diff --git a/.eslintrc.js b/.eslintrc.js index e2193c64..4bb0fadb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -15,7 +15,6 @@ module.exports = { }, plugins: [ "@typescript-eslint", - "@typescript-eslint/tslint", "import", "jsdoc", "prefer-arrow", @@ -27,17 +26,21 @@ module.exports = { "@typescript-eslint/no-namespace": "off", "@typescript-eslint/explicit-module-boundary-types": "off", "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-unsafe-argument": "off", "@typescript-eslint/no-unsafe-call": "off", "@typescript-eslint/no-unsafe-member-access": "off", "@typescript-eslint/no-unsafe-return": "off", "@typescript-eslint/restrict-plus-operands": "off", "@typescript-eslint/no-non-null-assertion": "off", "@typescript-eslint/restrict-template-expressions": "off", + "@typescript-eslint/no-base-to-string": "off", "@typescript-eslint/ban-types": "off", "@typescript-eslint/unbound-method": "off", "@typescript-eslint/no-this-alias": "off", "@typescript-eslint/no-inferrable-types": "off", "@typescript-eslint/no-unnecessary-type-assertion": "off", + "@typescript-eslint/no-redundant-type-constituents": "off", + "@typescript-eslint/no-unsafe-enum-comparison": "off", "prefer-const": "off", "prefer-spread": "off", "prefer-rest-params": "off", diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 9e23b5f5..825068bf 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -17,9 +17,9 @@ jobs: run: npm install - name: Install codecov run: npm install codecov - - name: Lint - run: npm run lint - name: Build run: npm run build - name: tests run: npm run test + - name: Lint + run: npm run lint \ No newline at end of file diff --git a/.gitignore b/.gitignore index 78325d98..2a8917a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,11 @@ /engine/ /compiler/ dist/ +bin/ test/stories/ /tests/specs/ +/ink.js +/ink.js.map # Logs logs diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 00000000..c4be887b --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "trailingComma": "es5" +} \ No newline at end of file diff --git a/README.md b/README.md index c894b317..9be1d448 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,18 @@ You can find some boilerplate code for node.js [here](https://github.com/y-lohse ### Loading inkjs -Require the module: `var Story = require('inkjs').Story;`. +#### require + +You can require the module: +```javascript +var Story = require('inkjs').Story; +``` + +#### import +You can use import style: +```javascript +import { Story } from 'inkjs'; +` ### Loading a json file @@ -135,27 +146,6 @@ var result = EvaluateFunction('my_ink_function', ['arg1', 'arg2'], true); // result.output is the text that was written to the output while the function was evaluated ``` -## Using TypeScript - -As this library is a port from C#, it requires a less standard way to assign the `Story` class, including all other classes, to a variable: - -```ts -import { Story } from 'inkjs'; -import { Compiler } from 'inkjs/full'; // Compiler is not provided in the default inkjs package - -let story: InstanceType; -let compiler: InstanceType; -``` - -Further, to minimize the verbose assignment, you can also create aliases in your project: - -```ts -import { Story, Compiler } from 'inkjs/full'; // Story is also provided in the "full" subpackage. - -export type InkStory = InstanceType; -export type InkCompiler= InstanceType; -``` - ## Compiler ### inkjs-compiler.js @@ -163,17 +153,21 @@ export type InkCompiler= InstanceType; ```shell $ node inkjs-compiler.js -h -Usage: inkjs-compiler +Usage: inkjs-compiler -o : Output file name -c: Count all visits to knots, stitches and weave points, not just those referenced by TURNS_SINCE and read counts. - -p: Play mode + -p: Play mode (automatic if a json file is passed as argument) ``` +If you install the package globally it is available as the `inkjs-compiler` command. +Alternatively, you can call it using `npx inkjs` + ### online compiler ```javascript +const inkjs = require("inkjs/full") //the `full` submodule contains the Compiler const story = new inkjs.Compiler(`Hello World`).Compile(); // story is an inkjs.Story that can be played right away @@ -187,6 +181,28 @@ You can use this in combination with [Webpack and TypeScript](docs/working-with- See [Differences with the C# Compiler](docs/compiler-differences.md). +## Using TypeScript + +Inkjs is also packaged to be usable with typescript imports, the main classes (`Story`, `InkList`, `Compiler`) are available under the `/types`submodule. + +```ts +import { Story, Compiler } from 'inkjs/types'; // shortcut + +let story: Story; +let compiler: Compiler; +``` + +It is also possible to import deeply nested classes if needed + +```ts +import { Story } from 'inkjs/engine/Story'; +import { Compiler } from 'inkjs/compiler/Compiler'; + +import { Choice } from 'inkjs/engine/Choice' +import { Identifier } from 'inkjs/compiler/Parser/ParsedHierarchy/Identifier'; + +``` + ## Compatibility table | _inklecate_ version | _inkjs_ version | _json_ version | @@ -207,4 +223,4 @@ See [Differences with the C# Compiler](docs/compiler-differences.md). | 0.8.3 | 1.10.0 – 1.10.5 | | | 0.9.0 | 1.11.0 | 19 | | 1.0.0 | 2.0.0 - 2.1.0 | 20 | -| 1.1.1 | 2.2.0 | 21 | +| 1.1.1 | 2.2.* | 21 | diff --git a/docs/compiler-differences.md b/docs/compiler-differences.md index 448f357d..d4be7e5a 100644 --- a/docs/compiler-differences.md +++ b/docs/compiler-differences.md @@ -16,7 +16,7 @@ Inkjs provides 2 file handlers : * A POSIX file handler : delivered as a separate `inkjs-full-posixhandler.js` file that must be included/required : similar to the one used in the C# compiler that will look for files in folders. Example when installing the package from npm : ```javascript -var Inkjs = require('inkjs'); +var inkjs = require('inkjs/full'); var { PosixFileHandler } = require('inkjs/compiler/FileHandler/PosixFileHandler'); const inkFile = fs.readFileSync(`${PATH_TO_STORY_FOLDER}/main.ink`, 'UTF-8').replace(/^\uFEFF/, ''); @@ -24,7 +24,7 @@ const fileHandler = new PosixFileHandler(`${PATH_TO_STORY_FOLDER}/`); const errorHandler = (message, errorType) => { console.log(message + "\n"); } -const story = new Inkjs.Compiler(inkFile, {fileHandler, errorHandler}).Compile(); +const story = new inkjs.Compiler(inkFile, {fileHandler, errorHandler}).Compile(); //story.Continue() ``` diff --git a/docs/working-with-typescript-and-webpack.md b/docs/working-with-typescript-and-webpack.md index 48fc3bed..60371a09 100644 --- a/docs/working-with-typescript-and-webpack.md +++ b/docs/working-with-typescript-and-webpack.md @@ -22,11 +22,11 @@ rules: [ We can then `import` (or `require`) the ink file and compile it. -```typescript -import * as Inkjs from 'inkjs'; +```javascript +import { Compiler } from 'inkjs/full'; import data from '../assets/myStory.ink'; -const inkStory = new Inkjs.Compiler(data).Compile(); +const inkStory = new Compiler(data).Compile(); ``` If you are working in JavaScript, then that is all you need. diff --git a/ink.d.mts b/ink.d.mts index b36779f2..de483b1e 100644 --- a/ink.d.mts +++ b/ink.d.mts @@ -1,41 +1,4 @@ -import { Story, InkList } from './engine/Story' -import { Compiler } from './compiler/Compiler' -import { CompilerOptions } from './compiler/CompilerOptions' -import { PosixFileHandler } from './compiler/FileHandler/PosixFileHandler' -import { JsonFileHandler } from './compiler/FileHandler/JsonFileHandler' - -declare interface Inkjs { - /** - * A Story is the core class that represents a complete Ink narrative, and - * manages runtime evaluation and state. - */ - Story: typeof Story - - /** - * The underlying type for a list item in Ink. - */ - InkList: typeof InkList - - /** - * Compiles Ink stories from source. - */ - Compiler: typeof Compiler - - /** - * Metadata options for a compiler pass. - */ - CompilerOptions: typeof CompilerOptions - - /** - * Resolves and loads Ink sources from a POSIX filesystem. - */ - PosixFileHandler: typeof PosixFileHandler - - /** - * Resolves and loads Ink sources from a JSON hierarchy. - */ - JsonFileHandler: typeof JsonFileHandler -} - -declare let inkjs: Inkjs -export default inkjs +export { Story, InkList } from "./engine/Story"; +export { Compiler, CompilerOptions } from "./compiler/Compiler"; +export { PosixFileHandler } from "./compiler/FileHandler/PosixFileHandler"; +export { JsonFileHandler } from "./compiler/FileHandler/JsonFileHandler"; diff --git a/ink.d.ts b/ink.d.ts index b36779f2..de483b1e 100644 --- a/ink.d.ts +++ b/ink.d.ts @@ -1,41 +1,4 @@ -import { Story, InkList } from './engine/Story' -import { Compiler } from './compiler/Compiler' -import { CompilerOptions } from './compiler/CompilerOptions' -import { PosixFileHandler } from './compiler/FileHandler/PosixFileHandler' -import { JsonFileHandler } from './compiler/FileHandler/JsonFileHandler' - -declare interface Inkjs { - /** - * A Story is the core class that represents a complete Ink narrative, and - * manages runtime evaluation and state. - */ - Story: typeof Story - - /** - * The underlying type for a list item in Ink. - */ - InkList: typeof InkList - - /** - * Compiles Ink stories from source. - */ - Compiler: typeof Compiler - - /** - * Metadata options for a compiler pass. - */ - CompilerOptions: typeof CompilerOptions - - /** - * Resolves and loads Ink sources from a POSIX filesystem. - */ - PosixFileHandler: typeof PosixFileHandler - - /** - * Resolves and loads Ink sources from a JSON hierarchy. - */ - JsonFileHandler: typeof JsonFileHandler -} - -declare let inkjs: Inkjs -export default inkjs +export { Story, InkList } from "./engine/Story"; +export { Compiler, CompilerOptions } from "./compiler/Compiler"; +export { PosixFileHandler } from "./compiler/FileHandler/PosixFileHandler"; +export { JsonFileHandler } from "./compiler/FileHandler/JsonFileHandler"; diff --git a/package-lock.json b/package-lock.json index 2fb0568a..c5cca7f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,66 +1,61 @@ { "name": "inkjs", - "version": "2.2.4", + "version": "2.2.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "inkjs", - "version": "2.2.4", + "version": "2.2.5", "license": "MIT", "devDependencies": { "@babel/core": "7.25.2", "@babel/preset-env": "7.25.3", "@rollup/plugin-babel": "6.0.4", - "@rollup/plugin-node-resolve": "13.3.0", - "@types/jest": "26.0.24", - "@types/node": "^20.2.6", - "@typescript-eslint/eslint-plugin": "4.33.0", - "@typescript-eslint/eslint-plugin-tslint": "4.33.0", - "@typescript-eslint/parser": "4.33.0", - "eslint": "7.32.0", - "eslint-config-prettier": "8.8.0", - "eslint-plugin-import": "2.27.5", - "eslint-plugin-jsdoc": "30.7.13", + "@rollup/plugin-node-resolve": "15.2.3", + "@rollup/plugin-terser": "0.4.4", + "@types/jest": "29.5.12", + "@types/node": "^20.12.5", + "@typescript-eslint/eslint-plugin": "7.5.0", + "@typescript-eslint/parser": "7.5.0", + "eslint": "^8.56.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-import": "2.29.1", + "eslint-plugin-jsdoc": "48.2.3", "eslint-plugin-prefer-arrow": "1.2.3", - "eslint-plugin-prettier": "3.4.1", - "fs-extra": "9.1.0", - "glob": "7.2.3", - "jest": "26.6.3", - "jest-diff": "27.5.1", - "prettier": "2.8.8", + "eslint-plugin-prettier": "5.1.3", + "fs-extra": "11.2.0", + "glob": "10.3.12", + "jest": "29.7.0", + "jest-diff": "29.7.0", + "prettier": "3.2.5", "remap-istanbul": "0.13.0", - "rollup": "2.79.1", + "rollup": "4.14.0", "rollup-plugin-sourcemaps": "0.6.3", - "rollup-plugin-terser": "7.0.2", - "rollup-plugin-typescript2": "0.34.1", - "ts-jest": "26.5.6", - "ts-node": "^10.9.1", - "tslint": "6.1.3", - "typescript": "4.9.5" + "rollup-plugin-typescript2": "0.36.0", + "ts-jest": "29.1.2", + "ts-node": "^10.9.2", + "tslib": "^2.6.3", + "typescript": "5.4.4" } }, - "node_modules/@ampproject/remapping": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", - "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", "dev": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.1.0", - "@jridgewell/trace-mapping": "^0.3.9" - }, "engines": { - "node": ">=6.0.0" + "node": ">=0.10.0" } }, - "node_modules/@ampproject/remapping/node_modules/@jridgewell/gen-mapping": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", - "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.0", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" @@ -118,12 +113,6 @@ "url": "https://opencollective.com/babel" } }, - "node_modules/@babel/core/node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true - }, "node_modules/@babel/generator": { "version": "7.25.0", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.0.tgz", @@ -180,21 +169,6 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "dependencies": { - "yallist": "^3.0.2" - } - }, - "node_modules/@babel/helper-compilation-targets/node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - }, "node_modules/@babel/helper-create-class-features-plugin": { "version": "7.24.7", "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.7.tgz", @@ -717,6 +691,21 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.1.tgz", + "integrity": "sha512-2eCtxZXf+kbkMIsXS4poTvT4Yu5rXiRa+9xGVT56raghjmBTKMpFNc9R4IDiB4emao9eO22Ox7CxuJG7BgExqA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/plugin-syntax-logical-assignment-operators": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", @@ -819,6 +808,21 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.24.1.tgz", + "integrity": "sha512-Yhnmvy5HZEnHUty6i++gcfH1/l68AHnItFHnaCv6hn9dNh0hQvvQJsxpi4BMBFN5DLeHBuucT/0DgzXif/OyRw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/plugin-syntax-unicode-sets-regex": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz", @@ -1738,9 +1742,9 @@ "dev": true }, "node_modules/@babel/runtime": { - "version": "7.22.11", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.11.tgz", - "integrity": "sha512-ee7jVNlWN09+KftVOu9n7S8gQzD/Z6hN/I8VBRXW4P1+Xe7kJGXMwu8vds4aGIMHZnNbdpSWCfZZtinytpcAvA==", + "version": "7.24.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.4.tgz", + "integrity": "sha512-dkxf7+hn8mFBwKjs9bvBlArzLVxVbS8usaPUDd5p2a9JCL9tB8OaOVN1isD4+Xyk4ns89/xeOmbQvgdK7IIVdA==", "dev": true, "dependencies": { "regenerator-runtime": "^0.14.0" @@ -1801,22 +1805,6 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, - "node_modules/@cnakazawa/watch": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", - "integrity": "sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ==", - "dev": true, - "dependencies": { - "exec-sh": "^0.3.2", - "minimist": "^1.2.0" - }, - "bin": { - "watch": "cli.js" - }, - "engines": { - "node": ">=0.1.95" - } - }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -1839,30 +1827,81 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@es-joy/jsdoccomment": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.42.0.tgz", + "integrity": "sha512-R1w57YlVA6+YE01wch3GPYn6bCsrOV3YW/5oGGE2tmX6JcL9Nr+b5IikrjMPF+v9CV3ay+obImEdsDhovhJrzw==", + "dev": true, + "dependencies": { + "comment-parser": "1.4.1", + "esquery": "^1.5.0", + "jsdoc-type-pratt-parser": "~4.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, "node_modules/@eslint/eslintrc": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", - "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "dependencies": { "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.11.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.11.0.tgz", - "integrity": "sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g==", + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -1874,6 +1913,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@eslint/eslintrc/node_modules/type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", @@ -1886,26 +1937,132 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^1.2.0", - "debug": "^4.1.1", - "minimatch": "^3.0.4" + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" }, "engines": { "node": ">=10.10.0" } }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz", - "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", "dev": true }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "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", @@ -1922,6 +2079,28 @@ "node": ">=8" } }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -1935,6 +2114,19 @@ "node": ">=8" } }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -1974,24 +2166,6 @@ "node": ">=8" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -2011,20 +2185,20 @@ } }, "node_modules/@jest/console": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-26.6.2.tgz", - "integrity": "sha512-IY1R2i2aLsLr7Id3S6p2BA82GNWryt4oSvEXLAKc+L2zdi89dSkE8xC1C+0kpATG4JhBJREnQOH7/zmccM2B0g==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", "dev": true, "dependencies": { - "@jest/types": "^26.6.2", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", - "jest-message-util": "^26.6.2", - "jest-util": "^26.6.2", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", "slash": "^3.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/console/node_modules/ansi-styles": { @@ -2043,9 +2217,9 @@ } }, "node_modules/@jest/console/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", @@ -2098,42 +2272,50 @@ } }, "node_modules/@jest/core": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-26.6.3.tgz", - "integrity": "sha512-xvV1kKbhfUqFVuZ8Cyo+JPpipAHHAV3kcDBftiduK8EICXmTFddryy3P7NfZt8Pv37rA9nEJBKCCkglCPt/Xjw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", "dev": true, "dependencies": { - "@jest/console": "^26.6.2", - "@jest/reporters": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", + "ci-info": "^3.2.0", "exit": "^0.1.2", - "graceful-fs": "^4.2.4", - "jest-changed-files": "^26.6.2", - "jest-config": "^26.6.3", - "jest-haste-map": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.2", - "jest-resolve-dependencies": "^26.6.3", - "jest-runner": "^26.6.3", - "jest-runtime": "^26.6.3", - "jest-snapshot": "^26.6.2", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "jest-watcher": "^26.6.2", - "micromatch": "^4.0.2", - "p-each-series": "^2.1.0", - "rimraf": "^3.0.0", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "strip-ansi": "^6.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } } }, "node_modules/@jest/core/node_modules/ansi-styles": { @@ -2152,9 +2334,9 @@ } }, "node_modules/@jest/core/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", @@ -2207,87 +2389,118 @@ } }, "node_modules/@jest/environment": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-26.6.2.tgz", - "integrity": "sha512-nFy+fHl28zUrRsCeMB61VDThV1pVTtlEokBRgqPrcT1JNq4yRNIyTHfyht6PqtUvY9IsuLGTrbG8kPXjSZIZwA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", "dev": true, "dependencies": { - "@jest/fake-timers": "^26.6.2", - "@jest/types": "^26.6.2", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", - "jest-mock": "^26.6.2" + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "dev": true, + "dependencies": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "dev": true, + "dependencies": { + "jest-get-type": "^29.6.3" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/fake-timers": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-26.6.2.tgz", - "integrity": "sha512-14Uleatt7jdzefLPYM3KLcnUl1ZNikaKq34enpb5XG9i81JpppDb5muZvonvKyrl7ftEHkKS5L5/eB/kxJ+bvA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", "dev": true, "dependencies": { - "@jest/types": "^26.6.2", - "@sinonjs/fake-timers": "^6.0.1", + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", "@types/node": "*", - "jest-message-util": "^26.6.2", - "jest-mock": "^26.6.2", - "jest-util": "^26.6.2" + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/globals": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.6.2.tgz", - "integrity": "sha512-85Ltnm7HlB/KesBUuALwQ68YTU72w9H2xW9FjZ1eL1U3lhtefjjl5c2MiUbpXt/i6LaPRvoOFJ22yCBSfQ0JIA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", "dev": true, "dependencies": { - "@jest/environment": "^26.6.2", - "@jest/types": "^26.6.2", - "expect": "^26.6.2" + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/reporters": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-26.6.2.tgz", - "integrity": "sha512-h2bW53APG4HvkOnVMo8q3QXa6pcaNt1HkwVsOPMBV6LD/q9oSpxNSYZQYkAnjdMjrJ86UuYeLo+aEZClV6opnw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", "dev": true, "dependencies": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", "chalk": "^4.0.0", "collect-v8-coverage": "^1.0.0", "exit": "^0.1.2", - "glob": "^7.1.2", - "graceful-fs": "^4.2.4", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^4.0.3", + "istanbul-lib-instrument": "^6.0.0", "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.0.2", - "jest-haste-map": "^26.6.2", - "jest-resolve": "^26.6.2", - "jest-util": "^26.6.2", - "jest-worker": "^26.6.2", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", "slash": "^3.0.0", - "source-map": "^0.6.0", "string-length": "^4.0.1", - "terminal-link": "^2.0.0", - "v8-to-istanbul": "^7.0.0" + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, - "optionalDependencies": { - "node-notifier": "^8.0.0" + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } } }, "node_modules/@jest/reporters/node_modules/ansi-styles": { @@ -2305,10 +2518,20 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/@jest/reporters/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/@jest/reporters/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", @@ -2339,6 +2562,26 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/@jest/reporters/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@jest/reporters/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2348,13 +2591,16 @@ "node": ">=8" } }, - "node_modules/@jest/reporters/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "node_modules/@jest/reporters/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, "engines": { - "node": ">=0.10.0" + "node": "*" } }, "node_modules/@jest/reporters/node_modules/supports-color": { @@ -2369,84 +2615,86 @@ "node": ">=8" } }, - "node_modules/@jest/source-map": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-26.6.2.tgz", - "integrity": "sha512-YwYcCwAnNmOVsZ8mr3GfnzdXDAl4LaenZP5z+G0c8bzC9/dugL8zRmxZzdoTl4IaS3CryS1uWnROLPFmb6lVvA==", + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", "dev": true, "dependencies": { - "callsites": "^3.0.0", - "graceful-fs": "^4.2.4", - "source-map": "^0.6.0" + "@sinclair/typebox": "^0.27.8" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@jest/source-map/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "node_modules/@jest/source-map": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, "engines": { - "node": ">=0.10.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/test-result": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-26.6.2.tgz", - "integrity": "sha512-5O7H5c/7YlojphYNrK02LlDIV2GNPYisKwHm2QTKjNZeEzezCbwYs9swJySv2UfPMyZ0VdsmMv7jIlD/IKYQpQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", "dev": true, "dependencies": { - "@jest/console": "^26.6.2", - "@jest/types": "^26.6.2", + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/test-sequencer": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.6.3.tgz", - "integrity": "sha512-YHlVIjP5nfEyjlrSr8t/YdNfU/1XEt7c5b4OxcXCjyRhjzLYu/rO69/WHPuYcbCWkz8kAeZVZp2N2+IOLLEPGw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", "dev": true, "dependencies": { - "@jest/test-result": "^26.6.2", - "graceful-fs": "^4.2.4", - "jest-haste-map": "^26.6.2", - "jest-runner": "^26.6.3", - "jest-runtime": "^26.6.3" + "@jest/test-result": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/transform": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-26.6.2.tgz", - "integrity": "sha512-E9JjhUgNzvuQ+vVAL21vlyfy12gP0GhazGgJC4h6qUt1jSdUXGWJ1wfu/X7Sd8etSgxV4ovT1pb9v5D6QW4XgA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", "dev": true, "dependencies": { - "@babel/core": "^7.1.0", - "@jest/types": "^26.6.2", - "babel-plugin-istanbul": "^6.0.0", + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", "chalk": "^4.0.0", - "convert-source-map": "^1.4.0", - "fast-json-stable-stringify": "^2.0.0", - "graceful-fs": "^4.2.4", - "jest-haste-map": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-util": "^26.6.2", - "micromatch": "^4.0.2", - "pirates": "^4.0.1", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", "slash": "^3.0.0", - "source-map": "^0.6.1", - "write-file-atomic": "^3.0.0" + "write-file-atomic": "^4.0.2" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/transform/node_modules/ansi-styles": { @@ -2465,9 +2713,9 @@ } }, "node_modules/@jest/transform/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", @@ -2507,15 +2755,6 @@ "node": ">=8" } }, - "node_modules/@jest/transform/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/@jest/transform/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -2529,19 +2768,20 @@ } }, "node_modules/@jest/types": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", - "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", "dev": true, "dependencies": { + "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", "@types/node": "*", - "@types/yargs": "^15.0.0", + "@types/yargs": "^17.0.8", "chalk": "^4.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/types/node_modules/ansi-styles": { @@ -2560,9 +2800,9 @@ } }, "node_modules/@jest/types/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", @@ -2629,9 +2869,9 @@ } }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, "engines": { "node": ">=6.0.0" @@ -2647,19 +2887,19 @@ } }, "node_modules/@jridgewell/source-map": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.3.tgz", - "integrity": "sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", "dev": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { @@ -2707,6 +2947,28 @@ "node": ">= 8" } }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@pkgr/core": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", + "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/@rollup/plugin-babel": { "version": "6.0.4", "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-6.0.4.tgz", @@ -2733,21 +2995,24 @@ } } }, - "node_modules/@rollup/plugin-babel/node_modules/@rollup/pluginutils": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.5.tgz", - "integrity": "sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q==", + "node_modules/@rollup/plugin-node-resolve": { + "version": "15.2.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.2.3.tgz", + "integrity": "sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==", "dev": true, "dependencies": { - "@types/estree": "^1.0.0", - "estree-walker": "^2.0.2", - "picomatch": "^2.3.1" + "@rollup/pluginutils": "^5.0.1", + "@types/resolve": "1.20.2", + "deepmerge": "^4.2.2", + "is-builtin-module": "^3.2.1", + "is-module": "^1.0.0", + "resolve": "^1.22.1" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + "rollup": "^2.78.0||^3.0.0||^4.0.0" }, "peerDependenciesMeta": { "rollup": { @@ -2755,132 +3020,319 @@ } } }, - "node_modules/@rollup/plugin-babel/node_modules/@types/estree": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.4.tgz", - "integrity": "sha512-2JwWnHK9H+wUZNorf2Zr6ves96WHoWDJIftkcxPKsS7Djta6Zu519LarhRNljPXkpsZR2ZMwNCPeW7omW07BJw==", - "dev": true - }, - "node_modules/@rollup/plugin-babel/node_modules/estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true - }, - "node_modules/@rollup/plugin-node-resolve": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.3.0.tgz", - "integrity": "sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==", + "node_modules/@rollup/plugin-terser": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.4.tgz", + "integrity": "sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==", "dev": true, "dependencies": { - "@rollup/pluginutils": "^3.1.0", - "@types/resolve": "1.17.1", - "deepmerge": "^4.2.2", - "is-builtin-module": "^3.1.0", - "is-module": "^1.0.0", - "resolve": "^1.19.0" + "serialize-javascript": "^6.0.1", + "smob": "^1.0.0", + "terser": "^5.17.4" }, "engines": { - "node": ">= 10.0.0" + "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^2.42.0" + "rollup": "^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } } }, "node_modules/@rollup/pluginutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", - "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", + "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", "dev": true, "dependencies": { - "@types/estree": "0.0.39", - "estree-walker": "^1.0.1", - "picomatch": "^2.2.2" + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^2.3.1" }, "engines": { - "node": ">= 8.0.0" + "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^1.20.0||^2.0.0" + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } } }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.14.0.tgz", + "integrity": "sha512-jwXtxYbRt1V+CdQSy6Z+uZti7JF5irRKF8hlKfEnF/xJpcNGuuiZMBvuoYM+x9sr9iWGnzrlM0+9hvQ1kgkf1w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.14.0.tgz", + "integrity": "sha512-fI9nduZhCccjzlsA/OuAwtFGWocxA4gqXGTLvOyiF8d+8o0fZUeSztixkYjcGq1fGZY3Tkq4yRvHPFxU+jdZ9Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.14.0.tgz", + "integrity": "sha512-BcnSPRM76/cD2gQC+rQNGBN6GStBs2pl/FpweW8JYuz5J/IEa0Fr4AtrPv766DB/6b2MZ/AfSIOSGw3nEIP8SA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.14.0.tgz", + "integrity": "sha512-LDyFB9GRolGN7XI6955aFeI3wCdCUszFWumWU0deHA8VpR3nWRrjG6GtGjBrQxQKFevnUTHKCfPR4IvrW3kCgQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.14.0.tgz", + "integrity": "sha512-ygrGVhQP47mRh0AAD0zl6QqCbNsf0eTo+vgwkY6LunBcg0f2Jv365GXlDUECIyoXp1kKwL5WW6rsO429DBY/bA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.14.0.tgz", + "integrity": "sha512-x+uJ6MAYRlHGe9wi4HQjxpaKHPM3d3JjqqCkeC5gpnnI6OWovLdXTpfa8trjxPLnWKyBsSi5kne+146GAxFt4A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.14.0.tgz", + "integrity": "sha512-nrRw8ZTQKg6+Lttwqo6a2VxR9tOroa2m91XbdQ2sUUzHoedXlsyvY1fN4xWdqz8PKmf4orDwejxXHjh7YBGUCA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.14.0.tgz", + "integrity": "sha512-xV0d5jDb4aFu84XKr+lcUJ9y3qpIWhttO3Qev97z8DKLXR62LC3cXT/bMZXrjLF9X+P5oSmJTzAhqwUbY96PnA==", + "cpu": [ + "ppc64le" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.14.0.tgz", + "integrity": "sha512-SDDhBQwZX6LPRoPYjAZWyL27LbcBo7WdBFWJi5PI9RPCzU8ijzkQn7tt8NXiXRiFMJCVpkuMkBf4OxSxVMizAw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.14.0.tgz", + "integrity": "sha512-RxB/qez8zIDshNJDufYlTT0ZTVut5eCpAZ3bdXDU9yTxBzui3KhbGjROK2OYTTor7alM7XBhssgoO3CZ0XD3qA==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.14.0.tgz", + "integrity": "sha512-C6y6z2eCNCfhZxT9u+jAM2Fup89ZjiG5pIzZIDycs1IwESviLxwkQcFRGLjnDrP+PT+v5i4YFvlcfAs+LnreXg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.14.0.tgz", + "integrity": "sha512-i0QwbHYfnOMYsBEyjxcwGu5SMIi9sImDVjDg087hpzXqhBSosxkE7gyIYFHgfFl4mr7RrXksIBZ4DoLoP4FhJg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.14.0.tgz", + "integrity": "sha512-Fq52EYb0riNHLBTAcL0cun+rRwyZ10S9vKzhGKKgeD+XbwunszSY0rVMco5KbOsTlwovP2rTOkiII/fQ4ih/zQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.14.0.tgz", + "integrity": "sha512-e/PBHxPdJ00O9p5Ui43+vixSgVf4NlLsmV6QneGERJ3lnjIua/kim6PRFe3iDueT1rQcgSkYP8ZBBXa/h4iPvw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.14.0.tgz", + "integrity": "sha512-aGg7iToJjdklmxlUlJh/PaPNa4PmqHfyRMLunbL3eaMO0gp656+q1zOKkpJ/CVe9CryJv6tAN1HDoR8cNGzkag==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, "node_modules/@sinonjs/commons": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", - "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", "dev": true, "dependencies": { "type-detect": "4.0.8" } }, "node_modules/@sinonjs/fake-timers": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", - "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", "dev": true, "dependencies": { - "@sinonjs/commons": "^1.7.0" - } - }, - "node_modules/@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", - "dev": true, - "engines": { - "node": ">= 6" + "@sinonjs/commons": "^3.0.0" } }, "node_modules/@tsconfig/node10": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", - "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", "dev": true }, "node_modules/@tsconfig/node12": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", - "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", "dev": true }, "node_modules/@tsconfig/node14": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", - "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", "dev": true }, "node_modules/@tsconfig/node16": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", - "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", "dev": true }, "node_modules/@types/babel__core": { - "version": "7.1.14", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.14.tgz", - "integrity": "sha512-zGZJzzBUVDo/eV6KgbE0f0ZI7dInEYvo12Rb70uNQDshC3SkRMb67ja0GgRHZgAX3Za6rhaWlvbDO8rrGyAb1g==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dev": true, "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0", + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", "@types/babel__generator": "*", "@types/babel__template": "*", "@types/babel__traverse": "*" } }, "node_modules/@types/babel__generator": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.2.tgz", - "integrity": "sha512-MdSJnBjl+bdwkLskZ3NGFp9YcXGx5ggLpQQPqtgakVhsWK0hTtNYhjpZLlWQTviGTvF8at+Bvli3jV7faPdgeQ==", + "version": "7.6.8", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", + "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", "dev": true, "dependencies": { "@babel/types": "^7.0.0" } }, "node_modules/@types/babel__template": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.0.tgz", - "integrity": "sha512-NTPErx4/FiPCGScH7foPyr+/1Dkzkni+rHiYHHoTjvwou7AQzJkNeD60A9CXRy+ZEN2B1bggmkTMCDb+Mv5k+A==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dev": true, "dependencies": { "@babel/parser": "^7.1.0", @@ -2888,167 +3340,73 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.14.0.tgz", - "integrity": "sha512-IilJZ1hJBUZwMOVDNTdflOOLzJB/ZtljYVa7k3gEZN/jqIJIPkWHC6dvbX+DD2CwZDHB9wAKzZPzzqMIkW37/w==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.5.tgz", + "integrity": "sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ==", "dev": true, "dependencies": { - "@babel/types": "^7.3.0" + "@babel/types": "^7.20.7" } }, "node_modules/@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, "node_modules/@types/graceful-fs": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", - "integrity": "sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==", + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", + "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", "dev": true, "dependencies": { "@types/node": "*" } }, "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", - "integrity": "sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", "dev": true }, "node_modules/@types/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", "dev": true, "dependencies": { "@types/istanbul-lib-coverage": "*" } }, "node_modules/@types/istanbul-reports": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", - "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", "dev": true, "dependencies": { "@types/istanbul-lib-report": "*" } }, "node_modules/@types/jest": { - "version": "26.0.24", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-26.0.24.tgz", - "integrity": "sha512-E/X5Vib8BWqZNRlDxj9vYXhsDwPYbPINqKF9BsnSoon4RQ0D9moEuLD8txgyypFLH7J4+Lho9Nr/c8H0Fi+17w==", - "dev": true, - "dependencies": { - "jest-diff": "^26.0.0", - "pretty-format": "^26.0.0" - } - }, - "node_modules/@types/jest/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@types/jest/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@types/jest/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@types/jest/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/@types/jest/node_modules/diff-sequences": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz", - "integrity": "sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==", - "dev": true, - "engines": { - "node": ">= 10.14.2" - } - }, - "node_modules/@types/jest/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@types/jest/node_modules/jest-diff": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.2.tgz", - "integrity": "sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==", - "dev": true, - "dependencies": { - "chalk": "^4.0.0", - "diff-sequences": "^26.6.2", - "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.2" - }, - "engines": { - "node": ">= 10.14.2" - } - }, - "node_modules/@types/jest/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" + "expect": "^29.0.0", + "pretty-format": "^29.0.0" } }, "node_modules/@types/json-schema": { - "version": "7.0.8", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.8.tgz", - "integrity": "sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg==", + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, "node_modules/@types/node": { @@ -3060,73 +3418,67 @@ "undici-types": "~5.26.4" } }, - "node_modules/@types/normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", + "node_modules/@types/resolve": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", + "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", "dev": true }, - "node_modules/@types/prettier": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.3.0.tgz", - "integrity": "sha512-hkc1DATxFLQo4VxPDpMH1gCkPpBbpOoJ/4nhuXw4n63/0R6bCpQECj4+K226UJ4JO/eJQz+1mC2I7JsWanAdQw==", + "node_modules/@types/semver": { + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", "dev": true }, - "node_modules/@types/resolve": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", - "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/stack-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.0.tgz", - "integrity": "sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", "dev": true }, "node_modules/@types/yargs": { - "version": "15.0.13", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.13.tgz", - "integrity": "sha512-kQ5JNTrbDv3Rp5X2n/iUu37IJBDU2gsZ5R/g1/KHOOEc5IKfUFjXT6DENPGduh08I/pamwtEq4oul7gUqKTQDQ==", + "version": "17.0.32", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", + "integrity": "sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==", "dev": true, "dependencies": { "@types/yargs-parser": "*" } }, "node_modules/@types/yargs-parser": { - "version": "20.2.0", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.0.tgz", - "integrity": "sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA==", + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz", - "integrity": "sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg==", - "dev": true, - "dependencies": { - "@typescript-eslint/experimental-utils": "4.33.0", - "@typescript-eslint/scope-manager": "4.33.0", - "debug": "^4.3.1", - "functional-red-black-tree": "^1.0.1", - "ignore": "^5.1.8", - "regexpp": "^3.1.0", - "semver": "^7.3.5", - "tsutils": "^3.21.0" + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.5.0.tgz", + "integrity": "sha512-HpqNTH8Du34nLxbKgVMGljZMG0rJd2O9ecvr2QLYp+7512ty1j42KnsFwspPXg1Vh8an9YImf6CokUBltisZFQ==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "7.5.0", + "@typescript-eslint/type-utils": "7.5.0", + "@typescript-eslint/utils": "7.5.0", + "@typescript-eslint/visitor-keys": "7.5.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^4.0.0", - "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -3134,37 +3486,22 @@ } } }, - "node_modules/@typescript-eslint/eslint-plugin-tslint": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin-tslint/-/eslint-plugin-tslint-4.33.0.tgz", - "integrity": "sha512-o3ujMErtZJPgiNRETRJefo1bFNrloocOa5dMU49OW/G+Rq92IbXTY6FSF5MOwrdQK1X+VBEcA8y6PhUPWGlYqA==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "dependencies": { - "@typescript-eslint/experimental-utils": "4.33.0", - "lodash": "^4.17.21" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" + "yallist": "^4.0.0" }, - "peerDependencies": { - "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0", - "tslint": "^5.0.0 || ^6.0.0", - "typescript": "*" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true, "engines": { - "node": ">= 4" + "node": ">=10" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", - "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -3176,68 +3513,71 @@ "node": ">=10" } }, - "node_modules/@typescript-eslint/experimental-utils": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz", - "integrity": "sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q==", + "node_modules/@typescript-eslint/parser": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.5.0.tgz", + "integrity": "sha512-cj+XGhNujfD2/wzR1tabNsidnYRaFfEkcULdcIyVBYcXjBvBKOes+mpMBP7hMpOyk+gBcfXsrg4NBGAStQyxjQ==", "dev": true, "dependencies": { - "@types/json-schema": "^7.0.7", - "@typescript-eslint/scope-manager": "4.33.0", - "@typescript-eslint/types": "4.33.0", - "@typescript-eslint/typescript-estree": "4.33.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" + "@typescript-eslint/scope-manager": "7.5.0", + "@typescript-eslint/types": "7.5.0", + "@typescript-eslint/typescript-estree": "7.5.0", + "@typescript-eslint/visitor-keys": "7.5.0", + "debug": "^4.3.4" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "*" + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "node_modules/@typescript-eslint/experimental-utils/node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "node_modules/@typescript-eslint/scope-manager": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.5.0.tgz", + "integrity": "sha512-Z1r7uJY0MDeUlql9XJ6kRVgk/sP11sr3HKXn268HZyqL7i4cEfrdFuSSY/0tUqT37l5zT0tJOsuDP16kio85iA==", "dev": true, "dependencies": { - "eslint-visitor-keys": "^2.0.0" + "@typescript-eslint/types": "7.5.0", + "@typescript-eslint/visitor-keys": "7.5.0" }, "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=5" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/parser": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.33.0.tgz", - "integrity": "sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==", + "node_modules/@typescript-eslint/type-utils": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.5.0.tgz", + "integrity": "sha512-A021Rj33+G8mx2Dqh0nMO9GyjjIBK3MqgVgZ2qlKf6CJy51wY/lkkFqq3TqqnH34XyAHUkq27IjlUkWlQRpLHw==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "4.33.0", - "@typescript-eslint/types": "4.33.0", - "@typescript-eslint/typescript-estree": "4.33.0", - "debug": "^4.3.1" + "@typescript-eslint/typescript-estree": "7.5.0", + "@typescript-eslint/utils": "7.5.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -3245,67 +3585,115 @@ } } }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz", - "integrity": "sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ==", + "node_modules/@typescript-eslint/types": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.5.0.tgz", + "integrity": "sha512-tv5B4IHeAdhR7uS4+bf8Ov3k793VEVHd45viRRkehIUZxm0WF82VPiLgHzA/Xl4TGPg1ZD49vfxBKFPecD5/mg==", "dev": true, - "dependencies": { - "@typescript-eslint/types": "4.33.0", - "@typescript-eslint/visitor-keys": "4.33.0" - }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/types": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz", - "integrity": "sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==", + "node_modules/@typescript-eslint/typescript-estree": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.5.0.tgz", + "integrity": "sha512-YklQQfe0Rv2PZEueLTUffiQGKQneiIEKKnfIqPIOxgM9lKSZFCjT5Ad4VqRKj/U4+kQE3fa8YQpskViL7WjdPQ==", "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.5.0", + "@typescript-eslint/visitor-keys": "7.5.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz", - "integrity": "sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==", + "node_modules/@typescript-eslint/typescript-estree/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "4.33.0", - "@typescript-eslint/visitor-keys": "4.33.0", - "debug": "^4.3.1", - "globby": "^11.0.3", - "is-glob": "^4.0.1", - "semver": "^7.3.5", - "tsutils": "^3.21.0" + "yallist": "^4.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.5.0.tgz", + "integrity": "sha512-3vZl9u0R+/FLQcpy2EHyRGNqAS/ofJ3Ji8aebilfJe+fobK8+LbIFmrHciLVDxjDoONmufDcnVSF38KwMEOjzw==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "7.5.0", + "@typescript-eslint/types": "7.5.0", + "@typescript-eslint/typescript-estree": "7.5.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "eslint": "^8.56.0" } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "node_modules/@typescript-eslint/utils/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -3318,38 +3706,38 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz", - "integrity": "sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.5.0.tgz", + "integrity": "sha512-mcuHM/QircmA6O7fy6nn2w/3ditQkj+SgtOc8DW3uQ10Yfj42amm2i+6F2K4YAOPNNTmE6iM1ynM6lrSwdendA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "4.33.0", - "eslint-visitor-keys": "^2.0.0" + "@typescript-eslint/types": "7.5.0", + "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/abab": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", - "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", "dev": true }, "node_modules/abbrev": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", - "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "integrity": "sha512-LEyx4aLEC3x6T0UguF6YILf+ntvmOaWsVfENmIW0E9H09vKlLDGelMjjSm0jkDHALj8A8quZ/HapKNigzwge+Q==", "dev": true }, "node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -3358,16 +3746,6 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-globals": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", - "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", - "dev": true, - "dependencies": { - "acorn": "^7.1.1", - "acorn-walk": "^7.1.1" - } - }, "node_modules/acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", @@ -3378,26 +3756,14 @@ } }, "node_modules/acorn-walk": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", - "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", "dev": true, "engines": { "node": ">=0.4.0" } }, - "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dev": true, - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -3417,7 +3783,7 @@ "node_modules/amdefine": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "integrity": "sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==", "dev": true, "optional": true, "engines": { @@ -3425,12 +3791,15 @@ } }, "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", + "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", "dev": true, + "dependencies": { + "ansi-wrap": "^0.1.0" + }, "engines": { - "node": ">=6" + "node": ">=0.10.0" } }, "node_modules/ansi-escapes": { @@ -3472,16 +3841,16 @@ "node_modules/ansi-wrap": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", - "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", + "integrity": "sha512-ZyznvL8k/FZeQHr2T6LzcJ/+vBApDnMNZvfVFy3At0knswWd6rJ3/0Hhmpu8oqa6C92npmozs890sX9Dl6q+Qw==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, "dependencies": { "normalize-path": "^3.0.0", @@ -3491,6 +3860,15 @@ "node": ">= 8" } }, + "node_modules/are-docs-informative": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", + "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", + "dev": true, + "engines": { + "node": ">=14" + } + }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -3498,27 +3876,15 @@ "dev": true }, "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "node_modules/arr-diff": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "integrity": "sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3527,35 +3893,39 @@ "node_modules/arr-union": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/array-buffer-byte-length": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", - "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "is-array-buffer": "^3.0.1" + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/array-includes": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", - "integrity": "sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", - "get-intrinsic": "^1.1.3", + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", "is-string": "^1.0.7" }, "engines": { @@ -3574,24 +3944,35 @@ "node": ">=8" } }, - "node_modules/array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "node_modules/array.prototype.findlastindex": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", + "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/array.prototype.flat": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", - "integrity": "sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", + "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", "es-shim-unscopables": "^1.0.0" }, "engines": { @@ -3602,14 +3983,14 @@ } }, "node_modules/array.prototype.flatmap": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", - "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", + "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", "es-shim-unscopables": "^1.0.0" }, "engines": { @@ -3619,45 +4000,43 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "node_modules/assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==", "dev": true, "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, "node_modules/async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "integrity": "sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==", "dev": true }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "node_modules/at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", - "dev": true, - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/atob": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", @@ -3671,10 +4050,13 @@ } }, "node_modules/available-typed-arrays": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", "dev": true, + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -3683,25 +4065,24 @@ } }, "node_modules/babel-jest": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-26.6.3.tgz", - "integrity": "sha512-pl4Q+GAVOHwvjrck6jKjvmGhnO3jHX/xuB9d27f+EJZ/6k+6nMuPjorrYp7s++bKKdANwzElBWnLWaObvTnaZA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", "dev": true, "dependencies": { - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/babel__core": "^7.1.7", - "babel-plugin-istanbul": "^6.0.0", - "babel-preset-jest": "^26.6.2", + "@jest/transform": "^29.7.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", + "graceful-fs": "^4.2.9", "slash": "^3.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, "peerDependencies": { - "@babel/core": "^7.0.0" + "@babel/core": "^7.8.0" } }, "node_modules/babel-jest/node_modules/ansi-styles": { @@ -3720,9 +4101,9 @@ } }, "node_modules/babel-jest/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", @@ -3775,34 +4156,50 @@ } }, "node_modules/babel-plugin-istanbul": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0.tgz", - "integrity": "sha512-AF55rZXpe7trmEylbaE1Gv54wn6rwU03aptvRoVIGP8YykoSxqdVLV1TfwflBCE/QtHmqtP8SWlTENqbK8GCSQ==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", "@istanbuljs/load-nyc-config": "^1.0.0", "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-instrument": "^5.0.4", "test-exclude": "^6.0.0" }, "engines": { "node": ">=8" } }, + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "dev": true, + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/babel-plugin-jest-hoist": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.6.2.tgz", - "integrity": "sha512-PO9t0697lNTmcEHH69mdtYiOIkkOlj9fySqfO3K1eCcdISevLAE0xY59VLLUj0SoiPiTX/JU2CYFpILydUa5Lw==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", "dev": true, "dependencies": { "@babel/template": "^7.3.3", "@babel/types": "^7.3.3", - "@types/babel__core": "^7.0.0", + "@types/babel__core": "^7.1.14", "@types/babel__traverse": "^7.0.6" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/babel-plugin-polyfill-corejs2": { @@ -3868,16 +4265,16 @@ } }, "node_modules/babel-preset-jest": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-26.6.2.tgz", - "integrity": "sha512-YvdtlVm9t3k777c5NPQIv6cxFFFapys25HiUmuSgHwIZhfifweR5c5Sf5nwE3MAbfu327CYSvps8Yx6ANLyleQ==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", "dev": true, "dependencies": { - "babel-plugin-jest-hoist": "^26.6.2", + "babel-plugin-jest-hoist": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, "peerDependencies": { "@babel/core": "^7.0.0" @@ -3889,44 +4286,13 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "node_modules/base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "dependencies": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/base/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/braces": { @@ -3941,12 +4307,6 @@ "node": ">=8" } }, - "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==", - "dev": true - }, "node_modules/browserslist": { "version": "4.23.2", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.2.tgz", @@ -4001,48 +4361,37 @@ } }, "node_modules/buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, "node_modules/builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", "dev": true, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "dependencies": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" + "node": ">=6" }, - "engines": { - "node": ">=0.10.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -4086,18 +4435,6 @@ } ] }, - "node_modules/capture-exit": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", - "integrity": "sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g==", - "dev": true, - "dependencies": { - "rsvp": "^4.8.4" - }, - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, "node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -4122,130 +4459,94 @@ } }, "node_modules/ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } }, "node_modules/cjs-module-lexer": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz", - "integrity": "sha512-uc2Vix1frTfnuzxxu1Hp4ktSvM3QaI4oXl4ZUqL1wjTu/BGki9TrCWoqLTg/drR1KwAEarXuRFCG2Svr1GxPFw==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", + "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", "dev": true }, - "node_modules/class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "dependencies": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=12" } }, - "node_modules/class-utils/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "node_modules/cliui/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "is-descriptor": "^0.1.0" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/class-utils/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" + "node": ">=8" }, - "engines": { - "node": ">=0.10.0" + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/class-utils/node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "node_modules/cliui/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "is-buffer": "^1.1.5" + "color-name": "~1.1.4" }, "engines": { - "node": ">=0.10.0" + "node": ">=7.0.0" } }, - "node_modules/class-utils/node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } + "node_modules/cliui/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, - "node_modules/class-utils/node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "dependencies": { - "is-buffer": "^1.1.5" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/class-utils/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" + "node": ">=10" }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/class-utils/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", "dev": true, "engines": { "iojs": ">= 1.0.0", @@ -4253,24 +4554,11 @@ } }, "node_modules/collect-v8-coverage": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", - "integrity": "sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", "dev": true }, - "node_modules/collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "dependencies": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -4283,21 +4571,9 @@ "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", @@ -4305,49 +4581,31 @@ "dev": true }, "node_modules/comment-parser": { - "version": "0.7.6", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-0.7.6.tgz", - "integrity": "sha512-GKNxVA7/iuTnAqGADlTWX4tkhzxZKXp5fLJqKTlQLHkE65XDUKutZ3BHaJC5IGcper2tT3QRD1xr4o3jNpgXXg==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", + "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", "dev": true, "engines": { - "node": ">= 6.0.0" + "node": ">= 12.0.0" } }, "node_modules/commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "node_modules/component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", "dev": true }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, "node_modules/convert-source-map": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", - "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.1" - } - }, - "node_modules/copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true }, "node_modules/core-js-compat": { "version": "3.37.1", @@ -4362,68 +4620,172 @@ "url": "https://opencollective.com/core-js" } }, - "node_modules/create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "node_modules/create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", "dev": true, "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "bin": { + "create-jest": "bin/create-jest.js" }, "engines": { - "node": ">= 8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/cssom": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", - "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", - "dev": true - }, - "node_modules/cssstyle": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", - "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "node_modules/create-jest/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "cssom": "~0.3.6" + "color-convert": "^2.0.1" }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/cssstyle/node_modules/cssom": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", - "dev": true - }, - "node_modules/data-urls": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", - "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==", - "dev": true, + "node_modules/create-jest/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "dependencies": { - "abab": "^2.0.3", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^8.0.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/create-jest/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/create-jest/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/create-jest/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/create-jest/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -4437,21 +4799,6 @@ } } }, - "node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/decimal.js": { - "version": "10.3.1", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", - "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==", - "dev": true - }, "node_modules/decode-uri-component": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", @@ -4461,29 +4808,44 @@ "node": ">=0.10" } }, + "node_modules/dedent": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", + "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", + "dev": true, + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, "node_modules/deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, "node_modules/deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "dev": true, "engines": { "node": ">=0.10.0" } }, - "node_modules/define-properties": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", - "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dev": true, "dependencies": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -4492,26 +4854,21 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, "dependencies": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true, - "engines": { - "node": ">=0.4.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/detect-newline": { @@ -4533,12 +4890,12 @@ } }, "node_modules/diff-sequences": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.5.1.tgz", - "integrity": "sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/dir-glob": { @@ -4565,26 +4922,11 @@ "node": ">=6.0.0" } }, - "node_modules/domexception": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", - "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", - "dev": true, - "dependencies": { - "webidl-conversions": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/domexception/node_modules/webidl-conversions": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", - "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", - "dev": true, - "engines": { - "node": ">=8" - } + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true }, "node_modules/electron-to-chromium": { "version": "1.5.4", @@ -4593,44 +4935,23 @@ "dev": true }, "node_modules/emittery": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz", - "integrity": "sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ==", + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", "dev": true, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/sindresorhus/emittery?sponsor=1" } }, "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, - "node_modules/end-of-stream": { - "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" - } - }, - "node_modules/enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "dependencies": { - "ansi-colors": "^4.1.1" - }, - "engines": { - "node": ">=8.6" - } - }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -4641,45 +4962,57 @@ } }, "node_modules/es-abstract": { - "version": "1.21.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.2.tgz", - "integrity": "sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==", - "dev": true, - "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "es-set-tostringtag": "^2.0.1", + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.2.0", - "get-symbol-description": "^1.0.0", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", "globalthis": "^1.0.3", "gopd": "^1.0.1", - "has": "^1.0.3", - "has-property-descriptors": "^1.0.0", - "has-proto": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", "has-symbols": "^1.0.3", - "internal-slot": "^1.0.5", - "is-array-buffer": "^3.0.2", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", "is-callable": "^1.2.7", - "is-negative-zero": "^2.0.2", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", + "is-shared-array-buffer": "^1.0.3", "is-string": "^1.0.7", - "is-typed-array": "^1.1.10", + "is-typed-array": "^1.1.13", "is-weakref": "^1.0.2", - "object-inspect": "^1.12.3", + "object-inspect": "^1.13.1", "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.4.3", - "safe-regex-test": "^1.0.0", - "string.prototype.trim": "^1.2.7", - "string.prototype.trimend": "^1.0.6", - "string.prototype.trimstart": "^1.0.6", - "typed-array-length": "^1.0.4", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.9" + "which-typed-array": "^1.1.15" }, "engines": { "node": ">= 0.4" @@ -4688,27 +5021,60 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-set-tostringtag": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", - "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", "dev": true, "dependencies": { - "get-intrinsic": "^1.1.3", - "has": "^1.0.3", - "has-tostringtag": "^1.0.0" + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" }, "engines": { "node": ">= 0.4" } }, "node_modules/es-shim-unscopables": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", - "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", + "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", "dev": true, "dependencies": { - "has": "^1.0.3" + "hasown": "^2.0.0" } }, "node_modules/es-to-primitive": { @@ -4740,20 +5106,20 @@ "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "engines": { "node": ">=0.8.0" } }, "node_modules/escodegen": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", - "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", + "integrity": "sha512-yhi5S+mNTOuRvyW4gWlg5W1byMaQGWWSYHXsuFZ7GBo7tpyOwi2EdzMP/QWxh9hwkD2m+wDVHJsxhRIj+v/b/A==", "dev": true, "dependencies": { - "esprima": "^4.0.1", - "estraverse": "^5.2.0", + "esprima": "^2.7.1", + "estraverse": "^1.9.1", "esutils": "^2.0.2", "optionator": "^0.8.1" }, @@ -4762,25 +5128,25 @@ "esgenerate": "bin/esgenerate.js" }, "engines": { - "node": ">=6.0" + "node": ">=0.12.0" }, "optionalDependencies": { - "source-map": "~0.6.1" + "source-map": "~0.2.0" } }, "node_modules/escodegen/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "integrity": "sha512-25w1fMXQrGdoquWnScXZGckOv+Wes+JDnuN/+7ex3SauFRS72r2lFDec0EKPt2YD1wUJ/IrfEex+9yp4hfSOJA==", "dev": true, "engines": { - "node": ">=4.0" + "node": ">=0.10.0" } }, "node_modules/escodegen/node_modules/levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", "dev": true, "dependencies": { "prelude-ls": "~1.1.2", @@ -4810,26 +5176,29 @@ "node_modules/escodegen/node_modules/prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", "dev": true, "engines": { "node": ">= 0.8.0" } }, "node_modules/escodegen/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha512-CBdZ2oa/BHhS4xj5DlhjWNHcan57/5YuvfdLf17iVmIpd9KRm+DFLmC6nBNj+6Ua7Kt3TmOjDpQT1aTYOQtoUA==", "dev": true, "optional": true, + "dependencies": { + "amdefine": ">=0.0.4" + }, "engines": { - "node": ">=0.10.0" + "node": ">=0.8.0" } }, "node_modules/escodegen/node_modules/type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", "dev": true, "dependencies": { "prelude-ls": "~1.1.2" @@ -4839,66 +5208,64 @@ } }, "node_modules/eslint": { - "version": "7.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", - "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", - "ajv": "^6.10.0", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", - "debug": "^4.0.1", + "debug": "^4.3.2", "doctrine": "^3.0.0", - "enquirer": "^2.3.5", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-config-prettier": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz", - "integrity": "sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", "dev": true, "bin": { "eslint-config-prettier": "bin/cli.js" @@ -4908,14 +5275,14 @@ } }, "node_modules/eslint-import-resolver-node": { - "version": "0.3.7", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz", - "integrity": "sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==", + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", "dev": true, "dependencies": { "debug": "^3.2.7", - "is-core-module": "^2.11.0", - "resolve": "^1.22.1" + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" } }, "node_modules/eslint-import-resolver-node/node_modules/debug": { @@ -4928,9 +5295,9 @@ } }, "node_modules/eslint-module-utils": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", - "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.1.tgz", + "integrity": "sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==", "dev": true, "dependencies": { "debug": "^3.2.7" @@ -4954,26 +5321,28 @@ } }, "node_modules/eslint-plugin-import": { - "version": "2.27.5", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz", - "integrity": "sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==", + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", + "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==", "dev": true, "dependencies": { - "array-includes": "^3.1.6", - "array.prototype.flat": "^1.3.1", - "array.prototype.flatmap": "^1.3.1", + "array-includes": "^3.1.7", + "array.prototype.findlastindex": "^1.2.3", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", "debug": "^3.2.7", "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.7", - "eslint-module-utils": "^2.7.4", - "has": "^1.0.3", - "is-core-module": "^2.11.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.8.0", + "hasown": "^2.0.0", + "is-core-module": "^2.13.1", "is-glob": "^4.0.3", "minimatch": "^3.1.2", - "object.values": "^1.1.6", - "resolve": "^1.22.1", - "semver": "^6.3.0", - "tsconfig-paths": "^3.14.1" + "object.fromentries": "^2.0.7", + "object.groupby": "^1.0.1", + "object.values": "^1.1.7", + "semver": "^6.3.1", + "tsconfig-paths": "^3.15.0" }, "engines": { "node": ">=4" @@ -4982,6 +5351,16 @@ "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" } }, + "node_modules/eslint-plugin-import/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/eslint-plugin-import/node_modules/debug": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", @@ -5003,31 +5382,69 @@ "node": ">=0.10.0" } }, - "node_modules/eslint-plugin-jsdoc": { - "version": "30.7.13", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-30.7.13.tgz", - "integrity": "sha512-YM4WIsmurrp0rHX6XiXQppqKB8Ne5ATiZLJe2+/fkp9l9ExXFr43BbAbjZaVrpCT+tuPYOZ8k1MICARHnURUNQ==", + "node_modules/eslint-plugin-import/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { - "comment-parser": "^0.7.6", - "debug": "^4.3.1", - "jsdoctypeparser": "^9.0.0", - "lodash": "^4.17.20", - "regextras": "^0.7.1", - "semver": "^7.3.4", - "spdx-expression-parse": "^3.0.1" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=10" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0" + "node": "*" + } + }, + "node_modules/eslint-plugin-jsdoc": { + "version": "48.2.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.2.3.tgz", + "integrity": "sha512-r9DMAmFs66VNvNqRLLjHejdnJtILrt3xGi+Qx0op0oRfFGVpOR1Hb3BC++MacseHx93d8SKYPhyrC9BS7Os2QA==", + "dev": true, + "dependencies": { + "@es-joy/jsdoccomment": "~0.42.0", + "are-docs-informative": "^0.0.2", + "comment-parser": "1.4.1", + "debug": "^4.3.4", + "escape-string-regexp": "^4.0.0", + "esquery": "^1.5.0", + "is-builtin-module": "^3.2.1", + "semver": "^7.6.0", + "spdx-expression-parse": "^4.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" } }, "node_modules/eslint-plugin-jsdoc/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -5039,6 +5456,17 @@ "node": ">=10" } }, + "node_modules/eslint-plugin-jsdoc/node_modules/spdx-expression-parse": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", + "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, "node_modules/eslint-plugin-prefer-arrow": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/eslint-plugin-prefer-arrow/-/eslint-plugin-prefer-arrow-1.2.3.tgz", @@ -5049,79 +5477,61 @@ } }, "node_modules/eslint-plugin-prettier": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.1.tgz", - "integrity": "sha512-htg25EUYUeIhKHXjOinK4BgCcDwtLHjqaxCDsMy5nbnUMkKFvIhMVCp+5GFUXQ4Nr8lBsPqtGAqBenbpFqAA2g==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz", + "integrity": "sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==", "dev": true, "dependencies": { - "prettier-linter-helpers": "^1.0.0" + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.8.6" }, "engines": { - "node": ">=6.0.0" + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" }, "peerDependencies": { - "eslint": ">=5.0.0", - "prettier": ">=1.13.0" + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": "*", + "prettier": ">=3.0.0" }, "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, "eslint-config-prettier": { "optional": true } } }, "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" + "estraverse": "^5.2.0" }, "engines": { - "node": ">=6" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, "engines": { - "node": ">=10" - } - }, - "node_modules/eslint/node_modules/@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.10.4" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint/node_modules/ansi-styles": { @@ -5139,10 +5549,20 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/eslint/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", @@ -5186,9 +5606,9 @@ } }, "node_modules/eslint/node_modules/globals": { - "version": "13.9.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.9.0.tgz", - "integrity": "sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==", + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -5209,19 +5629,16 @@ "node": ">=8" } }, - "node_modules/eslint/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=10" + "node": "*" } }, "node_modules/eslint/node_modules/supports-color": { @@ -5249,45 +5666,39 @@ } }, "node_modules/espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "dependencies": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha512-OarPfz0lFCiW4/AV2Oy1Rp9qu0iusTKqykwTspGCZtPxmF81JR4MmIebvF1F9+UOKth2ZubLQ4XGGaU+hSn99A==", "dev": true, "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" }, "engines": { - "node": ">=4" + "node": ">=0.10.0" } }, "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "dependencies": { "estraverse": "^5.1.0" @@ -5296,15 +5707,6 @@ "node": ">=0.10" } }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", @@ -5317,28 +5719,19 @@ "node": ">=4.0" } }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "engines": { "node": ">=4.0" } }, "node_modules/estree-walker": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", "dev": true }, "node_modules/esutils": { @@ -5350,26 +5743,20 @@ "node": ">=0.10.0" } }, - "node_modules/exec-sh": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.6.tgz", - "integrity": "sha512-nQn+hI3yp+oD0huYhKwvYI32+JFeq+XkNcD1GAo3Y/MjxsfVGmrrzrnzjWiNY6f+pUCP440fThsFh5gZrRAU/w==", - "dev": true - }, "node_modules/execa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", - "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, "dependencies": { - "cross-spawn": "^7.0.0", - "get-stream": "^5.0.0", - "human-signals": "^1.1.1", + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", "is-stream": "^2.0.0", "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.0", - "onetime": "^5.1.0", - "signal-exit": "^3.0.2", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", "strip-final-newline": "^2.0.0" }, "engines": { @@ -5379,649 +5766,727 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/execa/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, "node_modules/exit": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", "dev": true, "engines": { "node": ">= 0.8.0" } }, - "node_modules/expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "node_modules/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", "dev": true, "dependencies": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { - "node": ">=0.10.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/expand-brackets/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", "dev": true, "dependencies": { - "ms": "2.0.0" + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/expand-brackets/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, "dependencies": { - "is-descriptor": "^0.1.0" + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" }, "engines": { - "node": ">=0.10.0" + "node": ">=8.6.0" } }, - "node_modules/expand-brackets/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "dependencies": { - "is-extendable": "^0.1.0" + "is-glob": "^4.0.1" }, "engines": { - "node": ">=0.10.0" + "node": ">= 6" } }, - "node_modules/expand-brackets/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "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", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dev": true, "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" + "reusify": "^1.0.4" } }, - "node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "node_modules/fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", "dev": true, "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" + "bser": "2.1.1" } }, - "node_modules/expand-brackets/node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, "dependencies": { - "kind-of": "^3.0.2" + "flat-cache": "^3.0.4" }, "engines": { - "node": ">=0.10.0" + "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "dependencies": { - "is-buffer": "^1.1.5" + "to-regex-range": "^5.0.1" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/expand-brackets/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "node_modules/find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", "dev": true, "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/avajs/find-cache-dir?sponsor=1" } }, - "node_modules/expand-brackets/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "node_modules/find-cache-dir/node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/expand-brackets/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/expand-brackets/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "node_modules/expect": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/expect/-/expect-26.6.2.tgz", - "integrity": "sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA==", + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "dev": true, "dependencies": { - "@jest/types": "^26.6.2", - "ansi-styles": "^4.0.0", - "jest-get-type": "^26.3.0", - "jest-matcher-utils": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-regex-util": "^26.0.0" + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" }, "engines": { - "node": ">= 10.14.2" + "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/expect/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" }, "engines": { - "node": ">=8" + "node": ">=14" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/expect/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", "dev": true, "dependencies": { - "color-name": "~1.1.4" + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" }, "engines": { - "node": ">=7.0.0" + "node": ">=14.14" } }, - "node_modules/expect/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, - "node_modules/extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, - "dependencies": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=0.10.0" + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, - "dependencies": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/extglob/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", "dev": true, "dependencies": { - "is-descriptor": "^1.0.0" + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/extglob/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/extglob/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=6.9.0" } }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-diff": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", - "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", - "dev": true - }, - "node_modules/fast-glob": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", - "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, "engines": { - "node": ">=8" + "node": "6.* || 8.* || >= 10.*" } }, - "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", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "node_modules/fastq": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.1.tgz", - "integrity": "sha512-HOnr8Mc60eNYl1gzwp6r5RoUyAn5/glBolUzP/Ez6IFVPMPirxn/9phgL6zhOtaTy7ISwPvQ+wT+hfcRZh/bzw==", + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, "dependencies": { - "reusify": "^1.0.4" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/fb-watchman": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", - "integrity": "sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg==", + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true, - "dependencies": { - "bser": "2.1.1" + "engines": { + "node": ">=8.0.0" } }, - "node_modules/file-entry-cache": { + "node_modules/get-stream": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "node_modules/get-symbol-description": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", "dev": true, "dependencies": { - "to-regex-range": "^5.0.1" + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" }, "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/find-cache-dir": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", - "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "node_modules/glob": { + "version": "10.3.12", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.12.tgz", + "integrity": "sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg==", "dev": true, "dependencies": { - "commondir": "^1.0.1", - "make-dir": "^3.0.2", - "pkg-dir": "^4.1.0" + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.6", + "minimatch": "^9.0.1", + "minipass": "^7.0.4", + "path-scurry": "^1.10.2" + }, + "bin": { + "glob": "dist/esm/bin.mjs" }, "engines": { - "node": ">=8" + "node": ">=16 || 14 >=14.17" }, "funding": { - "url": "https://github.com/avajs/find-cache-dir?sponsor=1" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/find-cache-dir/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" + "is-glob": "^4.0.3" }, "engines": { - "node": ">=8" + "node": ">=10.13.0" } }, - "node_modules/find-cache-dir/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/find-cache-dir/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", "dev": true, "dependencies": { - "p-try": "^2.0.0" + "define-properties": "^1.1.3" }, "engines": { - "node": ">=6" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/find-cache-dir/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, "dependencies": { - "p-limit": "^2.2.0" + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/find-cache-dir/node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", "dev": true, - "engines": { - "node": ">=6" + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/find-cache-dir/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true }, - "node_modules/find-cache-dir/node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/handlebars": { + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", "dev": true, "dependencies": { - "find-up": "^4.0.0" + "minimist": "^1.2.5", + "neo-async": "^2.6.2", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" }, "engines": { - "node": ">=8" + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" } }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", "dev": true, - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/flatted": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", - "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", - "dev": true + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } }, - "node_modules/for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dev": true, "dependencies": { - "is-callable": "^1.1.3" + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, "engines": { - "node": ">= 6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, "dependencies": { - "map-cache": "^0.2.2" + "has-symbols": "^1.0.3" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dev": true, "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "function-bind": "^1.1.2" }, "engines": { - "node": ">=10" + "node": ">= 0.4" } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + "node": ">=10.17.0" } }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "engines": { + "node": ">= 4" + } }, - "node_modules/function.prototype.name": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", - "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0", - "functions-have-names": "^1.2.2" + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" }, "engines": { - "node": ">= 0.4" + "node": ">=6" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, - "node_modules/functions-have-names": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "node_modules/import-local": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", + "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", "dev": true, + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, "engines": { - "node": ">=6.9.0" + "node": ">=0.8.19" } }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, - "engines": { - "node": "6.* || 8.* || >= 10.*" + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" } }, - "node_modules/get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", + "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 + }, + "node_modules/internal-slot": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">= 0.4" } }, - "node_modules/get-package-type": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", - "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "node_modules/is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + }, "engines": { - "node": ">=8.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", "dev": true, "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" + "has-bigints": "^1.0.1" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-symbol-description": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", - "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" + "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -6030,63 +6495,52 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "node_modules/is-builtin-module": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", + "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", "dev": true, + "dependencies": { + "builtin-modules": "^3.3.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, "engines": { - "node": "*" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "dev": true, "dependencies": { - "is-glob": "^4.0.1" + "hasown": "^2.0.0" }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true, - "engines": { - "node": ">=4" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/globalthis": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", - "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", "dev": true, "dependencies": { - "define-properties": "^1.1.3" + "is-typed-array": "^1.1.13" }, "engines": { "node": ">= 0.4" @@ -6095,149 +6549,144 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/globby": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", - "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", "dev": true, "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", - "slash": "^3.0.0" + "has-tostringtag": "^1.0.0" }, "engines": { - "node": ">=10" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globby/node_modules/ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", - "dev": true, - "engines": { - "node": ">= 4" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/gopd": { + "node_modules/is-extendable": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "dependencies": { - "get-intrinsic": "^1.1.3" + "is-plain-object": "^2.0.4" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/graceful-fs": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", - "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", - "dev": true - }, - "node_modules/growly": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", - "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, - "optional": true + "engines": { + "node": ">=0.10.0" + } }, - "node_modules/handlebars": { - "version": "4.7.7", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", - "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, - "dependencies": { - "minimist": "^1.2.5", - "neo-async": "^2.6.0", - "source-map": "^0.6.1", - "wordwrap": "^1.0.0" - }, - "bin": { - "handlebars": "bin/handlebars" - }, "engines": { - "node": ">=0.4.7" - }, - "optionalDependencies": { - "uglify-js": "^3.1.4" + "node": ">=8" } }, - "node_modules/handlebars/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "dependencies": { - "function-bind": "^1.1.1" + "is-extglob": "^2.1.1" }, "engines": { - "node": ">= 0.4.0" + "node": ">=0.10.0" } }, - "node_modules/has-bigints": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", - "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "node_modules/is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", + "dev": true + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", "dev": true, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, "engines": { - "node": ">=4" + "node": ">=0.12.0" } }, - "node_modules/has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, "dependencies": { - "get-intrinsic": "^1.1.1" + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, "engines": { - "node": ">= 0.4" + "node": ">=8" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -6245,13 +6694,13 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "node_modules/is-shared-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", "dev": true, "dependencies": { - "has-symbols": "^1.0.2" + "call-bind": "^1.0.7" }, "engines": { "node": ">= 0.4" @@ -6260,809 +6709,930 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, - "dependencies": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - }, "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", "dev": true, "dependencies": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" + "has-tostringtag": "^1.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-values/node_modules/is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", "dev": true, "dependencies": { - "kind-of": "^3.0.2" + "has-symbols": "^1.0.2" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-values/node_modules/is-number/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "node_modules/is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", "dev": true, "dependencies": { - "is-buffer": "^1.1.5" + "which-typed-array": "^1.1.14" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-values/node_modules/kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", "dev": true, "dependencies": { - "is-buffer": "^1.1.5" + "call-bind": "^1.0.2" }, - "engines": { - "node": ">=0.10.0" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", "dev": true }, - "node_modules/html-encoding-sniffer": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", - "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", "dev": true, - "dependencies": { - "whatwg-encoding": "^1.0.5" - }, "engines": { - "node": ">=10" + "node": ">=0.10.0" } }, - "node_modules/html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true - }, - "node_modules/http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", - "dev": true, - "dependencies": { - "@tootallnate/once": "1", - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "node_modules/istanbul": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", + "integrity": "sha512-nMtdn4hvK0HjUlzr1DrKSUY8ychprt8dzHOgY2KXsIhHu5PuQQEOTM27gV9Xblyon7aUH/TSFIjRHEODF/FRPg==", + "deprecated": "This module is no longer maintained, try this instead:\n npm i nyc\nVisit https://istanbul.js.org/integrations for other alternatives.", "dev": true, "dependencies": { - "agent-base": "6", - "debug": "4" + "abbrev": "1.0.x", + "async": "1.x", + "escodegen": "1.8.x", + "esprima": "2.7.x", + "glob": "^5.0.15", + "handlebars": "^4.0.1", + "js-yaml": "3.x", + "mkdirp": "0.5.x", + "nopt": "3.x", + "once": "1.x", + "resolve": "1.1.x", + "supports-color": "^3.1.0", + "which": "^1.1.1", + "wordwrap": "^1.0.0" }, - "engines": { - "node": ">= 6" + "bin": { + "istanbul": "lib/cli.js" } }, - "node_modules/human-signals": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", - "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true, "engines": { - "node": ">=8.12.0" + "node": ">=8" } }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "node_modules/istanbul-lib-instrument": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.2.tgz", + "integrity": "sha512-1WUsZ9R1lA0HtBSohTkm39WTPlNKSJ5iFk7UwqXkBLoHQT+hfqPsfsTDVuZdKGaBwn7din9bS7SsnoAr943hvw==", "dev": true, "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "engines": { - "node": ">= 4" + "node": ">=10" } }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "node_modules/istanbul-lib-instrument/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" + "yallist": "^4.0.0" }, "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=10" } }, - "node_modules/import-local": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", - "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", + "node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" + "lru-cache": "^6.0.0" }, "bin": { - "import-local-fixture": "fixtures/cli.js" + "semver": "bin/semver.js" }, "engines": { - "node": ">=8" + "node": ">=10" } }, - "node_modules/import-local/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { "node": ">=8" } }, - "node_modules/import-local/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "p-locate": "^4.1.0" + "has-flag": "^4.0.0" }, "engines": { "node": ">=8" } }, - "node_modules/import-local/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", "dev": true, "dependencies": { - "p-try": "^2.0.0" + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" }, "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=10" } }, - "node_modules/import-local/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", "dev": true, "dependencies": { - "p-limit": "^2.2.0" + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" }, "engines": { "node": ">=8" } }, - "node_modules/import-local/node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "node_modules/istanbul/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, - "engines": { - "node": ">=6" + "dependencies": { + "sprintf-js": "~1.0.2" } }, - "node_modules/import-local/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "node_modules/istanbul/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "engines": { - "node": ">=8" + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "node_modules/import-local/node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "node_modules/istanbul/node_modules/glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha512-c9IPMazfRITpmAAKi22dK1VKxGDX9ehhqfABDriL/lzO92xcUKEJPQHrVA/2YHSNFB4iFlykVmWvwo48nr3OxA==", "dev": true, "dependencies": { - "find-up": "^4.0.0" + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" }, "engines": { - "node": ">=8" + "node": "*" } }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "node_modules/istanbul/node_modules/has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==", "dev": true, "engines": { - "node": ">=0.8.19" + "node": ">=0.10.0" } }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "node_modules/istanbul/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "dependencies": { - "once": "^1.3.0", - "wrappy": "1" + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "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 - }, - "node_modules/internal-slot": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", - "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", + "node_modules/istanbul/node_modules/js-yaml/node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.0", - "has": "^1.0.3", - "side-channel": "^1.0.4" + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" }, "engines": { - "node": ">= 0.4" + "node": ">=4" } }, - "node_modules/is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "node_modules/istanbul/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { - "kind-of": "^6.0.0" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=0.10.0" + "node": "*" } }, - "node_modules/is-array-buffer": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", - "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "node_modules/istanbul/node_modules/resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg==", + "dev": true + }, + "node_modules/istanbul/node_modules/supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha512-Jds2VIYDrlp5ui7t8abHN2bjAu4LV/q4N2KivFPpGH0lrka0BMq/33AmECUXlKPcHigkNaqfXRENFju+rlcy+A==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.0", - "is-typed-array": "^1.1.10" + "has-flag": "^1.0.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=0.8.0" } }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "node_modules/is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "node_modules/istanbul/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "dependencies": { - "has-bigints": "^1.0.1" + "isexe": "^2.0.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "bin": { + "which": "bin/which" } }, - "node_modules/is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "node_modules/jackspeak": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "@isaacs/cliui": "^8.0.2" }, "engines": { - "node": ">= 0.4" + "node": ">=14" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" } }, - "node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "node_modules/is-builtin-module": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.1.0.tgz", - "integrity": "sha512-OV7JjAgOTfAFJmHZLvpSTb4qi0nIILDV1gWPYDnDJUTNFM5aGlRAhk4QcT8i7TuAleeEV5Fdkqn3t4mS+Q11fg==", + "node_modules/jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, "dependencies": { - "builtin-modules": "^3.0.0" + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" }, - "engines": { - "node": ">=6" - } - }, - "node_modules/is-builtin-module/node_modules/builtin-modules": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", - "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", - "dev": true, - "engines": { - "node": ">=6" + "bin": { + "jest": "bin/jest.js" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true, "engines": { - "node": ">= 0.4" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } } }, - "node_modules/is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "node_modules/jest-changed-files": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", "dev": true, "dependencies": { - "ci-info": "^2.0.0" + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" }, - "bin": { - "is-ci": "bin.js" + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/is-core-module": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.0.tgz", - "integrity": "sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==", + "node_modules/jest-circus": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", "dev": true, "dependencies": { - "has": "^1.0.3" + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "node_modules/jest-circus/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "kind-of": "^6.0.0" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "node_modules/jest-circus/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "has-tostringtag": "^1.0.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">= 0.4" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "node_modules/jest-circus/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" + "color-name": "~1.1.4" }, "engines": { - "node": ">=0.10.0" + "node": ">=7.0.0" } }, - "node_modules/is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "node_modules/jest-circus/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-circus/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "optional": true, - "bin": { - "is-docker": "cli.js" - }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "node_modules/jest-circus/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "is-plain-object": "^2.0.4" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "node_modules/jest-cli": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", "dev": true, + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, "engines": { - "node": ">=0.10.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } } }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "node_modules/jest-cli/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/is-generator-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", - "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "node_modules/jest-cli/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "node_modules/jest-cli/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "is-extglob": "^2.1.1" + "color-name": "~1.1.4" }, "engines": { - "node": ">=0.10.0" + "node": ">=7.0.0" } }, - "node_modules/is-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", + "node_modules/jest-cli/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/is-negative-zero": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", - "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "node_modules/jest-cli/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=8" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "node_modules/jest-cli/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, "engines": { - "node": ">=0.12.0" + "node": ">=8" } }, - "node_modules/is-number-object": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "node_modules/jest-config": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", "dev": true, "dependencies": { - "has-tostringtag": "^1.0.0" + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" }, "engines": { - "node": ">= 0.4" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } } }, - "node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "node_modules/jest-config/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "isobject": "^3.0.1" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/is-potential-custom-element-name": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", - "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", - "dev": true + "node_modules/jest-config/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } }, - "node_modules/is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "node_modules/jest-config/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">= 0.4" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", - "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "node_modules/jest-config/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2" + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-config/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-config/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "node_modules/jest-config/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { "node": ">=8" } }, - "node_modules/is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "node_modules/jest-config/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { - "has-tostringtag": "^1.0.0" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">= 0.4" + "node": "*" + } + }, + "node_modules/jest-config/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=8" } }, - "node_modules/is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "node_modules/jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, "dependencies": { - "has-symbols": "^1.0.2" + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { - "node": ">= 0.4" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-diff/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/is-typed-array": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", - "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", + "node_modules/jest-diff/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">= 0.4" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "node_modules/is-weakref": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", - "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "node_modules/jest-diff/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2" + "color-name": "~1.1.4" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=7.0.0" } }, - "node_modules/is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "node_modules/jest-diff/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-diff/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "node_modules/jest-diff/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, - "optional": true, "dependencies": { - "is-docker": "^2.0.0" + "has-flag": "^4.0.0" }, "engines": { "node": ">=8" } }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "node_modules/isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "node_modules/jest-docblock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", "dev": true, + "dependencies": { + "detect-newline": "^3.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/istanbul": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", - "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", - "deprecated": "This module is no longer maintained, try this instead:\n npm i nyc\nVisit https://istanbul.js.org/integrations for other alternatives.", + "node_modules/jest-each": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", "dev": true, "dependencies": { - "abbrev": "1.0.x", - "async": "1.x", - "escodegen": "1.8.x", - "esprima": "2.7.x", - "glob": "^5.0.15", - "handlebars": "^4.0.1", - "js-yaml": "3.x", - "mkdirp": "0.5.x", - "nopt": "3.x", - "once": "1.x", - "resolve": "1.1.x", - "supports-color": "^3.1.0", - "which": "^1.1.1", - "wordwrap": "^1.0.0" + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" }, - "bin": { - "istanbul": "lib/cli.js" + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/istanbul-lib-coverage": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", - "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", + "node_modules/jest-each/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/istanbul-lib-instrument": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", - "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "node_modules/jest-each/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "@babel/core": "^7.7.5", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.0.0", - "semver": "^6.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "node_modules/jest-each/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", - "supports-color": "^7.1.0" + "color-name": "~1.1.4" }, "engines": { - "node": ">=8" + "node": ">=7.0.0" } }, - "node_modules/istanbul-lib-report/node_modules/has-flag": { + "node_modules/jest-each/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-each/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", @@ -7071,7 +7641,7 @@ "node": ">=8" } }, - "node_modules/istanbul-lib-report/node_modules/supports-color": { + "node_modules/jest-each/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", @@ -7083,264 +7653,176 @@ "node": ">=8" } }, - "node_modules/istanbul-lib-source-maps": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", - "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", + "node_modules/jest-environment-node": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", "dev": true, "dependencies": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { - "node": ">=8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/istanbul-lib-source-maps/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/istanbul-reports": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", - "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", + "node_modules/jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", "dev": true, "dependencies": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" }, "engines": { - "node": ">=8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" } }, - "node_modules/istanbul/node_modules/escodegen": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", - "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", + "node_modules/jest-leak-detector": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", "dev": true, "dependencies": { - "esprima": "^2.7.1", - "estraverse": "^1.9.1", - "esutils": "^2.0.2", - "optionator": "^0.8.1" - }, - "bin": { - "escodegen": "bin/escodegen.js", - "esgenerate": "bin/esgenerate.js" - }, - "engines": { - "node": ">=0.12.0" - }, - "optionalDependencies": { - "source-map": "~0.2.0" - } - }, - "node_modules/istanbul/node_modules/esprima": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", - "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/istanbul/node_modules/estraverse": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", - "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", - "dev": true, - "engines": { - "node": ">=0.10.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/istanbul/node_modules/glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "node_modules/jest-matcher-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", "dev": true, "dependencies": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { - "node": "*" - } - }, - "node_modules/istanbul/node_modules/has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true, - "engines": { - "node": ">=0.10.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/istanbul/node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "node_modules/jest-matcher-utils/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" + "color-convert": "^2.0.1" }, "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/istanbul/node_modules/optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, - "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" + "node": ">=8" }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/istanbul/node_modules/prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true, - "engines": { - "node": ">= 0.8.0" + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/istanbul/node_modules/resolve": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", - "dev": true - }, - "node_modules/istanbul/node_modules/source-map": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", - "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "node_modules/jest-matcher-utils/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "optional": true, "dependencies": { - "amdefine": ">=0.0.4" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/istanbul/node_modules/supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "dependencies": { - "has-flag": "^1.0.0" + "node": ">=10" }, - "engines": { - "node": ">=0.8.0" + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/istanbul/node_modules/type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "node_modules/jest-matcher-utils/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "prelude-ls": "~1.1.2" + "color-name": "~1.1.4" }, "engines": { - "node": ">= 0.8.0" + "node": ">=7.0.0" } }, - "node_modules/istanbul/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } + "node_modules/jest-matcher-utils/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, - "node_modules/jest": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest/-/jest-26.6.3.tgz", - "integrity": "sha512-lGS5PXGAzR4RF7V5+XObhqz2KZIDUA1yD0DG6pBVmy10eh0ZIXQImRuzocsI/N2XZ1GrLFwTS27In2i2jlpq1Q==", + "node_modules/jest-matcher-utils/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "dependencies": { - "@jest/core": "^26.6.3", - "import-local": "^3.0.2", - "jest-cli": "^26.6.3" - }, - "bin": { - "jest": "bin/jest.js" - }, "engines": { - "node": ">= 10.14.2" + "node": ">=8" } }, - "node_modules/jest-changed-files": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-26.6.2.tgz", - "integrity": "sha512-fDS7szLcY9sCtIip8Fjry9oGf3I2ht/QT21bAHm5Dmf0mD4X3ReNUf17y+bO6fR8WgbIZTlbyG1ak/53cbRzKQ==", + "node_modules/jest-matcher-utils/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "@jest/types": "^26.6.2", - "execa": "^4.0.0", - "throat": "^5.0.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": ">=8" } }, - "node_modules/jest-cli": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-26.6.3.tgz", - "integrity": "sha512-GF9noBSa9t08pSyl3CY4frMrqp+aQXFGFkf5hEPbh/pIUFYWMK6ZLTfbmadxJVcJrdRoChlWQsA2VkJcDFK8hg==", + "node_modules/jest-message-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", "dev": true, "dependencies": { - "@jest/core": "^26.6.3", - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.4", - "import-local": "^3.0.2", - "is-ci": "^2.0.0", - "jest-config": "^26.6.3", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "prompts": "^2.0.1", - "yargs": "^15.4.1" - }, - "bin": { - "jest": "bin/jest.js" + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-cli/node_modules/ansi-styles": { + "node_modules/jest-message-util/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", @@ -7355,10 +7837,10 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-cli/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "node_modules/jest-message-util/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", @@ -7371,7 +7853,7 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/jest-cli/node_modules/color-convert": { + "node_modules/jest-message-util/node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", @@ -7383,13 +7865,13 @@ "node": ">=7.0.0" } }, - "node_modules/jest-cli/node_modules/color-name": { + "node_modules/jest-message-util/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/jest-cli/node_modules/has-flag": { + "node_modules/jest-message-util/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", @@ -7398,7 +7880,7 @@ "node": ">=8" } }, - "node_modules/jest-cli/node_modules/supports-color": { + "node_modules/jest-message-util/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", @@ -7410,44 +7892,80 @@ "node": ">=8" } }, - "node_modules/jest-config": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-26.6.3.tgz", - "integrity": "sha512-t5qdIj/bCj2j7NFVHb2nFB4aUdfucDn3JRKgrZnplb8nieAirAzRSHP8uDEd+qV6ygzg9Pz4YG7UTJf94LPSyg==", + "node_modules/jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", "dev": true, "dependencies": { - "@babel/core": "^7.1.0", - "@jest/test-sequencer": "^26.6.3", - "@jest/types": "^26.6.2", - "babel-jest": "^26.6.3", - "chalk": "^4.0.0", - "deepmerge": "^4.2.2", - "glob": "^7.1.1", - "graceful-fs": "^4.2.4", - "jest-environment-jsdom": "^26.6.2", - "jest-environment-node": "^26.6.2", - "jest-get-type": "^26.3.0", - "jest-jasmine2": "^26.6.3", - "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.2", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "micromatch": "^4.0.2", - "pretty-format": "^26.6.2" - }, - "engines": { - "node": ">= 10.14.2" + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "dev": true, + "engines": { + "node": ">=6" }, "peerDependencies": { - "ts-node": ">=9.0.0" + "jest-resolve": "*" }, "peerDependenciesMeta": { - "ts-node": { + "jest-resolve": { "optional": true } } }, - "node_modules/jest-config/node_modules/ansi-styles": { + "node_modules/jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve-dependencies": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", + "dev": true, + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", @@ -7462,10 +7980,10 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-config/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "node_modules/jest-resolve/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", @@ -7478,7 +7996,7 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/jest-config/node_modules/color-convert": { + "node_modules/jest-resolve/node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", @@ -7490,13 +8008,13 @@ "node": ">=7.0.0" } }, - "node_modules/jest-config/node_modules/color-name": { + "node_modules/jest-resolve/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/jest-config/node_modules/has-flag": { + "node_modules/jest-resolve/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", @@ -7505,7 +8023,7 @@ "node": ">=8" } }, - "node_modules/jest-config/node_modules/supports-color": { + "node_modules/jest-resolve/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", @@ -7517,22 +8035,39 @@ "node": ">=8" } }, - "node_modules/jest-diff": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-27.5.1.tgz", - "integrity": "sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw==", + "node_modules/jest-runner": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", "dev": true, "dependencies": { + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", "chalk": "^4.0.0", - "diff-sequences": "^27.5.1", - "jest-get-type": "^27.5.1", - "pretty-format": "^27.5.1" + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-diff/node_modules/ansi-styles": { + "node_modules/jest-runner/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", @@ -7547,7 +8082,7 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-diff/node_modules/chalk": { + "node_modules/jest-runner/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", @@ -7563,7 +8098,7 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/jest-diff/node_modules/color-convert": { + "node_modules/jest-runner/node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", @@ -7575,13 +8110,13 @@ "node": ">=7.0.0" } }, - "node_modules/jest-diff/node_modules/color-name": { + "node_modules/jest-runner/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/jest-diff/node_modules/has-flag": { + "node_modules/jest-runner/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", @@ -7590,42 +8125,18 @@ "node": ">=8" } }, - "node_modules/jest-diff/node_modules/jest-get-type": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.5.1.tgz", - "integrity": "sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw==", + "node_modules/jest-runner/node_modules/source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", "dev": true, - "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" } }, - "node_modules/jest-diff/node_modules/pretty-format": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", - "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1", - "ansi-styles": "^5.0.0", - "react-is": "^17.0.1" - }, - "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" - } - }, - "node_modules/jest-diff/node_modules/pretty-format/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-diff/node_modules/supports-color": { + "node_modules/jest-runner/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", @@ -7637,35 +8148,40 @@ "node": ">=8" } }, - "node_modules/jest-docblock": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-26.0.0.tgz", - "integrity": "sha512-RDZ4Iz3QbtRWycd8bUEPxQsTlYazfYn/h5R65Fc6gOfwozFhoImx+affzky/FFBuqISPTqjXomoIGJVKBWoo0w==", - "dev": true, - "dependencies": { - "detect-newline": "^3.0.0" - }, - "engines": { - "node": ">= 10.14.2" - } - }, - "node_modules/jest-each": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-26.6.2.tgz", - "integrity": "sha512-Mer/f0KaATbjl8MCJ+0GEpNdqmnVmDYqCTJYTvoo7rqmRiDllmp2AYN+06F93nXcY3ur9ShIjS+CO/uD+BbH4A==", - "dev": true, - "dependencies": { - "@jest/types": "^26.6.2", + "node_modules/jest-runtime": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", "chalk": "^4.0.0", - "jest-get-type": "^26.3.0", - "jest-util": "^26.6.2", - "pretty-format": "^26.6.2" + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-each/node_modules/ansi-styles": { + "node_modules/jest-runtime/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", @@ -7680,10 +8196,20 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-each/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "node_modules/jest-runtime/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/jest-runtime/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", @@ -7696,7 +8222,7 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/jest-each/node_modules/color-convert": { + "node_modules/jest-runtime/node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", @@ -7708,134 +8234,97 @@ "node": ">=7.0.0" } }, - "node_modules/jest-each/node_modules/color-name": { + "node_modules/jest-runtime/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/jest-each/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-each/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/jest-runtime/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" }, "engines": { - "node": ">=8" + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/jest-environment-jsdom": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-26.6.2.tgz", - "integrity": "sha512-jgPqCruTlt3Kwqg5/WVFyHIOJHsiAvhcp2qiR2QQstuG9yWox5+iHpU3ZrcBxW14T4fe5Z68jAfLRh7joCSP2Q==", + "node_modules/jest-runtime/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "dependencies": { - "@jest/environment": "^26.6.2", - "@jest/fake-timers": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "jest-mock": "^26.6.2", - "jest-util": "^26.6.2", - "jsdom": "^16.4.0" - }, "engines": { - "node": ">= 10.14.2" + "node": ">=8" } }, - "node_modules/jest-environment-node": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-26.6.2.tgz", - "integrity": "sha512-zhtMio3Exty18dy8ee8eJ9kjnRyZC1N4C1Nt/VShN1apyXc8rWGtJ9lI7vqiWcyyXS4BVSEn9lxAM2D+07/Tag==", + "node_modules/jest-runtime/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { - "@jest/environment": "^26.6.2", - "@jest/fake-timers": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "jest-mock": "^26.6.2", - "jest-util": "^26.6.2" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">= 10.14.2" - } - }, - "node_modules/jest-get-type": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.3.0.tgz", - "integrity": "sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig==", - "dev": true, - "engines": { - "node": ">= 10.14.2" + "node": "*" } }, - "node_modules/jest-haste-map": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-26.6.2.tgz", - "integrity": "sha512-easWIJXIw71B2RdR8kgqpjQrbMRWQBgiBwXYEhtGUTaX+doCjBheluShdDMeR8IMfJiTqH4+zfhtg29apJf/8w==", + "node_modules/jest-runtime/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "@jest/types": "^26.6.2", - "@types/graceful-fs": "^4.1.2", - "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "graceful-fs": "^4.2.4", - "jest-regex-util": "^26.0.0", - "jest-serializer": "^26.6.2", - "jest-util": "^26.6.2", - "jest-worker": "^26.6.2", - "micromatch": "^4.0.2", - "sane": "^4.0.3", - "walker": "^1.0.7" + "has-flag": "^4.0.0" }, "engines": { - "node": ">= 10.14.2" - }, - "optionalDependencies": { - "fsevents": "^2.1.2" + "node": ">=8" } }, - "node_modules/jest-jasmine2": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.6.3.tgz", - "integrity": "sha512-kPKUrQtc8aYwBV7CqBg5pu+tmYXlvFlSFYn18ev4gPFtrRzB15N2gW/Roew3187q2w2eHuu0MU9TJz6w0/nPEg==", + "node_modules/jest-snapshot": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", "dev": true, "dependencies": { - "@babel/traverse": "^7.1.0", - "@jest/environment": "^26.6.2", - "@jest/source-map": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", "chalk": "^4.0.0", - "co": "^4.6.0", - "expect": "^26.6.2", - "is-generator-fn": "^2.0.0", - "jest-each": "^26.6.2", - "jest-matcher-utils": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-runtime": "^26.6.3", - "jest-snapshot": "^26.6.2", - "jest-util": "^26.6.2", - "pretty-format": "^26.6.2", - "throat": "^5.0.0" + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-jasmine2/node_modules/ansi-styles": { + "node_modules/jest-snapshot/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", @@ -7850,10 +8339,10 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-jasmine2/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "node_modules/jest-snapshot/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", @@ -7866,7 +8355,7 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/jest-jasmine2/node_modules/color-convert": { + "node_modules/jest-snapshot/node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", @@ -7878,13 +8367,13 @@ "node": ">=7.0.0" } }, - "node_modules/jest-jasmine2/node_modules/color-name": { + "node_modules/jest-snapshot/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/jest-jasmine2/node_modules/has-flag": { + "node_modules/jest-snapshot/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", @@ -7893,47 +8382,63 @@ "node": ">=8" } }, - "node_modules/jest-jasmine2/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/jest-snapshot/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "yallist": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" } }, - "node_modules/jest-leak-detector": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz", - "integrity": "sha512-i4xlXpsVSMeKvg2cEKdfhh0H39qlJlP5Ex1yQxwF9ubahboQYMgTtz5oML35AVA3B4Eu+YsmwaiKVev9KCvLxg==", + "node_modules/jest-snapshot/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest-snapshot/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.2" + "has-flag": "^4.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": ">=8" } }, - "node_modules/jest-matcher-utils": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz", - "integrity": "sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw==", + "node_modules/jest-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", "dev": true, "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", "chalk": "^4.0.0", - "jest-diff": "^26.6.2", - "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.2" + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-matcher-utils/node_modules/ansi-styles": { + "node_modules/jest-util/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", @@ -7948,10 +8453,10 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-matcher-utils/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "node_modules/jest-util/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", @@ -7964,7 +8469,7 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/jest-matcher-utils/node_modules/color-convert": { + "node_modules/jest-util/node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", @@ -7976,22 +8481,13 @@ "node": ">=7.0.0" } }, - "node_modules/jest-matcher-utils/node_modules/color-name": { + "node_modules/jest-util/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/jest-matcher-utils/node_modules/diff-sequences": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz", - "integrity": "sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==", - "dev": true, - "engines": { - "node": ">= 10.14.2" - } - }, - "node_modules/jest-matcher-utils/node_modules/has-flag": { + "node_modules/jest-util/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", @@ -8000,22 +8496,7 @@ "node": ">=8" } }, - "node_modules/jest-matcher-utils/node_modules/jest-diff": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.2.tgz", - "integrity": "sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==", - "dev": true, - "dependencies": { - "chalk": "^4.0.0", - "diff-sequences": "^26.6.2", - "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.2" - }, - "engines": { - "node": ">= 10.14.2" - } - }, - "node_modules/jest-matcher-utils/node_modules/supports-color": { + "node_modules/jest-util/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", @@ -8027,27 +8508,24 @@ "node": ">=8" } }, - "node_modules/jest-message-util": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.6.2.tgz", - "integrity": "sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA==", + "node_modules/jest-validate": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.0.0", - "@jest/types": "^26.6.2", - "@types/stack-utils": "^2.0.0", + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", - "micromatch": "^4.0.2", - "pretty-format": "^26.6.2", - "slash": "^3.0.0", - "stack-utils": "^2.0.2" + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-message-util/node_modules/ansi-styles": { + "node_modules/jest-validate/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", @@ -8062,10 +8540,22 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-message-util/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-validate/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", @@ -8078,7 +8568,7 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/jest-message-util/node_modules/color-convert": { + "node_modules/jest-validate/node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", @@ -8090,13 +8580,13 @@ "node": ">=7.0.0" } }, - "node_modules/jest-message-util/node_modules/color-name": { + "node_modules/jest-validate/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/jest-message-util/node_modules/has-flag": { + "node_modules/jest-validate/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", @@ -8105,7 +8595,7 @@ "node": ">=8" } }, - "node_modules/jest-message-util/node_modules/supports-color": { + "node_modules/jest-validate/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", @@ -8117,97 +8607,44 @@ "node": ">=8" } }, - "node_modules/jest-mock": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-26.6.2.tgz", - "integrity": "sha512-YyFjePHHp1LzpzYcmgqkJ0nm0gg/lJx2aZFzFy1S6eUqNjXsOqTK10zNRff2dNfssgokjkG65OlWNcIlgd3zew==", + "node_modules/jest-watcher": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", "dev": true, "dependencies": { - "@jest/types": "^26.6.2", - "@types/node": "*" + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", + "string-length": "^4.0.1" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-pnp-resolver": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", - "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", + "node_modules/jest-watcher/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, - "engines": { - "node": ">=6" - }, - "peerDependencies": { - "jest-resolve": "*" + "dependencies": { + "color-convert": "^2.0.1" }, - "peerDependenciesMeta": { - "jest-resolve": { - "optional": true - } - } - }, - "node_modules/jest-regex-util": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-26.0.0.tgz", - "integrity": "sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A==", - "dev": true, "engines": { - "node": ">= 10.14.2" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-resolve": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-26.6.2.tgz", - "integrity": "sha512-sOxsZOq25mT1wRsfHcbtkInS+Ek7Q8jCHUB0ZUTP0tc/c41QHriU/NunqMfCUWsL4H3MHpvQD4QR9kSYhS7UvQ==", - "dev": true, - "dependencies": { - "@jest/types": "^26.6.2", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", - "jest-pnp-resolver": "^1.2.2", - "jest-util": "^26.6.2", - "read-pkg-up": "^7.0.1", - "resolve": "^1.18.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">= 10.14.2" - } - }, - "node_modules/jest-resolve-dependencies": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.6.3.tgz", - "integrity": "sha512-pVwUjJkxbhe4RY8QEWzN3vns2kqyuldKpxlxJlzEYfKSvY6/bMvxoFrYYzUO1Gx28yKWN37qyV7rIoIp2h8fTg==", - "dev": true, - "dependencies": { - "@jest/types": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-snapshot": "^26.6.2" - }, - "engines": { - "node": ">= 10.14.2" - } - }, - "node_modules/jest-resolve/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-resolve/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "node_modules/jest-watcher/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", @@ -8220,7 +8657,7 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/jest-resolve/node_modules/color-convert": { + "node_modules/jest-watcher/node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", @@ -8232,26 +8669,13 @@ "node": ">=7.0.0" } }, - "node_modules/jest-resolve/node_modules/color-name": { + "node_modules/jest-watcher/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/jest-resolve/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-resolve/node_modules/has-flag": { + "node_modules/jest-watcher/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", @@ -8260,2671 +8684,1458 @@ "node": ">=8" } }, - "node_modules/jest-resolve/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "node_modules/jest-watcher/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "p-locate": "^4.1.0" + "has-flag": "^4.0.0" }, "engines": { "node": ">=8" } }, - "node_modules/jest-resolve/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", "dev": true, "dependencies": { - "p-try": "^2.0.0" + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" }, "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-resolve/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "node_modules/jest-worker/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, "engines": { "node": ">=8" } }, - "node_modules/jest-resolve/node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/jest-resolve/node_modules/parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" + "argparse": "^2.0.1" }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/jest-resolve/node_modules/path-exists": { + "node_modules/jsdoc-type-pratt-parser": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", + "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==", "dev": true, "engines": { - "node": ">=8" + "node": ">=12.0.0" } }, - "node_modules/jest-resolve/node_modules/read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true, - "dependencies": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" + "bin": { + "jsesc": "bin/jsesc" }, "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/jest-resolve/node_modules/read-pkg-up": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, - "dependencies": { - "find-up": "^4.1.0", - "read-pkg": "^5.2.0", - "type-fest": "^0.8.1" + "bin": { + "json5": "lib/cli.js" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=6" } }, - "node_modules/jest-resolve/node_modules/read-pkg/node_modules/type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, - "engines": { - "node": ">=8" + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" } }, - "node_modules/jest-resolve/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" - }, + "json-buffer": "3.0.1" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, "engines": { - "node": ">=8" + "node": ">=6" } }, - "node_modules/jest-resolve/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "dev": true, "engines": { - "node": ">=8" + "node": ">=6" } }, - "node_modules/jest-runner": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-26.6.3.tgz", - "integrity": "sha512-atgKpRHnaA2OvByG/HpGA4g6CSPS/1LK0jK3gATJAoptC1ojltpmVlYC3TYgdmGp+GLuhzpH30Gvs36szSL2JQ==", + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "dependencies": { - "@jest/console": "^26.6.2", - "@jest/environment": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "chalk": "^4.0.0", - "emittery": "^0.7.1", - "exit": "^0.1.2", - "graceful-fs": "^4.2.4", - "jest-config": "^26.6.3", - "jest-docblock": "^26.0.0", - "jest-haste-map": "^26.6.2", - "jest-leak-detector": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-resolve": "^26.6.2", - "jest-runtime": "^26.6.3", - "jest-util": "^26.6.2", - "jest-worker": "^26.6.2", - "source-map-support": "^0.5.6", - "throat": "^5.0.0" + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" }, "engines": { - "node": ">= 10.14.2" + "node": ">= 0.8.0" } }, - "node_modules/jest-runner/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" + "p-locate": "^5.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-runner/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "node_modules/lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", + "dev": true + }, + "node_modules/lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", + "dev": true + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "yallist": "^3.0.2" + } + }, + "node_modules/lru-cache/node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" }, "engines": { "node": ">=10" }, "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-runner/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/make-dir/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "dependencies": { - "color-name": "~1.1.4" + "yallist": "^4.0.0" }, "engines": { - "node": ">=7.0.0" + "node": ">=10" } }, - "node_modules/jest-runner/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "node_modules/make-dir/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, - "node_modules/jest-runner/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, "engines": { - "node": ">=8" + "node": ">= 8" } }, - "node_modules/jest-runner/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "braces": "^3.0.2", + "picomatch": "^2.3.1" }, "engines": { - "node": ">=8" + "node": ">=8.6" } }, - "node_modules/jest-runtime": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.6.3.tgz", - "integrity": "sha512-lrzyR3N8sacTAMeonbqpnSka1dHNux2uk0qqDXVkMv2c/A3wYnvQ4EXuI013Y6+gSKSCxdaczvf4HF0mVXHRdw==", - "dev": true, - "dependencies": { - "@jest/console": "^26.6.2", - "@jest/environment": "^26.6.2", - "@jest/fake-timers": "^26.6.2", - "@jest/globals": "^26.6.2", - "@jest/source-map": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/yargs": "^15.0.0", - "chalk": "^4.0.0", - "cjs-module-lexer": "^0.6.0", - "collect-v8-coverage": "^1.0.0", - "exit": "^0.1.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.4", - "jest-config": "^26.6.3", - "jest-haste-map": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-mock": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.2", - "jest-snapshot": "^26.6.2", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "slash": "^3.0.0", - "strip-bom": "^4.0.0", - "yargs": "^15.4.1" - }, - "bin": { - "jest-runtime": "bin/jest-runtime.js" - }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, "engines": { - "node": ">= 10.14.2" + "node": ">=6" } }, - "node_modules/jest-runtime/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=8" + "node": ">=16 || 14 >=14.17" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/jest-runtime/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-runtime/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/minipass": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", + "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "dev": true, "dependencies": { - "color-name": "~1.1.4" + "minimist": "^1.2.6" }, - "engines": { - "node": ">=7.0.0" + "bin": { + "mkdirp": "bin/cmd.js" } }, - "node_modules/jest-runtime/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/jest-runtime/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true + }, + "node_modules/node-releases": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", + "dev": true + }, + "node_modules/nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha512-4GUt3kSEYmk4ITxzB/b9vaIDfUVWN/Ml1Fwl11IlnIG2iaJ9O6WXZ9SrYM9NLI8OCBieN2Y8SWC2oJV0RQ7qYg==", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/jest-runtime/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "path-key": "^3.0.0" }, "engines": { "node": ">=8" } }, - "node_modules/jest-serializer": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-26.6.2.tgz", - "integrity": "sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g==", + "node_modules/object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", "dev": true, - "dependencies": { - "@types/node": "*", - "graceful-fs": "^4.2.4" - }, - "engines": { - "node": ">= 10.14.2" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-snapshot": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.6.2.tgz", - "integrity": "sha512-OLhxz05EzUtsAmOMzuupt1lHYXCNib0ECyuZ/PZOx9TrZcC8vL0x+DUG3TL+GLX3yHG45e6YGjIm0XwDc3q3og==", + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true, - "dependencies": { - "@babel/types": "^7.0.0", - "@jest/types": "^26.6.2", - "@types/babel__traverse": "^7.0.4", - "@types/prettier": "^2.0.0", - "chalk": "^4.0.0", - "expect": "^26.6.2", - "graceful-fs": "^4.2.4", - "jest-diff": "^26.6.2", - "jest-get-type": "^26.3.0", - "jest-haste-map": "^26.6.2", - "jest-matcher-utils": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-resolve": "^26.6.2", - "natural-compare": "^1.4.0", - "pretty-format": "^26.6.2", - "semver": "^7.3.2" - }, "engines": { - "node": ">= 10.14.2" + "node": ">= 0.4" } }, - "node_modules/jest-snapshot/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" }, "engines": { - "node": ">=8" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-snapshot/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "node_modules/object.fromentries": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" }, "engines": { - "node": ">=10" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-snapshot/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/object.groupby": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", "dev": true, "dependencies": { - "color-name": "~1.1.4" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" }, "engines": { - "node": ">=7.0.0" + "node": ">= 0.4" } }, - "node_modules/jest-snapshot/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/jest-snapshot/node_modules/diff-sequences": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz", - "integrity": "sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==", + "node_modules/object.values": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", + "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, "engines": { - "node": ">= 10.14.2" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-snapshot/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, - "engines": { - "node": ">=8" + "dependencies": { + "wrappy": "1" } }, - "node_modules/jest-snapshot/node_modules/jest-diff": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.2.tgz", - "integrity": "sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==", + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "dependencies": { - "chalk": "^4.0.0", - "diff-sequences": "^26.6.2", - "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.2" + "mimic-fn": "^2.1.0" }, "engines": { - "node": ">= 10.14.2" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-snapshot/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "node_modules/optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" }, "engines": { - "node": ">=10" + "node": ">= 0.8.0" } }, - "node_modules/jest-snapshot/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-util": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.6.2.tgz", - "integrity": "sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q==", + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "dependencies": { - "@jest/types": "^26.6.2", - "@types/node": "*", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", - "is-ci": "^2.0.0", - "micromatch": "^4.0.2" + "p-limit": "^3.0.2" }, "engines": { - "node": ">= 10.14.2" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-util/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node": ">=6" } }, - "node_modules/jest-util/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "callsites": "^3.0.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": ">=6" } }, - "node_modules/jest-util/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, "dependencies": { - "color-name": "~1.1.4" + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" }, "engines": { - "node": ">=7.0.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-util/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/jest-util/node_modules/has-flag": { + "node_modules/path-exists": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, "engines": { "node": ">=8" } }, - "node_modules/jest-util/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/jest-validate": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.6.2.tgz", - "integrity": "sha512-NEYZ9Aeyj0i5rQqbq+tpIOom0YS1u2MVu6+euBsvpgIme+FOfRmoC4R5p0JiAUpaFvFy24xgrpMknarR/93XjQ==", + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, - "dependencies": { - "@jest/types": "^26.6.2", - "camelcase": "^6.0.0", - "chalk": "^4.0.0", - "jest-get-type": "^26.3.0", - "leven": "^3.1.0", - "pretty-format": "^26.6.2" - }, "engines": { - "node": ">= 10.14.2" + "node": ">=8" } }, - "node_modules/jest-validate/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-scurry": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.2.tgz", + "integrity": "sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { - "node": ">=8" + "node": ">=16 || 14 >=14.17" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/jest-validate/node_modules/camelcase": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", - "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", + "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", "dev": true, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "14 || >=16.14" } }, - "node_modules/jest-validate/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": ">=8" } }, - "node_modules/jest-validate/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, "engines": { - "node": ">=7.0.0" + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/jest-validate/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/jest-validate/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/pirates": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", "dev": true, "engines": { - "node": ">=8" + "node": ">= 6" } }, - "node_modules/jest-validate/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "find-up": "^4.0.0" }, "engines": { "node": ">=8" } }, - "node_modules/jest-watcher": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-26.6.2.tgz", - "integrity": "sha512-WKJob0P/Em2csiVthsI68p6aGKTIcsfjH9Gsx1f0A3Italz43e3ho0geSAVsmj09RWOELP1AZ/DXyJgOgDKxXQ==", + "node_modules/pkg-dir/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "dependencies": { - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "jest-util": "^26.6.2", - "string-length": "^4.0.1" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": ">=8" } }, - "node_modules/jest-watcher/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" + "p-locate": "^4.1.0" }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-watcher/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "node_modules/pkg-dir/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "p-try": "^2.0.0" }, "engines": { - "node": ">=10" + "node": ">=6" }, "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-watcher/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "dependencies": { - "color-name": "~1.1.4" + "p-limit": "^2.2.0" }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-watcher/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/jest-watcher/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, "engines": { "node": ">=8" } }, - "node_modules/jest-watcher/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/plugin-error": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-1.0.1.tgz", + "integrity": "sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "ansi-colors": "^1.0.1", + "arr-diff": "^4.0.0", + "arr-union": "^3.1.0", + "extend-shallow": "^3.0.2" }, "engines": { - "node": ">=8" + "node": ">= 0.10" } }, - "node_modules/jest-worker": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", - "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", "dev": true, - "dependencies": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" - }, "engines": { - "node": ">= 10.13.0" + "node": ">= 0.4" } }, - "node_modules/jest-worker/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, "engines": { - "node": ">=8" + "node": ">= 0.8.0" } }, - "node_modules/jest-worker/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/prettier": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "dev": true, - "dependencies": { - "has-flag": "^4.0.0" + "bin": { + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=8" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", "dev": true, "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "fast-diff": "^1.1.2" }, - "bin": { - "js-yaml": "bin/js-yaml.js" + "engines": { + "node": ">=6.0.0" } }, - "node_modules/jsdoctypeparser": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-9.0.0.tgz", - "integrity": "sha512-jrTA2jJIL6/DAEILBEh2/w9QxCuwmvNXIry39Ay/HVfhE3o2yVV0U44blYkqdHA/OKloJEqvJy0xU+GSdE2SIw==", + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, - "bin": { - "jsdoctypeparser": "bin/jsdoctypeparser" + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" }, "engines": { - "node": ">=10" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jsdom": { - "version": "16.6.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.6.0.tgz", - "integrity": "sha512-Ty1vmF4NHJkolaEmdjtxTfSfkdb8Ywarwf63f+F8/mDD1uLSSWDxDuMiZxiPhwunLrn9LOSVItWj4bLYsLN3Dg==", - "dev": true, - "dependencies": { - "abab": "^2.0.5", - "acorn": "^8.2.4", - "acorn-globals": "^6.0.0", - "cssom": "^0.4.4", - "cssstyle": "^2.3.0", - "data-urls": "^2.0.0", - "decimal.js": "^10.2.1", - "domexception": "^2.0.1", - "escodegen": "^2.0.0", - "form-data": "^3.0.0", - "html-encoding-sniffer": "^2.0.1", - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "^5.0.0", - "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.0", - "parse5": "6.0.1", - "saxes": "^5.0.1", - "symbol-tree": "^3.2.4", - "tough-cookie": "^4.0.0", - "w3c-hr-time": "^1.0.2", - "w3c-xmlserializer": "^2.0.0", - "webidl-conversions": "^6.1.0", - "whatwg-encoding": "^1.0.5", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^8.5.0", - "ws": "^7.4.5", - "xml-name-validator": "^3.0.0" - }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, "engines": { "node": ">=10" }, - "peerDependencies": { - "canvas": "^2.5.0" - }, - "peerDependenciesMeta": { - "canvas": { - "optional": true - } - } - }, - "node_modules/jsdom/node_modules/acorn": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz", - "integrity": "sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", "dev": true, - "bin": { - "jsesc": "bin/jsesc" + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" }, "engines": { - "node": ">=4" + "node": ">= 6" } }, - "node_modules/json-parse-even-better-errors": { + "node_modules/punycode": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true - }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, - "bin": { - "json5": "lib/cli.js" - }, "engines": { "node": ">=6" } }, - "node_modules/jsonfile": { + "node_modules/pure-rand": { "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", "dev": true, - "engines": { - "node": ">=6" - } + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ] }, - "node_modules/leven": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", - "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true, - "engines": { - "node": ">=6" - } + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" + "safe-buffer": "^5.1.0" } }, - "node_modules/lines-and-columns": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", - "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", - "dev": true - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "node_modules/lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, - "node_modules/lodash.debounce": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", - "dev": true - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, - "node_modules/lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", + "node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", "dev": true }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "dependencies": { - "yallist": "^4.0.0" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" }, "engines": { - "node": ">=10" + "node": ">= 6" } }, - "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "node_modules/regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", + "dev": true + }, + "node_modules/regenerate-unicode-properties": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.1.tgz", + "integrity": "sha512-X007RyZLsCJVVrjgEFVpLUTZwyOZk3oiL75ZcuYjlIWd6rNJtOjkBwQc5AsRrpbKVkxN6sklw/k/9m2jJYOf8Q==", "dev": true, "dependencies": { - "semver": "^6.0.0" + "regenerate": "^1.4.2" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=4" } }, - "node_modules/make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", "dev": true }, - "node_modules/makeerror": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz", - "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=", + "node_modules/regenerator-transform": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.2.tgz", + "integrity": "sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==", "dev": true, "dependencies": { - "tmpl": "1.0.x" - } - }, - "node_modules/map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true, - "engines": { - "node": ">=0.10.0" + "@babel/runtime": "^7.8.4" } }, - "node_modules/map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "node_modules/regexp.prototype.flags": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", "dev": true, "dependencies": { - "object-visit": "^1.0.0" + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", - "dev": true, - "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/mime-db": { - "version": "1.48.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.48.0.tgz", - "integrity": "sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.31", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.31.tgz", - "integrity": "sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg==", - "dev": true, - "dependencies": { - "mime-db": "1.48.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true - }, - "node_modules/mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "dependencies": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "node_modules/neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true - }, - "node_modules/nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, - "node_modules/node-int64": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", - "dev": true - }, - "node_modules/node-modules-regexp": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", - "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/node-notifier": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-8.0.2.tgz", - "integrity": "sha512-oJP/9NAdd9+x2Q+rfphB2RJCHjod70RcRLjosiPMMu5gjIfwVnOUGq2nbTjTUbmy0DJ/tFIVT30+Qe3nzl4TJg==", - "dev": true, - "optional": true, - "dependencies": { - "growly": "^1.3.0", - "is-wsl": "^2.2.0", - "semver": "^7.3.2", - "shellwords": "^0.1.1", - "uuid": "^8.3.0", - "which": "^2.0.2" - } - }, - "node_modules/node-notifier/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "optional": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/node-releases": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", - "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", - "dev": true - }, - "node_modules/nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "dev": true, - "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" - } - }, - "node_modules/normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "dependencies": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "node_modules/normalize-package-data/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, - "dependencies": { - "path-key": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/nwsapi": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", - "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", - "dev": true - }, - "node_modules/object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "dependencies": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/is-descriptor/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "dependencies": { - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object.assign": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "has-symbols": "^1.0.3", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object.values": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", - "integrity": "sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/p-each-series": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz", - "integrity": "sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", - "dev": true - }, - "node_modules/pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/picocolors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", - "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", - "dev": true - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pirates": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", - "integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==", - "dev": true, - "dependencies": { - "node-modules-regexp": "^1.0.0" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/plugin-error": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-1.0.1.tgz", - "integrity": "sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA==", - "dev": true, - "dependencies": { - "ansi-colors": "^1.0.1", - "arr-diff": "^4.0.0", - "arr-union": "^3.1.0", - "extend-shallow": "^3.0.2" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/plugin-error/node_modules/ansi-colors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", - "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", - "dev": true, - "dependencies": { - "ansi-wrap": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", - "dev": true, - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/prettier-linter-helpers": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", - "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", - "dev": true, - "dependencies": { - "fast-diff": "^1.1.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/pretty-format": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", - "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==", - "dev": true, - "dependencies": { - "@jest/types": "^26.6.2", - "ansi-regex": "^5.0.0", - "ansi-styles": "^4.0.0", - "react-is": "^17.0.1" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/pretty-format/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/pretty-format/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/pretty-format/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/prompts": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.1.tgz", - "integrity": "sha512-EQyfIuO2hPDsX1L/blblV+H7I0knhgAd82cVneCwcdND9B8AuCDuRcBH6yIcG4dFzlOUqbazQqwGjx5xmsNLuQ==", - "dev": true, - "dependencies": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.5" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", - "dev": true - }, - "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/randombytes": { - "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" - } - }, - "node_modules/react-is": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", - "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", - "dev": true - }, - "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==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/regenerate": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", - "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", - "dev": true - }, - "node_modules/regenerate-unicode-properties": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz", - "integrity": "sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ==", - "dev": true, - "dependencies": { - "regenerate": "^1.4.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/regenerator-runtime": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", - "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==", - "dev": true - }, - "node_modules/regenerator-transform": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.2.tgz", - "integrity": "sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.8.4" - } - }, - "node_modules/regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "dependencies": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/regexp.prototype.flags": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", - "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "functions-have-names": "^1.2.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/regexpu-core": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz", - "integrity": "sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==", - "dev": true, - "dependencies": { - "@babel/regjsgen": "^0.8.0", - "regenerate": "^1.4.2", - "regenerate-unicode-properties": "^10.1.0", - "regjsparser": "^0.9.1", - "unicode-match-property-ecmascript": "^2.0.0", - "unicode-match-property-value-ecmascript": "^2.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/regextras": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/regextras/-/regextras-0.7.1.tgz", - "integrity": "sha512-9YXf6xtW+qzQ+hcMQXx95MOvfqXFgsKDZodX3qZB0x2n5Z94ioetIITsBtvJbiOyxa/6s9AtyweBLCdPmPko/w==", - "dev": true, - "engines": { - "node": ">=0.1.14" - } - }, - "node_modules/regjsparser": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz", - "integrity": "sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==", - "dev": true, - "dependencies": { - "jsesc": "~0.5.0" - }, - "bin": { - "regjsparser": "bin/parser" - } - }, - "node_modules/regjsparser/node_modules/jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", - "dev": true, - "bin": { - "jsesc": "bin/jsesc" - } - }, - "node_modules/remap-istanbul": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/remap-istanbul/-/remap-istanbul-0.13.0.tgz", - "integrity": "sha512-rS5ZpVAx3fGtKZkiBe1esXg5mKYbgW9iz8kkADFt3p6lo3NsBBUX1q6SwdhwUtYCGnr7nK6gRlbYK3i8R0jbRA==", - "dev": true, - "dependencies": { - "istanbul": "0.4.5", - "minimatch": "^3.0.4", - "plugin-error": "^1.0.1", - "source-map": "0.6.1", - "through2": "3.0.0" - }, - "bin": { - "remap-istanbul": "bin/remap-istanbul.js" - } - }, - "node_modules/remap-istanbul/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "node_modules/repeat-element": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", - "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "node_modules/resolve": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", - "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", - "dev": true, - "dependencies": { - "is-core-module": "^2.11.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "dev": true, - "dependencies": { - "resolve-from": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/resolve-cwd/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "deprecated": "https://github.com/lydell/resolve-url#deprecated", - "dev": true - }, - "node_modules/ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rollup": { - "version": "2.79.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz", - "integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==", - "dev": true, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=10.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/rollup-plugin-sourcemaps": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/rollup-plugin-sourcemaps/-/rollup-plugin-sourcemaps-0.6.3.tgz", - "integrity": "sha512-paFu+nT1xvuO1tPFYXGe+XnQvg4Hjqv/eIhG8i5EspfYYPBKL57X7iVbfv55aNVASg3dzWvES9dmWsL2KhfByw==", - "dev": true, - "dependencies": { - "@rollup/pluginutils": "^3.0.9", - "source-map-resolve": "^0.6.0" - }, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "@types/node": ">=10.0.0", - "rollup": ">=0.31.2" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/rollup-plugin-sourcemaps/node_modules/source-map-resolve": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.6.0.tgz", - "integrity": "sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==", - "dev": true, - "dependencies": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0" - } - }, - "node_modules/rollup-plugin-terser": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", - "integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.10.4", - "jest-worker": "^26.2.1", - "serialize-javascript": "^4.0.0", - "terser": "^5.0.0" - }, - "peerDependencies": { - "rollup": "^2.0.0" - } - }, - "node_modules/rollup-plugin-typescript2": { - "version": "0.34.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.34.1.tgz", - "integrity": "sha512-P4cHLtGikESmqi1CA+tdMDUv8WbQV48mzPYt77TSTOPJpERyZ9TXdDgjSDix8Fkqce6soYz3+fa4lrC93IEkcw==", - "dev": true, - "dependencies": { - "@rollup/pluginutils": "^4.1.2", - "find-cache-dir": "^3.3.2", - "fs-extra": "^10.0.0", - "semver": "^7.3.7", - "tslib": "^2.4.0" - }, - "peerDependencies": { - "rollup": ">=1.26.3", - "typescript": ">=2.4.0" - } - }, - "node_modules/rollup-plugin-typescript2/node_modules/@rollup/pluginutils": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz", - "integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==", - "dev": true, - "dependencies": { - "estree-walker": "^2.0.1", - "picomatch": "^2.2.2" - }, - "engines": { - "node": ">= 8.0.0" - } - }, - "node_modules/rollup-plugin-typescript2/node_modules/estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true - }, - "node_modules/rollup-plugin-typescript2/node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz", + "integrity": "sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==", "dev": true, "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "@babel/regjsgen": "^0.8.0", + "regenerate": "^1.4.2", + "regenerate-unicode-properties": "^10.1.0", + "regjsparser": "^0.9.1", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.1.0" }, "engines": { - "node": ">=12" + "node": ">=4" } }, - "node_modules/rollup-plugin-typescript2/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "node_modules/regjsparser": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz", + "integrity": "sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" + "jsesc": "~0.5.0" }, "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" + "regjsparser": "bin/parser" } }, - "node_modules/rollup-plugin-typescript2/node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "dev": true - }, - "node_modules/rsvp": { - "version": "4.8.5", - "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.5.tgz", - "integrity": "sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==", + "node_modules/regjsparser/node_modules/jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", "dev": true, - "engines": { - "node": "6.* || >= 7.*" + "bin": { + "jsesc": "bin/jsesc" } }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "node_modules/remap-istanbul": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/remap-istanbul/-/remap-istanbul-0.13.0.tgz", + "integrity": "sha512-rS5ZpVAx3fGtKZkiBe1esXg5mKYbgW9iz8kkADFt3p6lo3NsBBUX1q6SwdhwUtYCGnr7nK6gRlbYK3i8R0jbRA==", "dev": true, - "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": { - "queue-microtask": "^1.2.2" + "istanbul": "0.4.5", + "minimatch": "^3.0.4", + "plugin-error": "^1.0.1", + "source-map": "0.6.1", + "through2": "3.0.0" + }, + "bin": { + "remap-istanbul": "bin/remap-istanbul.js" } }, - "node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "node_modules/remap-istanbul/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "dependencies": { - "ret": "~0.1.10" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "node_modules/safe-regex-test": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", - "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "node_modules/remap-istanbul/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", - "is-regex": "^1.1.4" + "brace-expansion": "^1.1.7" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": "*" } }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "node_modules/sane": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/sane/-/sane-4.1.0.tgz", - "integrity": "sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA==", - "deprecated": "some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added", + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, "dependencies": { - "@cnakazawa/watch": "^1.0.3", - "anymatch": "^2.0.0", - "capture-exit": "^2.0.0", - "exec-sh": "^0.3.2", - "execa": "^1.0.0", - "fb-watchman": "^2.0.0", - "micromatch": "^3.1.4", - "minimist": "^1.1.1", - "walker": "~1.0.5" + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { - "sane": "src/cli.js" + "resolve": "bin/resolve" }, - "engines": { - "node": "6.* || 8.* || >= 10.*" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/sane/node_modules/anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", "dev": true, "dependencies": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/sane/node_modules/braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "node_modules/resolve-cwd/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, - "dependencies": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/sane/node_modules/braces/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, - "node_modules/sane/node_modules/cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "node_modules/resolve.exports": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", "dev": true, - "dependencies": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, "engines": { - "node": ">=4.8" + "node": ">=10" } }, - "node_modules/sane/node_modules/execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true, - "dependencies": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, "engines": { - "node": ">=6" + "iojs": ">=1.0.0", + "node": ">=0.10.0" } }, - "node_modules/sane/node_modules/fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "dependencies": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" + "glob": "^7.1.3" }, - "engines": { - "node": ">=0.10.0" + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/sane/node_modules/fill-range/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "node_modules/rimraf/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "node_modules/sane/node_modules/get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "dependencies": { - "pump": "^3.0.0" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" }, "engines": { - "node": ">=6" + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/sane/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "node_modules/rimraf/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, "engines": { - "node": ">=0.10.0" + "node": "*" } }, - "node_modules/sane/node_modules/is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "node_modules/rollup": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.14.0.tgz", + "integrity": "sha512-Qe7w62TyawbDzB4yt32R0+AbIo6m1/sqO7UPzFS8Z/ksL5mrfhA0v4CavfdmFav3D+ub4QeAgsGEe84DoWe/nQ==", "dev": true, "dependencies": { - "kind-of": "^3.0.2" + "@types/estree": "1.0.5" + }, + "bin": { + "rollup": "dist/bin/rollup" }, "engines": { - "node": ">=0.10.0" + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.14.0", + "@rollup/rollup-android-arm64": "4.14.0", + "@rollup/rollup-darwin-arm64": "4.14.0", + "@rollup/rollup-darwin-x64": "4.14.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.14.0", + "@rollup/rollup-linux-arm64-gnu": "4.14.0", + "@rollup/rollup-linux-arm64-musl": "4.14.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.14.0", + "@rollup/rollup-linux-riscv64-gnu": "4.14.0", + "@rollup/rollup-linux-s390x-gnu": "4.14.0", + "@rollup/rollup-linux-x64-gnu": "4.14.0", + "@rollup/rollup-linux-x64-musl": "4.14.0", + "@rollup/rollup-win32-arm64-msvc": "4.14.0", + "@rollup/rollup-win32-ia32-msvc": "4.14.0", + "@rollup/rollup-win32-x64-msvc": "4.14.0", + "fsevents": "~2.3.2" } }, - "node_modules/sane/node_modules/is-number/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "node_modules/rollup-plugin-sourcemaps": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/rollup-plugin-sourcemaps/-/rollup-plugin-sourcemaps-0.6.3.tgz", + "integrity": "sha512-paFu+nT1xvuO1tPFYXGe+XnQvg4Hjqv/eIhG8i5EspfYYPBKL57X7iVbfv55aNVASg3dzWvES9dmWsL2KhfByw==", "dev": true, "dependencies": { - "is-buffer": "^1.1.5" + "@rollup/pluginutils": "^3.0.9", + "source-map-resolve": "^0.6.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=10.0.0" + }, + "peerDependencies": { + "@types/node": ">=10.0.0", + "rollup": ">=0.31.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } } }, - "node_modules/sane/node_modules/is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "node_modules/rollup-plugin-sourcemaps/node_modules/@rollup/pluginutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", + "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", "dev": true, + "dependencies": { + "@types/estree": "0.0.39", + "estree-walker": "^1.0.1", + "picomatch": "^2.2.2" + }, "engines": { - "node": ">=0.10.0" + "node": ">= 8.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0" } }, - "node_modules/sane/node_modules/micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "node_modules/rollup-plugin-sourcemaps/node_modules/@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "dev": true + }, + "node_modules/rollup-plugin-sourcemaps/node_modules/estree-walker": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", + "dev": true + }, + "node_modules/rollup-plugin-typescript2": { + "version": "0.36.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.36.0.tgz", + "integrity": "sha512-NB2CSQDxSe9+Oe2ahZbf+B4bh7pHwjV5L+RSYpCu7Q5ROuN94F9b6ioWwKfz3ueL3KTtmX4o2MUH2cgHDIEUsw==", "dev": true, "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" + "@rollup/pluginutils": "^4.1.2", + "find-cache-dir": "^3.3.2", + "fs-extra": "^10.0.0", + "semver": "^7.5.4", + "tslib": "^2.6.2" }, - "engines": { - "node": ">=0.10.0" + "peerDependencies": { + "rollup": ">=1.26.3", + "typescript": ">=2.4.0" } }, - "node_modules/sane/node_modules/normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "node_modules/rollup-plugin-typescript2/node_modules/@rollup/pluginutils": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz", + "integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==", "dev": true, "dependencies": { - "remove-trailing-separator": "^1.0.1" + "estree-walker": "^2.0.1", + "picomatch": "^2.2.2" }, "engines": { - "node": ">=0.10.0" + "node": ">= 8.0.0" } }, - "node_modules/sane/node_modules/npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "node_modules/rollup-plugin-typescript2/node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dev": true, "dependencies": { - "path-key": "^2.0.0" + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" }, "engines": { - "node": ">=4" + "node": ">=12" } }, - "node_modules/sane/node_modules/path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "node_modules/rollup-plugin-typescript2/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, "engines": { - "node": ">=4" - } - }, - "node_modules/sane/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" + "node": ">=10" } }, - "node_modules/sane/node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "node_modules/rollup-plugin-typescript2/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { - "shebang-regex": "^1.0.0" + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" }, "engines": { - "node": ">=0.10.0" + "node": ">=10" } }, - "node_modules/sane/node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "dev": true, - "engines": { - "node": ">=0.10.0" + "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": { + "queue-microtask": "^1.2.2" } }, - "node_modules/sane/node_modules/to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "node_modules/safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", "dev": true, "dependencies": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" }, "engines": { - "node": ">=0.10.0" + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/sane/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "node_modules/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, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, - "node_modules/saxes": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", - "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", + "node_modules/safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", "dev": true, "dependencies": { - "xmlchars": "^2.2.0" + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" }, "engines": { - "node": ">=10" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/semver": { @@ -10937,54 +10148,44 @@ } }, "node_modules/serialize-javascript": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", - "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, "dependencies": { "randombytes": "^2.1.0" } }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "node_modules/set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", "dev": true, "dependencies": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" } }, - "node_modules/set-value/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", "dev": true, "dependencies": { - "is-extendable": "^0.1.0" + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/set-value/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true, - "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" } }, "node_modules/shebang-command": { @@ -11008,229 +10209,62 @@ "node": ">=8" } }, - "node_modules/shellwords": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", - "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", - "dev": true, - "optional": true - }, "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", - "dev": true - }, - "node_modules/sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", - "dev": true - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" }, "engines": { - "node": ">=8" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/slice-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "dependencies": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "dependencies": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-node/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "dependencies": { - "kind-of": "^3.2.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-util/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/snapdragon/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/snapdragon/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, "engines": { - "node": ">=0.10.0" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/snapdragon/node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, + "node_modules/smob": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/smob/-/smob-1.5.0.tgz", + "integrity": "sha512-g6T+p7QO8npa+/hNx9ohv1E5pVCmWrVCUzUXJyLdMmftX6ER0oiWY/w9knEonLpnOp6b6FenKnMfR8gqwWdwig==", + "dev": true + }, "node_modules/snapdragon/node_modules/is-data-descriptor": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, + "extraneous": true, "dependencies": { "kind-of": "^3.0.2" }, @@ -11238,23 +10272,11 @@ "node": ">=0.10.0" } }, - "node_modules/snapdragon/node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/snapdragon/node_modules/is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, + "extraneous": true, "dependencies": { "is-accessor-descriptor": "^0.1.6", "is-data-descriptor": "^0.1.4", @@ -11268,7 +10290,7 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true, + "extraneous": true, "engines": { "node": ">=0.10.0" } @@ -11277,7 +10299,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, + "extraneous": true, "engines": { "node": ">=0.10.0" } @@ -11286,28 +10308,28 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true + "extraneous": true }, "node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/source-map-resolve": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", - "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.6.0.tgz", + "integrity": "sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==", + "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", "dev": true, + "license": "MIT", "dependencies": { "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" + "decode-uri-component": "^0.2.0" } }, "node_modules/source-map-support": { @@ -11320,65 +10342,18 @@ "source-map": "^0.6.0" } }, - "node_modules/source-map-support/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-url": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", - "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", - "dev": true - }, - "node_modules/spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, "node_modules/spdx-exceptions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", "dev": true }, - "node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, "node_modules/spdx-license-ids": { "version": "3.0.9", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz", "integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==", "dev": true }, - "node_modules/split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "dependencies": { - "extend-shallow": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -11406,102 +10381,6 @@ "node": ">=8" } }, - "node_modules/static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "dependencies": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -11511,26 +10390,6 @@ "safe-buffer": "~5.2.0" } }, - "node_modules/string_decoder/node_modules/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, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", @@ -11545,28 +10404,59 @@ } }, "node_modules/string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" } }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/string-width/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, "node_modules/string.prototype.trim": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", - "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -11576,61 +10466,71 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", - "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", - "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" } }, - "node_modules/strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, "engines": { "node": ">=8" } }, - "node_modules/strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/strip-final-newline": { @@ -11639,65 +10539,31 @@ "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true, "engines": { - "node": ">=6" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/supports-hyperlinks": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz", - "integrity": "sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0", - "supports-color": "^7.0.0" - }, - "engines": { - "node": ">=8" + "node": ">=6" } }, - "node_modules/supports-hyperlinks/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/supports-hyperlinks/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "has-flag": "^3.0.0" }, "engines": { - "node": ">=8" + "node": ">=4" } }, "node_modules/supports-preserve-symlinks-flag": { @@ -11712,65 +10578,20 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/symbol-tree": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", - "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", - "dev": true - }, - "node_modules/table": { - "version": "6.7.1", - "resolved": "https://registry.npmjs.org/table/-/table-6.7.1.tgz", - "integrity": "sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg==", - "dev": true, - "dependencies": { - "ajv": "^8.0.1", - "lodash.clonedeep": "^4.5.0", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/table/node_modules/ajv": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.0.tgz", - "integrity": "sha512-cnUG4NSBiM4YFBxgZIj/In3/6KX+rQ2l2YPRVcvAMQGWEPKuXoPIhxzwqh31jA3IPbI4qEOp/5ILI4ynioXsGQ==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/table/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/terminal-link": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", - "integrity": "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==", + "node_modules/synckit": { + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.8.tgz", + "integrity": "sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==", "dev": true, "dependencies": { - "ansi-escapes": "^4.2.1", - "supports-hyperlinks": "^2.0.0" + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" }, "engines": { - "node": ">=8" + "node": "^14.18.0 || >=16.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://opencollective.com/unts" } }, "node_modules/terser": { @@ -11791,18 +10612,6 @@ "node": ">=10" } }, - "node_modules/terser/node_modules/acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -11817,18 +10626,54 @@ "node": ">=8" } }, + "node_modules/test-exclude/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, - "node_modules/throat": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", - "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==", - "dev": true - }, "node_modules/through2": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.0.tgz", @@ -11854,45 +10699,6 @@ "node": ">=4" } }, - "node_modules/to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/to-object-path/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "dependencies": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -11905,89 +10711,68 @@ "node": ">=8.0" } }, - "node_modules/tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", - "dev": true, - "dependencies": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.1.2" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/tough-cookie/node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "node_modules/ts-api-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", "dev": true, "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/tr46": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", - "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", - "dev": true, - "dependencies": { - "punycode": "^2.1.1" + "node": ">=16" }, - "engines": { - "node": ">=8" + "peerDependencies": { + "typescript": ">=4.2.0" } }, "node_modules/ts-jest": { - "version": "26.5.6", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-26.5.6.tgz", - "integrity": "sha512-rua+rCP8DxpA8b4DQD/6X2HQS8Zy/xzViVYfEs2OQu68tkCuKLV0Md8pmX55+W24uRIyAsf/BajRfxOs+R2MKA==", + "version": "29.1.2", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.2.tgz", + "integrity": "sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==", "dev": true, + "license": "MIT", "dependencies": { "bs-logger": "0.x", - "buffer-from": "1.x", "fast-json-stable-stringify": "2.x", - "jest-util": "^26.1.0", - "json5": "2.x", - "lodash": "4.x", + "jest-util": "^29.0.0", + "json5": "^2.2.3", + "lodash.memoize": "4.x", "make-error": "1.x", - "mkdirp": "1.x", - "semver": "7.x", - "yargs-parser": "20.x" + "semver": "^7.5.3", + "yargs-parser": "^21.0.1" }, "bin": { "ts-jest": "cli.js" }, "engines": { - "node": ">= 10" + "node": "^16.10.0 || ^18.0.0 || >=20.0.0" }, "peerDependencies": { - "jest": ">=26 <27", - "typescript": ">=3.8 <5.0" - } - }, - "node_modules/ts-jest/node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true, - "bin": { - "mkdirp": "bin/cmd.js" + "@babel/core": ">=7.0.0-beta.0 <8", + "@jest/types": "^29.0.0", + "babel-jest": "^29.0.0", + "jest": "^29.0.0", + "typescript": ">=4.3 <6" }, - "engines": { - "node": ">=10" + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@jest/types": { + "optional": true + }, + "babel-jest": { + "optional": true + }, + "esbuild": { + "optional": true + } } }, "node_modules/ts-jest/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -12038,35 +10823,15 @@ } } }, - "node_modules/ts-node/node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/ts-node/node_modules/acorn-walk": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", - "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/tsconfig-paths": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", - "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", "dev": true, + "license": "MIT", "dependencies": { "@types/json5": "^0.0.29", - "json5": "^1.0.1", + "json5": "^1.0.2", "minimist": "^1.2.6", "strip-bom": "^3.0.0" } @@ -12093,77 +10858,11 @@ } }, "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tslint": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz", - "integrity": "sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg==", - "deprecated": "TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "builtin-modules": "^1.1.1", - "chalk": "^2.3.0", - "commander": "^2.12.1", - "diff": "^4.0.1", - "glob": "^7.1.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.3", - "resolve": "^1.3.2", - "semver": "^5.3.0", - "tslib": "^1.13.0", - "tsutils": "^2.29.0" - }, - "bin": { - "tslint": "bin/tslint" - }, - "engines": { - "node": ">=4.8.0" - }, - "peerDependencies": { - "typescript": ">=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev || >= 4.0.0-dev" - } - }, - "node_modules/tslint/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/tslint/node_modules/tsutils": { - "version": "2.29.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", - "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "peerDependencies": { - "typescript": ">=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 3.0.0-dev || >= 3.1.0-dev" - } - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } + "license": "0BSD" }, "node_modules/type-check": { "version": "0.4.0", @@ -12195,43 +10894,98 @@ "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/typed-array-length": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", - "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", + "call-bind": "^1.0.7", "for-each": "^0.3.3", - "is-typed-array": "^1.1.9" + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dev": true, - "dependencies": { - "is-typedarray": "^1.0.0" - } - }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.4.tgz", + "integrity": "sha512-dGE2Vv8cpVvw28v8HCPqyb08EzbBURxDpuhJvTrusShUfGnhHBafDsLdS1EhhxyL6BJQE+2cT3dDPAv+MQ6oLw==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/uglify-js": { @@ -12308,30 +11062,6 @@ "node": ">=4" } }, - "node_modules/union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, - "dependencies": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/union-value/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/universalify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", @@ -12341,54 +11071,6 @@ "node": ">= 10.0.0" } }, - "node_modules/unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "dependencies": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unset-value/node_modules/has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "dependencies": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unset-value/node_modules/has-value/node_modules/isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "dependencies": { - "isarray": "1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unset-value/node_modules/has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/update-browserslist-db": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", @@ -12428,44 +11110,12 @@ "punycode": "^2.1.0" } }, - "node_modules/urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "deprecated": "Please see https://github.com/lydell/urix#deprecated", - "dev": true - }, - "node_modules/use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "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 }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, - "optional": true, - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", @@ -12473,104 +11123,28 @@ "dev": true }, "node_modules/v8-to-istanbul": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-7.1.2.tgz", - "integrity": "sha512-TxNb7YEUwkLXCQYeudi6lgQ/SZrzNO4kMdlqVxaZPUIUjCv6iSSypUQX70kNBSERpQ8fk48+d61FXk+tgqcWow==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", "dev": true, + "license": "ISC", "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^1.6.0", - "source-map": "^0.7.3" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/v8-to-istanbul/node_modules/source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "node_modules/w3c-hr-time": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", - "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", - "dev": true, - "dependencies": { - "browser-process-hrtime": "^1.0.0" - } - }, - "node_modules/w3c-xmlserializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", - "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", - "dev": true, - "dependencies": { - "xml-name-validator": "^3.0.0" + "convert-source-map": "^2.0.0" }, "engines": { - "node": ">=10" + "node": ">=10.12.0" } }, "node_modules/walker": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz", - "integrity": "sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=", - "dev": true, - "dependencies": { - "makeerror": "1.0.x" - } - }, - "node_modules/webidl-conversions": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", - "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", - "dev": true, - "engines": { - "node": ">=10.4" - } - }, - "node_modules/whatwg-encoding": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", - "dev": true, - "dependencies": { - "iconv-lite": "0.4.24" - } - }, - "node_modules/whatwg-mimetype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", - "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", - "dev": true - }, - "node_modules/whatwg-url": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", - "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "lodash": "^4.7.0", - "tr46": "^2.1.0", - "webidl-conversions": "^6.1.0" - }, - "engines": { - "node": ">=10" + "makeerror": "1.0.12" } }, "node_modules/which": { @@ -12604,24 +11178,18 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, "node_modules/which-typed-array": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", - "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", "dev": true, + "license": "MIT", "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0", - "is-typed-array": "^1.1.10" + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -12646,24 +11214,48 @@ "dev": true }, "node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -12674,11 +11266,12 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/color-convert": { + "node_modules/wrap-ansi-cjs/node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -12686,196 +11279,152 @@ "node": ">=7.0.0" } }, - "node_modules/wrap-ansi/node_modules/color-name": { + "node_modules/wrap-ansi-cjs/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "node_modules/write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } + "license": "MIT" }, - "node_modules/ws": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.1.tgz", - "integrity": "sha512-2c6faOUH/nhoQN6abwMloF7Iyl0ZS2E9HGtsiLrWn0zOOMWlhtDmdf/uihDt6jnuCxgtwGBNy6Onsoy2s2O2Ow==", + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true, + "license": "MIT", "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "node": ">=12" }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "node_modules/xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", - "dev": true - }, - "node_modules/xmlchars": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", - "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", - "dev": true - }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, + "license": "MIT", "engines": { - "node": ">=0.4" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "node_modules/wrap-ansi/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, + "license": "MIT", "dependencies": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" }, "engines": { - "node": ">=8" - } - }, - "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "dev": true, - "engines": { - "node": ">=10" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/yargs/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, + "license": "MIT", "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" + "ansi-regex": "^6.0.1" }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/yargs/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/write-file-atomic": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", "dev": true, + "license": "ISC", "dependencies": { - "p-locate": "^4.1.0" + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" }, "engines": { - "node": ">=8" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/yargs/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/write-file-atomic/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true, - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "license": "ISC" }, - "node_modules/yargs/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, "engines": { - "node": ">=8" + "node": ">=0.4" } }, - "node_modules/yargs/node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, + "license": "ISC", "engines": { - "node": ">=6" + "node": ">=10" } }, - "node_modules/yargs/node_modules/path-exists": { + "node_modules/yallist": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, "engines": { - "node": ">=8" + "node": ">=12" } }, - "node_modules/yargs/node_modules/yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, + "license": "ISC", "engines": { - "node": ">=6" + "node": ">=12" } }, "node_modules/yn": { @@ -12886,29 +11435,36 @@ "engines": { "node": ">=6" } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } }, "dependencies": { + "@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true + }, "@ampproject/remapping": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", - "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", "dev": true, "requires": { - "@jridgewell/gen-mapping": "^0.1.0", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "dependencies": { - "@jridgewell/gen-mapping": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", - "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", - "dev": true, - "requires": { - "@jridgewell/set-array": "^1.0.0", - "@jridgewell/sourcemap-codec": "^1.4.10" - } - } + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" } }, "@babel/code-frame": { @@ -12948,14 +11504,6 @@ "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" - }, - "dependencies": { - "convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true - } } }, "@babel/generator": { @@ -13000,23 +11548,6 @@ "browserslist": "^4.23.1", "lru-cache": "^5.1.1", "semver": "^6.3.1" - }, - "dependencies": { - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - } } }, "@babel/helper-create-class-features-plugin": { @@ -13383,6 +11914,15 @@ "@babel/helper-plugin-utils": "^7.8.0" } }, + "@babel/plugin-syntax-jsx": { + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.1.tgz", + "integrity": "sha512-2eCtxZXf+kbkMIsXS4poTvT4Yu5rXiRa+9xGVT56raghjmBTKMpFNc9R4IDiB4emao9eO22Ox7CxuJG7BgExqA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.0" + } + }, "@babel/plugin-syntax-logical-assignment-operators": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", @@ -13455,6 +11995,15 @@ "@babel/helper-plugin-utils": "^7.14.5" } }, + "@babel/plugin-syntax-typescript": { + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.24.1.tgz", + "integrity": "sha512-Yhnmvy5HZEnHUty6i++gcfH1/l68AHnItFHnaCv6hn9dNh0hQvvQJsxpi4BMBFN5DLeHBuucT/0DgzXif/OyRw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.0" + } + }, "@babel/plugin-syntax-unicode-sets-regex": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz", @@ -14065,9 +12614,9 @@ "dev": true }, "@babel/runtime": { - "version": "7.22.11", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.11.tgz", - "integrity": "sha512-ee7jVNlWN09+KftVOu9n7S8gQzD/Z6hN/I8VBRXW4P1+Xe7kJGXMwu8vds4aGIMHZnNbdpSWCfZZtinytpcAvA==", + "version": "7.24.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.4.tgz", + "integrity": "sha512-dkxf7+hn8mFBwKjs9bvBlArzLVxVbS8usaPUDd5p2a9JCL9tB8OaOVN1isD4+Xyk4ns89/xeOmbQvgdK7IIVdA==", "dev": true, "requires": { "regenerator-runtime": "^0.14.0" @@ -14116,16 +12665,6 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, - "@cnakazawa/watch": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", - "integrity": "sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ==", - "dev": true, - "requires": { - "exec-sh": "^0.3.2", - "minimist": "^1.2.0" - } - }, "@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -14147,32 +12686,77 @@ } } }, + "@es-joy/jsdoccomment": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.42.0.tgz", + "integrity": "sha512-R1w57YlVA6+YE01wch3GPYn6bCsrOV3YW/5oGGE2tmX6JcL9Nr+b5IikrjMPF+v9CV3ay+obImEdsDhovhJrzw==", + "dev": true, + "requires": { + "comment-parser": "1.4.1", + "esquery": "^1.5.0", + "jsdoc-type-pratt-parser": "~4.0.0" + } + }, + "@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^3.3.0" + } + }, + "@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true + }, "@eslint/eslintrc": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", - "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "requires": { "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "dependencies": { + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "globals": { - "version": "13.11.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.11.0.tgz", - "integrity": "sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g==", + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, "requires": { "type-fest": "^0.20.2" } }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, "type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", @@ -14181,23 +12765,98 @@ } } }, + "@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "dev": true + }, "@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, "requires": { - "@humanwhocodes/object-schema": "^1.2.0", - "debug": "^4.1.1", - "minimatch": "^3.0.4" + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "dependencies": { + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } } }, + "@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true + }, "@humanwhocodes/object-schema": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz", - "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", "dev": true }, + "@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "requires": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true + }, + "string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "requires": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + } + }, + "strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "requires": { + "ansi-regex": "^6.0.1" + } + } + } + }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -14211,6 +12870,21 @@ "resolve-from": "^5.0.0" }, "dependencies": { + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -14221,6 +12895,16 @@ "path-exists": "^4.0.0" } }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -14248,18 +12932,6 @@ "p-limit": "^2.2.0" } }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, "resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -14275,16 +12947,16 @@ "dev": true }, "@jest/console": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-26.6.2.tgz", - "integrity": "sha512-IY1R2i2aLsLr7Id3S6p2BA82GNWryt4oSvEXLAKc+L2zdi89dSkE8xC1C+0kpATG4JhBJREnQOH7/zmccM2B0g==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", "dev": true, "requires": { - "@jest/types": "^26.6.2", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", - "jest-message-util": "^26.6.2", - "jest-util": "^26.6.2", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", "slash": "^3.0.0" }, "dependencies": { @@ -14298,9 +12970,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -14340,37 +13012,37 @@ } }, "@jest/core": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-26.6.3.tgz", - "integrity": "sha512-xvV1kKbhfUqFVuZ8Cyo+JPpipAHHAV3kcDBftiduK8EICXmTFddryy3P7NfZt8Pv37rA9nEJBKCCkglCPt/Xjw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", "dev": true, "requires": { - "@jest/console": "^26.6.2", - "@jest/reporters": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", + "ci-info": "^3.2.0", "exit": "^0.1.2", - "graceful-fs": "^4.2.4", - "jest-changed-files": "^26.6.2", - "jest-config": "^26.6.3", - "jest-haste-map": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.2", - "jest-resolve-dependencies": "^26.6.3", - "jest-runner": "^26.6.3", - "jest-runtime": "^26.6.3", - "jest-snapshot": "^26.6.2", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "jest-watcher": "^26.6.2", - "micromatch": "^4.0.2", - "p-each-series": "^2.1.0", - "rimraf": "^3.0.0", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "strip-ansi": "^6.0.0" }, @@ -14385,9 +13057,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -14427,73 +13099,92 @@ } }, "@jest/environment": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-26.6.2.tgz", - "integrity": "sha512-nFy+fHl28zUrRsCeMB61VDThV1pVTtlEokBRgqPrcT1JNq4yRNIyTHfyht6PqtUvY9IsuLGTrbG8kPXjSZIZwA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", "dev": true, "requires": { - "@jest/fake-timers": "^26.6.2", - "@jest/types": "^26.6.2", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", - "jest-mock": "^26.6.2" + "jest-mock": "^29.7.0" + } + }, + "@jest/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "dev": true, + "requires": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + } + }, + "@jest/expect-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "dev": true, + "requires": { + "jest-get-type": "^29.6.3" } }, "@jest/fake-timers": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-26.6.2.tgz", - "integrity": "sha512-14Uleatt7jdzefLPYM3KLcnUl1ZNikaKq34enpb5XG9i81JpppDb5muZvonvKyrl7ftEHkKS5L5/eB/kxJ+bvA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", "dev": true, "requires": { - "@jest/types": "^26.6.2", - "@sinonjs/fake-timers": "^6.0.1", + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", "@types/node": "*", - "jest-message-util": "^26.6.2", - "jest-mock": "^26.6.2", - "jest-util": "^26.6.2" + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" } }, "@jest/globals": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.6.2.tgz", - "integrity": "sha512-85Ltnm7HlB/KesBUuALwQ68YTU72w9H2xW9FjZ1eL1U3lhtefjjl5c2MiUbpXt/i6LaPRvoOFJ22yCBSfQ0JIA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", "dev": true, "requires": { - "@jest/environment": "^26.6.2", - "@jest/types": "^26.6.2", - "expect": "^26.6.2" + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" } }, "@jest/reporters": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-26.6.2.tgz", - "integrity": "sha512-h2bW53APG4HvkOnVMo8q3QXa6pcaNt1HkwVsOPMBV6LD/q9oSpxNSYZQYkAnjdMjrJ86UuYeLo+aEZClV6opnw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", "dev": true, "requires": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", "chalk": "^4.0.0", "collect-v8-coverage": "^1.0.0", "exit": "^0.1.2", - "glob": "^7.1.2", - "graceful-fs": "^4.2.4", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^4.0.3", + "istanbul-lib-instrument": "^6.0.0", "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.0.2", - "jest-haste-map": "^26.6.2", - "jest-resolve": "^26.6.2", - "jest-util": "^26.6.2", - "jest-worker": "^26.6.2", - "node-notifier": "^8.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", "slash": "^3.0.0", - "source-map": "^0.6.0", "string-length": "^4.0.1", - "terminal-link": "^2.0.0", - "v8-to-istanbul": "^7.0.0" + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" }, "dependencies": { "ansi-styles": { @@ -14505,10 +13196,20 @@ "color-convert": "^2.0.1" } }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -14530,17 +13231,34 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } }, "supports-color": { "version": "7.2.0", @@ -14553,71 +13271,71 @@ } } }, + "@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "requires": { + "@sinclair/typebox": "^0.27.8" + } + }, "@jest/source-map": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-26.6.2.tgz", - "integrity": "sha512-YwYcCwAnNmOVsZ8mr3GfnzdXDAl4LaenZP5z+G0c8bzC9/dugL8zRmxZzdoTl4IaS3CryS1uWnROLPFmb6lVvA==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", "dev": true, "requires": { + "@jridgewell/trace-mapping": "^0.3.18", "callsites": "^3.0.0", - "graceful-fs": "^4.2.4", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } + "graceful-fs": "^4.2.9" } }, "@jest/test-result": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-26.6.2.tgz", - "integrity": "sha512-5O7H5c/7YlojphYNrK02LlDIV2GNPYisKwHm2QTKjNZeEzezCbwYs9swJySv2UfPMyZ0VdsmMv7jIlD/IKYQpQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", "dev": true, "requires": { - "@jest/console": "^26.6.2", - "@jest/types": "^26.6.2", + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" } }, "@jest/test-sequencer": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.6.3.tgz", - "integrity": "sha512-YHlVIjP5nfEyjlrSr8t/YdNfU/1XEt7c5b4OxcXCjyRhjzLYu/rO69/WHPuYcbCWkz8kAeZVZp2N2+IOLLEPGw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", "dev": true, "requires": { - "@jest/test-result": "^26.6.2", - "graceful-fs": "^4.2.4", - "jest-haste-map": "^26.6.2", - "jest-runner": "^26.6.3", - "jest-runtime": "^26.6.3" + "@jest/test-result": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" } }, "@jest/transform": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-26.6.2.tgz", - "integrity": "sha512-E9JjhUgNzvuQ+vVAL21vlyfy12gP0GhazGgJC4h6qUt1jSdUXGWJ1wfu/X7Sd8etSgxV4ovT1pb9v5D6QW4XgA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", "dev": true, "requires": { - "@babel/core": "^7.1.0", - "@jest/types": "^26.6.2", - "babel-plugin-istanbul": "^6.0.0", + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", "chalk": "^4.0.0", - "convert-source-map": "^1.4.0", - "fast-json-stable-stringify": "^2.0.0", - "graceful-fs": "^4.2.4", - "jest-haste-map": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-util": "^26.6.2", - "micromatch": "^4.0.2", - "pirates": "^4.0.1", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", "slash": "^3.0.0", - "source-map": "^0.6.1", - "write-file-atomic": "^3.0.0" + "write-file-atomic": "^4.0.2" }, "dependencies": { "ansi-styles": { @@ -14630,9 +13348,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -14660,12 +13378,6 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -14678,15 +13390,16 @@ } }, "@jest/types": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", - "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", "dev": true, "requires": { + "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", "@types/node": "*", - "@types/yargs": "^15.0.0", + "@types/yargs": "^17.0.8", "chalk": "^4.0.0" }, "dependencies": { @@ -14700,9 +13413,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -14753,9 +13466,9 @@ } }, "@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true }, "@jridgewell/set-array": { @@ -14765,19 +13478,19 @@ "dev": true }, "@jridgewell/source-map": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.3.tgz", - "integrity": "sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", "dev": true, "requires": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" } }, "@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, "@jridgewell/trace-mapping": { @@ -14816,140 +13529,244 @@ "fastq": "^1.6.0" } }, + "@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true + }, + "@pkgr/core": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", + "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", + "dev": true + }, "@rollup/plugin-babel": { "version": "6.0.4", "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-6.0.4.tgz", - "integrity": "sha512-YF7Y52kFdFT/xVSuVdjkV5ZdX/3YtmX0QulG+x0taQOtJdHYzVU61aSSkAgVJ7NOv6qPkIYiJSgSWWN/DM5sGw==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.18.6", - "@rollup/pluginutils": "^5.0.1" - }, - "dependencies": { - "@rollup/pluginutils": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.5.tgz", - "integrity": "sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q==", - "dev": true, - "requires": { - "@types/estree": "^1.0.0", - "estree-walker": "^2.0.2", - "picomatch": "^2.3.1" - } - }, - "@types/estree": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.4.tgz", - "integrity": "sha512-2JwWnHK9H+wUZNorf2Zr6ves96WHoWDJIftkcxPKsS7Djta6Zu519LarhRNljPXkpsZR2ZMwNCPeW7omW07BJw==", - "dev": true - }, - "estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true - } + "integrity": "sha512-YF7Y52kFdFT/xVSuVdjkV5ZdX/3YtmX0QulG+x0taQOtJdHYzVU61aSSkAgVJ7NOv6qPkIYiJSgSWWN/DM5sGw==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.18.6", + "@rollup/pluginutils": "^5.0.1" } }, "@rollup/plugin-node-resolve": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.3.0.tgz", - "integrity": "sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==", + "version": "15.2.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.2.3.tgz", + "integrity": "sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==", "dev": true, "requires": { - "@rollup/pluginutils": "^3.1.0", - "@types/resolve": "1.17.1", + "@rollup/pluginutils": "^5.0.1", + "@types/resolve": "1.20.2", "deepmerge": "^4.2.2", - "is-builtin-module": "^3.1.0", + "is-builtin-module": "^3.2.1", "is-module": "^1.0.0", - "resolve": "^1.19.0" + "resolve": "^1.22.1" + } + }, + "@rollup/plugin-terser": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.4.tgz", + "integrity": "sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==", + "dev": true, + "requires": { + "serialize-javascript": "^6.0.1", + "smob": "^1.0.0", + "terser": "^5.17.4" } }, "@rollup/pluginutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", - "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", + "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", "dev": true, "requires": { - "@types/estree": "0.0.39", - "estree-walker": "^1.0.1", - "picomatch": "^2.2.2" + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^2.3.1" } }, + "@rollup/rollup-android-arm-eabi": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.14.0.tgz", + "integrity": "sha512-jwXtxYbRt1V+CdQSy6Z+uZti7JF5irRKF8hlKfEnF/xJpcNGuuiZMBvuoYM+x9sr9iWGnzrlM0+9hvQ1kgkf1w==", + "dev": true, + "optional": true + }, + "@rollup/rollup-android-arm64": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.14.0.tgz", + "integrity": "sha512-fI9nduZhCccjzlsA/OuAwtFGWocxA4gqXGTLvOyiF8d+8o0fZUeSztixkYjcGq1fGZY3Tkq4yRvHPFxU+jdZ9Q==", + "dev": true, + "optional": true + }, + "@rollup/rollup-darwin-arm64": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.14.0.tgz", + "integrity": "sha512-BcnSPRM76/cD2gQC+rQNGBN6GStBs2pl/FpweW8JYuz5J/IEa0Fr4AtrPv766DB/6b2MZ/AfSIOSGw3nEIP8SA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-darwin-x64": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.14.0.tgz", + "integrity": "sha512-LDyFB9GRolGN7XI6955aFeI3wCdCUszFWumWU0deHA8VpR3nWRrjG6GtGjBrQxQKFevnUTHKCfPR4IvrW3kCgQ==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.14.0.tgz", + "integrity": "sha512-ygrGVhQP47mRh0AAD0zl6QqCbNsf0eTo+vgwkY6LunBcg0f2Jv365GXlDUECIyoXp1kKwL5WW6rsO429DBY/bA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm64-gnu": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.14.0.tgz", + "integrity": "sha512-x+uJ6MAYRlHGe9wi4HQjxpaKHPM3d3JjqqCkeC5gpnnI6OWovLdXTpfa8trjxPLnWKyBsSi5kne+146GAxFt4A==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm64-musl": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.14.0.tgz", + "integrity": "sha512-nrRw8ZTQKg6+Lttwqo6a2VxR9tOroa2m91XbdQ2sUUzHoedXlsyvY1fN4xWdqz8PKmf4orDwejxXHjh7YBGUCA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.14.0.tgz", + "integrity": "sha512-xV0d5jDb4aFu84XKr+lcUJ9y3qpIWhttO3Qev97z8DKLXR62LC3cXT/bMZXrjLF9X+P5oSmJTzAhqwUbY96PnA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-riscv64-gnu": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.14.0.tgz", + "integrity": "sha512-SDDhBQwZX6LPRoPYjAZWyL27LbcBo7WdBFWJi5PI9RPCzU8ijzkQn7tt8NXiXRiFMJCVpkuMkBf4OxSxVMizAw==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-s390x-gnu": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.14.0.tgz", + "integrity": "sha512-RxB/qez8zIDshNJDufYlTT0ZTVut5eCpAZ3bdXDU9yTxBzui3KhbGjROK2OYTTor7alM7XBhssgoO3CZ0XD3qA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-x64-gnu": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.14.0.tgz", + "integrity": "sha512-C6y6z2eCNCfhZxT9u+jAM2Fup89ZjiG5pIzZIDycs1IwESviLxwkQcFRGLjnDrP+PT+v5i4YFvlcfAs+LnreXg==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-x64-musl": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.14.0.tgz", + "integrity": "sha512-i0QwbHYfnOMYsBEyjxcwGu5SMIi9sImDVjDg087hpzXqhBSosxkE7gyIYFHgfFl4mr7RrXksIBZ4DoLoP4FhJg==", + "dev": true, + "optional": true + }, + "@rollup/rollup-win32-arm64-msvc": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.14.0.tgz", + "integrity": "sha512-Fq52EYb0riNHLBTAcL0cun+rRwyZ10S9vKzhGKKgeD+XbwunszSY0rVMco5KbOsTlwovP2rTOkiII/fQ4ih/zQ==", + "dev": true, + "optional": true + }, + "@rollup/rollup-win32-ia32-msvc": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.14.0.tgz", + "integrity": "sha512-e/PBHxPdJ00O9p5Ui43+vixSgVf4NlLsmV6QneGERJ3lnjIua/kim6PRFe3iDueT1rQcgSkYP8ZBBXa/h4iPvw==", + "dev": true, + "optional": true + }, + "@rollup/rollup-win32-x64-msvc": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.14.0.tgz", + "integrity": "sha512-aGg7iToJjdklmxlUlJh/PaPNa4PmqHfyRMLunbL3eaMO0gp656+q1zOKkpJ/CVe9CryJv6tAN1HDoR8cNGzkag==", + "dev": true, + "optional": true + }, + "@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, "@sinonjs/commons": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", - "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", "dev": true, "requires": { "type-detect": "4.0.8" } }, "@sinonjs/fake-timers": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", - "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", "dev": true, "requires": { - "@sinonjs/commons": "^1.7.0" + "@sinonjs/commons": "^3.0.0" } }, - "@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", - "dev": true - }, "@tsconfig/node10": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", - "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", "dev": true }, "@tsconfig/node12": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", - "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", "dev": true }, "@tsconfig/node14": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", - "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", "dev": true }, "@tsconfig/node16": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", - "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", "dev": true }, "@types/babel__core": { - "version": "7.1.14", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.14.tgz", - "integrity": "sha512-zGZJzzBUVDo/eV6KgbE0f0ZI7dInEYvo12Rb70uNQDshC3SkRMb67ja0GgRHZgAX3Za6rhaWlvbDO8rrGyAb1g==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dev": true, "requires": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0", + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", "@types/babel__generator": "*", "@types/babel__template": "*", "@types/babel__traverse": "*" } }, "@types/babel__generator": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.2.tgz", - "integrity": "sha512-MdSJnBjl+bdwkLskZ3NGFp9YcXGx5ggLpQQPqtgakVhsWK0hTtNYhjpZLlWQTviGTvF8at+Bvli3jV7faPdgeQ==", + "version": "7.6.8", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", + "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", "dev": true, "requires": { "@babel/types": "^7.0.0" } }, "@types/babel__template": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.0.tgz", - "integrity": "sha512-NTPErx4/FiPCGScH7foPyr+/1Dkzkni+rHiYHHoTjvwou7AQzJkNeD60A9CXRy+ZEN2B1bggmkTMCDb+Mv5k+A==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dev": true, "requires": { "@babel/parser": "^7.1.0", @@ -14957,142 +13774,73 @@ } }, "@types/babel__traverse": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.14.0.tgz", - "integrity": "sha512-IilJZ1hJBUZwMOVDNTdflOOLzJB/ZtljYVa7k3gEZN/jqIJIPkWHC6dvbX+DD2CwZDHB9wAKzZPzzqMIkW37/w==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.5.tgz", + "integrity": "sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ==", "dev": true, "requires": { - "@babel/types": "^7.3.0" + "@babel/types": "^7.20.7" } }, "@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, "@types/graceful-fs": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", - "integrity": "sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==", + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", + "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", "dev": true, "requires": { "@types/node": "*" } }, "@types/istanbul-lib-coverage": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", - "integrity": "sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", "dev": true }, "@types/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", "dev": true, "requires": { "@types/istanbul-lib-coverage": "*" } }, "@types/istanbul-reports": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", - "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", "dev": true, "requires": { "@types/istanbul-lib-report": "*" } }, "@types/jest": { - "version": "26.0.24", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-26.0.24.tgz", - "integrity": "sha512-E/X5Vib8BWqZNRlDxj9vYXhsDwPYbPINqKF9BsnSoon4RQ0D9moEuLD8txgyypFLH7J4+Lho9Nr/c8H0Fi+17w==", + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", "dev": true, "requires": { - "jest-diff": "^26.0.0", - "pretty-format": "^26.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "diff-sequences": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz", - "integrity": "sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "jest-diff": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.2.tgz", - "integrity": "sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==", - "dev": true, - "requires": { - "chalk": "^4.0.0", - "diff-sequences": "^26.6.2", - "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.2" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } + "expect": "^29.0.0", + "pretty-format": "^29.0.0" } }, "@types/json-schema": { - "version": "7.0.8", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.8.tgz", - "integrity": "sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg==", + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, "@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, "@types/node": { @@ -15104,74 +13852,71 @@ "undici-types": "~5.26.4" } }, - "@types/normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", + "@types/resolve": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", + "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", "dev": true }, - "@types/prettier": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.3.0.tgz", - "integrity": "sha512-hkc1DATxFLQo4VxPDpMH1gCkPpBbpOoJ/4nhuXw4n63/0R6bCpQECj4+K226UJ4JO/eJQz+1mC2I7JsWanAdQw==", + "@types/semver": { + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", "dev": true }, - "@types/resolve": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", - "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, "@types/stack-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.0.tgz", - "integrity": "sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", "dev": true }, "@types/yargs": { - "version": "15.0.13", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.13.tgz", - "integrity": "sha512-kQ5JNTrbDv3Rp5X2n/iUu37IJBDU2gsZ5R/g1/KHOOEc5IKfUFjXT6DENPGduh08I/pamwtEq4oul7gUqKTQDQ==", + "version": "17.0.32", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", + "integrity": "sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==", "dev": true, "requires": { "@types/yargs-parser": "*" } }, "@types/yargs-parser": { - "version": "20.2.0", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.0.tgz", - "integrity": "sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA==", + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz", - "integrity": "sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg==", - "dev": true, - "requires": { - "@typescript-eslint/experimental-utils": "4.33.0", - "@typescript-eslint/scope-manager": "4.33.0", - "debug": "^4.3.1", - "functional-red-black-tree": "^1.0.1", - "ignore": "^5.1.8", - "regexpp": "^3.1.0", - "semver": "^7.3.5", - "tsutils": "^3.21.0" + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.5.0.tgz", + "integrity": "sha512-HpqNTH8Du34nLxbKgVMGljZMG0rJd2O9ecvr2QLYp+7512ty1j42KnsFwspPXg1Vh8an9YImf6CokUBltisZFQ==", + "dev": true, + "requires": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "7.5.0", + "@typescript-eslint/type-utils": "7.5.0", + "@typescript-eslint/utils": "7.5.0", + "@typescript-eslint/visitor-keys": "7.5.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" }, "dependencies": { - "ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } }, "semver": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", - "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -15179,88 +13924,111 @@ } } }, - "@typescript-eslint/eslint-plugin-tslint": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin-tslint/-/eslint-plugin-tslint-4.33.0.tgz", - "integrity": "sha512-o3ujMErtZJPgiNRETRJefo1bFNrloocOa5dMU49OW/G+Rq92IbXTY6FSF5MOwrdQK1X+VBEcA8y6PhUPWGlYqA==", - "dev": true, - "requires": { - "@typescript-eslint/experimental-utils": "4.33.0", - "lodash": "^4.17.21" - } - }, - "@typescript-eslint/experimental-utils": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz", - "integrity": "sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q==", + "@typescript-eslint/parser": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.5.0.tgz", + "integrity": "sha512-cj+XGhNujfD2/wzR1tabNsidnYRaFfEkcULdcIyVBYcXjBvBKOes+mpMBP7hMpOyk+gBcfXsrg4NBGAStQyxjQ==", "dev": true, "requires": { - "@types/json-schema": "^7.0.7", - "@typescript-eslint/scope-manager": "4.33.0", - "@typescript-eslint/types": "4.33.0", - "@typescript-eslint/typescript-estree": "4.33.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" - }, - "dependencies": { - "eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^2.0.0" - } - } + "@typescript-eslint/scope-manager": "7.5.0", + "@typescript-eslint/types": "7.5.0", + "@typescript-eslint/typescript-estree": "7.5.0", + "@typescript-eslint/visitor-keys": "7.5.0", + "debug": "^4.3.4" } }, - "@typescript-eslint/parser": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.33.0.tgz", - "integrity": "sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==", + "@typescript-eslint/scope-manager": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.5.0.tgz", + "integrity": "sha512-Z1r7uJY0MDeUlql9XJ6kRVgk/sP11sr3HKXn268HZyqL7i4cEfrdFuSSY/0tUqT37l5zT0tJOsuDP16kio85iA==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "4.33.0", - "@typescript-eslint/types": "4.33.0", - "@typescript-eslint/typescript-estree": "4.33.0", - "debug": "^4.3.1" + "@typescript-eslint/types": "7.5.0", + "@typescript-eslint/visitor-keys": "7.5.0" } }, - "@typescript-eslint/scope-manager": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz", - "integrity": "sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ==", + "@typescript-eslint/type-utils": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.5.0.tgz", + "integrity": "sha512-A021Rj33+G8mx2Dqh0nMO9GyjjIBK3MqgVgZ2qlKf6CJy51wY/lkkFqq3TqqnH34XyAHUkq27IjlUkWlQRpLHw==", "dev": true, "requires": { - "@typescript-eslint/types": "4.33.0", - "@typescript-eslint/visitor-keys": "4.33.0" + "@typescript-eslint/typescript-estree": "7.5.0", + "@typescript-eslint/utils": "7.5.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" } }, "@typescript-eslint/types": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz", - "integrity": "sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.5.0.tgz", + "integrity": "sha512-tv5B4IHeAdhR7uS4+bf8Ov3k793VEVHd45viRRkehIUZxm0WF82VPiLgHzA/Xl4TGPg1ZD49vfxBKFPecD5/mg==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz", - "integrity": "sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.5.0.tgz", + "integrity": "sha512-YklQQfe0Rv2PZEueLTUffiQGKQneiIEKKnfIqPIOxgM9lKSZFCjT5Ad4VqRKj/U4+kQE3fa8YQpskViL7WjdPQ==", "dev": true, "requires": { - "@typescript-eslint/types": "4.33.0", - "@typescript-eslint/visitor-keys": "4.33.0", - "debug": "^4.3.1", - "globby": "^11.0.3", - "is-glob": "^4.0.1", - "semver": "^7.3.5", - "tsutils": "^3.21.0" + "@typescript-eslint/types": "7.5.0", + "@typescript-eslint/visitor-keys": "7.5.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "@typescript-eslint/utils": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.5.0.tgz", + "integrity": "sha512-3vZl9u0R+/FLQcpy2EHyRGNqAS/ofJ3Ji8aebilfJe+fobK8+LbIFmrHciLVDxjDoONmufDcnVSF38KwMEOjzw==", + "dev": true, + "requires": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "7.5.0", + "@typescript-eslint/types": "7.5.0", + "@typescript-eslint/typescript-estree": "7.5.0", + "semver": "^7.5.4" }, "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -15269,43 +14037,33 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz", - "integrity": "sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.5.0.tgz", + "integrity": "sha512-mcuHM/QircmA6O7fy6nn2w/3ditQkj+SgtOc8DW3uQ10Yfj42amm2i+6F2K4YAOPNNTmE6iM1ynM6lrSwdendA==", "dev": true, "requires": { - "@typescript-eslint/types": "4.33.0", - "eslint-visitor-keys": "^2.0.0" + "@typescript-eslint/types": "7.5.0", + "eslint-visitor-keys": "^3.4.1" } }, - "abab": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", - "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", + "@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", "dev": true }, "abbrev": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", - "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "integrity": "sha512-LEyx4aLEC3x6T0UguF6YILf+ntvmOaWsVfENmIW0E9H09vKlLDGelMjjSm0jkDHALj8A8quZ/HapKNigzwge+Q==", "dev": true }, "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true }, - "acorn-globals": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", - "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", - "dev": true, - "requires": { - "acorn": "^7.1.1", - "acorn-walk": "^7.1.1" - } - }, "acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", @@ -15314,20 +14072,11 @@ "requires": {} }, "acorn-walk": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", - "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", "dev": true }, - "agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dev": true, - "requires": { - "debug": "4" - } - }, "ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -15343,15 +14092,18 @@ "amdefine": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "integrity": "sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==", "dev": true, "optional": true }, "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", + "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", + "dev": true, + "requires": { + "ansi-wrap": "^0.1.0" + } }, "ansi-escapes": { "version": "4.3.2", @@ -15380,19 +14132,25 @@ "ansi-wrap": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", - "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", + "integrity": "sha512-ZyznvL8k/FZeQHr2T6LzcJ/+vBApDnMNZvfVFy3At0knswWd6rJ3/0Hhmpu8oqa6C92npmozs890sX9Dl6q+Qw==", "dev": true }, "anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, "requires": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" } }, + "are-docs-informative": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", + "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", + "dev": true + }, "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -15400,52 +14158,44 @@ "dev": true }, "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "arr-diff": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "integrity": "sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==", "dev": true }, "arr-union": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==", "dev": true }, "array-buffer-byte-length": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", - "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "is-array-buffer": "^3.0.1" + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" } }, "array-includes": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", - "integrity": "sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", - "get-intrinsic": "^1.1.3", + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", "is-string": "^1.0.7" } }, @@ -15455,64 +14205,70 @@ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true + "array.prototype.findlastindex": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", + "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + } }, "array.prototype.flat": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", - "integrity": "sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", + "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", "es-shim-unscopables": "^1.0.0" } }, "array.prototype.flatmap": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", - "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", + "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", "es-shim-unscopables": "^1.0.0" } }, + "arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + } + }, "assign-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true - }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==", "dev": true }, "async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "integrity": "sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==", "dev": true }, "atob": { @@ -15522,24 +14278,26 @@ "dev": true }, "available-typed-arrays": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", - "dev": true + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "requires": { + "possible-typed-array-names": "^1.0.0" + } }, "babel-jest": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-26.6.3.tgz", - "integrity": "sha512-pl4Q+GAVOHwvjrck6jKjvmGhnO3jHX/xuB9d27f+EJZ/6k+6nMuPjorrYp7s++bKKdANwzElBWnLWaObvTnaZA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", "dev": true, "requires": { - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/babel__core": "^7.1.7", - "babel-plugin-istanbul": "^6.0.0", - "babel-preset-jest": "^26.6.2", + "@jest/transform": "^29.7.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", + "graceful-fs": "^4.2.9", "slash": "^3.0.0" }, "dependencies": { @@ -15553,9 +14311,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -15595,27 +14353,42 @@ } }, "babel-plugin-istanbul": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0.tgz", - "integrity": "sha512-AF55rZXpe7trmEylbaE1Gv54wn6rwU03aptvRoVIGP8YykoSxqdVLV1TfwflBCE/QtHmqtP8SWlTENqbK8GCSQ==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0", "@istanbuljs/load-nyc-config": "^1.0.0", "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-instrument": "^5.0.4", "test-exclude": "^6.0.0" + }, + "dependencies": { + "istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "dev": true, + "requires": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + } + } } }, "babel-plugin-jest-hoist": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.6.2.tgz", - "integrity": "sha512-PO9t0697lNTmcEHH69mdtYiOIkkOlj9fySqfO3K1eCcdISevLAE0xY59VLLUj0SoiPiTX/JU2CYFpILydUa5Lw==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", "dev": true, "requires": { "@babel/template": "^7.3.3", "@babel/types": "^7.3.3", - "@types/babel__core": "^7.0.0", + "@types/babel__core": "^7.1.14", "@types/babel__traverse": "^7.0.6" } }, @@ -15670,12 +14443,12 @@ } }, "babel-preset-jest": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-26.6.2.tgz", - "integrity": "sha512-YvdtlVm9t3k777c5NPQIv6cxFFFapys25HiUmuSgHwIZhfifweR5c5Sf5nwE3MAbfu327CYSvps8Yx6ANLyleQ==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", "dev": true, "requires": { - "babel-plugin-jest-hoist": "^26.6.2", + "babel-plugin-jest-hoist": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0" } }, @@ -15685,40 +14458,13 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - } - } - }, "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "braces": { @@ -15730,12 +14476,6 @@ "fill-range": "^7.0.1" } }, - "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==", - "dev": true - }, "browserslist": { "version": "4.23.2", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.2.tgz", @@ -15767,42 +14507,28 @@ } }, "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", "dev": true }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - } - }, "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dev": true, "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" } }, "callsites": { @@ -15823,15 +14549,6 @@ "integrity": "sha512-GFtY2+qt91kzyMk6j48dJcwJVq5uTkk71XxE3RtScx7XWRLsO7bU44LOFkOZYR8w9YMS0UhPSYpN/6rAMImmLw==", "dev": true }, - "capture-exit": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", - "integrity": "sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g==", - "dev": true, - "requires": { - "rsvp": "^4.8.4" - } - }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -15850,130 +14567,77 @@ "dev": true }, "ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", "dev": true }, "cjs-module-lexer": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz", - "integrity": "sha512-uc2Vix1frTfnuzxxu1Hp4ktSvM3QaI4oXl4ZUqL1wjTu/BGki9TrCWoqLTg/drR1KwAEarXuRFCG2Svr1GxPFw==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", + "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", "dev": true }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" }, "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { - "is-descriptor": "^0.1.0" + "color-convert": "^2.0.1" } }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } + "color-name": "~1.1.4" } }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" } - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true } } }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", "dev": true }, "collect-v8-coverage": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", - "integrity": "sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", "dev": true }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -15986,18 +14650,9 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", @@ -16005,42 +14660,27 @@ "dev": true }, "comment-parser": { - "version": "0.7.6", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-0.7.6.tgz", - "integrity": "sha512-GKNxVA7/iuTnAqGADlTWX4tkhzxZKXp5fLJqKTlQLHkE65XDUKutZ3BHaJC5IGcper2tT3QRD1xr4o3jNpgXXg==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", + "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", "dev": true }, "commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", "dev": true }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, "convert-source-map": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", - "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true }, "core-js-compat": { @@ -16052,6 +14692,72 @@ "browserslist": "^4.23.0" } }, + "create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", @@ -16069,105 +14775,95 @@ "which": "^2.0.1" } }, - "cssom": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", - "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", - "dev": true + "data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + } }, - "cssstyle": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", - "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", "dev": true, "requires": { - "cssom": "~0.3.6" - }, - "dependencies": { - "cssom": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", - "dev": true - } + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" } }, - "data-urls": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", - "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==", + "data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", "dev": true, "requires": { - "abab": "^2.0.3", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^8.0.0" + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" } }, "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "requires": { "ms": "2.1.2" } }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "decimal.js": { - "version": "10.3.1", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", - "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==", - "dev": true - }, "decode-uri-component": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", "dev": true }, + "dedent": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", + "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", + "dev": true, + "requires": {} + }, "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, "deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "dev": true }, - "define-properties": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", - "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dev": true, "requires": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" } }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" } }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, "detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -16181,9 +14877,9 @@ "dev": true }, "diff-sequences": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.5.1.tgz", - "integrity": "sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true }, "dir-glob": { @@ -16198,29 +14894,18 @@ "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "domexception": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", - "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", - "dev": true, - "requires": { - "webidl-conversions": "^5.0.0" - }, - "dependencies": { - "webidl-conversions": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", - "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", - "dev": true - } + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" } }, + "eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, "electron-to-chromium": { "version": "1.5.4", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.4.tgz", @@ -16228,35 +14913,17 @@ "dev": true }, "emittery": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz", - "integrity": "sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ==", + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", "dev": true }, "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, - "end-of-stream": { - "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" - } - }, - "enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "requires": { - "ansi-colors": "^4.1.1" - } - }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -16267,65 +14934,101 @@ } }, "es-abstract": { - "version": "1.21.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.2.tgz", - "integrity": "sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==", - "dev": true, - "requires": { - "array-buffer-byte-length": "^1.0.0", - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "es-set-tostringtag": "^2.0.1", + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.2.0", - "get-symbol-description": "^1.0.0", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", "globalthis": "^1.0.3", "gopd": "^1.0.1", - "has": "^1.0.3", - "has-property-descriptors": "^1.0.0", - "has-proto": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", "has-symbols": "^1.0.3", - "internal-slot": "^1.0.5", - "is-array-buffer": "^3.0.2", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", "is-callable": "^1.2.7", - "is-negative-zero": "^2.0.2", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", + "is-shared-array-buffer": "^1.0.3", "is-string": "^1.0.7", - "is-typed-array": "^1.1.10", + "is-typed-array": "^1.1.13", "is-weakref": "^1.0.2", - "object-inspect": "^1.12.3", + "object-inspect": "^1.13.1", "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.4.3", - "safe-regex-test": "^1.0.0", - "string.prototype.trim": "^1.2.7", - "string.prototype.trimend": "^1.0.6", - "string.prototype.trimstart": "^1.0.6", - "typed-array-length": "^1.0.4", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.9" + "which-typed-array": "^1.1.15" + } + }, + "es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.2.4" + } + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true + }, + "es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "requires": { + "es-errors": "^1.3.0" } }, "es-set-tostringtag": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", - "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", "dev": true, "requires": { - "get-intrinsic": "^1.1.3", - "has": "^1.0.3", - "has-tostringtag": "^1.0.0" + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" } }, "es-shim-unscopables": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", - "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", + "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", "dev": true, "requires": { - "has": "^1.0.3" + "hasown": "^2.0.0" } }, "es-to-primitive": { @@ -16348,32 +15051,32 @@ "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true }, "escodegen": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", - "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", + "integrity": "sha512-yhi5S+mNTOuRvyW4gWlg5W1byMaQGWWSYHXsuFZ7GBo7tpyOwi2EdzMP/QWxh9hwkD2m+wDVHJsxhRIj+v/b/A==", "dev": true, "requires": { - "esprima": "^4.0.1", - "estraverse": "^5.2.0", + "esprima": "^2.7.1", + "estraverse": "^1.9.1", "esutils": "^2.0.2", "optionator": "^0.8.1", - "source-map": "~0.6.1" + "source-map": "~0.2.0" }, "dependencies": { "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "integrity": "sha512-25w1fMXQrGdoquWnScXZGckOv+Wes+JDnuN/+7ex3SauFRS72r2lFDec0EKPt2YD1wUJ/IrfEex+9yp4hfSOJA==", "dev": true }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", "dev": true, "requires": { "prelude-ls": "~1.1.2", @@ -16397,20 +15100,23 @@ "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", "dev": true }, "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha512-CBdZ2oa/BHhS4xj5DlhjWNHcan57/5YuvfdLf17iVmIpd9KRm+DFLmC6nBNj+6Ua7Kt3TmOjDpQT1aTYOQtoUA==", "dev": true, - "optional": true + "optional": true, + "requires": { + "amdefine": ">=0.0.4" + } }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", "dev": true, "requires": { "prelude-ls": "~1.1.2" @@ -16419,62 +15125,51 @@ } }, "eslint": { - "version": "7.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", - "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", - "dev": true, - "requires": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", - "ajv": "^6.10.0", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "dev": true, + "requires": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", - "debug": "^4.0.1", + "debug": "^4.3.2", "doctrine": "^3.0.0", - "enquirer": "^2.3.5", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" }, "dependencies": { - "@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -16484,10 +15179,20 @@ "color-convert": "^2.0.1" } }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -16516,9 +15221,9 @@ "dev": true }, "globals": { - "version": "13.9.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.9.0.tgz", - "integrity": "sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==", + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -16530,13 +15235,13 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "requires": { - "lru-cache": "^6.0.0" + "brace-expansion": "^1.1.7" } }, "supports-color": { @@ -16557,21 +15262,21 @@ } }, "eslint-config-prettier": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz", - "integrity": "sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", "dev": true, "requires": {} }, "eslint-import-resolver-node": { - "version": "0.3.7", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz", - "integrity": "sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==", + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", "dev": true, "requires": { "debug": "^3.2.7", - "is-core-module": "^2.11.0", - "resolve": "^1.22.1" + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" }, "dependencies": { "debug": { @@ -16586,9 +15291,9 @@ } }, "eslint-module-utils": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", - "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.1.tgz", + "integrity": "sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==", "dev": true, "requires": { "debug": "^3.2.7" @@ -16606,28 +15311,40 @@ } }, "eslint-plugin-import": { - "version": "2.27.5", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz", - "integrity": "sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==", + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", + "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==", "dev": true, "requires": { - "array-includes": "^3.1.6", - "array.prototype.flat": "^1.3.1", - "array.prototype.flatmap": "^1.3.1", + "array-includes": "^3.1.7", + "array.prototype.findlastindex": "^1.2.3", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", "debug": "^3.2.7", "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.7", - "eslint-module-utils": "^2.7.4", - "has": "^1.0.3", - "is-core-module": "^2.11.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.8.0", + "hasown": "^2.0.0", + "is-core-module": "^2.13.1", "is-glob": "^4.0.3", "minimatch": "^3.1.2", - "object.values": "^1.1.6", - "resolve": "^1.22.1", - "semver": "^6.3.0", - "tsconfig-paths": "^3.14.1" + "object.fromentries": "^2.0.7", + "object.groupby": "^1.0.1", + "object.values": "^1.1.7", + "semver": "^6.3.1", + "tsconfig-paths": "^3.15.0" }, "dependencies": { + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "debug": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", @@ -16645,32 +15362,68 @@ "requires": { "esutils": "^2.0.2" } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } } } }, "eslint-plugin-jsdoc": { - "version": "30.7.13", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-30.7.13.tgz", - "integrity": "sha512-YM4WIsmurrp0rHX6XiXQppqKB8Ne5ATiZLJe2+/fkp9l9ExXFr43BbAbjZaVrpCT+tuPYOZ8k1MICARHnURUNQ==", + "version": "48.2.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.2.3.tgz", + "integrity": "sha512-r9DMAmFs66VNvNqRLLjHejdnJtILrt3xGi+Qx0op0oRfFGVpOR1Hb3BC++MacseHx93d8SKYPhyrC9BS7Os2QA==", "dev": true, "requires": { - "comment-parser": "^0.7.6", - "debug": "^4.3.1", - "jsdoctypeparser": "^9.0.0", - "lodash": "^4.17.20", - "regextras": "^0.7.1", - "semver": "^7.3.4", - "spdx-expression-parse": "^3.0.1" + "@es-joy/jsdoccomment": "~0.42.0", + "are-docs-informative": "^0.0.2", + "comment-parser": "1.4.1", + "debug": "^4.3.4", + "escape-string-regexp": "^4.0.0", + "esquery": "^1.5.0", + "is-builtin-module": "^3.2.1", + "semver": "^7.6.0", + "spdx-expression-parse": "^4.0.0" }, "dependencies": { + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "requires": { "lru-cache": "^6.0.0" } + }, + "spdx-expression-parse": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", + "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } } } }, @@ -16682,87 +15435,55 @@ "requires": {} }, "eslint-plugin-prettier": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.1.tgz", - "integrity": "sha512-htg25EUYUeIhKHXjOinK4BgCcDwtLHjqaxCDsMy5nbnUMkKFvIhMVCp+5GFUXQ4Nr8lBsPqtGAqBenbpFqAA2g==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz", + "integrity": "sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==", "dev": true, "requires": { - "prettier-linter-helpers": "^1.0.0" + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.8.6" } }, "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, "requires": { "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - }, - "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } + "estraverse": "^5.2.0" } }, "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true }, "espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "requires": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" } }, "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha512-OarPfz0lFCiW4/AV2Oy1Rp9qu0iusTKqykwTspGCZtPxmF81JR4MmIebvF1F9+UOKth2ZubLQ4XGGaU+hSn99A==", "dev": true }, "esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "requires": { "estraverse": "^5.1.0" - }, - "dependencies": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true - } } }, "esrecurse": { @@ -16772,26 +15493,18 @@ "dev": true, "requires": { "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true - } } }, "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true }, "estree-walker": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", "dev": true }, "esutils": { @@ -16800,240 +15513,60 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, - "exec-sh": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.6.tgz", - "integrity": "sha512-nQn+hI3yp+oD0huYhKwvYI32+JFeq+XkNcD1GAo3Y/MjxsfVGmrrzrnzjWiNY6f+pUCP440fThsFh5gZrRAU/w==", - "dev": true - }, "execa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", - "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, "requires": { - "cross-spawn": "^7.0.0", - "get-stream": "^5.0.0", - "human-signals": "^1.1.1", + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", "is-stream": "^2.0.0", "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.0", - "onetime": "^5.1.0", - "signal-exit": "^3.0.2", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", "strip-final-newline": "^2.0.0" + }, + "dependencies": { + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + } } }, "exit": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", "dev": true }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, "expect": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/expect/-/expect-26.6.2.tgz", - "integrity": "sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", "dev": true, "requires": { - "@jest/types": "^26.6.2", - "ansi-styles": "^4.0.0", - "jest-get-type": "^26.3.0", - "jest-matcher-utils": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-regex-util": "^26.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - } + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" } }, "extend-shallow": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", "dev": true, "requires": { "assign-symbols": "^1.0.0", "is-extendable": "^1.0.1" } }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - } - } - }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -17041,15 +15574,15 @@ "dev": true }, "fast-diff": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", - "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", "dev": true }, "fast-glob": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", - "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", @@ -17057,6 +15590,17 @@ "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.4" + }, + "dependencies": { + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + } } }, "fast-json-stable-stringify": { @@ -17068,22 +15612,22 @@ "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, "fastq": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.1.tgz", - "integrity": "sha512-HOnr8Mc60eNYl1gzwp6r5RoUyAn5/glBolUzP/Ez6IFVPMPirxn/9phgL6zhOtaTy7ISwPvQ+wT+hfcRZh/bzw==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dev": true, "requires": { "reusify": "^1.0.4" } }, "fb-watchman": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", - "integrity": "sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", "dev": true, "requires": { "bser": "2.1.1" @@ -17118,80 +15662,42 @@ "pkg-dir": "^4.1.0" }, "dependencies": { - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "requires": { - "find-up": "^4.0.0" + "semver": "^6.0.0" } } } }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "dev": true, "requires": { - "flatted": "^3.1.0", + "flatted": "^3.2.9", + "keyv": "^4.5.3", "rimraf": "^3.0.2" } }, "flatted": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", - "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", "dev": true }, "for-each": { @@ -17203,39 +15709,22 @@ "is-callable": "^1.1.3" } }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", "dev": true, "requires": { - "map-cache": "^0.2.2" + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" } }, "fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", "dev": true, "requires": { - "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" @@ -17244,40 +15733,34 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "optional": true }, "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true }, "function.prototype.name": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", - "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0", - "functions-have-names": "^1.2.2" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" } }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, "functions-have-names": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", @@ -17297,14 +15780,16 @@ "dev": true }, "get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" } }, "get-package-type": { @@ -17314,51 +15799,42 @@ "dev": true }, "get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true }, "get-symbol-description": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", - "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" } }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, "glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "version": "10.3.12", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.12.tgz", + "integrity": "sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg==", "dev": true, "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.6", + "minimatch": "^9.0.1", + "minipass": "^7.0.4", + "path-scurry": "^1.10.2" } }, "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "requires": { - "is-glob": "^4.0.1" + "is-glob": "^4.0.3" } }, "globals": { @@ -17377,25 +15853,17 @@ } }, "globby": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", - "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, "requires": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", "slash": "^3.0.0" - }, - "dependencies": { - "ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", - "dev": true - } } }, "gopd": { @@ -17408,46 +15876,28 @@ } }, "graceful-fs": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", - "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, - "growly": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", - "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", - "dev": true, - "optional": true + "graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true }, "handlebars": { - "version": "4.7.7", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", - "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", "dev": true, "requires": { "minimist": "^1.2.5", - "neo-async": "^2.6.0", + "neo-async": "^2.6.2", "source-map": "^0.6.1", "uglify-js": "^3.1.4", "wordwrap": "^1.0.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" } }, "has-bigints": { @@ -17459,22 +15909,22 @@ "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true }, "has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dev": true, "requires": { - "get-intrinsic": "^1.1.1" + "es-define-property": "^1.0.0" } }, "has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", "dev": true }, "has-symbols": { @@ -17484,219 +15934,71 @@ "dev": true }, "has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", - "dev": true, - "requires": { - "has-symbols": "^1.0.2" - } - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } + "has-symbols": "^1.0.3" } }, - "hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true - }, - "html-encoding-sniffer": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", - "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dev": true, "requires": { - "whatwg-encoding": "^1.0.5" + "function-bind": "^1.1.2" } }, "html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true - }, - "http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", - "dev": true, - "requires": { - "@tootallnate/once": "1", - "agent-base": "6", - "debug": "4" - } - }, - "https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", - "dev": true, - "requires": { - "agent-base": "6", - "debug": "4" - } - }, - "human-signals": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", - "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", - "dev": true - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "import-local": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", - "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", - "dev": true, - "requires": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - }, - "dependencies": { - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "requires": { - "find-up": "^4.0.0" - } - } + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true + }, + "ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "import-local": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", + "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "dev": true, + "requires": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" } }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, "requires": { "once": "^1.3.0", @@ -17710,40 +16012,30 @@ "dev": true }, "internal-slot": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", - "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", "dev": true, "requires": { - "get-intrinsic": "^1.2.0", - "has": "^1.0.3", + "es-errors": "^1.3.0", + "hasown": "^2.0.0", "side-channel": "^1.0.4" } }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, "is-array-buffer": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", - "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", "dev": true, "requires": { "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.0", - "is-typed-array": "^1.1.10" + "get-intrinsic": "^1.2.1" } }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, "is-bigint": { @@ -17765,27 +16057,13 @@ "has-tostringtag": "^1.0.0" } }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, "is-builtin-module": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.1.0.tgz", - "integrity": "sha512-OV7JjAgOTfAFJmHZLvpSTb4qi0nIILDV1gWPYDnDJUTNFM5aGlRAhk4QcT8i7TuAleeEV5Fdkqn3t4mS+Q11fg==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", + "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", "dev": true, "requires": { - "builtin-modules": "^3.0.0" - }, - "dependencies": { - "builtin-modules": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", - "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", - "dev": true - } + "builtin-modules": "^3.3.0" } }, "is-callable": { @@ -17794,31 +16072,22 @@ "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true }, - "is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "dev": true, - "requires": { - "ci-info": "^2.0.0" - } - }, "is-core-module": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.0.tgz", - "integrity": "sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "dev": true, "requires": { - "has": "^1.0.3" + "hasown": "^2.0.0" } }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", "dev": true, "requires": { - "kind-of": "^6.0.0" + "is-typed-array": "^1.1.13" } }, "is-date-object": { @@ -17830,24 +16099,6 @@ "has-tostringtag": "^1.0.0" } }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", - "dev": true, - "optional": true - }, "is-extendable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", @@ -17860,7 +16111,7 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true }, "is-fullwidth-code-point": { @@ -17887,13 +16138,13 @@ "is-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", + "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", "dev": true }, "is-negative-zero": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", - "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", "dev": true }, "is-number": { @@ -17911,6 +16162,12 @@ "has-tostringtag": "^1.0.0" } }, + "is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true + }, "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -17920,12 +16177,6 @@ "isobject": "^3.0.1" } }, - "is-potential-custom-element-name": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", - "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", - "dev": true - }, "is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -17937,18 +16188,18 @@ } }, "is-shared-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", - "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", "dev": true, "requires": { - "call-bind": "^1.0.2" + "call-bind": "^1.0.7" } }, "is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true }, "is-string": { @@ -17970,24 +16221,14 @@ } }, "is-typed-array": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", - "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", "dev": true, "requires": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" + "which-typed-array": "^1.1.14" } }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, "is-weakref": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", @@ -17997,44 +16238,28 @@ "call-bind": "^1.0.2" } }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "dev": true, - "optional": true, - "requires": { - "is-docker": "^2.0.0" - } - }, "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", "dev": true }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, "isobject": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", "dev": true }, "istanbul": { "version": "0.4.5", "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", - "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", + "integrity": "sha512-nMtdn4hvK0HjUlzr1DrKSUY8ychprt8dzHOgY2KXsIhHu5PuQQEOTM27gV9Xblyon7aUH/TSFIjRHEODF/FRPg==", "dev": true, "requires": { "abbrev": "1.0.x", @@ -18053,35 +16278,29 @@ "wordwrap": "^1.0.0" }, "dependencies": { - "escodegen": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", - "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "esprima": "^2.7.1", - "estraverse": "^1.9.1", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.2.0" + "sprintf-js": "~1.0.2" } }, - "esprima": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", - "dev": true - }, - "estraverse": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", - "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", - "dev": true + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } }, "glob": { "version": "5.0.15", "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "integrity": "sha512-c9IPMazfRITpmAAKi22dK1VKxGDX9ehhqfABDriL/lzO92xcUKEJPQHrVA/2YHSNFB4iFlykVmWvwo48nr3OxA==", "dev": true, "requires": { "inflight": "^1.0.4", @@ -18094,73 +16313,51 @@ "has-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "integrity": "sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==", "dev": true }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "dependencies": { + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + } } }, - "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" + "brace-expansion": "^1.1.7" } }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true - }, "resolve": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "integrity": "sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg==", "dev": true }, - "source-map": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", - "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", - "dev": true, - "optional": true, - "requires": { - "amdefine": ">=0.0.4" - } - }, "supports-color": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "integrity": "sha512-Jds2VIYDrlp5ui7t8abHN2bjAu4LV/q4N2KivFPpGH0lrka0BMq/33AmECUXlKPcHigkNaqfXRENFju+rlcy+A==", "dev": true, "requires": { "has-flag": "^1.0.0" } }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2" - } - }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -18173,31 +16370,52 @@ } }, "istanbul-lib-coverage": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", - "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true }, "istanbul-lib-instrument": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", - "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.2.tgz", + "integrity": "sha512-1WUsZ9R1lA0HtBSohTkm39WTPlNKSJ5iFk7UwqXkBLoHQT+hfqPsfsTDVuZdKGaBwn7din9bS7SsnoAr943hvw==", "dev": true, "requires": { - "@babel/core": "^7.7.5", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.0.0", - "semver": "^6.3.0" + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } } }, "istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, "requires": { "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", + "make-dir": "^4.0.0", "supports-color": "^7.1.0" }, "dependencies": { @@ -18219,75 +16437,85 @@ } }, "istanbul-lib-source-maps": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", - "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", "dev": true, "requires": { "debug": "^4.1.1", "istanbul-lib-coverage": "^3.0.0", "source-map": "^0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } } }, "istanbul-reports": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", - "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", "dev": true, "requires": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" } }, + "jackspeak": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "dev": true, + "requires": { + "@isaacs/cliui": "^8.0.2", + "@pkgjs/parseargs": "^0.11.0" + } + }, "jest": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest/-/jest-26.6.3.tgz", - "integrity": "sha512-lGS5PXGAzR4RF7V5+XObhqz2KZIDUA1yD0DG6pBVmy10eh0ZIXQImRuzocsI/N2XZ1GrLFwTS27In2i2jlpq1Q==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, "requires": { - "@jest/core": "^26.6.3", + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", "import-local": "^3.0.2", - "jest-cli": "^26.6.3" + "jest-cli": "^29.7.0" } }, "jest-changed-files": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-26.6.2.tgz", - "integrity": "sha512-fDS7szLcY9sCtIip8Fjry9oGf3I2ht/QT21bAHm5Dmf0mD4X3ReNUf17y+bO6fR8WgbIZTlbyG1ak/53cbRzKQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", "dev": true, "requires": { - "@jest/types": "^26.6.2", - "execa": "^4.0.0", - "throat": "^5.0.0" + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" } }, - "jest-cli": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-26.6.3.tgz", - "integrity": "sha512-GF9noBSa9t08pSyl3CY4frMrqp+aQXFGFkf5hEPbh/pIUFYWMK6ZLTfbmadxJVcJrdRoChlWQsA2VkJcDFK8hg==", + "jest-circus": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", "dev": true, "requires": { - "@jest/core": "^26.6.3", - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", "chalk": "^4.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.4", - "import-local": "^3.0.2", - "is-ci": "^2.0.0", - "jest-config": "^26.6.3", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "prompts": "^2.0.1", - "yargs": "^15.4.1" + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" }, "dependencies": { "ansi-styles": { @@ -18300,9 +16528,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -18341,30 +16569,23 @@ } } }, - "jest-config": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-26.6.3.tgz", - "integrity": "sha512-t5qdIj/bCj2j7NFVHb2nFB4aUdfucDn3JRKgrZnplb8nieAirAzRSHP8uDEd+qV6ygzg9Pz4YG7UTJf94LPSyg==", + "jest-cli": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", "dev": true, "requires": { - "@babel/core": "^7.1.0", - "@jest/test-sequencer": "^26.6.3", - "@jest/types": "^26.6.2", - "babel-jest": "^26.6.3", + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "chalk": "^4.0.0", - "deepmerge": "^4.2.2", - "glob": "^7.1.1", - "graceful-fs": "^4.2.4", - "jest-environment-jsdom": "^26.6.2", - "jest-environment-node": "^26.6.2", - "jest-get-type": "^26.3.0", - "jest-jasmine2": "^26.6.3", - "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.2", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "micromatch": "^4.0.2", - "pretty-format": "^26.6.2" + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" }, "dependencies": { "ansi-styles": { @@ -18377,9 +16598,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -18418,16 +16639,34 @@ } } }, - "jest-diff": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-27.5.1.tgz", - "integrity": "sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw==", + "jest-config": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", "dev": true, "requires": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", "chalk": "^4.0.0", - "diff-sequences": "^27.5.1", - "jest-get-type": "^27.5.1", - "pretty-format": "^27.5.1" + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" }, "dependencies": { "ansi-styles": { @@ -18439,6 +16678,16 @@ "color-convert": "^2.0.1" } }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -18464,35 +16713,33 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "jest-get-type": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.5.1.tgz", - "integrity": "sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw==", - "dev": true - }, - "pretty-format": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", - "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "requires": { - "ansi-regex": "^5.0.1", - "ansi-styles": "^5.0.0", - "react-is": "^17.0.1" - }, - "dependencies": { - "ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true - } + "brace-expansion": "^1.1.7" } }, "supports-color": { @@ -18506,26 +16753,16 @@ } } }, - "jest-docblock": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-26.0.0.tgz", - "integrity": "sha512-RDZ4Iz3QbtRWycd8bUEPxQsTlYazfYn/h5R65Fc6gOfwozFhoImx+affzky/FFBuqISPTqjXomoIGJVKBWoo0w==", - "dev": true, - "requires": { - "detect-newline": "^3.0.0" - } - }, - "jest-each": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-26.6.2.tgz", - "integrity": "sha512-Mer/f0KaATbjl8MCJ+0GEpNdqmnVmDYqCTJYTvoo7rqmRiDllmp2AYN+06F93nXcY3ur9ShIjS+CO/uD+BbH4A==", + "jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, "requires": { - "@jest/types": "^26.6.2", "chalk": "^4.0.0", - "jest-get-type": "^26.3.0", - "jest-util": "^26.6.2", - "pretty-format": "^26.6.2" + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "dependencies": { "ansi-styles": { @@ -18538,9 +16775,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -18579,87 +16816,26 @@ } } }, - "jest-environment-jsdom": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-26.6.2.tgz", - "integrity": "sha512-jgPqCruTlt3Kwqg5/WVFyHIOJHsiAvhcp2qiR2QQstuG9yWox5+iHpU3ZrcBxW14T4fe5Z68jAfLRh7joCSP2Q==", - "dev": true, - "requires": { - "@jest/environment": "^26.6.2", - "@jest/fake-timers": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "jest-mock": "^26.6.2", - "jest-util": "^26.6.2", - "jsdom": "^16.4.0" - } - }, - "jest-environment-node": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-26.6.2.tgz", - "integrity": "sha512-zhtMio3Exty18dy8ee8eJ9kjnRyZC1N4C1Nt/VShN1apyXc8rWGtJ9lI7vqiWcyyXS4BVSEn9lxAM2D+07/Tag==", + "jest-docblock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", "dev": true, "requires": { - "@jest/environment": "^26.6.2", - "@jest/fake-timers": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "jest-mock": "^26.6.2", - "jest-util": "^26.6.2" + "detect-newline": "^3.0.0" } }, - "jest-get-type": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.3.0.tgz", - "integrity": "sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig==", - "dev": true - }, - "jest-haste-map": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-26.6.2.tgz", - "integrity": "sha512-easWIJXIw71B2RdR8kgqpjQrbMRWQBgiBwXYEhtGUTaX+doCjBheluShdDMeR8IMfJiTqH4+zfhtg29apJf/8w==", + "jest-each": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", "dev": true, "requires": { - "@jest/types": "^26.6.2", - "@types/graceful-fs": "^4.1.2", - "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "fsevents": "^2.1.2", - "graceful-fs": "^4.2.4", - "jest-regex-util": "^26.0.0", - "jest-serializer": "^26.6.2", - "jest-util": "^26.6.2", - "jest-worker": "^26.6.2", - "micromatch": "^4.0.2", - "sane": "^4.0.3", - "walker": "^1.0.7" - } - }, - "jest-jasmine2": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.6.3.tgz", - "integrity": "sha512-kPKUrQtc8aYwBV7CqBg5pu+tmYXlvFlSFYn18ev4gPFtrRzB15N2gW/Roew3187q2w2eHuu0MU9TJz6w0/nPEg==", - "dev": true, - "requires": { - "@babel/traverse": "^7.1.0", - "@jest/environment": "^26.6.2", - "@jest/source-map": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", + "@jest/types": "^29.6.3", "chalk": "^4.0.0", - "co": "^4.6.0", - "expect": "^26.6.2", - "is-generator-fn": "^2.0.0", - "jest-each": "^26.6.2", - "jest-matcher-utils": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-runtime": "^26.6.3", - "jest-snapshot": "^26.6.2", - "jest-util": "^26.6.2", - "pretty-format": "^26.6.2", - "throat": "^5.0.0" + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" }, "dependencies": { "ansi-styles": { @@ -18672,9 +16848,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -18713,26 +16889,66 @@ } } }, + "jest-environment-node": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", + "dev": true, + "requires": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + } + }, + "jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true + }, + "jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "fsevents": "^2.3.2", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + } + }, "jest-leak-detector": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz", - "integrity": "sha512-i4xlXpsVSMeKvg2cEKdfhh0H39qlJlP5Ex1yQxwF9ubahboQYMgTtz5oML35AVA3B4Eu+YsmwaiKVev9KCvLxg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", "dev": true, "requires": { - "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.2" + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" } }, "jest-matcher-utils": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz", - "integrity": "sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", "dev": true, "requires": { "chalk": "^4.0.0", - "jest-diff": "^26.6.2", - "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.2" + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "dependencies": { "ansi-styles": { @@ -18745,9 +16961,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -18769,30 +16985,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "diff-sequences": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz", - "integrity": "sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==", - "dev": true - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "jest-diff": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.2.tgz", - "integrity": "sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==", - "dev": true, - "requires": { - "chalk": "^4.0.0", - "diff-sequences": "^26.6.2", - "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.2" - } - }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -18805,20 +17003,20 @@ } }, "jest-message-util": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.6.2.tgz", - "integrity": "sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", "dev": true, "requires": { - "@babel/code-frame": "^7.0.0", - "@jest/types": "^26.6.2", + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", - "micromatch": "^4.0.2", - "pretty-format": "^26.6.2", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", "slash": "^3.0.0", - "stack-utils": "^2.0.2" + "stack-utils": "^2.0.3" }, "dependencies": { "ansi-styles": { @@ -18831,9 +17029,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -18873,41 +17071,43 @@ } }, "jest-mock": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-26.6.2.tgz", - "integrity": "sha512-YyFjePHHp1LzpzYcmgqkJ0nm0gg/lJx2aZFzFy1S6eUqNjXsOqTK10zNRff2dNfssgokjkG65OlWNcIlgd3zew==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", "dev": true, "requires": { - "@jest/types": "^26.6.2", - "@types/node": "*" + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" } }, "jest-pnp-resolver": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", - "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", "dev": true, "requires": {} }, "jest-regex-util": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-26.0.0.tgz", - "integrity": "sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", "dev": true }, "jest-resolve": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-26.6.2.tgz", - "integrity": "sha512-sOxsZOq25mT1wRsfHcbtkInS+Ek7Q8jCHUB0ZUTP0tc/c41QHriU/NunqMfCUWsL4H3MHpvQD4QR9kSYhS7UvQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", "dev": true, "requires": { - "@jest/types": "^26.6.2", "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", "jest-pnp-resolver": "^1.2.2", - "jest-util": "^26.6.2", - "read-pkg-up": "^7.0.1", - "resolve": "^1.18.1", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", "slash": "^3.0.0" }, "dependencies": { @@ -18921,9 +17121,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -18945,104 +17145,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", - "dev": true, - "requires": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" - }, - "dependencies": { - "type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", - "dev": true - } - } - }, - "read-pkg-up": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", - "dev": true, - "requires": { - "find-up": "^4.1.0", - "read-pkg": "^5.2.0", - "type-fest": "^0.8.1" - } - }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -19051,52 +17159,46 @@ "requires": { "has-flag": "^4.0.0" } - }, - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true } } }, "jest-resolve-dependencies": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.6.3.tgz", - "integrity": "sha512-pVwUjJkxbhe4RY8QEWzN3vns2kqyuldKpxlxJlzEYfKSvY6/bMvxoFrYYzUO1Gx28yKWN37qyV7rIoIp2h8fTg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", "dev": true, "requires": { - "@jest/types": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-snapshot": "^26.6.2" + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" } }, "jest-runner": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-26.6.3.tgz", - "integrity": "sha512-atgKpRHnaA2OvByG/HpGA4g6CSPS/1LK0jK3gATJAoptC1ojltpmVlYC3TYgdmGp+GLuhzpH30Gvs36szSL2JQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", "dev": true, "requires": { - "@jest/console": "^26.6.2", - "@jest/environment": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", - "emittery": "^0.7.1", - "exit": "^0.1.2", - "graceful-fs": "^4.2.4", - "jest-config": "^26.6.3", - "jest-docblock": "^26.0.0", - "jest-haste-map": "^26.6.2", - "jest-leak-detector": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-resolve": "^26.6.2", - "jest-runtime": "^26.6.3", - "jest-util": "^26.6.2", - "jest-worker": "^26.6.2", - "source-map-support": "^0.5.6", - "throat": "^5.0.0" + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" }, "dependencies": { "ansi-styles": { @@ -19109,9 +17211,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -19139,6 +17241,16 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, + "source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -19151,38 +17263,33 @@ } }, "jest-runtime": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.6.3.tgz", - "integrity": "sha512-lrzyR3N8sacTAMeonbqpnSka1dHNux2uk0qqDXVkMv2c/A3wYnvQ4EXuI013Y6+gSKSCxdaczvf4HF0mVXHRdw==", - "dev": true, - "requires": { - "@jest/console": "^26.6.2", - "@jest/environment": "^26.6.2", - "@jest/fake-timers": "^26.6.2", - "@jest/globals": "^26.6.2", - "@jest/source-map": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/yargs": "^15.0.0", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "requires": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", "chalk": "^4.0.0", - "cjs-module-lexer": "^0.6.0", + "cjs-module-lexer": "^1.0.0", "collect-v8-coverage": "^1.0.0", - "exit": "^0.1.2", "glob": "^7.1.3", - "graceful-fs": "^4.2.4", - "jest-config": "^26.6.3", - "jest-haste-map": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-mock": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.2", - "jest-snapshot": "^26.6.2", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", "slash": "^3.0.0", - "strip-bom": "^4.0.0", - "yargs": "^15.4.1" + "strip-bom": "^4.0.0" }, "dependencies": { "ansi-styles": { @@ -19194,10 +17301,20 @@ "color-convert": "^2.0.1" } }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -19219,12 +17336,35 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -19236,38 +17376,32 @@ } } }, - "jest-serializer": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-26.6.2.tgz", - "integrity": "sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g==", - "dev": true, - "requires": { - "@types/node": "*", - "graceful-fs": "^4.2.4" - } - }, "jest-snapshot": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.6.2.tgz", - "integrity": "sha512-OLhxz05EzUtsAmOMzuupt1lHYXCNib0ECyuZ/PZOx9TrZcC8vL0x+DUG3TL+GLX3yHG45e6YGjIm0XwDc3q3og==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", "dev": true, "requires": { - "@babel/types": "^7.0.0", - "@jest/types": "^26.6.2", - "@types/babel__traverse": "^7.0.4", - "@types/prettier": "^2.0.0", + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", "chalk": "^4.0.0", - "expect": "^26.6.2", - "graceful-fs": "^4.2.4", - "jest-diff": "^26.6.2", - "jest-get-type": "^26.3.0", - "jest-haste-map": "^26.6.2", - "jest-matcher-utils": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-resolve": "^26.6.2", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", "natural-compare": "^1.4.0", - "pretty-format": "^26.6.2", - "semver": "^7.3.2" + "pretty-format": "^29.7.0", + "semver": "^7.5.3" }, "dependencies": { "ansi-styles": { @@ -19280,9 +17414,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -19304,34 +17438,25 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "diff-sequences": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz", - "integrity": "sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==", - "dev": true - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "jest-diff": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.2.tgz", - "integrity": "sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==", + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "requires": { - "chalk": "^4.0.0", - "diff-sequences": "^26.6.2", - "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.2" + "yallist": "^4.0.0" } }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -19349,17 +17474,17 @@ } }, "jest-util": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.6.2.tgz", - "integrity": "sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", "dev": true, "requires": { - "@jest/types": "^26.6.2", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", - "is-ci": "^2.0.0", - "micromatch": "^4.0.2" + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" }, "dependencies": { "ansi-styles": { @@ -19372,9 +17497,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -19414,17 +17539,17 @@ } }, "jest-validate": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.6.2.tgz", - "integrity": "sha512-NEYZ9Aeyj0i5rQqbq+tpIOom0YS1u2MVu6+euBsvpgIme+FOfRmoC4R5p0JiAUpaFvFy24xgrpMknarR/93XjQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", "dev": true, "requires": { - "@jest/types": "^26.6.2", - "camelcase": "^6.0.0", + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", "chalk": "^4.0.0", - "jest-get-type": "^26.3.0", + "jest-get-type": "^29.6.3", "leven": "^3.1.0", - "pretty-format": "^26.6.2" + "pretty-format": "^29.7.0" }, "dependencies": { "ansi-styles": { @@ -19437,15 +17562,15 @@ } }, "camelcase": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", - "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -19485,17 +17610,18 @@ } }, "jest-watcher": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-26.6.2.tgz", - "integrity": "sha512-WKJob0P/Em2csiVthsI68p6aGKTIcsfjH9Gsx1f0A3Italz43e3ho0geSAVsmj09RWOELP1AZ/DXyJgOgDKxXQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", "dev": true, "requires": { - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", - "jest-util": "^26.6.2", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", "string-length": "^4.0.1" }, "dependencies": { @@ -19509,9 +17635,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -19551,14 +17677,15 @@ } }, "jest-worker": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", - "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", "dev": true, "requires": { "@types/node": "*", + "jest-util": "^29.7.0", "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" + "supports-color": "^8.0.0" }, "dependencies": { "has-flag": { @@ -19568,9 +17695,9 @@ "dev": true }, "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "requires": { "has-flag": "^4.0.0" @@ -19585,63 +17712,19 @@ "dev": true }, "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" } }, - "jsdoctypeparser": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-9.0.0.tgz", - "integrity": "sha512-jrTA2jJIL6/DAEILBEh2/w9QxCuwmvNXIry39Ay/HVfhE3o2yVV0U44blYkqdHA/OKloJEqvJy0xU+GSdE2SIw==", - "dev": true - }, - "jsdom": { - "version": "16.6.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.6.0.tgz", - "integrity": "sha512-Ty1vmF4NHJkolaEmdjtxTfSfkdb8Ywarwf63f+F8/mDD1uLSSWDxDuMiZxiPhwunLrn9LOSVItWj4bLYsLN3Dg==", - "dev": true, - "requires": { - "abab": "^2.0.5", - "acorn": "^8.2.4", - "acorn-globals": "^6.0.0", - "cssom": "^0.4.4", - "cssstyle": "^2.3.0", - "data-urls": "^2.0.0", - "decimal.js": "^10.2.1", - "domexception": "^2.0.1", - "escodegen": "^2.0.0", - "form-data": "^3.0.0", - "html-encoding-sniffer": "^2.0.1", - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "^5.0.0", - "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.0", - "parse5": "6.0.1", - "saxes": "^5.0.1", - "symbol-tree": "^3.2.4", - "tough-cookie": "^4.0.0", - "w3c-hr-time": "^1.0.2", - "w3c-xmlserializer": "^2.0.0", - "webidl-conversions": "^6.1.0", - "whatwg-encoding": "^1.0.5", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^8.5.0", - "ws": "^7.4.5", - "xml-name-validator": "^3.0.0" - }, - "dependencies": { - "acorn": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz", - "integrity": "sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA==", - "dev": true - } - } + "jsdoc-type-pratt-parser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", + "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==", + "dev": true }, "jsesc": { "version": "2.5.2", @@ -19649,6 +17732,12 @@ "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true }, + "json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, "json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -19664,7 +17753,7 @@ "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true }, "json5": { @@ -19683,11 +17772,14 @@ "universalify": "^2.0.0" } }, - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true + "keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "requires": { + "json-buffer": "3.0.1" + } }, "kleur": { "version": "3.0.3", @@ -19712,22 +17804,19 @@ } }, "lines-and-columns": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", - "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } }, "lodash.debounce": { "version": "4.0.8", @@ -19735,34 +17824,62 @@ "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", "dev": true }, + "lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", + "dev": true + }, "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", - "dev": true - }, "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, "requires": { - "yallist": "^4.0.0" + "yallist": "^3.0.2" + }, + "dependencies": { + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + } } }, "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, "requires": { - "semver": "^6.0.0" + "semver": "^7.5.3" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } } }, "make-error": { @@ -19772,27 +17889,12 @@ "dev": true }, "makeerror": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz", - "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=", - "dev": true, - "requires": { - "tmpl": "1.0.x" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", "dev": true, "requires": { - "object-visit": "^1.0.0" + "tmpl": "1.0.5" } }, "merge-stream": { @@ -19808,28 +17910,13 @@ "dev": true }, "micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", - "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" - } - }, - "mime-db": { - "version": "1.48.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.48.0.tgz", - "integrity": "sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ==", - "dev": true - }, - "mime-types": { - "version": "2.1.31", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.31.tgz", - "integrity": "sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, "requires": { - "mime-db": "1.48.0" + "braces": "^3.0.2", + "picomatch": "^2.3.1" } }, "mimic-fn": { @@ -19839,68 +17926,45 @@ "dev": true }, "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", "dev": true, "requires": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" } }, "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true }, - "mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - } + "minipass": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", + "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", + "dev": true }, "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "dev": true, "requires": { - "minimist": "^1.2.5" + "minimist": "^1.2.6" } }, "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - } + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, "neo-async": { @@ -19909,51 +17973,12 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", - "dev": true - }, - "node-modules-regexp": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", - "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", "dev": true }, - "node-notifier": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-8.0.2.tgz", - "integrity": "sha512-oJP/9NAdd9+x2Q+rfphB2RJCHjod70RcRLjosiPMMu5gjIfwVnOUGq2nbTjTUbmy0DJ/tFIVT30+Qe3nzl4TJg==", - "dev": true, - "optional": true, - "requires": { - "growly": "^1.3.0", - "is-wsl": "^2.2.0", - "semver": "^7.3.2", - "shellwords": "^0.1.1", - "uuid": "^8.3.0", - "which": "^2.0.2" - }, - "dependencies": { - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "optional": true, - "requires": { - "lru-cache": "^6.0.0" - } - } - } - }, "node-releases": { "version": "2.0.14", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", @@ -19963,32 +17988,12 @@ "nopt": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "integrity": "sha512-4GUt3kSEYmk4ITxzB/b9vaIDfUVWN/Ml1Fwl11IlnIG2iaJ9O6WXZ9SrYM9NLI8OCBieN2Y8SWC2oJV0RQ7qYg==", "dev": true, "requires": { "abbrev": "1" } }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -20004,84 +18009,10 @@ "path-key": "^3.0.0" } }, - "nwsapi": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", - "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", - "dev": true - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", "dev": true }, "object-keys": { @@ -20090,51 +18021,56 @@ "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", "dev": true, "requires": { - "isobject": "^3.0.0" + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" } }, - "object.assign": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "object.fromentries": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "has-symbols": "^1.0.3", - "object-keys": "^1.1.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" } }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "object.groupby": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", "dev": true, "requires": { - "isobject": "^3.0.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" } }, "object.values": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", - "integrity": "sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", + "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" } }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "requires": { "wrappy": "1" @@ -20150,29 +18086,41 @@ } }, "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", "dev": true, "requires": { + "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "type-check": "^0.4.0" } }, - "p-each-series": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz", - "integrity": "sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA==", - "dev": true + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, "parent-module": { @@ -20184,22 +18132,28 @@ "callsites": "^3.0.0" } }, - "parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", - "dev": true + "parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + } }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true }, "path-key": { @@ -20214,6 +18168,24 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, + "path-scurry": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.2.tgz", + "integrity": "sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==", + "dev": true, + "requires": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", + "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", + "dev": true + } + } + }, "path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -20233,12 +18205,57 @@ "dev": true }, "pirates": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", - "integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "requires": { - "node-modules-regexp": "^1.0.0" + "find-up": "^4.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + } } }, "plugin-error": { @@ -20251,23 +18268,12 @@ "arr-diff": "^4.0.0", "arr-union": "^3.1.0", "extend-shallow": "^3.0.2" - }, - "dependencies": { - "ansi-colors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", - "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", - "dev": true, - "requires": { - "ansi-wrap": "^0.1.0" - } - } } }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", "dev": true }, "prelude-ls": { @@ -20277,9 +18283,9 @@ "dev": true }, "prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "dev": true }, "prettier-linter-helpers": { @@ -20292,79 +18298,44 @@ } }, "pretty-format": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", - "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "requires": { - "@jest/types": "^26.6.2", - "ansi-regex": "^5.0.0", - "ansi-styles": "^4.0.0", - "react-is": "^17.0.1" + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" }, "dependencies": { "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true } } }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true - }, "prompts": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.1.tgz", - "integrity": "sha512-EQyfIuO2hPDsX1L/blblV+H7I0knhgAd82cVneCwcdND9B8AuCDuRcBH6yIcG4dFzlOUqbazQqwGjx5xmsNLuQ==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", "dev": true, "requires": { "kleur": "^3.0.3", "sisteransi": "^1.0.5" } }, - "psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "pure-rand": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", "dev": true }, "queue-microtask": { @@ -20383,15 +18354,15 @@ } }, "react-is": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", - "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", "dev": true }, "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==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "requires": { "inherits": "^2.0.3", @@ -20406,18 +18377,18 @@ "dev": true }, "regenerate-unicode-properties": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz", - "integrity": "sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ==", + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.1.tgz", + "integrity": "sha512-X007RyZLsCJVVrjgEFVpLUTZwyOZk3oiL75ZcuYjlIWd6rNJtOjkBwQc5AsRrpbKVkxN6sklw/k/9m2jJYOf8Q==", "dev": true, "requires": { "regenerate": "^1.4.2" } }, "regenerator-runtime": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", - "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==", + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", "dev": true }, "regenerator-transform": { @@ -20429,33 +18400,18 @@ "@babel/runtime": "^7.8.4" } }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, "regexp.prototype.flags": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", - "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "functions-have-names": "^1.2.3" + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" } }, - "regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true - }, "regexpu-core": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz", @@ -20470,12 +18426,6 @@ "unicode-match-property-value-ecmascript": "^2.1.0" } }, - "regextras": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/regextras/-/regextras-0.7.1.tgz", - "integrity": "sha512-9YXf6xtW+qzQ+hcMQXx95MOvfqXFgsKDZodX3qZB0x2n5Z94ioetIITsBtvJbiOyxa/6s9AtyweBLCdPmPko/w==", - "dev": true - }, "regjsparser": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz", @@ -20506,57 +18456,40 @@ "through2": "3.0.0" }, "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } } } }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "repeat-element": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", - "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true }, "resolve": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", - "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, "requires": { - "is-core-module": "^2.11.0", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" } @@ -20584,16 +18517,10 @@ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "resolve.exports": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", "dev": true }, "reusify": { @@ -20609,14 +18536,65 @@ "dev": true, "requires": { "glob": "^7.1.3" + }, + "dependencies": { + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } } }, "rollup": { - "version": "2.79.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz", - "integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==", - "dev": true, - "requires": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.14.0.tgz", + "integrity": "sha512-Qe7w62TyawbDzB4yt32R0+AbIo6m1/sqO7UPzFS8Z/ksL5mrfhA0v4CavfdmFav3D+ub4QeAgsGEe84DoWe/nQ==", + "dev": true, + "requires": { + "@rollup/rollup-android-arm-eabi": "4.14.0", + "@rollup/rollup-android-arm64": "4.14.0", + "@rollup/rollup-darwin-arm64": "4.14.0", + "@rollup/rollup-darwin-x64": "4.14.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.14.0", + "@rollup/rollup-linux-arm64-gnu": "4.14.0", + "@rollup/rollup-linux-arm64-musl": "4.14.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.14.0", + "@rollup/rollup-linux-riscv64-gnu": "4.14.0", + "@rollup/rollup-linux-s390x-gnu": "4.14.0", + "@rollup/rollup-linux-x64-gnu": "4.14.0", + "@rollup/rollup-linux-x64-musl": "4.14.0", + "@rollup/rollup-win32-arm64-msvc": "4.14.0", + "@rollup/rollup-win32-ia32-msvc": "4.14.0", + "@rollup/rollup-win32-x64-msvc": "4.14.0", + "@types/estree": "1.0.5", "fsevents": "~2.3.2" } }, @@ -20630,41 +18608,42 @@ "source-map-resolve": "^0.6.0" }, "dependencies": { - "source-map-resolve": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.6.0.tgz", - "integrity": "sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==", + "@rollup/pluginutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", + "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", "dev": true, "requires": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0" + "@types/estree": "0.0.39", + "estree-walker": "^1.0.1", + "picomatch": "^2.2.2" } + }, + "@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "dev": true + }, + "estree-walker": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", + "dev": true } } }, - "rollup-plugin-terser": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", - "integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.10.4", - "jest-worker": "^26.2.1", - "serialize-javascript": "^4.0.0", - "terser": "^5.0.0" - } - }, "rollup-plugin-typescript2": { - "version": "0.34.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.34.1.tgz", - "integrity": "sha512-P4cHLtGikESmqi1CA+tdMDUv8WbQV48mzPYt77TSTOPJpERyZ9TXdDgjSDix8Fkqce6soYz3+fa4lrC93IEkcw==", + "version": "0.36.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.36.0.tgz", + "integrity": "sha512-NB2CSQDxSe9+Oe2ahZbf+B4bh7pHwjV5L+RSYpCu7Q5ROuN94F9b6ioWwKfz3ueL3KTtmX4o2MUH2cgHDIEUsw==", "dev": true, "requires": { "@rollup/pluginutils": "^4.1.2", "find-cache-dir": "^3.3.2", "fs-extra": "^10.0.0", - "semver": "^7.3.7", - "tslib": "^2.4.0" + "semver": "^7.5.4", + "tslib": "^2.6.2" }, "dependencies": { "@rollup/pluginutils": { @@ -20677,12 +18656,6 @@ "picomatch": "^2.2.2" } }, - "estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true - }, "fs-extra": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", @@ -20694,29 +18667,26 @@ "universalify": "^2.0.0" } }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "requires": { "lru-cache": "^6.0.0" } - }, - "tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "dev": true } } }, - "rsvp": { - "version": "4.8.5", - "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.5.tgz", - "integrity": "sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==", - "dev": true - }, "run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -20726,280 +18696,33 @@ "queue-microtask": "^1.2.2" } }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "requires": { - "ret": "~0.1.10" - } - }, - "safe-regex-test": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", - "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", - "is-regex": "^1.1.4" + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" } }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "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 }, - "sane": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/sane/-/sane-4.1.0.tgz", - "integrity": "sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA==", - "dev": true, - "requires": { - "@cnakazawa/watch": "^1.0.3", - "anymatch": "^2.0.0", - "capture-exit": "^2.0.0", - "exec-sh": "^0.3.2", - "execa": "^1.0.0", - "fb-watchman": "^2.0.0", - "micromatch": "^3.1.4", - "minimist": "^1.1.1", - "walker": "~1.0.5" - }, - "dependencies": { - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - } - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, - "requires": { - "path-key": "^2.0.0" - } - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "saxes": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", - "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", + "safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", "dev": true, "requires": { - "xmlchars": "^2.2.0" + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" } }, "semver": { @@ -21009,310 +18732,105 @@ "dev": true }, "serialize-javascript": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", - "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, "requires": { "randombytes": "^2.1.0" } }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - } - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "shellwords": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", - "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", - "dev": true, - "optional": true - }, - "side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dev": true, - "requires": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - } - }, - "signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", - "dev": true - }, - "sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", - "dev": true - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", "dev": true, "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - } + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" } }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", "dev": true, "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" } }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - } + "shebang-regex": "^3.0.0" } }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dev": true, "requires": { - "kind-of": "^3.2.0" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" } }, + "signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true + }, + "sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "smob": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/smob/-/smob-1.5.0.tgz", + "integrity": "sha512-g6T+p7QO8npa+/hNx9ohv1E5pVCmWrVCUzUXJyLdMmftX6ER0oiWY/w9knEonLpnOp6b6FenKnMfR8gqwWdwig==", + "dev": true + }, "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, "source-map-resolve": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", - "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.6.0.tgz", + "integrity": "sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==", "dev": true, "requires": { "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" + "decode-uri-component": "^0.2.0" } }, "source-map-support": { @@ -21323,30 +18841,6 @@ "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "source-map-url": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", - "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", - "dev": true - }, - "spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" } }, "spdx-exceptions": { @@ -21355,31 +18849,12 @@ "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", "dev": true }, - "spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, "spdx-license-ids": { "version": "3.0.9", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz", "integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==", "dev": true }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -21403,84 +18878,6 @@ } } }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - } - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, "string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -21488,14 +18885,6 @@ "dev": true, "requires": { "safe-buffer": "~5.2.0" - }, - "dependencies": { - "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 - } } }, "string-length": { @@ -21509,56 +18898,93 @@ } }, "string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + } + } + }, + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + } } }, "string.prototype.trim": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", - "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" } }, "string.prototype.trimend": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", - "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" } }, "string.prototype.trimstart": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", - "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" } }, "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-ansi-cjs": { + "version": "npm:strip-ansi@6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" } }, "strip-bom": { @@ -21567,12 +18993,6 @@ "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true - }, "strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", @@ -21594,87 +19014,20 @@ "has-flag": "^3.0.0" } }, - "supports-hyperlinks": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz", - "integrity": "sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ==", - "dev": true, - "requires": { - "has-flag": "^4.0.0", - "supports-color": "^7.0.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true }, - "symbol-tree": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", - "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", - "dev": true - }, - "table": { - "version": "6.7.1", - "resolved": "https://registry.npmjs.org/table/-/table-6.7.1.tgz", - "integrity": "sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg==", - "dev": true, - "requires": { - "ajv": "^8.0.1", - "lodash.clonedeep": "^4.5.0", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ajv": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.0.tgz", - "integrity": "sha512-cnUG4NSBiM4YFBxgZIj/In3/6KX+rQ2l2YPRVcvAMQGWEPKuXoPIhxzwqh31jA3IPbI4qEOp/5ILI4ynioXsGQ==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - } - } - }, - "terminal-link": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", - "integrity": "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==", + "synckit": { + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.8.tgz", + "integrity": "sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==", "dev": true, "requires": { - "ansi-escapes": "^4.2.1", - "supports-hyperlinks": "^2.0.0" + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" } }, "terser": { @@ -21687,14 +19040,6 @@ "acorn": "^8.8.2", "commander": "^2.20.0", "source-map-support": "~0.5.20" - }, - "dependencies": { - "acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", - "dev": true - } } }, "test-exclude": { @@ -21706,6 +19051,41 @@ "@istanbuljs/schema": "^0.1.2", "glob": "^7.1.4", "minimatch": "^3.0.4" + }, + "dependencies": { + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } } }, "text-table": { @@ -21714,12 +19094,6 @@ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, - "throat": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", - "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==", - "dev": true - }, "through2": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.0.tgz", @@ -21742,38 +19116,6 @@ "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -21783,66 +19125,34 @@ "is-number": "^7.0.0" } }, - "tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", - "dev": true, - "requires": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.1.2" - }, - "dependencies": { - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - } - } - }, - "tr46": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", - "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", + "ts-api-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", "dev": true, - "requires": { - "punycode": "^2.1.1" - } + "requires": {} }, "ts-jest": { - "version": "26.5.6", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-26.5.6.tgz", - "integrity": "sha512-rua+rCP8DxpA8b4DQD/6X2HQS8Zy/xzViVYfEs2OQu68tkCuKLV0Md8pmX55+W24uRIyAsf/BajRfxOs+R2MKA==", + "version": "29.1.2", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.2.tgz", + "integrity": "sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==", "dev": true, "requires": { "bs-logger": "0.x", - "buffer-from": "1.x", "fast-json-stable-stringify": "2.x", - "jest-util": "^26.1.0", - "json5": "2.x", - "lodash": "4.x", + "jest-util": "^29.0.0", + "json5": "^2.2.3", + "lodash.memoize": "4.x", "make-error": "1.x", - "mkdirp": "1.x", - "semver": "7.x", - "yargs-parser": "20.x" + "semver": "^7.5.3", + "yargs-parser": "^21.0.1" }, "dependencies": { - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true - }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true } } }, @@ -21865,30 +19175,16 @@ "make-error": "^1.1.1", "v8-compile-cache-lib": "^3.0.1", "yn": "3.1.1" - }, - "dependencies": { - "acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", - "dev": true - }, - "acorn-walk": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", - "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", - "dev": true - } } }, "tsconfig-paths": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", - "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", "dev": true, "requires": { "@types/json5": "^0.0.29", - "json5": "^1.0.1", + "json5": "^1.0.2", "minimist": "^1.2.6", "strip-bom": "^3.0.0" }, @@ -21911,58 +19207,11 @@ } }, "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", "dev": true }, - "tslint": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz", - "integrity": "sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "builtin-modules": "^1.1.1", - "chalk": "^2.3.0", - "commander": "^2.12.1", - "diff": "^4.0.1", - "glob": "^7.1.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.3", - "resolve": "^1.3.2", - "semver": "^5.3.0", - "tslib": "^1.13.0", - "tsutils": "^2.29.0" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "tsutils": { - "version": "2.29.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", - "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - } - } - }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -21984,30 +19233,62 @@ "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true }, - "typed-array-length": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", - "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", "dev": true, "requires": { - "call-bind": "^1.0.2", + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + } + }, + "typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + } + }, + "typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", "for-each": "^0.3.3", - "is-typed-array": "^1.1.9" + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" } }, - "typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "typed-array-length": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", "dev": true, "requires": { - "is-typedarray": "^1.0.0" + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" } }, "typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.4.tgz", + "integrity": "sha512-dGE2Vv8cpVvw28v8HCPqyb08EzbBURxDpuhJvTrusShUfGnhHBafDsLdS1EhhxyL6BJQE+2cT3dDPAv+MQ6oLw==", "dev": true }, "uglify-js": { @@ -22063,72 +19344,12 @@ "integrity": "sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==", "dev": true }, - "union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - } - } - }, "universalify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", "dev": true }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true - } - } - }, "update-browserslist-db": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", @@ -22148,37 +19369,12 @@ "punycode": "^2.1.0" } }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true - }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, - "optional": true - }, - "v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, "v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", @@ -22186,91 +19382,23 @@ "dev": true }, "v8-to-istanbul": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-7.1.2.tgz", - "integrity": "sha512-TxNb7YEUwkLXCQYeudi6lgQ/SZrzNO4kMdlqVxaZPUIUjCv6iSSypUQX70kNBSERpQ8fk48+d61FXk+tgqcWow==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", "dev": true, "requires": { + "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^1.6.0", - "source-map": "^0.7.3" - }, - "dependencies": { - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true - } - } - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "w3c-hr-time": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", - "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", - "dev": true, - "requires": { - "browser-process-hrtime": "^1.0.0" - } - }, - "w3c-xmlserializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", - "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", - "dev": true, - "requires": { - "xml-name-validator": "^3.0.0" + "convert-source-map": "^2.0.0" } }, "walker": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz", - "integrity": "sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=", - "dev": true, - "requires": { - "makeerror": "1.0.x" - } - }, - "webidl-conversions": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", - "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", - "dev": true - }, - "whatwg-encoding": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", - "dev": true, - "requires": { - "iconv-lite": "0.4.24" - } - }, - "whatwg-mimetype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", - "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", - "dev": true - }, - "whatwg-url": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", - "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", "dev": true, "requires": { - "lodash": "^4.7.0", - "tr46": "^2.1.0", - "webidl-conversions": "^6.1.0" + "makeerror": "1.0.12" } }, "which": { @@ -22295,24 +19423,17 @@ "is-symbol": "^1.0.3" } }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, "which-typed-array": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", - "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", "dev": true, "requires": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0", - "is-typed-array": "^1.1.10" + "has-tostringtag": "^1.0.2" } }, "word-wrap": { @@ -22328,9 +19449,54 @@ "dev": true }, "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "requires": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true + }, + "ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true + }, + "string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "requires": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + } + }, + "strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "requires": { + "ansi-regex": "^6.0.1" + } + } + } + }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "requires": { "ansi-styles": "^4.0.0", @@ -22371,36 +19537,23 @@ "dev": true }, "write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", "dev": true, "requires": { "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" + "signal-exit": "^3.0.7" + }, + "dependencies": { + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + } } }, - "ws": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.1.tgz", - "integrity": "sha512-2c6faOUH/nhoQN6abwMloF7Iyl0ZS2E9HGtsiLrWn0zOOMWlhtDmdf/uihDt6jnuCxgtwGBNy6Onsoy2s2O2Ow==", - "dev": true, - "requires": {} - }, - "xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", - "dev": true - }, - "xmlchars": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", - "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", - "dev": true - }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", @@ -22408,9 +19561,9 @@ "dev": true }, "y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true }, "yallist": { @@ -22420,89 +19573,24 @@ "dev": true }, "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - }, - "dependencies": { - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" } }, "yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true }, "yn": { @@ -22510,6 +19598,12 @@ "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true } } } diff --git a/package.json b/package.json index 1affff96..8eadde59 100644 --- a/package.json +++ b/package.json @@ -1,68 +1,91 @@ { "name": "inkjs", - "version": "2.2.4", + "version": "2.2.5", "description": "A javascript port of inkle's ink scripting language (http://www.inklestudios.com/ink/)", "type": "commonjs", "main": "dist/ink-full.js", "types": "ink.d.ts", - "files": ["src/engine","src/compiler","ink.d.ts", "ink.d.mts","script/inkjs-compiler.ts", "dist"], + "files": [ + "engine", + "compiler", + "ink.js", + "ink.js.map", + "ink.d.ts", + "ink.d.mts", + "script/inkjs-compiler.ts", + "dist", + "bin" + ], "exports": { - ".":{ + ".": { "types": "./ink.d.mts", "import": "./dist/ink.mjs", "default": "./dist/ink.js" }, - "./full":{ + "./full": { "types": "./ink.d.mts", "import": "./dist/ink-full.mjs", "default": "./dist/ink-full.js" + }, + "./types": { + "types": "./ink.d.ts", + "default": "./ink.js" + }, + "./engine/*": { + "types": "./engine/*.d.ts", + "default": "./engine/*.js" + }, + "./compiler/*": { + "types": "./compiler/*.d.ts", + "default": "./compiler/*.js" } }, "scripts": { - "test": "npm run test:typescript && npm run test:javascript", + "test": "npm run build && npm run test:typescript && npm run test:javascript", "test:typescript": "jest", - "test:javascript": "npm run test:javascript:dist && npm run test:javascript:legacy", + "test:javascript": "npm run build && npm run test:javascript:dist && npm run test:javascript:legacy", "test:javascript:dist": "INK_TEST=dist jest --config='jest.config.javascript.js'", "test:javascript:legacy": "INK_TEST=legacy jest --config='jest.config.javascript.js'", "test:compileFiles": "node src/tests/compile.js", - "build": "tsc -p ./ && rollup -c", + "build": "tsc -p ./ && rollup -c --bundleConfigAsCjs", "lint": "eslint 'src/**/*.ts'", "lint:fix": "npm run lint -- --fix", - "watch": "tsc -p ./ && rollup -c -w", - "prepare": "npm run build" + "watch": "tsc -p ./ && rollup -c -w --bundleConfigAsCjs" }, "author": "Yannick Lohse", "license": "MIT", + "bin": { + "inkjs-compiler": "./bin/inkjs-compiler.js" + }, "browserslist": "> 0.25%, not dead", "devDependencies": { "@babel/core": "7.25.2", "@babel/preset-env": "7.25.3", "@rollup/plugin-babel": "6.0.4", - "@rollup/plugin-node-resolve": "13.3.0", - "@types/jest": "26.0.24", - "@types/node": "^20.2.6", - "@typescript-eslint/eslint-plugin": "4.33.0", - "@typescript-eslint/eslint-plugin-tslint": "4.33.0", - "@typescript-eslint/parser": "4.33.0", - "eslint": "7.32.0", - "eslint-config-prettier": "8.8.0", - "eslint-plugin-import": "2.27.5", - "eslint-plugin-jsdoc": "30.7.13", + "@rollup/plugin-node-resolve": "15.2.3", + "@rollup/plugin-terser": "0.4.4", + "@types/jest": "29.5.12", + "@types/node": "^20.12.5", + "@typescript-eslint/eslint-plugin": "7.5.0", + "@typescript-eslint/parser": "7.5.0", + "eslint": "^8.56.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-import": "2.29.1", + "eslint-plugin-jsdoc": "48.2.3", "eslint-plugin-prefer-arrow": "1.2.3", - "eslint-plugin-prettier": "3.4.1", - "fs-extra": "9.1.0", - "glob": "7.2.3", - "jest": "26.6.3", - "jest-diff": "27.5.1", - "prettier": "2.8.8", + "eslint-plugin-prettier": "5.1.3", + "fs-extra": "11.2.0", + "glob": "10.3.12", + "jest": "29.7.0", + "jest-diff": "29.7.0", + "prettier": "3.2.5", "remap-istanbul": "0.13.0", - "rollup": "2.79.1", + "rollup": "4.14.0", "rollup-plugin-sourcemaps": "0.6.3", - "rollup-plugin-terser": "7.0.2", - "rollup-plugin-typescript2": "0.34.1", - "ts-jest": "26.5.6", - "ts-node": "^10.9.1", - "tslint": "6.1.3", - "typescript": "4.9.5" + "rollup-plugin-typescript2": "0.36.0", + "ts-jest": "29.1.2", + "ts-node": "^10.9.2", + "tslib": "^2.6.3", + "typescript": "5.4.4" } } diff --git a/rollup.config.js b/rollup.config.js index a759068d..b753c536 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,5 +1,5 @@ import sourcemaps from 'rollup-plugin-sourcemaps'; -import { terser } from "rollup-plugin-terser"; +import terser from "@rollup/plugin-terser"; import typescript from 'rollup-plugin-typescript2'; import { nodeResolve } from '@rollup/plugin-node-resolve'; import { babel } from '@rollup/plugin-babel'; @@ -15,7 +15,8 @@ const tsconfig = { tsconfigOverride: { compilerOptions: { module: "es6", - declaration: false + declaration: false, + moduleResolution: "node" } } } @@ -135,7 +136,7 @@ export default [ input: inklecateInputFile, output: { name: 'inkjs-compiler', - file: 'dist/inkjs-compiler.js', + file: 'bin/inkjs-compiler.js', format: 'commonjs', sourcemap: false }, diff --git a/script/inkjs-compiler.ts b/script/inkjs-compiler.ts index aa2c4458..c26659d2 100644 --- a/script/inkjs-compiler.ts +++ b/script/inkjs-compiler.ts @@ -1,3 +1,5 @@ +#!/usr/bin/env node + import { Compiler } from '../src/compiler/Compiler'; import { CompilerOptions } from '../src/compiler/CompilerOptions'; import { Story } from '../src/engine/Story'; @@ -17,13 +19,13 @@ Usage: inkjs-compiler -o : Output file name -c: Count all visits to knots, stitches and weave points, not just those referenced by TURNS_SINCE and read counts. - -p: Play mode + -p: Play mode (automatic if a json file is passed as argument) `); process.exit(0); } const countAllVisit = process.argv.includes("-c"); -const play = process.argv.includes("-p") || process.argv.includes("-k"); +let play = process.argv.includes("-p") || process.argv.includes("-k"); const write = !process.argv.includes("-k") && !process.argv.includes("-p"); const explicitOutput = process.argv.includes("-o"); let outputfile: string|null = null; @@ -71,6 +73,7 @@ if(!inputFile.endsWith(".json")){ } }else{ jsonStory = fs.readFileSync(inputFile,"utf-8").replace(BOM, "") + play = true; } if(jsonStory && play){ diff --git a/src/compiler/Parser/InkParser.ts b/src/compiler/Parser/InkParser.ts index 34bc5db1..95bb7b4e 100644 --- a/src/compiler/Parser/InkParser.ts +++ b/src/compiler/Parser/InkParser.ts @@ -1594,17 +1594,17 @@ export class InkParser extends StringParser { return divertTarget; } - let prefixOp: Expression = this.OneOf([ + let prefixOp: string = this.OneOf([ this.String("-"), this.String("!"), - ]) as Expression; + ]) as string; // Don't parse like the string rules above, in case its actually // a variable that simply starts with "not", e.g. "notable". // This rule uses the Identifier rule, which will scan as much text // as possible before returning. if (prefixOp === null) { - prefixOp = this.Parse(this.ExpressionNot) as Expression; + prefixOp = this.Parse(this.ExpressionNot) as string; } this.Whitespace(); @@ -1627,7 +1627,7 @@ export class InkParser extends StringParser { if (expr === null) { return null; } else if (prefixOp !== null) { - expr = UnaryExpression.WithInner(expr, prefixOp as any) as Expression; + expr = UnaryExpression.WithInner(expr, prefixOp) as Expression; } this.Whitespace(); @@ -1746,12 +1746,14 @@ export class InkParser extends StringParser { this.Whitespace(); - const args = this.Parse(this.ExpressionFunctionCallArguments); + const args = this.Parse( + this.ExpressionFunctionCallArguments + ) as Expression[]; if (args === null) { return null; } - return new FunctionCall(iden as Identifier, args as any); + return new FunctionCall(iden as Identifier, args); }; public readonly ExpressionFunctionCallArguments = (): Expression[] | null => { @@ -2383,7 +2385,10 @@ export class InkParser extends StringParser { // Multiple newlines on the output will be removed, so there will be no "leak" for // long running calculations. It's disappointingly messy though :-/ if (result.Find(FunctionCall)() !== null) { - result = new ContentList(result as any, new Text("\n")); + result = new ContentList( + result as unknown as ParsedObject[], + new Text("\n") + ); } this.Expect(this.EndOfLine, "end of line", this.SkipToNextLine); @@ -2662,7 +2667,7 @@ export class InkParser extends StringParser { let contentList = asOrNull(logic, ContentList); if (!contentList) { - contentList = new ContentList(logic as any); + contentList = new ContentList(logic as unknown as ParsedObject[]); } this.Whitespace(); @@ -2735,7 +2740,7 @@ export class InkParser extends StringParser { this.InnerExpression, ]; - let wasTagActiveAtStartOfScope = this.tagActive; + //let wasTagActiveAtStartOfScope = this.tagActive; // Adapted from "OneOf" structuring rule except that in // order for the rule to succeed, it has to maximally @@ -2856,7 +2861,9 @@ export class InkParser extends StringParser { case SequenceType.Cycle: case SequenceType.Stopping: case SequenceType.Shuffle: + // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison case SequenceType.Shuffle | SequenceType.Stopping: + // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison case SequenceType.Shuffle | SequenceType.Once: break; default: @@ -2998,10 +3005,10 @@ export class InkParser extends StringParser { justHadContent = false; } else { // Real content - const content = contentOrPipe as any; + const content = contentOrPipe as unknown as ParsedObject[]; if (content === null) { this.Error( - `Expected content, but got ${contentOrPipe} (this is an ink compiler bug!)` + `Expected content, but got ${contentOrPipe as unknown as string} (this is an ink compiler bug!)` ); } else { result.push(new ContentList(content)); @@ -3124,7 +3131,9 @@ export class InkParser extends StringParser { }; public readonly GenerateStatementLevelRules = () => { - const levels = Object.values(StatementLevel); + const levels: StatementLevel[] = Object.values( + StatementLevel + ) as StatementLevel[]; this._statementRulesAtLevel = "f" .repeat(levels.length) diff --git a/src/compiler/Parser/ParsedHierarchy/Divert/Divert.ts b/src/compiler/Parser/ParsedHierarchy/Divert/Divert.ts index 80188e99..14150a1a 100644 --- a/src/compiler/Parser/ParsedHierarchy/Divert/Divert.ts +++ b/src/compiler/Parser/ParsedHierarchy/Divert/Divert.ts @@ -449,7 +449,7 @@ export class Divert extends ParsedObject { const externalName: string | null = this.target ? this.target.firstComponent : null; - const external = context.externals.get(externalName as any); + const external = context.externals.get(externalName as string); if (!external) { throw new Error("external not found"); } diff --git a/src/compiler/Parser/ParsedHierarchy/Expression/BinaryExpression.ts b/src/compiler/Parser/ParsedHierarchy/Expression/BinaryExpression.ts index 876c74f1..647259c4 100644 --- a/src/compiler/Parser/ParsedHierarchy/Expression/BinaryExpression.ts +++ b/src/compiler/Parser/ParsedHierarchy/Expression/BinaryExpression.ts @@ -9,7 +9,11 @@ export class BinaryExpression extends Expression { public readonly leftExpression: Expression; public readonly rightExpression: Expression; - constructor(left: Expression, right: Expression, public opName: string) { + constructor( + left: Expression, + right: Expression, + public opName: string + ) { super(); this.leftExpression = this.AddContent(left) as Expression; diff --git a/src/compiler/Parser/ParsedHierarchy/Expression/Expression.ts b/src/compiler/Parser/ParsedHierarchy/Expression/Expression.ts index a277817a..3279063b 100644 --- a/src/compiler/Parser/ParsedHierarchy/Expression/Expression.ts +++ b/src/compiler/Parser/ParsedHierarchy/Expression/Expression.ts @@ -55,6 +55,7 @@ export abstract class Expression extends ParsedObject { return "Expression"; } + // eslint-disable-next-line @typescript-eslint/no-unused-vars public Equals(obj: ParsedObject): boolean { return false; } diff --git a/src/compiler/Parser/ParsedHierarchy/Expression/UnaryExpression.ts b/src/compiler/Parser/ParsedHierarchy/Expression/UnaryExpression.ts index b6102b91..3134e12a 100644 --- a/src/compiler/Parser/ParsedHierarchy/Expression/UnaryExpression.ts +++ b/src/compiler/Parser/ParsedHierarchy/Expression/UnaryExpression.ts @@ -52,7 +52,10 @@ export class UnaryExpression extends Expression { return unary; }; - constructor(inner: Expression, public readonly op: string) { + constructor( + inner: Expression, + public readonly op: string + ) { super(); this.innerExpression = this.AddContent(inner) as Expression; diff --git a/src/compiler/Parser/ParsedHierarchy/Flow/FlowBase.ts b/src/compiler/Parser/ParsedHierarchy/Flow/FlowBase.ts index 14f91193..cfc2d0a3 100644 --- a/src/compiler/Parser/ParsedHierarchy/Flow/FlowBase.ts +++ b/src/compiler/Parser/ParsedHierarchy/Flow/FlowBase.ts @@ -138,6 +138,7 @@ export abstract class FlowBase extends ParsedObject implements INamedContent { return finalContent; }; + // eslint-disable-next-line @typescript-eslint/no-unused-vars public PreProcessTopLevelObjects(_: ParsedObject[]): void { // empty by default, used by Story to process included file references } diff --git a/src/compiler/Parser/ParsedHierarchy/FunctionCall.ts b/src/compiler/Parser/ParsedHierarchy/FunctionCall.ts index 1de3dc77..c7f87685 100644 --- a/src/compiler/Parser/ParsedHierarchy/FunctionCall.ts +++ b/src/compiler/Parser/ParsedHierarchy/FunctionCall.ts @@ -203,7 +203,7 @@ export class FunctionCall extends Expression { } else if (NativeFunctionCall.CallExistsWithName(this.name)) { const nativeCall = NativeFunctionCall.CallWithName(this.name); if (nativeCall.numberOfParameters !== this.args.length) { - let msg = `${name} should take ${nativeCall.numberOfParameters} parameter`; + let msg = `${FunctionCall.name} should take ${nativeCall.numberOfParameters} parameter`; if (nativeCall.numberOfParameters > 1) { msg += "s"; } @@ -302,7 +302,7 @@ export class FunctionCall extends Expression { if (runtimeVarRef.pathForCount !== null) { this.Error( - `Should be '${name}'(-> '${this._variableReferenceToCount.name}). Usage without the '->' only makes sense for variable targets.` + `Should be '${FunctionCall.name}'(-> '${this._variableReferenceToCount.name}). Usage without the '->' only makes sense for variable targets.` ); } } diff --git a/src/compiler/Parser/ParsedHierarchy/List/ListElementDefinition.ts b/src/compiler/Parser/ParsedHierarchy/List/ListElementDefinition.ts index 960051cd..3b011e26 100644 --- a/src/compiler/Parser/ParsedHierarchy/List/ListElementDefinition.ts +++ b/src/compiler/Parser/ParsedHierarchy/List/ListElementDefinition.ts @@ -33,7 +33,7 @@ export class ListElementDefinition extends ParsedObject { public readonly explicitValue: number | null = null ) { super(); - this.parent = super.parent as ListDefinition; + this.parent = this.parent as ListDefinition; } public readonly GenerateRuntimeObject = (): RuntimeObject => { diff --git a/src/compiler/Parser/ParsedHierarchy/Stitch.ts b/src/compiler/Parser/ParsedHierarchy/Stitch.ts index 486be6d7..66bdba61 100644 --- a/src/compiler/Parser/ParsedHierarchy/Stitch.ts +++ b/src/compiler/Parser/ParsedHierarchy/Stitch.ts @@ -22,9 +22,13 @@ export class Stitch extends FlowBase { return "Stitch"; } + // Fixes TS issue with not being able to access the prototype via `super` in functions + // attached to the class as properties. + private baseToString = this.toString; + public toString = (): string => { return `${ this.parent !== null ? this.parent + " > " : "" - }${super.toString()}`; + }${this.baseToString()}`; }; } diff --git a/src/compiler/Parser/ParsedHierarchy/Variable/VariableAssignment.ts b/src/compiler/Parser/ParsedHierarchy/Variable/VariableAssignment.ts index 867b654a..7c289876 100644 --- a/src/compiler/Parser/ParsedHierarchy/Variable/VariableAssignment.ts +++ b/src/compiler/Parser/ParsedHierarchy/Variable/VariableAssignment.ts @@ -169,7 +169,7 @@ export class VariableAssignment extends ParsedObject { this.isGlobalDeclaration ? "VAR" : this.isNewTemporaryDeclaration - ? "~ temp" - : "" + ? "~ temp" + : "" } ${this.variableName}`; } diff --git a/src/engine/Container.ts b/src/engine/Container.ts index 554f2683..25b36c21 100644 --- a/src/engine/Container.ts +++ b/src/engine/Container.ts @@ -329,6 +329,7 @@ export class Container extends InkObject implements INamedContent { export namespace Container { export enum CountFlags { + Start = 0, Visits = 1, Turns = 2, CountStartOnly = 4, diff --git a/src/engine/ListDefinition.ts b/src/engine/ListDefinition.ts index 71e1124c..71c334c4 100644 --- a/src/engine/ListDefinition.ts +++ b/src/engine/ListDefinition.ts @@ -56,8 +56,10 @@ export class ListDefinition { item = InkListItem.Null; return { result: item, exists: false }; } + public TryGetValueForItem( item: InkListItem, + // eslint-disable-next-line @typescript-eslint/no-unused-vars /* out */ intVal: number ): TryGetResult { if (!item.itemName) return { result: 0, exists: false }; diff --git a/src/engine/SimpleJson.ts b/src/engine/SimpleJson.ts index cd31407b..bc206f13 100644 --- a/src/engine/SimpleJson.ts +++ b/src/engine/SimpleJson.ts @@ -350,7 +350,7 @@ export namespace SimpleJson { } } - private get currentCollection() { + private get currentCollection(): Record | null { if (this._collectionStack.length > 0) { return this._collectionStack[this._collectionStack.length - 1]; } else { diff --git a/src/engine/TypeAssertion.ts b/src/engine/TypeAssertion.ts index b9de412e..25f2807f 100644 --- a/src/engine/TypeAssertion.ts +++ b/src/engine/TypeAssertion.ts @@ -63,6 +63,7 @@ export function isEquatable(type: any) { function unsafeTypeAssertion( obj: any, + // eslint-disable-next-line @typescript-eslint/no-unused-vars type: (new () => T) | (Function & { prototype: T }) ) { return obj as T; diff --git a/src/engine/Value.ts b/src/engine/Value.ts index a001ea58..5fcbe894 100644 --- a/src/engine/Value.ts +++ b/src/engine/Value.ts @@ -73,7 +73,7 @@ export abstract class AbstractValue extends InkObject { } export abstract class Value< - T extends { toString: () => string } + T extends { toString: () => string }, > extends AbstractValue { public value: T | null; diff --git a/src/ink.ts b/src/ink.ts new file mode 100644 index 00000000..de483b1e --- /dev/null +++ b/src/ink.ts @@ -0,0 +1,4 @@ +export { Story, InkList } from "./engine/Story"; +export { Compiler, CompilerOptions } from "./compiler/Compiler"; +export { PosixFileHandler } from "./compiler/FileHandler/PosixFileHandler"; +export { JsonFileHandler } from "./compiler/FileHandler/JsonFileHandler"; diff --git a/src/tests/specs/inkjs/engine/Integration.spec.ts b/src/tests/specs/inkjs/engine/Integration.spec.ts index 16c6937c..b2e0c47f 100644 --- a/src/tests/specs/inkjs/engine/Integration.spec.ts +++ b/src/tests/specs/inkjs/engine/Integration.spec.ts @@ -71,9 +71,9 @@ describe("Integration", () => { expect(context.story.variablesState["observedVar1"]).toEqual(1); expect(context.story.variablesState["observedVar2"]).toEqual(2); - const spy1 = jasmine.createSpy("variable observer spy 1"); - const spy2 = jasmine.createSpy("variable observer spy 2"); - const commonSpy = jasmine.createSpy("variable observer spy common"); + const spy1 = jest.fn().mockName("variable observer spy 1"); + const spy2 = jest.fn().mockName("variable observer spy 2"); + const commonSpy = jest.fn().mockName("variable observer spy common"); context.story.ObserveVariable("observedVar1", spy1); context.story.ObserveVariable("observedVar2", spy2); context.story.ObserveVariable("observedVar1", commonSpy); @@ -215,11 +215,8 @@ describe("Integration", () => { it("should call external functions", () => { context.story.allowExternalFunctionFallbacks = false; context.story.ChoosePathString("integration.external"); - const externalSpy = jasmine - .createSpy("external function spy", (a) => { - return a; - }) - .and.callThrough(); + + const externalSpy = jest.fn((a) => a).mockName("external function spy"); context.story.BindExternalFunction("fn_ext", externalSpy); context.story.BindExternalFunction("gameInc", () => undefined); @@ -232,13 +229,15 @@ describe("Integration", () => { it("should handle callstack changes", () => { context.story.allowExternalFunctionFallbacks = false; - const externalSpy = jasmine - .createSpy("external function spy", (x) => { + + const externalSpy = jest + .fn((x) => { x++; x = parseInt(context.story.EvaluateFunction("inkInc", [x])); return x; }) - .and.callThrough(); + .mockName("external function spy"); + context.story.BindExternalFunction("fn_ext", () => undefined); context.story.BindExternalFunction("gameInc", externalSpy); diff --git a/src/tests/specs/setupTests.ts b/src/tests/specs/setupTests.ts index 48fffd1b..81fb2aa8 100644 --- a/src/tests/specs/setupTests.ts +++ b/src/tests/specs/setupTests.ts @@ -2,6 +2,7 @@ export {}; declare global { namespace jest { + // eslint-disable-next-line @typescript-eslint/no-unused-vars interface Matchers { toContainStringContaining(expected: string): CustomMatcherResult; } diff --git a/templates/browser_serverless/ink.js b/templates/browser_serverless/ink.js index 1d0a53a4..3e4ebe54 100644 --- a/templates/browser_serverless/ink.js +++ b/templates/browser_serverless/ink.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).inkjs={})}(this,(function(t){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,i=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){o=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}var S,k=function(){function t(){if(n(this,t),this._components=[],this._componentsString=null,this._isRelative=!1,"string"==typeof arguments[0]){var e=arguments[0];this.componentsString=e}else if(arguments[0]instanceof t.Component&&arguments[1]instanceof t){var i=arguments[0],r=arguments[1];this._components.push(i),this._components=this._components.concat(r._components)}else if(arguments[0]instanceof Array){var a=arguments[0],s=!!arguments[1];this._components=this._components.concat(a),this._isRelative=s}}return r(t,[{key:"isRelative",get:function(){return this._isRelative}},{key:"componentCount",get:function(){return this._components.length}},{key:"head",get:function(){return this._components.length>0?this._components[0]:null}},{key:"tail",get:function(){return this._components.length>=2?new t(this._components.slice(1,this._components.length)):t.self}},{key:"length",get:function(){return this._components.length}},{key:"lastComponent",get:function(){var t=this._components.length-1;return t>=0?this._components[t]:null}},{key:"containsNamedComponent",get:function(){for(var t=0,e=this._components.length;t=0}},{key:"isParent",get:function(){return this.name==t.parentId}},{key:"toString",value:function(){return this.isIndex?this.index.toString():this.name}},{key:"Equals",value:function(t){return null!=t&&t.isIndex==this.isIndex&&(this.isIndex?this.index==t.index:this.name==t.name)}}],[{key:"ToParent",value:function(){return new e(t.parentId)}}]),e}();t.Component=e}(k||(k={})),function(t){function e(t,e){if(!t)throw void 0!==e&&console.warn(e),console.trace&&console.trace(),new Error("")}t.AssertType=function(t,n,i){e(t instanceof n,i)},t.Assert=e}(S||(S={}));var O=function(t){a(i,t);var e=v(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i)}(h(Error));function P(t){throw new O("".concat(t," is null or undefined"))}var N=function(){function t(){n(this,t),this.parent=null,this._debugMetadata=null,this._path=null}return r(t,[{key:"debugMetadata",get:function(){return null===this._debugMetadata&&this.parent?this.parent.debugMetadata:this._debugMetadata},set:function(t){this._debugMetadata=t}},{key:"ownDebugMetadata",get:function(){return this._debugMetadata}},{key:"DebugLineNumberOfPath",value:function(t){if(null===t)return null;var e=this.rootContentContainer;if(e){var n=e.ContentAtPath(t).obj;if(n){var i=n.debugMetadata;if(null!==i)return i.startLineNumber}}return null}},{key:"path",get:function(){if(null==this._path)if(null==this.parent)this._path=new k;else{for(var t=[],e=this,n=C(e.parent,K);null!==n;){var i=w(e);if(null!=i&&i.hasValidName){if(null===i.name)return P("namedChild.name");t.unshift(new k.Component(i.name))}else t.unshift(new k.Component(n.content.indexOf(e)));e=n,n=C(n.parent,K)}this._path=new k(t)}return this._path}},{key:"ResolvePath",value:function(t){if(null===t)return P("path");if(t.isRelative){var e=C(this,K);return null===e&&(S.Assert(null!==this.parent,"Can't resolve relative path because we don't have a parent"),e=C(this.parent,K),S.Assert(null!==e,"Expected parent to be a container"),S.Assert(t.GetComponent(0).isParent),t=t.tail),null===e?P("nearestContainer"):e.ContentAtPath(t)}var n=this.rootContentContainer;return null===n?P("contentContainer"):n.ContentAtPath(t)}},{key:"ConvertPathToRelative",value:function(t){for(var e=this.path,n=Math.min(t.length,e.length),i=-1,r=0;r1?e-1:0),i=1;i0){null==this._originNames&&this.Count>0?this._originNames=[]:(this._originNames||(this._originNames=[]),this._originNames.length=0);var t,e=g(this);try{for(e.s();!(t=e.n()).done;){var n=d(t.value,1)[0],i=I.fromSerializedKey(n);if(null===i.originName)return P("item.originName");this._originNames.push(i.originName)}}catch(t){e.e(t)}finally{e.f()}}return this._originNames}},{key:"SetInitialOriginName",value:function(t){this._originNames=[t]}},{key:"SetInitialOriginNames",value:function(t){this._originNames=null==t?null:t.slice()}},{key:"maxItem",get:function(){var t,e={Key:I.Null,Value:0},n=g(this);try{for(n.s();!(t=n.n()).done;){var i=d(t.value,2),r=i[0],a=i[1],s=I.fromSerializedKey(r);(e.Key.isNull||a>e.Value)&&(e={Key:s,Value:a})}}catch(t){n.e(t)}finally{n.f()}return e}},{key:"minItem",get:function(){var t,e={Key:I.Null,Value:0},n=g(this);try{for(n.s();!(t=n.n()).done;){var i=d(t.value,2),r=i[0],a=i[1],s=I.fromSerializedKey(r);(e.Key.isNull||at.maxItem.Value)}},{key:"GreaterThanOrEquals",value:function(t){return 0!=this.Count&&(0==t.Count||this.minItem.Value>=t.minItem.Value&&this.maxItem.Value>=t.maxItem.Value)}},{key:"LessThan",value:function(t){return 0!=t.Count&&(0==this.Count||this.maxItem.Value0?new s(this.maxItem):new s}},{key:"MinAsList",value:function(){return this.Count>0?new s(this.minItem):new s}},{key:"ListWithSubRange",value:function(t,e){if(0==this.Count)return new s;var n=this.orderedItems,i=0,r=Number.MAX_SAFE_INTEGER;Number.isInteger(t)?i=t:t instanceof s&&t.Count>0&&(i=t.minItem.Value),Number.isInteger(e)?r=e:t instanceof s&&t.Count>0&&(r=e.maxItem.Value);var a=new s;a.SetInitialOriginNames(this.originNames);var o,u=g(n);try{for(u.s();!(o=u.n()).done;){var l=o.value;l.Value>=i&&l.Value<=r&&a.Add(l.Key,l.Value)}}catch(t){u.e(t)}finally{u.f()}return a}},{key:"Equals",value:function(t){if(t instanceof s==!1)return!1;if(t.Count!=this.Count)return!1;var e,n=g(this);try{for(n.s();!(e=n.n()).done;){var i=d(e.value,1)[0];if(!t.has(i))return!1}}catch(t){n.e(t)}finally{n.f()}return!0}},{key:"orderedItems",get:function(){var t,e=new Array,n=g(this);try{for(n.s();!(t=n.n()).done;){var i=d(t.value,2),r=i[0],a=i[1],s=I.fromSerializedKey(r);e.push({Key:s,Value:a})}}catch(t){n.e(t)}finally{n.f()}return e.sort((function(t,e){return null===t.Key.originName?P("x.Key.originName"):null===e.Key.originName?P("y.Key.originName"):t.Value==e.Value?t.Key.originName.localeCompare(e.Key.originName):t.Valuee.Value?1:0})),e}},{key:"toString",value:function(){for(var t=this.orderedItems,e=new A,n=0;n0&&e.Append(", ");var i=t[n].Key;if(null===i.itemName)return P("item.itemName");e.Append(i.itemName)}return e.toString()}},{key:"valueOf",value:function(){return NaN}}],[{key:"FromString",value:function(t,e){var n,i=null===(n=e.listDefinitions)||void 0===n?void 0:n.FindSingleItemListWithName(t);if(i)return null===i.value?P("listValue.value"):new s(i.value);throw new Error("Could not find the InkListItem from the string '"+t+"' to create an InkList because it doesn't exist in the original list definition in ink.")}}]),s}(h(Map)),x=function(t){a(i,t);var e=v(i);function i(t){var r;return n(this,i),(r=e.call(this,t)).useEndLineNumber=!1,r.message=t,r.name="StoryException",r}return r(i)}(h(Error));function W(t,e,n){if(null===t)return{result:n,exists:!1};var i=t.get(e);return void 0===i?{result:n,exists:!1}:{result:i,exists:!0}}var V,L=function(t){a(i,t);var e=v(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"Copy",value:function(){return b(i.Create(this.valueObject),N)}},{key:"BadCastException",value:function(t){return new x("Can't cast "+this.valueObject+" from "+this.valueType+" to "+t)}}],[{key:"Create",value:function(t,e){if(e){if(e===V.Int&&Number.isInteger(Number(t)))return new D(Number(t));if(e===V.Float&&!isNaN(t))return new B(Number(t))}return"boolean"==typeof t?new R(Boolean(t)):"string"==typeof t?new G(String(t)):Number.isInteger(Number(t))?new D(Number(t)):isNaN(t)?t instanceof k?new M(b(t,k)):t instanceof F?new U(b(t,F)):null:new B(Number(t))}}]),i}(N),j=function(t){a(i,t);var e=v(i);function i(t){var r;return n(this,i),(r=e.call(this)).value=t,r}return r(i,[{key:"valueObject",get:function(){return this.value}},{key:"toString",value:function(){return null===this.value?P("Value.value"):this.value.toString()}}]),i}(L),R=function(t){a(i,t);var e=v(i);function i(t){return n(this,i),e.call(this,t||!1)}return r(i,[{key:"isTruthy",get:function(){return Boolean(this.value)}},{key:"valueType",get:function(){return V.Bool}},{key:"Cast",value:function(t){if(null===this.value)return P("Value.value");if(t==this.valueType)return this;if(t==V.Int)return new D(this.value?1:0);if(t==V.Float)return new B(this.value?1:0);if(t==V.String)return new G(this.value?"true":"false");throw this.BadCastException(t)}},{key:"toString",value:function(){return this.value?"true":"false"}}]),i}(j),D=function(t){a(i,t);var e=v(i);function i(t){return n(this,i),e.call(this,t||0)}return r(i,[{key:"isTruthy",get:function(){return 0!=this.value}},{key:"valueType",get:function(){return V.Int}},{key:"Cast",value:function(t){if(null===this.value)return P("Value.value");if(t==this.valueType)return this;if(t==V.Bool)return new R(0!==this.value);if(t==V.Float)return new B(this.value);if(t==V.String)return new G(""+this.value);throw this.BadCastException(t)}}]),i}(j),B=function(t){a(i,t);var e=v(i);function i(t){return n(this,i),e.call(this,t||0)}return r(i,[{key:"isTruthy",get:function(){return 0!=this.value}},{key:"valueType",get:function(){return V.Float}},{key:"Cast",value:function(t){if(null===this.value)return P("Value.value");if(t==this.valueType)return this;if(t==V.Bool)return new R(0!==this.value);if(t==V.Int)return new D(this.value);if(t==V.String)return new G(""+this.value);throw this.BadCastException(t)}}]),i}(j),G=function(t){a(i,t);var e=v(i);function i(t){var r;return n(this,i),(r=e.call(this,t||""))._isNewline="\n"==r.value,r._isInlineWhitespace=!0,null===r.value?f(r,P("Value.value")):(r.value.length>0&&r.value.split("").every((function(t){return" "==t||"\t"==t||(r._isInlineWhitespace=!1,!1)})),r)}return r(i,[{key:"valueType",get:function(){return V.String}},{key:"isTruthy",get:function(){return null===this.value?P("Value.value"):this.value.length>0}},{key:"isNewline",get:function(){return this._isNewline}},{key:"isInlineWhitespace",get:function(){return this._isInlineWhitespace}},{key:"isNonWhitespace",get:function(){return!this.isNewline&&!this.isInlineWhitespace}},{key:"Cast",value:function(t){if(t==this.valueType)return this;if(t==V.Int){var e=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=parseInt(t);return Number.isNaN(n)?{result:e,exists:!1}:{result:n,exists:!0}}(this.value);if(e.exists)return new D(e.result);throw this.BadCastException(t)}if(t==V.Float){var n=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=parseFloat(t);return Number.isNaN(n)?{result:e,exists:!1}:{result:n,exists:!0}}(this.value);if(n.exists)return new B(n.result);throw this.BadCastException(t)}throw this.BadCastException(t)}}]),i}(j),M=function(t){a(i,t);var e=v(i);function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return n(this,i),e.call(this,t)}return r(i,[{key:"valueType",get:function(){return V.DivertTarget}},{key:"targetPath",get:function(){return null===this.value?P("Value.value"):this.value},set:function(t){this.value=t}},{key:"isTruthy",get:function(){throw new Error("Shouldn't be checking the truthiness of a divert target")}},{key:"Cast",value:function(t){if(t==this.valueType)return this;throw this.BadCastException(t)}},{key:"toString",value:function(){return"DivertTargetValue("+this.targetPath+")"}}]),i}(j),J=function(t){a(i,t);var e=v(i);function i(t){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return n(this,i),(r=e.call(this,t))._contextIndex=a,r}return r(i,[{key:"contextIndex",get:function(){return this._contextIndex},set:function(t){this._contextIndex=t}},{key:"variableName",get:function(){return null===this.value?P("Value.value"):this.value},set:function(t){this.value=t}},{key:"valueType",get:function(){return V.VariablePointer}},{key:"isTruthy",get:function(){throw new Error("Shouldn't be checking the truthiness of a variable pointer")}},{key:"Cast",value:function(t){if(t==this.valueType)return this;throw this.BadCastException(t)}},{key:"toString",value:function(){return"VariablePointerValue("+this.variableName+")"}},{key:"Copy",value:function(){return new i(this.variableName,this.contextIndex)}}]),i}(j),U=function(t){a(i,t);var e=v(i);function i(t,r){var a;return n(this,i),a=e.call(this,null),t||r?t instanceof F?a.value=new F(t):t instanceof I&&"number"==typeof r&&(a.value=new F({Key:t,Value:r})):a.value=new F,a}return r(i,[{key:"isTruthy",get:function(){return null===this.value?P("this.value"):this.value.Count>0}},{key:"valueType",get:function(){return V.List}},{key:"Cast",value:function(t){if(null===this.value)return P("Value.value");if(t==V.Int){var e=this.value.maxItem;return e.Key.isNull?new D(0):new D(e.Value)}if(t==V.Float){var n=this.value.maxItem;return n.Key.isNull?new B(0):new B(n.Value)}if(t==V.String){var i=this.value.maxItem;return i.Key.isNull?new G(""):new G(i.Key.toString())}if(t==this.valueType)return this;throw this.BadCastException(t)}}],[{key:"RetainListOriginsForAssignment",value:function(t,e){var n=C(t,i),r=C(e,i);return r&&null===r.value?P("newList.value"):n&&null===n.value?P("oldList.value"):void(n&&r&&0==r.value.Count&&r.value.SetInitialOriginNames(n.value.originNames))}}]),i}(j);!function(t){t[t.Bool=-1]="Bool",t[t.Int=0]="Int",t[t.Float=1]="Float",t[t.List=2]="List",t[t.String=3]="String",t[t.DivertTarget=4]="DivertTarget",t[t.VariablePointer=5]="VariablePointer"}(V||(V={}));var q=function(){function t(){n(this,t),this.obj=null,this.approximate=!1}return r(t,[{key:"correctObj",get:function(){return this.approximate?null:this.obj}},{key:"container",get:function(){return this.obj instanceof K?this.obj:null}},{key:"copy",value:function(){var e=new t;return e.obj=this.obj,e.approximate=this.approximate,e}}]),t}(),K=function(t){a(i,t);var e=v(i);function i(){var t;return n(this,i),(t=e.apply(this,arguments)).name=null,t._content=[],t.namedContent=new Map,t.visitsShouldBeCounted=!1,t.turnIndexShouldBeCounted=!1,t.countingAtStartOnly=!1,t._pathToFirstLeafContent=null,t}return r(i,[{key:"hasValidName",get:function(){return null!=this.name&&this.name.length>0}},{key:"content",get:function(){return this._content},set:function(t){this.AddContent(t)}},{key:"namedOnlyContent",get:function(){var t,e=new Map,n=g(this.namedContent);try{for(n.s();!(t=n.n()).done;){var i=d(t.value,2),r=i[0],a=b(i[1],N);e.set(r,a)}}catch(t){n.e(t)}finally{n.f()}var s,o=g(this.content);try{for(o.s();!(s=o.n()).done;){var u=w(s.value);null!=u&&u.hasValidName&&e.delete(u.name)}}catch(t){o.e(t)}finally{o.f()}return 0==e.size&&(e=null),e},set:function(t){var e=this.namedOnlyContent;if(null!=e){var n,i=g(e);try{for(i.s();!(n=i.n()).done;){var r=d(n.value,1)[0];this.namedContent.delete(r)}}catch(t){i.e(t)}finally{i.f()}}if(null!=t){var a,s=g(t);try{for(s.s();!(a=s.n()).done;){var o=w(d(a.value,2)[1]);null!=o&&this.AddToNamedContentOnly(o)}}catch(t){s.e(t)}finally{s.f()}}}},{key:"countFlags",get:function(){var t=0;return this.visitsShouldBeCounted&&(t|=i.CountFlags.Visits),this.turnIndexShouldBeCounted&&(t|=i.CountFlags.Turns),this.countingAtStartOnly&&(t|=i.CountFlags.CountStartOnly),t==i.CountFlags.CountStartOnly&&(t=0),t},set:function(t){var e=t;(e&i.CountFlags.Visits)>0&&(this.visitsShouldBeCounted=!0),(e&i.CountFlags.Turns)>0&&(this.turnIndexShouldBeCounted=!0),(e&i.CountFlags.CountStartOnly)>0&&(this.countingAtStartOnly=!0)}},{key:"pathToFirstLeafContent",get:function(){return null==this._pathToFirstLeafContent&&(this._pathToFirstLeafContent=this.path.PathByAppendingPath(this.internalPathToFirstLeafContent)),this._pathToFirstLeafContent}},{key:"internalPathToFirstLeafContent",get:function(){for(var t=[],e=this;e instanceof i;)e.content.length>0&&(t.push(new k.Component(0)),e=e.content[0]);return new k(t)}},{key:"AddContent",value:function(t){if(t instanceof Array){var e,n=g(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;this.AddContent(i)}}catch(t){n.e(t)}finally{n.f()}}else{var r=t;if(this._content.push(r),r.parent)throw new Error("content is already in "+r.parent);r.parent=this,this.TryAddNamedContent(r)}}},{key:"TryAddNamedContent",value:function(t){var e=w(t);null!=e&&e.hasValidName&&this.AddToNamedContentOnly(e)}},{key:"AddToNamedContentOnly",value:function(t){if(S.AssertType(t,N,"Can only add Runtime.Objects to a Runtime.Container"),b(t,N).parent=this,null===t.name)return P("namedContentObj.name");this.namedContent.set(t.name,t)}},{key:"ContentAtPath",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;-1==n&&(n=t.length);var r=new q;r.approximate=!1;for(var a=this,s=this,o=e;o=0&&t.index=0||u.set(c,f)}}catch(t){l.e(t)}finally{l.f()}if(u.size>0){r(),t.AppendLine("-- named: --");var v,p=g(u);try{for(p.s();!(v=p.n()).done;){var y=d(v.value,2)[1];S.AssertType(y,i,"Can only print out named Containers"),y.BuildStringOfHierarchy(t,e,n),t.AppendLine()}}catch(t){p.e(t)}finally{p.f()}}e--,r(),t.Append("]")}}]),i}(N);!function(t){var e;(e=t.CountFlags||(t.CountFlags={}))[e.Visits=1]="Visits",e[e.Turns=2]="Turns",e[e.CountStartOnly=4]="CountStartOnly"}(K||(K={}));var z,H=function(t){a(i,t);var e=v(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"toString",value:function(){return"Glue"}}]),i}(N),X=function(t){a(i,t);var e=v(i);function i(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.CommandType.NotSet;return n(this,i),(t=e.call(this))._commandType=r,t}return r(i,[{key:"commandType",get:function(){return this._commandType}},{key:"Copy",value:function(){return new i(this.commandType)}},{key:"toString",value:function(){return this.commandType.toString()}}],[{key:"EvalStart",value:function(){return new i(i.CommandType.EvalStart)}},{key:"EvalOutput",value:function(){return new i(i.CommandType.EvalOutput)}},{key:"EvalEnd",value:function(){return new i(i.CommandType.EvalEnd)}},{key:"Duplicate",value:function(){return new i(i.CommandType.Duplicate)}},{key:"PopEvaluatedValue",value:function(){return new i(i.CommandType.PopEvaluatedValue)}},{key:"PopFunction",value:function(){return new i(i.CommandType.PopFunction)}},{key:"PopTunnel",value:function(){return new i(i.CommandType.PopTunnel)}},{key:"BeginString",value:function(){return new i(i.CommandType.BeginString)}},{key:"EndString",value:function(){return new i(i.CommandType.EndString)}},{key:"NoOp",value:function(){return new i(i.CommandType.NoOp)}},{key:"ChoiceCount",value:function(){return new i(i.CommandType.ChoiceCount)}},{key:"Turns",value:function(){return new i(i.CommandType.Turns)}},{key:"TurnsSince",value:function(){return new i(i.CommandType.TurnsSince)}},{key:"ReadCount",value:function(){return new i(i.CommandType.ReadCount)}},{key:"Random",value:function(){return new i(i.CommandType.Random)}},{key:"SeedRandom",value:function(){return new i(i.CommandType.SeedRandom)}},{key:"VisitIndex",value:function(){return new i(i.CommandType.VisitIndex)}},{key:"SequenceShuffleIndex",value:function(){return new i(i.CommandType.SequenceShuffleIndex)}},{key:"StartThread",value:function(){return new i(i.CommandType.StartThread)}},{key:"Done",value:function(){return new i(i.CommandType.Done)}},{key:"End",value:function(){return new i(i.CommandType.End)}},{key:"ListFromInt",value:function(){return new i(i.CommandType.ListFromInt)}},{key:"ListRange",value:function(){return new i(i.CommandType.ListRange)}},{key:"ListRandom",value:function(){return new i(i.CommandType.ListRandom)}},{key:"BeginTag",value:function(){return new i(i.CommandType.BeginTag)}},{key:"EndTag",value:function(){return new i(i.CommandType.EndTag)}}]),i}(N);!function(t){var e;(e=t.CommandType||(t.CommandType={}))[e.NotSet=-1]="NotSet",e[e.EvalStart=0]="EvalStart",e[e.EvalOutput=1]="EvalOutput",e[e.EvalEnd=2]="EvalEnd",e[e.Duplicate=3]="Duplicate",e[e.PopEvaluatedValue=4]="PopEvaluatedValue",e[e.PopFunction=5]="PopFunction",e[e.PopTunnel=6]="PopTunnel",e[e.BeginString=7]="BeginString",e[e.EndString=8]="EndString",e[e.NoOp=9]="NoOp",e[e.ChoiceCount=10]="ChoiceCount",e[e.Turns=11]="Turns",e[e.TurnsSince=12]="TurnsSince",e[e.ReadCount=13]="ReadCount",e[e.Random=14]="Random",e[e.SeedRandom=15]="SeedRandom",e[e.VisitIndex=16]="VisitIndex",e[e.SequenceShuffleIndex=17]="SequenceShuffleIndex",e[e.StartThread=18]="StartThread",e[e.Done=19]="Done",e[e.End=20]="End",e[e.ListFromInt=21]="ListFromInt",e[e.ListRange=22]="ListRange",e[e.ListRandom=23]="ListRandom",e[e.BeginTag=24]="BeginTag",e[e.EndTag=25]="EndTag",e[e.TOTAL_VALUES=26]="TOTAL_VALUES"}(X||(X={})),function(t){t[t.Tunnel=0]="Tunnel",t[t.Function=1]="Function",t[t.FunctionEvaluationFromGame=2]="FunctionEvaluationFromGame"}(z||(z={}));var $=function(){function t(){n(this,t),this.container=null,this.index=-1,2===arguments.length&&(this.container=arguments[0],this.index=arguments[1])}return r(t,[{key:"Resolve",value:function(){return this.index<0?this.container:null==this.container?null:0==this.container.content.length?this.container:this.index>=this.container.content.length?null:this.container.content[this.index]}},{key:"isNull",get:function(){return null==this.container}},{key:"path",get:function(){return this.isNull?null:this.index>=0?this.container.path.PathByAppendingComponent(new k.Component(this.index)):this.container.path}},{key:"toString",value:function(){return this.container?"Ink Pointer -> "+this.container.path.toString()+" -- index "+this.index:"Ink Pointer (null)"}},{key:"copy",value:function(){return new t(this.container,this.index)}}],[{key:"StartOf",value:function(e){return new t(e,0)}},{key:"Null",get:function(){return new t(null,-1)}}]),t}(),Y=function(t){a(i,t);var e=v(i);function i(t){var r;return n(this,i),(r=e.call(this))._targetPath=null,r._targetPointer=$.Null,r.variableDivertName=null,r.pushesToStack=!1,r.stackPushType=0,r.isExternal=!1,r.externalArgs=0,r.isConditional=!1,r.pushesToStack=!1,void 0!==t&&(r.pushesToStack=!0,r.stackPushType=t),r}return r(i,[{key:"targetPath",get:function(){if(null!=this._targetPath&&this._targetPath.isRelative){var t=this.targetPointer.Resolve();t&&(this._targetPath=t.path)}return this._targetPath},set:function(t){this._targetPath=t,this._targetPointer=$.Null}},{key:"targetPointer",get:function(){if(this._targetPointer.isNull){var t=this.ResolvePath(this._targetPath).obj;if(null===this._targetPath)return P("this._targetPath");if(null===this._targetPath.lastComponent)return P("this._targetPath.lastComponent");if(this._targetPath.lastComponent.isIndex){if(null===t)return P("targetObj");this._targetPointer.container=t.parent instanceof K?t.parent:null,this._targetPointer.index=this._targetPath.lastComponent.index}else this._targetPointer=$.StartOf(t instanceof K?t:null)}return this._targetPointer.copy()}},{key:"targetPathString",get:function(){return null==this.targetPath?null:this.CompactPathString(this.targetPath)},set:function(t){this.targetPath=null==t?null:new k(t)}},{key:"hasVariableTarget",get:function(){return null!=this.variableDivertName}},{key:"Equals",value:function(t){var e=t;return e instanceof i&&this.hasVariableTarget==e.hasVariableTarget&&(this.hasVariableTarget?this.variableDivertName==e.variableDivertName:null===this.targetPath?P("this.targetPath"):this.targetPath.Equals(e.targetPath))}},{key:"toString",value:function(){if(this.hasVariableTarget)return"Divert(variable: "+this.variableDivertName+")";if(null==this.targetPath)return"Divert(null)";var t=new A,e=this.targetPath.toString();return t.Append("Divert"),this.isConditional&&t.Append("?"),this.pushesToStack&&(this.stackPushType==z.Function?t.Append(" function"):t.Append(" tunnel")),t.Append(" -> "),t.Append(this.targetPathString),t.Append(" ("),t.Append(e),t.Append(")"),t.toString()}}]),i}(N),Q=function(t){a(i,t);var e=v(i);function i(){var t,r=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return n(this,i),(t=e.call(this))._pathOnChoice=null,t.hasCondition=!1,t.hasStartContent=!1,t.hasChoiceOnlyContent=!1,t.isInvisibleDefault=!1,t.onceOnly=!0,t.onceOnly=r,t}return r(i,[{key:"pathOnChoice",get:function(){if(null!=this._pathOnChoice&&this._pathOnChoice.isRelative){var t=this.choiceTarget;t&&(this._pathOnChoice=t.path)}return this._pathOnChoice},set:function(t){this._pathOnChoice=t}},{key:"choiceTarget",get:function(){return null===this._pathOnChoice?P("ChoicePoint._pathOnChoice"):this.ResolvePath(this._pathOnChoice).container}},{key:"pathStringOnChoice",get:function(){return null===this.pathOnChoice?P("ChoicePoint.pathOnChoice"):this.CompactPathString(this.pathOnChoice)},set:function(t){this.pathOnChoice=new k(t)}},{key:"flags",get:function(){var t=0;return this.hasCondition&&(t|=1),this.hasStartContent&&(t|=2),this.hasChoiceOnlyContent&&(t|=4),this.isInvisibleDefault&&(t|=8),this.onceOnly&&(t|=16),t},set:function(t){this.hasCondition=(1&t)>0,this.hasStartContent=(2&t)>0,this.hasChoiceOnlyContent=(4&t)>0,this.isInvisibleDefault=(8&t)>0,this.onceOnly=(16&t)>0}},{key:"toString",value:function(){return null===this.pathOnChoice?P("ChoicePoint.pathOnChoice"):"Choice: -> "+this.pathOnChoice.toString()}}]),i}(N),Z=function(t){a(i,t);var e=v(i);function i(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return n(this,i),(t=e.call(this)).pathForCount=null,t.name=r,t}return r(i,[{key:"containerForCount",get:function(){return null===this.pathForCount?null:this.ResolvePath(this.pathForCount).container}},{key:"pathStringForCount",get:function(){return null===this.pathForCount?null:this.CompactPathString(this.pathForCount)},set:function(t){this.pathForCount=null===t?null:new k(t)}},{key:"toString",value:function(){return null!=this.name?"var("+this.name+")":"read_count("+this.pathStringForCount+")"}}]),i}(N),tt=function(t){a(i,t);var e=v(i);function i(t,r){var a;return n(this,i),(a=e.call(this)).variableName=t||null,a.isNewDeclaration=!!r,a.isGlobal=!1,a}return r(i,[{key:"toString",value:function(){return"VarAssign to "+this.variableName}}]),i}(N),et=function(t){a(i,t);var e=v(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i)}(N),nt=function(t){a(i,t);var e=v(i);function i(){var t;if(n(this,i),(t=e.call(this))._name=null,t._numberOfParameters=0,t._prototype=null,t._isPrototype=!1,t._operationFuncs=null,0===arguments.length)i.GenerateNativeFunctionsIfNecessary();else if(1===arguments.length){var r=arguments[0];i.GenerateNativeFunctionsIfNecessary(),t.name=r}else if(2===arguments.length){var a=arguments[0],s=arguments[1];t._isPrototype=!0,t.name=a,t.numberOfParameters=s}return t}return r(i,[{key:"name",get:function(){return null===this._name?P("NativeFunctionCall._name"):this._name},set:function(t){this._name=t,this._isPrototype||(null===i._nativeFunctions?P("NativeFunctionCall._nativeFunctions"):this._prototype=i._nativeFunctions.get(this._name)||null)}},{key:"numberOfParameters",get:function(){return this._prototype?this._prototype.numberOfParameters:this._numberOfParameters},set:function(t){this._numberOfParameters=t}},{key:"Call",value:function(t){if(this._prototype)return this._prototype.Call(t);if(this.numberOfParameters!=t.length)throw new Error("Unexpected number of parameters");var e,n=!1,i=g(t);try{for(i.s();!(e=i.n()).done;){var r=e.value;if(r instanceof et)throw new x('Attempting to perform operation on a void value. Did you forget to "return" a value from a function you called here?');r instanceof U&&(n=!0)}}catch(t){i.e(t)}finally{i.f()}if(2==t.length&&n)return this.CallBinaryListOperation(t);var a=this.CoerceValuesToSingleType(t),s=a[0].valueType;return s==V.Int||s==V.Float||s==V.String||s==V.DivertTarget||s==V.List?this.CallType(a):null}},{key:"CallType",value:function(t){var e=b(t[0],j),n=e.valueType,r=e,a=t.length;if(2==a||1==a){if(null===this._operationFuncs)return P("NativeFunctionCall._operationFuncs");var s=this._operationFuncs.get(n);if(!s){var o=V[n];throw new x("Cannot perform operation "+this.name+" on "+o)}if(2==a){var u=b(t[1],j),l=s;if(null===r.value||null===u.value)return P("NativeFunctionCall.Call BinaryOp values");var h=l(r.value,u.value);return j.Create(h)}var c=s;if(null===r.value)return P("NativeFunctionCall.Call UnaryOp value");var f=c(r.value);return this.name===i.Int?j.Create(f,V.Int):this.name===i.Float?j.Create(f,V.Float):j.Create(f,e.valueType)}throw new Error("Unexpected number of parameters to NativeFunctionCall: "+t.length)}},{key:"CallBinaryListOperation",value:function(t){if(("+"==this.name||"-"==this.name)&&t[0]instanceof U&&t[1]instanceof D)return this.CallListIncrementOperation(t);var e=b(t[0],j),n=b(t[1],j);if(!("&&"!=this.name&&"||"!=this.name||e.valueType==V.List&&n.valueType==V.List)){if(null===this._operationFuncs)return P("NativeFunctionCall._operationFuncs");var i=this._operationFuncs.get(V.Int);if(null===i)return P("NativeFunctionCall.CallBinaryListOperation op");var r=function(t){if("boolean"==typeof t)return t;throw new Error("".concat(t," is not a boolean"))}(i(e.isTruthy?1:0,n.isTruthy?1:0));return new R(r)}if(e.valueType==V.List&&n.valueType==V.List)return this.CallType([e,n]);throw new x("Can not call use "+this.name+" operation on "+V[e.valueType]+" and "+V[n.valueType])}},{key:"CallListIncrementOperation",value:function(t){var e=b(t[0],U),n=b(t[1],D),i=new F;if(null===e.value)return P("NativeFunctionCall.CallListIncrementOperation listVal.value");var r,a=g(e.value);try{for(a.s();!(r=a.n()).done;){var s=d(r.value,2),o=s[0],u=s[1],l=I.fromSerializedKey(o);if(null===this._operationFuncs)return P("NativeFunctionCall._operationFuncs");var h=this._operationFuncs.get(V.Int);if(null===n.value)return P("NativeFunctionCall.CallListIncrementOperation intVal.value");var c=h(u,n.value),f=null;if(null===e.value.origins)return P("NativeFunctionCall.CallListIncrementOperation listVal.value.origins");var v,p=g(e.value.origins);try{for(p.s();!(v=p.n()).done;){var y=v.value;if(y.name==l.originName){f=y;break}}}catch(t){p.e(t)}finally{p.f()}if(null!=f){var m=f.TryGetItemWithValue(c,I.Null);m.exists&&i.Add(m.result,c)}}}catch(t){a.e(t)}finally{a.f()}return new U(i)}},{key:"CoerceValuesToSingleType",value:function(t){var e,n=V.Int,i=null,r=g(t);try{for(r.s();!(e=r.n()).done;){var a=b(e.value,j);a.valueType>n&&(n=a.valueType),a.valueType==V.List&&(i=C(a,U))}}catch(t){r.e(t)}finally{r.f()}var s=[];if(V[n]==V[V.List]){var o,u=g(t);try{for(u.s();!(o=u.n()).done;){var l=b(o.value,j);if(l.valueType==V.List)s.push(l);else{if(l.valueType!=V.Int){var h=V[l.valueType];throw new x("Cannot mix Lists and "+h+" values in this operation")}var c=parseInt(l.valueObject);if(null===(i=b(i,U)).value)return P("NativeFunctionCall.CoerceValuesToSingleType specialCaseList.value");var f=i.value.originOfMaxItem;if(null===f)return P("NativeFunctionCall.CoerceValuesToSingleType list");var v=f.TryGetItemWithValue(c,I.Null);if(!v.exists)throw new x("Could not find List item with the value "+c+" in "+f.name);var d=new U(v.result,c);s.push(d)}}}catch(t){u.e(t)}finally{u.f()}}else{var p,y=g(t);try{for(y.s();!(p=y.n()).done;){var m=b(p.value,j).Cast(n);s.push(m)}}catch(t){y.e(t)}finally{y.f()}}return s}},{key:"AddOpFuncForType",value:function(t,e){null==this._operationFuncs&&(this._operationFuncs=new Map),this._operationFuncs.set(t,e)}},{key:"toString",value:function(){return'Native "'+this.name+'"'}}],[{key:"CallWithName",value:function(t){return new i(t)}},{key:"CallExistsWithName",value:function(t){return this.GenerateNativeFunctionsIfNecessary(),this._nativeFunctions.get(t)}},{key:"Identity",value:function(t){return t}},{key:"GenerateNativeFunctionsIfNecessary",value:function(){if(null==this._nativeFunctions){this._nativeFunctions=new Map,this.AddIntBinaryOp(this.Add,(function(t,e){return t+e})),this.AddIntBinaryOp(this.Subtract,(function(t,e){return t-e})),this.AddIntBinaryOp(this.Multiply,(function(t,e){return t*e})),this.AddIntBinaryOp(this.Divide,(function(t,e){return Math.floor(t/e)})),this.AddIntBinaryOp(this.Mod,(function(t,e){return t%e})),this.AddIntUnaryOp(this.Negate,(function(t){return-t})),this.AddIntBinaryOp(this.Equal,(function(t,e){return t==e})),this.AddIntBinaryOp(this.Greater,(function(t,e){return t>e})),this.AddIntBinaryOp(this.Less,(function(t,e){return t=e})),this.AddIntBinaryOp(this.LessThanOrEquals,(function(t,e){return t<=e})),this.AddIntBinaryOp(this.NotEquals,(function(t,e){return t!=e})),this.AddIntUnaryOp(this.Not,(function(t){return 0==t})),this.AddIntBinaryOp(this.And,(function(t,e){return 0!=t&&0!=e})),this.AddIntBinaryOp(this.Or,(function(t,e){return 0!=t||0!=e})),this.AddIntBinaryOp(this.Max,(function(t,e){return Math.max(t,e)})),this.AddIntBinaryOp(this.Min,(function(t,e){return Math.min(t,e)})),this.AddIntBinaryOp(this.Pow,(function(t,e){return Math.pow(t,e)})),this.AddIntUnaryOp(this.Floor,i.Identity),this.AddIntUnaryOp(this.Ceiling,i.Identity),this.AddIntUnaryOp(this.Int,i.Identity),this.AddIntUnaryOp(this.Float,(function(t){return t})),this.AddFloatBinaryOp(this.Add,(function(t,e){return t+e})),this.AddFloatBinaryOp(this.Subtract,(function(t,e){return t-e})),this.AddFloatBinaryOp(this.Multiply,(function(t,e){return t*e})),this.AddFloatBinaryOp(this.Divide,(function(t,e){return t/e})),this.AddFloatBinaryOp(this.Mod,(function(t,e){return t%e})),this.AddFloatUnaryOp(this.Negate,(function(t){return-t})),this.AddFloatBinaryOp(this.Equal,(function(t,e){return t==e})),this.AddFloatBinaryOp(this.Greater,(function(t,e){return t>e})),this.AddFloatBinaryOp(this.Less,(function(t,e){return t=e})),this.AddFloatBinaryOp(this.LessThanOrEquals,(function(t,e){return t<=e})),this.AddFloatBinaryOp(this.NotEquals,(function(t,e){return t!=e})),this.AddFloatUnaryOp(this.Not,(function(t){return 0==t})),this.AddFloatBinaryOp(this.And,(function(t,e){return 0!=t&&0!=e})),this.AddFloatBinaryOp(this.Or,(function(t,e){return 0!=t||0!=e})),this.AddFloatBinaryOp(this.Max,(function(t,e){return Math.max(t,e)})),this.AddFloatBinaryOp(this.Min,(function(t,e){return Math.min(t,e)})),this.AddFloatBinaryOp(this.Pow,(function(t,e){return Math.pow(t,e)})),this.AddFloatUnaryOp(this.Floor,(function(t){return Math.floor(t)})),this.AddFloatUnaryOp(this.Ceiling,(function(t){return Math.ceil(t)})),this.AddFloatUnaryOp(this.Int,(function(t){return Math.floor(t)})),this.AddFloatUnaryOp(this.Float,i.Identity),this.AddStringBinaryOp(this.Add,(function(t,e){return t+e})),this.AddStringBinaryOp(this.Equal,(function(t,e){return t===e})),this.AddStringBinaryOp(this.NotEquals,(function(t,e){return!(t===e)})),this.AddStringBinaryOp(this.Has,(function(t,e){return t.includes(e)})),this.AddStringBinaryOp(this.Hasnt,(function(t,e){return!t.includes(e)})),this.AddListBinaryOp(this.Add,(function(t,e){return t.Union(e)})),this.AddListBinaryOp(this.Subtract,(function(t,e){return t.Without(e)})),this.AddListBinaryOp(this.Has,(function(t,e){return t.Contains(e)})),this.AddListBinaryOp(this.Hasnt,(function(t,e){return!t.Contains(e)})),this.AddListBinaryOp(this.Intersect,(function(t,e){return t.Intersect(e)})),this.AddListBinaryOp(this.Equal,(function(t,e){return t.Equals(e)})),this.AddListBinaryOp(this.Greater,(function(t,e){return t.GreaterThan(e)})),this.AddListBinaryOp(this.Less,(function(t,e){return t.LessThan(e)})),this.AddListBinaryOp(this.GreaterThanOrEquals,(function(t,e){return t.GreaterThanOrEquals(e)})),this.AddListBinaryOp(this.LessThanOrEquals,(function(t,e){return t.LessThanOrEquals(e)})),this.AddListBinaryOp(this.NotEquals,(function(t,e){return!t.Equals(e)})),this.AddListBinaryOp(this.And,(function(t,e){return t.Count>0&&e.Count>0})),this.AddListBinaryOp(this.Or,(function(t,e){return t.Count>0||e.Count>0})),this.AddListUnaryOp(this.Not,(function(t){return 0==t.Count?1:0})),this.AddListUnaryOp(this.Invert,(function(t){return t.inverse})),this.AddListUnaryOp(this.All,(function(t){return t.all})),this.AddListUnaryOp(this.ListMin,(function(t){return t.MinAsList()})),this.AddListUnaryOp(this.ListMax,(function(t){return t.MaxAsList()})),this.AddListUnaryOp(this.Count,(function(t){return t.Count})),this.AddListUnaryOp(this.ValueOfList,(function(t){return t.maxItem.Value}));this.AddOpToNativeFunc(this.Equal,2,V.DivertTarget,(function(t,e){return t.Equals(e)})),this.AddOpToNativeFunc(this.NotEquals,2,V.DivertTarget,(function(t,e){return!t.Equals(e)}))}}},{key:"AddOpToNativeFunc",value:function(t,e,n,r){if(null===this._nativeFunctions)return P("NativeFunctionCall._nativeFunctions");var a=this._nativeFunctions.get(t);a||(a=new i(t,e),this._nativeFunctions.set(t,a)),a.AddOpFuncForType(n,r)}},{key:"AddIntBinaryOp",value:function(t,e){this.AddOpToNativeFunc(t,2,V.Int,e)}},{key:"AddIntUnaryOp",value:function(t,e){this.AddOpToNativeFunc(t,1,V.Int,e)}},{key:"AddFloatBinaryOp",value:function(t,e){this.AddOpToNativeFunc(t,2,V.Float,e)}},{key:"AddFloatUnaryOp",value:function(t,e){this.AddOpToNativeFunc(t,1,V.Float,e)}},{key:"AddStringBinaryOp",value:function(t,e){this.AddOpToNativeFunc(t,2,V.String,e)}},{key:"AddListBinaryOp",value:function(t,e){this.AddOpToNativeFunc(t,2,V.List,e)}},{key:"AddListUnaryOp",value:function(t,e){this.AddOpToNativeFunc(t,1,V.List,e)}}]),i}(N);nt.Add="+",nt.Subtract="-",nt.Divide="/",nt.Multiply="*",nt.Mod="%",nt.Negate="_",nt.Equal="==",nt.Greater=">",nt.Less="<",nt.GreaterThanOrEquals=">=",nt.LessThanOrEquals="<=",nt.NotEquals="!=",nt.Not="!",nt.And="&&",nt.Or="||",nt.Min="MIN",nt.Max="MAX",nt.Pow="POW",nt.Floor="FLOOR",nt.Ceiling="CEILING",nt.Int="INT",nt.Float="FLOAT",nt.Has="?",nt.Hasnt="!?",nt.Intersect="^",nt.ListMin="LIST_MIN",nt.ListMax="LIST_MAX",nt.All="LIST_ALL",nt.Count="LIST_COUNT",nt.ValueOfList="LIST_VALUE",nt.Invert="LIST_INVERT",nt._nativeFunctions=null;var it=function(t){a(i,t);var e=v(i);function i(t){var r;return n(this,i),(r=e.call(this)).text=t.toString()||"",r}return r(i,[{key:"toString",value:function(){return"# "+this.text}}]),i}(N),rt=function(t){a(i,t);var e=v(i);function i(){var t;return n(this,i),(t=e.apply(this,arguments)).text="",t.index=0,t.threadAtGeneration=null,t.sourcePath="",t.targetPath=null,t.isInvisibleDefault=!1,t.tags=null,t.originalThreadIndex=0,t}return r(i,[{key:"pathStringOnChoice",get:function(){return null===this.targetPath?P("Choice.targetPath"):this.targetPath.toString()},set:function(t){this.targetPath=new k(t)}}]),i}(N),at=function(){function t(e,i){n(this,t),this._name=e||"",this._items=null,this._itemNameToValues=i||new Map}return r(t,[{key:"name",get:function(){return this._name}},{key:"items",get:function(){if(null==this._items){this._items=new Map;var t,e=g(this._itemNameToValues);try{for(e.s();!(t=e.n()).done;){var n=d(t.value,2),i=n[0],r=n[1],a=new I(this.name,i);this._items.set(a.serialized(),r)}}catch(t){e.e(t)}finally{e.f()}}return this._items}},{key:"ValueForItem",value:function(t){if(!t.itemName)return 0;var e=this._itemNameToValues.get(t.itemName);return void 0!==e?e:0}},{key:"ContainsItem",value:function(t){return!!t.itemName&&(t.originName==this.name&&this._itemNameToValues.has(t.itemName))}},{key:"ContainsItemWithName",value:function(t){return this._itemNameToValues.has(t)}},{key:"TryGetItemWithValue",value:function(t,e){var n,i=g(this._itemNameToValues);try{for(i.s();!(n=i.n()).done;){var r=d(n.value,2),a=r[0];if(r[1]==t)return{result:new I(this.name,a),exists:!0}}}catch(t){i.e(t)}finally{i.f()}return{result:I.Null,exists:!1}}},{key:"TryGetValueForItem",value:function(t,e){if(!t.itemName)return{result:0,exists:!1};var n=this._itemNameToValues.get(t.itemName);return n?{result:n,exists:!0}:{result:0,exists:!1}}}]),t}(),st=function(){function t(e){n(this,t),this._lists=new Map,this._allUnambiguousListValueCache=new Map;var i,r=g(e);try{for(r.s();!(i=r.n()).done;){var a=i.value;this._lists.set(a.name,a);var s,o=g(a.items);try{for(o.s();!(s=o.n()).done;){var u=d(s.value,2),l=u[0],h=u[1],c=I.fromSerializedKey(l),f=new U(c,h);if(!c.itemName)throw new Error("item.itemName is null or undefined.");this._allUnambiguousListValueCache.set(c.itemName,f),this._allUnambiguousListValueCache.set(c.fullName,f)}}catch(t){o.e(t)}finally{o.f()}}}catch(t){r.e(t)}finally{r.f()}}return r(t,[{key:"lists",get:function(){var t,e=[],n=g(this._lists);try{for(n.s();!(t=n.n()).done;){var i=d(t.value,2)[1];e.push(i)}}catch(t){n.e(t)}finally{n.f()}return e}},{key:"TryListGetDefinition",value:function(t,e){if(null===t)return{result:e,exists:!1};var n=this._lists.get(t);return n?{result:n,exists:!0}:{result:e,exists:!1}}},{key:"FindSingleItemListWithName",value:function(t){if(null===t)return P("name");var e=this._allUnambiguousListValueCache.get(t);return void 0!==e?e:null}}]),t}(),ot=function(){function t(){n(this,t)}return r(t,null,[{key:"JArrayToRuntimeObjList",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.length;e&&n--;for(var i=[],r=0;rt->")),a=r.hasVariableTarget?r.variableDivertName:r.targetPathString,e.WriteObjectStart(),e.WriteProperty(s,a),r.hasVariableTarget&&e.WriteProperty("var",!0),r.isConditional&&e.WriteProperty("c",!0),r.externalArgs>0&&e.WriteIntProperty("exArgs",r.externalArgs),void e.WriteObjectEnd()}var o=C(n,Q);if(o)return e.WriteObjectStart(),e.WriteProperty("*",o.pathStringOnChoice),e.WriteIntProperty("flg",o.flags),void e.WriteObjectEnd();var u=C(n,R);if(u)e.WriteBool(u.value);else{var l=C(n,D);if(l)e.WriteInt(l.value);else{var h=C(n,B);if(h)e.WriteFloat(h.value);else{var c=C(n,G);if(c)c.isNewline?e.Write("\n",!1):(e.WriteStringStart(),e.WriteStringInner("^"),e.WriteStringInner(c.value),e.WriteStringEnd());else{var f=C(n,U);if(f)this.WriteInkList(e,f);else{var v=C(n,M);if(v)return e.WriteObjectStart(),null===v.value?P("divTargetVal.value"):(e.WriteProperty("^->",v.value.componentsString),void e.WriteObjectEnd());var d=C(n,J);if(d)return e.WriteObjectStart(),e.WriteProperty("^var",d.value),e.WriteIntProperty("ci",d.contextIndex),void e.WriteObjectEnd();if(C(n,H))e.Write("<>");else{var p=C(n,X);if(p)e.Write(t._controlCommandNames[p.commandType]);else{var y=C(n,nt);if(y){var m=y.name;return"^"==m&&(m="L^"),void e.Write(m)}var g=C(n,Z);if(g){e.WriteObjectStart();var S=g.pathStringForCount;return null!=S?e.WriteProperty("CNT?",S):e.WriteProperty("VAR?",g.name),void e.WriteObjectEnd()}var k=C(n,tt);if(k){e.WriteObjectStart();var b=k.isGlobal?"VAR=":"temp=";return e.WriteProperty(b,k.variableName),k.isNewDeclaration||e.WriteProperty("re",!0),void e.WriteObjectEnd()}if(C(n,et))e.Write("void");else{var w=C(n,it);if(w)return e.WriteObjectStart(),e.WriteProperty("#",w.text),void e.WriteObjectEnd();var _=C(n,rt);if(!_)throw new Error("Failed to convert runtime object to Json token: "+n);this.WriteChoice(e,_)}}}}}}}}}}},{key:"JObjectToDictionaryRuntimeObjs",value:function(t){var e=new Map;for(var n in t)if(t.hasOwnProperty(n)){var i=this.JTokenToRuntimeObject(t[n]);if(null===i)return P("inkObject");e.set(n,i)}return e}},{key:"JObjectToIntDictionary",value:function(t){var e=new Map;for(var n in t)t.hasOwnProperty(n)&&e.set(n,parseInt(t[n]));return e}},{key:"JTokenToRuntimeObject",value:function(n){if("number"==typeof n&&!isNaN(n)||"boolean"==typeof n)return j.Create(n);if("string"==typeof n){var i=n.toString(),r=i[0];if("^"==r)return new G(i.substring(1));if("\n"==r&&1==i.length)return new G("\n");if("<>"==i)return new H;for(var a=0;a->"==i)return X.PopTunnel();if("~ret"==i)return X.PopFunction();if("void"==i)return new et}if("object"===e(n)&&!Array.isArray(n)){var s,o=n;if(o["^->"])return s=o["^->"],new M(new k(s.toString()));if(o["^var"]){s=o["^var"];var u=new J(s.toString());return"ci"in o&&(s=o.ci,u.contextIndex=parseInt(s)),u}var l=!1,h=!1,c=z.Function,f=!1;if((s=o["->"])?l=!0:(s=o["f()"])?(l=!0,h=!0,c=z.Function):(s=o["->t->"])?(l=!0,h=!0,c=z.Tunnel):(s=o["x()"])&&(l=!0,f=!0,h=!1,c=z.Function),l){var v=new Y;v.pushesToStack=h,v.stackPushType=c,v.isExternal=f;var d=s.toString();return(s=o.var)?v.variableDivertName=d:v.targetPathString=d,v.isConditional=!!o.c,f&&(s=o.exArgs)&&(v.externalArgs=parseInt(s)),v}if(s=o["*"]){var p=new Q;return p.pathStringOnChoice=s.toString(),(s=o.flg)&&(p.flags=parseInt(s)),p}if(s=o["VAR?"])return new Z(s.toString());if(s=o["CNT?"]){var y=new Z;return y.pathStringForCount=s.toString(),y}var m=!1,g=!1;if((s=o["VAR="])?(m=!0,g=!0):(s=o["temp="])&&(m=!0,g=!1),m){var S=s.toString(),C=!o.re,b=new tt(S,C);return b.isGlobal=g,b}if(void 0!==o["#"])return s=o["#"],new it(s.toString());if(s=o.list){var w=s,_=new F;if(s=o.origins){var T=s;_.SetInitialOriginNames(T)}for(var E in w)if(w.hasOwnProperty(E)){var O=w[E],P=new I(E),N=parseInt(O);_.Add(P,N)}return new U(_)}if(null!=o.originalChoicePath)return this.JObjectToChoice(o)}if(Array.isArray(n))return this.JArrayToContainer(n);if(null==n)return null;throw new Error("Failed to convert token to runtime object: "+this.toJson(n,["parent"]))}},{key:"toJson",value:function(t,e,n){return JSON.stringify(t,(function(t,n){return(null==e?void 0:e.some((function(e){return e===t})))?void 0:n}),n)}},{key:"WriteRuntimeContainer",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t.WriteArrayStart(),null===e)return P("container");var i,r=g(e.content);try{for(r.s();!(i=r.n()).done;){var a=i.value;this.WriteRuntimeObject(t,a)}}catch(t){r.e(t)}finally{r.f()}var s=e.namedOnlyContent,o=e.countFlags,u=null!=e.name&&!n,l=null!=s||o>0||u;if(l&&t.WriteObjectStart(),null!=s){var h,c=g(s);try{for(c.s();!(h=c.n()).done;){var f=d(h.value,2),v=f[0],p=f[1],y=v,m=C(p,K);t.WritePropertyStart(y),this.WriteRuntimeContainer(t,m,!0),t.WritePropertyEnd()}}catch(t){c.e(t)}finally{c.f()}}o>0&&t.WriteIntProperty("#f",o),u&&t.WriteProperty("#n",e.name),l?t.WriteObjectEnd():t.WriteNull(),t.WriteArrayEnd()}},{key:"JArrayToContainer",value:function(t){var e=new K;e.content=this.JArrayToRuntimeObjList(t,!0);var n=t[t.length-1];if(null!=n){var i=new Map;for(var r in n)if("#f"==r)e.countFlags=parseInt(n[r]);else if("#n"==r)e.name=n[r].toString();else{var a=this.JTokenToRuntimeObject(n[r]),s=C(a,K);s&&(s.name=r),i.set(r,a)}e.namedOnlyContent=i}return e}},{key:"JObjectToChoice",value:function(t){var e=new rt;return e.text=t.text.toString(),e.index=parseInt(t.index),e.sourcePath=t.originalChoicePath.toString(),e.originalThreadIndex=parseInt(t.originalThreadIndex),e.pathStringOnChoice=t.targetPath.toString(),e}},{key:"WriteChoice",value:function(t,e){t.WriteObjectStart(),t.WriteProperty("text",e.text),t.WriteIntProperty("index",e.index),t.WriteProperty("originalChoicePath",e.sourcePath),t.WriteIntProperty("originalThreadIndex",e.originalThreadIndex),t.WriteProperty("targetPath",e.pathStringOnChoice),t.WriteObjectEnd()}},{key:"WriteInkList",value:function(t,e){var n=e.value;if(null===n)return P("rawList");t.WriteObjectStart(),t.WritePropertyStart("list"),t.WriteObjectStart();var i,r=g(n);try{for(r.s();!(i=r.n()).done;){var a=d(i.value,2),s=a[0],o=a[1],u=I.fromSerializedKey(s),l=o;if(null===u.itemName)return P("item.itemName");t.WritePropertyNameStart(),t.WritePropertyNameInner(u.originName?u.originName:"?"),t.WritePropertyNameInner("."),t.WritePropertyNameInner(u.itemName),t.WritePropertyNameEnd(),t.Write(l),t.WritePropertyEnd()}}catch(t){r.e(t)}finally{r.f()}if(t.WriteObjectEnd(),t.WritePropertyEnd(),0==n.Count&&null!=n.originNames&&n.originNames.length>0){t.WritePropertyStart("origins"),t.WriteArrayStart();var h,c=g(n.originNames);try{for(c.s();!(h=c.n()).done;){var f=h.value;t.Write(f)}}catch(t){c.e(t)}finally{c.f()}t.WriteArrayEnd(),t.WritePropertyEnd()}t.WriteObjectEnd()}},{key:"ListDefinitionsToJToken",value:function(t){var e,n={},i=g(t.lists);try{for(i.s();!(e=i.n()).done;){var r,a=e.value,s={},o=g(a.items);try{for(o.s();!(r=o.n()).done;){var u=d(r.value,2),l=u[0],h=u[1],c=I.fromSerializedKey(l);if(null===c.itemName)return P("item.itemName");s[c.itemName]=h}}catch(t){o.e(t)}finally{o.f()}n[a.name]=s}}catch(t){i.e(t)}finally{i.f()}return n}},{key:"JTokenToListDefinitions",value:function(t){var e=t,n=[];for(var i in e)if(e.hasOwnProperty(i)){var r=i.toString(),a=e[i],s=new Map;for(var o in a)if(e.hasOwnProperty(i)){var u=a[o];s.set(o,parseInt(u))}var l=new at(r,s);n.push(l)}return new st(n)}}]),t}();ot._controlCommandNames=function(){var t=[];t[X.CommandType.EvalStart]="ev",t[X.CommandType.EvalOutput]="out",t[X.CommandType.EvalEnd]="/ev",t[X.CommandType.Duplicate]="du",t[X.CommandType.PopEvaluatedValue]="pop",t[X.CommandType.PopFunction]="~ret",t[X.CommandType.PopTunnel]="->->",t[X.CommandType.BeginString]="str",t[X.CommandType.EndString]="/str",t[X.CommandType.NoOp]="nop",t[X.CommandType.ChoiceCount]="choiceCnt",t[X.CommandType.Turns]="turn",t[X.CommandType.TurnsSince]="turns",t[X.CommandType.ReadCount]="readc",t[X.CommandType.Random]="rnd",t[X.CommandType.SeedRandom]="srnd",t[X.CommandType.VisitIndex]="visit",t[X.CommandType.SequenceShuffleIndex]="seq",t[X.CommandType.StartThread]="thread",t[X.CommandType.Done]="done",t[X.CommandType.End]="end",t[X.CommandType.ListFromInt]="listInt",t[X.CommandType.ListRange]="range",t[X.CommandType.ListRandom]="lrnd",t[X.CommandType.BeginTag]="#",t[X.CommandType.EndTag]="/#";for(var e=0;e1}},{key:"Reset",value:function(){this._threads=[],this._threads.push(new e.Thread),this._threads[0].callstack.push(new e.Element(z.Tunnel,this._startOfRoot))}},{key:"SetJsonToken",value:function(t,n){this._threads.length=0;var i,r=g(t.threads);try{for(r.s();!(i=r.n()).done;){var a=i.value,s=new e.Thread(a,n);this._threads.push(s)}}catch(t){r.e(t)}finally{r.f()}this._threadCounter=parseInt(t.threadCounter),this._startOfRoot=$.StartOf(n.rootContentContainer)}},{key:"WriteJson",value:function(t){var e=this;t.WriteObject((function(t){t.WritePropertyStart("threads"),t.WriteArrayStart();var n,i=g(e._threads);try{for(i.s();!(n=i.n()).done;){n.value.WriteJson(t)}}catch(t){i.e(t)}finally{i.f()}t.WriteArrayEnd(),t.WritePropertyEnd(),t.WritePropertyStart("threadCounter"),t.WriteInt(e._threadCounter),t.WritePropertyEnd()}))}},{key:"PushThread",value:function(){var t=this.currentThread.Copy();this._threadCounter++,t.threadIndex=this._threadCounter,this._threads.push(t)}},{key:"ForkThread",value:function(){var t=this.currentThread.Copy();return this._threadCounter++,t.threadIndex=this._threadCounter,t}},{key:"PopThread",value:function(){if(!this.canPopThread)throw new Error("Can't pop thread");this._threads.splice(this._threads.indexOf(this.currentThread),1)}},{key:"canPopThread",get:function(){return this._threads.length>1&&!this.elementIsEvaluateFromGame}},{key:"elementIsEvaluateFromGame",get:function(){return this.currentElement.type==z.FunctionEvaluationFromGame}},{key:"Push",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=new e.Element(t,this.currentElement.currentPointer,!1);r.evaluationStackHeightWhenPushed=n,r.functionStartInOutputStream=i,this.callStack.push(r)}},{key:"CanPop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!!this.canPop&&(null==t||this.currentElement.type==t)}},{key:"Pop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!this.CanPop(t))throw new Error("Mismatched push/pop in Callstack");this.callStack.pop()}},{key:"GetTemporaryVariableWithName",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;-1==e&&(e=this.currentElementIndex+1);var n=W(this.callStack[e-1].temporaryVariables,t,null);return n.exists?n.result:null}},{key:"SetTemporaryVariable",value:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1;-1==i&&(i=this.currentElementIndex+1);var r=this.callStack[i-1];if(!n&&!r.temporaryVariables.get(t))throw new Error("Could not find temporary variable to set: "+t);var a=W(r.temporaryVariables,t,null);a.exists&&U.RetainListOriginsForAssignment(a.result,e),r.temporaryVariables.set(t,e)}},{key:"ContextForVariableNamed",value:function(t){return this.currentElement.temporaryVariables.get(t)?this.currentElementIndex+1:0}},{key:"ThreadWithIndex",value:function(t){var e=this._threads.filter((function(e){if(e.threadIndex==t)return e}));return e.length>0?e[0]:null}},{key:"callStack",get:function(){return this.currentThread.callstack}},{key:"callStackTrace",get:function(){for(var t=new A,e=0;e")}}}return t.toString()}}]),e}();!function(t){var e=function(){function t(e,i){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n(this,t),this.evaluationStackHeightWhenPushed=0,this.functionStartInOutputStream=0,this.currentPointer=i.copy(),this.inExpressionEvaluation=r,this.temporaryVariables=new Map,this.type=e}return r(t,[{key:"Copy",value:function(){var e=new t(this.type,this.currentPointer,this.inExpressionEvaluation);return e.temporaryVariables=new Map(this.temporaryVariables),e.evaluationStackHeightWhenPushed=this.evaluationStackHeightWhenPushed,e.functionStartInOutputStream=this.functionStartInOutputStream,e}}]),t}();t.Element=e;var i=function(){function t(){if(n(this,t),this.threadIndex=0,this.previousPointer=$.Null,this.callstack=[],arguments[0]&&arguments[1]){var i=arguments[0],r=arguments[1];this.threadIndex=parseInt(i.threadIndex);var a,s=g(i.callstack);try{for(s.s();!(a=s.n()).done;){var o=a.value,u=parseInt(o.type),l=$.Null,h=void 0,c=o.cPath;if(void 0!==c){h=c.toString();var f=r.ContentAtPath(new k(h));if(l.container=f.container,l.index=parseInt(o.idx),null==f.obj)throw new Error("When loading state, internal story location couldn't be found: "+h+". Has the story changed since this save data was created?");if(f.approximate){if(null===l.container)return P("pointer.container");r.Warning("When loading state, exact internal story location couldn't be found: '"+h+"', so it was approximated to '"+l.container.path.toString()+"' to recover. Has the story changed since this save data was created?")}}var v=!!o.exp,d=new e(u,l,v),p=o.temp;void 0!==p?d.temporaryVariables=ot.JObjectToDictionaryRuntimeObjs(p):d.temporaryVariables.clear(),this.callstack.push(d)}}catch(t){s.e(t)}finally{s.f()}var y=i.previousContentObject;if(void 0!==y){var m=new k(y.toString());this.previousPointer=r.PointerAtPath(m)}}}return r(t,[{key:"Copy",value:function(){var e=new t;e.threadIndex=this.threadIndex;var n,i=g(this.callstack);try{for(i.s();!(n=i.n()).done;){var r=n.value;e.callstack.push(r.Copy())}}catch(t){i.e(t)}finally{i.f()}return e.previousPointer=this.previousPointer.copy(),e}},{key:"WriteJson",value:function(t){t.WriteObjectStart(),t.WritePropertyStart("callstack"),t.WriteArrayStart();var e,n=g(this.callstack);try{for(n.s();!(e=n.n()).done;){var i=e.value;if(t.WriteObjectStart(),!i.currentPointer.isNull){if(null===i.currentPointer.container)return P("el.currentPointer.container");t.WriteProperty("cPath",i.currentPointer.container.path.componentsString),t.WriteIntProperty("idx",i.currentPointer.index)}t.WriteProperty("exp",i.inExpressionEvaluation),t.WriteIntProperty("type",i.type),i.temporaryVariables.size>0&&(t.WritePropertyStart("temp"),ot.WriteDictionaryRuntimeObjs(t,i.temporaryVariables),t.WritePropertyEnd()),t.WriteObjectEnd()}}catch(t){n.e(t)}finally{n.f()}if(t.WriteArrayEnd(),t.WritePropertyEnd(),t.WriteIntProperty("threadIndex",this.threadIndex),!this.previousPointer.isNull){var r=this.previousPointer.Resolve();if(null===r)return P("this.previousPointer.Resolve()");t.WriteProperty("previousContentObject",r.path.toString())}t.WriteObjectEnd()}}]),t}();t.Thread=i}(ut||(ut={}));var lt=function(t){a(i,t);var e=v(i);function i(t,r){var a;n(this,i),(a=e.call(this)).variableChangedEventCallbacks=[],a.patch=null,a._batchObservingVariableChanges=!1,a._defaultGlobalVariables=new Map,a._changedVariablesForBatchObs=new Set,a._globalVariables=new Map,a._callStack=t,a._listDefsOrigin=r;try{return f(a,new Proxy(c(a),{get:function(t,e){return e in t?t[e]:t.$(e)},set:function(t,e,n){return e in t?t[e]=n:t.$(e,n),!0}}))}catch(t){}return a}return r(i,[{key:"variableChangedEvent",value:function(t,e){var n,i=g(this.variableChangedEventCallbacks);try{for(i.s();!(n=i.n()).done;){(0,n.value)(t,e)}}catch(t){i.e(t)}finally{i.f()}}},{key:"batchObservingVariableChanges",get:function(){return this._batchObservingVariableChanges},set:function(t){if(this._batchObservingVariableChanges=t,t)this._changedVariablesForBatchObs=new Set;else if(null!=this._changedVariablesForBatchObs){var e,n=g(this._changedVariablesForBatchObs);try{for(n.s();!(e=n.n()).done;){var i=e.value,r=this._globalVariables.get(i);r?this.variableChangedEvent(i,r):P("currentValue")}}catch(t){n.e(t)}finally{n.f()}this._changedVariablesForBatchObs=null}}},{key:"callStack",get:function(){return this._callStack},set:function(t){this._callStack=t}},{key:"$",value:function(t,e){if(void 0===e){var n=null;return null!==this.patch&&(n=this.patch.TryGetGlobal(t,null)).exists?n.result.valueObject:(void 0===(n=this._globalVariables.get(t))&&(n=this._defaultGlobalVariables.get(t)),void 0!==n?n.valueObject:null)}if(void 0===this._defaultGlobalVariables.get(t))throw new x("Cannot assign to a variable ("+t+") that hasn't been declared in the story");var i=j.Create(e);if(null==i)throw null==e?new Error("Cannot pass null to VariableState"):new Error("Invalid value passed to VariableState: "+e.toString());this.SetGlobal(t,i)}},{key:"ApplyPatch",value:function(){if(null===this.patch)return P("this.patch");var t,e=g(this.patch.globals);try{for(e.s();!(t=e.n()).done;){var n=d(t.value,2),i=n[0],r=n[1];this._globalVariables.set(i,r)}}catch(t){e.e(t)}finally{e.f()}if(null!==this._changedVariablesForBatchObs){var a,s=g(this.patch.changedVariables);try{for(s.s();!(a=s.n()).done;){var o=a.value;this._changedVariablesForBatchObs.add(o)}}catch(t){s.e(t)}finally{s.f()}}this.patch=null}},{key:"SetJsonToken",value:function(t){this._globalVariables.clear();var e,n=g(this._defaultGlobalVariables);try{for(n.s();!(e=n.n()).done;){var i=d(e.value,2),r=i[0],a=i[1],s=t[r];if(void 0!==s){var o=ot.JTokenToRuntimeObject(s);if(null===o)return P("tokenInkObject");this._globalVariables.set(r,o)}else this._globalVariables.set(r,a)}}catch(t){n.e(t)}finally{n.f()}}},{key:"WriteJson",value:function(t){t.WriteObjectStart();var e,n=g(this._globalVariables);try{for(n.s();!(e=n.n()).done;){var r=d(e.value,2),a=r[0],s=r[1],o=a,u=s;if(i.dontSaveDefaultValues&&this._defaultGlobalVariables.has(o)){var l=this._defaultGlobalVariables.get(o);if(this.RuntimeObjectsEqual(u,l))continue}t.WritePropertyStart(o),ot.WriteRuntimeObject(t,u),t.WritePropertyEnd()}}catch(t){n.e(t)}finally{n.f()}t.WriteObjectEnd()}},{key:"RuntimeObjectsEqual",value:function(t,e){if(null===t)return P("obj1");if(null===e)return P("obj2");if(t.constructor!==e.constructor)return!1;var n=C(t,R);if(null!==n)return n.value===b(e,R).value;var i=C(t,D);if(null!==i)return i.value===b(e,D).value;var r=C(t,B);if(null!==r)return r.value===b(e,B).value;var a=C(t,j),s=C(e,j);if(null!==a&&null!==s)return T(a.valueObject)&&T(s.valueObject)?a.valueObject.Equals(s.valueObject):a.valueObject===s.valueObject;throw new Error("FastRoughDefinitelyEquals: Unsupported runtime object type: "+t.constructor.name)}},{key:"GetVariableWithName",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=this.GetRawVariableWithName(t,e),i=C(n,J);return null!==i&&(n=this.ValueAtVariablePointer(i)),n}},{key:"TryGetDefaultVariableValue",value:function(t){var e=W(this._defaultGlobalVariables,t,null);return e.exists?e.result:null}},{key:"GlobalVariableExistsWithName",value:function(t){return this._globalVariables.has(t)||null!==this._defaultGlobalVariables&&this._defaultGlobalVariables.has(t)}},{key:"GetRawVariableWithName",value:function(t,e){if(0==e||-1==e){var n=null;if(null!==this.patch&&(n=this.patch.TryGetGlobal(t,null)).exists)return n.result;if((n=W(this._globalVariables,t,null)).exists)return n.result;if(null!==this._defaultGlobalVariables&&(n=W(this._defaultGlobalVariables,t,null)).exists)return n.result;if(null===this._listDefsOrigin)return P("VariablesState._listDefsOrigin");var i=this._listDefsOrigin.FindSingleItemListWithName(t);if(i)return i}return this._callStack.GetTemporaryVariableWithName(t,e)}},{key:"ValueAtVariablePointer",value:function(t){return this.GetVariableWithName(t.variableName,t.contextIndex)}},{key:"Assign",value:function(t,e){var n=t.variableName;if(null===n)return P("name");var i=-1,r=!1;if(r=t.isNewDeclaration?t.isGlobal:this.GlobalVariableExistsWithName(n),t.isNewDeclaration){var a=C(e,J);if(null!==a)e=this.ResolveVariablePointer(a)}else{var s=null;do{null!=(s=C(this.GetRawVariableWithName(n,i),J))&&(n=s.variableName,r=0==(i=s.contextIndex))}while(null!=s)}r?this.SetGlobal(n,e):this._callStack.SetTemporaryVariable(n,e,t.isNewDeclaration,i)}},{key:"SnapshotDefaultGlobals",value:function(){this._defaultGlobalVariables=new Map(this._globalVariables)}},{key:"RetainListOriginsForAssignment",value:function(t,e){var n=b(t,U),i=b(e,U);n.value&&i.value&&0==i.value.Count&&i.value.SetInitialOriginNames(n.value.originNames)}},{key:"SetGlobal",value:function(t,e){var n=null;if(null===this.patch&&(n=W(this._globalVariables,t,null)),null!==this.patch&&((n=this.patch.TryGetGlobal(t,null)).exists||(n=W(this._globalVariables,t,null))),U.RetainListOriginsForAssignment(n.result,e),null===t)return P("variableName");if(null!==this.patch?this.patch.SetGlobal(t,e):this._globalVariables.set(t,e),null!==this.variableChangedEvent&&null!==n&&e!==n.result)if(this.batchObservingVariableChanges){if(null===this._changedVariablesForBatchObs)return P("this._changedVariablesForBatchObs");null!==this.patch?this.patch.AddChangedVariable(t):null!==this._changedVariablesForBatchObs&&this._changedVariablesForBatchObs.add(t)}else this.variableChangedEvent(t,e)}},{key:"ResolveVariablePointer",value:function(t){var e=t.contextIndex;-1==e&&(e=this.GetContextIndexOfVariableNamed(t.variableName));var n=C(this.GetRawVariableWithName(t.variableName,e),J);return null!=n?n:new J(t.variableName,e)}},{key:"GetContextIndexOfVariableNamed",value:function(t){return this.GlobalVariableExistsWithName(t)?0:this._callStack.currentElementIndex}},{key:"ObserveVariableChange",value:function(t){this.variableChangedEventCallbacks.push(t)}}]),i}(function(){return r((function t(){n(this,t)}))}());lt.dontSaveDefaultValues=!0;var ht=function(){function t(e){n(this,t),this.seed=e%2147483647,this.seed<=0&&(this.seed+=2147483646)}return r(t,[{key:"next",value:function(){return this.seed=48271*this.seed%2147483647}},{key:"nextFloat",value:function(){return(this.next()-1)/2147483646}}]),t}(),ct=function(){function t(){if(n(this,t),this._changedVariables=new Set,this._visitCounts=new Map,this._turnIndices=new Map,1===arguments.length&&null!==arguments[0]){var e=arguments[0];this._globals=new Map(e._globals),this._changedVariables=new Set(e._changedVariables),this._visitCounts=new Map(e._visitCounts),this._turnIndices=new Map(e._turnIndices)}else this._globals=new Map,this._changedVariables=new Set,this._visitCounts=new Map,this._turnIndices=new Map}return r(t,[{key:"globals",get:function(){return this._globals}},{key:"changedVariables",get:function(){return this._changedVariables}},{key:"visitCounts",get:function(){return this._visitCounts}},{key:"turnIndices",get:function(){return this._turnIndices}},{key:"TryGetGlobal",value:function(t,e){return null!==t&&this._globals.has(t)?{result:this._globals.get(t),exists:!0}:{result:e,exists:!1}}},{key:"SetGlobal",value:function(t,e){this._globals.set(t,e)}},{key:"AddChangedVariable",value:function(t){return this._changedVariables.add(t)}},{key:"TryGetVisitCount",value:function(t,e){return this._visitCounts.has(t)?{result:this._visitCounts.get(t),exists:!0}:{result:e,exists:!1}}},{key:"SetVisitCount",value:function(t,e){this._visitCounts.set(t,e)}},{key:"SetTurnIndex",value:function(t,e){this._turnIndices.set(t,e)}},{key:"TryGetTurnIndex",value:function(t,e){return this._turnIndices.has(t)?{result:this._turnIndices.get(t),exists:!0}:{result:e,exists:!1}}}]),t}(),ft=function(){function t(){n(this,t)}return r(t,null,[{key:"TextToDictionary",value:function(e){return new t.Reader(e).ToDictionary()}},{key:"TextToArray",value:function(e){return new t.Reader(e).ToArray()}}]),t}();!function(t){var e=function(){function t(e){n(this,t),this._rootObject=JSON.parse(e)}return r(t,[{key:"ToDictionary",value:function(){return this._rootObject}},{key:"ToArray",value:function(){return this._rootObject}}]),t}();t.Reader=e;var i=function(){function e(){n(this,e),this._currentPropertyName=null,this._currentString=null,this._stateStack=[],this._collectionStack=[],this._propertyNameStack=[],this._jsonObject=null}return r(e,[{key:"WriteObject",value:function(t){this.WriteObjectStart(),t(this),this.WriteObjectEnd()}},{key:"WriteObjectStart",value:function(){this.StartNewObject(!0);var e={};if(this.state===t.Writer.State.Property){this.Assert(null!==this.currentCollection),this.Assert(null!==this.currentPropertyName);var n=this._propertyNameStack.pop();this.currentCollection[n]=e,this._collectionStack.push(e)}else this.state===t.Writer.State.Array?(this.Assert(null!==this.currentCollection),this.currentCollection.push(e),this._collectionStack.push(e)):(this.Assert(this.state===t.Writer.State.None),this._jsonObject=e,this._collectionStack.push(e));this._stateStack.push(new t.Writer.StateElement(t.Writer.State.Object))}},{key:"WriteObjectEnd",value:function(){this.Assert(this.state===t.Writer.State.Object),this._collectionStack.pop(),this._stateStack.pop()}},{key:"WriteProperty",value:function(t,e){if(this.WritePropertyStart(t),arguments[1]instanceof Function){(0,arguments[1])(this)}else{var n=arguments[1];this.Write(n)}this.WritePropertyEnd()}},{key:"WriteIntProperty",value:function(t,e){this.WritePropertyStart(t),this.WriteInt(e),this.WritePropertyEnd()}},{key:"WriteFloatProperty",value:function(t,e){this.WritePropertyStart(t),this.WriteFloat(e),this.WritePropertyEnd()}},{key:"WritePropertyStart",value:function(e){this.Assert(this.state===t.Writer.State.Object),this._propertyNameStack.push(e),this.IncrementChildCount(),this._stateStack.push(new t.Writer.StateElement(t.Writer.State.Property))}},{key:"WritePropertyEnd",value:function(){this.Assert(this.state===t.Writer.State.Property),this.Assert(1===this.childCount),this._stateStack.pop()}},{key:"WritePropertyNameStart",value:function(){this.Assert(this.state===t.Writer.State.Object),this.IncrementChildCount(),this._currentPropertyName="",this._stateStack.push(new t.Writer.StateElement(t.Writer.State.Property)),this._stateStack.push(new t.Writer.StateElement(t.Writer.State.PropertyName))}},{key:"WritePropertyNameEnd",value:function(){this.Assert(this.state===t.Writer.State.PropertyName),this.Assert(null!==this._currentPropertyName),this._propertyNameStack.push(this._currentPropertyName),this._currentPropertyName=null,this._stateStack.pop()}},{key:"WritePropertyNameInner",value:function(e){this.Assert(this.state===t.Writer.State.PropertyName),this.Assert(null!==this._currentPropertyName),this._currentPropertyName+=e}},{key:"WriteArrayStart",value:function(){this.StartNewObject(!0);var e=[];if(this.state===t.Writer.State.Property){this.Assert(null!==this.currentCollection),this.Assert(null!==this.currentPropertyName);var n=this._propertyNameStack.pop();this.currentCollection[n]=e,this._collectionStack.push(e)}else this.state===t.Writer.State.Array?(this.Assert(null!==this.currentCollection),this.currentCollection.push(e),this._collectionStack.push(e)):(this.Assert(this.state===t.Writer.State.None),this._jsonObject=e,this._collectionStack.push(e));this._stateStack.push(new t.Writer.StateElement(t.Writer.State.Array))}},{key:"WriteArrayEnd",value:function(){this.Assert(this.state===t.Writer.State.Array),this._collectionStack.pop(),this._stateStack.pop()}},{key:"Write",value:function(t){null!==t?(this.StartNewObject(!1),this._addToCurrentObject(t)):console.error("Warning: trying to write a null value")}},{key:"WriteBool",value:function(t){null!==t&&(this.StartNewObject(!1),this._addToCurrentObject(t))}},{key:"WriteInt",value:function(t){null!==t&&(this.StartNewObject(!1),this._addToCurrentObject(Math.floor(t)))}},{key:"WriteFloat",value:function(t){null!==t&&(this.StartNewObject(!1),t==Number.POSITIVE_INFINITY?this._addToCurrentObject(34e37):t==Number.NEGATIVE_INFINITY?this._addToCurrentObject(-34e37):isNaN(t)?this._addToCurrentObject(0):this._addToCurrentObject(t))}},{key:"WriteNull",value:function(){this.StartNewObject(!1),this._addToCurrentObject(null)}},{key:"WriteStringStart",value:function(){this.StartNewObject(!1),this._currentString="",this._stateStack.push(new t.Writer.StateElement(t.Writer.State.String))}},{key:"WriteStringEnd",value:function(){this.Assert(this.state==t.Writer.State.String),this._stateStack.pop(),this._addToCurrentObject(this._currentString),this._currentString=null}},{key:"WriteStringInner",value:function(e){this.Assert(this.state===t.Writer.State.String),null!==e?this._currentString+=e:console.error("Warning: trying to write a null string")}},{key:"toString",value:function(){return null===this._jsonObject?"":JSON.stringify(this._jsonObject)}},{key:"StartNewObject",value:function(e){e?this.Assert(this.state===t.Writer.State.None||this.state===t.Writer.State.Property||this.state===t.Writer.State.Array):this.Assert(this.state===t.Writer.State.Property||this.state===t.Writer.State.Array),this.state===t.Writer.State.Property&&this.Assert(0===this.childCount),this.state!==t.Writer.State.Array&&this.state!==t.Writer.State.Property||this.IncrementChildCount()}},{key:"state",get:function(){return this._stateStack.length>0?this._stateStack[this._stateStack.length-1].type:t.Writer.State.None}},{key:"childCount",get:function(){return this._stateStack.length>0?this._stateStack[this._stateStack.length-1].childCount:0}},{key:"currentCollection",get:function(){return this._collectionStack.length>0?this._collectionStack[this._collectionStack.length-1]:null}},{key:"currentPropertyName",get:function(){return this._propertyNameStack.length>0?this._propertyNameStack[this._propertyNameStack.length-1]:null}},{key:"IncrementChildCount",value:function(){this.Assert(this._stateStack.length>0);var t=this._stateStack.pop();t.childCount++,this._stateStack.push(t)}},{key:"Assert",value:function(t){if(!t)throw Error("Assert failed while writing JSON")}},{key:"_addToCurrentObject",value:function(e){this.Assert(null!==this.currentCollection),this.state===t.Writer.State.Array?(this.Assert(Array.isArray(this.currentCollection)),this.currentCollection.push(e)):this.state===t.Writer.State.Property&&(this.Assert(!Array.isArray(this.currentCollection)),this.Assert(null!==this.currentPropertyName),this.currentCollection[this.currentPropertyName]=e,this._propertyNameStack.pop())}}]),e}();t.Writer=i,function(e){var i;(i=e.State||(e.State={}))[i.None=0]="None",i[i.Object=1]="Object",i[i.Array=2]="Array",i[i.Property=3]="Property",i[i.PropertyName=4]="PropertyName",i[i.String=5]="String";var a=r((function e(i){n(this,e),this.type=t.Writer.State.None,this.childCount=0,this.type=i}));e.StateElement=a}(i=t.Writer||(t.Writer={}))}(ft||(ft={}));var vt,dt,pt,yt=function(){function t(){n(this,t);var e=arguments[0],i=arguments[1];if(this.name=e,this.callStack=new ut(i),arguments[2]){var r=arguments[2];this.callStack.SetJsonToken(r.callstack,i),this.outputStream=ot.JArrayToRuntimeObjList(r.outputStream),this.currentChoices=ot.JArrayToRuntimeObjList(r.currentChoices);var a=r.choiceThreads;void 0!==a&&this.LoadFlowChoiceThreads(a,i)}else this.outputStream=[],this.currentChoices=[]}return r(t,[{key:"WriteJson",value:function(t){var e=this;t.WriteObjectStart(),t.WriteProperty("callstack",(function(t){return e.callStack.WriteJson(t)})),t.WriteProperty("outputStream",(function(t){return ot.WriteListRuntimeObjs(t,e.outputStream)}));var n,i=!1,r=g(this.currentChoices);try{for(r.s();!(n=r.n()).done;){var a=n.value;if(null===a.threadAtGeneration)return P("c.threadAtGeneration");a.originalThreadIndex=a.threadAtGeneration.threadIndex,null===this.callStack.ThreadWithIndex(a.originalThreadIndex)&&(i||(i=!0,t.WritePropertyStart("choiceThreads"),t.WriteObjectStart()),t.WritePropertyStart(a.originalThreadIndex),a.threadAtGeneration.WriteJson(t),t.WritePropertyEnd())}}catch(t){r.e(t)}finally{r.f()}i&&(t.WriteObjectEnd(),t.WritePropertyEnd()),t.WriteProperty("currentChoices",(function(t){t.WriteArrayStart();var n,i=g(e.currentChoices);try{for(i.s();!(n=i.n()).done;){var r=n.value;ot.WriteChoice(t,r)}}catch(t){i.e(t)}finally{i.f()}t.WriteArrayEnd()})),t.WriteObjectEnd()}},{key:"LoadFlowChoiceThreads",value:function(t,e){var n,i=g(this.currentChoices);try{for(i.s();!(n=i.n()).done;){var r=n.value,a=this.callStack.ThreadWithIndex(r.originalThreadIndex);if(null!==a)r.threadAtGeneration=a.Copy();else{var s=t["".concat(r.originalThreadIndex)];r.threadAtGeneration=new ut.Thread(s,e)}}}catch(t){i.e(t)}finally{i.f()}}}]),t}(),mt=function(){function e(t){n(this,e),this.kInkSaveStateVersion=10,this.kMinCompatibleLoadVersion=8,this.onDidLoadState=null,this._currentErrors=null,this._currentWarnings=null,this.divertedPointer=$.Null,this._currentTurnIndex=0,this.storySeed=0,this.previousRandom=0,this.didSafeExit=!1,this._currentText=null,this._currentTags=null,this._outputStreamTextDirty=!0,this._outputStreamTagsDirty=!0,this._patch=null,this._aliveFlowNames=null,this._namedFlows=null,this.kDefaultFlowName="DEFAULT_FLOW",this._aliveFlowNamesDirty=!0,this.story=t,this._currentFlow=new yt(this.kDefaultFlowName,t),this.OutputStreamDirty(),this._aliveFlowNamesDirty=!0,this._evaluationStack=[],this._variablesState=new lt(this.callStack,t.listDefinitions),this._visitCounts=new Map,this._turnIndices=new Map,this.currentTurnIndex=-1;var i=(new Date).getTime();this.storySeed=new ht(i).next()%100,this.previousRandom=0,this.GoToStart()}return r(e,[{key:"ToJson",value:function(){var t=new ft.Writer;return this.WriteJson(t),t.toString()}},{key:"toJson",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.ToJson(t)}},{key:"LoadJson",value:function(t){var e=ft.TextToDictionary(t);this.LoadJsonObj(e),null!==this.onDidLoadState&&this.onDidLoadState()}},{key:"VisitCountAtPathString",value:function(t){var e;if(null!==this._patch){var n=this.story.ContentAtPath(new k(t)).container;if(null===n)throw new Error("Content at path not found: "+t);if((e=this._patch.TryGetVisitCount(n,0)).exists)return e.result}return(e=W(this._visitCounts,t,null)).exists?e.result:0}},{key:"VisitCountForContainer",value:function(t){if(null===t)return P("container");if(!t.visitsShouldBeCounted)return this.story.Error("Read count for target ("+t.name+" - on "+t.debugMetadata+") unknown. The story may need to be compiled with countAllVisits flag (-c)."),0;if(null!==this._patch){var e=this._patch.TryGetVisitCount(t,0);if(e.exists)return e.result}var n=t.path.toString(),i=W(this._visitCounts,n,null);return i.exists?i.result:0}},{key:"IncrementVisitCountForContainer",value:function(t){if(null!==this._patch){var e=this.VisitCountForContainer(t);return e++,void this._patch.SetVisitCount(t,e)}var n=t.path.toString(),i=W(this._visitCounts,n,null);i.exists?this._visitCounts.set(n,i.result+1):this._visitCounts.set(n,1)}},{key:"RecordTurnIndexVisitToContainer",value:function(t){if(null===this._patch){var e=t.path.toString();this._turnIndices.set(e,this.currentTurnIndex)}else this._patch.SetTurnIndex(t,this.currentTurnIndex)}},{key:"TurnsSinceForContainer",value:function(t){if(t.turnIndexShouldBeCounted||this.story.Error("TURNS_SINCE() for target ("+t.name+" - on "+t.debugMetadata+") unknown. The story may need to be compiled with countAllVisits flag (-c)."),null!==this._patch){var e=this._patch.TryGetTurnIndex(t,0);if(e.exists)return this.currentTurnIndex-e.result}var n=t.path.toString(),i=W(this._turnIndices,n,0);return i.exists?this.currentTurnIndex-i.result:-1}},{key:"callstackDepth",get:function(){return this.callStack.depth}},{key:"outputStream",get:function(){return this._currentFlow.outputStream}},{key:"currentChoices",get:function(){return this.canContinue?[]:this._currentFlow.currentChoices}},{key:"generatedChoices",get:function(){return this._currentFlow.currentChoices}},{key:"currentErrors",get:function(){return this._currentErrors}},{key:"currentWarnings",get:function(){return this._currentWarnings}},{key:"variablesState",get:function(){return this._variablesState},set:function(t){this._variablesState=t}},{key:"callStack",get:function(){return this._currentFlow.callStack}},{key:"evaluationStack",get:function(){return this._evaluationStack}},{key:"currentTurnIndex",get:function(){return this._currentTurnIndex},set:function(t){this._currentTurnIndex=t}},{key:"currentPathString",get:function(){var t=this.currentPointer;return t.isNull?null:null===t.path?P("pointer.path"):t.path.toString()}},{key:"currentPointer",get:function(){return this.callStack.currentElement.currentPointer.copy()},set:function(t){this.callStack.currentElement.currentPointer=t.copy()}},{key:"previousPointer",get:function(){return this.callStack.currentThread.previousPointer.copy()},set:function(t){this.callStack.currentThread.previousPointer=t.copy()}},{key:"canContinue",get:function(){return!this.currentPointer.isNull&&!this.hasError}},{key:"hasError",get:function(){return null!=this.currentErrors&&this.currentErrors.length>0}},{key:"hasWarning",get:function(){return null!=this.currentWarnings&&this.currentWarnings.length>0}},{key:"currentText",get:function(){if(this._outputStreamTextDirty){var t,e=new A,n=!1,i=g(this.outputStream);try{for(i.s();!(t=i.n()).done;){var r=t.value,a=C(r,G);if(n||null===a){var s=C(r,X);null!==s&&(s.commandType==X.CommandType.BeginTag?n=!0:s.commandType==X.CommandType.EndTag&&(n=!1))}else e.Append(a.value)}}catch(t){i.e(t)}finally{i.f()}this._currentText=this.CleanOutputWhitespace(e.toString()),this._outputStreamTextDirty=!1}return this._currentText}},{key:"CleanOutputWhitespace",value:function(t){for(var e=new A,n=-1,i=0,r=0;r0&&n!=i&&e.Append(" "),n=-1),"\n"==a&&(i=r+1),s||e.Append(a)}return e.toString()}},{key:"currentTags",get:function(){if(this._outputStreamTagsDirty){this._currentTags=[];var t,e=!1,n=new A,i=g(this.outputStream);try{for(i.s();!(t=i.n()).done;){var r=t.value,a=C(r,X);if(null!=a){if(a.commandType==X.CommandType.BeginTag){if(e&&n.Length>0){var s=this.CleanOutputWhitespace(n.toString());this._currentTags.push(s),n.Clear()}e=!0}else if(a.commandType==X.CommandType.EndTag){if(n.Length>0){var o=this.CleanOutputWhitespace(n.toString());this._currentTags.push(o),n.Clear()}e=!1}}else if(e){var u=C(r,G);null!==u&&n.Append(u.value)}else{var l=C(r,it);null!=l&&null!=l.text&&l.text.length>0&&this._currentTags.push(l.text)}}}catch(t){i.e(t)}finally{i.f()}if(n.Length>0){var h=this.CleanOutputWhitespace(n.toString());this._currentTags.push(h),n.Clear()}this._outputStreamTagsDirty=!1}return this._currentTags}},{key:"currentFlowName",get:function(){return this._currentFlow.name}},{key:"currentFlowIsDefaultFlow",get:function(){return this._currentFlow.name==this.kDefaultFlowName}},{key:"aliveFlowNames",get:function(){if(this._aliveFlowNamesDirty){if(this._aliveFlowNames=[],null!=this._namedFlows){var t,e=g(this._namedFlows.keys());try{for(e.s();!(t=e.n()).done;){var n=t.value;n!=this.kDefaultFlowName&&this._aliveFlowNames.push(n)}}catch(t){e.e(t)}finally{e.f()}}this._aliveFlowNamesDirty=!1}return this._aliveFlowNames}},{key:"inExpressionEvaluation",get:function(){return this.callStack.currentElement.inExpressionEvaluation},set:function(t){this.callStack.currentElement.inExpressionEvaluation=t}},{key:"GoToStart",value:function(){this.callStack.currentElement.currentPointer=$.StartOf(this.story.mainContentContainer)}},{key:"SwitchFlow_Internal",value:function(t){if(null===t)throw new Error("Must pass a non-null string to Story.SwitchFlow");if(null===this._namedFlows&&(this._namedFlows=new Map,this._namedFlows.set(this.kDefaultFlowName,this._currentFlow)),t!==this._currentFlow.name){var e,n=W(this._namedFlows,t,null);n.exists?e=n.result:(e=new yt(t,this.story),this._namedFlows.set(t,e),this._aliveFlowNamesDirty=!0),this._currentFlow=e,this.variablesState.callStack=this._currentFlow.callStack,this.OutputStreamDirty()}}},{key:"SwitchToDefaultFlow_Internal",value:function(){null!==this._namedFlows&&this.SwitchFlow_Internal(this.kDefaultFlowName)}},{key:"RemoveFlow_Internal",value:function(t){if(null===t)throw new Error("Must pass a non-null string to Story.DestroyFlow");if(t===this.kDefaultFlowName)throw new Error("Cannot destroy default flow");if(this._currentFlow.name===t&&this.SwitchToDefaultFlow_Internal(),null===this._namedFlows)return P("this._namedFlows");this._namedFlows.delete(t),this._aliveFlowNamesDirty=!0}},{key:"CopyAndStartPatching",value:function(){var t,n,i,r,a,s=new e(this.story);if(s._patch=new ct(this._patch),s._currentFlow.name=this._currentFlow.name,s._currentFlow.callStack=new ut(this._currentFlow.callStack),(t=s._currentFlow.currentChoices).push.apply(t,p(this._currentFlow.currentChoices)),(n=s._currentFlow.outputStream).push.apply(n,p(this._currentFlow.outputStream)),s.OutputStreamDirty(),null!==this._namedFlows){s._namedFlows=new Map;var o,u=g(this._namedFlows);try{for(u.s();!(o=u.n()).done;){var l=d(o.value,2),h=l[0],c=l[1];s._namedFlows.set(h,c),s._aliveFlowNamesDirty=!0}}catch(t){u.e(t)}finally{u.f()}s._namedFlows.set(this._currentFlow.name,s._currentFlow)}this.hasError&&(s._currentErrors=[],(r=s._currentErrors).push.apply(r,p(this.currentErrors||[])));this.hasWarning&&(s._currentWarnings=[],(a=s._currentWarnings).push.apply(a,p(this.currentWarnings||[])));return s.variablesState=this.variablesState,s.variablesState.callStack=s.callStack,s.variablesState.patch=s._patch,(i=s.evaluationStack).push.apply(i,p(this.evaluationStack)),this.divertedPointer.isNull||(s.divertedPointer=this.divertedPointer.copy()),s.previousPointer=this.previousPointer.copy(),s._visitCounts=this._visitCounts,s._turnIndices=this._turnIndices,s.currentTurnIndex=this.currentTurnIndex,s.storySeed=this.storySeed,s.previousRandom=this.previousRandom,s.didSafeExit=this.didSafeExit,s}},{key:"RestoreAfterPatch",value:function(){this.variablesState.callStack=this.callStack,this.variablesState.patch=this._patch}},{key:"ApplyAnyPatch",value:function(){if(null!==this._patch){this.variablesState.ApplyPatch();var t,e=g(this._patch.visitCounts);try{for(e.s();!(t=e.n()).done;){var n=d(t.value,2),i=n[0],r=n[1];this.ApplyCountChanges(i,r,!0)}}catch(t){e.e(t)}finally{e.f()}var a,s=g(this._patch.turnIndices);try{for(s.s();!(a=s.n()).done;){var o=d(a.value,2),u=o[0],l=o[1];this.ApplyCountChanges(u,l,!1)}}catch(t){s.e(t)}finally{s.f()}this._patch=null}}},{key:"ApplyCountChanges",value:function(t,e,n){(n?this._visitCounts:this._turnIndices).set(t.path.toString(),e)}},{key:"WriteJson",value:function(e){var n=this;if(e.WriteObjectStart(),e.WritePropertyStart("flows"),e.WriteObjectStart(),null!==this._namedFlows){var i,r=g(this._namedFlows);try{var a=function(){var t=d(i.value,2),n=t[0],r=t[1];e.WriteProperty(n,(function(t){return r.WriteJson(t)}))};for(r.s();!(i=r.n()).done;)a()}catch(t){r.e(t)}finally{r.f()}}else e.WriteProperty(this._currentFlow.name,(function(t){return n._currentFlow.WriteJson(t)}));if(e.WriteObjectEnd(),e.WritePropertyEnd(),e.WriteProperty("currentFlowName",this._currentFlow.name),e.WriteProperty("variablesState",(function(t){return n.variablesState.WriteJson(t)})),e.WriteProperty("evalStack",(function(t){return ot.WriteListRuntimeObjs(t,n.evaluationStack)})),!this.divertedPointer.isNull){if(null===this.divertedPointer.path)return P("divertedPointer");e.WriteProperty("currentDivertTarget",this.divertedPointer.path.componentsString)}e.WriteProperty("visitCounts",(function(t){return ot.WriteIntDictionary(t,n._visitCounts)})),e.WriteProperty("turnIndices",(function(t){return ot.WriteIntDictionary(t,n._turnIndices)})),e.WriteIntProperty("turnIdx",this.currentTurnIndex),e.WriteIntProperty("storySeed",this.storySeed),e.WriteIntProperty("previousRandom",this.previousRandom),e.WriteIntProperty("inkSaveVersion",this.kInkSaveStateVersion),e.WriteIntProperty("inkFormatVersion",t.Story.inkVersionCurrent),e.WriteObjectEnd()}},{key:"LoadJsonObj",value:function(t){var e=t,n=e.inkSaveVersion;if(null==n)throw new Error("ink save format incorrect, can't load.");if(parseInt(n)1){var c=e.currentFlowName;this._currentFlow=this._namedFlows.get(c)}}else{this._namedFlows=null,this._currentFlow.name=this.kDefaultFlowName,this._currentFlow.callStack.SetJsonToken(e.callstackThreads,this.story),this._currentFlow.outputStream=ot.JArrayToRuntimeObjList(e.outputStream),this._currentFlow.currentChoices=ot.JArrayToRuntimeObjList(e.currentChoices);var f=e.choiceThreads;this._currentFlow.LoadFlowChoiceThreads(f,this.story)}this.OutputStreamDirty(),this._aliveFlowNamesDirty=!0,this.variablesState.SetJsonToken(e.variablesState),this.variablesState.callStack=this._currentFlow.callStack,this._evaluationStack=ot.JArrayToRuntimeObjList(e.evalStack);var v=e.currentDivertTarget;if(null!=v){var p=new k(v.toString());this.divertedPointer=this.story.PointerAtPath(p)}this._visitCounts=ot.JObjectToIntDictionary(e.visitCounts),this._turnIndices=ot.JObjectToIntDictionary(e.turnIndices),this.currentTurnIndex=parseInt(e.turnIdx),this.storySeed=parseInt(e.storySeed),this.previousRandom=parseInt(e.previousRandom)}},{key:"ResetErrors",value:function(){this._currentErrors=null,this._currentWarnings=null}},{key:"ResetOutput",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.outputStream.length=0,null!==e&&(t=this.outputStream).push.apply(t,p(e)),this.OutputStreamDirty()}},{key:"PushToOutputStream",value:function(t){var e=C(t,G);if(null!==e){var n=this.TrySplittingHeadTailWhitespace(e);if(null!==n){var i,r=g(n);try{for(r.s();!(i=r.n()).done;){var a=i.value;this.PushToOutputStreamIndividual(a)}}catch(t){r.e(t)}finally{r.f()}return void this.OutputStreamDirty()}}this.PushToOutputStreamIndividual(t),this.OutputStreamDirty()}},{key:"PopFromOutputStream",value:function(t){this.outputStream.splice(this.outputStream.length-t,t),this.OutputStreamDirty()}},{key:"TrySplittingHeadTailWhitespace",value:function(t){var e=t.value;if(null===e)return P("single.value");for(var n=-1,i=-1,r=0;r=0;u--){var l=e[u];if("\n"!=l){if(" "==l||"\t"==l)continue;break}-1==s&&(s=u),o=u}if(-1==n&&-1==s)return null;var h=[],c=0,f=e.length;if(-1!=n){if(n>0){var v=new G(e.substring(0,n));h.push(v)}h.push(new G("\n")),c=i+1}if(-1!=s&&(f=o),f>c){var d=e.substring(c,f);h.push(new G(d))}if(-1!=s&&o>i&&(h.push(new G("\n")),s=0;o--){var u=this.outputStream[o],l=u instanceof X?u:null;if(null!=(u instanceof H?u:null)){s=o;break}if(null!=l&&l.commandType==X.CommandType.BeginString){o>=r&&(r=-1);break}}if(-1!=(-1!=s&&-1!=r?Math.min(r,s):-1!=s?s:r)){if(n.isNewline)i=!1;else if(n.isNonWhitespace&&(s>-1&&this.RemoveExistingGlue(),r>-1))for(var h=this.callStack.elements,c=h.length-1;c>=0;c--){var f=h[c];if(f.type!=z.Function)break;f.functionStartInOutputStream=-1}}else n.isNewline&&(!this.outputStreamEndsInNewline&&this.outputStreamContainsContent||(i=!1))}if(i){if(null===t)return P("obj");this.outputStream.push(t),this.OutputStreamDirty()}}},{key:"TrimNewlinesFromOutputStream",value:function(){for(var t=-1,e=this.outputStream.length-1;e>=0;){var n=this.outputStream[e],i=C(n,X),r=C(n,G);if(null!=i||null!=r&&r.isNonWhitespace)break;null!=r&&r.isNewline&&(t=e),e--}if(t>=0)for(e=t;e=0;t--){var e=this.outputStream[t];if(e instanceof H)this.outputStream.splice(t,1);else if(e instanceof X)break}this.OutputStreamDirty()}},{key:"outputStreamEndsInNewline",get:function(){if(this.outputStream.length>0)for(var t=this.outputStream.length-1;t>=0;t--){if(this.outputStream[t]instanceof X)break;var e=this.outputStream[t];if(e instanceof G){if(e.isNewline)return!0;if(e.isNonWhitespace)break}}return!1}},{key:"outputStreamContainsContent",get:function(){var t,e=g(this.outputStream);try{for(e.s();!(t=e.n()).done;){if(t.value instanceof G)return!0}}catch(t){e.e(t)}finally{e.f()}return!1}},{key:"inStringEvaluation",get:function(){for(var t=this.outputStream.length-1;t>=0;t--){var e=C(this.outputStream[t],X);if(e instanceof X&&e.commandType==X.CommandType.BeginString)return!0}return!1}},{key:"PushEvaluationStack",value:function(t){var e=C(t,U);if(e){var n=e.value;if(null===n)return P("rawList");if(null!=n.originNames){n.origins||(n.origins=[]),n.origins.length=0;var i,r=g(n.originNames);try{for(r.s();!(i=r.n()).done;){var a=i.value;if(null===this.story.listDefinitions)return P("StoryState.story.listDefinitions");var s=this.story.listDefinitions.TryListGetDefinition(a,null);if(null===s.result)return P("StoryState def.result");n.origins.indexOf(s.result)<0&&n.origins.push(s.result)}}catch(t){r.e(t)}finally{r.f()}}}if(null===t)return P("obj");this.evaluationStack.push(t)}},{key:"PopEvaluationStack",value:function(t){if(void 0===t)return _(this.evaluationStack.pop());if(t>this.evaluationStack.length)throw new Error("trying to pop too many objects");return _(this.evaluationStack.splice(this.evaluationStack.length-t,t))}},{key:"PeekEvaluationStack",value:function(){return this.evaluationStack[this.evaluationStack.length-1]}},{key:"ForceEnd",value:function(){this.callStack.Reset(),this._currentFlow.currentChoices.length=0,this.currentPointer=$.Null,this.previousPointer=$.Null,this.didSafeExit=!0}},{key:"TrimWhitespaceFromFunctionEnd",value:function(){S.Assert(this.callStack.currentElement.type==z.Function);var t=this.callStack.currentElement.functionStartInOutputStream;-1==t&&(t=0);for(var e=this.outputStream.length-1;e>=t;e--){var n=this.outputStream[e],i=C(n,G),r=C(n,X);if(null!=i){if(r)break;if(!i.isNewline&&!i.isInlineWhitespace)break;this.outputStream.splice(e,1),this.OutputStreamDirty()}}}},{key:"PopCallStack",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.callStack.currentElement.type==z.Function&&this.TrimWhitespaceFromFunctionEnd(),this.callStack.Pop(t)}},{key:"SetChosenPath",value:function(t,e){this._currentFlow.currentChoices.length=0;var n=this.story.PointerAtPath(t);n.isNull||-1!=n.index||(n.index=0),this.currentPointer=n,e&&this.currentTurnIndex++}},{key:"StartFunctionEvaluationFromGame",value:function(t,e){this.callStack.Push(z.FunctionEvaluationFromGame,this.evaluationStack.length),this.callStack.currentElement.currentPointer=$.StartOf(t),this.PassArgumentsToEvaluationStack(e)}},{key:"PassArgumentsToEvaluationStack",value:function(t){if(null!==t)for(var e=0;et;){var n=this.PopEvaluationStack();null===e&&(e=n)}if(this.PopCallStack(z.FunctionEvaluationFromGame),e){if(e instanceof et)return null;var i=b(e,j);return i.valueType==V.DivertTarget?i.valueObject.toString():i.valueObject}return null}},{key:"AddError",value:function(t,e){e?(null==this._currentWarnings&&(this._currentWarnings=[]),this._currentWarnings.push(t)):(null==this._currentErrors&&(this._currentErrors=[]),this._currentErrors.push(t))}},{key:"OutputStreamDirty",value:function(){this._outputStreamTextDirty=!0,this._outputStreamTagsDirty=!0}}]),e}(),gt=function(){function t(){n(this,t),this.startTime=void 0}return r(t,[{key:"ElapsedMilliseconds",get:function(){return void 0===this.startTime?0:(new Date).getTime()-this.startTime}},{key:"Start",value:function(){this.startTime=(new Date).getTime()}},{key:"Stop",value:function(){this.startTime=void 0}}]),t}();!function(t){t[t.Author=0]="Author",t[t.Warning=1]="Warning",t[t.Error=2]="Error"}(vt||(vt={})),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&t>-9007199254740992&&t<9007199254740992&&Math.floor(t)===t}),t.Story=function(t){a(s,t);var i=v(s);function s(){var t,e;n(this,s),(t=i.call(this)).inkVersionMinimumCompatible=18,t.onError=null,t.onDidContinue=null,t.onMakeChoice=null,t.onEvaluateFunction=null,t.onCompleteEvaluateFunction=null,t.onChoosePathString=null,t._prevContainers=[],t.allowExternalFunctionFallbacks=!1,t._listDefinitions=null,t._variableObservers=null,t._hasValidatedExternals=!1,t._temporaryEvaluationContainer=null,t._asyncContinueActive=!1,t._stateSnapshotAtLastNewline=null,t._sawLookaheadUnsafeFunctionAfterNewline=!1,t._recursiveContinueCount=0,t._asyncSaving=!1,t._profiler=null;var r=null,a=null;if(arguments[0]instanceof K)e=arguments[0],void 0!==arguments[1]&&(r=arguments[1]),t._mainContentContainer=e;else if("string"==typeof arguments[0]){var o=arguments[0];a=ft.TextToDictionary(o)}else a=arguments[0];if(null!=r&&(t._listDefinitions=new st(r)),t._externals=new Map,null!==a){var u=a,l=u.inkVersion;if(null==l)throw new Error("ink version number not found. Are you sure it's a valid .ink.json file?");var h=parseInt(l);if(h>s.inkVersionCurrent)throw new Error("Version of ink used to build story was newer than the current version of the engine");if(h0&&void 0!==arguments[0]?arguments[0]:0;null!=this._profiler&&this._profiler.PreContinue();var e=t>0;if(this._recursiveContinueCount++,!this._asyncContinueActive){if(this._asyncContinueActive=e,!this.canContinue)throw new Error("Can't continue - should check canContinue before calling Continue");this._state.didSafeExit=!1,this._state.ResetOutput(),1==this._recursiveContinueCount&&(this._state.variablesState.batchObservingVariableChanges=!0)}var n=new gt;n.Start();var i=!1;this._sawLookaheadUnsafeFunctionAfterNewline=!1;do{try{i=this.ContinueSingleStep()}catch(t){if(!(t instanceof x))throw t;this.AddError(t.message,void 0,t.useEndLineNumber);break}if(i)break;if(this._asyncContinueActive&&n.ElapsedMilliseconds>t)break}while(this.canContinue);if(n.Stop(),!i&&this.canContinue||(null!==this._stateSnapshotAtLastNewline&&this.RestoreStateSnapshot(),this.canContinue||(this.state.callStack.canPopThread&&this.AddError("Thread available to pop, threads should always be flat by the end of evaluation?"),0!=this.state.generatedChoices.length||this.state.didSafeExit||null!=this._temporaryEvaluationContainer||(this.state.callStack.CanPop(z.Tunnel)?this.AddError("unexpectedly reached end of content. Do you need a '->->' to return from a tunnel?"):this.state.callStack.CanPop(z.Function)?this.AddError("unexpectedly reached end of content. Do you need a '~ return'?"):this.state.callStack.canPop?this.AddError("unexpectedly reached end of content for unknown reason. Please debug compiler!"):this.AddError("ran out of content. Do you need a '-> DONE' or '-> END'?"))),this.state.didSafeExit=!1,this._sawLookaheadUnsafeFunctionAfterNewline=!1,1==this._recursiveContinueCount&&(this._state.variablesState.batchObservingVariableChanges=!1),this._asyncContinueActive=!1,null!==this.onDidContinue&&this.onDidContinue()),this._recursiveContinueCount--,null!=this._profiler&&this._profiler.PostContinue(),this.state.hasError||this.state.hasWarning){if(null===this.onError){var r=new A;throw r.Append("Ink had "),this.state.hasError&&(r.Append("".concat(this.state.currentErrors.length)),r.Append(1==this.state.currentErrors.length?" error":"errors"),this.state.hasWarning&&r.Append(" and ")),this.state.hasWarning&&(r.Append("".concat(this.state.currentWarnings.length)),r.Append(1==this.state.currentWarnings.length?" warning":"warnings"),this.state.hasWarning&&r.Append(" and ")),r.Append(". It is strongly suggested that you assign an error handler to story.onError. The first issue was: "),r.Append(this.state.hasError?this.state.currentErrors[0]:this.state.currentWarnings[0]),new x(r.toString())}if(this.state.hasError){var a,s=g(this.state.currentErrors);try{for(s.s();!(a=s.n()).done;){var o=a.value;this.onError(o,vt.Error)}}catch(o){s.e(o)}finally{s.f()}}if(this.state.hasWarning){var u,l=g(this.state.currentWarnings);try{for(l.s();!(u=l.n()).done;){var h=u.value;this.onError(h,vt.Warning)}}catch(o){l.e(o)}finally{l.f()}}this.ResetErrors()}}},{key:"ContinueSingleStep",value:function(){if(null!=this._profiler&&this._profiler.PreStep(),this.Step(),null!=this._profiler&&this._profiler.PostStep(),this.canContinue||this.state.callStack.elementIsEvaluateFromGame||this.TryFollowDefaultInvisibleChoice(),null!=this._profiler&&this._profiler.PreSnapshot(),!this.state.inStringEvaluation){if(null!==this._stateSnapshotAtLastNewline){if(null===this._stateSnapshotAtLastNewline.currentTags)return P("this._stateAtLastNewline.currentTags");if(null===this.state.currentTags)return P("this.state.currentTags");var t=this.CalculateNewlineOutputStateChange(this._stateSnapshotAtLastNewline.currentText,this.state.currentText,this._stateSnapshotAtLastNewline.currentTags.length,this.state.currentTags.length);if(t==s.OutputStateChange.ExtendedBeyondNewline||this._sawLookaheadUnsafeFunctionAfterNewline)return this.RestoreStateSnapshot(),!0;t==s.OutputStateChange.NewlineRemoved&&this.DiscardSnapshot()}this.state.outputStreamEndsInNewline&&(this.canContinue?null==this._stateSnapshotAtLastNewline&&this.StateSnapshot():this.DiscardSnapshot())}return null!=this._profiler&&this._profiler.PostSnapshot(),!1}},{key:"CalculateNewlineOutputStateChange",value:function(t,e,n,i){if(null===t)return P("prevText");if(null===e)return P("currText");var r=e.length>=t.length&&t.length>0&&"\n"==e.charAt(t.length-1);if(n==i&&t.length==e.length&&r)return s.OutputStateChange.NoChange;if(!r)return s.OutputStateChange.NewlineRemoved;if(i>n)return s.OutputStateChange.ExtendedBeyondNewline;for(var a=t.length;a0?this.Error("Failed to find content at path '"+t+"', and no approximation of it was possible."):i.approximate&&this.Warning("Failed to find content at path '"+t+"', so it was approximated to: '"+i.obj.path+"'."),e)}},{key:"StateSnapshot",value:function(){this._stateSnapshotAtLastNewline=this._state,this._state=this._state.CopyAndStartPatching()}},{key:"RestoreStateSnapshot",value:function(){null===this._stateSnapshotAtLastNewline&&P("_stateSnapshotAtLastNewline"),this._stateSnapshotAtLastNewline.RestoreAfterPatch(),this._state=this._stateSnapshotAtLastNewline,this._stateSnapshotAtLastNewline=null,this._asyncSaving||this._state.ApplyAnyPatch()}},{key:"DiscardSnapshot",value:function(){this._asyncSaving||this._state.ApplyAnyPatch(),this._stateSnapshotAtLastNewline=null}},{key:"CopyStateForBackgroundThreadSave",value:function(){if(this.IfAsyncWeCant("start saving on a background thread"),this._asyncSaving)throw new Error("Story is already in background saving mode, can't call CopyStateForBackgroundThreadSave again!");var t=this._state;return this._state=this._state.CopyAndStartPatching(),this._asyncSaving=!0,t}},{key:"BackgroundSaveComplete",value:function(){null===this._stateSnapshotAtLastNewline&&this._state.ApplyAnyPatch(),this._asyncSaving=!1}},{key:"Step",value:function(){var t=!0,e=this.state.currentPointer.copy();if(!e.isNull){for(var n=C(e.Resolve(),K);n&&(this.VisitContainer(n,!0),0!=n.content.length);)n=C((e=$.StartOf(n)).Resolve(),K);this.state.currentPointer=e.copy(),null!=this._profiler&&this._profiler.Step(this.state.callStack);var i=e.Resolve(),r=this.PerformLogicAndFlowControl(i);if(!this.state.currentPointer.isNull){r&&(t=!1);var a=C(i,Q);if(a){var s=this.ProcessChoice(a);s&&this.state.generatedChoices.push(s),i=null,t=!1}if(i instanceof K&&(t=!1),t){var o=C(i,J);if(o&&-1==o.contextIndex){var u=this.state.callStack.ContextForVariableNamed(o.variableName);i=new J(o.variableName,u)}this.state.inExpressionEvaluation?this.state.PushEvaluationStack(i):this.state.PushToOutputStream(i)}this.NextContent();var l=C(i,X);l&&l.commandType==X.CommandType.StartThread&&this.state.callStack.PushThread()}}}},{key:"VisitContainer",value:function(t,e){t.countingAtStartOnly&&!e||(t.visitsShouldBeCounted&&this.state.IncrementVisitCountForContainer(t),t.turnIndexShouldBeCounted&&this.state.RecordTurnIndexVisitToContainer(t))}},{key:"VisitChangedContainersDueToDivert",value:function(){var t=this.state.previousPointer.copy(),e=this.state.currentPointer.copy();if(!e.isNull&&-1!=e.index){if(this._prevContainers.length=0,!t.isNull)for(var n=C(t.Resolve(),K)||C(t.container,K);n;)this._prevContainers.push(n),n=C(n.parent,K);var i=e.Resolve();if(null!=i)for(var r=C(i.parent,K),a=!0;r&&(this._prevContainers.indexOf(r)<0||r.countingAtStartOnly);){var s=r.content.length>0&&i==r.content[0]&&a;s||(a=!1),this.VisitContainer(r,s),i=r,r=C(r.parent,K)}}}},{key:"PopChoiceStringAndTags",value:function(t){for(var e=b(this.state.PopEvaluationStack(),G);this.state.evaluationStack.length>0&&null!=C(this.state.PeekEvaluationStack(),it);){var n=C(this.state.PopEvaluationStack(),it);n&&t.push(n.text)}return e.value}},{key:"ProcessChoice",value:function(t){var e=!0;if(t.hasCondition){var n=this.state.PopEvaluationStack();this.IsTruthy(n)||(e=!1)}var i="",r="",a=[];(t.hasChoiceOnlyContent&&(r=this.PopChoiceStringAndTags(a)||""),t.hasStartContent&&(i=this.PopChoiceStringAndTags(a)||""),t.onceOnly)&&(this.state.VisitCountForContainer(t.choiceTarget)>0&&(e=!1));if(!e)return null;var s=new rt;return s.targetPath=t.pathOnChoice,s.sourcePath=t.path.toString(),s.isInvisibleDefault=t.isInvisibleDefault,s.threadAtGeneration=this.state.callStack.ForkThread(),s.tags=a.reverse(),s.text=(i+r).replace(/^[ \t]+|[ \t]+$/g,""),s}},{key:"IsTruthy",value:function(t){if(t instanceof j){var e=t;if(e instanceof M){var n=e;return this.Error("Shouldn't use a divert target (to "+n.targetPath+") as a conditional value. Did you intend a function call 'likeThis()' or a read count check 'likeThis'? (no arrows)"),!1}return e.isTruthy}return!1}},{key:"PerformLogicAndFlowControl",value:function(t){if(null==t)return!1;if(t instanceof Y){var e=t;if(e.isConditional){var n=this.state.PopEvaluationStack();if(!this.IsTruthy(n))return!0}if(e.hasVariableTarget){var i=e.variableDivertName,r=this.state.variablesState.GetVariableWithName(i);if(null==r)this.Error("Tried to divert using a target from a variable that could not be found ("+i+")");else if(!(r instanceof M)){var a=C(r,D),s="Tried to divert to a target from a variable, but the variable ("+i+") didn't contain a divert target, it ";a instanceof D&&0==a.value?s+="was empty/null (the value 0).":s+="contained '"+r+"'.",this.Error(s)}var o=b(r,M);this.state.divertedPointer=this.PointerAtPath(o.targetPath)}else{if(e.isExternal)return this.CallExternalFunction(e.targetPathString,e.externalArgs),!0;this.state.divertedPointer=e.targetPointer.copy()}return e.pushesToStack&&this.state.callStack.Push(e.stackPushType,void 0,this.state.outputStream.length),this.state.divertedPointer.isNull&&!e.isExternal&&(e&&e.debugMetadata&&null!=e.debugMetadata.sourceName?this.Error("Divert target doesn't exist: "+e.debugMetadata.sourceName):this.Error("Divert resolution failed: "+e)),!0}if(t instanceof X){var u=t;switch(u.commandType){case X.CommandType.EvalStart:this.Assert(!1===this.state.inExpressionEvaluation,"Already in expression evaluation?"),this.state.inExpressionEvaluation=!0;break;case X.CommandType.EvalEnd:this.Assert(!0===this.state.inExpressionEvaluation,"Not in expression evaluation mode"),this.state.inExpressionEvaluation=!1;break;case X.CommandType.EvalOutput:if(this.state.evaluationStack.length>0){var l=this.state.PopEvaluationStack();if(!(l instanceof et)){var h=new G(l.toString());this.state.PushToOutputStream(h)}}break;case X.CommandType.NoOp:break;case X.CommandType.Duplicate:this.state.PushEvaluationStack(this.state.PeekEvaluationStack());break;case X.CommandType.PopEvaluatedValue:this.state.PopEvaluationStack();break;case X.CommandType.PopFunction:case X.CommandType.PopTunnel:var c=u.commandType==X.CommandType.PopFunction?z.Function:z.Tunnel,f=null;if(c==z.Tunnel){var v=this.state.PopEvaluationStack();null===(f=C(v,M))&&this.Assert(v instanceof et,"Expected void if ->-> doesn't override target")}if(this.state.TryExitFunctionEvaluationFromGame())break;if(this.state.callStack.currentElement.type==c&&this.state.callStack.canPop)this.state.PopCallStack(),f&&(this.state.divertedPointer=this.PointerAtPath(f.targetPath));else{var d=new Map;d.set(z.Function,"function return statement (~ return)"),d.set(z.Tunnel,"tunnel onwards statement (->->)");var p=d.get(this.state.callStack.currentElement.type);this.state.callStack.canPop||(p="end of flow (-> END or choice)");var y="Found "+d.get(c)+", when expected "+p;this.Error(y)}break;case X.CommandType.BeginString:this.state.PushToOutputStream(u),this.Assert(!0===this.state.inExpressionEvaluation,"Expected to be in an expression when evaluating a string"),this.state.inExpressionEvaluation=!1;break;case X.CommandType.BeginTag:this.state.PushToOutputStream(u);break;case X.CommandType.EndTag:if(this.state.inStringEvaluation){for(var m=[],S=0,k=this.state.outputStream.length-1;k>=0;--k){var w=this.state.outputStream[k];S++;var _=C(w,X);if(null!=_){if(_.commandType==X.CommandType.BeginTag)break;this.Error("Unexpected ControlCommand while extracting tag from choice");break}w instanceof G&&m.push(w)}this.state.PopFromOutputStream(S);for(var T=new A,E=0,O=m;E=0;--B){var J=this.state.outputStream[B];R++;var q=C(J,X);if(q&&q.commandType==X.CommandType.BeginString)break;J instanceof it&&L.push(J),J instanceof G&&V.push(J)}this.state.PopFromOutputStream(R);for(var H=0,Q=L;HNumber.MAX_SAFE_INTEGER)&&(gt=Number.MAX_SAFE_INTEGER,this.Error("RANDOM was called with a range that exceeds the size that ink numbers can use.")),gt<=0&&this.Error("RANDOM was called with minimum as "+mt.value+" and maximum as "+yt.value+". The maximum must be larger");var St=this.state.storySeed+this.state.previousRandom,kt=new ht(St).next(),Ct=kt%gt+mt.value;this.state.PushEvaluationStack(new D(Ct)),this.state.previousRandom=kt;break;case X.CommandType.SeedRandom:var bt=C(this.state.PopEvaluationStack(),D);if(null==bt||bt instanceof D==!1)return this.Error("Invalid value passed to SEED_RANDOM");if(null===bt.value)return P("minInt.value");this.state.storySeed=bt.value,this.state.previousRandom=0,this.state.PushEvaluationStack(new et);break;case X.CommandType.VisitIndex:var wt=this.state.VisitCountForContainer(this.state.currentPointer.container)-1;this.state.PushEvaluationStack(new D(wt));break;case X.CommandType.SequenceShuffleIndex:var _t=this.NextSequenceShuffleIndex();this.state.PushEvaluationStack(new D(_t));break;case X.CommandType.StartThread:break;case X.CommandType.Done:this.state.callStack.canPopThread?this.state.callStack.PopThread():(this.state.didSafeExit=!0,this.state.currentPointer=$.Null);break;case X.CommandType.End:this.state.ForceEnd();break;case X.CommandType.ListFromInt:var Tt=C(this.state.PopEvaluationStack(),D),Et=b(this.state.PopEvaluationStack(),G);if(null===Tt)throw new x("Passed non-integer when creating a list element from a numerical value.");var Ot=null;if(null===this.listDefinitions)return P("this.listDefinitions");var Pt=this.listDefinitions.TryListGetDefinition(Et.value,null);if(!Pt.exists)throw new x("Failed to find LIST called "+Et.value);if(null===Tt.value)return P("minInt.value");var Nt=Pt.result.TryGetItemWithValue(Tt.value,I.Null);Nt.exists&&(Ot=new U(Nt.result,Tt.value)),null==Ot&&(Ot=new U),this.state.PushEvaluationStack(Ot);break;case X.CommandType.ListRange:var At=C(this.state.PopEvaluationStack(),j),It=C(this.state.PopEvaluationStack(),j),Ft=C(this.state.PopEvaluationStack(),U);if(null===Ft||null===It||null===At)throw new x("Expected list, minimum and maximum for LIST_RANGE");if(null===Ft.value)return P("targetList.value");var xt=Ft.value.ListWithSubRange(It.valueObject,At.valueObject);this.state.PushEvaluationStack(new U(xt));break;case X.CommandType.ListRandom:var Wt=this.state.PopEvaluationStack();if(null===Wt)throw new x("Expected list for LIST_RANDOM");var Vt=Wt.value,Lt=null;if(null===Vt)throw P("list");if(0==Vt.Count)Lt=new F;else{for(var jt=this.state.storySeed+this.state.previousRandom,Rt=new ht(jt).next(),Dt=Rt%Vt.Count,Bt=Vt.entries(),Gt=0;Gt<=Dt-1;Gt++)Bt.next();var Mt=Bt.next().value,Jt={Key:I.fromSerializedKey(Mt[0]),Value:Mt[1]};if(null===Jt.Key.originName)return P("randomItem.Key.originName");(Lt=new F(Jt.Key.originName,this)).Add(Jt.Key,Jt.Value),this.state.previousRandom=Rt}this.state.PushEvaluationStack(new U(Lt));break;default:this.Error("unhandled ControlCommand: "+u)}return!0}if(t instanceof tt){var Ut=t,qt=this.state.PopEvaluationStack();return this.state.variablesState.Assign(Ut,qt),!0}if(t instanceof Z){var Kt=t,zt=null;if(null!=Kt.pathForCount){var Ht=Kt.containerForCount,Xt=this.state.VisitCountForContainer(Ht);zt=new D(Xt)}else null==(zt=this.state.variablesState.GetVariableWithName(Kt.name))&&(this.Warning("Variable not found: '"+Kt.name+"'. Using default value of 0 (false). This can happen with temporary variables if the declaration hasn't yet been hit. Globals are always given a default value on load if a value doesn't exist in the save state."),zt=new D(0));return this.state.PushEvaluationStack(zt),!0}if(t instanceof nt){var $t=t,Yt=this.state.PopEvaluationStack($t.numberOfParameters),Qt=$t.Call(Yt);return this.state.PushEvaluationStack(Qt),!0}return!1}},{key:"ChoosePathString",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(this.IfAsyncWeCant("call ChoosePathString right now"),null!==this.onChoosePathString&&this.onChoosePathString(t,n),e)this.ResetCallstack();else if(this.state.callStack.currentElement.type==z.Function){var i="",r=this.state.callStack.currentElement.currentPointer.container;throw null!=r&&(i="("+r.path.toString()+") "),new Error("Story was running a function "+i+"when you called ChoosePathString("+t+") - this is almost certainly not not what you want! Full stack trace: \n"+this.state.callStack.callStackTrace)}this.state.PassArgumentsToEvaluationStack(n),this.ChoosePath(new k(t))}},{key:"IfAsyncWeCant",value:function(t){if(this._asyncContinueActive)throw new Error("Can't "+t+". Story is in the middle of a ContinueAsync(). Make more ContinueAsync() calls or a single Continue() call beforehand.")}},{key:"ChoosePath",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.state.SetChosenPath(t,e),this.VisitChangedContainersDueToDivert()}},{key:"ChooseChoiceIndex",value:function(t){var e=this.currentChoices;this.Assert(t>=0&&t1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null!==this.onEvaluateFunction&&this.onEvaluateFunction(t,e),this.IfAsyncWeCant("evaluate a function"),null==t)throw new Error("Function is null");if(""==t||""==t.trim())throw new Error("Function is empty or white space.");var i=this.KnotContainerWithName(t);if(null==i)throw new Error("Function doesn't exist: '"+t+"'");var r=[];r.push.apply(r,p(this.state.outputStream)),this._state.ResetOutput(),this.state.StartFunctionEvaluationFromGame(i,e);for(var a=new A;this.canContinue;)a.Append(this.Continue());var s=a.toString();this._state.ResetOutput(r);var o=this.state.CompleteFunctionEvaluationFromGame();return null!=this.onCompleteEvaluateFunction&&this.onCompleteEvaluateFunction(t,e,s,o),n?{returned:o,output:s}:o}},{key:"EvaluateExpression",value:function(t){var e=this.state.callStack.elements.length;this.state.callStack.Push(z.Tunnel),this._temporaryEvaluationContainer=t,this.state.GoToStart();var n=this.state.evaluationStack.length;return this.Continue(),this._temporaryEvaluationContainer=null,this.state.callStack.elements.length>e&&this.state.PopCallStack(),this.state.evaluationStack.length>n?this.state.PopEvaluationStack():null}},{key:"CallExternalFunction",value:function(t,n){if(null===t)return P("funcName");var i=this._externals.get(t),r=null,a=void 0!==i;if(!a||i.lookAheadSafe||null===this._stateSnapshotAtLastNewline){if(!a){if(this.allowExternalFunctionFallbacks)return r=this.KnotContainerWithName(t),this.Assert(null!==r,"Trying to call EXTERNAL function '"+t+"' which has not been bound, and fallback ink function could not be found."),this.state.callStack.Push(z.Function,void 0,this.state.outputStream.length),void(this.state.divertedPointer=$.StartOf(r));this.Assert(!1,"Trying to call EXTERNAL function '"+t+"' which has not been bound (and ink fallbacks disabled).")}for(var s=[],o=0;o2&&void 0!==arguments[2])||arguments[2];this.IfAsyncWeCant("bind an external function"),this.Assert(!this._externals.has(t),"Function '"+t+"' has already been bound."),this._externals.set(t,{function:e,lookAheadSafe:n})}},{key:"TryCoerce",value:function(t){return t}},{key:"BindExternalFunction",value:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.Assert(null!=e,"Can't bind a null function"),this.BindExternalFunctionGeneral(t,(function(t){n.Assert(t.length>=e.length,"External function expected "+e.length+" arguments");for(var i=[],r=0,a=t.length;r1?"s":"",i+=": '",i+=Array.from(n).join("', '"),i+="' ",i+=this.allowExternalFunctionFallbacks?", and no fallback ink function found.":" (ink fallbacks disabled)",this.Error(i)}else if(null!=t){var r,a=g(t.content);try{for(a.s();!(r=a.n()).done;){var s=r.value;null!=s&&s.hasValidName||this.ValidateExternalBindings(s,n)}}catch(t){a.e(t)}finally{a.f()}var o,u=g(t.namedContent);try{for(u.s();!(o=u.n()).done;){var l=d(o.value,2)[1];this.ValidateExternalBindings(C(l,N),n)}}catch(t){u.e(t)}finally{u.f()}}else if(null!=e){var h=C(e,Y);if(h&&h.isExternal){var c=h.targetPathString;if(null===c)return P("name");if(!this._externals.has(c))if(this.allowExternalFunctionFallbacks)this.mainContentContainer.namedContent.has(c)||n.add(c);else n.add(c)}}}},{key:"ObserveVariable",value:function(t,e){if(this.IfAsyncWeCant("observe a new variable"),null===this._variableObservers&&(this._variableObservers=new Map),!this.state.variablesState.GlobalVariableExistsWithName(t))throw new Error("Cannot observe variable '"+t+"' because it wasn't declared in the ink story.");this._variableObservers.has(t)?this._variableObservers.get(t).push(e):this._variableObservers.set(t,[e])}},{key:"ObserveVariables",value:function(t,e){for(var n=0,i=t.length;n=e.container.content.length;){t=!1;var n=C(e.container.parent,K);if(n instanceof K==!1)break;var i=n.content.indexOf(e.container);if(-1==i)break;if((e=new $(n,i)).index++,t=!0,null===e.container)return P("pointer.container")}return t||(e=$.Null),this.state.callStack.currentElement.currentPointer=e.copy(),t}},{key:"TryFollowDefaultInvisibleChoice",value:function(){var t=this._state.currentChoices,e=t.filter((function(t){return t.isInvisibleDefault}));if(0==e.length||t.length>e.length)return!1;var n=e[0];return null===n.targetPath?P("choice.targetPath"):null===n.threadAtGeneration?P("choice.threadAtGeneration"):(this.state.callStack.currentThread=n.threadAtGeneration,null!==this._stateSnapshotAtLastNewline&&(this.state.callStack.currentThread=this.state.callStack.ForkThread()),this.ChoosePath(n.targetPath,!1),!0)}},{key:"NextSequenceShuffleIndex",value:function(){var t=C(this.state.PopEvaluationStack(),D);if(!(t instanceof D))return this.Error("expected number of elements in sequence for shuffle index"),0;var e=this.state.currentPointer.container;if(null===e)return P("seqContainer");if(null===t.value)return P("numElementsIntVal.value");var n=t.value,i=b(this.state.PopEvaluationStack(),D).value;if(null===i)return P("seqCount");for(var r=i/n,a=i%n,s=e.path.toString(),o=0,u=0,l=s.length;u1&&void 0!==arguments[1]&&arguments[1],n=new x(t);throw n.useEndLineNumber=e,n}},{key:"Warning",value:function(t){this.AddError(t,!0)}},{key:"AddError",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.currentDebugMetadata,r=e?"WARNING":"ERROR";if(null!=i){var a=n?i.endLineNumber:i.startLineNumber;t="RUNTIME "+r+": '"+i.fileName+"' line "+a+": "+t}else t=this.state.currentPointer.isNull?"RUNTIME "+r+": "+t:"RUNTIME "+r+": ("+this.state.currentPointer+"): "+t;this.state.AddError(t,e),e||this.state.ForceEnd()}},{key:"Assert",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(0==t)throw null==e&&(e="Story assert"),new Error(e+" "+this.currentDebugMetadata)}},{key:"currentDebugMetadata",get:function(){var t,e=this.state.currentPointer;if(!e.isNull&&null!==e.Resolve()&&null!==(t=e.Resolve().debugMetadata))return t;for(var n=this.state.callStack.elements.length-1;n>=0;--n)if(!(e=this.state.callStack.elements[n].currentPointer).isNull&&null!==e.Resolve()&&null!==(t=e.Resolve().debugMetadata))return t;for(var i=this.state.outputStream.length-1;i>=0;--i){if(null!==(t=this.state.outputStream[i].debugMetadata))return t}return null}},{key:"mainContentContainer",get:function(){return this._temporaryEvaluationContainer?this._temporaryEvaluationContainer:this._mainContentContainer}}]),s}(N),t.Story.inkVersionCurrent=21,dt=t.Story||(t.Story={}),(pt=dt.OutputStateChange||(dt.OutputStateChange={}))[pt.NoChange=0]="NoChange",pt[pt.ExtendedBeyondNewline=1]="ExtendedBeyondNewline",pt[pt.NewlineRemoved=2]="NewlineRemoved",t.InkList=F,Object.defineProperty(t,"__esModule",{value:!0})})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).inkjs={})}(this,(function(t){"use strict";class e{constructor(){if(this._components=[],this._componentsString=null,this._isRelative=!1,"string"==typeof arguments[0]){let t=arguments[0];this.componentsString=t}else if(arguments[0]instanceof e.Component&&arguments[1]instanceof e){let t=arguments[0],e=arguments[1];this._components.push(t),this._components=this._components.concat(e._components)}else if(arguments[0]instanceof Array){let t=arguments[0],e=!!arguments[1];this._components=this._components.concat(t),this._isRelative=e}}get isRelative(){return this._isRelative}get componentCount(){return this._components.length}get head(){return this._components.length>0?this._components[0]:null}get tail(){if(this._components.length>=2){let t=this._components.slice(1,this._components.length);return new e(t)}return e.self}get length(){return this._components.length}get lastComponent(){let t=this._components.length-1;return t>=0?this._components[t]:null}get containsNamedComponent(){for(let t=0,e=this._components.length;t=0}get isParent(){return this.name==t.parentId}static ToParent(){return new e(t.parentId)}toString(){return this.isIndex?this.index.toString():this.name}Equals(t){return null!=t&&t.isIndex==this.isIndex&&(this.isIndex?this.index==t.index:this.name==t.name)}}t.Component=e}(e||(e={})),function(t){function e(t,e){if(!t)throw void 0!==e&&console.warn(e),console.trace&&console.trace(),new Error("")}t.AssertType=function(t,n,i){e(t instanceof n,i)},t.Assert=e}(n||(n={}));class d extends Error{}function p(t){throw new d(`${t} is null or undefined`)}class m{constructor(){this.parent=null,this._debugMetadata=null,this._path=null}get debugMetadata(){return null===this._debugMetadata&&this.parent?this.parent.debugMetadata:this._debugMetadata}set debugMetadata(t){this._debugMetadata=t}get ownDebugMetadata(){return this._debugMetadata}DebugLineNumberOfPath(t){if(null===t)return null;let e=this.rootContentContainer;if(e){let n=e.ContentAtPath(t).obj;if(n){let t=n.debugMetadata;if(null!==t)return t.startLineNumber}}return null}get path(){if(null==this._path)if(null==this.parent)this._path=new e;else{let t=[],n=this,i=s(n.parent,x);for(;null!==i;){let r=o(n);if(null!=r&&r.hasValidName){if(null===r.name)return p("namedChild.name");t.unshift(new e.Component(r.name))}else t.unshift(new e.Component(i.content.indexOf(n)));n=i,i=s(i.parent,x)}this._path=new e(t)}return this._path}ResolvePath(t){if(null===t)return p("path");if(t.isRelative){let e=s(this,x);return null===e&&(n.Assert(null!==this.parent,"Can't resolve relative path because we don't have a parent"),e=s(this.parent,x),n.Assert(null!==e,"Expected parent to be a container"),n.Assert(t.GetComponent(0).isParent),t=t.tail),null===e?p("nearestContainer"):e.ContentAtPath(t)}{let e=this.rootContentContainer;return null===e?p("contentContainer"):e.ContentAtPath(t)}}ConvertPathToRelative(t){let n=this.path,i=Math.min(t.length,n.length),r=-1;for(let e=0;e1?e-1:0),i=1;ivoid 0!==n[e]?n[e]:t))}toString(){return this.string}Clear(){this.string=""}}class g{constructor(){if(this.originName=null,this.itemName=null,void 0!==arguments[1]){let t=arguments[0],e=arguments[1];this.originName=t,this.itemName=e}else if(arguments[0]){let t=arguments[0].toString().split(".");this.originName=t[0],this.itemName=t[1]}}static get Null(){return new g(null,null)}get isNull(){return null==this.originName&&null==this.itemName}get fullName(){return(null!==this.originName?this.originName:"?")+"."+this.itemName}toString(){return this.fullName}Equals(t){if(t instanceof g){let e=t;return e.itemName==this.itemName&&e.originName==this.originName}return!1}copy(){return new g(this.originName,this.itemName)}serialized(){return JSON.stringify({originName:this.originName,itemName:this.itemName})}static fromSerializedKey(t){let e=JSON.parse(t);if(!g.isLikeInkListItem(e))return g.Null;let n=e;return new g(n.originName,n.itemName)}static isLikeInkListItem(t){return"object"==typeof t&&(!(!t.hasOwnProperty("originName")||!t.hasOwnProperty("itemName"))&&(("string"==typeof t.originName||null===typeof t.originName)&&("string"==typeof t.itemName||null===typeof t.itemName)))}}class S extends Map{constructor(){if(super(arguments[0]instanceof S?arguments[0]:[]),this.origins=null,this._originNames=[],arguments[0]instanceof S){let t=arguments[0],e=t.originNames;null!==e&&(this._originNames=e.slice()),null!==t.origins&&(this.origins=t.origins.slice())}else if("string"==typeof arguments[0]){let t=arguments[0],e=arguments[1];if(this.SetInitialOriginName(t),null===e.listDefinitions)return p("originStory.listDefinitions");let n=e.listDefinitions.TryListGetDefinition(t,null);if(!n.exists)throw new Error("InkList origin could not be found in story when constructing new list: "+t);if(null===n.result)return p("def.result");this.origins=[n.result]}else if("object"==typeof arguments[0]&&arguments[0].hasOwnProperty("Key")&&arguments[0].hasOwnProperty("Value")){let t=arguments[0];this.Add(t.Key,t.Value)}}static FromString(t,e){var n;let i=null===(n=e.listDefinitions)||void 0===n?void 0:n.FindSingleItemListWithName(t);if(i)return null===i.value?p("listValue.value"):new S(i.value);throw new Error("Could not find the InkListItem from the string '"+t+"' to create an InkList because it doesn't exist in the original list definition in ink.")}AddItem(t){if(t instanceof g){let e=t;if(null==e.originName)return void this.AddItem(e.itemName);if(null===this.origins)return p("this.origins");for(let t of this.origins)if(t.name==e.originName){let n=t.TryGetValueForItem(e,0);if(n.exists)return void this.Add(e,n.result);throw new Error("Could not add the item "+e+" to this list because it doesn't exist in the original list definition in ink.")}throw new Error("Failed to add item to list because the item was from a new list definition that wasn't previously known to this list. Only items from previously known lists can be used, so that the int value can be found.")}{let e=t,n=null;if(null===this.origins)return p("this.origins");for(let t of this.origins){if(null===e)return p("itemName");if(t.ContainsItemWithName(e)){if(null!=n)throw new Error("Could not add the item "+e+" to this list because it could come from either "+t.name+" or "+n.name);n=t}}if(null==n)throw new Error("Could not add the item "+e+" to this list because it isn't known to any list definitions previously associated with this list.");let i=new g(n.name,e),r=n.ValueForItem(i);this.Add(i,r)}}ContainsItemNamed(t){for(let[e]of this){if(g.fromSerializedKey(e).itemName==t)return!0}return!1}ContainsKey(t){return this.has(t.serialized())}Add(t,e){let n=t.serialized();if(this.has(n))throw new Error(`The Map already contains an entry for ${t}`);this.set(n,e)}Remove(t){return this.delete(t.serialized())}get Count(){return this.size}get originOfMaxItem(){if(null==this.origins)return null;let t=this.maxItem.Key.originName,e=null;return this.origins.every((n=>n.name!=t||(e=n,!1))),e}get originNames(){if(this.Count>0){null==this._originNames&&this.Count>0?this._originNames=[]:(this._originNames||(this._originNames=[]),this._originNames.length=0);for(let[t]of this){let e=g.fromSerializedKey(t);if(null===e.originName)return p("item.originName");this._originNames.push(e.originName)}}return this._originNames}SetInitialOriginName(t){this._originNames=[t]}SetInitialOriginNames(t){this._originNames=null==t?null:t.slice()}get maxItem(){let t={Key:g.Null,Value:0};for(let[e,n]of this){let i=g.fromSerializedKey(e);(t.Key.isNull||n>t.Value)&&(t={Key:i,Value:n})}return t}get minItem(){let t={Key:g.Null,Value:0};for(let[e,n]of this){let i=g.fromSerializedKey(e);(t.Key.isNull||nt.maxItem.Value)}GreaterThanOrEquals(t){return 0!=this.Count&&(0==t.Count||this.minItem.Value>=t.minItem.Value&&this.maxItem.Value>=t.maxItem.Value)}LessThan(t){return 0!=t.Count&&(0==this.Count||this.maxItem.Value0?new S(this.maxItem):new S}MinAsList(){return this.Count>0?new S(this.minItem):new S}ListWithSubRange(t,e){if(0==this.Count)return new S;let n=this.orderedItems,i=0,r=Number.MAX_SAFE_INTEGER;Number.isInteger(t)?i=t:t instanceof S&&t.Count>0&&(i=t.minItem.Value),Number.isInteger(e)?r=e:e instanceof S&&e.Count>0&&(r=e.maxItem.Value);let a=new S;a.SetInitialOriginNames(this.originNames);for(let t of n)t.Value>=i&&t.Value<=r&&a.Add(t.Key,t.Value);return a}Equals(t){if(t instanceof S==!1)return!1;if(t.Count!=this.Count)return!1;for(let[e]of this)if(!t.has(e))return!1;return!0}get orderedItems(){let t=new Array;for(let[e,n]of this){let i=g.fromSerializedKey(e);t.push({Key:i,Value:n})}return t.sort(((t,e)=>null===t.Key.originName?p("x.Key.originName"):null===e.Key.originName?p("y.Key.originName"):t.Value==e.Value?t.Key.originName.localeCompare(e.Key.originName):t.Valuee.Value?1:0)),t}toString(){let t=this.orderedItems,e=new f;for(let n=0;n0&&e.Append(", ");let i=t[n].Key;if(null===i.itemName)return p("item.itemName");e.Append(i.itemName)}return e.toString()}valueOf(){return NaN}}class y extends Error{constructor(t){super(t),this.useEndLineNumber=!1,this.message=t,this.name="StoryException"}}function v(t,e,n){if(null===t)return{result:n,exists:!1};let i=t.get(e);return void 0===i?{result:n,exists:!1}:{result:i,exists:!0}}class C extends m{static Create(t,n){if(n){if(n===i.Int&&Number.isInteger(Number(t)))return new w(Number(t));if(n===i.Float&&!isNaN(t))return new T(Number(t))}return"boolean"==typeof t?new _(Boolean(t)):"string"==typeof t?new E(String(t)):Number.isInteger(Number(t))?new w(Number(t)):isNaN(t)?t instanceof e?new P(l(t,e)):t instanceof S?new O(l(t,S)):null:new T(Number(t))}Copy(){return l(C.Create(this.valueObject),m)}BadCastException(t){return new y("Can't cast "+this.valueObject+" from "+this.valueType+" to "+t)}}class b extends C{constructor(t){super(),this.value=t}get valueObject(){return this.value}toString(){return null===this.value?p("Value.value"):this.value.toString()}}class _ extends b{constructor(t){super(t||!1)}get isTruthy(){return Boolean(this.value)}get valueType(){return i.Bool}Cast(t){if(null===this.value)return p("Value.value");if(t==this.valueType)return this;if(t==i.Int)return new w(this.value?1:0);if(t==i.Float)return new T(this.value?1:0);if(t==i.String)return new E(this.value?"true":"false");throw this.BadCastException(t)}toString(){return this.value?"true":"false"}}class w extends b{constructor(t){super(t||0)}get isTruthy(){return 0!=this.value}get valueType(){return i.Int}Cast(t){if(null===this.value)return p("Value.value");if(t==this.valueType)return this;if(t==i.Bool)return new _(0!==this.value);if(t==i.Float)return new T(this.value);if(t==i.String)return new E(""+this.value);throw this.BadCastException(t)}}class T extends b{constructor(t){super(t||0)}get isTruthy(){return 0!=this.value}get valueType(){return i.Float}Cast(t){if(null===this.value)return p("Value.value");if(t==this.valueType)return this;if(t==i.Bool)return new _(0!==this.value);if(t==i.Int)return new w(this.value);if(t==i.String)return new E(""+this.value);throw this.BadCastException(t)}}class E extends b{constructor(t){if(super(t||""),this._isNewline="\n"==this.value,this._isInlineWhitespace=!0,null===this.value)return p("Value.value");this.value.length>0&&this.value.split("").every((t=>" "==t||"\t"==t||(this._isInlineWhitespace=!1,!1)))}get valueType(){return i.String}get isTruthy(){return null===this.value?p("Value.value"):this.value.length>0}get isNewline(){return this._isNewline}get isInlineWhitespace(){return this._isInlineWhitespace}get isNonWhitespace(){return!this.isNewline&&!this.isInlineWhitespace}Cast(t){if(t==this.valueType)return this;if(t==i.Int){let e=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=parseInt(t);return Number.isNaN(n)?{result:e,exists:!1}:{result:n,exists:!0}}(this.value);if(e.exists)return new w(e.result);throw this.BadCastException(t)}if(t==i.Float){let e=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=parseFloat(t);return Number.isNaN(n)?{result:e,exists:!1}:{result:n,exists:!0}}(this.value);if(e.exists)return new T(e.result);throw this.BadCastException(t)}throw this.BadCastException(t)}}class P extends b{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)}get valueType(){return i.DivertTarget}get targetPath(){return null===this.value?p("Value.value"):this.value}set targetPath(t){this.value=t}get isTruthy(){throw new Error("Shouldn't be checking the truthiness of a divert target")}Cast(t){if(t==this.valueType)return this;throw this.BadCastException(t)}toString(){return"DivertTargetValue("+this.targetPath+")"}}class N extends b{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;super(t),this._contextIndex=e}get contextIndex(){return this._contextIndex}set contextIndex(t){this._contextIndex=t}get variableName(){return null===this.value?p("Value.value"):this.value}set variableName(t){this.value=t}get valueType(){return i.VariablePointer}get isTruthy(){throw new Error("Shouldn't be checking the truthiness of a variable pointer")}Cast(t){if(t==this.valueType)return this;throw this.BadCastException(t)}toString(){return"VariablePointerValue("+this.variableName+")"}Copy(){return new N(this.variableName,this.contextIndex)}}class O extends b{get isTruthy(){return null===this.value?p("this.value"):this.value.Count>0}get valueType(){return i.List}Cast(t){if(null===this.value)return p("Value.value");if(t==i.Int){let t=this.value.maxItem;return t.Key.isNull?new w(0):new w(t.Value)}if(t==i.Float){let t=this.value.maxItem;return t.Key.isNull?new T(0):new T(t.Value)}if(t==i.String){let t=this.value.maxItem;return t.Key.isNull?new E(""):new E(t.Key.toString())}if(t==this.valueType)return this;throw this.BadCastException(t)}constructor(t,e){super(null),t||e?t instanceof S?this.value=new S(t):t instanceof g&&"number"==typeof e&&(this.value=new S({Key:t,Value:e})):this.value=new S}static RetainListOriginsForAssignment(t,e){let n=s(t,O),i=s(e,O);return i&&null===i.value?p("newList.value"):n&&null===n.value?p("oldList.value"):void(n&&i&&0==i.value.Count&&i.value.SetInitialOriginNames(n.value.originNames))}}!function(t){t[t.Bool=-1]="Bool",t[t.Int=0]="Int",t[t.Float=1]="Float",t[t.List=2]="List",t[t.String=3]="String",t[t.DivertTarget=4]="DivertTarget",t[t.VariablePointer=5]="VariablePointer"}(i||(i={}));class A{constructor(){this.obj=null,this.approximate=!1}get correctObj(){return this.approximate?null:this.obj}get container(){return this.obj instanceof x?this.obj:null}copy(){let t=new A;return t.obj=this.obj,t.approximate=this.approximate,t}}class x extends m{constructor(){super(...arguments),this.name=null,this._content=[],this.namedContent=new Map,this.visitsShouldBeCounted=!1,this.turnIndexShouldBeCounted=!1,this.countingAtStartOnly=!1,this._pathToFirstLeafContent=null}get hasValidName(){return null!=this.name&&this.name.length>0}get content(){return this._content}set content(t){this.AddContent(t)}get namedOnlyContent(){let t=new Map;for(let[e,n]of this.namedContent){let i=l(n,m);t.set(e,i)}for(let e of this.content){let n=o(e);null!=n&&n.hasValidName&&t.delete(n.name)}return 0==t.size&&(t=null),t}set namedOnlyContent(t){let e=this.namedOnlyContent;if(null!=e)for(let[t]of e)this.namedContent.delete(t);if(null!=t)for(let[,e]of t){let t=o(e);null!=t&&this.AddToNamedContentOnly(t)}}get countFlags(){let t=0;return this.visitsShouldBeCounted&&(t|=x.CountFlags.Visits),this.turnIndexShouldBeCounted&&(t|=x.CountFlags.Turns),this.countingAtStartOnly&&(t|=x.CountFlags.CountStartOnly),t==x.CountFlags.CountStartOnly&&(t=0),t}set countFlags(t){let e=t;(e&x.CountFlags.Visits)>0&&(this.visitsShouldBeCounted=!0),(e&x.CountFlags.Turns)>0&&(this.turnIndexShouldBeCounted=!0),(e&x.CountFlags.CountStartOnly)>0&&(this.countingAtStartOnly=!0)}get pathToFirstLeafContent(){return null==this._pathToFirstLeafContent&&(this._pathToFirstLeafContent=this.path.PathByAppendingPath(this.internalPathToFirstLeafContent)),this._pathToFirstLeafContent}get internalPathToFirstLeafContent(){let t=[],n=this;for(;n instanceof x;)n.content.length>0&&(t.push(new e.Component(0)),n=n.content[0]);return new e(t)}AddContent(t){if(t instanceof Array){let e=t;for(let t of e)this.AddContent(t)}else{let e=t;if(this._content.push(e),e.parent)throw new Error("content is already in "+e.parent);e.parent=this,this.TryAddNamedContent(e)}}TryAddNamedContent(t){let e=o(t);null!=e&&e.hasValidName&&this.AddToNamedContentOnly(e)}AddToNamedContentOnly(t){if(n.AssertType(t,m,"Can only add Runtime.Objects to a Runtime.Container"),l(t,m).parent=this,null===t.name)return p("namedContentObj.name");this.namedContent.set(t.name,t)}ContentAtPath(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;-1==n&&(n=t.length);let i=new A;i.approximate=!1;let r=this,a=this;for(let l=e;l=0&&t.index=0||a.set(t,e);if(a.size>0){r(),t.AppendLine("-- named: --");for(let[,r]of a){n.AssertType(r,x,"Can only print out named Containers"),r.BuildStringOfHierarchy(t,e,i),t.AppendLine()}}e--,r(),t.Append("]")}}!function(t){var e;(e=t.CountFlags||(t.CountFlags={}))[e.Start=0]="Start",e[e.Visits=1]="Visits",e[e.Turns=2]="Turns",e[e.CountStartOnly=4]="CountStartOnly"}(x||(x={}));class I extends m{toString(){return"Glue"}}class k extends m{get commandType(){return this._commandType}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:k.CommandType.NotSet;super(),this._commandType=t}Copy(){return new k(this.commandType)}static EvalStart(){return new k(k.CommandType.EvalStart)}static EvalOutput(){return new k(k.CommandType.EvalOutput)}static EvalEnd(){return new k(k.CommandType.EvalEnd)}static Duplicate(){return new k(k.CommandType.Duplicate)}static PopEvaluatedValue(){return new k(k.CommandType.PopEvaluatedValue)}static PopFunction(){return new k(k.CommandType.PopFunction)}static PopTunnel(){return new k(k.CommandType.PopTunnel)}static BeginString(){return new k(k.CommandType.BeginString)}static EndString(){return new k(k.CommandType.EndString)}static NoOp(){return new k(k.CommandType.NoOp)}static ChoiceCount(){return new k(k.CommandType.ChoiceCount)}static Turns(){return new k(k.CommandType.Turns)}static TurnsSince(){return new k(k.CommandType.TurnsSince)}static ReadCount(){return new k(k.CommandType.ReadCount)}static Random(){return new k(k.CommandType.Random)}static SeedRandom(){return new k(k.CommandType.SeedRandom)}static VisitIndex(){return new k(k.CommandType.VisitIndex)}static SequenceShuffleIndex(){return new k(k.CommandType.SequenceShuffleIndex)}static StartThread(){return new k(k.CommandType.StartThread)}static Done(){return new k(k.CommandType.Done)}static End(){return new k(k.CommandType.End)}static ListFromInt(){return new k(k.CommandType.ListFromInt)}static ListRange(){return new k(k.CommandType.ListRange)}static ListRandom(){return new k(k.CommandType.ListRandom)}static BeginTag(){return new k(k.CommandType.BeginTag)}static EndTag(){return new k(k.CommandType.EndTag)}toString(){return"ControlCommand "+this.commandType.toString()}}!function(t){var e;(e=t.CommandType||(t.CommandType={}))[e.NotSet=-1]="NotSet",e[e.EvalStart=0]="EvalStart",e[e.EvalOutput=1]="EvalOutput",e[e.EvalEnd=2]="EvalEnd",e[e.Duplicate=3]="Duplicate",e[e.PopEvaluatedValue=4]="PopEvaluatedValue",e[e.PopFunction=5]="PopFunction",e[e.PopTunnel=6]="PopTunnel",e[e.BeginString=7]="BeginString",e[e.EndString=8]="EndString",e[e.NoOp=9]="NoOp",e[e.ChoiceCount=10]="ChoiceCount",e[e.Turns=11]="Turns",e[e.TurnsSince=12]="TurnsSince",e[e.ReadCount=13]="ReadCount",e[e.Random=14]="Random",e[e.SeedRandom=15]="SeedRandom",e[e.VisitIndex=16]="VisitIndex",e[e.SequenceShuffleIndex=17]="SequenceShuffleIndex",e[e.StartThread=18]="StartThread",e[e.Done=19]="Done",e[e.End=20]="End",e[e.ListFromInt=21]="ListFromInt",e[e.ListRange=22]="ListRange",e[e.ListRandom=23]="ListRandom",e[e.BeginTag=24]="BeginTag",e[e.EndTag=25]="EndTag",e[e.TOTAL_VALUES=26]="TOTAL_VALUES"}(k||(k={})),function(t){t[t.Tunnel=0]="Tunnel",t[t.Function=1]="Function",t[t.FunctionEvaluationFromGame=2]="FunctionEvaluationFromGame"}(r||(r={}));class F{constructor(){this.container=null,this.index=-1,2===arguments.length&&(this.container=arguments[0],this.index=arguments[1])}Resolve(){return this.index<0?this.container:null==this.container?null:0==this.container.content.length?this.container:this.index>=this.container.content.length?null:this.container.content[this.index]}get isNull(){return null==this.container}get path(){return this.isNull?null:this.index>=0?this.container.path.PathByAppendingComponent(new e.Component(this.index)):this.container.path}toString(){return this.container?"Ink Pointer -> "+this.container.path.toString()+" -- index "+this.index:"Ink Pointer (null)"}copy(){return new F(this.container,this.index)}static StartOf(t){return new F(t,0)}static get Null(){return new F(null,-1)}}class W extends m{get targetPath(){if(null!=this._targetPath&&this._targetPath.isRelative){let t=this.targetPointer.Resolve();t&&(this._targetPath=t.path)}return this._targetPath}set targetPath(t){this._targetPath=t,this._targetPointer=F.Null}get targetPointer(){if(this._targetPointer.isNull){let t=this.ResolvePath(this._targetPath).obj;if(null===this._targetPath)return p("this._targetPath");if(null===this._targetPath.lastComponent)return p("this._targetPath.lastComponent");if(this._targetPath.lastComponent.isIndex){if(null===t)return p("targetObj");this._targetPointer.container=t.parent instanceof x?t.parent:null,this._targetPointer.index=this._targetPath.lastComponent.index}else this._targetPointer=F.StartOf(t instanceof x?t:null)}return this._targetPointer.copy()}get targetPathString(){return null==this.targetPath?null:this.CompactPathString(this.targetPath)}set targetPathString(t){this.targetPath=null==t?null:new e(t)}get hasVariableTarget(){return null!=this.variableDivertName}constructor(t){super(),this._targetPath=null,this._targetPointer=F.Null,this.variableDivertName=null,this.pushesToStack=!1,this.stackPushType=0,this.isExternal=!1,this.externalArgs=0,this.isConditional=!1,this.pushesToStack=!1,void 0!==t&&(this.pushesToStack=!0,this.stackPushType=t)}Equals(t){let e=t;return e instanceof W&&this.hasVariableTarget==e.hasVariableTarget&&(this.hasVariableTarget?this.variableDivertName==e.variableDivertName:null===this.targetPath?p("this.targetPath"):this.targetPath.Equals(e.targetPath))}toString(){if(this.hasVariableTarget)return"Divert(variable: "+this.variableDivertName+")";if(null==this.targetPath)return"Divert(null)";{let t=new f,e=this.targetPath.toString();return t.Append("Divert"),this.isConditional&&t.Append("?"),this.pushesToStack&&(this.stackPushType==r.Function?t.Append(" function"):t.Append(" tunnel")),t.Append(" -> "),t.Append(this.targetPathString),t.Append(" ("),t.Append(e),t.Append(")"),t.toString()}}}class V extends m{constructor(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];super(),this._pathOnChoice=null,this.hasCondition=!1,this.hasStartContent=!1,this.hasChoiceOnlyContent=!1,this.isInvisibleDefault=!1,this.onceOnly=!0,this.onceOnly=t}get pathOnChoice(){if(null!=this._pathOnChoice&&this._pathOnChoice.isRelative){let t=this.choiceTarget;t&&(this._pathOnChoice=t.path)}return this._pathOnChoice}set pathOnChoice(t){this._pathOnChoice=t}get choiceTarget(){return null===this._pathOnChoice?p("ChoicePoint._pathOnChoice"):this.ResolvePath(this._pathOnChoice).container}get pathStringOnChoice(){return null===this.pathOnChoice?p("ChoicePoint.pathOnChoice"):this.CompactPathString(this.pathOnChoice)}set pathStringOnChoice(t){this.pathOnChoice=new e(t)}get flags(){let t=0;return this.hasCondition&&(t|=1),this.hasStartContent&&(t|=2),this.hasChoiceOnlyContent&&(t|=4),this.isInvisibleDefault&&(t|=8),this.onceOnly&&(t|=16),t}set flags(t){this.hasCondition=(1&t)>0,this.hasStartContent=(2&t)>0,this.hasChoiceOnlyContent=(4&t)>0,this.isInvisibleDefault=(8&t)>0,this.onceOnly=(16&t)>0}toString(){if(null===this.pathOnChoice)return p("ChoicePoint.pathOnChoice");return"Choice: -> "+this.pathOnChoice.toString()}}class L extends m{get containerForCount(){return null===this.pathForCount?null:this.ResolvePath(this.pathForCount).container}get pathStringForCount(){return null===this.pathForCount?null:this.CompactPathString(this.pathForCount)}set pathStringForCount(t){this.pathForCount=null===t?null:new e(t)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;super(),this.pathForCount=null,this.name=t}toString(){if(null!=this.name)return"var("+this.name+")";return"read_count("+this.pathStringForCount+")"}}class R extends m{constructor(t,e){super(),this.variableName=t||null,this.isNewDeclaration=!!e,this.isGlobal=!1}toString(){return"VarAssign to "+this.variableName}}class D extends m{toString(){return"Void"}}class j extends m{static CallWithName(t){return new j(t)}static CallExistsWithName(t){return this.GenerateNativeFunctionsIfNecessary(),this._nativeFunctions.get(t)}get name(){return null===this._name?p("NativeFunctionCall._name"):this._name}set name(t){this._name=t,this._isPrototype||(null===j._nativeFunctions?p("NativeFunctionCall._nativeFunctions"):this._prototype=j._nativeFunctions.get(this._name)||null)}get numberOfParameters(){return this._prototype?this._prototype.numberOfParameters:this._numberOfParameters}set numberOfParameters(t){this._numberOfParameters=t}Call(t){if(this._prototype)return this._prototype.Call(t);if(this.numberOfParameters!=t.length)throw new Error("Unexpected number of parameters");let e=!1;for(let n of t){if(n instanceof D)throw new y('Attempting to perform operation on a void value. Did you forget to "return" a value from a function you called here?');n instanceof O&&(e=!0)}if(2==t.length&&e)return this.CallBinaryListOperation(t);let n=this.CoerceValuesToSingleType(t),r=n[0].valueType;return r==i.Int||r==i.Float||r==i.String||r==i.DivertTarget||r==i.List?this.CallType(n):null}CallType(t){let e=l(t[0],b),n=e.valueType,r=e,a=t.length;if(2==a||1==a){if(null===this._operationFuncs)return p("NativeFunctionCall._operationFuncs");let s=this._operationFuncs.get(n);if(!s){const t=i[n];throw new y("Cannot perform operation "+this.name+" on "+t)}if(2==a){let e=l(t[1],b),n=s;if(null===r.value||null===e.value)return p("NativeFunctionCall.Call BinaryOp values");let i=n(r.value,e.value);return b.Create(i)}{let t=s;if(null===r.value)return p("NativeFunctionCall.Call UnaryOp value");let n=t(r.value);return this.name===j.Int?b.Create(n,i.Int):this.name===j.Float?b.Create(n,i.Float):b.Create(n,e.valueType)}}throw new Error("Unexpected number of parameters to NativeFunctionCall: "+t.length)}CallBinaryListOperation(t){if(("+"==this.name||"-"==this.name)&&t[0]instanceof O&&t[1]instanceof w)return this.CallListIncrementOperation(t);let e=l(t[0],b),n=l(t[1],b);if(!("&&"!=this.name&&"||"!=this.name||e.valueType==i.List&&n.valueType==i.List)){if(null===this._operationFuncs)return p("NativeFunctionCall._operationFuncs");let t=this._operationFuncs.get(i.Int);if(null===t)return p("NativeFunctionCall.CallBinaryListOperation op");let r=function(t){if("boolean"==typeof t)return t;throw new Error(`${t} is not a boolean`)}(t(e.isTruthy?1:0,n.isTruthy?1:0));return new _(r)}if(e.valueType==i.List&&n.valueType==i.List)return this.CallType([e,n]);throw new y("Can not call use "+this.name+" operation on "+i[e.valueType]+" and "+i[n.valueType])}CallListIncrementOperation(t){let e=l(t[0],O),n=l(t[1],w),r=new S;if(null===e.value)return p("NativeFunctionCall.CallListIncrementOperation listVal.value");for(let[t,a]of e.value){let s=g.fromSerializedKey(t);if(null===this._operationFuncs)return p("NativeFunctionCall._operationFuncs");let l=this._operationFuncs.get(i.Int);if(null===n.value)return p("NativeFunctionCall.CallListIncrementOperation intVal.value");let o=l(a,n.value),h=null;if(null===e.value.origins)return p("NativeFunctionCall.CallListIncrementOperation listVal.value.origins");for(let t of e.value.origins)if(t.name==s.originName){h=t;break}if(null!=h){let t=h.TryGetItemWithValue(o,g.Null);t.exists&&r.Add(t.result,o)}}return new O(r)}CoerceValuesToSingleType(t){let e=i.Int,n=null;for(let r of t){let t=l(r,b);t.valueType>e&&(e=t.valueType),t.valueType==i.List&&(n=s(t,O))}let r=[];if(i[e]==i[i.List])for(let e of t){let t=l(e,b);if(t.valueType==i.List)r.push(t);else{if(t.valueType!=i.Int){const e=i[t.valueType];throw new y("Cannot mix Lists and "+e+" values in this operation")}{let e=parseInt(t.valueObject);if(n=l(n,O),null===n.value)return p("NativeFunctionCall.CoerceValuesToSingleType specialCaseList.value");let i=n.value.originOfMaxItem;if(null===i)return p("NativeFunctionCall.CoerceValuesToSingleType list");let a=i.TryGetItemWithValue(e,g.Null);if(!a.exists)throw new y("Could not find List item with the value "+e+" in "+i.name);{let t=new O(a.result,e);r.push(t)}}}}else for(let n of t){let t=l(n,b).Cast(e);r.push(t)}return r}constructor(){if(super(),this._name=null,this._numberOfParameters=0,this._prototype=null,this._isPrototype=!1,this._operationFuncs=null,0===arguments.length)j.GenerateNativeFunctionsIfNecessary();else if(1===arguments.length){let t=arguments[0];j.GenerateNativeFunctionsIfNecessary(),this.name=t}else if(2===arguments.length){let t=arguments[0],e=arguments[1];this._isPrototype=!0,this.name=t,this.numberOfParameters=e}}static Identity(t){return t}static GenerateNativeFunctionsIfNecessary(){if(null==this._nativeFunctions){this._nativeFunctions=new Map,this.AddIntBinaryOp(this.Add,((t,e)=>t+e)),this.AddIntBinaryOp(this.Subtract,((t,e)=>t-e)),this.AddIntBinaryOp(this.Multiply,((t,e)=>t*e)),this.AddIntBinaryOp(this.Divide,((t,e)=>Math.floor(t/e))),this.AddIntBinaryOp(this.Mod,((t,e)=>t%e)),this.AddIntUnaryOp(this.Negate,(t=>-t)),this.AddIntBinaryOp(this.Equal,((t,e)=>t==e)),this.AddIntBinaryOp(this.Greater,((t,e)=>t>e)),this.AddIntBinaryOp(this.Less,((t,e)=>tt>=e)),this.AddIntBinaryOp(this.LessThanOrEquals,((t,e)=>t<=e)),this.AddIntBinaryOp(this.NotEquals,((t,e)=>t!=e)),this.AddIntUnaryOp(this.Not,(t=>0==t)),this.AddIntBinaryOp(this.And,((t,e)=>0!=t&&0!=e)),this.AddIntBinaryOp(this.Or,((t,e)=>0!=t||0!=e)),this.AddIntBinaryOp(this.Max,((t,e)=>Math.max(t,e))),this.AddIntBinaryOp(this.Min,((t,e)=>Math.min(t,e))),this.AddIntBinaryOp(this.Pow,((t,e)=>Math.pow(t,e))),this.AddIntUnaryOp(this.Floor,j.Identity),this.AddIntUnaryOp(this.Ceiling,j.Identity),this.AddIntUnaryOp(this.Int,j.Identity),this.AddIntUnaryOp(this.Float,(t=>t)),this.AddFloatBinaryOp(this.Add,((t,e)=>t+e)),this.AddFloatBinaryOp(this.Subtract,((t,e)=>t-e)),this.AddFloatBinaryOp(this.Multiply,((t,e)=>t*e)),this.AddFloatBinaryOp(this.Divide,((t,e)=>t/e)),this.AddFloatBinaryOp(this.Mod,((t,e)=>t%e)),this.AddFloatUnaryOp(this.Negate,(t=>-t)),this.AddFloatBinaryOp(this.Equal,((t,e)=>t==e)),this.AddFloatBinaryOp(this.Greater,((t,e)=>t>e)),this.AddFloatBinaryOp(this.Less,((t,e)=>tt>=e)),this.AddFloatBinaryOp(this.LessThanOrEquals,((t,e)=>t<=e)),this.AddFloatBinaryOp(this.NotEquals,((t,e)=>t!=e)),this.AddFloatUnaryOp(this.Not,(t=>0==t)),this.AddFloatBinaryOp(this.And,((t,e)=>0!=t&&0!=e)),this.AddFloatBinaryOp(this.Or,((t,e)=>0!=t||0!=e)),this.AddFloatBinaryOp(this.Max,((t,e)=>Math.max(t,e))),this.AddFloatBinaryOp(this.Min,((t,e)=>Math.min(t,e))),this.AddFloatBinaryOp(this.Pow,((t,e)=>Math.pow(t,e))),this.AddFloatUnaryOp(this.Floor,(t=>Math.floor(t))),this.AddFloatUnaryOp(this.Ceiling,(t=>Math.ceil(t))),this.AddFloatUnaryOp(this.Int,(t=>Math.floor(t))),this.AddFloatUnaryOp(this.Float,j.Identity),this.AddStringBinaryOp(this.Add,((t,e)=>t+e)),this.AddStringBinaryOp(this.Equal,((t,e)=>t===e)),this.AddStringBinaryOp(this.NotEquals,((t,e)=>!(t===e))),this.AddStringBinaryOp(this.Has,((t,e)=>t.includes(e))),this.AddStringBinaryOp(this.Hasnt,((t,e)=>!t.includes(e))),this.AddListBinaryOp(this.Add,((t,e)=>t.Union(e))),this.AddListBinaryOp(this.Subtract,((t,e)=>t.Without(e))),this.AddListBinaryOp(this.Has,((t,e)=>t.Contains(e))),this.AddListBinaryOp(this.Hasnt,((t,e)=>!t.Contains(e))),this.AddListBinaryOp(this.Intersect,((t,e)=>t.Intersect(e))),this.AddListBinaryOp(this.Equal,((t,e)=>t.Equals(e))),this.AddListBinaryOp(this.Greater,((t,e)=>t.GreaterThan(e))),this.AddListBinaryOp(this.Less,((t,e)=>t.LessThan(e))),this.AddListBinaryOp(this.GreaterThanOrEquals,((t,e)=>t.GreaterThanOrEquals(e))),this.AddListBinaryOp(this.LessThanOrEquals,((t,e)=>t.LessThanOrEquals(e))),this.AddListBinaryOp(this.NotEquals,((t,e)=>!t.Equals(e))),this.AddListBinaryOp(this.And,((t,e)=>t.Count>0&&e.Count>0)),this.AddListBinaryOp(this.Or,((t,e)=>t.Count>0||e.Count>0)),this.AddListUnaryOp(this.Not,(t=>0==t.Count?1:0)),this.AddListUnaryOp(this.Invert,(t=>t.inverse)),this.AddListUnaryOp(this.All,(t=>t.all)),this.AddListUnaryOp(this.ListMin,(t=>t.MinAsList())),this.AddListUnaryOp(this.ListMax,(t=>t.MaxAsList())),this.AddListUnaryOp(this.Count,(t=>t.Count)),this.AddListUnaryOp(this.ValueOfList,(t=>t.maxItem.Value));let t=(t,e)=>t.Equals(e),e=(t,e)=>!t.Equals(e);this.AddOpToNativeFunc(this.Equal,2,i.DivertTarget,t),this.AddOpToNativeFunc(this.NotEquals,2,i.DivertTarget,e)}}AddOpFuncForType(t,e){null==this._operationFuncs&&(this._operationFuncs=new Map),this._operationFuncs.set(t,e)}static AddOpToNativeFunc(t,e,n,i){if(null===this._nativeFunctions)return p("NativeFunctionCall._nativeFunctions");let r=this._nativeFunctions.get(t);r||(r=new j(t,e),this._nativeFunctions.set(t,r)),r.AddOpFuncForType(n,i)}static AddIntBinaryOp(t,e){this.AddOpToNativeFunc(t,2,i.Int,e)}static AddIntUnaryOp(t,e){this.AddOpToNativeFunc(t,1,i.Int,e)}static AddFloatBinaryOp(t,e){this.AddOpToNativeFunc(t,2,i.Float,e)}static AddFloatUnaryOp(t,e){this.AddOpToNativeFunc(t,1,i.Float,e)}static AddStringBinaryOp(t,e){this.AddOpToNativeFunc(t,2,i.String,e)}static AddListBinaryOp(t,e){this.AddOpToNativeFunc(t,2,i.List,e)}static AddListUnaryOp(t,e){this.AddOpToNativeFunc(t,1,i.List,e)}toString(){return'Native "'+this.name+'"'}}j.Add="+",j.Subtract="-",j.Divide="/",j.Multiply="*",j.Mod="%",j.Negate="_",j.Equal="==",j.Greater=">",j.Less="<",j.GreaterThanOrEquals=">=",j.LessThanOrEquals="<=",j.NotEquals="!=",j.Not="!",j.And="&&",j.Or="||",j.Min="MIN",j.Max="MAX",j.Pow="POW",j.Floor="FLOOR",j.Ceiling="CEILING",j.Int="INT",j.Float="FLOAT",j.Has="?",j.Hasnt="!?",j.Intersect="^",j.ListMin="LIST_MIN",j.ListMax="LIST_MAX",j.All="LIST_ALL",j.Count="LIST_COUNT",j.ValueOfList="LIST_VALUE",j.Invert="LIST_INVERT",j._nativeFunctions=null;class B extends m{constructor(t){super(),this.text=t.toString()||""}toString(){return"# "+this.text}}class G extends m{constructor(){super(...arguments),this.text="",this.index=0,this.threadAtGeneration=null,this.sourcePath="",this.targetPath=null,this.isInvisibleDefault=!1,this.tags=null,this.originalThreadIndex=0}get pathStringOnChoice(){return null===this.targetPath?p("Choice.targetPath"):this.targetPath.toString()}set pathStringOnChoice(t){this.targetPath=new e(t)}}class M{constructor(t,e){this._name=t||"",this._items=null,this._itemNameToValues=e||new Map}get name(){return this._name}get items(){if(null==this._items){this._items=new Map;for(let[t,e]of this._itemNameToValues){let n=new g(this.name,t);this._items.set(n.serialized(),e)}}return this._items}ValueForItem(t){if(!t.itemName)return 0;let e=this._itemNameToValues.get(t.itemName);return void 0!==e?e:0}ContainsItem(t){return!!t.itemName&&(t.originName==this.name&&this._itemNameToValues.has(t.itemName))}ContainsItemWithName(t){return this._itemNameToValues.has(t)}TryGetItemWithValue(t,e){for(let[e,n]of this._itemNameToValues)if(n==t)return{result:new g(this.name,e),exists:!0};return{result:g.Null,exists:!1}}TryGetValueForItem(t,e){if(!t.itemName)return{result:0,exists:!1};let n=this._itemNameToValues.get(t.itemName);return n?{result:n,exists:!0}:{result:0,exists:!1}}}class J{constructor(t){this._lists=new Map,this._allUnambiguousListValueCache=new Map;for(let e of t){this._lists.set(e.name,e);for(let[t,n]of e.items){let e=g.fromSerializedKey(t),i=new O(e,n);if(!e.itemName)throw new Error("item.itemName is null or undefined.");this._allUnambiguousListValueCache.set(e.itemName,i),this._allUnambiguousListValueCache.set(e.fullName,i)}}}get lists(){let t=[];for(let[,e]of this._lists)t.push(e);return t}TryListGetDefinition(t,e){if(null===t)return{result:e,exists:!1};let n=this._lists.get(t);return n?{result:n,exists:!0}:{result:e,exists:!1}}FindSingleItemListWithName(t){if(null===t)return p("name");let e=this._allUnambiguousListValueCache.get(t);return void 0!==e?e:null}}class q{static JArrayToRuntimeObjList(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.length;e&&n--;let i=[];for(let e=0;et->")),e=i.hasVariableTarget?i.variableDivertName:i.targetPathString,t.WriteObjectStart(),t.WriteProperty(n,e),i.hasVariableTarget&&t.WriteProperty("var",!0),i.isConditional&&t.WriteProperty("c",!0),i.externalArgs>0&&t.WriteIntProperty("exArgs",i.externalArgs),void t.WriteObjectEnd()}let a=s(e,V);if(a)return t.WriteObjectStart(),t.WriteProperty("*",a.pathStringOnChoice),t.WriteIntProperty("flg",a.flags),void t.WriteObjectEnd();let l=s(e,_);if(l)return void t.WriteBool(l.value);let o=s(e,w);if(o)return void t.WriteInt(o.value);let h=s(e,T);if(h)return void t.WriteFloat(h.value);let u=s(e,E);if(u)return void(u.isNewline?t.Write("\n",!1):(t.WriteStringStart(),t.WriteStringInner("^"),t.WriteStringInner(u.value),t.WriteStringEnd()));let c=s(e,O);if(c)return void this.WriteInkList(t,c);let d=s(e,P);if(d)return t.WriteObjectStart(),null===d.value?p("divTargetVal.value"):(t.WriteProperty("^->",d.value.componentsString),void t.WriteObjectEnd());let m=s(e,N);if(m)return t.WriteObjectStart(),t.WriteProperty("^var",m.value),t.WriteIntProperty("ci",m.contextIndex),void t.WriteObjectEnd();if(s(e,I))return void t.Write("<>");let f=s(e,k);if(f)return void t.Write(q._controlCommandNames[f.commandType]);let g=s(e,j);if(g){let e=g.name;return"^"==e&&(e="L^"),void t.Write(e)}let S=s(e,L);if(S){t.WriteObjectStart();let e=S.pathStringForCount;return null!=e?t.WriteProperty("CNT?",e):t.WriteProperty("VAR?",S.name),void t.WriteObjectEnd()}let y=s(e,R);if(y){t.WriteObjectStart();let e=y.isGlobal?"VAR=":"temp=";return t.WriteProperty(e,y.variableName),y.isNewDeclaration||t.WriteProperty("re",!0),void t.WriteObjectEnd()}if(s(e,D))return void t.Write("void");let v=s(e,B);if(v)return t.WriteObjectStart(),t.WriteProperty("#",v.text),void t.WriteObjectEnd();let C=s(e,G);if(!C)throw new Error("Failed to convert runtime object to Json token: "+e);this.WriteChoice(t,C)}static JObjectToDictionaryRuntimeObjs(t){let e=new Map;for(let n in t)if(t.hasOwnProperty(n)){let i=this.JTokenToRuntimeObject(t[n]);if(null===i)return p("inkObject");e.set(n,i)}return e}static JObjectToIntDictionary(t){let e=new Map;for(let n in t)t.hasOwnProperty(n)&&e.set(n,parseInt(t[n]));return e}static JTokenToRuntimeObject(t){if("number"==typeof t&&!isNaN(t)||"boolean"==typeof t)return b.Create(t);if("string"==typeof t){let e=t.toString(),n=e[0];if("^"==n)return new E(e.substring(1));if("\n"==n&&1==e.length)return new E("\n");if("<>"==e)return new I;for(let t=0;t->"==e)return k.PopTunnel();if("~ret"==e)return k.PopFunction();if("void"==e)return new D}if("object"==typeof t&&!Array.isArray(t)){let n,i=t;if(i["^->"])return n=i["^->"],new P(new e(n.toString()));if(i["^var"]){n=i["^var"];let t=new N(n.toString());return"ci"in i&&(n=i.ci,t.contextIndex=parseInt(n)),t}let a=!1,s=!1,l=r.Function,o=!1;if((n=i["->"])?a=!0:(n=i["f()"])?(a=!0,s=!0,l=r.Function):(n=i["->t->"])?(a=!0,s=!0,l=r.Tunnel):(n=i["x()"])&&(a=!0,o=!0,s=!1,l=r.Function),a){let t=new W;t.pushesToStack=s,t.stackPushType=l,t.isExternal=o;let e=n.toString();return(n=i.var)?t.variableDivertName=e:t.targetPathString=e,t.isConditional=!!i.c,o&&(n=i.exArgs)&&(t.externalArgs=parseInt(n)),t}if(n=i["*"]){let t=new V;return t.pathStringOnChoice=n.toString(),(n=i.flg)&&(t.flags=parseInt(n)),t}if(n=i["VAR?"])return new L(n.toString());if(n=i["CNT?"]){let t=new L;return t.pathStringForCount=n.toString(),t}let h=!1,u=!1;if((n=i["VAR="])?(h=!0,u=!0):(n=i["temp="])&&(h=!0,u=!1),h){let t=n.toString(),e=!i.re,r=new R(t,e);return r.isGlobal=u,r}if(void 0!==i["#"])return n=i["#"],new B(n.toString());if(n=i.list){let t=n,e=new S;if(n=i.origins){let t=n;e.SetInitialOriginNames(t)}for(let n in t)if(t.hasOwnProperty(n)){let i=t[n],r=new g(n),a=parseInt(i);e.Add(r,a)}return new O(e)}if(null!=i.originalChoicePath)return this.JObjectToChoice(i)}if(Array.isArray(t))return this.JArrayToContainer(t);if(null==t)return null;throw new Error("Failed to convert token to runtime object: "+this.toJson(t,["parent"]))}static toJson(t,e,n){return JSON.stringify(t,((t,n)=>(null==e?void 0:e.some((e=>e===t)))?void 0:n),n)}static WriteRuntimeContainer(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t.WriteArrayStart(),null===e)return p("container");for(let n of e.content)this.WriteRuntimeObject(t,n);let i=e.namedOnlyContent,r=e.countFlags,a=null!=e.name&&!n,l=null!=i||r>0||a;if(l&&t.WriteObjectStart(),null!=i)for(let[e,n]of i){let i=e,r=s(n,x);t.WritePropertyStart(i),this.WriteRuntimeContainer(t,r,!0),t.WritePropertyEnd()}r>0&&t.WriteIntProperty("#f",r),a&&t.WriteProperty("#n",e.name),l?t.WriteObjectEnd():t.WriteNull(),t.WriteArrayEnd()}static JArrayToContainer(t){let e=new x;e.content=this.JArrayToRuntimeObjList(t,!0);let n=t[t.length-1];if(null!=n){let t=new Map;for(let i in n)if("#f"==i)e.countFlags=parseInt(n[i]);else if("#n"==i)e.name=n[i].toString();else{let e=this.JTokenToRuntimeObject(n[i]),r=s(e,x);r&&(r.name=i),t.set(i,e)}e.namedOnlyContent=t}return e}static JObjectToChoice(t){let e=new G;return e.text=t.text.toString(),e.index=parseInt(t.index),e.sourcePath=t.originalChoicePath.toString(),e.originalThreadIndex=parseInt(t.originalThreadIndex),e.pathStringOnChoice=t.targetPath.toString(),t.tags&&(e.tags=t.tags),e}static WriteChoice(t,e){t.WriteObjectStart(),t.WriteProperty("text",e.text),t.WriteIntProperty("index",e.index),t.WriteProperty("originalChoicePath",e.sourcePath),t.WriteIntProperty("originalThreadIndex",e.originalThreadIndex),t.WriteProperty("targetPath",e.pathStringOnChoice),e.tags&&t.WriteProperty("tags",(t=>{t.WriteArrayStart();for(const n of e.tags)t.WriteStringStart(),t.WriteStringInner(n),t.WriteStringEnd();t.WriteArrayEnd()})),t.WriteObjectEnd()}static WriteInkList(t,e){let n=e.value;if(null===n)return p("rawList");t.WriteObjectStart(),t.WritePropertyStart("list"),t.WriteObjectStart();for(let[e,i]of n){let n=g.fromSerializedKey(e),r=i;if(null===n.itemName)return p("item.itemName");t.WritePropertyNameStart(),t.WritePropertyNameInner(n.originName?n.originName:"?"),t.WritePropertyNameInner("."),t.WritePropertyNameInner(n.itemName),t.WritePropertyNameEnd(),t.Write(r),t.WritePropertyEnd()}if(t.WriteObjectEnd(),t.WritePropertyEnd(),0==n.Count&&null!=n.originNames&&n.originNames.length>0){t.WritePropertyStart("origins"),t.WriteArrayStart();for(let e of n.originNames)t.Write(e);t.WriteArrayEnd(),t.WritePropertyEnd()}t.WriteObjectEnd()}static ListDefinitionsToJToken(t){let e={};for(let n of t.lists){let t={};for(let[e,i]of n.items){let n=g.fromSerializedKey(e);if(null===n.itemName)return p("item.itemName");t[n.itemName]=i}e[n.name]=t}return e}static JTokenToListDefinitions(t){let e=t,n=[];for(let t in e)if(e.hasOwnProperty(t)){let i=t.toString(),r=e[t],a=new Map;for(let n in r)if(e.hasOwnProperty(t)){let t=r[n];a.set(n,parseInt(t))}let s=new M(i,a);n.push(s)}return new J(n)}}q._controlCommandNames=(()=>{let t=[];t[k.CommandType.EvalStart]="ev",t[k.CommandType.EvalOutput]="out",t[k.CommandType.EvalEnd]="/ev",t[k.CommandType.Duplicate]="du",t[k.CommandType.PopEvaluatedValue]="pop",t[k.CommandType.PopFunction]="~ret",t[k.CommandType.PopTunnel]="->->",t[k.CommandType.BeginString]="str",t[k.CommandType.EndString]="/str",t[k.CommandType.NoOp]="nop",t[k.CommandType.ChoiceCount]="choiceCnt",t[k.CommandType.Turns]="turn",t[k.CommandType.TurnsSince]="turns",t[k.CommandType.ReadCount]="readc",t[k.CommandType.Random]="rnd",t[k.CommandType.SeedRandom]="srnd",t[k.CommandType.VisitIndex]="visit",t[k.CommandType.SequenceShuffleIndex]="seq",t[k.CommandType.StartThread]="thread",t[k.CommandType.Done]="done",t[k.CommandType.End]="end",t[k.CommandType.ListFromInt]="listInt",t[k.CommandType.ListRange]="range",t[k.CommandType.ListRandom]="lrnd",t[k.CommandType.BeginTag]="#",t[k.CommandType.EndTag]="/#";for(let e=0;e1}constructor(){if(this._threadCounter=0,this._startOfRoot=F.Null,arguments[0]instanceof Z){let t=arguments[0];this._startOfRoot=F.StartOf(t.rootContentContainer),this.Reset()}else{let t=arguments[0];this._threads=[];for(let e of t._threads)this._threads.push(e.Copy());this._threadCounter=t._threadCounter,this._startOfRoot=t._startOfRoot.copy()}}Reset(){this._threads=[],this._threads.push(new U.Thread),this._threads[0].callstack.push(new U.Element(r.Tunnel,this._startOfRoot))}SetJsonToken(t,e){this._threads.length=0;let n=t.threads;for(let t of n){let n=t,i=new U.Thread(n,e);this._threads.push(i)}this._threadCounter=parseInt(t.threadCounter),this._startOfRoot=F.StartOf(e.rootContentContainer)}WriteJson(t){t.WriteObject((t=>{t.WritePropertyStart("threads"),t.WriteArrayStart();for(let e of this._threads)e.WriteJson(t);t.WriteArrayEnd(),t.WritePropertyEnd(),t.WritePropertyStart("threadCounter"),t.WriteInt(this._threadCounter),t.WritePropertyEnd()}))}PushThread(){let t=this.currentThread.Copy();this._threadCounter++,t.threadIndex=this._threadCounter,this._threads.push(t)}ForkThread(){let t=this.currentThread.Copy();return this._threadCounter++,t.threadIndex=this._threadCounter,t}PopThread(){if(!this.canPopThread)throw new Error("Can't pop thread");this._threads.splice(this._threads.indexOf(this.currentThread),1)}get canPopThread(){return this._threads.length>1&&!this.elementIsEvaluateFromGame}get elementIsEvaluateFromGame(){return this.currentElement.type==r.FunctionEvaluationFromGame}Push(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=new U.Element(t,this.currentElement.currentPointer,!1);i.evaluationStackHeightWhenPushed=e,i.functionStartInOutputStream=n,this.callStack.push(i)}CanPop(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!!this.canPop&&(null==t||this.currentElement.type==t)}Pop(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!this.CanPop(t))throw new Error("Mismatched push/pop in Callstack");this.callStack.pop()}GetTemporaryVariableWithName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;-1==e&&(e=this.currentElementIndex+1);let n=v(this.callStack[e-1].temporaryVariables,t,null);return n.exists?n.result:null}SetTemporaryVariable(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1;-1==i&&(i=this.currentElementIndex+1);let r=this.callStack[i-1];if(!n&&!r.temporaryVariables.get(t))throw new Error("Could not find temporary variable to set: "+t);let a=v(r.temporaryVariables,t,null);a.exists&&O.RetainListOriginsForAssignment(a.result,e),r.temporaryVariables.set(t,e)}ContextForVariableNamed(t){return this.currentElement.temporaryVariables.get(t)?this.currentElementIndex+1:0}ThreadWithIndex(t){let e=this._threads.filter((e=>{if(e.threadIndex==t)return e}));return e.length>0?e[0]:null}get callStack(){return this.currentThread.callstack}get callStackTrace(){let t=new f;for(let e=0;e")}}}return t.toString()}}!function(t){class n{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.evaluationStackHeightWhenPushed=0,this.functionStartInOutputStream=0,this.currentPointer=e.copy(),this.inExpressionEvaluation=n,this.temporaryVariables=new Map,this.type=t}Copy(){let t=new n(this.type,this.currentPointer,this.inExpressionEvaluation);return t.temporaryVariables=new Map(this.temporaryVariables),t.evaluationStackHeightWhenPushed=this.evaluationStackHeightWhenPushed,t.functionStartInOutputStream=this.functionStartInOutputStream,t}}t.Element=n;class i{constructor(){if(this.threadIndex=0,this.previousPointer=F.Null,this.callstack=[],arguments[0]&&arguments[1]){let t=arguments[0],i=arguments[1];this.threadIndex=parseInt(t.threadIndex);let r=t.callstack;for(let t of r){let r,a=t,s=parseInt(a.type),l=F.Null,o=a.cPath;if(void 0!==o){r=o.toString();let t=i.ContentAtPath(new e(r));if(l.container=t.container,l.index=parseInt(a.idx),null==t.obj)throw new Error("When loading state, internal story location couldn't be found: "+r+". Has the story changed since this save data was created?");if(t.approximate){if(null===l.container)return p("pointer.container");i.Warning("When loading state, exact internal story location couldn't be found: '"+r+"', so it was approximated to '"+l.container.path.toString()+"' to recover. Has the story changed since this save data was created?")}}let h=!!a.exp,u=new n(s,l,h),c=a.temp;void 0!==c?u.temporaryVariables=q.JObjectToDictionaryRuntimeObjs(c):u.temporaryVariables.clear(),this.callstack.push(u)}let a=t.previousContentObject;if(void 0!==a){let t=new e(a.toString());this.previousPointer=i.PointerAtPath(t)}}}Copy(){let t=new i;t.threadIndex=this.threadIndex;for(let e of this.callstack)t.callstack.push(e.Copy());return t.previousPointer=this.previousPointer.copy(),t}WriteJson(t){t.WriteObjectStart(),t.WritePropertyStart("callstack"),t.WriteArrayStart();for(let e of this.callstack){if(t.WriteObjectStart(),!e.currentPointer.isNull){if(null===e.currentPointer.container)return p("el.currentPointer.container");t.WriteProperty("cPath",e.currentPointer.container.path.componentsString),t.WriteIntProperty("idx",e.currentPointer.index)}t.WriteProperty("exp",e.inExpressionEvaluation),t.WriteIntProperty("type",e.type),e.temporaryVariables.size>0&&(t.WritePropertyStart("temp"),q.WriteDictionaryRuntimeObjs(t,e.temporaryVariables),t.WritePropertyEnd()),t.WriteObjectEnd()}if(t.WriteArrayEnd(),t.WritePropertyEnd(),t.WriteIntProperty("threadIndex",this.threadIndex),!this.previousPointer.isNull){let e=this.previousPointer.Resolve();if(null===e)return p("this.previousPointer.Resolve()");t.WriteProperty("previousContentObject",e.path.toString())}t.WriteObjectEnd()}}t.Thread=i}(U||(U={}));class K extends class{}{variableChangedEvent(t,e){for(let n of this.variableChangedEventCallbacks)n(t,e)}get batchObservingVariableChanges(){return this._batchObservingVariableChanges}set batchObservingVariableChanges(t){if(this._batchObservingVariableChanges=t,t)this._changedVariablesForBatchObs=new Set;else if(null!=this._changedVariablesForBatchObs){for(let t of this._changedVariablesForBatchObs){let e=this._globalVariables.get(t);e?this.variableChangedEvent(t,e):p("currentValue")}this._changedVariablesForBatchObs=null}}get callStack(){return this._callStack}set callStack(t){this._callStack=t}$(t,e){if(void 0===e){let e=null;return null!==this.patch&&(e=this.patch.TryGetGlobal(t,null),e.exists)?e.result.valueObject:(e=this._globalVariables.get(t),void 0===e&&(e=this._defaultGlobalVariables.get(t)),void 0!==e?e.valueObject:null)}{if(void 0===this._defaultGlobalVariables.get(t))throw new y("Cannot assign to a variable ("+t+") that hasn't been declared in the story");let n=b.Create(e);if(null==n)throw null==e?new Error("Cannot pass null to VariableState"):new Error("Invalid value passed to VariableState: "+e.toString());this.SetGlobal(t,n)}}constructor(t,e){super(),this.variableChangedEventCallbacks=[],this.patch=null,this._batchObservingVariableChanges=!1,this._defaultGlobalVariables=new Map,this._changedVariablesForBatchObs=new Set,this._globalVariables=new Map,this._callStack=t,this._listDefsOrigin=e;try{return new Proxy(this,{get:(t,e)=>e in t?t[e]:t.$(e),set:(t,e,n)=>(e in t?t[e]=n:t.$(e,n),!0)})}catch(t){}}ApplyPatch(){if(null===this.patch)return p("this.patch");for(let[t,e]of this.patch.globals)this._globalVariables.set(t,e);if(null!==this._changedVariablesForBatchObs)for(let t of this.patch.changedVariables)this._changedVariablesForBatchObs.add(t);this.patch=null}SetJsonToken(t){this._globalVariables.clear();for(let[e,n]of this._defaultGlobalVariables){let i=t[e];if(void 0!==i){let t=q.JTokenToRuntimeObject(i);if(null===t)return p("tokenInkObject");this._globalVariables.set(e,t)}else this._globalVariables.set(e,n)}}WriteJson(t){t.WriteObjectStart();for(let[e,n]of this._globalVariables){let i=e,r=n;if(K.dontSaveDefaultValues&&this._defaultGlobalVariables.has(i)){let t=this._defaultGlobalVariables.get(i);if(this.RuntimeObjectsEqual(r,t))continue}t.WritePropertyStart(i),q.WriteRuntimeObject(t,r),t.WritePropertyEnd()}t.WriteObjectEnd()}RuntimeObjectsEqual(t,e){if(null===t)return p("obj1");if(null===e)return p("obj2");if(t.constructor!==e.constructor)return!1;let n=s(t,_);if(null!==n)return n.value===l(e,_).value;let i=s(t,w);if(null!==i)return i.value===l(e,w).value;let r=s(t,T);if(null!==r)return r.value===l(e,T).value;let a=s(t,b),o=s(e,b);if(null!==a&&null!==o)return u(a.valueObject)&&u(o.valueObject)?a.valueObject.Equals(o.valueObject):a.valueObject===o.valueObject;throw new Error("FastRoughDefinitelyEquals: Unsupported runtime object type: "+t.constructor.name)}GetVariableWithName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=this.GetRawVariableWithName(t,e),i=s(n,N);return null!==i&&(n=this.ValueAtVariablePointer(i)),n}TryGetDefaultVariableValue(t){let e=v(this._defaultGlobalVariables,t,null);return e.exists?e.result:null}GlobalVariableExistsWithName(t){return this._globalVariables.has(t)||null!==this._defaultGlobalVariables&&this._defaultGlobalVariables.has(t)}GetRawVariableWithName(t,e){let n=null;if(0==e||-1==e){let e=null;if(null!==this.patch&&(e=this.patch.TryGetGlobal(t,null),e.exists))return e.result;if(e=v(this._globalVariables,t,null),e.exists)return e.result;if(null!==this._defaultGlobalVariables&&(e=v(this._defaultGlobalVariables,t,null),e.exists))return e.result;if(null===this._listDefsOrigin)return p("VariablesState._listDefsOrigin");let n=this._listDefsOrigin.FindSingleItemListWithName(t);if(n)return n}return n=this._callStack.GetTemporaryVariableWithName(t,e),n}ValueAtVariablePointer(t){return this.GetVariableWithName(t.variableName,t.contextIndex)}Assign(t,e){let n=t.variableName;if(null===n)return p("name");let i=-1,r=!1;if(r=t.isNewDeclaration?t.isGlobal:this.GlobalVariableExistsWithName(n),t.isNewDeclaration){let t=s(e,N);if(null!==t){e=this.ResolveVariablePointer(t)}}else{let t=null;do{t=s(this.GetRawVariableWithName(n,i),N),null!=t&&(n=t.variableName,i=t.contextIndex,r=0==i)}while(null!=t)}r?this.SetGlobal(n,e):this._callStack.SetTemporaryVariable(n,e,t.isNewDeclaration,i)}SnapshotDefaultGlobals(){this._defaultGlobalVariables=new Map(this._globalVariables)}RetainListOriginsForAssignment(t,e){let n=l(t,O),i=l(e,O);n.value&&i.value&&0==i.value.Count&&i.value.SetInitialOriginNames(n.value.originNames)}SetGlobal(t,e){let n=null;if(null===this.patch&&(n=v(this._globalVariables,t,null)),null!==this.patch&&(n=this.patch.TryGetGlobal(t,null),n.exists||(n=v(this._globalVariables,t,null))),O.RetainListOriginsForAssignment(n.result,e),null===t)return p("variableName");if(null!==this.patch?this.patch.SetGlobal(t,e):this._globalVariables.set(t,e),null!==this.variableChangedEvent&&null!==n&&e!==n.result)if(this.batchObservingVariableChanges){if(null===this._changedVariablesForBatchObs)return p("this._changedVariablesForBatchObs");null!==this.patch?this.patch.AddChangedVariable(t):null!==this._changedVariablesForBatchObs&&this._changedVariablesForBatchObs.add(t)}else this.variableChangedEvent(t,e)}ResolveVariablePointer(t){let e=t.contextIndex;-1==e&&(e=this.GetContextIndexOfVariableNamed(t.variableName));let n=s(this.GetRawVariableWithName(t.variableName,e),N);return null!=n?n:new N(t.variableName,e)}GetContextIndexOfVariableNamed(t){return this.GlobalVariableExistsWithName(t)?0:this._callStack.currentElementIndex}ObserveVariableChange(t){this.variableChangedEventCallbacks.push(t)}}K.dontSaveDefaultValues=!0;class z{constructor(t){this.seed=t%2147483647,this.seed<=0&&(this.seed+=2147483646)}next(){return this.seed=48271*this.seed%2147483647}nextFloat(){return(this.next()-1)/2147483646}}class H{get globals(){return this._globals}get changedVariables(){return this._changedVariables}get visitCounts(){return this._visitCounts}get turnIndices(){return this._turnIndices}constructor(){if(this._changedVariables=new Set,this._visitCounts=new Map,this._turnIndices=new Map,1===arguments.length&&null!==arguments[0]){let t=arguments[0];this._globals=new Map(t._globals),this._changedVariables=new Set(t._changedVariables),this._visitCounts=new Map(t._visitCounts),this._turnIndices=new Map(t._turnIndices)}else this._globals=new Map,this._changedVariables=new Set,this._visitCounts=new Map,this._turnIndices=new Map}TryGetGlobal(t,e){return null!==t&&this._globals.has(t)?{result:this._globals.get(t),exists:!0}:{result:e,exists:!1}}SetGlobal(t,e){this._globals.set(t,e)}AddChangedVariable(t){return this._changedVariables.add(t)}TryGetVisitCount(t,e){return this._visitCounts.has(t)?{result:this._visitCounts.get(t),exists:!0}:{result:e,exists:!1}}SetVisitCount(t,e){this._visitCounts.set(t,e)}SetTurnIndex(t,e){this._turnIndices.set(t,e)}TryGetTurnIndex(t,e){return this._turnIndices.has(t)?{result:this._turnIndices.get(t),exists:!0}:{result:e,exists:!1}}}class ${static TextToDictionary(t){return new $.Reader(t).ToDictionary()}static TextToArray(t){return new $.Reader(t).ToArray()}}!function(t){t.Reader=class{constructor(t){this._rootObject=JSON.parse(t)}ToDictionary(){return this._rootObject}ToArray(){return this._rootObject}};class e{constructor(){this._currentPropertyName=null,this._currentString=null,this._stateStack=[],this._collectionStack=[],this._propertyNameStack=[],this._jsonObject=null}WriteObject(t){this.WriteObjectStart(),t(this),this.WriteObjectEnd()}WriteObjectStart(){this.StartNewObject(!0);let e={};if(this.state===t.Writer.State.Property){this.Assert(null!==this.currentCollection),this.Assert(null!==this.currentPropertyName);let t=this._propertyNameStack.pop();this.currentCollection[t]=e,this._collectionStack.push(e)}else this.state===t.Writer.State.Array?(this.Assert(null!==this.currentCollection),this.currentCollection.push(e),this._collectionStack.push(e)):(this.Assert(this.state===t.Writer.State.None),this._jsonObject=e,this._collectionStack.push(e));this._stateStack.push(new t.Writer.StateElement(t.Writer.State.Object))}WriteObjectEnd(){this.Assert(this.state===t.Writer.State.Object),this._collectionStack.pop(),this._stateStack.pop()}WriteProperty(t,e){if(this.WritePropertyStart(t),arguments[1]instanceof Function){(0,arguments[1])(this)}else{let t=arguments[1];this.Write(t)}this.WritePropertyEnd()}WriteIntProperty(t,e){this.WritePropertyStart(t),this.WriteInt(e),this.WritePropertyEnd()}WriteFloatProperty(t,e){this.WritePropertyStart(t),this.WriteFloat(e),this.WritePropertyEnd()}WritePropertyStart(e){this.Assert(this.state===t.Writer.State.Object),this._propertyNameStack.push(e),this.IncrementChildCount(),this._stateStack.push(new t.Writer.StateElement(t.Writer.State.Property))}WritePropertyEnd(){this.Assert(this.state===t.Writer.State.Property),this.Assert(1===this.childCount),this._stateStack.pop()}WritePropertyNameStart(){this.Assert(this.state===t.Writer.State.Object),this.IncrementChildCount(),this._currentPropertyName="",this._stateStack.push(new t.Writer.StateElement(t.Writer.State.Property)),this._stateStack.push(new t.Writer.StateElement(t.Writer.State.PropertyName))}WritePropertyNameEnd(){this.Assert(this.state===t.Writer.State.PropertyName),this.Assert(null!==this._currentPropertyName),this._propertyNameStack.push(this._currentPropertyName),this._currentPropertyName=null,this._stateStack.pop()}WritePropertyNameInner(e){this.Assert(this.state===t.Writer.State.PropertyName),this.Assert(null!==this._currentPropertyName),this._currentPropertyName+=e}WriteArrayStart(){this.StartNewObject(!0);let e=[];if(this.state===t.Writer.State.Property){this.Assert(null!==this.currentCollection),this.Assert(null!==this.currentPropertyName);let t=this._propertyNameStack.pop();this.currentCollection[t]=e,this._collectionStack.push(e)}else this.state===t.Writer.State.Array?(this.Assert(null!==this.currentCollection),this.currentCollection.push(e),this._collectionStack.push(e)):(this.Assert(this.state===t.Writer.State.None),this._jsonObject=e,this._collectionStack.push(e));this._stateStack.push(new t.Writer.StateElement(t.Writer.State.Array))}WriteArrayEnd(){this.Assert(this.state===t.Writer.State.Array),this._collectionStack.pop(),this._stateStack.pop()}Write(t){null!==t?(this.StartNewObject(!1),this._addToCurrentObject(t)):console.error("Warning: trying to write a null value")}WriteBool(t){null!==t&&(this.StartNewObject(!1),this._addToCurrentObject(t))}WriteInt(t){null!==t&&(this.StartNewObject(!1),this._addToCurrentObject(Math.floor(t)))}WriteFloat(t){null!==t&&(this.StartNewObject(!1),t==Number.POSITIVE_INFINITY?this._addToCurrentObject(34e37):t==Number.NEGATIVE_INFINITY?this._addToCurrentObject(-34e37):isNaN(t)?this._addToCurrentObject(0):this._addToCurrentObject(t))}WriteNull(){this.StartNewObject(!1),this._addToCurrentObject(null)}WriteStringStart(){this.StartNewObject(!1),this._currentString="",this._stateStack.push(new t.Writer.StateElement(t.Writer.State.String))}WriteStringEnd(){this.Assert(this.state==t.Writer.State.String),this._stateStack.pop(),this._addToCurrentObject(this._currentString),this._currentString=null}WriteStringInner(e){this.Assert(this.state===t.Writer.State.String),null!==e?this._currentString+=e:console.error("Warning: trying to write a null string")}toString(){return null===this._jsonObject?"":JSON.stringify(this._jsonObject)}StartNewObject(e){e?this.Assert(this.state===t.Writer.State.None||this.state===t.Writer.State.Property||this.state===t.Writer.State.Array):this.Assert(this.state===t.Writer.State.Property||this.state===t.Writer.State.Array),this.state===t.Writer.State.Property&&this.Assert(0===this.childCount),this.state!==t.Writer.State.Array&&this.state!==t.Writer.State.Property||this.IncrementChildCount()}get state(){return this._stateStack.length>0?this._stateStack[this._stateStack.length-1].type:t.Writer.State.None}get childCount(){return this._stateStack.length>0?this._stateStack[this._stateStack.length-1].childCount:0}get currentCollection(){return this._collectionStack.length>0?this._collectionStack[this._collectionStack.length-1]:null}get currentPropertyName(){return this._propertyNameStack.length>0?this._propertyNameStack[this._propertyNameStack.length-1]:null}IncrementChildCount(){this.Assert(this._stateStack.length>0);let t=this._stateStack.pop();t.childCount++,this._stateStack.push(t)}Assert(t){if(!t)throw Error("Assert failed while writing JSON")}_addToCurrentObject(e){this.Assert(null!==this.currentCollection),this.state===t.Writer.State.Array?(this.Assert(Array.isArray(this.currentCollection)),this.currentCollection.push(e)):this.state===t.Writer.State.Property&&(this.Assert(!Array.isArray(this.currentCollection)),this.Assert(null!==this.currentPropertyName),this.currentCollection[this.currentPropertyName]=e,this._propertyNameStack.pop())}}t.Writer=e,function(e){var n;(n=e.State||(e.State={}))[n.None=0]="None",n[n.Object=1]="Object",n[n.Array=2]="Array",n[n.Property=3]="Property",n[n.PropertyName=4]="PropertyName",n[n.String=5]="String";e.StateElement=class{constructor(e){this.type=t.Writer.State.None,this.childCount=0,this.type=e}}}(e=t.Writer||(t.Writer={}))}($||($={}));class X{constructor(){let t=arguments[0],e=arguments[1];if(this.name=t,this.callStack=new U(e),arguments[2]){let t=arguments[2];this.callStack.SetJsonToken(t.callstack,e),this.outputStream=q.JArrayToRuntimeObjList(t.outputStream),this.currentChoices=q.JArrayToRuntimeObjList(t.currentChoices);let n=t.choiceThreads;void 0!==n&&this.LoadFlowChoiceThreads(n,e)}else this.outputStream=[],this.currentChoices=[]}WriteJson(t){t.WriteObjectStart(),t.WriteProperty("callstack",(t=>this.callStack.WriteJson(t))),t.WriteProperty("outputStream",(t=>q.WriteListRuntimeObjs(t,this.outputStream)));let e=!1;for(let n of this.currentChoices){if(null===n.threadAtGeneration)return p("c.threadAtGeneration");n.originalThreadIndex=n.threadAtGeneration.threadIndex,null===this.callStack.ThreadWithIndex(n.originalThreadIndex)&&(e||(e=!0,t.WritePropertyStart("choiceThreads"),t.WriteObjectStart()),t.WritePropertyStart(n.originalThreadIndex),n.threadAtGeneration.WriteJson(t),t.WritePropertyEnd())}e&&(t.WriteObjectEnd(),t.WritePropertyEnd()),t.WriteProperty("currentChoices",(t=>{t.WriteArrayStart();for(let e of this.currentChoices)q.WriteChoice(t,e);t.WriteArrayEnd()})),t.WriteObjectEnd()}LoadFlowChoiceThreads(t,e){for(let n of this.currentChoices){let i=this.callStack.ThreadWithIndex(n.originalThreadIndex);if(null!==i)n.threadAtGeneration=i.Copy();else{let i=t[`${n.originalThreadIndex}`];n.threadAtGeneration=new U.Thread(i,e)}}}}class Y{ToJson(){let t=new $.Writer;return this.WriteJson(t),t.toString()}toJson(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.ToJson(t)}LoadJson(t){let e=$.TextToDictionary(t);this.LoadJsonObj(e),null!==this.onDidLoadState&&this.onDidLoadState()}VisitCountAtPathString(t){let n;if(null!==this._patch){let i=this.story.ContentAtPath(new e(t)).container;if(null===i)throw new Error("Content at path not found: "+t);if(n=this._patch.TryGetVisitCount(i,0),n.exists)return n.result}return n=v(this._visitCounts,t,null),n.exists?n.result:0}VisitCountForContainer(t){if(null===t)return p("container");if(!t.visitsShouldBeCounted)return this.story.Error("Read count for target ("+t.name+" - on "+t.debugMetadata+") unknown. The story may need to be compiled with countAllVisits flag (-c)."),0;if(null!==this._patch){let e=this._patch.TryGetVisitCount(t,0);if(e.exists)return e.result}let e=t.path.toString(),n=v(this._visitCounts,e,null);return n.exists?n.result:0}IncrementVisitCountForContainer(t){if(null!==this._patch){let e=this.VisitCountForContainer(t);return e++,void this._patch.SetVisitCount(t,e)}let e=t.path.toString(),n=v(this._visitCounts,e,null);n.exists?this._visitCounts.set(e,n.result+1):this._visitCounts.set(e,1)}RecordTurnIndexVisitToContainer(t){if(null!==this._patch)return void this._patch.SetTurnIndex(t,this.currentTurnIndex);let e=t.path.toString();this._turnIndices.set(e,this.currentTurnIndex)}TurnsSinceForContainer(t){if(t.turnIndexShouldBeCounted||this.story.Error("TURNS_SINCE() for target ("+t.name+" - on "+t.debugMetadata+") unknown. The story may need to be compiled with countAllVisits flag (-c)."),null!==this._patch){let e=this._patch.TryGetTurnIndex(t,0);if(e.exists)return this.currentTurnIndex-e.result}let e=t.path.toString(),n=v(this._turnIndices,e,0);return n.exists?this.currentTurnIndex-n.result:-1}get callstackDepth(){return this.callStack.depth}get outputStream(){return this._currentFlow.outputStream}get currentChoices(){return this.canContinue?[]:this._currentFlow.currentChoices}get generatedChoices(){return this._currentFlow.currentChoices}get currentErrors(){return this._currentErrors}get currentWarnings(){return this._currentWarnings}get variablesState(){return this._variablesState}set variablesState(t){this._variablesState=t}get callStack(){return this._currentFlow.callStack}get evaluationStack(){return this._evaluationStack}get currentTurnIndex(){return this._currentTurnIndex}set currentTurnIndex(t){this._currentTurnIndex=t}get currentPathString(){let t=this.currentPointer;return t.isNull?null:null===t.path?p("pointer.path"):t.path.toString()}get currentPointer(){return this.callStack.currentElement.currentPointer.copy()}set currentPointer(t){this.callStack.currentElement.currentPointer=t.copy()}get previousPointer(){return this.callStack.currentThread.previousPointer.copy()}set previousPointer(t){this.callStack.currentThread.previousPointer=t.copy()}get canContinue(){return!this.currentPointer.isNull&&!this.hasError}get hasError(){return null!=this.currentErrors&&this.currentErrors.length>0}get hasWarning(){return null!=this.currentWarnings&&this.currentWarnings.length>0}get currentText(){if(this._outputStreamTextDirty){let t=new f,e=!1;for(let n of this.outputStream){let i=s(n,E);if(e||null===i){let t=s(n,k);null!==t&&(t.commandType==k.CommandType.BeginTag?e=!0:t.commandType==k.CommandType.EndTag&&(e=!1))}else t.Append(i.value)}this._currentText=this.CleanOutputWhitespace(t.toString()),this._outputStreamTextDirty=!1}return this._currentText}CleanOutputWhitespace(t){let e=new f,n=-1,i=0;for(let r=0;r0&&n!=i&&e.Append(" "),n=-1),"\n"==a&&(i=r+1),s||e.Append(a)}return e.toString()}get currentTags(){if(this._outputStreamTagsDirty){this._currentTags=[];let t=!1,e=new f;for(let n of this.outputStream){let i=s(n,k);if(null!=i){if(i.commandType==k.CommandType.BeginTag){if(t&&e.Length>0){let t=this.CleanOutputWhitespace(e.toString());this._currentTags.push(t),e.Clear()}t=!0}else if(i.commandType==k.CommandType.EndTag){if(e.Length>0){let t=this.CleanOutputWhitespace(e.toString());this._currentTags.push(t),e.Clear()}t=!1}}else if(t){let t=s(n,E);null!==t&&e.Append(t.value)}else{let t=s(n,B);null!=t&&null!=t.text&&t.text.length>0&&this._currentTags.push(t.text)}}if(e.Length>0){let t=this.CleanOutputWhitespace(e.toString());this._currentTags.push(t),e.Clear()}this._outputStreamTagsDirty=!1}return this._currentTags}get currentFlowName(){return this._currentFlow.name}get currentFlowIsDefaultFlow(){return this._currentFlow.name==this.kDefaultFlowName}get aliveFlowNames(){if(this._aliveFlowNamesDirty){if(this._aliveFlowNames=[],null!=this._namedFlows)for(let t of this._namedFlows.keys())t!=this.kDefaultFlowName&&this._aliveFlowNames.push(t);this._aliveFlowNamesDirty=!1}return this._aliveFlowNames}get inExpressionEvaluation(){return this.callStack.currentElement.inExpressionEvaluation}set inExpressionEvaluation(t){this.callStack.currentElement.inExpressionEvaluation=t}constructor(t){this.kInkSaveStateVersion=10,this.kMinCompatibleLoadVersion=8,this.onDidLoadState=null,this._currentErrors=null,this._currentWarnings=null,this.divertedPointer=F.Null,this._currentTurnIndex=0,this.storySeed=0,this.previousRandom=0,this.didSafeExit=!1,this._currentText=null,this._currentTags=null,this._outputStreamTextDirty=!0,this._outputStreamTagsDirty=!0,this._patch=null,this._aliveFlowNames=null,this._namedFlows=null,this.kDefaultFlowName="DEFAULT_FLOW",this._aliveFlowNamesDirty=!0,this.story=t,this._currentFlow=new X(this.kDefaultFlowName,t),this.OutputStreamDirty(),this._aliveFlowNamesDirty=!0,this._evaluationStack=[],this._variablesState=new K(this.callStack,t.listDefinitions),this._visitCounts=new Map,this._turnIndices=new Map,this.currentTurnIndex=-1;let e=(new Date).getTime();this.storySeed=new z(e).next()%100,this.previousRandom=0,this.GoToStart()}GoToStart(){this.callStack.currentElement.currentPointer=F.StartOf(this.story.mainContentContainer)}SwitchFlow_Internal(t){if(null===t)throw new Error("Must pass a non-null string to Story.SwitchFlow");if(null===this._namedFlows&&(this._namedFlows=new Map,this._namedFlows.set(this.kDefaultFlowName,this._currentFlow)),t===this._currentFlow.name)return;let e,n=v(this._namedFlows,t,null);n.exists?e=n.result:(e=new X(t,this.story),this._namedFlows.set(t,e),this._aliveFlowNamesDirty=!0),this._currentFlow=e,this.variablesState.callStack=this._currentFlow.callStack,this.OutputStreamDirty()}SwitchToDefaultFlow_Internal(){null!==this._namedFlows&&this.SwitchFlow_Internal(this.kDefaultFlowName)}RemoveFlow_Internal(t){if(null===t)throw new Error("Must pass a non-null string to Story.DestroyFlow");if(t===this.kDefaultFlowName)throw new Error("Cannot destroy default flow");if(this._currentFlow.name===t&&this.SwitchToDefaultFlow_Internal(),null===this._namedFlows)return p("this._namedFlows");this._namedFlows.delete(t),this._aliveFlowNamesDirty=!0}CopyAndStartPatching(){let t=new Y(this.story);if(t._patch=new H(this._patch),t._currentFlow.name=this._currentFlow.name,t._currentFlow.callStack=new U(this._currentFlow.callStack),t._currentFlow.currentChoices.push(...this._currentFlow.currentChoices),t._currentFlow.outputStream.push(...this._currentFlow.outputStream),t.OutputStreamDirty(),null!==this._namedFlows){t._namedFlows=new Map;for(let[e,n]of this._namedFlows)t._namedFlows.set(e,n),t._aliveFlowNamesDirty=!0;t._namedFlows.set(this._currentFlow.name,t._currentFlow)}return this.hasError&&(t._currentErrors=[],t._currentErrors.push(...this.currentErrors||[])),this.hasWarning&&(t._currentWarnings=[],t._currentWarnings.push(...this.currentWarnings||[])),t.variablesState=this.variablesState,t.variablesState.callStack=t.callStack,t.variablesState.patch=t._patch,t.evaluationStack.push(...this.evaluationStack),this.divertedPointer.isNull||(t.divertedPointer=this.divertedPointer.copy()),t.previousPointer=this.previousPointer.copy(),t._visitCounts=this._visitCounts,t._turnIndices=this._turnIndices,t.currentTurnIndex=this.currentTurnIndex,t.storySeed=this.storySeed,t.previousRandom=this.previousRandom,t.didSafeExit=this.didSafeExit,t}RestoreAfterPatch(){this.variablesState.callStack=this.callStack,this.variablesState.patch=this._patch}ApplyAnyPatch(){if(null!==this._patch){this.variablesState.ApplyPatch();for(let[t,e]of this._patch.visitCounts)this.ApplyCountChanges(t,e,!0);for(let[t,e]of this._patch.turnIndices)this.ApplyCountChanges(t,e,!1);this._patch=null}}ApplyCountChanges(t,e,n){(n?this._visitCounts:this._turnIndices).set(t.path.toString(),e)}WriteJson(t){if(t.WriteObjectStart(),t.WritePropertyStart("flows"),t.WriteObjectStart(),null!==this._namedFlows)for(let[e,n]of this._namedFlows)t.WriteProperty(e,(t=>n.WriteJson(t)));else t.WriteProperty(this._currentFlow.name,(t=>this._currentFlow.WriteJson(t)));if(t.WriteObjectEnd(),t.WritePropertyEnd(),t.WriteProperty("currentFlowName",this._currentFlow.name),t.WriteProperty("variablesState",(t=>this.variablesState.WriteJson(t))),t.WriteProperty("evalStack",(t=>q.WriteListRuntimeObjs(t,this.evaluationStack))),!this.divertedPointer.isNull){if(null===this.divertedPointer.path)return p("divertedPointer");t.WriteProperty("currentDivertTarget",this.divertedPointer.path.componentsString)}t.WriteProperty("visitCounts",(t=>q.WriteIntDictionary(t,this._visitCounts))),t.WriteProperty("turnIndices",(t=>q.WriteIntDictionary(t,this._turnIndices))),t.WriteIntProperty("turnIdx",this.currentTurnIndex),t.WriteIntProperty("storySeed",this.storySeed),t.WriteIntProperty("previousRandom",this.previousRandom),t.WriteIntProperty("inkSaveVersion",this.kInkSaveStateVersion),t.WriteIntProperty("inkFormatVersion",Z.inkVersionCurrent),t.WriteObjectEnd()}LoadJsonObj(t){let n=t,i=n.inkSaveVersion;if(null==i)throw new Error("ink save format incorrect, can't load.");if(parseInt(i)1){let t=n.currentFlowName;this._currentFlow=this._namedFlows.get(t)}}else{this._namedFlows=null,this._currentFlow.name=this.kDefaultFlowName,this._currentFlow.callStack.SetJsonToken(n.callstackThreads,this.story),this._currentFlow.outputStream=q.JArrayToRuntimeObjList(n.outputStream),this._currentFlow.currentChoices=q.JArrayToRuntimeObjList(n.currentChoices);let t=n.choiceThreads;this._currentFlow.LoadFlowChoiceThreads(t,this.story)}this.OutputStreamDirty(),this._aliveFlowNamesDirty=!0,this.variablesState.SetJsonToken(n.variablesState),this.variablesState.callStack=this._currentFlow.callStack,this._evaluationStack=q.JArrayToRuntimeObjList(n.evalStack);let a=n.currentDivertTarget;if(null!=a){let t=new e(a.toString());this.divertedPointer=this.story.PointerAtPath(t)}this._visitCounts=q.JObjectToIntDictionary(n.visitCounts),this._turnIndices=q.JObjectToIntDictionary(n.turnIndices),this.currentTurnIndex=parseInt(n.turnIdx),this.storySeed=parseInt(n.storySeed),this.previousRandom=parseInt(n.previousRandom)}ResetErrors(){this._currentErrors=null,this._currentWarnings=null}ResetOutput(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.outputStream.length=0,null!==t&&this.outputStream.push(...t),this.OutputStreamDirty()}PushToOutputStream(t){let e=s(t,E);if(null!==e){let t=this.TrySplittingHeadTailWhitespace(e);if(null!==t){for(let e of t)this.PushToOutputStreamIndividual(e);return void this.OutputStreamDirty()}}this.PushToOutputStreamIndividual(t),this.OutputStreamDirty()}PopFromOutputStream(t){this.outputStream.splice(this.outputStream.length-t,t),this.OutputStreamDirty()}TrySplittingHeadTailWhitespace(t){let e=t.value;if(null===e)return p("single.value");let n=-1,i=-1;for(let t=0;t=0;t--){let n=e[t];if("\n"!=n){if(" "==n||"\t"==n)continue;break}-1==r&&(r=t),a=t}if(-1==n&&-1==r)return null;let s=[],l=0,o=e.length;if(-1!=n){if(n>0){let t=new E(e.substring(0,n));s.push(t)}s.push(new E("\n")),l=i+1}if(-1!=r&&(o=a),o>l){let t=e.substring(l,o);s.push(new E(t))}if(-1!=r&&a>i&&(s.push(new E("\n")),r=0;e--){let n=this.outputStream[e],i=n instanceof k?n:null;if(null!=(n instanceof I?n:null)){a=e;break}if(null!=i&&i.commandType==k.CommandType.BeginString){e>=t&&(t=-1);break}}let s=-1;if(s=-1!=a&&-1!=t?Math.min(t,a):-1!=a?a:t,-1!=s){if(n.isNewline)i=!1;else if(n.isNonWhitespace&&(a>-1&&this.RemoveExistingGlue(),t>-1)){let t=this.callStack.elements;for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type!=r.Function)break;n.functionStartInOutputStream=-1}}}else n.isNewline&&(!this.outputStreamEndsInNewline&&this.outputStreamContainsContent||(i=!1))}if(i){if(null===t)return p("obj");this.outputStream.push(t),this.OutputStreamDirty()}}TrimNewlinesFromOutputStream(){let t=-1,e=this.outputStream.length-1;for(;e>=0;){let n=this.outputStream[e],i=s(n,k),r=s(n,E);if(null!=i||null!=r&&r.isNonWhitespace)break;null!=r&&r.isNewline&&(t=e),e--}if(t>=0)for(e=t;e=0;t--){let e=this.outputStream[t];if(e instanceof I)this.outputStream.splice(t,1);else if(e instanceof k)break}this.OutputStreamDirty()}get outputStreamEndsInNewline(){if(this.outputStream.length>0)for(let t=this.outputStream.length-1;t>=0;t--){if(this.outputStream[t]instanceof k)break;let e=this.outputStream[t];if(e instanceof E){if(e.isNewline)return!0;if(e.isNonWhitespace)break}}return!1}get outputStreamContainsContent(){for(let t of this.outputStream)if(t instanceof E)return!0;return!1}get inStringEvaluation(){for(let t=this.outputStream.length-1;t>=0;t--){let e=s(this.outputStream[t],k);if(e instanceof k&&e.commandType==k.CommandType.BeginString)return!0}return!1}PushEvaluationStack(t){let e=s(t,O);if(e){let t=e.value;if(null===t)return p("rawList");if(null!=t.originNames){t.origins||(t.origins=[]),t.origins.length=0;for(let e of t.originNames){if(null===this.story.listDefinitions)return p("StoryState.story.listDefinitions");let n=this.story.listDefinitions.TryListGetDefinition(e,null);if(null===n.result)return p("StoryState def.result");t.origins.indexOf(n.result)<0&&t.origins.push(n.result)}}}if(null===t)return p("obj");this.evaluationStack.push(t)}PopEvaluationStack(t){if(void 0===t){return h(this.evaluationStack.pop())}if(t>this.evaluationStack.length)throw new Error("trying to pop too many objects");return h(this.evaluationStack.splice(this.evaluationStack.length-t,t))}PeekEvaluationStack(){return this.evaluationStack[this.evaluationStack.length-1]}ForceEnd(){this.callStack.Reset(),this._currentFlow.currentChoices.length=0,this.currentPointer=F.Null,this.previousPointer=F.Null,this.didSafeExit=!0}TrimWhitespaceFromFunctionEnd(){n.Assert(this.callStack.currentElement.type==r.Function);let t=this.callStack.currentElement.functionStartInOutputStream;-1==t&&(t=0);for(let e=this.outputStream.length-1;e>=t;e--){let t=this.outputStream[e],n=s(t,E),i=s(t,k);if(null!=n){if(i)break;if(!n.isNewline&&!n.isInlineWhitespace)break;this.outputStream.splice(e,1),this.OutputStreamDirty()}}}PopCallStack(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.callStack.currentElement.type==r.Function&&this.TrimWhitespaceFromFunctionEnd(),this.callStack.Pop(t)}SetChosenPath(t,e){this._currentFlow.currentChoices.length=0;let n=this.story.PointerAtPath(t);n.isNull||-1!=n.index||(n.index=0),this.currentPointer=n,e&&this.currentTurnIndex++}StartFunctionEvaluationFromGame(t,e){this.callStack.Push(r.FunctionEvaluationFromGame,this.evaluationStack.length),this.callStack.currentElement.currentPointer=F.StartOf(t),this.PassArgumentsToEvaluationStack(e)}PassArgumentsToEvaluationStack(t){if(null!==t)for(let e=0;et;){let t=this.PopEvaluationStack();null===e&&(e=t)}if(this.PopCallStack(r.FunctionEvaluationFromGame),e){if(e instanceof D)return null;let t=l(e,b);return t.valueType==i.DivertTarget?t.valueObject.toString():t.valueObject}return null}AddError(t,e){e?(null==this._currentWarnings&&(this._currentWarnings=[]),this._currentWarnings.push(t)):(null==this._currentErrors&&(this._currentErrors=[]),this._currentErrors.push(t))}OutputStreamDirty(){this._outputStreamTextDirty=!0,this._outputStreamTagsDirty=!0}}class Q{constructor(){this.startTime=void 0}get ElapsedMilliseconds(){return void 0===this.startTime?0:(new Date).getTime()-this.startTime}Start(){this.startTime=(new Date).getTime()}Stop(){this.startTime=void 0}}!function(t){t[t.Author=0]="Author",t[t.Warning=1]="Warning",t[t.Error=2]="Error"}(a||(a={})),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&t>-9007199254740992&&t<9007199254740992&&Math.floor(t)===t});class Z extends m{get currentChoices(){let t=[];if(null===this._state)return p("this._state");for(let e of this._state.currentChoices)e.isInvisibleDefault||(e.index=t.length,t.push(e));return t}get currentText(){return this.IfAsyncWeCant("call currentText since it's a work in progress"),this.state.currentText}get currentTags(){return this.IfAsyncWeCant("call currentTags since it's a work in progress"),this.state.currentTags}get currentErrors(){return this.state.currentErrors}get currentWarnings(){return this.state.currentWarnings}get currentFlowName(){return this.state.currentFlowName}get currentFlowIsDefaultFlow(){return this.state.currentFlowIsDefaultFlow}get aliveFlowNames(){return this.state.aliveFlowNames}get hasError(){return this.state.hasError}get hasWarning(){return this.state.hasWarning}get variablesState(){return this.state.variablesState}get listDefinitions(){return this._listDefinitions}get state(){return this._state}StartProfiling(){}EndProfiling(){}constructor(){let t;super(),this.inkVersionMinimumCompatible=18,this.onError=null,this.onDidContinue=null,this.onMakeChoice=null,this.onEvaluateFunction=null,this.onCompleteEvaluateFunction=null,this.onChoosePathString=null,this._prevContainers=[],this.allowExternalFunctionFallbacks=!1,this._listDefinitions=null,this._variableObservers=null,this._hasValidatedExternals=!1,this._temporaryEvaluationContainer=null,this._asyncContinueActive=!1,this._stateSnapshotAtLastNewline=null,this._sawLookaheadUnsafeFunctionAfterNewline=!1,this._recursiveContinueCount=0,this._asyncSaving=!1,this._profiler=null;let e=null,n=null;if(arguments[0]instanceof x)t=arguments[0],void 0!==arguments[1]&&(e=arguments[1]),this._mainContentContainer=t;else if("string"==typeof arguments[0]){let t=arguments[0];n=$.TextToDictionary(t)}else n=arguments[0];if(null!=e&&(this._listDefinitions=new J(e)),this._externals=new Map,null!==n){let t=n,e=t.inkVersion;if(null==e)throw new Error("ink version number not found. Are you sure it's a valid .ink.json file?");let i=parseInt(e);if(i>Z.inkVersionCurrent)throw new Error("Version of ink used to build story was newer than the current version of the engine");if(iq.WriteRuntimeContainer(t,this._mainContentContainer))),null!=this._listDefinitions){t.WritePropertyStart("listDefs"),t.WriteObjectStart();for(let e of this._listDefinitions.lists){t.WritePropertyStart(e.name),t.WriteObjectStart();for(let[n,i]of e.items){let e=g.fromSerializedKey(n),r=i;t.WriteIntProperty(e.itemName,r)}t.WriteObjectEnd(),t.WritePropertyEnd()}t.WriteObjectEnd(),t.WritePropertyEnd()}if(t.WriteObjectEnd(),e)return t.toString()}ResetState(){this.IfAsyncWeCant("ResetState"),this._state=new Y(this),this._state.variablesState.ObserveVariableChange(this.VariableStateDidChangeEvent.bind(this)),this.ResetGlobals()}ResetErrors(){if(null===this._state)return p("this._state");this._state.ResetErrors()}ResetCallstack(){if(this.IfAsyncWeCant("ResetCallstack"),null===this._state)return p("this._state");this._state.ForceEnd()}ResetGlobals(){if(this._mainContentContainer.namedContent.get("global decl")){let t=this.state.currentPointer.copy();this.ChoosePath(new e("global decl"),!1),this.ContinueInternal(),this.state.currentPointer=t}this.state.variablesState.SnapshotDefaultGlobals()}SwitchFlow(t){if(this.IfAsyncWeCant("switch flow"),this._asyncSaving)throw new Error("Story is already in background saving mode, can't switch flow to "+t);this.state.SwitchFlow_Internal(t)}RemoveFlow(t){this.state.RemoveFlow_Internal(t)}SwitchToDefaultFlow(){this.state.SwitchToDefaultFlow_Internal()}Continue(){return this.ContinueAsync(0),this.currentText}get canContinue(){return this.state.canContinue}get asyncContinueComplete(){return!this._asyncContinueActive}ContinueAsync(t){this._hasValidatedExternals||this.ValidateExternalBindings(),this.ContinueInternal(t)}ContinueInternal(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;null!=this._profiler&&this._profiler.PreContinue();let e=t>0;if(this._recursiveContinueCount++,!this._asyncContinueActive){if(this._asyncContinueActive=e,!this.canContinue)throw new Error("Can't continue - should check canContinue before calling Continue");this._state.didSafeExit=!1,this._state.ResetOutput(),1==this._recursiveContinueCount&&(this._state.variablesState.batchObservingVariableChanges=!0)}let n=new Q;n.Start();let i=!1;this._sawLookaheadUnsafeFunctionAfterNewline=!1;do{try{i=this.ContinueSingleStep()}catch(t){if(!(t instanceof y))throw t;this.AddError(t.message,void 0,t.useEndLineNumber);break}if(i)break;if(this._asyncContinueActive&&n.ElapsedMilliseconds>t)break}while(this.canContinue);if(n.Stop(),!i&&this.canContinue||(null!==this._stateSnapshotAtLastNewline&&this.RestoreStateSnapshot(),this.canContinue||(this.state.callStack.canPopThread&&this.AddError("Thread available to pop, threads should always be flat by the end of evaluation?"),0!=this.state.generatedChoices.length||this.state.didSafeExit||null!=this._temporaryEvaluationContainer||(this.state.callStack.CanPop(r.Tunnel)?this.AddError("unexpectedly reached end of content. Do you need a '->->' to return from a tunnel?"):this.state.callStack.CanPop(r.Function)?this.AddError("unexpectedly reached end of content. Do you need a '~ return'?"):this.state.callStack.canPop?this.AddError("unexpectedly reached end of content for unknown reason. Please debug compiler!"):this.AddError("ran out of content. Do you need a '-> DONE' or '-> END'?"))),this.state.didSafeExit=!1,this._sawLookaheadUnsafeFunctionAfterNewline=!1,1==this._recursiveContinueCount&&(this._state.variablesState.batchObservingVariableChanges=!1),this._asyncContinueActive=!1,null!==this.onDidContinue&&this.onDidContinue()),this._recursiveContinueCount--,null!=this._profiler&&this._profiler.PostContinue(),this.state.hasError||this.state.hasWarning){if(null===this.onError){let t=new f;throw t.Append("Ink had "),this.state.hasError&&(t.Append(`${this.state.currentErrors.length}`),t.Append(1==this.state.currentErrors.length?" error":"errors"),this.state.hasWarning&&t.Append(" and ")),this.state.hasWarning&&(t.Append(`${this.state.currentWarnings.length}`),t.Append(1==this.state.currentWarnings.length?" warning":"warnings"),this.state.hasWarning&&t.Append(" and ")),t.Append(". It is strongly suggested that you assign an error handler to story.onError. The first issue was: "),t.Append(this.state.hasError?this.state.currentErrors[0]:this.state.currentWarnings[0]),new y(t.toString())}if(this.state.hasError)for(let t of this.state.currentErrors)this.onError(t,a.Error);if(this.state.hasWarning)for(let t of this.state.currentWarnings)this.onError(t,a.Warning);this.ResetErrors()}}ContinueSingleStep(){if(null!=this._profiler&&this._profiler.PreStep(),this.Step(),null!=this._profiler&&this._profiler.PostStep(),this.canContinue||this.state.callStack.elementIsEvaluateFromGame||this.TryFollowDefaultInvisibleChoice(),null!=this._profiler&&this._profiler.PreSnapshot(),!this.state.inStringEvaluation){if(null!==this._stateSnapshotAtLastNewline){if(null===this._stateSnapshotAtLastNewline.currentTags)return p("this._stateAtLastNewline.currentTags");if(null===this.state.currentTags)return p("this.state.currentTags");let t=this.CalculateNewlineOutputStateChange(this._stateSnapshotAtLastNewline.currentText,this.state.currentText,this._stateSnapshotAtLastNewline.currentTags.length,this.state.currentTags.length);if(t==Z.OutputStateChange.ExtendedBeyondNewline||this._sawLookaheadUnsafeFunctionAfterNewline)return this.RestoreStateSnapshot(),!0;t==Z.OutputStateChange.NewlineRemoved&&this.DiscardSnapshot()}this.state.outputStreamEndsInNewline&&(this.canContinue?null==this._stateSnapshotAtLastNewline&&this.StateSnapshot():this.DiscardSnapshot())}return null!=this._profiler&&this._profiler.PostSnapshot(),!1}CalculateNewlineOutputStateChange(t,e,n,i){if(null===t)return p("prevText");if(null===e)return p("currText");let r=e.length>=t.length&&t.length>0&&"\n"==e.charAt(t.length-1);if(n==i&&t.length==e.length&&r)return Z.OutputStateChange.NoChange;if(!r)return Z.OutputStateChange.NewlineRemoved;if(i>n)return Z.OutputStateChange.ExtendedBeyondNewline;for(let n=t.length;n0?this.Error("Failed to find content at path '"+t+"', and no approximation of it was possible."):i.approximate&&this.Warning("Failed to find content at path '"+t+"', so it was approximated to: '"+i.obj.path+"'."),e)}StateSnapshot(){this._stateSnapshotAtLastNewline=this._state,this._state=this._state.CopyAndStartPatching()}RestoreStateSnapshot(){null===this._stateSnapshotAtLastNewline&&p("_stateSnapshotAtLastNewline"),this._stateSnapshotAtLastNewline.RestoreAfterPatch(),this._state=this._stateSnapshotAtLastNewline,this._stateSnapshotAtLastNewline=null,this._asyncSaving||this._state.ApplyAnyPatch()}DiscardSnapshot(){this._asyncSaving||this._state.ApplyAnyPatch(),this._stateSnapshotAtLastNewline=null}CopyStateForBackgroundThreadSave(){if(this.IfAsyncWeCant("start saving on a background thread"),this._asyncSaving)throw new Error("Story is already in background saving mode, can't call CopyStateForBackgroundThreadSave again!");let t=this._state;return this._state=this._state.CopyAndStartPatching(),this._asyncSaving=!0,t}BackgroundSaveComplete(){null===this._stateSnapshotAtLastNewline&&this._state.ApplyAnyPatch(),this._asyncSaving=!1}Step(){let t=!0,e=this.state.currentPointer.copy();if(e.isNull)return;let n=s(e.Resolve(),x);for(;n&&(this.VisitContainer(n,!0),0!=n.content.length);)e=F.StartOf(n),n=s(e.Resolve(),x);this.state.currentPointer=e.copy(),null!=this._profiler&&this._profiler.Step(this.state.callStack);let i=e.Resolve(),r=this.PerformLogicAndFlowControl(i);if(this.state.currentPointer.isNull)return;r&&(t=!1);let a=s(i,V);if(a){let e=this.ProcessChoice(a);e&&this.state.generatedChoices.push(e),i=null,t=!1}if(i instanceof x&&(t=!1),t){let t=s(i,N);if(t&&-1==t.contextIndex){let e=this.state.callStack.ContextForVariableNamed(t.variableName);i=new N(t.variableName,e)}this.state.inExpressionEvaluation?this.state.PushEvaluationStack(i):this.state.PushToOutputStream(i)}this.NextContent();let l=s(i,k);l&&l.commandType==k.CommandType.StartThread&&this.state.callStack.PushThread()}VisitContainer(t,e){t.countingAtStartOnly&&!e||(t.visitsShouldBeCounted&&this.state.IncrementVisitCountForContainer(t),t.turnIndexShouldBeCounted&&this.state.RecordTurnIndexVisitToContainer(t))}VisitChangedContainersDueToDivert(){let t=this.state.previousPointer.copy(),e=this.state.currentPointer.copy();if(e.isNull||-1==e.index)return;if(this._prevContainers.length=0,!t.isNull){let e=s(t.Resolve(),x)||s(t.container,x);for(;e;)this._prevContainers.push(e),e=s(e.parent,x)}let n=e.Resolve();if(null==n)return;let i=s(n.parent,x),r=!0;for(;i&&(this._prevContainers.indexOf(i)<0||i.countingAtStartOnly);){let t=i.content.length>0&&n==i.content[0]&&r;t||(r=!1),this.VisitContainer(i,t),n=i,i=s(i.parent,x)}}PopChoiceStringAndTags(t){let e=l(this.state.PopEvaluationStack(),E);for(;this.state.evaluationStack.length>0&&null!=s(this.state.PeekEvaluationStack(),B);){let e=s(this.state.PopEvaluationStack(),B);e&&t.push(e.text)}return e.value}ProcessChoice(t){let e=!0;if(t.hasCondition){let t=this.state.PopEvaluationStack();this.IsTruthy(t)||(e=!1)}let n="",i="",r=[];if(t.hasChoiceOnlyContent&&(i=this.PopChoiceStringAndTags(r)||""),t.hasStartContent&&(n=this.PopChoiceStringAndTags(r)||""),t.onceOnly){this.state.VisitCountForContainer(t.choiceTarget)>0&&(e=!1)}if(!e)return null;let a=new G;return a.targetPath=t.pathOnChoice,a.sourcePath=t.path.toString(),a.isInvisibleDefault=t.isInvisibleDefault,a.threadAtGeneration=this.state.callStack.ForkThread(),a.tags=r.reverse(),a.text=(n+i).replace(/^[ \t]+|[ \t]+$/g,""),a}IsTruthy(t){if(t instanceof b){let e=t;if(e instanceof P){let t=e;return this.Error("Shouldn't use a divert target (to "+t.targetPath+") as a conditional value. Did you intend a function call 'likeThis()' or a read count check 'likeThis'? (no arrows)"),!1}return e.isTruthy}return!1}PerformLogicAndFlowControl(t){if(null==t)return!1;if(t instanceof W){let e=t;if(e.isConditional){let t=this.state.PopEvaluationStack();if(!this.IsTruthy(t))return!0}if(e.hasVariableTarget){let t=e.variableDivertName,n=this.state.variablesState.GetVariableWithName(t);if(null==n)this.Error("Tried to divert using a target from a variable that could not be found ("+t+")");else if(!(n instanceof P)){let e=s(n,w),i="Tried to divert to a target from a variable, but the variable ("+t+") didn't contain a divert target, it ";e instanceof w&&0==e.value?i+="was empty/null (the value 0).":i+="contained '"+n+"'.",this.Error(i)}let i=l(n,P);this.state.divertedPointer=this.PointerAtPath(i.targetPath)}else{if(e.isExternal)return this.CallExternalFunction(e.targetPathString,e.externalArgs),!0;this.state.divertedPointer=e.targetPointer.copy()}return e.pushesToStack&&this.state.callStack.Push(e.stackPushType,void 0,this.state.outputStream.length),this.state.divertedPointer.isNull&&!e.isExternal&&(e&&e.debugMetadata&&null!=e.debugMetadata.sourceName?this.Error("Divert target doesn't exist: "+e.debugMetadata.sourceName):this.Error("Divert resolution failed: "+e)),!0}if(t instanceof k){let e=t;switch(e.commandType){case k.CommandType.EvalStart:this.Assert(!1===this.state.inExpressionEvaluation,"Already in expression evaluation?"),this.state.inExpressionEvaluation=!0;break;case k.CommandType.EvalEnd:this.Assert(!0===this.state.inExpressionEvaluation,"Not in expression evaluation mode"),this.state.inExpressionEvaluation=!1;break;case k.CommandType.EvalOutput:if(this.state.evaluationStack.length>0){let t=this.state.PopEvaluationStack();if(!(t instanceof D)){let e=new E(t.toString());this.state.PushToOutputStream(e)}}break;case k.CommandType.NoOp:break;case k.CommandType.Duplicate:this.state.PushEvaluationStack(this.state.PeekEvaluationStack());break;case k.CommandType.PopEvaluatedValue:this.state.PopEvaluationStack();break;case k.CommandType.PopFunction:case k.CommandType.PopTunnel:let t=e.commandType==k.CommandType.PopFunction?r.Function:r.Tunnel,n=null;if(t==r.Tunnel){let t=this.state.PopEvaluationStack();n=s(t,P),null===n&&this.Assert(t instanceof D,"Expected void if ->-> doesn't override target")}if(this.state.TryExitFunctionEvaluationFromGame())break;if(this.state.callStack.currentElement.type==t&&this.state.callStack.canPop)this.state.PopCallStack(),n&&(this.state.divertedPointer=this.PointerAtPath(n.targetPath));else{let e=new Map;e.set(r.Function,"function return statement (~ return)"),e.set(r.Tunnel,"tunnel onwards statement (->->)");let n=e.get(this.state.callStack.currentElement.type);this.state.callStack.canPop||(n="end of flow (-> END or choice)");let i="Found "+e.get(t)+", when expected "+n;this.Error(i)}break;case k.CommandType.BeginString:this.state.PushToOutputStream(e),this.Assert(!0===this.state.inExpressionEvaluation,"Expected to be in an expression when evaluating a string"),this.state.inExpressionEvaluation=!1;break;case k.CommandType.BeginTag:this.state.PushToOutputStream(e);break;case k.CommandType.EndTag:if(this.state.inStringEvaluation){let t=[],e=0;for(let n=this.state.outputStream.length-1;n>=0;--n){let i=this.state.outputStream[n];e++;let r=s(i,k);if(null!=r){if(r.commandType==k.CommandType.BeginTag)break;this.Error("Unexpected ControlCommand while extracting tag from choice");break}i instanceof E&&t.push(i)}this.state.PopFromOutputStream(e);let n=new f;for(let e of t.reverse())n.Append(e.toString());let i=new B(this.state.CleanOutputWhitespace(n.toString()));this.state.PushEvaluationStack(i)}else this.state.PushToOutputStream(e);break;case k.CommandType.EndString:{let t=[],e=[],n=0;for(let i=this.state.outputStream.length-1;i>=0;--i){let r=this.state.outputStream[i];n++;let a=s(r,k);if(a&&a.commandType==k.CommandType.BeginString)break;r instanceof B&&e.push(r),r instanceof E&&t.push(r)}this.state.PopFromOutputStream(n);for(let t of e)this.state.PushToOutputStream(t);t=t.reverse();let i=new f;for(let e of t)i.Append(e.toString());this.state.inExpressionEvaluation=!0,this.state.PushEvaluationStack(new E(i.toString()));break}case k.CommandType.ChoiceCount:let i=this.state.generatedChoices.length;this.state.PushEvaluationStack(new w(i));break;case k.CommandType.Turns:this.state.PushEvaluationStack(new w(this.state.currentTurnIndex+1));break;case k.CommandType.TurnsSince:case k.CommandType.ReadCount:let a=this.state.PopEvaluationStack();if(!(a instanceof P)){let t="";a instanceof w&&(t=". Did you accidentally pass a read count ('knot_name') instead of a target ('-> knot_name')?"),this.Error("TURNS_SINCE / READ_COUNT expected a divert target (knot, stitch, label name), but saw "+a+t);break}let o,h=l(a,P),u=s(this.ContentAtPath(h.targetPath).correctObj,x);null!=u?o=e.commandType==k.CommandType.TurnsSince?this.state.TurnsSinceForContainer(u):this.state.VisitCountForContainer(u):(o=e.commandType==k.CommandType.TurnsSince?-1:0,this.Warning("Failed to find container for "+e.toString()+" lookup at "+h.targetPath.toString())),this.state.PushEvaluationStack(new w(o));break;case k.CommandType.Random:{let t=s(this.state.PopEvaluationStack(),w),e=s(this.state.PopEvaluationStack(),w);if(null==e||e instanceof w==!1)return this.Error("Invalid value for minimum parameter of RANDOM(min, max)");if(null==t||t instanceof w==!1)return this.Error("Invalid value for maximum parameter of RANDOM(min, max)");if(null===t.value)return p("maxInt.value");if(null===e.value)return p("minInt.value");let n=t.value-e.value+1;(!isFinite(n)||n>Number.MAX_SAFE_INTEGER)&&(n=Number.MAX_SAFE_INTEGER,this.Error("RANDOM was called with a range that exceeds the size that ink numbers can use.")),n<=0&&this.Error("RANDOM was called with minimum as "+e.value+" and maximum as "+t.value+". The maximum must be larger");let i=this.state.storySeed+this.state.previousRandom,r=new z(i).next(),a=r%n+e.value;this.state.PushEvaluationStack(new w(a)),this.state.previousRandom=r;break}case k.CommandType.SeedRandom:let c=s(this.state.PopEvaluationStack(),w);if(null==c||c instanceof w==!1)return this.Error("Invalid value passed to SEED_RANDOM");if(null===c.value)return p("minInt.value");this.state.storySeed=c.value,this.state.previousRandom=0,this.state.PushEvaluationStack(new D);break;case k.CommandType.VisitIndex:let d=this.state.VisitCountForContainer(this.state.currentPointer.container)-1;this.state.PushEvaluationStack(new w(d));break;case k.CommandType.SequenceShuffleIndex:let m=this.NextSequenceShuffleIndex();this.state.PushEvaluationStack(new w(m));break;case k.CommandType.StartThread:break;case k.CommandType.Done:this.state.callStack.canPopThread?this.state.callStack.PopThread():(this.state.didSafeExit=!0,this.state.currentPointer=F.Null);break;case k.CommandType.End:this.state.ForceEnd();break;case k.CommandType.ListFromInt:let v=s(this.state.PopEvaluationStack(),w),C=l(this.state.PopEvaluationStack(),E);if(null===v)throw new y("Passed non-integer when creating a list element from a numerical value.");let _=null;if(null===this.listDefinitions)return p("this.listDefinitions");let T=this.listDefinitions.TryListGetDefinition(C.value,null);if(!T.exists)throw new y("Failed to find LIST called "+C.value);{if(null===v.value)return p("minInt.value");let t=T.result.TryGetItemWithValue(v.value,g.Null);t.exists&&(_=new O(t.result,v.value))}null==_&&(_=new O),this.state.PushEvaluationStack(_);break;case k.CommandType.ListRange:let N=s(this.state.PopEvaluationStack(),b),A=s(this.state.PopEvaluationStack(),b),I=s(this.state.PopEvaluationStack(),O);if(null===I||null===A||null===N)throw new y("Expected list, minimum and maximum for LIST_RANGE");if(null===I.value)return p("targetList.value");let W=I.value.ListWithSubRange(A.valueObject,N.valueObject);this.state.PushEvaluationStack(new O(W));break;case k.CommandType.ListRandom:{let t=this.state.PopEvaluationStack();if(null===t)throw new y("Expected list for LIST_RANDOM");let e=t.value,n=null;if(null===e)throw p("list");if(0==e.Count)n=new S;else{let t=this.state.storySeed+this.state.previousRandom,i=new z(t).next(),r=i%e.Count,a=e.entries();for(let t=0;t<=r-1;t++)a.next();let s=a.next().value,l={Key:g.fromSerializedKey(s[0]),Value:s[1]};if(null===l.Key.originName)return p("randomItem.Key.originName");n=new S(l.Key.originName,this),n.Add(l.Key,l.Value),this.state.previousRandom=i}this.state.PushEvaluationStack(new O(n));break}default:this.Error("unhandled ControlCommand: "+e)}return!0}if(t instanceof R){let e=t,n=this.state.PopEvaluationStack();return this.state.variablesState.Assign(e,n),!0}if(t instanceof L){let e=t,n=null;if(null!=e.pathForCount){let t=e.containerForCount,i=this.state.VisitCountForContainer(t);n=new w(i)}else n=this.state.variablesState.GetVariableWithName(e.name),null==n&&(this.Warning("Variable not found: '"+e.name+"'. Using default value of 0 (false). This can happen with temporary variables if the declaration hasn't yet been hit. Globals are always given a default value on load if a value doesn't exist in the save state."),n=new w(0));return this.state.PushEvaluationStack(n),!0}if(t instanceof j){let e=t,n=this.state.PopEvaluationStack(e.numberOfParameters),i=e.Call(n);return this.state.PushEvaluationStack(i),!0}return!1}ChoosePathString(t){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(this.IfAsyncWeCant("call ChoosePathString right now"),null!==this.onChoosePathString&&this.onChoosePathString(t,i),n)this.ResetCallstack();else if(this.state.callStack.currentElement.type==r.Function){let e="",n=this.state.callStack.currentElement.currentPointer.container;throw null!=n&&(e="("+n.path.toString()+") "),new Error("Story was running a function "+e+"when you called ChoosePathString("+t+") - this is almost certainly not not what you want! Full stack trace: \n"+this.state.callStack.callStackTrace)}this.state.PassArgumentsToEvaluationStack(i),this.ChoosePath(new e(t))}IfAsyncWeCant(t){if(this._asyncContinueActive)throw new Error("Can't "+t+". Story is in the middle of a ContinueAsync(). Make more ContinueAsync() calls or a single Continue() call beforehand.")}ChoosePath(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.state.SetChosenPath(t,e),this.VisitChangedContainersDueToDivert()}ChooseChoiceIndex(t){let e=this.currentChoices;this.Assert(t>=0&&t1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null!==this.onEvaluateFunction&&this.onEvaluateFunction(t,e),this.IfAsyncWeCant("evaluate a function"),null==t)throw new Error("Function is null");if(""==t||""==t.trim())throw new Error("Function is empty or white space.");let i=this.KnotContainerWithName(t);if(null==i)throw new Error("Function doesn't exist: '"+t+"'");let r=[];r.push(...this.state.outputStream),this._state.ResetOutput(),this.state.StartFunctionEvaluationFromGame(i,e);let a=new f;for(;this.canContinue;)a.Append(this.Continue());let s=a.toString();this._state.ResetOutput(r);let l=this.state.CompleteFunctionEvaluationFromGame();return null!=this.onCompleteEvaluateFunction&&this.onCompleteEvaluateFunction(t,e,s,l),n?{returned:l,output:s}:l}EvaluateExpression(t){let e=this.state.callStack.elements.length;this.state.callStack.Push(r.Tunnel),this._temporaryEvaluationContainer=t,this.state.GoToStart();let n=this.state.evaluationStack.length;return this.Continue(),this._temporaryEvaluationContainer=null,this.state.callStack.elements.length>e&&this.state.PopCallStack(),this.state.evaluationStack.length>n?this.state.PopEvaluationStack():null}CallExternalFunction(t,e){if(null===t)return p("funcName");let n=this._externals.get(t),i=null,a=void 0!==n;if(a&&!n.lookAheadSafe&&null!==this._stateSnapshotAtLastNewline)return void(this._sawLookaheadUnsafeFunctionAfterNewline=!0);if(!a){if(this.allowExternalFunctionFallbacks)return i=this.KnotContainerWithName(t),this.Assert(null!==i,"Trying to call EXTERNAL function '"+t+"' which has not been bound, and fallback ink function could not be found."),this.state.callStack.Push(r.Function,void 0,this.state.outputStream.length),void(this.state.divertedPointer=F.StartOf(i));this.Assert(!1,"Trying to call EXTERNAL function '"+t+"' which has not been bound (and ink fallbacks disabled).")}let s=[];for(let t=0;t2&&void 0!==arguments[2])||arguments[2];this.IfAsyncWeCant("bind an external function"),this.Assert(!this._externals.has(t),"Function '"+t+"' has already been bound."),this._externals.set(t,{function:e,lookAheadSafe:n})}TryCoerce(t){return t}BindExternalFunction(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.Assert(null!=e,"Can't bind a null function"),this.BindExternalFunctionGeneral(t,(t=>{this.Assert(t.length>=e.length,"External function expected "+e.length+" arguments");let n=[];for(let e=0,i=t.length;e1?"s":"",t+=": '",t+=Array.from(n).join("', '"),t+="' ",t+=this.allowExternalFunctionFallbacks?", and no fallback ink function found.":" (ink fallbacks disabled)",this.Error(t)}else if(null!=t){for(let e of t.content){null!=e&&e.hasValidName||this.ValidateExternalBindings(e,n)}for(let[,e]of t.namedContent)this.ValidateExternalBindings(s(e,m),n)}else if(null!=e){let t=s(e,W);if(t&&t.isExternal){let e=t.targetPathString;if(null===e)return p("name");if(!this._externals.has(e))if(this.allowExternalFunctionFallbacks){this.mainContentContainer.namedContent.has(e)||n.add(e)}else n.add(e)}}}ObserveVariable(t,e){if(this.IfAsyncWeCant("observe a new variable"),null===this._variableObservers&&(this._variableObservers=new Map),!this.state.variablesState.GlobalVariableExistsWithName(t))throw new Error("Cannot observe variable '"+t+"' because it wasn't declared in the ink story.");this._variableObservers.has(t)?this._variableObservers.get(t).push(e):this._variableObservers.set(t,[e])}ObserveVariables(t,e){for(let n=0,i=t.length;n=e.container.content.length;){t=!1;let n=s(e.container.parent,x);if(n instanceof x==!1)break;let i=n.content.indexOf(e.container);if(-1==i)break;if(e=new F(n,i),e.index++,t=!0,null===e.container)return p("pointer.container")}return t||(e=F.Null),this.state.callStack.currentElement.currentPointer=e.copy(),t}TryFollowDefaultInvisibleChoice(){let t=this._state.currentChoices,e=t.filter((t=>t.isInvisibleDefault));if(0==e.length||t.length>e.length)return!1;let n=e[0];return null===n.targetPath?p("choice.targetPath"):null===n.threadAtGeneration?p("choice.threadAtGeneration"):(this.state.callStack.currentThread=n.threadAtGeneration,null!==this._stateSnapshotAtLastNewline&&(this.state.callStack.currentThread=this.state.callStack.ForkThread()),this.ChoosePath(n.targetPath,!1),!0)}NextSequenceShuffleIndex(){let t=s(this.state.PopEvaluationStack(),w);if(!(t instanceof w))return this.Error("expected number of elements in sequence for shuffle index"),0;let e=this.state.currentPointer.container;if(null===e)return p("seqContainer");if(null===t.value)return p("numElementsIntVal.value");let n=t.value,i=l(this.state.PopEvaluationStack(),w).value;if(null===i)return p("seqCount");let r=i/n,a=i%n,o=e.path.toString(),h=0;for(let t=0,e=o.length;t1&&void 0!==arguments[1]&&arguments[1],n=new y(t);throw n.useEndLineNumber=e,n}Warning(t){this.AddError(t,!0)}AddError(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.currentDebugMetadata,r=e?"WARNING":"ERROR";if(null!=i){let e=n?i.endLineNumber:i.startLineNumber;t="RUNTIME "+r+": '"+i.fileName+"' line "+e+": "+t}else t=this.state.currentPointer.isNull?"RUNTIME "+r+": "+t:"RUNTIME "+r+": ("+this.state.currentPointer+"): "+t;this.state.AddError(t,e),e||this.state.ForceEnd()}Assert(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(0==t)throw null==e&&(e="Story assert"),new Error(e+" "+this.currentDebugMetadata)}get currentDebugMetadata(){let t,e=this.state.currentPointer;if(!e.isNull&&null!==e.Resolve()&&(t=e.Resolve().debugMetadata,null!==t))return t;for(let n=this.state.callStack.elements.length-1;n>=0;--n)if(e=this.state.callStack.elements[n].currentPointer,!e.isNull&&null!==e.Resolve()&&(t=e.Resolve().debugMetadata,null!==t))return t;for(let e=this.state.outputStream.length-1;e>=0;--e){if(t=this.state.outputStream[e].debugMetadata,null!==t)return t}return null}get mainContentContainer(){return this._temporaryEvaluationContainer?this._temporaryEvaluationContainer:this._mainContentContainer}}Z.inkVersionCurrent=21,function(t){var e;(e=t.OutputStateChange||(t.OutputStateChange={}))[e.NoChange=0]="NoChange",e[e.ExtendedBeyondNewline=1]="ExtendedBeyondNewline",e[e.NewlineRemoved=2]="NewlineRemoved"}(Z||(Z={})),t.InkList=S,t.Story=Z})); //# sourceMappingURL=ink.js.map diff --git a/templates/browser_serverless/ink.js.map b/templates/browser_serverless/ink.js.map index 3df9068c..b591696d 100644 --- a/templates/browser_serverless/ink.js.map +++ b/templates/browser_serverless/ink.js.map @@ -1 +1 @@ -{"version":3,"file":"ink.js","sources":["../src/engine/Path.ts","../src/engine/Debug.ts","../src/engine/TypeAssertion.ts","../src/engine/NullException.ts","../src/engine/Object.ts","../src/engine/StringBuilder.ts","../src/engine/InkList.ts","../src/engine/StoryException.ts","../src/engine/TryGetResult.ts","../src/engine/Value.ts","../src/engine/SearchResult.ts","../src/engine/Container.ts","../src/engine/Glue.ts","../src/engine/PushPop.ts","../src/engine/ControlCommand.ts","../src/engine/Pointer.ts","../src/engine/Divert.ts","../src/engine/ChoicePoint.ts","../src/engine/VariableReference.ts","../src/engine/VariableAssignment.ts","../src/engine/Void.ts","../src/engine/NativeFunctionCall.ts","../src/engine/Tag.ts","../src/engine/Choice.ts","../src/engine/ListDefinition.ts","../src/engine/ListDefinitionsOrigin.ts","../src/engine/JsonSerialisation.ts","../src/engine/CallStack.ts","../src/engine/VariablesState.ts","../src/engine/PRNG.ts","../src/engine/StatePatch.ts","../src/engine/SimpleJson.ts","../src/engine/Flow.ts","../src/engine/Error.ts","../src/engine/Story.ts","../src/engine/StoryState.ts","../src/engine/StopWatch.ts"],"sourcesContent":["export class Path {\n public static parentId = \"^\";\n\n public _isRelative: boolean;\n public _components: Path.Component[];\n public _componentsString: string | null;\n\n constructor();\n constructor(componentsString: string);\n constructor(head: Path.Component, tail: Path);\n constructor(head: Path.Component[], relative?: boolean);\n constructor() {\n this._components = [];\n this._componentsString = null;\n this._isRelative = false;\n\n if (typeof arguments[0] == \"string\") {\n let componentsString = arguments[0] as string;\n this.componentsString = componentsString;\n } else if (\n arguments[0] instanceof Path.Component &&\n arguments[1] instanceof Path\n ) {\n let head = arguments[0] as Path.Component;\n let tail = arguments[1] as Path;\n this._components.push(head);\n this._components = this._components.concat(tail._components);\n } else if (arguments[0] instanceof Array) {\n let head = arguments[0] as Path.Component[];\n let relative = !!arguments[1] as boolean;\n this._components = this._components.concat(head);\n this._isRelative = relative;\n }\n }\n get isRelative() {\n return this._isRelative;\n }\n get componentCount(): number {\n return this._components.length;\n }\n get head(): Path.Component | null {\n if (this._components.length > 0) {\n return this._components[0];\n } else {\n return null;\n }\n }\n get tail(): Path {\n if (this._components.length >= 2) {\n // careful, the original code uses length-1 here. This is because the second argument of\n // List.GetRange is a number of elements to extract, wherease Array.slice uses an index\n let tailComps = this._components.slice(1, this._components.length);\n return new Path(tailComps);\n } else {\n return Path.self;\n }\n }\n get length(): number {\n return this._components.length;\n }\n get lastComponent(): Path.Component | null {\n let lastComponentIdx = this._components.length - 1;\n if (lastComponentIdx >= 0) {\n return this._components[lastComponentIdx];\n } else {\n return null;\n }\n }\n get containsNamedComponent(): boolean {\n for (let i = 0, l = this._components.length; i < l; i++) {\n if (!this._components[i].isIndex) {\n return true;\n }\n }\n return false;\n }\n static get self(): Path {\n let path = new Path();\n path._isRelative = true;\n return path;\n }\n\n public GetComponent(index: number): Path.Component {\n return this._components[index];\n }\n public PathByAppendingPath(pathToAppend: Path): Path {\n let p = new Path();\n\n let upwardMoves = 0;\n for (let i = 0; i < pathToAppend._components.length; ++i) {\n if (pathToAppend._components[i].isParent) {\n upwardMoves++;\n } else {\n break;\n }\n }\n\n for (let i = 0; i < this._components.length - upwardMoves; ++i) {\n p._components.push(this._components[i]);\n }\n\n for (let i = upwardMoves; i < pathToAppend._components.length; ++i) {\n p._components.push(pathToAppend._components[i]);\n }\n\n return p;\n }\n get componentsString(): string {\n if (this._componentsString == null) {\n this._componentsString = this._components.join(\".\");\n if (this.isRelative)\n this._componentsString = \".\" + this._componentsString;\n }\n\n return this._componentsString;\n }\n set componentsString(value: string) {\n this._components.length = 0;\n\n this._componentsString = value;\n\n if (this._componentsString == null || this._componentsString == \"\") return;\n\n if (this._componentsString[0] == \".\") {\n this._isRelative = true;\n this._componentsString = this._componentsString.substring(1);\n }\n\n let componentStrings = this._componentsString.split(\".\");\n for (let str of componentStrings) {\n // we need to distinguish between named components that start with a number, eg \"42somewhere\", and indexed components\n // the normal parseInt won't do for the detection because it's too relaxed.\n // see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt\n if (/^(\\-|\\+)?([0-9]+|Infinity)$/.test(str)) {\n this._components.push(new Path.Component(parseInt(str)));\n } else {\n this._components.push(new Path.Component(str));\n }\n }\n }\n public toString(): string {\n return this.componentsString;\n }\n public Equals(otherPath: Path | null): boolean {\n if (otherPath == null) return false;\n\n if (otherPath._components.length != this._components.length) return false;\n\n if (otherPath.isRelative != this.isRelative) return false;\n\n // the original code uses SequenceEqual here, so we need to iterate over the components manually.\n for (let i = 0, l = otherPath._components.length; i < l; i++) {\n // it's not quite clear whether this test should use Equals or a simple == operator,\n // see https://github.com/y-lohse/inkjs/issues/22\n if (!otherPath._components[i].Equals(this._components[i])) return false;\n }\n\n return true;\n }\n public PathByAppendingComponent(c: Path.Component): Path {\n let p = new Path();\n p._components.push(...this._components);\n p._components.push(c);\n return p;\n }\n}\n\nexport namespace Path {\n export class Component {\n public readonly index: number;\n public readonly name: string | null;\n\n constructor(indexOrName: string | number) {\n this.index = -1;\n this.name = null;\n if (typeof indexOrName == \"string\") {\n this.name = indexOrName;\n } else {\n this.index = indexOrName;\n }\n }\n get isIndex(): boolean {\n return this.index >= 0;\n }\n get isParent(): boolean {\n return this.name == Path.parentId;\n }\n\n public static ToParent(): Component {\n return new Component(Path.parentId);\n }\n public toString(): string | null {\n if (this.isIndex) {\n return this.index.toString();\n } else {\n return this.name;\n }\n }\n public Equals(otherComp: Component): boolean {\n if (otherComp != null && otherComp.isIndex == this.isIndex) {\n if (this.isIndex) {\n return this.index == otherComp.index;\n } else {\n return this.name == otherComp.name;\n }\n }\n\n return false;\n }\n }\n}\n","export namespace Debug {\n export function AssertType(\n variable: any,\n type: new () => T,\n message: string\n ): void | never {\n Assert(variable instanceof type, message);\n }\n\n export function Assert(condition: boolean, message?: string): void | never {\n if (!condition) {\n if (typeof message !== \"undefined\") {\n console.warn(message);\n }\n\n if (console.trace) {\n console.trace();\n }\n\n throw new Error(\"\");\n }\n }\n}\n","import { INamedContent } from \"./INamedContent\";\n\nexport function asOrNull(\n obj: any,\n type: (new (...arg: any[]) => T) | (Function & { prototype: T })\n): T | null {\n if (obj instanceof type) {\n return unsafeTypeAssertion(obj, type);\n } else {\n return null;\n }\n}\n\nexport function asOrThrows(\n obj: any,\n type: (new (...arg: any[]) => T) | (Function & { prototype: T })\n): T | never {\n if (obj instanceof type) {\n return unsafeTypeAssertion(obj, type);\n } else {\n throw new Error(`${obj} is not of type ${type}`);\n }\n}\n\nexport function asNumberOrThrows(obj: any) {\n if (typeof obj === \"number\") {\n return obj as number;\n } else {\n throw new Error(`${obj} is not a number`);\n }\n}\n\nexport function asBooleanOrThrows(obj: any) {\n if (typeof obj === \"boolean\") {\n return obj as boolean;\n } else {\n throw new Error(`${obj} is not a boolean`);\n }\n}\n\n// So here, in the reference implementation, contentObj is casted to an INamedContent\n// but here we use js-style duck typing: if it implements the same props as the interface,\n// we treat it as valid.\nexport function asINamedContentOrNull(obj: any): INamedContent | null {\n if (obj.hasValidName && obj.name) {\n return obj as INamedContent;\n }\n\n return null;\n}\n\nexport function nullIfUndefined(obj: T | undefined): T | null {\n if (typeof obj === \"undefined\") {\n return null;\n }\n\n return obj;\n}\n\nexport function isEquatable(type: any) {\n return typeof type === \"object\" && typeof type.Equals === \"function\";\n}\n\nfunction unsafeTypeAssertion(\n obj: any,\n type: (new () => T) | (Function & { prototype: T })\n) {\n return obj as T;\n}\n\nexport function filterUndef(element: T | undefined): element is T {\n return element != undefined;\n}\n","/**\n * In the original C# code, a SystemException would be thrown when passing\n * null to methods expected a valid instance. Javascript has no such\n * concept, but TypeScript will not allow `null` to be passed to methods\n * explicitely requiring a valid type.\n *\n * Whenever TypeScript complain about the possibility of a `null` value,\n * check the offending value and it it's null, throw this exception using\n * `throwNullException(name: string)`.\n */\nexport class NullException extends Error {}\n\n/**\n * Throw a NullException.\n *\n * @param name a short description of the offending value (often its name within the code).\n */\nexport function throwNullException(name: string): never {\n throw new NullException(`${name} is null or undefined`);\n}\n","import { Path } from \"./Path\";\nimport { Container } from \"./Container\";\nimport { Debug } from \"./Debug\";\nimport { asOrNull, asINamedContentOrNull } from \"./TypeAssertion\";\nimport { throwNullException } from \"./NullException\";\nimport { SearchResult } from \"./SearchResult\";\nimport { DebugMetadata } from \"./DebugMetadata\";\n\nexport class InkObject {\n public parent: InkObject | null = null;\n\n get debugMetadata(): DebugMetadata | null {\n if (this._debugMetadata === null) {\n if (this.parent) {\n return this.parent.debugMetadata;\n }\n }\n\n return this._debugMetadata;\n }\n\n set debugMetadata(value) {\n this._debugMetadata = value;\n }\n\n get ownDebugMetadata() {\n return this._debugMetadata;\n }\n\n private _debugMetadata: DebugMetadata | null = null;\n\n public DebugLineNumberOfPath(path: Path) {\n if (path === null) return null;\n\n // Try to get a line number from debug metadata\n let root = this.rootContentContainer;\n if (root) {\n let targetContent = root.ContentAtPath(path).obj;\n if (targetContent) {\n let dm = targetContent.debugMetadata;\n if (dm !== null) {\n return dm.startLineNumber;\n }\n }\n }\n\n return null;\n }\n\n get path() {\n if (this._path == null) {\n if (this.parent == null) {\n this._path = new Path();\n } else {\n let comps: Path.Component[] = [];\n\n let child: InkObject = this;\n let container = asOrNull(child.parent, Container);\n\n while (container !== null) {\n let namedChild = asINamedContentOrNull(child);\n if (namedChild != null && namedChild.hasValidName) {\n if (namedChild.name === null)\n return throwNullException(\"namedChild.name\");\n comps.unshift(new Path.Component(namedChild.name!));\n } else {\n comps.unshift(new Path.Component(container.content.indexOf(child)));\n }\n\n child = container;\n container = asOrNull(container.parent, Container);\n }\n\n this._path = new Path(comps);\n }\n }\n\n return this._path;\n }\n private _path: Path | null = null;\n\n public ResolvePath(path: Path | null): SearchResult {\n if (path === null) return throwNullException(\"path\");\n if (path.isRelative) {\n let nearestContainer = asOrNull(this, Container);\n\n if (nearestContainer === null) {\n Debug.Assert(\n this.parent !== null,\n \"Can't resolve relative path because we don't have a parent\"\n );\n nearestContainer = asOrNull(this.parent, Container);\n Debug.Assert(\n nearestContainer !== null,\n \"Expected parent to be a container\"\n );\n Debug.Assert(path.GetComponent(0).isParent);\n path = path.tail;\n }\n\n if (nearestContainer === null) {\n return throwNullException(\"nearestContainer\");\n }\n return nearestContainer.ContentAtPath(path);\n } else {\n let contentContainer = this.rootContentContainer;\n if (contentContainer === null) {\n return throwNullException(\"contentContainer\");\n }\n return contentContainer.ContentAtPath(path);\n }\n }\n\n public ConvertPathToRelative(globalPath: Path) {\n let ownPath = this.path;\n\n let minPathLength = Math.min(globalPath.length, ownPath.length);\n let lastSharedPathCompIndex = -1;\n\n for (let i = 0; i < minPathLength; ++i) {\n let ownComp = ownPath.GetComponent(i);\n let otherComp = globalPath.GetComponent(i);\n\n if (ownComp.Equals(otherComp)) {\n lastSharedPathCompIndex = i;\n } else {\n break;\n }\n }\n\n // No shared path components, so just use global path\n if (lastSharedPathCompIndex == -1) return globalPath;\n\n let numUpwardsMoves = ownPath.componentCount - 1 - lastSharedPathCompIndex;\n\n let newPathComps: Path.Component[] = [];\n\n for (let up = 0; up < numUpwardsMoves; ++up)\n newPathComps.push(Path.Component.ToParent());\n\n for (\n let down = lastSharedPathCompIndex + 1;\n down < globalPath.componentCount;\n ++down\n )\n newPathComps.push(globalPath.GetComponent(down));\n\n let relativePath = new Path(newPathComps, true);\n return relativePath;\n }\n\n public CompactPathString(otherPath: Path) {\n let globalPathStr = null;\n let relativePathStr = null;\n\n if (otherPath.isRelative) {\n relativePathStr = otherPath.componentsString;\n globalPathStr = this.path.PathByAppendingPath(otherPath).componentsString;\n } else {\n let relativePath = this.ConvertPathToRelative(otherPath);\n relativePathStr = relativePath.componentsString;\n globalPathStr = otherPath.componentsString;\n }\n\n if (relativePathStr.length < globalPathStr.length) return relativePathStr;\n else return globalPathStr;\n }\n\n get rootContentContainer() {\n let ancestor: InkObject = this;\n while (ancestor.parent) {\n ancestor = ancestor.parent;\n }\n return asOrNull(ancestor, Container);\n }\n\n public Copy(): InkObject {\n throw Error(\"Not Implemented: Doesn't support copying\");\n }\n // SetChild works slightly diferently in the js implementation.\n // Since we can't pass an objets property by reference, we instead pass\n // the object and the property string.\n // TODO: This method can probably be rewritten with type-safety in mind.\n public SetChild(obj: any, prop: any, value: any) {\n if (obj[prop]) obj[prop] = null;\n\n obj[prop] = value;\n\n if (obj[prop]) obj[prop].parent = this;\n }\n\n public Equals(obj: any) {\n return obj === this;\n }\n}\n","export class StringBuilder {\n private string: string;\n\n constructor(str?: string) {\n str = typeof str !== \"undefined\" ? str.toString() : \"\";\n this.string = str;\n }\n get Length(): number {\n return this.string.length;\n }\n public Append(str: string | null) {\n if (str !== null) {\n this.string += str;\n }\n }\n public AppendLine(str?: string) {\n if (typeof str !== \"undefined\") this.Append(str);\n this.string += \"\\n\";\n }\n public AppendFormat(format: string, ...args: any[]) {\n // taken from http://stackoverflow.com/questions/610406/javascript-equivalent-to-printf-string-format\n this.string += format.replace(/{(\\d+)}/g, (match: string, num: number) =>\n typeof args[num] != \"undefined\" ? args[num] : match\n );\n }\n public toString(): string {\n return this.string;\n }\n\n public Clear() {\n this.string = \"\";\n }\n}\n","import { throwNullException } from \"./NullException\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { ListDefinition } from \"./ListDefinition\";\nimport { Story } from \"./Story\";\n\nexport class InkListItem implements IInkListItem {\n // InkListItem is a struct\n\n public readonly originName: string | null = null;\n public readonly itemName: string | null = null;\n\n constructor(originName: string | null, itemName: string | null);\n constructor(fullName: string | null);\n constructor() {\n if (typeof arguments[1] !== \"undefined\") {\n let originName = arguments[0] as string | null;\n let itemName = arguments[1] as string | null;\n\n this.originName = originName;\n this.itemName = itemName;\n } else if (arguments[0]) {\n let fullName = arguments[0] as string;\n\n let nameParts = fullName.toString().split(\".\");\n this.originName = nameParts[0];\n this.itemName = nameParts[1];\n }\n }\n public static get Null() {\n return new InkListItem(null, null);\n }\n public get isNull() {\n return this.originName == null && this.itemName == null;\n }\n get fullName() {\n return (\n (this.originName !== null ? this.originName : \"?\") + \".\" + this.itemName\n );\n }\n public toString(): string {\n return this.fullName;\n }\n public Equals(obj: InkListItem) {\n if (obj instanceof InkListItem) {\n let otherItem = obj;\n return (\n otherItem.itemName == this.itemName &&\n otherItem.originName == this.originName\n );\n }\n\n return false;\n }\n\n // These methods did not exist in the original C# code. Their purpose is to\n // make `InkListItem` mimics the value-type semantics of the original\n // struct. Please refer to the end of this file, for a more in-depth\n // explanation.\n\n /**\n * Returns a shallow clone of the current instance.\n */\n public copy() {\n return new InkListItem(this.originName, this.itemName);\n }\n /**\n * Returns a `SerializedInkListItem` representing the current\n * instance. The result is intended to be used as a key inside a Map.\n */\n public serialized(): SerializedInkListItem {\n // We are simply using a JSON representation as a value-typed key.\n return JSON.stringify({\n originName: this.originName,\n itemName: this.itemName,\n });\n }\n\n /**\n * Reconstructs a `InkListItem` from the given SerializedInkListItem.\n */\n public static fromSerializedKey(key: SerializedInkListItem): InkListItem {\n let obj = JSON.parse(key);\n if (!InkListItem.isLikeInkListItem(obj)) return InkListItem.Null;\n\n let inkListItem = obj as IInkListItem;\n\n return new InkListItem(inkListItem.originName, inkListItem.itemName);\n }\n\n /**\n * Determines whether the given item is sufficiently `InkListItem`-like\n * to be used as a template when reconstructing the InkListItem.\n */\n private static isLikeInkListItem(item: any) {\n if (typeof item !== \"object\") return false;\n if (!item.hasOwnProperty(\"originName\") || !item.hasOwnProperty(\"itemName\"))\n return false;\n if (typeof item.originName !== \"string\" && typeof item.originName !== null)\n return false;\n if (typeof item.itemName !== \"string\" && typeof item.itemName !== null)\n return false;\n\n return true;\n }\n}\n\nexport class InkList extends Map {\n public origins: ListDefinition[] | null = null;\n public _originNames: string[] | null = [];\n\n constructor();\n constructor(otherList: InkList);\n constructor(singleOriginListName: string, originStory: Story);\n constructor(singleElement: KeyValuePair);\n constructor() {\n // Trying to be smart here, this emulates the constructor inheritance found\n // in the original code, but only if otherList is an InkList. IIFE FTW.\n super(\n (() => {\n if (arguments[0] instanceof InkList) {\n return arguments[0];\n } else {\n return [];\n }\n })()\n );\n\n if (arguments[0] instanceof InkList) {\n let otherList = arguments[0] as InkList;\n\n let otherOriginNames = otherList.originNames as string[];\n if (otherOriginNames !== null)\n this._originNames = otherOriginNames.slice();\n if (otherList.origins !== null) {\n this.origins = otherList.origins.slice();\n }\n } else if (typeof arguments[0] === \"string\") {\n let singleOriginListName = arguments[0] as string;\n let originStory = arguments[1] as Story;\n this.SetInitialOriginName(singleOriginListName);\n\n if (originStory.listDefinitions === null) {\n return throwNullException(\"originStory.listDefinitions\");\n }\n let def = originStory.listDefinitions.TryListGetDefinition(\n singleOriginListName,\n null\n );\n if (def.exists) {\n // Throwing now, because if the value is `null` it will\n // eventually throw down the line.\n if (def.result === null) {\n return throwNullException(\"def.result\");\n }\n this.origins = [def.result];\n } else {\n throw new Error(\n \"InkList origin could not be found in story when constructing new list: \" +\n singleOriginListName\n );\n }\n } else if (\n typeof arguments[0] === \"object\" &&\n arguments[0].hasOwnProperty(\"Key\") &&\n arguments[0].hasOwnProperty(\"Value\")\n ) {\n let singleElement = arguments[0] as KeyValuePair;\n this.Add(singleElement.Key, singleElement.Value);\n }\n }\n\n public static FromString(myListItem: string, originStory: Story) {\n let listValue =\n originStory.listDefinitions?.FindSingleItemListWithName(myListItem);\n if (listValue) {\n if (listValue.value === null) {\n return throwNullException(\"listValue.value\");\n }\n return new InkList(listValue.value);\n } else {\n throw new Error(\n \"Could not find the InkListItem from the string '\" +\n myListItem +\n \"' to create an InkList because it doesn't exist in the original list definition in ink.\"\n );\n }\n }\n\n public AddItem(itemOrItemName: InkListItem | string | null) {\n if (itemOrItemName instanceof InkListItem) {\n let item = itemOrItemName;\n\n if (item.originName == null) {\n this.AddItem(item.itemName);\n return;\n }\n\n if (this.origins === null) return throwNullException(\"this.origins\");\n\n for (let origin of this.origins) {\n if (origin.name == item.originName) {\n let intVal = origin.TryGetValueForItem(item, 0);\n if (intVal.exists) {\n this.Add(item, intVal.result);\n return;\n } else {\n throw new Error(\n \"Could not add the item \" +\n item +\n \" to this list because it doesn't exist in the original list definition in ink.\"\n );\n }\n }\n }\n\n throw new Error(\n \"Failed to add item to list because the item was from a new list definition that wasn't previously known to this list. Only items from previously known lists can be used, so that the int value can be found.\"\n );\n } else {\n let itemName = itemOrItemName as string | null;\n\n let foundListDef: ListDefinition | null = null;\n\n if (this.origins === null) return throwNullException(\"this.origins\");\n\n for (let origin of this.origins) {\n if (itemName === null) return throwNullException(\"itemName\");\n\n if (origin.ContainsItemWithName(itemName)) {\n if (foundListDef != null) {\n throw new Error(\n \"Could not add the item \" +\n itemName +\n \" to this list because it could come from either \" +\n origin.name +\n \" or \" +\n foundListDef.name\n );\n } else {\n foundListDef = origin;\n }\n }\n }\n\n if (foundListDef == null)\n throw new Error(\n \"Could not add the item \" +\n itemName +\n \" to this list because it isn't known to any list definitions previously associated with this list.\"\n );\n\n let item = new InkListItem(foundListDef.name, itemName);\n let itemVal = foundListDef.ValueForItem(item);\n this.Add(item, itemVal);\n }\n }\n public ContainsItemNamed(itemName: string | null) {\n for (let [key] of this) {\n let item = InkListItem.fromSerializedKey(key);\n if (item.itemName == itemName) return true;\n }\n\n return false;\n }\n public ContainsKey(key: InkListItem) {\n return this.has(key.serialized());\n }\n public Add(key: InkListItem, value: number) {\n let serializedKey = key.serialized();\n if (this.has(serializedKey)) {\n // Throw an exception to match the C# behavior.\n throw new Error(`The Map already contains an entry for ${key}`);\n }\n this.set(serializedKey, value);\n }\n public Remove(key: InkListItem) {\n return this.delete(key.serialized());\n }\n get Count() {\n return this.size;\n }\n get originOfMaxItem(): ListDefinition | null {\n if (this.origins == null) return null;\n\n let maxOriginName = this.maxItem.Key.originName;\n let result = null;\n this.origins.every((origin) => {\n if (origin.name == maxOriginName) {\n result = origin;\n return false;\n } else return true;\n });\n\n return result;\n }\n get originNames(): string[] {\n if (this.Count > 0) {\n if (this._originNames == null && this.Count > 0) this._originNames = [];\n else {\n if (!this._originNames) this._originNames = [];\n this._originNames.length = 0;\n }\n\n for (let [key] of this) {\n let item = InkListItem.fromSerializedKey(key);\n if (item.originName === null)\n return throwNullException(\"item.originName\");\n this._originNames.push(item.originName);\n }\n }\n\n return this._originNames as string[];\n }\n public SetInitialOriginName(initialOriginName: string) {\n this._originNames = [initialOriginName];\n }\n public SetInitialOriginNames(initialOriginNames: string[]) {\n if (initialOriginNames == null) this._originNames = null;\n else this._originNames = initialOriginNames.slice(); // store a copy\n }\n get maxItem() {\n let max: KeyValuePair = {\n Key: InkListItem.Null,\n Value: 0,\n };\n for (let [key, value] of this) {\n let item = InkListItem.fromSerializedKey(key);\n if (max.Key.isNull || value > max.Value)\n max = { Key: item, Value: value };\n }\n\n return max;\n }\n get minItem() {\n let min: KeyValuePair = {\n Key: InkListItem.Null,\n Value: 0,\n };\n for (let [key, value] of this) {\n let item = InkListItem.fromSerializedKey(key);\n if (min.Key.isNull || value < min.Value) {\n min = { Key: item, Value: value };\n }\n }\n return min;\n }\n get inverse() {\n let list = new InkList();\n if (this.origins != null) {\n for (let origin of this.origins) {\n for (let [key, value] of origin.items) {\n let item = InkListItem.fromSerializedKey(key);\n if (!this.ContainsKey(item)) list.Add(item, value);\n }\n }\n }\n return list;\n }\n get all() {\n let list = new InkList();\n if (this.origins != null) {\n for (let origin of this.origins) {\n for (let [key, value] of origin.items) {\n let item = InkListItem.fromSerializedKey(key);\n list.set(item.serialized(), value);\n }\n }\n }\n return list;\n }\n public Union(otherList: InkList) {\n let union = new InkList(this);\n for (let [key, value] of otherList) {\n union.set(key, value);\n }\n return union;\n }\n public Intersect(otherList: InkList) {\n let intersection = new InkList();\n for (let [key, value] of this) {\n if (otherList.has(key)) intersection.set(key, value);\n }\n\n return intersection;\n }\n public HasIntersection(otherList: InkList): boolean {\n for (let [key] of this) {\n if (otherList.has(key)) return true;\n }\n return false;\n }\n public Without(listToRemove: InkList) {\n let result = new InkList(this);\n for (let [key] of listToRemove) {\n result.delete(key);\n }\n\n return result;\n }\n\n public Contains(key: string): boolean;\n public Contains(otherList: InkList): boolean;\n public Contains(what: string | InkList): boolean {\n if (typeof what == \"string\") return this.ContainsItemNamed(what);\n const otherList = what;\n if (otherList.size == 0 || this.size == 0) return false;\n for (let [key] of otherList) {\n if (!this.has(key)) return false;\n }\n\n return true;\n }\n public GreaterThan(otherList: InkList) {\n if (this.Count == 0) return false;\n if (otherList.Count == 0) return true;\n\n return this.minItem.Value > otherList.maxItem.Value;\n }\n public GreaterThanOrEquals(otherList: InkList) {\n if (this.Count == 0) return false;\n if (otherList.Count == 0) return true;\n\n return (\n this.minItem.Value >= otherList.minItem.Value &&\n this.maxItem.Value >= otherList.maxItem.Value\n );\n }\n public LessThan(otherList: InkList) {\n if (otherList.Count == 0) return false;\n if (this.Count == 0) return true;\n\n return this.maxItem.Value < otherList.minItem.Value;\n }\n public LessThanOrEquals(otherList: InkList) {\n if (otherList.Count == 0) return false;\n if (this.Count == 0) return true;\n\n return (\n this.maxItem.Value <= otherList.maxItem.Value &&\n this.minItem.Value <= otherList.minItem.Value\n );\n }\n public MaxAsList() {\n if (this.Count > 0) return new InkList(this.maxItem);\n else return new InkList();\n }\n public MinAsList() {\n if (this.Count > 0) return new InkList(this.minItem);\n else return new InkList();\n }\n public ListWithSubRange(minBound: any, maxBound: any) {\n if (this.Count == 0) return new InkList();\n\n let ordered = this.orderedItems;\n\n let minValue = 0;\n let maxValue = Number.MAX_SAFE_INTEGER;\n\n if (Number.isInteger(minBound)) {\n minValue = minBound;\n } else {\n if (minBound instanceof InkList && minBound.Count > 0)\n minValue = minBound.minItem.Value;\n }\n\n if (Number.isInteger(maxBound)) {\n maxValue = maxBound;\n } else {\n if (minBound instanceof InkList && minBound.Count > 0)\n maxValue = maxBound.maxItem.Value;\n }\n\n let subList = new InkList();\n subList.SetInitialOriginNames(this.originNames);\n for (let item of ordered) {\n if (item.Value >= minValue && item.Value <= maxValue) {\n subList.Add(item.Key, item.Value);\n }\n }\n\n return subList;\n }\n public Equals(otherInkList: InkList) {\n if (otherInkList instanceof InkList === false) return false;\n if (otherInkList.Count != this.Count) return false;\n\n for (let [key] of this) {\n if (!otherInkList.has(key)) return false;\n }\n\n return true;\n }\n // GetHashCode not implemented\n get orderedItems() {\n // List>\n let ordered = new Array>();\n\n for (let [key, value] of this) {\n let item = InkListItem.fromSerializedKey(key);\n ordered.push({ Key: item, Value: value });\n }\n\n ordered.sort((x, y) => {\n if (x.Key.originName === null) {\n return throwNullException(\"x.Key.originName\");\n }\n if (y.Key.originName === null) {\n return throwNullException(\"y.Key.originName\");\n }\n\n if (x.Value == y.Value) {\n return x.Key.originName.localeCompare(y.Key.originName);\n } else {\n // TODO: refactor this bit into a numberCompareTo method?\n if (x.Value < y.Value) return -1;\n return x.Value > y.Value ? 1 : 0;\n }\n });\n\n return ordered;\n }\n public toString() {\n let ordered = this.orderedItems;\n\n let sb = new StringBuilder();\n for (let i = 0; i < ordered.length; i++) {\n if (i > 0) sb.Append(\", \");\n\n let item = ordered[i].Key;\n if (item.itemName === null) return throwNullException(\"item.itemName\");\n sb.Append(item.itemName);\n }\n\n return sb.toString();\n }\n // casting a InkList to a Number, for somereason, actually gives a number.\n // This messes up the type detection when creating a Value from a InkList.\n // Returning NaN here prevents that.\n public valueOf() {\n return NaN;\n }\n}\n\n/**\n * In the original C# code, `InkListItem` was defined as value type, meaning\n * that two `InkListItem` would be considered equal as long as they held the\n * same values. This doesn't hold true in Javascript, as `InkListItem` is a\n * reference type (Javascript doesn't allow the creation of custom value types).\n *\n * The key equality of Map objects is based on the \"SameValueZero\" algorithm;\n * since `InkListItem` is a value type, two keys will only be considered\n * equal if they are, in fact, the same object. As we are trying to emulate\n * the original behavior as close as possible, this will lead to unforeseen\n * side effects.\n *\n * In order to have a key equality based on value semantics, we'll convert\n * `InkListItem` to a valid string representation and use this representation\n * as a key (strings are value types in Javascript). Rather than using the\n * type `string` directly, we'll alias it to `SerializedInkListItem` and use\n * this type as the key for our Map-based `InkList`.\n *\n * Reducing `InkListItem` to a JSON representation would not be bulletproof\n * in the general case, but for our needs it works well. The major downside of\n * this method is that we will have to to reconstruct the original `InkListItem`\n * every time we'll need to access its properties.\n */\nexport type SerializedInkListItem = string;\n\n/**\n * An interface inherited by `InkListItem`, defining exposed\n * properties. It's mainly used when deserializing a `InkListItem` from its\n * key (`SerializedInkListItem`)\n */\ninterface IInkListItem {\n readonly originName: string | null;\n readonly itemName: string | null;\n}\nexport interface KeyValuePair {\n Key: K;\n Value: V;\n}\n","export class StoryException extends Error {\n public useEndLineNumber: boolean;\n public message: string;\n public name: string;\n\n constructor(message: string) {\n super(message);\n this.useEndLineNumber = false;\n this.message = message;\n this.name = \"StoryException\";\n }\n}\n","/**\n * This interface normalize the `TryGet` behavior found in the original\n * C# project. Any `TryGet` method will return a object conforming to this\n * interface.\n *\n * The original function returns a boolean and has a second parameter called\n * item that is an `out`. Both are needed and we can't just return the item\n * because it'll always be truthy. Instead, we return an object containing\n * whether the result exists (`exists`) and the result itself (`result`).\n *\n * For instance a `TryGet` prototype would look like this:\n```\nTryGetItemWithValue(val: number, item: InkListItem): TryGetResult{\n```\n *\n * On the other hand, dealing with the result can be done in the following way:\n```\nvar item = item.TryGetItemWithValue(intVal, InkListItem.Null);\nif (item.exists) {\n\tconsole.log(item.result)\n}\n```\n *\n */\nexport interface TryGetResult {\n result: T;\n exists: boolean;\n}\n\nexport function tryGetValueFromMap(\n map: Map | null,\n key: K,\n /* out */ value: V\n): TryGetResult {\n if (map === null) {\n return { result: value, exists: false };\n }\n\n let val = map.get(key);\n\n if (typeof val === \"undefined\") {\n return { result: value, exists: false };\n } else {\n return { result: val, exists: true };\n }\n}\n\nexport function tryParseInt(\n value: any,\n /* out */ defaultValue: number = 0\n): TryGetResult {\n let val = parseInt(value);\n\n if (!Number.isNaN(val)) {\n return { result: val, exists: true };\n } else {\n return { result: defaultValue, exists: false };\n }\n}\n\nexport function tryParseFloat(\n value: any,\n /* out */ defaultValue: number = 0\n): TryGetResult {\n let val = parseFloat(value);\n\n if (!Number.isNaN(val)) {\n return { result: val, exists: true };\n } else {\n return { result: defaultValue, exists: false };\n }\n}\n","import { InkObject } from \"./Object\";\nimport { Path } from \"./Path\";\nimport { InkList, InkListItem } from \"./InkList\";\nimport { StoryException } from \"./StoryException\";\nimport { asOrNull, asOrThrows } from \"./TypeAssertion\";\nimport { tryParseInt, tryParseFloat } from \"./TryGetResult\";\nimport { throwNullException } from \"./NullException\";\n\nexport abstract class AbstractValue extends InkObject {\n public abstract get valueType(): ValueType;\n public abstract get isTruthy(): boolean;\n public abstract get valueObject(): any;\n\n public abstract Cast(newType: ValueType): Value;\n\n public static Create(\n val: any,\n preferredNumberType?: ValueType\n ): Value | null {\n // This code doesn't exist in upstream and is simply here to enforce\n // the creation of the proper number value.\n // If `preferredNumberType` is not provided or if value doesn't match\n // `preferredNumberType`, this conditional does nothing.\n if (preferredNumberType) {\n if (\n preferredNumberType === (ValueType.Int as ValueType) &&\n Number.isInteger(Number(val))\n ) {\n return new IntValue(Number(val));\n } else if (\n preferredNumberType === (ValueType.Float as ValueType) &&\n !isNaN(val)\n ) {\n return new FloatValue(Number(val));\n }\n }\n\n if (typeof val === \"boolean\") {\n return new BoolValue(Boolean(val));\n }\n\n // https://github.com/y-lohse/inkjs/issues/425\n // Changed condition sequence, because Number('') is\n // parsed to 0, which made setting string to empty\n // impossible\n if (typeof val === \"string\") {\n return new StringValue(String(val));\n } else if (Number.isInteger(Number(val))) {\n return new IntValue(Number(val));\n } else if (!isNaN(val)) {\n return new FloatValue(Number(val));\n } else if (val instanceof Path) {\n return new DivertTargetValue(asOrThrows(val, Path));\n } else if (val instanceof InkList) {\n return new ListValue(asOrThrows(val, InkList));\n }\n\n return null;\n }\n public Copy() {\n return asOrThrows(AbstractValue.Create(this.valueObject), InkObject);\n }\n public BadCastException(targetType: ValueType) {\n return new StoryException(\n \"Can't cast \" +\n this.valueObject +\n \" from \" +\n this.valueType +\n \" to \" +\n targetType\n );\n }\n}\n\nexport abstract class Value<\n T extends { toString: () => string }\n> extends AbstractValue {\n public value: T | null;\n\n constructor(val: T | null) {\n super();\n this.value = val;\n }\n public get valueObject() {\n return this.value;\n }\n public toString() {\n if (this.value === null) return throwNullException(\"Value.value\");\n return this.value.toString();\n }\n}\n\nexport class BoolValue extends Value {\n constructor(val: boolean) {\n super(val || false);\n }\n public get isTruthy() {\n return Boolean(this.value);\n }\n public get valueType() {\n return ValueType.Bool;\n }\n\n public Cast(newType: ValueType): Value {\n if (this.value === null) return throwNullException(\"Value.value\");\n\n if (newType == this.valueType) {\n return this;\n }\n\n if (newType == ValueType.Int) {\n return new IntValue(this.value ? 1 : 0);\n }\n\n if (newType == ValueType.Float) {\n return new FloatValue(this.value ? 1.0 : 0.0);\n }\n\n if (newType == ValueType.String) {\n return new StringValue(this.value ? \"true\" : \"false\");\n }\n\n throw this.BadCastException(newType);\n }\n\n public toString() {\n return this.value ? \"true\" : \"false\";\n }\n}\n\nexport class IntValue extends Value {\n constructor(val: number) {\n super(val || 0);\n }\n public get isTruthy() {\n return this.value != 0;\n }\n public get valueType() {\n return ValueType.Int;\n }\n\n public Cast(newType: ValueType): Value {\n if (this.value === null) return throwNullException(\"Value.value\");\n\n if (newType == this.valueType) {\n return this;\n }\n\n if (newType == ValueType.Bool) {\n return new BoolValue(this.value === 0 ? false : true);\n }\n\n if (newType == ValueType.Float) {\n return new FloatValue(this.value);\n }\n\n if (newType == ValueType.String) {\n return new StringValue(\"\" + this.value);\n }\n\n throw this.BadCastException(newType);\n }\n}\n\nexport class FloatValue extends Value {\n constructor(val: number) {\n super(val || 0.0);\n }\n public get isTruthy() {\n return this.value != 0.0;\n }\n public get valueType() {\n return ValueType.Float;\n }\n\n public Cast(newType: ValueType): Value {\n if (this.value === null) return throwNullException(\"Value.value\");\n\n if (newType == this.valueType) {\n return this;\n }\n\n if (newType == ValueType.Bool) {\n return new BoolValue(this.value === 0.0 ? false : true);\n }\n\n if (newType == ValueType.Int) {\n return new IntValue(this.value);\n }\n\n if (newType == ValueType.String) {\n return new StringValue(\"\" + this.value);\n }\n\n throw this.BadCastException(newType);\n }\n}\n\nexport class StringValue extends Value {\n public _isNewline: boolean;\n public _isInlineWhitespace: boolean;\n\n constructor(val: string) {\n super(val || \"\");\n\n this._isNewline = this.value == \"\\n\";\n this._isInlineWhitespace = true;\n\n if (this.value === null) return throwNullException(\"Value.value\");\n\n if (this.value.length > 0) {\n this.value.split(\"\").every((c) => {\n if (c != \" \" && c != \"\\t\") {\n this._isInlineWhitespace = false;\n return false;\n }\n\n return true;\n });\n }\n }\n public get valueType() {\n return ValueType.String;\n }\n public get isTruthy() {\n if (this.value === null) return throwNullException(\"Value.value\");\n return this.value.length > 0;\n }\n public get isNewline() {\n return this._isNewline;\n }\n public get isInlineWhitespace() {\n return this._isInlineWhitespace;\n }\n public get isNonWhitespace() {\n return !this.isNewline && !this.isInlineWhitespace;\n }\n\n public Cast(newType: ValueType): Value {\n if (newType == this.valueType) {\n return this;\n }\n\n if (newType == ValueType.Int) {\n let parsedInt = tryParseInt(this.value);\n if (parsedInt.exists) {\n return new IntValue(parsedInt.result);\n } else {\n throw this.BadCastException(newType);\n }\n }\n\n if (newType == ValueType.Float) {\n let parsedFloat = tryParseFloat(this.value);\n if (parsedFloat.exists) {\n return new FloatValue(parsedFloat.result);\n } else {\n throw this.BadCastException(newType);\n }\n }\n\n throw this.BadCastException(newType);\n }\n}\n\nexport class DivertTargetValue extends Value {\n constructor(targetPath: Path | null = null) {\n super(targetPath);\n }\n public get valueType() {\n return ValueType.DivertTarget;\n }\n public get targetPath() {\n if (this.value === null) return throwNullException(\"Value.value\");\n return this.value;\n }\n public set targetPath(value: Path) {\n this.value = value;\n }\n public get isTruthy(): never {\n throw new Error(\"Shouldn't be checking the truthiness of a divert target\");\n }\n\n public Cast(newType: ValueType): Value {\n if (newType == this.valueType) return this;\n\n throw this.BadCastException(newType);\n }\n public toString() {\n return \"DivertTargetValue(\" + this.targetPath + \")\";\n }\n}\n\nexport class VariablePointerValue extends Value {\n public _contextIndex: number;\n\n constructor(variableName: string, contextIndex: number = -1) {\n super(variableName);\n\n this._contextIndex = contextIndex;\n }\n\n public get contextIndex() {\n return this._contextIndex;\n }\n public set contextIndex(value: number) {\n this._contextIndex = value;\n }\n public get variableName() {\n if (this.value === null) return throwNullException(\"Value.value\");\n return this.value;\n }\n public set variableName(value: string) {\n this.value = value;\n }\n public get valueType() {\n return ValueType.VariablePointer;\n }\n\n public get isTruthy(): never {\n throw new Error(\n \"Shouldn't be checking the truthiness of a variable pointer\"\n );\n }\n\n public Cast(newType: ValueType): Value {\n if (newType == this.valueType) return this;\n\n throw this.BadCastException(newType);\n }\n public toString() {\n return \"VariablePointerValue(\" + this.variableName + \")\";\n }\n public Copy() {\n return new VariablePointerValue(this.variableName, this.contextIndex);\n }\n}\n\nexport class ListValue extends Value {\n public get isTruthy() {\n if (this.value === null) {\n return throwNullException(\"this.value\");\n }\n return this.value.Count > 0;\n }\n public get valueType() {\n return ValueType.List;\n }\n public Cast(newType: ValueType): Value {\n if (this.value === null) return throwNullException(\"Value.value\");\n\n if (newType == ValueType.Int) {\n let max = this.value.maxItem;\n if (max.Key.isNull) return new IntValue(0);\n else return new IntValue(max.Value);\n } else if (newType == ValueType.Float) {\n let max = this.value.maxItem;\n if (max.Key.isNull) return new FloatValue(0.0);\n else return new FloatValue(max.Value);\n } else if (newType == ValueType.String) {\n let max = this.value.maxItem;\n if (max.Key.isNull) return new StringValue(\"\");\n else {\n return new StringValue(max.Key.toString());\n }\n }\n\n if (newType == this.valueType) return this;\n\n throw this.BadCastException(newType);\n }\n constructor();\n constructor(list: InkList);\n constructor(listOrSingleItem: InkListItem, singleValue: number);\n constructor(listOrSingleItem?: InkListItem | InkList, singleValue?: number) {\n super(null);\n\n if (!listOrSingleItem && !singleValue) {\n this.value = new InkList();\n } else if (listOrSingleItem instanceof InkList) {\n this.value = new InkList(listOrSingleItem);\n } else if (\n listOrSingleItem instanceof InkListItem &&\n typeof singleValue === \"number\"\n ) {\n this.value = new InkList({\n Key: listOrSingleItem,\n Value: singleValue,\n });\n }\n }\n public static RetainListOriginsForAssignment(\n oldValue: InkObject | null,\n newValue: InkObject\n ) {\n let oldList = asOrNull(oldValue, ListValue);\n let newList = asOrNull(newValue, ListValue);\n\n if (newList && newList.value === null)\n return throwNullException(\"newList.value\");\n if (oldList && oldList.value === null)\n return throwNullException(\"oldList.value\");\n\n // When assigning the empty list, try to retain any initial origin names\n if (oldList && newList && newList.value!.Count == 0)\n newList.value!.SetInitialOriginNames(oldList.value!.originNames);\n }\n}\n\nexport enum ValueType {\n Bool = -1,\n Int = 0,\n Float = 1,\n List = 2,\n String = 3,\n DivertTarget = 4,\n VariablePointer = 5,\n}\n","import { InkObject } from \"./Object\";\nimport { Container } from \"./Container\";\n\nexport class SearchResult {\n public obj: InkObject | null = null;\n public approximate: boolean = false;\n\n get correctObj() {\n return this.approximate ? null : this.obj;\n }\n\n get container() {\n return this.obj instanceof Container ? this.obj : null;\n }\n\n public copy() {\n let searchResult = new SearchResult();\n searchResult.obj = this.obj;\n searchResult.approximate = this.approximate;\n\n return searchResult;\n }\n}\n","import { StringValue } from \"./Value\";\nimport { throwNullException } from \"./NullException\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { INamedContent } from \"./INamedContent\";\nimport { InkObject } from \"./Object\";\nimport { SearchResult } from \"./SearchResult\";\nimport { Path } from \"./Path\";\nimport { Debug } from \"./Debug\";\nimport { tryGetValueFromMap } from \"./TryGetResult\";\nimport { asINamedContentOrNull, asOrNull, asOrThrows } from \"./TypeAssertion\";\n\nexport class Container extends InkObject implements INamedContent {\n public name: string | null = null;\n\n public _content: InkObject[] = [];\n public namedContent: Map = new Map();\n\n public visitsShouldBeCounted: boolean = false;\n public turnIndexShouldBeCounted: boolean = false;\n public countingAtStartOnly: boolean = false;\n\n public _pathToFirstLeafContent: Path | null = null;\n\n get hasValidName() {\n return this.name != null && this.name.length > 0;\n }\n get content() {\n return this._content;\n }\n set content(value: InkObject[]) {\n this.AddContent(value);\n }\n get namedOnlyContent() {\n let namedOnlyContentDict: Map | null = new Map();\n\n for (let [key, value] of this.namedContent) {\n let inkObject = asOrThrows(value, InkObject);\n namedOnlyContentDict.set(key, inkObject);\n }\n\n for (let c of this.content) {\n let named = asINamedContentOrNull(c);\n if (named != null && named.hasValidName) {\n namedOnlyContentDict.delete(named.name!);\n }\n }\n\n if (namedOnlyContentDict.size == 0) namedOnlyContentDict = null;\n\n return namedOnlyContentDict;\n }\n set namedOnlyContent(value: Map | null) {\n let existingNamedOnly = this.namedOnlyContent;\n if (existingNamedOnly != null) {\n for (let [key] of existingNamedOnly) {\n this.namedContent.delete(key);\n }\n }\n\n if (value == null) return;\n\n for (let [, val] of value) {\n let named = asINamedContentOrNull(val);\n if (named != null) this.AddToNamedContentOnly(named);\n }\n }\n get countFlags(): number {\n let flags: Container.CountFlags = 0;\n if (this.visitsShouldBeCounted) flags |= Container.CountFlags.Visits;\n if (this.turnIndexShouldBeCounted) flags |= Container.CountFlags.Turns;\n if (this.countingAtStartOnly) flags |= Container.CountFlags.CountStartOnly;\n\n if (flags == Container.CountFlags.CountStartOnly) {\n flags = 0;\n }\n\n return flags;\n }\n set countFlags(value: number) {\n let flag: Container.CountFlags = value;\n if ((flag & Container.CountFlags.Visits) > 0)\n this.visitsShouldBeCounted = true;\n if ((flag & Container.CountFlags.Turns) > 0)\n this.turnIndexShouldBeCounted = true;\n if ((flag & Container.CountFlags.CountStartOnly) > 0)\n this.countingAtStartOnly = true;\n }\n get pathToFirstLeafContent() {\n if (this._pathToFirstLeafContent == null)\n this._pathToFirstLeafContent = this.path.PathByAppendingPath(\n this.internalPathToFirstLeafContent\n );\n\n return this._pathToFirstLeafContent;\n }\n get internalPathToFirstLeafContent() {\n let components: Path.Component[] = [];\n let container: Container = this;\n while (container instanceof Container) {\n if (container.content.length > 0) {\n components.push(new Path.Component(0));\n container = container.content[0] as Container;\n }\n }\n return new Path(components);\n }\n\n public AddContent(contentObjOrList: InkObject | InkObject[]) {\n if (contentObjOrList instanceof Array) {\n let contentList = contentObjOrList as InkObject[];\n\n for (let c of contentList) {\n this.AddContent(c);\n }\n } else {\n let contentObj = contentObjOrList as InkObject;\n\n this._content.push(contentObj);\n\n if (contentObj.parent) {\n throw new Error(\"content is already in \" + contentObj.parent);\n }\n\n contentObj.parent = this;\n\n this.TryAddNamedContent(contentObj);\n }\n }\n public TryAddNamedContent(contentObj: InkObject) {\n let namedContentObj = asINamedContentOrNull(contentObj);\n if (namedContentObj != null && namedContentObj.hasValidName) {\n this.AddToNamedContentOnly(namedContentObj);\n }\n }\n public AddToNamedContentOnly(namedContentObj: INamedContent) {\n Debug.AssertType(\n namedContentObj,\n InkObject,\n \"Can only add Runtime.Objects to a Runtime.Container\"\n );\n let runtimeObj = asOrThrows(namedContentObj, InkObject);\n runtimeObj.parent = this;\n\n if (namedContentObj.name === null)\n return throwNullException(\"namedContentObj.name\");\n this.namedContent.set(namedContentObj.name!, namedContentObj);\n }\n public ContentAtPath(\n path: Path,\n partialPathStart: number = 0,\n partialPathLength: number = -1\n ) {\n if (partialPathLength == -1) partialPathLength = path.length;\n\n let result = new SearchResult();\n result.approximate = false;\n\n let currentContainer: Container | null = this;\n let currentObj: InkObject = this;\n\n for (let i = partialPathStart; i < partialPathLength; ++i) {\n let comp = path.GetComponent(i);\n if (currentContainer == null) {\n result.approximate = true;\n break;\n }\n\n let foundObj: InkObject | null =\n currentContainer.ContentWithPathComponent(comp);\n\n if (foundObj == null) {\n result.approximate = true;\n break;\n }\n\n currentObj = foundObj;\n currentContainer = asOrNull(foundObj, Container);\n }\n\n result.obj = currentObj;\n\n return result;\n }\n public InsertContent(contentObj: InkObject, index: number) {\n this.content.splice(index, 0, contentObj);\n\n if (contentObj.parent) {\n throw new Error(\"content is already in \" + contentObj.parent);\n }\n\n contentObj.parent = this;\n\n this.TryAddNamedContent(contentObj);\n }\n public AddContentsOfContainer(otherContainer: Container) {\n this.content.push(...otherContainer.content);\n\n for (let obj of otherContainer.content) {\n obj.parent = this;\n this.TryAddNamedContent(obj);\n }\n }\n public ContentWithPathComponent(component: Path.Component): InkObject | null {\n if (component.isIndex) {\n if (component.index >= 0 && component.index < this.content.length) {\n return this.content[component.index];\n } else {\n return null;\n }\n } else if (component.isParent) {\n return this.parent;\n } else {\n if (component.name === null) {\n return throwNullException(\"component.name\");\n }\n let foundContent = tryGetValueFromMap(\n this.namedContent,\n component.name,\n null\n );\n if (foundContent.exists) {\n return asOrThrows(foundContent.result, InkObject);\n } else {\n return null;\n }\n }\n }\n public BuildStringOfHierarchy(): string;\n public BuildStringOfHierarchy(\n sb: StringBuilder,\n indentation: number,\n pointedObj: InkObject | null\n ): string;\n public BuildStringOfHierarchy() {\n let sb: StringBuilder;\n if (arguments.length == 0) {\n sb = new StringBuilder();\n this.BuildStringOfHierarchy(sb, 0, null);\n return sb.toString();\n }\n\n sb = arguments[0] as StringBuilder;\n let indentation = arguments[1] as number;\n let pointedObj = arguments[2] as InkObject | null;\n\n function appendIndentation() {\n const spacesPerIndent = 4; // Truly const in the original code\n for (let i = 0; i < spacesPerIndent * indentation; ++i) {\n sb.Append(\" \");\n }\n }\n\n appendIndentation();\n sb.Append(\"[\");\n\n if (this.hasValidName) {\n sb.AppendFormat(\" ({0})\", this.name);\n }\n\n if (this == pointedObj) {\n sb.Append(\" <---\");\n }\n\n sb.AppendLine();\n\n indentation++;\n\n for (let i = 0; i < this.content.length; ++i) {\n let obj = this.content[i];\n\n if (obj instanceof Container) {\n let container = obj as Container;\n\n container.BuildStringOfHierarchy(sb, indentation, pointedObj);\n } else {\n appendIndentation();\n if (obj instanceof StringValue) {\n sb.Append('\"');\n sb.Append(obj.toString().replace(\"\\n\", \"\\\\n\"));\n sb.Append('\"');\n } else {\n sb.Append(obj.toString());\n }\n }\n\n if (i != this.content.length - 1) {\n sb.Append(\",\");\n }\n\n if (!(obj instanceof Container) && obj == pointedObj) {\n sb.Append(\" <---\");\n }\n\n sb.AppendLine();\n }\n\n let onlyNamed: Map = new Map();\n\n for (let [key, value] of this.namedContent) {\n if (this.content.indexOf(asOrThrows(value, InkObject)) >= 0) {\n continue;\n } else {\n onlyNamed.set(key, value);\n }\n }\n\n if (onlyNamed.size > 0) {\n appendIndentation();\n sb.AppendLine(\"-- named: --\");\n\n for (let [, value] of onlyNamed) {\n Debug.AssertType(\n value,\n Container,\n \"Can only print out named Containers\"\n );\n let container = value as Container;\n container.BuildStringOfHierarchy(sb, indentation, pointedObj);\n sb.AppendLine();\n }\n }\n\n indentation--;\n\n appendIndentation();\n sb.Append(\"]\");\n }\n}\n\nexport namespace Container {\n export enum CountFlags {\n Visits = 1,\n Turns = 2,\n CountStartOnly = 4,\n }\n}\n","import { InkObject } from \"./Object\";\n\nexport class Glue extends InkObject {\n public toString() {\n return \"Glue\";\n }\n}\n","export enum PushPopType {\n Tunnel = 0,\n Function = 1,\n FunctionEvaluationFromGame = 2,\n}\n","import { InkObject } from \"./Object\";\n\nexport class ControlCommand extends InkObject {\n private _commandType: ControlCommand.CommandType;\n\n get commandType(): ControlCommand.CommandType {\n return this._commandType;\n }\n\n constructor(\n commandType: ControlCommand.CommandType = ControlCommand.CommandType.NotSet\n ) {\n super();\n this._commandType = commandType;\n }\n\n public Copy() {\n return new ControlCommand(this.commandType);\n }\n public static EvalStart() {\n return new ControlCommand(ControlCommand.CommandType.EvalStart);\n }\n public static EvalOutput() {\n return new ControlCommand(ControlCommand.CommandType.EvalOutput);\n }\n public static EvalEnd() {\n return new ControlCommand(ControlCommand.CommandType.EvalEnd);\n }\n public static Duplicate() {\n return new ControlCommand(ControlCommand.CommandType.Duplicate);\n }\n public static PopEvaluatedValue() {\n return new ControlCommand(ControlCommand.CommandType.PopEvaluatedValue);\n }\n public static PopFunction() {\n return new ControlCommand(ControlCommand.CommandType.PopFunction);\n }\n public static PopTunnel() {\n return new ControlCommand(ControlCommand.CommandType.PopTunnel);\n }\n public static BeginString() {\n return new ControlCommand(ControlCommand.CommandType.BeginString);\n }\n public static EndString() {\n return new ControlCommand(ControlCommand.CommandType.EndString);\n }\n public static NoOp() {\n return new ControlCommand(ControlCommand.CommandType.NoOp);\n }\n public static ChoiceCount() {\n return new ControlCommand(ControlCommand.CommandType.ChoiceCount);\n }\n public static Turns() {\n return new ControlCommand(ControlCommand.CommandType.Turns);\n }\n public static TurnsSince() {\n return new ControlCommand(ControlCommand.CommandType.TurnsSince);\n }\n public static ReadCount() {\n return new ControlCommand(ControlCommand.CommandType.ReadCount);\n }\n public static Random() {\n return new ControlCommand(ControlCommand.CommandType.Random);\n }\n public static SeedRandom() {\n return new ControlCommand(ControlCommand.CommandType.SeedRandom);\n }\n public static VisitIndex() {\n return new ControlCommand(ControlCommand.CommandType.VisitIndex);\n }\n public static SequenceShuffleIndex() {\n return new ControlCommand(ControlCommand.CommandType.SequenceShuffleIndex);\n }\n public static StartThread() {\n return new ControlCommand(ControlCommand.CommandType.StartThread);\n }\n public static Done() {\n return new ControlCommand(ControlCommand.CommandType.Done);\n }\n public static End() {\n return new ControlCommand(ControlCommand.CommandType.End);\n }\n public static ListFromInt() {\n return new ControlCommand(ControlCommand.CommandType.ListFromInt);\n }\n public static ListRange() {\n return new ControlCommand(ControlCommand.CommandType.ListRange);\n }\n public static ListRandom() {\n return new ControlCommand(ControlCommand.CommandType.ListRandom);\n }\n public static BeginTag() {\n return new ControlCommand(ControlCommand.CommandType.BeginTag);\n }\n public static EndTag() {\n return new ControlCommand(ControlCommand.CommandType.EndTag);\n }\n public toString() {\n return this.commandType.toString();\n }\n}\n\nexport namespace ControlCommand {\n export enum CommandType {\n NotSet = -1,\n EvalStart, // 0\n EvalOutput, // 1\n EvalEnd, // 2\n Duplicate, // 3\n PopEvaluatedValue, // 4\n PopFunction, // 5\n PopTunnel, // 6\n BeginString, // 7\n EndString, // 8\n NoOp, // 9\n ChoiceCount, // 10\n Turns, // 11\n TurnsSince, // 12\n ReadCount, // 13\n Random, // 14\n SeedRandom, // 15\n VisitIndex, // 16\n SequenceShuffleIndex, // 17\n StartThread, // 18\n Done, // 19\n End, // 20\n ListFromInt, // 21\n ListRange, // 22\n ListRandom, // 23\n BeginTag, // 24\n EndTag, // 25\n\n TOTAL_VALUES,\n }\n}\n","import { Path } from \"./Path\";\nimport { Container } from \"./Container\";\nimport { InkObject } from \"./Object\";\n\nexport class Pointer {\n public container: Container | null = null;\n public index: number = -1;\n\n constructor();\n constructor(container: Container | null, index: number);\n constructor() {\n if (arguments.length === 2) {\n this.container = arguments[0];\n this.index = arguments[1];\n }\n }\n\n public Resolve(): InkObject | null {\n if (this.index < 0) return this.container;\n if (this.container == null) return null;\n if (this.container.content.length == 0) return this.container;\n if (this.index >= this.container.content.length) return null;\n\n return this.container.content[this.index];\n }\n\n get isNull(): boolean {\n return this.container == null;\n }\n\n get path(): Path | null {\n if (this.isNull) return null;\n\n if (this.index >= 0)\n return this.container!.path.PathByAppendingComponent(\n new Path.Component(this.index)\n );\n else return this.container!.path;\n }\n\n public toString(): string {\n if (!this.container) return \"Ink Pointer (null)\";\n\n return (\n \"Ink Pointer -> \" +\n this.container.path.toString() +\n \" -- index \" +\n this.index\n );\n }\n\n // This method does not exist in the original C# code, but is here to maintain the\n // value semantics of Pointer.\n public copy(): Pointer {\n return new Pointer(this.container, this.index);\n }\n\n public static StartOf(container: Container | null): Pointer {\n return new Pointer(container, 0);\n }\n\n public static get Null(): Pointer {\n return new Pointer(null, -1);\n }\n}\n","import { Path } from \"./Path\";\nimport { PushPopType } from \"./PushPop\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { InkObject } from \"./Object\";\nimport { Pointer } from \"./Pointer\";\nimport { Container } from \"./Container\";\nimport { throwNullException } from \"./NullException\";\n\nexport class Divert extends InkObject {\n get targetPath() {\n if (this._targetPath != null && this._targetPath.isRelative) {\n let targetObj = this.targetPointer.Resolve();\n if (targetObj) {\n this._targetPath = targetObj.path;\n }\n }\n\n return this._targetPath;\n }\n set targetPath(value: Path | null) {\n this._targetPath = value;\n this._targetPointer = Pointer.Null;\n }\n\n public _targetPath: Path | null = null;\n\n get targetPointer() {\n if (this._targetPointer.isNull) {\n let targetObj = this.ResolvePath(this._targetPath).obj;\n\n if (this._targetPath === null)\n return throwNullException(\"this._targetPath\");\n if (this._targetPath.lastComponent === null)\n return throwNullException(\"this._targetPath.lastComponent\");\n\n if (this._targetPath.lastComponent.isIndex) {\n if (targetObj === null) return throwNullException(\"targetObj\");\n this._targetPointer.container =\n targetObj.parent instanceof Container ? targetObj.parent : null;\n this._targetPointer.index = this._targetPath.lastComponent.index;\n } else {\n this._targetPointer = Pointer.StartOf(\n targetObj instanceof Container ? targetObj : null\n );\n }\n }\n\n return this._targetPointer.copy();\n }\n\n public _targetPointer: Pointer = Pointer.Null;\n\n get targetPathString() {\n if (this.targetPath == null) return null;\n\n return this.CompactPathString(this.targetPath);\n }\n set targetPathString(value: string | null) {\n if (value == null) {\n this.targetPath = null;\n } else {\n this.targetPath = new Path(value);\n }\n }\n\n public variableDivertName: string | null = null;\n get hasVariableTarget() {\n return this.variableDivertName != null;\n }\n\n public pushesToStack: boolean = false;\n public stackPushType: PushPopType = 0;\n\n public isExternal: boolean = false;\n public externalArgs: number = 0;\n\n public isConditional: boolean = false;\n\n constructor(stackPushType?: PushPopType) {\n super();\n this.pushesToStack = false;\n\n if (typeof stackPushType !== \"undefined\") {\n this.pushesToStack = true;\n this.stackPushType = stackPushType;\n }\n }\n\n public Equals(obj: Divert | null) {\n let otherDivert = obj;\n if (otherDivert instanceof Divert) {\n if (this.hasVariableTarget == otherDivert.hasVariableTarget) {\n if (this.hasVariableTarget) {\n return this.variableDivertName == otherDivert.variableDivertName;\n } else {\n if (this.targetPath === null)\n return throwNullException(\"this.targetPath\");\n return this.targetPath.Equals(otherDivert.targetPath);\n }\n }\n }\n return false;\n }\n\n public toString() {\n if (this.hasVariableTarget) {\n return \"Divert(variable: \" + this.variableDivertName + \")\";\n } else if (this.targetPath == null) {\n return \"Divert(null)\";\n } else {\n let sb = new StringBuilder();\n\n let targetStr = this.targetPath.toString();\n // int? targetLineNum = DebugLineNumberOfPath (targetPath);\n let targetLineNum = null;\n if (targetLineNum != null) {\n targetStr = \"line \" + targetLineNum;\n }\n\n sb.Append(\"Divert\");\n\n if (this.isConditional) sb.Append(\"?\");\n\n if (this.pushesToStack) {\n if (this.stackPushType == PushPopType.Function) {\n sb.Append(\" function\");\n } else {\n sb.Append(\" tunnel\");\n }\n }\n\n sb.Append(\" -> \");\n sb.Append(this.targetPathString);\n\n sb.Append(\" (\");\n sb.Append(targetStr);\n sb.Append(\")\");\n\n return sb.toString();\n }\n }\n}\n","import { InkObject } from \"./Object\";\nimport { Path } from \"./Path\";\nimport { Container } from \"./Container\";\nimport { throwNullException } from \"./NullException\";\n\nexport class ChoicePoint extends InkObject {\n public _pathOnChoice: Path | null = null;\n public hasCondition: boolean = false;\n public hasStartContent: boolean = false;\n public hasChoiceOnlyContent: boolean = false;\n public isInvisibleDefault: boolean = false;\n public onceOnly: boolean = true;\n\n constructor(onceOnly: boolean = true) {\n super();\n this.onceOnly = onceOnly;\n }\n get pathOnChoice(): Path | null {\n if (this._pathOnChoice != null && this._pathOnChoice.isRelative) {\n let choiceTargetObj = this.choiceTarget;\n if (choiceTargetObj) {\n this._pathOnChoice = choiceTargetObj.path;\n }\n }\n return this._pathOnChoice;\n }\n set pathOnChoice(value: Path | null) {\n this._pathOnChoice = value;\n }\n get choiceTarget(): Container | null {\n if (this._pathOnChoice === null)\n return throwNullException(\"ChoicePoint._pathOnChoice\");\n return this.ResolvePath(this._pathOnChoice).container;\n }\n get pathStringOnChoice(): string {\n if (this.pathOnChoice === null)\n return throwNullException(\"ChoicePoint.pathOnChoice\");\n return this.CompactPathString(this.pathOnChoice);\n }\n set pathStringOnChoice(value: string) {\n this.pathOnChoice = new Path(value);\n }\n get flags(): number {\n let flags = 0;\n if (this.hasCondition) flags |= 1;\n if (this.hasStartContent) flags |= 2;\n if (this.hasChoiceOnlyContent) flags |= 4;\n if (this.isInvisibleDefault) flags |= 8;\n if (this.onceOnly) flags |= 16;\n return flags;\n }\n set flags(value: number) {\n this.hasCondition = (value & 1) > 0;\n this.hasStartContent = (value & 2) > 0;\n this.hasChoiceOnlyContent = (value & 4) > 0;\n this.isInvisibleDefault = (value & 8) > 0;\n this.onceOnly = (value & 16) > 0;\n }\n public toString(): string {\n if (this.pathOnChoice === null)\n return throwNullException(\"ChoicePoint.pathOnChoice\");\n // int? targetLineNum = DebugLineNumberOfPath (pathOnChoice);\n let targetLineNum = null;\n let targetString = this.pathOnChoice.toString();\n\n if (targetLineNum != null) {\n targetString = \" line \" + targetLineNum + \"(\" + targetString + \")\";\n }\n\n return \"Choice: -> \" + targetString;\n }\n}\n","import { InkObject } from \"./Object\";\nimport { Path } from \"./Path\";\n\nexport class VariableReference extends InkObject {\n public name: string | null;\n public pathForCount: Path | null = null;\n\n get containerForCount() {\n if (this.pathForCount === null) return null;\n return this.ResolvePath(this.pathForCount).container;\n }\n get pathStringForCount() {\n if (this.pathForCount === null) return null;\n\n return this.CompactPathString(this.pathForCount);\n }\n set pathStringForCount(value: string | null) {\n if (value === null) this.pathForCount = null;\n else this.pathForCount = new Path(value);\n }\n\n constructor(name: string | null = null) {\n super();\n this.name = name;\n }\n\n public toString() {\n if (this.name != null) {\n return \"var(\" + this.name + \")\";\n } else {\n let pathStr = this.pathStringForCount;\n return \"read_count(\" + pathStr + \")\";\n }\n }\n}\n","import { InkObject } from \"./Object\";\n\nexport class VariableAssignment extends InkObject {\n public readonly variableName: string | null;\n public readonly isNewDeclaration: boolean;\n public isGlobal: boolean;\n\n constructor(variableName: string | null, isNewDeclaration: boolean) {\n super();\n this.variableName = variableName || null;\n this.isNewDeclaration = !!isNewDeclaration;\n this.isGlobal = false;\n }\n\n public toString(): string {\n return \"VarAssign to \" + this.variableName;\n }\n}\n","import { InkObject } from \"./Object\";\n\nexport class Void extends InkObject {}\n","import { Value, ValueType, IntValue, ListValue, BoolValue } from \"./Value\";\nimport { StoryException } from \"./StoryException\";\nimport { Void } from \"./Void\";\nimport { Path } from \"./Path\";\nimport { InkList, InkListItem } from \"./InkList\";\nimport { InkObject } from \"./Object\";\nimport { asOrNull, asOrThrows, asBooleanOrThrows } from \"./TypeAssertion\";\nimport { throwNullException } from \"./NullException\";\n\ntype BinaryOp = (left: T, right: T) => any;\ntype UnaryOp = (val: T) => any;\n\nexport class NativeFunctionCall extends InkObject {\n public static readonly Add: string = \"+\";\n public static readonly Subtract: string = \"-\";\n public static readonly Divide: string = \"/\";\n public static readonly Multiply: string = \"*\";\n public static readonly Mod: string = \"%\";\n public static readonly Negate: string = \"_\";\n public static readonly Equal: string = \"==\";\n public static readonly Greater: string = \">\";\n public static readonly Less: string = \"<\";\n public static readonly GreaterThanOrEquals: string = \">=\";\n public static readonly LessThanOrEquals: string = \"<=\";\n public static readonly NotEquals: string = \"!=\";\n public static readonly Not: string = \"!\";\n public static readonly And: string = \"&&\";\n public static readonly Or: string = \"||\";\n public static readonly Min: string = \"MIN\";\n public static readonly Max: string = \"MAX\";\n public static readonly Pow: string = \"POW\";\n public static readonly Floor: string = \"FLOOR\";\n public static readonly Ceiling: string = \"CEILING\";\n public static readonly Int: string = \"INT\";\n public static readonly Float: string = \"FLOAT\";\n public static readonly Has: string = \"?\";\n public static readonly Hasnt: string = \"!?\";\n public static readonly Intersect: string = \"^\";\n public static readonly ListMin: string = \"LIST_MIN\";\n public static readonly ListMax: string = \"LIST_MAX\";\n public static readonly All: string = \"LIST_ALL\";\n public static readonly Count: string = \"LIST_COUNT\";\n public static readonly ValueOfList: string = \"LIST_VALUE\";\n public static readonly Invert: string = \"LIST_INVERT\";\n\n public static CallWithName(functionName: string) {\n return new NativeFunctionCall(functionName);\n }\n\n public static CallExistsWithName(functionName: string) {\n this.GenerateNativeFunctionsIfNecessary();\n return this._nativeFunctions!.get(functionName);\n }\n\n get name() {\n if (this._name === null)\n return throwNullException(\"NativeFunctionCall._name\");\n return this._name;\n }\n set name(value: string) {\n this._name = value;\n if (!this._isPrototype) {\n if (NativeFunctionCall._nativeFunctions === null)\n throwNullException(\"NativeFunctionCall._nativeFunctions\");\n else\n this._prototype =\n NativeFunctionCall._nativeFunctions.get(this._name) || null;\n }\n }\n public _name: string | null = null;\n\n get numberOfParameters() {\n if (this._prototype) {\n return this._prototype.numberOfParameters;\n } else {\n return this._numberOfParameters;\n }\n }\n set numberOfParameters(value: number) {\n this._numberOfParameters = value;\n }\n public _numberOfParameters: number = 0;\n\n public Call(parameters: InkObject[]): InkObject | null {\n if (this._prototype) {\n return this._prototype.Call(parameters);\n }\n\n if (this.numberOfParameters != parameters.length) {\n throw new Error(\"Unexpected number of parameters\");\n }\n\n let hasList = false;\n for (let p of parameters) {\n if (p instanceof Void)\n throw new StoryException(\n 'Attempting to perform operation on a void value. Did you forget to \"return\" a value from a function you called here?'\n );\n if (p instanceof ListValue) hasList = true;\n }\n\n if (parameters.length == 2 && hasList) {\n return this.CallBinaryListOperation(parameters);\n }\n\n let coercedParams = this.CoerceValuesToSingleType(parameters);\n let coercedType = coercedParams[0].valueType;\n\n if (coercedType == ValueType.Int) {\n return this.CallType(coercedParams);\n } else if (coercedType == ValueType.Float) {\n return this.CallType(coercedParams);\n } else if (coercedType == ValueType.String) {\n return this.CallType(coercedParams);\n } else if (coercedType == ValueType.DivertTarget) {\n return this.CallType(coercedParams);\n } else if (coercedType == ValueType.List) {\n return this.CallType(coercedParams);\n }\n\n return null;\n }\n\n public CallType string; }>(parametersOfSingleType: Array>) {\n let param1 = asOrThrows(parametersOfSingleType[0], Value);\n let valType = param1.valueType;\n\n let val1 = param1 as Value;\n\n let paramCount = parametersOfSingleType.length;\n\n if (paramCount == 2 || paramCount == 1) {\n if (this._operationFuncs === null)\n return throwNullException(\"NativeFunctionCall._operationFuncs\");\n let opForTypeObj = this._operationFuncs.get(valType);\n if (!opForTypeObj) {\n const key = ValueType[valType];\n throw new StoryException(\n \"Cannot perform operation \" + this.name + \" on \" + key\n );\n }\n\n if (paramCount == 2) {\n let param2 = asOrThrows(parametersOfSingleType[1], Value);\n\n let val2 = param2 as Value;\n\n let opForType = opForTypeObj as BinaryOp;\n\n if (val1.value === null || val2.value === null)\n return throwNullException(\"NativeFunctionCall.Call BinaryOp values\");\n let resultVal = opForType(val1.value, val2.value);\n\n return Value.Create(resultVal);\n } else {\n let opForType = opForTypeObj as UnaryOp;\n\n if (val1.value === null)\n return throwNullException(\"NativeFunctionCall.Call UnaryOp value\");\n let resultVal = opForType(val1.value);\n\n // This code is different from upstream. Since JavaScript treats\n // integers and floats as the same numbers, it's impossible\n // to force an number to be either an integer or a float.\n //\n // It can be useful to force a specific number type\n // (especially for divisions), so the result of INT() & FLOAT()\n // is coerced to the the proper value type.\n //\n // Note that we also force all other unary operation to\n // return the same value type, although this is only\n // meaningful for numbers. See `Value.Create`.\n if (this.name === NativeFunctionCall.Int) {\n return Value.Create(resultVal, ValueType.Int);\n } else if (this.name === NativeFunctionCall.Float) {\n return Value.Create(resultVal, ValueType.Float);\n } else {\n return Value.Create(resultVal, param1.valueType);\n }\n }\n } else {\n throw new Error(\n \"Unexpected number of parameters to NativeFunctionCall: \" +\n parametersOfSingleType.length\n );\n }\n }\n\n public CallBinaryListOperation(parameters: InkObject[]) {\n if (\n (this.name == \"+\" || this.name == \"-\") &&\n parameters[0] instanceof ListValue &&\n parameters[1] instanceof IntValue\n )\n return this.CallListIncrementOperation(parameters);\n\n let v1 = asOrThrows(parameters[0], Value);\n let v2 = asOrThrows(parameters[1], Value);\n\n if (\n (this.name == \"&&\" || this.name == \"||\") &&\n (v1.valueType != ValueType.List || v2.valueType != ValueType.List)\n ) {\n if (this._operationFuncs === null)\n return throwNullException(\"NativeFunctionCall._operationFuncs\");\n let op = this._operationFuncs.get(ValueType.Int) as BinaryOp;\n if (op === null)\n return throwNullException(\n \"NativeFunctionCall.CallBinaryListOperation op\"\n );\n let result = asBooleanOrThrows(\n op(v1.isTruthy ? 1 : 0, v2.isTruthy ? 1 : 0)\n );\n return new BoolValue(result);\n }\n\n if (v1.valueType == ValueType.List && v2.valueType == ValueType.List)\n return this.CallType([v1, v2]);\n\n throw new StoryException(\n \"Can not call use \" +\n this.name +\n \" operation on \" +\n ValueType[v1.valueType] +\n \" and \" +\n ValueType[v2.valueType]\n );\n }\n\n public CallListIncrementOperation(listIntParams: InkObject[]) {\n let listVal = asOrThrows(listIntParams[0], ListValue);\n let intVal = asOrThrows(listIntParams[1], IntValue);\n\n let resultInkList = new InkList();\n\n if (listVal.value === null)\n return throwNullException(\n \"NativeFunctionCall.CallListIncrementOperation listVal.value\"\n );\n for (let [listItemKey, listItemValue] of listVal.value) {\n let listItem = InkListItem.fromSerializedKey(listItemKey);\n\n if (this._operationFuncs === null)\n return throwNullException(\"NativeFunctionCall._operationFuncs\");\n let intOp = this._operationFuncs.get(ValueType.Int) as BinaryOp;\n\n if (intVal.value === null)\n return throwNullException(\n \"NativeFunctionCall.CallListIncrementOperation intVal.value\"\n );\n let targetInt = intOp(listItemValue, intVal.value);\n\n let itemOrigin = null;\n if (listVal.value.origins === null)\n return throwNullException(\n \"NativeFunctionCall.CallListIncrementOperation listVal.value.origins\"\n );\n for (let origin of listVal.value.origins) {\n if (origin.name == listItem.originName) {\n itemOrigin = origin;\n break;\n }\n }\n if (itemOrigin != null) {\n let incrementedItem = itemOrigin.TryGetItemWithValue(\n targetInt,\n InkListItem.Null\n );\n if (incrementedItem.exists)\n resultInkList.Add(incrementedItem.result, targetInt);\n }\n }\n\n return new ListValue(resultInkList);\n }\n\n public CoerceValuesToSingleType(parametersIn: InkObject[]) {\n let valType = ValueType.Int;\n\n let specialCaseList: null | ListValue = null;\n\n for (let obj of parametersIn) {\n let val = asOrThrows(obj, Value);\n if (val.valueType > valType) {\n valType = val.valueType;\n }\n\n if (val.valueType == ValueType.List) {\n specialCaseList = asOrNull(val, ListValue);\n }\n }\n\n let parametersOut = [];\n\n if (ValueType[valType] == ValueType[ValueType.List]) {\n for (let inkObjectVal of parametersIn) {\n let val = asOrThrows(inkObjectVal, Value);\n if (val.valueType == ValueType.List) {\n parametersOut.push(val);\n } else if (val.valueType == ValueType.Int) {\n let intVal = parseInt(val.valueObject);\n\n specialCaseList = asOrThrows(specialCaseList, ListValue);\n if (specialCaseList.value === null)\n return throwNullException(\n \"NativeFunctionCall.CoerceValuesToSingleType specialCaseList.value\"\n );\n let list = specialCaseList.value.originOfMaxItem;\n\n if (list === null)\n return throwNullException(\n \"NativeFunctionCall.CoerceValuesToSingleType list\"\n );\n let item = list.TryGetItemWithValue(intVal, InkListItem.Null);\n if (item.exists) {\n let castedValue = new ListValue(item.result, intVal);\n parametersOut.push(castedValue);\n } else\n throw new StoryException(\n \"Could not find List item with the value \" +\n intVal +\n \" in \" +\n list.name\n );\n } else {\n const key = ValueType[val.valueType];\n throw new StoryException(\n \"Cannot mix Lists and \" + key + \" values in this operation\"\n );\n }\n }\n } else {\n for (let inkObjectVal of parametersIn) {\n let val = asOrThrows(inkObjectVal, Value);\n let castedValue = val.Cast(valType);\n parametersOut.push(castedValue);\n }\n }\n\n return parametersOut;\n }\n\n constructor(name: string);\n constructor(name: string, numberOfParameters: number);\n constructor();\n constructor() {\n super();\n\n if (arguments.length === 0) {\n NativeFunctionCall.GenerateNativeFunctionsIfNecessary();\n } else if (arguments.length === 1) {\n let name = arguments[0];\n NativeFunctionCall.GenerateNativeFunctionsIfNecessary();\n this.name = name;\n } else if (arguments.length === 2) {\n let name = arguments[0];\n let numberOfParameters = arguments[1];\n\n this._isPrototype = true;\n this.name = name;\n this.numberOfParameters = numberOfParameters;\n }\n }\n\n public static Identity(t: T): any {\n return t;\n }\n\n public static GenerateNativeFunctionsIfNecessary() {\n if (this._nativeFunctions == null) {\n this._nativeFunctions = new Map();\n\n // Int operations\n this.AddIntBinaryOp(this.Add, (x, y) => x + y);\n this.AddIntBinaryOp(this.Subtract, (x, y) => x - y);\n this.AddIntBinaryOp(this.Multiply, (x, y) => x * y);\n this.AddIntBinaryOp(this.Divide, (x, y) => Math.floor(x / y));\n this.AddIntBinaryOp(this.Mod, (x, y) => x % y);\n this.AddIntUnaryOp(this.Negate, (x) => -x);\n\n this.AddIntBinaryOp(this.Equal, (x, y) => x == y);\n this.AddIntBinaryOp(this.Greater, (x, y) => x > y);\n this.AddIntBinaryOp(this.Less, (x, y) => x < y);\n this.AddIntBinaryOp(this.GreaterThanOrEquals, (x, y) => x >= y);\n this.AddIntBinaryOp(this.LessThanOrEquals, (x, y) => x <= y);\n this.AddIntBinaryOp(this.NotEquals, (x, y) => x != y);\n this.AddIntUnaryOp(this.Not, (x) => x == 0);\n\n this.AddIntBinaryOp(this.And, (x, y) => x != 0 && y != 0);\n this.AddIntBinaryOp(this.Or, (x, y) => x != 0 || y != 0);\n\n this.AddIntBinaryOp(this.Max, (x, y) => Math.max(x, y));\n this.AddIntBinaryOp(this.Min, (x, y) => Math.min(x, y));\n\n this.AddIntBinaryOp(this.Pow, (x, y) => Math.pow(x, y));\n this.AddIntUnaryOp(this.Floor, NativeFunctionCall.Identity);\n this.AddIntUnaryOp(this.Ceiling, NativeFunctionCall.Identity);\n this.AddIntUnaryOp(this.Int, NativeFunctionCall.Identity);\n this.AddIntUnaryOp(this.Float, (x) => x);\n\n // Float operations\n this.AddFloatBinaryOp(this.Add, (x, y) => x + y);\n this.AddFloatBinaryOp(this.Subtract, (x, y) => x - y);\n this.AddFloatBinaryOp(this.Multiply, (x, y) => x * y);\n this.AddFloatBinaryOp(this.Divide, (x, y) => x / y);\n this.AddFloatBinaryOp(this.Mod, (x, y) => x % y);\n this.AddFloatUnaryOp(this.Negate, (x) => -x);\n\n this.AddFloatBinaryOp(this.Equal, (x, y) => x == y);\n this.AddFloatBinaryOp(this.Greater, (x, y) => x > y);\n this.AddFloatBinaryOp(this.Less, (x, y) => x < y);\n this.AddFloatBinaryOp(this.GreaterThanOrEquals, (x, y) => x >= y);\n this.AddFloatBinaryOp(this.LessThanOrEquals, (x, y) => x <= y);\n this.AddFloatBinaryOp(this.NotEquals, (x, y) => x != y);\n this.AddFloatUnaryOp(this.Not, (x) => x == 0.0);\n\n this.AddFloatBinaryOp(this.And, (x, y) => x != 0.0 && y != 0.0);\n this.AddFloatBinaryOp(this.Or, (x, y) => x != 0.0 || y != 0.0);\n\n this.AddFloatBinaryOp(this.Max, (x, y) => Math.max(x, y));\n this.AddFloatBinaryOp(this.Min, (x, y) => Math.min(x, y));\n\n this.AddFloatBinaryOp(this.Pow, (x, y) => Math.pow(x, y));\n this.AddFloatUnaryOp(this.Floor, (x) => Math.floor(x));\n this.AddFloatUnaryOp(this.Ceiling, (x) => Math.ceil(x));\n this.AddFloatUnaryOp(this.Int, (x) => Math.floor(x));\n this.AddFloatUnaryOp(this.Float, NativeFunctionCall.Identity);\n\n // String operations\n this.AddStringBinaryOp(this.Add, (x, y) => x + y); // concat\n this.AddStringBinaryOp(this.Equal, (x, y) => x === y);\n this.AddStringBinaryOp(this.NotEquals, (x, y) => !(x === y));\n this.AddStringBinaryOp(this.Has, (x, y) => x.includes(y));\n this.AddStringBinaryOp(this.Hasnt, (x, y) => !x.includes(y));\n\n this.AddListBinaryOp(this.Add, (x, y) => x.Union(y));\n this.AddListBinaryOp(this.Subtract, (x, y) => x.Without(y));\n this.AddListBinaryOp(this.Has, (x, y) => x.Contains(y));\n this.AddListBinaryOp(this.Hasnt, (x, y) => !x.Contains(y));\n this.AddListBinaryOp(this.Intersect, (x, y) => x.Intersect(y));\n\n this.AddListBinaryOp(this.Equal, (x, y) => x.Equals(y));\n this.AddListBinaryOp(this.Greater, (x, y) => x.GreaterThan(y));\n this.AddListBinaryOp(this.Less, (x, y) => x.LessThan(y));\n this.AddListBinaryOp(this.GreaterThanOrEquals, (x, y) =>\n x.GreaterThanOrEquals(y)\n );\n this.AddListBinaryOp(this.LessThanOrEquals, (x, y) =>\n x.LessThanOrEquals(y)\n );\n this.AddListBinaryOp(this.NotEquals, (x, y) => !x.Equals(y));\n\n this.AddListBinaryOp(this.And, (x, y) => x.Count > 0 && y.Count > 0);\n this.AddListBinaryOp(this.Or, (x, y) => x.Count > 0 || y.Count > 0);\n\n this.AddListUnaryOp(this.Not, (x) => (x.Count == 0 ? 1 : 0));\n\n this.AddListUnaryOp(this.Invert, (x) => x.inverse);\n this.AddListUnaryOp(this.All, (x) => x.all);\n this.AddListUnaryOp(this.ListMin, (x) => x.MinAsList());\n this.AddListUnaryOp(this.ListMax, (x) => x.MaxAsList());\n this.AddListUnaryOp(this.Count, (x) => x.Count);\n this.AddListUnaryOp(this.ValueOfList, (x) => x.maxItem.Value);\n\n let divertTargetsEqual = (d1: Path, d2: Path) => d1.Equals(d2);\n let divertTargetsNotEqual = (d1: Path, d2: Path) => !d1.Equals(d2);\n this.AddOpToNativeFunc(\n this.Equal,\n 2,\n ValueType.DivertTarget,\n divertTargetsEqual\n );\n this.AddOpToNativeFunc(\n this.NotEquals,\n 2,\n ValueType.DivertTarget,\n divertTargetsNotEqual\n );\n }\n }\n\n public AddOpFuncForType(\n valType: ValueType,\n op: UnaryOp | BinaryOp\n ): void {\n if (this._operationFuncs == null) {\n this._operationFuncs = new Map();\n }\n\n this._operationFuncs.set(valType, op);\n }\n\n public static AddOpToNativeFunc(\n name: string,\n args: number,\n valType: ValueType,\n op: UnaryOp | BinaryOp\n ): void {\n if (this._nativeFunctions === null)\n return throwNullException(\"NativeFunctionCall._nativeFunctions\");\n let nativeFunc = this._nativeFunctions.get(name);\n if (!nativeFunc) {\n nativeFunc = new NativeFunctionCall(name, args);\n this._nativeFunctions.set(name, nativeFunc);\n }\n\n nativeFunc.AddOpFuncForType(valType, op);\n }\n\n public static AddIntBinaryOp(name: string, op: BinaryOp) {\n this.AddOpToNativeFunc(name, 2, ValueType.Int, op);\n }\n public static AddIntUnaryOp(name: string, op: UnaryOp) {\n this.AddOpToNativeFunc(name, 1, ValueType.Int, op);\n }\n\n public static AddFloatBinaryOp(name: string, op: BinaryOp) {\n this.AddOpToNativeFunc(name, 2, ValueType.Float, op);\n }\n public static AddFloatUnaryOp(name: string, op: UnaryOp) {\n this.AddOpToNativeFunc(name, 1, ValueType.Float, op);\n }\n\n public static AddStringBinaryOp(name: string, op: BinaryOp) {\n this.AddOpToNativeFunc(name, 2, ValueType.String, op);\n }\n\n public static AddListBinaryOp(name: string, op: BinaryOp) {\n this.AddOpToNativeFunc(name, 2, ValueType.List, op);\n }\n public static AddListUnaryOp(name: string, op: UnaryOp) {\n this.AddOpToNativeFunc(name, 1, ValueType.List, op);\n }\n\n public toString() {\n return 'Native \"' + this.name + '\"';\n }\n\n public _prototype: NativeFunctionCall | null = null;\n public _isPrototype: boolean = false;\n public _operationFuncs: Map | UnaryOp> | null =\n null;\n public static _nativeFunctions: Map | null = null;\n}\n","import { InkObject } from \"./Object\";\n\n// New version of tags is dynamic - it constructs the tags\n// at runtime based on BeginTag and EndTag control commands.\n// Plain text that's in the output stream is turned into tags\n// when you do story.currentTags.\n// The only place this is used is when flattening tags down\n// to string in advance, during dynamic string generation if\n// there's a tag embedded in it. See how ControlCommand.EndString\n// is implemented in Story.cs for more details + comment\nexport class Tag extends InkObject {\n public readonly text: string;\n\n constructor(tagText: string) {\n super();\n this.text = tagText.toString() || \"\";\n }\n\n public toString(): string {\n return \"# \" + this.text;\n }\n}\n","import { Path } from \"./Path\";\nimport { CallStack } from \"./CallStack\";\nimport { throwNullException } from \"./NullException\";\nimport { InkObject } from \"./Object\";\n\nexport class Choice extends InkObject {\n public text: string = \"\";\n public index: number = 0;\n public threadAtGeneration: CallStack.Thread | null = null;\n public sourcePath: string = \"\";\n public targetPath: Path | null = null;\n public isInvisibleDefault: boolean = false;\n public tags: string[] | null = null;\n public originalThreadIndex: number = 0;\n\n get pathStringOnChoice(): string {\n if (this.targetPath === null)\n return throwNullException(\"Choice.targetPath\");\n return this.targetPath.toString();\n }\n set pathStringOnChoice(value: string) {\n this.targetPath = new Path(value);\n }\n}\n","import { InkListItem, SerializedInkListItem } from \"./InkList\";\nimport { TryGetResult } from \"./TryGetResult\";\n\nexport class ListDefinition {\n public _name: string;\n public _items: Map | null;\n public _itemNameToValues: Map;\n\n constructor(name: string, items: Map | null) {\n this._name = name || \"\";\n this._items = null;\n this._itemNameToValues = items || new Map();\n }\n get name() {\n return this._name;\n }\n get items() {\n if (this._items == null) {\n this._items = new Map();\n for (let [key, value] of this._itemNameToValues) {\n let item = new InkListItem(this.name, key);\n this._items.set(item.serialized(), value);\n }\n }\n\n return this._items;\n }\n\n public ValueForItem(item: InkListItem) {\n if (!item.itemName) return 0;\n\n let intVal = this._itemNameToValues.get(item.itemName);\n if (typeof intVal !== \"undefined\") return intVal;\n else return 0;\n }\n public ContainsItem(item: InkListItem) {\n if (!item.itemName) return false;\n if (item.originName != this.name) return false;\n\n return this._itemNameToValues.has(item.itemName);\n }\n public ContainsItemWithName(itemName: string) {\n return this._itemNameToValues.has(itemName);\n }\n public TryGetItemWithValue(\n val: number,\n /* out */ item: InkListItem\n ): TryGetResult {\n for (let [key, value] of this._itemNameToValues) {\n if (value == val) {\n item = new InkListItem(this.name, key);\n return { result: item, exists: true };\n }\n }\n\n item = InkListItem.Null;\n return { result: item, exists: false };\n }\n public TryGetValueForItem(\n item: InkListItem,\n /* out */ intVal: number\n ): TryGetResult {\n if (!item.itemName) return { result: 0, exists: false };\n let value = this._itemNameToValues.get(item.itemName);\n\n if (!value) return { result: 0, exists: false };\n return { result: value, exists: true };\n }\n}\n","import { InkListItem } from \"./InkList\";\nimport { ListValue } from \"./Value\";\nimport { ListDefinition } from \"./ListDefinition\";\nimport { TryGetResult } from \"./TryGetResult\";\nimport { throwNullException } from \"./NullException\";\n\nexport class ListDefinitionsOrigin {\n protected _lists: Map;\n protected _allUnambiguousListValueCache: Map;\n\n constructor(lists: ListDefinition[]) {\n this._lists = new Map();\n this._allUnambiguousListValueCache = new Map();\n\n for (let list of lists) {\n this._lists.set(list.name, list);\n\n for (let [key, val] of list.items) {\n let item = InkListItem.fromSerializedKey(key);\n let listValue = new ListValue(item, val);\n\n if (!item.itemName) {\n throw new Error(\"item.itemName is null or undefined.\");\n }\n\n this._allUnambiguousListValueCache.set(item.itemName, listValue);\n this._allUnambiguousListValueCache.set(item.fullName, listValue);\n }\n }\n }\n get lists(): ListDefinition[] {\n let listOfLists: ListDefinition[] = [];\n\n for (let [, value] of this._lists) {\n listOfLists.push(value);\n }\n\n return listOfLists;\n }\n public TryListGetDefinition(\n name: string | null,\n /* out */ def: ListDefinition | null\n ): TryGetResult {\n if (name === null) {\n return { result: def, exists: false };\n }\n // initially, this function returns a boolean and the second parameter is an out.\n let definition = this._lists.get(name);\n if (!definition) return { result: def, exists: false };\n\n return { result: definition, exists: true };\n }\n public FindSingleItemListWithName(name: string | null) {\n if (name === null) {\n return throwNullException(\"name\");\n }\n let val = this._allUnambiguousListValueCache.get(name);\n\n if (typeof val !== \"undefined\") {\n return val;\n }\n\n return null;\n }\n}\n","import { Container } from \"./Container\";\nimport {\n Value,\n IntValue,\n FloatValue,\n StringValue,\n DivertTargetValue,\n VariablePointerValue,\n ListValue,\n BoolValue,\n} from \"./Value\";\nimport { Glue } from \"./Glue\";\nimport { ControlCommand } from \"./ControlCommand\";\nimport { PushPopType } from \"./PushPop\";\nimport { Divert } from \"./Divert\";\nimport { ChoicePoint } from \"./ChoicePoint\";\nimport { VariableReference } from \"./VariableReference\";\nimport { VariableAssignment } from \"./VariableAssignment\";\nimport { NativeFunctionCall } from \"./NativeFunctionCall\";\nimport { Void } from \"./Void\";\nimport { Tag } from \"./Tag\";\nimport { Path } from \"./Path\";\nimport { Choice } from \"./Choice\";\nimport { ListDefinition } from \"./ListDefinition\";\nimport { ListDefinitionsOrigin } from \"./ListDefinitionsOrigin\";\nimport { InkListItem, InkList } from \"./InkList\";\nimport { InkObject } from \"./Object\";\nimport { asOrNull } from \"./TypeAssertion\";\nimport { throwNullException } from \"./NullException\";\nimport { SimpleJson } from \"./SimpleJson\";\n\nexport class JsonSerialisation {\n public static JArrayToRuntimeObjList(\n jArray: any[],\n skipLast: boolean = false\n ) {\n let count = jArray.length;\n if (skipLast) count--;\n\n let list: InkObject[] = [];\n\n for (let i = 0; i < count; i++) {\n let jTok = jArray[i];\n let runtimeObj = this.JTokenToRuntimeObject(jTok);\n if (runtimeObj === null) {\n return throwNullException(\"runtimeObj\");\n }\n list.push(runtimeObj);\n }\n\n return list;\n }\n\n public static WriteDictionaryRuntimeObjs(\n writer: SimpleJson.Writer,\n dictionary: Map\n ) {\n writer.WriteObjectStart();\n for (let [key, value] of dictionary) {\n writer.WritePropertyStart(key);\n this.WriteRuntimeObject(writer, value);\n writer.WritePropertyEnd();\n }\n writer.WriteObjectEnd();\n }\n\n public static WriteListRuntimeObjs(\n writer: SimpleJson.Writer,\n list: InkObject[]\n ) {\n writer.WriteArrayStart();\n for (let value of list) {\n this.WriteRuntimeObject(writer, value);\n }\n writer.WriteArrayEnd();\n }\n\n public static WriteIntDictionary(\n writer: SimpleJson.Writer,\n dict: Map\n ) {\n writer.WriteObjectStart();\n for (let [key, value] of dict) {\n writer.WriteIntProperty(key, value);\n }\n writer.WriteObjectEnd();\n }\n\n public static WriteRuntimeObject(\n writer: SimpleJson.Writer,\n obj: InkObject\n ): void {\n let container = asOrNull(obj, Container);\n if (container) {\n this.WriteRuntimeContainer(writer, container);\n return;\n }\n\n let divert = asOrNull(obj, Divert);\n if (divert) {\n let divTypeKey = \"->\";\n if (divert.isExternal) {\n divTypeKey = \"x()\";\n } else if (divert.pushesToStack) {\n if (divert.stackPushType == PushPopType.Function) {\n divTypeKey = \"f()\";\n } else if (divert.stackPushType == PushPopType.Tunnel) {\n divTypeKey = \"->t->\";\n }\n }\n\n let targetStr;\n if (divert.hasVariableTarget) {\n targetStr = divert.variableDivertName;\n } else {\n targetStr = divert.targetPathString;\n }\n\n writer.WriteObjectStart();\n writer.WriteProperty(divTypeKey, targetStr);\n\n if (divert.hasVariableTarget) {\n writer.WriteProperty(\"var\", true);\n }\n\n if (divert.isConditional) {\n writer.WriteProperty(\"c\", true);\n }\n\n if (divert.externalArgs > 0) {\n writer.WriteIntProperty(\"exArgs\", divert.externalArgs);\n }\n\n writer.WriteObjectEnd();\n return;\n }\n\n let choicePoint = asOrNull(obj, ChoicePoint);\n if (choicePoint) {\n writer.WriteObjectStart();\n writer.WriteProperty(\"*\", choicePoint.pathStringOnChoice);\n writer.WriteIntProperty(\"flg\", choicePoint.flags);\n writer.WriteObjectEnd();\n return;\n }\n\n let boolVal = asOrNull(obj, BoolValue);\n if (boolVal) {\n writer.WriteBool(boolVal.value);\n return;\n }\n\n let intVal = asOrNull(obj, IntValue);\n if (intVal) {\n writer.WriteInt(intVal.value);\n return;\n }\n\n let floatVal = asOrNull(obj, FloatValue);\n if (floatVal) {\n writer.WriteFloat(floatVal.value);\n return;\n }\n\n let strVal = asOrNull(obj, StringValue);\n if (strVal) {\n if (strVal.isNewline) {\n writer.Write(\"\\n\", false);\n } else {\n writer.WriteStringStart();\n writer.WriteStringInner(\"^\");\n writer.WriteStringInner(strVal.value);\n writer.WriteStringEnd();\n }\n return;\n }\n\n let listVal = asOrNull(obj, ListValue);\n if (listVal) {\n this.WriteInkList(writer, listVal);\n return;\n }\n\n let divTargetVal = asOrNull(obj, DivertTargetValue);\n if (divTargetVal) {\n writer.WriteObjectStart();\n if (divTargetVal.value === null) {\n return throwNullException(\"divTargetVal.value\");\n }\n writer.WriteProperty(\"^->\", divTargetVal.value.componentsString);\n writer.WriteObjectEnd();\n\n return;\n }\n\n let varPtrVal = asOrNull(obj, VariablePointerValue);\n if (varPtrVal) {\n writer.WriteObjectStart();\n writer.WriteProperty(\"^var\", varPtrVal.value);\n writer.WriteIntProperty(\"ci\", varPtrVal.contextIndex);\n writer.WriteObjectEnd();\n return;\n }\n\n let glue = asOrNull(obj, Glue);\n if (glue) {\n writer.Write(\"<>\");\n return;\n }\n\n let controlCmd = asOrNull(obj, ControlCommand);\n if (controlCmd) {\n writer.Write(\n JsonSerialisation._controlCommandNames[controlCmd.commandType]\n );\n return;\n }\n\n let nativeFunc = asOrNull(obj, NativeFunctionCall);\n if (nativeFunc) {\n let name = nativeFunc.name;\n\n if (name == \"^\") name = \"L^\";\n\n writer.Write(name);\n return;\n }\n\n let varRef = asOrNull(obj, VariableReference);\n if (varRef) {\n writer.WriteObjectStart();\n let readCountPath = varRef.pathStringForCount;\n if (readCountPath != null) {\n writer.WriteProperty(\"CNT?\", readCountPath);\n } else {\n writer.WriteProperty(\"VAR?\", varRef.name);\n }\n\n writer.WriteObjectEnd();\n return;\n }\n\n let varAss = asOrNull(obj, VariableAssignment);\n if (varAss) {\n writer.WriteObjectStart();\n\n let key = varAss.isGlobal ? \"VAR=\" : \"temp=\";\n writer.WriteProperty(key, varAss.variableName);\n\n // Reassignment?\n if (!varAss.isNewDeclaration) writer.WriteProperty(\"re\", true);\n\n writer.WriteObjectEnd();\n\n return;\n }\n\n let voidObj = asOrNull(obj, Void);\n if (voidObj) {\n writer.Write(\"void\");\n return;\n }\n\n let tag = asOrNull(obj, Tag);\n if (tag) {\n writer.WriteObjectStart();\n writer.WriteProperty(\"#\", tag.text);\n writer.WriteObjectEnd();\n return;\n }\n\n let choice = asOrNull(obj, Choice);\n if (choice) {\n this.WriteChoice(writer, choice);\n return;\n }\n\n throw new Error(\"Failed to convert runtime object to Json token: \" + obj);\n }\n\n public static JObjectToDictionaryRuntimeObjs(jObject: Record) {\n let dict: Map = new Map();\n\n for (let key in jObject) {\n if (jObject.hasOwnProperty(key)) {\n let inkObject = this.JTokenToRuntimeObject(jObject[key]);\n if (inkObject === null) {\n return throwNullException(\"inkObject\");\n }\n dict.set(key, inkObject);\n }\n }\n\n return dict;\n }\n\n public static JObjectToIntDictionary(jObject: Record) {\n let dict: Map = new Map();\n for (let key in jObject) {\n if (jObject.hasOwnProperty(key)) {\n dict.set(key, parseInt(jObject[key]));\n }\n }\n return dict;\n }\n\n public static JTokenToRuntimeObject(token: any): InkObject | null {\n if (\n (typeof token === \"number\" && !isNaN(token)) ||\n typeof token === \"boolean\"\n ) {\n return Value.Create(token);\n }\n\n if (typeof token === \"string\") {\n let str = token.toString();\n\n // String value\n let firstChar = str[0];\n if (firstChar == \"^\") return new StringValue(str.substring(1));\n else if (firstChar == \"\\n\" && str.length == 1)\n return new StringValue(\"\\n\");\n\n // Glue\n if (str == \"<>\") return new Glue();\n\n // Control commands (would looking up in a hash set be faster?)\n for (let i = 0; i < JsonSerialisation._controlCommandNames.length; ++i) {\n let cmdName = JsonSerialisation._controlCommandNames[i];\n if (str == cmdName) {\n return new ControlCommand(i);\n }\n }\n\n // Native functions\n if (str == \"L^\") str = \"^\";\n if (NativeFunctionCall.CallExistsWithName(str))\n return NativeFunctionCall.CallWithName(str);\n\n // Pop\n if (str == \"->->\") return ControlCommand.PopTunnel();\n else if (str == \"~ret\") return ControlCommand.PopFunction();\n\n // Void\n if (str == \"void\") return new Void();\n }\n\n if (typeof token === \"object\" && !Array.isArray(token)) {\n let obj = token as Record;\n let propValue;\n\n // Divert target value to path\n if (obj[\"^->\"]) {\n propValue = obj[\"^->\"];\n return new DivertTargetValue(new Path(propValue.toString()));\n }\n\n // VariablePointerValue\n if (obj[\"^var\"]) {\n propValue = obj[\"^var\"];\n let varPtr = new VariablePointerValue(propValue.toString());\n if (\"ci\" in obj) {\n propValue = obj[\"ci\"];\n varPtr.contextIndex = parseInt(propValue);\n }\n return varPtr;\n }\n\n // Divert\n let isDivert = false;\n let pushesToStack = false;\n let divPushType = PushPopType.Function;\n let external = false;\n if ((propValue = obj[\"->\"])) {\n isDivert = true;\n } else if ((propValue = obj[\"f()\"])) {\n isDivert = true;\n pushesToStack = true;\n divPushType = PushPopType.Function;\n } else if ((propValue = obj[\"->t->\"])) {\n isDivert = true;\n pushesToStack = true;\n divPushType = PushPopType.Tunnel;\n } else if ((propValue = obj[\"x()\"])) {\n isDivert = true;\n external = true;\n pushesToStack = false;\n divPushType = PushPopType.Function;\n }\n\n if (isDivert) {\n let divert = new Divert();\n divert.pushesToStack = pushesToStack;\n divert.stackPushType = divPushType;\n divert.isExternal = external;\n\n let target = propValue.toString();\n\n if ((propValue = obj[\"var\"])) divert.variableDivertName = target;\n else divert.targetPathString = target;\n\n divert.isConditional = !!obj[\"c\"];\n\n if (external) {\n if ((propValue = obj[\"exArgs\"]))\n divert.externalArgs = parseInt(propValue);\n }\n\n return divert;\n }\n\n // Choice\n if ((propValue = obj[\"*\"])) {\n let choice = new ChoicePoint();\n choice.pathStringOnChoice = propValue.toString();\n\n if ((propValue = obj[\"flg\"])) choice.flags = parseInt(propValue);\n\n return choice;\n }\n\n // Variable reference\n if ((propValue = obj[\"VAR?\"])) {\n return new VariableReference(propValue.toString());\n } else if ((propValue = obj[\"CNT?\"])) {\n let readCountVarRef = new VariableReference();\n readCountVarRef.pathStringForCount = propValue.toString();\n return readCountVarRef;\n }\n\n // Variable assignment\n let isVarAss = false;\n let isGlobalVar = false;\n if ((propValue = obj[\"VAR=\"])) {\n isVarAss = true;\n isGlobalVar = true;\n } else if ((propValue = obj[\"temp=\"])) {\n isVarAss = true;\n isGlobalVar = false;\n }\n if (isVarAss) {\n let varName = propValue.toString();\n let isNewDecl = !obj[\"re\"];\n let varAss = new VariableAssignment(varName, isNewDecl);\n varAss.isGlobal = isGlobalVar;\n return varAss;\n }\n if (obj[\"#\"] !== undefined) {\n propValue = obj[\"#\"];\n return new Tag(propValue.toString());\n }\n\n // List value\n if ((propValue = obj[\"list\"])) {\n // var listContent = (Dictionary)propValue;\n let listContent = propValue as Record;\n let rawList = new InkList();\n if ((propValue = obj[\"origins\"])) {\n // var namesAsObjs = (List)propValue;\n let namesAsObjs = propValue as string[];\n // rawList.SetInitialOriginNames(namesAsObjs.Cast().ToList());\n rawList.SetInitialOriginNames(namesAsObjs);\n }\n\n for (let key in listContent) {\n if (listContent.hasOwnProperty(key)) {\n let nameToVal = listContent[key];\n let item = new InkListItem(key);\n let val = parseInt(nameToVal);\n rawList.Add(item, val);\n }\n }\n\n return new ListValue(rawList);\n }\n\n if (obj[\"originalChoicePath\"] != null) return this.JObjectToChoice(obj);\n }\n\n // Array is always a Runtime.Container\n if (Array.isArray(token)) {\n return this.JArrayToContainer(token);\n }\n\n if (token === null || token === undefined) return null;\n\n throw new Error(\n \"Failed to convert token to runtime object: \" +\n this.toJson(token, [\"parent\"])\n );\n }\n\n public static toJson(\n me: T,\n removes?: (keyof T)[],\n space?: number\n ): string {\n return JSON.stringify(\n me,\n (k, v) => (removes?.some((r) => r === k) ? undefined : v),\n space\n );\n }\n\n public static WriteRuntimeContainer(\n writer: SimpleJson.Writer,\n container: Container | null,\n withoutName: boolean = false\n ) {\n writer.WriteArrayStart();\n if (container === null) {\n return throwNullException(\"container\");\n }\n for (let c of container.content) this.WriteRuntimeObject(writer, c);\n\n let namedOnlyContent = container.namedOnlyContent;\n let countFlags = container.countFlags;\n let hasNameProperty = container.name != null && !withoutName;\n\n let hasTerminator =\n namedOnlyContent != null || countFlags > 0 || hasNameProperty;\n if (hasTerminator) {\n writer.WriteObjectStart();\n }\n\n if (namedOnlyContent != null) {\n for (let [key, value] of namedOnlyContent) {\n let name = key;\n let namedContainer = asOrNull(value, Container);\n writer.WritePropertyStart(name);\n this.WriteRuntimeContainer(writer, namedContainer, true);\n writer.WritePropertyEnd();\n }\n }\n\n if (countFlags > 0) writer.WriteIntProperty(\"#f\", countFlags);\n\n if (hasNameProperty) writer.WriteProperty(\"#n\", container.name);\n\n if (hasTerminator) writer.WriteObjectEnd();\n else writer.WriteNull();\n\n writer.WriteArrayEnd();\n }\n\n public static JArrayToContainer(jArray: any[]) {\n let container = new Container();\n container.content = this.JArrayToRuntimeObjList(jArray, true);\n\n let terminatingObj = jArray[jArray.length - 1] as Record;\n if (terminatingObj != null) {\n let namedOnlyContent = new Map();\n\n for (let key in terminatingObj) {\n if (key == \"#f\") {\n container.countFlags = parseInt(terminatingObj[key]);\n } else if (key == \"#n\") {\n container.name = terminatingObj[key].toString();\n } else {\n let namedContentItem = this.JTokenToRuntimeObject(\n terminatingObj[key]\n );\n // var namedSubContainer = namedContentItem as Container;\n let namedSubContainer = asOrNull(namedContentItem, Container);\n if (namedSubContainer) namedSubContainer.name = key;\n namedOnlyContent.set(key, namedContentItem);\n }\n }\n\n container.namedOnlyContent = namedOnlyContent;\n }\n\n return container;\n }\n\n public static JObjectToChoice(jObj: Record) {\n let choice = new Choice();\n choice.text = jObj[\"text\"].toString();\n choice.index = parseInt(jObj[\"index\"]);\n choice.sourcePath = jObj[\"originalChoicePath\"].toString();\n choice.originalThreadIndex = parseInt(jObj[\"originalThreadIndex\"]);\n choice.pathStringOnChoice = jObj[\"targetPath\"].toString();\n return choice;\n }\n\n public static WriteChoice(writer: SimpleJson.Writer, choice: Choice) {\n writer.WriteObjectStart();\n writer.WriteProperty(\"text\", choice.text);\n writer.WriteIntProperty(\"index\", choice.index);\n writer.WriteProperty(\"originalChoicePath\", choice.sourcePath);\n writer.WriteIntProperty(\"originalThreadIndex\", choice.originalThreadIndex);\n writer.WriteProperty(\"targetPath\", choice.pathStringOnChoice);\n writer.WriteObjectEnd();\n }\n\n public static WriteInkList(writer: SimpleJson.Writer, listVal: ListValue) {\n let rawList = listVal.value;\n if (rawList === null) {\n return throwNullException(\"rawList\");\n }\n\n writer.WriteObjectStart();\n writer.WritePropertyStart(\"list\");\n writer.WriteObjectStart();\n\n for (let [key, val] of rawList) {\n let item = InkListItem.fromSerializedKey(key);\n let itemVal = val;\n\n if (item.itemName === null) {\n return throwNullException(\"item.itemName\");\n }\n\n writer.WritePropertyNameStart();\n writer.WritePropertyNameInner(item.originName ? item.originName : \"?\");\n writer.WritePropertyNameInner(\".\");\n writer.WritePropertyNameInner(item.itemName);\n writer.WritePropertyNameEnd();\n\n writer.Write(itemVal);\n\n writer.WritePropertyEnd();\n }\n\n writer.WriteObjectEnd();\n\n writer.WritePropertyEnd();\n\n if (\n rawList.Count == 0 &&\n rawList.originNames != null &&\n rawList.originNames.length > 0\n ) {\n writer.WritePropertyStart(\"origins\");\n writer.WriteArrayStart();\n for (let name of rawList.originNames) writer.Write(name);\n writer.WriteArrayEnd();\n writer.WritePropertyEnd();\n }\n\n writer.WriteObjectEnd();\n }\n\n public static ListDefinitionsToJToken(origin: ListDefinitionsOrigin) {\n let result: Record = {};\n\n for (let def of origin.lists) {\n let listDefJson: Record = {};\n\n for (let [key, val] of def.items) {\n let item = InkListItem.fromSerializedKey(key);\n if (item.itemName === null) {\n return throwNullException(\"item.itemName\");\n }\n listDefJson[item.itemName] = val;\n }\n\n result[def.name] = listDefJson;\n }\n\n return result;\n }\n\n public static JTokenToListDefinitions(obj: Record) {\n // var defsObj = (Dictionary)obj;\n let defsObj = obj;\n\n let allDefs: ListDefinition[] = [];\n\n for (let key in defsObj) {\n if (defsObj.hasOwnProperty(key)) {\n let name = key.toString();\n // var listDefJson = (Dictionary)kv.Value;\n let listDefJson = defsObj[key] as Record;\n\n // Cast (string, object) to (string, int) for items\n let items: Map = new Map();\n\n for (let nameValueKey in listDefJson) {\n if (defsObj.hasOwnProperty(key)) {\n let nameValue = listDefJson[nameValueKey];\n items.set(nameValueKey, parseInt(nameValue));\n }\n }\n\n let def = new ListDefinition(name, items);\n allDefs.push(def);\n }\n }\n\n return new ListDefinitionsOrigin(allDefs);\n }\n\n private static _controlCommandNames = (() => {\n let _controlCommandNames: string[] = [];\n\n _controlCommandNames[ControlCommand.CommandType.EvalStart] = \"ev\";\n _controlCommandNames[ControlCommand.CommandType.EvalOutput] = \"out\";\n _controlCommandNames[ControlCommand.CommandType.EvalEnd] = \"/ev\";\n _controlCommandNames[ControlCommand.CommandType.Duplicate] = \"du\";\n _controlCommandNames[ControlCommand.CommandType.PopEvaluatedValue] = \"pop\";\n _controlCommandNames[ControlCommand.CommandType.PopFunction] = \"~ret\";\n _controlCommandNames[ControlCommand.CommandType.PopTunnel] = \"->->\";\n _controlCommandNames[ControlCommand.CommandType.BeginString] = \"str\";\n _controlCommandNames[ControlCommand.CommandType.EndString] = \"/str\";\n _controlCommandNames[ControlCommand.CommandType.NoOp] = \"nop\";\n _controlCommandNames[ControlCommand.CommandType.ChoiceCount] = \"choiceCnt\";\n _controlCommandNames[ControlCommand.CommandType.Turns] = \"turn\";\n _controlCommandNames[ControlCommand.CommandType.TurnsSince] = \"turns\";\n _controlCommandNames[ControlCommand.CommandType.ReadCount] = \"readc\";\n _controlCommandNames[ControlCommand.CommandType.Random] = \"rnd\";\n _controlCommandNames[ControlCommand.CommandType.SeedRandom] = \"srnd\";\n _controlCommandNames[ControlCommand.CommandType.VisitIndex] = \"visit\";\n _controlCommandNames[ControlCommand.CommandType.SequenceShuffleIndex] =\n \"seq\";\n _controlCommandNames[ControlCommand.CommandType.StartThread] = \"thread\";\n _controlCommandNames[ControlCommand.CommandType.Done] = \"done\";\n _controlCommandNames[ControlCommand.CommandType.End] = \"end\";\n _controlCommandNames[ControlCommand.CommandType.ListFromInt] = \"listInt\";\n _controlCommandNames[ControlCommand.CommandType.ListRange] = \"range\";\n _controlCommandNames[ControlCommand.CommandType.ListRandom] = \"lrnd\";\n _controlCommandNames[ControlCommand.CommandType.BeginTag] = \"#\";\n _controlCommandNames[ControlCommand.CommandType.EndTag] = \"/#\";\n\n for (let i = 0; i < ControlCommand.CommandType.TOTAL_VALUES; ++i) {\n if (_controlCommandNames[i] == null)\n throw new Error(\"Control command not accounted for in serialisation\");\n }\n\n return _controlCommandNames;\n })();\n}\n","import { PushPopType } from \"./PushPop\";\nimport { Path } from \"./Path\";\nimport { Story } from \"./Story\";\nimport { JsonSerialisation } from \"./JsonSerialisation\";\nimport { ListValue } from \"./Value\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { Pointer } from \"./Pointer\";\nimport { InkObject } from \"./Object\";\nimport { Debug } from \"./Debug\";\nimport { tryGetValueFromMap } from \"./TryGetResult\";\nimport { throwNullException } from \"./NullException\";\nimport { SimpleJson } from \"./SimpleJson\";\n\nexport class CallStack {\n get elements() {\n return this.callStack;\n }\n\n get depth() {\n return this.elements.length;\n }\n\n get currentElement() {\n let thread = this._threads[this._threads.length - 1];\n let cs = thread.callstack;\n return cs[cs.length - 1];\n }\n\n get currentElementIndex() {\n return this.callStack.length - 1;\n }\n\n get currentThread(): CallStack.Thread {\n return this._threads[this._threads.length - 1];\n }\n set currentThread(value: CallStack.Thread) {\n Debug.Assert(\n this._threads.length == 1,\n \"Shouldn't be directly setting the current thread when we have a stack of them\"\n );\n\n this._threads.length = 0;\n this._threads.push(value);\n }\n\n get canPop() {\n return this.callStack.length > 1;\n }\n\n constructor(storyContext: Story);\n constructor(toCopy: CallStack);\n constructor() {\n if (arguments[0] instanceof Story) {\n let storyContext = arguments[0] as Story;\n\n this._startOfRoot = Pointer.StartOf(storyContext.rootContentContainer);\n this.Reset();\n } else {\n let toCopy = arguments[0] as CallStack;\n\n this._threads = [];\n for (let otherThread of toCopy._threads) {\n this._threads.push(otherThread.Copy());\n }\n this._threadCounter = toCopy._threadCounter;\n this._startOfRoot = toCopy._startOfRoot.copy();\n }\n }\n\n public Reset() {\n this._threads = [];\n this._threads.push(new CallStack.Thread());\n\n this._threads[0].callstack.push(\n new CallStack.Element(PushPopType.Tunnel, this._startOfRoot)\n );\n }\n\n public SetJsonToken(jObject: Record, storyContext: Story) {\n this._threads.length = 0;\n\n // TODO: (List) jObject [\"threads\"];\n let jThreads: any[] = jObject[\"threads\"];\n\n for (let jThreadTok of jThreads) {\n // TODO: var jThreadObj = (Dictionary)jThreadTok;\n let jThreadObj = jThreadTok;\n let thread = new CallStack.Thread(jThreadObj, storyContext);\n this._threads.push(thread);\n }\n\n // TODO: (int)jObject [\"threadCounter\"];\n this._threadCounter = parseInt(jObject[\"threadCounter\"]);\n this._startOfRoot = Pointer.StartOf(storyContext.rootContentContainer);\n }\n public WriteJson(w: SimpleJson.Writer) {\n w.WriteObject((writer) => {\n writer.WritePropertyStart(\"threads\");\n writer.WriteArrayStart();\n\n for (let thread of this._threads) {\n thread.WriteJson(writer);\n }\n\n writer.WriteArrayEnd();\n writer.WritePropertyEnd();\n\n writer.WritePropertyStart(\"threadCounter\");\n writer.WriteInt(this._threadCounter);\n writer.WritePropertyEnd();\n });\n }\n\n public PushThread() {\n let newThread = this.currentThread.Copy();\n this._threadCounter++;\n newThread.threadIndex = this._threadCounter;\n this._threads.push(newThread);\n }\n\n public ForkThread() {\n let forkedThread = this.currentThread.Copy();\n this._threadCounter++;\n forkedThread.threadIndex = this._threadCounter;\n return forkedThread;\n }\n\n public PopThread() {\n if (this.canPopThread) {\n this._threads.splice(this._threads.indexOf(this.currentThread), 1); // should be equivalent to a pop()\n } else {\n throw new Error(\"Can't pop thread\");\n }\n }\n\n get canPopThread() {\n return this._threads.length > 1 && !this.elementIsEvaluateFromGame;\n }\n\n get elementIsEvaluateFromGame() {\n return this.currentElement.type == PushPopType.FunctionEvaluationFromGame;\n }\n\n public Push(\n type: PushPopType,\n externalEvaluationStackHeight: number = 0,\n outputStreamLengthWithPushed: number = 0\n ) {\n let element = new CallStack.Element(\n type,\n this.currentElement.currentPointer,\n false\n );\n\n element.evaluationStackHeightWhenPushed = externalEvaluationStackHeight;\n element.functionStartInOutputStream = outputStreamLengthWithPushed;\n\n this.callStack.push(element);\n }\n\n public CanPop(type: PushPopType | null = null) {\n if (!this.canPop) return false;\n\n if (type == null) return true;\n\n return this.currentElement.type == type;\n }\n\n public Pop(type: PushPopType | null = null) {\n if (this.CanPop(type)) {\n this.callStack.pop();\n return;\n } else {\n throw new Error(\"Mismatched push/pop in Callstack\");\n }\n }\n\n public GetTemporaryVariableWithName(\n name: string | null,\n contextIndex: number = -1\n ) {\n if (contextIndex == -1) contextIndex = this.currentElementIndex + 1;\n\n let contextElement = this.callStack[contextIndex - 1];\n\n let varValue = tryGetValueFromMap(\n contextElement.temporaryVariables,\n name,\n null\n );\n if (varValue.exists) {\n return varValue.result;\n } else {\n return null;\n }\n }\n\n public SetTemporaryVariable(\n name: string,\n value: any,\n declareNew: boolean,\n contextIndex: number = -1\n ) {\n if (contextIndex == -1) contextIndex = this.currentElementIndex + 1;\n\n let contextElement = this.callStack[contextIndex - 1];\n\n if (!declareNew && !contextElement.temporaryVariables.get(name)) {\n throw new Error(\"Could not find temporary variable to set: \" + name);\n }\n\n let oldValue = tryGetValueFromMap(\n contextElement.temporaryVariables,\n name,\n null\n );\n if (oldValue.exists)\n ListValue.RetainListOriginsForAssignment(oldValue.result, value);\n\n contextElement.temporaryVariables.set(name, value);\n }\n\n public ContextForVariableNamed(name: string) {\n if (this.currentElement.temporaryVariables.get(name)) {\n return this.currentElementIndex + 1;\n } else {\n return 0;\n }\n }\n\n public ThreadWithIndex(index: number) {\n let filtered = this._threads.filter((t) => {\n if (t.threadIndex == index) return t;\n });\n\n return filtered.length > 0 ? filtered[0] : null;\n }\n\n get callStack() {\n return this.currentThread.callstack;\n }\n\n get callStackTrace() {\n let sb = new StringBuilder();\n\n for (let t = 0; t < this._threads.length; t++) {\n let thread = this._threads[t];\n let isCurrent = t == this._threads.length - 1;\n sb.AppendFormat(\n \"=== THREAD {0}/{1} {2}===\\n\",\n t + 1,\n this._threads.length,\n isCurrent ? \"(current) \" : \"\"\n );\n\n for (let i = 0; i < thread.callstack.length; i++) {\n if (thread.callstack[i].type == PushPopType.Function)\n sb.Append(\" [FUNCTION] \");\n else sb.Append(\" [TUNNEL] \");\n\n let pointer = thread.callstack[i].currentPointer;\n if (!pointer.isNull) {\n sb.Append(\"\");\n }\n }\n }\n\n return sb.toString();\n }\n\n public _threads!: CallStack.Thread[]; // Banged because it's initialized in Reset().\n public _threadCounter: number = 0;\n public _startOfRoot: Pointer = Pointer.Null;\n}\n\nexport namespace CallStack {\n export class Element {\n public currentPointer: Pointer;\n public inExpressionEvaluation: boolean;\n public temporaryVariables: Map;\n public type: PushPopType;\n\n public evaluationStackHeightWhenPushed: number = 0;\n public functionStartInOutputStream: number = 0;\n\n constructor(\n type: PushPopType,\n pointer: Pointer,\n inExpressionEvaluation: boolean = false\n ) {\n this.currentPointer = pointer.copy();\n this.inExpressionEvaluation = inExpressionEvaluation;\n this.temporaryVariables = new Map();\n this.type = type;\n }\n\n public Copy() {\n let copy = new Element(\n this.type,\n this.currentPointer,\n this.inExpressionEvaluation\n );\n copy.temporaryVariables = new Map(this.temporaryVariables);\n copy.evaluationStackHeightWhenPushed =\n this.evaluationStackHeightWhenPushed;\n copy.functionStartInOutputStream = this.functionStartInOutputStream;\n return copy;\n }\n }\n\n export class Thread {\n public callstack: Element[];\n public threadIndex: number = 0;\n public previousPointer: Pointer = Pointer.Null;\n\n constructor();\n constructor(jThreadObj: any, storyContext: Story);\n constructor() {\n this.callstack = [];\n\n if (arguments[0] && arguments[1]) {\n let jThreadObj = arguments[0];\n let storyContext = arguments[1];\n\n // TODO: (int) jThreadObj['threadIndex'] can raise;\n this.threadIndex = parseInt(jThreadObj[\"threadIndex\"]);\n\n let jThreadCallstack = jThreadObj[\"callstack\"];\n\n for (let jElTok of jThreadCallstack) {\n let jElementObj = jElTok;\n\n // TODO: (int) jElementObj['type'] can raise;\n let pushPopType: PushPopType = parseInt(jElementObj[\"type\"]);\n\n let pointer = Pointer.Null;\n\n let currentContainerPathStr: string;\n // TODO: jElementObj.TryGetValue (\"cPath\", out currentContainerPathStrToken);\n let currentContainerPathStrToken = jElementObj[\"cPath\"];\n if (typeof currentContainerPathStrToken !== \"undefined\") {\n currentContainerPathStr = currentContainerPathStrToken.toString();\n\n let threadPointerResult = storyContext.ContentAtPath(\n new Path(currentContainerPathStr)\n );\n pointer.container = threadPointerResult.container;\n pointer.index = parseInt(jElementObj[\"idx\"]);\n\n if (threadPointerResult.obj == null)\n throw new Error(\n \"When loading state, internal story location couldn't be found: \" +\n currentContainerPathStr +\n \". Has the story changed since this save data was created?\"\n );\n else if (threadPointerResult.approximate) {\n if (pointer.container === null) {\n return throwNullException(\"pointer.container\");\n }\n storyContext.Warning(\n \"When loading state, exact internal story location couldn't be found: '\" +\n currentContainerPathStr +\n \"', so it was approximated to '\" +\n pointer.container.path.toString() +\n \"' to recover. Has the story changed since this save data was created?\"\n );\n }\n }\n\n let inExpressionEvaluation = !!jElementObj[\"exp\"];\n\n let el = new Element(pushPopType, pointer, inExpressionEvaluation);\n\n let temps = jElementObj[\"temp\"];\n if (typeof temps !== \"undefined\") {\n el.temporaryVariables =\n JsonSerialisation.JObjectToDictionaryRuntimeObjs(temps);\n } else {\n el.temporaryVariables.clear();\n }\n\n this.callstack.push(el);\n }\n\n let prevContentObjPath = jThreadObj[\"previousContentObject\"];\n if (typeof prevContentObjPath !== \"undefined\") {\n let prevPath = new Path(prevContentObjPath.toString());\n this.previousPointer = storyContext.PointerAtPath(prevPath);\n }\n }\n }\n\n public Copy() {\n let copy = new Thread();\n copy.threadIndex = this.threadIndex;\n for (let e of this.callstack) {\n copy.callstack.push(e.Copy());\n }\n copy.previousPointer = this.previousPointer.copy();\n return copy;\n }\n\n public WriteJson(writer: SimpleJson.Writer) {\n writer.WriteObjectStart();\n\n writer.WritePropertyStart(\"callstack\");\n writer.WriteArrayStart();\n for (let el of this.callstack) {\n writer.WriteObjectStart();\n if (!el.currentPointer.isNull) {\n if (el.currentPointer.container === null) {\n return throwNullException(\"el.currentPointer.container\");\n }\n writer.WriteProperty(\n \"cPath\",\n el.currentPointer.container.path.componentsString\n );\n writer.WriteIntProperty(\"idx\", el.currentPointer.index);\n }\n\n writer.WriteProperty(\"exp\", el.inExpressionEvaluation);\n writer.WriteIntProperty(\"type\", el.type);\n\n if (el.temporaryVariables.size > 0) {\n writer.WritePropertyStart(\"temp\");\n JsonSerialisation.WriteDictionaryRuntimeObjs(\n writer,\n el.temporaryVariables\n );\n writer.WritePropertyEnd();\n }\n\n writer.WriteObjectEnd();\n }\n writer.WriteArrayEnd();\n writer.WritePropertyEnd();\n\n writer.WriteIntProperty(\"threadIndex\", this.threadIndex);\n\n if (!this.previousPointer.isNull) {\n let resolvedPointer = this.previousPointer.Resolve();\n if (resolvedPointer === null) {\n return throwNullException(\"this.previousPointer.Resolve()\");\n }\n writer.WriteProperty(\n \"previousContentObject\",\n resolvedPointer.path.toString()\n );\n }\n\n writer.WriteObjectEnd();\n }\n }\n}\n","import {\n AbstractValue,\n Value,\n VariablePointerValue,\n ListValue,\n IntValue,\n FloatValue,\n BoolValue,\n} from \"./Value\";\nimport { VariableAssignment } from \"./VariableAssignment\";\nimport { InkObject } from \"./Object\";\nimport { ListDefinitionsOrigin } from \"./ListDefinitionsOrigin\";\nimport { StoryException } from \"./StoryException\";\nimport { JsonSerialisation } from \"./JsonSerialisation\";\nimport { asOrThrows, asOrNull, isEquatable } from \"./TypeAssertion\";\nimport { tryGetValueFromMap } from \"./TryGetResult\";\nimport { throwNullException } from \"./NullException\";\nimport { CallStack } from \"./CallStack\";\nimport { StatePatch } from \"./StatePatch\";\nimport { SimpleJson } from \"./SimpleJson\";\nimport { InkList } from \"./Story\";\nimport { Path } from \"./Path\";\n\n// Fake class wrapper around VariableState to have correct typing\n// when using the Proxy syntax in typescript\nfunction VariablesStateAccessor(): new () => Pick {\n return class {} as any;\n}\n\ntype VariableStateValue = boolean | string | number | InkList | Path | null;\n\nexport class VariablesState extends VariablesStateAccessor<\n Record\n>() {\n // The way variableChangedEvent is a bit different than the reference implementation.\n // Originally it uses the C# += operator to add delegates, but in js we need to maintain\n // an actual collection of delegates (ie. callbacks) to register a new one, there is a\n // special ObserveVariableChange method below.\n public variableChangedEventCallbacks: Array<\n (variableName: string, newValue: InkObject) => void\n > = [];\n public variableChangedEvent(variableName: string, newValue: InkObject): void {\n for (let callback of this.variableChangedEventCallbacks) {\n callback(variableName, newValue);\n }\n }\n\n public patch: StatePatch | null = null;\n\n get batchObservingVariableChanges() {\n return this._batchObservingVariableChanges;\n }\n set batchObservingVariableChanges(value: boolean) {\n this._batchObservingVariableChanges = value;\n if (value) {\n this._changedVariablesForBatchObs = new Set();\n } else {\n if (this._changedVariablesForBatchObs != null) {\n for (let variableName of this._changedVariablesForBatchObs) {\n let currentValue = this._globalVariables.get(variableName);\n if (!currentValue) {\n throwNullException(\"currentValue\");\n } else {\n this.variableChangedEvent(variableName, currentValue);\n }\n }\n\n this._changedVariablesForBatchObs = null;\n }\n }\n }\n\n get callStack() {\n return this._callStack;\n }\n set callStack(callStack) {\n this._callStack = callStack;\n }\n\n private _batchObservingVariableChanges: boolean = false;\n\n // the original code uses a magic getter and setter for global variables,\n // allowing things like variableState['varname]. This is not quite possible\n // in js without a Proxy, so it is replaced with this $ function.\n public $(variableName: string): VariableStateValue;\n public $(variableName: string, value: VariableStateValue): void;\n public $(variableName: string, value?: any) {\n if (typeof value === \"undefined\") {\n let varContents = null;\n\n if (this.patch !== null) {\n varContents = this.patch.TryGetGlobal(variableName, null);\n if (varContents.exists)\n return (varContents.result as AbstractValue).valueObject;\n }\n\n varContents = this._globalVariables.get(variableName);\n\n if (typeof varContents === \"undefined\") {\n varContents = this._defaultGlobalVariables.get(variableName);\n }\n\n if (typeof varContents !== \"undefined\")\n return (varContents as AbstractValue).valueObject;\n else return null;\n } else {\n if (typeof this._defaultGlobalVariables.get(variableName) === \"undefined\")\n throw new StoryException(\n \"Cannot assign to a variable (\" +\n variableName +\n \") that hasn't been declared in the story\"\n );\n\n let val = Value.Create(value);\n if (val == null) {\n if (value == null) {\n throw new Error(\"Cannot pass null to VariableState\");\n } else {\n throw new Error(\n \"Invalid value passed to VariableState: \" + value.toString()\n );\n }\n }\n\n this.SetGlobal(variableName, val);\n }\n }\n\n constructor(\n callStack: CallStack,\n listDefsOrigin: ListDefinitionsOrigin | null\n ) {\n super();\n this._globalVariables = new Map();\n this._callStack = callStack;\n this._listDefsOrigin = listDefsOrigin;\n\n // if es6 proxies are available, use them.\n try {\n // the proxy is used to allow direct manipulation of global variables.\n // It first tries to access the objects own property, and if none is\n // found it delegates the call to the $ method, defined below\n let p = new Proxy(this, {\n get(target: any, name) {\n return name in target ? target[name] : target.$(name);\n },\n set(target: any, name, value) {\n if (name in target) target[name] = value;\n else target.$(name, value);\n return true; // returning a falsy value make the trap fail\n },\n });\n\n return p;\n } catch (e) {\n // the proxy object is not available in this context. we should warn the\n // dev but writing to the console feels a bit intrusive.\n // console.log(\"ES6 Proxy not available - direct manipulation of global variables can't work, use $() instead.\");\n }\n }\n\n public ApplyPatch() {\n if (this.patch === null) {\n return throwNullException(\"this.patch\");\n }\n\n for (let [namedVarKey, namedVarValue] of this.patch.globals) {\n this._globalVariables.set(namedVarKey, namedVarValue);\n }\n\n if (this._changedVariablesForBatchObs !== null) {\n for (let name of this.patch.changedVariables) {\n this._changedVariablesForBatchObs.add(name);\n }\n }\n\n this.patch = null;\n }\n\n public SetJsonToken(jToken: Record) {\n this._globalVariables.clear();\n\n for (let [varValKey, varValValue] of this._defaultGlobalVariables) {\n let loadedToken = jToken[varValKey];\n if (typeof loadedToken !== \"undefined\") {\n let tokenInkObject =\n JsonSerialisation.JTokenToRuntimeObject(loadedToken);\n if (tokenInkObject === null) {\n return throwNullException(\"tokenInkObject\");\n }\n this._globalVariables.set(varValKey, tokenInkObject);\n } else {\n this._globalVariables.set(varValKey, varValValue);\n }\n }\n }\n\n public static dontSaveDefaultValues: boolean = true;\n\n public WriteJson(writer: SimpleJson.Writer) {\n writer.WriteObjectStart();\n for (let [keyValKey, keyValValue] of this._globalVariables) {\n let name = keyValKey;\n let val = keyValValue;\n\n if (VariablesState.dontSaveDefaultValues) {\n if (this._defaultGlobalVariables.has(name)) {\n let defaultVal = this._defaultGlobalVariables.get(name)!;\n if (this.RuntimeObjectsEqual(val, defaultVal)) continue;\n }\n }\n\n writer.WritePropertyStart(name);\n JsonSerialisation.WriteRuntimeObject(writer, val);\n writer.WritePropertyEnd();\n }\n writer.WriteObjectEnd();\n }\n\n public RuntimeObjectsEqual(\n obj1: InkObject | null,\n obj2: InkObject | null\n ): boolean {\n if (obj1 === null) {\n return throwNullException(\"obj1\");\n }\n if (obj2 === null) {\n return throwNullException(\"obj2\");\n }\n\n if (obj1.constructor !== obj2.constructor) return false;\n\n let boolVal = asOrNull(obj1, BoolValue);\n if (boolVal !== null) {\n return boolVal.value === asOrThrows(obj2, BoolValue).value;\n }\n\n let intVal = asOrNull(obj1, IntValue);\n if (intVal !== null) {\n return intVal.value === asOrThrows(obj2, IntValue).value;\n }\n\n let floatVal = asOrNull(obj1, FloatValue);\n if (floatVal !== null) {\n return floatVal.value === asOrThrows(obj2, FloatValue).value;\n }\n\n let val1 = asOrNull(obj1, Value);\n let val2 = asOrNull(obj2, Value);\n if (val1 !== null && val2 !== null) {\n if (isEquatable(val1.valueObject) && isEquatable(val2.valueObject)) {\n return val1.valueObject.Equals(val2.valueObject);\n } else {\n return val1.valueObject === val2.valueObject;\n }\n }\n\n throw new Error(\n \"FastRoughDefinitelyEquals: Unsupported runtime object type: \" +\n obj1.constructor.name\n );\n }\n\n public GetVariableWithName(\n name: string | null,\n contextIndex: number = -1\n ): InkObject | null {\n let varValue = this.GetRawVariableWithName(name, contextIndex);\n\n // var varPointer = varValue as VariablePointerValue;\n let varPointer = asOrNull(varValue, VariablePointerValue);\n if (varPointer !== null) {\n varValue = this.ValueAtVariablePointer(varPointer);\n }\n\n return varValue;\n }\n\n public TryGetDefaultVariableValue(name: string | null): InkObject | null {\n let val = tryGetValueFromMap(this._defaultGlobalVariables, name, null);\n return val.exists ? val.result : null;\n }\n\n public GlobalVariableExistsWithName(name: string) {\n return (\n this._globalVariables.has(name) ||\n (this._defaultGlobalVariables !== null &&\n this._defaultGlobalVariables.has(name))\n );\n }\n\n public GetRawVariableWithName(name: string | null, contextIndex: number) {\n let varValue: InkObject | null = null;\n\n if (contextIndex == 0 || contextIndex == -1) {\n let variableValue = null;\n if (this.patch !== null) {\n variableValue = this.patch.TryGetGlobal(name, null);\n if (variableValue.exists) return variableValue.result!;\n }\n\n // this is a conditional assignment\n variableValue = tryGetValueFromMap(this._globalVariables, name, null);\n if (variableValue.exists) return variableValue.result;\n\n if (this._defaultGlobalVariables !== null) {\n variableValue = tryGetValueFromMap(\n this._defaultGlobalVariables,\n name,\n null\n );\n if (variableValue.exists) return variableValue.result;\n }\n\n if (this._listDefsOrigin === null)\n return throwNullException(\"VariablesState._listDefsOrigin\");\n let listItemValue = this._listDefsOrigin.FindSingleItemListWithName(name);\n if (listItemValue) return listItemValue;\n }\n\n varValue = this._callStack.GetTemporaryVariableWithName(name, contextIndex);\n\n return varValue;\n }\n\n public ValueAtVariablePointer(pointer: VariablePointerValue) {\n return this.GetVariableWithName(pointer.variableName, pointer.contextIndex);\n }\n\n public Assign(varAss: VariableAssignment, value: InkObject) {\n let name = varAss.variableName;\n if (name === null) {\n return throwNullException(\"name\");\n }\n let contextIndex = -1;\n\n let setGlobal = false;\n if (varAss.isNewDeclaration) {\n setGlobal = varAss.isGlobal;\n } else {\n setGlobal = this.GlobalVariableExistsWithName(name);\n }\n\n if (varAss.isNewDeclaration) {\n // var varPointer = value as VariablePointerValue;\n let varPointer = asOrNull(value, VariablePointerValue);\n if (varPointer !== null) {\n let fullyResolvedVariablePointer =\n this.ResolveVariablePointer(varPointer);\n value = fullyResolvedVariablePointer;\n }\n } else {\n let existingPointer = null;\n do {\n // existingPointer = GetRawVariableWithName (name, contextIndex) as VariablePointerValue;\n existingPointer = asOrNull(\n this.GetRawVariableWithName(name, contextIndex),\n VariablePointerValue\n );\n if (existingPointer != null) {\n name = existingPointer.variableName;\n contextIndex = existingPointer.contextIndex;\n setGlobal = contextIndex == 0;\n }\n } while (existingPointer != null);\n }\n\n if (setGlobal) {\n this.SetGlobal(name, value);\n } else {\n this._callStack.SetTemporaryVariable(\n name,\n value,\n varAss.isNewDeclaration,\n contextIndex\n );\n }\n }\n\n public SnapshotDefaultGlobals() {\n this._defaultGlobalVariables = new Map(this._globalVariables);\n }\n\n public RetainListOriginsForAssignment(\n oldValue: InkObject,\n newValue: InkObject\n ) {\n let oldList = asOrThrows(oldValue, ListValue);\n let newList = asOrThrows(newValue, ListValue);\n\n if (oldList.value && newList.value && newList.value.Count == 0) {\n newList.value.SetInitialOriginNames(oldList.value.originNames);\n }\n }\n\n public SetGlobal(variableName: string | null, value: InkObject) {\n let oldValue = null;\n\n if (this.patch === null) {\n oldValue = tryGetValueFromMap(this._globalVariables, variableName, null);\n }\n\n if (this.patch !== null) {\n oldValue = this.patch.TryGetGlobal(variableName, null);\n if (!oldValue.exists) {\n oldValue = tryGetValueFromMap(\n this._globalVariables,\n variableName,\n null\n );\n }\n }\n\n ListValue.RetainListOriginsForAssignment(oldValue!.result!, value);\n\n if (variableName === null) {\n return throwNullException(\"variableName\");\n }\n\n if (this.patch !== null) {\n this.patch.SetGlobal(variableName, value);\n } else {\n this._globalVariables.set(variableName, value);\n }\n\n // TODO: Not sure !== is equivalent to !value.Equals(oldValue)\n if (\n this.variableChangedEvent !== null &&\n oldValue !== null &&\n value !== oldValue.result\n ) {\n if (this.batchObservingVariableChanges) {\n if (this._changedVariablesForBatchObs === null) {\n return throwNullException(\"this._changedVariablesForBatchObs\");\n }\n\n if (this.patch !== null) {\n this.patch.AddChangedVariable(variableName);\n } else if (this._changedVariablesForBatchObs !== null) {\n this._changedVariablesForBatchObs.add(variableName);\n }\n } else {\n this.variableChangedEvent(variableName, value);\n }\n }\n }\n\n public ResolveVariablePointer(varPointer: VariablePointerValue) {\n let contextIndex = varPointer.contextIndex;\n\n if (contextIndex == -1)\n contextIndex = this.GetContextIndexOfVariableNamed(\n varPointer.variableName\n );\n\n let valueOfVariablePointedTo = this.GetRawVariableWithName(\n varPointer.variableName,\n contextIndex\n );\n\n // var doubleRedirectionPointer = valueOfVariablePointedTo as VariablePointerValue;\n let doubleRedirectionPointer = asOrNull(\n valueOfVariablePointedTo,\n VariablePointerValue\n );\n if (doubleRedirectionPointer != null) {\n return doubleRedirectionPointer;\n } else {\n return new VariablePointerValue(varPointer.variableName, contextIndex);\n }\n }\n\n public GetContextIndexOfVariableNamed(varName: string) {\n if (this.GlobalVariableExistsWithName(varName)) return 0;\n\n return this._callStack.currentElementIndex;\n }\n\n /**\n * This function is specific to the js version of ink. It allows to register a\n * callback that will be called when a variable changes. The original code uses\n * `state.variableChangedEvent += callback` instead.\n *\n * @param {function} callback\n */\n public ObserveVariableChange(\n callback: (variableName: string, newValue: InkObject) => void\n ) {\n this.variableChangedEventCallbacks.push(callback);\n }\n\n private _globalVariables: Map;\n private _defaultGlobalVariables: Map = new Map();\n\n private _callStack: CallStack;\n private _changedVariablesForBatchObs: Set | null = new Set();\n private _listDefsOrigin: ListDefinitionsOrigin | null;\n}\n","// Taken from https://gist.github.com/blixt/f17b47c62508be59987b\n// Ink uses a seedable PRNG of which there is none in native javascript.\nexport class PRNG {\n private seed: number;\n\n constructor(seed: number) {\n this.seed = seed % 2147483647;\n if (this.seed <= 0) this.seed += 2147483646;\n }\n public next(): number {\n return (this.seed = (this.seed * 48271) % 2147483647);\n }\n public nextFloat(): number {\n return (this.next() - 1) / 2147483646;\n }\n}\n","import { InkObject } from \"./Object\";\nimport { Container } from \"./Container\";\n\nexport class StatePatch {\n get globals() {\n return this._globals;\n }\n get changedVariables() {\n return this._changedVariables;\n }\n get visitCounts() {\n return this._visitCounts;\n }\n get turnIndices() {\n return this._turnIndices;\n }\n\n constructor();\n constructor(toCopy: StatePatch | null);\n constructor() {\n if (arguments.length === 1 && arguments[0] !== null) {\n let toCopy = arguments[0] as StatePatch;\n this._globals = new Map(toCopy._globals);\n this._changedVariables = new Set(toCopy._changedVariables);\n this._visitCounts = new Map(toCopy._visitCounts);\n this._turnIndices = new Map(toCopy._turnIndices);\n } else {\n this._globals = new Map();\n this._changedVariables = new Set();\n this._visitCounts = new Map();\n this._turnIndices = new Map();\n }\n }\n\n public TryGetGlobal(name: string | null, /* out */ value: InkObject | null) {\n if (name !== null && this._globals.has(name)) {\n return { result: this._globals.get(name), exists: true };\n }\n\n return { result: value, exists: false };\n }\n\n public SetGlobal(name: string, value: InkObject) {\n this._globals.set(name, value);\n }\n\n public AddChangedVariable(name: string) {\n return this._changedVariables.add(name);\n }\n\n public TryGetVisitCount(container: Container, /* out */ count: number) {\n if (this._visitCounts.has(container)) {\n return { result: this._visitCounts.get(container), exists: true };\n }\n\n return { result: count, exists: false };\n }\n\n public SetVisitCount(container: Container, count: number) {\n this._visitCounts.set(container, count);\n }\n\n public SetTurnIndex(container: Container, index: number) {\n this._turnIndices.set(container, index);\n }\n\n public TryGetTurnIndex(container: Container, /* out */ index: number) {\n if (this._turnIndices.has(container)) {\n return { result: this._turnIndices.get(container), exists: true };\n }\n\n return { result: index, exists: false };\n }\n\n private _globals: Map;\n private _changedVariables: Set = new Set();\n private _visitCounts: Map = new Map();\n private _turnIndices: Map = new Map();\n}\n","export class SimpleJson {\n public static TextToDictionary(text: string) {\n return new SimpleJson.Reader(text).ToDictionary();\n }\n\n public static TextToArray(text: string) {\n return new SimpleJson.Reader(text).ToArray();\n }\n}\n\nexport namespace SimpleJson {\n export class Reader {\n constructor(text: string) {\n this._rootObject = JSON.parse(text);\n }\n\n public ToDictionary() {\n return this._rootObject as Record;\n }\n\n public ToArray() {\n return this._rootObject as any[];\n }\n\n private _rootObject: any[] | Record;\n }\n\n // In C#, this class writes json tokens directly to a StringWriter or\n // another stream. Here, a temporary hierarchy is created in the form\n // of a javascript object, which is serialised in the `toString` method.\n // See individual methods and properties for more information.\n export class Writer {\n public WriteObject(inner: (w: Writer) => void) {\n this.WriteObjectStart();\n inner(this);\n this.WriteObjectEnd();\n }\n\n // Add a new object.\n public WriteObjectStart() {\n this.StartNewObject(true);\n\n let newObject: Record = {};\n\n if (this.state === SimpleJson.Writer.State.Property) {\n // This object is created as the value of a property,\n // inside an other object.\n this.Assert(this.currentCollection !== null);\n this.Assert(this.currentPropertyName !== null);\n\n let propertyName = this._propertyNameStack.pop();\n this.currentCollection![propertyName!] = newObject;\n this._collectionStack.push(newObject);\n } else if (this.state === SimpleJson.Writer.State.Array) {\n // This object is created as the child of an array.\n this.Assert(this.currentCollection !== null);\n\n this.currentCollection!.push(newObject);\n this._collectionStack.push(newObject);\n } else {\n // This object is the root object.\n this.Assert(this.state === SimpleJson.Writer.State.None);\n this._jsonObject = newObject;\n this._collectionStack.push(newObject);\n }\n\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.Object)\n );\n }\n\n public WriteObjectEnd() {\n this.Assert(this.state === SimpleJson.Writer.State.Object);\n this._collectionStack.pop();\n this._stateStack.pop();\n }\n\n // Write a property name / value pair to the current object.\n public WriteProperty(\n name: any,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n innerOrContent: ((w: Writer) => void) | string | boolean | null\n ) {\n this.WritePropertyStart(name);\n if (arguments[1] instanceof Function) {\n let inner = arguments[1];\n inner(this);\n } else {\n let content: string | boolean | null = arguments[1];\n this.Write(content);\n }\n this.WritePropertyEnd();\n }\n\n // Int and Float are separate calls, since there both are\n // numbers in JavaScript, but need to be handled differently.\n\n public WriteIntProperty(name: any, content: number) {\n this.WritePropertyStart(name);\n this.WriteInt(content);\n this.WritePropertyEnd();\n }\n\n public WriteFloatProperty(name: any, content: number) {\n this.WritePropertyStart(name);\n this.WriteFloat(content);\n this.WritePropertyEnd();\n }\n\n // Prepare a new property name, which will be use to add the\n // new object when calling _addToCurrentObject() from a Write\n // method.\n public WritePropertyStart(name: any) {\n this.Assert(this.state === SimpleJson.Writer.State.Object);\n this._propertyNameStack.push(name);\n\n this.IncrementChildCount();\n\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.Property)\n );\n }\n\n public WritePropertyEnd() {\n this.Assert(this.state === SimpleJson.Writer.State.Property);\n this.Assert(this.childCount === 1);\n this._stateStack.pop();\n }\n\n // Prepare a new property name, except this time, the property name\n // will be created by concatenating all the strings passed to\n // WritePropertyNameInner.\n public WritePropertyNameStart() {\n this.Assert(this.state === SimpleJson.Writer.State.Object);\n this.IncrementChildCount();\n\n this._currentPropertyName = \"\";\n\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.Property)\n );\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.PropertyName)\n );\n }\n\n public WritePropertyNameEnd() {\n this.Assert(this.state === SimpleJson.Writer.State.PropertyName);\n this.Assert(this._currentPropertyName !== null);\n this._propertyNameStack.push(this._currentPropertyName!);\n this._currentPropertyName = null;\n this._stateStack.pop();\n }\n\n public WritePropertyNameInner(str: string) {\n this.Assert(this.state === SimpleJson.Writer.State.PropertyName);\n this.Assert(this._currentPropertyName !== null);\n this._currentPropertyName += str;\n }\n\n // Add a new array.\n public WriteArrayStart() {\n this.StartNewObject(true);\n\n let newObject: any[] = [];\n\n if (this.state === SimpleJson.Writer.State.Property) {\n // This array is created as the value of a property,\n // inside an object.\n this.Assert(this.currentCollection !== null);\n this.Assert(this.currentPropertyName !== null);\n\n let propertyName = this._propertyNameStack.pop();\n this.currentCollection![propertyName!] = newObject;\n this._collectionStack.push(newObject);\n } else if (this.state === SimpleJson.Writer.State.Array) {\n // This array is created as the child of another array.\n this.Assert(this.currentCollection !== null);\n\n this.currentCollection!.push(newObject);\n this._collectionStack.push(newObject);\n } else {\n // This array is the root object.\n this.Assert(this.state === SimpleJson.Writer.State.None);\n this._jsonObject = newObject;\n this._collectionStack.push(newObject);\n }\n\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.Array)\n );\n }\n\n public WriteArrayEnd() {\n this.Assert(this.state === SimpleJson.Writer.State.Array);\n this._collectionStack.pop();\n this._stateStack.pop();\n }\n\n // Add the value to the appropriate collection (array / object), given the current\n // context.\n public Write(\n value: number | string | boolean | null,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n escape: boolean = true\n ) {\n if (value === null) {\n console.error(\"Warning: trying to write a null value\");\n return;\n }\n\n this.StartNewObject(false);\n this._addToCurrentObject(value);\n }\n\n public WriteBool(value: boolean | null) {\n if (value === null) {\n return;\n }\n\n this.StartNewObject(false);\n this._addToCurrentObject(value);\n }\n\n public WriteInt(value: number | null) {\n if (value === null) {\n return;\n }\n\n this.StartNewObject(false);\n\n // Math.floor is used as a precaution:\n // 1. to ensure that the value is written as an integer\n // (without a fractional part -> 1 instead of 1.0), even\n // though it should be the default behaviour of\n // JSON.serialize;\n // 2. to ensure that if a floating number is passed\n // accidentally, it's converted to an integer.\n //\n // This guarantees savegame compatibility with the reference\n // implementation.\n this._addToCurrentObject(Math.floor(value));\n }\n\n // Since JSON doesn't support NaN and Infinity, these values\n // are converted here.\n public WriteFloat(value: number | null) {\n if (value === null) {\n return;\n }\n\n this.StartNewObject(false);\n if (value == Number.POSITIVE_INFINITY) {\n this._addToCurrentObject(3.4e38);\n } else if (value == Number.NEGATIVE_INFINITY) {\n this._addToCurrentObject(-3.4e38);\n } else if (isNaN(value)) {\n this._addToCurrentObject(0.0);\n } else {\n this._addToCurrentObject(value);\n }\n }\n\n public WriteNull() {\n this.StartNewObject(false);\n this._addToCurrentObject(null);\n }\n\n // Prepare a string before adding it to the current collection in\n // WriteStringEnd(). The string will be a concatenation of all the\n // strings passed to WriteStringInner.\n public WriteStringStart() {\n this.StartNewObject(false);\n this._currentString = \"\";\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.String)\n );\n }\n\n public WriteStringEnd() {\n this.Assert(this.state == SimpleJson.Writer.State.String);\n this._stateStack.pop();\n this._addToCurrentObject(this._currentString);\n this._currentString = null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n public WriteStringInner(str: string | null, escape: boolean = true) {\n this.Assert(this.state === SimpleJson.Writer.State.String);\n\n if (str === null) {\n console.error(\"Warning: trying to write a null string\");\n return;\n }\n\n this._currentString += str;\n }\n\n // Serialise the root object into a JSON string.\n public toString() {\n if (this._jsonObject === null) {\n return \"\";\n }\n\n return JSON.stringify(this._jsonObject);\n }\n\n // Prepare the state stack when adding new objects / values.\n private StartNewObject(container: boolean) {\n if (container) {\n this.Assert(\n this.state === SimpleJson.Writer.State.None ||\n this.state === SimpleJson.Writer.State.Property ||\n this.state === SimpleJson.Writer.State.Array\n );\n } else {\n this.Assert(\n this.state === SimpleJson.Writer.State.Property ||\n this.state === SimpleJson.Writer.State.Array\n );\n }\n\n if (this.state === SimpleJson.Writer.State.Property) {\n this.Assert(this.childCount === 0);\n }\n\n if (\n this.state === SimpleJson.Writer.State.Array ||\n this.state === SimpleJson.Writer.State.Property\n ) {\n this.IncrementChildCount();\n }\n }\n\n // These getters peek all the different stacks.\n\n private get state() {\n if (this._stateStack.length > 0) {\n return this._stateStack[this._stateStack.length - 1].type;\n } else {\n return SimpleJson.Writer.State.None;\n }\n }\n\n private get childCount() {\n if (this._stateStack.length > 0) {\n return this._stateStack[this._stateStack.length - 1].childCount;\n } else {\n return 0;\n }\n }\n\n private get currentCollection() {\n if (this._collectionStack.length > 0) {\n return this._collectionStack[this._collectionStack.length - 1];\n } else {\n return null;\n }\n }\n\n private get currentPropertyName() {\n if (this._propertyNameStack.length > 0) {\n return this._propertyNameStack[this._propertyNameStack.length - 1];\n } else {\n return null;\n }\n }\n\n private IncrementChildCount() {\n this.Assert(this._stateStack.length > 0);\n let currEl = this._stateStack.pop()!;\n currEl.childCount++;\n this._stateStack.push(currEl);\n }\n\n private Assert(condition: boolean) {\n if (!condition) throw Error(\"Assert failed while writing JSON\");\n }\n\n // This method did not exist in the original C# code. It adds\n // the given value to the current collection (used by Write methods).\n private _addToCurrentObject(value: number | string | boolean | null) {\n this.Assert(this.currentCollection !== null);\n if (this.state === SimpleJson.Writer.State.Array) {\n this.Assert(Array.isArray(this.currentCollection));\n (this.currentCollection as any[]).push(value);\n } else if (this.state === SimpleJson.Writer.State.Property) {\n this.Assert(!Array.isArray(this.currentCollection));\n this.Assert(this.currentPropertyName !== null);\n (this.currentCollection as Record)[\n this.currentPropertyName!\n ] = value;\n this._propertyNameStack.pop();\n }\n }\n\n // In addition to `_stateStack` present in the original code,\n // this implementation of SimpleJson use two other stacks and two\n // temporary variables holding the current context.\n\n // Used to keep track of the current property name being built\n // with `WritePropertyNameStart`, `WritePropertyNameInner` and\n // `WritePropertyNameEnd`.\n private _currentPropertyName: string | null = null;\n\n // Used to keep track of the current string value being built\n // with `WriteStringStart`, `WriteStringInner` and\n // `WriteStringEnd`.\n private _currentString: string | null = null;\n\n private _stateStack: SimpleJson.Writer.StateElement[] = [];\n\n // Keep track of the current collection being built (either an array\n // or an object). For instance, at the '?' step during the hiarchy\n // creation, this hierarchy:\n // [3, {a: [b, ?]}] will have this corresponding stack:\n // (bottom) [Array, Object, Array] (top)\n private _collectionStack: Array> = [];\n\n // Keep track of the current property being assigned. For instance, at\n // the '?' step during the hiarchy creation, this hierarchy:\n // [3, {a: [b, {c: ?}]}] will have this corresponding stack:\n // (bottom) [a, c] (top)\n private _propertyNameStack: string[] = [];\n\n // Object containing the entire hiearchy.\n private _jsonObject: Record | any[] | null = null;\n }\n\n export namespace Writer {\n export enum State {\n None,\n Object,\n Array,\n Property,\n PropertyName,\n String,\n }\n\n export class StateElement {\n public type: SimpleJson.Writer.State = SimpleJson.Writer.State.None;\n public childCount: number = 0;\n\n constructor(type: SimpleJson.Writer.State) {\n this.type = type;\n }\n }\n }\n}\n","import { CallStack } from \"./CallStack\";\nimport { Choice } from \"./Choice\";\nimport { JsonSerialisation } from \"./JsonSerialisation\";\nimport { InkObject } from \"./Object\";\nimport { SimpleJson } from \"./SimpleJson\";\nimport { Story } from \"./Story\";\nimport { throwNullException } from \"./NullException\";\n\nexport class Flow {\n public name: string;\n public callStack: CallStack;\n public outputStream: InkObject[];\n public currentChoices: Choice[];\n\n constructor(name: String, story: Story);\n constructor(name: String, story: Story, jObject: Record);\n constructor() {\n let name = arguments[0] as string;\n let story = arguments[1] as Story;\n\n this.name = name;\n this.callStack = new CallStack(story);\n\n if (arguments[2]) {\n let jObject = arguments[2] as Record;\n\n this.callStack.SetJsonToken(jObject[\"callstack\"], story);\n this.outputStream = JsonSerialisation.JArrayToRuntimeObjList(\n jObject[\"outputStream\"]\n );\n this.currentChoices = JsonSerialisation.JArrayToRuntimeObjList(\n jObject[\"currentChoices\"]\n ) as Choice[];\n\n let jChoiceThreadsObj = jObject[\"choiceThreads\"];\n if (typeof jChoiceThreadsObj !== \"undefined\") {\n this.LoadFlowChoiceThreads(jChoiceThreadsObj, story);\n }\n } else {\n this.outputStream = [];\n this.currentChoices = [];\n }\n }\n\n public WriteJson(writer: SimpleJson.Writer) {\n writer.WriteObjectStart();\n\n writer.WriteProperty(\"callstack\", (w) => this.callStack.WriteJson(w));\n writer.WriteProperty(\"outputStream\", (w) =>\n JsonSerialisation.WriteListRuntimeObjs(w, this.outputStream)\n );\n\n let hasChoiceThreads = false;\n for (let c of this.currentChoices) {\n if (c.threadAtGeneration === null)\n return throwNullException(\"c.threadAtGeneration\");\n\n c.originalThreadIndex = c.threadAtGeneration.threadIndex;\n\n if (this.callStack.ThreadWithIndex(c.originalThreadIndex) === null) {\n if (!hasChoiceThreads) {\n hasChoiceThreads = true;\n writer.WritePropertyStart(\"choiceThreads\");\n writer.WriteObjectStart();\n }\n\n writer.WritePropertyStart(c.originalThreadIndex);\n c.threadAtGeneration.WriteJson(writer);\n writer.WritePropertyEnd();\n }\n }\n\n if (hasChoiceThreads) {\n writer.WriteObjectEnd();\n writer.WritePropertyEnd();\n }\n\n writer.WriteProperty(\"currentChoices\", (w) => {\n w.WriteArrayStart();\n for (let c of this.currentChoices) {\n JsonSerialisation.WriteChoice(w, c);\n }\n w.WriteArrayEnd();\n });\n\n writer.WriteObjectEnd();\n }\n\n public LoadFlowChoiceThreads(\n jChoiceThreads: Record,\n story: Story\n ) {\n for (let choice of this.currentChoices) {\n let foundActiveThread = this.callStack.ThreadWithIndex(\n choice.originalThreadIndex\n );\n if (foundActiveThread !== null) {\n choice.threadAtGeneration = foundActiveThread.Copy();\n } else {\n let jSavedChoiceThread =\n jChoiceThreads[`${choice.originalThreadIndex}`];\n choice.threadAtGeneration = new CallStack.Thread(\n jSavedChoiceThread,\n story\n );\n }\n }\n }\n}\n","// TODO: Unify with Compiler.\n\nexport type ErrorHandler = (message: string, type: ErrorType) => void;\n\nexport enum ErrorType {\n Author,\n Warning,\n Error,\n}\n","import { Container } from \"./Container\";\nimport { InkObject } from \"./Object\";\nimport { JsonSerialisation } from \"./JsonSerialisation\";\nimport { StoryState } from \"./StoryState\";\nimport { ControlCommand } from \"./ControlCommand\";\nimport { PushPopType } from \"./PushPop\";\nimport { ChoicePoint } from \"./ChoicePoint\";\nimport { Choice } from \"./Choice\";\nimport { Divert } from \"./Divert\";\nimport {\n Value,\n StringValue,\n IntValue,\n DivertTargetValue,\n VariablePointerValue,\n ListValue,\n} from \"./Value\";\nimport { Path } from \"./Path\";\nimport { Void } from \"./Void\";\nimport { Tag } from \"./Tag\";\nimport { VariableAssignment } from \"./VariableAssignment\";\nimport { VariableReference } from \"./VariableReference\";\nimport { NativeFunctionCall } from \"./NativeFunctionCall\";\nimport { StoryException } from \"./StoryException\";\nimport { PRNG } from \"./PRNG\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { ListDefinitionsOrigin } from \"./ListDefinitionsOrigin\";\nimport { ListDefinition } from \"./ListDefinition\";\nimport { Stopwatch } from \"./StopWatch\";\nimport { Pointer } from \"./Pointer\";\nimport { InkList, InkListItem, KeyValuePair } from \"./InkList\";\nimport { asOrNull, asOrThrows } from \"./TypeAssertion\";\nimport { DebugMetadata } from \"./DebugMetadata\";\nimport { throwNullException } from \"./NullException\";\nimport { SimpleJson } from \"./SimpleJson\";\nimport { ErrorHandler, ErrorType } from \"./Error\";\n\nexport { InkList } from \"./InkList\";\n\nif (!Number.isInteger) {\n Number.isInteger = function isInteger(nVal: any) {\n return (\n typeof nVal === \"number\" &&\n isFinite(nVal) &&\n nVal > -9007199254740992 &&\n nVal < 9007199254740992 &&\n Math.floor(nVal) === nVal\n );\n };\n}\n\nexport class Story extends InkObject {\n public static inkVersionCurrent = 21;\n\n public inkVersionMinimumCompatible = 18;\n\n get currentChoices() {\n let choices: Choice[] = [];\n\n if (this._state === null) {\n return throwNullException(\"this._state\");\n }\n for (let c of this._state.currentChoices) {\n if (!c.isInvisibleDefault) {\n c.index = choices.length;\n choices.push(c);\n }\n }\n\n return choices;\n }\n\n get currentText() {\n this.IfAsyncWeCant(\"call currentText since it's a work in progress\");\n return this.state.currentText;\n }\n\n get currentTags() {\n this.IfAsyncWeCant(\"call currentTags since it's a work in progress\");\n return this.state.currentTags;\n }\n\n get currentErrors() {\n return this.state.currentErrors;\n }\n\n get currentWarnings() {\n return this.state.currentWarnings;\n }\n\n get currentFlowName() {\n return this.state.currentFlowName;\n }\n\n get currentFlowIsDefaultFlow() {\n return this.state.currentFlowIsDefaultFlow;\n }\n\n get aliveFlowNames() {\n return this.state.aliveFlowNames;\n }\n\n get hasError() {\n return this.state.hasError;\n }\n\n get hasWarning() {\n return this.state.hasWarning;\n }\n\n get variablesState() {\n return this.state.variablesState;\n }\n\n get listDefinitions() {\n return this._listDefinitions;\n }\n\n get state() {\n return this._state;\n }\n\n public onError: ErrorHandler | null = null;\n\n public onDidContinue: (() => void) | null = null;\n\n public onMakeChoice: ((arg1: Choice) => void) | null = null;\n\n public onEvaluateFunction: ((arg1: string, arg2: any[]) => void) | null =\n null;\n\n public onCompleteEvaluateFunction:\n | ((arg1: string, arg2: any[], arg3: string, arg4: any) => void)\n | null = null;\n\n public onChoosePathString: ((arg1: string, arg2: any[]) => void) | null =\n null;\n\n // TODO: Implement Profiler\n public StartProfiling() {\n /* */\n }\n public EndProfiling() {\n /* */\n }\n\n constructor(contentContainer: Container, lists: ListDefinition[] | null);\n constructor(jsonString: string);\n constructor(json: Record);\n constructor() {\n super();\n\n // Discrimination between constructors\n let contentContainer: Container;\n let lists: ListDefinition[] | null = null;\n let json: Record | null = null;\n\n if (arguments[0] instanceof Container) {\n contentContainer = arguments[0] as Container;\n\n if (typeof arguments[1] !== \"undefined\") {\n lists = arguments[1] as ListDefinition[];\n }\n\n // ------ Story (Container contentContainer, List lists = null)\n this._mainContentContainer = contentContainer;\n // ------\n } else {\n if (typeof arguments[0] === \"string\") {\n let jsonString = arguments[0] as string;\n json = SimpleJson.TextToDictionary(jsonString);\n } else {\n json = arguments[0] as Record;\n }\n }\n\n // ------ Story (Container contentContainer, List lists = null)\n if (lists != null) this._listDefinitions = new ListDefinitionsOrigin(lists);\n\n this._externals = new Map();\n // ------\n\n // ------ Story(string jsonString) : this((Container)null)\n if (json !== null) {\n let rootObject: Record = json;\n\n let versionObj = rootObject[\"inkVersion\"];\n if (versionObj == null)\n throw new Error(\n \"ink version number not found. Are you sure it's a valid .ink.json file?\"\n );\n\n let formatFromFile = parseInt(versionObj);\n if (formatFromFile > Story.inkVersionCurrent) {\n throw new Error(\n \"Version of ink used to build story was newer than the current version of the engine\"\n );\n } else if (formatFromFile < this.inkVersionMinimumCompatible) {\n throw new Error(\n \"Version of ink used to build story is too old to be loaded by this version of the engine\"\n );\n } else if (formatFromFile != Story.inkVersionCurrent) {\n console.warn(\n \"WARNING: Version of ink used to build story doesn't match current version of engine. Non-critical, but recommend synchronising.\"\n );\n }\n\n let rootToken = rootObject[\"root\"];\n if (rootToken == null)\n throw new Error(\n \"Root node for ink not found. Are you sure it's a valid .ink.json file?\"\n );\n\n let listDefsObj;\n if ((listDefsObj = rootObject[\"listDefs\"])) {\n this._listDefinitions =\n JsonSerialisation.JTokenToListDefinitions(listDefsObj);\n }\n\n this._mainContentContainer = asOrThrows(\n JsonSerialisation.JTokenToRuntimeObject(rootToken),\n Container\n );\n\n this.ResetState();\n }\n // ------\n }\n\n // Merge together `public string ToJson()` and `void ToJson(SimpleJson.Writer writer)`.\n // Will only return a value if writer was not provided.\n public ToJson(writer?: SimpleJson.Writer): string | void {\n let shouldReturn = false;\n\n if (!writer) {\n shouldReturn = true;\n writer = new SimpleJson.Writer();\n }\n\n writer.WriteObjectStart();\n\n writer.WriteIntProperty(\"inkVersion\", Story.inkVersionCurrent);\n\n writer.WriteProperty(\"root\", (w) =>\n JsonSerialisation.WriteRuntimeContainer(w, this._mainContentContainer)\n );\n\n if (this._listDefinitions != null) {\n writer.WritePropertyStart(\"listDefs\");\n writer.WriteObjectStart();\n\n for (let def of this._listDefinitions.lists) {\n writer.WritePropertyStart(def.name);\n writer.WriteObjectStart();\n\n for (let [key, value] of def.items) {\n let item = InkListItem.fromSerializedKey(key);\n let val = value;\n writer.WriteIntProperty(item.itemName, val);\n }\n\n writer.WriteObjectEnd();\n writer.WritePropertyEnd();\n }\n\n writer.WriteObjectEnd();\n writer.WritePropertyEnd();\n }\n\n writer.WriteObjectEnd();\n\n if (shouldReturn) return writer.toString();\n }\n\n public ResetState() {\n this.IfAsyncWeCant(\"ResetState\");\n\n this._state = new StoryState(this);\n this._state.variablesState.ObserveVariableChange(\n this.VariableStateDidChangeEvent.bind(this)\n );\n\n this.ResetGlobals();\n }\n\n public ResetErrors() {\n if (this._state === null) {\n return throwNullException(\"this._state\");\n }\n this._state.ResetErrors();\n }\n\n public ResetCallstack() {\n this.IfAsyncWeCant(\"ResetCallstack\");\n if (this._state === null) {\n return throwNullException(\"this._state\");\n }\n this._state.ForceEnd();\n }\n\n public ResetGlobals() {\n if (this._mainContentContainer.namedContent.get(\"global decl\")) {\n let originalPointer = this.state.currentPointer.copy();\n\n this.ChoosePath(new Path(\"global decl\"), false);\n\n this.ContinueInternal();\n\n this.state.currentPointer = originalPointer;\n }\n\n this.state.variablesState.SnapshotDefaultGlobals();\n }\n\n public SwitchFlow(flowName: string) {\n this.IfAsyncWeCant(\"switch flow\");\n if (this._asyncSaving) {\n throw new Error(\n \"Story is already in background saving mode, can't switch flow to \" +\n flowName\n );\n }\n\n this.state.SwitchFlow_Internal(flowName);\n }\n\n public RemoveFlow(flowName: string) {\n this.state.RemoveFlow_Internal(flowName);\n }\n\n public SwitchToDefaultFlow() {\n this.state.SwitchToDefaultFlow_Internal();\n }\n\n public Continue() {\n this.ContinueAsync(0);\n return this.currentText;\n }\n\n get canContinue() {\n return this.state.canContinue;\n }\n\n get asyncContinueComplete() {\n return !this._asyncContinueActive;\n }\n\n public ContinueAsync(millisecsLimitAsync: number) {\n if (!this._hasValidatedExternals) this.ValidateExternalBindings();\n\n this.ContinueInternal(millisecsLimitAsync);\n }\n\n public ContinueInternal(millisecsLimitAsync = 0) {\n if (this._profiler != null) this._profiler.PreContinue();\n\n let isAsyncTimeLimited = millisecsLimitAsync > 0;\n this._recursiveContinueCount++;\n\n if (!this._asyncContinueActive) {\n this._asyncContinueActive = isAsyncTimeLimited;\n\n if (!this.canContinue) {\n throw new Error(\n \"Can't continue - should check canContinue before calling Continue\"\n );\n }\n\n this._state.didSafeExit = false;\n this._state.ResetOutput();\n\n if (this._recursiveContinueCount == 1)\n this._state.variablesState.batchObservingVariableChanges = true;\n }\n\n let durationStopwatch = new Stopwatch();\n durationStopwatch.Start();\n\n let outputStreamEndsInNewline = false;\n this._sawLookaheadUnsafeFunctionAfterNewline = false;\n do {\n try {\n outputStreamEndsInNewline = this.ContinueSingleStep();\n } catch (e) {\n if (!(e instanceof StoryException)) throw e;\n\n this.AddError(e.message, undefined, e.useEndLineNumber);\n break;\n }\n\n if (outputStreamEndsInNewline) break;\n\n if (\n this._asyncContinueActive &&\n durationStopwatch.ElapsedMilliseconds > millisecsLimitAsync\n ) {\n break;\n }\n } while (this.canContinue);\n\n durationStopwatch.Stop();\n\n if (outputStreamEndsInNewline || !this.canContinue) {\n if (this._stateSnapshotAtLastNewline !== null) {\n this.RestoreStateSnapshot();\n }\n\n if (!this.canContinue) {\n if (this.state.callStack.canPopThread)\n this.AddError(\n \"Thread available to pop, threads should always be flat by the end of evaluation?\"\n );\n\n if (\n this.state.generatedChoices.length == 0 &&\n !this.state.didSafeExit &&\n this._temporaryEvaluationContainer == null\n ) {\n if (this.state.callStack.CanPop(PushPopType.Tunnel))\n this.AddError(\n \"unexpectedly reached end of content. Do you need a '->->' to return from a tunnel?\"\n );\n else if (this.state.callStack.CanPop(PushPopType.Function))\n this.AddError(\n \"unexpectedly reached end of content. Do you need a '~ return'?\"\n );\n else if (!this.state.callStack.canPop)\n this.AddError(\n \"ran out of content. Do you need a '-> DONE' or '-> END'?\"\n );\n else\n this.AddError(\n \"unexpectedly reached end of content for unknown reason. Please debug compiler!\"\n );\n }\n }\n\n this.state.didSafeExit = false;\n this._sawLookaheadUnsafeFunctionAfterNewline = false;\n\n if (this._recursiveContinueCount == 1)\n this._state.variablesState.batchObservingVariableChanges = false;\n\n this._asyncContinueActive = false;\n if (this.onDidContinue !== null) this.onDidContinue();\n }\n\n this._recursiveContinueCount--;\n\n if (this._profiler != null) this._profiler.PostContinue();\n\n // In the following code, we're masking a lot of non-null assertion,\n // because testing for against `hasError` or `hasWarning` makes sure\n // the arrays are present and contain at least one element.\n if (this.state.hasError || this.state.hasWarning) {\n if (this.onError !== null) {\n if (this.state.hasError) {\n for (let err of this.state.currentErrors!) {\n this.onError(err, ErrorType.Error);\n }\n }\n if (this.state.hasWarning) {\n for (let err of this.state.currentWarnings!) {\n this.onError(err, ErrorType.Warning);\n }\n }\n this.ResetErrors();\n } else {\n let sb = new StringBuilder();\n sb.Append(\"Ink had \");\n if (this.state.hasError) {\n sb.Append(`${this.state.currentErrors!.length}`);\n sb.Append(\n this.state.currentErrors!.length == 1 ? \" error\" : \"errors\"\n );\n if (this.state.hasWarning) sb.Append(\" and \");\n }\n if (this.state.hasWarning) {\n sb.Append(`${this.state.currentWarnings!.length}`);\n sb.Append(\n this.state.currentWarnings!.length == 1 ? \" warning\" : \"warnings\"\n );\n if (this.state.hasWarning) sb.Append(\" and \");\n }\n sb.Append(\n \". It is strongly suggested that you assign an error handler to story.onError. The first issue was: \"\n );\n sb.Append(\n this.state.hasError\n ? this.state.currentErrors![0]\n : this.state.currentWarnings![0]\n );\n\n throw new StoryException(sb.toString());\n }\n }\n }\n\n public ContinueSingleStep() {\n if (this._profiler != null) this._profiler.PreStep();\n\n this.Step();\n\n if (this._profiler != null) this._profiler.PostStep();\n\n if (!this.canContinue && !this.state.callStack.elementIsEvaluateFromGame) {\n this.TryFollowDefaultInvisibleChoice();\n }\n\n if (this._profiler != null) this._profiler.PreSnapshot();\n\n if (!this.state.inStringEvaluation) {\n if (this._stateSnapshotAtLastNewline !== null) {\n if (this._stateSnapshotAtLastNewline.currentTags === null) {\n return throwNullException(\"this._stateAtLastNewline.currentTags\");\n }\n if (this.state.currentTags === null) {\n return throwNullException(\"this.state.currentTags\");\n }\n\n let change = this.CalculateNewlineOutputStateChange(\n this._stateSnapshotAtLastNewline.currentText,\n this.state.currentText,\n this._stateSnapshotAtLastNewline.currentTags.length,\n this.state.currentTags.length\n );\n\n if (\n change == Story.OutputStateChange.ExtendedBeyondNewline ||\n this._sawLookaheadUnsafeFunctionAfterNewline\n ) {\n this.RestoreStateSnapshot();\n\n return true;\n } else if (change == Story.OutputStateChange.NewlineRemoved) {\n this.DiscardSnapshot();\n }\n }\n\n if (this.state.outputStreamEndsInNewline) {\n if (this.canContinue) {\n if (this._stateSnapshotAtLastNewline == null) this.StateSnapshot();\n } else {\n this.DiscardSnapshot();\n }\n }\n }\n\n if (this._profiler != null) this._profiler.PostSnapshot();\n\n return false;\n }\n\n public CalculateNewlineOutputStateChange(\n prevText: string | null,\n currText: string | null,\n prevTagCount: number,\n currTagCount: number\n ) {\n if (prevText === null) {\n return throwNullException(\"prevText\");\n }\n if (currText === null) {\n return throwNullException(\"currText\");\n }\n\n let newlineStillExists =\n currText.length >= prevText.length &&\n prevText.length > 0 &&\n currText.charAt(prevText.length - 1) == \"\\n\";\n if (\n prevTagCount == currTagCount &&\n prevText.length == currText.length &&\n newlineStillExists\n )\n return Story.OutputStateChange.NoChange;\n\n if (!newlineStillExists) {\n return Story.OutputStateChange.NewlineRemoved;\n }\n\n if (currTagCount > prevTagCount)\n return Story.OutputStateChange.ExtendedBeyondNewline;\n\n for (let i = prevText.length; i < currText.length; i++) {\n let c = currText.charAt(i);\n if (c != \" \" && c != \"\\t\") {\n return Story.OutputStateChange.ExtendedBeyondNewline;\n }\n }\n\n return Story.OutputStateChange.NoChange;\n }\n\n public ContinueMaximally() {\n this.IfAsyncWeCant(\"ContinueMaximally\");\n\n let sb = new StringBuilder();\n\n while (this.canContinue) {\n sb.Append(this.Continue());\n }\n\n return sb.toString();\n }\n\n public ContentAtPath(path: Path) {\n return this.mainContentContainer.ContentAtPath(path);\n }\n\n public KnotContainerWithName(name: string) {\n let namedContainer = this.mainContentContainer.namedContent.get(name);\n if (namedContainer instanceof Container) return namedContainer;\n else return null;\n }\n\n public PointerAtPath(path: Path) {\n if (path.length == 0) return Pointer.Null;\n\n let p = new Pointer();\n\n let pathLengthToUse = path.length;\n\n let result = null;\n if (path.lastComponent === null) {\n return throwNullException(\"path.lastComponent\");\n }\n\n if (path.lastComponent.isIndex) {\n pathLengthToUse = path.length - 1;\n result = this.mainContentContainer.ContentAtPath(\n path,\n undefined,\n pathLengthToUse\n );\n p.container = result.container;\n p.index = path.lastComponent.index;\n } else {\n result = this.mainContentContainer.ContentAtPath(path);\n p.container = result.container;\n p.index = -1;\n }\n\n if (\n result.obj == null ||\n (result.obj == this.mainContentContainer && pathLengthToUse > 0)\n ) {\n this.Error(\n \"Failed to find content at path '\" +\n path +\n \"', and no approximation of it was possible.\"\n );\n } else if (result.approximate)\n this.Warning(\n \"Failed to find content at path '\" +\n path +\n \"', so it was approximated to: '\" +\n result.obj.path +\n \"'.\"\n );\n\n return p;\n }\n\n public StateSnapshot() {\n this._stateSnapshotAtLastNewline = this._state;\n this._state = this._state.CopyAndStartPatching();\n }\n\n public RestoreStateSnapshot() {\n if (this._stateSnapshotAtLastNewline === null) {\n throwNullException(\"_stateSnapshotAtLastNewline\");\n }\n this._stateSnapshotAtLastNewline.RestoreAfterPatch();\n\n this._state = this._stateSnapshotAtLastNewline;\n this._stateSnapshotAtLastNewline = null;\n\n if (!this._asyncSaving) {\n this._state.ApplyAnyPatch();\n }\n }\n\n public DiscardSnapshot() {\n if (!this._asyncSaving) this._state.ApplyAnyPatch();\n\n this._stateSnapshotAtLastNewline = null;\n }\n\n public CopyStateForBackgroundThreadSave() {\n this.IfAsyncWeCant(\"start saving on a background thread\");\n\n if (this._asyncSaving)\n throw new Error(\n \"Story is already in background saving mode, can't call CopyStateForBackgroundThreadSave again!\"\n );\n\n let stateToSave = this._state;\n this._state = this._state.CopyAndStartPatching();\n this._asyncSaving = true;\n return stateToSave;\n }\n\n public BackgroundSaveComplete() {\n if (this._stateSnapshotAtLastNewline === null) {\n this._state.ApplyAnyPatch();\n }\n\n this._asyncSaving = false;\n }\n\n public Step() {\n let shouldAddToStream = true;\n\n let pointer = this.state.currentPointer.copy();\n if (pointer.isNull) {\n return;\n }\n\n // Container containerToEnter = pointer.Resolve () as Container;\n let containerToEnter = asOrNull(pointer.Resolve(), Container);\n\n while (containerToEnter) {\n this.VisitContainer(containerToEnter, true);\n\n // No content? the most we can do is step past it\n if (containerToEnter.content.length == 0) {\n break;\n }\n\n pointer = Pointer.StartOf(containerToEnter);\n // containerToEnter = pointer.Resolve() as Container;\n containerToEnter = asOrNull(pointer.Resolve(), Container);\n }\n\n this.state.currentPointer = pointer.copy();\n\n if (this._profiler != null) this._profiler.Step(this.state.callStack);\n\n // Is the current content object:\n // - Normal content\n // - Or a logic/flow statement - if so, do it\n // Stop flow if we hit a stack pop when we're unable to pop (e.g. return/done statement in knot\n // that was diverted to rather than called as a function)\n let currentContentObj = pointer.Resolve();\n let isLogicOrFlowControl =\n this.PerformLogicAndFlowControl(currentContentObj);\n\n // Has flow been forced to end by flow control above?\n if (this.state.currentPointer.isNull) {\n return;\n }\n\n if (isLogicOrFlowControl) {\n shouldAddToStream = false;\n }\n\n // Choice with condition?\n // var choicePoint = currentContentObj as ChoicePoint;\n let choicePoint = asOrNull(currentContentObj, ChoicePoint);\n if (choicePoint) {\n let choice = this.ProcessChoice(choicePoint);\n if (choice) {\n this.state.generatedChoices.push(choice);\n }\n\n currentContentObj = null;\n shouldAddToStream = false;\n }\n\n // If the container has no content, then it will be\n // the \"content\" itself, but we skip over it.\n if (currentContentObj instanceof Container) {\n shouldAddToStream = false;\n }\n\n // Content to add to evaluation stack or the output stream\n if (shouldAddToStream) {\n // If we're pushing a variable pointer onto the evaluation stack, ensure that it's specific\n // to our current (possibly temporary) context index. And make a copy of the pointer\n // so that we're not editing the original runtime object.\n // var varPointer = currentContentObj as VariablePointerValue;\n let varPointer = asOrNull(currentContentObj, VariablePointerValue);\n if (varPointer && varPointer.contextIndex == -1) {\n // Create new object so we're not overwriting the story's own data\n let contextIdx = this.state.callStack.ContextForVariableNamed(\n varPointer.variableName\n );\n currentContentObj = new VariablePointerValue(\n varPointer.variableName,\n contextIdx\n );\n }\n\n // Expression evaluation content\n if (this.state.inExpressionEvaluation) {\n this.state.PushEvaluationStack(currentContentObj);\n }\n // Output stream content (i.e. not expression evaluation)\n else {\n this.state.PushToOutputStream(currentContentObj);\n }\n }\n\n // Increment the content pointer, following diverts if necessary\n this.NextContent();\n\n // Starting a thread should be done after the increment to the content pointer,\n // so that when returning from the thread, it returns to the content after this instruction.\n // var controlCmd = currentContentObj as ;\n let controlCmd = asOrNull(currentContentObj, ControlCommand);\n if (\n controlCmd &&\n controlCmd.commandType == ControlCommand.CommandType.StartThread\n ) {\n this.state.callStack.PushThread();\n }\n }\n\n public VisitContainer(container: Container, atStart: boolean) {\n if (!container.countingAtStartOnly || atStart) {\n if (container.visitsShouldBeCounted)\n this.state.IncrementVisitCountForContainer(container);\n\n if (container.turnIndexShouldBeCounted)\n this.state.RecordTurnIndexVisitToContainer(container);\n }\n }\n\n private _prevContainers: Container[] = [];\n public VisitChangedContainersDueToDivert() {\n let previousPointer = this.state.previousPointer.copy();\n let pointer = this.state.currentPointer.copy();\n\n if (pointer.isNull || pointer.index == -1) return;\n\n this._prevContainers.length = 0;\n if (!previousPointer.isNull) {\n // Container prevAncestor = previousPointer.Resolve() as Container ?? previousPointer.container as Container;\n let resolvedPreviousAncestor = previousPointer.Resolve();\n let prevAncestor =\n asOrNull(resolvedPreviousAncestor, Container) ||\n asOrNull(previousPointer.container, Container);\n while (prevAncestor) {\n this._prevContainers.push(prevAncestor);\n // prevAncestor = prevAncestor.parent as Container;\n prevAncestor = asOrNull(prevAncestor.parent, Container);\n }\n }\n\n let currentChildOfContainer = pointer.Resolve();\n\n if (currentChildOfContainer == null) return;\n\n // Container currentContainerAncestor = currentChildOfContainer.parent as Container;\n let currentContainerAncestor = asOrNull(\n currentChildOfContainer.parent,\n Container\n );\n let allChildrenEnteredAtStart = true;\n while (\n currentContainerAncestor &&\n (this._prevContainers.indexOf(currentContainerAncestor) < 0 ||\n currentContainerAncestor.countingAtStartOnly)\n ) {\n // Check whether this ancestor container is being entered at the start,\n // by checking whether the child object is the first.\n let enteringAtStart =\n currentContainerAncestor.content.length > 0 &&\n currentChildOfContainer == currentContainerAncestor.content[0] &&\n allChildrenEnteredAtStart;\n\n if (!enteringAtStart) allChildrenEnteredAtStart = false;\n\n // Mark a visit to this container\n this.VisitContainer(currentContainerAncestor, enteringAtStart);\n\n currentChildOfContainer = currentContainerAncestor;\n // currentContainerAncestor = currentContainerAncestor.parent as Container;\n currentContainerAncestor = asOrNull(\n currentContainerAncestor.parent,\n Container\n );\n }\n }\n\n public PopChoiceStringAndTags(tags: string[]) {\n let choiceOnlyStrVal = asOrThrows(\n this.state.PopEvaluationStack(),\n StringValue\n );\n\n while (\n this.state.evaluationStack.length > 0 &&\n asOrNull(this.state.PeekEvaluationStack(), Tag) != null\n ) {\n let tag = asOrNull(this.state.PopEvaluationStack(), Tag);\n if (tag) tags.push(tag.text);\n }\n return choiceOnlyStrVal.value;\n }\n\n public ProcessChoice(choicePoint: ChoicePoint) {\n let showChoice = true;\n\n // Don't create choice if choice point doesn't pass conditional\n if (choicePoint.hasCondition) {\n let conditionValue = this.state.PopEvaluationStack();\n if (!this.IsTruthy(conditionValue)) {\n showChoice = false;\n }\n }\n\n let startText = \"\";\n let choiceOnlyText = \"\";\n let tags: string[] = [];\n\n if (choicePoint.hasChoiceOnlyContent) {\n choiceOnlyText = this.PopChoiceStringAndTags(tags) || \"\";\n }\n\n if (choicePoint.hasStartContent) {\n startText = this.PopChoiceStringAndTags(tags) || \"\";\n }\n\n // Don't create choice if player has already read this content\n if (choicePoint.onceOnly) {\n let visitCount = this.state.VisitCountForContainer(\n choicePoint.choiceTarget\n );\n if (visitCount > 0) {\n showChoice = false;\n }\n }\n\n // We go through the full process of creating the choice above so\n // that we consume the content for it, since otherwise it'll\n // be shown on the output stream.\n if (!showChoice) {\n return null;\n }\n\n let choice = new Choice();\n choice.targetPath = choicePoint.pathOnChoice;\n choice.sourcePath = choicePoint.path.toString();\n choice.isInvisibleDefault = choicePoint.isInvisibleDefault;\n choice.threadAtGeneration = this.state.callStack.ForkThread();\n choice.tags = tags.reverse(); //C# is a stack\n choice.text = (startText + choiceOnlyText).replace(/^[ \\t]+|[ \\t]+$/g, \"\");\n\n return choice;\n }\n\n public IsTruthy(obj: InkObject) {\n let truthy = false;\n if (obj instanceof Value) {\n let val = obj;\n\n if (val instanceof DivertTargetValue) {\n let divTarget = val;\n this.Error(\n \"Shouldn't use a divert target (to \" +\n divTarget.targetPath +\n \") as a conditional value. Did you intend a function call 'likeThis()' or a read count check 'likeThis'? (no arrows)\"\n );\n return false;\n }\n\n return val.isTruthy;\n }\n return truthy;\n }\n\n public PerformLogicAndFlowControl(contentObj: InkObject | null) {\n if (contentObj == null) {\n return false;\n }\n\n // Divert\n if (contentObj instanceof Divert) {\n let currentDivert = contentObj;\n\n if (currentDivert.isConditional) {\n let conditionValue = this.state.PopEvaluationStack();\n\n // False conditional? Cancel divert\n if (!this.IsTruthy(conditionValue)) return true;\n }\n\n if (currentDivert.hasVariableTarget) {\n let varName = currentDivert.variableDivertName;\n\n let varContents =\n this.state.variablesState.GetVariableWithName(varName);\n\n if (varContents == null) {\n this.Error(\n \"Tried to divert using a target from a variable that could not be found (\" +\n varName +\n \")\"\n );\n } else if (!(varContents instanceof DivertTargetValue)) {\n // var intContent = varContents as IntValue;\n let intContent = asOrNull(varContents, IntValue);\n\n let errorMessage =\n \"Tried to divert to a target from a variable, but the variable (\" +\n varName +\n \") didn't contain a divert target, it \";\n if (intContent instanceof IntValue && intContent.value == 0) {\n errorMessage += \"was empty/null (the value 0).\";\n } else {\n errorMessage += \"contained '\" + varContents + \"'.\";\n }\n\n this.Error(errorMessage);\n }\n\n let target = asOrThrows(varContents, DivertTargetValue);\n this.state.divertedPointer = this.PointerAtPath(target.targetPath);\n } else if (currentDivert.isExternal) {\n this.CallExternalFunction(\n currentDivert.targetPathString,\n currentDivert.externalArgs\n );\n return true;\n } else {\n this.state.divertedPointer = currentDivert.targetPointer.copy();\n }\n\n if (currentDivert.pushesToStack) {\n this.state.callStack.Push(\n currentDivert.stackPushType,\n undefined,\n this.state.outputStream.length\n );\n }\n\n if (this.state.divertedPointer.isNull && !currentDivert.isExternal) {\n if (\n currentDivert &&\n currentDivert.debugMetadata &&\n currentDivert.debugMetadata.sourceName != null\n ) {\n this.Error(\n \"Divert target doesn't exist: \" +\n currentDivert.debugMetadata.sourceName\n );\n } else {\n this.Error(\"Divert resolution failed: \" + currentDivert);\n }\n }\n\n return true;\n }\n\n // Start/end an expression evaluation? Or print out the result?\n else if (contentObj instanceof ControlCommand) {\n let evalCommand = contentObj;\n\n switch (evalCommand.commandType) {\n case ControlCommand.CommandType.EvalStart:\n this.Assert(\n this.state.inExpressionEvaluation === false,\n \"Already in expression evaluation?\"\n );\n this.state.inExpressionEvaluation = true;\n break;\n\n case ControlCommand.CommandType.EvalEnd:\n this.Assert(\n this.state.inExpressionEvaluation === true,\n \"Not in expression evaluation mode\"\n );\n this.state.inExpressionEvaluation = false;\n break;\n\n case ControlCommand.CommandType.EvalOutput:\n // If the expression turned out to be empty, there may not be anything on the stack\n if (this.state.evaluationStack.length > 0) {\n let output = this.state.PopEvaluationStack();\n\n // Functions may evaluate to Void, in which case we skip output\n if (!(output instanceof Void)) {\n // TODO: Should we really always blanket convert to string?\n // It would be okay to have numbers in the output stream the\n // only problem is when exporting text for viewing, it skips over numbers etc.\n let text = new StringValue(output.toString());\n\n this.state.PushToOutputStream(text);\n }\n }\n break;\n\n case ControlCommand.CommandType.NoOp:\n break;\n\n case ControlCommand.CommandType.Duplicate:\n this.state.PushEvaluationStack(this.state.PeekEvaluationStack());\n break;\n\n case ControlCommand.CommandType.PopEvaluatedValue:\n this.state.PopEvaluationStack();\n break;\n\n case ControlCommand.CommandType.PopFunction:\n case ControlCommand.CommandType.PopTunnel:\n let popType =\n evalCommand.commandType == ControlCommand.CommandType.PopFunction\n ? PushPopType.Function\n : PushPopType.Tunnel;\n\n let overrideTunnelReturnTarget: DivertTargetValue | null = null;\n if (popType == PushPopType.Tunnel) {\n let popped = this.state.PopEvaluationStack();\n // overrideTunnelReturnTarget = popped as DivertTargetValue;\n overrideTunnelReturnTarget = asOrNull(popped, DivertTargetValue);\n if (overrideTunnelReturnTarget === null) {\n this.Assert(\n popped instanceof Void,\n \"Expected void if ->-> doesn't override target\"\n );\n }\n }\n\n if (this.state.TryExitFunctionEvaluationFromGame()) {\n break;\n } else if (\n this.state.callStack.currentElement.type != popType ||\n !this.state.callStack.canPop\n ) {\n let names: Map = new Map();\n names.set(\n PushPopType.Function,\n \"function return statement (~ return)\"\n );\n names.set(PushPopType.Tunnel, \"tunnel onwards statement (->->)\");\n\n let expected = names.get(this.state.callStack.currentElement.type);\n if (!this.state.callStack.canPop) {\n expected = \"end of flow (-> END or choice)\";\n }\n\n let errorMsg =\n \"Found \" + names.get(popType) + \", when expected \" + expected;\n\n this.Error(errorMsg);\n } else {\n this.state.PopCallStack();\n\n if (overrideTunnelReturnTarget)\n this.state.divertedPointer = this.PointerAtPath(\n overrideTunnelReturnTarget.targetPath\n );\n }\n break;\n\n case ControlCommand.CommandType.BeginString:\n this.state.PushToOutputStream(evalCommand);\n\n this.Assert(\n this.state.inExpressionEvaluation === true,\n \"Expected to be in an expression when evaluating a string\"\n );\n this.state.inExpressionEvaluation = false;\n break;\n\n // Leave it to story.currentText and story.currentTags to sort out the text from the tags\n // This is mostly because we can't always rely on the existence of EndTag, and we don't want\n // to try and flatten dynamic tags to strings every time \\n is pushed to output\n case ControlCommand.CommandType.BeginTag:\n this.state.PushToOutputStream(evalCommand);\n break;\n\n // EndTag has 2 modes:\n // - When in string evaluation (for choices)\n // - Normal\n //\n // The only way you could have an EndTag in the middle of\n // string evaluation is if we're currently generating text for a\n // choice, such as:\n //\n // + choice # tag\n //\n // In the above case, the ink will be run twice:\n // - First, to generate the choice text. String evaluation\n // will be on, and the final string will be pushed to the\n // evaluation stack, ready to be popped to make a Choice\n // object.\n // - Second, when ink generates text after choosing the choice.\n // On this ocassion, it's not in string evaluation mode.\n //\n // On the writing side, we disallow manually putting tags within\n // strings like this:\n //\n // {\"hello # world\"}\n //\n // So we know that the tag must be being generated as part of\n // choice content. Therefore, when the tag has been generated,\n // we push it onto the evaluation stack in the exact same way\n // as the string for the choice content.\n case ControlCommand.CommandType.EndTag: {\n if (this.state.inStringEvaluation) {\n let contentStackForTag: InkObject[] = [];\n let outputCountConsumed = 0;\n for (let i = this.state.outputStream.length - 1; i >= 0; --i) {\n let obj = this.state.outputStream[i];\n outputCountConsumed++;\n\n // var command = obj as ControlCommand;\n let command = asOrNull(obj, ControlCommand);\n if (command != null) {\n if (\n command.commandType == ControlCommand.CommandType.BeginTag\n ) {\n break;\n } else {\n this.Error(\n \"Unexpected ControlCommand while extracting tag from choice\"\n );\n break;\n }\n }\n if (obj instanceof StringValue) {\n contentStackForTag.push(obj);\n }\n }\n\n // Consume the content that was produced for this string\n this.state.PopFromOutputStream(outputCountConsumed);\n // Build string out of the content we collected\n let sb = new StringBuilder();\n for (let strVal of contentStackForTag) {\n sb.Append(strVal.toString());\n }\n let choiceTag = new Tag(\n this.state.CleanOutputWhitespace(sb.toString())\n );\n // Pushing to the evaluation stack means it gets picked up\n // when a Choice is generated from the next Choice Point.\n this.state.PushEvaluationStack(choiceTag);\n } else {\n // Otherwise! Simply push EndTag, so that in the output stream we\n // have a structure of: [BeginTag, \"the tag content\", EndTag]\n this.state.PushToOutputStream(evalCommand);\n }\n break;\n }\n\n case ControlCommand.CommandType.EndString: {\n let contentStackForString: InkObject[] = [];\n let contentToRetain: InkObject[] = [];\n\n let outputCountConsumed = 0;\n for (let i = this.state.outputStream.length - 1; i >= 0; --i) {\n let obj = this.state.outputStream[i];\n\n outputCountConsumed++;\n\n // var command = obj as ControlCommand;\n let command = asOrNull(obj, ControlCommand);\n if (\n command &&\n command.commandType == ControlCommand.CommandType.BeginString\n ) {\n break;\n }\n if (obj instanceof Tag) {\n contentToRetain.push(obj);\n }\n if (obj instanceof StringValue) {\n contentStackForString.push(obj);\n }\n }\n\n // Consume the content that was produced for this string\n this.state.PopFromOutputStream(outputCountConsumed);\n\n // Rescue the tags that we want actually to keep on the output stack\n // rather than consume as part of the string we're building.\n // At the time of writing, this only applies to Tag objects generated\n // by choices, which are pushed to the stack during string generation.\n for (let rescuedTag of contentToRetain)\n this.state.PushToOutputStream(rescuedTag);\n\n // The C# version uses a Stack for contentStackForString, but we're\n // using a simple array, so we need to reverse it before using it\n contentStackForString = contentStackForString.reverse();\n\n // Build string out of the content we collected\n let sb = new StringBuilder();\n for (let c of contentStackForString) {\n sb.Append(c.toString());\n }\n\n // Return to expression evaluation (from content mode)\n this.state.inExpressionEvaluation = true;\n this.state.PushEvaluationStack(new StringValue(sb.toString()));\n break;\n }\n\n case ControlCommand.CommandType.ChoiceCount:\n let choiceCount = this.state.generatedChoices.length;\n this.state.PushEvaluationStack(new IntValue(choiceCount));\n break;\n\n case ControlCommand.CommandType.Turns:\n this.state.PushEvaluationStack(\n new IntValue(this.state.currentTurnIndex + 1)\n );\n break;\n\n case ControlCommand.CommandType.TurnsSince:\n case ControlCommand.CommandType.ReadCount:\n let target = this.state.PopEvaluationStack();\n if (!(target instanceof DivertTargetValue)) {\n let extraNote = \"\";\n if (target instanceof IntValue)\n extraNote =\n \". Did you accidentally pass a read count ('knot_name') instead of a target ('-> knot_name')?\";\n this.Error(\n \"TURNS_SINCE / READ_COUNT expected a divert target (knot, stitch, label name), but saw \" +\n target +\n extraNote\n );\n break;\n }\n\n // var divertTarget = target as DivertTargetValue;\n let divertTarget = asOrThrows(target, DivertTargetValue);\n // var container = ContentAtPath (divertTarget.targetPath).correctObj as Container;\n let container = asOrNull(\n this.ContentAtPath(divertTarget.targetPath).correctObj,\n Container\n );\n\n let eitherCount;\n if (container != null) {\n if (\n evalCommand.commandType == ControlCommand.CommandType.TurnsSince\n )\n eitherCount = this.state.TurnsSinceForContainer(container);\n else eitherCount = this.state.VisitCountForContainer(container);\n } else {\n if (\n evalCommand.commandType == ControlCommand.CommandType.TurnsSince\n )\n eitherCount = -1;\n else eitherCount = 0;\n\n this.Warning(\n \"Failed to find container for \" +\n evalCommand.toString() +\n \" lookup at \" +\n divertTarget.targetPath.toString()\n );\n }\n\n this.state.PushEvaluationStack(new IntValue(eitherCount));\n break;\n\n case ControlCommand.CommandType.Random: {\n let maxInt = asOrNull(this.state.PopEvaluationStack(), IntValue);\n let minInt = asOrNull(this.state.PopEvaluationStack(), IntValue);\n\n if (minInt == null || minInt instanceof IntValue === false)\n return this.Error(\n \"Invalid value for minimum parameter of RANDOM(min, max)\"\n );\n\n if (maxInt == null || minInt instanceof IntValue === false)\n return this.Error(\n \"Invalid value for maximum parameter of RANDOM(min, max)\"\n );\n\n // Originally a primitive type, but here, can be null.\n // TODO: Replace by default value?\n if (maxInt.value === null) {\n return throwNullException(\"maxInt.value\");\n }\n if (minInt.value === null) {\n return throwNullException(\"minInt.value\");\n }\n\n // This code is differs a bit from the reference implementation, since\n // JavaScript has no true integers. Hence integer arithmetics and\n // interger overflows don't apply here. A loss of precision can\n // happen with big numbers however.\n //\n // The case where 'randomRange' is lower than zero is handled below,\n // so there's no need to test against Number.MIN_SAFE_INTEGER.\n let randomRange = maxInt.value - minInt.value + 1;\n if (!isFinite(randomRange) || randomRange > Number.MAX_SAFE_INTEGER) {\n randomRange = Number.MAX_SAFE_INTEGER;\n this.Error(\n \"RANDOM was called with a range that exceeds the size that ink numbers can use.\"\n );\n }\n if (randomRange <= 0)\n this.Error(\n \"RANDOM was called with minimum as \" +\n minInt.value +\n \" and maximum as \" +\n maxInt.value +\n \". The maximum must be larger\"\n );\n\n let resultSeed = this.state.storySeed + this.state.previousRandom;\n let random = new PRNG(resultSeed);\n\n let nextRandom = random.next();\n let chosenValue = (nextRandom % randomRange) + minInt.value;\n this.state.PushEvaluationStack(new IntValue(chosenValue));\n\n // Next random number (rather than keeping the Random object around)\n this.state.previousRandom = nextRandom;\n break;\n }\n\n case ControlCommand.CommandType.SeedRandom:\n let seed = asOrNull(this.state.PopEvaluationStack(), IntValue);\n if (seed == null || seed instanceof IntValue === false)\n return this.Error(\"Invalid value passed to SEED_RANDOM\");\n\n // Originally a primitive type, but here, can be null.\n // TODO: Replace by default value?\n if (seed.value === null) {\n return throwNullException(\"minInt.value\");\n }\n\n this.state.storySeed = seed.value;\n this.state.previousRandom = 0;\n\n this.state.PushEvaluationStack(new Void());\n break;\n\n case ControlCommand.CommandType.VisitIndex:\n let count =\n this.state.VisitCountForContainer(\n this.state.currentPointer.container\n ) - 1; // index not count\n this.state.PushEvaluationStack(new IntValue(count));\n break;\n\n case ControlCommand.CommandType.SequenceShuffleIndex:\n let shuffleIndex = this.NextSequenceShuffleIndex();\n this.state.PushEvaluationStack(new IntValue(shuffleIndex));\n break;\n\n case ControlCommand.CommandType.StartThread:\n // Handled in main step function\n break;\n\n case ControlCommand.CommandType.Done:\n // We may exist in the context of the initial\n // act of creating the thread, or in the context of\n // evaluating the content.\n if (this.state.callStack.canPopThread) {\n this.state.callStack.PopThread();\n }\n\n // In normal flow - allow safe exit without warning\n else {\n this.state.didSafeExit = true;\n\n // Stop flow in current thread\n this.state.currentPointer = Pointer.Null;\n }\n\n break;\n\n // Force flow to end completely\n case ControlCommand.CommandType.End:\n this.state.ForceEnd();\n break;\n\n case ControlCommand.CommandType.ListFromInt:\n // var intVal = state.PopEvaluationStack () as IntValue;\n let intVal = asOrNull(this.state.PopEvaluationStack(), IntValue);\n // var listNameVal = state.PopEvaluationStack () as StringValue;\n let listNameVal = asOrThrows(\n this.state.PopEvaluationStack(),\n StringValue\n );\n\n if (intVal === null) {\n throw new StoryException(\n \"Passed non-integer when creating a list element from a numerical value.\"\n );\n }\n\n let generatedListValue = null;\n\n if (this.listDefinitions === null) {\n return throwNullException(\"this.listDefinitions\");\n }\n let foundListDef = this.listDefinitions.TryListGetDefinition(\n listNameVal.value,\n null\n );\n if (foundListDef.exists) {\n // Originally a primitive type, but here, can be null.\n // TODO: Replace by default value?\n if (intVal.value === null) {\n return throwNullException(\"minInt.value\");\n }\n\n let foundItem = foundListDef.result!.TryGetItemWithValue(\n intVal.value,\n InkListItem.Null\n );\n if (foundItem.exists) {\n generatedListValue = new ListValue(\n foundItem.result!,\n intVal.value\n );\n }\n } else {\n throw new StoryException(\n \"Failed to find LIST called \" + listNameVal.value\n );\n }\n\n if (generatedListValue == null) generatedListValue = new ListValue();\n\n this.state.PushEvaluationStack(generatedListValue);\n break;\n\n case ControlCommand.CommandType.ListRange:\n let max = asOrNull(this.state.PopEvaluationStack(), Value);\n let min = asOrNull(this.state.PopEvaluationStack(), Value);\n\n // var targetList = state.PopEvaluationStack () as ListValue;\n let targetList = asOrNull(this.state.PopEvaluationStack(), ListValue);\n\n if (targetList === null || min === null || max === null)\n throw new StoryException(\n \"Expected list, minimum and maximum for LIST_RANGE\"\n );\n\n if (targetList.value === null) {\n return throwNullException(\"targetList.value\");\n }\n let result = targetList.value.ListWithSubRange(\n min.valueObject,\n max.valueObject\n );\n\n this.state.PushEvaluationStack(new ListValue(result));\n break;\n\n case ControlCommand.CommandType.ListRandom: {\n let listVal = this.state.PopEvaluationStack() as ListValue;\n if (listVal === null)\n throw new StoryException(\"Expected list for LIST_RANDOM\");\n\n let list = listVal.value;\n\n let newList: InkList | null = null;\n\n if (list === null) {\n throw throwNullException(\"list\");\n }\n if (list.Count == 0) {\n newList = new InkList();\n } else {\n // Generate a random index for the element to take\n let resultSeed = this.state.storySeed + this.state.previousRandom;\n let random = new PRNG(resultSeed);\n\n let nextRandom = random.next();\n let listItemIndex = nextRandom % list.Count;\n\n // This bit is a little different from the original\n // C# code, since iterators do not work in the same way.\n // First, we iterate listItemIndex - 1 times, calling next().\n // The listItemIndex-th time is made outside of the loop,\n // in order to retrieve the value.\n let listEnumerator = list.entries();\n for (let i = 0; i <= listItemIndex - 1; i++) {\n listEnumerator.next();\n }\n let value = listEnumerator.next().value;\n let randomItem: KeyValuePair = {\n Key: InkListItem.fromSerializedKey(value[0]),\n Value: value[1],\n };\n\n // Origin list is simply the origin of the one element\n if (randomItem.Key.originName === null) {\n return throwNullException(\"randomItem.Key.originName\");\n }\n newList = new InkList(randomItem.Key.originName, this);\n newList.Add(randomItem.Key, randomItem.Value);\n\n this.state.previousRandom = nextRandom;\n }\n\n this.state.PushEvaluationStack(new ListValue(newList));\n break;\n }\n\n default:\n this.Error(\"unhandled ControlCommand: \" + evalCommand);\n break;\n }\n\n return true;\n }\n\n // Variable assignment\n else if (contentObj instanceof VariableAssignment) {\n let varAss = contentObj;\n let assignedVal = this.state.PopEvaluationStack();\n\n this.state.variablesState.Assign(varAss, assignedVal);\n\n return true;\n }\n\n // Variable reference\n else if (contentObj instanceof VariableReference) {\n let varRef = contentObj;\n let foundValue = null;\n\n // Explicit read count value\n if (varRef.pathForCount != null) {\n let container = varRef.containerForCount;\n let count = this.state.VisitCountForContainer(container);\n foundValue = new IntValue(count);\n }\n\n // Normal variable reference\n else {\n foundValue = this.state.variablesState.GetVariableWithName(varRef.name);\n\n if (foundValue == null) {\n this.Warning(\n \"Variable not found: '\" +\n varRef.name +\n \"'. Using default value of 0 (false). This can happen with temporary variables if the declaration hasn't yet been hit. Globals are always given a default value on load if a value doesn't exist in the save state.\"\n );\n foundValue = new IntValue(0);\n }\n }\n\n this.state.PushEvaluationStack(foundValue);\n\n return true;\n }\n\n // Native function call\n else if (contentObj instanceof NativeFunctionCall) {\n let func = contentObj;\n let funcParams = this.state.PopEvaluationStack(func.numberOfParameters);\n let result = func.Call(funcParams);\n this.state.PushEvaluationStack(result);\n return true;\n }\n\n // No control content, must be ordinary content\n return false;\n }\n\n public ChoosePathString(\n path: string,\n resetCallstack = true,\n args: any[] = []\n ) {\n this.IfAsyncWeCant(\"call ChoosePathString right now\");\n if (this.onChoosePathString !== null) this.onChoosePathString(path, args);\n\n if (resetCallstack) {\n this.ResetCallstack();\n } else {\n if (this.state.callStack.currentElement.type == PushPopType.Function) {\n let funcDetail = \"\";\n let container =\n this.state.callStack.currentElement.currentPointer.container;\n if (container != null) {\n funcDetail = \"(\" + container.path.toString() + \") \";\n }\n throw new Error(\n \"Story was running a function \" +\n funcDetail +\n \"when you called ChoosePathString(\" +\n path +\n \") - this is almost certainly not not what you want! Full stack trace: \\n\" +\n this.state.callStack.callStackTrace\n );\n }\n }\n\n this.state.PassArgumentsToEvaluationStack(args);\n this.ChoosePath(new Path(path));\n }\n\n public IfAsyncWeCant(activityStr: string) {\n if (this._asyncContinueActive)\n throw new Error(\n \"Can't \" +\n activityStr +\n \". Story is in the middle of a ContinueAsync(). Make more ContinueAsync() calls or a single Continue() call beforehand.\"\n );\n }\n\n public ChoosePath(p: Path, incrementingTurnIndex: boolean = true) {\n this.state.SetChosenPath(p, incrementingTurnIndex);\n\n // Take a note of newly visited containers for read counts etc\n this.VisitChangedContainersDueToDivert();\n }\n\n public ChooseChoiceIndex(choiceIdx: number) {\n choiceIdx = choiceIdx;\n let choices = this.currentChoices;\n this.Assert(\n choiceIdx >= 0 && choiceIdx < choices.length,\n \"choice out of range\"\n );\n\n let choiceToChoose = choices[choiceIdx];\n if (this.onMakeChoice !== null) this.onMakeChoice(choiceToChoose);\n\n if (choiceToChoose.threadAtGeneration === null) {\n return throwNullException(\"choiceToChoose.threadAtGeneration\");\n }\n if (choiceToChoose.targetPath === null) {\n return throwNullException(\"choiceToChoose.targetPath\");\n }\n\n this.state.callStack.currentThread = choiceToChoose.threadAtGeneration;\n\n this.ChoosePath(choiceToChoose.targetPath);\n }\n\n public HasFunction(functionName: string) {\n try {\n return this.KnotContainerWithName(functionName) != null;\n } catch (e) {\n return false;\n }\n }\n\n public EvaluateFunction(\n functionName: string,\n args: any[] = [],\n returnTextOutput: boolean = false\n ): Story.EvaluateFunctionTextOutput | any {\n // EvaluateFunction behaves slightly differently than the C# version.\n // In C#, you can pass a (second) parameter `out textOutput` to get the\n // text outputted by the function. This is not possible in js. Instead,\n // we maintain the regular signature (functionName, args), plus an\n // optional third parameter returnTextOutput. If set to true, we will\n // return both the textOutput and the returned value, as an object.\n\n if (this.onEvaluateFunction !== null)\n this.onEvaluateFunction(functionName, args);\n\n this.IfAsyncWeCant(\"evaluate a function\");\n\n if (functionName == null) {\n throw new Error(\"Function is null\");\n } else if (functionName == \"\" || functionName.trim() == \"\") {\n throw new Error(\"Function is empty or white space.\");\n }\n\n let funcContainer = this.KnotContainerWithName(functionName);\n if (funcContainer == null) {\n throw new Error(\"Function doesn't exist: '\" + functionName + \"'\");\n }\n\n let outputStreamBefore: InkObject[] = [];\n outputStreamBefore.push(...this.state.outputStream);\n this._state.ResetOutput();\n\n this.state.StartFunctionEvaluationFromGame(funcContainer, args);\n\n // Evaluate the function, and collect the string output\n let stringOutput = new StringBuilder();\n while (this.canContinue) {\n stringOutput.Append(this.Continue());\n }\n let textOutput = stringOutput.toString();\n\n this._state.ResetOutput(outputStreamBefore);\n\n let result = this.state.CompleteFunctionEvaluationFromGame();\n if (this.onCompleteEvaluateFunction != null)\n this.onCompleteEvaluateFunction(functionName, args, textOutput, result);\n\n return returnTextOutput ? { returned: result, output: textOutput } : result;\n }\n\n public EvaluateExpression(exprContainer: Container) {\n let startCallStackHeight = this.state.callStack.elements.length;\n\n this.state.callStack.Push(PushPopType.Tunnel);\n\n this._temporaryEvaluationContainer = exprContainer;\n\n this.state.GoToStart();\n\n let evalStackHeight = this.state.evaluationStack.length;\n\n this.Continue();\n\n this._temporaryEvaluationContainer = null;\n\n // Should have fallen off the end of the Container, which should\n // have auto-popped, but just in case we didn't for some reason,\n // manually pop to restore the state (including currentPath).\n if (this.state.callStack.elements.length > startCallStackHeight) {\n this.state.PopCallStack();\n }\n\n let endStackHeight = this.state.evaluationStack.length;\n if (endStackHeight > evalStackHeight) {\n return this.state.PopEvaluationStack();\n } else {\n return null;\n }\n }\n\n public allowExternalFunctionFallbacks: boolean = false;\n\n public CallExternalFunction(\n funcName: string | null,\n numberOfArguments: number\n ) {\n if (funcName === null) {\n return throwNullException(\"funcName\");\n }\n let funcDef = this._externals.get(funcName);\n let fallbackFunctionContainer = null;\n\n let foundExternal = typeof funcDef !== \"undefined\";\n\n if (\n foundExternal &&\n !funcDef!.lookAheadSafe &&\n this._stateSnapshotAtLastNewline !== null\n ) {\n this._sawLookaheadUnsafeFunctionAfterNewline = true;\n return;\n }\n\n if (!foundExternal) {\n if (this.allowExternalFunctionFallbacks) {\n fallbackFunctionContainer = this.KnotContainerWithName(funcName);\n this.Assert(\n fallbackFunctionContainer !== null,\n \"Trying to call EXTERNAL function '\" +\n funcName +\n \"' which has not been bound, and fallback ink function could not be found.\"\n );\n\n // Divert direct into fallback function and we're done\n this.state.callStack.Push(\n PushPopType.Function,\n undefined,\n this.state.outputStream.length\n );\n this.state.divertedPointer = Pointer.StartOf(fallbackFunctionContainer);\n return;\n } else {\n this.Assert(\n false,\n \"Trying to call EXTERNAL function '\" +\n funcName +\n \"' which has not been bound (and ink fallbacks disabled).\"\n );\n }\n }\n\n // Pop arguments\n let args: any[] = [];\n for (let i = 0; i < numberOfArguments; ++i) {\n // var poppedObj = state.PopEvaluationStack () as Value;\n let poppedObj = asOrThrows(this.state.PopEvaluationStack(), Value);\n let valueObj = poppedObj.valueObject;\n args.push(valueObj);\n }\n\n // Reverse arguments from the order they were popped,\n // so they're the right way round again.\n args.reverse();\n\n // Run the function!\n let funcResult = funcDef!.function(args);\n\n // Convert return value (if any) to the a type that the ink engine can use\n let returnObj = null;\n if (funcResult != null) {\n returnObj = Value.Create(funcResult);\n this.Assert(\n returnObj !== null,\n \"Could not create ink value from returned object of type \" +\n typeof funcResult\n );\n } else {\n returnObj = new Void();\n }\n\n this.state.PushEvaluationStack(returnObj);\n }\n\n public BindExternalFunctionGeneral(\n funcName: string,\n func: Story.ExternalFunction,\n lookaheadSafe: boolean = true\n ) {\n this.IfAsyncWeCant(\"bind an external function\");\n this.Assert(\n !this._externals.has(funcName),\n \"Function '\" + funcName + \"' has already been bound.\"\n );\n this._externals.set(funcName, {\n function: func,\n lookAheadSafe: lookaheadSafe,\n });\n }\n\n public TryCoerce(value: any) {\n // We're skipping type coercition in this implementation. First of, js\n // is loosely typed, so it's not that important. Secondly, there is no\n // clean way (AFAIK) for the user to describe what type of parameters\n // they expect.\n return value;\n }\n\n public BindExternalFunction(\n funcName: string,\n func: Story.ExternalFunction,\n lookaheadSafe: boolean = false\n ) {\n this.Assert(func != null, \"Can't bind a null function\");\n\n this.BindExternalFunctionGeneral(\n funcName,\n (args: any) => {\n this.Assert(\n args.length >= func.length,\n \"External function expected \" + func.length + \" arguments\"\n );\n\n let coercedArgs = [];\n for (let i = 0, l = args.length; i < l; i++) {\n coercedArgs[i] = this.TryCoerce(args[i]);\n }\n return func.apply(null, coercedArgs);\n },\n lookaheadSafe\n );\n }\n\n public UnbindExternalFunction(funcName: string) {\n this.IfAsyncWeCant(\"unbind an external a function\");\n this.Assert(\n this._externals.has(funcName),\n \"Function '\" + funcName + \"' has not been bound.\"\n );\n this._externals.delete(funcName);\n }\n\n public ValidateExternalBindings(): void;\n public ValidateExternalBindings(\n c: Container | null,\n missingExternals: Set\n ): void;\n public ValidateExternalBindings(\n o: InkObject | null,\n missingExternals: Set\n ): void;\n public ValidateExternalBindings() {\n let c: Container | null = null;\n let o: InkObject | null = null;\n let missingExternals: Set = arguments[1] || new Set();\n\n if (arguments[0] instanceof Container) {\n c = arguments[0];\n }\n\n if (arguments[0] instanceof InkObject) {\n o = arguments[0];\n }\n\n if (c === null && o === null) {\n this.ValidateExternalBindings(\n this._mainContentContainer,\n missingExternals\n );\n this._hasValidatedExternals = true;\n\n // No problem! Validation complete\n if (missingExternals.size == 0) {\n this._hasValidatedExternals = true;\n } else {\n let message = \"Error: Missing function binding for external\";\n message += missingExternals.size > 1 ? \"s\" : \"\";\n message += \": '\";\n message += Array.from(missingExternals).join(\"', '\");\n message += \"' \";\n message += this.allowExternalFunctionFallbacks\n ? \", and no fallback ink function found.\"\n : \" (ink fallbacks disabled)\";\n\n this.Error(message);\n }\n } else if (c != null) {\n for (let innerContent of c.content) {\n let container = innerContent as Container;\n if (container == null || !container.hasValidName)\n this.ValidateExternalBindings(innerContent, missingExternals);\n }\n for (let [, value] of c.namedContent) {\n this.ValidateExternalBindings(\n asOrNull(value, InkObject),\n missingExternals\n );\n }\n } else if (o != null) {\n let divert = asOrNull(o, Divert);\n if (divert && divert.isExternal) {\n let name = divert.targetPathString;\n if (name === null) {\n return throwNullException(\"name\");\n }\n if (!this._externals.has(name)) {\n if (this.allowExternalFunctionFallbacks) {\n let fallbackFound =\n this.mainContentContainer.namedContent.has(name);\n if (!fallbackFound) {\n missingExternals.add(name);\n }\n } else {\n missingExternals.add(name);\n }\n }\n }\n }\n }\n\n public ObserveVariable(\n variableName: string,\n observer: Story.VariableObserver\n ) {\n this.IfAsyncWeCant(\"observe a new variable\");\n\n if (this._variableObservers === null) this._variableObservers = new Map();\n\n if (!this.state.variablesState.GlobalVariableExistsWithName(variableName))\n throw new Error(\n \"Cannot observe variable '\" +\n variableName +\n \"' because it wasn't declared in the ink story.\"\n );\n\n if (this._variableObservers.has(variableName)) {\n this._variableObservers.get(variableName)!.push(observer);\n } else {\n this._variableObservers.set(variableName, [observer]);\n }\n }\n\n public ObserveVariables(\n variableNames: string[],\n observers: Story.VariableObserver[]\n ) {\n for (let i = 0, l = variableNames.length; i < l; i++) {\n this.ObserveVariable(variableNames[i], observers[i]);\n }\n }\n\n public RemoveVariableObserver(\n observer?: Story.VariableObserver,\n specificVariableName?: string\n ) {\n // A couple of things to know about this method:\n //\n // 1. Since `RemoveVariableObserver` is exposed to the JavaScript world,\n // optionality is marked as `undefined` rather than `null`.\n // To keep things simple, null-checks are performed using regular\n // equality operators, where undefined == null.\n //\n // 2. Since C# delegates are translated to arrays of functions,\n // -= becomes a call to splice and null-checks are replaced by\n // emptiness-checks.\n //\n this.IfAsyncWeCant(\"remove a variable observer\");\n\n if (this._variableObservers === null) return;\n\n if (specificVariableName != null) {\n if (this._variableObservers.has(specificVariableName)) {\n if (observer != null) {\n let variableObservers =\n this._variableObservers.get(specificVariableName);\n if (variableObservers != null) {\n variableObservers.splice(variableObservers.indexOf(observer), 1);\n if (variableObservers.length === 0) {\n this._variableObservers.delete(specificVariableName);\n }\n }\n } else {\n this._variableObservers.delete(specificVariableName);\n }\n }\n } else if (observer != null) {\n let keys = this._variableObservers.keys();\n for (let varName of keys) {\n let variableObservers = this._variableObservers.get(varName);\n if (variableObservers != null) {\n variableObservers.splice(variableObservers.indexOf(observer), 1);\n if (variableObservers.length === 0) {\n this._variableObservers.delete(varName);\n }\n }\n }\n }\n }\n\n public VariableStateDidChangeEvent(\n variableName: string,\n newValueObj: InkObject\n ) {\n if (this._variableObservers === null) return;\n\n let observers = this._variableObservers.get(variableName);\n if (typeof observers !== \"undefined\") {\n if (!(newValueObj instanceof Value)) {\n throw new Error(\n \"Tried to get the value of a variable that isn't a standard type\"\n );\n }\n // var val = newValueObj as Value;\n let val = asOrThrows(newValueObj, Value);\n\n for (let observer of observers) {\n observer(variableName, val.valueObject);\n }\n }\n }\n\n get globalTags() {\n return this.TagsAtStartOfFlowContainerWithPathString(\"\");\n }\n\n public TagsForContentAtPath(path: string) {\n return this.TagsAtStartOfFlowContainerWithPathString(path);\n }\n\n public TagsAtStartOfFlowContainerWithPathString(pathString: string) {\n let path = new Path(pathString);\n\n let flowContainer = this.ContentAtPath(path).container;\n if (flowContainer === null) {\n return throwNullException(\"flowContainer\");\n }\n while (true) {\n let firstContent: InkObject = flowContainer.content[0];\n if (firstContent instanceof Container) flowContainer = firstContent;\n else break;\n }\n\n let inTag = false;\n let tags: string[] | null = null;\n\n for (let c of flowContainer.content) {\n // var tag = c as Runtime.Tag;\n let command = asOrNull(c, ControlCommand);\n\n if (command != null) {\n if (command.commandType == ControlCommand.CommandType.BeginTag) {\n inTag = true;\n } else if (command.commandType == ControlCommand.CommandType.EndTag) {\n inTag = false;\n }\n } else if (inTag) {\n let str = asOrNull(c, StringValue);\n if (str !== null) {\n if (tags === null) tags = [];\n if (str.value !== null) tags.push(str.value);\n } else {\n this.Error(\n \"Tag contained non-text content. Only plain text is allowed when using globalTags or TagsAtContentPath. If you want to evaluate dynamic content, you need to use story.Continue().\"\n );\n }\n } else {\n break;\n }\n }\n\n return tags;\n }\n\n public BuildStringOfHierarchy() {\n let sb = new StringBuilder();\n\n this.mainContentContainer.BuildStringOfHierarchy(\n sb,\n 0,\n this.state.currentPointer.Resolve()\n );\n\n return sb.toString();\n }\n\n public BuildStringOfContainer(container: Container) {\n let sb = new StringBuilder();\n container.BuildStringOfHierarchy(\n sb,\n 0,\n this.state.currentPointer.Resolve()\n );\n return sb.toString();\n }\n\n public NextContent() {\n this.state.previousPointer = this.state.currentPointer.copy();\n\n if (!this.state.divertedPointer.isNull) {\n this.state.currentPointer = this.state.divertedPointer.copy();\n this.state.divertedPointer = Pointer.Null;\n\n this.VisitChangedContainersDueToDivert();\n\n if (!this.state.currentPointer.isNull) {\n return;\n }\n }\n\n let successfulPointerIncrement = this.IncrementContentPointer();\n\n if (!successfulPointerIncrement) {\n let didPop = false;\n\n if (this.state.callStack.CanPop(PushPopType.Function)) {\n this.state.PopCallStack(PushPopType.Function);\n\n if (this.state.inExpressionEvaluation) {\n this.state.PushEvaluationStack(new Void());\n }\n\n didPop = true;\n } else if (this.state.callStack.canPopThread) {\n this.state.callStack.PopThread();\n\n didPop = true;\n } else {\n this.state.TryExitFunctionEvaluationFromGame();\n }\n\n if (didPop && !this.state.currentPointer.isNull) {\n this.NextContent();\n }\n }\n }\n\n public IncrementContentPointer() {\n let successfulIncrement = true;\n\n let pointer = this.state.callStack.currentElement.currentPointer.copy();\n pointer.index++;\n\n if (pointer.container === null) {\n return throwNullException(\"pointer.container\");\n }\n while (pointer.index >= pointer.container.content.length) {\n successfulIncrement = false;\n\n // Container nextAncestor = pointer.container.parent as Container;\n let nextAncestor = asOrNull(pointer.container.parent, Container);\n if (nextAncestor instanceof Container === false) {\n break;\n }\n\n let indexInAncestor = nextAncestor!.content.indexOf(pointer.container);\n if (indexInAncestor == -1) {\n break;\n }\n\n pointer = new Pointer(nextAncestor, indexInAncestor);\n\n pointer.index++;\n\n successfulIncrement = true;\n if (pointer.container === null) {\n return throwNullException(\"pointer.container\");\n }\n }\n\n if (!successfulIncrement) pointer = Pointer.Null;\n\n this.state.callStack.currentElement.currentPointer = pointer.copy();\n\n return successfulIncrement;\n }\n\n public TryFollowDefaultInvisibleChoice() {\n let allChoices = this._state.currentChoices;\n\n let invisibleChoices = allChoices.filter((c) => c.isInvisibleDefault);\n\n if (\n invisibleChoices.length == 0 ||\n allChoices.length > invisibleChoices.length\n )\n return false;\n\n let choice = invisibleChoices[0];\n\n if (choice.targetPath === null) {\n return throwNullException(\"choice.targetPath\");\n }\n\n if (choice.threadAtGeneration === null) {\n return throwNullException(\"choice.threadAtGeneration\");\n }\n\n this.state.callStack.currentThread = choice.threadAtGeneration;\n\n if (this._stateSnapshotAtLastNewline !== null) {\n this.state.callStack.currentThread = this.state.callStack.ForkThread();\n }\n\n this.ChoosePath(choice.targetPath, false);\n\n return true;\n }\n\n public NextSequenceShuffleIndex() {\n // var numElementsIntVal = state.PopEvaluationStack () as IntValue;\n let numElementsIntVal = asOrNull(this.state.PopEvaluationStack(), IntValue);\n if (!(numElementsIntVal instanceof IntValue)) {\n this.Error(\"expected number of elements in sequence for shuffle index\");\n return 0;\n }\n\n let seqContainer = this.state.currentPointer.container;\n if (seqContainer === null) {\n return throwNullException(\"seqContainer\");\n }\n\n // Originally a primitive type, but here, can be null.\n // TODO: Replace by default value?\n if (numElementsIntVal.value === null) {\n return throwNullException(\"numElementsIntVal.value\");\n }\n let numElements = numElementsIntVal.value;\n\n // var seqCountVal = state.PopEvaluationStack () as IntValue;\n let seqCountVal = asOrThrows(this.state.PopEvaluationStack(), IntValue);\n let seqCount = seqCountVal.value;\n\n // Originally a primitive type, but here, can be null.\n // TODO: Replace by default value?\n if (seqCount === null) {\n return throwNullException(\"seqCount\");\n }\n\n let loopIndex = seqCount / numElements;\n let iterationIndex = seqCount % numElements;\n\n let seqPathStr = seqContainer.path.toString();\n let sequenceHash = 0;\n for (let i = 0, l = seqPathStr.length; i < l; i++) {\n sequenceHash += seqPathStr.charCodeAt(i) || 0;\n }\n let randomSeed = sequenceHash + loopIndex + this.state.storySeed;\n let random = new PRNG(Math.floor(randomSeed));\n\n let unpickedIndices = [];\n for (let i = 0; i < numElements; ++i) {\n unpickedIndices.push(i);\n }\n\n for (let i = 0; i <= iterationIndex; ++i) {\n let chosen = random.next() % unpickedIndices.length;\n let chosenIndex = unpickedIndices[chosen];\n unpickedIndices.splice(chosen, 1);\n\n if (i == iterationIndex) {\n return chosenIndex;\n }\n }\n\n throw new Error(\"Should never reach here\");\n }\n\n public Error(message: string, useEndLineNumber = false): never {\n let e = new StoryException(message);\n e.useEndLineNumber = useEndLineNumber;\n throw e;\n }\n\n public Warning(message: string) {\n this.AddError(message, true);\n }\n\n public AddError(\n message: string,\n isWarning = false,\n useEndLineNumber = false\n ) {\n let dm = this.currentDebugMetadata;\n\n let errorTypeStr = isWarning ? \"WARNING\" : \"ERROR\";\n\n if (dm != null) {\n let lineNum = useEndLineNumber ? dm.endLineNumber : dm.startLineNumber;\n message =\n \"RUNTIME \" +\n errorTypeStr +\n \": '\" +\n dm.fileName +\n \"' line \" +\n lineNum +\n \": \" +\n message;\n } else if (!this.state.currentPointer.isNull) {\n message =\n \"RUNTIME \" +\n errorTypeStr +\n \": (\" +\n this.state.currentPointer +\n \"): \" +\n message;\n } else {\n message = \"RUNTIME \" + errorTypeStr + \": \" + message;\n }\n\n this.state.AddError(message, isWarning);\n\n // In a broken state don't need to know about any other errors.\n if (!isWarning) this.state.ForceEnd();\n }\n\n public Assert(condition: boolean, message: string | null = null) {\n if (condition == false) {\n if (message == null) {\n message = \"Story assert\";\n }\n\n throw new Error(message + \" \" + this.currentDebugMetadata);\n }\n }\n\n get currentDebugMetadata(): DebugMetadata | null {\n let dm: DebugMetadata | null;\n\n let pointer = this.state.currentPointer;\n if (!pointer.isNull && pointer.Resolve() !== null) {\n dm = pointer.Resolve()!.debugMetadata;\n if (dm !== null) {\n return dm;\n }\n }\n\n for (let i = this.state.callStack.elements.length - 1; i >= 0; --i) {\n pointer = this.state.callStack.elements[i].currentPointer;\n if (!pointer.isNull && pointer.Resolve() !== null) {\n dm = pointer.Resolve()!.debugMetadata;\n if (dm !== null) {\n return dm;\n }\n }\n }\n\n for (let i = this.state.outputStream.length - 1; i >= 0; --i) {\n let outputObj = this.state.outputStream[i];\n dm = outputObj.debugMetadata;\n if (dm !== null) {\n return dm;\n }\n }\n\n return null;\n }\n\n get mainContentContainer() {\n if (this._temporaryEvaluationContainer) {\n return this._temporaryEvaluationContainer;\n } else {\n return this._mainContentContainer;\n }\n }\n\n /**\n * `_mainContentContainer` is almost guaranteed to be set in the\n * constructor, unless the json is malformed.\n */\n private _mainContentContainer!: Container;\n private _listDefinitions: ListDefinitionsOrigin | null = null;\n\n private _externals: Map;\n private _variableObservers: Map | null =\n null;\n private _hasValidatedExternals: boolean = false;\n\n private _temporaryEvaluationContainer: Container | null = null;\n\n /**\n * `state` is almost guaranteed to be set in the constructor, unless\n * using the compiler-specific constructor which will likely not be used in\n * the real world.\n */\n private _state!: StoryState;\n\n private _asyncContinueActive: boolean = false;\n private _stateSnapshotAtLastNewline: StoryState | null = null;\n private _sawLookaheadUnsafeFunctionAfterNewline: boolean = false;\n\n private _recursiveContinueCount: number = 0;\n\n private _asyncSaving: boolean = false;\n\n private _profiler: any | null = null; // TODO: Profiler\n}\n\nexport namespace Story {\n export enum OutputStateChange {\n NoChange = 0,\n ExtendedBeyondNewline = 1,\n NewlineRemoved = 2,\n }\n\n export interface EvaluateFunctionTextOutput {\n returned: any;\n output: string;\n }\n\n export interface ExternalFunctionDef {\n function: ExternalFunction;\n lookAheadSafe: boolean;\n }\n\n export type VariableObserver = (variableName: string, newValue: any) => void;\n export type ExternalFunction = (...args: any) => any;\n}\n","import { CallStack } from \"./CallStack\";\nimport { VariablesState } from \"./VariablesState\";\nimport { ValueType, Value, StringValue, ListValue } from \"./Value\";\nimport { PushPopType } from \"./PushPop\";\nimport { Tag } from \"./Tag\";\nimport { Glue } from \"./Glue\";\nimport { Path } from \"./Path\";\nimport { ControlCommand } from \"./ControlCommand\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { JsonSerialisation } from \"./JsonSerialisation\";\nimport { PRNG } from \"./PRNG\";\nimport { Void } from \"./Void\";\nimport { Pointer } from \"./Pointer\";\nimport { tryGetValueFromMap } from \"./TryGetResult\";\nimport { Choice } from \"./Choice\";\nimport { asOrNull, asOrThrows, nullIfUndefined } from \"./TypeAssertion\";\nimport { Debug } from \"./Debug\";\nimport { Container } from \"./Container\";\nimport { InkObject } from \"./Object\";\nimport { throwNullException } from \"./NullException\";\nimport { Story } from \"./Story\";\nimport { StatePatch } from \"./StatePatch\";\nimport { SimpleJson } from \"./SimpleJson\";\nimport { Flow } from \"./Flow\";\nimport { InkList } from \"./InkList\";\n\nexport class StoryState {\n // Backward compatible changes since v8:\n // v10: dynamic tags\n // v9: multi-flows\n public readonly kInkSaveStateVersion = 10;\n public readonly kMinCompatibleLoadVersion = 8;\n\n public onDidLoadState: (() => void) | null = null;\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n public ToJson(indented: boolean = false) {\n let writer = new SimpleJson.Writer();\n this.WriteJson(writer);\n return writer.toString();\n }\n public toJson(indented: boolean = false) {\n return this.ToJson(indented);\n }\n\n public LoadJson(json: string) {\n let jObject = SimpleJson.TextToDictionary(json);\n this.LoadJsonObj(jObject);\n if (this.onDidLoadState !== null) this.onDidLoadState();\n }\n\n public VisitCountAtPathString(pathString: string) {\n let visitCountOut;\n\n if (this._patch !== null) {\n let container = this.story.ContentAtPath(new Path(pathString)).container;\n if (container === null)\n throw new Error(\"Content at path not found: \" + pathString);\n\n visitCountOut = this._patch.TryGetVisitCount(container, 0);\n if (visitCountOut.exists) return visitCountOut.result;\n }\n\n visitCountOut = tryGetValueFromMap(this._visitCounts, pathString, null);\n if (visitCountOut.exists) return visitCountOut.result;\n\n return 0;\n }\n\n public VisitCountForContainer(container: Container | null): number {\n if (container === null) {\n return throwNullException(\"container\");\n }\n if (!container.visitsShouldBeCounted) {\n this.story.Error(\n \"Read count for target (\" +\n container.name +\n \" - on \" +\n container.debugMetadata +\n \") unknown. The story may need to be compiled with countAllVisits flag (-c).\"\n );\n return 0;\n }\n\n if (this._patch !== null) {\n let count = this._patch.TryGetVisitCount(container, 0);\n if (count.exists) {\n return count.result!;\n }\n }\n\n let containerPathStr = container.path.toString();\n let count2 = tryGetValueFromMap(this._visitCounts, containerPathStr, null);\n if (count2.exists) {\n return count2.result!;\n }\n\n return 0;\n }\n\n public IncrementVisitCountForContainer(container: Container) {\n if (this._patch !== null) {\n let currCount = this.VisitCountForContainer(container);\n currCount++;\n this._patch.SetVisitCount(container, currCount);\n return;\n }\n\n let containerPathStr = container.path.toString();\n let count = tryGetValueFromMap(this._visitCounts, containerPathStr, null);\n if (count.exists) {\n this._visitCounts.set(containerPathStr, count.result! + 1);\n } else {\n this._visitCounts.set(containerPathStr, 1);\n }\n }\n\n public RecordTurnIndexVisitToContainer(container: Container) {\n if (this._patch !== null) {\n this._patch.SetTurnIndex(container, this.currentTurnIndex);\n return;\n }\n\n let containerPathStr = container.path.toString();\n this._turnIndices.set(containerPathStr, this.currentTurnIndex);\n }\n\n public TurnsSinceForContainer(container: Container) {\n if (!container.turnIndexShouldBeCounted) {\n this.story.Error(\n \"TURNS_SINCE() for target (\" +\n container.name +\n \" - on \" +\n container.debugMetadata +\n \") unknown. The story may need to be compiled with countAllVisits flag (-c).\"\n );\n }\n\n if (this._patch !== null) {\n let index = this._patch.TryGetTurnIndex(container, 0);\n if (index.exists) {\n return this.currentTurnIndex - index.result!;\n }\n }\n\n let containerPathStr = container.path.toString();\n let index2 = tryGetValueFromMap(this._turnIndices, containerPathStr, 0);\n if (index2.exists) {\n return this.currentTurnIndex - index2.result!;\n } else {\n return -1;\n }\n }\n\n get callstackDepth() {\n return this.callStack.depth;\n }\n\n get outputStream() {\n return this._currentFlow.outputStream;\n }\n\n get currentChoices() {\n // If we can continue generating text content rather than choices,\n // then we reflect the choice list as being empty, since choices\n // should always come at the end.\n if (this.canContinue) return [];\n return this._currentFlow.currentChoices;\n }\n\n get generatedChoices() {\n return this._currentFlow.currentChoices;\n }\n\n get currentErrors() {\n return this._currentErrors;\n }\n private _currentErrors: string[] | null = null;\n\n get currentWarnings() {\n return this._currentWarnings;\n }\n private _currentWarnings: string[] | null = null;\n\n get variablesState() {\n return this._variablesState;\n }\n set variablesState(value) {\n this._variablesState = value;\n }\n private _variablesState: VariablesState;\n\n get callStack() {\n return this._currentFlow.callStack;\n }\n\n get evaluationStack() {\n return this._evaluationStack;\n }\n private _evaluationStack: InkObject[];\n\n public divertedPointer: Pointer = Pointer.Null;\n\n get currentTurnIndex() {\n return this._currentTurnIndex;\n }\n set currentTurnIndex(value) {\n this._currentTurnIndex = value;\n }\n private _currentTurnIndex: number = 0;\n\n public storySeed: number = 0;\n public previousRandom: number = 0;\n public didSafeExit: boolean = false;\n\n public story: Story;\n\n get currentPathString() {\n let pointer = this.currentPointer;\n if (pointer.isNull) {\n return null;\n } else {\n if (pointer.path === null) {\n return throwNullException(\"pointer.path\");\n }\n return pointer.path.toString();\n }\n }\n\n get currentPointer() {\n return this.callStack.currentElement.currentPointer.copy();\n }\n\n set currentPointer(value) {\n this.callStack.currentElement.currentPointer = value.copy();\n }\n\n get previousPointer() {\n return this.callStack.currentThread.previousPointer.copy();\n }\n\n set previousPointer(value) {\n this.callStack.currentThread.previousPointer = value.copy();\n }\n\n get canContinue() {\n return !this.currentPointer.isNull && !this.hasError;\n }\n\n get hasError() {\n return this.currentErrors != null && this.currentErrors.length > 0;\n }\n\n get hasWarning() {\n return this.currentWarnings != null && this.currentWarnings.length > 0;\n }\n\n get currentText() {\n if (this._outputStreamTextDirty) {\n let sb = new StringBuilder();\n\n let inTag: boolean = false;\n\n for (let outputObj of this.outputStream) {\n // var textContent = outputObj as StringValue;\n let textContent = asOrNull(outputObj, StringValue);\n if (!inTag && textContent !== null) {\n sb.Append(textContent.value);\n } else {\n let controlCommand = asOrNull(outputObj, ControlCommand);\n if (controlCommand !== null) {\n if (\n controlCommand.commandType == ControlCommand.CommandType.BeginTag\n ) {\n inTag = true;\n } else if (\n controlCommand.commandType == ControlCommand.CommandType.EndTag\n ) {\n inTag = false;\n }\n }\n }\n }\n\n this._currentText = this.CleanOutputWhitespace(sb.toString());\n this._outputStreamTextDirty = false;\n }\n\n return this._currentText;\n }\n private _currentText: string | null = null;\n\n public CleanOutputWhitespace(str: string) {\n let sb = new StringBuilder();\n\n let currentWhitespaceStart = -1;\n let startOfLine = 0;\n\n for (let i = 0; i < str.length; i++) {\n let c = str.charAt(i);\n\n let isInlineWhitespace = c == \" \" || c == \"\\t\";\n\n if (isInlineWhitespace && currentWhitespaceStart == -1)\n currentWhitespaceStart = i;\n\n if (!isInlineWhitespace) {\n if (\n c != \"\\n\" &&\n currentWhitespaceStart > 0 &&\n currentWhitespaceStart != startOfLine\n ) {\n sb.Append(\" \");\n }\n currentWhitespaceStart = -1;\n }\n\n if (c == \"\\n\") startOfLine = i + 1;\n\n if (!isInlineWhitespace) sb.Append(c);\n }\n\n return sb.toString();\n }\n\n get currentTags() {\n if (this._outputStreamTagsDirty) {\n this._currentTags = [];\n let inTag: boolean = false;\n let sb = new StringBuilder();\n\n for (let outputObj of this.outputStream) {\n let controlCommand = asOrNull(outputObj, ControlCommand);\n if (controlCommand != null) {\n if (\n controlCommand.commandType == ControlCommand.CommandType.BeginTag\n ) {\n if (inTag && sb.Length > 0) {\n let txt = this.CleanOutputWhitespace(sb.toString());\n this._currentTags.push(txt);\n sb.Clear();\n }\n inTag = true;\n } else if (\n controlCommand.commandType == ControlCommand.CommandType.EndTag\n ) {\n if (sb.Length > 0) {\n let txt = this.CleanOutputWhitespace(sb.toString());\n this._currentTags.push(txt);\n sb.Clear();\n }\n inTag = false;\n }\n } else if (inTag) {\n let strVal = asOrNull(outputObj, StringValue);\n if (strVal !== null) {\n sb.Append(strVal.value);\n }\n } else {\n let tag = asOrNull(outputObj, Tag);\n if (tag != null && tag.text != null && tag.text.length > 0) {\n this._currentTags.push(tag.text); // tag.text has whitespae already cleaned\n }\n }\n }\n\n if (sb.Length > 0) {\n let txt = this.CleanOutputWhitespace(sb.toString());\n this._currentTags.push(txt);\n sb.Clear();\n }\n\n this._outputStreamTagsDirty = false;\n }\n\n return this._currentTags;\n }\n private _currentTags: string[] | null = null;\n\n get currentFlowName() {\n return this._currentFlow.name;\n }\n\n get currentFlowIsDefaultFlow() {\n return this._currentFlow.name == this.kDefaultFlowName;\n }\n\n get aliveFlowNames() {\n if (this._aliveFlowNamesDirty) {\n this._aliveFlowNames = [];\n\n if (this._namedFlows != null) {\n for (let flowName of this._namedFlows.keys()) {\n if (flowName != this.kDefaultFlowName) {\n this._aliveFlowNames.push(flowName);\n }\n }\n }\n\n this._aliveFlowNamesDirty = false;\n }\n\n return this._aliveFlowNames;\n }\n\n get inExpressionEvaluation() {\n return this.callStack.currentElement.inExpressionEvaluation;\n }\n set inExpressionEvaluation(value) {\n this.callStack.currentElement.inExpressionEvaluation = value;\n }\n\n constructor(story: Story) {\n this.story = story;\n\n this._currentFlow = new Flow(this.kDefaultFlowName, story);\n this.OutputStreamDirty();\n\n this._aliveFlowNamesDirty = true;\n this._evaluationStack = [];\n\n this._variablesState = new VariablesState(\n this.callStack,\n story.listDefinitions\n );\n\n this._visitCounts = new Map();\n this._turnIndices = new Map();\n this.currentTurnIndex = -1;\n\n let timeSeed = new Date().getTime();\n this.storySeed = new PRNG(timeSeed).next() % 100;\n this.previousRandom = 0;\n\n this.GoToStart();\n }\n\n public GoToStart() {\n this.callStack.currentElement.currentPointer = Pointer.StartOf(\n this.story.mainContentContainer\n );\n }\n\n public SwitchFlow_Internal(flowName: string | null) {\n if (flowName === null)\n throw new Error(\"Must pass a non-null string to Story.SwitchFlow\");\n\n if (this._namedFlows === null) {\n this._namedFlows = new Map();\n this._namedFlows.set(this.kDefaultFlowName, this._currentFlow);\n }\n\n if (flowName === this._currentFlow.name) {\n return;\n }\n\n let flow: Flow;\n let content = tryGetValueFromMap(this._namedFlows, flowName, null);\n if (content.exists) {\n flow = content.result!;\n } else {\n flow = new Flow(flowName, this.story);\n this._namedFlows.set(flowName, flow);\n this._aliveFlowNamesDirty = true;\n }\n\n this._currentFlow = flow;\n this.variablesState.callStack = this._currentFlow.callStack;\n\n this.OutputStreamDirty();\n }\n\n public SwitchToDefaultFlow_Internal() {\n if (this._namedFlows === null) return;\n this.SwitchFlow_Internal(this.kDefaultFlowName);\n }\n\n public RemoveFlow_Internal(flowName: string | null) {\n if (flowName === null)\n throw new Error(\"Must pass a non-null string to Story.DestroyFlow\");\n if (flowName === this.kDefaultFlowName)\n throw new Error(\"Cannot destroy default flow\");\n\n if (this._currentFlow.name === flowName) {\n this.SwitchToDefaultFlow_Internal();\n }\n\n if (this._namedFlows === null)\n return throwNullException(\"this._namedFlows\");\n this._namedFlows.delete(flowName);\n this._aliveFlowNamesDirty = true;\n }\n\n public CopyAndStartPatching() {\n let copy = new StoryState(this.story);\n\n copy._patch = new StatePatch(this._patch);\n\n copy._currentFlow.name = this._currentFlow.name;\n copy._currentFlow.callStack = new CallStack(this._currentFlow.callStack);\n copy._currentFlow.currentChoices.push(...this._currentFlow.currentChoices);\n copy._currentFlow.outputStream.push(...this._currentFlow.outputStream);\n copy.OutputStreamDirty();\n\n if (this._namedFlows !== null) {\n copy._namedFlows = new Map();\n for (let [namedFlowKey, namedFlowValue] of this._namedFlows) {\n copy._namedFlows.set(namedFlowKey, namedFlowValue);\n copy._aliveFlowNamesDirty = true;\n }\n copy._namedFlows.set(this._currentFlow.name, copy._currentFlow);\n }\n\n if (this.hasError) {\n copy._currentErrors = [];\n copy._currentErrors.push(...(this.currentErrors || []));\n }\n\n if (this.hasWarning) {\n copy._currentWarnings = [];\n copy._currentWarnings.push(...(this.currentWarnings || []));\n }\n\n copy.variablesState = this.variablesState;\n copy.variablesState.callStack = copy.callStack;\n copy.variablesState.patch = copy._patch;\n\n copy.evaluationStack.push(...this.evaluationStack);\n\n if (!this.divertedPointer.isNull)\n copy.divertedPointer = this.divertedPointer.copy();\n\n copy.previousPointer = this.previousPointer.copy();\n\n copy._visitCounts = this._visitCounts;\n copy._turnIndices = this._turnIndices;\n\n copy.currentTurnIndex = this.currentTurnIndex;\n copy.storySeed = this.storySeed;\n copy.previousRandom = this.previousRandom;\n\n copy.didSafeExit = this.didSafeExit;\n\n return copy;\n }\n\n public RestoreAfterPatch() {\n this.variablesState.callStack = this.callStack;\n this.variablesState.patch = this._patch;\n }\n\n public ApplyAnyPatch() {\n if (this._patch === null) return;\n\n this.variablesState.ApplyPatch();\n\n for (let [key, value] of this._patch.visitCounts)\n this.ApplyCountChanges(key, value, true);\n\n for (let [key, value] of this._patch.turnIndices)\n this.ApplyCountChanges(key, value, false);\n\n this._patch = null;\n }\n\n public ApplyCountChanges(\n container: Container,\n newCount: number,\n isVisit: boolean\n ) {\n let counts = isVisit ? this._visitCounts : this._turnIndices;\n counts.set(container.path.toString(), newCount);\n }\n\n public WriteJson(writer: SimpleJson.Writer) {\n writer.WriteObjectStart();\n\n writer.WritePropertyStart(\"flows\");\n writer.WriteObjectStart();\n\n // NOTE: Never pass `WriteJson` directly as an argument to `WriteProperty`.\n // Call it inside a function to make sure `this` is correctly bound\n // and passed down the call hierarchy.\n\n if (this._namedFlows !== null) {\n for (let [namedFlowKey, namedFlowValue] of this._namedFlows) {\n writer.WriteProperty(namedFlowKey, (w) => namedFlowValue.WriteJson(w));\n }\n } else {\n writer.WriteProperty(this._currentFlow.name, (w) =>\n this._currentFlow.WriteJson(w)\n );\n }\n\n writer.WriteObjectEnd();\n writer.WritePropertyEnd();\n\n writer.WriteProperty(\"currentFlowName\", this._currentFlow.name);\n\n writer.WriteProperty(\"variablesState\", (w) =>\n this.variablesState.WriteJson(w)\n );\n\n writer.WriteProperty(\"evalStack\", (w) =>\n JsonSerialisation.WriteListRuntimeObjs(w, this.evaluationStack)\n );\n\n if (!this.divertedPointer.isNull) {\n if (this.divertedPointer.path === null) {\n return throwNullException(\"divertedPointer\");\n }\n writer.WriteProperty(\n \"currentDivertTarget\",\n this.divertedPointer.path.componentsString\n );\n }\n\n writer.WriteProperty(\"visitCounts\", (w) =>\n JsonSerialisation.WriteIntDictionary(w, this._visitCounts)\n );\n writer.WriteProperty(\"turnIndices\", (w) =>\n JsonSerialisation.WriteIntDictionary(w, this._turnIndices)\n );\n\n writer.WriteIntProperty(\"turnIdx\", this.currentTurnIndex);\n writer.WriteIntProperty(\"storySeed\", this.storySeed);\n writer.WriteIntProperty(\"previousRandom\", this.previousRandom);\n\n writer.WriteIntProperty(\"inkSaveVersion\", this.kInkSaveStateVersion);\n\n writer.WriteIntProperty(\"inkFormatVersion\", Story.inkVersionCurrent);\n\n writer.WriteObjectEnd();\n }\n\n public LoadJsonObj(value: Record) {\n let jObject = value;\n\n let jSaveVersion = jObject[\"inkSaveVersion\"];\n if (jSaveVersion == null) {\n throw new Error(\"ink save format incorrect, can't load.\");\n } else if (parseInt(jSaveVersion) < this.kMinCompatibleLoadVersion) {\n throw new Error(\n \"Ink save format isn't compatible with the current version (saw '\" +\n jSaveVersion +\n \"', but minimum is \" +\n this.kMinCompatibleLoadVersion +\n \"), so can't load.\"\n );\n }\n\n let flowsObj = jObject[\"flows\"];\n if (flowsObj != null) {\n let flowsObjDict = flowsObj as Record;\n\n // Single default flow\n if (Object.keys(flowsObjDict).length === 1) {\n this._namedFlows = null;\n } else if (this._namedFlows === null) {\n this._namedFlows = new Map();\n } else {\n this._namedFlows.clear();\n }\n\n let flowsObjDictEntries = Object.entries(flowsObjDict);\n for (let [namedFlowObjKey, namedFlowObjValue] of flowsObjDictEntries) {\n let name = namedFlowObjKey;\n let flowObj = namedFlowObjValue as Record;\n\n let flow = new Flow(name, this.story, flowObj);\n\n if (Object.keys(flowsObjDict).length === 1) {\n this._currentFlow = new Flow(name, this.story, flowObj);\n } else {\n if (this._namedFlows === null)\n return throwNullException(\"this._namedFlows\");\n this._namedFlows.set(name, flow);\n }\n }\n\n if (this._namedFlows != null && this._namedFlows.size > 1) {\n let currFlowName = jObject[\"currentFlowName\"] as string;\n // Adding a bang at the end, because we're trusting the save, as\n // done in upstream. If the save is corrupted, the execution\n // is undefined.\n this._currentFlow = this._namedFlows.get(currFlowName)!;\n }\n } else {\n this._namedFlows = null;\n this._currentFlow.name = this.kDefaultFlowName;\n this._currentFlow.callStack.SetJsonToken(\n jObject[\"callstackThreads\"] as Record,\n this.story\n );\n this._currentFlow.outputStream = JsonSerialisation.JArrayToRuntimeObjList(\n jObject[\"outputStream\"] as any[]\n );\n this._currentFlow.currentChoices =\n JsonSerialisation.JArrayToRuntimeObjList(\n jObject[\"currentChoices\"] as any[]\n ) as Choice[];\n\n let jChoiceThreadsObj = jObject[\"choiceThreads\"];\n this._currentFlow.LoadFlowChoiceThreads(jChoiceThreadsObj, this.story);\n }\n\n this.OutputStreamDirty();\n this._aliveFlowNamesDirty = true;\n\n this.variablesState.SetJsonToken(jObject[\"variablesState\"]);\n this.variablesState.callStack = this._currentFlow.callStack;\n\n this._evaluationStack = JsonSerialisation.JArrayToRuntimeObjList(\n jObject[\"evalStack\"]\n );\n\n let currentDivertTargetPath = jObject[\"currentDivertTarget\"];\n if (currentDivertTargetPath != null) {\n let divertPath = new Path(currentDivertTargetPath.toString());\n this.divertedPointer = this.story.PointerAtPath(divertPath);\n }\n\n this._visitCounts = JsonSerialisation.JObjectToIntDictionary(\n jObject[\"visitCounts\"]\n );\n this._turnIndices = JsonSerialisation.JObjectToIntDictionary(\n jObject[\"turnIndices\"]\n );\n this.currentTurnIndex = parseInt(jObject[\"turnIdx\"]);\n this.storySeed = parseInt(jObject[\"storySeed\"]);\n this.previousRandom = parseInt(jObject[\"previousRandom\"]);\n }\n\n public ResetErrors() {\n this._currentErrors = null;\n this._currentWarnings = null;\n }\n public ResetOutput(objs: InkObject[] | null = null) {\n this.outputStream.length = 0;\n if (objs !== null) this.outputStream.push(...objs);\n this.OutputStreamDirty();\n }\n\n public PushToOutputStream(obj: InkObject | null) {\n // var text = obj as StringValue;\n let text = asOrNull(obj, StringValue);\n if (text !== null) {\n let listText = this.TrySplittingHeadTailWhitespace(text);\n if (listText !== null) {\n for (let textObj of listText) {\n this.PushToOutputStreamIndividual(textObj);\n }\n this.OutputStreamDirty();\n return;\n }\n }\n\n this.PushToOutputStreamIndividual(obj);\n this.OutputStreamDirty();\n }\n\n public PopFromOutputStream(count: number) {\n this.outputStream.splice(this.outputStream.length - count, count);\n this.OutputStreamDirty();\n }\n\n public TrySplittingHeadTailWhitespace(single: StringValue) {\n let str = single.value;\n if (str === null) {\n return throwNullException(\"single.value\");\n }\n\n let headFirstNewlineIdx = -1;\n let headLastNewlineIdx = -1;\n for (let i = 0; i < str.length; i++) {\n let c = str[i];\n if (c == \"\\n\") {\n if (headFirstNewlineIdx == -1) headFirstNewlineIdx = i;\n headLastNewlineIdx = i;\n } else if (c == \" \" || c == \"\\t\") continue;\n else break;\n }\n\n let tailLastNewlineIdx = -1;\n let tailFirstNewlineIdx = -1;\n for (let i = str.length - 1; i >= 0; i--) {\n let c = str[i];\n if (c == \"\\n\") {\n if (tailLastNewlineIdx == -1) tailLastNewlineIdx = i;\n tailFirstNewlineIdx = i;\n } else if (c == \" \" || c == \"\\t\") continue;\n else break;\n }\n\n // No splitting to be done?\n if (headFirstNewlineIdx == -1 && tailLastNewlineIdx == -1) return null;\n\n let listTexts: StringValue[] = [];\n let innerStrStart = 0;\n let innerStrEnd = str.length;\n\n if (headFirstNewlineIdx != -1) {\n if (headFirstNewlineIdx > 0) {\n let leadingSpaces = new StringValue(\n str.substring(0, headFirstNewlineIdx)\n );\n listTexts.push(leadingSpaces);\n }\n listTexts.push(new StringValue(\"\\n\"));\n innerStrStart = headLastNewlineIdx + 1;\n }\n\n if (tailLastNewlineIdx != -1) {\n innerStrEnd = tailFirstNewlineIdx;\n }\n\n if (innerStrEnd > innerStrStart) {\n let innerStrText = str.substring(innerStrStart, innerStrEnd);\n listTexts.push(new StringValue(innerStrText));\n }\n\n if (tailLastNewlineIdx != -1 && tailFirstNewlineIdx > headLastNewlineIdx) {\n listTexts.push(new StringValue(\"\\n\"));\n if (tailLastNewlineIdx < str.length - 1) {\n let numSpaces = str.length - tailLastNewlineIdx - 1;\n let trailingSpaces = new StringValue(\n str.substring(\n tailLastNewlineIdx + 1,\n tailLastNewlineIdx + 1 + numSpaces\n )\n );\n listTexts.push(trailingSpaces);\n }\n }\n\n return listTexts;\n }\n\n public PushToOutputStreamIndividual(obj: InkObject | null) {\n let glue = asOrNull(obj, Glue);\n let text = asOrNull(obj, StringValue);\n\n let includeInOutput = true;\n\n if (glue) {\n this.TrimNewlinesFromOutputStream();\n includeInOutput = true;\n } else if (text) {\n let functionTrimIndex = -1;\n let currEl = this.callStack.currentElement;\n if (currEl.type == PushPopType.Function) {\n functionTrimIndex = currEl.functionStartInOutputStream;\n }\n\n let glueTrimIndex = -1;\n for (let i = this.outputStream.length - 1; i >= 0; i--) {\n let o = this.outputStream[i];\n let c = o instanceof ControlCommand ? o : null;\n let g = o instanceof Glue ? o : null;\n\n if (g != null) {\n glueTrimIndex = i;\n break;\n } else if (\n c != null &&\n c.commandType == ControlCommand.CommandType.BeginString\n ) {\n if (i >= functionTrimIndex) {\n functionTrimIndex = -1;\n }\n break;\n }\n }\n\n let trimIndex = -1;\n if (glueTrimIndex != -1 && functionTrimIndex != -1)\n trimIndex = Math.min(functionTrimIndex, glueTrimIndex);\n else if (glueTrimIndex != -1) trimIndex = glueTrimIndex;\n else trimIndex = functionTrimIndex;\n\n if (trimIndex != -1) {\n if (text.isNewline) {\n includeInOutput = false;\n } else if (text.isNonWhitespace) {\n if (glueTrimIndex > -1) this.RemoveExistingGlue();\n\n if (functionTrimIndex > -1) {\n let callStackElements = this.callStack.elements;\n for (let i = callStackElements.length - 1; i >= 0; i--) {\n let el = callStackElements[i];\n if (el.type == PushPopType.Function) {\n el.functionStartInOutputStream = -1;\n } else {\n break;\n }\n }\n }\n }\n } else if (text.isNewline) {\n if (this.outputStreamEndsInNewline || !this.outputStreamContainsContent)\n includeInOutput = false;\n }\n }\n\n if (includeInOutput) {\n if (obj === null) {\n return throwNullException(\"obj\");\n }\n this.outputStream.push(obj);\n this.OutputStreamDirty();\n }\n }\n\n public TrimNewlinesFromOutputStream() {\n let removeWhitespaceFrom = -1;\n\n let i = this.outputStream.length - 1;\n while (i >= 0) {\n let obj = this.outputStream[i];\n let cmd = asOrNull(obj, ControlCommand);\n let txt = asOrNull(obj, StringValue);\n\n if (cmd != null || (txt != null && txt.isNonWhitespace)) {\n break;\n } else if (txt != null && txt.isNewline) {\n removeWhitespaceFrom = i;\n }\n i--;\n }\n\n // Remove the whitespace\n if (removeWhitespaceFrom >= 0) {\n i = removeWhitespaceFrom;\n while (i < this.outputStream.length) {\n let text = asOrNull(this.outputStream[i], StringValue);\n if (text) {\n this.outputStream.splice(i, 1);\n } else {\n i++;\n }\n }\n }\n\n this.OutputStreamDirty();\n }\n\n public RemoveExistingGlue() {\n for (let i = this.outputStream.length - 1; i >= 0; i--) {\n let c = this.outputStream[i];\n if (c instanceof Glue) {\n this.outputStream.splice(i, 1);\n } else if (c instanceof ControlCommand) {\n break;\n }\n }\n\n this.OutputStreamDirty();\n }\n\n get outputStreamEndsInNewline() {\n if (this.outputStream.length > 0) {\n for (let i = this.outputStream.length - 1; i >= 0; i--) {\n let obj = this.outputStream[i];\n if (obj instanceof ControlCommand) break;\n let text = this.outputStream[i];\n if (text instanceof StringValue) {\n if (text.isNewline) return true;\n else if (text.isNonWhitespace) break;\n }\n }\n }\n\n return false;\n }\n\n get outputStreamContainsContent() {\n for (let content of this.outputStream) {\n if (content instanceof StringValue) return true;\n }\n return false;\n }\n\n get inStringEvaluation() {\n for (let i = this.outputStream.length - 1; i >= 0; i--) {\n let cmd = asOrNull(this.outputStream[i], ControlCommand);\n if (\n cmd instanceof ControlCommand &&\n cmd.commandType == ControlCommand.CommandType.BeginString\n ) {\n return true;\n }\n }\n\n return false;\n }\n\n public PushEvaluationStack(obj: InkObject | null) {\n // var listValue = obj as ListValue;\n let listValue = asOrNull(obj, ListValue);\n if (listValue) {\n // Update origin when list is has something to indicate the list origin\n let rawList = listValue.value;\n if (rawList === null) {\n return throwNullException(\"rawList\");\n }\n\n if (rawList.originNames != null) {\n if (!rawList.origins) rawList.origins = [];\n rawList.origins.length = 0;\n\n for (let n of rawList.originNames) {\n if (this.story.listDefinitions === null)\n return throwNullException(\"StoryState.story.listDefinitions\");\n let def = this.story.listDefinitions.TryListGetDefinition(n, null);\n if (def.result === null)\n return throwNullException(\"StoryState def.result\");\n if (rawList.origins.indexOf(def.result) < 0)\n rawList.origins.push(def.result);\n }\n }\n }\n\n if (obj === null) {\n return throwNullException(\"obj\");\n }\n this.evaluationStack.push(obj);\n }\n\n public PopEvaluationStack(): InkObject;\n public PopEvaluationStack(numberOfObjects: number): InkObject[];\n public PopEvaluationStack(numberOfObjects?: number) {\n if (typeof numberOfObjects === \"undefined\") {\n let obj = this.evaluationStack.pop();\n return nullIfUndefined(obj);\n } else {\n if (numberOfObjects > this.evaluationStack.length) {\n throw new Error(\"trying to pop too many objects\");\n }\n\n let popped = this.evaluationStack.splice(\n this.evaluationStack.length - numberOfObjects,\n numberOfObjects\n );\n return nullIfUndefined(popped);\n }\n }\n\n public PeekEvaluationStack() {\n return this.evaluationStack[this.evaluationStack.length - 1];\n }\n\n public ForceEnd() {\n this.callStack.Reset();\n\n this._currentFlow.currentChoices.length = 0;\n\n this.currentPointer = Pointer.Null;\n this.previousPointer = Pointer.Null;\n\n this.didSafeExit = true;\n }\n\n public TrimWhitespaceFromFunctionEnd() {\n Debug.Assert(this.callStack.currentElement.type == PushPopType.Function);\n let functionStartPoint =\n this.callStack.currentElement.functionStartInOutputStream;\n\n if (functionStartPoint == -1) {\n functionStartPoint = 0;\n }\n\n for (let i = this.outputStream.length - 1; i >= functionStartPoint; i--) {\n let obj = this.outputStream[i];\n let txt = asOrNull(obj, StringValue);\n let cmd = asOrNull(obj, ControlCommand);\n\n if (txt == null) continue;\n if (cmd) break;\n\n if (txt.isNewline || txt.isInlineWhitespace) {\n this.outputStream.splice(i, 1);\n this.OutputStreamDirty();\n } else {\n break;\n }\n }\n }\n\n public PopCallStack(popType: PushPopType | null = null) {\n if (this.callStack.currentElement.type == PushPopType.Function)\n this.TrimWhitespaceFromFunctionEnd();\n\n this.callStack.Pop(popType);\n }\n\n public SetChosenPath(path: Path, incrementingTurnIndex: boolean) {\n // Changing direction, assume we need to clear current set of choices\n this._currentFlow.currentChoices.length = 0;\n\n let newPointer = this.story.PointerAtPath(path);\n if (!newPointer.isNull && newPointer.index == -1) newPointer.index = 0;\n\n this.currentPointer = newPointer;\n\n if (incrementingTurnIndex) {\n this.currentTurnIndex++;\n }\n }\n\n public StartFunctionEvaluationFromGame(\n funcContainer: Container,\n args: any[]\n ) {\n this.callStack.Push(\n PushPopType.FunctionEvaluationFromGame,\n this.evaluationStack.length\n );\n this.callStack.currentElement.currentPointer =\n Pointer.StartOf(funcContainer);\n\n this.PassArgumentsToEvaluationStack(args);\n }\n\n public PassArgumentsToEvaluationStack(args: any[] | null) {\n if (args !== null) {\n for (let i = 0; i < args.length; i++) {\n if (\n !(\n typeof args[i] === \"number\" ||\n typeof args[i] === \"string\" ||\n typeof args[i] === \"boolean\" ||\n args[i] instanceof InkList\n )\n ) {\n throw new Error(\n \"ink arguments when calling EvaluateFunction / ChoosePathStringWithParameters must be\" +\n \"number, string, bool or InkList. Argument was \" +\n (nullIfUndefined(arguments[i]) === null)\n ? \"null\"\n : arguments[i].constructor.name\n );\n }\n\n this.PushEvaluationStack(Value.Create(args[i]));\n }\n }\n }\n\n public TryExitFunctionEvaluationFromGame() {\n if (\n this.callStack.currentElement.type ==\n PushPopType.FunctionEvaluationFromGame\n ) {\n this.currentPointer = Pointer.Null;\n this.didSafeExit = true;\n return true;\n }\n\n return false;\n }\n\n public CompleteFunctionEvaluationFromGame() {\n if (\n this.callStack.currentElement.type !=\n PushPopType.FunctionEvaluationFromGame\n ) {\n throw new Error(\n \"Expected external function evaluation to be complete. Stack trace: \" +\n this.callStack.callStackTrace\n );\n }\n\n let originalEvaluationStackHeight =\n this.callStack.currentElement.evaluationStackHeightWhenPushed;\n\n let returnedObj: InkObject | null = null;\n while (this.evaluationStack.length > originalEvaluationStackHeight) {\n let poppedObj = this.PopEvaluationStack();\n if (returnedObj === null) returnedObj = poppedObj;\n }\n\n this.PopCallStack(PushPopType.FunctionEvaluationFromGame);\n\n if (returnedObj) {\n if (returnedObj instanceof Void) return null;\n\n // Some kind of value, if not void\n // var returnVal = returnedObj as Runtime.Value;\n let returnVal = asOrThrows(returnedObj, Value);\n\n // DivertTargets get returned as the string of components\n // (rather than a Path, which isn't public)\n if (returnVal.valueType == ValueType.DivertTarget) {\n return returnVal.valueObject.toString();\n }\n\n // Other types can just have their exact object type:\n // int, float, string. VariablePointers get returned as strings.\n return returnVal.valueObject;\n }\n\n return null;\n }\n\n public AddError(message: string, isWarning: boolean) {\n if (!isWarning) {\n if (this._currentErrors == null) this._currentErrors = [];\n this._currentErrors.push(message);\n } else {\n if (this._currentWarnings == null) this._currentWarnings = [];\n this._currentWarnings.push(message);\n }\n }\n\n public OutputStreamDirty() {\n this._outputStreamTextDirty = true;\n this._outputStreamTagsDirty = true;\n }\n\n private _visitCounts: Map;\n private _turnIndices: Map;\n\n private _outputStreamTextDirty = true;\n private _outputStreamTagsDirty = true;\n\n private _patch: StatePatch | null = null;\n\n private _currentFlow: Flow;\n private _aliveFlowNames: string[] | null = null;\n private _namedFlows: Map | null = null;\n private readonly kDefaultFlowName = \"DEFAULT_FLOW\";\n private _aliveFlowNamesDirty: boolean = true;\n}\n","// This is simple replacement of the Stopwatch class from the .NET Framework.\n// The original class can count time with much more accuracy than the Javascript version.\n// It might be worth considering using `window.performance` in the browser\n// or `process.hrtime()` in node.\nexport class Stopwatch {\n private startTime: number | undefined;\n\n constructor() {\n this.startTime = undefined;\n }\n\n get ElapsedMilliseconds(): number {\n if (typeof this.startTime === \"undefined\") {\n return 0;\n }\n return new Date().getTime() - this.startTime;\n }\n\n public Start() {\n this.startTime = new Date().getTime();\n }\n public Stop() {\n this.startTime = undefined;\n }\n}\n"],"names":["Debug","Path","_classCallCheck","this","_components","_componentsString","_isRelative","arguments","componentsString","Component","head","tail","push","concat","Array","relative","_createClass","key","get","length","slice","self","lastComponentIdx","i","l","isIndex","value","index","pathToAppend","p","upwardMoves","isParent","join","isRelative","set","substring","_step","_iterator","_createForOfIteratorHelper","split","s","n","done","str","test","parseInt","err","e","f","otherPath","Equals","c","_p$_components","apply","_toConsumableArray","path","asOrNull","obj","type","unsafeTypeAssertion","asOrThrows","Error","asINamedContentOrNull","hasValidName","name","nullIfUndefined","isEquatable","_typeof","parentId","indexOrName","toString","otherComp","Assert","condition","message","console","warn","trace","AssertType","variable","NullException","_Error","_inherits","_super","_createSuper","_wrapNativeSuper","throwNullException","InkObject","parent","_debugMetadata","_path","debugMetadata","root","rootContentContainer","targetContent","ContentAtPath","dm","startLineNumber","comps","child","container","Container","namedChild","unshift","content","indexOf","nearestContainer","GetComponent","contentContainer","globalPath","ownPath","minPathLength","Math","min","lastSharedPathCompIndex","ownComp","numUpwardsMoves","componentCount","newPathComps","up","ToParent","down","globalPathStr","relativePathStr","PathByAppendingPath","ConvertPathToRelative","ancestor","prop","StringBuilder","string","Append","format","_len","args","_key","replace","match","num","InkListItem","originName","itemName","nameParts","fullName","otherItem","JSON","stringify","parse","isLikeInkListItem","Null","inkListItem","item","hasOwnProperty","InkList","_Map","_this","_arguments","call","origins","_originNames","otherList","otherOriginNames","originNames","singleOriginListName","originStory","SetInitialOriginName","listDefinitions","_possibleConstructorReturn","def","TryListGetDefinition","exists","result","singleElement","Add","Key","Value","itemOrItemName","AddItem","origin","intVal","TryGetValueForItem","foundListDef","_step2","_iterator2","ContainsItemWithName","itemVal","ValueForItem","_step3","_iterator3","_slicedToArray","fromSerializedKey","has","serialized","serializedKey","delete","size","maxOriginName","maxItem","every","Count","_step4","_iterator4","initialOriginName","initialOriginNames","_step5","max","_iterator5","_step5$value","isNull","_step6","_iterator6","_step6$value","list","_step7","_iterator7","_step8","_iterator8","items","_step8$value","ContainsKey","_step9","_iterator9","_step10","_iterator10","_step10$value","_step11","union","_iterator11","_step11$value","_step12","intersection","_iterator12","_step12$value","_step13","_iterator13","listToRemove","_step14","_iterator14","what","ContainsItemNamed","_step15","_iterator15","minItem","minBound","maxBound","ordered","orderedItems","minValue","maxValue","Number","MAX_SAFE_INTEGER","isInteger","subList","SetInitialOriginNames","_step16","_iterator16","otherInkList","_step17","_iterator17","_step18","_iterator18","_step18$value","sort","x","y","localeCompare","sb","NaN","myListItem","listValue","_a","FindSingleItemListWithName","Map","StoryException","useEndLineNumber","tryGetValueFromMap","map","val","AbstractValue","ValueType","_InkObject","Create","valueObject","targetType","valueType","preferredNumberType","Int","IntValue","Float","isNaN","FloatValue","BoolValue","Boolean","StringValue","String","DivertTargetValue","ListValue","_AbstractValue","_super2","_Value","_super3","Bool","newType","BadCastException","_Value2","_super4","_Value3","_super5","_Value4","_super6","_this2","_isNewline","_isInlineWhitespace","isNewline","isInlineWhitespace","parsedInt","defaultValue","tryParseInt","parsedFloat","parseFloat","tryParseFloat","_Value5","_super7","targetPath","DivertTarget","VariablePointerValue","_Value6","_super8","variableName","_this3","contextIndex","undefined","_contextIndex","VariablePointer","_Value7","_super9","listOrSingleItem","singleValue","_this4","List","oldValue","newValue","oldList","newList","SearchResult","approximate","searchResult","_content","namedContent","visitsShouldBeCounted","turnIndexShouldBeCounted","countingAtStartOnly","_pathToFirstLeafContent","AddContent","namedOnlyContentDict","_step$value","inkObject","named","existingNamedOnly","namedOnlyContent","AddToNamedContentOnly","flags","CountFlags","Visits","Turns","CountStartOnly","flag","internalPathToFirstLeafContent","components","contentObjOrList","contentObj","TryAddNamedContent","namedContentObj","partialPathStart","partialPathLength","currentContainer","currentObj","comp","foundObj","ContentWithPathComponent","splice","otherContainer","_this$content","component","foundContent","BuildStringOfHierarchy","indentation","pointedObj","appendIndentation","AppendFormat","AppendLine","onlyNamed","_step7$value","Glue","PushPopType","ControlCommand","commandType","CommandType","NotSet","_commandType","EvalStart","EvalOutput","EvalEnd","Duplicate","PopEvaluatedValue","PopFunction","PopTunnel","BeginString","EndString","NoOp","ChoiceCount","TurnsSince","ReadCount","Random","SeedRandom","VisitIndex","SequenceShuffleIndex","StartThread","Done","End","ListFromInt","ListRange","ListRandom","BeginTag","EndTag","Pointer","PathByAppendingComponent","Divert","stackPushType","_targetPath","_targetPointer","variableDivertName","pushesToStack","isExternal","externalArgs","isConditional","targetObj","targetPointer","Resolve","ResolvePath","lastComponent","StartOf","copy","CompactPathString","otherDivert","hasVariableTarget","targetStr","Function","targetPathString","ChoicePoint","onceOnly","_pathOnChoice","hasCondition","hasStartContent","hasChoiceOnlyContent","isInvisibleDefault","choiceTargetObj","choiceTarget","pathOnChoice","VariableReference","pathForCount","pathStringForCount","VariableAssignment","isNewDeclaration","isGlobal","Void","NativeFunctionCall","_name","_numberOfParameters","_prototype","_isPrototype","_operationFuncs","GenerateNativeFunctionsIfNecessary","numberOfParameters","_nativeFunctions","parameters","Call","hasList","CallBinaryListOperation","coercedParams","CoerceValuesToSingleType","coercedType","CallType","parametersOfSingleType","param1","valType","val1","paramCount","opForTypeObj","val2","opForType","resultVal","CallListIncrementOperation","v1","v2","op","asBooleanOrThrows","isTruthy","listIntParams","listVal","resultInkList","_step2$value","listItemKey","listItemValue","listItem","intOp","targetInt","itemOrigin","incrementedItem","TryGetItemWithValue","parametersIn","specialCaseList","parametersOut","originOfMaxItem","castedValue","Cast","functionName","t","AddIntBinaryOp","Subtract","Multiply","Divide","floor","Mod","AddIntUnaryOp","Negate","Equal","Greater","Less","GreaterThanOrEquals","LessThanOrEquals","NotEquals","Not","And","Or","Max","Min","Pow","pow","Floor","Identity","Ceiling","AddFloatBinaryOp","AddFloatUnaryOp","ceil","AddStringBinaryOp","Has","includes","Hasnt","AddListBinaryOp","Union","Without","Contains","Intersect","GreaterThan","LessThan","AddListUnaryOp","Invert","inverse","All","all","ListMin","MinAsList","ListMax","MaxAsList","ValueOfList","AddOpToNativeFunc","d1","d2","nativeFunc","AddOpFuncForType","Tag","tagText","text","Choice","threadAtGeneration","sourcePath","tags","originalThreadIndex","ListDefinition","_items","_itemNameToValues","ListDefinitionsOrigin","lists","_lists","_allUnambiguousListValueCache","listOfLists","definition","JsonSerialisation","jArray","skipLast","count","jTok","runtimeObj","JTokenToRuntimeObject","writer","dictionary","WriteObjectStart","WritePropertyStart","WriteRuntimeObject","WritePropertyEnd","WriteObjectEnd","WriteArrayStart","WriteArrayEnd","dict","_step3$value","WriteIntProperty","WriteRuntimeContainer","divert","divTypeKey","Tunnel","WriteProperty","choicePoint","pathStringOnChoice","boolVal","WriteBool","WriteInt","floatVal","WriteFloat","strVal","Write","WriteStringStart","WriteStringInner","WriteStringEnd","WriteInkList","divTargetVal","varPtrVal","controlCmd","_controlCommandNames","varRef","readCountPath","varAss","tag","choice","WriteChoice","jObject","token","firstChar","CallExistsWithName","CallWithName","isArray","propValue","varPtr","isDivert","divPushType","external","target","readCountVarRef","isVarAss","isGlobalVar","varName","isNewDecl","listContent","rawList","namesAsObjs","nameToVal","JObjectToChoice","JArrayToContainer","toJson","me","removes","space","k","v","some","r","withoutName","countFlags","hasNameProperty","hasTerminator","namedContainer","WriteNull","JArrayToRuntimeObjList","terminatingObj","namedContentItem","namedSubContainer","jObj","WritePropertyNameStart","WritePropertyNameInner","WritePropertyNameEnd","listDefJson","_step9$value","defsObj","allDefs","nameValueKey","nameValue","TOTAL_VALUES","CallStack","_threadCounter","_startOfRoot","Story","storyContext","Reset","toCopy","_threads","otherThread","Copy","callStack","elements","cs","callstack","Thread","Element","jThreadObj","thread","w","WriteObject","WriteJson","newThread","currentThread","threadIndex","forkedThread","canPopThread","elementIsEvaluateFromGame","currentElement","FunctionEvaluationFromGame","externalEvaluationStackHeight","outputStreamLengthWithPushed","element","currentPointer","evaluationStackHeightWhenPushed","functionStartInOutputStream","canPop","CanPop","pop","currentElementIndex","varValue","temporaryVariables","declareNew","contextElement","RetainListOriginsForAssignment","filtered","filter","isCurrent","pointer","inExpressionEvaluation","previousPointer","jElementObj","pushPopType","currentContainerPathStr","currentContainerPathStrToken","threadPointerResult","Warning","el","temps","JObjectToDictionaryRuntimeObjs","clear","prevContentObjPath","prevPath","PointerAtPath","WriteDictionaryRuntimeObjs","resolvedPointer","VariablesState","_VariablesStateAccess","listDefsOrigin","variableChangedEventCallbacks","patch","_batchObservingVariableChanges","_defaultGlobalVariables","_changedVariablesForBatchObs","Set","_globalVariables","_callStack","_listDefsOrigin","Proxy","_assertThisInitialized","$","callback","currentValue","variableChangedEvent","varContents","TryGetGlobal","SetGlobal","globals","namedVarKey","namedVarValue","changedVariables","add","jToken","varValKey","varValValue","loadedToken","tokenInkObject","keyValKey","keyValValue","dontSaveDefaultValues","defaultVal","RuntimeObjectsEqual","obj1","obj2","constructor","GetRawVariableWithName","varPointer","ValueAtVariablePointer","variableValue","GetTemporaryVariableWithName","GetVariableWithName","setGlobal","GlobalVariableExistsWithName","ResolveVariablePointer","existingPointer","SetTemporaryVariable","batchObservingVariableChanges","AddChangedVariable","GetContextIndexOfVariableNamed","doubleRedirectionPointer","_class","PRNG","seed","next","StatePatch","_changedVariables","_visitCounts","_turnIndices","_globals","SimpleJson","Reader","ToDictionary","ToArray","_rootObject","Writer","_currentPropertyName","_currentString","_stateStack","_collectionStack","_propertyNameStack","_jsonObject","inner","StartNewObject","newObject","state","State","Property","currentCollection","currentPropertyName","propertyName","None","StateElement","Object","innerOrContent","IncrementChildCount","childCount","PropertyName","_addToCurrentObject","error","POSITIVE_INFINITY","NEGATIVE_INFINITY","currEl","ErrorType","OutputStateChange","Flow","story","SetJsonToken","outputStream","currentChoices","jChoiceThreadsObj","LoadFlowChoiceThreads","WriteListRuntimeObjs","hasChoiceThreads","ThreadWithIndex","jChoiceThreads","foundActiveThread","jSavedChoiceThread","StoryState","kInkSaveStateVersion","kMinCompatibleLoadVersion","onDidLoadState","_currentErrors","_currentWarnings","divertedPointer","_currentTurnIndex","storySeed","previousRandom","didSafeExit","_currentText","_currentTags","_outputStreamTextDirty","_outputStreamTagsDirty","_patch","_aliveFlowNames","_namedFlows","kDefaultFlowName","_aliveFlowNamesDirty","_currentFlow","OutputStreamDirty","_evaluationStack","_variablesState","currentTurnIndex","timeSeed","Date","getTime","GoToStart","indented","ToJson","json","TextToDictionary","LoadJsonObj","pathString","visitCountOut","TryGetVisitCount","containerPathStr","count2","currCount","VisitCountForContainer","SetVisitCount","SetTurnIndex","TryGetTurnIndex","index2","depth","canContinue","hasError","currentErrors","currentWarnings","inTag","outputObj","textContent","controlCommand","CleanOutputWhitespace","currentWhitespaceStart","startOfLine","charAt","Length","txt","Clear","keys","flowName","mainContentContainer","flow","variablesState","SwitchFlow_Internal","SwitchToDefaultFlow_Internal","_copy$_currentFlow$cu","_copy$_currentFlow$ou","_copy$evaluationStack","_copy$_currentErrors","_copy$_currentWarning","_step4$value","namedFlowKey","namedFlowValue","hasWarning","evaluationStack","ApplyPatch","visitCounts","ApplyCountChanges","turnIndices","newCount","isVisit","_loop","WriteIntDictionary","inkVersionCurrent","jSaveVersion","flowsObj","flowsObjDict","_i","_flowsObjDictEntries","entries","_flowsObjDictEntries$","flowObj","currFlowName","currentDivertTargetPath","divertPath","JObjectToIntDictionary","_this$outputStream","objs","listText","TrySplittingHeadTailWhitespace","textObj","PushToOutputStreamIndividual","single","headFirstNewlineIdx","headLastNewlineIdx","tailLastNewlineIdx","tailFirstNewlineIdx","listTexts","innerStrStart","innerStrEnd","leadingSpaces","innerStrText","numSpaces","trailingSpaces","glue","includeInOutput","TrimNewlinesFromOutputStream","functionTrimIndex","glueTrimIndex","o","isNonWhitespace","RemoveExistingGlue","callStackElements","outputStreamEndsInNewline","outputStreamContainsContent","removeWhitespaceFrom","cmd","numberOfObjects","functionStartPoint","popType","TrimWhitespaceFromFunctionEnd","Pop","incrementingTurnIndex","newPointer","funcContainer","Push","PassArgumentsToEvaluationStack","PushEvaluationStack","callStackTrace","originalEvaluationStackHeight","returnedObj","poppedObj","PopEvaluationStack","PopCallStack","returnVal","isWarning","Stopwatch","startTime","nVal","isFinite","exports","inkVersionMinimumCompatible","onError","onDidContinue","onMakeChoice","onEvaluateFunction","onCompleteEvaluateFunction","onChoosePathString","_prevContainers","allowExternalFunctionFallbacks","_listDefinitions","_variableObservers","_hasValidatedExternals","_temporaryEvaluationContainer","_asyncContinueActive","_stateSnapshotAtLastNewline","_sawLookaheadUnsafeFunctionAfterNewline","_recursiveContinueCount","_asyncSaving","_profiler","_mainContentContainer","jsonString","_externals","rootObject","versionObj","formatFromFile","listDefsObj","rootToken","JTokenToListDefinitions","ResetState","choices","_state","IfAsyncWeCant","currentText","currentTags","currentFlowName","currentFlowIsDefaultFlow","aliveFlowNames","shouldReturn","ObserveVariableChange","VariableStateDidChangeEvent","bind","ResetGlobals","ResetErrors","ForceEnd","originalPointer","ChoosePath","ContinueInternal","SnapshotDefaultGlobals","RemoveFlow_Internal","ContinueAsync","millisecsLimitAsync","ValidateExternalBindings","PreContinue","isAsyncTimeLimited","ResetOutput","durationStopwatch","Start","ContinueSingleStep","AddError","ElapsedMilliseconds","Stop","RestoreStateSnapshot","generatedChoices","PostContinue","PreStep","Step","PostStep","TryFollowDefaultInvisibleChoice","PreSnapshot","inStringEvaluation","change","CalculateNewlineOutputStateChange","ExtendedBeyondNewline","NewlineRemoved","DiscardSnapshot","StateSnapshot","PostSnapshot","prevText","currText","prevTagCount","currTagCount","newlineStillExists","NoChange","Continue","pathLengthToUse","CopyAndStartPatching","RestoreAfterPatch","ApplyAnyPatch","stateToSave","shouldAddToStream","containerToEnter","VisitContainer","currentContentObj","isLogicOrFlowControl","PerformLogicAndFlowControl","ProcessChoice","contextIdx","ContextForVariableNamed","PushToOutputStream","NextContent","PushThread","atStart","IncrementVisitCountForContainer","RecordTurnIndexVisitToContainer","prevAncestor","currentChildOfContainer","currentContainerAncestor","allChildrenEnteredAtStart","enteringAtStart","choiceOnlyStrVal","PeekEvaluationStack","showChoice","conditionValue","IsTruthy","startText","choiceOnlyText","PopChoiceStringAndTags","ForkThread","reverse","divTarget","currentDivert","intContent","errorMessage","CallExternalFunction","sourceName","evalCommand","output","overrideTunnelReturnTarget","popped","TryExitFunctionEvaluationFromGame","names","expected","errorMsg","contentStackForTag","outputCountConsumed","command","PopFromOutputStream","_contentStackForTag","choiceTag","contentStackForString","contentToRetain","_i3","_contentToRetain","rescuedTag","choiceCount","extraNote","eitherCount","divertTarget","correctObj","TurnsSinceForContainer","maxInt","minInt","randomRange","resultSeed","nextRandom","chosenValue","shuffleIndex","NextSequenceShuffleIndex","PopThread","listNameVal","generatedListValue","foundItem","targetList","ListWithSubRange","listItemIndex","listEnumerator","randomItem","assignedVal","Assign","foundValue","containerForCount","func","funcParams","resetCallstack","ResetCallstack","funcDetail","activityStr","SetChosenPath","VisitChangedContainersDueToDivert","choiceIdx","choiceToChoose","KnotContainerWithName","returnTextOutput","trim","outputStreamBefore","StartFunctionEvaluationFromGame","stringOutput","textOutput","CompleteFunctionEvaluationFromGame","returned","exprContainer","startCallStackHeight","evalStackHeight","funcName","numberOfArguments","funcDef","fallbackFunctionContainer","foundExternal","lookAheadSafe","valueObj","funcResult","function","returnObj","lookaheadSafe","BindExternalFunctionGeneral","coercedArgs","TryCoerce","missingExternals","from","innerContent","observer","variableNames","observers","ObserveVariable","specificVariableName","variableObservers","newValueObj","TagsAtStartOfFlowContainerWithPathString","flowContainer","firstContent","IncrementContentPointer","didPop","successfulIncrement","nextAncestor","indexInAncestor","allChoices","invisibleChoices","numElementsIntVal","seqContainer","numElements","seqCount","loopIndex","iterationIndex","seqPathStr","sequenceHash","charCodeAt","randomSeed","random","unpickedIndices","chosen","chosenIndex","currentDebugMetadata","errorTypeStr","lineNum","endLineNumber","fileName"],"mappings":"sjKAAA,ICAiBA,ED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AAK0zB,MAAMrI,UAAUC,SAASlqB,GAAGurB,gBAC9B/f,QAAgC,OAAtB8gB,EAAQxS,WAElB,QADXrV,EAAK6nB,EAAQxS,UAAW1V,eAEtB,OAAOK,EAKb,IAAK,IAAIzE,EAAIpB,KAAK0zB,MAAMuB,aAAaj0B,OAAS,EAAGI,GAAK,IAAKA,EAAG,CAG5D,GAAW,QADXyE,EADgB7F,KAAK0zB,MAAMuB,aAAa7zB,GACzBoE,eAEb,OAAOK,CAEV,CAED,OAAO,IACT,GAAC,CAAA/E,IAAA,uBAAAC,IAED,WACE,OAAIf,KAAKigC,8BACAjgC,KAAKigC,8BAELjgC,KAAKwgC,qBAEhB,KAAC1V,CAAA,EAn4EwB1lB,GACX0lB,EAAAA,MAAiBmQ,kBAAG,GAo6EnBnQ,GAAAA,EAAKA,QAALA,QAmBhB,CAAA,IAlBa+J,GAAA/J,GAAiB+J,oBAAjB/J,qBAIX,CAAA,IAHC+J,GAAA,SAAA,GAAA,WACAA,GAAAA,GAAA,sBAAA,GAAA,wBACAA,GAAAA,GAAA,eAAA,GAAA"} \ No newline at end of file +{"version":3,"file":"ink.js","sources":["../src/engine/Path.ts","../src/engine/Debug.ts","../src/engine/Value.ts","../src/engine/PushPop.ts","../src/engine/Error.ts","../src/engine/TypeAssertion.ts","../src/engine/NullException.ts","../src/engine/Object.ts","../src/engine/StringBuilder.ts","../src/engine/InkList.ts","../src/engine/StoryException.ts","../src/engine/TryGetResult.ts","../src/engine/SearchResult.ts","../src/engine/Container.ts","../src/engine/Glue.ts","../src/engine/ControlCommand.ts","../src/engine/Pointer.ts","../src/engine/Divert.ts","../src/engine/ChoicePoint.ts","../src/engine/VariableReference.ts","../src/engine/VariableAssignment.ts","../src/engine/Void.ts","../src/engine/NativeFunctionCall.ts","../src/engine/Tag.ts","../src/engine/Choice.ts","../src/engine/ListDefinition.ts","../src/engine/ListDefinitionsOrigin.ts","../src/engine/JsonSerialisation.ts","../src/engine/CallStack.ts","../src/engine/VariablesState.ts","../src/engine/PRNG.ts","../src/engine/StatePatch.ts","../src/engine/SimpleJson.ts","../src/engine/Flow.ts","../src/engine/StoryState.ts","../src/engine/StopWatch.ts","../src/engine/Story.ts"],"sourcesContent":["export class Path {\n public static parentId = \"^\";\n\n public _isRelative: boolean;\n public _components: Path.Component[];\n public _componentsString: string | null;\n\n constructor();\n constructor(componentsString: string);\n constructor(head: Path.Component, tail: Path);\n constructor(head: Path.Component[], relative?: boolean);\n constructor() {\n this._components = [];\n this._componentsString = null;\n this._isRelative = false;\n\n if (typeof arguments[0] == \"string\") {\n let componentsString = arguments[0] as string;\n this.componentsString = componentsString;\n } else if (\n arguments[0] instanceof Path.Component &&\n arguments[1] instanceof Path\n ) {\n let head = arguments[0] as Path.Component;\n let tail = arguments[1] as Path;\n this._components.push(head);\n this._components = this._components.concat(tail._components);\n } else if (arguments[0] instanceof Array) {\n let head = arguments[0] as Path.Component[];\n let relative = !!arguments[1] as boolean;\n this._components = this._components.concat(head);\n this._isRelative = relative;\n }\n }\n get isRelative() {\n return this._isRelative;\n }\n get componentCount(): number {\n return this._components.length;\n }\n get head(): Path.Component | null {\n if (this._components.length > 0) {\n return this._components[0];\n } else {\n return null;\n }\n }\n get tail(): Path {\n if (this._components.length >= 2) {\n // careful, the original code uses length-1 here. This is because the second argument of\n // List.GetRange is a number of elements to extract, wherease Array.slice uses an index\n let tailComps = this._components.slice(1, this._components.length);\n return new Path(tailComps);\n } else {\n return Path.self;\n }\n }\n get length(): number {\n return this._components.length;\n }\n get lastComponent(): Path.Component | null {\n let lastComponentIdx = this._components.length - 1;\n if (lastComponentIdx >= 0) {\n return this._components[lastComponentIdx];\n } else {\n return null;\n }\n }\n get containsNamedComponent(): boolean {\n for (let i = 0, l = this._components.length; i < l; i++) {\n if (!this._components[i].isIndex) {\n return true;\n }\n }\n return false;\n }\n static get self(): Path {\n let path = new Path();\n path._isRelative = true;\n return path;\n }\n\n public GetComponent(index: number): Path.Component {\n return this._components[index];\n }\n public PathByAppendingPath(pathToAppend: Path): Path {\n let p = new Path();\n\n let upwardMoves = 0;\n for (let i = 0; i < pathToAppend._components.length; ++i) {\n if (pathToAppend._components[i].isParent) {\n upwardMoves++;\n } else {\n break;\n }\n }\n\n for (let i = 0; i < this._components.length - upwardMoves; ++i) {\n p._components.push(this._components[i]);\n }\n\n for (let i = upwardMoves; i < pathToAppend._components.length; ++i) {\n p._components.push(pathToAppend._components[i]);\n }\n\n return p;\n }\n get componentsString(): string {\n if (this._componentsString == null) {\n this._componentsString = this._components.join(\".\");\n if (this.isRelative)\n this._componentsString = \".\" + this._componentsString;\n }\n\n return this._componentsString;\n }\n set componentsString(value: string) {\n this._components.length = 0;\n\n this._componentsString = value;\n\n if (this._componentsString == null || this._componentsString == \"\") return;\n\n if (this._componentsString[0] == \".\") {\n this._isRelative = true;\n this._componentsString = this._componentsString.substring(1);\n }\n\n let componentStrings = this._componentsString.split(\".\");\n for (let str of componentStrings) {\n // we need to distinguish between named components that start with a number, eg \"42somewhere\", and indexed components\n // the normal parseInt won't do for the detection because it's too relaxed.\n // see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt\n if (/^(\\-|\\+)?([0-9]+|Infinity)$/.test(str)) {\n this._components.push(new Path.Component(parseInt(str)));\n } else {\n this._components.push(new Path.Component(str));\n }\n }\n }\n public toString(): string {\n return this.componentsString;\n }\n public Equals(otherPath: Path | null): boolean {\n if (otherPath == null) return false;\n\n if (otherPath._components.length != this._components.length) return false;\n\n if (otherPath.isRelative != this.isRelative) return false;\n\n // the original code uses SequenceEqual here, so we need to iterate over the components manually.\n for (let i = 0, l = otherPath._components.length; i < l; i++) {\n // it's not quite clear whether this test should use Equals or a simple == operator,\n // see https://github.com/y-lohse/inkjs/issues/22\n if (!otherPath._components[i].Equals(this._components[i])) return false;\n }\n\n return true;\n }\n public PathByAppendingComponent(c: Path.Component): Path {\n let p = new Path();\n p._components.push(...this._components);\n p._components.push(c);\n return p;\n }\n}\n\nexport namespace Path {\n export class Component {\n public readonly index: number;\n public readonly name: string | null;\n\n constructor(indexOrName: string | number) {\n this.index = -1;\n this.name = null;\n if (typeof indexOrName == \"string\") {\n this.name = indexOrName;\n } else {\n this.index = indexOrName;\n }\n }\n get isIndex(): boolean {\n return this.index >= 0;\n }\n get isParent(): boolean {\n return this.name == Path.parentId;\n }\n\n public static ToParent(): Component {\n return new Component(Path.parentId);\n }\n public toString(): string | null {\n if (this.isIndex) {\n return this.index.toString();\n } else {\n return this.name;\n }\n }\n public Equals(otherComp: Component): boolean {\n if (otherComp != null && otherComp.isIndex == this.isIndex) {\n if (this.isIndex) {\n return this.index == otherComp.index;\n } else {\n return this.name == otherComp.name;\n }\n }\n\n return false;\n }\n }\n}\n","export namespace Debug {\n export function AssertType(\n variable: any,\n type: new () => T,\n message: string\n ): void | never {\n Assert(variable instanceof type, message);\n }\n\n export function Assert(condition: boolean, message?: string): void | never {\n if (!condition) {\n if (typeof message !== \"undefined\") {\n console.warn(message);\n }\n\n if (console.trace) {\n console.trace();\n }\n\n throw new Error(\"\");\n }\n }\n}\n","import { InkObject } from \"./Object\";\nimport { Path } from \"./Path\";\nimport { InkList, InkListItem } from \"./InkList\";\nimport { StoryException } from \"./StoryException\";\nimport { asOrNull, asOrThrows } from \"./TypeAssertion\";\nimport { tryParseInt, tryParseFloat } from \"./TryGetResult\";\nimport { throwNullException } from \"./NullException\";\n\nexport abstract class AbstractValue extends InkObject {\n public abstract get valueType(): ValueType;\n public abstract get isTruthy(): boolean;\n public abstract get valueObject(): any;\n\n public abstract Cast(newType: ValueType): Value;\n\n public static Create(\n val: any,\n preferredNumberType?: ValueType\n ): Value | null {\n // This code doesn't exist in upstream and is simply here to enforce\n // the creation of the proper number value.\n // If `preferredNumberType` is not provided or if value doesn't match\n // `preferredNumberType`, this conditional does nothing.\n if (preferredNumberType) {\n if (\n preferredNumberType === (ValueType.Int as ValueType) &&\n Number.isInteger(Number(val))\n ) {\n return new IntValue(Number(val));\n } else if (\n preferredNumberType === (ValueType.Float as ValueType) &&\n !isNaN(val)\n ) {\n return new FloatValue(Number(val));\n }\n }\n\n if (typeof val === \"boolean\") {\n return new BoolValue(Boolean(val));\n }\n\n // https://github.com/y-lohse/inkjs/issues/425\n // Changed condition sequence, because Number('') is\n // parsed to 0, which made setting string to empty\n // impossible\n if (typeof val === \"string\") {\n return new StringValue(String(val));\n } else if (Number.isInteger(Number(val))) {\n return new IntValue(Number(val));\n } else if (!isNaN(val)) {\n return new FloatValue(Number(val));\n } else if (val instanceof Path) {\n return new DivertTargetValue(asOrThrows(val, Path));\n } else if (val instanceof InkList) {\n return new ListValue(asOrThrows(val, InkList));\n }\n\n return null;\n }\n public Copy() {\n return asOrThrows(AbstractValue.Create(this.valueObject), InkObject);\n }\n public BadCastException(targetType: ValueType) {\n return new StoryException(\n \"Can't cast \" +\n this.valueObject +\n \" from \" +\n this.valueType +\n \" to \" +\n targetType\n );\n }\n}\n\nexport abstract class Value<\n T extends { toString: () => string }\n> extends AbstractValue {\n public value: T | null;\n\n constructor(val: T | null) {\n super();\n this.value = val;\n }\n public get valueObject() {\n return this.value;\n }\n public toString() {\n if (this.value === null) return throwNullException(\"Value.value\");\n return this.value.toString();\n }\n}\n\nexport class BoolValue extends Value {\n constructor(val: boolean) {\n super(val || false);\n }\n public get isTruthy() {\n return Boolean(this.value);\n }\n public get valueType() {\n return ValueType.Bool;\n }\n\n public Cast(newType: ValueType): Value {\n if (this.value === null) return throwNullException(\"Value.value\");\n\n if (newType == this.valueType) {\n return this;\n }\n\n if (newType == ValueType.Int) {\n return new IntValue(this.value ? 1 : 0);\n }\n\n if (newType == ValueType.Float) {\n return new FloatValue(this.value ? 1.0 : 0.0);\n }\n\n if (newType == ValueType.String) {\n return new StringValue(this.value ? \"true\" : \"false\");\n }\n\n throw this.BadCastException(newType);\n }\n\n public toString() {\n return this.value ? \"true\" : \"false\";\n }\n}\n\nexport class IntValue extends Value {\n constructor(val: number) {\n super(val || 0);\n }\n public get isTruthy() {\n return this.value != 0;\n }\n public get valueType() {\n return ValueType.Int;\n }\n\n public Cast(newType: ValueType): Value {\n if (this.value === null) return throwNullException(\"Value.value\");\n\n if (newType == this.valueType) {\n return this;\n }\n\n if (newType == ValueType.Bool) {\n return new BoolValue(this.value === 0 ? false : true);\n }\n\n if (newType == ValueType.Float) {\n return new FloatValue(this.value);\n }\n\n if (newType == ValueType.String) {\n return new StringValue(\"\" + this.value);\n }\n\n throw this.BadCastException(newType);\n }\n}\n\nexport class FloatValue extends Value {\n constructor(val: number) {\n super(val || 0.0);\n }\n public get isTruthy() {\n return this.value != 0.0;\n }\n public get valueType() {\n return ValueType.Float;\n }\n\n public Cast(newType: ValueType): Value {\n if (this.value === null) return throwNullException(\"Value.value\");\n\n if (newType == this.valueType) {\n return this;\n }\n\n if (newType == ValueType.Bool) {\n return new BoolValue(this.value === 0.0 ? false : true);\n }\n\n if (newType == ValueType.Int) {\n return new IntValue(this.value);\n }\n\n if (newType == ValueType.String) {\n return new StringValue(\"\" + this.value);\n }\n\n throw this.BadCastException(newType);\n }\n}\n\nexport class StringValue extends Value {\n public _isNewline: boolean;\n public _isInlineWhitespace: boolean;\n\n constructor(val: string) {\n super(val || \"\");\n\n this._isNewline = this.value == \"\\n\";\n this._isInlineWhitespace = true;\n\n if (this.value === null) return throwNullException(\"Value.value\");\n\n if (this.value.length > 0) {\n this.value.split(\"\").every((c) => {\n if (c != \" \" && c != \"\\t\") {\n this._isInlineWhitespace = false;\n return false;\n }\n\n return true;\n });\n }\n }\n public get valueType() {\n return ValueType.String;\n }\n public get isTruthy() {\n if (this.value === null) return throwNullException(\"Value.value\");\n return this.value.length > 0;\n }\n public get isNewline() {\n return this._isNewline;\n }\n public get isInlineWhitespace() {\n return this._isInlineWhitespace;\n }\n public get isNonWhitespace() {\n return !this.isNewline && !this.isInlineWhitespace;\n }\n\n public Cast(newType: ValueType): Value {\n if (newType == this.valueType) {\n return this;\n }\n\n if (newType == ValueType.Int) {\n let parsedInt = tryParseInt(this.value);\n if (parsedInt.exists) {\n return new IntValue(parsedInt.result);\n } else {\n throw this.BadCastException(newType);\n }\n }\n\n if (newType == ValueType.Float) {\n let parsedFloat = tryParseFloat(this.value);\n if (parsedFloat.exists) {\n return new FloatValue(parsedFloat.result);\n } else {\n throw this.BadCastException(newType);\n }\n }\n\n throw this.BadCastException(newType);\n }\n}\n\nexport class DivertTargetValue extends Value {\n constructor(targetPath: Path | null = null) {\n super(targetPath);\n }\n public get valueType() {\n return ValueType.DivertTarget;\n }\n public get targetPath() {\n if (this.value === null) return throwNullException(\"Value.value\");\n return this.value;\n }\n public set targetPath(value: Path) {\n this.value = value;\n }\n public get isTruthy(): never {\n throw new Error(\"Shouldn't be checking the truthiness of a divert target\");\n }\n\n public Cast(newType: ValueType): Value {\n if (newType == this.valueType) return this;\n\n throw this.BadCastException(newType);\n }\n public toString() {\n return \"DivertTargetValue(\" + this.targetPath + \")\";\n }\n}\n\nexport class VariablePointerValue extends Value {\n public _contextIndex: number;\n\n constructor(variableName: string, contextIndex: number = -1) {\n super(variableName);\n\n this._contextIndex = contextIndex;\n }\n\n public get contextIndex() {\n return this._contextIndex;\n }\n public set contextIndex(value: number) {\n this._contextIndex = value;\n }\n public get variableName() {\n if (this.value === null) return throwNullException(\"Value.value\");\n return this.value;\n }\n public set variableName(value: string) {\n this.value = value;\n }\n public get valueType() {\n return ValueType.VariablePointer;\n }\n\n public get isTruthy(): never {\n throw new Error(\n \"Shouldn't be checking the truthiness of a variable pointer\"\n );\n }\n\n public Cast(newType: ValueType): Value {\n if (newType == this.valueType) return this;\n\n throw this.BadCastException(newType);\n }\n public toString() {\n return \"VariablePointerValue(\" + this.variableName + \")\";\n }\n public Copy() {\n return new VariablePointerValue(this.variableName, this.contextIndex);\n }\n}\n\nexport class ListValue extends Value {\n public get isTruthy() {\n if (this.value === null) {\n return throwNullException(\"this.value\");\n }\n return this.value.Count > 0;\n }\n public get valueType() {\n return ValueType.List;\n }\n public Cast(newType: ValueType): Value {\n if (this.value === null) return throwNullException(\"Value.value\");\n\n if (newType == ValueType.Int) {\n let max = this.value.maxItem;\n if (max.Key.isNull) return new IntValue(0);\n else return new IntValue(max.Value);\n } else if (newType == ValueType.Float) {\n let max = this.value.maxItem;\n if (max.Key.isNull) return new FloatValue(0.0);\n else return new FloatValue(max.Value);\n } else if (newType == ValueType.String) {\n let max = this.value.maxItem;\n if (max.Key.isNull) return new StringValue(\"\");\n else {\n return new StringValue(max.Key.toString());\n }\n }\n\n if (newType == this.valueType) return this;\n\n throw this.BadCastException(newType);\n }\n constructor();\n constructor(list: InkList);\n constructor(listOrSingleItem: InkListItem, singleValue: number);\n constructor(listOrSingleItem?: InkListItem | InkList, singleValue?: number) {\n super(null);\n\n if (!listOrSingleItem && !singleValue) {\n this.value = new InkList();\n } else if (listOrSingleItem instanceof InkList) {\n this.value = new InkList(listOrSingleItem);\n } else if (\n listOrSingleItem instanceof InkListItem &&\n typeof singleValue === \"number\"\n ) {\n this.value = new InkList({\n Key: listOrSingleItem,\n Value: singleValue,\n });\n }\n }\n public static RetainListOriginsForAssignment(\n oldValue: InkObject | null,\n newValue: InkObject\n ) {\n let oldList = asOrNull(oldValue, ListValue);\n let newList = asOrNull(newValue, ListValue);\n\n if (newList && newList.value === null)\n return throwNullException(\"newList.value\");\n if (oldList && oldList.value === null)\n return throwNullException(\"oldList.value\");\n\n // When assigning the empty list, try to retain any initial origin names\n if (oldList && newList && newList.value!.Count == 0)\n newList.value!.SetInitialOriginNames(oldList.value!.originNames);\n }\n}\n\nexport enum ValueType {\n Bool = -1,\n Int = 0,\n Float = 1,\n List = 2,\n String = 3,\n DivertTarget = 4,\n VariablePointer = 5,\n}\n","export enum PushPopType {\n Tunnel = 0,\n Function = 1,\n FunctionEvaluationFromGame = 2,\n}\n","// TODO: Unify with Compiler.\n\nexport type ErrorHandler = (message: string, type: ErrorType) => void;\n\nexport enum ErrorType {\n Author,\n Warning,\n Error,\n}\n","import { INamedContent } from \"./INamedContent\";\n\nexport function asOrNull(\n obj: any,\n type: (new (...arg: any[]) => T) | (Function & { prototype: T })\n): T | null {\n if (obj instanceof type) {\n return unsafeTypeAssertion(obj, type);\n } else {\n return null;\n }\n}\n\nexport function asOrThrows(\n obj: any,\n type: (new (...arg: any[]) => T) | (Function & { prototype: T })\n): T | never {\n if (obj instanceof type) {\n return unsafeTypeAssertion(obj, type);\n } else {\n throw new Error(`${obj} is not of type ${type}`);\n }\n}\n\nexport function asNumberOrThrows(obj: any) {\n if (typeof obj === \"number\") {\n return obj as number;\n } else {\n throw new Error(`${obj} is not a number`);\n }\n}\n\nexport function asBooleanOrThrows(obj: any) {\n if (typeof obj === \"boolean\") {\n return obj as boolean;\n } else {\n throw new Error(`${obj} is not a boolean`);\n }\n}\n\n// So here, in the reference implementation, contentObj is casted to an INamedContent\n// but here we use js-style duck typing: if it implements the same props as the interface,\n// we treat it as valid.\nexport function asINamedContentOrNull(obj: any): INamedContent | null {\n if (obj.hasValidName && obj.name) {\n return obj as INamedContent;\n }\n\n return null;\n}\n\nexport function nullIfUndefined(obj: T | undefined): T | null {\n if (typeof obj === \"undefined\") {\n return null;\n }\n\n return obj;\n}\n\nexport function isEquatable(type: any) {\n return typeof type === \"object\" && typeof type.Equals === \"function\";\n}\n\nfunction unsafeTypeAssertion(\n obj: any,\n type: (new () => T) | (Function & { prototype: T })\n) {\n return obj as T;\n}\n\nexport function filterUndef(element: T | undefined): element is T {\n return element != undefined;\n}\n","/**\n * In the original C# code, a SystemException would be thrown when passing\n * null to methods expected a valid instance. Javascript has no such\n * concept, but TypeScript will not allow `null` to be passed to methods\n * explicitely requiring a valid type.\n *\n * Whenever TypeScript complain about the possibility of a `null` value,\n * check the offending value and it it's null, throw this exception using\n * `throwNullException(name: string)`.\n */\nexport class NullException extends Error {}\n\n/**\n * Throw a NullException.\n *\n * @param name a short description of the offending value (often its name within the code).\n */\nexport function throwNullException(name: string): never {\n throw new NullException(`${name} is null or undefined`);\n}\n","import { Path } from \"./Path\";\nimport { Container } from \"./Container\";\nimport { Debug } from \"./Debug\";\nimport { asOrNull, asINamedContentOrNull } from \"./TypeAssertion\";\nimport { throwNullException } from \"./NullException\";\nimport { SearchResult } from \"./SearchResult\";\nimport { DebugMetadata } from \"./DebugMetadata\";\n\nexport class InkObject {\n public parent: InkObject | null = null;\n\n get debugMetadata(): DebugMetadata | null {\n if (this._debugMetadata === null) {\n if (this.parent) {\n return this.parent.debugMetadata;\n }\n }\n\n return this._debugMetadata;\n }\n\n set debugMetadata(value) {\n this._debugMetadata = value;\n }\n\n get ownDebugMetadata() {\n return this._debugMetadata;\n }\n\n private _debugMetadata: DebugMetadata | null = null;\n\n public DebugLineNumberOfPath(path: Path) {\n if (path === null) return null;\n\n // Try to get a line number from debug metadata\n let root = this.rootContentContainer;\n if (root) {\n let targetContent = root.ContentAtPath(path).obj;\n if (targetContent) {\n let dm = targetContent.debugMetadata;\n if (dm !== null) {\n return dm.startLineNumber;\n }\n }\n }\n\n return null;\n }\n\n get path() {\n if (this._path == null) {\n if (this.parent == null) {\n this._path = new Path();\n } else {\n let comps: Path.Component[] = [];\n\n let child: InkObject = this;\n let container = asOrNull(child.parent, Container);\n\n while (container !== null) {\n let namedChild = asINamedContentOrNull(child);\n if (namedChild != null && namedChild.hasValidName) {\n if (namedChild.name === null)\n return throwNullException(\"namedChild.name\");\n comps.unshift(new Path.Component(namedChild.name!));\n } else {\n comps.unshift(new Path.Component(container.content.indexOf(child)));\n }\n\n child = container;\n container = asOrNull(container.parent, Container);\n }\n\n this._path = new Path(comps);\n }\n }\n\n return this._path;\n }\n private _path: Path | null = null;\n\n public ResolvePath(path: Path | null): SearchResult {\n if (path === null) return throwNullException(\"path\");\n if (path.isRelative) {\n let nearestContainer = asOrNull(this, Container);\n\n if (nearestContainer === null) {\n Debug.Assert(\n this.parent !== null,\n \"Can't resolve relative path because we don't have a parent\"\n );\n nearestContainer = asOrNull(this.parent, Container);\n Debug.Assert(\n nearestContainer !== null,\n \"Expected parent to be a container\"\n );\n Debug.Assert(path.GetComponent(0).isParent);\n path = path.tail;\n }\n\n if (nearestContainer === null) {\n return throwNullException(\"nearestContainer\");\n }\n return nearestContainer.ContentAtPath(path);\n } else {\n let contentContainer = this.rootContentContainer;\n if (contentContainer === null) {\n return throwNullException(\"contentContainer\");\n }\n return contentContainer.ContentAtPath(path);\n }\n }\n\n public ConvertPathToRelative(globalPath: Path) {\n let ownPath = this.path;\n\n let minPathLength = Math.min(globalPath.length, ownPath.length);\n let lastSharedPathCompIndex = -1;\n\n for (let i = 0; i < minPathLength; ++i) {\n let ownComp = ownPath.GetComponent(i);\n let otherComp = globalPath.GetComponent(i);\n\n if (ownComp.Equals(otherComp)) {\n lastSharedPathCompIndex = i;\n } else {\n break;\n }\n }\n\n // No shared path components, so just use global path\n if (lastSharedPathCompIndex == -1) return globalPath;\n\n let numUpwardsMoves = ownPath.componentCount - 1 - lastSharedPathCompIndex;\n\n let newPathComps: Path.Component[] = [];\n\n for (let up = 0; up < numUpwardsMoves; ++up)\n newPathComps.push(Path.Component.ToParent());\n\n for (\n let down = lastSharedPathCompIndex + 1;\n down < globalPath.componentCount;\n ++down\n )\n newPathComps.push(globalPath.GetComponent(down));\n\n let relativePath = new Path(newPathComps, true);\n return relativePath;\n }\n\n public CompactPathString(otherPath: Path) {\n let globalPathStr = null;\n let relativePathStr = null;\n\n if (otherPath.isRelative) {\n relativePathStr = otherPath.componentsString;\n globalPathStr = this.path.PathByAppendingPath(otherPath).componentsString;\n } else {\n let relativePath = this.ConvertPathToRelative(otherPath);\n relativePathStr = relativePath.componentsString;\n globalPathStr = otherPath.componentsString;\n }\n\n if (relativePathStr.length < globalPathStr.length) return relativePathStr;\n else return globalPathStr;\n }\n\n get rootContentContainer() {\n let ancestor: InkObject = this;\n while (ancestor.parent) {\n ancestor = ancestor.parent;\n }\n return asOrNull(ancestor, Container);\n }\n\n public Copy(): InkObject {\n throw Error(\"Not Implemented: Doesn't support copying\");\n }\n // SetChild works slightly diferently in the js implementation.\n // Since we can't pass an objets property by reference, we instead pass\n // the object and the property string.\n // TODO: This method can probably be rewritten with type-safety in mind.\n public SetChild(obj: any, prop: any, value: any) {\n if (obj[prop]) obj[prop] = null;\n\n obj[prop] = value;\n\n if (obj[prop]) obj[prop].parent = this;\n }\n\n public Equals(obj: any) {\n return obj === this;\n }\n}\n","export class StringBuilder {\n private string: string;\n\n constructor(str?: string) {\n str = typeof str !== \"undefined\" ? str.toString() : \"\";\n this.string = str;\n }\n get Length(): number {\n return this.string.length;\n }\n public Append(str: string | null) {\n if (str !== null) {\n this.string += str;\n }\n }\n public AppendLine(str?: string) {\n if (typeof str !== \"undefined\") this.Append(str);\n this.string += \"\\n\";\n }\n public AppendFormat(format: string, ...args: any[]) {\n // taken from http://stackoverflow.com/questions/610406/javascript-equivalent-to-printf-string-format\n this.string += format.replace(/{(\\d+)}/g, (match: string, num: number) =>\n typeof args[num] != \"undefined\" ? args[num] : match\n );\n }\n public toString(): string {\n return this.string;\n }\n\n public Clear() {\n this.string = \"\";\n }\n}\n","import { throwNullException } from \"./NullException\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { ListDefinition } from \"./ListDefinition\";\nimport { Story } from \"./Story\";\n\nexport class InkListItem implements IInkListItem {\n // InkListItem is a struct\n\n public readonly originName: string | null = null;\n public readonly itemName: string | null = null;\n\n constructor(originName: string | null, itemName: string | null);\n constructor(fullName: string | null);\n constructor() {\n if (typeof arguments[1] !== \"undefined\") {\n let originName = arguments[0] as string | null;\n let itemName = arguments[1] as string | null;\n\n this.originName = originName;\n this.itemName = itemName;\n } else if (arguments[0]) {\n let fullName = arguments[0] as string;\n\n let nameParts = fullName.toString().split(\".\");\n this.originName = nameParts[0];\n this.itemName = nameParts[1];\n }\n }\n public static get Null() {\n return new InkListItem(null, null);\n }\n public get isNull() {\n return this.originName == null && this.itemName == null;\n }\n get fullName() {\n return (\n (this.originName !== null ? this.originName : \"?\") + \".\" + this.itemName\n );\n }\n public toString(): string {\n return this.fullName;\n }\n public Equals(obj: InkListItem) {\n if (obj instanceof InkListItem) {\n let otherItem = obj;\n return (\n otherItem.itemName == this.itemName &&\n otherItem.originName == this.originName\n );\n }\n\n return false;\n }\n\n // These methods did not exist in the original C# code. Their purpose is to\n // make `InkListItem` mimics the value-type semantics of the original\n // struct. Please refer to the end of this file, for a more in-depth\n // explanation.\n\n /**\n * Returns a shallow clone of the current instance.\n */\n public copy() {\n return new InkListItem(this.originName, this.itemName);\n }\n /**\n * Returns a `SerializedInkListItem` representing the current\n * instance. The result is intended to be used as a key inside a Map.\n */\n public serialized(): SerializedInkListItem {\n // We are simply using a JSON representation as a value-typed key.\n return JSON.stringify({\n originName: this.originName,\n itemName: this.itemName,\n });\n }\n\n /**\n * Reconstructs a `InkListItem` from the given SerializedInkListItem.\n */\n public static fromSerializedKey(key: SerializedInkListItem): InkListItem {\n let obj = JSON.parse(key);\n if (!InkListItem.isLikeInkListItem(obj)) return InkListItem.Null;\n\n let inkListItem = obj as IInkListItem;\n\n return new InkListItem(inkListItem.originName, inkListItem.itemName);\n }\n\n /**\n * Determines whether the given item is sufficiently `InkListItem`-like\n * to be used as a template when reconstructing the InkListItem.\n */\n private static isLikeInkListItem(item: any) {\n if (typeof item !== \"object\") return false;\n if (!item.hasOwnProperty(\"originName\") || !item.hasOwnProperty(\"itemName\"))\n return false;\n if (typeof item.originName !== \"string\" && typeof item.originName !== null)\n return false;\n if (typeof item.itemName !== \"string\" && typeof item.itemName !== null)\n return false;\n\n return true;\n }\n}\n\nexport class InkList extends Map {\n public origins: ListDefinition[] | null = null;\n public _originNames: string[] | null = [];\n\n constructor();\n constructor(otherList: InkList);\n constructor(singleOriginListName: string, originStory: Story);\n constructor(singleElement: KeyValuePair);\n constructor() {\n // Trying to be smart here, this emulates the constructor inheritance found\n // in the original code, but only if otherList is an InkList. IIFE FTW.\n super(\n (() => {\n if (arguments[0] instanceof InkList) {\n return arguments[0];\n } else {\n return [];\n }\n })()\n );\n\n if (arguments[0] instanceof InkList) {\n let otherList = arguments[0] as InkList;\n\n let otherOriginNames = otherList.originNames as string[];\n if (otherOriginNames !== null)\n this._originNames = otherOriginNames.slice();\n if (otherList.origins !== null) {\n this.origins = otherList.origins.slice();\n }\n } else if (typeof arguments[0] === \"string\") {\n let singleOriginListName = arguments[0] as string;\n let originStory = arguments[1] as Story;\n this.SetInitialOriginName(singleOriginListName);\n\n if (originStory.listDefinitions === null) {\n return throwNullException(\"originStory.listDefinitions\");\n }\n let def = originStory.listDefinitions.TryListGetDefinition(\n singleOriginListName,\n null\n );\n if (def.exists) {\n // Throwing now, because if the value is `null` it will\n // eventually throw down the line.\n if (def.result === null) {\n return throwNullException(\"def.result\");\n }\n this.origins = [def.result];\n } else {\n throw new Error(\n \"InkList origin could not be found in story when constructing new list: \" +\n singleOriginListName\n );\n }\n } else if (\n typeof arguments[0] === \"object\" &&\n arguments[0].hasOwnProperty(\"Key\") &&\n arguments[0].hasOwnProperty(\"Value\")\n ) {\n let singleElement = arguments[0] as KeyValuePair;\n this.Add(singleElement.Key, singleElement.Value);\n }\n }\n\n public static FromString(myListItem: string, originStory: Story) {\n let listValue =\n originStory.listDefinitions?.FindSingleItemListWithName(myListItem);\n if (listValue) {\n if (listValue.value === null) {\n return throwNullException(\"listValue.value\");\n }\n return new InkList(listValue.value);\n } else {\n throw new Error(\n \"Could not find the InkListItem from the string '\" +\n myListItem +\n \"' to create an InkList because it doesn't exist in the original list definition in ink.\"\n );\n }\n }\n\n public AddItem(itemOrItemName: InkListItem | string | null) {\n if (itemOrItemName instanceof InkListItem) {\n let item = itemOrItemName;\n\n if (item.originName == null) {\n this.AddItem(item.itemName);\n return;\n }\n\n if (this.origins === null) return throwNullException(\"this.origins\");\n\n for (let origin of this.origins) {\n if (origin.name == item.originName) {\n let intVal = origin.TryGetValueForItem(item, 0);\n if (intVal.exists) {\n this.Add(item, intVal.result);\n return;\n } else {\n throw new Error(\n \"Could not add the item \" +\n item +\n \" to this list because it doesn't exist in the original list definition in ink.\"\n );\n }\n }\n }\n\n throw new Error(\n \"Failed to add item to list because the item was from a new list definition that wasn't previously known to this list. Only items from previously known lists can be used, so that the int value can be found.\"\n );\n } else {\n let itemName = itemOrItemName as string | null;\n\n let foundListDef: ListDefinition | null = null;\n\n if (this.origins === null) return throwNullException(\"this.origins\");\n\n for (let origin of this.origins) {\n if (itemName === null) return throwNullException(\"itemName\");\n\n if (origin.ContainsItemWithName(itemName)) {\n if (foundListDef != null) {\n throw new Error(\n \"Could not add the item \" +\n itemName +\n \" to this list because it could come from either \" +\n origin.name +\n \" or \" +\n foundListDef.name\n );\n } else {\n foundListDef = origin;\n }\n }\n }\n\n if (foundListDef == null)\n throw new Error(\n \"Could not add the item \" +\n itemName +\n \" to this list because it isn't known to any list definitions previously associated with this list.\"\n );\n\n let item = new InkListItem(foundListDef.name, itemName);\n let itemVal = foundListDef.ValueForItem(item);\n this.Add(item, itemVal);\n }\n }\n public ContainsItemNamed(itemName: string | null) {\n for (let [key] of this) {\n let item = InkListItem.fromSerializedKey(key);\n if (item.itemName == itemName) return true;\n }\n\n return false;\n }\n public ContainsKey(key: InkListItem) {\n return this.has(key.serialized());\n }\n public Add(key: InkListItem, value: number) {\n let serializedKey = key.serialized();\n if (this.has(serializedKey)) {\n // Throw an exception to match the C# behavior.\n throw new Error(`The Map already contains an entry for ${key}`);\n }\n this.set(serializedKey, value);\n }\n public Remove(key: InkListItem) {\n return this.delete(key.serialized());\n }\n get Count() {\n return this.size;\n }\n get originOfMaxItem(): ListDefinition | null {\n if (this.origins == null) return null;\n\n let maxOriginName = this.maxItem.Key.originName;\n let result = null;\n this.origins.every((origin) => {\n if (origin.name == maxOriginName) {\n result = origin;\n return false;\n } else return true;\n });\n\n return result;\n }\n get originNames(): string[] {\n if (this.Count > 0) {\n if (this._originNames == null && this.Count > 0) this._originNames = [];\n else {\n if (!this._originNames) this._originNames = [];\n this._originNames.length = 0;\n }\n\n for (let [key] of this) {\n let item = InkListItem.fromSerializedKey(key);\n if (item.originName === null)\n return throwNullException(\"item.originName\");\n this._originNames.push(item.originName);\n }\n }\n\n return this._originNames as string[];\n }\n public SetInitialOriginName(initialOriginName: string) {\n this._originNames = [initialOriginName];\n }\n public SetInitialOriginNames(initialOriginNames: string[]) {\n if (initialOriginNames == null) this._originNames = null;\n else this._originNames = initialOriginNames.slice(); // store a copy\n }\n get maxItem() {\n let max: KeyValuePair = {\n Key: InkListItem.Null,\n Value: 0,\n };\n for (let [key, value] of this) {\n let item = InkListItem.fromSerializedKey(key);\n if (max.Key.isNull || value > max.Value)\n max = { Key: item, Value: value };\n }\n\n return max;\n }\n get minItem() {\n let min: KeyValuePair = {\n Key: InkListItem.Null,\n Value: 0,\n };\n for (let [key, value] of this) {\n let item = InkListItem.fromSerializedKey(key);\n if (min.Key.isNull || value < min.Value) {\n min = { Key: item, Value: value };\n }\n }\n return min;\n }\n get inverse() {\n let list = new InkList();\n if (this.origins != null) {\n for (let origin of this.origins) {\n for (let [key, value] of origin.items) {\n let item = InkListItem.fromSerializedKey(key);\n if (!this.ContainsKey(item)) list.Add(item, value);\n }\n }\n }\n return list;\n }\n get all() {\n let list = new InkList();\n if (this.origins != null) {\n for (let origin of this.origins) {\n for (let [key, value] of origin.items) {\n let item = InkListItem.fromSerializedKey(key);\n list.set(item.serialized(), value);\n }\n }\n }\n return list;\n }\n public Union(otherList: InkList) {\n let union = new InkList(this);\n for (let [key, value] of otherList) {\n union.set(key, value);\n }\n return union;\n }\n public Intersect(otherList: InkList) {\n let intersection = new InkList();\n for (let [key, value] of this) {\n if (otherList.has(key)) intersection.set(key, value);\n }\n\n return intersection;\n }\n public HasIntersection(otherList: InkList): boolean {\n for (let [key] of this) {\n if (otherList.has(key)) return true;\n }\n return false;\n }\n public Without(listToRemove: InkList) {\n let result = new InkList(this);\n for (let [key] of listToRemove) {\n result.delete(key);\n }\n\n return result;\n }\n\n public Contains(key: string): boolean;\n public Contains(otherList: InkList): boolean;\n public Contains(what: string | InkList): boolean {\n if (typeof what == \"string\") return this.ContainsItemNamed(what);\n const otherList = what;\n if (otherList.size == 0 || this.size == 0) return false;\n for (let [key] of otherList) {\n if (!this.has(key)) return false;\n }\n\n return true;\n }\n public GreaterThan(otherList: InkList) {\n if (this.Count == 0) return false;\n if (otherList.Count == 0) return true;\n\n return this.minItem.Value > otherList.maxItem.Value;\n }\n public GreaterThanOrEquals(otherList: InkList) {\n if (this.Count == 0) return false;\n if (otherList.Count == 0) return true;\n\n return (\n this.minItem.Value >= otherList.minItem.Value &&\n this.maxItem.Value >= otherList.maxItem.Value\n );\n }\n public LessThan(otherList: InkList) {\n if (otherList.Count == 0) return false;\n if (this.Count == 0) return true;\n\n return this.maxItem.Value < otherList.minItem.Value;\n }\n public LessThanOrEquals(otherList: InkList) {\n if (otherList.Count == 0) return false;\n if (this.Count == 0) return true;\n\n return (\n this.maxItem.Value <= otherList.maxItem.Value &&\n this.minItem.Value <= otherList.minItem.Value\n );\n }\n public MaxAsList() {\n if (this.Count > 0) return new InkList(this.maxItem);\n else return new InkList();\n }\n public MinAsList() {\n if (this.Count > 0) return new InkList(this.minItem);\n else return new InkList();\n }\n public ListWithSubRange(minBound: any, maxBound: any) {\n if (this.Count == 0) return new InkList();\n\n let ordered = this.orderedItems;\n\n let minValue = 0;\n let maxValue = Number.MAX_SAFE_INTEGER;\n\n if (Number.isInteger(minBound)) {\n minValue = minBound;\n } else {\n if (minBound instanceof InkList && minBound.Count > 0)\n minValue = minBound.minItem.Value;\n }\n\n if (Number.isInteger(maxBound)) {\n maxValue = maxBound;\n } else {\n if (maxBound instanceof InkList && maxBound.Count > 0)\n maxValue = maxBound.maxItem.Value;\n }\n\n let subList = new InkList();\n subList.SetInitialOriginNames(this.originNames);\n for (let item of ordered) {\n if (item.Value >= minValue && item.Value <= maxValue) {\n subList.Add(item.Key, item.Value);\n }\n }\n\n return subList;\n }\n public Equals(otherInkList: InkList) {\n if (otherInkList instanceof InkList === false) return false;\n if (otherInkList.Count != this.Count) return false;\n\n for (let [key] of this) {\n if (!otherInkList.has(key)) return false;\n }\n\n return true;\n }\n // GetHashCode not implemented\n get orderedItems() {\n // List>\n let ordered = new Array>();\n\n for (let [key, value] of this) {\n let item = InkListItem.fromSerializedKey(key);\n ordered.push({ Key: item, Value: value });\n }\n\n ordered.sort((x, y) => {\n if (x.Key.originName === null) {\n return throwNullException(\"x.Key.originName\");\n }\n if (y.Key.originName === null) {\n return throwNullException(\"y.Key.originName\");\n }\n\n if (x.Value == y.Value) {\n return x.Key.originName.localeCompare(y.Key.originName);\n } else {\n // TODO: refactor this bit into a numberCompareTo method?\n if (x.Value < y.Value) return -1;\n return x.Value > y.Value ? 1 : 0;\n }\n });\n\n return ordered;\n }\n public toString() {\n let ordered = this.orderedItems;\n\n let sb = new StringBuilder();\n for (let i = 0; i < ordered.length; i++) {\n if (i > 0) sb.Append(\", \");\n\n let item = ordered[i].Key;\n if (item.itemName === null) return throwNullException(\"item.itemName\");\n sb.Append(item.itemName);\n }\n\n return sb.toString();\n }\n // casting a InkList to a Number, for somereason, actually gives a number.\n // This messes up the type detection when creating a Value from a InkList.\n // Returning NaN here prevents that.\n public valueOf() {\n return NaN;\n }\n}\n\n/**\n * In the original C# code, `InkListItem` was defined as value type, meaning\n * that two `InkListItem` would be considered equal as long as they held the\n * same values. This doesn't hold true in Javascript, as `InkListItem` is a\n * reference type (Javascript doesn't allow the creation of custom value types).\n *\n * The key equality of Map objects is based on the \"SameValueZero\" algorithm;\n * since `InkListItem` is a value type, two keys will only be considered\n * equal if they are, in fact, the same object. As we are trying to emulate\n * the original behavior as close as possible, this will lead to unforeseen\n * side effects.\n *\n * In order to have a key equality based on value semantics, we'll convert\n * `InkListItem` to a valid string representation and use this representation\n * as a key (strings are value types in Javascript). Rather than using the\n * type `string` directly, we'll alias it to `SerializedInkListItem` and use\n * this type as the key for our Map-based `InkList`.\n *\n * Reducing `InkListItem` to a JSON representation would not be bulletproof\n * in the general case, but for our needs it works well. The major downside of\n * this method is that we will have to to reconstruct the original `InkListItem`\n * every time we'll need to access its properties.\n */\nexport type SerializedInkListItem = string;\n\n/**\n * An interface inherited by `InkListItem`, defining exposed\n * properties. It's mainly used when deserializing a `InkListItem` from its\n * key (`SerializedInkListItem`)\n */\ninterface IInkListItem {\n readonly originName: string | null;\n readonly itemName: string | null;\n}\nexport interface KeyValuePair {\n Key: K;\n Value: V;\n}\n","export class StoryException extends Error {\n public useEndLineNumber: boolean;\n public message: string;\n public name: string;\n\n constructor(message: string) {\n super(message);\n this.useEndLineNumber = false;\n this.message = message;\n this.name = \"StoryException\";\n }\n}\n","/**\n * This interface normalize the `TryGet` behavior found in the original\n * C# project. Any `TryGet` method will return a object conforming to this\n * interface.\n *\n * The original function returns a boolean and has a second parameter called\n * item that is an `out`. Both are needed and we can't just return the item\n * because it'll always be truthy. Instead, we return an object containing\n * whether the result exists (`exists`) and the result itself (`result`).\n *\n * For instance a `TryGet` prototype would look like this:\n```\nTryGetItemWithValue(val: number, item: InkListItem): TryGetResult{\n```\n *\n * On the other hand, dealing with the result can be done in the following way:\n```\nvar item = item.TryGetItemWithValue(intVal, InkListItem.Null);\nif (item.exists) {\n\tconsole.log(item.result)\n}\n```\n *\n */\nexport interface TryGetResult {\n result: T;\n exists: boolean;\n}\n\nexport function tryGetValueFromMap(\n map: Map | null,\n key: K,\n /* out */ value: V\n): TryGetResult {\n if (map === null) {\n return { result: value, exists: false };\n }\n\n let val = map.get(key);\n\n if (typeof val === \"undefined\") {\n return { result: value, exists: false };\n } else {\n return { result: val, exists: true };\n }\n}\n\nexport function tryParseInt(\n value: any,\n /* out */ defaultValue: number = 0\n): TryGetResult {\n let val = parseInt(value);\n\n if (!Number.isNaN(val)) {\n return { result: val, exists: true };\n } else {\n return { result: defaultValue, exists: false };\n }\n}\n\nexport function tryParseFloat(\n value: any,\n /* out */ defaultValue: number = 0\n): TryGetResult {\n let val = parseFloat(value);\n\n if (!Number.isNaN(val)) {\n return { result: val, exists: true };\n } else {\n return { result: defaultValue, exists: false };\n }\n}\n","import { InkObject } from \"./Object\";\nimport { Container } from \"./Container\";\n\nexport class SearchResult {\n public obj: InkObject | null = null;\n public approximate: boolean = false;\n\n get correctObj() {\n return this.approximate ? null : this.obj;\n }\n\n get container() {\n return this.obj instanceof Container ? this.obj : null;\n }\n\n public copy() {\n let searchResult = new SearchResult();\n searchResult.obj = this.obj;\n searchResult.approximate = this.approximate;\n\n return searchResult;\n }\n}\n","import { StringValue } from \"./Value\";\nimport { throwNullException } from \"./NullException\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { INamedContent } from \"./INamedContent\";\nimport { InkObject } from \"./Object\";\nimport { SearchResult } from \"./SearchResult\";\nimport { Path } from \"./Path\";\nimport { Debug } from \"./Debug\";\nimport { tryGetValueFromMap } from \"./TryGetResult\";\nimport { asINamedContentOrNull, asOrNull, asOrThrows } from \"./TypeAssertion\";\n\nexport class Container extends InkObject implements INamedContent {\n public name: string | null = null;\n\n public _content: InkObject[] = [];\n public namedContent: Map = new Map();\n\n public visitsShouldBeCounted: boolean = false;\n public turnIndexShouldBeCounted: boolean = false;\n public countingAtStartOnly: boolean = false;\n\n public _pathToFirstLeafContent: Path | null = null;\n\n get hasValidName() {\n return this.name != null && this.name.length > 0;\n }\n get content() {\n return this._content;\n }\n set content(value: InkObject[]) {\n this.AddContent(value);\n }\n get namedOnlyContent() {\n let namedOnlyContentDict: Map | null = new Map();\n\n for (let [key, value] of this.namedContent) {\n let inkObject = asOrThrows(value, InkObject);\n namedOnlyContentDict.set(key, inkObject);\n }\n\n for (let c of this.content) {\n let named = asINamedContentOrNull(c);\n if (named != null && named.hasValidName) {\n namedOnlyContentDict.delete(named.name!);\n }\n }\n\n if (namedOnlyContentDict.size == 0) namedOnlyContentDict = null;\n\n return namedOnlyContentDict;\n }\n set namedOnlyContent(value: Map | null) {\n let existingNamedOnly = this.namedOnlyContent;\n if (existingNamedOnly != null) {\n for (let [key] of existingNamedOnly) {\n this.namedContent.delete(key);\n }\n }\n\n if (value == null) return;\n\n for (let [, val] of value) {\n let named = asINamedContentOrNull(val);\n if (named != null) this.AddToNamedContentOnly(named);\n }\n }\n get countFlags(): number {\n let flags: Container.CountFlags = 0;\n if (this.visitsShouldBeCounted) flags |= Container.CountFlags.Visits;\n if (this.turnIndexShouldBeCounted) flags |= Container.CountFlags.Turns;\n if (this.countingAtStartOnly) flags |= Container.CountFlags.CountStartOnly;\n\n if (flags == Container.CountFlags.CountStartOnly) {\n flags = 0;\n }\n\n return flags;\n }\n set countFlags(value: number) {\n let flag: Container.CountFlags = value;\n if ((flag & Container.CountFlags.Visits) > 0)\n this.visitsShouldBeCounted = true;\n if ((flag & Container.CountFlags.Turns) > 0)\n this.turnIndexShouldBeCounted = true;\n if ((flag & Container.CountFlags.CountStartOnly) > 0)\n this.countingAtStartOnly = true;\n }\n get pathToFirstLeafContent() {\n if (this._pathToFirstLeafContent == null)\n this._pathToFirstLeafContent = this.path.PathByAppendingPath(\n this.internalPathToFirstLeafContent\n );\n\n return this._pathToFirstLeafContent;\n }\n get internalPathToFirstLeafContent() {\n let components: Path.Component[] = [];\n let container: Container = this;\n while (container instanceof Container) {\n if (container.content.length > 0) {\n components.push(new Path.Component(0));\n container = container.content[0] as Container;\n }\n }\n return new Path(components);\n }\n\n public AddContent(contentObjOrList: InkObject | InkObject[]) {\n if (contentObjOrList instanceof Array) {\n let contentList = contentObjOrList as InkObject[];\n\n for (let c of contentList) {\n this.AddContent(c);\n }\n } else {\n let contentObj = contentObjOrList as InkObject;\n\n this._content.push(contentObj);\n\n if (contentObj.parent) {\n throw new Error(\"content is already in \" + contentObj.parent);\n }\n\n contentObj.parent = this;\n\n this.TryAddNamedContent(contentObj);\n }\n }\n public TryAddNamedContent(contentObj: InkObject) {\n let namedContentObj = asINamedContentOrNull(contentObj);\n if (namedContentObj != null && namedContentObj.hasValidName) {\n this.AddToNamedContentOnly(namedContentObj);\n }\n }\n public AddToNamedContentOnly(namedContentObj: INamedContent) {\n Debug.AssertType(\n namedContentObj,\n InkObject,\n \"Can only add Runtime.Objects to a Runtime.Container\"\n );\n let runtimeObj = asOrThrows(namedContentObj, InkObject);\n runtimeObj.parent = this;\n\n if (namedContentObj.name === null)\n return throwNullException(\"namedContentObj.name\");\n this.namedContent.set(namedContentObj.name!, namedContentObj);\n }\n public ContentAtPath(\n path: Path,\n partialPathStart: number = 0,\n partialPathLength: number = -1\n ) {\n if (partialPathLength == -1) partialPathLength = path.length;\n\n let result = new SearchResult();\n result.approximate = false;\n\n let currentContainer: Container | null = this;\n let currentObj: InkObject = this;\n\n for (let i = partialPathStart; i < partialPathLength; ++i) {\n let comp = path.GetComponent(i);\n if (currentContainer == null) {\n result.approximate = true;\n break;\n }\n\n let foundObj: InkObject | null =\n currentContainer.ContentWithPathComponent(comp);\n\n if (foundObj == null) {\n result.approximate = true;\n break;\n }\n\n currentObj = foundObj;\n currentContainer = asOrNull(foundObj, Container);\n }\n\n result.obj = currentObj;\n\n return result;\n }\n public InsertContent(contentObj: InkObject, index: number) {\n this.content.splice(index, 0, contentObj);\n\n if (contentObj.parent) {\n throw new Error(\"content is already in \" + contentObj.parent);\n }\n\n contentObj.parent = this;\n\n this.TryAddNamedContent(contentObj);\n }\n public AddContentsOfContainer(otherContainer: Container) {\n this.content.push(...otherContainer.content);\n\n for (let obj of otherContainer.content) {\n obj.parent = this;\n this.TryAddNamedContent(obj);\n }\n }\n public ContentWithPathComponent(component: Path.Component): InkObject | null {\n if (component.isIndex) {\n if (component.index >= 0 && component.index < this.content.length) {\n return this.content[component.index];\n } else {\n return null;\n }\n } else if (component.isParent) {\n return this.parent;\n } else {\n if (component.name === null) {\n return throwNullException(\"component.name\");\n }\n let foundContent = tryGetValueFromMap(\n this.namedContent,\n component.name,\n null\n );\n if (foundContent.exists) {\n return asOrThrows(foundContent.result, InkObject);\n } else {\n return null;\n }\n }\n }\n public BuildStringOfHierarchy(): string;\n public BuildStringOfHierarchy(\n sb: StringBuilder,\n indentation: number,\n pointedObj: InkObject | null\n ): string;\n public BuildStringOfHierarchy() {\n let sb: StringBuilder;\n if (arguments.length == 0) {\n sb = new StringBuilder();\n this.BuildStringOfHierarchy(sb, 0, null);\n return sb.toString();\n }\n\n sb = arguments[0] as StringBuilder;\n let indentation = arguments[1] as number;\n let pointedObj = arguments[2] as InkObject | null;\n\n function appendIndentation() {\n const spacesPerIndent = 4; // Truly const in the original code\n for (let i = 0; i < spacesPerIndent * indentation; ++i) {\n sb.Append(\" \");\n }\n }\n\n appendIndentation();\n sb.Append(\"[\");\n\n if (this.hasValidName) {\n sb.AppendFormat(\" ({0})\", this.name);\n }\n\n if (this == pointedObj) {\n sb.Append(\" <---\");\n }\n\n sb.AppendLine();\n\n indentation++;\n\n for (let i = 0; i < this.content.length; ++i) {\n let obj = this.content[i];\n\n if (obj instanceof Container) {\n let container = obj as Container;\n\n container.BuildStringOfHierarchy(sb, indentation, pointedObj);\n } else {\n appendIndentation();\n if (obj instanceof StringValue) {\n sb.Append('\"');\n sb.Append(obj.toString().replace(\"\\n\", \"\\\\n\"));\n sb.Append('\"');\n } else {\n sb.Append(obj.toString());\n }\n }\n\n if (i != this.content.length - 1) {\n sb.Append(\",\");\n }\n\n if (!(obj instanceof Container) && obj == pointedObj) {\n sb.Append(\" <---\");\n }\n\n sb.AppendLine();\n }\n\n let onlyNamed: Map = new Map();\n\n for (let [key, value] of this.namedContent) {\n if (this.content.indexOf(asOrThrows(value, InkObject)) >= 0) {\n continue;\n } else {\n onlyNamed.set(key, value);\n }\n }\n\n if (onlyNamed.size > 0) {\n appendIndentation();\n sb.AppendLine(\"-- named: --\");\n\n for (let [, value] of onlyNamed) {\n Debug.AssertType(\n value,\n Container,\n \"Can only print out named Containers\"\n );\n let container = value as Container;\n container.BuildStringOfHierarchy(sb, indentation, pointedObj);\n sb.AppendLine();\n }\n }\n\n indentation--;\n\n appendIndentation();\n sb.Append(\"]\");\n }\n}\n\nexport namespace Container {\n export enum CountFlags {\n Start = 0,\n Visits = 1,\n Turns = 2,\n CountStartOnly = 4,\n }\n}\n","import { InkObject } from \"./Object\";\n\nexport class Glue extends InkObject {\n public toString() {\n return \"Glue\";\n }\n}\n","import { InkObject } from \"./Object\";\n\nexport class ControlCommand extends InkObject {\n private _commandType: ControlCommand.CommandType;\n\n get commandType(): ControlCommand.CommandType {\n return this._commandType;\n }\n\n constructor(\n commandType: ControlCommand.CommandType = ControlCommand.CommandType.NotSet\n ) {\n super();\n this._commandType = commandType;\n }\n\n public Copy() {\n return new ControlCommand(this.commandType);\n }\n public static EvalStart() {\n return new ControlCommand(ControlCommand.CommandType.EvalStart);\n }\n public static EvalOutput() {\n return new ControlCommand(ControlCommand.CommandType.EvalOutput);\n }\n public static EvalEnd() {\n return new ControlCommand(ControlCommand.CommandType.EvalEnd);\n }\n public static Duplicate() {\n return new ControlCommand(ControlCommand.CommandType.Duplicate);\n }\n public static PopEvaluatedValue() {\n return new ControlCommand(ControlCommand.CommandType.PopEvaluatedValue);\n }\n public static PopFunction() {\n return new ControlCommand(ControlCommand.CommandType.PopFunction);\n }\n public static PopTunnel() {\n return new ControlCommand(ControlCommand.CommandType.PopTunnel);\n }\n public static BeginString() {\n return new ControlCommand(ControlCommand.CommandType.BeginString);\n }\n public static EndString() {\n return new ControlCommand(ControlCommand.CommandType.EndString);\n }\n public static NoOp() {\n return new ControlCommand(ControlCommand.CommandType.NoOp);\n }\n public static ChoiceCount() {\n return new ControlCommand(ControlCommand.CommandType.ChoiceCount);\n }\n public static Turns() {\n return new ControlCommand(ControlCommand.CommandType.Turns);\n }\n public static TurnsSince() {\n return new ControlCommand(ControlCommand.CommandType.TurnsSince);\n }\n public static ReadCount() {\n return new ControlCommand(ControlCommand.CommandType.ReadCount);\n }\n public static Random() {\n return new ControlCommand(ControlCommand.CommandType.Random);\n }\n public static SeedRandom() {\n return new ControlCommand(ControlCommand.CommandType.SeedRandom);\n }\n public static VisitIndex() {\n return new ControlCommand(ControlCommand.CommandType.VisitIndex);\n }\n public static SequenceShuffleIndex() {\n return new ControlCommand(ControlCommand.CommandType.SequenceShuffleIndex);\n }\n public static StartThread() {\n return new ControlCommand(ControlCommand.CommandType.StartThread);\n }\n public static Done() {\n return new ControlCommand(ControlCommand.CommandType.Done);\n }\n public static End() {\n return new ControlCommand(ControlCommand.CommandType.End);\n }\n public static ListFromInt() {\n return new ControlCommand(ControlCommand.CommandType.ListFromInt);\n }\n public static ListRange() {\n return new ControlCommand(ControlCommand.CommandType.ListRange);\n }\n public static ListRandom() {\n return new ControlCommand(ControlCommand.CommandType.ListRandom);\n }\n public static BeginTag() {\n return new ControlCommand(ControlCommand.CommandType.BeginTag);\n }\n public static EndTag() {\n return new ControlCommand(ControlCommand.CommandType.EndTag);\n }\n public toString() {\n return \"ControlCommand \" + this.commandType.toString();\n }\n}\n\nexport namespace ControlCommand {\n export enum CommandType {\n NotSet = -1,\n EvalStart, // 0\n EvalOutput, // 1\n EvalEnd, // 2\n Duplicate, // 3\n PopEvaluatedValue, // 4\n PopFunction, // 5\n PopTunnel, // 6\n BeginString, // 7\n EndString, // 8\n NoOp, // 9\n ChoiceCount, // 10\n Turns, // 11\n TurnsSince, // 12\n ReadCount, // 13\n Random, // 14\n SeedRandom, // 15\n VisitIndex, // 16\n SequenceShuffleIndex, // 17\n StartThread, // 18\n Done, // 19\n End, // 20\n ListFromInt, // 21\n ListRange, // 22\n ListRandom, // 23\n BeginTag, // 24\n EndTag, // 25\n\n TOTAL_VALUES,\n }\n}\n","import { Path } from \"./Path\";\nimport { Container } from \"./Container\";\nimport { InkObject } from \"./Object\";\n\nexport class Pointer {\n public container: Container | null = null;\n public index: number = -1;\n\n constructor();\n constructor(container: Container | null, index: number);\n constructor() {\n if (arguments.length === 2) {\n this.container = arguments[0];\n this.index = arguments[1];\n }\n }\n\n public Resolve(): InkObject | null {\n if (this.index < 0) return this.container;\n if (this.container == null) return null;\n if (this.container.content.length == 0) return this.container;\n if (this.index >= this.container.content.length) return null;\n\n return this.container.content[this.index];\n }\n\n get isNull(): boolean {\n return this.container == null;\n }\n\n get path(): Path | null {\n if (this.isNull) return null;\n\n if (this.index >= 0)\n return this.container!.path.PathByAppendingComponent(\n new Path.Component(this.index)\n );\n else return this.container!.path;\n }\n\n public toString(): string {\n if (!this.container) return \"Ink Pointer (null)\";\n\n return (\n \"Ink Pointer -> \" +\n this.container.path.toString() +\n \" -- index \" +\n this.index\n );\n }\n\n // This method does not exist in the original C# code, but is here to maintain the\n // value semantics of Pointer.\n public copy(): Pointer {\n return new Pointer(this.container, this.index);\n }\n\n public static StartOf(container: Container | null): Pointer {\n return new Pointer(container, 0);\n }\n\n public static get Null(): Pointer {\n return new Pointer(null, -1);\n }\n}\n","import { Path } from \"./Path\";\nimport { PushPopType } from \"./PushPop\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { InkObject } from \"./Object\";\nimport { Pointer } from \"./Pointer\";\nimport { Container } from \"./Container\";\nimport { throwNullException } from \"./NullException\";\n\nexport class Divert extends InkObject {\n get targetPath() {\n if (this._targetPath != null && this._targetPath.isRelative) {\n let targetObj = this.targetPointer.Resolve();\n if (targetObj) {\n this._targetPath = targetObj.path;\n }\n }\n\n return this._targetPath;\n }\n set targetPath(value: Path | null) {\n this._targetPath = value;\n this._targetPointer = Pointer.Null;\n }\n\n public _targetPath: Path | null = null;\n\n get targetPointer() {\n if (this._targetPointer.isNull) {\n let targetObj = this.ResolvePath(this._targetPath).obj;\n\n if (this._targetPath === null)\n return throwNullException(\"this._targetPath\");\n if (this._targetPath.lastComponent === null)\n return throwNullException(\"this._targetPath.lastComponent\");\n\n if (this._targetPath.lastComponent.isIndex) {\n if (targetObj === null) return throwNullException(\"targetObj\");\n this._targetPointer.container =\n targetObj.parent instanceof Container ? targetObj.parent : null;\n this._targetPointer.index = this._targetPath.lastComponent.index;\n } else {\n this._targetPointer = Pointer.StartOf(\n targetObj instanceof Container ? targetObj : null\n );\n }\n }\n\n return this._targetPointer.copy();\n }\n\n public _targetPointer: Pointer = Pointer.Null;\n\n get targetPathString() {\n if (this.targetPath == null) return null;\n\n return this.CompactPathString(this.targetPath);\n }\n set targetPathString(value: string | null) {\n if (value == null) {\n this.targetPath = null;\n } else {\n this.targetPath = new Path(value);\n }\n }\n\n public variableDivertName: string | null = null;\n get hasVariableTarget() {\n return this.variableDivertName != null;\n }\n\n public pushesToStack: boolean = false;\n public stackPushType: PushPopType = 0;\n\n public isExternal: boolean = false;\n public externalArgs: number = 0;\n\n public isConditional: boolean = false;\n\n constructor(stackPushType?: PushPopType) {\n super();\n this.pushesToStack = false;\n\n if (typeof stackPushType !== \"undefined\") {\n this.pushesToStack = true;\n this.stackPushType = stackPushType;\n }\n }\n\n public Equals(obj: Divert | null) {\n let otherDivert = obj;\n if (otherDivert instanceof Divert) {\n if (this.hasVariableTarget == otherDivert.hasVariableTarget) {\n if (this.hasVariableTarget) {\n return this.variableDivertName == otherDivert.variableDivertName;\n } else {\n if (this.targetPath === null)\n return throwNullException(\"this.targetPath\");\n return this.targetPath.Equals(otherDivert.targetPath);\n }\n }\n }\n return false;\n }\n\n public toString() {\n if (this.hasVariableTarget) {\n return \"Divert(variable: \" + this.variableDivertName + \")\";\n } else if (this.targetPath == null) {\n return \"Divert(null)\";\n } else {\n let sb = new StringBuilder();\n\n let targetStr = this.targetPath.toString();\n // int? targetLineNum = DebugLineNumberOfPath (targetPath);\n let targetLineNum = null;\n if (targetLineNum != null) {\n targetStr = \"line \" + targetLineNum;\n }\n\n sb.Append(\"Divert\");\n\n if (this.isConditional) sb.Append(\"?\");\n\n if (this.pushesToStack) {\n if (this.stackPushType == PushPopType.Function) {\n sb.Append(\" function\");\n } else {\n sb.Append(\" tunnel\");\n }\n }\n\n sb.Append(\" -> \");\n sb.Append(this.targetPathString);\n\n sb.Append(\" (\");\n sb.Append(targetStr);\n sb.Append(\")\");\n\n return sb.toString();\n }\n }\n}\n","import { InkObject } from \"./Object\";\nimport { Path } from \"./Path\";\nimport { Container } from \"./Container\";\nimport { throwNullException } from \"./NullException\";\n\nexport class ChoicePoint extends InkObject {\n public _pathOnChoice: Path | null = null;\n public hasCondition: boolean = false;\n public hasStartContent: boolean = false;\n public hasChoiceOnlyContent: boolean = false;\n public isInvisibleDefault: boolean = false;\n public onceOnly: boolean = true;\n\n constructor(onceOnly: boolean = true) {\n super();\n this.onceOnly = onceOnly;\n }\n get pathOnChoice(): Path | null {\n if (this._pathOnChoice != null && this._pathOnChoice.isRelative) {\n let choiceTargetObj = this.choiceTarget;\n if (choiceTargetObj) {\n this._pathOnChoice = choiceTargetObj.path;\n }\n }\n return this._pathOnChoice;\n }\n set pathOnChoice(value: Path | null) {\n this._pathOnChoice = value;\n }\n get choiceTarget(): Container | null {\n if (this._pathOnChoice === null)\n return throwNullException(\"ChoicePoint._pathOnChoice\");\n return this.ResolvePath(this._pathOnChoice).container;\n }\n get pathStringOnChoice(): string {\n if (this.pathOnChoice === null)\n return throwNullException(\"ChoicePoint.pathOnChoice\");\n return this.CompactPathString(this.pathOnChoice);\n }\n set pathStringOnChoice(value: string) {\n this.pathOnChoice = new Path(value);\n }\n get flags(): number {\n let flags = 0;\n if (this.hasCondition) flags |= 1;\n if (this.hasStartContent) flags |= 2;\n if (this.hasChoiceOnlyContent) flags |= 4;\n if (this.isInvisibleDefault) flags |= 8;\n if (this.onceOnly) flags |= 16;\n return flags;\n }\n set flags(value: number) {\n this.hasCondition = (value & 1) > 0;\n this.hasStartContent = (value & 2) > 0;\n this.hasChoiceOnlyContent = (value & 4) > 0;\n this.isInvisibleDefault = (value & 8) > 0;\n this.onceOnly = (value & 16) > 0;\n }\n public toString(): string {\n if (this.pathOnChoice === null)\n return throwNullException(\"ChoicePoint.pathOnChoice\");\n // int? targetLineNum = DebugLineNumberOfPath (pathOnChoice);\n let targetLineNum = null;\n let targetString = this.pathOnChoice.toString();\n\n if (targetLineNum != null) {\n targetString = \" line \" + targetLineNum + \"(\" + targetString + \")\";\n }\n\n return \"Choice: -> \" + targetString;\n }\n}\n","import { InkObject } from \"./Object\";\nimport { Path } from \"./Path\";\n\nexport class VariableReference extends InkObject {\n public name: string | null;\n public pathForCount: Path | null = null;\n\n get containerForCount() {\n if (this.pathForCount === null) return null;\n return this.ResolvePath(this.pathForCount).container;\n }\n get pathStringForCount() {\n if (this.pathForCount === null) return null;\n\n return this.CompactPathString(this.pathForCount);\n }\n set pathStringForCount(value: string | null) {\n if (value === null) this.pathForCount = null;\n else this.pathForCount = new Path(value);\n }\n\n constructor(name: string | null = null) {\n super();\n this.name = name;\n }\n\n public toString() {\n if (this.name != null) {\n return \"var(\" + this.name + \")\";\n } else {\n let pathStr = this.pathStringForCount;\n return \"read_count(\" + pathStr + \")\";\n }\n }\n}\n","import { InkObject } from \"./Object\";\n\nexport class VariableAssignment extends InkObject {\n public readonly variableName: string | null;\n public readonly isNewDeclaration: boolean;\n public isGlobal: boolean;\n\n constructor(variableName: string | null, isNewDeclaration: boolean) {\n super();\n this.variableName = variableName || null;\n this.isNewDeclaration = !!isNewDeclaration;\n this.isGlobal = false;\n }\n\n public toString(): string {\n return \"VarAssign to \" + this.variableName;\n }\n}\n","import { InkObject } from \"./Object\";\n\nexport class Void extends InkObject {\n public toString() {\n return \"Void\";\n }\n}\n","import { Value, ValueType, IntValue, ListValue, BoolValue } from \"./Value\";\nimport { StoryException } from \"./StoryException\";\nimport { Void } from \"./Void\";\nimport { Path } from \"./Path\";\nimport { InkList, InkListItem } from \"./InkList\";\nimport { InkObject } from \"./Object\";\nimport { asOrNull, asOrThrows, asBooleanOrThrows } from \"./TypeAssertion\";\nimport { throwNullException } from \"./NullException\";\n\ntype BinaryOp = (left: T, right: T) => any;\ntype UnaryOp = (val: T) => any;\n\nexport class NativeFunctionCall extends InkObject {\n public static readonly Add: string = \"+\";\n public static readonly Subtract: string = \"-\";\n public static readonly Divide: string = \"/\";\n public static readonly Multiply: string = \"*\";\n public static readonly Mod: string = \"%\";\n public static readonly Negate: string = \"_\";\n public static readonly Equal: string = \"==\";\n public static readonly Greater: string = \">\";\n public static readonly Less: string = \"<\";\n public static readonly GreaterThanOrEquals: string = \">=\";\n public static readonly LessThanOrEquals: string = \"<=\";\n public static readonly NotEquals: string = \"!=\";\n public static readonly Not: string = \"!\";\n public static readonly And: string = \"&&\";\n public static readonly Or: string = \"||\";\n public static readonly Min: string = \"MIN\";\n public static readonly Max: string = \"MAX\";\n public static readonly Pow: string = \"POW\";\n public static readonly Floor: string = \"FLOOR\";\n public static readonly Ceiling: string = \"CEILING\";\n public static readonly Int: string = \"INT\";\n public static readonly Float: string = \"FLOAT\";\n public static readonly Has: string = \"?\";\n public static readonly Hasnt: string = \"!?\";\n public static readonly Intersect: string = \"^\";\n public static readonly ListMin: string = \"LIST_MIN\";\n public static readonly ListMax: string = \"LIST_MAX\";\n public static readonly All: string = \"LIST_ALL\";\n public static readonly Count: string = \"LIST_COUNT\";\n public static readonly ValueOfList: string = \"LIST_VALUE\";\n public static readonly Invert: string = \"LIST_INVERT\";\n\n public static CallWithName(functionName: string) {\n return new NativeFunctionCall(functionName);\n }\n\n public static CallExistsWithName(functionName: string) {\n this.GenerateNativeFunctionsIfNecessary();\n return this._nativeFunctions!.get(functionName);\n }\n\n get name() {\n if (this._name === null)\n return throwNullException(\"NativeFunctionCall._name\");\n return this._name;\n }\n set name(value: string) {\n this._name = value;\n if (!this._isPrototype) {\n if (NativeFunctionCall._nativeFunctions === null)\n throwNullException(\"NativeFunctionCall._nativeFunctions\");\n else\n this._prototype =\n NativeFunctionCall._nativeFunctions.get(this._name) || null;\n }\n }\n public _name: string | null = null;\n\n get numberOfParameters() {\n if (this._prototype) {\n return this._prototype.numberOfParameters;\n } else {\n return this._numberOfParameters;\n }\n }\n set numberOfParameters(value: number) {\n this._numberOfParameters = value;\n }\n public _numberOfParameters: number = 0;\n\n public Call(parameters: InkObject[]): InkObject | null {\n if (this._prototype) {\n return this._prototype.Call(parameters);\n }\n\n if (this.numberOfParameters != parameters.length) {\n throw new Error(\"Unexpected number of parameters\");\n }\n\n let hasList = false;\n for (let p of parameters) {\n if (p instanceof Void)\n throw new StoryException(\n 'Attempting to perform operation on a void value. Did you forget to \"return\" a value from a function you called here?'\n );\n if (p instanceof ListValue) hasList = true;\n }\n\n if (parameters.length == 2 && hasList) {\n return this.CallBinaryListOperation(parameters);\n }\n\n let coercedParams = this.CoerceValuesToSingleType(parameters);\n let coercedType = coercedParams[0].valueType;\n\n if (coercedType == ValueType.Int) {\n return this.CallType(coercedParams);\n } else if (coercedType == ValueType.Float) {\n return this.CallType(coercedParams);\n } else if (coercedType == ValueType.String) {\n return this.CallType(coercedParams);\n } else if (coercedType == ValueType.DivertTarget) {\n return this.CallType(coercedParams);\n } else if (coercedType == ValueType.List) {\n return this.CallType(coercedParams);\n }\n\n return null;\n }\n\n public CallType string }>(\n parametersOfSingleType: Array>\n ) {\n let param1 = asOrThrows(parametersOfSingleType[0], Value);\n let valType = param1.valueType;\n\n let val1 = param1 as Value;\n\n let paramCount = parametersOfSingleType.length;\n\n if (paramCount == 2 || paramCount == 1) {\n if (this._operationFuncs === null)\n return throwNullException(\"NativeFunctionCall._operationFuncs\");\n let opForTypeObj = this._operationFuncs.get(valType);\n if (!opForTypeObj) {\n const key = ValueType[valType];\n throw new StoryException(\n \"Cannot perform operation \" + this.name + \" on \" + key\n );\n }\n\n if (paramCount == 2) {\n let param2 = asOrThrows(parametersOfSingleType[1], Value);\n\n let val2 = param2 as Value;\n\n let opForType = opForTypeObj as BinaryOp;\n\n if (val1.value === null || val2.value === null)\n return throwNullException(\"NativeFunctionCall.Call BinaryOp values\");\n let resultVal = opForType(val1.value, val2.value);\n\n return Value.Create(resultVal);\n } else {\n let opForType = opForTypeObj as UnaryOp;\n\n if (val1.value === null)\n return throwNullException(\"NativeFunctionCall.Call UnaryOp value\");\n let resultVal = opForType(val1.value);\n\n // This code is different from upstream. Since JavaScript treats\n // integers and floats as the same numbers, it's impossible\n // to force an number to be either an integer or a float.\n //\n // It can be useful to force a specific number type\n // (especially for divisions), so the result of INT() & FLOAT()\n // is coerced to the the proper value type.\n //\n // Note that we also force all other unary operation to\n // return the same value type, although this is only\n // meaningful for numbers. See `Value.Create`.\n if (this.name === NativeFunctionCall.Int) {\n return Value.Create(resultVal, ValueType.Int);\n } else if (this.name === NativeFunctionCall.Float) {\n return Value.Create(resultVal, ValueType.Float);\n } else {\n return Value.Create(resultVal, param1.valueType);\n }\n }\n } else {\n throw new Error(\n \"Unexpected number of parameters to NativeFunctionCall: \" +\n parametersOfSingleType.length\n );\n }\n }\n\n public CallBinaryListOperation(parameters: InkObject[]) {\n if (\n (this.name == \"+\" || this.name == \"-\") &&\n parameters[0] instanceof ListValue &&\n parameters[1] instanceof IntValue\n )\n return this.CallListIncrementOperation(parameters);\n\n let v1 = asOrThrows(parameters[0], Value);\n let v2 = asOrThrows(parameters[1], Value);\n\n if (\n (this.name == \"&&\" || this.name == \"||\") &&\n (v1.valueType != ValueType.List || v2.valueType != ValueType.List)\n ) {\n if (this._operationFuncs === null)\n return throwNullException(\"NativeFunctionCall._operationFuncs\");\n let op = this._operationFuncs.get(ValueType.Int) as BinaryOp;\n if (op === null)\n return throwNullException(\n \"NativeFunctionCall.CallBinaryListOperation op\"\n );\n let result = asBooleanOrThrows(\n op(v1.isTruthy ? 1 : 0, v2.isTruthy ? 1 : 0)\n );\n return new BoolValue(result);\n }\n\n if (v1.valueType == ValueType.List && v2.valueType == ValueType.List)\n return this.CallType([v1, v2]);\n\n throw new StoryException(\n \"Can not call use \" +\n this.name +\n \" operation on \" +\n ValueType[v1.valueType] +\n \" and \" +\n ValueType[v2.valueType]\n );\n }\n\n public CallListIncrementOperation(listIntParams: InkObject[]) {\n let listVal = asOrThrows(listIntParams[0], ListValue);\n let intVal = asOrThrows(listIntParams[1], IntValue);\n\n let resultInkList = new InkList();\n\n if (listVal.value === null)\n return throwNullException(\n \"NativeFunctionCall.CallListIncrementOperation listVal.value\"\n );\n for (let [listItemKey, listItemValue] of listVal.value) {\n let listItem = InkListItem.fromSerializedKey(listItemKey);\n\n if (this._operationFuncs === null)\n return throwNullException(\"NativeFunctionCall._operationFuncs\");\n let intOp = this._operationFuncs.get(ValueType.Int) as BinaryOp;\n\n if (intVal.value === null)\n return throwNullException(\n \"NativeFunctionCall.CallListIncrementOperation intVal.value\"\n );\n let targetInt = intOp(listItemValue, intVal.value);\n\n let itemOrigin = null;\n if (listVal.value.origins === null)\n return throwNullException(\n \"NativeFunctionCall.CallListIncrementOperation listVal.value.origins\"\n );\n for (let origin of listVal.value.origins) {\n if (origin.name == listItem.originName) {\n itemOrigin = origin;\n break;\n }\n }\n if (itemOrigin != null) {\n let incrementedItem = itemOrigin.TryGetItemWithValue(\n targetInt,\n InkListItem.Null\n );\n if (incrementedItem.exists)\n resultInkList.Add(incrementedItem.result, targetInt);\n }\n }\n\n return new ListValue(resultInkList);\n }\n\n public CoerceValuesToSingleType(parametersIn: InkObject[]) {\n let valType = ValueType.Int;\n\n let specialCaseList: null | ListValue = null;\n\n for (let obj of parametersIn) {\n let val = asOrThrows(obj, Value);\n if (val.valueType > valType) {\n valType = val.valueType;\n }\n\n if (val.valueType == ValueType.List) {\n specialCaseList = asOrNull(val, ListValue);\n }\n }\n\n let parametersOut = [];\n\n if (ValueType[valType] == ValueType[ValueType.List]) {\n for (let inkObjectVal of parametersIn) {\n let val = asOrThrows(inkObjectVal, Value);\n if (val.valueType == ValueType.List) {\n parametersOut.push(val);\n } else if (val.valueType == ValueType.Int) {\n let intVal = parseInt(val.valueObject);\n\n specialCaseList = asOrThrows(specialCaseList, ListValue);\n if (specialCaseList.value === null)\n return throwNullException(\n \"NativeFunctionCall.CoerceValuesToSingleType specialCaseList.value\"\n );\n let list = specialCaseList.value.originOfMaxItem;\n\n if (list === null)\n return throwNullException(\n \"NativeFunctionCall.CoerceValuesToSingleType list\"\n );\n let item = list.TryGetItemWithValue(intVal, InkListItem.Null);\n if (item.exists) {\n let castedValue = new ListValue(item.result, intVal);\n parametersOut.push(castedValue);\n } else\n throw new StoryException(\n \"Could not find List item with the value \" +\n intVal +\n \" in \" +\n list.name\n );\n } else {\n const key = ValueType[val.valueType];\n throw new StoryException(\n \"Cannot mix Lists and \" + key + \" values in this operation\"\n );\n }\n }\n } else {\n for (let inkObjectVal of parametersIn) {\n let val = asOrThrows(inkObjectVal, Value);\n let castedValue = val.Cast(valType);\n parametersOut.push(castedValue);\n }\n }\n\n return parametersOut;\n }\n\n constructor(name: string);\n constructor(name: string, numberOfParameters: number);\n constructor();\n constructor() {\n super();\n\n if (arguments.length === 0) {\n NativeFunctionCall.GenerateNativeFunctionsIfNecessary();\n } else if (arguments.length === 1) {\n let name = arguments[0];\n NativeFunctionCall.GenerateNativeFunctionsIfNecessary();\n this.name = name;\n } else if (arguments.length === 2) {\n let name = arguments[0];\n let numberOfParameters = arguments[1];\n\n this._isPrototype = true;\n this.name = name;\n this.numberOfParameters = numberOfParameters;\n }\n }\n\n public static Identity(t: T): any {\n return t;\n }\n\n public static GenerateNativeFunctionsIfNecessary() {\n if (this._nativeFunctions == null) {\n this._nativeFunctions = new Map();\n\n // Int operations\n this.AddIntBinaryOp(this.Add, (x, y) => x + y);\n this.AddIntBinaryOp(this.Subtract, (x, y) => x - y);\n this.AddIntBinaryOp(this.Multiply, (x, y) => x * y);\n this.AddIntBinaryOp(this.Divide, (x, y) => Math.floor(x / y));\n this.AddIntBinaryOp(this.Mod, (x, y) => x % y);\n this.AddIntUnaryOp(this.Negate, (x) => -x);\n\n this.AddIntBinaryOp(this.Equal, (x, y) => x == y);\n this.AddIntBinaryOp(this.Greater, (x, y) => x > y);\n this.AddIntBinaryOp(this.Less, (x, y) => x < y);\n this.AddIntBinaryOp(this.GreaterThanOrEquals, (x, y) => x >= y);\n this.AddIntBinaryOp(this.LessThanOrEquals, (x, y) => x <= y);\n this.AddIntBinaryOp(this.NotEquals, (x, y) => x != y);\n this.AddIntUnaryOp(this.Not, (x) => x == 0);\n\n this.AddIntBinaryOp(this.And, (x, y) => x != 0 && y != 0);\n this.AddIntBinaryOp(this.Or, (x, y) => x != 0 || y != 0);\n\n this.AddIntBinaryOp(this.Max, (x, y) => Math.max(x, y));\n this.AddIntBinaryOp(this.Min, (x, y) => Math.min(x, y));\n\n this.AddIntBinaryOp(this.Pow, (x, y) => Math.pow(x, y));\n this.AddIntUnaryOp(this.Floor, NativeFunctionCall.Identity);\n this.AddIntUnaryOp(this.Ceiling, NativeFunctionCall.Identity);\n this.AddIntUnaryOp(this.Int, NativeFunctionCall.Identity);\n this.AddIntUnaryOp(this.Float, (x) => x);\n\n // Float operations\n this.AddFloatBinaryOp(this.Add, (x, y) => x + y);\n this.AddFloatBinaryOp(this.Subtract, (x, y) => x - y);\n this.AddFloatBinaryOp(this.Multiply, (x, y) => x * y);\n this.AddFloatBinaryOp(this.Divide, (x, y) => x / y);\n this.AddFloatBinaryOp(this.Mod, (x, y) => x % y);\n this.AddFloatUnaryOp(this.Negate, (x) => -x);\n\n this.AddFloatBinaryOp(this.Equal, (x, y) => x == y);\n this.AddFloatBinaryOp(this.Greater, (x, y) => x > y);\n this.AddFloatBinaryOp(this.Less, (x, y) => x < y);\n this.AddFloatBinaryOp(this.GreaterThanOrEquals, (x, y) => x >= y);\n this.AddFloatBinaryOp(this.LessThanOrEquals, (x, y) => x <= y);\n this.AddFloatBinaryOp(this.NotEquals, (x, y) => x != y);\n this.AddFloatUnaryOp(this.Not, (x) => x == 0.0);\n\n this.AddFloatBinaryOp(this.And, (x, y) => x != 0.0 && y != 0.0);\n this.AddFloatBinaryOp(this.Or, (x, y) => x != 0.0 || y != 0.0);\n\n this.AddFloatBinaryOp(this.Max, (x, y) => Math.max(x, y));\n this.AddFloatBinaryOp(this.Min, (x, y) => Math.min(x, y));\n\n this.AddFloatBinaryOp(this.Pow, (x, y) => Math.pow(x, y));\n this.AddFloatUnaryOp(this.Floor, (x) => Math.floor(x));\n this.AddFloatUnaryOp(this.Ceiling, (x) => Math.ceil(x));\n this.AddFloatUnaryOp(this.Int, (x) => Math.floor(x));\n this.AddFloatUnaryOp(this.Float, NativeFunctionCall.Identity);\n\n // String operations\n this.AddStringBinaryOp(this.Add, (x, y) => x + y); // concat\n this.AddStringBinaryOp(this.Equal, (x, y) => x === y);\n this.AddStringBinaryOp(this.NotEquals, (x, y) => !(x === y));\n this.AddStringBinaryOp(this.Has, (x, y) => x.includes(y));\n this.AddStringBinaryOp(this.Hasnt, (x, y) => !x.includes(y));\n\n this.AddListBinaryOp(this.Add, (x, y) => x.Union(y));\n this.AddListBinaryOp(this.Subtract, (x, y) => x.Without(y));\n this.AddListBinaryOp(this.Has, (x, y) => x.Contains(y));\n this.AddListBinaryOp(this.Hasnt, (x, y) => !x.Contains(y));\n this.AddListBinaryOp(this.Intersect, (x, y) => x.Intersect(y));\n\n this.AddListBinaryOp(this.Equal, (x, y) => x.Equals(y));\n this.AddListBinaryOp(this.Greater, (x, y) => x.GreaterThan(y));\n this.AddListBinaryOp(this.Less, (x, y) => x.LessThan(y));\n this.AddListBinaryOp(this.GreaterThanOrEquals, (x, y) =>\n x.GreaterThanOrEquals(y)\n );\n this.AddListBinaryOp(this.LessThanOrEquals, (x, y) =>\n x.LessThanOrEquals(y)\n );\n this.AddListBinaryOp(this.NotEquals, (x, y) => !x.Equals(y));\n\n this.AddListBinaryOp(this.And, (x, y) => x.Count > 0 && y.Count > 0);\n this.AddListBinaryOp(this.Or, (x, y) => x.Count > 0 || y.Count > 0);\n\n this.AddListUnaryOp(this.Not, (x) => (x.Count == 0 ? 1 : 0));\n\n this.AddListUnaryOp(this.Invert, (x) => x.inverse);\n this.AddListUnaryOp(this.All, (x) => x.all);\n this.AddListUnaryOp(this.ListMin, (x) => x.MinAsList());\n this.AddListUnaryOp(this.ListMax, (x) => x.MaxAsList());\n this.AddListUnaryOp(this.Count, (x) => x.Count);\n this.AddListUnaryOp(this.ValueOfList, (x) => x.maxItem.Value);\n\n let divertTargetsEqual = (d1: Path, d2: Path) => d1.Equals(d2);\n let divertTargetsNotEqual = (d1: Path, d2: Path) => !d1.Equals(d2);\n this.AddOpToNativeFunc(\n this.Equal,\n 2,\n ValueType.DivertTarget,\n divertTargetsEqual\n );\n this.AddOpToNativeFunc(\n this.NotEquals,\n 2,\n ValueType.DivertTarget,\n divertTargetsNotEqual\n );\n }\n }\n\n public AddOpFuncForType(\n valType: ValueType,\n op: UnaryOp | BinaryOp\n ): void {\n if (this._operationFuncs == null) {\n this._operationFuncs = new Map();\n }\n\n this._operationFuncs.set(valType, op);\n }\n\n public static AddOpToNativeFunc(\n name: string,\n args: number,\n valType: ValueType,\n op: UnaryOp | BinaryOp\n ): void {\n if (this._nativeFunctions === null)\n return throwNullException(\"NativeFunctionCall._nativeFunctions\");\n let nativeFunc = this._nativeFunctions.get(name);\n if (!nativeFunc) {\n nativeFunc = new NativeFunctionCall(name, args);\n this._nativeFunctions.set(name, nativeFunc);\n }\n\n nativeFunc.AddOpFuncForType(valType, op);\n }\n\n public static AddIntBinaryOp(name: string, op: BinaryOp) {\n this.AddOpToNativeFunc(name, 2, ValueType.Int, op);\n }\n public static AddIntUnaryOp(name: string, op: UnaryOp) {\n this.AddOpToNativeFunc(name, 1, ValueType.Int, op);\n }\n\n public static AddFloatBinaryOp(name: string, op: BinaryOp) {\n this.AddOpToNativeFunc(name, 2, ValueType.Float, op);\n }\n public static AddFloatUnaryOp(name: string, op: UnaryOp) {\n this.AddOpToNativeFunc(name, 1, ValueType.Float, op);\n }\n\n public static AddStringBinaryOp(name: string, op: BinaryOp) {\n this.AddOpToNativeFunc(name, 2, ValueType.String, op);\n }\n\n public static AddListBinaryOp(name: string, op: BinaryOp) {\n this.AddOpToNativeFunc(name, 2, ValueType.List, op);\n }\n public static AddListUnaryOp(name: string, op: UnaryOp) {\n this.AddOpToNativeFunc(name, 1, ValueType.List, op);\n }\n\n public toString() {\n return 'Native \"' + this.name + '\"';\n }\n\n public _prototype: NativeFunctionCall | null = null;\n public _isPrototype: boolean = false;\n public _operationFuncs: Map | UnaryOp> | null =\n null;\n public static _nativeFunctions: Map | null = null;\n}\n","import { InkObject } from \"./Object\";\n\n// New version of tags is dynamic - it constructs the tags\n// at runtime based on BeginTag and EndTag control commands.\n// Plain text that's in the output stream is turned into tags\n// when you do story.currentTags.\n// The only place this is used is when flattening tags down\n// to string in advance, during dynamic string generation if\n// there's a tag embedded in it. See how ControlCommand.EndString\n// is implemented in Story.cs for more details + comment\nexport class Tag extends InkObject {\n public readonly text: string;\n\n constructor(tagText: string) {\n super();\n this.text = tagText.toString() || \"\";\n }\n\n public toString(): string {\n return \"# \" + this.text;\n }\n}\n","import { Path } from \"./Path\";\nimport { CallStack } from \"./CallStack\";\nimport { throwNullException } from \"./NullException\";\nimport { InkObject } from \"./Object\";\n\nexport class Choice extends InkObject {\n public text: string = \"\";\n public index: number = 0;\n public threadAtGeneration: CallStack.Thread | null = null;\n public sourcePath: string = \"\";\n public targetPath: Path | null = null;\n public isInvisibleDefault: boolean = false;\n public tags: string[] | null = null;\n public originalThreadIndex: number = 0;\n\n get pathStringOnChoice(): string {\n if (this.targetPath === null)\n return throwNullException(\"Choice.targetPath\");\n return this.targetPath.toString();\n }\n set pathStringOnChoice(value: string) {\n this.targetPath = new Path(value);\n }\n}\n","import { InkListItem, SerializedInkListItem } from \"./InkList\";\nimport { TryGetResult } from \"./TryGetResult\";\n\nexport class ListDefinition {\n public _name: string;\n public _items: Map | null;\n public _itemNameToValues: Map;\n\n constructor(name: string, items: Map | null) {\n this._name = name || \"\";\n this._items = null;\n this._itemNameToValues = items || new Map();\n }\n get name() {\n return this._name;\n }\n get items() {\n if (this._items == null) {\n this._items = new Map();\n for (let [key, value] of this._itemNameToValues) {\n let item = new InkListItem(this.name, key);\n this._items.set(item.serialized(), value);\n }\n }\n\n return this._items;\n }\n\n public ValueForItem(item: InkListItem) {\n if (!item.itemName) return 0;\n\n let intVal = this._itemNameToValues.get(item.itemName);\n if (typeof intVal !== \"undefined\") return intVal;\n else return 0;\n }\n public ContainsItem(item: InkListItem) {\n if (!item.itemName) return false;\n if (item.originName != this.name) return false;\n\n return this._itemNameToValues.has(item.itemName);\n }\n public ContainsItemWithName(itemName: string) {\n return this._itemNameToValues.has(itemName);\n }\n public TryGetItemWithValue(\n val: number,\n /* out */ item: InkListItem\n ): TryGetResult {\n for (let [key, value] of this._itemNameToValues) {\n if (value == val) {\n item = new InkListItem(this.name, key);\n return { result: item, exists: true };\n }\n }\n\n item = InkListItem.Null;\n return { result: item, exists: false };\n }\n public TryGetValueForItem(\n item: InkListItem,\n /* out */ intVal: number\n ): TryGetResult {\n if (!item.itemName) return { result: 0, exists: false };\n let value = this._itemNameToValues.get(item.itemName);\n\n if (!value) return { result: 0, exists: false };\n return { result: value, exists: true };\n }\n}\n","import { InkListItem } from \"./InkList\";\nimport { ListValue } from \"./Value\";\nimport { ListDefinition } from \"./ListDefinition\";\nimport { TryGetResult } from \"./TryGetResult\";\nimport { throwNullException } from \"./NullException\";\n\nexport class ListDefinitionsOrigin {\n protected _lists: Map;\n protected _allUnambiguousListValueCache: Map;\n\n constructor(lists: ListDefinition[]) {\n this._lists = new Map();\n this._allUnambiguousListValueCache = new Map();\n\n for (let list of lists) {\n this._lists.set(list.name, list);\n\n for (let [key, val] of list.items) {\n let item = InkListItem.fromSerializedKey(key);\n let listValue = new ListValue(item, val);\n\n if (!item.itemName) {\n throw new Error(\"item.itemName is null or undefined.\");\n }\n\n this._allUnambiguousListValueCache.set(item.itemName, listValue);\n this._allUnambiguousListValueCache.set(item.fullName, listValue);\n }\n }\n }\n get lists(): ListDefinition[] {\n let listOfLists: ListDefinition[] = [];\n\n for (let [, value] of this._lists) {\n listOfLists.push(value);\n }\n\n return listOfLists;\n }\n public TryListGetDefinition(\n name: string | null,\n /* out */ def: ListDefinition | null\n ): TryGetResult {\n if (name === null) {\n return { result: def, exists: false };\n }\n // initially, this function returns a boolean and the second parameter is an out.\n let definition = this._lists.get(name);\n if (!definition) return { result: def, exists: false };\n\n return { result: definition, exists: true };\n }\n public FindSingleItemListWithName(name: string | null) {\n if (name === null) {\n return throwNullException(\"name\");\n }\n let val = this._allUnambiguousListValueCache.get(name);\n\n if (typeof val !== \"undefined\") {\n return val;\n }\n\n return null;\n }\n}\n","import { Container } from \"./Container\";\nimport {\n Value,\n IntValue,\n FloatValue,\n StringValue,\n DivertTargetValue,\n VariablePointerValue,\n ListValue,\n BoolValue,\n} from \"./Value\";\nimport { Glue } from \"./Glue\";\nimport { ControlCommand } from \"./ControlCommand\";\nimport { PushPopType } from \"./PushPop\";\nimport { Divert } from \"./Divert\";\nimport { ChoicePoint } from \"./ChoicePoint\";\nimport { VariableReference } from \"./VariableReference\";\nimport { VariableAssignment } from \"./VariableAssignment\";\nimport { NativeFunctionCall } from \"./NativeFunctionCall\";\nimport { Void } from \"./Void\";\nimport { Tag } from \"./Tag\";\nimport { Path } from \"./Path\";\nimport { Choice } from \"./Choice\";\nimport { ListDefinition } from \"./ListDefinition\";\nimport { ListDefinitionsOrigin } from \"./ListDefinitionsOrigin\";\nimport { InkListItem, InkList } from \"./InkList\";\nimport { InkObject } from \"./Object\";\nimport { asOrNull } from \"./TypeAssertion\";\nimport { throwNullException } from \"./NullException\";\nimport { SimpleJson } from \"./SimpleJson\";\n\nexport class JsonSerialisation {\n public static JArrayToRuntimeObjList(\n jArray: any[],\n skipLast: boolean = false\n ) {\n let count = jArray.length;\n if (skipLast) count--;\n\n let list: InkObject[] = [];\n\n for (let i = 0; i < count; i++) {\n let jTok = jArray[i];\n let runtimeObj = this.JTokenToRuntimeObject(jTok);\n if (runtimeObj === null) {\n return throwNullException(\"runtimeObj\");\n }\n list.push(runtimeObj);\n }\n\n return list;\n }\n\n public static WriteDictionaryRuntimeObjs(\n writer: SimpleJson.Writer,\n dictionary: Map\n ) {\n writer.WriteObjectStart();\n for (let [key, value] of dictionary) {\n writer.WritePropertyStart(key);\n this.WriteRuntimeObject(writer, value);\n writer.WritePropertyEnd();\n }\n writer.WriteObjectEnd();\n }\n\n public static WriteListRuntimeObjs(\n writer: SimpleJson.Writer,\n list: InkObject[]\n ) {\n writer.WriteArrayStart();\n for (let value of list) {\n this.WriteRuntimeObject(writer, value);\n }\n writer.WriteArrayEnd();\n }\n\n public static WriteIntDictionary(\n writer: SimpleJson.Writer,\n dict: Map\n ) {\n writer.WriteObjectStart();\n for (let [key, value] of dict) {\n writer.WriteIntProperty(key, value);\n }\n writer.WriteObjectEnd();\n }\n\n public static WriteRuntimeObject(\n writer: SimpleJson.Writer,\n obj: InkObject\n ): void {\n let container = asOrNull(obj, Container);\n if (container) {\n this.WriteRuntimeContainer(writer, container);\n return;\n }\n\n let divert = asOrNull(obj, Divert);\n if (divert) {\n let divTypeKey = \"->\";\n if (divert.isExternal) {\n divTypeKey = \"x()\";\n } else if (divert.pushesToStack) {\n if (divert.stackPushType == PushPopType.Function) {\n divTypeKey = \"f()\";\n } else if (divert.stackPushType == PushPopType.Tunnel) {\n divTypeKey = \"->t->\";\n }\n }\n\n let targetStr;\n if (divert.hasVariableTarget) {\n targetStr = divert.variableDivertName;\n } else {\n targetStr = divert.targetPathString;\n }\n\n writer.WriteObjectStart();\n writer.WriteProperty(divTypeKey, targetStr);\n\n if (divert.hasVariableTarget) {\n writer.WriteProperty(\"var\", true);\n }\n\n if (divert.isConditional) {\n writer.WriteProperty(\"c\", true);\n }\n\n if (divert.externalArgs > 0) {\n writer.WriteIntProperty(\"exArgs\", divert.externalArgs);\n }\n\n writer.WriteObjectEnd();\n return;\n }\n\n let choicePoint = asOrNull(obj, ChoicePoint);\n if (choicePoint) {\n writer.WriteObjectStart();\n writer.WriteProperty(\"*\", choicePoint.pathStringOnChoice);\n writer.WriteIntProperty(\"flg\", choicePoint.flags);\n writer.WriteObjectEnd();\n return;\n }\n\n let boolVal = asOrNull(obj, BoolValue);\n if (boolVal) {\n writer.WriteBool(boolVal.value);\n return;\n }\n\n let intVal = asOrNull(obj, IntValue);\n if (intVal) {\n writer.WriteInt(intVal.value);\n return;\n }\n\n let floatVal = asOrNull(obj, FloatValue);\n if (floatVal) {\n writer.WriteFloat(floatVal.value);\n return;\n }\n\n let strVal = asOrNull(obj, StringValue);\n if (strVal) {\n if (strVal.isNewline) {\n writer.Write(\"\\n\", false);\n } else {\n writer.WriteStringStart();\n writer.WriteStringInner(\"^\");\n writer.WriteStringInner(strVal.value);\n writer.WriteStringEnd();\n }\n return;\n }\n\n let listVal = asOrNull(obj, ListValue);\n if (listVal) {\n this.WriteInkList(writer, listVal);\n return;\n }\n\n let divTargetVal = asOrNull(obj, DivertTargetValue);\n if (divTargetVal) {\n writer.WriteObjectStart();\n if (divTargetVal.value === null) {\n return throwNullException(\"divTargetVal.value\");\n }\n writer.WriteProperty(\"^->\", divTargetVal.value.componentsString);\n writer.WriteObjectEnd();\n\n return;\n }\n\n let varPtrVal = asOrNull(obj, VariablePointerValue);\n if (varPtrVal) {\n writer.WriteObjectStart();\n writer.WriteProperty(\"^var\", varPtrVal.value);\n writer.WriteIntProperty(\"ci\", varPtrVal.contextIndex);\n writer.WriteObjectEnd();\n return;\n }\n\n let glue = asOrNull(obj, Glue);\n if (glue) {\n writer.Write(\"<>\");\n return;\n }\n\n let controlCmd = asOrNull(obj, ControlCommand);\n if (controlCmd) {\n writer.Write(\n JsonSerialisation._controlCommandNames[controlCmd.commandType]\n );\n return;\n }\n\n let nativeFunc = asOrNull(obj, NativeFunctionCall);\n if (nativeFunc) {\n let name = nativeFunc.name;\n\n if (name == \"^\") name = \"L^\";\n\n writer.Write(name);\n return;\n }\n\n let varRef = asOrNull(obj, VariableReference);\n if (varRef) {\n writer.WriteObjectStart();\n let readCountPath = varRef.pathStringForCount;\n if (readCountPath != null) {\n writer.WriteProperty(\"CNT?\", readCountPath);\n } else {\n writer.WriteProperty(\"VAR?\", varRef.name);\n }\n\n writer.WriteObjectEnd();\n return;\n }\n\n let varAss = asOrNull(obj, VariableAssignment);\n if (varAss) {\n writer.WriteObjectStart();\n\n let key = varAss.isGlobal ? \"VAR=\" : \"temp=\";\n writer.WriteProperty(key, varAss.variableName);\n\n // Reassignment?\n if (!varAss.isNewDeclaration) writer.WriteProperty(\"re\", true);\n\n writer.WriteObjectEnd();\n\n return;\n }\n\n let voidObj = asOrNull(obj, Void);\n if (voidObj) {\n writer.Write(\"void\");\n return;\n }\n\n let tag = asOrNull(obj, Tag);\n if (tag) {\n writer.WriteObjectStart();\n writer.WriteProperty(\"#\", tag.text);\n writer.WriteObjectEnd();\n return;\n }\n\n let choice = asOrNull(obj, Choice);\n if (choice) {\n this.WriteChoice(writer, choice);\n return;\n }\n\n throw new Error(\"Failed to convert runtime object to Json token: \" + obj);\n }\n\n public static JObjectToDictionaryRuntimeObjs(jObject: Record) {\n let dict: Map = new Map();\n\n for (let key in jObject) {\n if (jObject.hasOwnProperty(key)) {\n let inkObject = this.JTokenToRuntimeObject(jObject[key]);\n if (inkObject === null) {\n return throwNullException(\"inkObject\");\n }\n dict.set(key, inkObject);\n }\n }\n\n return dict;\n }\n\n public static JObjectToIntDictionary(jObject: Record) {\n let dict: Map = new Map();\n for (let key in jObject) {\n if (jObject.hasOwnProperty(key)) {\n dict.set(key, parseInt(jObject[key]));\n }\n }\n return dict;\n }\n\n public static JTokenToRuntimeObject(token: any): InkObject | null {\n if (\n (typeof token === \"number\" && !isNaN(token)) ||\n typeof token === \"boolean\"\n ) {\n return Value.Create(token);\n }\n\n if (typeof token === \"string\") {\n let str = token.toString();\n\n // String value\n let firstChar = str[0];\n if (firstChar == \"^\") return new StringValue(str.substring(1));\n else if (firstChar == \"\\n\" && str.length == 1)\n return new StringValue(\"\\n\");\n\n // Glue\n if (str == \"<>\") return new Glue();\n\n // Control commands (would looking up in a hash set be faster?)\n for (let i = 0; i < JsonSerialisation._controlCommandNames.length; ++i) {\n let cmdName = JsonSerialisation._controlCommandNames[i];\n if (str == cmdName) {\n return new ControlCommand(i);\n }\n }\n\n // Native functions\n if (str == \"L^\") str = \"^\";\n if (NativeFunctionCall.CallExistsWithName(str))\n return NativeFunctionCall.CallWithName(str);\n\n // Pop\n if (str == \"->->\") return ControlCommand.PopTunnel();\n else if (str == \"~ret\") return ControlCommand.PopFunction();\n\n // Void\n if (str == \"void\") return new Void();\n }\n\n if (typeof token === \"object\" && !Array.isArray(token)) {\n let obj = token as Record;\n let propValue;\n\n // Divert target value to path\n if (obj[\"^->\"]) {\n propValue = obj[\"^->\"];\n return new DivertTargetValue(new Path(propValue.toString()));\n }\n\n // VariablePointerValue\n if (obj[\"^var\"]) {\n propValue = obj[\"^var\"];\n let varPtr = new VariablePointerValue(propValue.toString());\n if (\"ci\" in obj) {\n propValue = obj[\"ci\"];\n varPtr.contextIndex = parseInt(propValue);\n }\n return varPtr;\n }\n\n // Divert\n let isDivert = false;\n let pushesToStack = false;\n let divPushType = PushPopType.Function;\n let external = false;\n if ((propValue = obj[\"->\"])) {\n isDivert = true;\n } else if ((propValue = obj[\"f()\"])) {\n isDivert = true;\n pushesToStack = true;\n divPushType = PushPopType.Function;\n } else if ((propValue = obj[\"->t->\"])) {\n isDivert = true;\n pushesToStack = true;\n divPushType = PushPopType.Tunnel;\n } else if ((propValue = obj[\"x()\"])) {\n isDivert = true;\n external = true;\n pushesToStack = false;\n divPushType = PushPopType.Function;\n }\n\n if (isDivert) {\n let divert = new Divert();\n divert.pushesToStack = pushesToStack;\n divert.stackPushType = divPushType;\n divert.isExternal = external;\n\n let target = propValue.toString();\n\n if ((propValue = obj[\"var\"])) divert.variableDivertName = target;\n else divert.targetPathString = target;\n\n divert.isConditional = !!obj[\"c\"];\n\n if (external) {\n if ((propValue = obj[\"exArgs\"]))\n divert.externalArgs = parseInt(propValue);\n }\n\n return divert;\n }\n\n // Choice\n if ((propValue = obj[\"*\"])) {\n let choice = new ChoicePoint();\n choice.pathStringOnChoice = propValue.toString();\n\n if ((propValue = obj[\"flg\"])) choice.flags = parseInt(propValue);\n\n return choice;\n }\n\n // Variable reference\n if ((propValue = obj[\"VAR?\"])) {\n return new VariableReference(propValue.toString());\n } else if ((propValue = obj[\"CNT?\"])) {\n let readCountVarRef = new VariableReference();\n readCountVarRef.pathStringForCount = propValue.toString();\n return readCountVarRef;\n }\n\n // Variable assignment\n let isVarAss = false;\n let isGlobalVar = false;\n if ((propValue = obj[\"VAR=\"])) {\n isVarAss = true;\n isGlobalVar = true;\n } else if ((propValue = obj[\"temp=\"])) {\n isVarAss = true;\n isGlobalVar = false;\n }\n if (isVarAss) {\n let varName = propValue.toString();\n let isNewDecl = !obj[\"re\"];\n let varAss = new VariableAssignment(varName, isNewDecl);\n varAss.isGlobal = isGlobalVar;\n return varAss;\n }\n if (obj[\"#\"] !== undefined) {\n propValue = obj[\"#\"];\n return new Tag(propValue.toString());\n }\n\n // List value\n if ((propValue = obj[\"list\"])) {\n // var listContent = (Dictionary)propValue;\n let listContent = propValue as Record;\n let rawList = new InkList();\n if ((propValue = obj[\"origins\"])) {\n // var namesAsObjs = (List)propValue;\n let namesAsObjs = propValue as string[];\n // rawList.SetInitialOriginNames(namesAsObjs.Cast().ToList());\n rawList.SetInitialOriginNames(namesAsObjs);\n }\n\n for (let key in listContent) {\n if (listContent.hasOwnProperty(key)) {\n let nameToVal = listContent[key];\n let item = new InkListItem(key);\n let val = parseInt(nameToVal);\n rawList.Add(item, val);\n }\n }\n\n return new ListValue(rawList);\n }\n\n if (obj[\"originalChoicePath\"] != null) return this.JObjectToChoice(obj);\n }\n\n // Array is always a Runtime.Container\n if (Array.isArray(token)) {\n return this.JArrayToContainer(token);\n }\n\n if (token === null || token === undefined) return null;\n\n throw new Error(\n \"Failed to convert token to runtime object: \" +\n this.toJson(token, [\"parent\"])\n );\n }\n\n public static toJson(\n me: T,\n removes?: (keyof T)[],\n space?: number\n ): string {\n return JSON.stringify(\n me,\n (k, v) => (removes?.some((r) => r === k) ? undefined : v),\n space\n );\n }\n\n public static WriteRuntimeContainer(\n writer: SimpleJson.Writer,\n container: Container | null,\n withoutName: boolean = false\n ) {\n writer.WriteArrayStart();\n if (container === null) {\n return throwNullException(\"container\");\n }\n for (let c of container.content) this.WriteRuntimeObject(writer, c);\n\n let namedOnlyContent = container.namedOnlyContent;\n let countFlags = container.countFlags;\n let hasNameProperty = container.name != null && !withoutName;\n\n let hasTerminator =\n namedOnlyContent != null || countFlags > 0 || hasNameProperty;\n if (hasTerminator) {\n writer.WriteObjectStart();\n }\n\n if (namedOnlyContent != null) {\n for (let [key, value] of namedOnlyContent) {\n let name = key;\n let namedContainer = asOrNull(value, Container);\n writer.WritePropertyStart(name);\n this.WriteRuntimeContainer(writer, namedContainer, true);\n writer.WritePropertyEnd();\n }\n }\n\n if (countFlags > 0) writer.WriteIntProperty(\"#f\", countFlags);\n\n if (hasNameProperty) writer.WriteProperty(\"#n\", container.name);\n\n if (hasTerminator) writer.WriteObjectEnd();\n else writer.WriteNull();\n\n writer.WriteArrayEnd();\n }\n\n public static JArrayToContainer(jArray: any[]) {\n let container = new Container();\n container.content = this.JArrayToRuntimeObjList(jArray, true);\n\n let terminatingObj = jArray[jArray.length - 1] as Record;\n if (terminatingObj != null) {\n let namedOnlyContent = new Map();\n\n for (let key in terminatingObj) {\n if (key == \"#f\") {\n container.countFlags = parseInt(terminatingObj[key]);\n } else if (key == \"#n\") {\n container.name = terminatingObj[key].toString();\n } else {\n let namedContentItem = this.JTokenToRuntimeObject(\n terminatingObj[key]\n );\n // var namedSubContainer = namedContentItem as Container;\n let namedSubContainer = asOrNull(namedContentItem, Container);\n if (namedSubContainer) namedSubContainer.name = key;\n namedOnlyContent.set(key, namedContentItem);\n }\n }\n\n container.namedOnlyContent = namedOnlyContent;\n }\n\n return container;\n }\n\n public static JObjectToChoice(jObj: Record) {\n let choice = new Choice();\n choice.text = jObj[\"text\"].toString();\n choice.index = parseInt(jObj[\"index\"]);\n choice.sourcePath = jObj[\"originalChoicePath\"].toString();\n choice.originalThreadIndex = parseInt(jObj[\"originalThreadIndex\"]);\n choice.pathStringOnChoice = jObj[\"targetPath\"].toString();\n if (jObj[\"tags\"]) {\n choice.tags = jObj[\"tags\"];\n }\n return choice;\n }\n\n public static WriteChoice(writer: SimpleJson.Writer, choice: Choice) {\n writer.WriteObjectStart();\n writer.WriteProperty(\"text\", choice.text);\n writer.WriteIntProperty(\"index\", choice.index);\n writer.WriteProperty(\"originalChoicePath\", choice.sourcePath);\n writer.WriteIntProperty(\"originalThreadIndex\", choice.originalThreadIndex);\n writer.WriteProperty(\"targetPath\", choice.pathStringOnChoice);\n if (choice.tags) {\n writer.WriteProperty(\"tags\", (w) => {\n w.WriteArrayStart();\n for (const tag of choice.tags!) {\n w.WriteStringStart();\n w.WriteStringInner(tag);\n w.WriteStringEnd();\n }\n w.WriteArrayEnd();\n });\n }\n writer.WriteObjectEnd();\n }\n\n public static WriteInkList(writer: SimpleJson.Writer, listVal: ListValue) {\n let rawList = listVal.value;\n if (rawList === null) {\n return throwNullException(\"rawList\");\n }\n\n writer.WriteObjectStart();\n writer.WritePropertyStart(\"list\");\n writer.WriteObjectStart();\n\n for (let [key, val] of rawList) {\n let item = InkListItem.fromSerializedKey(key);\n let itemVal = val;\n\n if (item.itemName === null) {\n return throwNullException(\"item.itemName\");\n }\n\n writer.WritePropertyNameStart();\n writer.WritePropertyNameInner(item.originName ? item.originName : \"?\");\n writer.WritePropertyNameInner(\".\");\n writer.WritePropertyNameInner(item.itemName);\n writer.WritePropertyNameEnd();\n\n writer.Write(itemVal);\n\n writer.WritePropertyEnd();\n }\n\n writer.WriteObjectEnd();\n\n writer.WritePropertyEnd();\n\n if (\n rawList.Count == 0 &&\n rawList.originNames != null &&\n rawList.originNames.length > 0\n ) {\n writer.WritePropertyStart(\"origins\");\n writer.WriteArrayStart();\n for (let name of rawList.originNames) writer.Write(name);\n writer.WriteArrayEnd();\n writer.WritePropertyEnd();\n }\n\n writer.WriteObjectEnd();\n }\n\n public static ListDefinitionsToJToken(origin: ListDefinitionsOrigin) {\n let result: Record = {};\n\n for (let def of origin.lists) {\n let listDefJson: Record = {};\n\n for (let [key, val] of def.items) {\n let item = InkListItem.fromSerializedKey(key);\n if (item.itemName === null) {\n return throwNullException(\"item.itemName\");\n }\n listDefJson[item.itemName] = val;\n }\n\n result[def.name] = listDefJson;\n }\n\n return result;\n }\n\n public static JTokenToListDefinitions(obj: Record) {\n // var defsObj = (Dictionary)obj;\n let defsObj = obj;\n\n let allDefs: ListDefinition[] = [];\n\n for (let key in defsObj) {\n if (defsObj.hasOwnProperty(key)) {\n let name = key.toString();\n // var listDefJson = (Dictionary)kv.Value;\n let listDefJson = defsObj[key] as Record;\n\n // Cast (string, object) to (string, int) for items\n let items: Map = new Map();\n\n for (let nameValueKey in listDefJson) {\n if (defsObj.hasOwnProperty(key)) {\n let nameValue = listDefJson[nameValueKey];\n items.set(nameValueKey, parseInt(nameValue));\n }\n }\n\n let def = new ListDefinition(name, items);\n allDefs.push(def);\n }\n }\n\n return new ListDefinitionsOrigin(allDefs);\n }\n\n private static _controlCommandNames = (() => {\n let _controlCommandNames: string[] = [];\n\n _controlCommandNames[ControlCommand.CommandType.EvalStart] = \"ev\";\n _controlCommandNames[ControlCommand.CommandType.EvalOutput] = \"out\";\n _controlCommandNames[ControlCommand.CommandType.EvalEnd] = \"/ev\";\n _controlCommandNames[ControlCommand.CommandType.Duplicate] = \"du\";\n _controlCommandNames[ControlCommand.CommandType.PopEvaluatedValue] = \"pop\";\n _controlCommandNames[ControlCommand.CommandType.PopFunction] = \"~ret\";\n _controlCommandNames[ControlCommand.CommandType.PopTunnel] = \"->->\";\n _controlCommandNames[ControlCommand.CommandType.BeginString] = \"str\";\n _controlCommandNames[ControlCommand.CommandType.EndString] = \"/str\";\n _controlCommandNames[ControlCommand.CommandType.NoOp] = \"nop\";\n _controlCommandNames[ControlCommand.CommandType.ChoiceCount] = \"choiceCnt\";\n _controlCommandNames[ControlCommand.CommandType.Turns] = \"turn\";\n _controlCommandNames[ControlCommand.CommandType.TurnsSince] = \"turns\";\n _controlCommandNames[ControlCommand.CommandType.ReadCount] = \"readc\";\n _controlCommandNames[ControlCommand.CommandType.Random] = \"rnd\";\n _controlCommandNames[ControlCommand.CommandType.SeedRandom] = \"srnd\";\n _controlCommandNames[ControlCommand.CommandType.VisitIndex] = \"visit\";\n _controlCommandNames[ControlCommand.CommandType.SequenceShuffleIndex] =\n \"seq\";\n _controlCommandNames[ControlCommand.CommandType.StartThread] = \"thread\";\n _controlCommandNames[ControlCommand.CommandType.Done] = \"done\";\n _controlCommandNames[ControlCommand.CommandType.End] = \"end\";\n _controlCommandNames[ControlCommand.CommandType.ListFromInt] = \"listInt\";\n _controlCommandNames[ControlCommand.CommandType.ListRange] = \"range\";\n _controlCommandNames[ControlCommand.CommandType.ListRandom] = \"lrnd\";\n _controlCommandNames[ControlCommand.CommandType.BeginTag] = \"#\";\n _controlCommandNames[ControlCommand.CommandType.EndTag] = \"/#\";\n\n for (let i = 0; i < ControlCommand.CommandType.TOTAL_VALUES; ++i) {\n if (_controlCommandNames[i] == null)\n throw new Error(\"Control command not accounted for in serialisation\");\n }\n\n return _controlCommandNames;\n })();\n}\n","import { PushPopType } from \"./PushPop\";\nimport { Path } from \"./Path\";\nimport { Story } from \"./Story\";\nimport { JsonSerialisation } from \"./JsonSerialisation\";\nimport { ListValue } from \"./Value\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { Pointer } from \"./Pointer\";\nimport { InkObject } from \"./Object\";\nimport { Debug } from \"./Debug\";\nimport { tryGetValueFromMap } from \"./TryGetResult\";\nimport { throwNullException } from \"./NullException\";\nimport { SimpleJson } from \"./SimpleJson\";\n\nexport class CallStack {\n get elements() {\n return this.callStack;\n }\n\n get depth() {\n return this.elements.length;\n }\n\n get currentElement() {\n let thread = this._threads[this._threads.length - 1];\n let cs = thread.callstack;\n return cs[cs.length - 1];\n }\n\n get currentElementIndex() {\n return this.callStack.length - 1;\n }\n\n get currentThread(): CallStack.Thread {\n return this._threads[this._threads.length - 1];\n }\n set currentThread(value: CallStack.Thread) {\n Debug.Assert(\n this._threads.length == 1,\n \"Shouldn't be directly setting the current thread when we have a stack of them\"\n );\n\n this._threads.length = 0;\n this._threads.push(value);\n }\n\n get canPop() {\n return this.callStack.length > 1;\n }\n\n constructor(storyContext: Story);\n constructor(toCopy: CallStack);\n constructor() {\n if (arguments[0] instanceof Story) {\n let storyContext = arguments[0] as Story;\n\n this._startOfRoot = Pointer.StartOf(storyContext.rootContentContainer);\n this.Reset();\n } else {\n let toCopy = arguments[0] as CallStack;\n\n this._threads = [];\n for (let otherThread of toCopy._threads) {\n this._threads.push(otherThread.Copy());\n }\n this._threadCounter = toCopy._threadCounter;\n this._startOfRoot = toCopy._startOfRoot.copy();\n }\n }\n\n public Reset() {\n this._threads = [];\n this._threads.push(new CallStack.Thread());\n\n this._threads[0].callstack.push(\n new CallStack.Element(PushPopType.Tunnel, this._startOfRoot)\n );\n }\n\n public SetJsonToken(jObject: Record, storyContext: Story) {\n this._threads.length = 0;\n\n // TODO: (List) jObject [\"threads\"];\n let jThreads: any[] = jObject[\"threads\"];\n\n for (let jThreadTok of jThreads) {\n // TODO: var jThreadObj = (Dictionary)jThreadTok;\n let jThreadObj = jThreadTok;\n let thread = new CallStack.Thread(jThreadObj, storyContext);\n this._threads.push(thread);\n }\n\n // TODO: (int)jObject [\"threadCounter\"];\n this._threadCounter = parseInt(jObject[\"threadCounter\"]);\n this._startOfRoot = Pointer.StartOf(storyContext.rootContentContainer);\n }\n public WriteJson(w: SimpleJson.Writer) {\n w.WriteObject((writer) => {\n writer.WritePropertyStart(\"threads\");\n writer.WriteArrayStart();\n\n for (let thread of this._threads) {\n thread.WriteJson(writer);\n }\n\n writer.WriteArrayEnd();\n writer.WritePropertyEnd();\n\n writer.WritePropertyStart(\"threadCounter\");\n writer.WriteInt(this._threadCounter);\n writer.WritePropertyEnd();\n });\n }\n\n public PushThread() {\n let newThread = this.currentThread.Copy();\n this._threadCounter++;\n newThread.threadIndex = this._threadCounter;\n this._threads.push(newThread);\n }\n\n public ForkThread() {\n let forkedThread = this.currentThread.Copy();\n this._threadCounter++;\n forkedThread.threadIndex = this._threadCounter;\n return forkedThread;\n }\n\n public PopThread() {\n if (this.canPopThread) {\n this._threads.splice(this._threads.indexOf(this.currentThread), 1); // should be equivalent to a pop()\n } else {\n throw new Error(\"Can't pop thread\");\n }\n }\n\n get canPopThread() {\n return this._threads.length > 1 && !this.elementIsEvaluateFromGame;\n }\n\n get elementIsEvaluateFromGame() {\n return this.currentElement.type == PushPopType.FunctionEvaluationFromGame;\n }\n\n public Push(\n type: PushPopType,\n externalEvaluationStackHeight: number = 0,\n outputStreamLengthWithPushed: number = 0\n ) {\n let element = new CallStack.Element(\n type,\n this.currentElement.currentPointer,\n false\n );\n\n element.evaluationStackHeightWhenPushed = externalEvaluationStackHeight;\n element.functionStartInOutputStream = outputStreamLengthWithPushed;\n\n this.callStack.push(element);\n }\n\n public CanPop(type: PushPopType | null = null) {\n if (!this.canPop) return false;\n\n if (type == null) return true;\n\n return this.currentElement.type == type;\n }\n\n public Pop(type: PushPopType | null = null) {\n if (this.CanPop(type)) {\n this.callStack.pop();\n return;\n } else {\n throw new Error(\"Mismatched push/pop in Callstack\");\n }\n }\n\n public GetTemporaryVariableWithName(\n name: string | null,\n contextIndex: number = -1\n ) {\n if (contextIndex == -1) contextIndex = this.currentElementIndex + 1;\n\n let contextElement = this.callStack[contextIndex - 1];\n\n let varValue = tryGetValueFromMap(\n contextElement.temporaryVariables,\n name,\n null\n );\n if (varValue.exists) {\n return varValue.result;\n } else {\n return null;\n }\n }\n\n public SetTemporaryVariable(\n name: string,\n value: any,\n declareNew: boolean,\n contextIndex: number = -1\n ) {\n if (contextIndex == -1) contextIndex = this.currentElementIndex + 1;\n\n let contextElement = this.callStack[contextIndex - 1];\n\n if (!declareNew && !contextElement.temporaryVariables.get(name)) {\n throw new Error(\"Could not find temporary variable to set: \" + name);\n }\n\n let oldValue = tryGetValueFromMap(\n contextElement.temporaryVariables,\n name,\n null\n );\n if (oldValue.exists)\n ListValue.RetainListOriginsForAssignment(oldValue.result, value);\n\n contextElement.temporaryVariables.set(name, value);\n }\n\n public ContextForVariableNamed(name: string) {\n if (this.currentElement.temporaryVariables.get(name)) {\n return this.currentElementIndex + 1;\n } else {\n return 0;\n }\n }\n\n public ThreadWithIndex(index: number) {\n let filtered = this._threads.filter((t) => {\n if (t.threadIndex == index) return t;\n });\n\n return filtered.length > 0 ? filtered[0] : null;\n }\n\n get callStack() {\n return this.currentThread.callstack;\n }\n\n get callStackTrace() {\n let sb = new StringBuilder();\n\n for (let t = 0; t < this._threads.length; t++) {\n let thread = this._threads[t];\n let isCurrent = t == this._threads.length - 1;\n sb.AppendFormat(\n \"=== THREAD {0}/{1} {2}===\\n\",\n t + 1,\n this._threads.length,\n isCurrent ? \"(current) \" : \"\"\n );\n\n for (let i = 0; i < thread.callstack.length; i++) {\n if (thread.callstack[i].type == PushPopType.Function)\n sb.Append(\" [FUNCTION] \");\n else sb.Append(\" [TUNNEL] \");\n\n let pointer = thread.callstack[i].currentPointer;\n if (!pointer.isNull) {\n sb.Append(\"\");\n }\n }\n }\n\n return sb.toString();\n }\n\n public _threads!: CallStack.Thread[]; // Banged because it's initialized in Reset().\n public _threadCounter: number = 0;\n public _startOfRoot: Pointer = Pointer.Null;\n}\n\nexport namespace CallStack {\n export class Element {\n public currentPointer: Pointer;\n public inExpressionEvaluation: boolean;\n public temporaryVariables: Map;\n public type: PushPopType;\n\n public evaluationStackHeightWhenPushed: number = 0;\n public functionStartInOutputStream: number = 0;\n\n constructor(\n type: PushPopType,\n pointer: Pointer,\n inExpressionEvaluation: boolean = false\n ) {\n this.currentPointer = pointer.copy();\n this.inExpressionEvaluation = inExpressionEvaluation;\n this.temporaryVariables = new Map();\n this.type = type;\n }\n\n public Copy() {\n let copy = new Element(\n this.type,\n this.currentPointer,\n this.inExpressionEvaluation\n );\n copy.temporaryVariables = new Map(this.temporaryVariables);\n copy.evaluationStackHeightWhenPushed =\n this.evaluationStackHeightWhenPushed;\n copy.functionStartInOutputStream = this.functionStartInOutputStream;\n return copy;\n }\n }\n\n export class Thread {\n public callstack: Element[];\n public threadIndex: number = 0;\n public previousPointer: Pointer = Pointer.Null;\n\n constructor();\n constructor(jThreadObj: any, storyContext: Story);\n constructor() {\n this.callstack = [];\n\n if (arguments[0] && arguments[1]) {\n let jThreadObj = arguments[0];\n let storyContext = arguments[1];\n\n // TODO: (int) jThreadObj['threadIndex'] can raise;\n this.threadIndex = parseInt(jThreadObj[\"threadIndex\"]);\n\n let jThreadCallstack = jThreadObj[\"callstack\"];\n\n for (let jElTok of jThreadCallstack) {\n let jElementObj = jElTok;\n\n // TODO: (int) jElementObj['type'] can raise;\n let pushPopType: PushPopType = parseInt(jElementObj[\"type\"]);\n\n let pointer = Pointer.Null;\n\n let currentContainerPathStr: string;\n // TODO: jElementObj.TryGetValue (\"cPath\", out currentContainerPathStrToken);\n let currentContainerPathStrToken = jElementObj[\"cPath\"];\n if (typeof currentContainerPathStrToken !== \"undefined\") {\n currentContainerPathStr = currentContainerPathStrToken.toString();\n\n let threadPointerResult = storyContext.ContentAtPath(\n new Path(currentContainerPathStr)\n );\n pointer.container = threadPointerResult.container;\n pointer.index = parseInt(jElementObj[\"idx\"]);\n\n if (threadPointerResult.obj == null)\n throw new Error(\n \"When loading state, internal story location couldn't be found: \" +\n currentContainerPathStr +\n \". Has the story changed since this save data was created?\"\n );\n else if (threadPointerResult.approximate) {\n if (pointer.container === null) {\n return throwNullException(\"pointer.container\");\n }\n storyContext.Warning(\n \"When loading state, exact internal story location couldn't be found: '\" +\n currentContainerPathStr +\n \"', so it was approximated to '\" +\n pointer.container.path.toString() +\n \"' to recover. Has the story changed since this save data was created?\"\n );\n }\n }\n\n let inExpressionEvaluation = !!jElementObj[\"exp\"];\n\n let el = new Element(pushPopType, pointer, inExpressionEvaluation);\n\n let temps = jElementObj[\"temp\"];\n if (typeof temps !== \"undefined\") {\n el.temporaryVariables =\n JsonSerialisation.JObjectToDictionaryRuntimeObjs(temps);\n } else {\n el.temporaryVariables.clear();\n }\n\n this.callstack.push(el);\n }\n\n let prevContentObjPath = jThreadObj[\"previousContentObject\"];\n if (typeof prevContentObjPath !== \"undefined\") {\n let prevPath = new Path(prevContentObjPath.toString());\n this.previousPointer = storyContext.PointerAtPath(prevPath);\n }\n }\n }\n\n public Copy() {\n let copy = new Thread();\n copy.threadIndex = this.threadIndex;\n for (let e of this.callstack) {\n copy.callstack.push(e.Copy());\n }\n copy.previousPointer = this.previousPointer.copy();\n return copy;\n }\n\n public WriteJson(writer: SimpleJson.Writer) {\n writer.WriteObjectStart();\n\n writer.WritePropertyStart(\"callstack\");\n writer.WriteArrayStart();\n for (let el of this.callstack) {\n writer.WriteObjectStart();\n if (!el.currentPointer.isNull) {\n if (el.currentPointer.container === null) {\n return throwNullException(\"el.currentPointer.container\");\n }\n writer.WriteProperty(\n \"cPath\",\n el.currentPointer.container.path.componentsString\n );\n writer.WriteIntProperty(\"idx\", el.currentPointer.index);\n }\n\n writer.WriteProperty(\"exp\", el.inExpressionEvaluation);\n writer.WriteIntProperty(\"type\", el.type);\n\n if (el.temporaryVariables.size > 0) {\n writer.WritePropertyStart(\"temp\");\n JsonSerialisation.WriteDictionaryRuntimeObjs(\n writer,\n el.temporaryVariables\n );\n writer.WritePropertyEnd();\n }\n\n writer.WriteObjectEnd();\n }\n writer.WriteArrayEnd();\n writer.WritePropertyEnd();\n\n writer.WriteIntProperty(\"threadIndex\", this.threadIndex);\n\n if (!this.previousPointer.isNull) {\n let resolvedPointer = this.previousPointer.Resolve();\n if (resolvedPointer === null) {\n return throwNullException(\"this.previousPointer.Resolve()\");\n }\n writer.WriteProperty(\n \"previousContentObject\",\n resolvedPointer.path.toString()\n );\n }\n\n writer.WriteObjectEnd();\n }\n }\n}\n","import {\n AbstractValue,\n Value,\n VariablePointerValue,\n ListValue,\n IntValue,\n FloatValue,\n BoolValue,\n} from \"./Value\";\nimport { VariableAssignment } from \"./VariableAssignment\";\nimport { InkObject } from \"./Object\";\nimport { ListDefinitionsOrigin } from \"./ListDefinitionsOrigin\";\nimport { StoryException } from \"./StoryException\";\nimport { JsonSerialisation } from \"./JsonSerialisation\";\nimport { asOrThrows, asOrNull, isEquatable } from \"./TypeAssertion\";\nimport { tryGetValueFromMap } from \"./TryGetResult\";\nimport { throwNullException } from \"./NullException\";\nimport { CallStack } from \"./CallStack\";\nimport { StatePatch } from \"./StatePatch\";\nimport { SimpleJson } from \"./SimpleJson\";\nimport { InkList } from \"./Story\";\nimport { Path } from \"./Path\";\n\n// Fake class wrapper around VariableState to have correct typing\n// when using the Proxy syntax in typescript\nfunction VariablesStateAccessor(): new () => Pick {\n return class {} as any;\n}\n\ntype VariableStateValue = boolean | string | number | InkList | Path | null;\n\nexport class VariablesState extends VariablesStateAccessor<\n Record\n>() {\n // The way variableChangedEvent is a bit different than the reference implementation.\n // Originally it uses the C# += operator to add delegates, but in js we need to maintain\n // an actual collection of delegates (ie. callbacks) to register a new one, there is a\n // special ObserveVariableChange method below.\n public variableChangedEventCallbacks: Array<\n (variableName: string, newValue: InkObject) => void\n > = [];\n public variableChangedEvent(variableName: string, newValue: InkObject): void {\n for (let callback of this.variableChangedEventCallbacks) {\n callback(variableName, newValue);\n }\n }\n\n public patch: StatePatch | null = null;\n\n get batchObservingVariableChanges() {\n return this._batchObservingVariableChanges;\n }\n set batchObservingVariableChanges(value: boolean) {\n this._batchObservingVariableChanges = value;\n if (value) {\n this._changedVariablesForBatchObs = new Set();\n } else {\n if (this._changedVariablesForBatchObs != null) {\n for (let variableName of this._changedVariablesForBatchObs) {\n let currentValue = this._globalVariables.get(variableName);\n if (!currentValue) {\n throwNullException(\"currentValue\");\n } else {\n this.variableChangedEvent(variableName, currentValue);\n }\n }\n\n this._changedVariablesForBatchObs = null;\n }\n }\n }\n\n get callStack() {\n return this._callStack;\n }\n set callStack(callStack) {\n this._callStack = callStack;\n }\n\n private _batchObservingVariableChanges: boolean = false;\n\n // the original code uses a magic getter and setter for global variables,\n // allowing things like variableState['varname]. This is not quite possible\n // in js without a Proxy, so it is replaced with this $ function.\n public $(variableName: string): VariableStateValue;\n public $(variableName: string, value: VariableStateValue): void;\n public $(variableName: string, value?: any) {\n if (typeof value === \"undefined\") {\n let varContents = null;\n\n if (this.patch !== null) {\n varContents = this.patch.TryGetGlobal(variableName, null);\n if (varContents.exists)\n return (varContents.result as AbstractValue).valueObject;\n }\n\n varContents = this._globalVariables.get(variableName);\n\n if (typeof varContents === \"undefined\") {\n varContents = this._defaultGlobalVariables.get(variableName);\n }\n\n if (typeof varContents !== \"undefined\")\n return (varContents as AbstractValue).valueObject;\n else return null;\n } else {\n if (typeof this._defaultGlobalVariables.get(variableName) === \"undefined\")\n throw new StoryException(\n \"Cannot assign to a variable (\" +\n variableName +\n \") that hasn't been declared in the story\"\n );\n\n let val = Value.Create(value);\n if (val == null) {\n if (value == null) {\n throw new Error(\"Cannot pass null to VariableState\");\n } else {\n throw new Error(\n \"Invalid value passed to VariableState: \" + value.toString()\n );\n }\n }\n\n this.SetGlobal(variableName, val);\n }\n }\n\n constructor(\n callStack: CallStack,\n listDefsOrigin: ListDefinitionsOrigin | null\n ) {\n super();\n this._globalVariables = new Map();\n this._callStack = callStack;\n this._listDefsOrigin = listDefsOrigin;\n\n // if es6 proxies are available, use them.\n try {\n // the proxy is used to allow direct manipulation of global variables.\n // It first tries to access the objects own property, and if none is\n // found it delegates the call to the $ method, defined below\n let p = new Proxy(this, {\n get(target: any, name) {\n return name in target ? target[name] : target.$(name);\n },\n set(target: any, name, value) {\n if (name in target) target[name] = value;\n else target.$(name, value);\n return true; // returning a falsy value make the trap fail\n },\n });\n\n return p;\n } catch (e) {\n // the proxy object is not available in this context. we should warn the\n // dev but writing to the console feels a bit intrusive.\n // console.log(\"ES6 Proxy not available - direct manipulation of global variables can't work, use $() instead.\");\n }\n }\n\n public ApplyPatch() {\n if (this.patch === null) {\n return throwNullException(\"this.patch\");\n }\n\n for (let [namedVarKey, namedVarValue] of this.patch.globals) {\n this._globalVariables.set(namedVarKey, namedVarValue);\n }\n\n if (this._changedVariablesForBatchObs !== null) {\n for (let name of this.patch.changedVariables) {\n this._changedVariablesForBatchObs.add(name);\n }\n }\n\n this.patch = null;\n }\n\n public SetJsonToken(jToken: Record) {\n this._globalVariables.clear();\n\n for (let [varValKey, varValValue] of this._defaultGlobalVariables) {\n let loadedToken = jToken[varValKey];\n if (typeof loadedToken !== \"undefined\") {\n let tokenInkObject =\n JsonSerialisation.JTokenToRuntimeObject(loadedToken);\n if (tokenInkObject === null) {\n return throwNullException(\"tokenInkObject\");\n }\n this._globalVariables.set(varValKey, tokenInkObject);\n } else {\n this._globalVariables.set(varValKey, varValValue);\n }\n }\n }\n\n public static dontSaveDefaultValues: boolean = true;\n\n public WriteJson(writer: SimpleJson.Writer) {\n writer.WriteObjectStart();\n for (let [keyValKey, keyValValue] of this._globalVariables) {\n let name = keyValKey;\n let val = keyValValue;\n\n if (VariablesState.dontSaveDefaultValues) {\n if (this._defaultGlobalVariables.has(name)) {\n let defaultVal = this._defaultGlobalVariables.get(name)!;\n if (this.RuntimeObjectsEqual(val, defaultVal)) continue;\n }\n }\n\n writer.WritePropertyStart(name);\n JsonSerialisation.WriteRuntimeObject(writer, val);\n writer.WritePropertyEnd();\n }\n writer.WriteObjectEnd();\n }\n\n public RuntimeObjectsEqual(\n obj1: InkObject | null,\n obj2: InkObject | null\n ): boolean {\n if (obj1 === null) {\n return throwNullException(\"obj1\");\n }\n if (obj2 === null) {\n return throwNullException(\"obj2\");\n }\n\n if (obj1.constructor !== obj2.constructor) return false;\n\n let boolVal = asOrNull(obj1, BoolValue);\n if (boolVal !== null) {\n return boolVal.value === asOrThrows(obj2, BoolValue).value;\n }\n\n let intVal = asOrNull(obj1, IntValue);\n if (intVal !== null) {\n return intVal.value === asOrThrows(obj2, IntValue).value;\n }\n\n let floatVal = asOrNull(obj1, FloatValue);\n if (floatVal !== null) {\n return floatVal.value === asOrThrows(obj2, FloatValue).value;\n }\n\n let val1 = asOrNull(obj1, Value);\n let val2 = asOrNull(obj2, Value);\n if (val1 !== null && val2 !== null) {\n if (isEquatable(val1.valueObject) && isEquatable(val2.valueObject)) {\n return val1.valueObject.Equals(val2.valueObject);\n } else {\n return val1.valueObject === val2.valueObject;\n }\n }\n\n throw new Error(\n \"FastRoughDefinitelyEquals: Unsupported runtime object type: \" +\n obj1.constructor.name\n );\n }\n\n public GetVariableWithName(\n name: string | null,\n contextIndex: number = -1\n ): InkObject | null {\n let varValue = this.GetRawVariableWithName(name, contextIndex);\n\n // var varPointer = varValue as VariablePointerValue;\n let varPointer = asOrNull(varValue, VariablePointerValue);\n if (varPointer !== null) {\n varValue = this.ValueAtVariablePointer(varPointer);\n }\n\n return varValue;\n }\n\n public TryGetDefaultVariableValue(name: string | null): InkObject | null {\n let val = tryGetValueFromMap(this._defaultGlobalVariables, name, null);\n return val.exists ? val.result : null;\n }\n\n public GlobalVariableExistsWithName(name: string) {\n return (\n this._globalVariables.has(name) ||\n (this._defaultGlobalVariables !== null &&\n this._defaultGlobalVariables.has(name))\n );\n }\n\n public GetRawVariableWithName(name: string | null, contextIndex: number) {\n let varValue: InkObject | null = null;\n\n if (contextIndex == 0 || contextIndex == -1) {\n let variableValue = null;\n if (this.patch !== null) {\n variableValue = this.patch.TryGetGlobal(name, null);\n if (variableValue.exists) return variableValue.result!;\n }\n\n // this is a conditional assignment\n variableValue = tryGetValueFromMap(this._globalVariables, name, null);\n if (variableValue.exists) return variableValue.result;\n\n if (this._defaultGlobalVariables !== null) {\n variableValue = tryGetValueFromMap(\n this._defaultGlobalVariables,\n name,\n null\n );\n if (variableValue.exists) return variableValue.result;\n }\n\n if (this._listDefsOrigin === null)\n return throwNullException(\"VariablesState._listDefsOrigin\");\n let listItemValue = this._listDefsOrigin.FindSingleItemListWithName(name);\n if (listItemValue) return listItemValue;\n }\n\n varValue = this._callStack.GetTemporaryVariableWithName(name, contextIndex);\n\n return varValue;\n }\n\n public ValueAtVariablePointer(pointer: VariablePointerValue) {\n return this.GetVariableWithName(pointer.variableName, pointer.contextIndex);\n }\n\n public Assign(varAss: VariableAssignment, value: InkObject) {\n let name = varAss.variableName;\n if (name === null) {\n return throwNullException(\"name\");\n }\n let contextIndex = -1;\n\n let setGlobal = false;\n if (varAss.isNewDeclaration) {\n setGlobal = varAss.isGlobal;\n } else {\n setGlobal = this.GlobalVariableExistsWithName(name);\n }\n\n if (varAss.isNewDeclaration) {\n // var varPointer = value as VariablePointerValue;\n let varPointer = asOrNull(value, VariablePointerValue);\n if (varPointer !== null) {\n let fullyResolvedVariablePointer =\n this.ResolveVariablePointer(varPointer);\n value = fullyResolvedVariablePointer;\n }\n } else {\n let existingPointer = null;\n do {\n // existingPointer = GetRawVariableWithName (name, contextIndex) as VariablePointerValue;\n existingPointer = asOrNull(\n this.GetRawVariableWithName(name, contextIndex),\n VariablePointerValue\n );\n if (existingPointer != null) {\n name = existingPointer.variableName;\n contextIndex = existingPointer.contextIndex;\n setGlobal = contextIndex == 0;\n }\n } while (existingPointer != null);\n }\n\n if (setGlobal) {\n this.SetGlobal(name, value);\n } else {\n this._callStack.SetTemporaryVariable(\n name,\n value,\n varAss.isNewDeclaration,\n contextIndex\n );\n }\n }\n\n public SnapshotDefaultGlobals() {\n this._defaultGlobalVariables = new Map(this._globalVariables);\n }\n\n public RetainListOriginsForAssignment(\n oldValue: InkObject,\n newValue: InkObject\n ) {\n let oldList = asOrThrows(oldValue, ListValue);\n let newList = asOrThrows(newValue, ListValue);\n\n if (oldList.value && newList.value && newList.value.Count == 0) {\n newList.value.SetInitialOriginNames(oldList.value.originNames);\n }\n }\n\n public SetGlobal(variableName: string | null, value: InkObject) {\n let oldValue = null;\n\n if (this.patch === null) {\n oldValue = tryGetValueFromMap(this._globalVariables, variableName, null);\n }\n\n if (this.patch !== null) {\n oldValue = this.patch.TryGetGlobal(variableName, null);\n if (!oldValue.exists) {\n oldValue = tryGetValueFromMap(\n this._globalVariables,\n variableName,\n null\n );\n }\n }\n\n ListValue.RetainListOriginsForAssignment(oldValue!.result!, value);\n\n if (variableName === null) {\n return throwNullException(\"variableName\");\n }\n\n if (this.patch !== null) {\n this.patch.SetGlobal(variableName, value);\n } else {\n this._globalVariables.set(variableName, value);\n }\n\n // TODO: Not sure !== is equivalent to !value.Equals(oldValue)\n if (\n this.variableChangedEvent !== null &&\n oldValue !== null &&\n value !== oldValue.result\n ) {\n if (this.batchObservingVariableChanges) {\n if (this._changedVariablesForBatchObs === null) {\n return throwNullException(\"this._changedVariablesForBatchObs\");\n }\n\n if (this.patch !== null) {\n this.patch.AddChangedVariable(variableName);\n } else if (this._changedVariablesForBatchObs !== null) {\n this._changedVariablesForBatchObs.add(variableName);\n }\n } else {\n this.variableChangedEvent(variableName, value);\n }\n }\n }\n\n public ResolveVariablePointer(varPointer: VariablePointerValue) {\n let contextIndex = varPointer.contextIndex;\n\n if (contextIndex == -1)\n contextIndex = this.GetContextIndexOfVariableNamed(\n varPointer.variableName\n );\n\n let valueOfVariablePointedTo = this.GetRawVariableWithName(\n varPointer.variableName,\n contextIndex\n );\n\n // var doubleRedirectionPointer = valueOfVariablePointedTo as VariablePointerValue;\n let doubleRedirectionPointer = asOrNull(\n valueOfVariablePointedTo,\n VariablePointerValue\n );\n if (doubleRedirectionPointer != null) {\n return doubleRedirectionPointer;\n } else {\n return new VariablePointerValue(varPointer.variableName, contextIndex);\n }\n }\n\n public GetContextIndexOfVariableNamed(varName: string) {\n if (this.GlobalVariableExistsWithName(varName)) return 0;\n\n return this._callStack.currentElementIndex;\n }\n\n /**\n * This function is specific to the js version of ink. It allows to register a\n * callback that will be called when a variable changes. The original code uses\n * `state.variableChangedEvent += callback` instead.\n *\n * @param {function} callback\n */\n public ObserveVariableChange(\n callback: (variableName: string, newValue: InkObject) => void\n ) {\n this.variableChangedEventCallbacks.push(callback);\n }\n\n private _globalVariables: Map;\n private _defaultGlobalVariables: Map = new Map();\n\n private _callStack: CallStack;\n private _changedVariablesForBatchObs: Set | null = new Set();\n private _listDefsOrigin: ListDefinitionsOrigin | null;\n}\n","// Taken from https://gist.github.com/blixt/f17b47c62508be59987b\n// Ink uses a seedable PRNG of which there is none in native javascript.\nexport class PRNG {\n private seed: number;\n\n constructor(seed: number) {\n this.seed = seed % 2147483647;\n if (this.seed <= 0) this.seed += 2147483646;\n }\n public next(): number {\n return (this.seed = (this.seed * 48271) % 2147483647);\n }\n public nextFloat(): number {\n return (this.next() - 1) / 2147483646;\n }\n}\n","import { InkObject } from \"./Object\";\nimport { Container } from \"./Container\";\n\nexport class StatePatch {\n get globals() {\n return this._globals;\n }\n get changedVariables() {\n return this._changedVariables;\n }\n get visitCounts() {\n return this._visitCounts;\n }\n get turnIndices() {\n return this._turnIndices;\n }\n\n constructor();\n constructor(toCopy: StatePatch | null);\n constructor() {\n if (arguments.length === 1 && arguments[0] !== null) {\n let toCopy = arguments[0] as StatePatch;\n this._globals = new Map(toCopy._globals);\n this._changedVariables = new Set(toCopy._changedVariables);\n this._visitCounts = new Map(toCopy._visitCounts);\n this._turnIndices = new Map(toCopy._turnIndices);\n } else {\n this._globals = new Map();\n this._changedVariables = new Set();\n this._visitCounts = new Map();\n this._turnIndices = new Map();\n }\n }\n\n public TryGetGlobal(name: string | null, /* out */ value: InkObject | null) {\n if (name !== null && this._globals.has(name)) {\n return { result: this._globals.get(name), exists: true };\n }\n\n return { result: value, exists: false };\n }\n\n public SetGlobal(name: string, value: InkObject) {\n this._globals.set(name, value);\n }\n\n public AddChangedVariable(name: string) {\n return this._changedVariables.add(name);\n }\n\n public TryGetVisitCount(container: Container, /* out */ count: number) {\n if (this._visitCounts.has(container)) {\n return { result: this._visitCounts.get(container), exists: true };\n }\n\n return { result: count, exists: false };\n }\n\n public SetVisitCount(container: Container, count: number) {\n this._visitCounts.set(container, count);\n }\n\n public SetTurnIndex(container: Container, index: number) {\n this._turnIndices.set(container, index);\n }\n\n public TryGetTurnIndex(container: Container, /* out */ index: number) {\n if (this._turnIndices.has(container)) {\n return { result: this._turnIndices.get(container), exists: true };\n }\n\n return { result: index, exists: false };\n }\n\n private _globals: Map;\n private _changedVariables: Set = new Set();\n private _visitCounts: Map = new Map();\n private _turnIndices: Map = new Map();\n}\n","export class SimpleJson {\n public static TextToDictionary(text: string) {\n return new SimpleJson.Reader(text).ToDictionary();\n }\n\n public static TextToArray(text: string) {\n return new SimpleJson.Reader(text).ToArray();\n }\n}\n\nexport namespace SimpleJson {\n export class Reader {\n constructor(text: string) {\n this._rootObject = JSON.parse(text);\n }\n\n public ToDictionary() {\n return this._rootObject as Record;\n }\n\n public ToArray() {\n return this._rootObject as any[];\n }\n\n private _rootObject: any[] | Record;\n }\n\n // In C#, this class writes json tokens directly to a StringWriter or\n // another stream. Here, a temporary hierarchy is created in the form\n // of a javascript object, which is serialised in the `toString` method.\n // See individual methods and properties for more information.\n export class Writer {\n public WriteObject(inner: (w: Writer) => void) {\n this.WriteObjectStart();\n inner(this);\n this.WriteObjectEnd();\n }\n\n // Add a new object.\n public WriteObjectStart() {\n this.StartNewObject(true);\n\n let newObject: Record = {};\n\n if (this.state === SimpleJson.Writer.State.Property) {\n // This object is created as the value of a property,\n // inside an other object.\n this.Assert(this.currentCollection !== null);\n this.Assert(this.currentPropertyName !== null);\n\n let propertyName = this._propertyNameStack.pop();\n this.currentCollection![propertyName!] = newObject;\n this._collectionStack.push(newObject);\n } else if (this.state === SimpleJson.Writer.State.Array) {\n // This object is created as the child of an array.\n this.Assert(this.currentCollection !== null);\n\n this.currentCollection!.push(newObject);\n this._collectionStack.push(newObject);\n } else {\n // This object is the root object.\n this.Assert(this.state === SimpleJson.Writer.State.None);\n this._jsonObject = newObject;\n this._collectionStack.push(newObject);\n }\n\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.Object)\n );\n }\n\n public WriteObjectEnd() {\n this.Assert(this.state === SimpleJson.Writer.State.Object);\n this._collectionStack.pop();\n this._stateStack.pop();\n }\n\n // Write a property name / value pair to the current object.\n public WriteProperty(\n name: any,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n innerOrContent: ((w: Writer) => void) | string | boolean | null\n ) {\n this.WritePropertyStart(name);\n if (arguments[1] instanceof Function) {\n let inner = arguments[1];\n inner(this);\n } else {\n let content: string | boolean | null = arguments[1];\n this.Write(content);\n }\n this.WritePropertyEnd();\n }\n\n // Int and Float are separate calls, since there both are\n // numbers in JavaScript, but need to be handled differently.\n\n public WriteIntProperty(name: any, content: number) {\n this.WritePropertyStart(name);\n this.WriteInt(content);\n this.WritePropertyEnd();\n }\n\n public WriteFloatProperty(name: any, content: number) {\n this.WritePropertyStart(name);\n this.WriteFloat(content);\n this.WritePropertyEnd();\n }\n\n // Prepare a new property name, which will be use to add the\n // new object when calling _addToCurrentObject() from a Write\n // method.\n public WritePropertyStart(name: any) {\n this.Assert(this.state === SimpleJson.Writer.State.Object);\n this._propertyNameStack.push(name);\n\n this.IncrementChildCount();\n\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.Property)\n );\n }\n\n public WritePropertyEnd() {\n this.Assert(this.state === SimpleJson.Writer.State.Property);\n this.Assert(this.childCount === 1);\n this._stateStack.pop();\n }\n\n // Prepare a new property name, except this time, the property name\n // will be created by concatenating all the strings passed to\n // WritePropertyNameInner.\n public WritePropertyNameStart() {\n this.Assert(this.state === SimpleJson.Writer.State.Object);\n this.IncrementChildCount();\n\n this._currentPropertyName = \"\";\n\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.Property)\n );\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.PropertyName)\n );\n }\n\n public WritePropertyNameEnd() {\n this.Assert(this.state === SimpleJson.Writer.State.PropertyName);\n this.Assert(this._currentPropertyName !== null);\n this._propertyNameStack.push(this._currentPropertyName!);\n this._currentPropertyName = null;\n this._stateStack.pop();\n }\n\n public WritePropertyNameInner(str: string) {\n this.Assert(this.state === SimpleJson.Writer.State.PropertyName);\n this.Assert(this._currentPropertyName !== null);\n this._currentPropertyName += str;\n }\n\n // Add a new array.\n public WriteArrayStart() {\n this.StartNewObject(true);\n\n let newObject: any[] = [];\n\n if (this.state === SimpleJson.Writer.State.Property) {\n // This array is created as the value of a property,\n // inside an object.\n this.Assert(this.currentCollection !== null);\n this.Assert(this.currentPropertyName !== null);\n\n let propertyName = this._propertyNameStack.pop();\n this.currentCollection![propertyName!] = newObject;\n this._collectionStack.push(newObject);\n } else if (this.state === SimpleJson.Writer.State.Array) {\n // This array is created as the child of another array.\n this.Assert(this.currentCollection !== null);\n\n this.currentCollection!.push(newObject);\n this._collectionStack.push(newObject);\n } else {\n // This array is the root object.\n this.Assert(this.state === SimpleJson.Writer.State.None);\n this._jsonObject = newObject;\n this._collectionStack.push(newObject);\n }\n\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.Array)\n );\n }\n\n public WriteArrayEnd() {\n this.Assert(this.state === SimpleJson.Writer.State.Array);\n this._collectionStack.pop();\n this._stateStack.pop();\n }\n\n // Add the value to the appropriate collection (array / object), given the current\n // context.\n public Write(\n value: number | string | boolean | null,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n escape: boolean = true\n ) {\n if (value === null) {\n console.error(\"Warning: trying to write a null value\");\n return;\n }\n\n this.StartNewObject(false);\n this._addToCurrentObject(value);\n }\n\n public WriteBool(value: boolean | null) {\n if (value === null) {\n return;\n }\n\n this.StartNewObject(false);\n this._addToCurrentObject(value);\n }\n\n public WriteInt(value: number | null) {\n if (value === null) {\n return;\n }\n\n this.StartNewObject(false);\n\n // Math.floor is used as a precaution:\n // 1. to ensure that the value is written as an integer\n // (without a fractional part -> 1 instead of 1.0), even\n // though it should be the default behaviour of\n // JSON.serialize;\n // 2. to ensure that if a floating number is passed\n // accidentally, it's converted to an integer.\n //\n // This guarantees savegame compatibility with the reference\n // implementation.\n this._addToCurrentObject(Math.floor(value));\n }\n\n // Since JSON doesn't support NaN and Infinity, these values\n // are converted here.\n public WriteFloat(value: number | null) {\n if (value === null) {\n return;\n }\n\n this.StartNewObject(false);\n if (value == Number.POSITIVE_INFINITY) {\n this._addToCurrentObject(3.4e38);\n } else if (value == Number.NEGATIVE_INFINITY) {\n this._addToCurrentObject(-3.4e38);\n } else if (isNaN(value)) {\n this._addToCurrentObject(0.0);\n } else {\n this._addToCurrentObject(value);\n }\n }\n\n public WriteNull() {\n this.StartNewObject(false);\n this._addToCurrentObject(null);\n }\n\n // Prepare a string before adding it to the current collection in\n // WriteStringEnd(). The string will be a concatenation of all the\n // strings passed to WriteStringInner.\n public WriteStringStart() {\n this.StartNewObject(false);\n this._currentString = \"\";\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.String)\n );\n }\n\n public WriteStringEnd() {\n this.Assert(this.state == SimpleJson.Writer.State.String);\n this._stateStack.pop();\n this._addToCurrentObject(this._currentString);\n this._currentString = null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n public WriteStringInner(str: string | null, escape: boolean = true) {\n this.Assert(this.state === SimpleJson.Writer.State.String);\n\n if (str === null) {\n console.error(\"Warning: trying to write a null string\");\n return;\n }\n\n this._currentString += str;\n }\n\n // Serialise the root object into a JSON string.\n public toString() {\n if (this._jsonObject === null) {\n return \"\";\n }\n\n return JSON.stringify(this._jsonObject);\n }\n\n // Prepare the state stack when adding new objects / values.\n private StartNewObject(container: boolean) {\n if (container) {\n this.Assert(\n this.state === SimpleJson.Writer.State.None ||\n this.state === SimpleJson.Writer.State.Property ||\n this.state === SimpleJson.Writer.State.Array\n );\n } else {\n this.Assert(\n this.state === SimpleJson.Writer.State.Property ||\n this.state === SimpleJson.Writer.State.Array\n );\n }\n\n if (this.state === SimpleJson.Writer.State.Property) {\n this.Assert(this.childCount === 0);\n }\n\n if (\n this.state === SimpleJson.Writer.State.Array ||\n this.state === SimpleJson.Writer.State.Property\n ) {\n this.IncrementChildCount();\n }\n }\n\n // These getters peek all the different stacks.\n\n private get state() {\n if (this._stateStack.length > 0) {\n return this._stateStack[this._stateStack.length - 1].type;\n } else {\n return SimpleJson.Writer.State.None;\n }\n }\n\n private get childCount() {\n if (this._stateStack.length > 0) {\n return this._stateStack[this._stateStack.length - 1].childCount;\n } else {\n return 0;\n }\n }\n\n private get currentCollection() : Record | null {\n if (this._collectionStack.length > 0) {\n return this._collectionStack[this._collectionStack.length - 1];\n } else {\n return null;\n }\n }\n\n private get currentPropertyName() {\n if (this._propertyNameStack.length > 0) {\n return this._propertyNameStack[this._propertyNameStack.length - 1];\n } else {\n return null;\n }\n }\n\n private IncrementChildCount() {\n this.Assert(this._stateStack.length > 0);\n let currEl = this._stateStack.pop()!;\n currEl.childCount++;\n this._stateStack.push(currEl);\n }\n\n private Assert(condition: boolean) {\n if (!condition) throw Error(\"Assert failed while writing JSON\");\n }\n\n // This method did not exist in the original C# code. It adds\n // the given value to the current collection (used by Write methods).\n private _addToCurrentObject(value: number | string | boolean | null) {\n this.Assert(this.currentCollection !== null);\n if (this.state === SimpleJson.Writer.State.Array) {\n this.Assert(Array.isArray(this.currentCollection));\n (this.currentCollection as any[]).push(value);\n } else if (this.state === SimpleJson.Writer.State.Property) {\n this.Assert(!Array.isArray(this.currentCollection));\n this.Assert(this.currentPropertyName !== null);\n (this.currentCollection as Record)[\n this.currentPropertyName!\n ] = value;\n this._propertyNameStack.pop();\n }\n }\n\n // In addition to `_stateStack` present in the original code,\n // this implementation of SimpleJson use two other stacks and two\n // temporary variables holding the current context.\n\n // Used to keep track of the current property name being built\n // with `WritePropertyNameStart`, `WritePropertyNameInner` and\n // `WritePropertyNameEnd`.\n private _currentPropertyName: string | null = null;\n\n // Used to keep track of the current string value being built\n // with `WriteStringStart`, `WriteStringInner` and\n // `WriteStringEnd`.\n private _currentString: string | null = null;\n\n private _stateStack: SimpleJson.Writer.StateElement[] = [];\n\n // Keep track of the current collection being built (either an array\n // or an object). For instance, at the '?' step during the hiarchy\n // creation, this hierarchy:\n // [3, {a: [b, ?]}] will have this corresponding stack:\n // (bottom) [Array, Object, Array] (top)\n private _collectionStack: Array> = [];\n\n // Keep track of the current property being assigned. For instance, at\n // the '?' step during the hiarchy creation, this hierarchy:\n // [3, {a: [b, {c: ?}]}] will have this corresponding stack:\n // (bottom) [a, c] (top)\n private _propertyNameStack: string[] = [];\n\n // Object containing the entire hiearchy.\n private _jsonObject: Record | any[] | null = null;\n }\n\n export namespace Writer {\n export enum State {\n None,\n Object,\n Array,\n Property,\n PropertyName,\n String,\n }\n\n export class StateElement {\n public type: SimpleJson.Writer.State = SimpleJson.Writer.State.None;\n public childCount: number = 0;\n\n constructor(type: SimpleJson.Writer.State) {\n this.type = type;\n }\n }\n }\n}\n","import { CallStack } from \"./CallStack\";\nimport { Choice } from \"./Choice\";\nimport { JsonSerialisation } from \"./JsonSerialisation\";\nimport { InkObject } from \"./Object\";\nimport { SimpleJson } from \"./SimpleJson\";\nimport { Story } from \"./Story\";\nimport { throwNullException } from \"./NullException\";\n\nexport class Flow {\n public name: string;\n public callStack: CallStack;\n public outputStream: InkObject[];\n public currentChoices: Choice[];\n\n constructor(name: String, story: Story);\n constructor(name: String, story: Story, jObject: Record);\n constructor() {\n let name = arguments[0] as string;\n let story = arguments[1] as Story;\n\n this.name = name;\n this.callStack = new CallStack(story);\n\n if (arguments[2]) {\n let jObject = arguments[2] as Record;\n\n this.callStack.SetJsonToken(jObject[\"callstack\"], story);\n this.outputStream = JsonSerialisation.JArrayToRuntimeObjList(\n jObject[\"outputStream\"]\n );\n this.currentChoices = JsonSerialisation.JArrayToRuntimeObjList(\n jObject[\"currentChoices\"]\n ) as Choice[];\n\n let jChoiceThreadsObj = jObject[\"choiceThreads\"];\n if (typeof jChoiceThreadsObj !== \"undefined\") {\n this.LoadFlowChoiceThreads(jChoiceThreadsObj, story);\n }\n } else {\n this.outputStream = [];\n this.currentChoices = [];\n }\n }\n\n public WriteJson(writer: SimpleJson.Writer) {\n writer.WriteObjectStart();\n\n writer.WriteProperty(\"callstack\", (w) => this.callStack.WriteJson(w));\n writer.WriteProperty(\"outputStream\", (w) =>\n JsonSerialisation.WriteListRuntimeObjs(w, this.outputStream)\n );\n\n let hasChoiceThreads = false;\n for (let c of this.currentChoices) {\n if (c.threadAtGeneration === null)\n return throwNullException(\"c.threadAtGeneration\");\n\n c.originalThreadIndex = c.threadAtGeneration.threadIndex;\n\n if (this.callStack.ThreadWithIndex(c.originalThreadIndex) === null) {\n if (!hasChoiceThreads) {\n hasChoiceThreads = true;\n writer.WritePropertyStart(\"choiceThreads\");\n writer.WriteObjectStart();\n }\n\n writer.WritePropertyStart(c.originalThreadIndex);\n c.threadAtGeneration.WriteJson(writer);\n writer.WritePropertyEnd();\n }\n }\n\n if (hasChoiceThreads) {\n writer.WriteObjectEnd();\n writer.WritePropertyEnd();\n }\n\n writer.WriteProperty(\"currentChoices\", (w) => {\n w.WriteArrayStart();\n for (let c of this.currentChoices) {\n JsonSerialisation.WriteChoice(w, c);\n }\n w.WriteArrayEnd();\n });\n\n writer.WriteObjectEnd();\n }\n\n public LoadFlowChoiceThreads(\n jChoiceThreads: Record,\n story: Story\n ) {\n for (let choice of this.currentChoices) {\n let foundActiveThread = this.callStack.ThreadWithIndex(\n choice.originalThreadIndex\n );\n if (foundActiveThread !== null) {\n choice.threadAtGeneration = foundActiveThread.Copy();\n } else {\n let jSavedChoiceThread =\n jChoiceThreads[`${choice.originalThreadIndex}`];\n choice.threadAtGeneration = new CallStack.Thread(\n jSavedChoiceThread,\n story\n );\n }\n }\n }\n}\n","import { CallStack } from \"./CallStack\";\nimport { VariablesState } from \"./VariablesState\";\nimport { ValueType, Value, StringValue, ListValue } from \"./Value\";\nimport { PushPopType } from \"./PushPop\";\nimport { Tag } from \"./Tag\";\nimport { Glue } from \"./Glue\";\nimport { Path } from \"./Path\";\nimport { ControlCommand } from \"./ControlCommand\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { JsonSerialisation } from \"./JsonSerialisation\";\nimport { PRNG } from \"./PRNG\";\nimport { Void } from \"./Void\";\nimport { Pointer } from \"./Pointer\";\nimport { tryGetValueFromMap } from \"./TryGetResult\";\nimport { Choice } from \"./Choice\";\nimport { asOrNull, asOrThrows, nullIfUndefined } from \"./TypeAssertion\";\nimport { Debug } from \"./Debug\";\nimport { Container } from \"./Container\";\nimport { InkObject } from \"./Object\";\nimport { throwNullException } from \"./NullException\";\nimport { Story } from \"./Story\";\nimport { StatePatch } from \"./StatePatch\";\nimport { SimpleJson } from \"./SimpleJson\";\nimport { Flow } from \"./Flow\";\nimport { InkList } from \"./InkList\";\n\nexport class StoryState {\n // Backward compatible changes since v8:\n // v10: dynamic tags\n // v9: multi-flows\n public readonly kInkSaveStateVersion = 10;\n public readonly kMinCompatibleLoadVersion = 8;\n\n public onDidLoadState: (() => void) | null = null;\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n public ToJson(indented: boolean = false) {\n let writer = new SimpleJson.Writer();\n this.WriteJson(writer);\n return writer.toString();\n }\n public toJson(indented: boolean = false) {\n return this.ToJson(indented);\n }\n\n public LoadJson(json: string) {\n let jObject = SimpleJson.TextToDictionary(json);\n this.LoadJsonObj(jObject);\n if (this.onDidLoadState !== null) this.onDidLoadState();\n }\n\n public VisitCountAtPathString(pathString: string) {\n let visitCountOut;\n\n if (this._patch !== null) {\n let container = this.story.ContentAtPath(new Path(pathString)).container;\n if (container === null)\n throw new Error(\"Content at path not found: \" + pathString);\n\n visitCountOut = this._patch.TryGetVisitCount(container, 0);\n if (visitCountOut.exists) return visitCountOut.result;\n }\n\n visitCountOut = tryGetValueFromMap(this._visitCounts, pathString, null);\n if (visitCountOut.exists) return visitCountOut.result;\n\n return 0;\n }\n\n public VisitCountForContainer(container: Container | null): number {\n if (container === null) {\n return throwNullException(\"container\");\n }\n if (!container.visitsShouldBeCounted) {\n this.story.Error(\n \"Read count for target (\" +\n container.name +\n \" - on \" +\n container.debugMetadata +\n \") unknown. The story may need to be compiled with countAllVisits flag (-c).\"\n );\n return 0;\n }\n\n if (this._patch !== null) {\n let count = this._patch.TryGetVisitCount(container, 0);\n if (count.exists) {\n return count.result!;\n }\n }\n\n let containerPathStr = container.path.toString();\n let count2 = tryGetValueFromMap(this._visitCounts, containerPathStr, null);\n if (count2.exists) {\n return count2.result!;\n }\n\n return 0;\n }\n\n public IncrementVisitCountForContainer(container: Container) {\n if (this._patch !== null) {\n let currCount = this.VisitCountForContainer(container);\n currCount++;\n this._patch.SetVisitCount(container, currCount);\n return;\n }\n\n let containerPathStr = container.path.toString();\n let count = tryGetValueFromMap(this._visitCounts, containerPathStr, null);\n if (count.exists) {\n this._visitCounts.set(containerPathStr, count.result! + 1);\n } else {\n this._visitCounts.set(containerPathStr, 1);\n }\n }\n\n public RecordTurnIndexVisitToContainer(container: Container) {\n if (this._patch !== null) {\n this._patch.SetTurnIndex(container, this.currentTurnIndex);\n return;\n }\n\n let containerPathStr = container.path.toString();\n this._turnIndices.set(containerPathStr, this.currentTurnIndex);\n }\n\n public TurnsSinceForContainer(container: Container) {\n if (!container.turnIndexShouldBeCounted) {\n this.story.Error(\n \"TURNS_SINCE() for target (\" +\n container.name +\n \" - on \" +\n container.debugMetadata +\n \") unknown. The story may need to be compiled with countAllVisits flag (-c).\"\n );\n }\n\n if (this._patch !== null) {\n let index = this._patch.TryGetTurnIndex(container, 0);\n if (index.exists) {\n return this.currentTurnIndex - index.result!;\n }\n }\n\n let containerPathStr = container.path.toString();\n let index2 = tryGetValueFromMap(this._turnIndices, containerPathStr, 0);\n if (index2.exists) {\n return this.currentTurnIndex - index2.result!;\n } else {\n return -1;\n }\n }\n\n get callstackDepth() {\n return this.callStack.depth;\n }\n\n get outputStream() {\n return this._currentFlow.outputStream;\n }\n\n get currentChoices() {\n // If we can continue generating text content rather than choices,\n // then we reflect the choice list as being empty, since choices\n // should always come at the end.\n if (this.canContinue) return [];\n return this._currentFlow.currentChoices;\n }\n\n get generatedChoices() {\n return this._currentFlow.currentChoices;\n }\n\n get currentErrors() {\n return this._currentErrors;\n }\n private _currentErrors: string[] | null = null;\n\n get currentWarnings() {\n return this._currentWarnings;\n }\n private _currentWarnings: string[] | null = null;\n\n get variablesState() {\n return this._variablesState;\n }\n set variablesState(value) {\n this._variablesState = value;\n }\n private _variablesState: VariablesState;\n\n get callStack() {\n return this._currentFlow.callStack;\n }\n\n get evaluationStack() {\n return this._evaluationStack;\n }\n private _evaluationStack: InkObject[];\n\n public divertedPointer: Pointer = Pointer.Null;\n\n get currentTurnIndex() {\n return this._currentTurnIndex;\n }\n set currentTurnIndex(value) {\n this._currentTurnIndex = value;\n }\n private _currentTurnIndex: number = 0;\n\n public storySeed: number = 0;\n public previousRandom: number = 0;\n public didSafeExit: boolean = false;\n\n public story: Story;\n\n get currentPathString() {\n let pointer = this.currentPointer;\n if (pointer.isNull) {\n return null;\n } else {\n if (pointer.path === null) {\n return throwNullException(\"pointer.path\");\n }\n return pointer.path.toString();\n }\n }\n\n get currentPointer() {\n return this.callStack.currentElement.currentPointer.copy();\n }\n\n set currentPointer(value) {\n this.callStack.currentElement.currentPointer = value.copy();\n }\n\n get previousPointer() {\n return this.callStack.currentThread.previousPointer.copy();\n }\n\n set previousPointer(value) {\n this.callStack.currentThread.previousPointer = value.copy();\n }\n\n get canContinue() {\n return !this.currentPointer.isNull && !this.hasError;\n }\n\n get hasError() {\n return this.currentErrors != null && this.currentErrors.length > 0;\n }\n\n get hasWarning() {\n return this.currentWarnings != null && this.currentWarnings.length > 0;\n }\n\n get currentText() {\n if (this._outputStreamTextDirty) {\n let sb = new StringBuilder();\n\n let inTag: boolean = false;\n\n for (let outputObj of this.outputStream) {\n // var textContent = outputObj as StringValue;\n let textContent = asOrNull(outputObj, StringValue);\n if (!inTag && textContent !== null) {\n sb.Append(textContent.value);\n } else {\n let controlCommand = asOrNull(outputObj, ControlCommand);\n if (controlCommand !== null) {\n if (\n controlCommand.commandType == ControlCommand.CommandType.BeginTag\n ) {\n inTag = true;\n } else if (\n controlCommand.commandType == ControlCommand.CommandType.EndTag\n ) {\n inTag = false;\n }\n }\n }\n }\n\n this._currentText = this.CleanOutputWhitespace(sb.toString());\n this._outputStreamTextDirty = false;\n }\n\n return this._currentText;\n }\n private _currentText: string | null = null;\n\n public CleanOutputWhitespace(str: string) {\n let sb = new StringBuilder();\n\n let currentWhitespaceStart = -1;\n let startOfLine = 0;\n\n for (let i = 0; i < str.length; i++) {\n let c = str.charAt(i);\n\n let isInlineWhitespace = c == \" \" || c == \"\\t\";\n\n if (isInlineWhitespace && currentWhitespaceStart == -1)\n currentWhitespaceStart = i;\n\n if (!isInlineWhitespace) {\n if (\n c != \"\\n\" &&\n currentWhitespaceStart > 0 &&\n currentWhitespaceStart != startOfLine\n ) {\n sb.Append(\" \");\n }\n currentWhitespaceStart = -1;\n }\n\n if (c == \"\\n\") startOfLine = i + 1;\n\n if (!isInlineWhitespace) sb.Append(c);\n }\n\n return sb.toString();\n }\n\n get currentTags() {\n if (this._outputStreamTagsDirty) {\n this._currentTags = [];\n let inTag: boolean = false;\n let sb = new StringBuilder();\n\n for (let outputObj of this.outputStream) {\n let controlCommand = asOrNull(outputObj, ControlCommand);\n if (controlCommand != null) {\n if (\n controlCommand.commandType == ControlCommand.CommandType.BeginTag\n ) {\n if (inTag && sb.Length > 0) {\n let txt = this.CleanOutputWhitespace(sb.toString());\n this._currentTags.push(txt);\n sb.Clear();\n }\n inTag = true;\n } else if (\n controlCommand.commandType == ControlCommand.CommandType.EndTag\n ) {\n if (sb.Length > 0) {\n let txt = this.CleanOutputWhitespace(sb.toString());\n this._currentTags.push(txt);\n sb.Clear();\n }\n inTag = false;\n }\n } else if (inTag) {\n let strVal = asOrNull(outputObj, StringValue);\n if (strVal !== null) {\n sb.Append(strVal.value);\n }\n } else {\n let tag = asOrNull(outputObj, Tag);\n if (tag != null && tag.text != null && tag.text.length > 0) {\n this._currentTags.push(tag.text); // tag.text has whitespae already cleaned\n }\n }\n }\n\n if (sb.Length > 0) {\n let txt = this.CleanOutputWhitespace(sb.toString());\n this._currentTags.push(txt);\n sb.Clear();\n }\n\n this._outputStreamTagsDirty = false;\n }\n\n return this._currentTags;\n }\n private _currentTags: string[] | null = null;\n\n get currentFlowName() {\n return this._currentFlow.name;\n }\n\n get currentFlowIsDefaultFlow() {\n return this._currentFlow.name == this.kDefaultFlowName;\n }\n\n get aliveFlowNames() {\n if (this._aliveFlowNamesDirty) {\n this._aliveFlowNames = [];\n\n if (this._namedFlows != null) {\n for (let flowName of this._namedFlows.keys()) {\n if (flowName != this.kDefaultFlowName) {\n this._aliveFlowNames.push(flowName);\n }\n }\n }\n\n this._aliveFlowNamesDirty = false;\n }\n\n return this._aliveFlowNames;\n }\n\n get inExpressionEvaluation() {\n return this.callStack.currentElement.inExpressionEvaluation;\n }\n set inExpressionEvaluation(value) {\n this.callStack.currentElement.inExpressionEvaluation = value;\n }\n\n constructor(story: Story) {\n this.story = story;\n\n this._currentFlow = new Flow(this.kDefaultFlowName, story);\n this.OutputStreamDirty();\n\n this._aliveFlowNamesDirty = true;\n this._evaluationStack = [];\n\n this._variablesState = new VariablesState(\n this.callStack,\n story.listDefinitions\n );\n\n this._visitCounts = new Map();\n this._turnIndices = new Map();\n this.currentTurnIndex = -1;\n\n let timeSeed = new Date().getTime();\n this.storySeed = new PRNG(timeSeed).next() % 100;\n this.previousRandom = 0;\n\n this.GoToStart();\n }\n\n public GoToStart() {\n this.callStack.currentElement.currentPointer = Pointer.StartOf(\n this.story.mainContentContainer\n );\n }\n\n public SwitchFlow_Internal(flowName: string | null) {\n if (flowName === null)\n throw new Error(\"Must pass a non-null string to Story.SwitchFlow\");\n\n if (this._namedFlows === null) {\n this._namedFlows = new Map();\n this._namedFlows.set(this.kDefaultFlowName, this._currentFlow);\n }\n\n if (flowName === this._currentFlow.name) {\n return;\n }\n\n let flow: Flow;\n let content = tryGetValueFromMap(this._namedFlows, flowName, null);\n if (content.exists) {\n flow = content.result!;\n } else {\n flow = new Flow(flowName, this.story);\n this._namedFlows.set(flowName, flow);\n this._aliveFlowNamesDirty = true;\n }\n\n this._currentFlow = flow;\n this.variablesState.callStack = this._currentFlow.callStack;\n\n this.OutputStreamDirty();\n }\n\n public SwitchToDefaultFlow_Internal() {\n if (this._namedFlows === null) return;\n this.SwitchFlow_Internal(this.kDefaultFlowName);\n }\n\n public RemoveFlow_Internal(flowName: string | null) {\n if (flowName === null)\n throw new Error(\"Must pass a non-null string to Story.DestroyFlow\");\n if (flowName === this.kDefaultFlowName)\n throw new Error(\"Cannot destroy default flow\");\n\n if (this._currentFlow.name === flowName) {\n this.SwitchToDefaultFlow_Internal();\n }\n\n if (this._namedFlows === null)\n return throwNullException(\"this._namedFlows\");\n this._namedFlows.delete(flowName);\n this._aliveFlowNamesDirty = true;\n }\n\n public CopyAndStartPatching() {\n let copy = new StoryState(this.story);\n\n copy._patch = new StatePatch(this._patch);\n\n copy._currentFlow.name = this._currentFlow.name;\n copy._currentFlow.callStack = new CallStack(this._currentFlow.callStack);\n copy._currentFlow.currentChoices.push(...this._currentFlow.currentChoices);\n copy._currentFlow.outputStream.push(...this._currentFlow.outputStream);\n copy.OutputStreamDirty();\n\n if (this._namedFlows !== null) {\n copy._namedFlows = new Map();\n for (let [namedFlowKey, namedFlowValue] of this._namedFlows) {\n copy._namedFlows.set(namedFlowKey, namedFlowValue);\n copy._aliveFlowNamesDirty = true;\n }\n copy._namedFlows.set(this._currentFlow.name, copy._currentFlow);\n }\n\n if (this.hasError) {\n copy._currentErrors = [];\n copy._currentErrors.push(...(this.currentErrors || []));\n }\n\n if (this.hasWarning) {\n copy._currentWarnings = [];\n copy._currentWarnings.push(...(this.currentWarnings || []));\n }\n\n copy.variablesState = this.variablesState;\n copy.variablesState.callStack = copy.callStack;\n copy.variablesState.patch = copy._patch;\n\n copy.evaluationStack.push(...this.evaluationStack);\n\n if (!this.divertedPointer.isNull)\n copy.divertedPointer = this.divertedPointer.copy();\n\n copy.previousPointer = this.previousPointer.copy();\n\n copy._visitCounts = this._visitCounts;\n copy._turnIndices = this._turnIndices;\n\n copy.currentTurnIndex = this.currentTurnIndex;\n copy.storySeed = this.storySeed;\n copy.previousRandom = this.previousRandom;\n\n copy.didSafeExit = this.didSafeExit;\n\n return copy;\n }\n\n public RestoreAfterPatch() {\n this.variablesState.callStack = this.callStack;\n this.variablesState.patch = this._patch;\n }\n\n public ApplyAnyPatch() {\n if (this._patch === null) return;\n\n this.variablesState.ApplyPatch();\n\n for (let [key, value] of this._patch.visitCounts)\n this.ApplyCountChanges(key, value, true);\n\n for (let [key, value] of this._patch.turnIndices)\n this.ApplyCountChanges(key, value, false);\n\n this._patch = null;\n }\n\n public ApplyCountChanges(\n container: Container,\n newCount: number,\n isVisit: boolean\n ) {\n let counts = isVisit ? this._visitCounts : this._turnIndices;\n counts.set(container.path.toString(), newCount);\n }\n\n public WriteJson(writer: SimpleJson.Writer) {\n writer.WriteObjectStart();\n\n writer.WritePropertyStart(\"flows\");\n writer.WriteObjectStart();\n\n // NOTE: Never pass `WriteJson` directly as an argument to `WriteProperty`.\n // Call it inside a function to make sure `this` is correctly bound\n // and passed down the call hierarchy.\n\n if (this._namedFlows !== null) {\n for (let [namedFlowKey, namedFlowValue] of this._namedFlows) {\n writer.WriteProperty(namedFlowKey, (w) => namedFlowValue.WriteJson(w));\n }\n } else {\n writer.WriteProperty(this._currentFlow.name, (w) =>\n this._currentFlow.WriteJson(w)\n );\n }\n\n writer.WriteObjectEnd();\n writer.WritePropertyEnd();\n\n writer.WriteProperty(\"currentFlowName\", this._currentFlow.name);\n\n writer.WriteProperty(\"variablesState\", (w) =>\n this.variablesState.WriteJson(w)\n );\n\n writer.WriteProperty(\"evalStack\", (w) =>\n JsonSerialisation.WriteListRuntimeObjs(w, this.evaluationStack)\n );\n\n if (!this.divertedPointer.isNull) {\n if (this.divertedPointer.path === null) {\n return throwNullException(\"divertedPointer\");\n }\n writer.WriteProperty(\n \"currentDivertTarget\",\n this.divertedPointer.path.componentsString\n );\n }\n\n writer.WriteProperty(\"visitCounts\", (w) =>\n JsonSerialisation.WriteIntDictionary(w, this._visitCounts)\n );\n writer.WriteProperty(\"turnIndices\", (w) =>\n JsonSerialisation.WriteIntDictionary(w, this._turnIndices)\n );\n\n writer.WriteIntProperty(\"turnIdx\", this.currentTurnIndex);\n writer.WriteIntProperty(\"storySeed\", this.storySeed);\n writer.WriteIntProperty(\"previousRandom\", this.previousRandom);\n\n writer.WriteIntProperty(\"inkSaveVersion\", this.kInkSaveStateVersion);\n\n writer.WriteIntProperty(\"inkFormatVersion\", Story.inkVersionCurrent);\n\n writer.WriteObjectEnd();\n }\n\n public LoadJsonObj(value: Record) {\n let jObject = value;\n\n let jSaveVersion = jObject[\"inkSaveVersion\"];\n if (jSaveVersion == null) {\n throw new Error(\"ink save format incorrect, can't load.\");\n } else if (parseInt(jSaveVersion) < this.kMinCompatibleLoadVersion) {\n throw new Error(\n \"Ink save format isn't compatible with the current version (saw '\" +\n jSaveVersion +\n \"', but minimum is \" +\n this.kMinCompatibleLoadVersion +\n \"), so can't load.\"\n );\n }\n\n let flowsObj = jObject[\"flows\"];\n if (flowsObj != null) {\n let flowsObjDict = flowsObj as Record;\n\n // Single default flow\n if (Object.keys(flowsObjDict).length === 1) {\n this._namedFlows = null;\n } else if (this._namedFlows === null) {\n this._namedFlows = new Map();\n } else {\n this._namedFlows.clear();\n }\n\n let flowsObjDictEntries = Object.entries(flowsObjDict);\n for (let [namedFlowObjKey, namedFlowObjValue] of flowsObjDictEntries) {\n let name = namedFlowObjKey;\n let flowObj = namedFlowObjValue as Record;\n\n let flow = new Flow(name, this.story, flowObj);\n\n if (Object.keys(flowsObjDict).length === 1) {\n this._currentFlow = new Flow(name, this.story, flowObj);\n } else {\n if (this._namedFlows === null)\n return throwNullException(\"this._namedFlows\");\n this._namedFlows.set(name, flow);\n }\n }\n\n if (this._namedFlows != null && this._namedFlows.size > 1) {\n let currFlowName = jObject[\"currentFlowName\"] as string;\n // Adding a bang at the end, because we're trusting the save, as\n // done in upstream. If the save is corrupted, the execution\n // is undefined.\n this._currentFlow = this._namedFlows.get(currFlowName)!;\n }\n } else {\n this._namedFlows = null;\n this._currentFlow.name = this.kDefaultFlowName;\n this._currentFlow.callStack.SetJsonToken(\n jObject[\"callstackThreads\"] as Record,\n this.story\n );\n this._currentFlow.outputStream = JsonSerialisation.JArrayToRuntimeObjList(\n jObject[\"outputStream\"] as any[]\n );\n this._currentFlow.currentChoices =\n JsonSerialisation.JArrayToRuntimeObjList(\n jObject[\"currentChoices\"] as any[]\n ) as Choice[];\n\n let jChoiceThreadsObj = jObject[\"choiceThreads\"];\n this._currentFlow.LoadFlowChoiceThreads(jChoiceThreadsObj, this.story);\n }\n\n this.OutputStreamDirty();\n this._aliveFlowNamesDirty = true;\n\n this.variablesState.SetJsonToken(jObject[\"variablesState\"]);\n this.variablesState.callStack = this._currentFlow.callStack;\n\n this._evaluationStack = JsonSerialisation.JArrayToRuntimeObjList(\n jObject[\"evalStack\"]\n );\n\n let currentDivertTargetPath = jObject[\"currentDivertTarget\"];\n if (currentDivertTargetPath != null) {\n let divertPath = new Path(currentDivertTargetPath.toString());\n this.divertedPointer = this.story.PointerAtPath(divertPath);\n }\n\n this._visitCounts = JsonSerialisation.JObjectToIntDictionary(\n jObject[\"visitCounts\"]\n );\n this._turnIndices = JsonSerialisation.JObjectToIntDictionary(\n jObject[\"turnIndices\"]\n );\n this.currentTurnIndex = parseInt(jObject[\"turnIdx\"]);\n this.storySeed = parseInt(jObject[\"storySeed\"]);\n this.previousRandom = parseInt(jObject[\"previousRandom\"]);\n }\n\n public ResetErrors() {\n this._currentErrors = null;\n this._currentWarnings = null;\n }\n public ResetOutput(objs: InkObject[] | null = null) {\n this.outputStream.length = 0;\n if (objs !== null) this.outputStream.push(...objs);\n this.OutputStreamDirty();\n }\n\n public PushToOutputStream(obj: InkObject | null) {\n // var text = obj as StringValue;\n let text = asOrNull(obj, StringValue);\n if (text !== null) {\n let listText = this.TrySplittingHeadTailWhitespace(text);\n if (listText !== null) {\n for (let textObj of listText) {\n this.PushToOutputStreamIndividual(textObj);\n }\n this.OutputStreamDirty();\n return;\n }\n }\n\n this.PushToOutputStreamIndividual(obj);\n this.OutputStreamDirty();\n }\n\n public PopFromOutputStream(count: number) {\n this.outputStream.splice(this.outputStream.length - count, count);\n this.OutputStreamDirty();\n }\n\n public TrySplittingHeadTailWhitespace(single: StringValue) {\n let str = single.value;\n if (str === null) {\n return throwNullException(\"single.value\");\n }\n\n let headFirstNewlineIdx = -1;\n let headLastNewlineIdx = -1;\n for (let i = 0; i < str.length; i++) {\n let c = str[i];\n if (c == \"\\n\") {\n if (headFirstNewlineIdx == -1) headFirstNewlineIdx = i;\n headLastNewlineIdx = i;\n } else if (c == \" \" || c == \"\\t\") continue;\n else break;\n }\n\n let tailLastNewlineIdx = -1;\n let tailFirstNewlineIdx = -1;\n for (let i = str.length - 1; i >= 0; i--) {\n let c = str[i];\n if (c == \"\\n\") {\n if (tailLastNewlineIdx == -1) tailLastNewlineIdx = i;\n tailFirstNewlineIdx = i;\n } else if (c == \" \" || c == \"\\t\") continue;\n else break;\n }\n\n // No splitting to be done?\n if (headFirstNewlineIdx == -1 && tailLastNewlineIdx == -1) return null;\n\n let listTexts: StringValue[] = [];\n let innerStrStart = 0;\n let innerStrEnd = str.length;\n\n if (headFirstNewlineIdx != -1) {\n if (headFirstNewlineIdx > 0) {\n let leadingSpaces = new StringValue(\n str.substring(0, headFirstNewlineIdx)\n );\n listTexts.push(leadingSpaces);\n }\n listTexts.push(new StringValue(\"\\n\"));\n innerStrStart = headLastNewlineIdx + 1;\n }\n\n if (tailLastNewlineIdx != -1) {\n innerStrEnd = tailFirstNewlineIdx;\n }\n\n if (innerStrEnd > innerStrStart) {\n let innerStrText = str.substring(innerStrStart, innerStrEnd);\n listTexts.push(new StringValue(innerStrText));\n }\n\n if (tailLastNewlineIdx != -1 && tailFirstNewlineIdx > headLastNewlineIdx) {\n listTexts.push(new StringValue(\"\\n\"));\n if (tailLastNewlineIdx < str.length - 1) {\n let numSpaces = str.length - tailLastNewlineIdx - 1;\n let trailingSpaces = new StringValue(\n str.substring(\n tailLastNewlineIdx + 1,\n tailLastNewlineIdx + 1 + numSpaces\n )\n );\n listTexts.push(trailingSpaces);\n }\n }\n\n return listTexts;\n }\n\n public PushToOutputStreamIndividual(obj: InkObject | null) {\n let glue = asOrNull(obj, Glue);\n let text = asOrNull(obj, StringValue);\n\n let includeInOutput = true;\n\n if (glue) {\n this.TrimNewlinesFromOutputStream();\n includeInOutput = true;\n } else if (text) {\n let functionTrimIndex = -1;\n let currEl = this.callStack.currentElement;\n if (currEl.type == PushPopType.Function) {\n functionTrimIndex = currEl.functionStartInOutputStream;\n }\n\n let glueTrimIndex = -1;\n for (let i = this.outputStream.length - 1; i >= 0; i--) {\n let o = this.outputStream[i];\n let c = o instanceof ControlCommand ? o : null;\n let g = o instanceof Glue ? o : null;\n\n if (g != null) {\n glueTrimIndex = i;\n break;\n } else if (\n c != null &&\n c.commandType == ControlCommand.CommandType.BeginString\n ) {\n if (i >= functionTrimIndex) {\n functionTrimIndex = -1;\n }\n break;\n }\n }\n\n let trimIndex = -1;\n if (glueTrimIndex != -1 && functionTrimIndex != -1)\n trimIndex = Math.min(functionTrimIndex, glueTrimIndex);\n else if (glueTrimIndex != -1) trimIndex = glueTrimIndex;\n else trimIndex = functionTrimIndex;\n\n if (trimIndex != -1) {\n if (text.isNewline) {\n includeInOutput = false;\n } else if (text.isNonWhitespace) {\n if (glueTrimIndex > -1) this.RemoveExistingGlue();\n\n if (functionTrimIndex > -1) {\n let callStackElements = this.callStack.elements;\n for (let i = callStackElements.length - 1; i >= 0; i--) {\n let el = callStackElements[i];\n if (el.type == PushPopType.Function) {\n el.functionStartInOutputStream = -1;\n } else {\n break;\n }\n }\n }\n }\n } else if (text.isNewline) {\n if (this.outputStreamEndsInNewline || !this.outputStreamContainsContent)\n includeInOutput = false;\n }\n }\n\n if (includeInOutput) {\n if (obj === null) {\n return throwNullException(\"obj\");\n }\n this.outputStream.push(obj);\n this.OutputStreamDirty();\n }\n }\n\n public TrimNewlinesFromOutputStream() {\n let removeWhitespaceFrom = -1;\n\n let i = this.outputStream.length - 1;\n while (i >= 0) {\n let obj = this.outputStream[i];\n let cmd = asOrNull(obj, ControlCommand);\n let txt = asOrNull(obj, StringValue);\n\n if (cmd != null || (txt != null && txt.isNonWhitespace)) {\n break;\n } else if (txt != null && txt.isNewline) {\n removeWhitespaceFrom = i;\n }\n i--;\n }\n\n // Remove the whitespace\n if (removeWhitespaceFrom >= 0) {\n i = removeWhitespaceFrom;\n while (i < this.outputStream.length) {\n let text = asOrNull(this.outputStream[i], StringValue);\n if (text) {\n this.outputStream.splice(i, 1);\n } else {\n i++;\n }\n }\n }\n\n this.OutputStreamDirty();\n }\n\n public RemoveExistingGlue() {\n for (let i = this.outputStream.length - 1; i >= 0; i--) {\n let c = this.outputStream[i];\n if (c instanceof Glue) {\n this.outputStream.splice(i, 1);\n } else if (c instanceof ControlCommand) {\n break;\n }\n }\n\n this.OutputStreamDirty();\n }\n\n get outputStreamEndsInNewline() {\n if (this.outputStream.length > 0) {\n for (let i = this.outputStream.length - 1; i >= 0; i--) {\n let obj = this.outputStream[i];\n if (obj instanceof ControlCommand) break;\n let text = this.outputStream[i];\n if (text instanceof StringValue) {\n if (text.isNewline) return true;\n else if (text.isNonWhitespace) break;\n }\n }\n }\n\n return false;\n }\n\n get outputStreamContainsContent() {\n for (let content of this.outputStream) {\n if (content instanceof StringValue) return true;\n }\n return false;\n }\n\n get inStringEvaluation() {\n for (let i = this.outputStream.length - 1; i >= 0; i--) {\n let cmd = asOrNull(this.outputStream[i], ControlCommand);\n if (\n cmd instanceof ControlCommand &&\n cmd.commandType == ControlCommand.CommandType.BeginString\n ) {\n return true;\n }\n }\n\n return false;\n }\n\n public PushEvaluationStack(obj: InkObject | null) {\n // var listValue = obj as ListValue;\n let listValue = asOrNull(obj, ListValue);\n if (listValue) {\n // Update origin when list is has something to indicate the list origin\n let rawList = listValue.value;\n if (rawList === null) {\n return throwNullException(\"rawList\");\n }\n\n if (rawList.originNames != null) {\n if (!rawList.origins) rawList.origins = [];\n rawList.origins.length = 0;\n\n for (let n of rawList.originNames) {\n if (this.story.listDefinitions === null)\n return throwNullException(\"StoryState.story.listDefinitions\");\n let def = this.story.listDefinitions.TryListGetDefinition(n, null);\n if (def.result === null)\n return throwNullException(\"StoryState def.result\");\n if (rawList.origins.indexOf(def.result) < 0)\n rawList.origins.push(def.result);\n }\n }\n }\n\n if (obj === null) {\n return throwNullException(\"obj\");\n }\n this.evaluationStack.push(obj);\n }\n\n public PopEvaluationStack(): InkObject;\n public PopEvaluationStack(numberOfObjects: number): InkObject[];\n public PopEvaluationStack(numberOfObjects?: number) {\n if (typeof numberOfObjects === \"undefined\") {\n let obj = this.evaluationStack.pop();\n return nullIfUndefined(obj);\n } else {\n if (numberOfObjects > this.evaluationStack.length) {\n throw new Error(\"trying to pop too many objects\");\n }\n\n let popped = this.evaluationStack.splice(\n this.evaluationStack.length - numberOfObjects,\n numberOfObjects\n );\n return nullIfUndefined(popped);\n }\n }\n\n public PeekEvaluationStack() {\n return this.evaluationStack[this.evaluationStack.length - 1];\n }\n\n public ForceEnd() {\n this.callStack.Reset();\n\n this._currentFlow.currentChoices.length = 0;\n\n this.currentPointer = Pointer.Null;\n this.previousPointer = Pointer.Null;\n\n this.didSafeExit = true;\n }\n\n public TrimWhitespaceFromFunctionEnd() {\n Debug.Assert(this.callStack.currentElement.type == PushPopType.Function);\n let functionStartPoint =\n this.callStack.currentElement.functionStartInOutputStream;\n\n if (functionStartPoint == -1) {\n functionStartPoint = 0;\n }\n\n for (let i = this.outputStream.length - 1; i >= functionStartPoint; i--) {\n let obj = this.outputStream[i];\n let txt = asOrNull(obj, StringValue);\n let cmd = asOrNull(obj, ControlCommand);\n\n if (txt == null) continue;\n if (cmd) break;\n\n if (txt.isNewline || txt.isInlineWhitespace) {\n this.outputStream.splice(i, 1);\n this.OutputStreamDirty();\n } else {\n break;\n }\n }\n }\n\n public PopCallStack(popType: PushPopType | null = null) {\n if (this.callStack.currentElement.type == PushPopType.Function)\n this.TrimWhitespaceFromFunctionEnd();\n\n this.callStack.Pop(popType);\n }\n\n public SetChosenPath(path: Path, incrementingTurnIndex: boolean) {\n // Changing direction, assume we need to clear current set of choices\n this._currentFlow.currentChoices.length = 0;\n\n let newPointer = this.story.PointerAtPath(path);\n if (!newPointer.isNull && newPointer.index == -1) newPointer.index = 0;\n\n this.currentPointer = newPointer;\n\n if (incrementingTurnIndex) {\n this.currentTurnIndex++;\n }\n }\n\n public StartFunctionEvaluationFromGame(\n funcContainer: Container,\n args: any[]\n ) {\n this.callStack.Push(\n PushPopType.FunctionEvaluationFromGame,\n this.evaluationStack.length\n );\n this.callStack.currentElement.currentPointer =\n Pointer.StartOf(funcContainer);\n\n this.PassArgumentsToEvaluationStack(args);\n }\n\n public PassArgumentsToEvaluationStack(args: any[] | null) {\n if (args !== null) {\n for (let i = 0; i < args.length; i++) {\n if (\n !(\n typeof args[i] === \"number\" ||\n typeof args[i] === \"string\" ||\n typeof args[i] === \"boolean\" ||\n args[i] instanceof InkList\n )\n ) {\n throw new Error(\n \"ink arguments when calling EvaluateFunction / ChoosePathStringWithParameters must be\" +\n \"number, string, bool or InkList. Argument was \" +\n (nullIfUndefined(args[i]) === null\n ? \"null\"\n : args[i].constructor.name)\n );\n }\n\n this.PushEvaluationStack(Value.Create(args[i]));\n }\n }\n }\n\n public TryExitFunctionEvaluationFromGame() {\n if (\n this.callStack.currentElement.type ==\n PushPopType.FunctionEvaluationFromGame\n ) {\n this.currentPointer = Pointer.Null;\n this.didSafeExit = true;\n return true;\n }\n\n return false;\n }\n\n public CompleteFunctionEvaluationFromGame() {\n if (\n this.callStack.currentElement.type !=\n PushPopType.FunctionEvaluationFromGame\n ) {\n throw new Error(\n \"Expected external function evaluation to be complete. Stack trace: \" +\n this.callStack.callStackTrace\n );\n }\n\n let originalEvaluationStackHeight =\n this.callStack.currentElement.evaluationStackHeightWhenPushed;\n\n let returnedObj: InkObject | null = null;\n while (this.evaluationStack.length > originalEvaluationStackHeight) {\n let poppedObj = this.PopEvaluationStack();\n if (returnedObj === null) returnedObj = poppedObj;\n }\n\n this.PopCallStack(PushPopType.FunctionEvaluationFromGame);\n\n if (returnedObj) {\n if (returnedObj instanceof Void) return null;\n\n // Some kind of value, if not void\n // var returnVal = returnedObj as Runtime.Value;\n let returnVal = asOrThrows(returnedObj, Value);\n\n // DivertTargets get returned as the string of components\n // (rather than a Path, which isn't public)\n if (returnVal.valueType == ValueType.DivertTarget) {\n return returnVal.valueObject.toString();\n }\n\n // Other types can just have their exact object type:\n // int, float, string. VariablePointers get returned as strings.\n return returnVal.valueObject;\n }\n\n return null;\n }\n\n public AddError(message: string, isWarning: boolean) {\n if (!isWarning) {\n if (this._currentErrors == null) this._currentErrors = [];\n this._currentErrors.push(message);\n } else {\n if (this._currentWarnings == null) this._currentWarnings = [];\n this._currentWarnings.push(message);\n }\n }\n\n public OutputStreamDirty() {\n this._outputStreamTextDirty = true;\n this._outputStreamTagsDirty = true;\n }\n\n private _visitCounts: Map;\n private _turnIndices: Map;\n\n private _outputStreamTextDirty = true;\n private _outputStreamTagsDirty = true;\n\n private _patch: StatePatch | null = null;\n\n private _currentFlow: Flow;\n private _aliveFlowNames: string[] | null = null;\n private _namedFlows: Map | null = null;\n private readonly kDefaultFlowName = \"DEFAULT_FLOW\";\n private _aliveFlowNamesDirty: boolean = true;\n}\n","// This is simple replacement of the Stopwatch class from the .NET Framework.\n// The original class can count time with much more accuracy than the Javascript version.\n// It might be worth considering using `window.performance` in the browser\n// or `process.hrtime()` in node.\nexport class Stopwatch {\n private startTime: number | undefined;\n\n constructor() {\n this.startTime = undefined;\n }\n\n get ElapsedMilliseconds(): number {\n if (typeof this.startTime === \"undefined\") {\n return 0;\n }\n return new Date().getTime() - this.startTime;\n }\n\n public Start() {\n this.startTime = new Date().getTime();\n }\n public Stop() {\n this.startTime = undefined;\n }\n}\n","import { Container } from \"./Container\";\nimport { InkObject } from \"./Object\";\nimport { JsonSerialisation } from \"./JsonSerialisation\";\nimport { StoryState } from \"./StoryState\";\nimport { ControlCommand } from \"./ControlCommand\";\nimport { PushPopType } from \"./PushPop\";\nimport { ChoicePoint } from \"./ChoicePoint\";\nimport { Choice } from \"./Choice\";\nimport { Divert } from \"./Divert\";\nimport {\n Value,\n StringValue,\n IntValue,\n DivertTargetValue,\n VariablePointerValue,\n ListValue,\n} from \"./Value\";\nimport { Path } from \"./Path\";\nimport { Void } from \"./Void\";\nimport { Tag } from \"./Tag\";\nimport { VariableAssignment } from \"./VariableAssignment\";\nimport { VariableReference } from \"./VariableReference\";\nimport { NativeFunctionCall } from \"./NativeFunctionCall\";\nimport { StoryException } from \"./StoryException\";\nimport { PRNG } from \"./PRNG\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { ListDefinitionsOrigin } from \"./ListDefinitionsOrigin\";\nimport { ListDefinition } from \"./ListDefinition\";\nimport { Stopwatch } from \"./StopWatch\";\nimport { Pointer } from \"./Pointer\";\nimport { InkList, InkListItem, KeyValuePair } from \"./InkList\";\nimport { asOrNull, asOrThrows } from \"./TypeAssertion\";\nimport { DebugMetadata } from \"./DebugMetadata\";\nimport { throwNullException } from \"./NullException\";\nimport { SimpleJson } from \"./SimpleJson\";\nimport { ErrorHandler, ErrorType } from \"./Error\";\n\nexport { InkList } from \"./InkList\";\n\nif (!Number.isInteger) {\n Number.isInteger = function isInteger(nVal: any) {\n return (\n typeof nVal === \"number\" &&\n isFinite(nVal) &&\n nVal > -9007199254740992 &&\n nVal < 9007199254740992 &&\n Math.floor(nVal) === nVal\n );\n };\n}\n\nexport class Story extends InkObject {\n public static inkVersionCurrent = 21;\n\n public inkVersionMinimumCompatible = 18;\n\n get currentChoices() {\n let choices: Choice[] = [];\n\n if (this._state === null) {\n return throwNullException(\"this._state\");\n }\n for (let c of this._state.currentChoices) {\n if (!c.isInvisibleDefault) {\n c.index = choices.length;\n choices.push(c);\n }\n }\n\n return choices;\n }\n\n get currentText() {\n this.IfAsyncWeCant(\"call currentText since it's a work in progress\");\n return this.state.currentText;\n }\n\n get currentTags() {\n this.IfAsyncWeCant(\"call currentTags since it's a work in progress\");\n return this.state.currentTags;\n }\n\n get currentErrors() {\n return this.state.currentErrors;\n }\n\n get currentWarnings() {\n return this.state.currentWarnings;\n }\n\n get currentFlowName() {\n return this.state.currentFlowName;\n }\n\n get currentFlowIsDefaultFlow() {\n return this.state.currentFlowIsDefaultFlow;\n }\n\n get aliveFlowNames() {\n return this.state.aliveFlowNames;\n }\n\n get hasError() {\n return this.state.hasError;\n }\n\n get hasWarning() {\n return this.state.hasWarning;\n }\n\n get variablesState() {\n return this.state.variablesState;\n }\n\n get listDefinitions() {\n return this._listDefinitions;\n }\n\n get state() {\n return this._state;\n }\n\n public onError: ErrorHandler | null = null;\n\n public onDidContinue: (() => void) | null = null;\n\n public onMakeChoice: ((arg1: Choice) => void) | null = null;\n\n public onEvaluateFunction: ((arg1: string, arg2: any[]) => void) | null =\n null;\n\n public onCompleteEvaluateFunction:\n | ((arg1: string, arg2: any[], arg3: string, arg4: any) => void)\n | null = null;\n\n public onChoosePathString: ((arg1: string, arg2: any[]) => void) | null =\n null;\n\n // TODO: Implement Profiler\n public StartProfiling() {\n /* */\n }\n public EndProfiling() {\n /* */\n }\n\n constructor(contentContainer: Container, lists: ListDefinition[] | null);\n constructor(jsonString: string);\n constructor(json: Record);\n constructor() {\n super();\n\n // Discrimination between constructors\n let contentContainer: Container;\n let lists: ListDefinition[] | null = null;\n let json: Record | null = null;\n\n if (arguments[0] instanceof Container) {\n contentContainer = arguments[0] as Container;\n\n if (typeof arguments[1] !== \"undefined\") {\n lists = arguments[1] as ListDefinition[];\n }\n\n // ------ Story (Container contentContainer, List lists = null)\n this._mainContentContainer = contentContainer;\n // ------\n } else {\n if (typeof arguments[0] === \"string\") {\n let jsonString = arguments[0] as string;\n json = SimpleJson.TextToDictionary(jsonString);\n } else {\n json = arguments[0] as Record;\n }\n }\n\n // ------ Story (Container contentContainer, List lists = null)\n if (lists != null) this._listDefinitions = new ListDefinitionsOrigin(lists);\n\n this._externals = new Map();\n // ------\n\n // ------ Story(string jsonString) : this((Container)null)\n if (json !== null) {\n let rootObject: Record = json;\n\n let versionObj = rootObject[\"inkVersion\"];\n if (versionObj == null)\n throw new Error(\n \"ink version number not found. Are you sure it's a valid .ink.json file?\"\n );\n\n let formatFromFile = parseInt(versionObj);\n if (formatFromFile > Story.inkVersionCurrent) {\n throw new Error(\n \"Version of ink used to build story was newer than the current version of the engine\"\n );\n } else if (formatFromFile < this.inkVersionMinimumCompatible) {\n throw new Error(\n \"Version of ink used to build story is too old to be loaded by this version of the engine\"\n );\n } else if (formatFromFile != Story.inkVersionCurrent) {\n console.warn(\n \"WARNING: Version of ink used to build story doesn't match current version of engine. Non-critical, but recommend synchronising.\"\n );\n }\n\n let rootToken = rootObject[\"root\"];\n if (rootToken == null)\n throw new Error(\n \"Root node for ink not found. Are you sure it's a valid .ink.json file?\"\n );\n\n let listDefsObj;\n if ((listDefsObj = rootObject[\"listDefs\"])) {\n this._listDefinitions =\n JsonSerialisation.JTokenToListDefinitions(listDefsObj);\n }\n\n this._mainContentContainer = asOrThrows(\n JsonSerialisation.JTokenToRuntimeObject(rootToken),\n Container\n );\n\n this.ResetState();\n }\n // ------\n }\n\n // Merge together `public string ToJson()` and `void ToJson(SimpleJson.Writer writer)`.\n // Will only return a value if writer was not provided.\n public ToJson(writer?: SimpleJson.Writer): string | void {\n let shouldReturn = false;\n\n if (!writer) {\n shouldReturn = true;\n writer = new SimpleJson.Writer();\n }\n\n writer.WriteObjectStart();\n\n writer.WriteIntProperty(\"inkVersion\", Story.inkVersionCurrent);\n\n writer.WriteProperty(\"root\", (w) =>\n JsonSerialisation.WriteRuntimeContainer(w, this._mainContentContainer)\n );\n\n if (this._listDefinitions != null) {\n writer.WritePropertyStart(\"listDefs\");\n writer.WriteObjectStart();\n\n for (let def of this._listDefinitions.lists) {\n writer.WritePropertyStart(def.name);\n writer.WriteObjectStart();\n\n for (let [key, value] of def.items) {\n let item = InkListItem.fromSerializedKey(key);\n let val = value;\n writer.WriteIntProperty(item.itemName, val);\n }\n\n writer.WriteObjectEnd();\n writer.WritePropertyEnd();\n }\n\n writer.WriteObjectEnd();\n writer.WritePropertyEnd();\n }\n\n writer.WriteObjectEnd();\n\n if (shouldReturn) return writer.toString();\n }\n\n public ResetState() {\n this.IfAsyncWeCant(\"ResetState\");\n\n this._state = new StoryState(this);\n this._state.variablesState.ObserveVariableChange(\n this.VariableStateDidChangeEvent.bind(this)\n );\n\n this.ResetGlobals();\n }\n\n public ResetErrors() {\n if (this._state === null) {\n return throwNullException(\"this._state\");\n }\n this._state.ResetErrors();\n }\n\n public ResetCallstack() {\n this.IfAsyncWeCant(\"ResetCallstack\");\n if (this._state === null) {\n return throwNullException(\"this._state\");\n }\n this._state.ForceEnd();\n }\n\n public ResetGlobals() {\n if (this._mainContentContainer.namedContent.get(\"global decl\")) {\n let originalPointer = this.state.currentPointer.copy();\n\n this.ChoosePath(new Path(\"global decl\"), false);\n\n this.ContinueInternal();\n\n this.state.currentPointer = originalPointer;\n }\n\n this.state.variablesState.SnapshotDefaultGlobals();\n }\n\n public SwitchFlow(flowName: string) {\n this.IfAsyncWeCant(\"switch flow\");\n if (this._asyncSaving) {\n throw new Error(\n \"Story is already in background saving mode, can't switch flow to \" +\n flowName\n );\n }\n\n this.state.SwitchFlow_Internal(flowName);\n }\n\n public RemoveFlow(flowName: string) {\n this.state.RemoveFlow_Internal(flowName);\n }\n\n public SwitchToDefaultFlow() {\n this.state.SwitchToDefaultFlow_Internal();\n }\n\n public Continue() {\n this.ContinueAsync(0);\n return this.currentText;\n }\n\n get canContinue() {\n return this.state.canContinue;\n }\n\n get asyncContinueComplete() {\n return !this._asyncContinueActive;\n }\n\n public ContinueAsync(millisecsLimitAsync: number) {\n if (!this._hasValidatedExternals) this.ValidateExternalBindings();\n\n this.ContinueInternal(millisecsLimitAsync);\n }\n\n public ContinueInternal(millisecsLimitAsync = 0) {\n if (this._profiler != null) this._profiler.PreContinue();\n\n let isAsyncTimeLimited = millisecsLimitAsync > 0;\n this._recursiveContinueCount++;\n\n if (!this._asyncContinueActive) {\n this._asyncContinueActive = isAsyncTimeLimited;\n\n if (!this.canContinue) {\n throw new Error(\n \"Can't continue - should check canContinue before calling Continue\"\n );\n }\n\n this._state.didSafeExit = false;\n this._state.ResetOutput();\n\n if (this._recursiveContinueCount == 1)\n this._state.variablesState.batchObservingVariableChanges = true;\n }\n\n let durationStopwatch = new Stopwatch();\n durationStopwatch.Start();\n\n let outputStreamEndsInNewline = false;\n this._sawLookaheadUnsafeFunctionAfterNewline = false;\n do {\n try {\n outputStreamEndsInNewline = this.ContinueSingleStep();\n } catch (e) {\n if (!(e instanceof StoryException)) throw e;\n\n this.AddError(e.message, undefined, e.useEndLineNumber);\n break;\n }\n\n if (outputStreamEndsInNewline) break;\n\n if (\n this._asyncContinueActive &&\n durationStopwatch.ElapsedMilliseconds > millisecsLimitAsync\n ) {\n break;\n }\n } while (this.canContinue);\n\n durationStopwatch.Stop();\n\n if (outputStreamEndsInNewline || !this.canContinue) {\n if (this._stateSnapshotAtLastNewline !== null) {\n this.RestoreStateSnapshot();\n }\n\n if (!this.canContinue) {\n if (this.state.callStack.canPopThread)\n this.AddError(\n \"Thread available to pop, threads should always be flat by the end of evaluation?\"\n );\n\n if (\n this.state.generatedChoices.length == 0 &&\n !this.state.didSafeExit &&\n this._temporaryEvaluationContainer == null\n ) {\n if (this.state.callStack.CanPop(PushPopType.Tunnel))\n this.AddError(\n \"unexpectedly reached end of content. Do you need a '->->' to return from a tunnel?\"\n );\n else if (this.state.callStack.CanPop(PushPopType.Function))\n this.AddError(\n \"unexpectedly reached end of content. Do you need a '~ return'?\"\n );\n else if (!this.state.callStack.canPop)\n this.AddError(\n \"ran out of content. Do you need a '-> DONE' or '-> END'?\"\n );\n else\n this.AddError(\n \"unexpectedly reached end of content for unknown reason. Please debug compiler!\"\n );\n }\n }\n\n this.state.didSafeExit = false;\n this._sawLookaheadUnsafeFunctionAfterNewline = false;\n\n if (this._recursiveContinueCount == 1)\n this._state.variablesState.batchObservingVariableChanges = false;\n\n this._asyncContinueActive = false;\n if (this.onDidContinue !== null) this.onDidContinue();\n }\n\n this._recursiveContinueCount--;\n\n if (this._profiler != null) this._profiler.PostContinue();\n\n // In the following code, we're masking a lot of non-null assertion,\n // because testing for against `hasError` or `hasWarning` makes sure\n // the arrays are present and contain at least one element.\n if (this.state.hasError || this.state.hasWarning) {\n if (this.onError !== null) {\n if (this.state.hasError) {\n for (let err of this.state.currentErrors!) {\n this.onError(err, ErrorType.Error);\n }\n }\n if (this.state.hasWarning) {\n for (let err of this.state.currentWarnings!) {\n this.onError(err, ErrorType.Warning);\n }\n }\n this.ResetErrors();\n } else {\n let sb = new StringBuilder();\n sb.Append(\"Ink had \");\n if (this.state.hasError) {\n sb.Append(`${this.state.currentErrors!.length}`);\n sb.Append(\n this.state.currentErrors!.length == 1 ? \" error\" : \"errors\"\n );\n if (this.state.hasWarning) sb.Append(\" and \");\n }\n if (this.state.hasWarning) {\n sb.Append(`${this.state.currentWarnings!.length}`);\n sb.Append(\n this.state.currentWarnings!.length == 1 ? \" warning\" : \"warnings\"\n );\n if (this.state.hasWarning) sb.Append(\" and \");\n }\n sb.Append(\n \". It is strongly suggested that you assign an error handler to story.onError. The first issue was: \"\n );\n sb.Append(\n this.state.hasError\n ? this.state.currentErrors![0]\n : this.state.currentWarnings![0]\n );\n\n throw new StoryException(sb.toString());\n }\n }\n }\n\n public ContinueSingleStep() {\n if (this._profiler != null) this._profiler.PreStep();\n\n this.Step();\n\n if (this._profiler != null) this._profiler.PostStep();\n\n if (!this.canContinue && !this.state.callStack.elementIsEvaluateFromGame) {\n this.TryFollowDefaultInvisibleChoice();\n }\n\n if (this._profiler != null) this._profiler.PreSnapshot();\n\n if (!this.state.inStringEvaluation) {\n if (this._stateSnapshotAtLastNewline !== null) {\n if (this._stateSnapshotAtLastNewline.currentTags === null) {\n return throwNullException(\"this._stateAtLastNewline.currentTags\");\n }\n if (this.state.currentTags === null) {\n return throwNullException(\"this.state.currentTags\");\n }\n\n let change = this.CalculateNewlineOutputStateChange(\n this._stateSnapshotAtLastNewline.currentText,\n this.state.currentText,\n this._stateSnapshotAtLastNewline.currentTags.length,\n this.state.currentTags.length\n );\n\n if (\n change == Story.OutputStateChange.ExtendedBeyondNewline ||\n this._sawLookaheadUnsafeFunctionAfterNewline\n ) {\n this.RestoreStateSnapshot();\n\n return true;\n } else if (change == Story.OutputStateChange.NewlineRemoved) {\n this.DiscardSnapshot();\n }\n }\n\n if (this.state.outputStreamEndsInNewline) {\n if (this.canContinue) {\n if (this._stateSnapshotAtLastNewline == null) this.StateSnapshot();\n } else {\n this.DiscardSnapshot();\n }\n }\n }\n\n if (this._profiler != null) this._profiler.PostSnapshot();\n\n return false;\n }\n\n public CalculateNewlineOutputStateChange(\n prevText: string | null,\n currText: string | null,\n prevTagCount: number,\n currTagCount: number\n ) {\n if (prevText === null) {\n return throwNullException(\"prevText\");\n }\n if (currText === null) {\n return throwNullException(\"currText\");\n }\n\n let newlineStillExists =\n currText.length >= prevText.length &&\n prevText.length > 0 &&\n currText.charAt(prevText.length - 1) == \"\\n\";\n if (\n prevTagCount == currTagCount &&\n prevText.length == currText.length &&\n newlineStillExists\n )\n return Story.OutputStateChange.NoChange;\n\n if (!newlineStillExists) {\n return Story.OutputStateChange.NewlineRemoved;\n }\n\n if (currTagCount > prevTagCount)\n return Story.OutputStateChange.ExtendedBeyondNewline;\n\n for (let i = prevText.length; i < currText.length; i++) {\n let c = currText.charAt(i);\n if (c != \" \" && c != \"\\t\") {\n return Story.OutputStateChange.ExtendedBeyondNewline;\n }\n }\n\n return Story.OutputStateChange.NoChange;\n }\n\n public ContinueMaximally() {\n this.IfAsyncWeCant(\"ContinueMaximally\");\n\n let sb = new StringBuilder();\n\n while (this.canContinue) {\n sb.Append(this.Continue());\n }\n\n return sb.toString();\n }\n\n public ContentAtPath(path: Path) {\n return this.mainContentContainer.ContentAtPath(path);\n }\n\n public KnotContainerWithName(name: string) {\n let namedContainer = this.mainContentContainer.namedContent.get(name);\n if (namedContainer instanceof Container) return namedContainer;\n else return null;\n }\n\n public PointerAtPath(path: Path) {\n if (path.length == 0) return Pointer.Null;\n\n let p = new Pointer();\n\n let pathLengthToUse = path.length;\n\n let result = null;\n if (path.lastComponent === null) {\n return throwNullException(\"path.lastComponent\");\n }\n\n if (path.lastComponent.isIndex) {\n pathLengthToUse = path.length - 1;\n result = this.mainContentContainer.ContentAtPath(\n path,\n undefined,\n pathLengthToUse\n );\n p.container = result.container;\n p.index = path.lastComponent.index;\n } else {\n result = this.mainContentContainer.ContentAtPath(path);\n p.container = result.container;\n p.index = -1;\n }\n\n if (\n result.obj == null ||\n (result.obj == this.mainContentContainer && pathLengthToUse > 0)\n ) {\n this.Error(\n \"Failed to find content at path '\" +\n path +\n \"', and no approximation of it was possible.\"\n );\n } else if (result.approximate)\n this.Warning(\n \"Failed to find content at path '\" +\n path +\n \"', so it was approximated to: '\" +\n result.obj.path +\n \"'.\"\n );\n\n return p;\n }\n\n public StateSnapshot() {\n this._stateSnapshotAtLastNewline = this._state;\n this._state = this._state.CopyAndStartPatching();\n }\n\n public RestoreStateSnapshot() {\n if (this._stateSnapshotAtLastNewline === null) {\n throwNullException(\"_stateSnapshotAtLastNewline\");\n }\n this._stateSnapshotAtLastNewline.RestoreAfterPatch();\n\n this._state = this._stateSnapshotAtLastNewline;\n this._stateSnapshotAtLastNewline = null;\n\n if (!this._asyncSaving) {\n this._state.ApplyAnyPatch();\n }\n }\n\n public DiscardSnapshot() {\n if (!this._asyncSaving) this._state.ApplyAnyPatch();\n\n this._stateSnapshotAtLastNewline = null;\n }\n\n public CopyStateForBackgroundThreadSave() {\n this.IfAsyncWeCant(\"start saving on a background thread\");\n\n if (this._asyncSaving)\n throw new Error(\n \"Story is already in background saving mode, can't call CopyStateForBackgroundThreadSave again!\"\n );\n\n let stateToSave = this._state;\n this._state = this._state.CopyAndStartPatching();\n this._asyncSaving = true;\n return stateToSave;\n }\n\n public BackgroundSaveComplete() {\n if (this._stateSnapshotAtLastNewline === null) {\n this._state.ApplyAnyPatch();\n }\n\n this._asyncSaving = false;\n }\n\n public Step() {\n let shouldAddToStream = true;\n\n let pointer = this.state.currentPointer.copy();\n if (pointer.isNull) {\n return;\n }\n\n // Container containerToEnter = pointer.Resolve () as Container;\n let containerToEnter = asOrNull(pointer.Resolve(), Container);\n\n while (containerToEnter) {\n this.VisitContainer(containerToEnter, true);\n\n // No content? the most we can do is step past it\n if (containerToEnter.content.length == 0) {\n break;\n }\n\n pointer = Pointer.StartOf(containerToEnter);\n // containerToEnter = pointer.Resolve() as Container;\n containerToEnter = asOrNull(pointer.Resolve(), Container);\n }\n\n this.state.currentPointer = pointer.copy();\n\n if (this._profiler != null) this._profiler.Step(this.state.callStack);\n\n // Is the current content object:\n // - Normal content\n // - Or a logic/flow statement - if so, do it\n // Stop flow if we hit a stack pop when we're unable to pop (e.g. return/done statement in knot\n // that was diverted to rather than called as a function)\n let currentContentObj = pointer.Resolve();\n let isLogicOrFlowControl =\n this.PerformLogicAndFlowControl(currentContentObj);\n\n // Has flow been forced to end by flow control above?\n if (this.state.currentPointer.isNull) {\n return;\n }\n\n if (isLogicOrFlowControl) {\n shouldAddToStream = false;\n }\n\n // Choice with condition?\n // var choicePoint = currentContentObj as ChoicePoint;\n let choicePoint = asOrNull(currentContentObj, ChoicePoint);\n if (choicePoint) {\n let choice = this.ProcessChoice(choicePoint);\n if (choice) {\n this.state.generatedChoices.push(choice);\n }\n\n currentContentObj = null;\n shouldAddToStream = false;\n }\n\n // If the container has no content, then it will be\n // the \"content\" itself, but we skip over it.\n if (currentContentObj instanceof Container) {\n shouldAddToStream = false;\n }\n\n // Content to add to evaluation stack or the output stream\n if (shouldAddToStream) {\n // If we're pushing a variable pointer onto the evaluation stack, ensure that it's specific\n // to our current (possibly temporary) context index. And make a copy of the pointer\n // so that we're not editing the original runtime object.\n // var varPointer = currentContentObj as VariablePointerValue;\n let varPointer = asOrNull(currentContentObj, VariablePointerValue);\n if (varPointer && varPointer.contextIndex == -1) {\n // Create new object so we're not overwriting the story's own data\n let contextIdx = this.state.callStack.ContextForVariableNamed(\n varPointer.variableName\n );\n currentContentObj = new VariablePointerValue(\n varPointer.variableName,\n contextIdx\n );\n }\n\n // Expression evaluation content\n if (this.state.inExpressionEvaluation) {\n this.state.PushEvaluationStack(currentContentObj);\n }\n // Output stream content (i.e. not expression evaluation)\n else {\n this.state.PushToOutputStream(currentContentObj);\n }\n }\n\n // Increment the content pointer, following diverts if necessary\n this.NextContent();\n\n // Starting a thread should be done after the increment to the content pointer,\n // so that when returning from the thread, it returns to the content after this instruction.\n // var controlCmd = currentContentObj as ;\n let controlCmd = asOrNull(currentContentObj, ControlCommand);\n if (\n controlCmd &&\n controlCmd.commandType == ControlCommand.CommandType.StartThread\n ) {\n this.state.callStack.PushThread();\n }\n }\n\n public VisitContainer(container: Container, atStart: boolean) {\n if (!container.countingAtStartOnly || atStart) {\n if (container.visitsShouldBeCounted)\n this.state.IncrementVisitCountForContainer(container);\n\n if (container.turnIndexShouldBeCounted)\n this.state.RecordTurnIndexVisitToContainer(container);\n }\n }\n\n private _prevContainers: Container[] = [];\n public VisitChangedContainersDueToDivert() {\n let previousPointer = this.state.previousPointer.copy();\n let pointer = this.state.currentPointer.copy();\n\n if (pointer.isNull || pointer.index == -1) return;\n\n this._prevContainers.length = 0;\n if (!previousPointer.isNull) {\n // Container prevAncestor = previousPointer.Resolve() as Container ?? previousPointer.container as Container;\n let resolvedPreviousAncestor = previousPointer.Resolve();\n let prevAncestor =\n asOrNull(resolvedPreviousAncestor, Container) ||\n asOrNull(previousPointer.container, Container);\n while (prevAncestor) {\n this._prevContainers.push(prevAncestor);\n // prevAncestor = prevAncestor.parent as Container;\n prevAncestor = asOrNull(prevAncestor.parent, Container);\n }\n }\n\n let currentChildOfContainer = pointer.Resolve();\n\n if (currentChildOfContainer == null) return;\n\n // Container currentContainerAncestor = currentChildOfContainer.parent as Container;\n let currentContainerAncestor = asOrNull(\n currentChildOfContainer.parent,\n Container\n );\n let allChildrenEnteredAtStart = true;\n while (\n currentContainerAncestor &&\n (this._prevContainers.indexOf(currentContainerAncestor) < 0 ||\n currentContainerAncestor.countingAtStartOnly)\n ) {\n // Check whether this ancestor container is being entered at the start,\n // by checking whether the child object is the first.\n let enteringAtStart =\n currentContainerAncestor.content.length > 0 &&\n currentChildOfContainer == currentContainerAncestor.content[0] &&\n allChildrenEnteredAtStart;\n\n if (!enteringAtStart) allChildrenEnteredAtStart = false;\n\n // Mark a visit to this container\n this.VisitContainer(currentContainerAncestor, enteringAtStart);\n\n currentChildOfContainer = currentContainerAncestor;\n // currentContainerAncestor = currentContainerAncestor.parent as Container;\n currentContainerAncestor = asOrNull(\n currentContainerAncestor.parent,\n Container\n );\n }\n }\n\n public PopChoiceStringAndTags(tags: string[]) {\n let choiceOnlyStrVal = asOrThrows(\n this.state.PopEvaluationStack(),\n StringValue\n );\n\n while (\n this.state.evaluationStack.length > 0 &&\n asOrNull(this.state.PeekEvaluationStack(), Tag) != null\n ) {\n let tag = asOrNull(this.state.PopEvaluationStack(), Tag);\n if (tag) tags.push(tag.text);\n }\n return choiceOnlyStrVal.value;\n }\n\n public ProcessChoice(choicePoint: ChoicePoint) {\n let showChoice = true;\n\n // Don't create choice if choice point doesn't pass conditional\n if (choicePoint.hasCondition) {\n let conditionValue = this.state.PopEvaluationStack();\n if (!this.IsTruthy(conditionValue)) {\n showChoice = false;\n }\n }\n\n let startText = \"\";\n let choiceOnlyText = \"\";\n let tags: string[] = [];\n\n if (choicePoint.hasChoiceOnlyContent) {\n choiceOnlyText = this.PopChoiceStringAndTags(tags) || \"\";\n }\n\n if (choicePoint.hasStartContent) {\n startText = this.PopChoiceStringAndTags(tags) || \"\";\n }\n\n // Don't create choice if player has already read this content\n if (choicePoint.onceOnly) {\n let visitCount = this.state.VisitCountForContainer(\n choicePoint.choiceTarget\n );\n if (visitCount > 0) {\n showChoice = false;\n }\n }\n\n // We go through the full process of creating the choice above so\n // that we consume the content for it, since otherwise it'll\n // be shown on the output stream.\n if (!showChoice) {\n return null;\n }\n\n let choice = new Choice();\n choice.targetPath = choicePoint.pathOnChoice;\n choice.sourcePath = choicePoint.path.toString();\n choice.isInvisibleDefault = choicePoint.isInvisibleDefault;\n choice.threadAtGeneration = this.state.callStack.ForkThread();\n choice.tags = tags.reverse(); //C# is a stack\n choice.text = (startText + choiceOnlyText).replace(/^[ \\t]+|[ \\t]+$/g, \"\");\n\n return choice;\n }\n\n public IsTruthy(obj: InkObject) {\n let truthy = false;\n if (obj instanceof Value) {\n let val = obj;\n\n if (val instanceof DivertTargetValue) {\n let divTarget = val;\n this.Error(\n \"Shouldn't use a divert target (to \" +\n divTarget.targetPath +\n \") as a conditional value. Did you intend a function call 'likeThis()' or a read count check 'likeThis'? (no arrows)\"\n );\n return false;\n }\n\n return val.isTruthy;\n }\n return truthy;\n }\n\n public PerformLogicAndFlowControl(contentObj: InkObject | null) {\n if (contentObj == null) {\n return false;\n }\n\n // Divert\n if (contentObj instanceof Divert) {\n let currentDivert = contentObj;\n\n if (currentDivert.isConditional) {\n let conditionValue = this.state.PopEvaluationStack();\n\n // False conditional? Cancel divert\n if (!this.IsTruthy(conditionValue)) return true;\n }\n\n if (currentDivert.hasVariableTarget) {\n let varName = currentDivert.variableDivertName;\n\n let varContents =\n this.state.variablesState.GetVariableWithName(varName);\n\n if (varContents == null) {\n this.Error(\n \"Tried to divert using a target from a variable that could not be found (\" +\n varName +\n \")\"\n );\n } else if (!(varContents instanceof DivertTargetValue)) {\n // var intContent = varContents as IntValue;\n let intContent = asOrNull(varContents, IntValue);\n\n let errorMessage =\n \"Tried to divert to a target from a variable, but the variable (\" +\n varName +\n \") didn't contain a divert target, it \";\n if (intContent instanceof IntValue && intContent.value == 0) {\n errorMessage += \"was empty/null (the value 0).\";\n } else {\n errorMessage += \"contained '\" + varContents + \"'.\";\n }\n\n this.Error(errorMessage);\n }\n\n let target = asOrThrows(varContents, DivertTargetValue);\n this.state.divertedPointer = this.PointerAtPath(target.targetPath);\n } else if (currentDivert.isExternal) {\n this.CallExternalFunction(\n currentDivert.targetPathString,\n currentDivert.externalArgs\n );\n return true;\n } else {\n this.state.divertedPointer = currentDivert.targetPointer.copy();\n }\n\n if (currentDivert.pushesToStack) {\n this.state.callStack.Push(\n currentDivert.stackPushType,\n undefined,\n this.state.outputStream.length\n );\n }\n\n if (this.state.divertedPointer.isNull && !currentDivert.isExternal) {\n if (\n currentDivert &&\n currentDivert.debugMetadata &&\n currentDivert.debugMetadata.sourceName != null\n ) {\n this.Error(\n \"Divert target doesn't exist: \" +\n currentDivert.debugMetadata.sourceName\n );\n } else {\n this.Error(\"Divert resolution failed: \" + currentDivert);\n }\n }\n\n return true;\n }\n\n // Start/end an expression evaluation? Or print out the result?\n else if (contentObj instanceof ControlCommand) {\n let evalCommand = contentObj;\n\n switch (evalCommand.commandType) {\n case ControlCommand.CommandType.EvalStart:\n this.Assert(\n this.state.inExpressionEvaluation === false,\n \"Already in expression evaluation?\"\n );\n this.state.inExpressionEvaluation = true;\n break;\n\n case ControlCommand.CommandType.EvalEnd:\n this.Assert(\n this.state.inExpressionEvaluation === true,\n \"Not in expression evaluation mode\"\n );\n this.state.inExpressionEvaluation = false;\n break;\n\n case ControlCommand.CommandType.EvalOutput:\n // If the expression turned out to be empty, there may not be anything on the stack\n if (this.state.evaluationStack.length > 0) {\n let output = this.state.PopEvaluationStack();\n\n // Functions may evaluate to Void, in which case we skip output\n if (!(output instanceof Void)) {\n // TODO: Should we really always blanket convert to string?\n // It would be okay to have numbers in the output stream the\n // only problem is when exporting text for viewing, it skips over numbers etc.\n let text = new StringValue(output.toString());\n\n this.state.PushToOutputStream(text);\n }\n }\n break;\n\n case ControlCommand.CommandType.NoOp:\n break;\n\n case ControlCommand.CommandType.Duplicate:\n this.state.PushEvaluationStack(this.state.PeekEvaluationStack());\n break;\n\n case ControlCommand.CommandType.PopEvaluatedValue:\n this.state.PopEvaluationStack();\n break;\n\n case ControlCommand.CommandType.PopFunction:\n case ControlCommand.CommandType.PopTunnel:\n let popType =\n evalCommand.commandType == ControlCommand.CommandType.PopFunction\n ? PushPopType.Function\n : PushPopType.Tunnel;\n\n let overrideTunnelReturnTarget: DivertTargetValue | null = null;\n if (popType == PushPopType.Tunnel) {\n let popped = this.state.PopEvaluationStack();\n // overrideTunnelReturnTarget = popped as DivertTargetValue;\n overrideTunnelReturnTarget = asOrNull(popped, DivertTargetValue);\n if (overrideTunnelReturnTarget === null) {\n this.Assert(\n popped instanceof Void,\n \"Expected void if ->-> doesn't override target\"\n );\n }\n }\n\n if (this.state.TryExitFunctionEvaluationFromGame()) {\n break;\n } else if (\n this.state.callStack.currentElement.type != popType ||\n !this.state.callStack.canPop\n ) {\n let names: Map = new Map();\n names.set(\n PushPopType.Function,\n \"function return statement (~ return)\"\n );\n names.set(PushPopType.Tunnel, \"tunnel onwards statement (->->)\");\n\n let expected = names.get(this.state.callStack.currentElement.type);\n if (!this.state.callStack.canPop) {\n expected = \"end of flow (-> END or choice)\";\n }\n\n let errorMsg =\n \"Found \" + names.get(popType) + \", when expected \" + expected;\n\n this.Error(errorMsg);\n } else {\n this.state.PopCallStack();\n\n if (overrideTunnelReturnTarget)\n this.state.divertedPointer = this.PointerAtPath(\n overrideTunnelReturnTarget.targetPath\n );\n }\n break;\n\n case ControlCommand.CommandType.BeginString:\n this.state.PushToOutputStream(evalCommand);\n\n this.Assert(\n this.state.inExpressionEvaluation === true,\n \"Expected to be in an expression when evaluating a string\"\n );\n this.state.inExpressionEvaluation = false;\n break;\n\n // Leave it to story.currentText and story.currentTags to sort out the text from the tags\n // This is mostly because we can't always rely on the existence of EndTag, and we don't want\n // to try and flatten dynamic tags to strings every time \\n is pushed to output\n case ControlCommand.CommandType.BeginTag:\n this.state.PushToOutputStream(evalCommand);\n break;\n\n // EndTag has 2 modes:\n // - When in string evaluation (for choices)\n // - Normal\n //\n // The only way you could have an EndTag in the middle of\n // string evaluation is if we're currently generating text for a\n // choice, such as:\n //\n // + choice # tag\n //\n // In the above case, the ink will be run twice:\n // - First, to generate the choice text. String evaluation\n // will be on, and the final string will be pushed to the\n // evaluation stack, ready to be popped to make a Choice\n // object.\n // - Second, when ink generates text after choosing the choice.\n // On this ocassion, it's not in string evaluation mode.\n //\n // On the writing side, we disallow manually putting tags within\n // strings like this:\n //\n // {\"hello # world\"}\n //\n // So we know that the tag must be being generated as part of\n // choice content. Therefore, when the tag has been generated,\n // we push it onto the evaluation stack in the exact same way\n // as the string for the choice content.\n case ControlCommand.CommandType.EndTag: {\n if (this.state.inStringEvaluation) {\n let contentStackForTag: InkObject[] = [];\n let outputCountConsumed = 0;\n for (let i = this.state.outputStream.length - 1; i >= 0; --i) {\n let obj = this.state.outputStream[i];\n outputCountConsumed++;\n\n // var command = obj as ControlCommand;\n let command = asOrNull(obj, ControlCommand);\n if (command != null) {\n if (\n command.commandType == ControlCommand.CommandType.BeginTag\n ) {\n break;\n } else {\n this.Error(\n \"Unexpected ControlCommand while extracting tag from choice\"\n );\n break;\n }\n }\n if (obj instanceof StringValue) {\n contentStackForTag.push(obj);\n }\n }\n\n // Consume the content that was produced for this string\n this.state.PopFromOutputStream(outputCountConsumed);\n // Build string out of the content we collected\n let sb = new StringBuilder();\n for (let strVal of contentStackForTag.reverse()) {\n sb.Append(strVal.toString());\n }\n let choiceTag = new Tag(\n this.state.CleanOutputWhitespace(sb.toString())\n );\n // Pushing to the evaluation stack means it gets picked up\n // when a Choice is generated from the next Choice Point.\n this.state.PushEvaluationStack(choiceTag);\n } else {\n // Otherwise! Simply push EndTag, so that in the output stream we\n // have a structure of: [BeginTag, \"the tag content\", EndTag]\n this.state.PushToOutputStream(evalCommand);\n }\n break;\n }\n\n case ControlCommand.CommandType.EndString: {\n let contentStackForString: InkObject[] = [];\n let contentToRetain: InkObject[] = [];\n\n let outputCountConsumed = 0;\n for (let i = this.state.outputStream.length - 1; i >= 0; --i) {\n let obj = this.state.outputStream[i];\n\n outputCountConsumed++;\n\n // var command = obj as ControlCommand;\n let command = asOrNull(obj, ControlCommand);\n if (\n command &&\n command.commandType == ControlCommand.CommandType.BeginString\n ) {\n break;\n }\n if (obj instanceof Tag) {\n contentToRetain.push(obj);\n }\n if (obj instanceof StringValue) {\n contentStackForString.push(obj);\n }\n }\n\n // Consume the content that was produced for this string\n this.state.PopFromOutputStream(outputCountConsumed);\n\n // Rescue the tags that we want actually to keep on the output stack\n // rather than consume as part of the string we're building.\n // At the time of writing, this only applies to Tag objects generated\n // by choices, which are pushed to the stack during string generation.\n for (let rescuedTag of contentToRetain)\n this.state.PushToOutputStream(rescuedTag);\n\n // The C# version uses a Stack for contentStackForString, but we're\n // using a simple array, so we need to reverse it before using it\n contentStackForString = contentStackForString.reverse();\n\n // Build string out of the content we collected\n let sb = new StringBuilder();\n for (let c of contentStackForString) {\n sb.Append(c.toString());\n }\n\n // Return to expression evaluation (from content mode)\n this.state.inExpressionEvaluation = true;\n this.state.PushEvaluationStack(new StringValue(sb.toString()));\n break;\n }\n\n case ControlCommand.CommandType.ChoiceCount:\n let choiceCount = this.state.generatedChoices.length;\n this.state.PushEvaluationStack(new IntValue(choiceCount));\n break;\n\n case ControlCommand.CommandType.Turns:\n this.state.PushEvaluationStack(\n new IntValue(this.state.currentTurnIndex + 1)\n );\n break;\n\n case ControlCommand.CommandType.TurnsSince:\n case ControlCommand.CommandType.ReadCount:\n let target = this.state.PopEvaluationStack();\n if (!(target instanceof DivertTargetValue)) {\n let extraNote = \"\";\n if (target instanceof IntValue)\n extraNote =\n \". Did you accidentally pass a read count ('knot_name') instead of a target ('-> knot_name')?\";\n this.Error(\n \"TURNS_SINCE / READ_COUNT expected a divert target (knot, stitch, label name), but saw \" +\n target +\n extraNote\n );\n break;\n }\n\n // var divertTarget = target as DivertTargetValue;\n let divertTarget = asOrThrows(target, DivertTargetValue);\n // var container = ContentAtPath (divertTarget.targetPath).correctObj as Container;\n let container = asOrNull(\n this.ContentAtPath(divertTarget.targetPath).correctObj,\n Container\n );\n\n let eitherCount;\n if (container != null) {\n if (\n evalCommand.commandType == ControlCommand.CommandType.TurnsSince\n )\n eitherCount = this.state.TurnsSinceForContainer(container);\n else eitherCount = this.state.VisitCountForContainer(container);\n } else {\n if (\n evalCommand.commandType == ControlCommand.CommandType.TurnsSince\n )\n eitherCount = -1;\n else eitherCount = 0;\n\n this.Warning(\n \"Failed to find container for \" +\n evalCommand.toString() +\n \" lookup at \" +\n divertTarget.targetPath.toString()\n );\n }\n\n this.state.PushEvaluationStack(new IntValue(eitherCount));\n break;\n\n case ControlCommand.CommandType.Random: {\n let maxInt = asOrNull(this.state.PopEvaluationStack(), IntValue);\n let minInt = asOrNull(this.state.PopEvaluationStack(), IntValue);\n\n if (minInt == null || minInt instanceof IntValue === false)\n return this.Error(\n \"Invalid value for minimum parameter of RANDOM(min, max)\"\n );\n\n if (maxInt == null || maxInt instanceof IntValue === false)\n return this.Error(\n \"Invalid value for maximum parameter of RANDOM(min, max)\"\n );\n\n // Originally a primitive type, but here, can be null.\n // TODO: Replace by default value?\n if (maxInt.value === null) {\n return throwNullException(\"maxInt.value\");\n }\n if (minInt.value === null) {\n return throwNullException(\"minInt.value\");\n }\n\n // This code is differs a bit from the reference implementation, since\n // JavaScript has no true integers. Hence integer arithmetics and\n // interger overflows don't apply here. A loss of precision can\n // happen with big numbers however.\n //\n // The case where 'randomRange' is lower than zero is handled below,\n // so there's no need to test against Number.MIN_SAFE_INTEGER.\n let randomRange = maxInt.value - minInt.value + 1;\n if (!isFinite(randomRange) || randomRange > Number.MAX_SAFE_INTEGER) {\n randomRange = Number.MAX_SAFE_INTEGER;\n this.Error(\n \"RANDOM was called with a range that exceeds the size that ink numbers can use.\"\n );\n }\n if (randomRange <= 0)\n this.Error(\n \"RANDOM was called with minimum as \" +\n minInt.value +\n \" and maximum as \" +\n maxInt.value +\n \". The maximum must be larger\"\n );\n\n let resultSeed = this.state.storySeed + this.state.previousRandom;\n let random = new PRNG(resultSeed);\n\n let nextRandom = random.next();\n let chosenValue = (nextRandom % randomRange) + minInt.value;\n this.state.PushEvaluationStack(new IntValue(chosenValue));\n\n // Next random number (rather than keeping the Random object around)\n this.state.previousRandom = nextRandom;\n break;\n }\n\n case ControlCommand.CommandType.SeedRandom:\n let seed = asOrNull(this.state.PopEvaluationStack(), IntValue);\n if (seed == null || seed instanceof IntValue === false)\n return this.Error(\"Invalid value passed to SEED_RANDOM\");\n\n // Originally a primitive type, but here, can be null.\n // TODO: Replace by default value?\n if (seed.value === null) {\n return throwNullException(\"minInt.value\");\n }\n\n this.state.storySeed = seed.value;\n this.state.previousRandom = 0;\n\n this.state.PushEvaluationStack(new Void());\n break;\n\n case ControlCommand.CommandType.VisitIndex:\n let count =\n this.state.VisitCountForContainer(\n this.state.currentPointer.container\n ) - 1; // index not count\n this.state.PushEvaluationStack(new IntValue(count));\n break;\n\n case ControlCommand.CommandType.SequenceShuffleIndex:\n let shuffleIndex = this.NextSequenceShuffleIndex();\n this.state.PushEvaluationStack(new IntValue(shuffleIndex));\n break;\n\n case ControlCommand.CommandType.StartThread:\n // Handled in main step function\n break;\n\n case ControlCommand.CommandType.Done:\n // We may exist in the context of the initial\n // act of creating the thread, or in the context of\n // evaluating the content.\n if (this.state.callStack.canPopThread) {\n this.state.callStack.PopThread();\n }\n\n // In normal flow - allow safe exit without warning\n else {\n this.state.didSafeExit = true;\n\n // Stop flow in current thread\n this.state.currentPointer = Pointer.Null;\n }\n\n break;\n\n // Force flow to end completely\n case ControlCommand.CommandType.End:\n this.state.ForceEnd();\n break;\n\n case ControlCommand.CommandType.ListFromInt:\n // var intVal = state.PopEvaluationStack () as IntValue;\n let intVal = asOrNull(this.state.PopEvaluationStack(), IntValue);\n // var listNameVal = state.PopEvaluationStack () as StringValue;\n let listNameVal = asOrThrows(\n this.state.PopEvaluationStack(),\n StringValue\n );\n\n if (intVal === null) {\n throw new StoryException(\n \"Passed non-integer when creating a list element from a numerical value.\"\n );\n }\n\n let generatedListValue = null;\n\n if (this.listDefinitions === null) {\n return throwNullException(\"this.listDefinitions\");\n }\n let foundListDef = this.listDefinitions.TryListGetDefinition(\n listNameVal.value,\n null\n );\n if (foundListDef.exists) {\n // Originally a primitive type, but here, can be null.\n // TODO: Replace by default value?\n if (intVal.value === null) {\n return throwNullException(\"minInt.value\");\n }\n\n let foundItem = foundListDef.result!.TryGetItemWithValue(\n intVal.value,\n InkListItem.Null\n );\n if (foundItem.exists) {\n generatedListValue = new ListValue(\n foundItem.result!,\n intVal.value\n );\n }\n } else {\n throw new StoryException(\n \"Failed to find LIST called \" + listNameVal.value\n );\n }\n\n if (generatedListValue == null) generatedListValue = new ListValue();\n\n this.state.PushEvaluationStack(generatedListValue);\n break;\n\n case ControlCommand.CommandType.ListRange:\n let max = asOrNull(this.state.PopEvaluationStack(), Value);\n let min = asOrNull(this.state.PopEvaluationStack(), Value);\n\n // var targetList = state.PopEvaluationStack () as ListValue;\n let targetList = asOrNull(this.state.PopEvaluationStack(), ListValue);\n\n if (targetList === null || min === null || max === null)\n throw new StoryException(\n \"Expected list, minimum and maximum for LIST_RANGE\"\n );\n\n if (targetList.value === null) {\n return throwNullException(\"targetList.value\");\n }\n let result = targetList.value.ListWithSubRange(\n min.valueObject,\n max.valueObject\n );\n\n this.state.PushEvaluationStack(new ListValue(result));\n break;\n\n case ControlCommand.CommandType.ListRandom: {\n let listVal = this.state.PopEvaluationStack() as ListValue;\n if (listVal === null)\n throw new StoryException(\"Expected list for LIST_RANDOM\");\n\n let list = listVal.value;\n\n let newList: InkList | null = null;\n\n if (list === null) {\n throw throwNullException(\"list\");\n }\n if (list.Count == 0) {\n newList = new InkList();\n } else {\n // Generate a random index for the element to take\n let resultSeed = this.state.storySeed + this.state.previousRandom;\n let random = new PRNG(resultSeed);\n\n let nextRandom = random.next();\n let listItemIndex = nextRandom % list.Count;\n\n // This bit is a little different from the original\n // C# code, since iterators do not work in the same way.\n // First, we iterate listItemIndex - 1 times, calling next().\n // The listItemIndex-th time is made outside of the loop,\n // in order to retrieve the value.\n let listEnumerator = list.entries();\n for (let i = 0; i <= listItemIndex - 1; i++) {\n listEnumerator.next();\n }\n let value = listEnumerator.next().value;\n let randomItem: KeyValuePair = {\n Key: InkListItem.fromSerializedKey(value[0]),\n Value: value[1],\n };\n\n // Origin list is simply the origin of the one element\n if (randomItem.Key.originName === null) {\n return throwNullException(\"randomItem.Key.originName\");\n }\n newList = new InkList(randomItem.Key.originName, this);\n newList.Add(randomItem.Key, randomItem.Value);\n\n this.state.previousRandom = nextRandom;\n }\n\n this.state.PushEvaluationStack(new ListValue(newList));\n break;\n }\n\n default:\n this.Error(\"unhandled ControlCommand: \" + evalCommand);\n break;\n }\n\n return true;\n }\n\n // Variable assignment\n else if (contentObj instanceof VariableAssignment) {\n let varAss = contentObj;\n let assignedVal = this.state.PopEvaluationStack();\n\n this.state.variablesState.Assign(varAss, assignedVal);\n\n return true;\n }\n\n // Variable reference\n else if (contentObj instanceof VariableReference) {\n let varRef = contentObj;\n let foundValue = null;\n\n // Explicit read count value\n if (varRef.pathForCount != null) {\n let container = varRef.containerForCount;\n let count = this.state.VisitCountForContainer(container);\n foundValue = new IntValue(count);\n }\n\n // Normal variable reference\n else {\n foundValue = this.state.variablesState.GetVariableWithName(varRef.name);\n\n if (foundValue == null) {\n this.Warning(\n \"Variable not found: '\" +\n varRef.name +\n \"'. Using default value of 0 (false). This can happen with temporary variables if the declaration hasn't yet been hit. Globals are always given a default value on load if a value doesn't exist in the save state.\"\n );\n foundValue = new IntValue(0);\n }\n }\n\n this.state.PushEvaluationStack(foundValue);\n\n return true;\n }\n\n // Native function call\n else if (contentObj instanceof NativeFunctionCall) {\n let func = contentObj;\n let funcParams = this.state.PopEvaluationStack(func.numberOfParameters);\n let result = func.Call(funcParams);\n this.state.PushEvaluationStack(result);\n return true;\n }\n\n // No control content, must be ordinary content\n return false;\n }\n\n public ChoosePathString(\n path: string,\n resetCallstack = true,\n args: any[] = []\n ) {\n this.IfAsyncWeCant(\"call ChoosePathString right now\");\n if (this.onChoosePathString !== null) this.onChoosePathString(path, args);\n\n if (resetCallstack) {\n this.ResetCallstack();\n } else {\n if (this.state.callStack.currentElement.type == PushPopType.Function) {\n let funcDetail = \"\";\n let container =\n this.state.callStack.currentElement.currentPointer.container;\n if (container != null) {\n funcDetail = \"(\" + container.path.toString() + \") \";\n }\n throw new Error(\n \"Story was running a function \" +\n funcDetail +\n \"when you called ChoosePathString(\" +\n path +\n \") - this is almost certainly not not what you want! Full stack trace: \\n\" +\n this.state.callStack.callStackTrace\n );\n }\n }\n\n this.state.PassArgumentsToEvaluationStack(args);\n this.ChoosePath(new Path(path));\n }\n\n public IfAsyncWeCant(activityStr: string) {\n if (this._asyncContinueActive)\n throw new Error(\n \"Can't \" +\n activityStr +\n \". Story is in the middle of a ContinueAsync(). Make more ContinueAsync() calls or a single Continue() call beforehand.\"\n );\n }\n\n public ChoosePath(p: Path, incrementingTurnIndex: boolean = true) {\n this.state.SetChosenPath(p, incrementingTurnIndex);\n\n // Take a note of newly visited containers for read counts etc\n this.VisitChangedContainersDueToDivert();\n }\n\n public ChooseChoiceIndex(choiceIdx: number) {\n choiceIdx = choiceIdx;\n let choices = this.currentChoices;\n this.Assert(\n choiceIdx >= 0 && choiceIdx < choices.length,\n \"choice out of range\"\n );\n\n let choiceToChoose = choices[choiceIdx];\n if (this.onMakeChoice !== null) this.onMakeChoice(choiceToChoose);\n\n if (choiceToChoose.threadAtGeneration === null) {\n return throwNullException(\"choiceToChoose.threadAtGeneration\");\n }\n if (choiceToChoose.targetPath === null) {\n return throwNullException(\"choiceToChoose.targetPath\");\n }\n\n this.state.callStack.currentThread = choiceToChoose.threadAtGeneration;\n\n this.ChoosePath(choiceToChoose.targetPath);\n }\n\n public HasFunction(functionName: string) {\n try {\n return this.KnotContainerWithName(functionName) != null;\n } catch (e) {\n return false;\n }\n }\n\n public EvaluateFunction(\n functionName: string,\n args: any[] = [],\n returnTextOutput: boolean = false\n ): Story.EvaluateFunctionTextOutput | any {\n // EvaluateFunction behaves slightly differently than the C# version.\n // In C#, you can pass a (second) parameter `out textOutput` to get the\n // text outputted by the function. This is not possible in js. Instead,\n // we maintain the regular signature (functionName, args), plus an\n // optional third parameter returnTextOutput. If set to true, we will\n // return both the textOutput and the returned value, as an object.\n\n if (this.onEvaluateFunction !== null)\n this.onEvaluateFunction(functionName, args);\n\n this.IfAsyncWeCant(\"evaluate a function\");\n\n if (functionName == null) {\n throw new Error(\"Function is null\");\n } else if (functionName == \"\" || functionName.trim() == \"\") {\n throw new Error(\"Function is empty or white space.\");\n }\n\n let funcContainer = this.KnotContainerWithName(functionName);\n if (funcContainer == null) {\n throw new Error(\"Function doesn't exist: '\" + functionName + \"'\");\n }\n\n let outputStreamBefore: InkObject[] = [];\n outputStreamBefore.push(...this.state.outputStream);\n this._state.ResetOutput();\n\n this.state.StartFunctionEvaluationFromGame(funcContainer, args);\n\n // Evaluate the function, and collect the string output\n let stringOutput = new StringBuilder();\n while (this.canContinue) {\n stringOutput.Append(this.Continue());\n }\n let textOutput = stringOutput.toString();\n\n this._state.ResetOutput(outputStreamBefore);\n\n let result = this.state.CompleteFunctionEvaluationFromGame();\n if (this.onCompleteEvaluateFunction != null)\n this.onCompleteEvaluateFunction(functionName, args, textOutput, result);\n\n return returnTextOutput ? { returned: result, output: textOutput } : result;\n }\n\n public EvaluateExpression(exprContainer: Container) {\n let startCallStackHeight = this.state.callStack.elements.length;\n\n this.state.callStack.Push(PushPopType.Tunnel);\n\n this._temporaryEvaluationContainer = exprContainer;\n\n this.state.GoToStart();\n\n let evalStackHeight = this.state.evaluationStack.length;\n\n this.Continue();\n\n this._temporaryEvaluationContainer = null;\n\n // Should have fallen off the end of the Container, which should\n // have auto-popped, but just in case we didn't for some reason,\n // manually pop to restore the state (including currentPath).\n if (this.state.callStack.elements.length > startCallStackHeight) {\n this.state.PopCallStack();\n }\n\n let endStackHeight = this.state.evaluationStack.length;\n if (endStackHeight > evalStackHeight) {\n return this.state.PopEvaluationStack();\n } else {\n return null;\n }\n }\n\n public allowExternalFunctionFallbacks: boolean = false;\n\n public CallExternalFunction(\n funcName: string | null,\n numberOfArguments: number\n ) {\n if (funcName === null) {\n return throwNullException(\"funcName\");\n }\n let funcDef = this._externals.get(funcName);\n let fallbackFunctionContainer = null;\n\n let foundExternal = typeof funcDef !== \"undefined\";\n\n if (\n foundExternal &&\n !funcDef!.lookAheadSafe &&\n this._stateSnapshotAtLastNewline !== null\n ) {\n this._sawLookaheadUnsafeFunctionAfterNewline = true;\n return;\n }\n\n if (!foundExternal) {\n if (this.allowExternalFunctionFallbacks) {\n fallbackFunctionContainer = this.KnotContainerWithName(funcName);\n this.Assert(\n fallbackFunctionContainer !== null,\n \"Trying to call EXTERNAL function '\" +\n funcName +\n \"' which has not been bound, and fallback ink function could not be found.\"\n );\n\n // Divert direct into fallback function and we're done\n this.state.callStack.Push(\n PushPopType.Function,\n undefined,\n this.state.outputStream.length\n );\n this.state.divertedPointer = Pointer.StartOf(fallbackFunctionContainer);\n return;\n } else {\n this.Assert(\n false,\n \"Trying to call EXTERNAL function '\" +\n funcName +\n \"' which has not been bound (and ink fallbacks disabled).\"\n );\n }\n }\n\n // Pop arguments\n let args: any[] = [];\n for (let i = 0; i < numberOfArguments; ++i) {\n // var poppedObj = state.PopEvaluationStack () as Value;\n let poppedObj = asOrThrows(this.state.PopEvaluationStack(), Value);\n let valueObj = poppedObj.valueObject;\n args.push(valueObj);\n }\n\n // Reverse arguments from the order they were popped,\n // so they're the right way round again.\n args.reverse();\n\n // Run the function!\n let funcResult = funcDef!.function(args);\n\n // Convert return value (if any) to the a type that the ink engine can use\n let returnObj = null;\n if (funcResult != null) {\n returnObj = Value.Create(funcResult);\n this.Assert(\n returnObj !== null,\n \"Could not create ink value from returned object of type \" +\n typeof funcResult\n );\n } else {\n returnObj = new Void();\n }\n\n this.state.PushEvaluationStack(returnObj);\n }\n\n public BindExternalFunctionGeneral(\n funcName: string,\n func: Story.ExternalFunction,\n lookaheadSafe: boolean = true\n ) {\n this.IfAsyncWeCant(\"bind an external function\");\n this.Assert(\n !this._externals.has(funcName),\n \"Function '\" + funcName + \"' has already been bound.\"\n );\n this._externals.set(funcName, {\n function: func,\n lookAheadSafe: lookaheadSafe,\n });\n }\n\n public TryCoerce(value: any) {\n // We're skipping type coercition in this implementation. First of, js\n // is loosely typed, so it's not that important. Secondly, there is no\n // clean way (AFAIK) for the user to describe what type of parameters\n // they expect.\n return value;\n }\n\n public BindExternalFunction(\n funcName: string,\n func: Story.ExternalFunction,\n lookaheadSafe: boolean = false\n ) {\n this.Assert(func != null, \"Can't bind a null function\");\n\n this.BindExternalFunctionGeneral(\n funcName,\n (args: any) => {\n this.Assert(\n args.length >= func.length,\n \"External function expected \" + func.length + \" arguments\"\n );\n\n let coercedArgs = [];\n for (let i = 0, l = args.length; i < l; i++) {\n coercedArgs[i] = this.TryCoerce(args[i]);\n }\n return func.apply(null, coercedArgs);\n },\n lookaheadSafe\n );\n }\n\n public UnbindExternalFunction(funcName: string) {\n this.IfAsyncWeCant(\"unbind an external a function\");\n this.Assert(\n this._externals.has(funcName),\n \"Function '\" + funcName + \"' has not been bound.\"\n );\n this._externals.delete(funcName);\n }\n\n public ValidateExternalBindings(): void;\n public ValidateExternalBindings(\n c: Container | null,\n missingExternals: Set\n ): void;\n public ValidateExternalBindings(\n o: InkObject | null,\n missingExternals: Set\n ): void;\n public ValidateExternalBindings() {\n let c: Container | null = null;\n let o: InkObject | null = null;\n let missingExternals: Set = arguments[1] || new Set();\n\n if (arguments[0] instanceof Container) {\n c = arguments[0];\n }\n\n if (arguments[0] instanceof InkObject) {\n o = arguments[0];\n }\n\n if (c === null && o === null) {\n this.ValidateExternalBindings(\n this._mainContentContainer,\n missingExternals\n );\n this._hasValidatedExternals = true;\n\n // No problem! Validation complete\n if (missingExternals.size == 0) {\n this._hasValidatedExternals = true;\n } else {\n let message = \"Error: Missing function binding for external\";\n message += missingExternals.size > 1 ? \"s\" : \"\";\n message += \": '\";\n message += Array.from(missingExternals).join(\"', '\");\n message += \"' \";\n message += this.allowExternalFunctionFallbacks\n ? \", and no fallback ink function found.\"\n : \" (ink fallbacks disabled)\";\n\n this.Error(message);\n }\n } else if (c != null) {\n for (let innerContent of c.content) {\n let container = innerContent as Container;\n if (container == null || !container.hasValidName)\n this.ValidateExternalBindings(innerContent, missingExternals);\n }\n for (let [, value] of c.namedContent) {\n this.ValidateExternalBindings(\n asOrNull(value, InkObject),\n missingExternals\n );\n }\n } else if (o != null) {\n let divert = asOrNull(o, Divert);\n if (divert && divert.isExternal) {\n let name = divert.targetPathString;\n if (name === null) {\n return throwNullException(\"name\");\n }\n if (!this._externals.has(name)) {\n if (this.allowExternalFunctionFallbacks) {\n let fallbackFound =\n this.mainContentContainer.namedContent.has(name);\n if (!fallbackFound) {\n missingExternals.add(name);\n }\n } else {\n missingExternals.add(name);\n }\n }\n }\n }\n }\n\n public ObserveVariable(\n variableName: string,\n observer: Story.VariableObserver\n ) {\n this.IfAsyncWeCant(\"observe a new variable\");\n\n if (this._variableObservers === null) this._variableObservers = new Map();\n\n if (!this.state.variablesState.GlobalVariableExistsWithName(variableName))\n throw new Error(\n \"Cannot observe variable '\" +\n variableName +\n \"' because it wasn't declared in the ink story.\"\n );\n\n if (this._variableObservers.has(variableName)) {\n this._variableObservers.get(variableName)!.push(observer);\n } else {\n this._variableObservers.set(variableName, [observer]);\n }\n }\n\n public ObserveVariables(\n variableNames: string[],\n observers: Story.VariableObserver[]\n ) {\n for (let i = 0, l = variableNames.length; i < l; i++) {\n this.ObserveVariable(variableNames[i], observers[i]);\n }\n }\n\n public RemoveVariableObserver(\n observer?: Story.VariableObserver,\n specificVariableName?: string\n ) {\n // A couple of things to know about this method:\n //\n // 1. Since `RemoveVariableObserver` is exposed to the JavaScript world,\n // optionality is marked as `undefined` rather than `null`.\n // To keep things simple, null-checks are performed using regular\n // equality operators, where undefined == null.\n //\n // 2. Since C# delegates are translated to arrays of functions,\n // -= becomes a call to splice and null-checks are replaced by\n // emptiness-checks.\n //\n this.IfAsyncWeCant(\"remove a variable observer\");\n\n if (this._variableObservers === null) return;\n\n if (specificVariableName != null) {\n if (this._variableObservers.has(specificVariableName)) {\n if (observer != null) {\n let variableObservers =\n this._variableObservers.get(specificVariableName);\n if (variableObservers != null) {\n variableObservers.splice(variableObservers.indexOf(observer), 1);\n if (variableObservers.length === 0) {\n this._variableObservers.delete(specificVariableName);\n }\n }\n } else {\n this._variableObservers.delete(specificVariableName);\n }\n }\n } else if (observer != null) {\n let keys = this._variableObservers.keys();\n for (let varName of keys) {\n let variableObservers = this._variableObservers.get(varName);\n if (variableObservers != null) {\n variableObservers.splice(variableObservers.indexOf(observer), 1);\n if (variableObservers.length === 0) {\n this._variableObservers.delete(varName);\n }\n }\n }\n }\n }\n\n public VariableStateDidChangeEvent(\n variableName: string,\n newValueObj: InkObject\n ) {\n if (this._variableObservers === null) return;\n\n let observers = this._variableObservers.get(variableName);\n if (typeof observers !== \"undefined\") {\n if (!(newValueObj instanceof Value)) {\n throw new Error(\n \"Tried to get the value of a variable that isn't a standard type\"\n );\n }\n // var val = newValueObj as Value;\n let val = asOrThrows(newValueObj, Value);\n\n for (let observer of observers) {\n observer(variableName, val.valueObject);\n }\n }\n }\n\n get globalTags() {\n return this.TagsAtStartOfFlowContainerWithPathString(\"\");\n }\n\n public TagsForContentAtPath(path: string) {\n return this.TagsAtStartOfFlowContainerWithPathString(path);\n }\n\n public TagsAtStartOfFlowContainerWithPathString(pathString: string) {\n let path = new Path(pathString);\n\n let flowContainer = this.ContentAtPath(path).container;\n if (flowContainer === null) {\n return throwNullException(\"flowContainer\");\n }\n while (true) {\n let firstContent: InkObject = flowContainer.content[0];\n if (firstContent instanceof Container) flowContainer = firstContent;\n else break;\n }\n\n let inTag = false;\n let tags: string[] | null = null;\n\n for (let c of flowContainer.content) {\n // var tag = c as Runtime.Tag;\n let command = asOrNull(c, ControlCommand);\n\n if (command != null) {\n if (command.commandType == ControlCommand.CommandType.BeginTag) {\n inTag = true;\n } else if (command.commandType == ControlCommand.CommandType.EndTag) {\n inTag = false;\n }\n } else if (inTag) {\n let str = asOrNull(c, StringValue);\n if (str !== null) {\n if (tags === null) tags = [];\n if (str.value !== null) tags.push(str.value);\n } else {\n this.Error(\n \"Tag contained non-text content. Only plain text is allowed when using globalTags or TagsAtContentPath. If you want to evaluate dynamic content, you need to use story.Continue().\"\n );\n }\n } else {\n break;\n }\n }\n\n return tags;\n }\n\n public BuildStringOfHierarchy() {\n let sb = new StringBuilder();\n\n this.mainContentContainer.BuildStringOfHierarchy(\n sb,\n 0,\n this.state.currentPointer.Resolve()\n );\n\n return sb.toString();\n }\n\n public BuildStringOfContainer(container: Container) {\n let sb = new StringBuilder();\n container.BuildStringOfHierarchy(\n sb,\n 0,\n this.state.currentPointer.Resolve()\n );\n return sb.toString();\n }\n\n public NextContent() {\n this.state.previousPointer = this.state.currentPointer.copy();\n\n if (!this.state.divertedPointer.isNull) {\n this.state.currentPointer = this.state.divertedPointer.copy();\n this.state.divertedPointer = Pointer.Null;\n\n this.VisitChangedContainersDueToDivert();\n\n if (!this.state.currentPointer.isNull) {\n return;\n }\n }\n\n let successfulPointerIncrement = this.IncrementContentPointer();\n\n if (!successfulPointerIncrement) {\n let didPop = false;\n\n if (this.state.callStack.CanPop(PushPopType.Function)) {\n this.state.PopCallStack(PushPopType.Function);\n\n if (this.state.inExpressionEvaluation) {\n this.state.PushEvaluationStack(new Void());\n }\n\n didPop = true;\n } else if (this.state.callStack.canPopThread) {\n this.state.callStack.PopThread();\n\n didPop = true;\n } else {\n this.state.TryExitFunctionEvaluationFromGame();\n }\n\n if (didPop && !this.state.currentPointer.isNull) {\n this.NextContent();\n }\n }\n }\n\n public IncrementContentPointer() {\n let successfulIncrement = true;\n\n let pointer = this.state.callStack.currentElement.currentPointer.copy();\n pointer.index++;\n\n if (pointer.container === null) {\n return throwNullException(\"pointer.container\");\n }\n while (pointer.index >= pointer.container.content.length) {\n successfulIncrement = false;\n\n // Container nextAncestor = pointer.container.parent as Container;\n let nextAncestor = asOrNull(pointer.container.parent, Container);\n if (nextAncestor instanceof Container === false) {\n break;\n }\n\n let indexInAncestor = nextAncestor!.content.indexOf(pointer.container);\n if (indexInAncestor == -1) {\n break;\n }\n\n pointer = new Pointer(nextAncestor, indexInAncestor);\n\n pointer.index++;\n\n successfulIncrement = true;\n if (pointer.container === null) {\n return throwNullException(\"pointer.container\");\n }\n }\n\n if (!successfulIncrement) pointer = Pointer.Null;\n\n this.state.callStack.currentElement.currentPointer = pointer.copy();\n\n return successfulIncrement;\n }\n\n public TryFollowDefaultInvisibleChoice() {\n let allChoices = this._state.currentChoices;\n\n let invisibleChoices = allChoices.filter((c) => c.isInvisibleDefault);\n\n if (\n invisibleChoices.length == 0 ||\n allChoices.length > invisibleChoices.length\n )\n return false;\n\n let choice = invisibleChoices[0];\n\n if (choice.targetPath === null) {\n return throwNullException(\"choice.targetPath\");\n }\n\n if (choice.threadAtGeneration === null) {\n return throwNullException(\"choice.threadAtGeneration\");\n }\n\n this.state.callStack.currentThread = choice.threadAtGeneration;\n\n if (this._stateSnapshotAtLastNewline !== null) {\n this.state.callStack.currentThread = this.state.callStack.ForkThread();\n }\n\n this.ChoosePath(choice.targetPath, false);\n\n return true;\n }\n\n public NextSequenceShuffleIndex() {\n // var numElementsIntVal = state.PopEvaluationStack () as IntValue;\n let numElementsIntVal = asOrNull(this.state.PopEvaluationStack(), IntValue);\n if (!(numElementsIntVal instanceof IntValue)) {\n this.Error(\"expected number of elements in sequence for shuffle index\");\n return 0;\n }\n\n let seqContainer = this.state.currentPointer.container;\n if (seqContainer === null) {\n return throwNullException(\"seqContainer\");\n }\n\n // Originally a primitive type, but here, can be null.\n // TODO: Replace by default value?\n if (numElementsIntVal.value === null) {\n return throwNullException(\"numElementsIntVal.value\");\n }\n let numElements = numElementsIntVal.value;\n\n // var seqCountVal = state.PopEvaluationStack () as IntValue;\n let seqCountVal = asOrThrows(this.state.PopEvaluationStack(), IntValue);\n let seqCount = seqCountVal.value;\n\n // Originally a primitive type, but here, can be null.\n // TODO: Replace by default value?\n if (seqCount === null) {\n return throwNullException(\"seqCount\");\n }\n\n let loopIndex = seqCount / numElements;\n let iterationIndex = seqCount % numElements;\n\n let seqPathStr = seqContainer.path.toString();\n let sequenceHash = 0;\n for (let i = 0, l = seqPathStr.length; i < l; i++) {\n sequenceHash += seqPathStr.charCodeAt(i) || 0;\n }\n let randomSeed = sequenceHash + loopIndex + this.state.storySeed;\n let random = new PRNG(Math.floor(randomSeed));\n\n let unpickedIndices = [];\n for (let i = 0; i < numElements; ++i) {\n unpickedIndices.push(i);\n }\n\n for (let i = 0; i <= iterationIndex; ++i) {\n let chosen = random.next() % unpickedIndices.length;\n let chosenIndex = unpickedIndices[chosen];\n unpickedIndices.splice(chosen, 1);\n\n if (i == iterationIndex) {\n return chosenIndex;\n }\n }\n\n throw new Error(\"Should never reach here\");\n }\n\n public Error(message: string, useEndLineNumber = false): never {\n let e = new StoryException(message);\n e.useEndLineNumber = useEndLineNumber;\n throw e;\n }\n\n public Warning(message: string) {\n this.AddError(message, true);\n }\n\n public AddError(\n message: string,\n isWarning = false,\n useEndLineNumber = false\n ) {\n let dm = this.currentDebugMetadata;\n\n let errorTypeStr = isWarning ? \"WARNING\" : \"ERROR\";\n\n if (dm != null) {\n let lineNum = useEndLineNumber ? dm.endLineNumber : dm.startLineNumber;\n message =\n \"RUNTIME \" +\n errorTypeStr +\n \": '\" +\n dm.fileName +\n \"' line \" +\n lineNum +\n \": \" +\n message;\n } else if (!this.state.currentPointer.isNull) {\n message =\n \"RUNTIME \" +\n errorTypeStr +\n \": (\" +\n this.state.currentPointer +\n \"): \" +\n message;\n } else {\n message = \"RUNTIME \" + errorTypeStr + \": \" + message;\n }\n\n this.state.AddError(message, isWarning);\n\n // In a broken state don't need to know about any other errors.\n if (!isWarning) this.state.ForceEnd();\n }\n\n public Assert(condition: boolean, message: string | null = null) {\n if (condition == false) {\n if (message == null) {\n message = \"Story assert\";\n }\n\n throw new Error(message + \" \" + this.currentDebugMetadata);\n }\n }\n\n get currentDebugMetadata(): DebugMetadata | null {\n let dm: DebugMetadata | null;\n\n let pointer = this.state.currentPointer;\n if (!pointer.isNull && pointer.Resolve() !== null) {\n dm = pointer.Resolve()!.debugMetadata;\n if (dm !== null) {\n return dm;\n }\n }\n\n for (let i = this.state.callStack.elements.length - 1; i >= 0; --i) {\n pointer = this.state.callStack.elements[i].currentPointer;\n if (!pointer.isNull && pointer.Resolve() !== null) {\n dm = pointer.Resolve()!.debugMetadata;\n if (dm !== null) {\n return dm;\n }\n }\n }\n\n for (let i = this.state.outputStream.length - 1; i >= 0; --i) {\n let outputObj = this.state.outputStream[i];\n dm = outputObj.debugMetadata;\n if (dm !== null) {\n return dm;\n }\n }\n\n return null;\n }\n\n get mainContentContainer() {\n if (this._temporaryEvaluationContainer) {\n return this._temporaryEvaluationContainer;\n } else {\n return this._mainContentContainer;\n }\n }\n\n /**\n * `_mainContentContainer` is almost guaranteed to be set in the\n * constructor, unless the json is malformed.\n */\n private _mainContentContainer!: Container;\n private _listDefinitions: ListDefinitionsOrigin | null = null;\n\n private _externals: Map;\n private _variableObservers: Map | null =\n null;\n private _hasValidatedExternals: boolean = false;\n\n private _temporaryEvaluationContainer: Container | null = null;\n\n /**\n * `state` is almost guaranteed to be set in the constructor, unless\n * using the compiler-specific constructor which will likely not be used in\n * the real world.\n */\n private _state!: StoryState;\n\n private _asyncContinueActive: boolean = false;\n private _stateSnapshotAtLastNewline: StoryState | null = null;\n private _sawLookaheadUnsafeFunctionAfterNewline: boolean = false;\n\n private _recursiveContinueCount: number = 0;\n\n private _asyncSaving: boolean = false;\n\n private _profiler: any | null = null; // TODO: Profiler\n}\n\nexport namespace Story {\n export enum OutputStateChange {\n NoChange = 0,\n ExtendedBeyondNewline = 1,\n NewlineRemoved = 2,\n }\n\n export interface EvaluateFunctionTextOutput {\n returned: any;\n output: string;\n }\n\n export interface ExternalFunctionDef {\n function: ExternalFunction;\n lookAheadSafe: boolean;\n }\n\n export type VariableObserver = (variableName: string, newValue: any) => void;\n export type ExternalFunction = (...args: any) => any;\n}\n"],"names":["Path","constructor","this","_components","_componentsString","_isRelative","arguments","componentsString","Component","head","tail","push","concat","Array","relative","isRelative","componentCount","length","tailComps","slice","self","lastComponent","lastComponentIdx","containsNamedComponent","i","l","isIndex","path","GetComponent","index","PathByAppendingPath","pathToAppend","p","upwardMoves","isParent","join","value","substring","componentStrings","split","str","test","parseInt","toString","Equals","otherPath","PathByAppendingComponent","c","Debug","ValueType","PushPopType","ErrorType","asOrNull","obj","type","unsafeTypeAssertion","asOrThrows","Error","asINamedContentOrNull","hasValidName","name","nullIfUndefined","isEquatable","parentId","indexOrName","static","otherComp","Assert","condition","message","console","warn","trace","AssertType","variable","NullException","throwNullException","InkObject","parent","_debugMetadata","_path","debugMetadata","ownDebugMetadata","DebugLineNumberOfPath","root","rootContentContainer","targetContent","ContentAtPath","dm","startLineNumber","comps","child","container","Container","namedChild","unshift","content","indexOf","ResolvePath","nearestContainer","contentContainer","ConvertPathToRelative","globalPath","ownPath","minPathLength","Math","min","lastSharedPathCompIndex","ownComp","numUpwardsMoves","newPathComps","up","ToParent","down","CompactPathString","globalPathStr","relativePathStr","ancestor","Copy","SetChild","prop","StringBuilder","string","Length","Append","AppendLine","AppendFormat","format","_len","args","_key","replace","match","num","Clear","InkListItem","originName","itemName","nameParts","Null","isNull","fullName","otherItem","copy","serialized","JSON","stringify","key","parse","isLikeInkListItem","inkListItem","item","hasOwnProperty","InkList","Map","super","origins","_originNames","otherList","otherOriginNames","originNames","singleOriginListName","originStory","SetInitialOriginName","listDefinitions","def","TryListGetDefinition","exists","result","singleElement","Add","Key","Value","myListItem","listValue","_a","FindSingleItemListWithName","AddItem","itemOrItemName","origin","intVal","TryGetValueForItem","foundListDef","ContainsItemWithName","itemVal","ValueForItem","ContainsItemNamed","fromSerializedKey","ContainsKey","has","serializedKey","set","Remove","delete","Count","size","originOfMaxItem","maxOriginName","maxItem","every","initialOriginName","SetInitialOriginNames","initialOriginNames","max","minItem","inverse","list","items","all","Union","union","Intersect","intersection","HasIntersection","Without","listToRemove","Contains","what","GreaterThan","GreaterThanOrEquals","LessThan","LessThanOrEquals","MaxAsList","MinAsList","ListWithSubRange","minBound","maxBound","ordered","orderedItems","minValue","maxValue","Number","MAX_SAFE_INTEGER","isInteger","subList","otherInkList","sort","x","y","localeCompare","sb","valueOf","NaN","StoryException","useEndLineNumber","tryGetValueFromMap","map","val","get","AbstractValue","preferredNumberType","Int","IntValue","Float","isNaN","FloatValue","BoolValue","Boolean","StringValue","String","DivertTargetValue","ListValue","Create","valueObject","BadCastException","targetType","valueType","isTruthy","Bool","Cast","newType","_isNewline","_isInlineWhitespace","isNewline","isInlineWhitespace","isNonWhitespace","parsedInt","defaultValue","tryParseInt","parsedFloat","parseFloat","tryParseFloat","DivertTarget","targetPath","VariablePointerValue","variableName","contextIndex","undefined","_contextIndex","VariablePointer","List","listOrSingleItem","singleValue","oldValue","newValue","oldList","newList","SearchResult","approximate","correctObj","searchResult","_content","namedContent","visitsShouldBeCounted","turnIndexShouldBeCounted","countingAtStartOnly","_pathToFirstLeafContent","AddContent","namedOnlyContent","namedOnlyContentDict","inkObject","named","existingNamedOnly","AddToNamedContentOnly","countFlags","flags","CountFlags","Visits","Turns","CountStartOnly","flag","pathToFirstLeafContent","internalPathToFirstLeafContent","components","contentObjOrList","contentList","contentObj","TryAddNamedContent","namedContentObj","partialPathStart","partialPathLength","currentContainer","currentObj","comp","foundObj","ContentWithPathComponent","InsertContent","splice","AddContentsOfContainer","otherContainer","component","foundContent","BuildStringOfHierarchy","indentation","pointedObj","appendIndentation","onlyNamed","Glue","ControlCommand","commandType","_commandType","CommandType","NotSet","EvalStart","EvalOutput","EvalEnd","Duplicate","PopEvaluatedValue","PopFunction","PopTunnel","BeginString","EndString","NoOp","ChoiceCount","TurnsSince","ReadCount","Random","SeedRandom","VisitIndex","SequenceShuffleIndex","StartThread","Done","End","ListFromInt","ListRange","ListRandom","BeginTag","EndTag","Pointer","Resolve","Divert","_targetPath","targetObj","targetPointer","_targetPointer","StartOf","targetPathString","hasVariableTarget","variableDivertName","stackPushType","pushesToStack","isExternal","externalArgs","isConditional","otherDivert","targetStr","Function","ChoicePoint","onceOnly","_pathOnChoice","hasCondition","hasStartContent","hasChoiceOnlyContent","isInvisibleDefault","pathOnChoice","choiceTargetObj","choiceTarget","pathStringOnChoice","VariableReference","containerForCount","pathForCount","pathStringForCount","VariableAssignment","isNewDeclaration","isGlobal","Void","NativeFunctionCall","functionName","GenerateNativeFunctionsIfNecessary","_nativeFunctions","_name","_isPrototype","_prototype","numberOfParameters","_numberOfParameters","Call","parameters","hasList","CallBinaryListOperation","coercedParams","CoerceValuesToSingleType","coercedType","CallType","parametersOfSingleType","param1","valType","val1","paramCount","_operationFuncs","opForTypeObj","val2","opForType","resultVal","CallListIncrementOperation","v1","v2","op","asBooleanOrThrows","listIntParams","listVal","resultInkList","listItemKey","listItemValue","listItem","intOp","targetInt","itemOrigin","incrementedItem","TryGetItemWithValue","parametersIn","specialCaseList","parametersOut","inkObjectVal","castedValue","t","AddIntBinaryOp","Subtract","Multiply","Divide","floor","Mod","AddIntUnaryOp","Negate","Equal","Greater","Less","NotEquals","Not","And","Or","Max","Min","Pow","pow","Floor","Identity","Ceiling","AddFloatBinaryOp","AddFloatUnaryOp","ceil","AddStringBinaryOp","Has","includes","Hasnt","AddListBinaryOp","AddListUnaryOp","Invert","All","ListMin","ListMax","ValueOfList","divertTargetsEqual","d1","d2","divertTargetsNotEqual","AddOpToNativeFunc","AddOpFuncForType","nativeFunc","Tag","tagText","text","Choice","threadAtGeneration","sourcePath","tags","originalThreadIndex","ListDefinition","_items","_itemNameToValues","ContainsItem","ListDefinitionsOrigin","lists","_lists","_allUnambiguousListValueCache","listOfLists","definition","JsonSerialisation","jArray","skipLast","count","jTok","runtimeObj","JTokenToRuntimeObject","writer","dictionary","WriteObjectStart","WritePropertyStart","WriteRuntimeObject","WritePropertyEnd","WriteObjectEnd","WriteArrayStart","WriteArrayEnd","dict","WriteIntProperty","WriteRuntimeContainer","divert","divTypeKey","Tunnel","WriteProperty","choicePoint","boolVal","WriteBool","WriteInt","floatVal","WriteFloat","strVal","Write","WriteStringStart","WriteStringInner","WriteStringEnd","WriteInkList","divTargetVal","varPtrVal","controlCmd","_controlCommandNames","varRef","readCountPath","varAss","tag","choice","WriteChoice","jObject","token","firstChar","CallExistsWithName","CallWithName","isArray","propValue","varPtr","isDivert","divPushType","external","target","readCountVarRef","isVarAss","isGlobalVar","varName","isNewDecl","listContent","rawList","namesAsObjs","nameToVal","JObjectToChoice","JArrayToContainer","toJson","me","removes","space","k","v","some","r","withoutName","hasNameProperty","hasTerminator","namedContainer","WriteNull","JArrayToRuntimeObjList","terminatingObj","namedContentItem","namedSubContainer","jObj","w","WritePropertyNameStart","WritePropertyNameInner","WritePropertyNameEnd","listDefJson","defsObj","allDefs","nameValueKey","nameValue","TOTAL_VALUES","CallStack","elements","callStack","depth","currentElement","cs","_threads","callstack","currentElementIndex","currentThread","canPop","_threadCounter","_startOfRoot","Story","storyContext","Reset","toCopy","otherThread","Thread","Element","SetJsonToken","jThreads","jThreadTok","jThreadObj","thread","WriteJson","WriteObject","PushThread","newThread","threadIndex","ForkThread","forkedThread","PopThread","canPopThread","elementIsEvaluateFromGame","FunctionEvaluationFromGame","Push","externalEvaluationStackHeight","outputStreamLengthWithPushed","element","currentPointer","evaluationStackHeightWhenPushed","functionStartInOutputStream","CanPop","Pop","pop","GetTemporaryVariableWithName","varValue","temporaryVariables","SetTemporaryVariable","declareNew","contextElement","RetainListOriginsForAssignment","ContextForVariableNamed","ThreadWithIndex","filtered","filter","callStackTrace","isCurrent","pointer","inExpressionEvaluation","previousPointer","jThreadCallstack","jElTok","currentContainerPathStr","jElementObj","pushPopType","currentContainerPathStrToken","threadPointerResult","Warning","el","temps","JObjectToDictionaryRuntimeObjs","clear","prevContentObjPath","prevPath","PointerAtPath","e","WriteDictionaryRuntimeObjs","resolvedPointer","VariablesState","variableChangedEvent","callback","variableChangedEventCallbacks","batchObservingVariableChanges","_batchObservingVariableChanges","_changedVariablesForBatchObs","Set","currentValue","_globalVariables","_callStack","$","varContents","patch","TryGetGlobal","_defaultGlobalVariables","SetGlobal","listDefsOrigin","_listDefsOrigin","Proxy","ApplyPatch","namedVarKey","namedVarValue","globals","changedVariables","add","jToken","varValKey","varValValue","loadedToken","tokenInkObject","keyValKey","keyValValue","dontSaveDefaultValues","defaultVal","RuntimeObjectsEqual","obj1","obj2","GetVariableWithName","GetRawVariableWithName","varPointer","ValueAtVariablePointer","TryGetDefaultVariableValue","GlobalVariableExistsWithName","variableValue","Assign","setGlobal","ResolveVariablePointer","existingPointer","SnapshotDefaultGlobals","AddChangedVariable","GetContextIndexOfVariableNamed","doubleRedirectionPointer","ObserveVariableChange","PRNG","seed","next","nextFloat","StatePatch","_globals","_changedVariables","visitCounts","_visitCounts","turnIndices","_turnIndices","TryGetVisitCount","SetVisitCount","SetTurnIndex","TryGetTurnIndex","SimpleJson","Reader","ToDictionary","ToArray","_rootObject","Writer","_currentPropertyName","_currentString","_stateStack","_collectionStack","_propertyNameStack","_jsonObject","inner","StartNewObject","newObject","state","State","Property","currentCollection","currentPropertyName","propertyName","None","StateElement","Object","innerOrContent","WriteFloatProperty","IncrementChildCount","childCount","PropertyName","_addToCurrentObject","error","POSITIVE_INFINITY","NEGATIVE_INFINITY","currEl","Flow","story","outputStream","currentChoices","jChoiceThreadsObj","LoadFlowChoiceThreads","WriteListRuntimeObjs","hasChoiceThreads","jChoiceThreads","foundActiveThread","jSavedChoiceThread","StoryState","ToJson","indented","LoadJson","json","TextToDictionary","LoadJsonObj","onDidLoadState","VisitCountAtPathString","pathString","visitCountOut","_patch","VisitCountForContainer","containerPathStr","count2","IncrementVisitCountForContainer","currCount","RecordTurnIndexVisitToContainer","currentTurnIndex","TurnsSinceForContainer","index2","callstackDepth","_currentFlow","canContinue","generatedChoices","currentErrors","_currentErrors","currentWarnings","_currentWarnings","variablesState","_variablesState","evaluationStack","_evaluationStack","_currentTurnIndex","currentPathString","hasError","hasWarning","currentText","_outputStreamTextDirty","inTag","outputObj","textContent","controlCommand","_currentText","CleanOutputWhitespace","currentWhitespaceStart","startOfLine","charAt","currentTags","_outputStreamTagsDirty","_currentTags","txt","currentFlowName","currentFlowIsDefaultFlow","kDefaultFlowName","aliveFlowNames","_aliveFlowNamesDirty","_aliveFlowNames","_namedFlows","flowName","keys","kInkSaveStateVersion","kMinCompatibleLoadVersion","divertedPointer","storySeed","previousRandom","didSafeExit","OutputStreamDirty","timeSeed","Date","getTime","GoToStart","mainContentContainer","SwitchFlow_Internal","flow","SwitchToDefaultFlow_Internal","RemoveFlow_Internal","CopyAndStartPatching","namedFlowKey","namedFlowValue","RestoreAfterPatch","ApplyAnyPatch","ApplyCountChanges","newCount","isVisit","WriteIntDictionary","inkVersionCurrent","jSaveVersion","flowsObj","flowsObjDict","flowsObjDictEntries","entries","namedFlowObjKey","namedFlowObjValue","flowObj","currFlowName","currentDivertTargetPath","divertPath","JObjectToIntDictionary","ResetErrors","ResetOutput","objs","PushToOutputStream","listText","TrySplittingHeadTailWhitespace","textObj","PushToOutputStreamIndividual","PopFromOutputStream","single","headFirstNewlineIdx","headLastNewlineIdx","tailLastNewlineIdx","tailFirstNewlineIdx","listTexts","innerStrStart","innerStrEnd","leadingSpaces","innerStrText","numSpaces","trailingSpaces","glue","includeInOutput","TrimNewlinesFromOutputStream","functionTrimIndex","glueTrimIndex","o","trimIndex","RemoveExistingGlue","callStackElements","outputStreamEndsInNewline","outputStreamContainsContent","removeWhitespaceFrom","cmd","inStringEvaluation","PushEvaluationStack","n","PopEvaluationStack","numberOfObjects","PeekEvaluationStack","ForceEnd","TrimWhitespaceFromFunctionEnd","functionStartPoint","PopCallStack","popType","SetChosenPath","incrementingTurnIndex","newPointer","StartFunctionEvaluationFromGame","funcContainer","PassArgumentsToEvaluationStack","TryExitFunctionEvaluationFromGame","CompleteFunctionEvaluationFromGame","originalEvaluationStackHeight","returnedObj","poppedObj","returnVal","AddError","isWarning","Stopwatch","startTime","ElapsedMilliseconds","Start","Stop","nVal","isFinite","choices","_state","IfAsyncWeCant","_listDefinitions","StartProfiling","EndProfiling","inkVersionMinimumCompatible","onError","onDidContinue","onMakeChoice","onEvaluateFunction","onCompleteEvaluateFunction","onChoosePathString","_prevContainers","allowExternalFunctionFallbacks","_variableObservers","_hasValidatedExternals","_temporaryEvaluationContainer","_asyncContinueActive","_stateSnapshotAtLastNewline","_sawLookaheadUnsafeFunctionAfterNewline","_recursiveContinueCount","_asyncSaving","_profiler","_mainContentContainer","jsonString","_externals","rootObject","versionObj","formatFromFile","listDefsObj","rootToken","JTokenToListDefinitions","ResetState","shouldReturn","VariableStateDidChangeEvent","bind","ResetGlobals","ResetCallstack","originalPointer","ChoosePath","ContinueInternal","SwitchFlow","RemoveFlow","SwitchToDefaultFlow","Continue","ContinueAsync","asyncContinueComplete","millisecsLimitAsync","ValidateExternalBindings","PreContinue","isAsyncTimeLimited","durationStopwatch","ContinueSingleStep","RestoreStateSnapshot","PostContinue","err","PreStep","Step","PostStep","TryFollowDefaultInvisibleChoice","PreSnapshot","change","CalculateNewlineOutputStateChange","OutputStateChange","ExtendedBeyondNewline","NewlineRemoved","DiscardSnapshot","StateSnapshot","PostSnapshot","prevText","currText","prevTagCount","currTagCount","newlineStillExists","NoChange","ContinueMaximally","KnotContainerWithName","pathLengthToUse","CopyStateForBackgroundThreadSave","stateToSave","BackgroundSaveComplete","shouldAddToStream","containerToEnter","VisitContainer","currentContentObj","isLogicOrFlowControl","PerformLogicAndFlowControl","ProcessChoice","contextIdx","NextContent","atStart","VisitChangedContainersDueToDivert","prevAncestor","currentChildOfContainer","currentContainerAncestor","allChildrenEnteredAtStart","enteringAtStart","PopChoiceStringAndTags","choiceOnlyStrVal","showChoice","conditionValue","IsTruthy","startText","choiceOnlyText","reverse","divTarget","currentDivert","intContent","errorMessage","CallExternalFunction","sourceName","evalCommand","output","overrideTunnelReturnTarget","popped","names","expected","errorMsg","contentStackForTag","outputCountConsumed","command","choiceTag","contentStackForString","contentToRetain","rescuedTag","choiceCount","extraNote","eitherCount","divertTarget","maxInt","minInt","randomRange","resultSeed","nextRandom","chosenValue","shuffleIndex","NextSequenceShuffleIndex","listNameVal","generatedListValue","foundItem","targetList","listItemIndex","listEnumerator","randomItem","assignedVal","foundValue","func","funcParams","ChoosePathString","resetCallstack","funcDetail","activityStr","ChooseChoiceIndex","choiceIdx","choiceToChoose","HasFunction","EvaluateFunction","returnTextOutput","trim","outputStreamBefore","stringOutput","textOutput","returned","EvaluateExpression","exprContainer","startCallStackHeight","evalStackHeight","funcName","numberOfArguments","funcDef","fallbackFunctionContainer","foundExternal","lookAheadSafe","valueObj","funcResult","function","returnObj","BindExternalFunctionGeneral","lookaheadSafe","TryCoerce","BindExternalFunction","coercedArgs","apply","UnbindExternalFunction","missingExternals","from","innerContent","ObserveVariable","observer","ObserveVariables","variableNames","observers","RemoveVariableObserver","specificVariableName","variableObservers","newValueObj","globalTags","TagsAtStartOfFlowContainerWithPathString","TagsForContentAtPath","flowContainer","firstContent","BuildStringOfContainer","IncrementContentPointer","didPop","successfulIncrement","nextAncestor","indexInAncestor","allChoices","invisibleChoices","numElementsIntVal","seqContainer","numElements","seqCount","loopIndex","iterationIndex","seqPathStr","sequenceHash","charCodeAt","randomSeed","random","unpickedIndices","chosen","chosenIndex","currentDebugMetadata","errorTypeStr","lineNum","endLineNumber","fileName"],"mappings":"mPAAaA,EAWXC,cAKE,GAJAC,KAAKC,YAAc,GACnBD,KAAKE,kBAAoB,KACzBF,KAAKG,aAAc,EAEQ,iBAAhBC,UAAU,GAAgB,CACnC,IAAIC,EAAmBD,UAAU,GACjCJ,KAAKK,iBAAmBA,CAC1B,MAAO,GACLD,UAAU,aAAcN,EAAKQ,WAC7BF,UAAU,aAAcN,EACxB,CACA,IAAIS,EAAOH,UAAU,GACjBI,EAAOJ,UAAU,GACrBJ,KAAKC,YAAYQ,KAAKF,GACtBP,KAAKC,YAAcD,KAAKC,YAAYS,OAAOF,EAAKP,YACjD,MAAM,GAAIG,UAAU,aAAcO,MAAO,CACxC,IAAIJ,EAAOH,UAAU,GACjBQ,IAAaR,UAAU,GAC3BJ,KAAKC,YAAcD,KAAKC,YAAYS,OAAOH,GAC3CP,KAAKG,YAAcS,CACrB,CACF,CACIC,iBACF,OAAOb,KAAKG,WACd,CACIW,qBACF,OAAOd,KAAKC,YAAYc,MAC1B,CACIR,WACF,OAAIP,KAAKC,YAAYc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templates/browser_with_server/ink.js b/templates/browser_with_server/ink.js index 1d0a53a4..3e4ebe54 100644 --- a/templates/browser_with_server/ink.js +++ b/templates/browser_with_server/ink.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).inkjs={})}(this,(function(t){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,i=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){o=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}var S,k=function(){function t(){if(n(this,t),this._components=[],this._componentsString=null,this._isRelative=!1,"string"==typeof arguments[0]){var e=arguments[0];this.componentsString=e}else if(arguments[0]instanceof t.Component&&arguments[1]instanceof t){var i=arguments[0],r=arguments[1];this._components.push(i),this._components=this._components.concat(r._components)}else if(arguments[0]instanceof Array){var a=arguments[0],s=!!arguments[1];this._components=this._components.concat(a),this._isRelative=s}}return r(t,[{key:"isRelative",get:function(){return this._isRelative}},{key:"componentCount",get:function(){return this._components.length}},{key:"head",get:function(){return this._components.length>0?this._components[0]:null}},{key:"tail",get:function(){return this._components.length>=2?new t(this._components.slice(1,this._components.length)):t.self}},{key:"length",get:function(){return this._components.length}},{key:"lastComponent",get:function(){var t=this._components.length-1;return t>=0?this._components[t]:null}},{key:"containsNamedComponent",get:function(){for(var t=0,e=this._components.length;t=0}},{key:"isParent",get:function(){return this.name==t.parentId}},{key:"toString",value:function(){return this.isIndex?this.index.toString():this.name}},{key:"Equals",value:function(t){return null!=t&&t.isIndex==this.isIndex&&(this.isIndex?this.index==t.index:this.name==t.name)}}],[{key:"ToParent",value:function(){return new e(t.parentId)}}]),e}();t.Component=e}(k||(k={})),function(t){function e(t,e){if(!t)throw void 0!==e&&console.warn(e),console.trace&&console.trace(),new Error("")}t.AssertType=function(t,n,i){e(t instanceof n,i)},t.Assert=e}(S||(S={}));var O=function(t){a(i,t);var e=v(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i)}(h(Error));function P(t){throw new O("".concat(t," is null or undefined"))}var N=function(){function t(){n(this,t),this.parent=null,this._debugMetadata=null,this._path=null}return r(t,[{key:"debugMetadata",get:function(){return null===this._debugMetadata&&this.parent?this.parent.debugMetadata:this._debugMetadata},set:function(t){this._debugMetadata=t}},{key:"ownDebugMetadata",get:function(){return this._debugMetadata}},{key:"DebugLineNumberOfPath",value:function(t){if(null===t)return null;var e=this.rootContentContainer;if(e){var n=e.ContentAtPath(t).obj;if(n){var i=n.debugMetadata;if(null!==i)return i.startLineNumber}}return null}},{key:"path",get:function(){if(null==this._path)if(null==this.parent)this._path=new k;else{for(var t=[],e=this,n=C(e.parent,K);null!==n;){var i=w(e);if(null!=i&&i.hasValidName){if(null===i.name)return P("namedChild.name");t.unshift(new k.Component(i.name))}else t.unshift(new k.Component(n.content.indexOf(e)));e=n,n=C(n.parent,K)}this._path=new k(t)}return this._path}},{key:"ResolvePath",value:function(t){if(null===t)return P("path");if(t.isRelative){var e=C(this,K);return null===e&&(S.Assert(null!==this.parent,"Can't resolve relative path because we don't have a parent"),e=C(this.parent,K),S.Assert(null!==e,"Expected parent to be a container"),S.Assert(t.GetComponent(0).isParent),t=t.tail),null===e?P("nearestContainer"):e.ContentAtPath(t)}var n=this.rootContentContainer;return null===n?P("contentContainer"):n.ContentAtPath(t)}},{key:"ConvertPathToRelative",value:function(t){for(var e=this.path,n=Math.min(t.length,e.length),i=-1,r=0;r1?e-1:0),i=1;i0){null==this._originNames&&this.Count>0?this._originNames=[]:(this._originNames||(this._originNames=[]),this._originNames.length=0);var t,e=g(this);try{for(e.s();!(t=e.n()).done;){var n=d(t.value,1)[0],i=I.fromSerializedKey(n);if(null===i.originName)return P("item.originName");this._originNames.push(i.originName)}}catch(t){e.e(t)}finally{e.f()}}return this._originNames}},{key:"SetInitialOriginName",value:function(t){this._originNames=[t]}},{key:"SetInitialOriginNames",value:function(t){this._originNames=null==t?null:t.slice()}},{key:"maxItem",get:function(){var t,e={Key:I.Null,Value:0},n=g(this);try{for(n.s();!(t=n.n()).done;){var i=d(t.value,2),r=i[0],a=i[1],s=I.fromSerializedKey(r);(e.Key.isNull||a>e.Value)&&(e={Key:s,Value:a})}}catch(t){n.e(t)}finally{n.f()}return e}},{key:"minItem",get:function(){var t,e={Key:I.Null,Value:0},n=g(this);try{for(n.s();!(t=n.n()).done;){var i=d(t.value,2),r=i[0],a=i[1],s=I.fromSerializedKey(r);(e.Key.isNull||at.maxItem.Value)}},{key:"GreaterThanOrEquals",value:function(t){return 0!=this.Count&&(0==t.Count||this.minItem.Value>=t.minItem.Value&&this.maxItem.Value>=t.maxItem.Value)}},{key:"LessThan",value:function(t){return 0!=t.Count&&(0==this.Count||this.maxItem.Value0?new s(this.maxItem):new s}},{key:"MinAsList",value:function(){return this.Count>0?new s(this.minItem):new s}},{key:"ListWithSubRange",value:function(t,e){if(0==this.Count)return new s;var n=this.orderedItems,i=0,r=Number.MAX_SAFE_INTEGER;Number.isInteger(t)?i=t:t instanceof s&&t.Count>0&&(i=t.minItem.Value),Number.isInteger(e)?r=e:t instanceof s&&t.Count>0&&(r=e.maxItem.Value);var a=new s;a.SetInitialOriginNames(this.originNames);var o,u=g(n);try{for(u.s();!(o=u.n()).done;){var l=o.value;l.Value>=i&&l.Value<=r&&a.Add(l.Key,l.Value)}}catch(t){u.e(t)}finally{u.f()}return a}},{key:"Equals",value:function(t){if(t instanceof s==!1)return!1;if(t.Count!=this.Count)return!1;var e,n=g(this);try{for(n.s();!(e=n.n()).done;){var i=d(e.value,1)[0];if(!t.has(i))return!1}}catch(t){n.e(t)}finally{n.f()}return!0}},{key:"orderedItems",get:function(){var t,e=new Array,n=g(this);try{for(n.s();!(t=n.n()).done;){var i=d(t.value,2),r=i[0],a=i[1],s=I.fromSerializedKey(r);e.push({Key:s,Value:a})}}catch(t){n.e(t)}finally{n.f()}return e.sort((function(t,e){return null===t.Key.originName?P("x.Key.originName"):null===e.Key.originName?P("y.Key.originName"):t.Value==e.Value?t.Key.originName.localeCompare(e.Key.originName):t.Valuee.Value?1:0})),e}},{key:"toString",value:function(){for(var t=this.orderedItems,e=new A,n=0;n0&&e.Append(", ");var i=t[n].Key;if(null===i.itemName)return P("item.itemName");e.Append(i.itemName)}return e.toString()}},{key:"valueOf",value:function(){return NaN}}],[{key:"FromString",value:function(t,e){var n,i=null===(n=e.listDefinitions)||void 0===n?void 0:n.FindSingleItemListWithName(t);if(i)return null===i.value?P("listValue.value"):new s(i.value);throw new Error("Could not find the InkListItem from the string '"+t+"' to create an InkList because it doesn't exist in the original list definition in ink.")}}]),s}(h(Map)),x=function(t){a(i,t);var e=v(i);function i(t){var r;return n(this,i),(r=e.call(this,t)).useEndLineNumber=!1,r.message=t,r.name="StoryException",r}return r(i)}(h(Error));function W(t,e,n){if(null===t)return{result:n,exists:!1};var i=t.get(e);return void 0===i?{result:n,exists:!1}:{result:i,exists:!0}}var V,L=function(t){a(i,t);var e=v(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"Copy",value:function(){return b(i.Create(this.valueObject),N)}},{key:"BadCastException",value:function(t){return new x("Can't cast "+this.valueObject+" from "+this.valueType+" to "+t)}}],[{key:"Create",value:function(t,e){if(e){if(e===V.Int&&Number.isInteger(Number(t)))return new D(Number(t));if(e===V.Float&&!isNaN(t))return new B(Number(t))}return"boolean"==typeof t?new R(Boolean(t)):"string"==typeof t?new G(String(t)):Number.isInteger(Number(t))?new D(Number(t)):isNaN(t)?t instanceof k?new M(b(t,k)):t instanceof F?new U(b(t,F)):null:new B(Number(t))}}]),i}(N),j=function(t){a(i,t);var e=v(i);function i(t){var r;return n(this,i),(r=e.call(this)).value=t,r}return r(i,[{key:"valueObject",get:function(){return this.value}},{key:"toString",value:function(){return null===this.value?P("Value.value"):this.value.toString()}}]),i}(L),R=function(t){a(i,t);var e=v(i);function i(t){return n(this,i),e.call(this,t||!1)}return r(i,[{key:"isTruthy",get:function(){return Boolean(this.value)}},{key:"valueType",get:function(){return V.Bool}},{key:"Cast",value:function(t){if(null===this.value)return P("Value.value");if(t==this.valueType)return this;if(t==V.Int)return new D(this.value?1:0);if(t==V.Float)return new B(this.value?1:0);if(t==V.String)return new G(this.value?"true":"false");throw this.BadCastException(t)}},{key:"toString",value:function(){return this.value?"true":"false"}}]),i}(j),D=function(t){a(i,t);var e=v(i);function i(t){return n(this,i),e.call(this,t||0)}return r(i,[{key:"isTruthy",get:function(){return 0!=this.value}},{key:"valueType",get:function(){return V.Int}},{key:"Cast",value:function(t){if(null===this.value)return P("Value.value");if(t==this.valueType)return this;if(t==V.Bool)return new R(0!==this.value);if(t==V.Float)return new B(this.value);if(t==V.String)return new G(""+this.value);throw this.BadCastException(t)}}]),i}(j),B=function(t){a(i,t);var e=v(i);function i(t){return n(this,i),e.call(this,t||0)}return r(i,[{key:"isTruthy",get:function(){return 0!=this.value}},{key:"valueType",get:function(){return V.Float}},{key:"Cast",value:function(t){if(null===this.value)return P("Value.value");if(t==this.valueType)return this;if(t==V.Bool)return new R(0!==this.value);if(t==V.Int)return new D(this.value);if(t==V.String)return new G(""+this.value);throw this.BadCastException(t)}}]),i}(j),G=function(t){a(i,t);var e=v(i);function i(t){var r;return n(this,i),(r=e.call(this,t||""))._isNewline="\n"==r.value,r._isInlineWhitespace=!0,null===r.value?f(r,P("Value.value")):(r.value.length>0&&r.value.split("").every((function(t){return" "==t||"\t"==t||(r._isInlineWhitespace=!1,!1)})),r)}return r(i,[{key:"valueType",get:function(){return V.String}},{key:"isTruthy",get:function(){return null===this.value?P("Value.value"):this.value.length>0}},{key:"isNewline",get:function(){return this._isNewline}},{key:"isInlineWhitespace",get:function(){return this._isInlineWhitespace}},{key:"isNonWhitespace",get:function(){return!this.isNewline&&!this.isInlineWhitespace}},{key:"Cast",value:function(t){if(t==this.valueType)return this;if(t==V.Int){var e=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=parseInt(t);return Number.isNaN(n)?{result:e,exists:!1}:{result:n,exists:!0}}(this.value);if(e.exists)return new D(e.result);throw this.BadCastException(t)}if(t==V.Float){var n=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=parseFloat(t);return Number.isNaN(n)?{result:e,exists:!1}:{result:n,exists:!0}}(this.value);if(n.exists)return new B(n.result);throw this.BadCastException(t)}throw this.BadCastException(t)}}]),i}(j),M=function(t){a(i,t);var e=v(i);function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return n(this,i),e.call(this,t)}return r(i,[{key:"valueType",get:function(){return V.DivertTarget}},{key:"targetPath",get:function(){return null===this.value?P("Value.value"):this.value},set:function(t){this.value=t}},{key:"isTruthy",get:function(){throw new Error("Shouldn't be checking the truthiness of a divert target")}},{key:"Cast",value:function(t){if(t==this.valueType)return this;throw this.BadCastException(t)}},{key:"toString",value:function(){return"DivertTargetValue("+this.targetPath+")"}}]),i}(j),J=function(t){a(i,t);var e=v(i);function i(t){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return n(this,i),(r=e.call(this,t))._contextIndex=a,r}return r(i,[{key:"contextIndex",get:function(){return this._contextIndex},set:function(t){this._contextIndex=t}},{key:"variableName",get:function(){return null===this.value?P("Value.value"):this.value},set:function(t){this.value=t}},{key:"valueType",get:function(){return V.VariablePointer}},{key:"isTruthy",get:function(){throw new Error("Shouldn't be checking the truthiness of a variable pointer")}},{key:"Cast",value:function(t){if(t==this.valueType)return this;throw this.BadCastException(t)}},{key:"toString",value:function(){return"VariablePointerValue("+this.variableName+")"}},{key:"Copy",value:function(){return new i(this.variableName,this.contextIndex)}}]),i}(j),U=function(t){a(i,t);var e=v(i);function i(t,r){var a;return n(this,i),a=e.call(this,null),t||r?t instanceof F?a.value=new F(t):t instanceof I&&"number"==typeof r&&(a.value=new F({Key:t,Value:r})):a.value=new F,a}return r(i,[{key:"isTruthy",get:function(){return null===this.value?P("this.value"):this.value.Count>0}},{key:"valueType",get:function(){return V.List}},{key:"Cast",value:function(t){if(null===this.value)return P("Value.value");if(t==V.Int){var e=this.value.maxItem;return e.Key.isNull?new D(0):new D(e.Value)}if(t==V.Float){var n=this.value.maxItem;return n.Key.isNull?new B(0):new B(n.Value)}if(t==V.String){var i=this.value.maxItem;return i.Key.isNull?new G(""):new G(i.Key.toString())}if(t==this.valueType)return this;throw this.BadCastException(t)}}],[{key:"RetainListOriginsForAssignment",value:function(t,e){var n=C(t,i),r=C(e,i);return r&&null===r.value?P("newList.value"):n&&null===n.value?P("oldList.value"):void(n&&r&&0==r.value.Count&&r.value.SetInitialOriginNames(n.value.originNames))}}]),i}(j);!function(t){t[t.Bool=-1]="Bool",t[t.Int=0]="Int",t[t.Float=1]="Float",t[t.List=2]="List",t[t.String=3]="String",t[t.DivertTarget=4]="DivertTarget",t[t.VariablePointer=5]="VariablePointer"}(V||(V={}));var q=function(){function t(){n(this,t),this.obj=null,this.approximate=!1}return r(t,[{key:"correctObj",get:function(){return this.approximate?null:this.obj}},{key:"container",get:function(){return this.obj instanceof K?this.obj:null}},{key:"copy",value:function(){var e=new t;return e.obj=this.obj,e.approximate=this.approximate,e}}]),t}(),K=function(t){a(i,t);var e=v(i);function i(){var t;return n(this,i),(t=e.apply(this,arguments)).name=null,t._content=[],t.namedContent=new Map,t.visitsShouldBeCounted=!1,t.turnIndexShouldBeCounted=!1,t.countingAtStartOnly=!1,t._pathToFirstLeafContent=null,t}return r(i,[{key:"hasValidName",get:function(){return null!=this.name&&this.name.length>0}},{key:"content",get:function(){return this._content},set:function(t){this.AddContent(t)}},{key:"namedOnlyContent",get:function(){var t,e=new Map,n=g(this.namedContent);try{for(n.s();!(t=n.n()).done;){var i=d(t.value,2),r=i[0],a=b(i[1],N);e.set(r,a)}}catch(t){n.e(t)}finally{n.f()}var s,o=g(this.content);try{for(o.s();!(s=o.n()).done;){var u=w(s.value);null!=u&&u.hasValidName&&e.delete(u.name)}}catch(t){o.e(t)}finally{o.f()}return 0==e.size&&(e=null),e},set:function(t){var e=this.namedOnlyContent;if(null!=e){var n,i=g(e);try{for(i.s();!(n=i.n()).done;){var r=d(n.value,1)[0];this.namedContent.delete(r)}}catch(t){i.e(t)}finally{i.f()}}if(null!=t){var a,s=g(t);try{for(s.s();!(a=s.n()).done;){var o=w(d(a.value,2)[1]);null!=o&&this.AddToNamedContentOnly(o)}}catch(t){s.e(t)}finally{s.f()}}}},{key:"countFlags",get:function(){var t=0;return this.visitsShouldBeCounted&&(t|=i.CountFlags.Visits),this.turnIndexShouldBeCounted&&(t|=i.CountFlags.Turns),this.countingAtStartOnly&&(t|=i.CountFlags.CountStartOnly),t==i.CountFlags.CountStartOnly&&(t=0),t},set:function(t){var e=t;(e&i.CountFlags.Visits)>0&&(this.visitsShouldBeCounted=!0),(e&i.CountFlags.Turns)>0&&(this.turnIndexShouldBeCounted=!0),(e&i.CountFlags.CountStartOnly)>0&&(this.countingAtStartOnly=!0)}},{key:"pathToFirstLeafContent",get:function(){return null==this._pathToFirstLeafContent&&(this._pathToFirstLeafContent=this.path.PathByAppendingPath(this.internalPathToFirstLeafContent)),this._pathToFirstLeafContent}},{key:"internalPathToFirstLeafContent",get:function(){for(var t=[],e=this;e instanceof i;)e.content.length>0&&(t.push(new k.Component(0)),e=e.content[0]);return new k(t)}},{key:"AddContent",value:function(t){if(t instanceof Array){var e,n=g(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;this.AddContent(i)}}catch(t){n.e(t)}finally{n.f()}}else{var r=t;if(this._content.push(r),r.parent)throw new Error("content is already in "+r.parent);r.parent=this,this.TryAddNamedContent(r)}}},{key:"TryAddNamedContent",value:function(t){var e=w(t);null!=e&&e.hasValidName&&this.AddToNamedContentOnly(e)}},{key:"AddToNamedContentOnly",value:function(t){if(S.AssertType(t,N,"Can only add Runtime.Objects to a Runtime.Container"),b(t,N).parent=this,null===t.name)return P("namedContentObj.name");this.namedContent.set(t.name,t)}},{key:"ContentAtPath",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;-1==n&&(n=t.length);var r=new q;r.approximate=!1;for(var a=this,s=this,o=e;o=0&&t.index=0||u.set(c,f)}}catch(t){l.e(t)}finally{l.f()}if(u.size>0){r(),t.AppendLine("-- named: --");var v,p=g(u);try{for(p.s();!(v=p.n()).done;){var y=d(v.value,2)[1];S.AssertType(y,i,"Can only print out named Containers"),y.BuildStringOfHierarchy(t,e,n),t.AppendLine()}}catch(t){p.e(t)}finally{p.f()}}e--,r(),t.Append("]")}}]),i}(N);!function(t){var e;(e=t.CountFlags||(t.CountFlags={}))[e.Visits=1]="Visits",e[e.Turns=2]="Turns",e[e.CountStartOnly=4]="CountStartOnly"}(K||(K={}));var z,H=function(t){a(i,t);var e=v(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"toString",value:function(){return"Glue"}}]),i}(N),X=function(t){a(i,t);var e=v(i);function i(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.CommandType.NotSet;return n(this,i),(t=e.call(this))._commandType=r,t}return r(i,[{key:"commandType",get:function(){return this._commandType}},{key:"Copy",value:function(){return new i(this.commandType)}},{key:"toString",value:function(){return this.commandType.toString()}}],[{key:"EvalStart",value:function(){return new i(i.CommandType.EvalStart)}},{key:"EvalOutput",value:function(){return new i(i.CommandType.EvalOutput)}},{key:"EvalEnd",value:function(){return new i(i.CommandType.EvalEnd)}},{key:"Duplicate",value:function(){return new i(i.CommandType.Duplicate)}},{key:"PopEvaluatedValue",value:function(){return new i(i.CommandType.PopEvaluatedValue)}},{key:"PopFunction",value:function(){return new i(i.CommandType.PopFunction)}},{key:"PopTunnel",value:function(){return new i(i.CommandType.PopTunnel)}},{key:"BeginString",value:function(){return new i(i.CommandType.BeginString)}},{key:"EndString",value:function(){return new i(i.CommandType.EndString)}},{key:"NoOp",value:function(){return new i(i.CommandType.NoOp)}},{key:"ChoiceCount",value:function(){return new i(i.CommandType.ChoiceCount)}},{key:"Turns",value:function(){return new i(i.CommandType.Turns)}},{key:"TurnsSince",value:function(){return new i(i.CommandType.TurnsSince)}},{key:"ReadCount",value:function(){return new i(i.CommandType.ReadCount)}},{key:"Random",value:function(){return new i(i.CommandType.Random)}},{key:"SeedRandom",value:function(){return new i(i.CommandType.SeedRandom)}},{key:"VisitIndex",value:function(){return new i(i.CommandType.VisitIndex)}},{key:"SequenceShuffleIndex",value:function(){return new i(i.CommandType.SequenceShuffleIndex)}},{key:"StartThread",value:function(){return new i(i.CommandType.StartThread)}},{key:"Done",value:function(){return new i(i.CommandType.Done)}},{key:"End",value:function(){return new i(i.CommandType.End)}},{key:"ListFromInt",value:function(){return new i(i.CommandType.ListFromInt)}},{key:"ListRange",value:function(){return new i(i.CommandType.ListRange)}},{key:"ListRandom",value:function(){return new i(i.CommandType.ListRandom)}},{key:"BeginTag",value:function(){return new i(i.CommandType.BeginTag)}},{key:"EndTag",value:function(){return new i(i.CommandType.EndTag)}}]),i}(N);!function(t){var e;(e=t.CommandType||(t.CommandType={}))[e.NotSet=-1]="NotSet",e[e.EvalStart=0]="EvalStart",e[e.EvalOutput=1]="EvalOutput",e[e.EvalEnd=2]="EvalEnd",e[e.Duplicate=3]="Duplicate",e[e.PopEvaluatedValue=4]="PopEvaluatedValue",e[e.PopFunction=5]="PopFunction",e[e.PopTunnel=6]="PopTunnel",e[e.BeginString=7]="BeginString",e[e.EndString=8]="EndString",e[e.NoOp=9]="NoOp",e[e.ChoiceCount=10]="ChoiceCount",e[e.Turns=11]="Turns",e[e.TurnsSince=12]="TurnsSince",e[e.ReadCount=13]="ReadCount",e[e.Random=14]="Random",e[e.SeedRandom=15]="SeedRandom",e[e.VisitIndex=16]="VisitIndex",e[e.SequenceShuffleIndex=17]="SequenceShuffleIndex",e[e.StartThread=18]="StartThread",e[e.Done=19]="Done",e[e.End=20]="End",e[e.ListFromInt=21]="ListFromInt",e[e.ListRange=22]="ListRange",e[e.ListRandom=23]="ListRandom",e[e.BeginTag=24]="BeginTag",e[e.EndTag=25]="EndTag",e[e.TOTAL_VALUES=26]="TOTAL_VALUES"}(X||(X={})),function(t){t[t.Tunnel=0]="Tunnel",t[t.Function=1]="Function",t[t.FunctionEvaluationFromGame=2]="FunctionEvaluationFromGame"}(z||(z={}));var $=function(){function t(){n(this,t),this.container=null,this.index=-1,2===arguments.length&&(this.container=arguments[0],this.index=arguments[1])}return r(t,[{key:"Resolve",value:function(){return this.index<0?this.container:null==this.container?null:0==this.container.content.length?this.container:this.index>=this.container.content.length?null:this.container.content[this.index]}},{key:"isNull",get:function(){return null==this.container}},{key:"path",get:function(){return this.isNull?null:this.index>=0?this.container.path.PathByAppendingComponent(new k.Component(this.index)):this.container.path}},{key:"toString",value:function(){return this.container?"Ink Pointer -> "+this.container.path.toString()+" -- index "+this.index:"Ink Pointer (null)"}},{key:"copy",value:function(){return new t(this.container,this.index)}}],[{key:"StartOf",value:function(e){return new t(e,0)}},{key:"Null",get:function(){return new t(null,-1)}}]),t}(),Y=function(t){a(i,t);var e=v(i);function i(t){var r;return n(this,i),(r=e.call(this))._targetPath=null,r._targetPointer=$.Null,r.variableDivertName=null,r.pushesToStack=!1,r.stackPushType=0,r.isExternal=!1,r.externalArgs=0,r.isConditional=!1,r.pushesToStack=!1,void 0!==t&&(r.pushesToStack=!0,r.stackPushType=t),r}return r(i,[{key:"targetPath",get:function(){if(null!=this._targetPath&&this._targetPath.isRelative){var t=this.targetPointer.Resolve();t&&(this._targetPath=t.path)}return this._targetPath},set:function(t){this._targetPath=t,this._targetPointer=$.Null}},{key:"targetPointer",get:function(){if(this._targetPointer.isNull){var t=this.ResolvePath(this._targetPath).obj;if(null===this._targetPath)return P("this._targetPath");if(null===this._targetPath.lastComponent)return P("this._targetPath.lastComponent");if(this._targetPath.lastComponent.isIndex){if(null===t)return P("targetObj");this._targetPointer.container=t.parent instanceof K?t.parent:null,this._targetPointer.index=this._targetPath.lastComponent.index}else this._targetPointer=$.StartOf(t instanceof K?t:null)}return this._targetPointer.copy()}},{key:"targetPathString",get:function(){return null==this.targetPath?null:this.CompactPathString(this.targetPath)},set:function(t){this.targetPath=null==t?null:new k(t)}},{key:"hasVariableTarget",get:function(){return null!=this.variableDivertName}},{key:"Equals",value:function(t){var e=t;return e instanceof i&&this.hasVariableTarget==e.hasVariableTarget&&(this.hasVariableTarget?this.variableDivertName==e.variableDivertName:null===this.targetPath?P("this.targetPath"):this.targetPath.Equals(e.targetPath))}},{key:"toString",value:function(){if(this.hasVariableTarget)return"Divert(variable: "+this.variableDivertName+")";if(null==this.targetPath)return"Divert(null)";var t=new A,e=this.targetPath.toString();return t.Append("Divert"),this.isConditional&&t.Append("?"),this.pushesToStack&&(this.stackPushType==z.Function?t.Append(" function"):t.Append(" tunnel")),t.Append(" -> "),t.Append(this.targetPathString),t.Append(" ("),t.Append(e),t.Append(")"),t.toString()}}]),i}(N),Q=function(t){a(i,t);var e=v(i);function i(){var t,r=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return n(this,i),(t=e.call(this))._pathOnChoice=null,t.hasCondition=!1,t.hasStartContent=!1,t.hasChoiceOnlyContent=!1,t.isInvisibleDefault=!1,t.onceOnly=!0,t.onceOnly=r,t}return r(i,[{key:"pathOnChoice",get:function(){if(null!=this._pathOnChoice&&this._pathOnChoice.isRelative){var t=this.choiceTarget;t&&(this._pathOnChoice=t.path)}return this._pathOnChoice},set:function(t){this._pathOnChoice=t}},{key:"choiceTarget",get:function(){return null===this._pathOnChoice?P("ChoicePoint._pathOnChoice"):this.ResolvePath(this._pathOnChoice).container}},{key:"pathStringOnChoice",get:function(){return null===this.pathOnChoice?P("ChoicePoint.pathOnChoice"):this.CompactPathString(this.pathOnChoice)},set:function(t){this.pathOnChoice=new k(t)}},{key:"flags",get:function(){var t=0;return this.hasCondition&&(t|=1),this.hasStartContent&&(t|=2),this.hasChoiceOnlyContent&&(t|=4),this.isInvisibleDefault&&(t|=8),this.onceOnly&&(t|=16),t},set:function(t){this.hasCondition=(1&t)>0,this.hasStartContent=(2&t)>0,this.hasChoiceOnlyContent=(4&t)>0,this.isInvisibleDefault=(8&t)>0,this.onceOnly=(16&t)>0}},{key:"toString",value:function(){return null===this.pathOnChoice?P("ChoicePoint.pathOnChoice"):"Choice: -> "+this.pathOnChoice.toString()}}]),i}(N),Z=function(t){a(i,t);var e=v(i);function i(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return n(this,i),(t=e.call(this)).pathForCount=null,t.name=r,t}return r(i,[{key:"containerForCount",get:function(){return null===this.pathForCount?null:this.ResolvePath(this.pathForCount).container}},{key:"pathStringForCount",get:function(){return null===this.pathForCount?null:this.CompactPathString(this.pathForCount)},set:function(t){this.pathForCount=null===t?null:new k(t)}},{key:"toString",value:function(){return null!=this.name?"var("+this.name+")":"read_count("+this.pathStringForCount+")"}}]),i}(N),tt=function(t){a(i,t);var e=v(i);function i(t,r){var a;return n(this,i),(a=e.call(this)).variableName=t||null,a.isNewDeclaration=!!r,a.isGlobal=!1,a}return r(i,[{key:"toString",value:function(){return"VarAssign to "+this.variableName}}]),i}(N),et=function(t){a(i,t);var e=v(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i)}(N),nt=function(t){a(i,t);var e=v(i);function i(){var t;if(n(this,i),(t=e.call(this))._name=null,t._numberOfParameters=0,t._prototype=null,t._isPrototype=!1,t._operationFuncs=null,0===arguments.length)i.GenerateNativeFunctionsIfNecessary();else if(1===arguments.length){var r=arguments[0];i.GenerateNativeFunctionsIfNecessary(),t.name=r}else if(2===arguments.length){var a=arguments[0],s=arguments[1];t._isPrototype=!0,t.name=a,t.numberOfParameters=s}return t}return r(i,[{key:"name",get:function(){return null===this._name?P("NativeFunctionCall._name"):this._name},set:function(t){this._name=t,this._isPrototype||(null===i._nativeFunctions?P("NativeFunctionCall._nativeFunctions"):this._prototype=i._nativeFunctions.get(this._name)||null)}},{key:"numberOfParameters",get:function(){return this._prototype?this._prototype.numberOfParameters:this._numberOfParameters},set:function(t){this._numberOfParameters=t}},{key:"Call",value:function(t){if(this._prototype)return this._prototype.Call(t);if(this.numberOfParameters!=t.length)throw new Error("Unexpected number of parameters");var e,n=!1,i=g(t);try{for(i.s();!(e=i.n()).done;){var r=e.value;if(r instanceof et)throw new x('Attempting to perform operation on a void value. Did you forget to "return" a value from a function you called here?');r instanceof U&&(n=!0)}}catch(t){i.e(t)}finally{i.f()}if(2==t.length&&n)return this.CallBinaryListOperation(t);var a=this.CoerceValuesToSingleType(t),s=a[0].valueType;return s==V.Int||s==V.Float||s==V.String||s==V.DivertTarget||s==V.List?this.CallType(a):null}},{key:"CallType",value:function(t){var e=b(t[0],j),n=e.valueType,r=e,a=t.length;if(2==a||1==a){if(null===this._operationFuncs)return P("NativeFunctionCall._operationFuncs");var s=this._operationFuncs.get(n);if(!s){var o=V[n];throw new x("Cannot perform operation "+this.name+" on "+o)}if(2==a){var u=b(t[1],j),l=s;if(null===r.value||null===u.value)return P("NativeFunctionCall.Call BinaryOp values");var h=l(r.value,u.value);return j.Create(h)}var c=s;if(null===r.value)return P("NativeFunctionCall.Call UnaryOp value");var f=c(r.value);return this.name===i.Int?j.Create(f,V.Int):this.name===i.Float?j.Create(f,V.Float):j.Create(f,e.valueType)}throw new Error("Unexpected number of parameters to NativeFunctionCall: "+t.length)}},{key:"CallBinaryListOperation",value:function(t){if(("+"==this.name||"-"==this.name)&&t[0]instanceof U&&t[1]instanceof D)return this.CallListIncrementOperation(t);var e=b(t[0],j),n=b(t[1],j);if(!("&&"!=this.name&&"||"!=this.name||e.valueType==V.List&&n.valueType==V.List)){if(null===this._operationFuncs)return P("NativeFunctionCall._operationFuncs");var i=this._operationFuncs.get(V.Int);if(null===i)return P("NativeFunctionCall.CallBinaryListOperation op");var r=function(t){if("boolean"==typeof t)return t;throw new Error("".concat(t," is not a boolean"))}(i(e.isTruthy?1:0,n.isTruthy?1:0));return new R(r)}if(e.valueType==V.List&&n.valueType==V.List)return this.CallType([e,n]);throw new x("Can not call use "+this.name+" operation on "+V[e.valueType]+" and "+V[n.valueType])}},{key:"CallListIncrementOperation",value:function(t){var e=b(t[0],U),n=b(t[1],D),i=new F;if(null===e.value)return P("NativeFunctionCall.CallListIncrementOperation listVal.value");var r,a=g(e.value);try{for(a.s();!(r=a.n()).done;){var s=d(r.value,2),o=s[0],u=s[1],l=I.fromSerializedKey(o);if(null===this._operationFuncs)return P("NativeFunctionCall._operationFuncs");var h=this._operationFuncs.get(V.Int);if(null===n.value)return P("NativeFunctionCall.CallListIncrementOperation intVal.value");var c=h(u,n.value),f=null;if(null===e.value.origins)return P("NativeFunctionCall.CallListIncrementOperation listVal.value.origins");var v,p=g(e.value.origins);try{for(p.s();!(v=p.n()).done;){var y=v.value;if(y.name==l.originName){f=y;break}}}catch(t){p.e(t)}finally{p.f()}if(null!=f){var m=f.TryGetItemWithValue(c,I.Null);m.exists&&i.Add(m.result,c)}}}catch(t){a.e(t)}finally{a.f()}return new U(i)}},{key:"CoerceValuesToSingleType",value:function(t){var e,n=V.Int,i=null,r=g(t);try{for(r.s();!(e=r.n()).done;){var a=b(e.value,j);a.valueType>n&&(n=a.valueType),a.valueType==V.List&&(i=C(a,U))}}catch(t){r.e(t)}finally{r.f()}var s=[];if(V[n]==V[V.List]){var o,u=g(t);try{for(u.s();!(o=u.n()).done;){var l=b(o.value,j);if(l.valueType==V.List)s.push(l);else{if(l.valueType!=V.Int){var h=V[l.valueType];throw new x("Cannot mix Lists and "+h+" values in this operation")}var c=parseInt(l.valueObject);if(null===(i=b(i,U)).value)return P("NativeFunctionCall.CoerceValuesToSingleType specialCaseList.value");var f=i.value.originOfMaxItem;if(null===f)return P("NativeFunctionCall.CoerceValuesToSingleType list");var v=f.TryGetItemWithValue(c,I.Null);if(!v.exists)throw new x("Could not find List item with the value "+c+" in "+f.name);var d=new U(v.result,c);s.push(d)}}}catch(t){u.e(t)}finally{u.f()}}else{var p,y=g(t);try{for(y.s();!(p=y.n()).done;){var m=b(p.value,j).Cast(n);s.push(m)}}catch(t){y.e(t)}finally{y.f()}}return s}},{key:"AddOpFuncForType",value:function(t,e){null==this._operationFuncs&&(this._operationFuncs=new Map),this._operationFuncs.set(t,e)}},{key:"toString",value:function(){return'Native "'+this.name+'"'}}],[{key:"CallWithName",value:function(t){return new i(t)}},{key:"CallExistsWithName",value:function(t){return this.GenerateNativeFunctionsIfNecessary(),this._nativeFunctions.get(t)}},{key:"Identity",value:function(t){return t}},{key:"GenerateNativeFunctionsIfNecessary",value:function(){if(null==this._nativeFunctions){this._nativeFunctions=new Map,this.AddIntBinaryOp(this.Add,(function(t,e){return t+e})),this.AddIntBinaryOp(this.Subtract,(function(t,e){return t-e})),this.AddIntBinaryOp(this.Multiply,(function(t,e){return t*e})),this.AddIntBinaryOp(this.Divide,(function(t,e){return Math.floor(t/e)})),this.AddIntBinaryOp(this.Mod,(function(t,e){return t%e})),this.AddIntUnaryOp(this.Negate,(function(t){return-t})),this.AddIntBinaryOp(this.Equal,(function(t,e){return t==e})),this.AddIntBinaryOp(this.Greater,(function(t,e){return t>e})),this.AddIntBinaryOp(this.Less,(function(t,e){return t=e})),this.AddIntBinaryOp(this.LessThanOrEquals,(function(t,e){return t<=e})),this.AddIntBinaryOp(this.NotEquals,(function(t,e){return t!=e})),this.AddIntUnaryOp(this.Not,(function(t){return 0==t})),this.AddIntBinaryOp(this.And,(function(t,e){return 0!=t&&0!=e})),this.AddIntBinaryOp(this.Or,(function(t,e){return 0!=t||0!=e})),this.AddIntBinaryOp(this.Max,(function(t,e){return Math.max(t,e)})),this.AddIntBinaryOp(this.Min,(function(t,e){return Math.min(t,e)})),this.AddIntBinaryOp(this.Pow,(function(t,e){return Math.pow(t,e)})),this.AddIntUnaryOp(this.Floor,i.Identity),this.AddIntUnaryOp(this.Ceiling,i.Identity),this.AddIntUnaryOp(this.Int,i.Identity),this.AddIntUnaryOp(this.Float,(function(t){return t})),this.AddFloatBinaryOp(this.Add,(function(t,e){return t+e})),this.AddFloatBinaryOp(this.Subtract,(function(t,e){return t-e})),this.AddFloatBinaryOp(this.Multiply,(function(t,e){return t*e})),this.AddFloatBinaryOp(this.Divide,(function(t,e){return t/e})),this.AddFloatBinaryOp(this.Mod,(function(t,e){return t%e})),this.AddFloatUnaryOp(this.Negate,(function(t){return-t})),this.AddFloatBinaryOp(this.Equal,(function(t,e){return t==e})),this.AddFloatBinaryOp(this.Greater,(function(t,e){return t>e})),this.AddFloatBinaryOp(this.Less,(function(t,e){return t=e})),this.AddFloatBinaryOp(this.LessThanOrEquals,(function(t,e){return t<=e})),this.AddFloatBinaryOp(this.NotEquals,(function(t,e){return t!=e})),this.AddFloatUnaryOp(this.Not,(function(t){return 0==t})),this.AddFloatBinaryOp(this.And,(function(t,e){return 0!=t&&0!=e})),this.AddFloatBinaryOp(this.Or,(function(t,e){return 0!=t||0!=e})),this.AddFloatBinaryOp(this.Max,(function(t,e){return Math.max(t,e)})),this.AddFloatBinaryOp(this.Min,(function(t,e){return Math.min(t,e)})),this.AddFloatBinaryOp(this.Pow,(function(t,e){return Math.pow(t,e)})),this.AddFloatUnaryOp(this.Floor,(function(t){return Math.floor(t)})),this.AddFloatUnaryOp(this.Ceiling,(function(t){return Math.ceil(t)})),this.AddFloatUnaryOp(this.Int,(function(t){return Math.floor(t)})),this.AddFloatUnaryOp(this.Float,i.Identity),this.AddStringBinaryOp(this.Add,(function(t,e){return t+e})),this.AddStringBinaryOp(this.Equal,(function(t,e){return t===e})),this.AddStringBinaryOp(this.NotEquals,(function(t,e){return!(t===e)})),this.AddStringBinaryOp(this.Has,(function(t,e){return t.includes(e)})),this.AddStringBinaryOp(this.Hasnt,(function(t,e){return!t.includes(e)})),this.AddListBinaryOp(this.Add,(function(t,e){return t.Union(e)})),this.AddListBinaryOp(this.Subtract,(function(t,e){return t.Without(e)})),this.AddListBinaryOp(this.Has,(function(t,e){return t.Contains(e)})),this.AddListBinaryOp(this.Hasnt,(function(t,e){return!t.Contains(e)})),this.AddListBinaryOp(this.Intersect,(function(t,e){return t.Intersect(e)})),this.AddListBinaryOp(this.Equal,(function(t,e){return t.Equals(e)})),this.AddListBinaryOp(this.Greater,(function(t,e){return t.GreaterThan(e)})),this.AddListBinaryOp(this.Less,(function(t,e){return t.LessThan(e)})),this.AddListBinaryOp(this.GreaterThanOrEquals,(function(t,e){return t.GreaterThanOrEquals(e)})),this.AddListBinaryOp(this.LessThanOrEquals,(function(t,e){return t.LessThanOrEquals(e)})),this.AddListBinaryOp(this.NotEquals,(function(t,e){return!t.Equals(e)})),this.AddListBinaryOp(this.And,(function(t,e){return t.Count>0&&e.Count>0})),this.AddListBinaryOp(this.Or,(function(t,e){return t.Count>0||e.Count>0})),this.AddListUnaryOp(this.Not,(function(t){return 0==t.Count?1:0})),this.AddListUnaryOp(this.Invert,(function(t){return t.inverse})),this.AddListUnaryOp(this.All,(function(t){return t.all})),this.AddListUnaryOp(this.ListMin,(function(t){return t.MinAsList()})),this.AddListUnaryOp(this.ListMax,(function(t){return t.MaxAsList()})),this.AddListUnaryOp(this.Count,(function(t){return t.Count})),this.AddListUnaryOp(this.ValueOfList,(function(t){return t.maxItem.Value}));this.AddOpToNativeFunc(this.Equal,2,V.DivertTarget,(function(t,e){return t.Equals(e)})),this.AddOpToNativeFunc(this.NotEquals,2,V.DivertTarget,(function(t,e){return!t.Equals(e)}))}}},{key:"AddOpToNativeFunc",value:function(t,e,n,r){if(null===this._nativeFunctions)return P("NativeFunctionCall._nativeFunctions");var a=this._nativeFunctions.get(t);a||(a=new i(t,e),this._nativeFunctions.set(t,a)),a.AddOpFuncForType(n,r)}},{key:"AddIntBinaryOp",value:function(t,e){this.AddOpToNativeFunc(t,2,V.Int,e)}},{key:"AddIntUnaryOp",value:function(t,e){this.AddOpToNativeFunc(t,1,V.Int,e)}},{key:"AddFloatBinaryOp",value:function(t,e){this.AddOpToNativeFunc(t,2,V.Float,e)}},{key:"AddFloatUnaryOp",value:function(t,e){this.AddOpToNativeFunc(t,1,V.Float,e)}},{key:"AddStringBinaryOp",value:function(t,e){this.AddOpToNativeFunc(t,2,V.String,e)}},{key:"AddListBinaryOp",value:function(t,e){this.AddOpToNativeFunc(t,2,V.List,e)}},{key:"AddListUnaryOp",value:function(t,e){this.AddOpToNativeFunc(t,1,V.List,e)}}]),i}(N);nt.Add="+",nt.Subtract="-",nt.Divide="/",nt.Multiply="*",nt.Mod="%",nt.Negate="_",nt.Equal="==",nt.Greater=">",nt.Less="<",nt.GreaterThanOrEquals=">=",nt.LessThanOrEquals="<=",nt.NotEquals="!=",nt.Not="!",nt.And="&&",nt.Or="||",nt.Min="MIN",nt.Max="MAX",nt.Pow="POW",nt.Floor="FLOOR",nt.Ceiling="CEILING",nt.Int="INT",nt.Float="FLOAT",nt.Has="?",nt.Hasnt="!?",nt.Intersect="^",nt.ListMin="LIST_MIN",nt.ListMax="LIST_MAX",nt.All="LIST_ALL",nt.Count="LIST_COUNT",nt.ValueOfList="LIST_VALUE",nt.Invert="LIST_INVERT",nt._nativeFunctions=null;var it=function(t){a(i,t);var e=v(i);function i(t){var r;return n(this,i),(r=e.call(this)).text=t.toString()||"",r}return r(i,[{key:"toString",value:function(){return"# "+this.text}}]),i}(N),rt=function(t){a(i,t);var e=v(i);function i(){var t;return n(this,i),(t=e.apply(this,arguments)).text="",t.index=0,t.threadAtGeneration=null,t.sourcePath="",t.targetPath=null,t.isInvisibleDefault=!1,t.tags=null,t.originalThreadIndex=0,t}return r(i,[{key:"pathStringOnChoice",get:function(){return null===this.targetPath?P("Choice.targetPath"):this.targetPath.toString()},set:function(t){this.targetPath=new k(t)}}]),i}(N),at=function(){function t(e,i){n(this,t),this._name=e||"",this._items=null,this._itemNameToValues=i||new Map}return r(t,[{key:"name",get:function(){return this._name}},{key:"items",get:function(){if(null==this._items){this._items=new Map;var t,e=g(this._itemNameToValues);try{for(e.s();!(t=e.n()).done;){var n=d(t.value,2),i=n[0],r=n[1],a=new I(this.name,i);this._items.set(a.serialized(),r)}}catch(t){e.e(t)}finally{e.f()}}return this._items}},{key:"ValueForItem",value:function(t){if(!t.itemName)return 0;var e=this._itemNameToValues.get(t.itemName);return void 0!==e?e:0}},{key:"ContainsItem",value:function(t){return!!t.itemName&&(t.originName==this.name&&this._itemNameToValues.has(t.itemName))}},{key:"ContainsItemWithName",value:function(t){return this._itemNameToValues.has(t)}},{key:"TryGetItemWithValue",value:function(t,e){var n,i=g(this._itemNameToValues);try{for(i.s();!(n=i.n()).done;){var r=d(n.value,2),a=r[0];if(r[1]==t)return{result:new I(this.name,a),exists:!0}}}catch(t){i.e(t)}finally{i.f()}return{result:I.Null,exists:!1}}},{key:"TryGetValueForItem",value:function(t,e){if(!t.itemName)return{result:0,exists:!1};var n=this._itemNameToValues.get(t.itemName);return n?{result:n,exists:!0}:{result:0,exists:!1}}}]),t}(),st=function(){function t(e){n(this,t),this._lists=new Map,this._allUnambiguousListValueCache=new Map;var i,r=g(e);try{for(r.s();!(i=r.n()).done;){var a=i.value;this._lists.set(a.name,a);var s,o=g(a.items);try{for(o.s();!(s=o.n()).done;){var u=d(s.value,2),l=u[0],h=u[1],c=I.fromSerializedKey(l),f=new U(c,h);if(!c.itemName)throw new Error("item.itemName is null or undefined.");this._allUnambiguousListValueCache.set(c.itemName,f),this._allUnambiguousListValueCache.set(c.fullName,f)}}catch(t){o.e(t)}finally{o.f()}}}catch(t){r.e(t)}finally{r.f()}}return r(t,[{key:"lists",get:function(){var t,e=[],n=g(this._lists);try{for(n.s();!(t=n.n()).done;){var i=d(t.value,2)[1];e.push(i)}}catch(t){n.e(t)}finally{n.f()}return e}},{key:"TryListGetDefinition",value:function(t,e){if(null===t)return{result:e,exists:!1};var n=this._lists.get(t);return n?{result:n,exists:!0}:{result:e,exists:!1}}},{key:"FindSingleItemListWithName",value:function(t){if(null===t)return P("name");var e=this._allUnambiguousListValueCache.get(t);return void 0!==e?e:null}}]),t}(),ot=function(){function t(){n(this,t)}return r(t,null,[{key:"JArrayToRuntimeObjList",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.length;e&&n--;for(var i=[],r=0;rt->")),a=r.hasVariableTarget?r.variableDivertName:r.targetPathString,e.WriteObjectStart(),e.WriteProperty(s,a),r.hasVariableTarget&&e.WriteProperty("var",!0),r.isConditional&&e.WriteProperty("c",!0),r.externalArgs>0&&e.WriteIntProperty("exArgs",r.externalArgs),void e.WriteObjectEnd()}var o=C(n,Q);if(o)return e.WriteObjectStart(),e.WriteProperty("*",o.pathStringOnChoice),e.WriteIntProperty("flg",o.flags),void e.WriteObjectEnd();var u=C(n,R);if(u)e.WriteBool(u.value);else{var l=C(n,D);if(l)e.WriteInt(l.value);else{var h=C(n,B);if(h)e.WriteFloat(h.value);else{var c=C(n,G);if(c)c.isNewline?e.Write("\n",!1):(e.WriteStringStart(),e.WriteStringInner("^"),e.WriteStringInner(c.value),e.WriteStringEnd());else{var f=C(n,U);if(f)this.WriteInkList(e,f);else{var v=C(n,M);if(v)return e.WriteObjectStart(),null===v.value?P("divTargetVal.value"):(e.WriteProperty("^->",v.value.componentsString),void e.WriteObjectEnd());var d=C(n,J);if(d)return e.WriteObjectStart(),e.WriteProperty("^var",d.value),e.WriteIntProperty("ci",d.contextIndex),void e.WriteObjectEnd();if(C(n,H))e.Write("<>");else{var p=C(n,X);if(p)e.Write(t._controlCommandNames[p.commandType]);else{var y=C(n,nt);if(y){var m=y.name;return"^"==m&&(m="L^"),void e.Write(m)}var g=C(n,Z);if(g){e.WriteObjectStart();var S=g.pathStringForCount;return null!=S?e.WriteProperty("CNT?",S):e.WriteProperty("VAR?",g.name),void e.WriteObjectEnd()}var k=C(n,tt);if(k){e.WriteObjectStart();var b=k.isGlobal?"VAR=":"temp=";return e.WriteProperty(b,k.variableName),k.isNewDeclaration||e.WriteProperty("re",!0),void e.WriteObjectEnd()}if(C(n,et))e.Write("void");else{var w=C(n,it);if(w)return e.WriteObjectStart(),e.WriteProperty("#",w.text),void e.WriteObjectEnd();var _=C(n,rt);if(!_)throw new Error("Failed to convert runtime object to Json token: "+n);this.WriteChoice(e,_)}}}}}}}}}}},{key:"JObjectToDictionaryRuntimeObjs",value:function(t){var e=new Map;for(var n in t)if(t.hasOwnProperty(n)){var i=this.JTokenToRuntimeObject(t[n]);if(null===i)return P("inkObject");e.set(n,i)}return e}},{key:"JObjectToIntDictionary",value:function(t){var e=new Map;for(var n in t)t.hasOwnProperty(n)&&e.set(n,parseInt(t[n]));return e}},{key:"JTokenToRuntimeObject",value:function(n){if("number"==typeof n&&!isNaN(n)||"boolean"==typeof n)return j.Create(n);if("string"==typeof n){var i=n.toString(),r=i[0];if("^"==r)return new G(i.substring(1));if("\n"==r&&1==i.length)return new G("\n");if("<>"==i)return new H;for(var a=0;a->"==i)return X.PopTunnel();if("~ret"==i)return X.PopFunction();if("void"==i)return new et}if("object"===e(n)&&!Array.isArray(n)){var s,o=n;if(o["^->"])return s=o["^->"],new M(new k(s.toString()));if(o["^var"]){s=o["^var"];var u=new J(s.toString());return"ci"in o&&(s=o.ci,u.contextIndex=parseInt(s)),u}var l=!1,h=!1,c=z.Function,f=!1;if((s=o["->"])?l=!0:(s=o["f()"])?(l=!0,h=!0,c=z.Function):(s=o["->t->"])?(l=!0,h=!0,c=z.Tunnel):(s=o["x()"])&&(l=!0,f=!0,h=!1,c=z.Function),l){var v=new Y;v.pushesToStack=h,v.stackPushType=c,v.isExternal=f;var d=s.toString();return(s=o.var)?v.variableDivertName=d:v.targetPathString=d,v.isConditional=!!o.c,f&&(s=o.exArgs)&&(v.externalArgs=parseInt(s)),v}if(s=o["*"]){var p=new Q;return p.pathStringOnChoice=s.toString(),(s=o.flg)&&(p.flags=parseInt(s)),p}if(s=o["VAR?"])return new Z(s.toString());if(s=o["CNT?"]){var y=new Z;return y.pathStringForCount=s.toString(),y}var m=!1,g=!1;if((s=o["VAR="])?(m=!0,g=!0):(s=o["temp="])&&(m=!0,g=!1),m){var S=s.toString(),C=!o.re,b=new tt(S,C);return b.isGlobal=g,b}if(void 0!==o["#"])return s=o["#"],new it(s.toString());if(s=o.list){var w=s,_=new F;if(s=o.origins){var T=s;_.SetInitialOriginNames(T)}for(var E in w)if(w.hasOwnProperty(E)){var O=w[E],P=new I(E),N=parseInt(O);_.Add(P,N)}return new U(_)}if(null!=o.originalChoicePath)return this.JObjectToChoice(o)}if(Array.isArray(n))return this.JArrayToContainer(n);if(null==n)return null;throw new Error("Failed to convert token to runtime object: "+this.toJson(n,["parent"]))}},{key:"toJson",value:function(t,e,n){return JSON.stringify(t,(function(t,n){return(null==e?void 0:e.some((function(e){return e===t})))?void 0:n}),n)}},{key:"WriteRuntimeContainer",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t.WriteArrayStart(),null===e)return P("container");var i,r=g(e.content);try{for(r.s();!(i=r.n()).done;){var a=i.value;this.WriteRuntimeObject(t,a)}}catch(t){r.e(t)}finally{r.f()}var s=e.namedOnlyContent,o=e.countFlags,u=null!=e.name&&!n,l=null!=s||o>0||u;if(l&&t.WriteObjectStart(),null!=s){var h,c=g(s);try{for(c.s();!(h=c.n()).done;){var f=d(h.value,2),v=f[0],p=f[1],y=v,m=C(p,K);t.WritePropertyStart(y),this.WriteRuntimeContainer(t,m,!0),t.WritePropertyEnd()}}catch(t){c.e(t)}finally{c.f()}}o>0&&t.WriteIntProperty("#f",o),u&&t.WriteProperty("#n",e.name),l?t.WriteObjectEnd():t.WriteNull(),t.WriteArrayEnd()}},{key:"JArrayToContainer",value:function(t){var e=new K;e.content=this.JArrayToRuntimeObjList(t,!0);var n=t[t.length-1];if(null!=n){var i=new Map;for(var r in n)if("#f"==r)e.countFlags=parseInt(n[r]);else if("#n"==r)e.name=n[r].toString();else{var a=this.JTokenToRuntimeObject(n[r]),s=C(a,K);s&&(s.name=r),i.set(r,a)}e.namedOnlyContent=i}return e}},{key:"JObjectToChoice",value:function(t){var e=new rt;return e.text=t.text.toString(),e.index=parseInt(t.index),e.sourcePath=t.originalChoicePath.toString(),e.originalThreadIndex=parseInt(t.originalThreadIndex),e.pathStringOnChoice=t.targetPath.toString(),e}},{key:"WriteChoice",value:function(t,e){t.WriteObjectStart(),t.WriteProperty("text",e.text),t.WriteIntProperty("index",e.index),t.WriteProperty("originalChoicePath",e.sourcePath),t.WriteIntProperty("originalThreadIndex",e.originalThreadIndex),t.WriteProperty("targetPath",e.pathStringOnChoice),t.WriteObjectEnd()}},{key:"WriteInkList",value:function(t,e){var n=e.value;if(null===n)return P("rawList");t.WriteObjectStart(),t.WritePropertyStart("list"),t.WriteObjectStart();var i,r=g(n);try{for(r.s();!(i=r.n()).done;){var a=d(i.value,2),s=a[0],o=a[1],u=I.fromSerializedKey(s),l=o;if(null===u.itemName)return P("item.itemName");t.WritePropertyNameStart(),t.WritePropertyNameInner(u.originName?u.originName:"?"),t.WritePropertyNameInner("."),t.WritePropertyNameInner(u.itemName),t.WritePropertyNameEnd(),t.Write(l),t.WritePropertyEnd()}}catch(t){r.e(t)}finally{r.f()}if(t.WriteObjectEnd(),t.WritePropertyEnd(),0==n.Count&&null!=n.originNames&&n.originNames.length>0){t.WritePropertyStart("origins"),t.WriteArrayStart();var h,c=g(n.originNames);try{for(c.s();!(h=c.n()).done;){var f=h.value;t.Write(f)}}catch(t){c.e(t)}finally{c.f()}t.WriteArrayEnd(),t.WritePropertyEnd()}t.WriteObjectEnd()}},{key:"ListDefinitionsToJToken",value:function(t){var e,n={},i=g(t.lists);try{for(i.s();!(e=i.n()).done;){var r,a=e.value,s={},o=g(a.items);try{for(o.s();!(r=o.n()).done;){var u=d(r.value,2),l=u[0],h=u[1],c=I.fromSerializedKey(l);if(null===c.itemName)return P("item.itemName");s[c.itemName]=h}}catch(t){o.e(t)}finally{o.f()}n[a.name]=s}}catch(t){i.e(t)}finally{i.f()}return n}},{key:"JTokenToListDefinitions",value:function(t){var e=t,n=[];for(var i in e)if(e.hasOwnProperty(i)){var r=i.toString(),a=e[i],s=new Map;for(var o in a)if(e.hasOwnProperty(i)){var u=a[o];s.set(o,parseInt(u))}var l=new at(r,s);n.push(l)}return new st(n)}}]),t}();ot._controlCommandNames=function(){var t=[];t[X.CommandType.EvalStart]="ev",t[X.CommandType.EvalOutput]="out",t[X.CommandType.EvalEnd]="/ev",t[X.CommandType.Duplicate]="du",t[X.CommandType.PopEvaluatedValue]="pop",t[X.CommandType.PopFunction]="~ret",t[X.CommandType.PopTunnel]="->->",t[X.CommandType.BeginString]="str",t[X.CommandType.EndString]="/str",t[X.CommandType.NoOp]="nop",t[X.CommandType.ChoiceCount]="choiceCnt",t[X.CommandType.Turns]="turn",t[X.CommandType.TurnsSince]="turns",t[X.CommandType.ReadCount]="readc",t[X.CommandType.Random]="rnd",t[X.CommandType.SeedRandom]="srnd",t[X.CommandType.VisitIndex]="visit",t[X.CommandType.SequenceShuffleIndex]="seq",t[X.CommandType.StartThread]="thread",t[X.CommandType.Done]="done",t[X.CommandType.End]="end",t[X.CommandType.ListFromInt]="listInt",t[X.CommandType.ListRange]="range",t[X.CommandType.ListRandom]="lrnd",t[X.CommandType.BeginTag]="#",t[X.CommandType.EndTag]="/#";for(var e=0;e1}},{key:"Reset",value:function(){this._threads=[],this._threads.push(new e.Thread),this._threads[0].callstack.push(new e.Element(z.Tunnel,this._startOfRoot))}},{key:"SetJsonToken",value:function(t,n){this._threads.length=0;var i,r=g(t.threads);try{for(r.s();!(i=r.n()).done;){var a=i.value,s=new e.Thread(a,n);this._threads.push(s)}}catch(t){r.e(t)}finally{r.f()}this._threadCounter=parseInt(t.threadCounter),this._startOfRoot=$.StartOf(n.rootContentContainer)}},{key:"WriteJson",value:function(t){var e=this;t.WriteObject((function(t){t.WritePropertyStart("threads"),t.WriteArrayStart();var n,i=g(e._threads);try{for(i.s();!(n=i.n()).done;){n.value.WriteJson(t)}}catch(t){i.e(t)}finally{i.f()}t.WriteArrayEnd(),t.WritePropertyEnd(),t.WritePropertyStart("threadCounter"),t.WriteInt(e._threadCounter),t.WritePropertyEnd()}))}},{key:"PushThread",value:function(){var t=this.currentThread.Copy();this._threadCounter++,t.threadIndex=this._threadCounter,this._threads.push(t)}},{key:"ForkThread",value:function(){var t=this.currentThread.Copy();return this._threadCounter++,t.threadIndex=this._threadCounter,t}},{key:"PopThread",value:function(){if(!this.canPopThread)throw new Error("Can't pop thread");this._threads.splice(this._threads.indexOf(this.currentThread),1)}},{key:"canPopThread",get:function(){return this._threads.length>1&&!this.elementIsEvaluateFromGame}},{key:"elementIsEvaluateFromGame",get:function(){return this.currentElement.type==z.FunctionEvaluationFromGame}},{key:"Push",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=new e.Element(t,this.currentElement.currentPointer,!1);r.evaluationStackHeightWhenPushed=n,r.functionStartInOutputStream=i,this.callStack.push(r)}},{key:"CanPop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!!this.canPop&&(null==t||this.currentElement.type==t)}},{key:"Pop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!this.CanPop(t))throw new Error("Mismatched push/pop in Callstack");this.callStack.pop()}},{key:"GetTemporaryVariableWithName",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;-1==e&&(e=this.currentElementIndex+1);var n=W(this.callStack[e-1].temporaryVariables,t,null);return n.exists?n.result:null}},{key:"SetTemporaryVariable",value:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1;-1==i&&(i=this.currentElementIndex+1);var r=this.callStack[i-1];if(!n&&!r.temporaryVariables.get(t))throw new Error("Could not find temporary variable to set: "+t);var a=W(r.temporaryVariables,t,null);a.exists&&U.RetainListOriginsForAssignment(a.result,e),r.temporaryVariables.set(t,e)}},{key:"ContextForVariableNamed",value:function(t){return this.currentElement.temporaryVariables.get(t)?this.currentElementIndex+1:0}},{key:"ThreadWithIndex",value:function(t){var e=this._threads.filter((function(e){if(e.threadIndex==t)return e}));return e.length>0?e[0]:null}},{key:"callStack",get:function(){return this.currentThread.callstack}},{key:"callStackTrace",get:function(){for(var t=new A,e=0;e")}}}return t.toString()}}]),e}();!function(t){var e=function(){function t(e,i){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n(this,t),this.evaluationStackHeightWhenPushed=0,this.functionStartInOutputStream=0,this.currentPointer=i.copy(),this.inExpressionEvaluation=r,this.temporaryVariables=new Map,this.type=e}return r(t,[{key:"Copy",value:function(){var e=new t(this.type,this.currentPointer,this.inExpressionEvaluation);return e.temporaryVariables=new Map(this.temporaryVariables),e.evaluationStackHeightWhenPushed=this.evaluationStackHeightWhenPushed,e.functionStartInOutputStream=this.functionStartInOutputStream,e}}]),t}();t.Element=e;var i=function(){function t(){if(n(this,t),this.threadIndex=0,this.previousPointer=$.Null,this.callstack=[],arguments[0]&&arguments[1]){var i=arguments[0],r=arguments[1];this.threadIndex=parseInt(i.threadIndex);var a,s=g(i.callstack);try{for(s.s();!(a=s.n()).done;){var o=a.value,u=parseInt(o.type),l=$.Null,h=void 0,c=o.cPath;if(void 0!==c){h=c.toString();var f=r.ContentAtPath(new k(h));if(l.container=f.container,l.index=parseInt(o.idx),null==f.obj)throw new Error("When loading state, internal story location couldn't be found: "+h+". Has the story changed since this save data was created?");if(f.approximate){if(null===l.container)return P("pointer.container");r.Warning("When loading state, exact internal story location couldn't be found: '"+h+"', so it was approximated to '"+l.container.path.toString()+"' to recover. Has the story changed since this save data was created?")}}var v=!!o.exp,d=new e(u,l,v),p=o.temp;void 0!==p?d.temporaryVariables=ot.JObjectToDictionaryRuntimeObjs(p):d.temporaryVariables.clear(),this.callstack.push(d)}}catch(t){s.e(t)}finally{s.f()}var y=i.previousContentObject;if(void 0!==y){var m=new k(y.toString());this.previousPointer=r.PointerAtPath(m)}}}return r(t,[{key:"Copy",value:function(){var e=new t;e.threadIndex=this.threadIndex;var n,i=g(this.callstack);try{for(i.s();!(n=i.n()).done;){var r=n.value;e.callstack.push(r.Copy())}}catch(t){i.e(t)}finally{i.f()}return e.previousPointer=this.previousPointer.copy(),e}},{key:"WriteJson",value:function(t){t.WriteObjectStart(),t.WritePropertyStart("callstack"),t.WriteArrayStart();var e,n=g(this.callstack);try{for(n.s();!(e=n.n()).done;){var i=e.value;if(t.WriteObjectStart(),!i.currentPointer.isNull){if(null===i.currentPointer.container)return P("el.currentPointer.container");t.WriteProperty("cPath",i.currentPointer.container.path.componentsString),t.WriteIntProperty("idx",i.currentPointer.index)}t.WriteProperty("exp",i.inExpressionEvaluation),t.WriteIntProperty("type",i.type),i.temporaryVariables.size>0&&(t.WritePropertyStart("temp"),ot.WriteDictionaryRuntimeObjs(t,i.temporaryVariables),t.WritePropertyEnd()),t.WriteObjectEnd()}}catch(t){n.e(t)}finally{n.f()}if(t.WriteArrayEnd(),t.WritePropertyEnd(),t.WriteIntProperty("threadIndex",this.threadIndex),!this.previousPointer.isNull){var r=this.previousPointer.Resolve();if(null===r)return P("this.previousPointer.Resolve()");t.WriteProperty("previousContentObject",r.path.toString())}t.WriteObjectEnd()}}]),t}();t.Thread=i}(ut||(ut={}));var lt=function(t){a(i,t);var e=v(i);function i(t,r){var a;n(this,i),(a=e.call(this)).variableChangedEventCallbacks=[],a.patch=null,a._batchObservingVariableChanges=!1,a._defaultGlobalVariables=new Map,a._changedVariablesForBatchObs=new Set,a._globalVariables=new Map,a._callStack=t,a._listDefsOrigin=r;try{return f(a,new Proxy(c(a),{get:function(t,e){return e in t?t[e]:t.$(e)},set:function(t,e,n){return e in t?t[e]=n:t.$(e,n),!0}}))}catch(t){}return a}return r(i,[{key:"variableChangedEvent",value:function(t,e){var n,i=g(this.variableChangedEventCallbacks);try{for(i.s();!(n=i.n()).done;){(0,n.value)(t,e)}}catch(t){i.e(t)}finally{i.f()}}},{key:"batchObservingVariableChanges",get:function(){return this._batchObservingVariableChanges},set:function(t){if(this._batchObservingVariableChanges=t,t)this._changedVariablesForBatchObs=new Set;else if(null!=this._changedVariablesForBatchObs){var e,n=g(this._changedVariablesForBatchObs);try{for(n.s();!(e=n.n()).done;){var i=e.value,r=this._globalVariables.get(i);r?this.variableChangedEvent(i,r):P("currentValue")}}catch(t){n.e(t)}finally{n.f()}this._changedVariablesForBatchObs=null}}},{key:"callStack",get:function(){return this._callStack},set:function(t){this._callStack=t}},{key:"$",value:function(t,e){if(void 0===e){var n=null;return null!==this.patch&&(n=this.patch.TryGetGlobal(t,null)).exists?n.result.valueObject:(void 0===(n=this._globalVariables.get(t))&&(n=this._defaultGlobalVariables.get(t)),void 0!==n?n.valueObject:null)}if(void 0===this._defaultGlobalVariables.get(t))throw new x("Cannot assign to a variable ("+t+") that hasn't been declared in the story");var i=j.Create(e);if(null==i)throw null==e?new Error("Cannot pass null to VariableState"):new Error("Invalid value passed to VariableState: "+e.toString());this.SetGlobal(t,i)}},{key:"ApplyPatch",value:function(){if(null===this.patch)return P("this.patch");var t,e=g(this.patch.globals);try{for(e.s();!(t=e.n()).done;){var n=d(t.value,2),i=n[0],r=n[1];this._globalVariables.set(i,r)}}catch(t){e.e(t)}finally{e.f()}if(null!==this._changedVariablesForBatchObs){var a,s=g(this.patch.changedVariables);try{for(s.s();!(a=s.n()).done;){var o=a.value;this._changedVariablesForBatchObs.add(o)}}catch(t){s.e(t)}finally{s.f()}}this.patch=null}},{key:"SetJsonToken",value:function(t){this._globalVariables.clear();var e,n=g(this._defaultGlobalVariables);try{for(n.s();!(e=n.n()).done;){var i=d(e.value,2),r=i[0],a=i[1],s=t[r];if(void 0!==s){var o=ot.JTokenToRuntimeObject(s);if(null===o)return P("tokenInkObject");this._globalVariables.set(r,o)}else this._globalVariables.set(r,a)}}catch(t){n.e(t)}finally{n.f()}}},{key:"WriteJson",value:function(t){t.WriteObjectStart();var e,n=g(this._globalVariables);try{for(n.s();!(e=n.n()).done;){var r=d(e.value,2),a=r[0],s=r[1],o=a,u=s;if(i.dontSaveDefaultValues&&this._defaultGlobalVariables.has(o)){var l=this._defaultGlobalVariables.get(o);if(this.RuntimeObjectsEqual(u,l))continue}t.WritePropertyStart(o),ot.WriteRuntimeObject(t,u),t.WritePropertyEnd()}}catch(t){n.e(t)}finally{n.f()}t.WriteObjectEnd()}},{key:"RuntimeObjectsEqual",value:function(t,e){if(null===t)return P("obj1");if(null===e)return P("obj2");if(t.constructor!==e.constructor)return!1;var n=C(t,R);if(null!==n)return n.value===b(e,R).value;var i=C(t,D);if(null!==i)return i.value===b(e,D).value;var r=C(t,B);if(null!==r)return r.value===b(e,B).value;var a=C(t,j),s=C(e,j);if(null!==a&&null!==s)return T(a.valueObject)&&T(s.valueObject)?a.valueObject.Equals(s.valueObject):a.valueObject===s.valueObject;throw new Error("FastRoughDefinitelyEquals: Unsupported runtime object type: "+t.constructor.name)}},{key:"GetVariableWithName",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=this.GetRawVariableWithName(t,e),i=C(n,J);return null!==i&&(n=this.ValueAtVariablePointer(i)),n}},{key:"TryGetDefaultVariableValue",value:function(t){var e=W(this._defaultGlobalVariables,t,null);return e.exists?e.result:null}},{key:"GlobalVariableExistsWithName",value:function(t){return this._globalVariables.has(t)||null!==this._defaultGlobalVariables&&this._defaultGlobalVariables.has(t)}},{key:"GetRawVariableWithName",value:function(t,e){if(0==e||-1==e){var n=null;if(null!==this.patch&&(n=this.patch.TryGetGlobal(t,null)).exists)return n.result;if((n=W(this._globalVariables,t,null)).exists)return n.result;if(null!==this._defaultGlobalVariables&&(n=W(this._defaultGlobalVariables,t,null)).exists)return n.result;if(null===this._listDefsOrigin)return P("VariablesState._listDefsOrigin");var i=this._listDefsOrigin.FindSingleItemListWithName(t);if(i)return i}return this._callStack.GetTemporaryVariableWithName(t,e)}},{key:"ValueAtVariablePointer",value:function(t){return this.GetVariableWithName(t.variableName,t.contextIndex)}},{key:"Assign",value:function(t,e){var n=t.variableName;if(null===n)return P("name");var i=-1,r=!1;if(r=t.isNewDeclaration?t.isGlobal:this.GlobalVariableExistsWithName(n),t.isNewDeclaration){var a=C(e,J);if(null!==a)e=this.ResolveVariablePointer(a)}else{var s=null;do{null!=(s=C(this.GetRawVariableWithName(n,i),J))&&(n=s.variableName,r=0==(i=s.contextIndex))}while(null!=s)}r?this.SetGlobal(n,e):this._callStack.SetTemporaryVariable(n,e,t.isNewDeclaration,i)}},{key:"SnapshotDefaultGlobals",value:function(){this._defaultGlobalVariables=new Map(this._globalVariables)}},{key:"RetainListOriginsForAssignment",value:function(t,e){var n=b(t,U),i=b(e,U);n.value&&i.value&&0==i.value.Count&&i.value.SetInitialOriginNames(n.value.originNames)}},{key:"SetGlobal",value:function(t,e){var n=null;if(null===this.patch&&(n=W(this._globalVariables,t,null)),null!==this.patch&&((n=this.patch.TryGetGlobal(t,null)).exists||(n=W(this._globalVariables,t,null))),U.RetainListOriginsForAssignment(n.result,e),null===t)return P("variableName");if(null!==this.patch?this.patch.SetGlobal(t,e):this._globalVariables.set(t,e),null!==this.variableChangedEvent&&null!==n&&e!==n.result)if(this.batchObservingVariableChanges){if(null===this._changedVariablesForBatchObs)return P("this._changedVariablesForBatchObs");null!==this.patch?this.patch.AddChangedVariable(t):null!==this._changedVariablesForBatchObs&&this._changedVariablesForBatchObs.add(t)}else this.variableChangedEvent(t,e)}},{key:"ResolveVariablePointer",value:function(t){var e=t.contextIndex;-1==e&&(e=this.GetContextIndexOfVariableNamed(t.variableName));var n=C(this.GetRawVariableWithName(t.variableName,e),J);return null!=n?n:new J(t.variableName,e)}},{key:"GetContextIndexOfVariableNamed",value:function(t){return this.GlobalVariableExistsWithName(t)?0:this._callStack.currentElementIndex}},{key:"ObserveVariableChange",value:function(t){this.variableChangedEventCallbacks.push(t)}}]),i}(function(){return r((function t(){n(this,t)}))}());lt.dontSaveDefaultValues=!0;var ht=function(){function t(e){n(this,t),this.seed=e%2147483647,this.seed<=0&&(this.seed+=2147483646)}return r(t,[{key:"next",value:function(){return this.seed=48271*this.seed%2147483647}},{key:"nextFloat",value:function(){return(this.next()-1)/2147483646}}]),t}(),ct=function(){function t(){if(n(this,t),this._changedVariables=new Set,this._visitCounts=new Map,this._turnIndices=new Map,1===arguments.length&&null!==arguments[0]){var e=arguments[0];this._globals=new Map(e._globals),this._changedVariables=new Set(e._changedVariables),this._visitCounts=new Map(e._visitCounts),this._turnIndices=new Map(e._turnIndices)}else this._globals=new Map,this._changedVariables=new Set,this._visitCounts=new Map,this._turnIndices=new Map}return r(t,[{key:"globals",get:function(){return this._globals}},{key:"changedVariables",get:function(){return this._changedVariables}},{key:"visitCounts",get:function(){return this._visitCounts}},{key:"turnIndices",get:function(){return this._turnIndices}},{key:"TryGetGlobal",value:function(t,e){return null!==t&&this._globals.has(t)?{result:this._globals.get(t),exists:!0}:{result:e,exists:!1}}},{key:"SetGlobal",value:function(t,e){this._globals.set(t,e)}},{key:"AddChangedVariable",value:function(t){return this._changedVariables.add(t)}},{key:"TryGetVisitCount",value:function(t,e){return this._visitCounts.has(t)?{result:this._visitCounts.get(t),exists:!0}:{result:e,exists:!1}}},{key:"SetVisitCount",value:function(t,e){this._visitCounts.set(t,e)}},{key:"SetTurnIndex",value:function(t,e){this._turnIndices.set(t,e)}},{key:"TryGetTurnIndex",value:function(t,e){return this._turnIndices.has(t)?{result:this._turnIndices.get(t),exists:!0}:{result:e,exists:!1}}}]),t}(),ft=function(){function t(){n(this,t)}return r(t,null,[{key:"TextToDictionary",value:function(e){return new t.Reader(e).ToDictionary()}},{key:"TextToArray",value:function(e){return new t.Reader(e).ToArray()}}]),t}();!function(t){var e=function(){function t(e){n(this,t),this._rootObject=JSON.parse(e)}return r(t,[{key:"ToDictionary",value:function(){return this._rootObject}},{key:"ToArray",value:function(){return this._rootObject}}]),t}();t.Reader=e;var i=function(){function e(){n(this,e),this._currentPropertyName=null,this._currentString=null,this._stateStack=[],this._collectionStack=[],this._propertyNameStack=[],this._jsonObject=null}return r(e,[{key:"WriteObject",value:function(t){this.WriteObjectStart(),t(this),this.WriteObjectEnd()}},{key:"WriteObjectStart",value:function(){this.StartNewObject(!0);var e={};if(this.state===t.Writer.State.Property){this.Assert(null!==this.currentCollection),this.Assert(null!==this.currentPropertyName);var n=this._propertyNameStack.pop();this.currentCollection[n]=e,this._collectionStack.push(e)}else this.state===t.Writer.State.Array?(this.Assert(null!==this.currentCollection),this.currentCollection.push(e),this._collectionStack.push(e)):(this.Assert(this.state===t.Writer.State.None),this._jsonObject=e,this._collectionStack.push(e));this._stateStack.push(new t.Writer.StateElement(t.Writer.State.Object))}},{key:"WriteObjectEnd",value:function(){this.Assert(this.state===t.Writer.State.Object),this._collectionStack.pop(),this._stateStack.pop()}},{key:"WriteProperty",value:function(t,e){if(this.WritePropertyStart(t),arguments[1]instanceof Function){(0,arguments[1])(this)}else{var n=arguments[1];this.Write(n)}this.WritePropertyEnd()}},{key:"WriteIntProperty",value:function(t,e){this.WritePropertyStart(t),this.WriteInt(e),this.WritePropertyEnd()}},{key:"WriteFloatProperty",value:function(t,e){this.WritePropertyStart(t),this.WriteFloat(e),this.WritePropertyEnd()}},{key:"WritePropertyStart",value:function(e){this.Assert(this.state===t.Writer.State.Object),this._propertyNameStack.push(e),this.IncrementChildCount(),this._stateStack.push(new t.Writer.StateElement(t.Writer.State.Property))}},{key:"WritePropertyEnd",value:function(){this.Assert(this.state===t.Writer.State.Property),this.Assert(1===this.childCount),this._stateStack.pop()}},{key:"WritePropertyNameStart",value:function(){this.Assert(this.state===t.Writer.State.Object),this.IncrementChildCount(),this._currentPropertyName="",this._stateStack.push(new t.Writer.StateElement(t.Writer.State.Property)),this._stateStack.push(new t.Writer.StateElement(t.Writer.State.PropertyName))}},{key:"WritePropertyNameEnd",value:function(){this.Assert(this.state===t.Writer.State.PropertyName),this.Assert(null!==this._currentPropertyName),this._propertyNameStack.push(this._currentPropertyName),this._currentPropertyName=null,this._stateStack.pop()}},{key:"WritePropertyNameInner",value:function(e){this.Assert(this.state===t.Writer.State.PropertyName),this.Assert(null!==this._currentPropertyName),this._currentPropertyName+=e}},{key:"WriteArrayStart",value:function(){this.StartNewObject(!0);var e=[];if(this.state===t.Writer.State.Property){this.Assert(null!==this.currentCollection),this.Assert(null!==this.currentPropertyName);var n=this._propertyNameStack.pop();this.currentCollection[n]=e,this._collectionStack.push(e)}else this.state===t.Writer.State.Array?(this.Assert(null!==this.currentCollection),this.currentCollection.push(e),this._collectionStack.push(e)):(this.Assert(this.state===t.Writer.State.None),this._jsonObject=e,this._collectionStack.push(e));this._stateStack.push(new t.Writer.StateElement(t.Writer.State.Array))}},{key:"WriteArrayEnd",value:function(){this.Assert(this.state===t.Writer.State.Array),this._collectionStack.pop(),this._stateStack.pop()}},{key:"Write",value:function(t){null!==t?(this.StartNewObject(!1),this._addToCurrentObject(t)):console.error("Warning: trying to write a null value")}},{key:"WriteBool",value:function(t){null!==t&&(this.StartNewObject(!1),this._addToCurrentObject(t))}},{key:"WriteInt",value:function(t){null!==t&&(this.StartNewObject(!1),this._addToCurrentObject(Math.floor(t)))}},{key:"WriteFloat",value:function(t){null!==t&&(this.StartNewObject(!1),t==Number.POSITIVE_INFINITY?this._addToCurrentObject(34e37):t==Number.NEGATIVE_INFINITY?this._addToCurrentObject(-34e37):isNaN(t)?this._addToCurrentObject(0):this._addToCurrentObject(t))}},{key:"WriteNull",value:function(){this.StartNewObject(!1),this._addToCurrentObject(null)}},{key:"WriteStringStart",value:function(){this.StartNewObject(!1),this._currentString="",this._stateStack.push(new t.Writer.StateElement(t.Writer.State.String))}},{key:"WriteStringEnd",value:function(){this.Assert(this.state==t.Writer.State.String),this._stateStack.pop(),this._addToCurrentObject(this._currentString),this._currentString=null}},{key:"WriteStringInner",value:function(e){this.Assert(this.state===t.Writer.State.String),null!==e?this._currentString+=e:console.error("Warning: trying to write a null string")}},{key:"toString",value:function(){return null===this._jsonObject?"":JSON.stringify(this._jsonObject)}},{key:"StartNewObject",value:function(e){e?this.Assert(this.state===t.Writer.State.None||this.state===t.Writer.State.Property||this.state===t.Writer.State.Array):this.Assert(this.state===t.Writer.State.Property||this.state===t.Writer.State.Array),this.state===t.Writer.State.Property&&this.Assert(0===this.childCount),this.state!==t.Writer.State.Array&&this.state!==t.Writer.State.Property||this.IncrementChildCount()}},{key:"state",get:function(){return this._stateStack.length>0?this._stateStack[this._stateStack.length-1].type:t.Writer.State.None}},{key:"childCount",get:function(){return this._stateStack.length>0?this._stateStack[this._stateStack.length-1].childCount:0}},{key:"currentCollection",get:function(){return this._collectionStack.length>0?this._collectionStack[this._collectionStack.length-1]:null}},{key:"currentPropertyName",get:function(){return this._propertyNameStack.length>0?this._propertyNameStack[this._propertyNameStack.length-1]:null}},{key:"IncrementChildCount",value:function(){this.Assert(this._stateStack.length>0);var t=this._stateStack.pop();t.childCount++,this._stateStack.push(t)}},{key:"Assert",value:function(t){if(!t)throw Error("Assert failed while writing JSON")}},{key:"_addToCurrentObject",value:function(e){this.Assert(null!==this.currentCollection),this.state===t.Writer.State.Array?(this.Assert(Array.isArray(this.currentCollection)),this.currentCollection.push(e)):this.state===t.Writer.State.Property&&(this.Assert(!Array.isArray(this.currentCollection)),this.Assert(null!==this.currentPropertyName),this.currentCollection[this.currentPropertyName]=e,this._propertyNameStack.pop())}}]),e}();t.Writer=i,function(e){var i;(i=e.State||(e.State={}))[i.None=0]="None",i[i.Object=1]="Object",i[i.Array=2]="Array",i[i.Property=3]="Property",i[i.PropertyName=4]="PropertyName",i[i.String=5]="String";var a=r((function e(i){n(this,e),this.type=t.Writer.State.None,this.childCount=0,this.type=i}));e.StateElement=a}(i=t.Writer||(t.Writer={}))}(ft||(ft={}));var vt,dt,pt,yt=function(){function t(){n(this,t);var e=arguments[0],i=arguments[1];if(this.name=e,this.callStack=new ut(i),arguments[2]){var r=arguments[2];this.callStack.SetJsonToken(r.callstack,i),this.outputStream=ot.JArrayToRuntimeObjList(r.outputStream),this.currentChoices=ot.JArrayToRuntimeObjList(r.currentChoices);var a=r.choiceThreads;void 0!==a&&this.LoadFlowChoiceThreads(a,i)}else this.outputStream=[],this.currentChoices=[]}return r(t,[{key:"WriteJson",value:function(t){var e=this;t.WriteObjectStart(),t.WriteProperty("callstack",(function(t){return e.callStack.WriteJson(t)})),t.WriteProperty("outputStream",(function(t){return ot.WriteListRuntimeObjs(t,e.outputStream)}));var n,i=!1,r=g(this.currentChoices);try{for(r.s();!(n=r.n()).done;){var a=n.value;if(null===a.threadAtGeneration)return P("c.threadAtGeneration");a.originalThreadIndex=a.threadAtGeneration.threadIndex,null===this.callStack.ThreadWithIndex(a.originalThreadIndex)&&(i||(i=!0,t.WritePropertyStart("choiceThreads"),t.WriteObjectStart()),t.WritePropertyStart(a.originalThreadIndex),a.threadAtGeneration.WriteJson(t),t.WritePropertyEnd())}}catch(t){r.e(t)}finally{r.f()}i&&(t.WriteObjectEnd(),t.WritePropertyEnd()),t.WriteProperty("currentChoices",(function(t){t.WriteArrayStart();var n,i=g(e.currentChoices);try{for(i.s();!(n=i.n()).done;){var r=n.value;ot.WriteChoice(t,r)}}catch(t){i.e(t)}finally{i.f()}t.WriteArrayEnd()})),t.WriteObjectEnd()}},{key:"LoadFlowChoiceThreads",value:function(t,e){var n,i=g(this.currentChoices);try{for(i.s();!(n=i.n()).done;){var r=n.value,a=this.callStack.ThreadWithIndex(r.originalThreadIndex);if(null!==a)r.threadAtGeneration=a.Copy();else{var s=t["".concat(r.originalThreadIndex)];r.threadAtGeneration=new ut.Thread(s,e)}}}catch(t){i.e(t)}finally{i.f()}}}]),t}(),mt=function(){function e(t){n(this,e),this.kInkSaveStateVersion=10,this.kMinCompatibleLoadVersion=8,this.onDidLoadState=null,this._currentErrors=null,this._currentWarnings=null,this.divertedPointer=$.Null,this._currentTurnIndex=0,this.storySeed=0,this.previousRandom=0,this.didSafeExit=!1,this._currentText=null,this._currentTags=null,this._outputStreamTextDirty=!0,this._outputStreamTagsDirty=!0,this._patch=null,this._aliveFlowNames=null,this._namedFlows=null,this.kDefaultFlowName="DEFAULT_FLOW",this._aliveFlowNamesDirty=!0,this.story=t,this._currentFlow=new yt(this.kDefaultFlowName,t),this.OutputStreamDirty(),this._aliveFlowNamesDirty=!0,this._evaluationStack=[],this._variablesState=new lt(this.callStack,t.listDefinitions),this._visitCounts=new Map,this._turnIndices=new Map,this.currentTurnIndex=-1;var i=(new Date).getTime();this.storySeed=new ht(i).next()%100,this.previousRandom=0,this.GoToStart()}return r(e,[{key:"ToJson",value:function(){var t=new ft.Writer;return this.WriteJson(t),t.toString()}},{key:"toJson",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.ToJson(t)}},{key:"LoadJson",value:function(t){var e=ft.TextToDictionary(t);this.LoadJsonObj(e),null!==this.onDidLoadState&&this.onDidLoadState()}},{key:"VisitCountAtPathString",value:function(t){var e;if(null!==this._patch){var n=this.story.ContentAtPath(new k(t)).container;if(null===n)throw new Error("Content at path not found: "+t);if((e=this._patch.TryGetVisitCount(n,0)).exists)return e.result}return(e=W(this._visitCounts,t,null)).exists?e.result:0}},{key:"VisitCountForContainer",value:function(t){if(null===t)return P("container");if(!t.visitsShouldBeCounted)return this.story.Error("Read count for target ("+t.name+" - on "+t.debugMetadata+") unknown. The story may need to be compiled with countAllVisits flag (-c)."),0;if(null!==this._patch){var e=this._patch.TryGetVisitCount(t,0);if(e.exists)return e.result}var n=t.path.toString(),i=W(this._visitCounts,n,null);return i.exists?i.result:0}},{key:"IncrementVisitCountForContainer",value:function(t){if(null!==this._patch){var e=this.VisitCountForContainer(t);return e++,void this._patch.SetVisitCount(t,e)}var n=t.path.toString(),i=W(this._visitCounts,n,null);i.exists?this._visitCounts.set(n,i.result+1):this._visitCounts.set(n,1)}},{key:"RecordTurnIndexVisitToContainer",value:function(t){if(null===this._patch){var e=t.path.toString();this._turnIndices.set(e,this.currentTurnIndex)}else this._patch.SetTurnIndex(t,this.currentTurnIndex)}},{key:"TurnsSinceForContainer",value:function(t){if(t.turnIndexShouldBeCounted||this.story.Error("TURNS_SINCE() for target ("+t.name+" - on "+t.debugMetadata+") unknown. The story may need to be compiled with countAllVisits flag (-c)."),null!==this._patch){var e=this._patch.TryGetTurnIndex(t,0);if(e.exists)return this.currentTurnIndex-e.result}var n=t.path.toString(),i=W(this._turnIndices,n,0);return i.exists?this.currentTurnIndex-i.result:-1}},{key:"callstackDepth",get:function(){return this.callStack.depth}},{key:"outputStream",get:function(){return this._currentFlow.outputStream}},{key:"currentChoices",get:function(){return this.canContinue?[]:this._currentFlow.currentChoices}},{key:"generatedChoices",get:function(){return this._currentFlow.currentChoices}},{key:"currentErrors",get:function(){return this._currentErrors}},{key:"currentWarnings",get:function(){return this._currentWarnings}},{key:"variablesState",get:function(){return this._variablesState},set:function(t){this._variablesState=t}},{key:"callStack",get:function(){return this._currentFlow.callStack}},{key:"evaluationStack",get:function(){return this._evaluationStack}},{key:"currentTurnIndex",get:function(){return this._currentTurnIndex},set:function(t){this._currentTurnIndex=t}},{key:"currentPathString",get:function(){var t=this.currentPointer;return t.isNull?null:null===t.path?P("pointer.path"):t.path.toString()}},{key:"currentPointer",get:function(){return this.callStack.currentElement.currentPointer.copy()},set:function(t){this.callStack.currentElement.currentPointer=t.copy()}},{key:"previousPointer",get:function(){return this.callStack.currentThread.previousPointer.copy()},set:function(t){this.callStack.currentThread.previousPointer=t.copy()}},{key:"canContinue",get:function(){return!this.currentPointer.isNull&&!this.hasError}},{key:"hasError",get:function(){return null!=this.currentErrors&&this.currentErrors.length>0}},{key:"hasWarning",get:function(){return null!=this.currentWarnings&&this.currentWarnings.length>0}},{key:"currentText",get:function(){if(this._outputStreamTextDirty){var t,e=new A,n=!1,i=g(this.outputStream);try{for(i.s();!(t=i.n()).done;){var r=t.value,a=C(r,G);if(n||null===a){var s=C(r,X);null!==s&&(s.commandType==X.CommandType.BeginTag?n=!0:s.commandType==X.CommandType.EndTag&&(n=!1))}else e.Append(a.value)}}catch(t){i.e(t)}finally{i.f()}this._currentText=this.CleanOutputWhitespace(e.toString()),this._outputStreamTextDirty=!1}return this._currentText}},{key:"CleanOutputWhitespace",value:function(t){for(var e=new A,n=-1,i=0,r=0;r0&&n!=i&&e.Append(" "),n=-1),"\n"==a&&(i=r+1),s||e.Append(a)}return e.toString()}},{key:"currentTags",get:function(){if(this._outputStreamTagsDirty){this._currentTags=[];var t,e=!1,n=new A,i=g(this.outputStream);try{for(i.s();!(t=i.n()).done;){var r=t.value,a=C(r,X);if(null!=a){if(a.commandType==X.CommandType.BeginTag){if(e&&n.Length>0){var s=this.CleanOutputWhitespace(n.toString());this._currentTags.push(s),n.Clear()}e=!0}else if(a.commandType==X.CommandType.EndTag){if(n.Length>0){var o=this.CleanOutputWhitespace(n.toString());this._currentTags.push(o),n.Clear()}e=!1}}else if(e){var u=C(r,G);null!==u&&n.Append(u.value)}else{var l=C(r,it);null!=l&&null!=l.text&&l.text.length>0&&this._currentTags.push(l.text)}}}catch(t){i.e(t)}finally{i.f()}if(n.Length>0){var h=this.CleanOutputWhitespace(n.toString());this._currentTags.push(h),n.Clear()}this._outputStreamTagsDirty=!1}return this._currentTags}},{key:"currentFlowName",get:function(){return this._currentFlow.name}},{key:"currentFlowIsDefaultFlow",get:function(){return this._currentFlow.name==this.kDefaultFlowName}},{key:"aliveFlowNames",get:function(){if(this._aliveFlowNamesDirty){if(this._aliveFlowNames=[],null!=this._namedFlows){var t,e=g(this._namedFlows.keys());try{for(e.s();!(t=e.n()).done;){var n=t.value;n!=this.kDefaultFlowName&&this._aliveFlowNames.push(n)}}catch(t){e.e(t)}finally{e.f()}}this._aliveFlowNamesDirty=!1}return this._aliveFlowNames}},{key:"inExpressionEvaluation",get:function(){return this.callStack.currentElement.inExpressionEvaluation},set:function(t){this.callStack.currentElement.inExpressionEvaluation=t}},{key:"GoToStart",value:function(){this.callStack.currentElement.currentPointer=$.StartOf(this.story.mainContentContainer)}},{key:"SwitchFlow_Internal",value:function(t){if(null===t)throw new Error("Must pass a non-null string to Story.SwitchFlow");if(null===this._namedFlows&&(this._namedFlows=new Map,this._namedFlows.set(this.kDefaultFlowName,this._currentFlow)),t!==this._currentFlow.name){var e,n=W(this._namedFlows,t,null);n.exists?e=n.result:(e=new yt(t,this.story),this._namedFlows.set(t,e),this._aliveFlowNamesDirty=!0),this._currentFlow=e,this.variablesState.callStack=this._currentFlow.callStack,this.OutputStreamDirty()}}},{key:"SwitchToDefaultFlow_Internal",value:function(){null!==this._namedFlows&&this.SwitchFlow_Internal(this.kDefaultFlowName)}},{key:"RemoveFlow_Internal",value:function(t){if(null===t)throw new Error("Must pass a non-null string to Story.DestroyFlow");if(t===this.kDefaultFlowName)throw new Error("Cannot destroy default flow");if(this._currentFlow.name===t&&this.SwitchToDefaultFlow_Internal(),null===this._namedFlows)return P("this._namedFlows");this._namedFlows.delete(t),this._aliveFlowNamesDirty=!0}},{key:"CopyAndStartPatching",value:function(){var t,n,i,r,a,s=new e(this.story);if(s._patch=new ct(this._patch),s._currentFlow.name=this._currentFlow.name,s._currentFlow.callStack=new ut(this._currentFlow.callStack),(t=s._currentFlow.currentChoices).push.apply(t,p(this._currentFlow.currentChoices)),(n=s._currentFlow.outputStream).push.apply(n,p(this._currentFlow.outputStream)),s.OutputStreamDirty(),null!==this._namedFlows){s._namedFlows=new Map;var o,u=g(this._namedFlows);try{for(u.s();!(o=u.n()).done;){var l=d(o.value,2),h=l[0],c=l[1];s._namedFlows.set(h,c),s._aliveFlowNamesDirty=!0}}catch(t){u.e(t)}finally{u.f()}s._namedFlows.set(this._currentFlow.name,s._currentFlow)}this.hasError&&(s._currentErrors=[],(r=s._currentErrors).push.apply(r,p(this.currentErrors||[])));this.hasWarning&&(s._currentWarnings=[],(a=s._currentWarnings).push.apply(a,p(this.currentWarnings||[])));return s.variablesState=this.variablesState,s.variablesState.callStack=s.callStack,s.variablesState.patch=s._patch,(i=s.evaluationStack).push.apply(i,p(this.evaluationStack)),this.divertedPointer.isNull||(s.divertedPointer=this.divertedPointer.copy()),s.previousPointer=this.previousPointer.copy(),s._visitCounts=this._visitCounts,s._turnIndices=this._turnIndices,s.currentTurnIndex=this.currentTurnIndex,s.storySeed=this.storySeed,s.previousRandom=this.previousRandom,s.didSafeExit=this.didSafeExit,s}},{key:"RestoreAfterPatch",value:function(){this.variablesState.callStack=this.callStack,this.variablesState.patch=this._patch}},{key:"ApplyAnyPatch",value:function(){if(null!==this._patch){this.variablesState.ApplyPatch();var t,e=g(this._patch.visitCounts);try{for(e.s();!(t=e.n()).done;){var n=d(t.value,2),i=n[0],r=n[1];this.ApplyCountChanges(i,r,!0)}}catch(t){e.e(t)}finally{e.f()}var a,s=g(this._patch.turnIndices);try{for(s.s();!(a=s.n()).done;){var o=d(a.value,2),u=o[0],l=o[1];this.ApplyCountChanges(u,l,!1)}}catch(t){s.e(t)}finally{s.f()}this._patch=null}}},{key:"ApplyCountChanges",value:function(t,e,n){(n?this._visitCounts:this._turnIndices).set(t.path.toString(),e)}},{key:"WriteJson",value:function(e){var n=this;if(e.WriteObjectStart(),e.WritePropertyStart("flows"),e.WriteObjectStart(),null!==this._namedFlows){var i,r=g(this._namedFlows);try{var a=function(){var t=d(i.value,2),n=t[0],r=t[1];e.WriteProperty(n,(function(t){return r.WriteJson(t)}))};for(r.s();!(i=r.n()).done;)a()}catch(t){r.e(t)}finally{r.f()}}else e.WriteProperty(this._currentFlow.name,(function(t){return n._currentFlow.WriteJson(t)}));if(e.WriteObjectEnd(),e.WritePropertyEnd(),e.WriteProperty("currentFlowName",this._currentFlow.name),e.WriteProperty("variablesState",(function(t){return n.variablesState.WriteJson(t)})),e.WriteProperty("evalStack",(function(t){return ot.WriteListRuntimeObjs(t,n.evaluationStack)})),!this.divertedPointer.isNull){if(null===this.divertedPointer.path)return P("divertedPointer");e.WriteProperty("currentDivertTarget",this.divertedPointer.path.componentsString)}e.WriteProperty("visitCounts",(function(t){return ot.WriteIntDictionary(t,n._visitCounts)})),e.WriteProperty("turnIndices",(function(t){return ot.WriteIntDictionary(t,n._turnIndices)})),e.WriteIntProperty("turnIdx",this.currentTurnIndex),e.WriteIntProperty("storySeed",this.storySeed),e.WriteIntProperty("previousRandom",this.previousRandom),e.WriteIntProperty("inkSaveVersion",this.kInkSaveStateVersion),e.WriteIntProperty("inkFormatVersion",t.Story.inkVersionCurrent),e.WriteObjectEnd()}},{key:"LoadJsonObj",value:function(t){var e=t,n=e.inkSaveVersion;if(null==n)throw new Error("ink save format incorrect, can't load.");if(parseInt(n)1){var c=e.currentFlowName;this._currentFlow=this._namedFlows.get(c)}}else{this._namedFlows=null,this._currentFlow.name=this.kDefaultFlowName,this._currentFlow.callStack.SetJsonToken(e.callstackThreads,this.story),this._currentFlow.outputStream=ot.JArrayToRuntimeObjList(e.outputStream),this._currentFlow.currentChoices=ot.JArrayToRuntimeObjList(e.currentChoices);var f=e.choiceThreads;this._currentFlow.LoadFlowChoiceThreads(f,this.story)}this.OutputStreamDirty(),this._aliveFlowNamesDirty=!0,this.variablesState.SetJsonToken(e.variablesState),this.variablesState.callStack=this._currentFlow.callStack,this._evaluationStack=ot.JArrayToRuntimeObjList(e.evalStack);var v=e.currentDivertTarget;if(null!=v){var p=new k(v.toString());this.divertedPointer=this.story.PointerAtPath(p)}this._visitCounts=ot.JObjectToIntDictionary(e.visitCounts),this._turnIndices=ot.JObjectToIntDictionary(e.turnIndices),this.currentTurnIndex=parseInt(e.turnIdx),this.storySeed=parseInt(e.storySeed),this.previousRandom=parseInt(e.previousRandom)}},{key:"ResetErrors",value:function(){this._currentErrors=null,this._currentWarnings=null}},{key:"ResetOutput",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.outputStream.length=0,null!==e&&(t=this.outputStream).push.apply(t,p(e)),this.OutputStreamDirty()}},{key:"PushToOutputStream",value:function(t){var e=C(t,G);if(null!==e){var n=this.TrySplittingHeadTailWhitespace(e);if(null!==n){var i,r=g(n);try{for(r.s();!(i=r.n()).done;){var a=i.value;this.PushToOutputStreamIndividual(a)}}catch(t){r.e(t)}finally{r.f()}return void this.OutputStreamDirty()}}this.PushToOutputStreamIndividual(t),this.OutputStreamDirty()}},{key:"PopFromOutputStream",value:function(t){this.outputStream.splice(this.outputStream.length-t,t),this.OutputStreamDirty()}},{key:"TrySplittingHeadTailWhitespace",value:function(t){var e=t.value;if(null===e)return P("single.value");for(var n=-1,i=-1,r=0;r=0;u--){var l=e[u];if("\n"!=l){if(" "==l||"\t"==l)continue;break}-1==s&&(s=u),o=u}if(-1==n&&-1==s)return null;var h=[],c=0,f=e.length;if(-1!=n){if(n>0){var v=new G(e.substring(0,n));h.push(v)}h.push(new G("\n")),c=i+1}if(-1!=s&&(f=o),f>c){var d=e.substring(c,f);h.push(new G(d))}if(-1!=s&&o>i&&(h.push(new G("\n")),s=0;o--){var u=this.outputStream[o],l=u instanceof X?u:null;if(null!=(u instanceof H?u:null)){s=o;break}if(null!=l&&l.commandType==X.CommandType.BeginString){o>=r&&(r=-1);break}}if(-1!=(-1!=s&&-1!=r?Math.min(r,s):-1!=s?s:r)){if(n.isNewline)i=!1;else if(n.isNonWhitespace&&(s>-1&&this.RemoveExistingGlue(),r>-1))for(var h=this.callStack.elements,c=h.length-1;c>=0;c--){var f=h[c];if(f.type!=z.Function)break;f.functionStartInOutputStream=-1}}else n.isNewline&&(!this.outputStreamEndsInNewline&&this.outputStreamContainsContent||(i=!1))}if(i){if(null===t)return P("obj");this.outputStream.push(t),this.OutputStreamDirty()}}},{key:"TrimNewlinesFromOutputStream",value:function(){for(var t=-1,e=this.outputStream.length-1;e>=0;){var n=this.outputStream[e],i=C(n,X),r=C(n,G);if(null!=i||null!=r&&r.isNonWhitespace)break;null!=r&&r.isNewline&&(t=e),e--}if(t>=0)for(e=t;e=0;t--){var e=this.outputStream[t];if(e instanceof H)this.outputStream.splice(t,1);else if(e instanceof X)break}this.OutputStreamDirty()}},{key:"outputStreamEndsInNewline",get:function(){if(this.outputStream.length>0)for(var t=this.outputStream.length-1;t>=0;t--){if(this.outputStream[t]instanceof X)break;var e=this.outputStream[t];if(e instanceof G){if(e.isNewline)return!0;if(e.isNonWhitespace)break}}return!1}},{key:"outputStreamContainsContent",get:function(){var t,e=g(this.outputStream);try{for(e.s();!(t=e.n()).done;){if(t.value instanceof G)return!0}}catch(t){e.e(t)}finally{e.f()}return!1}},{key:"inStringEvaluation",get:function(){for(var t=this.outputStream.length-1;t>=0;t--){var e=C(this.outputStream[t],X);if(e instanceof X&&e.commandType==X.CommandType.BeginString)return!0}return!1}},{key:"PushEvaluationStack",value:function(t){var e=C(t,U);if(e){var n=e.value;if(null===n)return P("rawList");if(null!=n.originNames){n.origins||(n.origins=[]),n.origins.length=0;var i,r=g(n.originNames);try{for(r.s();!(i=r.n()).done;){var a=i.value;if(null===this.story.listDefinitions)return P("StoryState.story.listDefinitions");var s=this.story.listDefinitions.TryListGetDefinition(a,null);if(null===s.result)return P("StoryState def.result");n.origins.indexOf(s.result)<0&&n.origins.push(s.result)}}catch(t){r.e(t)}finally{r.f()}}}if(null===t)return P("obj");this.evaluationStack.push(t)}},{key:"PopEvaluationStack",value:function(t){if(void 0===t)return _(this.evaluationStack.pop());if(t>this.evaluationStack.length)throw new Error("trying to pop too many objects");return _(this.evaluationStack.splice(this.evaluationStack.length-t,t))}},{key:"PeekEvaluationStack",value:function(){return this.evaluationStack[this.evaluationStack.length-1]}},{key:"ForceEnd",value:function(){this.callStack.Reset(),this._currentFlow.currentChoices.length=0,this.currentPointer=$.Null,this.previousPointer=$.Null,this.didSafeExit=!0}},{key:"TrimWhitespaceFromFunctionEnd",value:function(){S.Assert(this.callStack.currentElement.type==z.Function);var t=this.callStack.currentElement.functionStartInOutputStream;-1==t&&(t=0);for(var e=this.outputStream.length-1;e>=t;e--){var n=this.outputStream[e],i=C(n,G),r=C(n,X);if(null!=i){if(r)break;if(!i.isNewline&&!i.isInlineWhitespace)break;this.outputStream.splice(e,1),this.OutputStreamDirty()}}}},{key:"PopCallStack",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.callStack.currentElement.type==z.Function&&this.TrimWhitespaceFromFunctionEnd(),this.callStack.Pop(t)}},{key:"SetChosenPath",value:function(t,e){this._currentFlow.currentChoices.length=0;var n=this.story.PointerAtPath(t);n.isNull||-1!=n.index||(n.index=0),this.currentPointer=n,e&&this.currentTurnIndex++}},{key:"StartFunctionEvaluationFromGame",value:function(t,e){this.callStack.Push(z.FunctionEvaluationFromGame,this.evaluationStack.length),this.callStack.currentElement.currentPointer=$.StartOf(t),this.PassArgumentsToEvaluationStack(e)}},{key:"PassArgumentsToEvaluationStack",value:function(t){if(null!==t)for(var e=0;et;){var n=this.PopEvaluationStack();null===e&&(e=n)}if(this.PopCallStack(z.FunctionEvaluationFromGame),e){if(e instanceof et)return null;var i=b(e,j);return i.valueType==V.DivertTarget?i.valueObject.toString():i.valueObject}return null}},{key:"AddError",value:function(t,e){e?(null==this._currentWarnings&&(this._currentWarnings=[]),this._currentWarnings.push(t)):(null==this._currentErrors&&(this._currentErrors=[]),this._currentErrors.push(t))}},{key:"OutputStreamDirty",value:function(){this._outputStreamTextDirty=!0,this._outputStreamTagsDirty=!0}}]),e}(),gt=function(){function t(){n(this,t),this.startTime=void 0}return r(t,[{key:"ElapsedMilliseconds",get:function(){return void 0===this.startTime?0:(new Date).getTime()-this.startTime}},{key:"Start",value:function(){this.startTime=(new Date).getTime()}},{key:"Stop",value:function(){this.startTime=void 0}}]),t}();!function(t){t[t.Author=0]="Author",t[t.Warning=1]="Warning",t[t.Error=2]="Error"}(vt||(vt={})),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&t>-9007199254740992&&t<9007199254740992&&Math.floor(t)===t}),t.Story=function(t){a(s,t);var i=v(s);function s(){var t,e;n(this,s),(t=i.call(this)).inkVersionMinimumCompatible=18,t.onError=null,t.onDidContinue=null,t.onMakeChoice=null,t.onEvaluateFunction=null,t.onCompleteEvaluateFunction=null,t.onChoosePathString=null,t._prevContainers=[],t.allowExternalFunctionFallbacks=!1,t._listDefinitions=null,t._variableObservers=null,t._hasValidatedExternals=!1,t._temporaryEvaluationContainer=null,t._asyncContinueActive=!1,t._stateSnapshotAtLastNewline=null,t._sawLookaheadUnsafeFunctionAfterNewline=!1,t._recursiveContinueCount=0,t._asyncSaving=!1,t._profiler=null;var r=null,a=null;if(arguments[0]instanceof K)e=arguments[0],void 0!==arguments[1]&&(r=arguments[1]),t._mainContentContainer=e;else if("string"==typeof arguments[0]){var o=arguments[0];a=ft.TextToDictionary(o)}else a=arguments[0];if(null!=r&&(t._listDefinitions=new st(r)),t._externals=new Map,null!==a){var u=a,l=u.inkVersion;if(null==l)throw new Error("ink version number not found. Are you sure it's a valid .ink.json file?");var h=parseInt(l);if(h>s.inkVersionCurrent)throw new Error("Version of ink used to build story was newer than the current version of the engine");if(h0&&void 0!==arguments[0]?arguments[0]:0;null!=this._profiler&&this._profiler.PreContinue();var e=t>0;if(this._recursiveContinueCount++,!this._asyncContinueActive){if(this._asyncContinueActive=e,!this.canContinue)throw new Error("Can't continue - should check canContinue before calling Continue");this._state.didSafeExit=!1,this._state.ResetOutput(),1==this._recursiveContinueCount&&(this._state.variablesState.batchObservingVariableChanges=!0)}var n=new gt;n.Start();var i=!1;this._sawLookaheadUnsafeFunctionAfterNewline=!1;do{try{i=this.ContinueSingleStep()}catch(t){if(!(t instanceof x))throw t;this.AddError(t.message,void 0,t.useEndLineNumber);break}if(i)break;if(this._asyncContinueActive&&n.ElapsedMilliseconds>t)break}while(this.canContinue);if(n.Stop(),!i&&this.canContinue||(null!==this._stateSnapshotAtLastNewline&&this.RestoreStateSnapshot(),this.canContinue||(this.state.callStack.canPopThread&&this.AddError("Thread available to pop, threads should always be flat by the end of evaluation?"),0!=this.state.generatedChoices.length||this.state.didSafeExit||null!=this._temporaryEvaluationContainer||(this.state.callStack.CanPop(z.Tunnel)?this.AddError("unexpectedly reached end of content. Do you need a '->->' to return from a tunnel?"):this.state.callStack.CanPop(z.Function)?this.AddError("unexpectedly reached end of content. Do you need a '~ return'?"):this.state.callStack.canPop?this.AddError("unexpectedly reached end of content for unknown reason. Please debug compiler!"):this.AddError("ran out of content. Do you need a '-> DONE' or '-> END'?"))),this.state.didSafeExit=!1,this._sawLookaheadUnsafeFunctionAfterNewline=!1,1==this._recursiveContinueCount&&(this._state.variablesState.batchObservingVariableChanges=!1),this._asyncContinueActive=!1,null!==this.onDidContinue&&this.onDidContinue()),this._recursiveContinueCount--,null!=this._profiler&&this._profiler.PostContinue(),this.state.hasError||this.state.hasWarning){if(null===this.onError){var r=new A;throw r.Append("Ink had "),this.state.hasError&&(r.Append("".concat(this.state.currentErrors.length)),r.Append(1==this.state.currentErrors.length?" error":"errors"),this.state.hasWarning&&r.Append(" and ")),this.state.hasWarning&&(r.Append("".concat(this.state.currentWarnings.length)),r.Append(1==this.state.currentWarnings.length?" warning":"warnings"),this.state.hasWarning&&r.Append(" and ")),r.Append(". It is strongly suggested that you assign an error handler to story.onError. The first issue was: "),r.Append(this.state.hasError?this.state.currentErrors[0]:this.state.currentWarnings[0]),new x(r.toString())}if(this.state.hasError){var a,s=g(this.state.currentErrors);try{for(s.s();!(a=s.n()).done;){var o=a.value;this.onError(o,vt.Error)}}catch(o){s.e(o)}finally{s.f()}}if(this.state.hasWarning){var u,l=g(this.state.currentWarnings);try{for(l.s();!(u=l.n()).done;){var h=u.value;this.onError(h,vt.Warning)}}catch(o){l.e(o)}finally{l.f()}}this.ResetErrors()}}},{key:"ContinueSingleStep",value:function(){if(null!=this._profiler&&this._profiler.PreStep(),this.Step(),null!=this._profiler&&this._profiler.PostStep(),this.canContinue||this.state.callStack.elementIsEvaluateFromGame||this.TryFollowDefaultInvisibleChoice(),null!=this._profiler&&this._profiler.PreSnapshot(),!this.state.inStringEvaluation){if(null!==this._stateSnapshotAtLastNewline){if(null===this._stateSnapshotAtLastNewline.currentTags)return P("this._stateAtLastNewline.currentTags");if(null===this.state.currentTags)return P("this.state.currentTags");var t=this.CalculateNewlineOutputStateChange(this._stateSnapshotAtLastNewline.currentText,this.state.currentText,this._stateSnapshotAtLastNewline.currentTags.length,this.state.currentTags.length);if(t==s.OutputStateChange.ExtendedBeyondNewline||this._sawLookaheadUnsafeFunctionAfterNewline)return this.RestoreStateSnapshot(),!0;t==s.OutputStateChange.NewlineRemoved&&this.DiscardSnapshot()}this.state.outputStreamEndsInNewline&&(this.canContinue?null==this._stateSnapshotAtLastNewline&&this.StateSnapshot():this.DiscardSnapshot())}return null!=this._profiler&&this._profiler.PostSnapshot(),!1}},{key:"CalculateNewlineOutputStateChange",value:function(t,e,n,i){if(null===t)return P("prevText");if(null===e)return P("currText");var r=e.length>=t.length&&t.length>0&&"\n"==e.charAt(t.length-1);if(n==i&&t.length==e.length&&r)return s.OutputStateChange.NoChange;if(!r)return s.OutputStateChange.NewlineRemoved;if(i>n)return s.OutputStateChange.ExtendedBeyondNewline;for(var a=t.length;a0?this.Error("Failed to find content at path '"+t+"', and no approximation of it was possible."):i.approximate&&this.Warning("Failed to find content at path '"+t+"', so it was approximated to: '"+i.obj.path+"'."),e)}},{key:"StateSnapshot",value:function(){this._stateSnapshotAtLastNewline=this._state,this._state=this._state.CopyAndStartPatching()}},{key:"RestoreStateSnapshot",value:function(){null===this._stateSnapshotAtLastNewline&&P("_stateSnapshotAtLastNewline"),this._stateSnapshotAtLastNewline.RestoreAfterPatch(),this._state=this._stateSnapshotAtLastNewline,this._stateSnapshotAtLastNewline=null,this._asyncSaving||this._state.ApplyAnyPatch()}},{key:"DiscardSnapshot",value:function(){this._asyncSaving||this._state.ApplyAnyPatch(),this._stateSnapshotAtLastNewline=null}},{key:"CopyStateForBackgroundThreadSave",value:function(){if(this.IfAsyncWeCant("start saving on a background thread"),this._asyncSaving)throw new Error("Story is already in background saving mode, can't call CopyStateForBackgroundThreadSave again!");var t=this._state;return this._state=this._state.CopyAndStartPatching(),this._asyncSaving=!0,t}},{key:"BackgroundSaveComplete",value:function(){null===this._stateSnapshotAtLastNewline&&this._state.ApplyAnyPatch(),this._asyncSaving=!1}},{key:"Step",value:function(){var t=!0,e=this.state.currentPointer.copy();if(!e.isNull){for(var n=C(e.Resolve(),K);n&&(this.VisitContainer(n,!0),0!=n.content.length);)n=C((e=$.StartOf(n)).Resolve(),K);this.state.currentPointer=e.copy(),null!=this._profiler&&this._profiler.Step(this.state.callStack);var i=e.Resolve(),r=this.PerformLogicAndFlowControl(i);if(!this.state.currentPointer.isNull){r&&(t=!1);var a=C(i,Q);if(a){var s=this.ProcessChoice(a);s&&this.state.generatedChoices.push(s),i=null,t=!1}if(i instanceof K&&(t=!1),t){var o=C(i,J);if(o&&-1==o.contextIndex){var u=this.state.callStack.ContextForVariableNamed(o.variableName);i=new J(o.variableName,u)}this.state.inExpressionEvaluation?this.state.PushEvaluationStack(i):this.state.PushToOutputStream(i)}this.NextContent();var l=C(i,X);l&&l.commandType==X.CommandType.StartThread&&this.state.callStack.PushThread()}}}},{key:"VisitContainer",value:function(t,e){t.countingAtStartOnly&&!e||(t.visitsShouldBeCounted&&this.state.IncrementVisitCountForContainer(t),t.turnIndexShouldBeCounted&&this.state.RecordTurnIndexVisitToContainer(t))}},{key:"VisitChangedContainersDueToDivert",value:function(){var t=this.state.previousPointer.copy(),e=this.state.currentPointer.copy();if(!e.isNull&&-1!=e.index){if(this._prevContainers.length=0,!t.isNull)for(var n=C(t.Resolve(),K)||C(t.container,K);n;)this._prevContainers.push(n),n=C(n.parent,K);var i=e.Resolve();if(null!=i)for(var r=C(i.parent,K),a=!0;r&&(this._prevContainers.indexOf(r)<0||r.countingAtStartOnly);){var s=r.content.length>0&&i==r.content[0]&&a;s||(a=!1),this.VisitContainer(r,s),i=r,r=C(r.parent,K)}}}},{key:"PopChoiceStringAndTags",value:function(t){for(var e=b(this.state.PopEvaluationStack(),G);this.state.evaluationStack.length>0&&null!=C(this.state.PeekEvaluationStack(),it);){var n=C(this.state.PopEvaluationStack(),it);n&&t.push(n.text)}return e.value}},{key:"ProcessChoice",value:function(t){var e=!0;if(t.hasCondition){var n=this.state.PopEvaluationStack();this.IsTruthy(n)||(e=!1)}var i="",r="",a=[];(t.hasChoiceOnlyContent&&(r=this.PopChoiceStringAndTags(a)||""),t.hasStartContent&&(i=this.PopChoiceStringAndTags(a)||""),t.onceOnly)&&(this.state.VisitCountForContainer(t.choiceTarget)>0&&(e=!1));if(!e)return null;var s=new rt;return s.targetPath=t.pathOnChoice,s.sourcePath=t.path.toString(),s.isInvisibleDefault=t.isInvisibleDefault,s.threadAtGeneration=this.state.callStack.ForkThread(),s.tags=a.reverse(),s.text=(i+r).replace(/^[ \t]+|[ \t]+$/g,""),s}},{key:"IsTruthy",value:function(t){if(t instanceof j){var e=t;if(e instanceof M){var n=e;return this.Error("Shouldn't use a divert target (to "+n.targetPath+") as a conditional value. Did you intend a function call 'likeThis()' or a read count check 'likeThis'? (no arrows)"),!1}return e.isTruthy}return!1}},{key:"PerformLogicAndFlowControl",value:function(t){if(null==t)return!1;if(t instanceof Y){var e=t;if(e.isConditional){var n=this.state.PopEvaluationStack();if(!this.IsTruthy(n))return!0}if(e.hasVariableTarget){var i=e.variableDivertName,r=this.state.variablesState.GetVariableWithName(i);if(null==r)this.Error("Tried to divert using a target from a variable that could not be found ("+i+")");else if(!(r instanceof M)){var a=C(r,D),s="Tried to divert to a target from a variable, but the variable ("+i+") didn't contain a divert target, it ";a instanceof D&&0==a.value?s+="was empty/null (the value 0).":s+="contained '"+r+"'.",this.Error(s)}var o=b(r,M);this.state.divertedPointer=this.PointerAtPath(o.targetPath)}else{if(e.isExternal)return this.CallExternalFunction(e.targetPathString,e.externalArgs),!0;this.state.divertedPointer=e.targetPointer.copy()}return e.pushesToStack&&this.state.callStack.Push(e.stackPushType,void 0,this.state.outputStream.length),this.state.divertedPointer.isNull&&!e.isExternal&&(e&&e.debugMetadata&&null!=e.debugMetadata.sourceName?this.Error("Divert target doesn't exist: "+e.debugMetadata.sourceName):this.Error("Divert resolution failed: "+e)),!0}if(t instanceof X){var u=t;switch(u.commandType){case X.CommandType.EvalStart:this.Assert(!1===this.state.inExpressionEvaluation,"Already in expression evaluation?"),this.state.inExpressionEvaluation=!0;break;case X.CommandType.EvalEnd:this.Assert(!0===this.state.inExpressionEvaluation,"Not in expression evaluation mode"),this.state.inExpressionEvaluation=!1;break;case X.CommandType.EvalOutput:if(this.state.evaluationStack.length>0){var l=this.state.PopEvaluationStack();if(!(l instanceof et)){var h=new G(l.toString());this.state.PushToOutputStream(h)}}break;case X.CommandType.NoOp:break;case X.CommandType.Duplicate:this.state.PushEvaluationStack(this.state.PeekEvaluationStack());break;case X.CommandType.PopEvaluatedValue:this.state.PopEvaluationStack();break;case X.CommandType.PopFunction:case X.CommandType.PopTunnel:var c=u.commandType==X.CommandType.PopFunction?z.Function:z.Tunnel,f=null;if(c==z.Tunnel){var v=this.state.PopEvaluationStack();null===(f=C(v,M))&&this.Assert(v instanceof et,"Expected void if ->-> doesn't override target")}if(this.state.TryExitFunctionEvaluationFromGame())break;if(this.state.callStack.currentElement.type==c&&this.state.callStack.canPop)this.state.PopCallStack(),f&&(this.state.divertedPointer=this.PointerAtPath(f.targetPath));else{var d=new Map;d.set(z.Function,"function return statement (~ return)"),d.set(z.Tunnel,"tunnel onwards statement (->->)");var p=d.get(this.state.callStack.currentElement.type);this.state.callStack.canPop||(p="end of flow (-> END or choice)");var y="Found "+d.get(c)+", when expected "+p;this.Error(y)}break;case X.CommandType.BeginString:this.state.PushToOutputStream(u),this.Assert(!0===this.state.inExpressionEvaluation,"Expected to be in an expression when evaluating a string"),this.state.inExpressionEvaluation=!1;break;case X.CommandType.BeginTag:this.state.PushToOutputStream(u);break;case X.CommandType.EndTag:if(this.state.inStringEvaluation){for(var m=[],S=0,k=this.state.outputStream.length-1;k>=0;--k){var w=this.state.outputStream[k];S++;var _=C(w,X);if(null!=_){if(_.commandType==X.CommandType.BeginTag)break;this.Error("Unexpected ControlCommand while extracting tag from choice");break}w instanceof G&&m.push(w)}this.state.PopFromOutputStream(S);for(var T=new A,E=0,O=m;E=0;--B){var J=this.state.outputStream[B];R++;var q=C(J,X);if(q&&q.commandType==X.CommandType.BeginString)break;J instanceof it&&L.push(J),J instanceof G&&V.push(J)}this.state.PopFromOutputStream(R);for(var H=0,Q=L;HNumber.MAX_SAFE_INTEGER)&&(gt=Number.MAX_SAFE_INTEGER,this.Error("RANDOM was called with a range that exceeds the size that ink numbers can use.")),gt<=0&&this.Error("RANDOM was called with minimum as "+mt.value+" and maximum as "+yt.value+". The maximum must be larger");var St=this.state.storySeed+this.state.previousRandom,kt=new ht(St).next(),Ct=kt%gt+mt.value;this.state.PushEvaluationStack(new D(Ct)),this.state.previousRandom=kt;break;case X.CommandType.SeedRandom:var bt=C(this.state.PopEvaluationStack(),D);if(null==bt||bt instanceof D==!1)return this.Error("Invalid value passed to SEED_RANDOM");if(null===bt.value)return P("minInt.value");this.state.storySeed=bt.value,this.state.previousRandom=0,this.state.PushEvaluationStack(new et);break;case X.CommandType.VisitIndex:var wt=this.state.VisitCountForContainer(this.state.currentPointer.container)-1;this.state.PushEvaluationStack(new D(wt));break;case X.CommandType.SequenceShuffleIndex:var _t=this.NextSequenceShuffleIndex();this.state.PushEvaluationStack(new D(_t));break;case X.CommandType.StartThread:break;case X.CommandType.Done:this.state.callStack.canPopThread?this.state.callStack.PopThread():(this.state.didSafeExit=!0,this.state.currentPointer=$.Null);break;case X.CommandType.End:this.state.ForceEnd();break;case X.CommandType.ListFromInt:var Tt=C(this.state.PopEvaluationStack(),D),Et=b(this.state.PopEvaluationStack(),G);if(null===Tt)throw new x("Passed non-integer when creating a list element from a numerical value.");var Ot=null;if(null===this.listDefinitions)return P("this.listDefinitions");var Pt=this.listDefinitions.TryListGetDefinition(Et.value,null);if(!Pt.exists)throw new x("Failed to find LIST called "+Et.value);if(null===Tt.value)return P("minInt.value");var Nt=Pt.result.TryGetItemWithValue(Tt.value,I.Null);Nt.exists&&(Ot=new U(Nt.result,Tt.value)),null==Ot&&(Ot=new U),this.state.PushEvaluationStack(Ot);break;case X.CommandType.ListRange:var At=C(this.state.PopEvaluationStack(),j),It=C(this.state.PopEvaluationStack(),j),Ft=C(this.state.PopEvaluationStack(),U);if(null===Ft||null===It||null===At)throw new x("Expected list, minimum and maximum for LIST_RANGE");if(null===Ft.value)return P("targetList.value");var xt=Ft.value.ListWithSubRange(It.valueObject,At.valueObject);this.state.PushEvaluationStack(new U(xt));break;case X.CommandType.ListRandom:var Wt=this.state.PopEvaluationStack();if(null===Wt)throw new x("Expected list for LIST_RANDOM");var Vt=Wt.value,Lt=null;if(null===Vt)throw P("list");if(0==Vt.Count)Lt=new F;else{for(var jt=this.state.storySeed+this.state.previousRandom,Rt=new ht(jt).next(),Dt=Rt%Vt.Count,Bt=Vt.entries(),Gt=0;Gt<=Dt-1;Gt++)Bt.next();var Mt=Bt.next().value,Jt={Key:I.fromSerializedKey(Mt[0]),Value:Mt[1]};if(null===Jt.Key.originName)return P("randomItem.Key.originName");(Lt=new F(Jt.Key.originName,this)).Add(Jt.Key,Jt.Value),this.state.previousRandom=Rt}this.state.PushEvaluationStack(new U(Lt));break;default:this.Error("unhandled ControlCommand: "+u)}return!0}if(t instanceof tt){var Ut=t,qt=this.state.PopEvaluationStack();return this.state.variablesState.Assign(Ut,qt),!0}if(t instanceof Z){var Kt=t,zt=null;if(null!=Kt.pathForCount){var Ht=Kt.containerForCount,Xt=this.state.VisitCountForContainer(Ht);zt=new D(Xt)}else null==(zt=this.state.variablesState.GetVariableWithName(Kt.name))&&(this.Warning("Variable not found: '"+Kt.name+"'. Using default value of 0 (false). This can happen with temporary variables if the declaration hasn't yet been hit. Globals are always given a default value on load if a value doesn't exist in the save state."),zt=new D(0));return this.state.PushEvaluationStack(zt),!0}if(t instanceof nt){var $t=t,Yt=this.state.PopEvaluationStack($t.numberOfParameters),Qt=$t.Call(Yt);return this.state.PushEvaluationStack(Qt),!0}return!1}},{key:"ChoosePathString",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(this.IfAsyncWeCant("call ChoosePathString right now"),null!==this.onChoosePathString&&this.onChoosePathString(t,n),e)this.ResetCallstack();else if(this.state.callStack.currentElement.type==z.Function){var i="",r=this.state.callStack.currentElement.currentPointer.container;throw null!=r&&(i="("+r.path.toString()+") "),new Error("Story was running a function "+i+"when you called ChoosePathString("+t+") - this is almost certainly not not what you want! Full stack trace: \n"+this.state.callStack.callStackTrace)}this.state.PassArgumentsToEvaluationStack(n),this.ChoosePath(new k(t))}},{key:"IfAsyncWeCant",value:function(t){if(this._asyncContinueActive)throw new Error("Can't "+t+". Story is in the middle of a ContinueAsync(). Make more ContinueAsync() calls or a single Continue() call beforehand.")}},{key:"ChoosePath",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.state.SetChosenPath(t,e),this.VisitChangedContainersDueToDivert()}},{key:"ChooseChoiceIndex",value:function(t){var e=this.currentChoices;this.Assert(t>=0&&t1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null!==this.onEvaluateFunction&&this.onEvaluateFunction(t,e),this.IfAsyncWeCant("evaluate a function"),null==t)throw new Error("Function is null");if(""==t||""==t.trim())throw new Error("Function is empty or white space.");var i=this.KnotContainerWithName(t);if(null==i)throw new Error("Function doesn't exist: '"+t+"'");var r=[];r.push.apply(r,p(this.state.outputStream)),this._state.ResetOutput(),this.state.StartFunctionEvaluationFromGame(i,e);for(var a=new A;this.canContinue;)a.Append(this.Continue());var s=a.toString();this._state.ResetOutput(r);var o=this.state.CompleteFunctionEvaluationFromGame();return null!=this.onCompleteEvaluateFunction&&this.onCompleteEvaluateFunction(t,e,s,o),n?{returned:o,output:s}:o}},{key:"EvaluateExpression",value:function(t){var e=this.state.callStack.elements.length;this.state.callStack.Push(z.Tunnel),this._temporaryEvaluationContainer=t,this.state.GoToStart();var n=this.state.evaluationStack.length;return this.Continue(),this._temporaryEvaluationContainer=null,this.state.callStack.elements.length>e&&this.state.PopCallStack(),this.state.evaluationStack.length>n?this.state.PopEvaluationStack():null}},{key:"CallExternalFunction",value:function(t,n){if(null===t)return P("funcName");var i=this._externals.get(t),r=null,a=void 0!==i;if(!a||i.lookAheadSafe||null===this._stateSnapshotAtLastNewline){if(!a){if(this.allowExternalFunctionFallbacks)return r=this.KnotContainerWithName(t),this.Assert(null!==r,"Trying to call EXTERNAL function '"+t+"' which has not been bound, and fallback ink function could not be found."),this.state.callStack.Push(z.Function,void 0,this.state.outputStream.length),void(this.state.divertedPointer=$.StartOf(r));this.Assert(!1,"Trying to call EXTERNAL function '"+t+"' which has not been bound (and ink fallbacks disabled).")}for(var s=[],o=0;o2&&void 0!==arguments[2])||arguments[2];this.IfAsyncWeCant("bind an external function"),this.Assert(!this._externals.has(t),"Function '"+t+"' has already been bound."),this._externals.set(t,{function:e,lookAheadSafe:n})}},{key:"TryCoerce",value:function(t){return t}},{key:"BindExternalFunction",value:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.Assert(null!=e,"Can't bind a null function"),this.BindExternalFunctionGeneral(t,(function(t){n.Assert(t.length>=e.length,"External function expected "+e.length+" arguments");for(var i=[],r=0,a=t.length;r1?"s":"",i+=": '",i+=Array.from(n).join("', '"),i+="' ",i+=this.allowExternalFunctionFallbacks?", and no fallback ink function found.":" (ink fallbacks disabled)",this.Error(i)}else if(null!=t){var r,a=g(t.content);try{for(a.s();!(r=a.n()).done;){var s=r.value;null!=s&&s.hasValidName||this.ValidateExternalBindings(s,n)}}catch(t){a.e(t)}finally{a.f()}var o,u=g(t.namedContent);try{for(u.s();!(o=u.n()).done;){var l=d(o.value,2)[1];this.ValidateExternalBindings(C(l,N),n)}}catch(t){u.e(t)}finally{u.f()}}else if(null!=e){var h=C(e,Y);if(h&&h.isExternal){var c=h.targetPathString;if(null===c)return P("name");if(!this._externals.has(c))if(this.allowExternalFunctionFallbacks)this.mainContentContainer.namedContent.has(c)||n.add(c);else n.add(c)}}}},{key:"ObserveVariable",value:function(t,e){if(this.IfAsyncWeCant("observe a new variable"),null===this._variableObservers&&(this._variableObservers=new Map),!this.state.variablesState.GlobalVariableExistsWithName(t))throw new Error("Cannot observe variable '"+t+"' because it wasn't declared in the ink story.");this._variableObservers.has(t)?this._variableObservers.get(t).push(e):this._variableObservers.set(t,[e])}},{key:"ObserveVariables",value:function(t,e){for(var n=0,i=t.length;n=e.container.content.length;){t=!1;var n=C(e.container.parent,K);if(n instanceof K==!1)break;var i=n.content.indexOf(e.container);if(-1==i)break;if((e=new $(n,i)).index++,t=!0,null===e.container)return P("pointer.container")}return t||(e=$.Null),this.state.callStack.currentElement.currentPointer=e.copy(),t}},{key:"TryFollowDefaultInvisibleChoice",value:function(){var t=this._state.currentChoices,e=t.filter((function(t){return t.isInvisibleDefault}));if(0==e.length||t.length>e.length)return!1;var n=e[0];return null===n.targetPath?P("choice.targetPath"):null===n.threadAtGeneration?P("choice.threadAtGeneration"):(this.state.callStack.currentThread=n.threadAtGeneration,null!==this._stateSnapshotAtLastNewline&&(this.state.callStack.currentThread=this.state.callStack.ForkThread()),this.ChoosePath(n.targetPath,!1),!0)}},{key:"NextSequenceShuffleIndex",value:function(){var t=C(this.state.PopEvaluationStack(),D);if(!(t instanceof D))return this.Error("expected number of elements in sequence for shuffle index"),0;var e=this.state.currentPointer.container;if(null===e)return P("seqContainer");if(null===t.value)return P("numElementsIntVal.value");var n=t.value,i=b(this.state.PopEvaluationStack(),D).value;if(null===i)return P("seqCount");for(var r=i/n,a=i%n,s=e.path.toString(),o=0,u=0,l=s.length;u1&&void 0!==arguments[1]&&arguments[1],n=new x(t);throw n.useEndLineNumber=e,n}},{key:"Warning",value:function(t){this.AddError(t,!0)}},{key:"AddError",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.currentDebugMetadata,r=e?"WARNING":"ERROR";if(null!=i){var a=n?i.endLineNumber:i.startLineNumber;t="RUNTIME "+r+": '"+i.fileName+"' line "+a+": "+t}else t=this.state.currentPointer.isNull?"RUNTIME "+r+": "+t:"RUNTIME "+r+": ("+this.state.currentPointer+"): "+t;this.state.AddError(t,e),e||this.state.ForceEnd()}},{key:"Assert",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(0==t)throw null==e&&(e="Story assert"),new Error(e+" "+this.currentDebugMetadata)}},{key:"currentDebugMetadata",get:function(){var t,e=this.state.currentPointer;if(!e.isNull&&null!==e.Resolve()&&null!==(t=e.Resolve().debugMetadata))return t;for(var n=this.state.callStack.elements.length-1;n>=0;--n)if(!(e=this.state.callStack.elements[n].currentPointer).isNull&&null!==e.Resolve()&&null!==(t=e.Resolve().debugMetadata))return t;for(var i=this.state.outputStream.length-1;i>=0;--i){if(null!==(t=this.state.outputStream[i].debugMetadata))return t}return null}},{key:"mainContentContainer",get:function(){return this._temporaryEvaluationContainer?this._temporaryEvaluationContainer:this._mainContentContainer}}]),s}(N),t.Story.inkVersionCurrent=21,dt=t.Story||(t.Story={}),(pt=dt.OutputStateChange||(dt.OutputStateChange={}))[pt.NoChange=0]="NoChange",pt[pt.ExtendedBeyondNewline=1]="ExtendedBeyondNewline",pt[pt.NewlineRemoved=2]="NewlineRemoved",t.InkList=F,Object.defineProperty(t,"__esModule",{value:!0})})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).inkjs={})}(this,(function(t){"use strict";class e{constructor(){if(this._components=[],this._componentsString=null,this._isRelative=!1,"string"==typeof arguments[0]){let t=arguments[0];this.componentsString=t}else if(arguments[0]instanceof e.Component&&arguments[1]instanceof e){let t=arguments[0],e=arguments[1];this._components.push(t),this._components=this._components.concat(e._components)}else if(arguments[0]instanceof Array){let t=arguments[0],e=!!arguments[1];this._components=this._components.concat(t),this._isRelative=e}}get isRelative(){return this._isRelative}get componentCount(){return this._components.length}get head(){return this._components.length>0?this._components[0]:null}get tail(){if(this._components.length>=2){let t=this._components.slice(1,this._components.length);return new e(t)}return e.self}get length(){return this._components.length}get lastComponent(){let t=this._components.length-1;return t>=0?this._components[t]:null}get containsNamedComponent(){for(let t=0,e=this._components.length;t=0}get isParent(){return this.name==t.parentId}static ToParent(){return new e(t.parentId)}toString(){return this.isIndex?this.index.toString():this.name}Equals(t){return null!=t&&t.isIndex==this.isIndex&&(this.isIndex?this.index==t.index:this.name==t.name)}}t.Component=e}(e||(e={})),function(t){function e(t,e){if(!t)throw void 0!==e&&console.warn(e),console.trace&&console.trace(),new Error("")}t.AssertType=function(t,n,i){e(t instanceof n,i)},t.Assert=e}(n||(n={}));class d extends Error{}function p(t){throw new d(`${t} is null or undefined`)}class m{constructor(){this.parent=null,this._debugMetadata=null,this._path=null}get debugMetadata(){return null===this._debugMetadata&&this.parent?this.parent.debugMetadata:this._debugMetadata}set debugMetadata(t){this._debugMetadata=t}get ownDebugMetadata(){return this._debugMetadata}DebugLineNumberOfPath(t){if(null===t)return null;let e=this.rootContentContainer;if(e){let n=e.ContentAtPath(t).obj;if(n){let t=n.debugMetadata;if(null!==t)return t.startLineNumber}}return null}get path(){if(null==this._path)if(null==this.parent)this._path=new e;else{let t=[],n=this,i=s(n.parent,x);for(;null!==i;){let r=o(n);if(null!=r&&r.hasValidName){if(null===r.name)return p("namedChild.name");t.unshift(new e.Component(r.name))}else t.unshift(new e.Component(i.content.indexOf(n)));n=i,i=s(i.parent,x)}this._path=new e(t)}return this._path}ResolvePath(t){if(null===t)return p("path");if(t.isRelative){let e=s(this,x);return null===e&&(n.Assert(null!==this.parent,"Can't resolve relative path because we don't have a parent"),e=s(this.parent,x),n.Assert(null!==e,"Expected parent to be a container"),n.Assert(t.GetComponent(0).isParent),t=t.tail),null===e?p("nearestContainer"):e.ContentAtPath(t)}{let e=this.rootContentContainer;return null===e?p("contentContainer"):e.ContentAtPath(t)}}ConvertPathToRelative(t){let n=this.path,i=Math.min(t.length,n.length),r=-1;for(let e=0;e1?e-1:0),i=1;ivoid 0!==n[e]?n[e]:t))}toString(){return this.string}Clear(){this.string=""}}class g{constructor(){if(this.originName=null,this.itemName=null,void 0!==arguments[1]){let t=arguments[0],e=arguments[1];this.originName=t,this.itemName=e}else if(arguments[0]){let t=arguments[0].toString().split(".");this.originName=t[0],this.itemName=t[1]}}static get Null(){return new g(null,null)}get isNull(){return null==this.originName&&null==this.itemName}get fullName(){return(null!==this.originName?this.originName:"?")+"."+this.itemName}toString(){return this.fullName}Equals(t){if(t instanceof g){let e=t;return e.itemName==this.itemName&&e.originName==this.originName}return!1}copy(){return new g(this.originName,this.itemName)}serialized(){return JSON.stringify({originName:this.originName,itemName:this.itemName})}static fromSerializedKey(t){let e=JSON.parse(t);if(!g.isLikeInkListItem(e))return g.Null;let n=e;return new g(n.originName,n.itemName)}static isLikeInkListItem(t){return"object"==typeof t&&(!(!t.hasOwnProperty("originName")||!t.hasOwnProperty("itemName"))&&(("string"==typeof t.originName||null===typeof t.originName)&&("string"==typeof t.itemName||null===typeof t.itemName)))}}class S extends Map{constructor(){if(super(arguments[0]instanceof S?arguments[0]:[]),this.origins=null,this._originNames=[],arguments[0]instanceof S){let t=arguments[0],e=t.originNames;null!==e&&(this._originNames=e.slice()),null!==t.origins&&(this.origins=t.origins.slice())}else if("string"==typeof arguments[0]){let t=arguments[0],e=arguments[1];if(this.SetInitialOriginName(t),null===e.listDefinitions)return p("originStory.listDefinitions");let n=e.listDefinitions.TryListGetDefinition(t,null);if(!n.exists)throw new Error("InkList origin could not be found in story when constructing new list: "+t);if(null===n.result)return p("def.result");this.origins=[n.result]}else if("object"==typeof arguments[0]&&arguments[0].hasOwnProperty("Key")&&arguments[0].hasOwnProperty("Value")){let t=arguments[0];this.Add(t.Key,t.Value)}}static FromString(t,e){var n;let i=null===(n=e.listDefinitions)||void 0===n?void 0:n.FindSingleItemListWithName(t);if(i)return null===i.value?p("listValue.value"):new S(i.value);throw new Error("Could not find the InkListItem from the string '"+t+"' to create an InkList because it doesn't exist in the original list definition in ink.")}AddItem(t){if(t instanceof g){let e=t;if(null==e.originName)return void this.AddItem(e.itemName);if(null===this.origins)return p("this.origins");for(let t of this.origins)if(t.name==e.originName){let n=t.TryGetValueForItem(e,0);if(n.exists)return void this.Add(e,n.result);throw new Error("Could not add the item "+e+" to this list because it doesn't exist in the original list definition in ink.")}throw new Error("Failed to add item to list because the item was from a new list definition that wasn't previously known to this list. Only items from previously known lists can be used, so that the int value can be found.")}{let e=t,n=null;if(null===this.origins)return p("this.origins");for(let t of this.origins){if(null===e)return p("itemName");if(t.ContainsItemWithName(e)){if(null!=n)throw new Error("Could not add the item "+e+" to this list because it could come from either "+t.name+" or "+n.name);n=t}}if(null==n)throw new Error("Could not add the item "+e+" to this list because it isn't known to any list definitions previously associated with this list.");let i=new g(n.name,e),r=n.ValueForItem(i);this.Add(i,r)}}ContainsItemNamed(t){for(let[e]of this){if(g.fromSerializedKey(e).itemName==t)return!0}return!1}ContainsKey(t){return this.has(t.serialized())}Add(t,e){let n=t.serialized();if(this.has(n))throw new Error(`The Map already contains an entry for ${t}`);this.set(n,e)}Remove(t){return this.delete(t.serialized())}get Count(){return this.size}get originOfMaxItem(){if(null==this.origins)return null;let t=this.maxItem.Key.originName,e=null;return this.origins.every((n=>n.name!=t||(e=n,!1))),e}get originNames(){if(this.Count>0){null==this._originNames&&this.Count>0?this._originNames=[]:(this._originNames||(this._originNames=[]),this._originNames.length=0);for(let[t]of this){let e=g.fromSerializedKey(t);if(null===e.originName)return p("item.originName");this._originNames.push(e.originName)}}return this._originNames}SetInitialOriginName(t){this._originNames=[t]}SetInitialOriginNames(t){this._originNames=null==t?null:t.slice()}get maxItem(){let t={Key:g.Null,Value:0};for(let[e,n]of this){let i=g.fromSerializedKey(e);(t.Key.isNull||n>t.Value)&&(t={Key:i,Value:n})}return t}get minItem(){let t={Key:g.Null,Value:0};for(let[e,n]of this){let i=g.fromSerializedKey(e);(t.Key.isNull||nt.maxItem.Value)}GreaterThanOrEquals(t){return 0!=this.Count&&(0==t.Count||this.minItem.Value>=t.minItem.Value&&this.maxItem.Value>=t.maxItem.Value)}LessThan(t){return 0!=t.Count&&(0==this.Count||this.maxItem.Value0?new S(this.maxItem):new S}MinAsList(){return this.Count>0?new S(this.minItem):new S}ListWithSubRange(t,e){if(0==this.Count)return new S;let n=this.orderedItems,i=0,r=Number.MAX_SAFE_INTEGER;Number.isInteger(t)?i=t:t instanceof S&&t.Count>0&&(i=t.minItem.Value),Number.isInteger(e)?r=e:e instanceof S&&e.Count>0&&(r=e.maxItem.Value);let a=new S;a.SetInitialOriginNames(this.originNames);for(let t of n)t.Value>=i&&t.Value<=r&&a.Add(t.Key,t.Value);return a}Equals(t){if(t instanceof S==!1)return!1;if(t.Count!=this.Count)return!1;for(let[e]of this)if(!t.has(e))return!1;return!0}get orderedItems(){let t=new Array;for(let[e,n]of this){let i=g.fromSerializedKey(e);t.push({Key:i,Value:n})}return t.sort(((t,e)=>null===t.Key.originName?p("x.Key.originName"):null===e.Key.originName?p("y.Key.originName"):t.Value==e.Value?t.Key.originName.localeCompare(e.Key.originName):t.Valuee.Value?1:0)),t}toString(){let t=this.orderedItems,e=new f;for(let n=0;n0&&e.Append(", ");let i=t[n].Key;if(null===i.itemName)return p("item.itemName");e.Append(i.itemName)}return e.toString()}valueOf(){return NaN}}class y extends Error{constructor(t){super(t),this.useEndLineNumber=!1,this.message=t,this.name="StoryException"}}function v(t,e,n){if(null===t)return{result:n,exists:!1};let i=t.get(e);return void 0===i?{result:n,exists:!1}:{result:i,exists:!0}}class C extends m{static Create(t,n){if(n){if(n===i.Int&&Number.isInteger(Number(t)))return new w(Number(t));if(n===i.Float&&!isNaN(t))return new T(Number(t))}return"boolean"==typeof t?new _(Boolean(t)):"string"==typeof t?new E(String(t)):Number.isInteger(Number(t))?new w(Number(t)):isNaN(t)?t instanceof e?new P(l(t,e)):t instanceof S?new O(l(t,S)):null:new T(Number(t))}Copy(){return l(C.Create(this.valueObject),m)}BadCastException(t){return new y("Can't cast "+this.valueObject+" from "+this.valueType+" to "+t)}}class b extends C{constructor(t){super(),this.value=t}get valueObject(){return this.value}toString(){return null===this.value?p("Value.value"):this.value.toString()}}class _ extends b{constructor(t){super(t||!1)}get isTruthy(){return Boolean(this.value)}get valueType(){return i.Bool}Cast(t){if(null===this.value)return p("Value.value");if(t==this.valueType)return this;if(t==i.Int)return new w(this.value?1:0);if(t==i.Float)return new T(this.value?1:0);if(t==i.String)return new E(this.value?"true":"false");throw this.BadCastException(t)}toString(){return this.value?"true":"false"}}class w extends b{constructor(t){super(t||0)}get isTruthy(){return 0!=this.value}get valueType(){return i.Int}Cast(t){if(null===this.value)return p("Value.value");if(t==this.valueType)return this;if(t==i.Bool)return new _(0!==this.value);if(t==i.Float)return new T(this.value);if(t==i.String)return new E(""+this.value);throw this.BadCastException(t)}}class T extends b{constructor(t){super(t||0)}get isTruthy(){return 0!=this.value}get valueType(){return i.Float}Cast(t){if(null===this.value)return p("Value.value");if(t==this.valueType)return this;if(t==i.Bool)return new _(0!==this.value);if(t==i.Int)return new w(this.value);if(t==i.String)return new E(""+this.value);throw this.BadCastException(t)}}class E extends b{constructor(t){if(super(t||""),this._isNewline="\n"==this.value,this._isInlineWhitespace=!0,null===this.value)return p("Value.value");this.value.length>0&&this.value.split("").every((t=>" "==t||"\t"==t||(this._isInlineWhitespace=!1,!1)))}get valueType(){return i.String}get isTruthy(){return null===this.value?p("Value.value"):this.value.length>0}get isNewline(){return this._isNewline}get isInlineWhitespace(){return this._isInlineWhitespace}get isNonWhitespace(){return!this.isNewline&&!this.isInlineWhitespace}Cast(t){if(t==this.valueType)return this;if(t==i.Int){let e=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=parseInt(t);return Number.isNaN(n)?{result:e,exists:!1}:{result:n,exists:!0}}(this.value);if(e.exists)return new w(e.result);throw this.BadCastException(t)}if(t==i.Float){let e=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=parseFloat(t);return Number.isNaN(n)?{result:e,exists:!1}:{result:n,exists:!0}}(this.value);if(e.exists)return new T(e.result);throw this.BadCastException(t)}throw this.BadCastException(t)}}class P extends b{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)}get valueType(){return i.DivertTarget}get targetPath(){return null===this.value?p("Value.value"):this.value}set targetPath(t){this.value=t}get isTruthy(){throw new Error("Shouldn't be checking the truthiness of a divert target")}Cast(t){if(t==this.valueType)return this;throw this.BadCastException(t)}toString(){return"DivertTargetValue("+this.targetPath+")"}}class N extends b{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;super(t),this._contextIndex=e}get contextIndex(){return this._contextIndex}set contextIndex(t){this._contextIndex=t}get variableName(){return null===this.value?p("Value.value"):this.value}set variableName(t){this.value=t}get valueType(){return i.VariablePointer}get isTruthy(){throw new Error("Shouldn't be checking the truthiness of a variable pointer")}Cast(t){if(t==this.valueType)return this;throw this.BadCastException(t)}toString(){return"VariablePointerValue("+this.variableName+")"}Copy(){return new N(this.variableName,this.contextIndex)}}class O extends b{get isTruthy(){return null===this.value?p("this.value"):this.value.Count>0}get valueType(){return i.List}Cast(t){if(null===this.value)return p("Value.value");if(t==i.Int){let t=this.value.maxItem;return t.Key.isNull?new w(0):new w(t.Value)}if(t==i.Float){let t=this.value.maxItem;return t.Key.isNull?new T(0):new T(t.Value)}if(t==i.String){let t=this.value.maxItem;return t.Key.isNull?new E(""):new E(t.Key.toString())}if(t==this.valueType)return this;throw this.BadCastException(t)}constructor(t,e){super(null),t||e?t instanceof S?this.value=new S(t):t instanceof g&&"number"==typeof e&&(this.value=new S({Key:t,Value:e})):this.value=new S}static RetainListOriginsForAssignment(t,e){let n=s(t,O),i=s(e,O);return i&&null===i.value?p("newList.value"):n&&null===n.value?p("oldList.value"):void(n&&i&&0==i.value.Count&&i.value.SetInitialOriginNames(n.value.originNames))}}!function(t){t[t.Bool=-1]="Bool",t[t.Int=0]="Int",t[t.Float=1]="Float",t[t.List=2]="List",t[t.String=3]="String",t[t.DivertTarget=4]="DivertTarget",t[t.VariablePointer=5]="VariablePointer"}(i||(i={}));class A{constructor(){this.obj=null,this.approximate=!1}get correctObj(){return this.approximate?null:this.obj}get container(){return this.obj instanceof x?this.obj:null}copy(){let t=new A;return t.obj=this.obj,t.approximate=this.approximate,t}}class x extends m{constructor(){super(...arguments),this.name=null,this._content=[],this.namedContent=new Map,this.visitsShouldBeCounted=!1,this.turnIndexShouldBeCounted=!1,this.countingAtStartOnly=!1,this._pathToFirstLeafContent=null}get hasValidName(){return null!=this.name&&this.name.length>0}get content(){return this._content}set content(t){this.AddContent(t)}get namedOnlyContent(){let t=new Map;for(let[e,n]of this.namedContent){let i=l(n,m);t.set(e,i)}for(let e of this.content){let n=o(e);null!=n&&n.hasValidName&&t.delete(n.name)}return 0==t.size&&(t=null),t}set namedOnlyContent(t){let e=this.namedOnlyContent;if(null!=e)for(let[t]of e)this.namedContent.delete(t);if(null!=t)for(let[,e]of t){let t=o(e);null!=t&&this.AddToNamedContentOnly(t)}}get countFlags(){let t=0;return this.visitsShouldBeCounted&&(t|=x.CountFlags.Visits),this.turnIndexShouldBeCounted&&(t|=x.CountFlags.Turns),this.countingAtStartOnly&&(t|=x.CountFlags.CountStartOnly),t==x.CountFlags.CountStartOnly&&(t=0),t}set countFlags(t){let e=t;(e&x.CountFlags.Visits)>0&&(this.visitsShouldBeCounted=!0),(e&x.CountFlags.Turns)>0&&(this.turnIndexShouldBeCounted=!0),(e&x.CountFlags.CountStartOnly)>0&&(this.countingAtStartOnly=!0)}get pathToFirstLeafContent(){return null==this._pathToFirstLeafContent&&(this._pathToFirstLeafContent=this.path.PathByAppendingPath(this.internalPathToFirstLeafContent)),this._pathToFirstLeafContent}get internalPathToFirstLeafContent(){let t=[],n=this;for(;n instanceof x;)n.content.length>0&&(t.push(new e.Component(0)),n=n.content[0]);return new e(t)}AddContent(t){if(t instanceof Array){let e=t;for(let t of e)this.AddContent(t)}else{let e=t;if(this._content.push(e),e.parent)throw new Error("content is already in "+e.parent);e.parent=this,this.TryAddNamedContent(e)}}TryAddNamedContent(t){let e=o(t);null!=e&&e.hasValidName&&this.AddToNamedContentOnly(e)}AddToNamedContentOnly(t){if(n.AssertType(t,m,"Can only add Runtime.Objects to a Runtime.Container"),l(t,m).parent=this,null===t.name)return p("namedContentObj.name");this.namedContent.set(t.name,t)}ContentAtPath(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;-1==n&&(n=t.length);let i=new A;i.approximate=!1;let r=this,a=this;for(let l=e;l=0&&t.index=0||a.set(t,e);if(a.size>0){r(),t.AppendLine("-- named: --");for(let[,r]of a){n.AssertType(r,x,"Can only print out named Containers"),r.BuildStringOfHierarchy(t,e,i),t.AppendLine()}}e--,r(),t.Append("]")}}!function(t){var e;(e=t.CountFlags||(t.CountFlags={}))[e.Start=0]="Start",e[e.Visits=1]="Visits",e[e.Turns=2]="Turns",e[e.CountStartOnly=4]="CountStartOnly"}(x||(x={}));class I extends m{toString(){return"Glue"}}class k extends m{get commandType(){return this._commandType}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:k.CommandType.NotSet;super(),this._commandType=t}Copy(){return new k(this.commandType)}static EvalStart(){return new k(k.CommandType.EvalStart)}static EvalOutput(){return new k(k.CommandType.EvalOutput)}static EvalEnd(){return new k(k.CommandType.EvalEnd)}static Duplicate(){return new k(k.CommandType.Duplicate)}static PopEvaluatedValue(){return new k(k.CommandType.PopEvaluatedValue)}static PopFunction(){return new k(k.CommandType.PopFunction)}static PopTunnel(){return new k(k.CommandType.PopTunnel)}static BeginString(){return new k(k.CommandType.BeginString)}static EndString(){return new k(k.CommandType.EndString)}static NoOp(){return new k(k.CommandType.NoOp)}static ChoiceCount(){return new k(k.CommandType.ChoiceCount)}static Turns(){return new k(k.CommandType.Turns)}static TurnsSince(){return new k(k.CommandType.TurnsSince)}static ReadCount(){return new k(k.CommandType.ReadCount)}static Random(){return new k(k.CommandType.Random)}static SeedRandom(){return new k(k.CommandType.SeedRandom)}static VisitIndex(){return new k(k.CommandType.VisitIndex)}static SequenceShuffleIndex(){return new k(k.CommandType.SequenceShuffleIndex)}static StartThread(){return new k(k.CommandType.StartThread)}static Done(){return new k(k.CommandType.Done)}static End(){return new k(k.CommandType.End)}static ListFromInt(){return new k(k.CommandType.ListFromInt)}static ListRange(){return new k(k.CommandType.ListRange)}static ListRandom(){return new k(k.CommandType.ListRandom)}static BeginTag(){return new k(k.CommandType.BeginTag)}static EndTag(){return new k(k.CommandType.EndTag)}toString(){return"ControlCommand "+this.commandType.toString()}}!function(t){var e;(e=t.CommandType||(t.CommandType={}))[e.NotSet=-1]="NotSet",e[e.EvalStart=0]="EvalStart",e[e.EvalOutput=1]="EvalOutput",e[e.EvalEnd=2]="EvalEnd",e[e.Duplicate=3]="Duplicate",e[e.PopEvaluatedValue=4]="PopEvaluatedValue",e[e.PopFunction=5]="PopFunction",e[e.PopTunnel=6]="PopTunnel",e[e.BeginString=7]="BeginString",e[e.EndString=8]="EndString",e[e.NoOp=9]="NoOp",e[e.ChoiceCount=10]="ChoiceCount",e[e.Turns=11]="Turns",e[e.TurnsSince=12]="TurnsSince",e[e.ReadCount=13]="ReadCount",e[e.Random=14]="Random",e[e.SeedRandom=15]="SeedRandom",e[e.VisitIndex=16]="VisitIndex",e[e.SequenceShuffleIndex=17]="SequenceShuffleIndex",e[e.StartThread=18]="StartThread",e[e.Done=19]="Done",e[e.End=20]="End",e[e.ListFromInt=21]="ListFromInt",e[e.ListRange=22]="ListRange",e[e.ListRandom=23]="ListRandom",e[e.BeginTag=24]="BeginTag",e[e.EndTag=25]="EndTag",e[e.TOTAL_VALUES=26]="TOTAL_VALUES"}(k||(k={})),function(t){t[t.Tunnel=0]="Tunnel",t[t.Function=1]="Function",t[t.FunctionEvaluationFromGame=2]="FunctionEvaluationFromGame"}(r||(r={}));class F{constructor(){this.container=null,this.index=-1,2===arguments.length&&(this.container=arguments[0],this.index=arguments[1])}Resolve(){return this.index<0?this.container:null==this.container?null:0==this.container.content.length?this.container:this.index>=this.container.content.length?null:this.container.content[this.index]}get isNull(){return null==this.container}get path(){return this.isNull?null:this.index>=0?this.container.path.PathByAppendingComponent(new e.Component(this.index)):this.container.path}toString(){return this.container?"Ink Pointer -> "+this.container.path.toString()+" -- index "+this.index:"Ink Pointer (null)"}copy(){return new F(this.container,this.index)}static StartOf(t){return new F(t,0)}static get Null(){return new F(null,-1)}}class W extends m{get targetPath(){if(null!=this._targetPath&&this._targetPath.isRelative){let t=this.targetPointer.Resolve();t&&(this._targetPath=t.path)}return this._targetPath}set targetPath(t){this._targetPath=t,this._targetPointer=F.Null}get targetPointer(){if(this._targetPointer.isNull){let t=this.ResolvePath(this._targetPath).obj;if(null===this._targetPath)return p("this._targetPath");if(null===this._targetPath.lastComponent)return p("this._targetPath.lastComponent");if(this._targetPath.lastComponent.isIndex){if(null===t)return p("targetObj");this._targetPointer.container=t.parent instanceof x?t.parent:null,this._targetPointer.index=this._targetPath.lastComponent.index}else this._targetPointer=F.StartOf(t instanceof x?t:null)}return this._targetPointer.copy()}get targetPathString(){return null==this.targetPath?null:this.CompactPathString(this.targetPath)}set targetPathString(t){this.targetPath=null==t?null:new e(t)}get hasVariableTarget(){return null!=this.variableDivertName}constructor(t){super(),this._targetPath=null,this._targetPointer=F.Null,this.variableDivertName=null,this.pushesToStack=!1,this.stackPushType=0,this.isExternal=!1,this.externalArgs=0,this.isConditional=!1,this.pushesToStack=!1,void 0!==t&&(this.pushesToStack=!0,this.stackPushType=t)}Equals(t){let e=t;return e instanceof W&&this.hasVariableTarget==e.hasVariableTarget&&(this.hasVariableTarget?this.variableDivertName==e.variableDivertName:null===this.targetPath?p("this.targetPath"):this.targetPath.Equals(e.targetPath))}toString(){if(this.hasVariableTarget)return"Divert(variable: "+this.variableDivertName+")";if(null==this.targetPath)return"Divert(null)";{let t=new f,e=this.targetPath.toString();return t.Append("Divert"),this.isConditional&&t.Append("?"),this.pushesToStack&&(this.stackPushType==r.Function?t.Append(" function"):t.Append(" tunnel")),t.Append(" -> "),t.Append(this.targetPathString),t.Append(" ("),t.Append(e),t.Append(")"),t.toString()}}}class V extends m{constructor(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];super(),this._pathOnChoice=null,this.hasCondition=!1,this.hasStartContent=!1,this.hasChoiceOnlyContent=!1,this.isInvisibleDefault=!1,this.onceOnly=!0,this.onceOnly=t}get pathOnChoice(){if(null!=this._pathOnChoice&&this._pathOnChoice.isRelative){let t=this.choiceTarget;t&&(this._pathOnChoice=t.path)}return this._pathOnChoice}set pathOnChoice(t){this._pathOnChoice=t}get choiceTarget(){return null===this._pathOnChoice?p("ChoicePoint._pathOnChoice"):this.ResolvePath(this._pathOnChoice).container}get pathStringOnChoice(){return null===this.pathOnChoice?p("ChoicePoint.pathOnChoice"):this.CompactPathString(this.pathOnChoice)}set pathStringOnChoice(t){this.pathOnChoice=new e(t)}get flags(){let t=0;return this.hasCondition&&(t|=1),this.hasStartContent&&(t|=2),this.hasChoiceOnlyContent&&(t|=4),this.isInvisibleDefault&&(t|=8),this.onceOnly&&(t|=16),t}set flags(t){this.hasCondition=(1&t)>0,this.hasStartContent=(2&t)>0,this.hasChoiceOnlyContent=(4&t)>0,this.isInvisibleDefault=(8&t)>0,this.onceOnly=(16&t)>0}toString(){if(null===this.pathOnChoice)return p("ChoicePoint.pathOnChoice");return"Choice: -> "+this.pathOnChoice.toString()}}class L extends m{get containerForCount(){return null===this.pathForCount?null:this.ResolvePath(this.pathForCount).container}get pathStringForCount(){return null===this.pathForCount?null:this.CompactPathString(this.pathForCount)}set pathStringForCount(t){this.pathForCount=null===t?null:new e(t)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;super(),this.pathForCount=null,this.name=t}toString(){if(null!=this.name)return"var("+this.name+")";return"read_count("+this.pathStringForCount+")"}}class R extends m{constructor(t,e){super(),this.variableName=t||null,this.isNewDeclaration=!!e,this.isGlobal=!1}toString(){return"VarAssign to "+this.variableName}}class D extends m{toString(){return"Void"}}class j extends m{static CallWithName(t){return new j(t)}static CallExistsWithName(t){return this.GenerateNativeFunctionsIfNecessary(),this._nativeFunctions.get(t)}get name(){return null===this._name?p("NativeFunctionCall._name"):this._name}set name(t){this._name=t,this._isPrototype||(null===j._nativeFunctions?p("NativeFunctionCall._nativeFunctions"):this._prototype=j._nativeFunctions.get(this._name)||null)}get numberOfParameters(){return this._prototype?this._prototype.numberOfParameters:this._numberOfParameters}set numberOfParameters(t){this._numberOfParameters=t}Call(t){if(this._prototype)return this._prototype.Call(t);if(this.numberOfParameters!=t.length)throw new Error("Unexpected number of parameters");let e=!1;for(let n of t){if(n instanceof D)throw new y('Attempting to perform operation on a void value. Did you forget to "return" a value from a function you called here?');n instanceof O&&(e=!0)}if(2==t.length&&e)return this.CallBinaryListOperation(t);let n=this.CoerceValuesToSingleType(t),r=n[0].valueType;return r==i.Int||r==i.Float||r==i.String||r==i.DivertTarget||r==i.List?this.CallType(n):null}CallType(t){let e=l(t[0],b),n=e.valueType,r=e,a=t.length;if(2==a||1==a){if(null===this._operationFuncs)return p("NativeFunctionCall._operationFuncs");let s=this._operationFuncs.get(n);if(!s){const t=i[n];throw new y("Cannot perform operation "+this.name+" on "+t)}if(2==a){let e=l(t[1],b),n=s;if(null===r.value||null===e.value)return p("NativeFunctionCall.Call BinaryOp values");let i=n(r.value,e.value);return b.Create(i)}{let t=s;if(null===r.value)return p("NativeFunctionCall.Call UnaryOp value");let n=t(r.value);return this.name===j.Int?b.Create(n,i.Int):this.name===j.Float?b.Create(n,i.Float):b.Create(n,e.valueType)}}throw new Error("Unexpected number of parameters to NativeFunctionCall: "+t.length)}CallBinaryListOperation(t){if(("+"==this.name||"-"==this.name)&&t[0]instanceof O&&t[1]instanceof w)return this.CallListIncrementOperation(t);let e=l(t[0],b),n=l(t[1],b);if(!("&&"!=this.name&&"||"!=this.name||e.valueType==i.List&&n.valueType==i.List)){if(null===this._operationFuncs)return p("NativeFunctionCall._operationFuncs");let t=this._operationFuncs.get(i.Int);if(null===t)return p("NativeFunctionCall.CallBinaryListOperation op");let r=function(t){if("boolean"==typeof t)return t;throw new Error(`${t} is not a boolean`)}(t(e.isTruthy?1:0,n.isTruthy?1:0));return new _(r)}if(e.valueType==i.List&&n.valueType==i.List)return this.CallType([e,n]);throw new y("Can not call use "+this.name+" operation on "+i[e.valueType]+" and "+i[n.valueType])}CallListIncrementOperation(t){let e=l(t[0],O),n=l(t[1],w),r=new S;if(null===e.value)return p("NativeFunctionCall.CallListIncrementOperation listVal.value");for(let[t,a]of e.value){let s=g.fromSerializedKey(t);if(null===this._operationFuncs)return p("NativeFunctionCall._operationFuncs");let l=this._operationFuncs.get(i.Int);if(null===n.value)return p("NativeFunctionCall.CallListIncrementOperation intVal.value");let o=l(a,n.value),h=null;if(null===e.value.origins)return p("NativeFunctionCall.CallListIncrementOperation listVal.value.origins");for(let t of e.value.origins)if(t.name==s.originName){h=t;break}if(null!=h){let t=h.TryGetItemWithValue(o,g.Null);t.exists&&r.Add(t.result,o)}}return new O(r)}CoerceValuesToSingleType(t){let e=i.Int,n=null;for(let r of t){let t=l(r,b);t.valueType>e&&(e=t.valueType),t.valueType==i.List&&(n=s(t,O))}let r=[];if(i[e]==i[i.List])for(let e of t){let t=l(e,b);if(t.valueType==i.List)r.push(t);else{if(t.valueType!=i.Int){const e=i[t.valueType];throw new y("Cannot mix Lists and "+e+" values in this operation")}{let e=parseInt(t.valueObject);if(n=l(n,O),null===n.value)return p("NativeFunctionCall.CoerceValuesToSingleType specialCaseList.value");let i=n.value.originOfMaxItem;if(null===i)return p("NativeFunctionCall.CoerceValuesToSingleType list");let a=i.TryGetItemWithValue(e,g.Null);if(!a.exists)throw new y("Could not find List item with the value "+e+" in "+i.name);{let t=new O(a.result,e);r.push(t)}}}}else for(let n of t){let t=l(n,b).Cast(e);r.push(t)}return r}constructor(){if(super(),this._name=null,this._numberOfParameters=0,this._prototype=null,this._isPrototype=!1,this._operationFuncs=null,0===arguments.length)j.GenerateNativeFunctionsIfNecessary();else if(1===arguments.length){let t=arguments[0];j.GenerateNativeFunctionsIfNecessary(),this.name=t}else if(2===arguments.length){let t=arguments[0],e=arguments[1];this._isPrototype=!0,this.name=t,this.numberOfParameters=e}}static Identity(t){return t}static GenerateNativeFunctionsIfNecessary(){if(null==this._nativeFunctions){this._nativeFunctions=new Map,this.AddIntBinaryOp(this.Add,((t,e)=>t+e)),this.AddIntBinaryOp(this.Subtract,((t,e)=>t-e)),this.AddIntBinaryOp(this.Multiply,((t,e)=>t*e)),this.AddIntBinaryOp(this.Divide,((t,e)=>Math.floor(t/e))),this.AddIntBinaryOp(this.Mod,((t,e)=>t%e)),this.AddIntUnaryOp(this.Negate,(t=>-t)),this.AddIntBinaryOp(this.Equal,((t,e)=>t==e)),this.AddIntBinaryOp(this.Greater,((t,e)=>t>e)),this.AddIntBinaryOp(this.Less,((t,e)=>tt>=e)),this.AddIntBinaryOp(this.LessThanOrEquals,((t,e)=>t<=e)),this.AddIntBinaryOp(this.NotEquals,((t,e)=>t!=e)),this.AddIntUnaryOp(this.Not,(t=>0==t)),this.AddIntBinaryOp(this.And,((t,e)=>0!=t&&0!=e)),this.AddIntBinaryOp(this.Or,((t,e)=>0!=t||0!=e)),this.AddIntBinaryOp(this.Max,((t,e)=>Math.max(t,e))),this.AddIntBinaryOp(this.Min,((t,e)=>Math.min(t,e))),this.AddIntBinaryOp(this.Pow,((t,e)=>Math.pow(t,e))),this.AddIntUnaryOp(this.Floor,j.Identity),this.AddIntUnaryOp(this.Ceiling,j.Identity),this.AddIntUnaryOp(this.Int,j.Identity),this.AddIntUnaryOp(this.Float,(t=>t)),this.AddFloatBinaryOp(this.Add,((t,e)=>t+e)),this.AddFloatBinaryOp(this.Subtract,((t,e)=>t-e)),this.AddFloatBinaryOp(this.Multiply,((t,e)=>t*e)),this.AddFloatBinaryOp(this.Divide,((t,e)=>t/e)),this.AddFloatBinaryOp(this.Mod,((t,e)=>t%e)),this.AddFloatUnaryOp(this.Negate,(t=>-t)),this.AddFloatBinaryOp(this.Equal,((t,e)=>t==e)),this.AddFloatBinaryOp(this.Greater,((t,e)=>t>e)),this.AddFloatBinaryOp(this.Less,((t,e)=>tt>=e)),this.AddFloatBinaryOp(this.LessThanOrEquals,((t,e)=>t<=e)),this.AddFloatBinaryOp(this.NotEquals,((t,e)=>t!=e)),this.AddFloatUnaryOp(this.Not,(t=>0==t)),this.AddFloatBinaryOp(this.And,((t,e)=>0!=t&&0!=e)),this.AddFloatBinaryOp(this.Or,((t,e)=>0!=t||0!=e)),this.AddFloatBinaryOp(this.Max,((t,e)=>Math.max(t,e))),this.AddFloatBinaryOp(this.Min,((t,e)=>Math.min(t,e))),this.AddFloatBinaryOp(this.Pow,((t,e)=>Math.pow(t,e))),this.AddFloatUnaryOp(this.Floor,(t=>Math.floor(t))),this.AddFloatUnaryOp(this.Ceiling,(t=>Math.ceil(t))),this.AddFloatUnaryOp(this.Int,(t=>Math.floor(t))),this.AddFloatUnaryOp(this.Float,j.Identity),this.AddStringBinaryOp(this.Add,((t,e)=>t+e)),this.AddStringBinaryOp(this.Equal,((t,e)=>t===e)),this.AddStringBinaryOp(this.NotEquals,((t,e)=>!(t===e))),this.AddStringBinaryOp(this.Has,((t,e)=>t.includes(e))),this.AddStringBinaryOp(this.Hasnt,((t,e)=>!t.includes(e))),this.AddListBinaryOp(this.Add,((t,e)=>t.Union(e))),this.AddListBinaryOp(this.Subtract,((t,e)=>t.Without(e))),this.AddListBinaryOp(this.Has,((t,e)=>t.Contains(e))),this.AddListBinaryOp(this.Hasnt,((t,e)=>!t.Contains(e))),this.AddListBinaryOp(this.Intersect,((t,e)=>t.Intersect(e))),this.AddListBinaryOp(this.Equal,((t,e)=>t.Equals(e))),this.AddListBinaryOp(this.Greater,((t,e)=>t.GreaterThan(e))),this.AddListBinaryOp(this.Less,((t,e)=>t.LessThan(e))),this.AddListBinaryOp(this.GreaterThanOrEquals,((t,e)=>t.GreaterThanOrEquals(e))),this.AddListBinaryOp(this.LessThanOrEquals,((t,e)=>t.LessThanOrEquals(e))),this.AddListBinaryOp(this.NotEquals,((t,e)=>!t.Equals(e))),this.AddListBinaryOp(this.And,((t,e)=>t.Count>0&&e.Count>0)),this.AddListBinaryOp(this.Or,((t,e)=>t.Count>0||e.Count>0)),this.AddListUnaryOp(this.Not,(t=>0==t.Count?1:0)),this.AddListUnaryOp(this.Invert,(t=>t.inverse)),this.AddListUnaryOp(this.All,(t=>t.all)),this.AddListUnaryOp(this.ListMin,(t=>t.MinAsList())),this.AddListUnaryOp(this.ListMax,(t=>t.MaxAsList())),this.AddListUnaryOp(this.Count,(t=>t.Count)),this.AddListUnaryOp(this.ValueOfList,(t=>t.maxItem.Value));let t=(t,e)=>t.Equals(e),e=(t,e)=>!t.Equals(e);this.AddOpToNativeFunc(this.Equal,2,i.DivertTarget,t),this.AddOpToNativeFunc(this.NotEquals,2,i.DivertTarget,e)}}AddOpFuncForType(t,e){null==this._operationFuncs&&(this._operationFuncs=new Map),this._operationFuncs.set(t,e)}static AddOpToNativeFunc(t,e,n,i){if(null===this._nativeFunctions)return p("NativeFunctionCall._nativeFunctions");let r=this._nativeFunctions.get(t);r||(r=new j(t,e),this._nativeFunctions.set(t,r)),r.AddOpFuncForType(n,i)}static AddIntBinaryOp(t,e){this.AddOpToNativeFunc(t,2,i.Int,e)}static AddIntUnaryOp(t,e){this.AddOpToNativeFunc(t,1,i.Int,e)}static AddFloatBinaryOp(t,e){this.AddOpToNativeFunc(t,2,i.Float,e)}static AddFloatUnaryOp(t,e){this.AddOpToNativeFunc(t,1,i.Float,e)}static AddStringBinaryOp(t,e){this.AddOpToNativeFunc(t,2,i.String,e)}static AddListBinaryOp(t,e){this.AddOpToNativeFunc(t,2,i.List,e)}static AddListUnaryOp(t,e){this.AddOpToNativeFunc(t,1,i.List,e)}toString(){return'Native "'+this.name+'"'}}j.Add="+",j.Subtract="-",j.Divide="/",j.Multiply="*",j.Mod="%",j.Negate="_",j.Equal="==",j.Greater=">",j.Less="<",j.GreaterThanOrEquals=">=",j.LessThanOrEquals="<=",j.NotEquals="!=",j.Not="!",j.And="&&",j.Or="||",j.Min="MIN",j.Max="MAX",j.Pow="POW",j.Floor="FLOOR",j.Ceiling="CEILING",j.Int="INT",j.Float="FLOAT",j.Has="?",j.Hasnt="!?",j.Intersect="^",j.ListMin="LIST_MIN",j.ListMax="LIST_MAX",j.All="LIST_ALL",j.Count="LIST_COUNT",j.ValueOfList="LIST_VALUE",j.Invert="LIST_INVERT",j._nativeFunctions=null;class B extends m{constructor(t){super(),this.text=t.toString()||""}toString(){return"# "+this.text}}class G extends m{constructor(){super(...arguments),this.text="",this.index=0,this.threadAtGeneration=null,this.sourcePath="",this.targetPath=null,this.isInvisibleDefault=!1,this.tags=null,this.originalThreadIndex=0}get pathStringOnChoice(){return null===this.targetPath?p("Choice.targetPath"):this.targetPath.toString()}set pathStringOnChoice(t){this.targetPath=new e(t)}}class M{constructor(t,e){this._name=t||"",this._items=null,this._itemNameToValues=e||new Map}get name(){return this._name}get items(){if(null==this._items){this._items=new Map;for(let[t,e]of this._itemNameToValues){let n=new g(this.name,t);this._items.set(n.serialized(),e)}}return this._items}ValueForItem(t){if(!t.itemName)return 0;let e=this._itemNameToValues.get(t.itemName);return void 0!==e?e:0}ContainsItem(t){return!!t.itemName&&(t.originName==this.name&&this._itemNameToValues.has(t.itemName))}ContainsItemWithName(t){return this._itemNameToValues.has(t)}TryGetItemWithValue(t,e){for(let[e,n]of this._itemNameToValues)if(n==t)return{result:new g(this.name,e),exists:!0};return{result:g.Null,exists:!1}}TryGetValueForItem(t,e){if(!t.itemName)return{result:0,exists:!1};let n=this._itemNameToValues.get(t.itemName);return n?{result:n,exists:!0}:{result:0,exists:!1}}}class J{constructor(t){this._lists=new Map,this._allUnambiguousListValueCache=new Map;for(let e of t){this._lists.set(e.name,e);for(let[t,n]of e.items){let e=g.fromSerializedKey(t),i=new O(e,n);if(!e.itemName)throw new Error("item.itemName is null or undefined.");this._allUnambiguousListValueCache.set(e.itemName,i),this._allUnambiguousListValueCache.set(e.fullName,i)}}}get lists(){let t=[];for(let[,e]of this._lists)t.push(e);return t}TryListGetDefinition(t,e){if(null===t)return{result:e,exists:!1};let n=this._lists.get(t);return n?{result:n,exists:!0}:{result:e,exists:!1}}FindSingleItemListWithName(t){if(null===t)return p("name");let e=this._allUnambiguousListValueCache.get(t);return void 0!==e?e:null}}class q{static JArrayToRuntimeObjList(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.length;e&&n--;let i=[];for(let e=0;et->")),e=i.hasVariableTarget?i.variableDivertName:i.targetPathString,t.WriteObjectStart(),t.WriteProperty(n,e),i.hasVariableTarget&&t.WriteProperty("var",!0),i.isConditional&&t.WriteProperty("c",!0),i.externalArgs>0&&t.WriteIntProperty("exArgs",i.externalArgs),void t.WriteObjectEnd()}let a=s(e,V);if(a)return t.WriteObjectStart(),t.WriteProperty("*",a.pathStringOnChoice),t.WriteIntProperty("flg",a.flags),void t.WriteObjectEnd();let l=s(e,_);if(l)return void t.WriteBool(l.value);let o=s(e,w);if(o)return void t.WriteInt(o.value);let h=s(e,T);if(h)return void t.WriteFloat(h.value);let u=s(e,E);if(u)return void(u.isNewline?t.Write("\n",!1):(t.WriteStringStart(),t.WriteStringInner("^"),t.WriteStringInner(u.value),t.WriteStringEnd()));let c=s(e,O);if(c)return void this.WriteInkList(t,c);let d=s(e,P);if(d)return t.WriteObjectStart(),null===d.value?p("divTargetVal.value"):(t.WriteProperty("^->",d.value.componentsString),void t.WriteObjectEnd());let m=s(e,N);if(m)return t.WriteObjectStart(),t.WriteProperty("^var",m.value),t.WriteIntProperty("ci",m.contextIndex),void t.WriteObjectEnd();if(s(e,I))return void t.Write("<>");let f=s(e,k);if(f)return void t.Write(q._controlCommandNames[f.commandType]);let g=s(e,j);if(g){let e=g.name;return"^"==e&&(e="L^"),void t.Write(e)}let S=s(e,L);if(S){t.WriteObjectStart();let e=S.pathStringForCount;return null!=e?t.WriteProperty("CNT?",e):t.WriteProperty("VAR?",S.name),void t.WriteObjectEnd()}let y=s(e,R);if(y){t.WriteObjectStart();let e=y.isGlobal?"VAR=":"temp=";return t.WriteProperty(e,y.variableName),y.isNewDeclaration||t.WriteProperty("re",!0),void t.WriteObjectEnd()}if(s(e,D))return void t.Write("void");let v=s(e,B);if(v)return t.WriteObjectStart(),t.WriteProperty("#",v.text),void t.WriteObjectEnd();let C=s(e,G);if(!C)throw new Error("Failed to convert runtime object to Json token: "+e);this.WriteChoice(t,C)}static JObjectToDictionaryRuntimeObjs(t){let e=new Map;for(let n in t)if(t.hasOwnProperty(n)){let i=this.JTokenToRuntimeObject(t[n]);if(null===i)return p("inkObject");e.set(n,i)}return e}static JObjectToIntDictionary(t){let e=new Map;for(let n in t)t.hasOwnProperty(n)&&e.set(n,parseInt(t[n]));return e}static JTokenToRuntimeObject(t){if("number"==typeof t&&!isNaN(t)||"boolean"==typeof t)return b.Create(t);if("string"==typeof t){let e=t.toString(),n=e[0];if("^"==n)return new E(e.substring(1));if("\n"==n&&1==e.length)return new E("\n");if("<>"==e)return new I;for(let t=0;t->"==e)return k.PopTunnel();if("~ret"==e)return k.PopFunction();if("void"==e)return new D}if("object"==typeof t&&!Array.isArray(t)){let n,i=t;if(i["^->"])return n=i["^->"],new P(new e(n.toString()));if(i["^var"]){n=i["^var"];let t=new N(n.toString());return"ci"in i&&(n=i.ci,t.contextIndex=parseInt(n)),t}let a=!1,s=!1,l=r.Function,o=!1;if((n=i["->"])?a=!0:(n=i["f()"])?(a=!0,s=!0,l=r.Function):(n=i["->t->"])?(a=!0,s=!0,l=r.Tunnel):(n=i["x()"])&&(a=!0,o=!0,s=!1,l=r.Function),a){let t=new W;t.pushesToStack=s,t.stackPushType=l,t.isExternal=o;let e=n.toString();return(n=i.var)?t.variableDivertName=e:t.targetPathString=e,t.isConditional=!!i.c,o&&(n=i.exArgs)&&(t.externalArgs=parseInt(n)),t}if(n=i["*"]){let t=new V;return t.pathStringOnChoice=n.toString(),(n=i.flg)&&(t.flags=parseInt(n)),t}if(n=i["VAR?"])return new L(n.toString());if(n=i["CNT?"]){let t=new L;return t.pathStringForCount=n.toString(),t}let h=!1,u=!1;if((n=i["VAR="])?(h=!0,u=!0):(n=i["temp="])&&(h=!0,u=!1),h){let t=n.toString(),e=!i.re,r=new R(t,e);return r.isGlobal=u,r}if(void 0!==i["#"])return n=i["#"],new B(n.toString());if(n=i.list){let t=n,e=new S;if(n=i.origins){let t=n;e.SetInitialOriginNames(t)}for(let n in t)if(t.hasOwnProperty(n)){let i=t[n],r=new g(n),a=parseInt(i);e.Add(r,a)}return new O(e)}if(null!=i.originalChoicePath)return this.JObjectToChoice(i)}if(Array.isArray(t))return this.JArrayToContainer(t);if(null==t)return null;throw new Error("Failed to convert token to runtime object: "+this.toJson(t,["parent"]))}static toJson(t,e,n){return JSON.stringify(t,((t,n)=>(null==e?void 0:e.some((e=>e===t)))?void 0:n),n)}static WriteRuntimeContainer(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t.WriteArrayStart(),null===e)return p("container");for(let n of e.content)this.WriteRuntimeObject(t,n);let i=e.namedOnlyContent,r=e.countFlags,a=null!=e.name&&!n,l=null!=i||r>0||a;if(l&&t.WriteObjectStart(),null!=i)for(let[e,n]of i){let i=e,r=s(n,x);t.WritePropertyStart(i),this.WriteRuntimeContainer(t,r,!0),t.WritePropertyEnd()}r>0&&t.WriteIntProperty("#f",r),a&&t.WriteProperty("#n",e.name),l?t.WriteObjectEnd():t.WriteNull(),t.WriteArrayEnd()}static JArrayToContainer(t){let e=new x;e.content=this.JArrayToRuntimeObjList(t,!0);let n=t[t.length-1];if(null!=n){let t=new Map;for(let i in n)if("#f"==i)e.countFlags=parseInt(n[i]);else if("#n"==i)e.name=n[i].toString();else{let e=this.JTokenToRuntimeObject(n[i]),r=s(e,x);r&&(r.name=i),t.set(i,e)}e.namedOnlyContent=t}return e}static JObjectToChoice(t){let e=new G;return e.text=t.text.toString(),e.index=parseInt(t.index),e.sourcePath=t.originalChoicePath.toString(),e.originalThreadIndex=parseInt(t.originalThreadIndex),e.pathStringOnChoice=t.targetPath.toString(),t.tags&&(e.tags=t.tags),e}static WriteChoice(t,e){t.WriteObjectStart(),t.WriteProperty("text",e.text),t.WriteIntProperty("index",e.index),t.WriteProperty("originalChoicePath",e.sourcePath),t.WriteIntProperty("originalThreadIndex",e.originalThreadIndex),t.WriteProperty("targetPath",e.pathStringOnChoice),e.tags&&t.WriteProperty("tags",(t=>{t.WriteArrayStart();for(const n of e.tags)t.WriteStringStart(),t.WriteStringInner(n),t.WriteStringEnd();t.WriteArrayEnd()})),t.WriteObjectEnd()}static WriteInkList(t,e){let n=e.value;if(null===n)return p("rawList");t.WriteObjectStart(),t.WritePropertyStart("list"),t.WriteObjectStart();for(let[e,i]of n){let n=g.fromSerializedKey(e),r=i;if(null===n.itemName)return p("item.itemName");t.WritePropertyNameStart(),t.WritePropertyNameInner(n.originName?n.originName:"?"),t.WritePropertyNameInner("."),t.WritePropertyNameInner(n.itemName),t.WritePropertyNameEnd(),t.Write(r),t.WritePropertyEnd()}if(t.WriteObjectEnd(),t.WritePropertyEnd(),0==n.Count&&null!=n.originNames&&n.originNames.length>0){t.WritePropertyStart("origins"),t.WriteArrayStart();for(let e of n.originNames)t.Write(e);t.WriteArrayEnd(),t.WritePropertyEnd()}t.WriteObjectEnd()}static ListDefinitionsToJToken(t){let e={};for(let n of t.lists){let t={};for(let[e,i]of n.items){let n=g.fromSerializedKey(e);if(null===n.itemName)return p("item.itemName");t[n.itemName]=i}e[n.name]=t}return e}static JTokenToListDefinitions(t){let e=t,n=[];for(let t in e)if(e.hasOwnProperty(t)){let i=t.toString(),r=e[t],a=new Map;for(let n in r)if(e.hasOwnProperty(t)){let t=r[n];a.set(n,parseInt(t))}let s=new M(i,a);n.push(s)}return new J(n)}}q._controlCommandNames=(()=>{let t=[];t[k.CommandType.EvalStart]="ev",t[k.CommandType.EvalOutput]="out",t[k.CommandType.EvalEnd]="/ev",t[k.CommandType.Duplicate]="du",t[k.CommandType.PopEvaluatedValue]="pop",t[k.CommandType.PopFunction]="~ret",t[k.CommandType.PopTunnel]="->->",t[k.CommandType.BeginString]="str",t[k.CommandType.EndString]="/str",t[k.CommandType.NoOp]="nop",t[k.CommandType.ChoiceCount]="choiceCnt",t[k.CommandType.Turns]="turn",t[k.CommandType.TurnsSince]="turns",t[k.CommandType.ReadCount]="readc",t[k.CommandType.Random]="rnd",t[k.CommandType.SeedRandom]="srnd",t[k.CommandType.VisitIndex]="visit",t[k.CommandType.SequenceShuffleIndex]="seq",t[k.CommandType.StartThread]="thread",t[k.CommandType.Done]="done",t[k.CommandType.End]="end",t[k.CommandType.ListFromInt]="listInt",t[k.CommandType.ListRange]="range",t[k.CommandType.ListRandom]="lrnd",t[k.CommandType.BeginTag]="#",t[k.CommandType.EndTag]="/#";for(let e=0;e1}constructor(){if(this._threadCounter=0,this._startOfRoot=F.Null,arguments[0]instanceof Z){let t=arguments[0];this._startOfRoot=F.StartOf(t.rootContentContainer),this.Reset()}else{let t=arguments[0];this._threads=[];for(let e of t._threads)this._threads.push(e.Copy());this._threadCounter=t._threadCounter,this._startOfRoot=t._startOfRoot.copy()}}Reset(){this._threads=[],this._threads.push(new U.Thread),this._threads[0].callstack.push(new U.Element(r.Tunnel,this._startOfRoot))}SetJsonToken(t,e){this._threads.length=0;let n=t.threads;for(let t of n){let n=t,i=new U.Thread(n,e);this._threads.push(i)}this._threadCounter=parseInt(t.threadCounter),this._startOfRoot=F.StartOf(e.rootContentContainer)}WriteJson(t){t.WriteObject((t=>{t.WritePropertyStart("threads"),t.WriteArrayStart();for(let e of this._threads)e.WriteJson(t);t.WriteArrayEnd(),t.WritePropertyEnd(),t.WritePropertyStart("threadCounter"),t.WriteInt(this._threadCounter),t.WritePropertyEnd()}))}PushThread(){let t=this.currentThread.Copy();this._threadCounter++,t.threadIndex=this._threadCounter,this._threads.push(t)}ForkThread(){let t=this.currentThread.Copy();return this._threadCounter++,t.threadIndex=this._threadCounter,t}PopThread(){if(!this.canPopThread)throw new Error("Can't pop thread");this._threads.splice(this._threads.indexOf(this.currentThread),1)}get canPopThread(){return this._threads.length>1&&!this.elementIsEvaluateFromGame}get elementIsEvaluateFromGame(){return this.currentElement.type==r.FunctionEvaluationFromGame}Push(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=new U.Element(t,this.currentElement.currentPointer,!1);i.evaluationStackHeightWhenPushed=e,i.functionStartInOutputStream=n,this.callStack.push(i)}CanPop(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!!this.canPop&&(null==t||this.currentElement.type==t)}Pop(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!this.CanPop(t))throw new Error("Mismatched push/pop in Callstack");this.callStack.pop()}GetTemporaryVariableWithName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;-1==e&&(e=this.currentElementIndex+1);let n=v(this.callStack[e-1].temporaryVariables,t,null);return n.exists?n.result:null}SetTemporaryVariable(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1;-1==i&&(i=this.currentElementIndex+1);let r=this.callStack[i-1];if(!n&&!r.temporaryVariables.get(t))throw new Error("Could not find temporary variable to set: "+t);let a=v(r.temporaryVariables,t,null);a.exists&&O.RetainListOriginsForAssignment(a.result,e),r.temporaryVariables.set(t,e)}ContextForVariableNamed(t){return this.currentElement.temporaryVariables.get(t)?this.currentElementIndex+1:0}ThreadWithIndex(t){let e=this._threads.filter((e=>{if(e.threadIndex==t)return e}));return e.length>0?e[0]:null}get callStack(){return this.currentThread.callstack}get callStackTrace(){let t=new f;for(let e=0;e")}}}return t.toString()}}!function(t){class n{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.evaluationStackHeightWhenPushed=0,this.functionStartInOutputStream=0,this.currentPointer=e.copy(),this.inExpressionEvaluation=n,this.temporaryVariables=new Map,this.type=t}Copy(){let t=new n(this.type,this.currentPointer,this.inExpressionEvaluation);return t.temporaryVariables=new Map(this.temporaryVariables),t.evaluationStackHeightWhenPushed=this.evaluationStackHeightWhenPushed,t.functionStartInOutputStream=this.functionStartInOutputStream,t}}t.Element=n;class i{constructor(){if(this.threadIndex=0,this.previousPointer=F.Null,this.callstack=[],arguments[0]&&arguments[1]){let t=arguments[0],i=arguments[1];this.threadIndex=parseInt(t.threadIndex);let r=t.callstack;for(let t of r){let r,a=t,s=parseInt(a.type),l=F.Null,o=a.cPath;if(void 0!==o){r=o.toString();let t=i.ContentAtPath(new e(r));if(l.container=t.container,l.index=parseInt(a.idx),null==t.obj)throw new Error("When loading state, internal story location couldn't be found: "+r+". Has the story changed since this save data was created?");if(t.approximate){if(null===l.container)return p("pointer.container");i.Warning("When loading state, exact internal story location couldn't be found: '"+r+"', so it was approximated to '"+l.container.path.toString()+"' to recover. Has the story changed since this save data was created?")}}let h=!!a.exp,u=new n(s,l,h),c=a.temp;void 0!==c?u.temporaryVariables=q.JObjectToDictionaryRuntimeObjs(c):u.temporaryVariables.clear(),this.callstack.push(u)}let a=t.previousContentObject;if(void 0!==a){let t=new e(a.toString());this.previousPointer=i.PointerAtPath(t)}}}Copy(){let t=new i;t.threadIndex=this.threadIndex;for(let e of this.callstack)t.callstack.push(e.Copy());return t.previousPointer=this.previousPointer.copy(),t}WriteJson(t){t.WriteObjectStart(),t.WritePropertyStart("callstack"),t.WriteArrayStart();for(let e of this.callstack){if(t.WriteObjectStart(),!e.currentPointer.isNull){if(null===e.currentPointer.container)return p("el.currentPointer.container");t.WriteProperty("cPath",e.currentPointer.container.path.componentsString),t.WriteIntProperty("idx",e.currentPointer.index)}t.WriteProperty("exp",e.inExpressionEvaluation),t.WriteIntProperty("type",e.type),e.temporaryVariables.size>0&&(t.WritePropertyStart("temp"),q.WriteDictionaryRuntimeObjs(t,e.temporaryVariables),t.WritePropertyEnd()),t.WriteObjectEnd()}if(t.WriteArrayEnd(),t.WritePropertyEnd(),t.WriteIntProperty("threadIndex",this.threadIndex),!this.previousPointer.isNull){let e=this.previousPointer.Resolve();if(null===e)return p("this.previousPointer.Resolve()");t.WriteProperty("previousContentObject",e.path.toString())}t.WriteObjectEnd()}}t.Thread=i}(U||(U={}));class K extends class{}{variableChangedEvent(t,e){for(let n of this.variableChangedEventCallbacks)n(t,e)}get batchObservingVariableChanges(){return this._batchObservingVariableChanges}set batchObservingVariableChanges(t){if(this._batchObservingVariableChanges=t,t)this._changedVariablesForBatchObs=new Set;else if(null!=this._changedVariablesForBatchObs){for(let t of this._changedVariablesForBatchObs){let e=this._globalVariables.get(t);e?this.variableChangedEvent(t,e):p("currentValue")}this._changedVariablesForBatchObs=null}}get callStack(){return this._callStack}set callStack(t){this._callStack=t}$(t,e){if(void 0===e){let e=null;return null!==this.patch&&(e=this.patch.TryGetGlobal(t,null),e.exists)?e.result.valueObject:(e=this._globalVariables.get(t),void 0===e&&(e=this._defaultGlobalVariables.get(t)),void 0!==e?e.valueObject:null)}{if(void 0===this._defaultGlobalVariables.get(t))throw new y("Cannot assign to a variable ("+t+") that hasn't been declared in the story");let n=b.Create(e);if(null==n)throw null==e?new Error("Cannot pass null to VariableState"):new Error("Invalid value passed to VariableState: "+e.toString());this.SetGlobal(t,n)}}constructor(t,e){super(),this.variableChangedEventCallbacks=[],this.patch=null,this._batchObservingVariableChanges=!1,this._defaultGlobalVariables=new Map,this._changedVariablesForBatchObs=new Set,this._globalVariables=new Map,this._callStack=t,this._listDefsOrigin=e;try{return new Proxy(this,{get:(t,e)=>e in t?t[e]:t.$(e),set:(t,e,n)=>(e in t?t[e]=n:t.$(e,n),!0)})}catch(t){}}ApplyPatch(){if(null===this.patch)return p("this.patch");for(let[t,e]of this.patch.globals)this._globalVariables.set(t,e);if(null!==this._changedVariablesForBatchObs)for(let t of this.patch.changedVariables)this._changedVariablesForBatchObs.add(t);this.patch=null}SetJsonToken(t){this._globalVariables.clear();for(let[e,n]of this._defaultGlobalVariables){let i=t[e];if(void 0!==i){let t=q.JTokenToRuntimeObject(i);if(null===t)return p("tokenInkObject");this._globalVariables.set(e,t)}else this._globalVariables.set(e,n)}}WriteJson(t){t.WriteObjectStart();for(let[e,n]of this._globalVariables){let i=e,r=n;if(K.dontSaveDefaultValues&&this._defaultGlobalVariables.has(i)){let t=this._defaultGlobalVariables.get(i);if(this.RuntimeObjectsEqual(r,t))continue}t.WritePropertyStart(i),q.WriteRuntimeObject(t,r),t.WritePropertyEnd()}t.WriteObjectEnd()}RuntimeObjectsEqual(t,e){if(null===t)return p("obj1");if(null===e)return p("obj2");if(t.constructor!==e.constructor)return!1;let n=s(t,_);if(null!==n)return n.value===l(e,_).value;let i=s(t,w);if(null!==i)return i.value===l(e,w).value;let r=s(t,T);if(null!==r)return r.value===l(e,T).value;let a=s(t,b),o=s(e,b);if(null!==a&&null!==o)return u(a.valueObject)&&u(o.valueObject)?a.valueObject.Equals(o.valueObject):a.valueObject===o.valueObject;throw new Error("FastRoughDefinitelyEquals: Unsupported runtime object type: "+t.constructor.name)}GetVariableWithName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=this.GetRawVariableWithName(t,e),i=s(n,N);return null!==i&&(n=this.ValueAtVariablePointer(i)),n}TryGetDefaultVariableValue(t){let e=v(this._defaultGlobalVariables,t,null);return e.exists?e.result:null}GlobalVariableExistsWithName(t){return this._globalVariables.has(t)||null!==this._defaultGlobalVariables&&this._defaultGlobalVariables.has(t)}GetRawVariableWithName(t,e){let n=null;if(0==e||-1==e){let e=null;if(null!==this.patch&&(e=this.patch.TryGetGlobal(t,null),e.exists))return e.result;if(e=v(this._globalVariables,t,null),e.exists)return e.result;if(null!==this._defaultGlobalVariables&&(e=v(this._defaultGlobalVariables,t,null),e.exists))return e.result;if(null===this._listDefsOrigin)return p("VariablesState._listDefsOrigin");let n=this._listDefsOrigin.FindSingleItemListWithName(t);if(n)return n}return n=this._callStack.GetTemporaryVariableWithName(t,e),n}ValueAtVariablePointer(t){return this.GetVariableWithName(t.variableName,t.contextIndex)}Assign(t,e){let n=t.variableName;if(null===n)return p("name");let i=-1,r=!1;if(r=t.isNewDeclaration?t.isGlobal:this.GlobalVariableExistsWithName(n),t.isNewDeclaration){let t=s(e,N);if(null!==t){e=this.ResolveVariablePointer(t)}}else{let t=null;do{t=s(this.GetRawVariableWithName(n,i),N),null!=t&&(n=t.variableName,i=t.contextIndex,r=0==i)}while(null!=t)}r?this.SetGlobal(n,e):this._callStack.SetTemporaryVariable(n,e,t.isNewDeclaration,i)}SnapshotDefaultGlobals(){this._defaultGlobalVariables=new Map(this._globalVariables)}RetainListOriginsForAssignment(t,e){let n=l(t,O),i=l(e,O);n.value&&i.value&&0==i.value.Count&&i.value.SetInitialOriginNames(n.value.originNames)}SetGlobal(t,e){let n=null;if(null===this.patch&&(n=v(this._globalVariables,t,null)),null!==this.patch&&(n=this.patch.TryGetGlobal(t,null),n.exists||(n=v(this._globalVariables,t,null))),O.RetainListOriginsForAssignment(n.result,e),null===t)return p("variableName");if(null!==this.patch?this.patch.SetGlobal(t,e):this._globalVariables.set(t,e),null!==this.variableChangedEvent&&null!==n&&e!==n.result)if(this.batchObservingVariableChanges){if(null===this._changedVariablesForBatchObs)return p("this._changedVariablesForBatchObs");null!==this.patch?this.patch.AddChangedVariable(t):null!==this._changedVariablesForBatchObs&&this._changedVariablesForBatchObs.add(t)}else this.variableChangedEvent(t,e)}ResolveVariablePointer(t){let e=t.contextIndex;-1==e&&(e=this.GetContextIndexOfVariableNamed(t.variableName));let n=s(this.GetRawVariableWithName(t.variableName,e),N);return null!=n?n:new N(t.variableName,e)}GetContextIndexOfVariableNamed(t){return this.GlobalVariableExistsWithName(t)?0:this._callStack.currentElementIndex}ObserveVariableChange(t){this.variableChangedEventCallbacks.push(t)}}K.dontSaveDefaultValues=!0;class z{constructor(t){this.seed=t%2147483647,this.seed<=0&&(this.seed+=2147483646)}next(){return this.seed=48271*this.seed%2147483647}nextFloat(){return(this.next()-1)/2147483646}}class H{get globals(){return this._globals}get changedVariables(){return this._changedVariables}get visitCounts(){return this._visitCounts}get turnIndices(){return this._turnIndices}constructor(){if(this._changedVariables=new Set,this._visitCounts=new Map,this._turnIndices=new Map,1===arguments.length&&null!==arguments[0]){let t=arguments[0];this._globals=new Map(t._globals),this._changedVariables=new Set(t._changedVariables),this._visitCounts=new Map(t._visitCounts),this._turnIndices=new Map(t._turnIndices)}else this._globals=new Map,this._changedVariables=new Set,this._visitCounts=new Map,this._turnIndices=new Map}TryGetGlobal(t,e){return null!==t&&this._globals.has(t)?{result:this._globals.get(t),exists:!0}:{result:e,exists:!1}}SetGlobal(t,e){this._globals.set(t,e)}AddChangedVariable(t){return this._changedVariables.add(t)}TryGetVisitCount(t,e){return this._visitCounts.has(t)?{result:this._visitCounts.get(t),exists:!0}:{result:e,exists:!1}}SetVisitCount(t,e){this._visitCounts.set(t,e)}SetTurnIndex(t,e){this._turnIndices.set(t,e)}TryGetTurnIndex(t,e){return this._turnIndices.has(t)?{result:this._turnIndices.get(t),exists:!0}:{result:e,exists:!1}}}class ${static TextToDictionary(t){return new $.Reader(t).ToDictionary()}static TextToArray(t){return new $.Reader(t).ToArray()}}!function(t){t.Reader=class{constructor(t){this._rootObject=JSON.parse(t)}ToDictionary(){return this._rootObject}ToArray(){return this._rootObject}};class e{constructor(){this._currentPropertyName=null,this._currentString=null,this._stateStack=[],this._collectionStack=[],this._propertyNameStack=[],this._jsonObject=null}WriteObject(t){this.WriteObjectStart(),t(this),this.WriteObjectEnd()}WriteObjectStart(){this.StartNewObject(!0);let e={};if(this.state===t.Writer.State.Property){this.Assert(null!==this.currentCollection),this.Assert(null!==this.currentPropertyName);let t=this._propertyNameStack.pop();this.currentCollection[t]=e,this._collectionStack.push(e)}else this.state===t.Writer.State.Array?(this.Assert(null!==this.currentCollection),this.currentCollection.push(e),this._collectionStack.push(e)):(this.Assert(this.state===t.Writer.State.None),this._jsonObject=e,this._collectionStack.push(e));this._stateStack.push(new t.Writer.StateElement(t.Writer.State.Object))}WriteObjectEnd(){this.Assert(this.state===t.Writer.State.Object),this._collectionStack.pop(),this._stateStack.pop()}WriteProperty(t,e){if(this.WritePropertyStart(t),arguments[1]instanceof Function){(0,arguments[1])(this)}else{let t=arguments[1];this.Write(t)}this.WritePropertyEnd()}WriteIntProperty(t,e){this.WritePropertyStart(t),this.WriteInt(e),this.WritePropertyEnd()}WriteFloatProperty(t,e){this.WritePropertyStart(t),this.WriteFloat(e),this.WritePropertyEnd()}WritePropertyStart(e){this.Assert(this.state===t.Writer.State.Object),this._propertyNameStack.push(e),this.IncrementChildCount(),this._stateStack.push(new t.Writer.StateElement(t.Writer.State.Property))}WritePropertyEnd(){this.Assert(this.state===t.Writer.State.Property),this.Assert(1===this.childCount),this._stateStack.pop()}WritePropertyNameStart(){this.Assert(this.state===t.Writer.State.Object),this.IncrementChildCount(),this._currentPropertyName="",this._stateStack.push(new t.Writer.StateElement(t.Writer.State.Property)),this._stateStack.push(new t.Writer.StateElement(t.Writer.State.PropertyName))}WritePropertyNameEnd(){this.Assert(this.state===t.Writer.State.PropertyName),this.Assert(null!==this._currentPropertyName),this._propertyNameStack.push(this._currentPropertyName),this._currentPropertyName=null,this._stateStack.pop()}WritePropertyNameInner(e){this.Assert(this.state===t.Writer.State.PropertyName),this.Assert(null!==this._currentPropertyName),this._currentPropertyName+=e}WriteArrayStart(){this.StartNewObject(!0);let e=[];if(this.state===t.Writer.State.Property){this.Assert(null!==this.currentCollection),this.Assert(null!==this.currentPropertyName);let t=this._propertyNameStack.pop();this.currentCollection[t]=e,this._collectionStack.push(e)}else this.state===t.Writer.State.Array?(this.Assert(null!==this.currentCollection),this.currentCollection.push(e),this._collectionStack.push(e)):(this.Assert(this.state===t.Writer.State.None),this._jsonObject=e,this._collectionStack.push(e));this._stateStack.push(new t.Writer.StateElement(t.Writer.State.Array))}WriteArrayEnd(){this.Assert(this.state===t.Writer.State.Array),this._collectionStack.pop(),this._stateStack.pop()}Write(t){null!==t?(this.StartNewObject(!1),this._addToCurrentObject(t)):console.error("Warning: trying to write a null value")}WriteBool(t){null!==t&&(this.StartNewObject(!1),this._addToCurrentObject(t))}WriteInt(t){null!==t&&(this.StartNewObject(!1),this._addToCurrentObject(Math.floor(t)))}WriteFloat(t){null!==t&&(this.StartNewObject(!1),t==Number.POSITIVE_INFINITY?this._addToCurrentObject(34e37):t==Number.NEGATIVE_INFINITY?this._addToCurrentObject(-34e37):isNaN(t)?this._addToCurrentObject(0):this._addToCurrentObject(t))}WriteNull(){this.StartNewObject(!1),this._addToCurrentObject(null)}WriteStringStart(){this.StartNewObject(!1),this._currentString="",this._stateStack.push(new t.Writer.StateElement(t.Writer.State.String))}WriteStringEnd(){this.Assert(this.state==t.Writer.State.String),this._stateStack.pop(),this._addToCurrentObject(this._currentString),this._currentString=null}WriteStringInner(e){this.Assert(this.state===t.Writer.State.String),null!==e?this._currentString+=e:console.error("Warning: trying to write a null string")}toString(){return null===this._jsonObject?"":JSON.stringify(this._jsonObject)}StartNewObject(e){e?this.Assert(this.state===t.Writer.State.None||this.state===t.Writer.State.Property||this.state===t.Writer.State.Array):this.Assert(this.state===t.Writer.State.Property||this.state===t.Writer.State.Array),this.state===t.Writer.State.Property&&this.Assert(0===this.childCount),this.state!==t.Writer.State.Array&&this.state!==t.Writer.State.Property||this.IncrementChildCount()}get state(){return this._stateStack.length>0?this._stateStack[this._stateStack.length-1].type:t.Writer.State.None}get childCount(){return this._stateStack.length>0?this._stateStack[this._stateStack.length-1].childCount:0}get currentCollection(){return this._collectionStack.length>0?this._collectionStack[this._collectionStack.length-1]:null}get currentPropertyName(){return this._propertyNameStack.length>0?this._propertyNameStack[this._propertyNameStack.length-1]:null}IncrementChildCount(){this.Assert(this._stateStack.length>0);let t=this._stateStack.pop();t.childCount++,this._stateStack.push(t)}Assert(t){if(!t)throw Error("Assert failed while writing JSON")}_addToCurrentObject(e){this.Assert(null!==this.currentCollection),this.state===t.Writer.State.Array?(this.Assert(Array.isArray(this.currentCollection)),this.currentCollection.push(e)):this.state===t.Writer.State.Property&&(this.Assert(!Array.isArray(this.currentCollection)),this.Assert(null!==this.currentPropertyName),this.currentCollection[this.currentPropertyName]=e,this._propertyNameStack.pop())}}t.Writer=e,function(e){var n;(n=e.State||(e.State={}))[n.None=0]="None",n[n.Object=1]="Object",n[n.Array=2]="Array",n[n.Property=3]="Property",n[n.PropertyName=4]="PropertyName",n[n.String=5]="String";e.StateElement=class{constructor(e){this.type=t.Writer.State.None,this.childCount=0,this.type=e}}}(e=t.Writer||(t.Writer={}))}($||($={}));class X{constructor(){let t=arguments[0],e=arguments[1];if(this.name=t,this.callStack=new U(e),arguments[2]){let t=arguments[2];this.callStack.SetJsonToken(t.callstack,e),this.outputStream=q.JArrayToRuntimeObjList(t.outputStream),this.currentChoices=q.JArrayToRuntimeObjList(t.currentChoices);let n=t.choiceThreads;void 0!==n&&this.LoadFlowChoiceThreads(n,e)}else this.outputStream=[],this.currentChoices=[]}WriteJson(t){t.WriteObjectStart(),t.WriteProperty("callstack",(t=>this.callStack.WriteJson(t))),t.WriteProperty("outputStream",(t=>q.WriteListRuntimeObjs(t,this.outputStream)));let e=!1;for(let n of this.currentChoices){if(null===n.threadAtGeneration)return p("c.threadAtGeneration");n.originalThreadIndex=n.threadAtGeneration.threadIndex,null===this.callStack.ThreadWithIndex(n.originalThreadIndex)&&(e||(e=!0,t.WritePropertyStart("choiceThreads"),t.WriteObjectStart()),t.WritePropertyStart(n.originalThreadIndex),n.threadAtGeneration.WriteJson(t),t.WritePropertyEnd())}e&&(t.WriteObjectEnd(),t.WritePropertyEnd()),t.WriteProperty("currentChoices",(t=>{t.WriteArrayStart();for(let e of this.currentChoices)q.WriteChoice(t,e);t.WriteArrayEnd()})),t.WriteObjectEnd()}LoadFlowChoiceThreads(t,e){for(let n of this.currentChoices){let i=this.callStack.ThreadWithIndex(n.originalThreadIndex);if(null!==i)n.threadAtGeneration=i.Copy();else{let i=t[`${n.originalThreadIndex}`];n.threadAtGeneration=new U.Thread(i,e)}}}}class Y{ToJson(){let t=new $.Writer;return this.WriteJson(t),t.toString()}toJson(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.ToJson(t)}LoadJson(t){let e=$.TextToDictionary(t);this.LoadJsonObj(e),null!==this.onDidLoadState&&this.onDidLoadState()}VisitCountAtPathString(t){let n;if(null!==this._patch){let i=this.story.ContentAtPath(new e(t)).container;if(null===i)throw new Error("Content at path not found: "+t);if(n=this._patch.TryGetVisitCount(i,0),n.exists)return n.result}return n=v(this._visitCounts,t,null),n.exists?n.result:0}VisitCountForContainer(t){if(null===t)return p("container");if(!t.visitsShouldBeCounted)return this.story.Error("Read count for target ("+t.name+" - on "+t.debugMetadata+") unknown. The story may need to be compiled with countAllVisits flag (-c)."),0;if(null!==this._patch){let e=this._patch.TryGetVisitCount(t,0);if(e.exists)return e.result}let e=t.path.toString(),n=v(this._visitCounts,e,null);return n.exists?n.result:0}IncrementVisitCountForContainer(t){if(null!==this._patch){let e=this.VisitCountForContainer(t);return e++,void this._patch.SetVisitCount(t,e)}let e=t.path.toString(),n=v(this._visitCounts,e,null);n.exists?this._visitCounts.set(e,n.result+1):this._visitCounts.set(e,1)}RecordTurnIndexVisitToContainer(t){if(null!==this._patch)return void this._patch.SetTurnIndex(t,this.currentTurnIndex);let e=t.path.toString();this._turnIndices.set(e,this.currentTurnIndex)}TurnsSinceForContainer(t){if(t.turnIndexShouldBeCounted||this.story.Error("TURNS_SINCE() for target ("+t.name+" - on "+t.debugMetadata+") unknown. The story may need to be compiled with countAllVisits flag (-c)."),null!==this._patch){let e=this._patch.TryGetTurnIndex(t,0);if(e.exists)return this.currentTurnIndex-e.result}let e=t.path.toString(),n=v(this._turnIndices,e,0);return n.exists?this.currentTurnIndex-n.result:-1}get callstackDepth(){return this.callStack.depth}get outputStream(){return this._currentFlow.outputStream}get currentChoices(){return this.canContinue?[]:this._currentFlow.currentChoices}get generatedChoices(){return this._currentFlow.currentChoices}get currentErrors(){return this._currentErrors}get currentWarnings(){return this._currentWarnings}get variablesState(){return this._variablesState}set variablesState(t){this._variablesState=t}get callStack(){return this._currentFlow.callStack}get evaluationStack(){return this._evaluationStack}get currentTurnIndex(){return this._currentTurnIndex}set currentTurnIndex(t){this._currentTurnIndex=t}get currentPathString(){let t=this.currentPointer;return t.isNull?null:null===t.path?p("pointer.path"):t.path.toString()}get currentPointer(){return this.callStack.currentElement.currentPointer.copy()}set currentPointer(t){this.callStack.currentElement.currentPointer=t.copy()}get previousPointer(){return this.callStack.currentThread.previousPointer.copy()}set previousPointer(t){this.callStack.currentThread.previousPointer=t.copy()}get canContinue(){return!this.currentPointer.isNull&&!this.hasError}get hasError(){return null!=this.currentErrors&&this.currentErrors.length>0}get hasWarning(){return null!=this.currentWarnings&&this.currentWarnings.length>0}get currentText(){if(this._outputStreamTextDirty){let t=new f,e=!1;for(let n of this.outputStream){let i=s(n,E);if(e||null===i){let t=s(n,k);null!==t&&(t.commandType==k.CommandType.BeginTag?e=!0:t.commandType==k.CommandType.EndTag&&(e=!1))}else t.Append(i.value)}this._currentText=this.CleanOutputWhitespace(t.toString()),this._outputStreamTextDirty=!1}return this._currentText}CleanOutputWhitespace(t){let e=new f,n=-1,i=0;for(let r=0;r0&&n!=i&&e.Append(" "),n=-1),"\n"==a&&(i=r+1),s||e.Append(a)}return e.toString()}get currentTags(){if(this._outputStreamTagsDirty){this._currentTags=[];let t=!1,e=new f;for(let n of this.outputStream){let i=s(n,k);if(null!=i){if(i.commandType==k.CommandType.BeginTag){if(t&&e.Length>0){let t=this.CleanOutputWhitespace(e.toString());this._currentTags.push(t),e.Clear()}t=!0}else if(i.commandType==k.CommandType.EndTag){if(e.Length>0){let t=this.CleanOutputWhitespace(e.toString());this._currentTags.push(t),e.Clear()}t=!1}}else if(t){let t=s(n,E);null!==t&&e.Append(t.value)}else{let t=s(n,B);null!=t&&null!=t.text&&t.text.length>0&&this._currentTags.push(t.text)}}if(e.Length>0){let t=this.CleanOutputWhitespace(e.toString());this._currentTags.push(t),e.Clear()}this._outputStreamTagsDirty=!1}return this._currentTags}get currentFlowName(){return this._currentFlow.name}get currentFlowIsDefaultFlow(){return this._currentFlow.name==this.kDefaultFlowName}get aliveFlowNames(){if(this._aliveFlowNamesDirty){if(this._aliveFlowNames=[],null!=this._namedFlows)for(let t of this._namedFlows.keys())t!=this.kDefaultFlowName&&this._aliveFlowNames.push(t);this._aliveFlowNamesDirty=!1}return this._aliveFlowNames}get inExpressionEvaluation(){return this.callStack.currentElement.inExpressionEvaluation}set inExpressionEvaluation(t){this.callStack.currentElement.inExpressionEvaluation=t}constructor(t){this.kInkSaveStateVersion=10,this.kMinCompatibleLoadVersion=8,this.onDidLoadState=null,this._currentErrors=null,this._currentWarnings=null,this.divertedPointer=F.Null,this._currentTurnIndex=0,this.storySeed=0,this.previousRandom=0,this.didSafeExit=!1,this._currentText=null,this._currentTags=null,this._outputStreamTextDirty=!0,this._outputStreamTagsDirty=!0,this._patch=null,this._aliveFlowNames=null,this._namedFlows=null,this.kDefaultFlowName="DEFAULT_FLOW",this._aliveFlowNamesDirty=!0,this.story=t,this._currentFlow=new X(this.kDefaultFlowName,t),this.OutputStreamDirty(),this._aliveFlowNamesDirty=!0,this._evaluationStack=[],this._variablesState=new K(this.callStack,t.listDefinitions),this._visitCounts=new Map,this._turnIndices=new Map,this.currentTurnIndex=-1;let e=(new Date).getTime();this.storySeed=new z(e).next()%100,this.previousRandom=0,this.GoToStart()}GoToStart(){this.callStack.currentElement.currentPointer=F.StartOf(this.story.mainContentContainer)}SwitchFlow_Internal(t){if(null===t)throw new Error("Must pass a non-null string to Story.SwitchFlow");if(null===this._namedFlows&&(this._namedFlows=new Map,this._namedFlows.set(this.kDefaultFlowName,this._currentFlow)),t===this._currentFlow.name)return;let e,n=v(this._namedFlows,t,null);n.exists?e=n.result:(e=new X(t,this.story),this._namedFlows.set(t,e),this._aliveFlowNamesDirty=!0),this._currentFlow=e,this.variablesState.callStack=this._currentFlow.callStack,this.OutputStreamDirty()}SwitchToDefaultFlow_Internal(){null!==this._namedFlows&&this.SwitchFlow_Internal(this.kDefaultFlowName)}RemoveFlow_Internal(t){if(null===t)throw new Error("Must pass a non-null string to Story.DestroyFlow");if(t===this.kDefaultFlowName)throw new Error("Cannot destroy default flow");if(this._currentFlow.name===t&&this.SwitchToDefaultFlow_Internal(),null===this._namedFlows)return p("this._namedFlows");this._namedFlows.delete(t),this._aliveFlowNamesDirty=!0}CopyAndStartPatching(){let t=new Y(this.story);if(t._patch=new H(this._patch),t._currentFlow.name=this._currentFlow.name,t._currentFlow.callStack=new U(this._currentFlow.callStack),t._currentFlow.currentChoices.push(...this._currentFlow.currentChoices),t._currentFlow.outputStream.push(...this._currentFlow.outputStream),t.OutputStreamDirty(),null!==this._namedFlows){t._namedFlows=new Map;for(let[e,n]of this._namedFlows)t._namedFlows.set(e,n),t._aliveFlowNamesDirty=!0;t._namedFlows.set(this._currentFlow.name,t._currentFlow)}return this.hasError&&(t._currentErrors=[],t._currentErrors.push(...this.currentErrors||[])),this.hasWarning&&(t._currentWarnings=[],t._currentWarnings.push(...this.currentWarnings||[])),t.variablesState=this.variablesState,t.variablesState.callStack=t.callStack,t.variablesState.patch=t._patch,t.evaluationStack.push(...this.evaluationStack),this.divertedPointer.isNull||(t.divertedPointer=this.divertedPointer.copy()),t.previousPointer=this.previousPointer.copy(),t._visitCounts=this._visitCounts,t._turnIndices=this._turnIndices,t.currentTurnIndex=this.currentTurnIndex,t.storySeed=this.storySeed,t.previousRandom=this.previousRandom,t.didSafeExit=this.didSafeExit,t}RestoreAfterPatch(){this.variablesState.callStack=this.callStack,this.variablesState.patch=this._patch}ApplyAnyPatch(){if(null!==this._patch){this.variablesState.ApplyPatch();for(let[t,e]of this._patch.visitCounts)this.ApplyCountChanges(t,e,!0);for(let[t,e]of this._patch.turnIndices)this.ApplyCountChanges(t,e,!1);this._patch=null}}ApplyCountChanges(t,e,n){(n?this._visitCounts:this._turnIndices).set(t.path.toString(),e)}WriteJson(t){if(t.WriteObjectStart(),t.WritePropertyStart("flows"),t.WriteObjectStart(),null!==this._namedFlows)for(let[e,n]of this._namedFlows)t.WriteProperty(e,(t=>n.WriteJson(t)));else t.WriteProperty(this._currentFlow.name,(t=>this._currentFlow.WriteJson(t)));if(t.WriteObjectEnd(),t.WritePropertyEnd(),t.WriteProperty("currentFlowName",this._currentFlow.name),t.WriteProperty("variablesState",(t=>this.variablesState.WriteJson(t))),t.WriteProperty("evalStack",(t=>q.WriteListRuntimeObjs(t,this.evaluationStack))),!this.divertedPointer.isNull){if(null===this.divertedPointer.path)return p("divertedPointer");t.WriteProperty("currentDivertTarget",this.divertedPointer.path.componentsString)}t.WriteProperty("visitCounts",(t=>q.WriteIntDictionary(t,this._visitCounts))),t.WriteProperty("turnIndices",(t=>q.WriteIntDictionary(t,this._turnIndices))),t.WriteIntProperty("turnIdx",this.currentTurnIndex),t.WriteIntProperty("storySeed",this.storySeed),t.WriteIntProperty("previousRandom",this.previousRandom),t.WriteIntProperty("inkSaveVersion",this.kInkSaveStateVersion),t.WriteIntProperty("inkFormatVersion",Z.inkVersionCurrent),t.WriteObjectEnd()}LoadJsonObj(t){let n=t,i=n.inkSaveVersion;if(null==i)throw new Error("ink save format incorrect, can't load.");if(parseInt(i)1){let t=n.currentFlowName;this._currentFlow=this._namedFlows.get(t)}}else{this._namedFlows=null,this._currentFlow.name=this.kDefaultFlowName,this._currentFlow.callStack.SetJsonToken(n.callstackThreads,this.story),this._currentFlow.outputStream=q.JArrayToRuntimeObjList(n.outputStream),this._currentFlow.currentChoices=q.JArrayToRuntimeObjList(n.currentChoices);let t=n.choiceThreads;this._currentFlow.LoadFlowChoiceThreads(t,this.story)}this.OutputStreamDirty(),this._aliveFlowNamesDirty=!0,this.variablesState.SetJsonToken(n.variablesState),this.variablesState.callStack=this._currentFlow.callStack,this._evaluationStack=q.JArrayToRuntimeObjList(n.evalStack);let a=n.currentDivertTarget;if(null!=a){let t=new e(a.toString());this.divertedPointer=this.story.PointerAtPath(t)}this._visitCounts=q.JObjectToIntDictionary(n.visitCounts),this._turnIndices=q.JObjectToIntDictionary(n.turnIndices),this.currentTurnIndex=parseInt(n.turnIdx),this.storySeed=parseInt(n.storySeed),this.previousRandom=parseInt(n.previousRandom)}ResetErrors(){this._currentErrors=null,this._currentWarnings=null}ResetOutput(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.outputStream.length=0,null!==t&&this.outputStream.push(...t),this.OutputStreamDirty()}PushToOutputStream(t){let e=s(t,E);if(null!==e){let t=this.TrySplittingHeadTailWhitespace(e);if(null!==t){for(let e of t)this.PushToOutputStreamIndividual(e);return void this.OutputStreamDirty()}}this.PushToOutputStreamIndividual(t),this.OutputStreamDirty()}PopFromOutputStream(t){this.outputStream.splice(this.outputStream.length-t,t),this.OutputStreamDirty()}TrySplittingHeadTailWhitespace(t){let e=t.value;if(null===e)return p("single.value");let n=-1,i=-1;for(let t=0;t=0;t--){let n=e[t];if("\n"!=n){if(" "==n||"\t"==n)continue;break}-1==r&&(r=t),a=t}if(-1==n&&-1==r)return null;let s=[],l=0,o=e.length;if(-1!=n){if(n>0){let t=new E(e.substring(0,n));s.push(t)}s.push(new E("\n")),l=i+1}if(-1!=r&&(o=a),o>l){let t=e.substring(l,o);s.push(new E(t))}if(-1!=r&&a>i&&(s.push(new E("\n")),r=0;e--){let n=this.outputStream[e],i=n instanceof k?n:null;if(null!=(n instanceof I?n:null)){a=e;break}if(null!=i&&i.commandType==k.CommandType.BeginString){e>=t&&(t=-1);break}}let s=-1;if(s=-1!=a&&-1!=t?Math.min(t,a):-1!=a?a:t,-1!=s){if(n.isNewline)i=!1;else if(n.isNonWhitespace&&(a>-1&&this.RemoveExistingGlue(),t>-1)){let t=this.callStack.elements;for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type!=r.Function)break;n.functionStartInOutputStream=-1}}}else n.isNewline&&(!this.outputStreamEndsInNewline&&this.outputStreamContainsContent||(i=!1))}if(i){if(null===t)return p("obj");this.outputStream.push(t),this.OutputStreamDirty()}}TrimNewlinesFromOutputStream(){let t=-1,e=this.outputStream.length-1;for(;e>=0;){let n=this.outputStream[e],i=s(n,k),r=s(n,E);if(null!=i||null!=r&&r.isNonWhitespace)break;null!=r&&r.isNewline&&(t=e),e--}if(t>=0)for(e=t;e=0;t--){let e=this.outputStream[t];if(e instanceof I)this.outputStream.splice(t,1);else if(e instanceof k)break}this.OutputStreamDirty()}get outputStreamEndsInNewline(){if(this.outputStream.length>0)for(let t=this.outputStream.length-1;t>=0;t--){if(this.outputStream[t]instanceof k)break;let e=this.outputStream[t];if(e instanceof E){if(e.isNewline)return!0;if(e.isNonWhitespace)break}}return!1}get outputStreamContainsContent(){for(let t of this.outputStream)if(t instanceof E)return!0;return!1}get inStringEvaluation(){for(let t=this.outputStream.length-1;t>=0;t--){let e=s(this.outputStream[t],k);if(e instanceof k&&e.commandType==k.CommandType.BeginString)return!0}return!1}PushEvaluationStack(t){let e=s(t,O);if(e){let t=e.value;if(null===t)return p("rawList");if(null!=t.originNames){t.origins||(t.origins=[]),t.origins.length=0;for(let e of t.originNames){if(null===this.story.listDefinitions)return p("StoryState.story.listDefinitions");let n=this.story.listDefinitions.TryListGetDefinition(e,null);if(null===n.result)return p("StoryState def.result");t.origins.indexOf(n.result)<0&&t.origins.push(n.result)}}}if(null===t)return p("obj");this.evaluationStack.push(t)}PopEvaluationStack(t){if(void 0===t){return h(this.evaluationStack.pop())}if(t>this.evaluationStack.length)throw new Error("trying to pop too many objects");return h(this.evaluationStack.splice(this.evaluationStack.length-t,t))}PeekEvaluationStack(){return this.evaluationStack[this.evaluationStack.length-1]}ForceEnd(){this.callStack.Reset(),this._currentFlow.currentChoices.length=0,this.currentPointer=F.Null,this.previousPointer=F.Null,this.didSafeExit=!0}TrimWhitespaceFromFunctionEnd(){n.Assert(this.callStack.currentElement.type==r.Function);let t=this.callStack.currentElement.functionStartInOutputStream;-1==t&&(t=0);for(let e=this.outputStream.length-1;e>=t;e--){let t=this.outputStream[e],n=s(t,E),i=s(t,k);if(null!=n){if(i)break;if(!n.isNewline&&!n.isInlineWhitespace)break;this.outputStream.splice(e,1),this.OutputStreamDirty()}}}PopCallStack(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.callStack.currentElement.type==r.Function&&this.TrimWhitespaceFromFunctionEnd(),this.callStack.Pop(t)}SetChosenPath(t,e){this._currentFlow.currentChoices.length=0;let n=this.story.PointerAtPath(t);n.isNull||-1!=n.index||(n.index=0),this.currentPointer=n,e&&this.currentTurnIndex++}StartFunctionEvaluationFromGame(t,e){this.callStack.Push(r.FunctionEvaluationFromGame,this.evaluationStack.length),this.callStack.currentElement.currentPointer=F.StartOf(t),this.PassArgumentsToEvaluationStack(e)}PassArgumentsToEvaluationStack(t){if(null!==t)for(let e=0;et;){let t=this.PopEvaluationStack();null===e&&(e=t)}if(this.PopCallStack(r.FunctionEvaluationFromGame),e){if(e instanceof D)return null;let t=l(e,b);return t.valueType==i.DivertTarget?t.valueObject.toString():t.valueObject}return null}AddError(t,e){e?(null==this._currentWarnings&&(this._currentWarnings=[]),this._currentWarnings.push(t)):(null==this._currentErrors&&(this._currentErrors=[]),this._currentErrors.push(t))}OutputStreamDirty(){this._outputStreamTextDirty=!0,this._outputStreamTagsDirty=!0}}class Q{constructor(){this.startTime=void 0}get ElapsedMilliseconds(){return void 0===this.startTime?0:(new Date).getTime()-this.startTime}Start(){this.startTime=(new Date).getTime()}Stop(){this.startTime=void 0}}!function(t){t[t.Author=0]="Author",t[t.Warning=1]="Warning",t[t.Error=2]="Error"}(a||(a={})),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&t>-9007199254740992&&t<9007199254740992&&Math.floor(t)===t});class Z extends m{get currentChoices(){let t=[];if(null===this._state)return p("this._state");for(let e of this._state.currentChoices)e.isInvisibleDefault||(e.index=t.length,t.push(e));return t}get currentText(){return this.IfAsyncWeCant("call currentText since it's a work in progress"),this.state.currentText}get currentTags(){return this.IfAsyncWeCant("call currentTags since it's a work in progress"),this.state.currentTags}get currentErrors(){return this.state.currentErrors}get currentWarnings(){return this.state.currentWarnings}get currentFlowName(){return this.state.currentFlowName}get currentFlowIsDefaultFlow(){return this.state.currentFlowIsDefaultFlow}get aliveFlowNames(){return this.state.aliveFlowNames}get hasError(){return this.state.hasError}get hasWarning(){return this.state.hasWarning}get variablesState(){return this.state.variablesState}get listDefinitions(){return this._listDefinitions}get state(){return this._state}StartProfiling(){}EndProfiling(){}constructor(){let t;super(),this.inkVersionMinimumCompatible=18,this.onError=null,this.onDidContinue=null,this.onMakeChoice=null,this.onEvaluateFunction=null,this.onCompleteEvaluateFunction=null,this.onChoosePathString=null,this._prevContainers=[],this.allowExternalFunctionFallbacks=!1,this._listDefinitions=null,this._variableObservers=null,this._hasValidatedExternals=!1,this._temporaryEvaluationContainer=null,this._asyncContinueActive=!1,this._stateSnapshotAtLastNewline=null,this._sawLookaheadUnsafeFunctionAfterNewline=!1,this._recursiveContinueCount=0,this._asyncSaving=!1,this._profiler=null;let e=null,n=null;if(arguments[0]instanceof x)t=arguments[0],void 0!==arguments[1]&&(e=arguments[1]),this._mainContentContainer=t;else if("string"==typeof arguments[0]){let t=arguments[0];n=$.TextToDictionary(t)}else n=arguments[0];if(null!=e&&(this._listDefinitions=new J(e)),this._externals=new Map,null!==n){let t=n,e=t.inkVersion;if(null==e)throw new Error("ink version number not found. Are you sure it's a valid .ink.json file?");let i=parseInt(e);if(i>Z.inkVersionCurrent)throw new Error("Version of ink used to build story was newer than the current version of the engine");if(iq.WriteRuntimeContainer(t,this._mainContentContainer))),null!=this._listDefinitions){t.WritePropertyStart("listDefs"),t.WriteObjectStart();for(let e of this._listDefinitions.lists){t.WritePropertyStart(e.name),t.WriteObjectStart();for(let[n,i]of e.items){let e=g.fromSerializedKey(n),r=i;t.WriteIntProperty(e.itemName,r)}t.WriteObjectEnd(),t.WritePropertyEnd()}t.WriteObjectEnd(),t.WritePropertyEnd()}if(t.WriteObjectEnd(),e)return t.toString()}ResetState(){this.IfAsyncWeCant("ResetState"),this._state=new Y(this),this._state.variablesState.ObserveVariableChange(this.VariableStateDidChangeEvent.bind(this)),this.ResetGlobals()}ResetErrors(){if(null===this._state)return p("this._state");this._state.ResetErrors()}ResetCallstack(){if(this.IfAsyncWeCant("ResetCallstack"),null===this._state)return p("this._state");this._state.ForceEnd()}ResetGlobals(){if(this._mainContentContainer.namedContent.get("global decl")){let t=this.state.currentPointer.copy();this.ChoosePath(new e("global decl"),!1),this.ContinueInternal(),this.state.currentPointer=t}this.state.variablesState.SnapshotDefaultGlobals()}SwitchFlow(t){if(this.IfAsyncWeCant("switch flow"),this._asyncSaving)throw new Error("Story is already in background saving mode, can't switch flow to "+t);this.state.SwitchFlow_Internal(t)}RemoveFlow(t){this.state.RemoveFlow_Internal(t)}SwitchToDefaultFlow(){this.state.SwitchToDefaultFlow_Internal()}Continue(){return this.ContinueAsync(0),this.currentText}get canContinue(){return this.state.canContinue}get asyncContinueComplete(){return!this._asyncContinueActive}ContinueAsync(t){this._hasValidatedExternals||this.ValidateExternalBindings(),this.ContinueInternal(t)}ContinueInternal(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;null!=this._profiler&&this._profiler.PreContinue();let e=t>0;if(this._recursiveContinueCount++,!this._asyncContinueActive){if(this._asyncContinueActive=e,!this.canContinue)throw new Error("Can't continue - should check canContinue before calling Continue");this._state.didSafeExit=!1,this._state.ResetOutput(),1==this._recursiveContinueCount&&(this._state.variablesState.batchObservingVariableChanges=!0)}let n=new Q;n.Start();let i=!1;this._sawLookaheadUnsafeFunctionAfterNewline=!1;do{try{i=this.ContinueSingleStep()}catch(t){if(!(t instanceof y))throw t;this.AddError(t.message,void 0,t.useEndLineNumber);break}if(i)break;if(this._asyncContinueActive&&n.ElapsedMilliseconds>t)break}while(this.canContinue);if(n.Stop(),!i&&this.canContinue||(null!==this._stateSnapshotAtLastNewline&&this.RestoreStateSnapshot(),this.canContinue||(this.state.callStack.canPopThread&&this.AddError("Thread available to pop, threads should always be flat by the end of evaluation?"),0!=this.state.generatedChoices.length||this.state.didSafeExit||null!=this._temporaryEvaluationContainer||(this.state.callStack.CanPop(r.Tunnel)?this.AddError("unexpectedly reached end of content. Do you need a '->->' to return from a tunnel?"):this.state.callStack.CanPop(r.Function)?this.AddError("unexpectedly reached end of content. Do you need a '~ return'?"):this.state.callStack.canPop?this.AddError("unexpectedly reached end of content for unknown reason. Please debug compiler!"):this.AddError("ran out of content. Do you need a '-> DONE' or '-> END'?"))),this.state.didSafeExit=!1,this._sawLookaheadUnsafeFunctionAfterNewline=!1,1==this._recursiveContinueCount&&(this._state.variablesState.batchObservingVariableChanges=!1),this._asyncContinueActive=!1,null!==this.onDidContinue&&this.onDidContinue()),this._recursiveContinueCount--,null!=this._profiler&&this._profiler.PostContinue(),this.state.hasError||this.state.hasWarning){if(null===this.onError){let t=new f;throw t.Append("Ink had "),this.state.hasError&&(t.Append(`${this.state.currentErrors.length}`),t.Append(1==this.state.currentErrors.length?" error":"errors"),this.state.hasWarning&&t.Append(" and ")),this.state.hasWarning&&(t.Append(`${this.state.currentWarnings.length}`),t.Append(1==this.state.currentWarnings.length?" warning":"warnings"),this.state.hasWarning&&t.Append(" and ")),t.Append(". It is strongly suggested that you assign an error handler to story.onError. The first issue was: "),t.Append(this.state.hasError?this.state.currentErrors[0]:this.state.currentWarnings[0]),new y(t.toString())}if(this.state.hasError)for(let t of this.state.currentErrors)this.onError(t,a.Error);if(this.state.hasWarning)for(let t of this.state.currentWarnings)this.onError(t,a.Warning);this.ResetErrors()}}ContinueSingleStep(){if(null!=this._profiler&&this._profiler.PreStep(),this.Step(),null!=this._profiler&&this._profiler.PostStep(),this.canContinue||this.state.callStack.elementIsEvaluateFromGame||this.TryFollowDefaultInvisibleChoice(),null!=this._profiler&&this._profiler.PreSnapshot(),!this.state.inStringEvaluation){if(null!==this._stateSnapshotAtLastNewline){if(null===this._stateSnapshotAtLastNewline.currentTags)return p("this._stateAtLastNewline.currentTags");if(null===this.state.currentTags)return p("this.state.currentTags");let t=this.CalculateNewlineOutputStateChange(this._stateSnapshotAtLastNewline.currentText,this.state.currentText,this._stateSnapshotAtLastNewline.currentTags.length,this.state.currentTags.length);if(t==Z.OutputStateChange.ExtendedBeyondNewline||this._sawLookaheadUnsafeFunctionAfterNewline)return this.RestoreStateSnapshot(),!0;t==Z.OutputStateChange.NewlineRemoved&&this.DiscardSnapshot()}this.state.outputStreamEndsInNewline&&(this.canContinue?null==this._stateSnapshotAtLastNewline&&this.StateSnapshot():this.DiscardSnapshot())}return null!=this._profiler&&this._profiler.PostSnapshot(),!1}CalculateNewlineOutputStateChange(t,e,n,i){if(null===t)return p("prevText");if(null===e)return p("currText");let r=e.length>=t.length&&t.length>0&&"\n"==e.charAt(t.length-1);if(n==i&&t.length==e.length&&r)return Z.OutputStateChange.NoChange;if(!r)return Z.OutputStateChange.NewlineRemoved;if(i>n)return Z.OutputStateChange.ExtendedBeyondNewline;for(let n=t.length;n0?this.Error("Failed to find content at path '"+t+"', and no approximation of it was possible."):i.approximate&&this.Warning("Failed to find content at path '"+t+"', so it was approximated to: '"+i.obj.path+"'."),e)}StateSnapshot(){this._stateSnapshotAtLastNewline=this._state,this._state=this._state.CopyAndStartPatching()}RestoreStateSnapshot(){null===this._stateSnapshotAtLastNewline&&p("_stateSnapshotAtLastNewline"),this._stateSnapshotAtLastNewline.RestoreAfterPatch(),this._state=this._stateSnapshotAtLastNewline,this._stateSnapshotAtLastNewline=null,this._asyncSaving||this._state.ApplyAnyPatch()}DiscardSnapshot(){this._asyncSaving||this._state.ApplyAnyPatch(),this._stateSnapshotAtLastNewline=null}CopyStateForBackgroundThreadSave(){if(this.IfAsyncWeCant("start saving on a background thread"),this._asyncSaving)throw new Error("Story is already in background saving mode, can't call CopyStateForBackgroundThreadSave again!");let t=this._state;return this._state=this._state.CopyAndStartPatching(),this._asyncSaving=!0,t}BackgroundSaveComplete(){null===this._stateSnapshotAtLastNewline&&this._state.ApplyAnyPatch(),this._asyncSaving=!1}Step(){let t=!0,e=this.state.currentPointer.copy();if(e.isNull)return;let n=s(e.Resolve(),x);for(;n&&(this.VisitContainer(n,!0),0!=n.content.length);)e=F.StartOf(n),n=s(e.Resolve(),x);this.state.currentPointer=e.copy(),null!=this._profiler&&this._profiler.Step(this.state.callStack);let i=e.Resolve(),r=this.PerformLogicAndFlowControl(i);if(this.state.currentPointer.isNull)return;r&&(t=!1);let a=s(i,V);if(a){let e=this.ProcessChoice(a);e&&this.state.generatedChoices.push(e),i=null,t=!1}if(i instanceof x&&(t=!1),t){let t=s(i,N);if(t&&-1==t.contextIndex){let e=this.state.callStack.ContextForVariableNamed(t.variableName);i=new N(t.variableName,e)}this.state.inExpressionEvaluation?this.state.PushEvaluationStack(i):this.state.PushToOutputStream(i)}this.NextContent();let l=s(i,k);l&&l.commandType==k.CommandType.StartThread&&this.state.callStack.PushThread()}VisitContainer(t,e){t.countingAtStartOnly&&!e||(t.visitsShouldBeCounted&&this.state.IncrementVisitCountForContainer(t),t.turnIndexShouldBeCounted&&this.state.RecordTurnIndexVisitToContainer(t))}VisitChangedContainersDueToDivert(){let t=this.state.previousPointer.copy(),e=this.state.currentPointer.copy();if(e.isNull||-1==e.index)return;if(this._prevContainers.length=0,!t.isNull){let e=s(t.Resolve(),x)||s(t.container,x);for(;e;)this._prevContainers.push(e),e=s(e.parent,x)}let n=e.Resolve();if(null==n)return;let i=s(n.parent,x),r=!0;for(;i&&(this._prevContainers.indexOf(i)<0||i.countingAtStartOnly);){let t=i.content.length>0&&n==i.content[0]&&r;t||(r=!1),this.VisitContainer(i,t),n=i,i=s(i.parent,x)}}PopChoiceStringAndTags(t){let e=l(this.state.PopEvaluationStack(),E);for(;this.state.evaluationStack.length>0&&null!=s(this.state.PeekEvaluationStack(),B);){let e=s(this.state.PopEvaluationStack(),B);e&&t.push(e.text)}return e.value}ProcessChoice(t){let e=!0;if(t.hasCondition){let t=this.state.PopEvaluationStack();this.IsTruthy(t)||(e=!1)}let n="",i="",r=[];if(t.hasChoiceOnlyContent&&(i=this.PopChoiceStringAndTags(r)||""),t.hasStartContent&&(n=this.PopChoiceStringAndTags(r)||""),t.onceOnly){this.state.VisitCountForContainer(t.choiceTarget)>0&&(e=!1)}if(!e)return null;let a=new G;return a.targetPath=t.pathOnChoice,a.sourcePath=t.path.toString(),a.isInvisibleDefault=t.isInvisibleDefault,a.threadAtGeneration=this.state.callStack.ForkThread(),a.tags=r.reverse(),a.text=(n+i).replace(/^[ \t]+|[ \t]+$/g,""),a}IsTruthy(t){if(t instanceof b){let e=t;if(e instanceof P){let t=e;return this.Error("Shouldn't use a divert target (to "+t.targetPath+") as a conditional value. Did you intend a function call 'likeThis()' or a read count check 'likeThis'? (no arrows)"),!1}return e.isTruthy}return!1}PerformLogicAndFlowControl(t){if(null==t)return!1;if(t instanceof W){let e=t;if(e.isConditional){let t=this.state.PopEvaluationStack();if(!this.IsTruthy(t))return!0}if(e.hasVariableTarget){let t=e.variableDivertName,n=this.state.variablesState.GetVariableWithName(t);if(null==n)this.Error("Tried to divert using a target from a variable that could not be found ("+t+")");else if(!(n instanceof P)){let e=s(n,w),i="Tried to divert to a target from a variable, but the variable ("+t+") didn't contain a divert target, it ";e instanceof w&&0==e.value?i+="was empty/null (the value 0).":i+="contained '"+n+"'.",this.Error(i)}let i=l(n,P);this.state.divertedPointer=this.PointerAtPath(i.targetPath)}else{if(e.isExternal)return this.CallExternalFunction(e.targetPathString,e.externalArgs),!0;this.state.divertedPointer=e.targetPointer.copy()}return e.pushesToStack&&this.state.callStack.Push(e.stackPushType,void 0,this.state.outputStream.length),this.state.divertedPointer.isNull&&!e.isExternal&&(e&&e.debugMetadata&&null!=e.debugMetadata.sourceName?this.Error("Divert target doesn't exist: "+e.debugMetadata.sourceName):this.Error("Divert resolution failed: "+e)),!0}if(t instanceof k){let e=t;switch(e.commandType){case k.CommandType.EvalStart:this.Assert(!1===this.state.inExpressionEvaluation,"Already in expression evaluation?"),this.state.inExpressionEvaluation=!0;break;case k.CommandType.EvalEnd:this.Assert(!0===this.state.inExpressionEvaluation,"Not in expression evaluation mode"),this.state.inExpressionEvaluation=!1;break;case k.CommandType.EvalOutput:if(this.state.evaluationStack.length>0){let t=this.state.PopEvaluationStack();if(!(t instanceof D)){let e=new E(t.toString());this.state.PushToOutputStream(e)}}break;case k.CommandType.NoOp:break;case k.CommandType.Duplicate:this.state.PushEvaluationStack(this.state.PeekEvaluationStack());break;case k.CommandType.PopEvaluatedValue:this.state.PopEvaluationStack();break;case k.CommandType.PopFunction:case k.CommandType.PopTunnel:let t=e.commandType==k.CommandType.PopFunction?r.Function:r.Tunnel,n=null;if(t==r.Tunnel){let t=this.state.PopEvaluationStack();n=s(t,P),null===n&&this.Assert(t instanceof D,"Expected void if ->-> doesn't override target")}if(this.state.TryExitFunctionEvaluationFromGame())break;if(this.state.callStack.currentElement.type==t&&this.state.callStack.canPop)this.state.PopCallStack(),n&&(this.state.divertedPointer=this.PointerAtPath(n.targetPath));else{let e=new Map;e.set(r.Function,"function return statement (~ return)"),e.set(r.Tunnel,"tunnel onwards statement (->->)");let n=e.get(this.state.callStack.currentElement.type);this.state.callStack.canPop||(n="end of flow (-> END or choice)");let i="Found "+e.get(t)+", when expected "+n;this.Error(i)}break;case k.CommandType.BeginString:this.state.PushToOutputStream(e),this.Assert(!0===this.state.inExpressionEvaluation,"Expected to be in an expression when evaluating a string"),this.state.inExpressionEvaluation=!1;break;case k.CommandType.BeginTag:this.state.PushToOutputStream(e);break;case k.CommandType.EndTag:if(this.state.inStringEvaluation){let t=[],e=0;for(let n=this.state.outputStream.length-1;n>=0;--n){let i=this.state.outputStream[n];e++;let r=s(i,k);if(null!=r){if(r.commandType==k.CommandType.BeginTag)break;this.Error("Unexpected ControlCommand while extracting tag from choice");break}i instanceof E&&t.push(i)}this.state.PopFromOutputStream(e);let n=new f;for(let e of t.reverse())n.Append(e.toString());let i=new B(this.state.CleanOutputWhitespace(n.toString()));this.state.PushEvaluationStack(i)}else this.state.PushToOutputStream(e);break;case k.CommandType.EndString:{let t=[],e=[],n=0;for(let i=this.state.outputStream.length-1;i>=0;--i){let r=this.state.outputStream[i];n++;let a=s(r,k);if(a&&a.commandType==k.CommandType.BeginString)break;r instanceof B&&e.push(r),r instanceof E&&t.push(r)}this.state.PopFromOutputStream(n);for(let t of e)this.state.PushToOutputStream(t);t=t.reverse();let i=new f;for(let e of t)i.Append(e.toString());this.state.inExpressionEvaluation=!0,this.state.PushEvaluationStack(new E(i.toString()));break}case k.CommandType.ChoiceCount:let i=this.state.generatedChoices.length;this.state.PushEvaluationStack(new w(i));break;case k.CommandType.Turns:this.state.PushEvaluationStack(new w(this.state.currentTurnIndex+1));break;case k.CommandType.TurnsSince:case k.CommandType.ReadCount:let a=this.state.PopEvaluationStack();if(!(a instanceof P)){let t="";a instanceof w&&(t=". Did you accidentally pass a read count ('knot_name') instead of a target ('-> knot_name')?"),this.Error("TURNS_SINCE / READ_COUNT expected a divert target (knot, stitch, label name), but saw "+a+t);break}let o,h=l(a,P),u=s(this.ContentAtPath(h.targetPath).correctObj,x);null!=u?o=e.commandType==k.CommandType.TurnsSince?this.state.TurnsSinceForContainer(u):this.state.VisitCountForContainer(u):(o=e.commandType==k.CommandType.TurnsSince?-1:0,this.Warning("Failed to find container for "+e.toString()+" lookup at "+h.targetPath.toString())),this.state.PushEvaluationStack(new w(o));break;case k.CommandType.Random:{let t=s(this.state.PopEvaluationStack(),w),e=s(this.state.PopEvaluationStack(),w);if(null==e||e instanceof w==!1)return this.Error("Invalid value for minimum parameter of RANDOM(min, max)");if(null==t||t instanceof w==!1)return this.Error("Invalid value for maximum parameter of RANDOM(min, max)");if(null===t.value)return p("maxInt.value");if(null===e.value)return p("minInt.value");let n=t.value-e.value+1;(!isFinite(n)||n>Number.MAX_SAFE_INTEGER)&&(n=Number.MAX_SAFE_INTEGER,this.Error("RANDOM was called with a range that exceeds the size that ink numbers can use.")),n<=0&&this.Error("RANDOM was called with minimum as "+e.value+" and maximum as "+t.value+". The maximum must be larger");let i=this.state.storySeed+this.state.previousRandom,r=new z(i).next(),a=r%n+e.value;this.state.PushEvaluationStack(new w(a)),this.state.previousRandom=r;break}case k.CommandType.SeedRandom:let c=s(this.state.PopEvaluationStack(),w);if(null==c||c instanceof w==!1)return this.Error("Invalid value passed to SEED_RANDOM");if(null===c.value)return p("minInt.value");this.state.storySeed=c.value,this.state.previousRandom=0,this.state.PushEvaluationStack(new D);break;case k.CommandType.VisitIndex:let d=this.state.VisitCountForContainer(this.state.currentPointer.container)-1;this.state.PushEvaluationStack(new w(d));break;case k.CommandType.SequenceShuffleIndex:let m=this.NextSequenceShuffleIndex();this.state.PushEvaluationStack(new w(m));break;case k.CommandType.StartThread:break;case k.CommandType.Done:this.state.callStack.canPopThread?this.state.callStack.PopThread():(this.state.didSafeExit=!0,this.state.currentPointer=F.Null);break;case k.CommandType.End:this.state.ForceEnd();break;case k.CommandType.ListFromInt:let v=s(this.state.PopEvaluationStack(),w),C=l(this.state.PopEvaluationStack(),E);if(null===v)throw new y("Passed non-integer when creating a list element from a numerical value.");let _=null;if(null===this.listDefinitions)return p("this.listDefinitions");let T=this.listDefinitions.TryListGetDefinition(C.value,null);if(!T.exists)throw new y("Failed to find LIST called "+C.value);{if(null===v.value)return p("minInt.value");let t=T.result.TryGetItemWithValue(v.value,g.Null);t.exists&&(_=new O(t.result,v.value))}null==_&&(_=new O),this.state.PushEvaluationStack(_);break;case k.CommandType.ListRange:let N=s(this.state.PopEvaluationStack(),b),A=s(this.state.PopEvaluationStack(),b),I=s(this.state.PopEvaluationStack(),O);if(null===I||null===A||null===N)throw new y("Expected list, minimum and maximum for LIST_RANGE");if(null===I.value)return p("targetList.value");let W=I.value.ListWithSubRange(A.valueObject,N.valueObject);this.state.PushEvaluationStack(new O(W));break;case k.CommandType.ListRandom:{let t=this.state.PopEvaluationStack();if(null===t)throw new y("Expected list for LIST_RANDOM");let e=t.value,n=null;if(null===e)throw p("list");if(0==e.Count)n=new S;else{let t=this.state.storySeed+this.state.previousRandom,i=new z(t).next(),r=i%e.Count,a=e.entries();for(let t=0;t<=r-1;t++)a.next();let s=a.next().value,l={Key:g.fromSerializedKey(s[0]),Value:s[1]};if(null===l.Key.originName)return p("randomItem.Key.originName");n=new S(l.Key.originName,this),n.Add(l.Key,l.Value),this.state.previousRandom=i}this.state.PushEvaluationStack(new O(n));break}default:this.Error("unhandled ControlCommand: "+e)}return!0}if(t instanceof R){let e=t,n=this.state.PopEvaluationStack();return this.state.variablesState.Assign(e,n),!0}if(t instanceof L){let e=t,n=null;if(null!=e.pathForCount){let t=e.containerForCount,i=this.state.VisitCountForContainer(t);n=new w(i)}else n=this.state.variablesState.GetVariableWithName(e.name),null==n&&(this.Warning("Variable not found: '"+e.name+"'. Using default value of 0 (false). This can happen with temporary variables if the declaration hasn't yet been hit. Globals are always given a default value on load if a value doesn't exist in the save state."),n=new w(0));return this.state.PushEvaluationStack(n),!0}if(t instanceof j){let e=t,n=this.state.PopEvaluationStack(e.numberOfParameters),i=e.Call(n);return this.state.PushEvaluationStack(i),!0}return!1}ChoosePathString(t){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(this.IfAsyncWeCant("call ChoosePathString right now"),null!==this.onChoosePathString&&this.onChoosePathString(t,i),n)this.ResetCallstack();else if(this.state.callStack.currentElement.type==r.Function){let e="",n=this.state.callStack.currentElement.currentPointer.container;throw null!=n&&(e="("+n.path.toString()+") "),new Error("Story was running a function "+e+"when you called ChoosePathString("+t+") - this is almost certainly not not what you want! Full stack trace: \n"+this.state.callStack.callStackTrace)}this.state.PassArgumentsToEvaluationStack(i),this.ChoosePath(new e(t))}IfAsyncWeCant(t){if(this._asyncContinueActive)throw new Error("Can't "+t+". Story is in the middle of a ContinueAsync(). Make more ContinueAsync() calls or a single Continue() call beforehand.")}ChoosePath(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.state.SetChosenPath(t,e),this.VisitChangedContainersDueToDivert()}ChooseChoiceIndex(t){let e=this.currentChoices;this.Assert(t>=0&&t1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null!==this.onEvaluateFunction&&this.onEvaluateFunction(t,e),this.IfAsyncWeCant("evaluate a function"),null==t)throw new Error("Function is null");if(""==t||""==t.trim())throw new Error("Function is empty or white space.");let i=this.KnotContainerWithName(t);if(null==i)throw new Error("Function doesn't exist: '"+t+"'");let r=[];r.push(...this.state.outputStream),this._state.ResetOutput(),this.state.StartFunctionEvaluationFromGame(i,e);let a=new f;for(;this.canContinue;)a.Append(this.Continue());let s=a.toString();this._state.ResetOutput(r);let l=this.state.CompleteFunctionEvaluationFromGame();return null!=this.onCompleteEvaluateFunction&&this.onCompleteEvaluateFunction(t,e,s,l),n?{returned:l,output:s}:l}EvaluateExpression(t){let e=this.state.callStack.elements.length;this.state.callStack.Push(r.Tunnel),this._temporaryEvaluationContainer=t,this.state.GoToStart();let n=this.state.evaluationStack.length;return this.Continue(),this._temporaryEvaluationContainer=null,this.state.callStack.elements.length>e&&this.state.PopCallStack(),this.state.evaluationStack.length>n?this.state.PopEvaluationStack():null}CallExternalFunction(t,e){if(null===t)return p("funcName");let n=this._externals.get(t),i=null,a=void 0!==n;if(a&&!n.lookAheadSafe&&null!==this._stateSnapshotAtLastNewline)return void(this._sawLookaheadUnsafeFunctionAfterNewline=!0);if(!a){if(this.allowExternalFunctionFallbacks)return i=this.KnotContainerWithName(t),this.Assert(null!==i,"Trying to call EXTERNAL function '"+t+"' which has not been bound, and fallback ink function could not be found."),this.state.callStack.Push(r.Function,void 0,this.state.outputStream.length),void(this.state.divertedPointer=F.StartOf(i));this.Assert(!1,"Trying to call EXTERNAL function '"+t+"' which has not been bound (and ink fallbacks disabled).")}let s=[];for(let t=0;t2&&void 0!==arguments[2])||arguments[2];this.IfAsyncWeCant("bind an external function"),this.Assert(!this._externals.has(t),"Function '"+t+"' has already been bound."),this._externals.set(t,{function:e,lookAheadSafe:n})}TryCoerce(t){return t}BindExternalFunction(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.Assert(null!=e,"Can't bind a null function"),this.BindExternalFunctionGeneral(t,(t=>{this.Assert(t.length>=e.length,"External function expected "+e.length+" arguments");let n=[];for(let e=0,i=t.length;e1?"s":"",t+=": '",t+=Array.from(n).join("', '"),t+="' ",t+=this.allowExternalFunctionFallbacks?", and no fallback ink function found.":" (ink fallbacks disabled)",this.Error(t)}else if(null!=t){for(let e of t.content){null!=e&&e.hasValidName||this.ValidateExternalBindings(e,n)}for(let[,e]of t.namedContent)this.ValidateExternalBindings(s(e,m),n)}else if(null!=e){let t=s(e,W);if(t&&t.isExternal){let e=t.targetPathString;if(null===e)return p("name");if(!this._externals.has(e))if(this.allowExternalFunctionFallbacks){this.mainContentContainer.namedContent.has(e)||n.add(e)}else n.add(e)}}}ObserveVariable(t,e){if(this.IfAsyncWeCant("observe a new variable"),null===this._variableObservers&&(this._variableObservers=new Map),!this.state.variablesState.GlobalVariableExistsWithName(t))throw new Error("Cannot observe variable '"+t+"' because it wasn't declared in the ink story.");this._variableObservers.has(t)?this._variableObservers.get(t).push(e):this._variableObservers.set(t,[e])}ObserveVariables(t,e){for(let n=0,i=t.length;n=e.container.content.length;){t=!1;let n=s(e.container.parent,x);if(n instanceof x==!1)break;let i=n.content.indexOf(e.container);if(-1==i)break;if(e=new F(n,i),e.index++,t=!0,null===e.container)return p("pointer.container")}return t||(e=F.Null),this.state.callStack.currentElement.currentPointer=e.copy(),t}TryFollowDefaultInvisibleChoice(){let t=this._state.currentChoices,e=t.filter((t=>t.isInvisibleDefault));if(0==e.length||t.length>e.length)return!1;let n=e[0];return null===n.targetPath?p("choice.targetPath"):null===n.threadAtGeneration?p("choice.threadAtGeneration"):(this.state.callStack.currentThread=n.threadAtGeneration,null!==this._stateSnapshotAtLastNewline&&(this.state.callStack.currentThread=this.state.callStack.ForkThread()),this.ChoosePath(n.targetPath,!1),!0)}NextSequenceShuffleIndex(){let t=s(this.state.PopEvaluationStack(),w);if(!(t instanceof w))return this.Error("expected number of elements in sequence for shuffle index"),0;let e=this.state.currentPointer.container;if(null===e)return p("seqContainer");if(null===t.value)return p("numElementsIntVal.value");let n=t.value,i=l(this.state.PopEvaluationStack(),w).value;if(null===i)return p("seqCount");let r=i/n,a=i%n,o=e.path.toString(),h=0;for(let t=0,e=o.length;t1&&void 0!==arguments[1]&&arguments[1],n=new y(t);throw n.useEndLineNumber=e,n}Warning(t){this.AddError(t,!0)}AddError(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.currentDebugMetadata,r=e?"WARNING":"ERROR";if(null!=i){let e=n?i.endLineNumber:i.startLineNumber;t="RUNTIME "+r+": '"+i.fileName+"' line "+e+": "+t}else t=this.state.currentPointer.isNull?"RUNTIME "+r+": "+t:"RUNTIME "+r+": ("+this.state.currentPointer+"): "+t;this.state.AddError(t,e),e||this.state.ForceEnd()}Assert(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(0==t)throw null==e&&(e="Story assert"),new Error(e+" "+this.currentDebugMetadata)}get currentDebugMetadata(){let t,e=this.state.currentPointer;if(!e.isNull&&null!==e.Resolve()&&(t=e.Resolve().debugMetadata,null!==t))return t;for(let n=this.state.callStack.elements.length-1;n>=0;--n)if(e=this.state.callStack.elements[n].currentPointer,!e.isNull&&null!==e.Resolve()&&(t=e.Resolve().debugMetadata,null!==t))return t;for(let e=this.state.outputStream.length-1;e>=0;--e){if(t=this.state.outputStream[e].debugMetadata,null!==t)return t}return null}get mainContentContainer(){return this._temporaryEvaluationContainer?this._temporaryEvaluationContainer:this._mainContentContainer}}Z.inkVersionCurrent=21,function(t){var e;(e=t.OutputStateChange||(t.OutputStateChange={}))[e.NoChange=0]="NoChange",e[e.ExtendedBeyondNewline=1]="ExtendedBeyondNewline",e[e.NewlineRemoved=2]="NewlineRemoved"}(Z||(Z={})),t.InkList=S,t.Story=Z})); //# sourceMappingURL=ink.js.map diff --git a/templates/browser_with_server/ink.js.map b/templates/browser_with_server/ink.js.map index 3df9068c..b591696d 100644 --- a/templates/browser_with_server/ink.js.map +++ b/templates/browser_with_server/ink.js.map @@ -1 +1 @@ -{"version":3,"file":"ink.js","sources":["../src/engine/Path.ts","../src/engine/Debug.ts","../src/engine/TypeAssertion.ts","../src/engine/NullException.ts","../src/engine/Object.ts","../src/engine/StringBuilder.ts","../src/engine/InkList.ts","../src/engine/StoryException.ts","../src/engine/TryGetResult.ts","../src/engine/Value.ts","../src/engine/SearchResult.ts","../src/engine/Container.ts","../src/engine/Glue.ts","../src/engine/PushPop.ts","../src/engine/ControlCommand.ts","../src/engine/Pointer.ts","../src/engine/Divert.ts","../src/engine/ChoicePoint.ts","../src/engine/VariableReference.ts","../src/engine/VariableAssignment.ts","../src/engine/Void.ts","../src/engine/NativeFunctionCall.ts","../src/engine/Tag.ts","../src/engine/Choice.ts","../src/engine/ListDefinition.ts","../src/engine/ListDefinitionsOrigin.ts","../src/engine/JsonSerialisation.ts","../src/engine/CallStack.ts","../src/engine/VariablesState.ts","../src/engine/PRNG.ts","../src/engine/StatePatch.ts","../src/engine/SimpleJson.ts","../src/engine/Flow.ts","../src/engine/Error.ts","../src/engine/Story.ts","../src/engine/StoryState.ts","../src/engine/StopWatch.ts"],"sourcesContent":["export class Path {\n public static parentId = \"^\";\n\n public _isRelative: boolean;\n public _components: Path.Component[];\n public _componentsString: string | null;\n\n constructor();\n constructor(componentsString: string);\n constructor(head: Path.Component, tail: Path);\n constructor(head: Path.Component[], relative?: boolean);\n constructor() {\n this._components = [];\n this._componentsString = null;\n this._isRelative = false;\n\n if (typeof arguments[0] == \"string\") {\n let componentsString = arguments[0] as string;\n this.componentsString = componentsString;\n } else if (\n arguments[0] instanceof Path.Component &&\n arguments[1] instanceof Path\n ) {\n let head = arguments[0] as Path.Component;\n let tail = arguments[1] as Path;\n this._components.push(head);\n this._components = this._components.concat(tail._components);\n } else if (arguments[0] instanceof Array) {\n let head = arguments[0] as Path.Component[];\n let relative = !!arguments[1] as boolean;\n this._components = this._components.concat(head);\n this._isRelative = relative;\n }\n }\n get isRelative() {\n return this._isRelative;\n }\n get componentCount(): number {\n return this._components.length;\n }\n get head(): Path.Component | null {\n if (this._components.length > 0) {\n return this._components[0];\n } else {\n return null;\n }\n }\n get tail(): Path {\n if (this._components.length >= 2) {\n // careful, the original code uses length-1 here. This is because the second argument of\n // List.GetRange is a number of elements to extract, wherease Array.slice uses an index\n let tailComps = this._components.slice(1, this._components.length);\n return new Path(tailComps);\n } else {\n return Path.self;\n }\n }\n get length(): number {\n return this._components.length;\n }\n get lastComponent(): Path.Component | null {\n let lastComponentIdx = this._components.length - 1;\n if (lastComponentIdx >= 0) {\n return this._components[lastComponentIdx];\n } else {\n return null;\n }\n }\n get containsNamedComponent(): boolean {\n for (let i = 0, l = this._components.length; i < l; i++) {\n if (!this._components[i].isIndex) {\n return true;\n }\n }\n return false;\n }\n static get self(): Path {\n let path = new Path();\n path._isRelative = true;\n return path;\n }\n\n public GetComponent(index: number): Path.Component {\n return this._components[index];\n }\n public PathByAppendingPath(pathToAppend: Path): Path {\n let p = new Path();\n\n let upwardMoves = 0;\n for (let i = 0; i < pathToAppend._components.length; ++i) {\n if (pathToAppend._components[i].isParent) {\n upwardMoves++;\n } else {\n break;\n }\n }\n\n for (let i = 0; i < this._components.length - upwardMoves; ++i) {\n p._components.push(this._components[i]);\n }\n\n for (let i = upwardMoves; i < pathToAppend._components.length; ++i) {\n p._components.push(pathToAppend._components[i]);\n }\n\n return p;\n }\n get componentsString(): string {\n if (this._componentsString == null) {\n this._componentsString = this._components.join(\".\");\n if (this.isRelative)\n this._componentsString = \".\" + this._componentsString;\n }\n\n return this._componentsString;\n }\n set componentsString(value: string) {\n this._components.length = 0;\n\n this._componentsString = value;\n\n if (this._componentsString == null || this._componentsString == \"\") return;\n\n if (this._componentsString[0] == \".\") {\n this._isRelative = true;\n this._componentsString = this._componentsString.substring(1);\n }\n\n let componentStrings = this._componentsString.split(\".\");\n for (let str of componentStrings) {\n // we need to distinguish between named components that start with a number, eg \"42somewhere\", and indexed components\n // the normal parseInt won't do for the detection because it's too relaxed.\n // see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt\n if (/^(\\-|\\+)?([0-9]+|Infinity)$/.test(str)) {\n this._components.push(new Path.Component(parseInt(str)));\n } else {\n this._components.push(new Path.Component(str));\n }\n }\n }\n public toString(): string {\n return this.componentsString;\n }\n public Equals(otherPath: Path | null): boolean {\n if (otherPath == null) return false;\n\n if (otherPath._components.length != this._components.length) return false;\n\n if (otherPath.isRelative != this.isRelative) return false;\n\n // the original code uses SequenceEqual here, so we need to iterate over the components manually.\n for (let i = 0, l = otherPath._components.length; i < l; i++) {\n // it's not quite clear whether this test should use Equals or a simple == operator,\n // see https://github.com/y-lohse/inkjs/issues/22\n if (!otherPath._components[i].Equals(this._components[i])) return false;\n }\n\n return true;\n }\n public PathByAppendingComponent(c: Path.Component): Path {\n let p = new Path();\n p._components.push(...this._components);\n p._components.push(c);\n return p;\n }\n}\n\nexport namespace Path {\n export class Component {\n public readonly index: number;\n public readonly name: string | null;\n\n constructor(indexOrName: string | number) {\n this.index = -1;\n this.name = null;\n if (typeof indexOrName == \"string\") {\n this.name = indexOrName;\n } else {\n this.index = indexOrName;\n }\n }\n get isIndex(): boolean {\n return this.index >= 0;\n }\n get isParent(): boolean {\n return this.name == Path.parentId;\n }\n\n public static ToParent(): Component {\n return new Component(Path.parentId);\n }\n public toString(): string | null {\n if (this.isIndex) {\n return this.index.toString();\n } else {\n return this.name;\n }\n }\n public Equals(otherComp: Component): boolean {\n if (otherComp != null && otherComp.isIndex == this.isIndex) {\n if (this.isIndex) {\n return this.index == otherComp.index;\n } else {\n return this.name == otherComp.name;\n }\n }\n\n return false;\n }\n }\n}\n","export namespace Debug {\n export function AssertType(\n variable: any,\n type: new () => T,\n message: string\n ): void | never {\n Assert(variable instanceof type, message);\n }\n\n export function Assert(condition: boolean, message?: string): void | never {\n if (!condition) {\n if (typeof message !== \"undefined\") {\n console.warn(message);\n }\n\n if (console.trace) {\n console.trace();\n }\n\n throw new Error(\"\");\n }\n }\n}\n","import { INamedContent } from \"./INamedContent\";\n\nexport function asOrNull(\n obj: any,\n type: (new (...arg: any[]) => T) | (Function & { prototype: T })\n): T | null {\n if (obj instanceof type) {\n return unsafeTypeAssertion(obj, type);\n } else {\n return null;\n }\n}\n\nexport function asOrThrows(\n obj: any,\n type: (new (...arg: any[]) => T) | (Function & { prototype: T })\n): T | never {\n if (obj instanceof type) {\n return unsafeTypeAssertion(obj, type);\n } else {\n throw new Error(`${obj} is not of type ${type}`);\n }\n}\n\nexport function asNumberOrThrows(obj: any) {\n if (typeof obj === \"number\") {\n return obj as number;\n } else {\n throw new Error(`${obj} is not a number`);\n }\n}\n\nexport function asBooleanOrThrows(obj: any) {\n if (typeof obj === \"boolean\") {\n return obj as boolean;\n } else {\n throw new Error(`${obj} is not a boolean`);\n }\n}\n\n// So here, in the reference implementation, contentObj is casted to an INamedContent\n// but here we use js-style duck typing: if it implements the same props as the interface,\n// we treat it as valid.\nexport function asINamedContentOrNull(obj: any): INamedContent | null {\n if (obj.hasValidName && obj.name) {\n return obj as INamedContent;\n }\n\n return null;\n}\n\nexport function nullIfUndefined(obj: T | undefined): T | null {\n if (typeof obj === \"undefined\") {\n return null;\n }\n\n return obj;\n}\n\nexport function isEquatable(type: any) {\n return typeof type === \"object\" && typeof type.Equals === \"function\";\n}\n\nfunction unsafeTypeAssertion(\n obj: any,\n type: (new () => T) | (Function & { prototype: T })\n) {\n return obj as T;\n}\n\nexport function filterUndef(element: T | undefined): element is T {\n return element != undefined;\n}\n","/**\n * In the original C# code, a SystemException would be thrown when passing\n * null to methods expected a valid instance. Javascript has no such\n * concept, but TypeScript will not allow `null` to be passed to methods\n * explicitely requiring a valid type.\n *\n * Whenever TypeScript complain about the possibility of a `null` value,\n * check the offending value and it it's null, throw this exception using\n * `throwNullException(name: string)`.\n */\nexport class NullException extends Error {}\n\n/**\n * Throw a NullException.\n *\n * @param name a short description of the offending value (often its name within the code).\n */\nexport function throwNullException(name: string): never {\n throw new NullException(`${name} is null or undefined`);\n}\n","import { Path } from \"./Path\";\nimport { Container } from \"./Container\";\nimport { Debug } from \"./Debug\";\nimport { asOrNull, asINamedContentOrNull } from \"./TypeAssertion\";\nimport { throwNullException } from \"./NullException\";\nimport { SearchResult } from \"./SearchResult\";\nimport { DebugMetadata } from \"./DebugMetadata\";\n\nexport class InkObject {\n public parent: InkObject | null = null;\n\n get debugMetadata(): DebugMetadata | null {\n if (this._debugMetadata === null) {\n if (this.parent) {\n return this.parent.debugMetadata;\n }\n }\n\n return this._debugMetadata;\n }\n\n set debugMetadata(value) {\n this._debugMetadata = value;\n }\n\n get ownDebugMetadata() {\n return this._debugMetadata;\n }\n\n private _debugMetadata: DebugMetadata | null = null;\n\n public DebugLineNumberOfPath(path: Path) {\n if (path === null) return null;\n\n // Try to get a line number from debug metadata\n let root = this.rootContentContainer;\n if (root) {\n let targetContent = root.ContentAtPath(path).obj;\n if (targetContent) {\n let dm = targetContent.debugMetadata;\n if (dm !== null) {\n return dm.startLineNumber;\n }\n }\n }\n\n return null;\n }\n\n get path() {\n if (this._path == null) {\n if (this.parent == null) {\n this._path = new Path();\n } else {\n let comps: Path.Component[] = [];\n\n let child: InkObject = this;\n let container = asOrNull(child.parent, Container);\n\n while (container !== null) {\n let namedChild = asINamedContentOrNull(child);\n if (namedChild != null && namedChild.hasValidName) {\n if (namedChild.name === null)\n return throwNullException(\"namedChild.name\");\n comps.unshift(new Path.Component(namedChild.name!));\n } else {\n comps.unshift(new Path.Component(container.content.indexOf(child)));\n }\n\n child = container;\n container = asOrNull(container.parent, Container);\n }\n\n this._path = new Path(comps);\n }\n }\n\n return this._path;\n }\n private _path: Path | null = null;\n\n public ResolvePath(path: Path | null): SearchResult {\n if (path === null) return throwNullException(\"path\");\n if (path.isRelative) {\n let nearestContainer = asOrNull(this, Container);\n\n if (nearestContainer === null) {\n Debug.Assert(\n this.parent !== null,\n \"Can't resolve relative path because we don't have a parent\"\n );\n nearestContainer = asOrNull(this.parent, Container);\n Debug.Assert(\n nearestContainer !== null,\n \"Expected parent to be a container\"\n );\n Debug.Assert(path.GetComponent(0).isParent);\n path = path.tail;\n }\n\n if (nearestContainer === null) {\n return throwNullException(\"nearestContainer\");\n }\n return nearestContainer.ContentAtPath(path);\n } else {\n let contentContainer = this.rootContentContainer;\n if (contentContainer === null) {\n return throwNullException(\"contentContainer\");\n }\n return contentContainer.ContentAtPath(path);\n }\n }\n\n public ConvertPathToRelative(globalPath: Path) {\n let ownPath = this.path;\n\n let minPathLength = Math.min(globalPath.length, ownPath.length);\n let lastSharedPathCompIndex = -1;\n\n for (let i = 0; i < minPathLength; ++i) {\n let ownComp = ownPath.GetComponent(i);\n let otherComp = globalPath.GetComponent(i);\n\n if (ownComp.Equals(otherComp)) {\n lastSharedPathCompIndex = i;\n } else {\n break;\n }\n }\n\n // No shared path components, so just use global path\n if (lastSharedPathCompIndex == -1) return globalPath;\n\n let numUpwardsMoves = ownPath.componentCount - 1 - lastSharedPathCompIndex;\n\n let newPathComps: Path.Component[] = [];\n\n for (let up = 0; up < numUpwardsMoves; ++up)\n newPathComps.push(Path.Component.ToParent());\n\n for (\n let down = lastSharedPathCompIndex + 1;\n down < globalPath.componentCount;\n ++down\n )\n newPathComps.push(globalPath.GetComponent(down));\n\n let relativePath = new Path(newPathComps, true);\n return relativePath;\n }\n\n public CompactPathString(otherPath: Path) {\n let globalPathStr = null;\n let relativePathStr = null;\n\n if (otherPath.isRelative) {\n relativePathStr = otherPath.componentsString;\n globalPathStr = this.path.PathByAppendingPath(otherPath).componentsString;\n } else {\n let relativePath = this.ConvertPathToRelative(otherPath);\n relativePathStr = relativePath.componentsString;\n globalPathStr = otherPath.componentsString;\n }\n\n if (relativePathStr.length < globalPathStr.length) return relativePathStr;\n else return globalPathStr;\n }\n\n get rootContentContainer() {\n let ancestor: InkObject = this;\n while (ancestor.parent) {\n ancestor = ancestor.parent;\n }\n return asOrNull(ancestor, Container);\n }\n\n public Copy(): InkObject {\n throw Error(\"Not Implemented: Doesn't support copying\");\n }\n // SetChild works slightly diferently in the js implementation.\n // Since we can't pass an objets property by reference, we instead pass\n // the object and the property string.\n // TODO: This method can probably be rewritten with type-safety in mind.\n public SetChild(obj: any, prop: any, value: any) {\n if (obj[prop]) obj[prop] = null;\n\n obj[prop] = value;\n\n if (obj[prop]) obj[prop].parent = this;\n }\n\n public Equals(obj: any) {\n return obj === this;\n }\n}\n","export class StringBuilder {\n private string: string;\n\n constructor(str?: string) {\n str = typeof str !== \"undefined\" ? str.toString() : \"\";\n this.string = str;\n }\n get Length(): number {\n return this.string.length;\n }\n public Append(str: string | null) {\n if (str !== null) {\n this.string += str;\n }\n }\n public AppendLine(str?: string) {\n if (typeof str !== \"undefined\") this.Append(str);\n this.string += \"\\n\";\n }\n public AppendFormat(format: string, ...args: any[]) {\n // taken from http://stackoverflow.com/questions/610406/javascript-equivalent-to-printf-string-format\n this.string += format.replace(/{(\\d+)}/g, (match: string, num: number) =>\n typeof args[num] != \"undefined\" ? args[num] : match\n );\n }\n public toString(): string {\n return this.string;\n }\n\n public Clear() {\n this.string = \"\";\n }\n}\n","import { throwNullException } from \"./NullException\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { ListDefinition } from \"./ListDefinition\";\nimport { Story } from \"./Story\";\n\nexport class InkListItem implements IInkListItem {\n // InkListItem is a struct\n\n public readonly originName: string | null = null;\n public readonly itemName: string | null = null;\n\n constructor(originName: string | null, itemName: string | null);\n constructor(fullName: string | null);\n constructor() {\n if (typeof arguments[1] !== \"undefined\") {\n let originName = arguments[0] as string | null;\n let itemName = arguments[1] as string | null;\n\n this.originName = originName;\n this.itemName = itemName;\n } else if (arguments[0]) {\n let fullName = arguments[0] as string;\n\n let nameParts = fullName.toString().split(\".\");\n this.originName = nameParts[0];\n this.itemName = nameParts[1];\n }\n }\n public static get Null() {\n return new InkListItem(null, null);\n }\n public get isNull() {\n return this.originName == null && this.itemName == null;\n }\n get fullName() {\n return (\n (this.originName !== null ? this.originName : \"?\") + \".\" + this.itemName\n );\n }\n public toString(): string {\n return this.fullName;\n }\n public Equals(obj: InkListItem) {\n if (obj instanceof InkListItem) {\n let otherItem = obj;\n return (\n otherItem.itemName == this.itemName &&\n otherItem.originName == this.originName\n );\n }\n\n return false;\n }\n\n // These methods did not exist in the original C# code. Their purpose is to\n // make `InkListItem` mimics the value-type semantics of the original\n // struct. Please refer to the end of this file, for a more in-depth\n // explanation.\n\n /**\n * Returns a shallow clone of the current instance.\n */\n public copy() {\n return new InkListItem(this.originName, this.itemName);\n }\n /**\n * Returns a `SerializedInkListItem` representing the current\n * instance. The result is intended to be used as a key inside a Map.\n */\n public serialized(): SerializedInkListItem {\n // We are simply using a JSON representation as a value-typed key.\n return JSON.stringify({\n originName: this.originName,\n itemName: this.itemName,\n });\n }\n\n /**\n * Reconstructs a `InkListItem` from the given SerializedInkListItem.\n */\n public static fromSerializedKey(key: SerializedInkListItem): InkListItem {\n let obj = JSON.parse(key);\n if (!InkListItem.isLikeInkListItem(obj)) return InkListItem.Null;\n\n let inkListItem = obj as IInkListItem;\n\n return new InkListItem(inkListItem.originName, inkListItem.itemName);\n }\n\n /**\n * Determines whether the given item is sufficiently `InkListItem`-like\n * to be used as a template when reconstructing the InkListItem.\n */\n private static isLikeInkListItem(item: any) {\n if (typeof item !== \"object\") return false;\n if (!item.hasOwnProperty(\"originName\") || !item.hasOwnProperty(\"itemName\"))\n return false;\n if (typeof item.originName !== \"string\" && typeof item.originName !== null)\n return false;\n if (typeof item.itemName !== \"string\" && typeof item.itemName !== null)\n return false;\n\n return true;\n }\n}\n\nexport class InkList extends Map {\n public origins: ListDefinition[] | null = null;\n public _originNames: string[] | null = [];\n\n constructor();\n constructor(otherList: InkList);\n constructor(singleOriginListName: string, originStory: Story);\n constructor(singleElement: KeyValuePair);\n constructor() {\n // Trying to be smart here, this emulates the constructor inheritance found\n // in the original code, but only if otherList is an InkList. IIFE FTW.\n super(\n (() => {\n if (arguments[0] instanceof InkList) {\n return arguments[0];\n } else {\n return [];\n }\n })()\n );\n\n if (arguments[0] instanceof InkList) {\n let otherList = arguments[0] as InkList;\n\n let otherOriginNames = otherList.originNames as string[];\n if (otherOriginNames !== null)\n this._originNames = otherOriginNames.slice();\n if (otherList.origins !== null) {\n this.origins = otherList.origins.slice();\n }\n } else if (typeof arguments[0] === \"string\") {\n let singleOriginListName = arguments[0] as string;\n let originStory = arguments[1] as Story;\n this.SetInitialOriginName(singleOriginListName);\n\n if (originStory.listDefinitions === null) {\n return throwNullException(\"originStory.listDefinitions\");\n }\n let def = originStory.listDefinitions.TryListGetDefinition(\n singleOriginListName,\n null\n );\n if (def.exists) {\n // Throwing now, because if the value is `null` it will\n // eventually throw down the line.\n if (def.result === null) {\n return throwNullException(\"def.result\");\n }\n this.origins = [def.result];\n } else {\n throw new Error(\n \"InkList origin could not be found in story when constructing new list: \" +\n singleOriginListName\n );\n }\n } else if (\n typeof arguments[0] === \"object\" &&\n arguments[0].hasOwnProperty(\"Key\") &&\n arguments[0].hasOwnProperty(\"Value\")\n ) {\n let singleElement = arguments[0] as KeyValuePair;\n this.Add(singleElement.Key, singleElement.Value);\n }\n }\n\n public static FromString(myListItem: string, originStory: Story) {\n let listValue =\n originStory.listDefinitions?.FindSingleItemListWithName(myListItem);\n if (listValue) {\n if (listValue.value === null) {\n return throwNullException(\"listValue.value\");\n }\n return new InkList(listValue.value);\n } else {\n throw new Error(\n \"Could not find the InkListItem from the string '\" +\n myListItem +\n \"' to create an InkList because it doesn't exist in the original list definition in ink.\"\n );\n }\n }\n\n public AddItem(itemOrItemName: InkListItem | string | null) {\n if (itemOrItemName instanceof InkListItem) {\n let item = itemOrItemName;\n\n if (item.originName == null) {\n this.AddItem(item.itemName);\n return;\n }\n\n if (this.origins === null) return throwNullException(\"this.origins\");\n\n for (let origin of this.origins) {\n if (origin.name == item.originName) {\n let intVal = origin.TryGetValueForItem(item, 0);\n if (intVal.exists) {\n this.Add(item, intVal.result);\n return;\n } else {\n throw new Error(\n \"Could not add the item \" +\n item +\n \" to this list because it doesn't exist in the original list definition in ink.\"\n );\n }\n }\n }\n\n throw new Error(\n \"Failed to add item to list because the item was from a new list definition that wasn't previously known to this list. Only items from previously known lists can be used, so that the int value can be found.\"\n );\n } else {\n let itemName = itemOrItemName as string | null;\n\n let foundListDef: ListDefinition | null = null;\n\n if (this.origins === null) return throwNullException(\"this.origins\");\n\n for (let origin of this.origins) {\n if (itemName === null) return throwNullException(\"itemName\");\n\n if (origin.ContainsItemWithName(itemName)) {\n if (foundListDef != null) {\n throw new Error(\n \"Could not add the item \" +\n itemName +\n \" to this list because it could come from either \" +\n origin.name +\n \" or \" +\n foundListDef.name\n );\n } else {\n foundListDef = origin;\n }\n }\n }\n\n if (foundListDef == null)\n throw new Error(\n \"Could not add the item \" +\n itemName +\n \" to this list because it isn't known to any list definitions previously associated with this list.\"\n );\n\n let item = new InkListItem(foundListDef.name, itemName);\n let itemVal = foundListDef.ValueForItem(item);\n this.Add(item, itemVal);\n }\n }\n public ContainsItemNamed(itemName: string | null) {\n for (let [key] of this) {\n let item = InkListItem.fromSerializedKey(key);\n if (item.itemName == itemName) return true;\n }\n\n return false;\n }\n public ContainsKey(key: InkListItem) {\n return this.has(key.serialized());\n }\n public Add(key: InkListItem, value: number) {\n let serializedKey = key.serialized();\n if (this.has(serializedKey)) {\n // Throw an exception to match the C# behavior.\n throw new Error(`The Map already contains an entry for ${key}`);\n }\n this.set(serializedKey, value);\n }\n public Remove(key: InkListItem) {\n return this.delete(key.serialized());\n }\n get Count() {\n return this.size;\n }\n get originOfMaxItem(): ListDefinition | null {\n if (this.origins == null) return null;\n\n let maxOriginName = this.maxItem.Key.originName;\n let result = null;\n this.origins.every((origin) => {\n if (origin.name == maxOriginName) {\n result = origin;\n return false;\n } else return true;\n });\n\n return result;\n }\n get originNames(): string[] {\n if (this.Count > 0) {\n if (this._originNames == null && this.Count > 0) this._originNames = [];\n else {\n if (!this._originNames) this._originNames = [];\n this._originNames.length = 0;\n }\n\n for (let [key] of this) {\n let item = InkListItem.fromSerializedKey(key);\n if (item.originName === null)\n return throwNullException(\"item.originName\");\n this._originNames.push(item.originName);\n }\n }\n\n return this._originNames as string[];\n }\n public SetInitialOriginName(initialOriginName: string) {\n this._originNames = [initialOriginName];\n }\n public SetInitialOriginNames(initialOriginNames: string[]) {\n if (initialOriginNames == null) this._originNames = null;\n else this._originNames = initialOriginNames.slice(); // store a copy\n }\n get maxItem() {\n let max: KeyValuePair = {\n Key: InkListItem.Null,\n Value: 0,\n };\n for (let [key, value] of this) {\n let item = InkListItem.fromSerializedKey(key);\n if (max.Key.isNull || value > max.Value)\n max = { Key: item, Value: value };\n }\n\n return max;\n }\n get minItem() {\n let min: KeyValuePair = {\n Key: InkListItem.Null,\n Value: 0,\n };\n for (let [key, value] of this) {\n let item = InkListItem.fromSerializedKey(key);\n if (min.Key.isNull || value < min.Value) {\n min = { Key: item, Value: value };\n }\n }\n return min;\n }\n get inverse() {\n let list = new InkList();\n if (this.origins != null) {\n for (let origin of this.origins) {\n for (let [key, value] of origin.items) {\n let item = InkListItem.fromSerializedKey(key);\n if (!this.ContainsKey(item)) list.Add(item, value);\n }\n }\n }\n return list;\n }\n get all() {\n let list = new InkList();\n if (this.origins != null) {\n for (let origin of this.origins) {\n for (let [key, value] of origin.items) {\n let item = InkListItem.fromSerializedKey(key);\n list.set(item.serialized(), value);\n }\n }\n }\n return list;\n }\n public Union(otherList: InkList) {\n let union = new InkList(this);\n for (let [key, value] of otherList) {\n union.set(key, value);\n }\n return union;\n }\n public Intersect(otherList: InkList) {\n let intersection = new InkList();\n for (let [key, value] of this) {\n if (otherList.has(key)) intersection.set(key, value);\n }\n\n return intersection;\n }\n public HasIntersection(otherList: InkList): boolean {\n for (let [key] of this) {\n if (otherList.has(key)) return true;\n }\n return false;\n }\n public Without(listToRemove: InkList) {\n let result = new InkList(this);\n for (let [key] of listToRemove) {\n result.delete(key);\n }\n\n return result;\n }\n\n public Contains(key: string): boolean;\n public Contains(otherList: InkList): boolean;\n public Contains(what: string | InkList): boolean {\n if (typeof what == \"string\") return this.ContainsItemNamed(what);\n const otherList = what;\n if (otherList.size == 0 || this.size == 0) return false;\n for (let [key] of otherList) {\n if (!this.has(key)) return false;\n }\n\n return true;\n }\n public GreaterThan(otherList: InkList) {\n if (this.Count == 0) return false;\n if (otherList.Count == 0) return true;\n\n return this.minItem.Value > otherList.maxItem.Value;\n }\n public GreaterThanOrEquals(otherList: InkList) {\n if (this.Count == 0) return false;\n if (otherList.Count == 0) return true;\n\n return (\n this.minItem.Value >= otherList.minItem.Value &&\n this.maxItem.Value >= otherList.maxItem.Value\n );\n }\n public LessThan(otherList: InkList) {\n if (otherList.Count == 0) return false;\n if (this.Count == 0) return true;\n\n return this.maxItem.Value < otherList.minItem.Value;\n }\n public LessThanOrEquals(otherList: InkList) {\n if (otherList.Count == 0) return false;\n if (this.Count == 0) return true;\n\n return (\n this.maxItem.Value <= otherList.maxItem.Value &&\n this.minItem.Value <= otherList.minItem.Value\n );\n }\n public MaxAsList() {\n if (this.Count > 0) return new InkList(this.maxItem);\n else return new InkList();\n }\n public MinAsList() {\n if (this.Count > 0) return new InkList(this.minItem);\n else return new InkList();\n }\n public ListWithSubRange(minBound: any, maxBound: any) {\n if (this.Count == 0) return new InkList();\n\n let ordered = this.orderedItems;\n\n let minValue = 0;\n let maxValue = Number.MAX_SAFE_INTEGER;\n\n if (Number.isInteger(minBound)) {\n minValue = minBound;\n } else {\n if (minBound instanceof InkList && minBound.Count > 0)\n minValue = minBound.minItem.Value;\n }\n\n if (Number.isInteger(maxBound)) {\n maxValue = maxBound;\n } else {\n if (minBound instanceof InkList && minBound.Count > 0)\n maxValue = maxBound.maxItem.Value;\n }\n\n let subList = new InkList();\n subList.SetInitialOriginNames(this.originNames);\n for (let item of ordered) {\n if (item.Value >= minValue && item.Value <= maxValue) {\n subList.Add(item.Key, item.Value);\n }\n }\n\n return subList;\n }\n public Equals(otherInkList: InkList) {\n if (otherInkList instanceof InkList === false) return false;\n if (otherInkList.Count != this.Count) return false;\n\n for (let [key] of this) {\n if (!otherInkList.has(key)) return false;\n }\n\n return true;\n }\n // GetHashCode not implemented\n get orderedItems() {\n // List>\n let ordered = new Array>();\n\n for (let [key, value] of this) {\n let item = InkListItem.fromSerializedKey(key);\n ordered.push({ Key: item, Value: value });\n }\n\n ordered.sort((x, y) => {\n if (x.Key.originName === null) {\n return throwNullException(\"x.Key.originName\");\n }\n if (y.Key.originName === null) {\n return throwNullException(\"y.Key.originName\");\n }\n\n if (x.Value == y.Value) {\n return x.Key.originName.localeCompare(y.Key.originName);\n } else {\n // TODO: refactor this bit into a numberCompareTo method?\n if (x.Value < y.Value) return -1;\n return x.Value > y.Value ? 1 : 0;\n }\n });\n\n return ordered;\n }\n public toString() {\n let ordered = this.orderedItems;\n\n let sb = new StringBuilder();\n for (let i = 0; i < ordered.length; i++) {\n if (i > 0) sb.Append(\", \");\n\n let item = ordered[i].Key;\n if (item.itemName === null) return throwNullException(\"item.itemName\");\n sb.Append(item.itemName);\n }\n\n return sb.toString();\n }\n // casting a InkList to a Number, for somereason, actually gives a number.\n // This messes up the type detection when creating a Value from a InkList.\n // Returning NaN here prevents that.\n public valueOf() {\n return NaN;\n }\n}\n\n/**\n * In the original C# code, `InkListItem` was defined as value type, meaning\n * that two `InkListItem` would be considered equal as long as they held the\n * same values. This doesn't hold true in Javascript, as `InkListItem` is a\n * reference type (Javascript doesn't allow the creation of custom value types).\n *\n * The key equality of Map objects is based on the \"SameValueZero\" algorithm;\n * since `InkListItem` is a value type, two keys will only be considered\n * equal if they are, in fact, the same object. As we are trying to emulate\n * the original behavior as close as possible, this will lead to unforeseen\n * side effects.\n *\n * In order to have a key equality based on value semantics, we'll convert\n * `InkListItem` to a valid string representation and use this representation\n * as a key (strings are value types in Javascript). Rather than using the\n * type `string` directly, we'll alias it to `SerializedInkListItem` and use\n * this type as the key for our Map-based `InkList`.\n *\n * Reducing `InkListItem` to a JSON representation would not be bulletproof\n * in the general case, but for our needs it works well. The major downside of\n * this method is that we will have to to reconstruct the original `InkListItem`\n * every time we'll need to access its properties.\n */\nexport type SerializedInkListItem = string;\n\n/**\n * An interface inherited by `InkListItem`, defining exposed\n * properties. It's mainly used when deserializing a `InkListItem` from its\n * key (`SerializedInkListItem`)\n */\ninterface IInkListItem {\n readonly originName: string | null;\n readonly itemName: string | null;\n}\nexport interface KeyValuePair {\n Key: K;\n Value: V;\n}\n","export class StoryException extends Error {\n public useEndLineNumber: boolean;\n public message: string;\n public name: string;\n\n constructor(message: string) {\n super(message);\n this.useEndLineNumber = false;\n this.message = message;\n this.name = \"StoryException\";\n }\n}\n","/**\n * This interface normalize the `TryGet` behavior found in the original\n * C# project. Any `TryGet` method will return a object conforming to this\n * interface.\n *\n * The original function returns a boolean and has a second parameter called\n * item that is an `out`. Both are needed and we can't just return the item\n * because it'll always be truthy. Instead, we return an object containing\n * whether the result exists (`exists`) and the result itself (`result`).\n *\n * For instance a `TryGet` prototype would look like this:\n```\nTryGetItemWithValue(val: number, item: InkListItem): TryGetResult{\n```\n *\n * On the other hand, dealing with the result can be done in the following way:\n```\nvar item = item.TryGetItemWithValue(intVal, InkListItem.Null);\nif (item.exists) {\n\tconsole.log(item.result)\n}\n```\n *\n */\nexport interface TryGetResult {\n result: T;\n exists: boolean;\n}\n\nexport function tryGetValueFromMap(\n map: Map | null,\n key: K,\n /* out */ value: V\n): TryGetResult {\n if (map === null) {\n return { result: value, exists: false };\n }\n\n let val = map.get(key);\n\n if (typeof val === \"undefined\") {\n return { result: value, exists: false };\n } else {\n return { result: val, exists: true };\n }\n}\n\nexport function tryParseInt(\n value: any,\n /* out */ defaultValue: number = 0\n): TryGetResult {\n let val = parseInt(value);\n\n if (!Number.isNaN(val)) {\n return { result: val, exists: true };\n } else {\n return { result: defaultValue, exists: false };\n }\n}\n\nexport function tryParseFloat(\n value: any,\n /* out */ defaultValue: number = 0\n): TryGetResult {\n let val = parseFloat(value);\n\n if (!Number.isNaN(val)) {\n return { result: val, exists: true };\n } else {\n return { result: defaultValue, exists: false };\n }\n}\n","import { InkObject } from \"./Object\";\nimport { Path } from \"./Path\";\nimport { InkList, InkListItem } from \"./InkList\";\nimport { StoryException } from \"./StoryException\";\nimport { asOrNull, asOrThrows } from \"./TypeAssertion\";\nimport { tryParseInt, tryParseFloat } from \"./TryGetResult\";\nimport { throwNullException } from \"./NullException\";\n\nexport abstract class AbstractValue extends InkObject {\n public abstract get valueType(): ValueType;\n public abstract get isTruthy(): boolean;\n public abstract get valueObject(): any;\n\n public abstract Cast(newType: ValueType): Value;\n\n public static Create(\n val: any,\n preferredNumberType?: ValueType\n ): Value | null {\n // This code doesn't exist in upstream and is simply here to enforce\n // the creation of the proper number value.\n // If `preferredNumberType` is not provided or if value doesn't match\n // `preferredNumberType`, this conditional does nothing.\n if (preferredNumberType) {\n if (\n preferredNumberType === (ValueType.Int as ValueType) &&\n Number.isInteger(Number(val))\n ) {\n return new IntValue(Number(val));\n } else if (\n preferredNumberType === (ValueType.Float as ValueType) &&\n !isNaN(val)\n ) {\n return new FloatValue(Number(val));\n }\n }\n\n if (typeof val === \"boolean\") {\n return new BoolValue(Boolean(val));\n }\n\n // https://github.com/y-lohse/inkjs/issues/425\n // Changed condition sequence, because Number('') is\n // parsed to 0, which made setting string to empty\n // impossible\n if (typeof val === \"string\") {\n return new StringValue(String(val));\n } else if (Number.isInteger(Number(val))) {\n return new IntValue(Number(val));\n } else if (!isNaN(val)) {\n return new FloatValue(Number(val));\n } else if (val instanceof Path) {\n return new DivertTargetValue(asOrThrows(val, Path));\n } else if (val instanceof InkList) {\n return new ListValue(asOrThrows(val, InkList));\n }\n\n return null;\n }\n public Copy() {\n return asOrThrows(AbstractValue.Create(this.valueObject), InkObject);\n }\n public BadCastException(targetType: ValueType) {\n return new StoryException(\n \"Can't cast \" +\n this.valueObject +\n \" from \" +\n this.valueType +\n \" to \" +\n targetType\n );\n }\n}\n\nexport abstract class Value<\n T extends { toString: () => string }\n> extends AbstractValue {\n public value: T | null;\n\n constructor(val: T | null) {\n super();\n this.value = val;\n }\n public get valueObject() {\n return this.value;\n }\n public toString() {\n if (this.value === null) return throwNullException(\"Value.value\");\n return this.value.toString();\n }\n}\n\nexport class BoolValue extends Value {\n constructor(val: boolean) {\n super(val || false);\n }\n public get isTruthy() {\n return Boolean(this.value);\n }\n public get valueType() {\n return ValueType.Bool;\n }\n\n public Cast(newType: ValueType): Value {\n if (this.value === null) return throwNullException(\"Value.value\");\n\n if (newType == this.valueType) {\n return this;\n }\n\n if (newType == ValueType.Int) {\n return new IntValue(this.value ? 1 : 0);\n }\n\n if (newType == ValueType.Float) {\n return new FloatValue(this.value ? 1.0 : 0.0);\n }\n\n if (newType == ValueType.String) {\n return new StringValue(this.value ? \"true\" : \"false\");\n }\n\n throw this.BadCastException(newType);\n }\n\n public toString() {\n return this.value ? \"true\" : \"false\";\n }\n}\n\nexport class IntValue extends Value {\n constructor(val: number) {\n super(val || 0);\n }\n public get isTruthy() {\n return this.value != 0;\n }\n public get valueType() {\n return ValueType.Int;\n }\n\n public Cast(newType: ValueType): Value {\n if (this.value === null) return throwNullException(\"Value.value\");\n\n if (newType == this.valueType) {\n return this;\n }\n\n if (newType == ValueType.Bool) {\n return new BoolValue(this.value === 0 ? false : true);\n }\n\n if (newType == ValueType.Float) {\n return new FloatValue(this.value);\n }\n\n if (newType == ValueType.String) {\n return new StringValue(\"\" + this.value);\n }\n\n throw this.BadCastException(newType);\n }\n}\n\nexport class FloatValue extends Value {\n constructor(val: number) {\n super(val || 0.0);\n }\n public get isTruthy() {\n return this.value != 0.0;\n }\n public get valueType() {\n return ValueType.Float;\n }\n\n public Cast(newType: ValueType): Value {\n if (this.value === null) return throwNullException(\"Value.value\");\n\n if (newType == this.valueType) {\n return this;\n }\n\n if (newType == ValueType.Bool) {\n return new BoolValue(this.value === 0.0 ? false : true);\n }\n\n if (newType == ValueType.Int) {\n return new IntValue(this.value);\n }\n\n if (newType == ValueType.String) {\n return new StringValue(\"\" + this.value);\n }\n\n throw this.BadCastException(newType);\n }\n}\n\nexport class StringValue extends Value {\n public _isNewline: boolean;\n public _isInlineWhitespace: boolean;\n\n constructor(val: string) {\n super(val || \"\");\n\n this._isNewline = this.value == \"\\n\";\n this._isInlineWhitespace = true;\n\n if (this.value === null) return throwNullException(\"Value.value\");\n\n if (this.value.length > 0) {\n this.value.split(\"\").every((c) => {\n if (c != \" \" && c != \"\\t\") {\n this._isInlineWhitespace = false;\n return false;\n }\n\n return true;\n });\n }\n }\n public get valueType() {\n return ValueType.String;\n }\n public get isTruthy() {\n if (this.value === null) return throwNullException(\"Value.value\");\n return this.value.length > 0;\n }\n public get isNewline() {\n return this._isNewline;\n }\n public get isInlineWhitespace() {\n return this._isInlineWhitespace;\n }\n public get isNonWhitespace() {\n return !this.isNewline && !this.isInlineWhitespace;\n }\n\n public Cast(newType: ValueType): Value {\n if (newType == this.valueType) {\n return this;\n }\n\n if (newType == ValueType.Int) {\n let parsedInt = tryParseInt(this.value);\n if (parsedInt.exists) {\n return new IntValue(parsedInt.result);\n } else {\n throw this.BadCastException(newType);\n }\n }\n\n if (newType == ValueType.Float) {\n let parsedFloat = tryParseFloat(this.value);\n if (parsedFloat.exists) {\n return new FloatValue(parsedFloat.result);\n } else {\n throw this.BadCastException(newType);\n }\n }\n\n throw this.BadCastException(newType);\n }\n}\n\nexport class DivertTargetValue extends Value {\n constructor(targetPath: Path | null = null) {\n super(targetPath);\n }\n public get valueType() {\n return ValueType.DivertTarget;\n }\n public get targetPath() {\n if (this.value === null) return throwNullException(\"Value.value\");\n return this.value;\n }\n public set targetPath(value: Path) {\n this.value = value;\n }\n public get isTruthy(): never {\n throw new Error(\"Shouldn't be checking the truthiness of a divert target\");\n }\n\n public Cast(newType: ValueType): Value {\n if (newType == this.valueType) return this;\n\n throw this.BadCastException(newType);\n }\n public toString() {\n return \"DivertTargetValue(\" + this.targetPath + \")\";\n }\n}\n\nexport class VariablePointerValue extends Value {\n public _contextIndex: number;\n\n constructor(variableName: string, contextIndex: number = -1) {\n super(variableName);\n\n this._contextIndex = contextIndex;\n }\n\n public get contextIndex() {\n return this._contextIndex;\n }\n public set contextIndex(value: number) {\n this._contextIndex = value;\n }\n public get variableName() {\n if (this.value === null) return throwNullException(\"Value.value\");\n return this.value;\n }\n public set variableName(value: string) {\n this.value = value;\n }\n public get valueType() {\n return ValueType.VariablePointer;\n }\n\n public get isTruthy(): never {\n throw new Error(\n \"Shouldn't be checking the truthiness of a variable pointer\"\n );\n }\n\n public Cast(newType: ValueType): Value {\n if (newType == this.valueType) return this;\n\n throw this.BadCastException(newType);\n }\n public toString() {\n return \"VariablePointerValue(\" + this.variableName + \")\";\n }\n public Copy() {\n return new VariablePointerValue(this.variableName, this.contextIndex);\n }\n}\n\nexport class ListValue extends Value {\n public get isTruthy() {\n if (this.value === null) {\n return throwNullException(\"this.value\");\n }\n return this.value.Count > 0;\n }\n public get valueType() {\n return ValueType.List;\n }\n public Cast(newType: ValueType): Value {\n if (this.value === null) return throwNullException(\"Value.value\");\n\n if (newType == ValueType.Int) {\n let max = this.value.maxItem;\n if (max.Key.isNull) return new IntValue(0);\n else return new IntValue(max.Value);\n } else if (newType == ValueType.Float) {\n let max = this.value.maxItem;\n if (max.Key.isNull) return new FloatValue(0.0);\n else return new FloatValue(max.Value);\n } else if (newType == ValueType.String) {\n let max = this.value.maxItem;\n if (max.Key.isNull) return new StringValue(\"\");\n else {\n return new StringValue(max.Key.toString());\n }\n }\n\n if (newType == this.valueType) return this;\n\n throw this.BadCastException(newType);\n }\n constructor();\n constructor(list: InkList);\n constructor(listOrSingleItem: InkListItem, singleValue: number);\n constructor(listOrSingleItem?: InkListItem | InkList, singleValue?: number) {\n super(null);\n\n if (!listOrSingleItem && !singleValue) {\n this.value = new InkList();\n } else if (listOrSingleItem instanceof InkList) {\n this.value = new InkList(listOrSingleItem);\n } else if (\n listOrSingleItem instanceof InkListItem &&\n typeof singleValue === \"number\"\n ) {\n this.value = new InkList({\n Key: listOrSingleItem,\n Value: singleValue,\n });\n }\n }\n public static RetainListOriginsForAssignment(\n oldValue: InkObject | null,\n newValue: InkObject\n ) {\n let oldList = asOrNull(oldValue, ListValue);\n let newList = asOrNull(newValue, ListValue);\n\n if (newList && newList.value === null)\n return throwNullException(\"newList.value\");\n if (oldList && oldList.value === null)\n return throwNullException(\"oldList.value\");\n\n // When assigning the empty list, try to retain any initial origin names\n if (oldList && newList && newList.value!.Count == 0)\n newList.value!.SetInitialOriginNames(oldList.value!.originNames);\n }\n}\n\nexport enum ValueType {\n Bool = -1,\n Int = 0,\n Float = 1,\n List = 2,\n String = 3,\n DivertTarget = 4,\n VariablePointer = 5,\n}\n","import { InkObject } from \"./Object\";\nimport { Container } from \"./Container\";\n\nexport class SearchResult {\n public obj: InkObject | null = null;\n public approximate: boolean = false;\n\n get correctObj() {\n return this.approximate ? null : this.obj;\n }\n\n get container() {\n return this.obj instanceof Container ? this.obj : null;\n }\n\n public copy() {\n let searchResult = new SearchResult();\n searchResult.obj = this.obj;\n searchResult.approximate = this.approximate;\n\n return searchResult;\n }\n}\n","import { StringValue } from \"./Value\";\nimport { throwNullException } from \"./NullException\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { INamedContent } from \"./INamedContent\";\nimport { InkObject } from \"./Object\";\nimport { SearchResult } from \"./SearchResult\";\nimport { Path } from \"./Path\";\nimport { Debug } from \"./Debug\";\nimport { tryGetValueFromMap } from \"./TryGetResult\";\nimport { asINamedContentOrNull, asOrNull, asOrThrows } from \"./TypeAssertion\";\n\nexport class Container extends InkObject implements INamedContent {\n public name: string | null = null;\n\n public _content: InkObject[] = [];\n public namedContent: Map = new Map();\n\n public visitsShouldBeCounted: boolean = false;\n public turnIndexShouldBeCounted: boolean = false;\n public countingAtStartOnly: boolean = false;\n\n public _pathToFirstLeafContent: Path | null = null;\n\n get hasValidName() {\n return this.name != null && this.name.length > 0;\n }\n get content() {\n return this._content;\n }\n set content(value: InkObject[]) {\n this.AddContent(value);\n }\n get namedOnlyContent() {\n let namedOnlyContentDict: Map | null = new Map();\n\n for (let [key, value] of this.namedContent) {\n let inkObject = asOrThrows(value, InkObject);\n namedOnlyContentDict.set(key, inkObject);\n }\n\n for (let c of this.content) {\n let named = asINamedContentOrNull(c);\n if (named != null && named.hasValidName) {\n namedOnlyContentDict.delete(named.name!);\n }\n }\n\n if (namedOnlyContentDict.size == 0) namedOnlyContentDict = null;\n\n return namedOnlyContentDict;\n }\n set namedOnlyContent(value: Map | null) {\n let existingNamedOnly = this.namedOnlyContent;\n if (existingNamedOnly != null) {\n for (let [key] of existingNamedOnly) {\n this.namedContent.delete(key);\n }\n }\n\n if (value == null) return;\n\n for (let [, val] of value) {\n let named = asINamedContentOrNull(val);\n if (named != null) this.AddToNamedContentOnly(named);\n }\n }\n get countFlags(): number {\n let flags: Container.CountFlags = 0;\n if (this.visitsShouldBeCounted) flags |= Container.CountFlags.Visits;\n if (this.turnIndexShouldBeCounted) flags |= Container.CountFlags.Turns;\n if (this.countingAtStartOnly) flags |= Container.CountFlags.CountStartOnly;\n\n if (flags == Container.CountFlags.CountStartOnly) {\n flags = 0;\n }\n\n return flags;\n }\n set countFlags(value: number) {\n let flag: Container.CountFlags = value;\n if ((flag & Container.CountFlags.Visits) > 0)\n this.visitsShouldBeCounted = true;\n if ((flag & Container.CountFlags.Turns) > 0)\n this.turnIndexShouldBeCounted = true;\n if ((flag & Container.CountFlags.CountStartOnly) > 0)\n this.countingAtStartOnly = true;\n }\n get pathToFirstLeafContent() {\n if (this._pathToFirstLeafContent == null)\n this._pathToFirstLeafContent = this.path.PathByAppendingPath(\n this.internalPathToFirstLeafContent\n );\n\n return this._pathToFirstLeafContent;\n }\n get internalPathToFirstLeafContent() {\n let components: Path.Component[] = [];\n let container: Container = this;\n while (container instanceof Container) {\n if (container.content.length > 0) {\n components.push(new Path.Component(0));\n container = container.content[0] as Container;\n }\n }\n return new Path(components);\n }\n\n public AddContent(contentObjOrList: InkObject | InkObject[]) {\n if (contentObjOrList instanceof Array) {\n let contentList = contentObjOrList as InkObject[];\n\n for (let c of contentList) {\n this.AddContent(c);\n }\n } else {\n let contentObj = contentObjOrList as InkObject;\n\n this._content.push(contentObj);\n\n if (contentObj.parent) {\n throw new Error(\"content is already in \" + contentObj.parent);\n }\n\n contentObj.parent = this;\n\n this.TryAddNamedContent(contentObj);\n }\n }\n public TryAddNamedContent(contentObj: InkObject) {\n let namedContentObj = asINamedContentOrNull(contentObj);\n if (namedContentObj != null && namedContentObj.hasValidName) {\n this.AddToNamedContentOnly(namedContentObj);\n }\n }\n public AddToNamedContentOnly(namedContentObj: INamedContent) {\n Debug.AssertType(\n namedContentObj,\n InkObject,\n \"Can only add Runtime.Objects to a Runtime.Container\"\n );\n let runtimeObj = asOrThrows(namedContentObj, InkObject);\n runtimeObj.parent = this;\n\n if (namedContentObj.name === null)\n return throwNullException(\"namedContentObj.name\");\n this.namedContent.set(namedContentObj.name!, namedContentObj);\n }\n public ContentAtPath(\n path: Path,\n partialPathStart: number = 0,\n partialPathLength: number = -1\n ) {\n if (partialPathLength == -1) partialPathLength = path.length;\n\n let result = new SearchResult();\n result.approximate = false;\n\n let currentContainer: Container | null = this;\n let currentObj: InkObject = this;\n\n for (let i = partialPathStart; i < partialPathLength; ++i) {\n let comp = path.GetComponent(i);\n if (currentContainer == null) {\n result.approximate = true;\n break;\n }\n\n let foundObj: InkObject | null =\n currentContainer.ContentWithPathComponent(comp);\n\n if (foundObj == null) {\n result.approximate = true;\n break;\n }\n\n currentObj = foundObj;\n currentContainer = asOrNull(foundObj, Container);\n }\n\n result.obj = currentObj;\n\n return result;\n }\n public InsertContent(contentObj: InkObject, index: number) {\n this.content.splice(index, 0, contentObj);\n\n if (contentObj.parent) {\n throw new Error(\"content is already in \" + contentObj.parent);\n }\n\n contentObj.parent = this;\n\n this.TryAddNamedContent(contentObj);\n }\n public AddContentsOfContainer(otherContainer: Container) {\n this.content.push(...otherContainer.content);\n\n for (let obj of otherContainer.content) {\n obj.parent = this;\n this.TryAddNamedContent(obj);\n }\n }\n public ContentWithPathComponent(component: Path.Component): InkObject | null {\n if (component.isIndex) {\n if (component.index >= 0 && component.index < this.content.length) {\n return this.content[component.index];\n } else {\n return null;\n }\n } else if (component.isParent) {\n return this.parent;\n } else {\n if (component.name === null) {\n return throwNullException(\"component.name\");\n }\n let foundContent = tryGetValueFromMap(\n this.namedContent,\n component.name,\n null\n );\n if (foundContent.exists) {\n return asOrThrows(foundContent.result, InkObject);\n } else {\n return null;\n }\n }\n }\n public BuildStringOfHierarchy(): string;\n public BuildStringOfHierarchy(\n sb: StringBuilder,\n indentation: number,\n pointedObj: InkObject | null\n ): string;\n public BuildStringOfHierarchy() {\n let sb: StringBuilder;\n if (arguments.length == 0) {\n sb = new StringBuilder();\n this.BuildStringOfHierarchy(sb, 0, null);\n return sb.toString();\n }\n\n sb = arguments[0] as StringBuilder;\n let indentation = arguments[1] as number;\n let pointedObj = arguments[2] as InkObject | null;\n\n function appendIndentation() {\n const spacesPerIndent = 4; // Truly const in the original code\n for (let i = 0; i < spacesPerIndent * indentation; ++i) {\n sb.Append(\" \");\n }\n }\n\n appendIndentation();\n sb.Append(\"[\");\n\n if (this.hasValidName) {\n sb.AppendFormat(\" ({0})\", this.name);\n }\n\n if (this == pointedObj) {\n sb.Append(\" <---\");\n }\n\n sb.AppendLine();\n\n indentation++;\n\n for (let i = 0; i < this.content.length; ++i) {\n let obj = this.content[i];\n\n if (obj instanceof Container) {\n let container = obj as Container;\n\n container.BuildStringOfHierarchy(sb, indentation, pointedObj);\n } else {\n appendIndentation();\n if (obj instanceof StringValue) {\n sb.Append('\"');\n sb.Append(obj.toString().replace(\"\\n\", \"\\\\n\"));\n sb.Append('\"');\n } else {\n sb.Append(obj.toString());\n }\n }\n\n if (i != this.content.length - 1) {\n sb.Append(\",\");\n }\n\n if (!(obj instanceof Container) && obj == pointedObj) {\n sb.Append(\" <---\");\n }\n\n sb.AppendLine();\n }\n\n let onlyNamed: Map = new Map();\n\n for (let [key, value] of this.namedContent) {\n if (this.content.indexOf(asOrThrows(value, InkObject)) >= 0) {\n continue;\n } else {\n onlyNamed.set(key, value);\n }\n }\n\n if (onlyNamed.size > 0) {\n appendIndentation();\n sb.AppendLine(\"-- named: --\");\n\n for (let [, value] of onlyNamed) {\n Debug.AssertType(\n value,\n Container,\n \"Can only print out named Containers\"\n );\n let container = value as Container;\n container.BuildStringOfHierarchy(sb, indentation, pointedObj);\n sb.AppendLine();\n }\n }\n\n indentation--;\n\n appendIndentation();\n sb.Append(\"]\");\n }\n}\n\nexport namespace Container {\n export enum CountFlags {\n Visits = 1,\n Turns = 2,\n CountStartOnly = 4,\n }\n}\n","import { InkObject } from \"./Object\";\n\nexport class Glue extends InkObject {\n public toString() {\n return \"Glue\";\n }\n}\n","export enum PushPopType {\n Tunnel = 0,\n Function = 1,\n FunctionEvaluationFromGame = 2,\n}\n","import { InkObject } from \"./Object\";\n\nexport class ControlCommand extends InkObject {\n private _commandType: ControlCommand.CommandType;\n\n get commandType(): ControlCommand.CommandType {\n return this._commandType;\n }\n\n constructor(\n commandType: ControlCommand.CommandType = ControlCommand.CommandType.NotSet\n ) {\n super();\n this._commandType = commandType;\n }\n\n public Copy() {\n return new ControlCommand(this.commandType);\n }\n public static EvalStart() {\n return new ControlCommand(ControlCommand.CommandType.EvalStart);\n }\n public static EvalOutput() {\n return new ControlCommand(ControlCommand.CommandType.EvalOutput);\n }\n public static EvalEnd() {\n return new ControlCommand(ControlCommand.CommandType.EvalEnd);\n }\n public static Duplicate() {\n return new ControlCommand(ControlCommand.CommandType.Duplicate);\n }\n public static PopEvaluatedValue() {\n return new ControlCommand(ControlCommand.CommandType.PopEvaluatedValue);\n }\n public static PopFunction() {\n return new ControlCommand(ControlCommand.CommandType.PopFunction);\n }\n public static PopTunnel() {\n return new ControlCommand(ControlCommand.CommandType.PopTunnel);\n }\n public static BeginString() {\n return new ControlCommand(ControlCommand.CommandType.BeginString);\n }\n public static EndString() {\n return new ControlCommand(ControlCommand.CommandType.EndString);\n }\n public static NoOp() {\n return new ControlCommand(ControlCommand.CommandType.NoOp);\n }\n public static ChoiceCount() {\n return new ControlCommand(ControlCommand.CommandType.ChoiceCount);\n }\n public static Turns() {\n return new ControlCommand(ControlCommand.CommandType.Turns);\n }\n public static TurnsSince() {\n return new ControlCommand(ControlCommand.CommandType.TurnsSince);\n }\n public static ReadCount() {\n return new ControlCommand(ControlCommand.CommandType.ReadCount);\n }\n public static Random() {\n return new ControlCommand(ControlCommand.CommandType.Random);\n }\n public static SeedRandom() {\n return new ControlCommand(ControlCommand.CommandType.SeedRandom);\n }\n public static VisitIndex() {\n return new ControlCommand(ControlCommand.CommandType.VisitIndex);\n }\n public static SequenceShuffleIndex() {\n return new ControlCommand(ControlCommand.CommandType.SequenceShuffleIndex);\n }\n public static StartThread() {\n return new ControlCommand(ControlCommand.CommandType.StartThread);\n }\n public static Done() {\n return new ControlCommand(ControlCommand.CommandType.Done);\n }\n public static End() {\n return new ControlCommand(ControlCommand.CommandType.End);\n }\n public static ListFromInt() {\n return new ControlCommand(ControlCommand.CommandType.ListFromInt);\n }\n public static ListRange() {\n return new ControlCommand(ControlCommand.CommandType.ListRange);\n }\n public static ListRandom() {\n return new ControlCommand(ControlCommand.CommandType.ListRandom);\n }\n public static BeginTag() {\n return new ControlCommand(ControlCommand.CommandType.BeginTag);\n }\n public static EndTag() {\n return new ControlCommand(ControlCommand.CommandType.EndTag);\n }\n public toString() {\n return this.commandType.toString();\n }\n}\n\nexport namespace ControlCommand {\n export enum CommandType {\n NotSet = -1,\n EvalStart, // 0\n EvalOutput, // 1\n EvalEnd, // 2\n Duplicate, // 3\n PopEvaluatedValue, // 4\n PopFunction, // 5\n PopTunnel, // 6\n BeginString, // 7\n EndString, // 8\n NoOp, // 9\n ChoiceCount, // 10\n Turns, // 11\n TurnsSince, // 12\n ReadCount, // 13\n Random, // 14\n SeedRandom, // 15\n VisitIndex, // 16\n SequenceShuffleIndex, // 17\n StartThread, // 18\n Done, // 19\n End, // 20\n ListFromInt, // 21\n ListRange, // 22\n ListRandom, // 23\n BeginTag, // 24\n EndTag, // 25\n\n TOTAL_VALUES,\n }\n}\n","import { Path } from \"./Path\";\nimport { Container } from \"./Container\";\nimport { InkObject } from \"./Object\";\n\nexport class Pointer {\n public container: Container | null = null;\n public index: number = -1;\n\n constructor();\n constructor(container: Container | null, index: number);\n constructor() {\n if (arguments.length === 2) {\n this.container = arguments[0];\n this.index = arguments[1];\n }\n }\n\n public Resolve(): InkObject | null {\n if (this.index < 0) return this.container;\n if (this.container == null) return null;\n if (this.container.content.length == 0) return this.container;\n if (this.index >= this.container.content.length) return null;\n\n return this.container.content[this.index];\n }\n\n get isNull(): boolean {\n return this.container == null;\n }\n\n get path(): Path | null {\n if (this.isNull) return null;\n\n if (this.index >= 0)\n return this.container!.path.PathByAppendingComponent(\n new Path.Component(this.index)\n );\n else return this.container!.path;\n }\n\n public toString(): string {\n if (!this.container) return \"Ink Pointer (null)\";\n\n return (\n \"Ink Pointer -> \" +\n this.container.path.toString() +\n \" -- index \" +\n this.index\n );\n }\n\n // This method does not exist in the original C# code, but is here to maintain the\n // value semantics of Pointer.\n public copy(): Pointer {\n return new Pointer(this.container, this.index);\n }\n\n public static StartOf(container: Container | null): Pointer {\n return new Pointer(container, 0);\n }\n\n public static get Null(): Pointer {\n return new Pointer(null, -1);\n }\n}\n","import { Path } from \"./Path\";\nimport { PushPopType } from \"./PushPop\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { InkObject } from \"./Object\";\nimport { Pointer } from \"./Pointer\";\nimport { Container } from \"./Container\";\nimport { throwNullException } from \"./NullException\";\n\nexport class Divert extends InkObject {\n get targetPath() {\n if (this._targetPath != null && this._targetPath.isRelative) {\n let targetObj = this.targetPointer.Resolve();\n if (targetObj) {\n this._targetPath = targetObj.path;\n }\n }\n\n return this._targetPath;\n }\n set targetPath(value: Path | null) {\n this._targetPath = value;\n this._targetPointer = Pointer.Null;\n }\n\n public _targetPath: Path | null = null;\n\n get targetPointer() {\n if (this._targetPointer.isNull) {\n let targetObj = this.ResolvePath(this._targetPath).obj;\n\n if (this._targetPath === null)\n return throwNullException(\"this._targetPath\");\n if (this._targetPath.lastComponent === null)\n return throwNullException(\"this._targetPath.lastComponent\");\n\n if (this._targetPath.lastComponent.isIndex) {\n if (targetObj === null) return throwNullException(\"targetObj\");\n this._targetPointer.container =\n targetObj.parent instanceof Container ? targetObj.parent : null;\n this._targetPointer.index = this._targetPath.lastComponent.index;\n } else {\n this._targetPointer = Pointer.StartOf(\n targetObj instanceof Container ? targetObj : null\n );\n }\n }\n\n return this._targetPointer.copy();\n }\n\n public _targetPointer: Pointer = Pointer.Null;\n\n get targetPathString() {\n if (this.targetPath == null) return null;\n\n return this.CompactPathString(this.targetPath);\n }\n set targetPathString(value: string | null) {\n if (value == null) {\n this.targetPath = null;\n } else {\n this.targetPath = new Path(value);\n }\n }\n\n public variableDivertName: string | null = null;\n get hasVariableTarget() {\n return this.variableDivertName != null;\n }\n\n public pushesToStack: boolean = false;\n public stackPushType: PushPopType = 0;\n\n public isExternal: boolean = false;\n public externalArgs: number = 0;\n\n public isConditional: boolean = false;\n\n constructor(stackPushType?: PushPopType) {\n super();\n this.pushesToStack = false;\n\n if (typeof stackPushType !== \"undefined\") {\n this.pushesToStack = true;\n this.stackPushType = stackPushType;\n }\n }\n\n public Equals(obj: Divert | null) {\n let otherDivert = obj;\n if (otherDivert instanceof Divert) {\n if (this.hasVariableTarget == otherDivert.hasVariableTarget) {\n if (this.hasVariableTarget) {\n return this.variableDivertName == otherDivert.variableDivertName;\n } else {\n if (this.targetPath === null)\n return throwNullException(\"this.targetPath\");\n return this.targetPath.Equals(otherDivert.targetPath);\n }\n }\n }\n return false;\n }\n\n public toString() {\n if (this.hasVariableTarget) {\n return \"Divert(variable: \" + this.variableDivertName + \")\";\n } else if (this.targetPath == null) {\n return \"Divert(null)\";\n } else {\n let sb = new StringBuilder();\n\n let targetStr = this.targetPath.toString();\n // int? targetLineNum = DebugLineNumberOfPath (targetPath);\n let targetLineNum = null;\n if (targetLineNum != null) {\n targetStr = \"line \" + targetLineNum;\n }\n\n sb.Append(\"Divert\");\n\n if (this.isConditional) sb.Append(\"?\");\n\n if (this.pushesToStack) {\n if (this.stackPushType == PushPopType.Function) {\n sb.Append(\" function\");\n } else {\n sb.Append(\" tunnel\");\n }\n }\n\n sb.Append(\" -> \");\n sb.Append(this.targetPathString);\n\n sb.Append(\" (\");\n sb.Append(targetStr);\n sb.Append(\")\");\n\n return sb.toString();\n }\n }\n}\n","import { InkObject } from \"./Object\";\nimport { Path } from \"./Path\";\nimport { Container } from \"./Container\";\nimport { throwNullException } from \"./NullException\";\n\nexport class ChoicePoint extends InkObject {\n public _pathOnChoice: Path | null = null;\n public hasCondition: boolean = false;\n public hasStartContent: boolean = false;\n public hasChoiceOnlyContent: boolean = false;\n public isInvisibleDefault: boolean = false;\n public onceOnly: boolean = true;\n\n constructor(onceOnly: boolean = true) {\n super();\n this.onceOnly = onceOnly;\n }\n get pathOnChoice(): Path | null {\n if (this._pathOnChoice != null && this._pathOnChoice.isRelative) {\n let choiceTargetObj = this.choiceTarget;\n if (choiceTargetObj) {\n this._pathOnChoice = choiceTargetObj.path;\n }\n }\n return this._pathOnChoice;\n }\n set pathOnChoice(value: Path | null) {\n this._pathOnChoice = value;\n }\n get choiceTarget(): Container | null {\n if (this._pathOnChoice === null)\n return throwNullException(\"ChoicePoint._pathOnChoice\");\n return this.ResolvePath(this._pathOnChoice).container;\n }\n get pathStringOnChoice(): string {\n if (this.pathOnChoice === null)\n return throwNullException(\"ChoicePoint.pathOnChoice\");\n return this.CompactPathString(this.pathOnChoice);\n }\n set pathStringOnChoice(value: string) {\n this.pathOnChoice = new Path(value);\n }\n get flags(): number {\n let flags = 0;\n if (this.hasCondition) flags |= 1;\n if (this.hasStartContent) flags |= 2;\n if (this.hasChoiceOnlyContent) flags |= 4;\n if (this.isInvisibleDefault) flags |= 8;\n if (this.onceOnly) flags |= 16;\n return flags;\n }\n set flags(value: number) {\n this.hasCondition = (value & 1) > 0;\n this.hasStartContent = (value & 2) > 0;\n this.hasChoiceOnlyContent = (value & 4) > 0;\n this.isInvisibleDefault = (value & 8) > 0;\n this.onceOnly = (value & 16) > 0;\n }\n public toString(): string {\n if (this.pathOnChoice === null)\n return throwNullException(\"ChoicePoint.pathOnChoice\");\n // int? targetLineNum = DebugLineNumberOfPath (pathOnChoice);\n let targetLineNum = null;\n let targetString = this.pathOnChoice.toString();\n\n if (targetLineNum != null) {\n targetString = \" line \" + targetLineNum + \"(\" + targetString + \")\";\n }\n\n return \"Choice: -> \" + targetString;\n }\n}\n","import { InkObject } from \"./Object\";\nimport { Path } from \"./Path\";\n\nexport class VariableReference extends InkObject {\n public name: string | null;\n public pathForCount: Path | null = null;\n\n get containerForCount() {\n if (this.pathForCount === null) return null;\n return this.ResolvePath(this.pathForCount).container;\n }\n get pathStringForCount() {\n if (this.pathForCount === null) return null;\n\n return this.CompactPathString(this.pathForCount);\n }\n set pathStringForCount(value: string | null) {\n if (value === null) this.pathForCount = null;\n else this.pathForCount = new Path(value);\n }\n\n constructor(name: string | null = null) {\n super();\n this.name = name;\n }\n\n public toString() {\n if (this.name != null) {\n return \"var(\" + this.name + \")\";\n } else {\n let pathStr = this.pathStringForCount;\n return \"read_count(\" + pathStr + \")\";\n }\n }\n}\n","import { InkObject } from \"./Object\";\n\nexport class VariableAssignment extends InkObject {\n public readonly variableName: string | null;\n public readonly isNewDeclaration: boolean;\n public isGlobal: boolean;\n\n constructor(variableName: string | null, isNewDeclaration: boolean) {\n super();\n this.variableName = variableName || null;\n this.isNewDeclaration = !!isNewDeclaration;\n this.isGlobal = false;\n }\n\n public toString(): string {\n return \"VarAssign to \" + this.variableName;\n }\n}\n","import { InkObject } from \"./Object\";\n\nexport class Void extends InkObject {}\n","import { Value, ValueType, IntValue, ListValue, BoolValue } from \"./Value\";\nimport { StoryException } from \"./StoryException\";\nimport { Void } from \"./Void\";\nimport { Path } from \"./Path\";\nimport { InkList, InkListItem } from \"./InkList\";\nimport { InkObject } from \"./Object\";\nimport { asOrNull, asOrThrows, asBooleanOrThrows } from \"./TypeAssertion\";\nimport { throwNullException } from \"./NullException\";\n\ntype BinaryOp = (left: T, right: T) => any;\ntype UnaryOp = (val: T) => any;\n\nexport class NativeFunctionCall extends InkObject {\n public static readonly Add: string = \"+\";\n public static readonly Subtract: string = \"-\";\n public static readonly Divide: string = \"/\";\n public static readonly Multiply: string = \"*\";\n public static readonly Mod: string = \"%\";\n public static readonly Negate: string = \"_\";\n public static readonly Equal: string = \"==\";\n public static readonly Greater: string = \">\";\n public static readonly Less: string = \"<\";\n public static readonly GreaterThanOrEquals: string = \">=\";\n public static readonly LessThanOrEquals: string = \"<=\";\n public static readonly NotEquals: string = \"!=\";\n public static readonly Not: string = \"!\";\n public static readonly And: string = \"&&\";\n public static readonly Or: string = \"||\";\n public static readonly Min: string = \"MIN\";\n public static readonly Max: string = \"MAX\";\n public static readonly Pow: string = \"POW\";\n public static readonly Floor: string = \"FLOOR\";\n public static readonly Ceiling: string = \"CEILING\";\n public static readonly Int: string = \"INT\";\n public static readonly Float: string = \"FLOAT\";\n public static readonly Has: string = \"?\";\n public static readonly Hasnt: string = \"!?\";\n public static readonly Intersect: string = \"^\";\n public static readonly ListMin: string = \"LIST_MIN\";\n public static readonly ListMax: string = \"LIST_MAX\";\n public static readonly All: string = \"LIST_ALL\";\n public static readonly Count: string = \"LIST_COUNT\";\n public static readonly ValueOfList: string = \"LIST_VALUE\";\n public static readonly Invert: string = \"LIST_INVERT\";\n\n public static CallWithName(functionName: string) {\n return new NativeFunctionCall(functionName);\n }\n\n public static CallExistsWithName(functionName: string) {\n this.GenerateNativeFunctionsIfNecessary();\n return this._nativeFunctions!.get(functionName);\n }\n\n get name() {\n if (this._name === null)\n return throwNullException(\"NativeFunctionCall._name\");\n return this._name;\n }\n set name(value: string) {\n this._name = value;\n if (!this._isPrototype) {\n if (NativeFunctionCall._nativeFunctions === null)\n throwNullException(\"NativeFunctionCall._nativeFunctions\");\n else\n this._prototype =\n NativeFunctionCall._nativeFunctions.get(this._name) || null;\n }\n }\n public _name: string | null = null;\n\n get numberOfParameters() {\n if (this._prototype) {\n return this._prototype.numberOfParameters;\n } else {\n return this._numberOfParameters;\n }\n }\n set numberOfParameters(value: number) {\n this._numberOfParameters = value;\n }\n public _numberOfParameters: number = 0;\n\n public Call(parameters: InkObject[]): InkObject | null {\n if (this._prototype) {\n return this._prototype.Call(parameters);\n }\n\n if (this.numberOfParameters != parameters.length) {\n throw new Error(\"Unexpected number of parameters\");\n }\n\n let hasList = false;\n for (let p of parameters) {\n if (p instanceof Void)\n throw new StoryException(\n 'Attempting to perform operation on a void value. Did you forget to \"return\" a value from a function you called here?'\n );\n if (p instanceof ListValue) hasList = true;\n }\n\n if (parameters.length == 2 && hasList) {\n return this.CallBinaryListOperation(parameters);\n }\n\n let coercedParams = this.CoerceValuesToSingleType(parameters);\n let coercedType = coercedParams[0].valueType;\n\n if (coercedType == ValueType.Int) {\n return this.CallType(coercedParams);\n } else if (coercedType == ValueType.Float) {\n return this.CallType(coercedParams);\n } else if (coercedType == ValueType.String) {\n return this.CallType(coercedParams);\n } else if (coercedType == ValueType.DivertTarget) {\n return this.CallType(coercedParams);\n } else if (coercedType == ValueType.List) {\n return this.CallType(coercedParams);\n }\n\n return null;\n }\n\n public CallType string; }>(parametersOfSingleType: Array>) {\n let param1 = asOrThrows(parametersOfSingleType[0], Value);\n let valType = param1.valueType;\n\n let val1 = param1 as Value;\n\n let paramCount = parametersOfSingleType.length;\n\n if (paramCount == 2 || paramCount == 1) {\n if (this._operationFuncs === null)\n return throwNullException(\"NativeFunctionCall._operationFuncs\");\n let opForTypeObj = this._operationFuncs.get(valType);\n if (!opForTypeObj) {\n const key = ValueType[valType];\n throw new StoryException(\n \"Cannot perform operation \" + this.name + \" on \" + key\n );\n }\n\n if (paramCount == 2) {\n let param2 = asOrThrows(parametersOfSingleType[1], Value);\n\n let val2 = param2 as Value;\n\n let opForType = opForTypeObj as BinaryOp;\n\n if (val1.value === null || val2.value === null)\n return throwNullException(\"NativeFunctionCall.Call BinaryOp values\");\n let resultVal = opForType(val1.value, val2.value);\n\n return Value.Create(resultVal);\n } else {\n let opForType = opForTypeObj as UnaryOp;\n\n if (val1.value === null)\n return throwNullException(\"NativeFunctionCall.Call UnaryOp value\");\n let resultVal = opForType(val1.value);\n\n // This code is different from upstream. Since JavaScript treats\n // integers and floats as the same numbers, it's impossible\n // to force an number to be either an integer or a float.\n //\n // It can be useful to force a specific number type\n // (especially for divisions), so the result of INT() & FLOAT()\n // is coerced to the the proper value type.\n //\n // Note that we also force all other unary operation to\n // return the same value type, although this is only\n // meaningful for numbers. See `Value.Create`.\n if (this.name === NativeFunctionCall.Int) {\n return Value.Create(resultVal, ValueType.Int);\n } else if (this.name === NativeFunctionCall.Float) {\n return Value.Create(resultVal, ValueType.Float);\n } else {\n return Value.Create(resultVal, param1.valueType);\n }\n }\n } else {\n throw new Error(\n \"Unexpected number of parameters to NativeFunctionCall: \" +\n parametersOfSingleType.length\n );\n }\n }\n\n public CallBinaryListOperation(parameters: InkObject[]) {\n if (\n (this.name == \"+\" || this.name == \"-\") &&\n parameters[0] instanceof ListValue &&\n parameters[1] instanceof IntValue\n )\n return this.CallListIncrementOperation(parameters);\n\n let v1 = asOrThrows(parameters[0], Value);\n let v2 = asOrThrows(parameters[1], Value);\n\n if (\n (this.name == \"&&\" || this.name == \"||\") &&\n (v1.valueType != ValueType.List || v2.valueType != ValueType.List)\n ) {\n if (this._operationFuncs === null)\n return throwNullException(\"NativeFunctionCall._operationFuncs\");\n let op = this._operationFuncs.get(ValueType.Int) as BinaryOp;\n if (op === null)\n return throwNullException(\n \"NativeFunctionCall.CallBinaryListOperation op\"\n );\n let result = asBooleanOrThrows(\n op(v1.isTruthy ? 1 : 0, v2.isTruthy ? 1 : 0)\n );\n return new BoolValue(result);\n }\n\n if (v1.valueType == ValueType.List && v2.valueType == ValueType.List)\n return this.CallType([v1, v2]);\n\n throw new StoryException(\n \"Can not call use \" +\n this.name +\n \" operation on \" +\n ValueType[v1.valueType] +\n \" and \" +\n ValueType[v2.valueType]\n );\n }\n\n public CallListIncrementOperation(listIntParams: InkObject[]) {\n let listVal = asOrThrows(listIntParams[0], ListValue);\n let intVal = asOrThrows(listIntParams[1], IntValue);\n\n let resultInkList = new InkList();\n\n if (listVal.value === null)\n return throwNullException(\n \"NativeFunctionCall.CallListIncrementOperation listVal.value\"\n );\n for (let [listItemKey, listItemValue] of listVal.value) {\n let listItem = InkListItem.fromSerializedKey(listItemKey);\n\n if (this._operationFuncs === null)\n return throwNullException(\"NativeFunctionCall._operationFuncs\");\n let intOp = this._operationFuncs.get(ValueType.Int) as BinaryOp;\n\n if (intVal.value === null)\n return throwNullException(\n \"NativeFunctionCall.CallListIncrementOperation intVal.value\"\n );\n let targetInt = intOp(listItemValue, intVal.value);\n\n let itemOrigin = null;\n if (listVal.value.origins === null)\n return throwNullException(\n \"NativeFunctionCall.CallListIncrementOperation listVal.value.origins\"\n );\n for (let origin of listVal.value.origins) {\n if (origin.name == listItem.originName) {\n itemOrigin = origin;\n break;\n }\n }\n if (itemOrigin != null) {\n let incrementedItem = itemOrigin.TryGetItemWithValue(\n targetInt,\n InkListItem.Null\n );\n if (incrementedItem.exists)\n resultInkList.Add(incrementedItem.result, targetInt);\n }\n }\n\n return new ListValue(resultInkList);\n }\n\n public CoerceValuesToSingleType(parametersIn: InkObject[]) {\n let valType = ValueType.Int;\n\n let specialCaseList: null | ListValue = null;\n\n for (let obj of parametersIn) {\n let val = asOrThrows(obj, Value);\n if (val.valueType > valType) {\n valType = val.valueType;\n }\n\n if (val.valueType == ValueType.List) {\n specialCaseList = asOrNull(val, ListValue);\n }\n }\n\n let parametersOut = [];\n\n if (ValueType[valType] == ValueType[ValueType.List]) {\n for (let inkObjectVal of parametersIn) {\n let val = asOrThrows(inkObjectVal, Value);\n if (val.valueType == ValueType.List) {\n parametersOut.push(val);\n } else if (val.valueType == ValueType.Int) {\n let intVal = parseInt(val.valueObject);\n\n specialCaseList = asOrThrows(specialCaseList, ListValue);\n if (specialCaseList.value === null)\n return throwNullException(\n \"NativeFunctionCall.CoerceValuesToSingleType specialCaseList.value\"\n );\n let list = specialCaseList.value.originOfMaxItem;\n\n if (list === null)\n return throwNullException(\n \"NativeFunctionCall.CoerceValuesToSingleType list\"\n );\n let item = list.TryGetItemWithValue(intVal, InkListItem.Null);\n if (item.exists) {\n let castedValue = new ListValue(item.result, intVal);\n parametersOut.push(castedValue);\n } else\n throw new StoryException(\n \"Could not find List item with the value \" +\n intVal +\n \" in \" +\n list.name\n );\n } else {\n const key = ValueType[val.valueType];\n throw new StoryException(\n \"Cannot mix Lists and \" + key + \" values in this operation\"\n );\n }\n }\n } else {\n for (let inkObjectVal of parametersIn) {\n let val = asOrThrows(inkObjectVal, Value);\n let castedValue = val.Cast(valType);\n parametersOut.push(castedValue);\n }\n }\n\n return parametersOut;\n }\n\n constructor(name: string);\n constructor(name: string, numberOfParameters: number);\n constructor();\n constructor() {\n super();\n\n if (arguments.length === 0) {\n NativeFunctionCall.GenerateNativeFunctionsIfNecessary();\n } else if (arguments.length === 1) {\n let name = arguments[0];\n NativeFunctionCall.GenerateNativeFunctionsIfNecessary();\n this.name = name;\n } else if (arguments.length === 2) {\n let name = arguments[0];\n let numberOfParameters = arguments[1];\n\n this._isPrototype = true;\n this.name = name;\n this.numberOfParameters = numberOfParameters;\n }\n }\n\n public static Identity(t: T): any {\n return t;\n }\n\n public static GenerateNativeFunctionsIfNecessary() {\n if (this._nativeFunctions == null) {\n this._nativeFunctions = new Map();\n\n // Int operations\n this.AddIntBinaryOp(this.Add, (x, y) => x + y);\n this.AddIntBinaryOp(this.Subtract, (x, y) => x - y);\n this.AddIntBinaryOp(this.Multiply, (x, y) => x * y);\n this.AddIntBinaryOp(this.Divide, (x, y) => Math.floor(x / y));\n this.AddIntBinaryOp(this.Mod, (x, y) => x % y);\n this.AddIntUnaryOp(this.Negate, (x) => -x);\n\n this.AddIntBinaryOp(this.Equal, (x, y) => x == y);\n this.AddIntBinaryOp(this.Greater, (x, y) => x > y);\n this.AddIntBinaryOp(this.Less, (x, y) => x < y);\n this.AddIntBinaryOp(this.GreaterThanOrEquals, (x, y) => x >= y);\n this.AddIntBinaryOp(this.LessThanOrEquals, (x, y) => x <= y);\n this.AddIntBinaryOp(this.NotEquals, (x, y) => x != y);\n this.AddIntUnaryOp(this.Not, (x) => x == 0);\n\n this.AddIntBinaryOp(this.And, (x, y) => x != 0 && y != 0);\n this.AddIntBinaryOp(this.Or, (x, y) => x != 0 || y != 0);\n\n this.AddIntBinaryOp(this.Max, (x, y) => Math.max(x, y));\n this.AddIntBinaryOp(this.Min, (x, y) => Math.min(x, y));\n\n this.AddIntBinaryOp(this.Pow, (x, y) => Math.pow(x, y));\n this.AddIntUnaryOp(this.Floor, NativeFunctionCall.Identity);\n this.AddIntUnaryOp(this.Ceiling, NativeFunctionCall.Identity);\n this.AddIntUnaryOp(this.Int, NativeFunctionCall.Identity);\n this.AddIntUnaryOp(this.Float, (x) => x);\n\n // Float operations\n this.AddFloatBinaryOp(this.Add, (x, y) => x + y);\n this.AddFloatBinaryOp(this.Subtract, (x, y) => x - y);\n this.AddFloatBinaryOp(this.Multiply, (x, y) => x * y);\n this.AddFloatBinaryOp(this.Divide, (x, y) => x / y);\n this.AddFloatBinaryOp(this.Mod, (x, y) => x % y);\n this.AddFloatUnaryOp(this.Negate, (x) => -x);\n\n this.AddFloatBinaryOp(this.Equal, (x, y) => x == y);\n this.AddFloatBinaryOp(this.Greater, (x, y) => x > y);\n this.AddFloatBinaryOp(this.Less, (x, y) => x < y);\n this.AddFloatBinaryOp(this.GreaterThanOrEquals, (x, y) => x >= y);\n this.AddFloatBinaryOp(this.LessThanOrEquals, (x, y) => x <= y);\n this.AddFloatBinaryOp(this.NotEquals, (x, y) => x != y);\n this.AddFloatUnaryOp(this.Not, (x) => x == 0.0);\n\n this.AddFloatBinaryOp(this.And, (x, y) => x != 0.0 && y != 0.0);\n this.AddFloatBinaryOp(this.Or, (x, y) => x != 0.0 || y != 0.0);\n\n this.AddFloatBinaryOp(this.Max, (x, y) => Math.max(x, y));\n this.AddFloatBinaryOp(this.Min, (x, y) => Math.min(x, y));\n\n this.AddFloatBinaryOp(this.Pow, (x, y) => Math.pow(x, y));\n this.AddFloatUnaryOp(this.Floor, (x) => Math.floor(x));\n this.AddFloatUnaryOp(this.Ceiling, (x) => Math.ceil(x));\n this.AddFloatUnaryOp(this.Int, (x) => Math.floor(x));\n this.AddFloatUnaryOp(this.Float, NativeFunctionCall.Identity);\n\n // String operations\n this.AddStringBinaryOp(this.Add, (x, y) => x + y); // concat\n this.AddStringBinaryOp(this.Equal, (x, y) => x === y);\n this.AddStringBinaryOp(this.NotEquals, (x, y) => !(x === y));\n this.AddStringBinaryOp(this.Has, (x, y) => x.includes(y));\n this.AddStringBinaryOp(this.Hasnt, (x, y) => !x.includes(y));\n\n this.AddListBinaryOp(this.Add, (x, y) => x.Union(y));\n this.AddListBinaryOp(this.Subtract, (x, y) => x.Without(y));\n this.AddListBinaryOp(this.Has, (x, y) => x.Contains(y));\n this.AddListBinaryOp(this.Hasnt, (x, y) => !x.Contains(y));\n this.AddListBinaryOp(this.Intersect, (x, y) => x.Intersect(y));\n\n this.AddListBinaryOp(this.Equal, (x, y) => x.Equals(y));\n this.AddListBinaryOp(this.Greater, (x, y) => x.GreaterThan(y));\n this.AddListBinaryOp(this.Less, (x, y) => x.LessThan(y));\n this.AddListBinaryOp(this.GreaterThanOrEquals, (x, y) =>\n x.GreaterThanOrEquals(y)\n );\n this.AddListBinaryOp(this.LessThanOrEquals, (x, y) =>\n x.LessThanOrEquals(y)\n );\n this.AddListBinaryOp(this.NotEquals, (x, y) => !x.Equals(y));\n\n this.AddListBinaryOp(this.And, (x, y) => x.Count > 0 && y.Count > 0);\n this.AddListBinaryOp(this.Or, (x, y) => x.Count > 0 || y.Count > 0);\n\n this.AddListUnaryOp(this.Not, (x) => (x.Count == 0 ? 1 : 0));\n\n this.AddListUnaryOp(this.Invert, (x) => x.inverse);\n this.AddListUnaryOp(this.All, (x) => x.all);\n this.AddListUnaryOp(this.ListMin, (x) => x.MinAsList());\n this.AddListUnaryOp(this.ListMax, (x) => x.MaxAsList());\n this.AddListUnaryOp(this.Count, (x) => x.Count);\n this.AddListUnaryOp(this.ValueOfList, (x) => x.maxItem.Value);\n\n let divertTargetsEqual = (d1: Path, d2: Path) => d1.Equals(d2);\n let divertTargetsNotEqual = (d1: Path, d2: Path) => !d1.Equals(d2);\n this.AddOpToNativeFunc(\n this.Equal,\n 2,\n ValueType.DivertTarget,\n divertTargetsEqual\n );\n this.AddOpToNativeFunc(\n this.NotEquals,\n 2,\n ValueType.DivertTarget,\n divertTargetsNotEqual\n );\n }\n }\n\n public AddOpFuncForType(\n valType: ValueType,\n op: UnaryOp | BinaryOp\n ): void {\n if (this._operationFuncs == null) {\n this._operationFuncs = new Map();\n }\n\n this._operationFuncs.set(valType, op);\n }\n\n public static AddOpToNativeFunc(\n name: string,\n args: number,\n valType: ValueType,\n op: UnaryOp | BinaryOp\n ): void {\n if (this._nativeFunctions === null)\n return throwNullException(\"NativeFunctionCall._nativeFunctions\");\n let nativeFunc = this._nativeFunctions.get(name);\n if (!nativeFunc) {\n nativeFunc = new NativeFunctionCall(name, args);\n this._nativeFunctions.set(name, nativeFunc);\n }\n\n nativeFunc.AddOpFuncForType(valType, op);\n }\n\n public static AddIntBinaryOp(name: string, op: BinaryOp) {\n this.AddOpToNativeFunc(name, 2, ValueType.Int, op);\n }\n public static AddIntUnaryOp(name: string, op: UnaryOp) {\n this.AddOpToNativeFunc(name, 1, ValueType.Int, op);\n }\n\n public static AddFloatBinaryOp(name: string, op: BinaryOp) {\n this.AddOpToNativeFunc(name, 2, ValueType.Float, op);\n }\n public static AddFloatUnaryOp(name: string, op: UnaryOp) {\n this.AddOpToNativeFunc(name, 1, ValueType.Float, op);\n }\n\n public static AddStringBinaryOp(name: string, op: BinaryOp) {\n this.AddOpToNativeFunc(name, 2, ValueType.String, op);\n }\n\n public static AddListBinaryOp(name: string, op: BinaryOp) {\n this.AddOpToNativeFunc(name, 2, ValueType.List, op);\n }\n public static AddListUnaryOp(name: string, op: UnaryOp) {\n this.AddOpToNativeFunc(name, 1, ValueType.List, op);\n }\n\n public toString() {\n return 'Native \"' + this.name + '\"';\n }\n\n public _prototype: NativeFunctionCall | null = null;\n public _isPrototype: boolean = false;\n public _operationFuncs: Map | UnaryOp> | null =\n null;\n public static _nativeFunctions: Map | null = null;\n}\n","import { InkObject } from \"./Object\";\n\n// New version of tags is dynamic - it constructs the tags\n// at runtime based on BeginTag and EndTag control commands.\n// Plain text that's in the output stream is turned into tags\n// when you do story.currentTags.\n// The only place this is used is when flattening tags down\n// to string in advance, during dynamic string generation if\n// there's a tag embedded in it. See how ControlCommand.EndString\n// is implemented in Story.cs for more details + comment\nexport class Tag extends InkObject {\n public readonly text: string;\n\n constructor(tagText: string) {\n super();\n this.text = tagText.toString() || \"\";\n }\n\n public toString(): string {\n return \"# \" + this.text;\n }\n}\n","import { Path } from \"./Path\";\nimport { CallStack } from \"./CallStack\";\nimport { throwNullException } from \"./NullException\";\nimport { InkObject } from \"./Object\";\n\nexport class Choice extends InkObject {\n public text: string = \"\";\n public index: number = 0;\n public threadAtGeneration: CallStack.Thread | null = null;\n public sourcePath: string = \"\";\n public targetPath: Path | null = null;\n public isInvisibleDefault: boolean = false;\n public tags: string[] | null = null;\n public originalThreadIndex: number = 0;\n\n get pathStringOnChoice(): string {\n if (this.targetPath === null)\n return throwNullException(\"Choice.targetPath\");\n return this.targetPath.toString();\n }\n set pathStringOnChoice(value: string) {\n this.targetPath = new Path(value);\n }\n}\n","import { InkListItem, SerializedInkListItem } from \"./InkList\";\nimport { TryGetResult } from \"./TryGetResult\";\n\nexport class ListDefinition {\n public _name: string;\n public _items: Map | null;\n public _itemNameToValues: Map;\n\n constructor(name: string, items: Map | null) {\n this._name = name || \"\";\n this._items = null;\n this._itemNameToValues = items || new Map();\n }\n get name() {\n return this._name;\n }\n get items() {\n if (this._items == null) {\n this._items = new Map();\n for (let [key, value] of this._itemNameToValues) {\n let item = new InkListItem(this.name, key);\n this._items.set(item.serialized(), value);\n }\n }\n\n return this._items;\n }\n\n public ValueForItem(item: InkListItem) {\n if (!item.itemName) return 0;\n\n let intVal = this._itemNameToValues.get(item.itemName);\n if (typeof intVal !== \"undefined\") return intVal;\n else return 0;\n }\n public ContainsItem(item: InkListItem) {\n if (!item.itemName) return false;\n if (item.originName != this.name) return false;\n\n return this._itemNameToValues.has(item.itemName);\n }\n public ContainsItemWithName(itemName: string) {\n return this._itemNameToValues.has(itemName);\n }\n public TryGetItemWithValue(\n val: number,\n /* out */ item: InkListItem\n ): TryGetResult {\n for (let [key, value] of this._itemNameToValues) {\n if (value == val) {\n item = new InkListItem(this.name, key);\n return { result: item, exists: true };\n }\n }\n\n item = InkListItem.Null;\n return { result: item, exists: false };\n }\n public TryGetValueForItem(\n item: InkListItem,\n /* out */ intVal: number\n ): TryGetResult {\n if (!item.itemName) return { result: 0, exists: false };\n let value = this._itemNameToValues.get(item.itemName);\n\n if (!value) return { result: 0, exists: false };\n return { result: value, exists: true };\n }\n}\n","import { InkListItem } from \"./InkList\";\nimport { ListValue } from \"./Value\";\nimport { ListDefinition } from \"./ListDefinition\";\nimport { TryGetResult } from \"./TryGetResult\";\nimport { throwNullException } from \"./NullException\";\n\nexport class ListDefinitionsOrigin {\n protected _lists: Map;\n protected _allUnambiguousListValueCache: Map;\n\n constructor(lists: ListDefinition[]) {\n this._lists = new Map();\n this._allUnambiguousListValueCache = new Map();\n\n for (let list of lists) {\n this._lists.set(list.name, list);\n\n for (let [key, val] of list.items) {\n let item = InkListItem.fromSerializedKey(key);\n let listValue = new ListValue(item, val);\n\n if (!item.itemName) {\n throw new Error(\"item.itemName is null or undefined.\");\n }\n\n this._allUnambiguousListValueCache.set(item.itemName, listValue);\n this._allUnambiguousListValueCache.set(item.fullName, listValue);\n }\n }\n }\n get lists(): ListDefinition[] {\n let listOfLists: ListDefinition[] = [];\n\n for (let [, value] of this._lists) {\n listOfLists.push(value);\n }\n\n return listOfLists;\n }\n public TryListGetDefinition(\n name: string | null,\n /* out */ def: ListDefinition | null\n ): TryGetResult {\n if (name === null) {\n return { result: def, exists: false };\n }\n // initially, this function returns a boolean and the second parameter is an out.\n let definition = this._lists.get(name);\n if (!definition) return { result: def, exists: false };\n\n return { result: definition, exists: true };\n }\n public FindSingleItemListWithName(name: string | null) {\n if (name === null) {\n return throwNullException(\"name\");\n }\n let val = this._allUnambiguousListValueCache.get(name);\n\n if (typeof val !== \"undefined\") {\n return val;\n }\n\n return null;\n }\n}\n","import { Container } from \"./Container\";\nimport {\n Value,\n IntValue,\n FloatValue,\n StringValue,\n DivertTargetValue,\n VariablePointerValue,\n ListValue,\n BoolValue,\n} from \"./Value\";\nimport { Glue } from \"./Glue\";\nimport { ControlCommand } from \"./ControlCommand\";\nimport { PushPopType } from \"./PushPop\";\nimport { Divert } from \"./Divert\";\nimport { ChoicePoint } from \"./ChoicePoint\";\nimport { VariableReference } from \"./VariableReference\";\nimport { VariableAssignment } from \"./VariableAssignment\";\nimport { NativeFunctionCall } from \"./NativeFunctionCall\";\nimport { Void } from \"./Void\";\nimport { Tag } from \"./Tag\";\nimport { Path } from \"./Path\";\nimport { Choice } from \"./Choice\";\nimport { ListDefinition } from \"./ListDefinition\";\nimport { ListDefinitionsOrigin } from \"./ListDefinitionsOrigin\";\nimport { InkListItem, InkList } from \"./InkList\";\nimport { InkObject } from \"./Object\";\nimport { asOrNull } from \"./TypeAssertion\";\nimport { throwNullException } from \"./NullException\";\nimport { SimpleJson } from \"./SimpleJson\";\n\nexport class JsonSerialisation {\n public static JArrayToRuntimeObjList(\n jArray: any[],\n skipLast: boolean = false\n ) {\n let count = jArray.length;\n if (skipLast) count--;\n\n let list: InkObject[] = [];\n\n for (let i = 0; i < count; i++) {\n let jTok = jArray[i];\n let runtimeObj = this.JTokenToRuntimeObject(jTok);\n if (runtimeObj === null) {\n return throwNullException(\"runtimeObj\");\n }\n list.push(runtimeObj);\n }\n\n return list;\n }\n\n public static WriteDictionaryRuntimeObjs(\n writer: SimpleJson.Writer,\n dictionary: Map\n ) {\n writer.WriteObjectStart();\n for (let [key, value] of dictionary) {\n writer.WritePropertyStart(key);\n this.WriteRuntimeObject(writer, value);\n writer.WritePropertyEnd();\n }\n writer.WriteObjectEnd();\n }\n\n public static WriteListRuntimeObjs(\n writer: SimpleJson.Writer,\n list: InkObject[]\n ) {\n writer.WriteArrayStart();\n for (let value of list) {\n this.WriteRuntimeObject(writer, value);\n }\n writer.WriteArrayEnd();\n }\n\n public static WriteIntDictionary(\n writer: SimpleJson.Writer,\n dict: Map\n ) {\n writer.WriteObjectStart();\n for (let [key, value] of dict) {\n writer.WriteIntProperty(key, value);\n }\n writer.WriteObjectEnd();\n }\n\n public static WriteRuntimeObject(\n writer: SimpleJson.Writer,\n obj: InkObject\n ): void {\n let container = asOrNull(obj, Container);\n if (container) {\n this.WriteRuntimeContainer(writer, container);\n return;\n }\n\n let divert = asOrNull(obj, Divert);\n if (divert) {\n let divTypeKey = \"->\";\n if (divert.isExternal) {\n divTypeKey = \"x()\";\n } else if (divert.pushesToStack) {\n if (divert.stackPushType == PushPopType.Function) {\n divTypeKey = \"f()\";\n } else if (divert.stackPushType == PushPopType.Tunnel) {\n divTypeKey = \"->t->\";\n }\n }\n\n let targetStr;\n if (divert.hasVariableTarget) {\n targetStr = divert.variableDivertName;\n } else {\n targetStr = divert.targetPathString;\n }\n\n writer.WriteObjectStart();\n writer.WriteProperty(divTypeKey, targetStr);\n\n if (divert.hasVariableTarget) {\n writer.WriteProperty(\"var\", true);\n }\n\n if (divert.isConditional) {\n writer.WriteProperty(\"c\", true);\n }\n\n if (divert.externalArgs > 0) {\n writer.WriteIntProperty(\"exArgs\", divert.externalArgs);\n }\n\n writer.WriteObjectEnd();\n return;\n }\n\n let choicePoint = asOrNull(obj, ChoicePoint);\n if (choicePoint) {\n writer.WriteObjectStart();\n writer.WriteProperty(\"*\", choicePoint.pathStringOnChoice);\n writer.WriteIntProperty(\"flg\", choicePoint.flags);\n writer.WriteObjectEnd();\n return;\n }\n\n let boolVal = asOrNull(obj, BoolValue);\n if (boolVal) {\n writer.WriteBool(boolVal.value);\n return;\n }\n\n let intVal = asOrNull(obj, IntValue);\n if (intVal) {\n writer.WriteInt(intVal.value);\n return;\n }\n\n let floatVal = asOrNull(obj, FloatValue);\n if (floatVal) {\n writer.WriteFloat(floatVal.value);\n return;\n }\n\n let strVal = asOrNull(obj, StringValue);\n if (strVal) {\n if (strVal.isNewline) {\n writer.Write(\"\\n\", false);\n } else {\n writer.WriteStringStart();\n writer.WriteStringInner(\"^\");\n writer.WriteStringInner(strVal.value);\n writer.WriteStringEnd();\n }\n return;\n }\n\n let listVal = asOrNull(obj, ListValue);\n if (listVal) {\n this.WriteInkList(writer, listVal);\n return;\n }\n\n let divTargetVal = asOrNull(obj, DivertTargetValue);\n if (divTargetVal) {\n writer.WriteObjectStart();\n if (divTargetVal.value === null) {\n return throwNullException(\"divTargetVal.value\");\n }\n writer.WriteProperty(\"^->\", divTargetVal.value.componentsString);\n writer.WriteObjectEnd();\n\n return;\n }\n\n let varPtrVal = asOrNull(obj, VariablePointerValue);\n if (varPtrVal) {\n writer.WriteObjectStart();\n writer.WriteProperty(\"^var\", varPtrVal.value);\n writer.WriteIntProperty(\"ci\", varPtrVal.contextIndex);\n writer.WriteObjectEnd();\n return;\n }\n\n let glue = asOrNull(obj, Glue);\n if (glue) {\n writer.Write(\"<>\");\n return;\n }\n\n let controlCmd = asOrNull(obj, ControlCommand);\n if (controlCmd) {\n writer.Write(\n JsonSerialisation._controlCommandNames[controlCmd.commandType]\n );\n return;\n }\n\n let nativeFunc = asOrNull(obj, NativeFunctionCall);\n if (nativeFunc) {\n let name = nativeFunc.name;\n\n if (name == \"^\") name = \"L^\";\n\n writer.Write(name);\n return;\n }\n\n let varRef = asOrNull(obj, VariableReference);\n if (varRef) {\n writer.WriteObjectStart();\n let readCountPath = varRef.pathStringForCount;\n if (readCountPath != null) {\n writer.WriteProperty(\"CNT?\", readCountPath);\n } else {\n writer.WriteProperty(\"VAR?\", varRef.name);\n }\n\n writer.WriteObjectEnd();\n return;\n }\n\n let varAss = asOrNull(obj, VariableAssignment);\n if (varAss) {\n writer.WriteObjectStart();\n\n let key = varAss.isGlobal ? \"VAR=\" : \"temp=\";\n writer.WriteProperty(key, varAss.variableName);\n\n // Reassignment?\n if (!varAss.isNewDeclaration) writer.WriteProperty(\"re\", true);\n\n writer.WriteObjectEnd();\n\n return;\n }\n\n let voidObj = asOrNull(obj, Void);\n if (voidObj) {\n writer.Write(\"void\");\n return;\n }\n\n let tag = asOrNull(obj, Tag);\n if (tag) {\n writer.WriteObjectStart();\n writer.WriteProperty(\"#\", tag.text);\n writer.WriteObjectEnd();\n return;\n }\n\n let choice = asOrNull(obj, Choice);\n if (choice) {\n this.WriteChoice(writer, choice);\n return;\n }\n\n throw new Error(\"Failed to convert runtime object to Json token: \" + obj);\n }\n\n public static JObjectToDictionaryRuntimeObjs(jObject: Record) {\n let dict: Map = new Map();\n\n for (let key in jObject) {\n if (jObject.hasOwnProperty(key)) {\n let inkObject = this.JTokenToRuntimeObject(jObject[key]);\n if (inkObject === null) {\n return throwNullException(\"inkObject\");\n }\n dict.set(key, inkObject);\n }\n }\n\n return dict;\n }\n\n public static JObjectToIntDictionary(jObject: Record) {\n let dict: Map = new Map();\n for (let key in jObject) {\n if (jObject.hasOwnProperty(key)) {\n dict.set(key, parseInt(jObject[key]));\n }\n }\n return dict;\n }\n\n public static JTokenToRuntimeObject(token: any): InkObject | null {\n if (\n (typeof token === \"number\" && !isNaN(token)) ||\n typeof token === \"boolean\"\n ) {\n return Value.Create(token);\n }\n\n if (typeof token === \"string\") {\n let str = token.toString();\n\n // String value\n let firstChar = str[0];\n if (firstChar == \"^\") return new StringValue(str.substring(1));\n else if (firstChar == \"\\n\" && str.length == 1)\n return new StringValue(\"\\n\");\n\n // Glue\n if (str == \"<>\") return new Glue();\n\n // Control commands (would looking up in a hash set be faster?)\n for (let i = 0; i < JsonSerialisation._controlCommandNames.length; ++i) {\n let cmdName = JsonSerialisation._controlCommandNames[i];\n if (str == cmdName) {\n return new ControlCommand(i);\n }\n }\n\n // Native functions\n if (str == \"L^\") str = \"^\";\n if (NativeFunctionCall.CallExistsWithName(str))\n return NativeFunctionCall.CallWithName(str);\n\n // Pop\n if (str == \"->->\") return ControlCommand.PopTunnel();\n else if (str == \"~ret\") return ControlCommand.PopFunction();\n\n // Void\n if (str == \"void\") return new Void();\n }\n\n if (typeof token === \"object\" && !Array.isArray(token)) {\n let obj = token as Record;\n let propValue;\n\n // Divert target value to path\n if (obj[\"^->\"]) {\n propValue = obj[\"^->\"];\n return new DivertTargetValue(new Path(propValue.toString()));\n }\n\n // VariablePointerValue\n if (obj[\"^var\"]) {\n propValue = obj[\"^var\"];\n let varPtr = new VariablePointerValue(propValue.toString());\n if (\"ci\" in obj) {\n propValue = obj[\"ci\"];\n varPtr.contextIndex = parseInt(propValue);\n }\n return varPtr;\n }\n\n // Divert\n let isDivert = false;\n let pushesToStack = false;\n let divPushType = PushPopType.Function;\n let external = false;\n if ((propValue = obj[\"->\"])) {\n isDivert = true;\n } else if ((propValue = obj[\"f()\"])) {\n isDivert = true;\n pushesToStack = true;\n divPushType = PushPopType.Function;\n } else if ((propValue = obj[\"->t->\"])) {\n isDivert = true;\n pushesToStack = true;\n divPushType = PushPopType.Tunnel;\n } else if ((propValue = obj[\"x()\"])) {\n isDivert = true;\n external = true;\n pushesToStack = false;\n divPushType = PushPopType.Function;\n }\n\n if (isDivert) {\n let divert = new Divert();\n divert.pushesToStack = pushesToStack;\n divert.stackPushType = divPushType;\n divert.isExternal = external;\n\n let target = propValue.toString();\n\n if ((propValue = obj[\"var\"])) divert.variableDivertName = target;\n else divert.targetPathString = target;\n\n divert.isConditional = !!obj[\"c\"];\n\n if (external) {\n if ((propValue = obj[\"exArgs\"]))\n divert.externalArgs = parseInt(propValue);\n }\n\n return divert;\n }\n\n // Choice\n if ((propValue = obj[\"*\"])) {\n let choice = new ChoicePoint();\n choice.pathStringOnChoice = propValue.toString();\n\n if ((propValue = obj[\"flg\"])) choice.flags = parseInt(propValue);\n\n return choice;\n }\n\n // Variable reference\n if ((propValue = obj[\"VAR?\"])) {\n return new VariableReference(propValue.toString());\n } else if ((propValue = obj[\"CNT?\"])) {\n let readCountVarRef = new VariableReference();\n readCountVarRef.pathStringForCount = propValue.toString();\n return readCountVarRef;\n }\n\n // Variable assignment\n let isVarAss = false;\n let isGlobalVar = false;\n if ((propValue = obj[\"VAR=\"])) {\n isVarAss = true;\n isGlobalVar = true;\n } else if ((propValue = obj[\"temp=\"])) {\n isVarAss = true;\n isGlobalVar = false;\n }\n if (isVarAss) {\n let varName = propValue.toString();\n let isNewDecl = !obj[\"re\"];\n let varAss = new VariableAssignment(varName, isNewDecl);\n varAss.isGlobal = isGlobalVar;\n return varAss;\n }\n if (obj[\"#\"] !== undefined) {\n propValue = obj[\"#\"];\n return new Tag(propValue.toString());\n }\n\n // List value\n if ((propValue = obj[\"list\"])) {\n // var listContent = (Dictionary)propValue;\n let listContent = propValue as Record;\n let rawList = new InkList();\n if ((propValue = obj[\"origins\"])) {\n // var namesAsObjs = (List)propValue;\n let namesAsObjs = propValue as string[];\n // rawList.SetInitialOriginNames(namesAsObjs.Cast().ToList());\n rawList.SetInitialOriginNames(namesAsObjs);\n }\n\n for (let key in listContent) {\n if (listContent.hasOwnProperty(key)) {\n let nameToVal = listContent[key];\n let item = new InkListItem(key);\n let val = parseInt(nameToVal);\n rawList.Add(item, val);\n }\n }\n\n return new ListValue(rawList);\n }\n\n if (obj[\"originalChoicePath\"] != null) return this.JObjectToChoice(obj);\n }\n\n // Array is always a Runtime.Container\n if (Array.isArray(token)) {\n return this.JArrayToContainer(token);\n }\n\n if (token === null || token === undefined) return null;\n\n throw new Error(\n \"Failed to convert token to runtime object: \" +\n this.toJson(token, [\"parent\"])\n );\n }\n\n public static toJson(\n me: T,\n removes?: (keyof T)[],\n space?: number\n ): string {\n return JSON.stringify(\n me,\n (k, v) => (removes?.some((r) => r === k) ? undefined : v),\n space\n );\n }\n\n public static WriteRuntimeContainer(\n writer: SimpleJson.Writer,\n container: Container | null,\n withoutName: boolean = false\n ) {\n writer.WriteArrayStart();\n if (container === null) {\n return throwNullException(\"container\");\n }\n for (let c of container.content) this.WriteRuntimeObject(writer, c);\n\n let namedOnlyContent = container.namedOnlyContent;\n let countFlags = container.countFlags;\n let hasNameProperty = container.name != null && !withoutName;\n\n let hasTerminator =\n namedOnlyContent != null || countFlags > 0 || hasNameProperty;\n if (hasTerminator) {\n writer.WriteObjectStart();\n }\n\n if (namedOnlyContent != null) {\n for (let [key, value] of namedOnlyContent) {\n let name = key;\n let namedContainer = asOrNull(value, Container);\n writer.WritePropertyStart(name);\n this.WriteRuntimeContainer(writer, namedContainer, true);\n writer.WritePropertyEnd();\n }\n }\n\n if (countFlags > 0) writer.WriteIntProperty(\"#f\", countFlags);\n\n if (hasNameProperty) writer.WriteProperty(\"#n\", container.name);\n\n if (hasTerminator) writer.WriteObjectEnd();\n else writer.WriteNull();\n\n writer.WriteArrayEnd();\n }\n\n public static JArrayToContainer(jArray: any[]) {\n let container = new Container();\n container.content = this.JArrayToRuntimeObjList(jArray, true);\n\n let terminatingObj = jArray[jArray.length - 1] as Record;\n if (terminatingObj != null) {\n let namedOnlyContent = new Map();\n\n for (let key in terminatingObj) {\n if (key == \"#f\") {\n container.countFlags = parseInt(terminatingObj[key]);\n } else if (key == \"#n\") {\n container.name = terminatingObj[key].toString();\n } else {\n let namedContentItem = this.JTokenToRuntimeObject(\n terminatingObj[key]\n );\n // var namedSubContainer = namedContentItem as Container;\n let namedSubContainer = asOrNull(namedContentItem, Container);\n if (namedSubContainer) namedSubContainer.name = key;\n namedOnlyContent.set(key, namedContentItem);\n }\n }\n\n container.namedOnlyContent = namedOnlyContent;\n }\n\n return container;\n }\n\n public static JObjectToChoice(jObj: Record) {\n let choice = new Choice();\n choice.text = jObj[\"text\"].toString();\n choice.index = parseInt(jObj[\"index\"]);\n choice.sourcePath = jObj[\"originalChoicePath\"].toString();\n choice.originalThreadIndex = parseInt(jObj[\"originalThreadIndex\"]);\n choice.pathStringOnChoice = jObj[\"targetPath\"].toString();\n return choice;\n }\n\n public static WriteChoice(writer: SimpleJson.Writer, choice: Choice) {\n writer.WriteObjectStart();\n writer.WriteProperty(\"text\", choice.text);\n writer.WriteIntProperty(\"index\", choice.index);\n writer.WriteProperty(\"originalChoicePath\", choice.sourcePath);\n writer.WriteIntProperty(\"originalThreadIndex\", choice.originalThreadIndex);\n writer.WriteProperty(\"targetPath\", choice.pathStringOnChoice);\n writer.WriteObjectEnd();\n }\n\n public static WriteInkList(writer: SimpleJson.Writer, listVal: ListValue) {\n let rawList = listVal.value;\n if (rawList === null) {\n return throwNullException(\"rawList\");\n }\n\n writer.WriteObjectStart();\n writer.WritePropertyStart(\"list\");\n writer.WriteObjectStart();\n\n for (let [key, val] of rawList) {\n let item = InkListItem.fromSerializedKey(key);\n let itemVal = val;\n\n if (item.itemName === null) {\n return throwNullException(\"item.itemName\");\n }\n\n writer.WritePropertyNameStart();\n writer.WritePropertyNameInner(item.originName ? item.originName : \"?\");\n writer.WritePropertyNameInner(\".\");\n writer.WritePropertyNameInner(item.itemName);\n writer.WritePropertyNameEnd();\n\n writer.Write(itemVal);\n\n writer.WritePropertyEnd();\n }\n\n writer.WriteObjectEnd();\n\n writer.WritePropertyEnd();\n\n if (\n rawList.Count == 0 &&\n rawList.originNames != null &&\n rawList.originNames.length > 0\n ) {\n writer.WritePropertyStart(\"origins\");\n writer.WriteArrayStart();\n for (let name of rawList.originNames) writer.Write(name);\n writer.WriteArrayEnd();\n writer.WritePropertyEnd();\n }\n\n writer.WriteObjectEnd();\n }\n\n public static ListDefinitionsToJToken(origin: ListDefinitionsOrigin) {\n let result: Record = {};\n\n for (let def of origin.lists) {\n let listDefJson: Record = {};\n\n for (let [key, val] of def.items) {\n let item = InkListItem.fromSerializedKey(key);\n if (item.itemName === null) {\n return throwNullException(\"item.itemName\");\n }\n listDefJson[item.itemName] = val;\n }\n\n result[def.name] = listDefJson;\n }\n\n return result;\n }\n\n public static JTokenToListDefinitions(obj: Record) {\n // var defsObj = (Dictionary)obj;\n let defsObj = obj;\n\n let allDefs: ListDefinition[] = [];\n\n for (let key in defsObj) {\n if (defsObj.hasOwnProperty(key)) {\n let name = key.toString();\n // var listDefJson = (Dictionary)kv.Value;\n let listDefJson = defsObj[key] as Record;\n\n // Cast (string, object) to (string, int) for items\n let items: Map = new Map();\n\n for (let nameValueKey in listDefJson) {\n if (defsObj.hasOwnProperty(key)) {\n let nameValue = listDefJson[nameValueKey];\n items.set(nameValueKey, parseInt(nameValue));\n }\n }\n\n let def = new ListDefinition(name, items);\n allDefs.push(def);\n }\n }\n\n return new ListDefinitionsOrigin(allDefs);\n }\n\n private static _controlCommandNames = (() => {\n let _controlCommandNames: string[] = [];\n\n _controlCommandNames[ControlCommand.CommandType.EvalStart] = \"ev\";\n _controlCommandNames[ControlCommand.CommandType.EvalOutput] = \"out\";\n _controlCommandNames[ControlCommand.CommandType.EvalEnd] = \"/ev\";\n _controlCommandNames[ControlCommand.CommandType.Duplicate] = \"du\";\n _controlCommandNames[ControlCommand.CommandType.PopEvaluatedValue] = \"pop\";\n _controlCommandNames[ControlCommand.CommandType.PopFunction] = \"~ret\";\n _controlCommandNames[ControlCommand.CommandType.PopTunnel] = \"->->\";\n _controlCommandNames[ControlCommand.CommandType.BeginString] = \"str\";\n _controlCommandNames[ControlCommand.CommandType.EndString] = \"/str\";\n _controlCommandNames[ControlCommand.CommandType.NoOp] = \"nop\";\n _controlCommandNames[ControlCommand.CommandType.ChoiceCount] = \"choiceCnt\";\n _controlCommandNames[ControlCommand.CommandType.Turns] = \"turn\";\n _controlCommandNames[ControlCommand.CommandType.TurnsSince] = \"turns\";\n _controlCommandNames[ControlCommand.CommandType.ReadCount] = \"readc\";\n _controlCommandNames[ControlCommand.CommandType.Random] = \"rnd\";\n _controlCommandNames[ControlCommand.CommandType.SeedRandom] = \"srnd\";\n _controlCommandNames[ControlCommand.CommandType.VisitIndex] = \"visit\";\n _controlCommandNames[ControlCommand.CommandType.SequenceShuffleIndex] =\n \"seq\";\n _controlCommandNames[ControlCommand.CommandType.StartThread] = \"thread\";\n _controlCommandNames[ControlCommand.CommandType.Done] = \"done\";\n _controlCommandNames[ControlCommand.CommandType.End] = \"end\";\n _controlCommandNames[ControlCommand.CommandType.ListFromInt] = \"listInt\";\n _controlCommandNames[ControlCommand.CommandType.ListRange] = \"range\";\n _controlCommandNames[ControlCommand.CommandType.ListRandom] = \"lrnd\";\n _controlCommandNames[ControlCommand.CommandType.BeginTag] = \"#\";\n _controlCommandNames[ControlCommand.CommandType.EndTag] = \"/#\";\n\n for (let i = 0; i < ControlCommand.CommandType.TOTAL_VALUES; ++i) {\n if (_controlCommandNames[i] == null)\n throw new Error(\"Control command not accounted for in serialisation\");\n }\n\n return _controlCommandNames;\n })();\n}\n","import { PushPopType } from \"./PushPop\";\nimport { Path } from \"./Path\";\nimport { Story } from \"./Story\";\nimport { JsonSerialisation } from \"./JsonSerialisation\";\nimport { ListValue } from \"./Value\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { Pointer } from \"./Pointer\";\nimport { InkObject } from \"./Object\";\nimport { Debug } from \"./Debug\";\nimport { tryGetValueFromMap } from \"./TryGetResult\";\nimport { throwNullException } from \"./NullException\";\nimport { SimpleJson } from \"./SimpleJson\";\n\nexport class CallStack {\n get elements() {\n return this.callStack;\n }\n\n get depth() {\n return this.elements.length;\n }\n\n get currentElement() {\n let thread = this._threads[this._threads.length - 1];\n let cs = thread.callstack;\n return cs[cs.length - 1];\n }\n\n get currentElementIndex() {\n return this.callStack.length - 1;\n }\n\n get currentThread(): CallStack.Thread {\n return this._threads[this._threads.length - 1];\n }\n set currentThread(value: CallStack.Thread) {\n Debug.Assert(\n this._threads.length == 1,\n \"Shouldn't be directly setting the current thread when we have a stack of them\"\n );\n\n this._threads.length = 0;\n this._threads.push(value);\n }\n\n get canPop() {\n return this.callStack.length > 1;\n }\n\n constructor(storyContext: Story);\n constructor(toCopy: CallStack);\n constructor() {\n if (arguments[0] instanceof Story) {\n let storyContext = arguments[0] as Story;\n\n this._startOfRoot = Pointer.StartOf(storyContext.rootContentContainer);\n this.Reset();\n } else {\n let toCopy = arguments[0] as CallStack;\n\n this._threads = [];\n for (let otherThread of toCopy._threads) {\n this._threads.push(otherThread.Copy());\n }\n this._threadCounter = toCopy._threadCounter;\n this._startOfRoot = toCopy._startOfRoot.copy();\n }\n }\n\n public Reset() {\n this._threads = [];\n this._threads.push(new CallStack.Thread());\n\n this._threads[0].callstack.push(\n new CallStack.Element(PushPopType.Tunnel, this._startOfRoot)\n );\n }\n\n public SetJsonToken(jObject: Record, storyContext: Story) {\n this._threads.length = 0;\n\n // TODO: (List) jObject [\"threads\"];\n let jThreads: any[] = jObject[\"threads\"];\n\n for (let jThreadTok of jThreads) {\n // TODO: var jThreadObj = (Dictionary)jThreadTok;\n let jThreadObj = jThreadTok;\n let thread = new CallStack.Thread(jThreadObj, storyContext);\n this._threads.push(thread);\n }\n\n // TODO: (int)jObject [\"threadCounter\"];\n this._threadCounter = parseInt(jObject[\"threadCounter\"]);\n this._startOfRoot = Pointer.StartOf(storyContext.rootContentContainer);\n }\n public WriteJson(w: SimpleJson.Writer) {\n w.WriteObject((writer) => {\n writer.WritePropertyStart(\"threads\");\n writer.WriteArrayStart();\n\n for (let thread of this._threads) {\n thread.WriteJson(writer);\n }\n\n writer.WriteArrayEnd();\n writer.WritePropertyEnd();\n\n writer.WritePropertyStart(\"threadCounter\");\n writer.WriteInt(this._threadCounter);\n writer.WritePropertyEnd();\n });\n }\n\n public PushThread() {\n let newThread = this.currentThread.Copy();\n this._threadCounter++;\n newThread.threadIndex = this._threadCounter;\n this._threads.push(newThread);\n }\n\n public ForkThread() {\n let forkedThread = this.currentThread.Copy();\n this._threadCounter++;\n forkedThread.threadIndex = this._threadCounter;\n return forkedThread;\n }\n\n public PopThread() {\n if (this.canPopThread) {\n this._threads.splice(this._threads.indexOf(this.currentThread), 1); // should be equivalent to a pop()\n } else {\n throw new Error(\"Can't pop thread\");\n }\n }\n\n get canPopThread() {\n return this._threads.length > 1 && !this.elementIsEvaluateFromGame;\n }\n\n get elementIsEvaluateFromGame() {\n return this.currentElement.type == PushPopType.FunctionEvaluationFromGame;\n }\n\n public Push(\n type: PushPopType,\n externalEvaluationStackHeight: number = 0,\n outputStreamLengthWithPushed: number = 0\n ) {\n let element = new CallStack.Element(\n type,\n this.currentElement.currentPointer,\n false\n );\n\n element.evaluationStackHeightWhenPushed = externalEvaluationStackHeight;\n element.functionStartInOutputStream = outputStreamLengthWithPushed;\n\n this.callStack.push(element);\n }\n\n public CanPop(type: PushPopType | null = null) {\n if (!this.canPop) return false;\n\n if (type == null) return true;\n\n return this.currentElement.type == type;\n }\n\n public Pop(type: PushPopType | null = null) {\n if (this.CanPop(type)) {\n this.callStack.pop();\n return;\n } else {\n throw new Error(\"Mismatched push/pop in Callstack\");\n }\n }\n\n public GetTemporaryVariableWithName(\n name: string | null,\n contextIndex: number = -1\n ) {\n if (contextIndex == -1) contextIndex = this.currentElementIndex + 1;\n\n let contextElement = this.callStack[contextIndex - 1];\n\n let varValue = tryGetValueFromMap(\n contextElement.temporaryVariables,\n name,\n null\n );\n if (varValue.exists) {\n return varValue.result;\n } else {\n return null;\n }\n }\n\n public SetTemporaryVariable(\n name: string,\n value: any,\n declareNew: boolean,\n contextIndex: number = -1\n ) {\n if (contextIndex == -1) contextIndex = this.currentElementIndex + 1;\n\n let contextElement = this.callStack[contextIndex - 1];\n\n if (!declareNew && !contextElement.temporaryVariables.get(name)) {\n throw new Error(\"Could not find temporary variable to set: \" + name);\n }\n\n let oldValue = tryGetValueFromMap(\n contextElement.temporaryVariables,\n name,\n null\n );\n if (oldValue.exists)\n ListValue.RetainListOriginsForAssignment(oldValue.result, value);\n\n contextElement.temporaryVariables.set(name, value);\n }\n\n public ContextForVariableNamed(name: string) {\n if (this.currentElement.temporaryVariables.get(name)) {\n return this.currentElementIndex + 1;\n } else {\n return 0;\n }\n }\n\n public ThreadWithIndex(index: number) {\n let filtered = this._threads.filter((t) => {\n if (t.threadIndex == index) return t;\n });\n\n return filtered.length > 0 ? filtered[0] : null;\n }\n\n get callStack() {\n return this.currentThread.callstack;\n }\n\n get callStackTrace() {\n let sb = new StringBuilder();\n\n for (let t = 0; t < this._threads.length; t++) {\n let thread = this._threads[t];\n let isCurrent = t == this._threads.length - 1;\n sb.AppendFormat(\n \"=== THREAD {0}/{1} {2}===\\n\",\n t + 1,\n this._threads.length,\n isCurrent ? \"(current) \" : \"\"\n );\n\n for (let i = 0; i < thread.callstack.length; i++) {\n if (thread.callstack[i].type == PushPopType.Function)\n sb.Append(\" [FUNCTION] \");\n else sb.Append(\" [TUNNEL] \");\n\n let pointer = thread.callstack[i].currentPointer;\n if (!pointer.isNull) {\n sb.Append(\"\");\n }\n }\n }\n\n return sb.toString();\n }\n\n public _threads!: CallStack.Thread[]; // Banged because it's initialized in Reset().\n public _threadCounter: number = 0;\n public _startOfRoot: Pointer = Pointer.Null;\n}\n\nexport namespace CallStack {\n export class Element {\n public currentPointer: Pointer;\n public inExpressionEvaluation: boolean;\n public temporaryVariables: Map;\n public type: PushPopType;\n\n public evaluationStackHeightWhenPushed: number = 0;\n public functionStartInOutputStream: number = 0;\n\n constructor(\n type: PushPopType,\n pointer: Pointer,\n inExpressionEvaluation: boolean = false\n ) {\n this.currentPointer = pointer.copy();\n this.inExpressionEvaluation = inExpressionEvaluation;\n this.temporaryVariables = new Map();\n this.type = type;\n }\n\n public Copy() {\n let copy = new Element(\n this.type,\n this.currentPointer,\n this.inExpressionEvaluation\n );\n copy.temporaryVariables = new Map(this.temporaryVariables);\n copy.evaluationStackHeightWhenPushed =\n this.evaluationStackHeightWhenPushed;\n copy.functionStartInOutputStream = this.functionStartInOutputStream;\n return copy;\n }\n }\n\n export class Thread {\n public callstack: Element[];\n public threadIndex: number = 0;\n public previousPointer: Pointer = Pointer.Null;\n\n constructor();\n constructor(jThreadObj: any, storyContext: Story);\n constructor() {\n this.callstack = [];\n\n if (arguments[0] && arguments[1]) {\n let jThreadObj = arguments[0];\n let storyContext = arguments[1];\n\n // TODO: (int) jThreadObj['threadIndex'] can raise;\n this.threadIndex = parseInt(jThreadObj[\"threadIndex\"]);\n\n let jThreadCallstack = jThreadObj[\"callstack\"];\n\n for (let jElTok of jThreadCallstack) {\n let jElementObj = jElTok;\n\n // TODO: (int) jElementObj['type'] can raise;\n let pushPopType: PushPopType = parseInt(jElementObj[\"type\"]);\n\n let pointer = Pointer.Null;\n\n let currentContainerPathStr: string;\n // TODO: jElementObj.TryGetValue (\"cPath\", out currentContainerPathStrToken);\n let currentContainerPathStrToken = jElementObj[\"cPath\"];\n if (typeof currentContainerPathStrToken !== \"undefined\") {\n currentContainerPathStr = currentContainerPathStrToken.toString();\n\n let threadPointerResult = storyContext.ContentAtPath(\n new Path(currentContainerPathStr)\n );\n pointer.container = threadPointerResult.container;\n pointer.index = parseInt(jElementObj[\"idx\"]);\n\n if (threadPointerResult.obj == null)\n throw new Error(\n \"When loading state, internal story location couldn't be found: \" +\n currentContainerPathStr +\n \". Has the story changed since this save data was created?\"\n );\n else if (threadPointerResult.approximate) {\n if (pointer.container === null) {\n return throwNullException(\"pointer.container\");\n }\n storyContext.Warning(\n \"When loading state, exact internal story location couldn't be found: '\" +\n currentContainerPathStr +\n \"', so it was approximated to '\" +\n pointer.container.path.toString() +\n \"' to recover. Has the story changed since this save data was created?\"\n );\n }\n }\n\n let inExpressionEvaluation = !!jElementObj[\"exp\"];\n\n let el = new Element(pushPopType, pointer, inExpressionEvaluation);\n\n let temps = jElementObj[\"temp\"];\n if (typeof temps !== \"undefined\") {\n el.temporaryVariables =\n JsonSerialisation.JObjectToDictionaryRuntimeObjs(temps);\n } else {\n el.temporaryVariables.clear();\n }\n\n this.callstack.push(el);\n }\n\n let prevContentObjPath = jThreadObj[\"previousContentObject\"];\n if (typeof prevContentObjPath !== \"undefined\") {\n let prevPath = new Path(prevContentObjPath.toString());\n this.previousPointer = storyContext.PointerAtPath(prevPath);\n }\n }\n }\n\n public Copy() {\n let copy = new Thread();\n copy.threadIndex = this.threadIndex;\n for (let e of this.callstack) {\n copy.callstack.push(e.Copy());\n }\n copy.previousPointer = this.previousPointer.copy();\n return copy;\n }\n\n public WriteJson(writer: SimpleJson.Writer) {\n writer.WriteObjectStart();\n\n writer.WritePropertyStart(\"callstack\");\n writer.WriteArrayStart();\n for (let el of this.callstack) {\n writer.WriteObjectStart();\n if (!el.currentPointer.isNull) {\n if (el.currentPointer.container === null) {\n return throwNullException(\"el.currentPointer.container\");\n }\n writer.WriteProperty(\n \"cPath\",\n el.currentPointer.container.path.componentsString\n );\n writer.WriteIntProperty(\"idx\", el.currentPointer.index);\n }\n\n writer.WriteProperty(\"exp\", el.inExpressionEvaluation);\n writer.WriteIntProperty(\"type\", el.type);\n\n if (el.temporaryVariables.size > 0) {\n writer.WritePropertyStart(\"temp\");\n JsonSerialisation.WriteDictionaryRuntimeObjs(\n writer,\n el.temporaryVariables\n );\n writer.WritePropertyEnd();\n }\n\n writer.WriteObjectEnd();\n }\n writer.WriteArrayEnd();\n writer.WritePropertyEnd();\n\n writer.WriteIntProperty(\"threadIndex\", this.threadIndex);\n\n if (!this.previousPointer.isNull) {\n let resolvedPointer = this.previousPointer.Resolve();\n if (resolvedPointer === null) {\n return throwNullException(\"this.previousPointer.Resolve()\");\n }\n writer.WriteProperty(\n \"previousContentObject\",\n resolvedPointer.path.toString()\n );\n }\n\n writer.WriteObjectEnd();\n }\n }\n}\n","import {\n AbstractValue,\n Value,\n VariablePointerValue,\n ListValue,\n IntValue,\n FloatValue,\n BoolValue,\n} from \"./Value\";\nimport { VariableAssignment } from \"./VariableAssignment\";\nimport { InkObject } from \"./Object\";\nimport { ListDefinitionsOrigin } from \"./ListDefinitionsOrigin\";\nimport { StoryException } from \"./StoryException\";\nimport { JsonSerialisation } from \"./JsonSerialisation\";\nimport { asOrThrows, asOrNull, isEquatable } from \"./TypeAssertion\";\nimport { tryGetValueFromMap } from \"./TryGetResult\";\nimport { throwNullException } from \"./NullException\";\nimport { CallStack } from \"./CallStack\";\nimport { StatePatch } from \"./StatePatch\";\nimport { SimpleJson } from \"./SimpleJson\";\nimport { InkList } from \"./Story\";\nimport { Path } from \"./Path\";\n\n// Fake class wrapper around VariableState to have correct typing\n// when using the Proxy syntax in typescript\nfunction VariablesStateAccessor(): new () => Pick {\n return class {} as any;\n}\n\ntype VariableStateValue = boolean | string | number | InkList | Path | null;\n\nexport class VariablesState extends VariablesStateAccessor<\n Record\n>() {\n // The way variableChangedEvent is a bit different than the reference implementation.\n // Originally it uses the C# += operator to add delegates, but in js we need to maintain\n // an actual collection of delegates (ie. callbacks) to register a new one, there is a\n // special ObserveVariableChange method below.\n public variableChangedEventCallbacks: Array<\n (variableName: string, newValue: InkObject) => void\n > = [];\n public variableChangedEvent(variableName: string, newValue: InkObject): void {\n for (let callback of this.variableChangedEventCallbacks) {\n callback(variableName, newValue);\n }\n }\n\n public patch: StatePatch | null = null;\n\n get batchObservingVariableChanges() {\n return this._batchObservingVariableChanges;\n }\n set batchObservingVariableChanges(value: boolean) {\n this._batchObservingVariableChanges = value;\n if (value) {\n this._changedVariablesForBatchObs = new Set();\n } else {\n if (this._changedVariablesForBatchObs != null) {\n for (let variableName of this._changedVariablesForBatchObs) {\n let currentValue = this._globalVariables.get(variableName);\n if (!currentValue) {\n throwNullException(\"currentValue\");\n } else {\n this.variableChangedEvent(variableName, currentValue);\n }\n }\n\n this._changedVariablesForBatchObs = null;\n }\n }\n }\n\n get callStack() {\n return this._callStack;\n }\n set callStack(callStack) {\n this._callStack = callStack;\n }\n\n private _batchObservingVariableChanges: boolean = false;\n\n // the original code uses a magic getter and setter for global variables,\n // allowing things like variableState['varname]. This is not quite possible\n // in js without a Proxy, so it is replaced with this $ function.\n public $(variableName: string): VariableStateValue;\n public $(variableName: string, value: VariableStateValue): void;\n public $(variableName: string, value?: any) {\n if (typeof value === \"undefined\") {\n let varContents = null;\n\n if (this.patch !== null) {\n varContents = this.patch.TryGetGlobal(variableName, null);\n if (varContents.exists)\n return (varContents.result as AbstractValue).valueObject;\n }\n\n varContents = this._globalVariables.get(variableName);\n\n if (typeof varContents === \"undefined\") {\n varContents = this._defaultGlobalVariables.get(variableName);\n }\n\n if (typeof varContents !== \"undefined\")\n return (varContents as AbstractValue).valueObject;\n else return null;\n } else {\n if (typeof this._defaultGlobalVariables.get(variableName) === \"undefined\")\n throw new StoryException(\n \"Cannot assign to a variable (\" +\n variableName +\n \") that hasn't been declared in the story\"\n );\n\n let val = Value.Create(value);\n if (val == null) {\n if (value == null) {\n throw new Error(\"Cannot pass null to VariableState\");\n } else {\n throw new Error(\n \"Invalid value passed to VariableState: \" + value.toString()\n );\n }\n }\n\n this.SetGlobal(variableName, val);\n }\n }\n\n constructor(\n callStack: CallStack,\n listDefsOrigin: ListDefinitionsOrigin | null\n ) {\n super();\n this._globalVariables = new Map();\n this._callStack = callStack;\n this._listDefsOrigin = listDefsOrigin;\n\n // if es6 proxies are available, use them.\n try {\n // the proxy is used to allow direct manipulation of global variables.\n // It first tries to access the objects own property, and if none is\n // found it delegates the call to the $ method, defined below\n let p = new Proxy(this, {\n get(target: any, name) {\n return name in target ? target[name] : target.$(name);\n },\n set(target: any, name, value) {\n if (name in target) target[name] = value;\n else target.$(name, value);\n return true; // returning a falsy value make the trap fail\n },\n });\n\n return p;\n } catch (e) {\n // the proxy object is not available in this context. we should warn the\n // dev but writing to the console feels a bit intrusive.\n // console.log(\"ES6 Proxy not available - direct manipulation of global variables can't work, use $() instead.\");\n }\n }\n\n public ApplyPatch() {\n if (this.patch === null) {\n return throwNullException(\"this.patch\");\n }\n\n for (let [namedVarKey, namedVarValue] of this.patch.globals) {\n this._globalVariables.set(namedVarKey, namedVarValue);\n }\n\n if (this._changedVariablesForBatchObs !== null) {\n for (let name of this.patch.changedVariables) {\n this._changedVariablesForBatchObs.add(name);\n }\n }\n\n this.patch = null;\n }\n\n public SetJsonToken(jToken: Record) {\n this._globalVariables.clear();\n\n for (let [varValKey, varValValue] of this._defaultGlobalVariables) {\n let loadedToken = jToken[varValKey];\n if (typeof loadedToken !== \"undefined\") {\n let tokenInkObject =\n JsonSerialisation.JTokenToRuntimeObject(loadedToken);\n if (tokenInkObject === null) {\n return throwNullException(\"tokenInkObject\");\n }\n this._globalVariables.set(varValKey, tokenInkObject);\n } else {\n this._globalVariables.set(varValKey, varValValue);\n }\n }\n }\n\n public static dontSaveDefaultValues: boolean = true;\n\n public WriteJson(writer: SimpleJson.Writer) {\n writer.WriteObjectStart();\n for (let [keyValKey, keyValValue] of this._globalVariables) {\n let name = keyValKey;\n let val = keyValValue;\n\n if (VariablesState.dontSaveDefaultValues) {\n if (this._defaultGlobalVariables.has(name)) {\n let defaultVal = this._defaultGlobalVariables.get(name)!;\n if (this.RuntimeObjectsEqual(val, defaultVal)) continue;\n }\n }\n\n writer.WritePropertyStart(name);\n JsonSerialisation.WriteRuntimeObject(writer, val);\n writer.WritePropertyEnd();\n }\n writer.WriteObjectEnd();\n }\n\n public RuntimeObjectsEqual(\n obj1: InkObject | null,\n obj2: InkObject | null\n ): boolean {\n if (obj1 === null) {\n return throwNullException(\"obj1\");\n }\n if (obj2 === null) {\n return throwNullException(\"obj2\");\n }\n\n if (obj1.constructor !== obj2.constructor) return false;\n\n let boolVal = asOrNull(obj1, BoolValue);\n if (boolVal !== null) {\n return boolVal.value === asOrThrows(obj2, BoolValue).value;\n }\n\n let intVal = asOrNull(obj1, IntValue);\n if (intVal !== null) {\n return intVal.value === asOrThrows(obj2, IntValue).value;\n }\n\n let floatVal = asOrNull(obj1, FloatValue);\n if (floatVal !== null) {\n return floatVal.value === asOrThrows(obj2, FloatValue).value;\n }\n\n let val1 = asOrNull(obj1, Value);\n let val2 = asOrNull(obj2, Value);\n if (val1 !== null && val2 !== null) {\n if (isEquatable(val1.valueObject) && isEquatable(val2.valueObject)) {\n return val1.valueObject.Equals(val2.valueObject);\n } else {\n return val1.valueObject === val2.valueObject;\n }\n }\n\n throw new Error(\n \"FastRoughDefinitelyEquals: Unsupported runtime object type: \" +\n obj1.constructor.name\n );\n }\n\n public GetVariableWithName(\n name: string | null,\n contextIndex: number = -1\n ): InkObject | null {\n let varValue = this.GetRawVariableWithName(name, contextIndex);\n\n // var varPointer = varValue as VariablePointerValue;\n let varPointer = asOrNull(varValue, VariablePointerValue);\n if (varPointer !== null) {\n varValue = this.ValueAtVariablePointer(varPointer);\n }\n\n return varValue;\n }\n\n public TryGetDefaultVariableValue(name: string | null): InkObject | null {\n let val = tryGetValueFromMap(this._defaultGlobalVariables, name, null);\n return val.exists ? val.result : null;\n }\n\n public GlobalVariableExistsWithName(name: string) {\n return (\n this._globalVariables.has(name) ||\n (this._defaultGlobalVariables !== null &&\n this._defaultGlobalVariables.has(name))\n );\n }\n\n public GetRawVariableWithName(name: string | null, contextIndex: number) {\n let varValue: InkObject | null = null;\n\n if (contextIndex == 0 || contextIndex == -1) {\n let variableValue = null;\n if (this.patch !== null) {\n variableValue = this.patch.TryGetGlobal(name, null);\n if (variableValue.exists) return variableValue.result!;\n }\n\n // this is a conditional assignment\n variableValue = tryGetValueFromMap(this._globalVariables, name, null);\n if (variableValue.exists) return variableValue.result;\n\n if (this._defaultGlobalVariables !== null) {\n variableValue = tryGetValueFromMap(\n this._defaultGlobalVariables,\n name,\n null\n );\n if (variableValue.exists) return variableValue.result;\n }\n\n if (this._listDefsOrigin === null)\n return throwNullException(\"VariablesState._listDefsOrigin\");\n let listItemValue = this._listDefsOrigin.FindSingleItemListWithName(name);\n if (listItemValue) return listItemValue;\n }\n\n varValue = this._callStack.GetTemporaryVariableWithName(name, contextIndex);\n\n return varValue;\n }\n\n public ValueAtVariablePointer(pointer: VariablePointerValue) {\n return this.GetVariableWithName(pointer.variableName, pointer.contextIndex);\n }\n\n public Assign(varAss: VariableAssignment, value: InkObject) {\n let name = varAss.variableName;\n if (name === null) {\n return throwNullException(\"name\");\n }\n let contextIndex = -1;\n\n let setGlobal = false;\n if (varAss.isNewDeclaration) {\n setGlobal = varAss.isGlobal;\n } else {\n setGlobal = this.GlobalVariableExistsWithName(name);\n }\n\n if (varAss.isNewDeclaration) {\n // var varPointer = value as VariablePointerValue;\n let varPointer = asOrNull(value, VariablePointerValue);\n if (varPointer !== null) {\n let fullyResolvedVariablePointer =\n this.ResolveVariablePointer(varPointer);\n value = fullyResolvedVariablePointer;\n }\n } else {\n let existingPointer = null;\n do {\n // existingPointer = GetRawVariableWithName (name, contextIndex) as VariablePointerValue;\n existingPointer = asOrNull(\n this.GetRawVariableWithName(name, contextIndex),\n VariablePointerValue\n );\n if (existingPointer != null) {\n name = existingPointer.variableName;\n contextIndex = existingPointer.contextIndex;\n setGlobal = contextIndex == 0;\n }\n } while (existingPointer != null);\n }\n\n if (setGlobal) {\n this.SetGlobal(name, value);\n } else {\n this._callStack.SetTemporaryVariable(\n name,\n value,\n varAss.isNewDeclaration,\n contextIndex\n );\n }\n }\n\n public SnapshotDefaultGlobals() {\n this._defaultGlobalVariables = new Map(this._globalVariables);\n }\n\n public RetainListOriginsForAssignment(\n oldValue: InkObject,\n newValue: InkObject\n ) {\n let oldList = asOrThrows(oldValue, ListValue);\n let newList = asOrThrows(newValue, ListValue);\n\n if (oldList.value && newList.value && newList.value.Count == 0) {\n newList.value.SetInitialOriginNames(oldList.value.originNames);\n }\n }\n\n public SetGlobal(variableName: string | null, value: InkObject) {\n let oldValue = null;\n\n if (this.patch === null) {\n oldValue = tryGetValueFromMap(this._globalVariables, variableName, null);\n }\n\n if (this.patch !== null) {\n oldValue = this.patch.TryGetGlobal(variableName, null);\n if (!oldValue.exists) {\n oldValue = tryGetValueFromMap(\n this._globalVariables,\n variableName,\n null\n );\n }\n }\n\n ListValue.RetainListOriginsForAssignment(oldValue!.result!, value);\n\n if (variableName === null) {\n return throwNullException(\"variableName\");\n }\n\n if (this.patch !== null) {\n this.patch.SetGlobal(variableName, value);\n } else {\n this._globalVariables.set(variableName, value);\n }\n\n // TODO: Not sure !== is equivalent to !value.Equals(oldValue)\n if (\n this.variableChangedEvent !== null &&\n oldValue !== null &&\n value !== oldValue.result\n ) {\n if (this.batchObservingVariableChanges) {\n if (this._changedVariablesForBatchObs === null) {\n return throwNullException(\"this._changedVariablesForBatchObs\");\n }\n\n if (this.patch !== null) {\n this.patch.AddChangedVariable(variableName);\n } else if (this._changedVariablesForBatchObs !== null) {\n this._changedVariablesForBatchObs.add(variableName);\n }\n } else {\n this.variableChangedEvent(variableName, value);\n }\n }\n }\n\n public ResolveVariablePointer(varPointer: VariablePointerValue) {\n let contextIndex = varPointer.contextIndex;\n\n if (contextIndex == -1)\n contextIndex = this.GetContextIndexOfVariableNamed(\n varPointer.variableName\n );\n\n let valueOfVariablePointedTo = this.GetRawVariableWithName(\n varPointer.variableName,\n contextIndex\n );\n\n // var doubleRedirectionPointer = valueOfVariablePointedTo as VariablePointerValue;\n let doubleRedirectionPointer = asOrNull(\n valueOfVariablePointedTo,\n VariablePointerValue\n );\n if (doubleRedirectionPointer != null) {\n return doubleRedirectionPointer;\n } else {\n return new VariablePointerValue(varPointer.variableName, contextIndex);\n }\n }\n\n public GetContextIndexOfVariableNamed(varName: string) {\n if (this.GlobalVariableExistsWithName(varName)) return 0;\n\n return this._callStack.currentElementIndex;\n }\n\n /**\n * This function is specific to the js version of ink. It allows to register a\n * callback that will be called when a variable changes. The original code uses\n * `state.variableChangedEvent += callback` instead.\n *\n * @param {function} callback\n */\n public ObserveVariableChange(\n callback: (variableName: string, newValue: InkObject) => void\n ) {\n this.variableChangedEventCallbacks.push(callback);\n }\n\n private _globalVariables: Map;\n private _defaultGlobalVariables: Map = new Map();\n\n private _callStack: CallStack;\n private _changedVariablesForBatchObs: Set | null = new Set();\n private _listDefsOrigin: ListDefinitionsOrigin | null;\n}\n","// Taken from https://gist.github.com/blixt/f17b47c62508be59987b\n// Ink uses a seedable PRNG of which there is none in native javascript.\nexport class PRNG {\n private seed: number;\n\n constructor(seed: number) {\n this.seed = seed % 2147483647;\n if (this.seed <= 0) this.seed += 2147483646;\n }\n public next(): number {\n return (this.seed = (this.seed * 48271) % 2147483647);\n }\n public nextFloat(): number {\n return (this.next() - 1) / 2147483646;\n }\n}\n","import { InkObject } from \"./Object\";\nimport { Container } from \"./Container\";\n\nexport class StatePatch {\n get globals() {\n return this._globals;\n }\n get changedVariables() {\n return this._changedVariables;\n }\n get visitCounts() {\n return this._visitCounts;\n }\n get turnIndices() {\n return this._turnIndices;\n }\n\n constructor();\n constructor(toCopy: StatePatch | null);\n constructor() {\n if (arguments.length === 1 && arguments[0] !== null) {\n let toCopy = arguments[0] as StatePatch;\n this._globals = new Map(toCopy._globals);\n this._changedVariables = new Set(toCopy._changedVariables);\n this._visitCounts = new Map(toCopy._visitCounts);\n this._turnIndices = new Map(toCopy._turnIndices);\n } else {\n this._globals = new Map();\n this._changedVariables = new Set();\n this._visitCounts = new Map();\n this._turnIndices = new Map();\n }\n }\n\n public TryGetGlobal(name: string | null, /* out */ value: InkObject | null) {\n if (name !== null && this._globals.has(name)) {\n return { result: this._globals.get(name), exists: true };\n }\n\n return { result: value, exists: false };\n }\n\n public SetGlobal(name: string, value: InkObject) {\n this._globals.set(name, value);\n }\n\n public AddChangedVariable(name: string) {\n return this._changedVariables.add(name);\n }\n\n public TryGetVisitCount(container: Container, /* out */ count: number) {\n if (this._visitCounts.has(container)) {\n return { result: this._visitCounts.get(container), exists: true };\n }\n\n return { result: count, exists: false };\n }\n\n public SetVisitCount(container: Container, count: number) {\n this._visitCounts.set(container, count);\n }\n\n public SetTurnIndex(container: Container, index: number) {\n this._turnIndices.set(container, index);\n }\n\n public TryGetTurnIndex(container: Container, /* out */ index: number) {\n if (this._turnIndices.has(container)) {\n return { result: this._turnIndices.get(container), exists: true };\n }\n\n return { result: index, exists: false };\n }\n\n private _globals: Map;\n private _changedVariables: Set = new Set();\n private _visitCounts: Map = new Map();\n private _turnIndices: Map = new Map();\n}\n","export class SimpleJson {\n public static TextToDictionary(text: string) {\n return new SimpleJson.Reader(text).ToDictionary();\n }\n\n public static TextToArray(text: string) {\n return new SimpleJson.Reader(text).ToArray();\n }\n}\n\nexport namespace SimpleJson {\n export class Reader {\n constructor(text: string) {\n this._rootObject = JSON.parse(text);\n }\n\n public ToDictionary() {\n return this._rootObject as Record;\n }\n\n public ToArray() {\n return this._rootObject as any[];\n }\n\n private _rootObject: any[] | Record;\n }\n\n // In C#, this class writes json tokens directly to a StringWriter or\n // another stream. Here, a temporary hierarchy is created in the form\n // of a javascript object, which is serialised in the `toString` method.\n // See individual methods and properties for more information.\n export class Writer {\n public WriteObject(inner: (w: Writer) => void) {\n this.WriteObjectStart();\n inner(this);\n this.WriteObjectEnd();\n }\n\n // Add a new object.\n public WriteObjectStart() {\n this.StartNewObject(true);\n\n let newObject: Record = {};\n\n if (this.state === SimpleJson.Writer.State.Property) {\n // This object is created as the value of a property,\n // inside an other object.\n this.Assert(this.currentCollection !== null);\n this.Assert(this.currentPropertyName !== null);\n\n let propertyName = this._propertyNameStack.pop();\n this.currentCollection![propertyName!] = newObject;\n this._collectionStack.push(newObject);\n } else if (this.state === SimpleJson.Writer.State.Array) {\n // This object is created as the child of an array.\n this.Assert(this.currentCollection !== null);\n\n this.currentCollection!.push(newObject);\n this._collectionStack.push(newObject);\n } else {\n // This object is the root object.\n this.Assert(this.state === SimpleJson.Writer.State.None);\n this._jsonObject = newObject;\n this._collectionStack.push(newObject);\n }\n\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.Object)\n );\n }\n\n public WriteObjectEnd() {\n this.Assert(this.state === SimpleJson.Writer.State.Object);\n this._collectionStack.pop();\n this._stateStack.pop();\n }\n\n // Write a property name / value pair to the current object.\n public WriteProperty(\n name: any,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n innerOrContent: ((w: Writer) => void) | string | boolean | null\n ) {\n this.WritePropertyStart(name);\n if (arguments[1] instanceof Function) {\n let inner = arguments[1];\n inner(this);\n } else {\n let content: string | boolean | null = arguments[1];\n this.Write(content);\n }\n this.WritePropertyEnd();\n }\n\n // Int and Float are separate calls, since there both are\n // numbers in JavaScript, but need to be handled differently.\n\n public WriteIntProperty(name: any, content: number) {\n this.WritePropertyStart(name);\n this.WriteInt(content);\n this.WritePropertyEnd();\n }\n\n public WriteFloatProperty(name: any, content: number) {\n this.WritePropertyStart(name);\n this.WriteFloat(content);\n this.WritePropertyEnd();\n }\n\n // Prepare a new property name, which will be use to add the\n // new object when calling _addToCurrentObject() from a Write\n // method.\n public WritePropertyStart(name: any) {\n this.Assert(this.state === SimpleJson.Writer.State.Object);\n this._propertyNameStack.push(name);\n\n this.IncrementChildCount();\n\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.Property)\n );\n }\n\n public WritePropertyEnd() {\n this.Assert(this.state === SimpleJson.Writer.State.Property);\n this.Assert(this.childCount === 1);\n this._stateStack.pop();\n }\n\n // Prepare a new property name, except this time, the property name\n // will be created by concatenating all the strings passed to\n // WritePropertyNameInner.\n public WritePropertyNameStart() {\n this.Assert(this.state === SimpleJson.Writer.State.Object);\n this.IncrementChildCount();\n\n this._currentPropertyName = \"\";\n\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.Property)\n );\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.PropertyName)\n );\n }\n\n public WritePropertyNameEnd() {\n this.Assert(this.state === SimpleJson.Writer.State.PropertyName);\n this.Assert(this._currentPropertyName !== null);\n this._propertyNameStack.push(this._currentPropertyName!);\n this._currentPropertyName = null;\n this._stateStack.pop();\n }\n\n public WritePropertyNameInner(str: string) {\n this.Assert(this.state === SimpleJson.Writer.State.PropertyName);\n this.Assert(this._currentPropertyName !== null);\n this._currentPropertyName += str;\n }\n\n // Add a new array.\n public WriteArrayStart() {\n this.StartNewObject(true);\n\n let newObject: any[] = [];\n\n if (this.state === SimpleJson.Writer.State.Property) {\n // This array is created as the value of a property,\n // inside an object.\n this.Assert(this.currentCollection !== null);\n this.Assert(this.currentPropertyName !== null);\n\n let propertyName = this._propertyNameStack.pop();\n this.currentCollection![propertyName!] = newObject;\n this._collectionStack.push(newObject);\n } else if (this.state === SimpleJson.Writer.State.Array) {\n // This array is created as the child of another array.\n this.Assert(this.currentCollection !== null);\n\n this.currentCollection!.push(newObject);\n this._collectionStack.push(newObject);\n } else {\n // This array is the root object.\n this.Assert(this.state === SimpleJson.Writer.State.None);\n this._jsonObject = newObject;\n this._collectionStack.push(newObject);\n }\n\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.Array)\n );\n }\n\n public WriteArrayEnd() {\n this.Assert(this.state === SimpleJson.Writer.State.Array);\n this._collectionStack.pop();\n this._stateStack.pop();\n }\n\n // Add the value to the appropriate collection (array / object), given the current\n // context.\n public Write(\n value: number | string | boolean | null,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n escape: boolean = true\n ) {\n if (value === null) {\n console.error(\"Warning: trying to write a null value\");\n return;\n }\n\n this.StartNewObject(false);\n this._addToCurrentObject(value);\n }\n\n public WriteBool(value: boolean | null) {\n if (value === null) {\n return;\n }\n\n this.StartNewObject(false);\n this._addToCurrentObject(value);\n }\n\n public WriteInt(value: number | null) {\n if (value === null) {\n return;\n }\n\n this.StartNewObject(false);\n\n // Math.floor is used as a precaution:\n // 1. to ensure that the value is written as an integer\n // (without a fractional part -> 1 instead of 1.0), even\n // though it should be the default behaviour of\n // JSON.serialize;\n // 2. to ensure that if a floating number is passed\n // accidentally, it's converted to an integer.\n //\n // This guarantees savegame compatibility with the reference\n // implementation.\n this._addToCurrentObject(Math.floor(value));\n }\n\n // Since JSON doesn't support NaN and Infinity, these values\n // are converted here.\n public WriteFloat(value: number | null) {\n if (value === null) {\n return;\n }\n\n this.StartNewObject(false);\n if (value == Number.POSITIVE_INFINITY) {\n this._addToCurrentObject(3.4e38);\n } else if (value == Number.NEGATIVE_INFINITY) {\n this._addToCurrentObject(-3.4e38);\n } else if (isNaN(value)) {\n this._addToCurrentObject(0.0);\n } else {\n this._addToCurrentObject(value);\n }\n }\n\n public WriteNull() {\n this.StartNewObject(false);\n this._addToCurrentObject(null);\n }\n\n // Prepare a string before adding it to the current collection in\n // WriteStringEnd(). The string will be a concatenation of all the\n // strings passed to WriteStringInner.\n public WriteStringStart() {\n this.StartNewObject(false);\n this._currentString = \"\";\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.String)\n );\n }\n\n public WriteStringEnd() {\n this.Assert(this.state == SimpleJson.Writer.State.String);\n this._stateStack.pop();\n this._addToCurrentObject(this._currentString);\n this._currentString = null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n public WriteStringInner(str: string | null, escape: boolean = true) {\n this.Assert(this.state === SimpleJson.Writer.State.String);\n\n if (str === null) {\n console.error(\"Warning: trying to write a null string\");\n return;\n }\n\n this._currentString += str;\n }\n\n // Serialise the root object into a JSON string.\n public toString() {\n if (this._jsonObject === null) {\n return \"\";\n }\n\n return JSON.stringify(this._jsonObject);\n }\n\n // Prepare the state stack when adding new objects / values.\n private StartNewObject(container: boolean) {\n if (container) {\n this.Assert(\n this.state === SimpleJson.Writer.State.None ||\n this.state === SimpleJson.Writer.State.Property ||\n this.state === SimpleJson.Writer.State.Array\n );\n } else {\n this.Assert(\n this.state === SimpleJson.Writer.State.Property ||\n this.state === SimpleJson.Writer.State.Array\n );\n }\n\n if (this.state === SimpleJson.Writer.State.Property) {\n this.Assert(this.childCount === 0);\n }\n\n if (\n this.state === SimpleJson.Writer.State.Array ||\n this.state === SimpleJson.Writer.State.Property\n ) {\n this.IncrementChildCount();\n }\n }\n\n // These getters peek all the different stacks.\n\n private get state() {\n if (this._stateStack.length > 0) {\n return this._stateStack[this._stateStack.length - 1].type;\n } else {\n return SimpleJson.Writer.State.None;\n }\n }\n\n private get childCount() {\n if (this._stateStack.length > 0) {\n return this._stateStack[this._stateStack.length - 1].childCount;\n } else {\n return 0;\n }\n }\n\n private get currentCollection() {\n if (this._collectionStack.length > 0) {\n return this._collectionStack[this._collectionStack.length - 1];\n } else {\n return null;\n }\n }\n\n private get currentPropertyName() {\n if (this._propertyNameStack.length > 0) {\n return this._propertyNameStack[this._propertyNameStack.length - 1];\n } else {\n return null;\n }\n }\n\n private IncrementChildCount() {\n this.Assert(this._stateStack.length > 0);\n let currEl = this._stateStack.pop()!;\n currEl.childCount++;\n this._stateStack.push(currEl);\n }\n\n private Assert(condition: boolean) {\n if (!condition) throw Error(\"Assert failed while writing JSON\");\n }\n\n // This method did not exist in the original C# code. It adds\n // the given value to the current collection (used by Write methods).\n private _addToCurrentObject(value: number | string | boolean | null) {\n this.Assert(this.currentCollection !== null);\n if (this.state === SimpleJson.Writer.State.Array) {\n this.Assert(Array.isArray(this.currentCollection));\n (this.currentCollection as any[]).push(value);\n } else if (this.state === SimpleJson.Writer.State.Property) {\n this.Assert(!Array.isArray(this.currentCollection));\n this.Assert(this.currentPropertyName !== null);\n (this.currentCollection as Record)[\n this.currentPropertyName!\n ] = value;\n this._propertyNameStack.pop();\n }\n }\n\n // In addition to `_stateStack` present in the original code,\n // this implementation of SimpleJson use two other stacks and two\n // temporary variables holding the current context.\n\n // Used to keep track of the current property name being built\n // with `WritePropertyNameStart`, `WritePropertyNameInner` and\n // `WritePropertyNameEnd`.\n private _currentPropertyName: string | null = null;\n\n // Used to keep track of the current string value being built\n // with `WriteStringStart`, `WriteStringInner` and\n // `WriteStringEnd`.\n private _currentString: string | null = null;\n\n private _stateStack: SimpleJson.Writer.StateElement[] = [];\n\n // Keep track of the current collection being built (either an array\n // or an object). For instance, at the '?' step during the hiarchy\n // creation, this hierarchy:\n // [3, {a: [b, ?]}] will have this corresponding stack:\n // (bottom) [Array, Object, Array] (top)\n private _collectionStack: Array> = [];\n\n // Keep track of the current property being assigned. For instance, at\n // the '?' step during the hiarchy creation, this hierarchy:\n // [3, {a: [b, {c: ?}]}] will have this corresponding stack:\n // (bottom) [a, c] (top)\n private _propertyNameStack: string[] = [];\n\n // Object containing the entire hiearchy.\n private _jsonObject: Record | any[] | null = null;\n }\n\n export namespace Writer {\n export enum State {\n None,\n Object,\n Array,\n Property,\n PropertyName,\n String,\n }\n\n export class StateElement {\n public type: SimpleJson.Writer.State = SimpleJson.Writer.State.None;\n public childCount: number = 0;\n\n constructor(type: SimpleJson.Writer.State) {\n this.type = type;\n }\n }\n }\n}\n","import { CallStack } from \"./CallStack\";\nimport { Choice } from \"./Choice\";\nimport { JsonSerialisation } from \"./JsonSerialisation\";\nimport { InkObject } from \"./Object\";\nimport { SimpleJson } from \"./SimpleJson\";\nimport { Story } from \"./Story\";\nimport { throwNullException } from \"./NullException\";\n\nexport class Flow {\n public name: string;\n public callStack: CallStack;\n public outputStream: InkObject[];\n public currentChoices: Choice[];\n\n constructor(name: String, story: Story);\n constructor(name: String, story: Story, jObject: Record);\n constructor() {\n let name = arguments[0] as string;\n let story = arguments[1] as Story;\n\n this.name = name;\n this.callStack = new CallStack(story);\n\n if (arguments[2]) {\n let jObject = arguments[2] as Record;\n\n this.callStack.SetJsonToken(jObject[\"callstack\"], story);\n this.outputStream = JsonSerialisation.JArrayToRuntimeObjList(\n jObject[\"outputStream\"]\n );\n this.currentChoices = JsonSerialisation.JArrayToRuntimeObjList(\n jObject[\"currentChoices\"]\n ) as Choice[];\n\n let jChoiceThreadsObj = jObject[\"choiceThreads\"];\n if (typeof jChoiceThreadsObj !== \"undefined\") {\n this.LoadFlowChoiceThreads(jChoiceThreadsObj, story);\n }\n } else {\n this.outputStream = [];\n this.currentChoices = [];\n }\n }\n\n public WriteJson(writer: SimpleJson.Writer) {\n writer.WriteObjectStart();\n\n writer.WriteProperty(\"callstack\", (w) => this.callStack.WriteJson(w));\n writer.WriteProperty(\"outputStream\", (w) =>\n JsonSerialisation.WriteListRuntimeObjs(w, this.outputStream)\n );\n\n let hasChoiceThreads = false;\n for (let c of this.currentChoices) {\n if (c.threadAtGeneration === null)\n return throwNullException(\"c.threadAtGeneration\");\n\n c.originalThreadIndex = c.threadAtGeneration.threadIndex;\n\n if (this.callStack.ThreadWithIndex(c.originalThreadIndex) === null) {\n if (!hasChoiceThreads) {\n hasChoiceThreads = true;\n writer.WritePropertyStart(\"choiceThreads\");\n writer.WriteObjectStart();\n }\n\n writer.WritePropertyStart(c.originalThreadIndex);\n c.threadAtGeneration.WriteJson(writer);\n writer.WritePropertyEnd();\n }\n }\n\n if (hasChoiceThreads) {\n writer.WriteObjectEnd();\n writer.WritePropertyEnd();\n }\n\n writer.WriteProperty(\"currentChoices\", (w) => {\n w.WriteArrayStart();\n for (let c of this.currentChoices) {\n JsonSerialisation.WriteChoice(w, c);\n }\n w.WriteArrayEnd();\n });\n\n writer.WriteObjectEnd();\n }\n\n public LoadFlowChoiceThreads(\n jChoiceThreads: Record,\n story: Story\n ) {\n for (let choice of this.currentChoices) {\n let foundActiveThread = this.callStack.ThreadWithIndex(\n choice.originalThreadIndex\n );\n if (foundActiveThread !== null) {\n choice.threadAtGeneration = foundActiveThread.Copy();\n } else {\n let jSavedChoiceThread =\n jChoiceThreads[`${choice.originalThreadIndex}`];\n choice.threadAtGeneration = new CallStack.Thread(\n jSavedChoiceThread,\n story\n );\n }\n }\n }\n}\n","// TODO: Unify with Compiler.\n\nexport type ErrorHandler = (message: string, type: ErrorType) => void;\n\nexport enum ErrorType {\n Author,\n Warning,\n Error,\n}\n","import { Container } from \"./Container\";\nimport { InkObject } from \"./Object\";\nimport { JsonSerialisation } from \"./JsonSerialisation\";\nimport { StoryState } from \"./StoryState\";\nimport { ControlCommand } from \"./ControlCommand\";\nimport { PushPopType } from \"./PushPop\";\nimport { ChoicePoint } from \"./ChoicePoint\";\nimport { Choice } from \"./Choice\";\nimport { Divert } from \"./Divert\";\nimport {\n Value,\n StringValue,\n IntValue,\n DivertTargetValue,\n VariablePointerValue,\n ListValue,\n} from \"./Value\";\nimport { Path } from \"./Path\";\nimport { Void } from \"./Void\";\nimport { Tag } from \"./Tag\";\nimport { VariableAssignment } from \"./VariableAssignment\";\nimport { VariableReference } from \"./VariableReference\";\nimport { NativeFunctionCall } from \"./NativeFunctionCall\";\nimport { StoryException } from \"./StoryException\";\nimport { PRNG } from \"./PRNG\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { ListDefinitionsOrigin } from \"./ListDefinitionsOrigin\";\nimport { ListDefinition } from \"./ListDefinition\";\nimport { Stopwatch } from \"./StopWatch\";\nimport { Pointer } from \"./Pointer\";\nimport { InkList, InkListItem, KeyValuePair } from \"./InkList\";\nimport { asOrNull, asOrThrows } from \"./TypeAssertion\";\nimport { DebugMetadata } from \"./DebugMetadata\";\nimport { throwNullException } from \"./NullException\";\nimport { SimpleJson } from \"./SimpleJson\";\nimport { ErrorHandler, ErrorType } from \"./Error\";\n\nexport { InkList } from \"./InkList\";\n\nif (!Number.isInteger) {\n Number.isInteger = function isInteger(nVal: any) {\n return (\n typeof nVal === \"number\" &&\n isFinite(nVal) &&\n nVal > -9007199254740992 &&\n nVal < 9007199254740992 &&\n Math.floor(nVal) === nVal\n );\n };\n}\n\nexport class Story extends InkObject {\n public static inkVersionCurrent = 21;\n\n public inkVersionMinimumCompatible = 18;\n\n get currentChoices() {\n let choices: Choice[] = [];\n\n if (this._state === null) {\n return throwNullException(\"this._state\");\n }\n for (let c of this._state.currentChoices) {\n if (!c.isInvisibleDefault) {\n c.index = choices.length;\n choices.push(c);\n }\n }\n\n return choices;\n }\n\n get currentText() {\n this.IfAsyncWeCant(\"call currentText since it's a work in progress\");\n return this.state.currentText;\n }\n\n get currentTags() {\n this.IfAsyncWeCant(\"call currentTags since it's a work in progress\");\n return this.state.currentTags;\n }\n\n get currentErrors() {\n return this.state.currentErrors;\n }\n\n get currentWarnings() {\n return this.state.currentWarnings;\n }\n\n get currentFlowName() {\n return this.state.currentFlowName;\n }\n\n get currentFlowIsDefaultFlow() {\n return this.state.currentFlowIsDefaultFlow;\n }\n\n get aliveFlowNames() {\n return this.state.aliveFlowNames;\n }\n\n get hasError() {\n return this.state.hasError;\n }\n\n get hasWarning() {\n return this.state.hasWarning;\n }\n\n get variablesState() {\n return this.state.variablesState;\n }\n\n get listDefinitions() {\n return this._listDefinitions;\n }\n\n get state() {\n return this._state;\n }\n\n public onError: ErrorHandler | null = null;\n\n public onDidContinue: (() => void) | null = null;\n\n public onMakeChoice: ((arg1: Choice) => void) | null = null;\n\n public onEvaluateFunction: ((arg1: string, arg2: any[]) => void) | null =\n null;\n\n public onCompleteEvaluateFunction:\n | ((arg1: string, arg2: any[], arg3: string, arg4: any) => void)\n | null = null;\n\n public onChoosePathString: ((arg1: string, arg2: any[]) => void) | null =\n null;\n\n // TODO: Implement Profiler\n public StartProfiling() {\n /* */\n }\n public EndProfiling() {\n /* */\n }\n\n constructor(contentContainer: Container, lists: ListDefinition[] | null);\n constructor(jsonString: string);\n constructor(json: Record);\n constructor() {\n super();\n\n // Discrimination between constructors\n let contentContainer: Container;\n let lists: ListDefinition[] | null = null;\n let json: Record | null = null;\n\n if (arguments[0] instanceof Container) {\n contentContainer = arguments[0] as Container;\n\n if (typeof arguments[1] !== \"undefined\") {\n lists = arguments[1] as ListDefinition[];\n }\n\n // ------ Story (Container contentContainer, List lists = null)\n this._mainContentContainer = contentContainer;\n // ------\n } else {\n if (typeof arguments[0] === \"string\") {\n let jsonString = arguments[0] as string;\n json = SimpleJson.TextToDictionary(jsonString);\n } else {\n json = arguments[0] as Record;\n }\n }\n\n // ------ Story (Container contentContainer, List lists = null)\n if (lists != null) this._listDefinitions = new ListDefinitionsOrigin(lists);\n\n this._externals = new Map();\n // ------\n\n // ------ Story(string jsonString) : this((Container)null)\n if (json !== null) {\n let rootObject: Record = json;\n\n let versionObj = rootObject[\"inkVersion\"];\n if (versionObj == null)\n throw new Error(\n \"ink version number not found. Are you sure it's a valid .ink.json file?\"\n );\n\n let formatFromFile = parseInt(versionObj);\n if (formatFromFile > Story.inkVersionCurrent) {\n throw new Error(\n \"Version of ink used to build story was newer than the current version of the engine\"\n );\n } else if (formatFromFile < this.inkVersionMinimumCompatible) {\n throw new Error(\n \"Version of ink used to build story is too old to be loaded by this version of the engine\"\n );\n } else if (formatFromFile != Story.inkVersionCurrent) {\n console.warn(\n \"WARNING: Version of ink used to build story doesn't match current version of engine. Non-critical, but recommend synchronising.\"\n );\n }\n\n let rootToken = rootObject[\"root\"];\n if (rootToken == null)\n throw new Error(\n \"Root node for ink not found. Are you sure it's a valid .ink.json file?\"\n );\n\n let listDefsObj;\n if ((listDefsObj = rootObject[\"listDefs\"])) {\n this._listDefinitions =\n JsonSerialisation.JTokenToListDefinitions(listDefsObj);\n }\n\n this._mainContentContainer = asOrThrows(\n JsonSerialisation.JTokenToRuntimeObject(rootToken),\n Container\n );\n\n this.ResetState();\n }\n // ------\n }\n\n // Merge together `public string ToJson()` and `void ToJson(SimpleJson.Writer writer)`.\n // Will only return a value if writer was not provided.\n public ToJson(writer?: SimpleJson.Writer): string | void {\n let shouldReturn = false;\n\n if (!writer) {\n shouldReturn = true;\n writer = new SimpleJson.Writer();\n }\n\n writer.WriteObjectStart();\n\n writer.WriteIntProperty(\"inkVersion\", Story.inkVersionCurrent);\n\n writer.WriteProperty(\"root\", (w) =>\n JsonSerialisation.WriteRuntimeContainer(w, this._mainContentContainer)\n );\n\n if (this._listDefinitions != null) {\n writer.WritePropertyStart(\"listDefs\");\n writer.WriteObjectStart();\n\n for (let def of this._listDefinitions.lists) {\n writer.WritePropertyStart(def.name);\n writer.WriteObjectStart();\n\n for (let [key, value] of def.items) {\n let item = InkListItem.fromSerializedKey(key);\n let val = value;\n writer.WriteIntProperty(item.itemName, val);\n }\n\n writer.WriteObjectEnd();\n writer.WritePropertyEnd();\n }\n\n writer.WriteObjectEnd();\n writer.WritePropertyEnd();\n }\n\n writer.WriteObjectEnd();\n\n if (shouldReturn) return writer.toString();\n }\n\n public ResetState() {\n this.IfAsyncWeCant(\"ResetState\");\n\n this._state = new StoryState(this);\n this._state.variablesState.ObserveVariableChange(\n this.VariableStateDidChangeEvent.bind(this)\n );\n\n this.ResetGlobals();\n }\n\n public ResetErrors() {\n if (this._state === null) {\n return throwNullException(\"this._state\");\n }\n this._state.ResetErrors();\n }\n\n public ResetCallstack() {\n this.IfAsyncWeCant(\"ResetCallstack\");\n if (this._state === null) {\n return throwNullException(\"this._state\");\n }\n this._state.ForceEnd();\n }\n\n public ResetGlobals() {\n if (this._mainContentContainer.namedContent.get(\"global decl\")) {\n let originalPointer = this.state.currentPointer.copy();\n\n this.ChoosePath(new Path(\"global decl\"), false);\n\n this.ContinueInternal();\n\n this.state.currentPointer = originalPointer;\n }\n\n this.state.variablesState.SnapshotDefaultGlobals();\n }\n\n public SwitchFlow(flowName: string) {\n this.IfAsyncWeCant(\"switch flow\");\n if (this._asyncSaving) {\n throw new Error(\n \"Story is already in background saving mode, can't switch flow to \" +\n flowName\n );\n }\n\n this.state.SwitchFlow_Internal(flowName);\n }\n\n public RemoveFlow(flowName: string) {\n this.state.RemoveFlow_Internal(flowName);\n }\n\n public SwitchToDefaultFlow() {\n this.state.SwitchToDefaultFlow_Internal();\n }\n\n public Continue() {\n this.ContinueAsync(0);\n return this.currentText;\n }\n\n get canContinue() {\n return this.state.canContinue;\n }\n\n get asyncContinueComplete() {\n return !this._asyncContinueActive;\n }\n\n public ContinueAsync(millisecsLimitAsync: number) {\n if (!this._hasValidatedExternals) this.ValidateExternalBindings();\n\n this.ContinueInternal(millisecsLimitAsync);\n }\n\n public ContinueInternal(millisecsLimitAsync = 0) {\n if (this._profiler != null) this._profiler.PreContinue();\n\n let isAsyncTimeLimited = millisecsLimitAsync > 0;\n this._recursiveContinueCount++;\n\n if (!this._asyncContinueActive) {\n this._asyncContinueActive = isAsyncTimeLimited;\n\n if (!this.canContinue) {\n throw new Error(\n \"Can't continue - should check canContinue before calling Continue\"\n );\n }\n\n this._state.didSafeExit = false;\n this._state.ResetOutput();\n\n if (this._recursiveContinueCount == 1)\n this._state.variablesState.batchObservingVariableChanges = true;\n }\n\n let durationStopwatch = new Stopwatch();\n durationStopwatch.Start();\n\n let outputStreamEndsInNewline = false;\n this._sawLookaheadUnsafeFunctionAfterNewline = false;\n do {\n try {\n outputStreamEndsInNewline = this.ContinueSingleStep();\n } catch (e) {\n if (!(e instanceof StoryException)) throw e;\n\n this.AddError(e.message, undefined, e.useEndLineNumber);\n break;\n }\n\n if (outputStreamEndsInNewline) break;\n\n if (\n this._asyncContinueActive &&\n durationStopwatch.ElapsedMilliseconds > millisecsLimitAsync\n ) {\n break;\n }\n } while (this.canContinue);\n\n durationStopwatch.Stop();\n\n if (outputStreamEndsInNewline || !this.canContinue) {\n if (this._stateSnapshotAtLastNewline !== null) {\n this.RestoreStateSnapshot();\n }\n\n if (!this.canContinue) {\n if (this.state.callStack.canPopThread)\n this.AddError(\n \"Thread available to pop, threads should always be flat by the end of evaluation?\"\n );\n\n if (\n this.state.generatedChoices.length == 0 &&\n !this.state.didSafeExit &&\n this._temporaryEvaluationContainer == null\n ) {\n if (this.state.callStack.CanPop(PushPopType.Tunnel))\n this.AddError(\n \"unexpectedly reached end of content. Do you need a '->->' to return from a tunnel?\"\n );\n else if (this.state.callStack.CanPop(PushPopType.Function))\n this.AddError(\n \"unexpectedly reached end of content. Do you need a '~ return'?\"\n );\n else if (!this.state.callStack.canPop)\n this.AddError(\n \"ran out of content. Do you need a '-> DONE' or '-> END'?\"\n );\n else\n this.AddError(\n \"unexpectedly reached end of content for unknown reason. Please debug compiler!\"\n );\n }\n }\n\n this.state.didSafeExit = false;\n this._sawLookaheadUnsafeFunctionAfterNewline = false;\n\n if (this._recursiveContinueCount == 1)\n this._state.variablesState.batchObservingVariableChanges = false;\n\n this._asyncContinueActive = false;\n if (this.onDidContinue !== null) this.onDidContinue();\n }\n\n this._recursiveContinueCount--;\n\n if (this._profiler != null) this._profiler.PostContinue();\n\n // In the following code, we're masking a lot of non-null assertion,\n // because testing for against `hasError` or `hasWarning` makes sure\n // the arrays are present and contain at least one element.\n if (this.state.hasError || this.state.hasWarning) {\n if (this.onError !== null) {\n if (this.state.hasError) {\n for (let err of this.state.currentErrors!) {\n this.onError(err, ErrorType.Error);\n }\n }\n if (this.state.hasWarning) {\n for (let err of this.state.currentWarnings!) {\n this.onError(err, ErrorType.Warning);\n }\n }\n this.ResetErrors();\n } else {\n let sb = new StringBuilder();\n sb.Append(\"Ink had \");\n if (this.state.hasError) {\n sb.Append(`${this.state.currentErrors!.length}`);\n sb.Append(\n this.state.currentErrors!.length == 1 ? \" error\" : \"errors\"\n );\n if (this.state.hasWarning) sb.Append(\" and \");\n }\n if (this.state.hasWarning) {\n sb.Append(`${this.state.currentWarnings!.length}`);\n sb.Append(\n this.state.currentWarnings!.length == 1 ? \" warning\" : \"warnings\"\n );\n if (this.state.hasWarning) sb.Append(\" and \");\n }\n sb.Append(\n \". It is strongly suggested that you assign an error handler to story.onError. The first issue was: \"\n );\n sb.Append(\n this.state.hasError\n ? this.state.currentErrors![0]\n : this.state.currentWarnings![0]\n );\n\n throw new StoryException(sb.toString());\n }\n }\n }\n\n public ContinueSingleStep() {\n if (this._profiler != null) this._profiler.PreStep();\n\n this.Step();\n\n if (this._profiler != null) this._profiler.PostStep();\n\n if (!this.canContinue && !this.state.callStack.elementIsEvaluateFromGame) {\n this.TryFollowDefaultInvisibleChoice();\n }\n\n if (this._profiler != null) this._profiler.PreSnapshot();\n\n if (!this.state.inStringEvaluation) {\n if (this._stateSnapshotAtLastNewline !== null) {\n if (this._stateSnapshotAtLastNewline.currentTags === null) {\n return throwNullException(\"this._stateAtLastNewline.currentTags\");\n }\n if (this.state.currentTags === null) {\n return throwNullException(\"this.state.currentTags\");\n }\n\n let change = this.CalculateNewlineOutputStateChange(\n this._stateSnapshotAtLastNewline.currentText,\n this.state.currentText,\n this._stateSnapshotAtLastNewline.currentTags.length,\n this.state.currentTags.length\n );\n\n if (\n change == Story.OutputStateChange.ExtendedBeyondNewline ||\n this._sawLookaheadUnsafeFunctionAfterNewline\n ) {\n this.RestoreStateSnapshot();\n\n return true;\n } else if (change == Story.OutputStateChange.NewlineRemoved) {\n this.DiscardSnapshot();\n }\n }\n\n if (this.state.outputStreamEndsInNewline) {\n if (this.canContinue) {\n if (this._stateSnapshotAtLastNewline == null) this.StateSnapshot();\n } else {\n this.DiscardSnapshot();\n }\n }\n }\n\n if (this._profiler != null) this._profiler.PostSnapshot();\n\n return false;\n }\n\n public CalculateNewlineOutputStateChange(\n prevText: string | null,\n currText: string | null,\n prevTagCount: number,\n currTagCount: number\n ) {\n if (prevText === null) {\n return throwNullException(\"prevText\");\n }\n if (currText === null) {\n return throwNullException(\"currText\");\n }\n\n let newlineStillExists =\n currText.length >= prevText.length &&\n prevText.length > 0 &&\n currText.charAt(prevText.length - 1) == \"\\n\";\n if (\n prevTagCount == currTagCount &&\n prevText.length == currText.length &&\n newlineStillExists\n )\n return Story.OutputStateChange.NoChange;\n\n if (!newlineStillExists) {\n return Story.OutputStateChange.NewlineRemoved;\n }\n\n if (currTagCount > prevTagCount)\n return Story.OutputStateChange.ExtendedBeyondNewline;\n\n for (let i = prevText.length; i < currText.length; i++) {\n let c = currText.charAt(i);\n if (c != \" \" && c != \"\\t\") {\n return Story.OutputStateChange.ExtendedBeyondNewline;\n }\n }\n\n return Story.OutputStateChange.NoChange;\n }\n\n public ContinueMaximally() {\n this.IfAsyncWeCant(\"ContinueMaximally\");\n\n let sb = new StringBuilder();\n\n while (this.canContinue) {\n sb.Append(this.Continue());\n }\n\n return sb.toString();\n }\n\n public ContentAtPath(path: Path) {\n return this.mainContentContainer.ContentAtPath(path);\n }\n\n public KnotContainerWithName(name: string) {\n let namedContainer = this.mainContentContainer.namedContent.get(name);\n if (namedContainer instanceof Container) return namedContainer;\n else return null;\n }\n\n public PointerAtPath(path: Path) {\n if (path.length == 0) return Pointer.Null;\n\n let p = new Pointer();\n\n let pathLengthToUse = path.length;\n\n let result = null;\n if (path.lastComponent === null) {\n return throwNullException(\"path.lastComponent\");\n }\n\n if (path.lastComponent.isIndex) {\n pathLengthToUse = path.length - 1;\n result = this.mainContentContainer.ContentAtPath(\n path,\n undefined,\n pathLengthToUse\n );\n p.container = result.container;\n p.index = path.lastComponent.index;\n } else {\n result = this.mainContentContainer.ContentAtPath(path);\n p.container = result.container;\n p.index = -1;\n }\n\n if (\n result.obj == null ||\n (result.obj == this.mainContentContainer && pathLengthToUse > 0)\n ) {\n this.Error(\n \"Failed to find content at path '\" +\n path +\n \"', and no approximation of it was possible.\"\n );\n } else if (result.approximate)\n this.Warning(\n \"Failed to find content at path '\" +\n path +\n \"', so it was approximated to: '\" +\n result.obj.path +\n \"'.\"\n );\n\n return p;\n }\n\n public StateSnapshot() {\n this._stateSnapshotAtLastNewline = this._state;\n this._state = this._state.CopyAndStartPatching();\n }\n\n public RestoreStateSnapshot() {\n if (this._stateSnapshotAtLastNewline === null) {\n throwNullException(\"_stateSnapshotAtLastNewline\");\n }\n this._stateSnapshotAtLastNewline.RestoreAfterPatch();\n\n this._state = this._stateSnapshotAtLastNewline;\n this._stateSnapshotAtLastNewline = null;\n\n if (!this._asyncSaving) {\n this._state.ApplyAnyPatch();\n }\n }\n\n public DiscardSnapshot() {\n if (!this._asyncSaving) this._state.ApplyAnyPatch();\n\n this._stateSnapshotAtLastNewline = null;\n }\n\n public CopyStateForBackgroundThreadSave() {\n this.IfAsyncWeCant(\"start saving on a background thread\");\n\n if (this._asyncSaving)\n throw new Error(\n \"Story is already in background saving mode, can't call CopyStateForBackgroundThreadSave again!\"\n );\n\n let stateToSave = this._state;\n this._state = this._state.CopyAndStartPatching();\n this._asyncSaving = true;\n return stateToSave;\n }\n\n public BackgroundSaveComplete() {\n if (this._stateSnapshotAtLastNewline === null) {\n this._state.ApplyAnyPatch();\n }\n\n this._asyncSaving = false;\n }\n\n public Step() {\n let shouldAddToStream = true;\n\n let pointer = this.state.currentPointer.copy();\n if (pointer.isNull) {\n return;\n }\n\n // Container containerToEnter = pointer.Resolve () as Container;\n let containerToEnter = asOrNull(pointer.Resolve(), Container);\n\n while (containerToEnter) {\n this.VisitContainer(containerToEnter, true);\n\n // No content? the most we can do is step past it\n if (containerToEnter.content.length == 0) {\n break;\n }\n\n pointer = Pointer.StartOf(containerToEnter);\n // containerToEnter = pointer.Resolve() as Container;\n containerToEnter = asOrNull(pointer.Resolve(), Container);\n }\n\n this.state.currentPointer = pointer.copy();\n\n if (this._profiler != null) this._profiler.Step(this.state.callStack);\n\n // Is the current content object:\n // - Normal content\n // - Or a logic/flow statement - if so, do it\n // Stop flow if we hit a stack pop when we're unable to pop (e.g. return/done statement in knot\n // that was diverted to rather than called as a function)\n let currentContentObj = pointer.Resolve();\n let isLogicOrFlowControl =\n this.PerformLogicAndFlowControl(currentContentObj);\n\n // Has flow been forced to end by flow control above?\n if (this.state.currentPointer.isNull) {\n return;\n }\n\n if (isLogicOrFlowControl) {\n shouldAddToStream = false;\n }\n\n // Choice with condition?\n // var choicePoint = currentContentObj as ChoicePoint;\n let choicePoint = asOrNull(currentContentObj, ChoicePoint);\n if (choicePoint) {\n let choice = this.ProcessChoice(choicePoint);\n if (choice) {\n this.state.generatedChoices.push(choice);\n }\n\n currentContentObj = null;\n shouldAddToStream = false;\n }\n\n // If the container has no content, then it will be\n // the \"content\" itself, but we skip over it.\n if (currentContentObj instanceof Container) {\n shouldAddToStream = false;\n }\n\n // Content to add to evaluation stack or the output stream\n if (shouldAddToStream) {\n // If we're pushing a variable pointer onto the evaluation stack, ensure that it's specific\n // to our current (possibly temporary) context index. And make a copy of the pointer\n // so that we're not editing the original runtime object.\n // var varPointer = currentContentObj as VariablePointerValue;\n let varPointer = asOrNull(currentContentObj, VariablePointerValue);\n if (varPointer && varPointer.contextIndex == -1) {\n // Create new object so we're not overwriting the story's own data\n let contextIdx = this.state.callStack.ContextForVariableNamed(\n varPointer.variableName\n );\n currentContentObj = new VariablePointerValue(\n varPointer.variableName,\n contextIdx\n );\n }\n\n // Expression evaluation content\n if (this.state.inExpressionEvaluation) {\n this.state.PushEvaluationStack(currentContentObj);\n }\n // Output stream content (i.e. not expression evaluation)\n else {\n this.state.PushToOutputStream(currentContentObj);\n }\n }\n\n // Increment the content pointer, following diverts if necessary\n this.NextContent();\n\n // Starting a thread should be done after the increment to the content pointer,\n // so that when returning from the thread, it returns to the content after this instruction.\n // var controlCmd = currentContentObj as ;\n let controlCmd = asOrNull(currentContentObj, ControlCommand);\n if (\n controlCmd &&\n controlCmd.commandType == ControlCommand.CommandType.StartThread\n ) {\n this.state.callStack.PushThread();\n }\n }\n\n public VisitContainer(container: Container, atStart: boolean) {\n if (!container.countingAtStartOnly || atStart) {\n if (container.visitsShouldBeCounted)\n this.state.IncrementVisitCountForContainer(container);\n\n if (container.turnIndexShouldBeCounted)\n this.state.RecordTurnIndexVisitToContainer(container);\n }\n }\n\n private _prevContainers: Container[] = [];\n public VisitChangedContainersDueToDivert() {\n let previousPointer = this.state.previousPointer.copy();\n let pointer = this.state.currentPointer.copy();\n\n if (pointer.isNull || pointer.index == -1) return;\n\n this._prevContainers.length = 0;\n if (!previousPointer.isNull) {\n // Container prevAncestor = previousPointer.Resolve() as Container ?? previousPointer.container as Container;\n let resolvedPreviousAncestor = previousPointer.Resolve();\n let prevAncestor =\n asOrNull(resolvedPreviousAncestor, Container) ||\n asOrNull(previousPointer.container, Container);\n while (prevAncestor) {\n this._prevContainers.push(prevAncestor);\n // prevAncestor = prevAncestor.parent as Container;\n prevAncestor = asOrNull(prevAncestor.parent, Container);\n }\n }\n\n let currentChildOfContainer = pointer.Resolve();\n\n if (currentChildOfContainer == null) return;\n\n // Container currentContainerAncestor = currentChildOfContainer.parent as Container;\n let currentContainerAncestor = asOrNull(\n currentChildOfContainer.parent,\n Container\n );\n let allChildrenEnteredAtStart = true;\n while (\n currentContainerAncestor &&\n (this._prevContainers.indexOf(currentContainerAncestor) < 0 ||\n currentContainerAncestor.countingAtStartOnly)\n ) {\n // Check whether this ancestor container is being entered at the start,\n // by checking whether the child object is the first.\n let enteringAtStart =\n currentContainerAncestor.content.length > 0 &&\n currentChildOfContainer == currentContainerAncestor.content[0] &&\n allChildrenEnteredAtStart;\n\n if (!enteringAtStart) allChildrenEnteredAtStart = false;\n\n // Mark a visit to this container\n this.VisitContainer(currentContainerAncestor, enteringAtStart);\n\n currentChildOfContainer = currentContainerAncestor;\n // currentContainerAncestor = currentContainerAncestor.parent as Container;\n currentContainerAncestor = asOrNull(\n currentContainerAncestor.parent,\n Container\n );\n }\n }\n\n public PopChoiceStringAndTags(tags: string[]) {\n let choiceOnlyStrVal = asOrThrows(\n this.state.PopEvaluationStack(),\n StringValue\n );\n\n while (\n this.state.evaluationStack.length > 0 &&\n asOrNull(this.state.PeekEvaluationStack(), Tag) != null\n ) {\n let tag = asOrNull(this.state.PopEvaluationStack(), Tag);\n if (tag) tags.push(tag.text);\n }\n return choiceOnlyStrVal.value;\n }\n\n public ProcessChoice(choicePoint: ChoicePoint) {\n let showChoice = true;\n\n // Don't create choice if choice point doesn't pass conditional\n if (choicePoint.hasCondition) {\n let conditionValue = this.state.PopEvaluationStack();\n if (!this.IsTruthy(conditionValue)) {\n showChoice = false;\n }\n }\n\n let startText = \"\";\n let choiceOnlyText = \"\";\n let tags: string[] = [];\n\n if (choicePoint.hasChoiceOnlyContent) {\n choiceOnlyText = this.PopChoiceStringAndTags(tags) || \"\";\n }\n\n if (choicePoint.hasStartContent) {\n startText = this.PopChoiceStringAndTags(tags) || \"\";\n }\n\n // Don't create choice if player has already read this content\n if (choicePoint.onceOnly) {\n let visitCount = this.state.VisitCountForContainer(\n choicePoint.choiceTarget\n );\n if (visitCount > 0) {\n showChoice = false;\n }\n }\n\n // We go through the full process of creating the choice above so\n // that we consume the content for it, since otherwise it'll\n // be shown on the output stream.\n if (!showChoice) {\n return null;\n }\n\n let choice = new Choice();\n choice.targetPath = choicePoint.pathOnChoice;\n choice.sourcePath = choicePoint.path.toString();\n choice.isInvisibleDefault = choicePoint.isInvisibleDefault;\n choice.threadAtGeneration = this.state.callStack.ForkThread();\n choice.tags = tags.reverse(); //C# is a stack\n choice.text = (startText + choiceOnlyText).replace(/^[ \\t]+|[ \\t]+$/g, \"\");\n\n return choice;\n }\n\n public IsTruthy(obj: InkObject) {\n let truthy = false;\n if (obj instanceof Value) {\n let val = obj;\n\n if (val instanceof DivertTargetValue) {\n let divTarget = val;\n this.Error(\n \"Shouldn't use a divert target (to \" +\n divTarget.targetPath +\n \") as a conditional value. Did you intend a function call 'likeThis()' or a read count check 'likeThis'? (no arrows)\"\n );\n return false;\n }\n\n return val.isTruthy;\n }\n return truthy;\n }\n\n public PerformLogicAndFlowControl(contentObj: InkObject | null) {\n if (contentObj == null) {\n return false;\n }\n\n // Divert\n if (contentObj instanceof Divert) {\n let currentDivert = contentObj;\n\n if (currentDivert.isConditional) {\n let conditionValue = this.state.PopEvaluationStack();\n\n // False conditional? Cancel divert\n if (!this.IsTruthy(conditionValue)) return true;\n }\n\n if (currentDivert.hasVariableTarget) {\n let varName = currentDivert.variableDivertName;\n\n let varContents =\n this.state.variablesState.GetVariableWithName(varName);\n\n if (varContents == null) {\n this.Error(\n \"Tried to divert using a target from a variable that could not be found (\" +\n varName +\n \")\"\n );\n } else if (!(varContents instanceof DivertTargetValue)) {\n // var intContent = varContents as IntValue;\n let intContent = asOrNull(varContents, IntValue);\n\n let errorMessage =\n \"Tried to divert to a target from a variable, but the variable (\" +\n varName +\n \") didn't contain a divert target, it \";\n if (intContent instanceof IntValue && intContent.value == 0) {\n errorMessage += \"was empty/null (the value 0).\";\n } else {\n errorMessage += \"contained '\" + varContents + \"'.\";\n }\n\n this.Error(errorMessage);\n }\n\n let target = asOrThrows(varContents, DivertTargetValue);\n this.state.divertedPointer = this.PointerAtPath(target.targetPath);\n } else if (currentDivert.isExternal) {\n this.CallExternalFunction(\n currentDivert.targetPathString,\n currentDivert.externalArgs\n );\n return true;\n } else {\n this.state.divertedPointer = currentDivert.targetPointer.copy();\n }\n\n if (currentDivert.pushesToStack) {\n this.state.callStack.Push(\n currentDivert.stackPushType,\n undefined,\n this.state.outputStream.length\n );\n }\n\n if (this.state.divertedPointer.isNull && !currentDivert.isExternal) {\n if (\n currentDivert &&\n currentDivert.debugMetadata &&\n currentDivert.debugMetadata.sourceName != null\n ) {\n this.Error(\n \"Divert target doesn't exist: \" +\n currentDivert.debugMetadata.sourceName\n );\n } else {\n this.Error(\"Divert resolution failed: \" + currentDivert);\n }\n }\n\n return true;\n }\n\n // Start/end an expression evaluation? Or print out the result?\n else if (contentObj instanceof ControlCommand) {\n let evalCommand = contentObj;\n\n switch (evalCommand.commandType) {\n case ControlCommand.CommandType.EvalStart:\n this.Assert(\n this.state.inExpressionEvaluation === false,\n \"Already in expression evaluation?\"\n );\n this.state.inExpressionEvaluation = true;\n break;\n\n case ControlCommand.CommandType.EvalEnd:\n this.Assert(\n this.state.inExpressionEvaluation === true,\n \"Not in expression evaluation mode\"\n );\n this.state.inExpressionEvaluation = false;\n break;\n\n case ControlCommand.CommandType.EvalOutput:\n // If the expression turned out to be empty, there may not be anything on the stack\n if (this.state.evaluationStack.length > 0) {\n let output = this.state.PopEvaluationStack();\n\n // Functions may evaluate to Void, in which case we skip output\n if (!(output instanceof Void)) {\n // TODO: Should we really always blanket convert to string?\n // It would be okay to have numbers in the output stream the\n // only problem is when exporting text for viewing, it skips over numbers etc.\n let text = new StringValue(output.toString());\n\n this.state.PushToOutputStream(text);\n }\n }\n break;\n\n case ControlCommand.CommandType.NoOp:\n break;\n\n case ControlCommand.CommandType.Duplicate:\n this.state.PushEvaluationStack(this.state.PeekEvaluationStack());\n break;\n\n case ControlCommand.CommandType.PopEvaluatedValue:\n this.state.PopEvaluationStack();\n break;\n\n case ControlCommand.CommandType.PopFunction:\n case ControlCommand.CommandType.PopTunnel:\n let popType =\n evalCommand.commandType == ControlCommand.CommandType.PopFunction\n ? PushPopType.Function\n : PushPopType.Tunnel;\n\n let overrideTunnelReturnTarget: DivertTargetValue | null = null;\n if (popType == PushPopType.Tunnel) {\n let popped = this.state.PopEvaluationStack();\n // overrideTunnelReturnTarget = popped as DivertTargetValue;\n overrideTunnelReturnTarget = asOrNull(popped, DivertTargetValue);\n if (overrideTunnelReturnTarget === null) {\n this.Assert(\n popped instanceof Void,\n \"Expected void if ->-> doesn't override target\"\n );\n }\n }\n\n if (this.state.TryExitFunctionEvaluationFromGame()) {\n break;\n } else if (\n this.state.callStack.currentElement.type != popType ||\n !this.state.callStack.canPop\n ) {\n let names: Map = new Map();\n names.set(\n PushPopType.Function,\n \"function return statement (~ return)\"\n );\n names.set(PushPopType.Tunnel, \"tunnel onwards statement (->->)\");\n\n let expected = names.get(this.state.callStack.currentElement.type);\n if (!this.state.callStack.canPop) {\n expected = \"end of flow (-> END or choice)\";\n }\n\n let errorMsg =\n \"Found \" + names.get(popType) + \", when expected \" + expected;\n\n this.Error(errorMsg);\n } else {\n this.state.PopCallStack();\n\n if (overrideTunnelReturnTarget)\n this.state.divertedPointer = this.PointerAtPath(\n overrideTunnelReturnTarget.targetPath\n );\n }\n break;\n\n case ControlCommand.CommandType.BeginString:\n this.state.PushToOutputStream(evalCommand);\n\n this.Assert(\n this.state.inExpressionEvaluation === true,\n \"Expected to be in an expression when evaluating a string\"\n );\n this.state.inExpressionEvaluation = false;\n break;\n\n // Leave it to story.currentText and story.currentTags to sort out the text from the tags\n // This is mostly because we can't always rely on the existence of EndTag, and we don't want\n // to try and flatten dynamic tags to strings every time \\n is pushed to output\n case ControlCommand.CommandType.BeginTag:\n this.state.PushToOutputStream(evalCommand);\n break;\n\n // EndTag has 2 modes:\n // - When in string evaluation (for choices)\n // - Normal\n //\n // The only way you could have an EndTag in the middle of\n // string evaluation is if we're currently generating text for a\n // choice, such as:\n //\n // + choice # tag\n //\n // In the above case, the ink will be run twice:\n // - First, to generate the choice text. String evaluation\n // will be on, and the final string will be pushed to the\n // evaluation stack, ready to be popped to make a Choice\n // object.\n // - Second, when ink generates text after choosing the choice.\n // On this ocassion, it's not in string evaluation mode.\n //\n // On the writing side, we disallow manually putting tags within\n // strings like this:\n //\n // {\"hello # world\"}\n //\n // So we know that the tag must be being generated as part of\n // choice content. Therefore, when the tag has been generated,\n // we push it onto the evaluation stack in the exact same way\n // as the string for the choice content.\n case ControlCommand.CommandType.EndTag: {\n if (this.state.inStringEvaluation) {\n let contentStackForTag: InkObject[] = [];\n let outputCountConsumed = 0;\n for (let i = this.state.outputStream.length - 1; i >= 0; --i) {\n let obj = this.state.outputStream[i];\n outputCountConsumed++;\n\n // var command = obj as ControlCommand;\n let command = asOrNull(obj, ControlCommand);\n if (command != null) {\n if (\n command.commandType == ControlCommand.CommandType.BeginTag\n ) {\n break;\n } else {\n this.Error(\n \"Unexpected ControlCommand while extracting tag from choice\"\n );\n break;\n }\n }\n if (obj instanceof StringValue) {\n contentStackForTag.push(obj);\n }\n }\n\n // Consume the content that was produced for this string\n this.state.PopFromOutputStream(outputCountConsumed);\n // Build string out of the content we collected\n let sb = new StringBuilder();\n for (let strVal of contentStackForTag) {\n sb.Append(strVal.toString());\n }\n let choiceTag = new Tag(\n this.state.CleanOutputWhitespace(sb.toString())\n );\n // Pushing to the evaluation stack means it gets picked up\n // when a Choice is generated from the next Choice Point.\n this.state.PushEvaluationStack(choiceTag);\n } else {\n // Otherwise! Simply push EndTag, so that in the output stream we\n // have a structure of: [BeginTag, \"the tag content\", EndTag]\n this.state.PushToOutputStream(evalCommand);\n }\n break;\n }\n\n case ControlCommand.CommandType.EndString: {\n let contentStackForString: InkObject[] = [];\n let contentToRetain: InkObject[] = [];\n\n let outputCountConsumed = 0;\n for (let i = this.state.outputStream.length - 1; i >= 0; --i) {\n let obj = this.state.outputStream[i];\n\n outputCountConsumed++;\n\n // var command = obj as ControlCommand;\n let command = asOrNull(obj, ControlCommand);\n if (\n command &&\n command.commandType == ControlCommand.CommandType.BeginString\n ) {\n break;\n }\n if (obj instanceof Tag) {\n contentToRetain.push(obj);\n }\n if (obj instanceof StringValue) {\n contentStackForString.push(obj);\n }\n }\n\n // Consume the content that was produced for this string\n this.state.PopFromOutputStream(outputCountConsumed);\n\n // Rescue the tags that we want actually to keep on the output stack\n // rather than consume as part of the string we're building.\n // At the time of writing, this only applies to Tag objects generated\n // by choices, which are pushed to the stack during string generation.\n for (let rescuedTag of contentToRetain)\n this.state.PushToOutputStream(rescuedTag);\n\n // The C# version uses a Stack for contentStackForString, but we're\n // using a simple array, so we need to reverse it before using it\n contentStackForString = contentStackForString.reverse();\n\n // Build string out of the content we collected\n let sb = new StringBuilder();\n for (let c of contentStackForString) {\n sb.Append(c.toString());\n }\n\n // Return to expression evaluation (from content mode)\n this.state.inExpressionEvaluation = true;\n this.state.PushEvaluationStack(new StringValue(sb.toString()));\n break;\n }\n\n case ControlCommand.CommandType.ChoiceCount:\n let choiceCount = this.state.generatedChoices.length;\n this.state.PushEvaluationStack(new IntValue(choiceCount));\n break;\n\n case ControlCommand.CommandType.Turns:\n this.state.PushEvaluationStack(\n new IntValue(this.state.currentTurnIndex + 1)\n );\n break;\n\n case ControlCommand.CommandType.TurnsSince:\n case ControlCommand.CommandType.ReadCount:\n let target = this.state.PopEvaluationStack();\n if (!(target instanceof DivertTargetValue)) {\n let extraNote = \"\";\n if (target instanceof IntValue)\n extraNote =\n \". Did you accidentally pass a read count ('knot_name') instead of a target ('-> knot_name')?\";\n this.Error(\n \"TURNS_SINCE / READ_COUNT expected a divert target (knot, stitch, label name), but saw \" +\n target +\n extraNote\n );\n break;\n }\n\n // var divertTarget = target as DivertTargetValue;\n let divertTarget = asOrThrows(target, DivertTargetValue);\n // var container = ContentAtPath (divertTarget.targetPath).correctObj as Container;\n let container = asOrNull(\n this.ContentAtPath(divertTarget.targetPath).correctObj,\n Container\n );\n\n let eitherCount;\n if (container != null) {\n if (\n evalCommand.commandType == ControlCommand.CommandType.TurnsSince\n )\n eitherCount = this.state.TurnsSinceForContainer(container);\n else eitherCount = this.state.VisitCountForContainer(container);\n } else {\n if (\n evalCommand.commandType == ControlCommand.CommandType.TurnsSince\n )\n eitherCount = -1;\n else eitherCount = 0;\n\n this.Warning(\n \"Failed to find container for \" +\n evalCommand.toString() +\n \" lookup at \" +\n divertTarget.targetPath.toString()\n );\n }\n\n this.state.PushEvaluationStack(new IntValue(eitherCount));\n break;\n\n case ControlCommand.CommandType.Random: {\n let maxInt = asOrNull(this.state.PopEvaluationStack(), IntValue);\n let minInt = asOrNull(this.state.PopEvaluationStack(), IntValue);\n\n if (minInt == null || minInt instanceof IntValue === false)\n return this.Error(\n \"Invalid value for minimum parameter of RANDOM(min, max)\"\n );\n\n if (maxInt == null || minInt instanceof IntValue === false)\n return this.Error(\n \"Invalid value for maximum parameter of RANDOM(min, max)\"\n );\n\n // Originally a primitive type, but here, can be null.\n // TODO: Replace by default value?\n if (maxInt.value === null) {\n return throwNullException(\"maxInt.value\");\n }\n if (minInt.value === null) {\n return throwNullException(\"minInt.value\");\n }\n\n // This code is differs a bit from the reference implementation, since\n // JavaScript has no true integers. Hence integer arithmetics and\n // interger overflows don't apply here. A loss of precision can\n // happen with big numbers however.\n //\n // The case where 'randomRange' is lower than zero is handled below,\n // so there's no need to test against Number.MIN_SAFE_INTEGER.\n let randomRange = maxInt.value - minInt.value + 1;\n if (!isFinite(randomRange) || randomRange > Number.MAX_SAFE_INTEGER) {\n randomRange = Number.MAX_SAFE_INTEGER;\n this.Error(\n \"RANDOM was called with a range that exceeds the size that ink numbers can use.\"\n );\n }\n if (randomRange <= 0)\n this.Error(\n \"RANDOM was called with minimum as \" +\n minInt.value +\n \" and maximum as \" +\n maxInt.value +\n \". The maximum must be larger\"\n );\n\n let resultSeed = this.state.storySeed + this.state.previousRandom;\n let random = new PRNG(resultSeed);\n\n let nextRandom = random.next();\n let chosenValue = (nextRandom % randomRange) + minInt.value;\n this.state.PushEvaluationStack(new IntValue(chosenValue));\n\n // Next random number (rather than keeping the Random object around)\n this.state.previousRandom = nextRandom;\n break;\n }\n\n case ControlCommand.CommandType.SeedRandom:\n let seed = asOrNull(this.state.PopEvaluationStack(), IntValue);\n if (seed == null || seed instanceof IntValue === false)\n return this.Error(\"Invalid value passed to SEED_RANDOM\");\n\n // Originally a primitive type, but here, can be null.\n // TODO: Replace by default value?\n if (seed.value === null) {\n return throwNullException(\"minInt.value\");\n }\n\n this.state.storySeed = seed.value;\n this.state.previousRandom = 0;\n\n this.state.PushEvaluationStack(new Void());\n break;\n\n case ControlCommand.CommandType.VisitIndex:\n let count =\n this.state.VisitCountForContainer(\n this.state.currentPointer.container\n ) - 1; // index not count\n this.state.PushEvaluationStack(new IntValue(count));\n break;\n\n case ControlCommand.CommandType.SequenceShuffleIndex:\n let shuffleIndex = this.NextSequenceShuffleIndex();\n this.state.PushEvaluationStack(new IntValue(shuffleIndex));\n break;\n\n case ControlCommand.CommandType.StartThread:\n // Handled in main step function\n break;\n\n case ControlCommand.CommandType.Done:\n // We may exist in the context of the initial\n // act of creating the thread, or in the context of\n // evaluating the content.\n if (this.state.callStack.canPopThread) {\n this.state.callStack.PopThread();\n }\n\n // In normal flow - allow safe exit without warning\n else {\n this.state.didSafeExit = true;\n\n // Stop flow in current thread\n this.state.currentPointer = Pointer.Null;\n }\n\n break;\n\n // Force flow to end completely\n case ControlCommand.CommandType.End:\n this.state.ForceEnd();\n break;\n\n case ControlCommand.CommandType.ListFromInt:\n // var intVal = state.PopEvaluationStack () as IntValue;\n let intVal = asOrNull(this.state.PopEvaluationStack(), IntValue);\n // var listNameVal = state.PopEvaluationStack () as StringValue;\n let listNameVal = asOrThrows(\n this.state.PopEvaluationStack(),\n StringValue\n );\n\n if (intVal === null) {\n throw new StoryException(\n \"Passed non-integer when creating a list element from a numerical value.\"\n );\n }\n\n let generatedListValue = null;\n\n if (this.listDefinitions === null) {\n return throwNullException(\"this.listDefinitions\");\n }\n let foundListDef = this.listDefinitions.TryListGetDefinition(\n listNameVal.value,\n null\n );\n if (foundListDef.exists) {\n // Originally a primitive type, but here, can be null.\n // TODO: Replace by default value?\n if (intVal.value === null) {\n return throwNullException(\"minInt.value\");\n }\n\n let foundItem = foundListDef.result!.TryGetItemWithValue(\n intVal.value,\n InkListItem.Null\n );\n if (foundItem.exists) {\n generatedListValue = new ListValue(\n foundItem.result!,\n intVal.value\n );\n }\n } else {\n throw new StoryException(\n \"Failed to find LIST called \" + listNameVal.value\n );\n }\n\n if (generatedListValue == null) generatedListValue = new ListValue();\n\n this.state.PushEvaluationStack(generatedListValue);\n break;\n\n case ControlCommand.CommandType.ListRange:\n let max = asOrNull(this.state.PopEvaluationStack(), Value);\n let min = asOrNull(this.state.PopEvaluationStack(), Value);\n\n // var targetList = state.PopEvaluationStack () as ListValue;\n let targetList = asOrNull(this.state.PopEvaluationStack(), ListValue);\n\n if (targetList === null || min === null || max === null)\n throw new StoryException(\n \"Expected list, minimum and maximum for LIST_RANGE\"\n );\n\n if (targetList.value === null) {\n return throwNullException(\"targetList.value\");\n }\n let result = targetList.value.ListWithSubRange(\n min.valueObject,\n max.valueObject\n );\n\n this.state.PushEvaluationStack(new ListValue(result));\n break;\n\n case ControlCommand.CommandType.ListRandom: {\n let listVal = this.state.PopEvaluationStack() as ListValue;\n if (listVal === null)\n throw new StoryException(\"Expected list for LIST_RANDOM\");\n\n let list = listVal.value;\n\n let newList: InkList | null = null;\n\n if (list === null) {\n throw throwNullException(\"list\");\n }\n if (list.Count == 0) {\n newList = new InkList();\n } else {\n // Generate a random index for the element to take\n let resultSeed = this.state.storySeed + this.state.previousRandom;\n let random = new PRNG(resultSeed);\n\n let nextRandom = random.next();\n let listItemIndex = nextRandom % list.Count;\n\n // This bit is a little different from the original\n // C# code, since iterators do not work in the same way.\n // First, we iterate listItemIndex - 1 times, calling next().\n // The listItemIndex-th time is made outside of the loop,\n // in order to retrieve the value.\n let listEnumerator = list.entries();\n for (let i = 0; i <= listItemIndex - 1; i++) {\n listEnumerator.next();\n }\n let value = listEnumerator.next().value;\n let randomItem: KeyValuePair = {\n Key: InkListItem.fromSerializedKey(value[0]),\n Value: value[1],\n };\n\n // Origin list is simply the origin of the one element\n if (randomItem.Key.originName === null) {\n return throwNullException(\"randomItem.Key.originName\");\n }\n newList = new InkList(randomItem.Key.originName, this);\n newList.Add(randomItem.Key, randomItem.Value);\n\n this.state.previousRandom = nextRandom;\n }\n\n this.state.PushEvaluationStack(new ListValue(newList));\n break;\n }\n\n default:\n this.Error(\"unhandled ControlCommand: \" + evalCommand);\n break;\n }\n\n return true;\n }\n\n // Variable assignment\n else if (contentObj instanceof VariableAssignment) {\n let varAss = contentObj;\n let assignedVal = this.state.PopEvaluationStack();\n\n this.state.variablesState.Assign(varAss, assignedVal);\n\n return true;\n }\n\n // Variable reference\n else if (contentObj instanceof VariableReference) {\n let varRef = contentObj;\n let foundValue = null;\n\n // Explicit read count value\n if (varRef.pathForCount != null) {\n let container = varRef.containerForCount;\n let count = this.state.VisitCountForContainer(container);\n foundValue = new IntValue(count);\n }\n\n // Normal variable reference\n else {\n foundValue = this.state.variablesState.GetVariableWithName(varRef.name);\n\n if (foundValue == null) {\n this.Warning(\n \"Variable not found: '\" +\n varRef.name +\n \"'. Using default value of 0 (false). This can happen with temporary variables if the declaration hasn't yet been hit. Globals are always given a default value on load if a value doesn't exist in the save state.\"\n );\n foundValue = new IntValue(0);\n }\n }\n\n this.state.PushEvaluationStack(foundValue);\n\n return true;\n }\n\n // Native function call\n else if (contentObj instanceof NativeFunctionCall) {\n let func = contentObj;\n let funcParams = this.state.PopEvaluationStack(func.numberOfParameters);\n let result = func.Call(funcParams);\n this.state.PushEvaluationStack(result);\n return true;\n }\n\n // No control content, must be ordinary content\n return false;\n }\n\n public ChoosePathString(\n path: string,\n resetCallstack = true,\n args: any[] = []\n ) {\n this.IfAsyncWeCant(\"call ChoosePathString right now\");\n if (this.onChoosePathString !== null) this.onChoosePathString(path, args);\n\n if (resetCallstack) {\n this.ResetCallstack();\n } else {\n if (this.state.callStack.currentElement.type == PushPopType.Function) {\n let funcDetail = \"\";\n let container =\n this.state.callStack.currentElement.currentPointer.container;\n if (container != null) {\n funcDetail = \"(\" + container.path.toString() + \") \";\n }\n throw new Error(\n \"Story was running a function \" +\n funcDetail +\n \"when you called ChoosePathString(\" +\n path +\n \") - this is almost certainly not not what you want! Full stack trace: \\n\" +\n this.state.callStack.callStackTrace\n );\n }\n }\n\n this.state.PassArgumentsToEvaluationStack(args);\n this.ChoosePath(new Path(path));\n }\n\n public IfAsyncWeCant(activityStr: string) {\n if (this._asyncContinueActive)\n throw new Error(\n \"Can't \" +\n activityStr +\n \". Story is in the middle of a ContinueAsync(). Make more ContinueAsync() calls or a single Continue() call beforehand.\"\n );\n }\n\n public ChoosePath(p: Path, incrementingTurnIndex: boolean = true) {\n this.state.SetChosenPath(p, incrementingTurnIndex);\n\n // Take a note of newly visited containers for read counts etc\n this.VisitChangedContainersDueToDivert();\n }\n\n public ChooseChoiceIndex(choiceIdx: number) {\n choiceIdx = choiceIdx;\n let choices = this.currentChoices;\n this.Assert(\n choiceIdx >= 0 && choiceIdx < choices.length,\n \"choice out of range\"\n );\n\n let choiceToChoose = choices[choiceIdx];\n if (this.onMakeChoice !== null) this.onMakeChoice(choiceToChoose);\n\n if (choiceToChoose.threadAtGeneration === null) {\n return throwNullException(\"choiceToChoose.threadAtGeneration\");\n }\n if (choiceToChoose.targetPath === null) {\n return throwNullException(\"choiceToChoose.targetPath\");\n }\n\n this.state.callStack.currentThread = choiceToChoose.threadAtGeneration;\n\n this.ChoosePath(choiceToChoose.targetPath);\n }\n\n public HasFunction(functionName: string) {\n try {\n return this.KnotContainerWithName(functionName) != null;\n } catch (e) {\n return false;\n }\n }\n\n public EvaluateFunction(\n functionName: string,\n args: any[] = [],\n returnTextOutput: boolean = false\n ): Story.EvaluateFunctionTextOutput | any {\n // EvaluateFunction behaves slightly differently than the C# version.\n // In C#, you can pass a (second) parameter `out textOutput` to get the\n // text outputted by the function. This is not possible in js. Instead,\n // we maintain the regular signature (functionName, args), plus an\n // optional third parameter returnTextOutput. If set to true, we will\n // return both the textOutput and the returned value, as an object.\n\n if (this.onEvaluateFunction !== null)\n this.onEvaluateFunction(functionName, args);\n\n this.IfAsyncWeCant(\"evaluate a function\");\n\n if (functionName == null) {\n throw new Error(\"Function is null\");\n } else if (functionName == \"\" || functionName.trim() == \"\") {\n throw new Error(\"Function is empty or white space.\");\n }\n\n let funcContainer = this.KnotContainerWithName(functionName);\n if (funcContainer == null) {\n throw new Error(\"Function doesn't exist: '\" + functionName + \"'\");\n }\n\n let outputStreamBefore: InkObject[] = [];\n outputStreamBefore.push(...this.state.outputStream);\n this._state.ResetOutput();\n\n this.state.StartFunctionEvaluationFromGame(funcContainer, args);\n\n // Evaluate the function, and collect the string output\n let stringOutput = new StringBuilder();\n while (this.canContinue) {\n stringOutput.Append(this.Continue());\n }\n let textOutput = stringOutput.toString();\n\n this._state.ResetOutput(outputStreamBefore);\n\n let result = this.state.CompleteFunctionEvaluationFromGame();\n if (this.onCompleteEvaluateFunction != null)\n this.onCompleteEvaluateFunction(functionName, args, textOutput, result);\n\n return returnTextOutput ? { returned: result, output: textOutput } : result;\n }\n\n public EvaluateExpression(exprContainer: Container) {\n let startCallStackHeight = this.state.callStack.elements.length;\n\n this.state.callStack.Push(PushPopType.Tunnel);\n\n this._temporaryEvaluationContainer = exprContainer;\n\n this.state.GoToStart();\n\n let evalStackHeight = this.state.evaluationStack.length;\n\n this.Continue();\n\n this._temporaryEvaluationContainer = null;\n\n // Should have fallen off the end of the Container, which should\n // have auto-popped, but just in case we didn't for some reason,\n // manually pop to restore the state (including currentPath).\n if (this.state.callStack.elements.length > startCallStackHeight) {\n this.state.PopCallStack();\n }\n\n let endStackHeight = this.state.evaluationStack.length;\n if (endStackHeight > evalStackHeight) {\n return this.state.PopEvaluationStack();\n } else {\n return null;\n }\n }\n\n public allowExternalFunctionFallbacks: boolean = false;\n\n public CallExternalFunction(\n funcName: string | null,\n numberOfArguments: number\n ) {\n if (funcName === null) {\n return throwNullException(\"funcName\");\n }\n let funcDef = this._externals.get(funcName);\n let fallbackFunctionContainer = null;\n\n let foundExternal = typeof funcDef !== \"undefined\";\n\n if (\n foundExternal &&\n !funcDef!.lookAheadSafe &&\n this._stateSnapshotAtLastNewline !== null\n ) {\n this._sawLookaheadUnsafeFunctionAfterNewline = true;\n return;\n }\n\n if (!foundExternal) {\n if (this.allowExternalFunctionFallbacks) {\n fallbackFunctionContainer = this.KnotContainerWithName(funcName);\n this.Assert(\n fallbackFunctionContainer !== null,\n \"Trying to call EXTERNAL function '\" +\n funcName +\n \"' which has not been bound, and fallback ink function could not be found.\"\n );\n\n // Divert direct into fallback function and we're done\n this.state.callStack.Push(\n PushPopType.Function,\n undefined,\n this.state.outputStream.length\n );\n this.state.divertedPointer = Pointer.StartOf(fallbackFunctionContainer);\n return;\n } else {\n this.Assert(\n false,\n \"Trying to call EXTERNAL function '\" +\n funcName +\n \"' which has not been bound (and ink fallbacks disabled).\"\n );\n }\n }\n\n // Pop arguments\n let args: any[] = [];\n for (let i = 0; i < numberOfArguments; ++i) {\n // var poppedObj = state.PopEvaluationStack () as Value;\n let poppedObj = asOrThrows(this.state.PopEvaluationStack(), Value);\n let valueObj = poppedObj.valueObject;\n args.push(valueObj);\n }\n\n // Reverse arguments from the order they were popped,\n // so they're the right way round again.\n args.reverse();\n\n // Run the function!\n let funcResult = funcDef!.function(args);\n\n // Convert return value (if any) to the a type that the ink engine can use\n let returnObj = null;\n if (funcResult != null) {\n returnObj = Value.Create(funcResult);\n this.Assert(\n returnObj !== null,\n \"Could not create ink value from returned object of type \" +\n typeof funcResult\n );\n } else {\n returnObj = new Void();\n }\n\n this.state.PushEvaluationStack(returnObj);\n }\n\n public BindExternalFunctionGeneral(\n funcName: string,\n func: Story.ExternalFunction,\n lookaheadSafe: boolean = true\n ) {\n this.IfAsyncWeCant(\"bind an external function\");\n this.Assert(\n !this._externals.has(funcName),\n \"Function '\" + funcName + \"' has already been bound.\"\n );\n this._externals.set(funcName, {\n function: func,\n lookAheadSafe: lookaheadSafe,\n });\n }\n\n public TryCoerce(value: any) {\n // We're skipping type coercition in this implementation. First of, js\n // is loosely typed, so it's not that important. Secondly, there is no\n // clean way (AFAIK) for the user to describe what type of parameters\n // they expect.\n return value;\n }\n\n public BindExternalFunction(\n funcName: string,\n func: Story.ExternalFunction,\n lookaheadSafe: boolean = false\n ) {\n this.Assert(func != null, \"Can't bind a null function\");\n\n this.BindExternalFunctionGeneral(\n funcName,\n (args: any) => {\n this.Assert(\n args.length >= func.length,\n \"External function expected \" + func.length + \" arguments\"\n );\n\n let coercedArgs = [];\n for (let i = 0, l = args.length; i < l; i++) {\n coercedArgs[i] = this.TryCoerce(args[i]);\n }\n return func.apply(null, coercedArgs);\n },\n lookaheadSafe\n );\n }\n\n public UnbindExternalFunction(funcName: string) {\n this.IfAsyncWeCant(\"unbind an external a function\");\n this.Assert(\n this._externals.has(funcName),\n \"Function '\" + funcName + \"' has not been bound.\"\n );\n this._externals.delete(funcName);\n }\n\n public ValidateExternalBindings(): void;\n public ValidateExternalBindings(\n c: Container | null,\n missingExternals: Set\n ): void;\n public ValidateExternalBindings(\n o: InkObject | null,\n missingExternals: Set\n ): void;\n public ValidateExternalBindings() {\n let c: Container | null = null;\n let o: InkObject | null = null;\n let missingExternals: Set = arguments[1] || new Set();\n\n if (arguments[0] instanceof Container) {\n c = arguments[0];\n }\n\n if (arguments[0] instanceof InkObject) {\n o = arguments[0];\n }\n\n if (c === null && o === null) {\n this.ValidateExternalBindings(\n this._mainContentContainer,\n missingExternals\n );\n this._hasValidatedExternals = true;\n\n // No problem! Validation complete\n if (missingExternals.size == 0) {\n this._hasValidatedExternals = true;\n } else {\n let message = \"Error: Missing function binding for external\";\n message += missingExternals.size > 1 ? \"s\" : \"\";\n message += \": '\";\n message += Array.from(missingExternals).join(\"', '\");\n message += \"' \";\n message += this.allowExternalFunctionFallbacks\n ? \", and no fallback ink function found.\"\n : \" (ink fallbacks disabled)\";\n\n this.Error(message);\n }\n } else if (c != null) {\n for (let innerContent of c.content) {\n let container = innerContent as Container;\n if (container == null || !container.hasValidName)\n this.ValidateExternalBindings(innerContent, missingExternals);\n }\n for (let [, value] of c.namedContent) {\n this.ValidateExternalBindings(\n asOrNull(value, InkObject),\n missingExternals\n );\n }\n } else if (o != null) {\n let divert = asOrNull(o, Divert);\n if (divert && divert.isExternal) {\n let name = divert.targetPathString;\n if (name === null) {\n return throwNullException(\"name\");\n }\n if (!this._externals.has(name)) {\n if (this.allowExternalFunctionFallbacks) {\n let fallbackFound =\n this.mainContentContainer.namedContent.has(name);\n if (!fallbackFound) {\n missingExternals.add(name);\n }\n } else {\n missingExternals.add(name);\n }\n }\n }\n }\n }\n\n public ObserveVariable(\n variableName: string,\n observer: Story.VariableObserver\n ) {\n this.IfAsyncWeCant(\"observe a new variable\");\n\n if (this._variableObservers === null) this._variableObservers = new Map();\n\n if (!this.state.variablesState.GlobalVariableExistsWithName(variableName))\n throw new Error(\n \"Cannot observe variable '\" +\n variableName +\n \"' because it wasn't declared in the ink story.\"\n );\n\n if (this._variableObservers.has(variableName)) {\n this._variableObservers.get(variableName)!.push(observer);\n } else {\n this._variableObservers.set(variableName, [observer]);\n }\n }\n\n public ObserveVariables(\n variableNames: string[],\n observers: Story.VariableObserver[]\n ) {\n for (let i = 0, l = variableNames.length; i < l; i++) {\n this.ObserveVariable(variableNames[i], observers[i]);\n }\n }\n\n public RemoveVariableObserver(\n observer?: Story.VariableObserver,\n specificVariableName?: string\n ) {\n // A couple of things to know about this method:\n //\n // 1. Since `RemoveVariableObserver` is exposed to the JavaScript world,\n // optionality is marked as `undefined` rather than `null`.\n // To keep things simple, null-checks are performed using regular\n // equality operators, where undefined == null.\n //\n // 2. Since C# delegates are translated to arrays of functions,\n // -= becomes a call to splice and null-checks are replaced by\n // emptiness-checks.\n //\n this.IfAsyncWeCant(\"remove a variable observer\");\n\n if (this._variableObservers === null) return;\n\n if (specificVariableName != null) {\n if (this._variableObservers.has(specificVariableName)) {\n if (observer != null) {\n let variableObservers =\n this._variableObservers.get(specificVariableName);\n if (variableObservers != null) {\n variableObservers.splice(variableObservers.indexOf(observer), 1);\n if (variableObservers.length === 0) {\n this._variableObservers.delete(specificVariableName);\n }\n }\n } else {\n this._variableObservers.delete(specificVariableName);\n }\n }\n } else if (observer != null) {\n let keys = this._variableObservers.keys();\n for (let varName of keys) {\n let variableObservers = this._variableObservers.get(varName);\n if (variableObservers != null) {\n variableObservers.splice(variableObservers.indexOf(observer), 1);\n if (variableObservers.length === 0) {\n this._variableObservers.delete(varName);\n }\n }\n }\n }\n }\n\n public VariableStateDidChangeEvent(\n variableName: string,\n newValueObj: InkObject\n ) {\n if (this._variableObservers === null) return;\n\n let observers = this._variableObservers.get(variableName);\n if (typeof observers !== \"undefined\") {\n if (!(newValueObj instanceof Value)) {\n throw new Error(\n \"Tried to get the value of a variable that isn't a standard type\"\n );\n }\n // var val = newValueObj as Value;\n let val = asOrThrows(newValueObj, Value);\n\n for (let observer of observers) {\n observer(variableName, val.valueObject);\n }\n }\n }\n\n get globalTags() {\n return this.TagsAtStartOfFlowContainerWithPathString(\"\");\n }\n\n public TagsForContentAtPath(path: string) {\n return this.TagsAtStartOfFlowContainerWithPathString(path);\n }\n\n public TagsAtStartOfFlowContainerWithPathString(pathString: string) {\n let path = new Path(pathString);\n\n let flowContainer = this.ContentAtPath(path).container;\n if (flowContainer === null) {\n return throwNullException(\"flowContainer\");\n }\n while (true) {\n let firstContent: InkObject = flowContainer.content[0];\n if (firstContent instanceof Container) flowContainer = firstContent;\n else break;\n }\n\n let inTag = false;\n let tags: string[] | null = null;\n\n for (let c of flowContainer.content) {\n // var tag = c as Runtime.Tag;\n let command = asOrNull(c, ControlCommand);\n\n if (command != null) {\n if (command.commandType == ControlCommand.CommandType.BeginTag) {\n inTag = true;\n } else if (command.commandType == ControlCommand.CommandType.EndTag) {\n inTag = false;\n }\n } else if (inTag) {\n let str = asOrNull(c, StringValue);\n if (str !== null) {\n if (tags === null) tags = [];\n if (str.value !== null) tags.push(str.value);\n } else {\n this.Error(\n \"Tag contained non-text content. Only plain text is allowed when using globalTags or TagsAtContentPath. If you want to evaluate dynamic content, you need to use story.Continue().\"\n );\n }\n } else {\n break;\n }\n }\n\n return tags;\n }\n\n public BuildStringOfHierarchy() {\n let sb = new StringBuilder();\n\n this.mainContentContainer.BuildStringOfHierarchy(\n sb,\n 0,\n this.state.currentPointer.Resolve()\n );\n\n return sb.toString();\n }\n\n public BuildStringOfContainer(container: Container) {\n let sb = new StringBuilder();\n container.BuildStringOfHierarchy(\n sb,\n 0,\n this.state.currentPointer.Resolve()\n );\n return sb.toString();\n }\n\n public NextContent() {\n this.state.previousPointer = this.state.currentPointer.copy();\n\n if (!this.state.divertedPointer.isNull) {\n this.state.currentPointer = this.state.divertedPointer.copy();\n this.state.divertedPointer = Pointer.Null;\n\n this.VisitChangedContainersDueToDivert();\n\n if (!this.state.currentPointer.isNull) {\n return;\n }\n }\n\n let successfulPointerIncrement = this.IncrementContentPointer();\n\n if (!successfulPointerIncrement) {\n let didPop = false;\n\n if (this.state.callStack.CanPop(PushPopType.Function)) {\n this.state.PopCallStack(PushPopType.Function);\n\n if (this.state.inExpressionEvaluation) {\n this.state.PushEvaluationStack(new Void());\n }\n\n didPop = true;\n } else if (this.state.callStack.canPopThread) {\n this.state.callStack.PopThread();\n\n didPop = true;\n } else {\n this.state.TryExitFunctionEvaluationFromGame();\n }\n\n if (didPop && !this.state.currentPointer.isNull) {\n this.NextContent();\n }\n }\n }\n\n public IncrementContentPointer() {\n let successfulIncrement = true;\n\n let pointer = this.state.callStack.currentElement.currentPointer.copy();\n pointer.index++;\n\n if (pointer.container === null) {\n return throwNullException(\"pointer.container\");\n }\n while (pointer.index >= pointer.container.content.length) {\n successfulIncrement = false;\n\n // Container nextAncestor = pointer.container.parent as Container;\n let nextAncestor = asOrNull(pointer.container.parent, Container);\n if (nextAncestor instanceof Container === false) {\n break;\n }\n\n let indexInAncestor = nextAncestor!.content.indexOf(pointer.container);\n if (indexInAncestor == -1) {\n break;\n }\n\n pointer = new Pointer(nextAncestor, indexInAncestor);\n\n pointer.index++;\n\n successfulIncrement = true;\n if (pointer.container === null) {\n return throwNullException(\"pointer.container\");\n }\n }\n\n if (!successfulIncrement) pointer = Pointer.Null;\n\n this.state.callStack.currentElement.currentPointer = pointer.copy();\n\n return successfulIncrement;\n }\n\n public TryFollowDefaultInvisibleChoice() {\n let allChoices = this._state.currentChoices;\n\n let invisibleChoices = allChoices.filter((c) => c.isInvisibleDefault);\n\n if (\n invisibleChoices.length == 0 ||\n allChoices.length > invisibleChoices.length\n )\n return false;\n\n let choice = invisibleChoices[0];\n\n if (choice.targetPath === null) {\n return throwNullException(\"choice.targetPath\");\n }\n\n if (choice.threadAtGeneration === null) {\n return throwNullException(\"choice.threadAtGeneration\");\n }\n\n this.state.callStack.currentThread = choice.threadAtGeneration;\n\n if (this._stateSnapshotAtLastNewline !== null) {\n this.state.callStack.currentThread = this.state.callStack.ForkThread();\n }\n\n this.ChoosePath(choice.targetPath, false);\n\n return true;\n }\n\n public NextSequenceShuffleIndex() {\n // var numElementsIntVal = state.PopEvaluationStack () as IntValue;\n let numElementsIntVal = asOrNull(this.state.PopEvaluationStack(), IntValue);\n if (!(numElementsIntVal instanceof IntValue)) {\n this.Error(\"expected number of elements in sequence for shuffle index\");\n return 0;\n }\n\n let seqContainer = this.state.currentPointer.container;\n if (seqContainer === null) {\n return throwNullException(\"seqContainer\");\n }\n\n // Originally a primitive type, but here, can be null.\n // TODO: Replace by default value?\n if (numElementsIntVal.value === null) {\n return throwNullException(\"numElementsIntVal.value\");\n }\n let numElements = numElementsIntVal.value;\n\n // var seqCountVal = state.PopEvaluationStack () as IntValue;\n let seqCountVal = asOrThrows(this.state.PopEvaluationStack(), IntValue);\n let seqCount = seqCountVal.value;\n\n // Originally a primitive type, but here, can be null.\n // TODO: Replace by default value?\n if (seqCount === null) {\n return throwNullException(\"seqCount\");\n }\n\n let loopIndex = seqCount / numElements;\n let iterationIndex = seqCount % numElements;\n\n let seqPathStr = seqContainer.path.toString();\n let sequenceHash = 0;\n for (let i = 0, l = seqPathStr.length; i < l; i++) {\n sequenceHash += seqPathStr.charCodeAt(i) || 0;\n }\n let randomSeed = sequenceHash + loopIndex + this.state.storySeed;\n let random = new PRNG(Math.floor(randomSeed));\n\n let unpickedIndices = [];\n for (let i = 0; i < numElements; ++i) {\n unpickedIndices.push(i);\n }\n\n for (let i = 0; i <= iterationIndex; ++i) {\n let chosen = random.next() % unpickedIndices.length;\n let chosenIndex = unpickedIndices[chosen];\n unpickedIndices.splice(chosen, 1);\n\n if (i == iterationIndex) {\n return chosenIndex;\n }\n }\n\n throw new Error(\"Should never reach here\");\n }\n\n public Error(message: string, useEndLineNumber = false): never {\n let e = new StoryException(message);\n e.useEndLineNumber = useEndLineNumber;\n throw e;\n }\n\n public Warning(message: string) {\n this.AddError(message, true);\n }\n\n public AddError(\n message: string,\n isWarning = false,\n useEndLineNumber = false\n ) {\n let dm = this.currentDebugMetadata;\n\n let errorTypeStr = isWarning ? \"WARNING\" : \"ERROR\";\n\n if (dm != null) {\n let lineNum = useEndLineNumber ? dm.endLineNumber : dm.startLineNumber;\n message =\n \"RUNTIME \" +\n errorTypeStr +\n \": '\" +\n dm.fileName +\n \"' line \" +\n lineNum +\n \": \" +\n message;\n } else if (!this.state.currentPointer.isNull) {\n message =\n \"RUNTIME \" +\n errorTypeStr +\n \": (\" +\n this.state.currentPointer +\n \"): \" +\n message;\n } else {\n message = \"RUNTIME \" + errorTypeStr + \": \" + message;\n }\n\n this.state.AddError(message, isWarning);\n\n // In a broken state don't need to know about any other errors.\n if (!isWarning) this.state.ForceEnd();\n }\n\n public Assert(condition: boolean, message: string | null = null) {\n if (condition == false) {\n if (message == null) {\n message = \"Story assert\";\n }\n\n throw new Error(message + \" \" + this.currentDebugMetadata);\n }\n }\n\n get currentDebugMetadata(): DebugMetadata | null {\n let dm: DebugMetadata | null;\n\n let pointer = this.state.currentPointer;\n if (!pointer.isNull && pointer.Resolve() !== null) {\n dm = pointer.Resolve()!.debugMetadata;\n if (dm !== null) {\n return dm;\n }\n }\n\n for (let i = this.state.callStack.elements.length - 1; i >= 0; --i) {\n pointer = this.state.callStack.elements[i].currentPointer;\n if (!pointer.isNull && pointer.Resolve() !== null) {\n dm = pointer.Resolve()!.debugMetadata;\n if (dm !== null) {\n return dm;\n }\n }\n }\n\n for (let i = this.state.outputStream.length - 1; i >= 0; --i) {\n let outputObj = this.state.outputStream[i];\n dm = outputObj.debugMetadata;\n if (dm !== null) {\n return dm;\n }\n }\n\n return null;\n }\n\n get mainContentContainer() {\n if (this._temporaryEvaluationContainer) {\n return this._temporaryEvaluationContainer;\n } else {\n return this._mainContentContainer;\n }\n }\n\n /**\n * `_mainContentContainer` is almost guaranteed to be set in the\n * constructor, unless the json is malformed.\n */\n private _mainContentContainer!: Container;\n private _listDefinitions: ListDefinitionsOrigin | null = null;\n\n private _externals: Map;\n private _variableObservers: Map | null =\n null;\n private _hasValidatedExternals: boolean = false;\n\n private _temporaryEvaluationContainer: Container | null = null;\n\n /**\n * `state` is almost guaranteed to be set in the constructor, unless\n * using the compiler-specific constructor which will likely not be used in\n * the real world.\n */\n private _state!: StoryState;\n\n private _asyncContinueActive: boolean = false;\n private _stateSnapshotAtLastNewline: StoryState | null = null;\n private _sawLookaheadUnsafeFunctionAfterNewline: boolean = false;\n\n private _recursiveContinueCount: number = 0;\n\n private _asyncSaving: boolean = false;\n\n private _profiler: any | null = null; // TODO: Profiler\n}\n\nexport namespace Story {\n export enum OutputStateChange {\n NoChange = 0,\n ExtendedBeyondNewline = 1,\n NewlineRemoved = 2,\n }\n\n export interface EvaluateFunctionTextOutput {\n returned: any;\n output: string;\n }\n\n export interface ExternalFunctionDef {\n function: ExternalFunction;\n lookAheadSafe: boolean;\n }\n\n export type VariableObserver = (variableName: string, newValue: any) => void;\n export type ExternalFunction = (...args: any) => any;\n}\n","import { CallStack } from \"./CallStack\";\nimport { VariablesState } from \"./VariablesState\";\nimport { ValueType, Value, StringValue, ListValue } from \"./Value\";\nimport { PushPopType } from \"./PushPop\";\nimport { Tag } from \"./Tag\";\nimport { Glue } from \"./Glue\";\nimport { Path } from \"./Path\";\nimport { ControlCommand } from \"./ControlCommand\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { JsonSerialisation } from \"./JsonSerialisation\";\nimport { PRNG } from \"./PRNG\";\nimport { Void } from \"./Void\";\nimport { Pointer } from \"./Pointer\";\nimport { tryGetValueFromMap } from \"./TryGetResult\";\nimport { Choice } from \"./Choice\";\nimport { asOrNull, asOrThrows, nullIfUndefined } from \"./TypeAssertion\";\nimport { Debug } from \"./Debug\";\nimport { Container } from \"./Container\";\nimport { InkObject } from \"./Object\";\nimport { throwNullException } from \"./NullException\";\nimport { Story } from \"./Story\";\nimport { StatePatch } from \"./StatePatch\";\nimport { SimpleJson } from \"./SimpleJson\";\nimport { Flow } from \"./Flow\";\nimport { InkList } from \"./InkList\";\n\nexport class StoryState {\n // Backward compatible changes since v8:\n // v10: dynamic tags\n // v9: multi-flows\n public readonly kInkSaveStateVersion = 10;\n public readonly kMinCompatibleLoadVersion = 8;\n\n public onDidLoadState: (() => void) | null = null;\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n public ToJson(indented: boolean = false) {\n let writer = new SimpleJson.Writer();\n this.WriteJson(writer);\n return writer.toString();\n }\n public toJson(indented: boolean = false) {\n return this.ToJson(indented);\n }\n\n public LoadJson(json: string) {\n let jObject = SimpleJson.TextToDictionary(json);\n this.LoadJsonObj(jObject);\n if (this.onDidLoadState !== null) this.onDidLoadState();\n }\n\n public VisitCountAtPathString(pathString: string) {\n let visitCountOut;\n\n if (this._patch !== null) {\n let container = this.story.ContentAtPath(new Path(pathString)).container;\n if (container === null)\n throw new Error(\"Content at path not found: \" + pathString);\n\n visitCountOut = this._patch.TryGetVisitCount(container, 0);\n if (visitCountOut.exists) return visitCountOut.result;\n }\n\n visitCountOut = tryGetValueFromMap(this._visitCounts, pathString, null);\n if (visitCountOut.exists) return visitCountOut.result;\n\n return 0;\n }\n\n public VisitCountForContainer(container: Container | null): number {\n if (container === null) {\n return throwNullException(\"container\");\n }\n if (!container.visitsShouldBeCounted) {\n this.story.Error(\n \"Read count for target (\" +\n container.name +\n \" - on \" +\n container.debugMetadata +\n \") unknown. The story may need to be compiled with countAllVisits flag (-c).\"\n );\n return 0;\n }\n\n if (this._patch !== null) {\n let count = this._patch.TryGetVisitCount(container, 0);\n if (count.exists) {\n return count.result!;\n }\n }\n\n let containerPathStr = container.path.toString();\n let count2 = tryGetValueFromMap(this._visitCounts, containerPathStr, null);\n if (count2.exists) {\n return count2.result!;\n }\n\n return 0;\n }\n\n public IncrementVisitCountForContainer(container: Container) {\n if (this._patch !== null) {\n let currCount = this.VisitCountForContainer(container);\n currCount++;\n this._patch.SetVisitCount(container, currCount);\n return;\n }\n\n let containerPathStr = container.path.toString();\n let count = tryGetValueFromMap(this._visitCounts, containerPathStr, null);\n if (count.exists) {\n this._visitCounts.set(containerPathStr, count.result! + 1);\n } else {\n this._visitCounts.set(containerPathStr, 1);\n }\n }\n\n public RecordTurnIndexVisitToContainer(container: Container) {\n if (this._patch !== null) {\n this._patch.SetTurnIndex(container, this.currentTurnIndex);\n return;\n }\n\n let containerPathStr = container.path.toString();\n this._turnIndices.set(containerPathStr, this.currentTurnIndex);\n }\n\n public TurnsSinceForContainer(container: Container) {\n if (!container.turnIndexShouldBeCounted) {\n this.story.Error(\n \"TURNS_SINCE() for target (\" +\n container.name +\n \" - on \" +\n container.debugMetadata +\n \") unknown. The story may need to be compiled with countAllVisits flag (-c).\"\n );\n }\n\n if (this._patch !== null) {\n let index = this._patch.TryGetTurnIndex(container, 0);\n if (index.exists) {\n return this.currentTurnIndex - index.result!;\n }\n }\n\n let containerPathStr = container.path.toString();\n let index2 = tryGetValueFromMap(this._turnIndices, containerPathStr, 0);\n if (index2.exists) {\n return this.currentTurnIndex - index2.result!;\n } else {\n return -1;\n }\n }\n\n get callstackDepth() {\n return this.callStack.depth;\n }\n\n get outputStream() {\n return this._currentFlow.outputStream;\n }\n\n get currentChoices() {\n // If we can continue generating text content rather than choices,\n // then we reflect the choice list as being empty, since choices\n // should always come at the end.\n if (this.canContinue) return [];\n return this._currentFlow.currentChoices;\n }\n\n get generatedChoices() {\n return this._currentFlow.currentChoices;\n }\n\n get currentErrors() {\n return this._currentErrors;\n }\n private _currentErrors: string[] | null = null;\n\n get currentWarnings() {\n return this._currentWarnings;\n }\n private _currentWarnings: string[] | null = null;\n\n get variablesState() {\n return this._variablesState;\n }\n set variablesState(value) {\n this._variablesState = value;\n }\n private _variablesState: VariablesState;\n\n get callStack() {\n return this._currentFlow.callStack;\n }\n\n get evaluationStack() {\n return this._evaluationStack;\n }\n private _evaluationStack: InkObject[];\n\n public divertedPointer: Pointer = Pointer.Null;\n\n get currentTurnIndex() {\n return this._currentTurnIndex;\n }\n set currentTurnIndex(value) {\n this._currentTurnIndex = value;\n }\n private _currentTurnIndex: number = 0;\n\n public storySeed: number = 0;\n public previousRandom: number = 0;\n public didSafeExit: boolean = false;\n\n public story: Story;\n\n get currentPathString() {\n let pointer = this.currentPointer;\n if (pointer.isNull) {\n return null;\n } else {\n if (pointer.path === null) {\n return throwNullException(\"pointer.path\");\n }\n return pointer.path.toString();\n }\n }\n\n get currentPointer() {\n return this.callStack.currentElement.currentPointer.copy();\n }\n\n set currentPointer(value) {\n this.callStack.currentElement.currentPointer = value.copy();\n }\n\n get previousPointer() {\n return this.callStack.currentThread.previousPointer.copy();\n }\n\n set previousPointer(value) {\n this.callStack.currentThread.previousPointer = value.copy();\n }\n\n get canContinue() {\n return !this.currentPointer.isNull && !this.hasError;\n }\n\n get hasError() {\n return this.currentErrors != null && this.currentErrors.length > 0;\n }\n\n get hasWarning() {\n return this.currentWarnings != null && this.currentWarnings.length > 0;\n }\n\n get currentText() {\n if (this._outputStreamTextDirty) {\n let sb = new StringBuilder();\n\n let inTag: boolean = false;\n\n for (let outputObj of this.outputStream) {\n // var textContent = outputObj as StringValue;\n let textContent = asOrNull(outputObj, StringValue);\n if (!inTag && textContent !== null) {\n sb.Append(textContent.value);\n } else {\n let controlCommand = asOrNull(outputObj, ControlCommand);\n if (controlCommand !== null) {\n if (\n controlCommand.commandType == ControlCommand.CommandType.BeginTag\n ) {\n inTag = true;\n } else if (\n controlCommand.commandType == ControlCommand.CommandType.EndTag\n ) {\n inTag = false;\n }\n }\n }\n }\n\n this._currentText = this.CleanOutputWhitespace(sb.toString());\n this._outputStreamTextDirty = false;\n }\n\n return this._currentText;\n }\n private _currentText: string | null = null;\n\n public CleanOutputWhitespace(str: string) {\n let sb = new StringBuilder();\n\n let currentWhitespaceStart = -1;\n let startOfLine = 0;\n\n for (let i = 0; i < str.length; i++) {\n let c = str.charAt(i);\n\n let isInlineWhitespace = c == \" \" || c == \"\\t\";\n\n if (isInlineWhitespace && currentWhitespaceStart == -1)\n currentWhitespaceStart = i;\n\n if (!isInlineWhitespace) {\n if (\n c != \"\\n\" &&\n currentWhitespaceStart > 0 &&\n currentWhitespaceStart != startOfLine\n ) {\n sb.Append(\" \");\n }\n currentWhitespaceStart = -1;\n }\n\n if (c == \"\\n\") startOfLine = i + 1;\n\n if (!isInlineWhitespace) sb.Append(c);\n }\n\n return sb.toString();\n }\n\n get currentTags() {\n if (this._outputStreamTagsDirty) {\n this._currentTags = [];\n let inTag: boolean = false;\n let sb = new StringBuilder();\n\n for (let outputObj of this.outputStream) {\n let controlCommand = asOrNull(outputObj, ControlCommand);\n if (controlCommand != null) {\n if (\n controlCommand.commandType == ControlCommand.CommandType.BeginTag\n ) {\n if (inTag && sb.Length > 0) {\n let txt = this.CleanOutputWhitespace(sb.toString());\n this._currentTags.push(txt);\n sb.Clear();\n }\n inTag = true;\n } else if (\n controlCommand.commandType == ControlCommand.CommandType.EndTag\n ) {\n if (sb.Length > 0) {\n let txt = this.CleanOutputWhitespace(sb.toString());\n this._currentTags.push(txt);\n sb.Clear();\n }\n inTag = false;\n }\n } else if (inTag) {\n let strVal = asOrNull(outputObj, StringValue);\n if (strVal !== null) {\n sb.Append(strVal.value);\n }\n } else {\n let tag = asOrNull(outputObj, Tag);\n if (tag != null && tag.text != null && tag.text.length > 0) {\n this._currentTags.push(tag.text); // tag.text has whitespae already cleaned\n }\n }\n }\n\n if (sb.Length > 0) {\n let txt = this.CleanOutputWhitespace(sb.toString());\n this._currentTags.push(txt);\n sb.Clear();\n }\n\n this._outputStreamTagsDirty = false;\n }\n\n return this._currentTags;\n }\n private _currentTags: string[] | null = null;\n\n get currentFlowName() {\n return this._currentFlow.name;\n }\n\n get currentFlowIsDefaultFlow() {\n return this._currentFlow.name == this.kDefaultFlowName;\n }\n\n get aliveFlowNames() {\n if (this._aliveFlowNamesDirty) {\n this._aliveFlowNames = [];\n\n if (this._namedFlows != null) {\n for (let flowName of this._namedFlows.keys()) {\n if (flowName != this.kDefaultFlowName) {\n this._aliveFlowNames.push(flowName);\n }\n }\n }\n\n this._aliveFlowNamesDirty = false;\n }\n\n return this._aliveFlowNames;\n }\n\n get inExpressionEvaluation() {\n return this.callStack.currentElement.inExpressionEvaluation;\n }\n set inExpressionEvaluation(value) {\n this.callStack.currentElement.inExpressionEvaluation = value;\n }\n\n constructor(story: Story) {\n this.story = story;\n\n this._currentFlow = new Flow(this.kDefaultFlowName, story);\n this.OutputStreamDirty();\n\n this._aliveFlowNamesDirty = true;\n this._evaluationStack = [];\n\n this._variablesState = new VariablesState(\n this.callStack,\n story.listDefinitions\n );\n\n this._visitCounts = new Map();\n this._turnIndices = new Map();\n this.currentTurnIndex = -1;\n\n let timeSeed = new Date().getTime();\n this.storySeed = new PRNG(timeSeed).next() % 100;\n this.previousRandom = 0;\n\n this.GoToStart();\n }\n\n public GoToStart() {\n this.callStack.currentElement.currentPointer = Pointer.StartOf(\n this.story.mainContentContainer\n );\n }\n\n public SwitchFlow_Internal(flowName: string | null) {\n if (flowName === null)\n throw new Error(\"Must pass a non-null string to Story.SwitchFlow\");\n\n if (this._namedFlows === null) {\n this._namedFlows = new Map();\n this._namedFlows.set(this.kDefaultFlowName, this._currentFlow);\n }\n\n if (flowName === this._currentFlow.name) {\n return;\n }\n\n let flow: Flow;\n let content = tryGetValueFromMap(this._namedFlows, flowName, null);\n if (content.exists) {\n flow = content.result!;\n } else {\n flow = new Flow(flowName, this.story);\n this._namedFlows.set(flowName, flow);\n this._aliveFlowNamesDirty = true;\n }\n\n this._currentFlow = flow;\n this.variablesState.callStack = this._currentFlow.callStack;\n\n this.OutputStreamDirty();\n }\n\n public SwitchToDefaultFlow_Internal() {\n if (this._namedFlows === null) return;\n this.SwitchFlow_Internal(this.kDefaultFlowName);\n }\n\n public RemoveFlow_Internal(flowName: string | null) {\n if (flowName === null)\n throw new Error(\"Must pass a non-null string to Story.DestroyFlow\");\n if (flowName === this.kDefaultFlowName)\n throw new Error(\"Cannot destroy default flow\");\n\n if (this._currentFlow.name === flowName) {\n this.SwitchToDefaultFlow_Internal();\n }\n\n if (this._namedFlows === null)\n return throwNullException(\"this._namedFlows\");\n this._namedFlows.delete(flowName);\n this._aliveFlowNamesDirty = true;\n }\n\n public CopyAndStartPatching() {\n let copy = new StoryState(this.story);\n\n copy._patch = new StatePatch(this._patch);\n\n copy._currentFlow.name = this._currentFlow.name;\n copy._currentFlow.callStack = new CallStack(this._currentFlow.callStack);\n copy._currentFlow.currentChoices.push(...this._currentFlow.currentChoices);\n copy._currentFlow.outputStream.push(...this._currentFlow.outputStream);\n copy.OutputStreamDirty();\n\n if (this._namedFlows !== null) {\n copy._namedFlows = new Map();\n for (let [namedFlowKey, namedFlowValue] of this._namedFlows) {\n copy._namedFlows.set(namedFlowKey, namedFlowValue);\n copy._aliveFlowNamesDirty = true;\n }\n copy._namedFlows.set(this._currentFlow.name, copy._currentFlow);\n }\n\n if (this.hasError) {\n copy._currentErrors = [];\n copy._currentErrors.push(...(this.currentErrors || []));\n }\n\n if (this.hasWarning) {\n copy._currentWarnings = [];\n copy._currentWarnings.push(...(this.currentWarnings || []));\n }\n\n copy.variablesState = this.variablesState;\n copy.variablesState.callStack = copy.callStack;\n copy.variablesState.patch = copy._patch;\n\n copy.evaluationStack.push(...this.evaluationStack);\n\n if (!this.divertedPointer.isNull)\n copy.divertedPointer = this.divertedPointer.copy();\n\n copy.previousPointer = this.previousPointer.copy();\n\n copy._visitCounts = this._visitCounts;\n copy._turnIndices = this._turnIndices;\n\n copy.currentTurnIndex = this.currentTurnIndex;\n copy.storySeed = this.storySeed;\n copy.previousRandom = this.previousRandom;\n\n copy.didSafeExit = this.didSafeExit;\n\n return copy;\n }\n\n public RestoreAfterPatch() {\n this.variablesState.callStack = this.callStack;\n this.variablesState.patch = this._patch;\n }\n\n public ApplyAnyPatch() {\n if (this._patch === null) return;\n\n this.variablesState.ApplyPatch();\n\n for (let [key, value] of this._patch.visitCounts)\n this.ApplyCountChanges(key, value, true);\n\n for (let [key, value] of this._patch.turnIndices)\n this.ApplyCountChanges(key, value, false);\n\n this._patch = null;\n }\n\n public ApplyCountChanges(\n container: Container,\n newCount: number,\n isVisit: boolean\n ) {\n let counts = isVisit ? this._visitCounts : this._turnIndices;\n counts.set(container.path.toString(), newCount);\n }\n\n public WriteJson(writer: SimpleJson.Writer) {\n writer.WriteObjectStart();\n\n writer.WritePropertyStart(\"flows\");\n writer.WriteObjectStart();\n\n // NOTE: Never pass `WriteJson` directly as an argument to `WriteProperty`.\n // Call it inside a function to make sure `this` is correctly bound\n // and passed down the call hierarchy.\n\n if (this._namedFlows !== null) {\n for (let [namedFlowKey, namedFlowValue] of this._namedFlows) {\n writer.WriteProperty(namedFlowKey, (w) => namedFlowValue.WriteJson(w));\n }\n } else {\n writer.WriteProperty(this._currentFlow.name, (w) =>\n this._currentFlow.WriteJson(w)\n );\n }\n\n writer.WriteObjectEnd();\n writer.WritePropertyEnd();\n\n writer.WriteProperty(\"currentFlowName\", this._currentFlow.name);\n\n writer.WriteProperty(\"variablesState\", (w) =>\n this.variablesState.WriteJson(w)\n );\n\n writer.WriteProperty(\"evalStack\", (w) =>\n JsonSerialisation.WriteListRuntimeObjs(w, this.evaluationStack)\n );\n\n if (!this.divertedPointer.isNull) {\n if (this.divertedPointer.path === null) {\n return throwNullException(\"divertedPointer\");\n }\n writer.WriteProperty(\n \"currentDivertTarget\",\n this.divertedPointer.path.componentsString\n );\n }\n\n writer.WriteProperty(\"visitCounts\", (w) =>\n JsonSerialisation.WriteIntDictionary(w, this._visitCounts)\n );\n writer.WriteProperty(\"turnIndices\", (w) =>\n JsonSerialisation.WriteIntDictionary(w, this._turnIndices)\n );\n\n writer.WriteIntProperty(\"turnIdx\", this.currentTurnIndex);\n writer.WriteIntProperty(\"storySeed\", this.storySeed);\n writer.WriteIntProperty(\"previousRandom\", this.previousRandom);\n\n writer.WriteIntProperty(\"inkSaveVersion\", this.kInkSaveStateVersion);\n\n writer.WriteIntProperty(\"inkFormatVersion\", Story.inkVersionCurrent);\n\n writer.WriteObjectEnd();\n }\n\n public LoadJsonObj(value: Record) {\n let jObject = value;\n\n let jSaveVersion = jObject[\"inkSaveVersion\"];\n if (jSaveVersion == null) {\n throw new Error(\"ink save format incorrect, can't load.\");\n } else if (parseInt(jSaveVersion) < this.kMinCompatibleLoadVersion) {\n throw new Error(\n \"Ink save format isn't compatible with the current version (saw '\" +\n jSaveVersion +\n \"', but minimum is \" +\n this.kMinCompatibleLoadVersion +\n \"), so can't load.\"\n );\n }\n\n let flowsObj = jObject[\"flows\"];\n if (flowsObj != null) {\n let flowsObjDict = flowsObj as Record;\n\n // Single default flow\n if (Object.keys(flowsObjDict).length === 1) {\n this._namedFlows = null;\n } else if (this._namedFlows === null) {\n this._namedFlows = new Map();\n } else {\n this._namedFlows.clear();\n }\n\n let flowsObjDictEntries = Object.entries(flowsObjDict);\n for (let [namedFlowObjKey, namedFlowObjValue] of flowsObjDictEntries) {\n let name = namedFlowObjKey;\n let flowObj = namedFlowObjValue as Record;\n\n let flow = new Flow(name, this.story, flowObj);\n\n if (Object.keys(flowsObjDict).length === 1) {\n this._currentFlow = new Flow(name, this.story, flowObj);\n } else {\n if (this._namedFlows === null)\n return throwNullException(\"this._namedFlows\");\n this._namedFlows.set(name, flow);\n }\n }\n\n if (this._namedFlows != null && this._namedFlows.size > 1) {\n let currFlowName = jObject[\"currentFlowName\"] as string;\n // Adding a bang at the end, because we're trusting the save, as\n // done in upstream. If the save is corrupted, the execution\n // is undefined.\n this._currentFlow = this._namedFlows.get(currFlowName)!;\n }\n } else {\n this._namedFlows = null;\n this._currentFlow.name = this.kDefaultFlowName;\n this._currentFlow.callStack.SetJsonToken(\n jObject[\"callstackThreads\"] as Record,\n this.story\n );\n this._currentFlow.outputStream = JsonSerialisation.JArrayToRuntimeObjList(\n jObject[\"outputStream\"] as any[]\n );\n this._currentFlow.currentChoices =\n JsonSerialisation.JArrayToRuntimeObjList(\n jObject[\"currentChoices\"] as any[]\n ) as Choice[];\n\n let jChoiceThreadsObj = jObject[\"choiceThreads\"];\n this._currentFlow.LoadFlowChoiceThreads(jChoiceThreadsObj, this.story);\n }\n\n this.OutputStreamDirty();\n this._aliveFlowNamesDirty = true;\n\n this.variablesState.SetJsonToken(jObject[\"variablesState\"]);\n this.variablesState.callStack = this._currentFlow.callStack;\n\n this._evaluationStack = JsonSerialisation.JArrayToRuntimeObjList(\n jObject[\"evalStack\"]\n );\n\n let currentDivertTargetPath = jObject[\"currentDivertTarget\"];\n if (currentDivertTargetPath != null) {\n let divertPath = new Path(currentDivertTargetPath.toString());\n this.divertedPointer = this.story.PointerAtPath(divertPath);\n }\n\n this._visitCounts = JsonSerialisation.JObjectToIntDictionary(\n jObject[\"visitCounts\"]\n );\n this._turnIndices = JsonSerialisation.JObjectToIntDictionary(\n jObject[\"turnIndices\"]\n );\n this.currentTurnIndex = parseInt(jObject[\"turnIdx\"]);\n this.storySeed = parseInt(jObject[\"storySeed\"]);\n this.previousRandom = parseInt(jObject[\"previousRandom\"]);\n }\n\n public ResetErrors() {\n this._currentErrors = null;\n this._currentWarnings = null;\n }\n public ResetOutput(objs: InkObject[] | null = null) {\n this.outputStream.length = 0;\n if (objs !== null) this.outputStream.push(...objs);\n this.OutputStreamDirty();\n }\n\n public PushToOutputStream(obj: InkObject | null) {\n // var text = obj as StringValue;\n let text = asOrNull(obj, StringValue);\n if (text !== null) {\n let listText = this.TrySplittingHeadTailWhitespace(text);\n if (listText !== null) {\n for (let textObj of listText) {\n this.PushToOutputStreamIndividual(textObj);\n }\n this.OutputStreamDirty();\n return;\n }\n }\n\n this.PushToOutputStreamIndividual(obj);\n this.OutputStreamDirty();\n }\n\n public PopFromOutputStream(count: number) {\n this.outputStream.splice(this.outputStream.length - count, count);\n this.OutputStreamDirty();\n }\n\n public TrySplittingHeadTailWhitespace(single: StringValue) {\n let str = single.value;\n if (str === null) {\n return throwNullException(\"single.value\");\n }\n\n let headFirstNewlineIdx = -1;\n let headLastNewlineIdx = -1;\n for (let i = 0; i < str.length; i++) {\n let c = str[i];\n if (c == \"\\n\") {\n if (headFirstNewlineIdx == -1) headFirstNewlineIdx = i;\n headLastNewlineIdx = i;\n } else if (c == \" \" || c == \"\\t\") continue;\n else break;\n }\n\n let tailLastNewlineIdx = -1;\n let tailFirstNewlineIdx = -1;\n for (let i = str.length - 1; i >= 0; i--) {\n let c = str[i];\n if (c == \"\\n\") {\n if (tailLastNewlineIdx == -1) tailLastNewlineIdx = i;\n tailFirstNewlineIdx = i;\n } else if (c == \" \" || c == \"\\t\") continue;\n else break;\n }\n\n // No splitting to be done?\n if (headFirstNewlineIdx == -1 && tailLastNewlineIdx == -1) return null;\n\n let listTexts: StringValue[] = [];\n let innerStrStart = 0;\n let innerStrEnd = str.length;\n\n if (headFirstNewlineIdx != -1) {\n if (headFirstNewlineIdx > 0) {\n let leadingSpaces = new StringValue(\n str.substring(0, headFirstNewlineIdx)\n );\n listTexts.push(leadingSpaces);\n }\n listTexts.push(new StringValue(\"\\n\"));\n innerStrStart = headLastNewlineIdx + 1;\n }\n\n if (tailLastNewlineIdx != -1) {\n innerStrEnd = tailFirstNewlineIdx;\n }\n\n if (innerStrEnd > innerStrStart) {\n let innerStrText = str.substring(innerStrStart, innerStrEnd);\n listTexts.push(new StringValue(innerStrText));\n }\n\n if (tailLastNewlineIdx != -1 && tailFirstNewlineIdx > headLastNewlineIdx) {\n listTexts.push(new StringValue(\"\\n\"));\n if (tailLastNewlineIdx < str.length - 1) {\n let numSpaces = str.length - tailLastNewlineIdx - 1;\n let trailingSpaces = new StringValue(\n str.substring(\n tailLastNewlineIdx + 1,\n tailLastNewlineIdx + 1 + numSpaces\n )\n );\n listTexts.push(trailingSpaces);\n }\n }\n\n return listTexts;\n }\n\n public PushToOutputStreamIndividual(obj: InkObject | null) {\n let glue = asOrNull(obj, Glue);\n let text = asOrNull(obj, StringValue);\n\n let includeInOutput = true;\n\n if (glue) {\n this.TrimNewlinesFromOutputStream();\n includeInOutput = true;\n } else if (text) {\n let functionTrimIndex = -1;\n let currEl = this.callStack.currentElement;\n if (currEl.type == PushPopType.Function) {\n functionTrimIndex = currEl.functionStartInOutputStream;\n }\n\n let glueTrimIndex = -1;\n for (let i = this.outputStream.length - 1; i >= 0; i--) {\n let o = this.outputStream[i];\n let c = o instanceof ControlCommand ? o : null;\n let g = o instanceof Glue ? o : null;\n\n if (g != null) {\n glueTrimIndex = i;\n break;\n } else if (\n c != null &&\n c.commandType == ControlCommand.CommandType.BeginString\n ) {\n if (i >= functionTrimIndex) {\n functionTrimIndex = -1;\n }\n break;\n }\n }\n\n let trimIndex = -1;\n if (glueTrimIndex != -1 && functionTrimIndex != -1)\n trimIndex = Math.min(functionTrimIndex, glueTrimIndex);\n else if (glueTrimIndex != -1) trimIndex = glueTrimIndex;\n else trimIndex = functionTrimIndex;\n\n if (trimIndex != -1) {\n if (text.isNewline) {\n includeInOutput = false;\n } else if (text.isNonWhitespace) {\n if (glueTrimIndex > -1) this.RemoveExistingGlue();\n\n if (functionTrimIndex > -1) {\n let callStackElements = this.callStack.elements;\n for (let i = callStackElements.length - 1; i >= 0; i--) {\n let el = callStackElements[i];\n if (el.type == PushPopType.Function) {\n el.functionStartInOutputStream = -1;\n } else {\n break;\n }\n }\n }\n }\n } else if (text.isNewline) {\n if (this.outputStreamEndsInNewline || !this.outputStreamContainsContent)\n includeInOutput = false;\n }\n }\n\n if (includeInOutput) {\n if (obj === null) {\n return throwNullException(\"obj\");\n }\n this.outputStream.push(obj);\n this.OutputStreamDirty();\n }\n }\n\n public TrimNewlinesFromOutputStream() {\n let removeWhitespaceFrom = -1;\n\n let i = this.outputStream.length - 1;\n while (i >= 0) {\n let obj = this.outputStream[i];\n let cmd = asOrNull(obj, ControlCommand);\n let txt = asOrNull(obj, StringValue);\n\n if (cmd != null || (txt != null && txt.isNonWhitespace)) {\n break;\n } else if (txt != null && txt.isNewline) {\n removeWhitespaceFrom = i;\n }\n i--;\n }\n\n // Remove the whitespace\n if (removeWhitespaceFrom >= 0) {\n i = removeWhitespaceFrom;\n while (i < this.outputStream.length) {\n let text = asOrNull(this.outputStream[i], StringValue);\n if (text) {\n this.outputStream.splice(i, 1);\n } else {\n i++;\n }\n }\n }\n\n this.OutputStreamDirty();\n }\n\n public RemoveExistingGlue() {\n for (let i = this.outputStream.length - 1; i >= 0; i--) {\n let c = this.outputStream[i];\n if (c instanceof Glue) {\n this.outputStream.splice(i, 1);\n } else if (c instanceof ControlCommand) {\n break;\n }\n }\n\n this.OutputStreamDirty();\n }\n\n get outputStreamEndsInNewline() {\n if (this.outputStream.length > 0) {\n for (let i = this.outputStream.length - 1; i >= 0; i--) {\n let obj = this.outputStream[i];\n if (obj instanceof ControlCommand) break;\n let text = this.outputStream[i];\n if (text instanceof StringValue) {\n if (text.isNewline) return true;\n else if (text.isNonWhitespace) break;\n }\n }\n }\n\n return false;\n }\n\n get outputStreamContainsContent() {\n for (let content of this.outputStream) {\n if (content instanceof StringValue) return true;\n }\n return false;\n }\n\n get inStringEvaluation() {\n for (let i = this.outputStream.length - 1; i >= 0; i--) {\n let cmd = asOrNull(this.outputStream[i], ControlCommand);\n if (\n cmd instanceof ControlCommand &&\n cmd.commandType == ControlCommand.CommandType.BeginString\n ) {\n return true;\n }\n }\n\n return false;\n }\n\n public PushEvaluationStack(obj: InkObject | null) {\n // var listValue = obj as ListValue;\n let listValue = asOrNull(obj, ListValue);\n if (listValue) {\n // Update origin when list is has something to indicate the list origin\n let rawList = listValue.value;\n if (rawList === null) {\n return throwNullException(\"rawList\");\n }\n\n if (rawList.originNames != null) {\n if (!rawList.origins) rawList.origins = [];\n rawList.origins.length = 0;\n\n for (let n of rawList.originNames) {\n if (this.story.listDefinitions === null)\n return throwNullException(\"StoryState.story.listDefinitions\");\n let def = this.story.listDefinitions.TryListGetDefinition(n, null);\n if (def.result === null)\n return throwNullException(\"StoryState def.result\");\n if (rawList.origins.indexOf(def.result) < 0)\n rawList.origins.push(def.result);\n }\n }\n }\n\n if (obj === null) {\n return throwNullException(\"obj\");\n }\n this.evaluationStack.push(obj);\n }\n\n public PopEvaluationStack(): InkObject;\n public PopEvaluationStack(numberOfObjects: number): InkObject[];\n public PopEvaluationStack(numberOfObjects?: number) {\n if (typeof numberOfObjects === \"undefined\") {\n let obj = this.evaluationStack.pop();\n return nullIfUndefined(obj);\n } else {\n if (numberOfObjects > this.evaluationStack.length) {\n throw new Error(\"trying to pop too many objects\");\n }\n\n let popped = this.evaluationStack.splice(\n this.evaluationStack.length - numberOfObjects,\n numberOfObjects\n );\n return nullIfUndefined(popped);\n }\n }\n\n public PeekEvaluationStack() {\n return this.evaluationStack[this.evaluationStack.length - 1];\n }\n\n public ForceEnd() {\n this.callStack.Reset();\n\n this._currentFlow.currentChoices.length = 0;\n\n this.currentPointer = Pointer.Null;\n this.previousPointer = Pointer.Null;\n\n this.didSafeExit = true;\n }\n\n public TrimWhitespaceFromFunctionEnd() {\n Debug.Assert(this.callStack.currentElement.type == PushPopType.Function);\n let functionStartPoint =\n this.callStack.currentElement.functionStartInOutputStream;\n\n if (functionStartPoint == -1) {\n functionStartPoint = 0;\n }\n\n for (let i = this.outputStream.length - 1; i >= functionStartPoint; i--) {\n let obj = this.outputStream[i];\n let txt = asOrNull(obj, StringValue);\n let cmd = asOrNull(obj, ControlCommand);\n\n if (txt == null) continue;\n if (cmd) break;\n\n if (txt.isNewline || txt.isInlineWhitespace) {\n this.outputStream.splice(i, 1);\n this.OutputStreamDirty();\n } else {\n break;\n }\n }\n }\n\n public PopCallStack(popType: PushPopType | null = null) {\n if (this.callStack.currentElement.type == PushPopType.Function)\n this.TrimWhitespaceFromFunctionEnd();\n\n this.callStack.Pop(popType);\n }\n\n public SetChosenPath(path: Path, incrementingTurnIndex: boolean) {\n // Changing direction, assume we need to clear current set of choices\n this._currentFlow.currentChoices.length = 0;\n\n let newPointer = this.story.PointerAtPath(path);\n if (!newPointer.isNull && newPointer.index == -1) newPointer.index = 0;\n\n this.currentPointer = newPointer;\n\n if (incrementingTurnIndex) {\n this.currentTurnIndex++;\n }\n }\n\n public StartFunctionEvaluationFromGame(\n funcContainer: Container,\n args: any[]\n ) {\n this.callStack.Push(\n PushPopType.FunctionEvaluationFromGame,\n this.evaluationStack.length\n );\n this.callStack.currentElement.currentPointer =\n Pointer.StartOf(funcContainer);\n\n this.PassArgumentsToEvaluationStack(args);\n }\n\n public PassArgumentsToEvaluationStack(args: any[] | null) {\n if (args !== null) {\n for (let i = 0; i < args.length; i++) {\n if (\n !(\n typeof args[i] === \"number\" ||\n typeof args[i] === \"string\" ||\n typeof args[i] === \"boolean\" ||\n args[i] instanceof InkList\n )\n ) {\n throw new Error(\n \"ink arguments when calling EvaluateFunction / ChoosePathStringWithParameters must be\" +\n \"number, string, bool or InkList. Argument was \" +\n (nullIfUndefined(arguments[i]) === null)\n ? \"null\"\n : arguments[i].constructor.name\n );\n }\n\n this.PushEvaluationStack(Value.Create(args[i]));\n }\n }\n }\n\n public TryExitFunctionEvaluationFromGame() {\n if (\n this.callStack.currentElement.type ==\n PushPopType.FunctionEvaluationFromGame\n ) {\n this.currentPointer = Pointer.Null;\n this.didSafeExit = true;\n return true;\n }\n\n return false;\n }\n\n public CompleteFunctionEvaluationFromGame() {\n if (\n this.callStack.currentElement.type !=\n PushPopType.FunctionEvaluationFromGame\n ) {\n throw new Error(\n \"Expected external function evaluation to be complete. Stack trace: \" +\n this.callStack.callStackTrace\n );\n }\n\n let originalEvaluationStackHeight =\n this.callStack.currentElement.evaluationStackHeightWhenPushed;\n\n let returnedObj: InkObject | null = null;\n while (this.evaluationStack.length > originalEvaluationStackHeight) {\n let poppedObj = this.PopEvaluationStack();\n if (returnedObj === null) returnedObj = poppedObj;\n }\n\n this.PopCallStack(PushPopType.FunctionEvaluationFromGame);\n\n if (returnedObj) {\n if (returnedObj instanceof Void) return null;\n\n // Some kind of value, if not void\n // var returnVal = returnedObj as Runtime.Value;\n let returnVal = asOrThrows(returnedObj, Value);\n\n // DivertTargets get returned as the string of components\n // (rather than a Path, which isn't public)\n if (returnVal.valueType == ValueType.DivertTarget) {\n return returnVal.valueObject.toString();\n }\n\n // Other types can just have their exact object type:\n // int, float, string. VariablePointers get returned as strings.\n return returnVal.valueObject;\n }\n\n return null;\n }\n\n public AddError(message: string, isWarning: boolean) {\n if (!isWarning) {\n if (this._currentErrors == null) this._currentErrors = [];\n this._currentErrors.push(message);\n } else {\n if (this._currentWarnings == null) this._currentWarnings = [];\n this._currentWarnings.push(message);\n }\n }\n\n public OutputStreamDirty() {\n this._outputStreamTextDirty = true;\n this._outputStreamTagsDirty = true;\n }\n\n private _visitCounts: Map;\n private _turnIndices: Map;\n\n private _outputStreamTextDirty = true;\n private _outputStreamTagsDirty = true;\n\n private _patch: StatePatch | null = null;\n\n private _currentFlow: Flow;\n private _aliveFlowNames: string[] | null = null;\n private _namedFlows: Map | null = null;\n private readonly kDefaultFlowName = \"DEFAULT_FLOW\";\n private _aliveFlowNamesDirty: boolean = true;\n}\n","// This is simple replacement of the Stopwatch class from the .NET Framework.\n// The original class can count time with much more accuracy than the Javascript version.\n// It might be worth considering using `window.performance` in the browser\n// or `process.hrtime()` in node.\nexport class Stopwatch {\n private startTime: number | undefined;\n\n constructor() {\n this.startTime = undefined;\n }\n\n get ElapsedMilliseconds(): number {\n if (typeof this.startTime === \"undefined\") {\n return 0;\n }\n return new Date().getTime() - this.startTime;\n }\n\n public Start() {\n this.startTime = new Date().getTime();\n }\n public Stop() {\n this.startTime = undefined;\n }\n}\n"],"names":["Debug","Path","_classCallCheck","this","_components","_componentsString","_isRelative","arguments","componentsString","Component","head","tail","push","concat","Array","relative","_createClass","key","get","length","slice","self","lastComponentIdx","i","l","isIndex","value","index","pathToAppend","p","upwardMoves","isParent","join","isRelative","set","substring","_step","_iterator","_createForOfIteratorHelper","split","s","n","done","str","test","parseInt","err","e","f","otherPath","Equals","c","_p$_components","apply","_toConsumableArray","path","asOrNull","obj","type","unsafeTypeAssertion","asOrThrows","Error","asINamedContentOrNull","hasValidName","name","nullIfUndefined","isEquatable","_typeof","parentId","indexOrName","toString","otherComp","Assert","condition","message","console","warn","trace","AssertType","variable","NullException","_Error","_inherits","_super","_createSuper","_wrapNativeSuper","throwNullException","InkObject","parent","_debugMetadata","_path","debugMetadata","root","rootContentContainer","targetContent","ContentAtPath","dm","startLineNumber","comps","child","container","Container","namedChild","unshift","content","indexOf","nearestContainer","GetComponent","contentContainer","globalPath","ownPath","minPathLength","Math","min","lastSharedPathCompIndex","ownComp","numUpwardsMoves","componentCount","newPathComps","up","ToParent","down","globalPathStr","relativePathStr","PathByAppendingPath","ConvertPathToRelative","ancestor","prop","StringBuilder","string","Append","format","_len","args","_key","replace","match","num","InkListItem","originName","itemName","nameParts","fullName","otherItem","JSON","stringify","parse","isLikeInkListItem","Null","inkListItem","item","hasOwnProperty","InkList","_Map","_this","_arguments","call","origins","_originNames","otherList","otherOriginNames","originNames","singleOriginListName","originStory","SetInitialOriginName","listDefinitions","_possibleConstructorReturn","def","TryListGetDefinition","exists","result","singleElement","Add","Key","Value","itemOrItemName","AddItem","origin","intVal","TryGetValueForItem","foundListDef","_step2","_iterator2","ContainsItemWithName","itemVal","ValueForItem","_step3","_iterator3","_slicedToArray","fromSerializedKey","has","serialized","serializedKey","delete","size","maxOriginName","maxItem","every","Count","_step4","_iterator4","initialOriginName","initialOriginNames","_step5","max","_iterator5","_step5$value","isNull","_step6","_iterator6","_step6$value","list","_step7","_iterator7","_step8","_iterator8","items","_step8$value","ContainsKey","_step9","_iterator9","_step10","_iterator10","_step10$value","_step11","union","_iterator11","_step11$value","_step12","intersection","_iterator12","_step12$value","_step13","_iterator13","listToRemove","_step14","_iterator14","what","ContainsItemNamed","_step15","_iterator15","minItem","minBound","maxBound","ordered","orderedItems","minValue","maxValue","Number","MAX_SAFE_INTEGER","isInteger","subList","SetInitialOriginNames","_step16","_iterator16","otherInkList","_step17","_iterator17","_step18","_iterator18","_step18$value","sort","x","y","localeCompare","sb","NaN","myListItem","listValue","_a","FindSingleItemListWithName","Map","StoryException","useEndLineNumber","tryGetValueFromMap","map","val","AbstractValue","ValueType","_InkObject","Create","valueObject","targetType","valueType","preferredNumberType","Int","IntValue","Float","isNaN","FloatValue","BoolValue","Boolean","StringValue","String","DivertTargetValue","ListValue","_AbstractValue","_super2","_Value","_super3","Bool","newType","BadCastException","_Value2","_super4","_Value3","_super5","_Value4","_super6","_this2","_isNewline","_isInlineWhitespace","isNewline","isInlineWhitespace","parsedInt","defaultValue","tryParseInt","parsedFloat","parseFloat","tryParseFloat","_Value5","_super7","targetPath","DivertTarget","VariablePointerValue","_Value6","_super8","variableName","_this3","contextIndex","undefined","_contextIndex","VariablePointer","_Value7","_super9","listOrSingleItem","singleValue","_this4","List","oldValue","newValue","oldList","newList","SearchResult","approximate","searchResult","_content","namedContent","visitsShouldBeCounted","turnIndexShouldBeCounted","countingAtStartOnly","_pathToFirstLeafContent","AddContent","namedOnlyContentDict","_step$value","inkObject","named","existingNamedOnly","namedOnlyContent","AddToNamedContentOnly","flags","CountFlags","Visits","Turns","CountStartOnly","flag","internalPathToFirstLeafContent","components","contentObjOrList","contentObj","TryAddNamedContent","namedContentObj","partialPathStart","partialPathLength","currentContainer","currentObj","comp","foundObj","ContentWithPathComponent","splice","otherContainer","_this$content","component","foundContent","BuildStringOfHierarchy","indentation","pointedObj","appendIndentation","AppendFormat","AppendLine","onlyNamed","_step7$value","Glue","PushPopType","ControlCommand","commandType","CommandType","NotSet","_commandType","EvalStart","EvalOutput","EvalEnd","Duplicate","PopEvaluatedValue","PopFunction","PopTunnel","BeginString","EndString","NoOp","ChoiceCount","TurnsSince","ReadCount","Random","SeedRandom","VisitIndex","SequenceShuffleIndex","StartThread","Done","End","ListFromInt","ListRange","ListRandom","BeginTag","EndTag","Pointer","PathByAppendingComponent","Divert","stackPushType","_targetPath","_targetPointer","variableDivertName","pushesToStack","isExternal","externalArgs","isConditional","targetObj","targetPointer","Resolve","ResolvePath","lastComponent","StartOf","copy","CompactPathString","otherDivert","hasVariableTarget","targetStr","Function","targetPathString","ChoicePoint","onceOnly","_pathOnChoice","hasCondition","hasStartContent","hasChoiceOnlyContent","isInvisibleDefault","choiceTargetObj","choiceTarget","pathOnChoice","VariableReference","pathForCount","pathStringForCount","VariableAssignment","isNewDeclaration","isGlobal","Void","NativeFunctionCall","_name","_numberOfParameters","_prototype","_isPrototype","_operationFuncs","GenerateNativeFunctionsIfNecessary","numberOfParameters","_nativeFunctions","parameters","Call","hasList","CallBinaryListOperation","coercedParams","CoerceValuesToSingleType","coercedType","CallType","parametersOfSingleType","param1","valType","val1","paramCount","opForTypeObj","val2","opForType","resultVal","CallListIncrementOperation","v1","v2","op","asBooleanOrThrows","isTruthy","listIntParams","listVal","resultInkList","_step2$value","listItemKey","listItemValue","listItem","intOp","targetInt","itemOrigin","incrementedItem","TryGetItemWithValue","parametersIn","specialCaseList","parametersOut","originOfMaxItem","castedValue","Cast","functionName","t","AddIntBinaryOp","Subtract","Multiply","Divide","floor","Mod","AddIntUnaryOp","Negate","Equal","Greater","Less","GreaterThanOrEquals","LessThanOrEquals","NotEquals","Not","And","Or","Max","Min","Pow","pow","Floor","Identity","Ceiling","AddFloatBinaryOp","AddFloatUnaryOp","ceil","AddStringBinaryOp","Has","includes","Hasnt","AddListBinaryOp","Union","Without","Contains","Intersect","GreaterThan","LessThan","AddListUnaryOp","Invert","inverse","All","all","ListMin","MinAsList","ListMax","MaxAsList","ValueOfList","AddOpToNativeFunc","d1","d2","nativeFunc","AddOpFuncForType","Tag","tagText","text","Choice","threadAtGeneration","sourcePath","tags","originalThreadIndex","ListDefinition","_items","_itemNameToValues","ListDefinitionsOrigin","lists","_lists","_allUnambiguousListValueCache","listOfLists","definition","JsonSerialisation","jArray","skipLast","count","jTok","runtimeObj","JTokenToRuntimeObject","writer","dictionary","WriteObjectStart","WritePropertyStart","WriteRuntimeObject","WritePropertyEnd","WriteObjectEnd","WriteArrayStart","WriteArrayEnd","dict","_step3$value","WriteIntProperty","WriteRuntimeContainer","divert","divTypeKey","Tunnel","WriteProperty","choicePoint","pathStringOnChoice","boolVal","WriteBool","WriteInt","floatVal","WriteFloat","strVal","Write","WriteStringStart","WriteStringInner","WriteStringEnd","WriteInkList","divTargetVal","varPtrVal","controlCmd","_controlCommandNames","varRef","readCountPath","varAss","tag","choice","WriteChoice","jObject","token","firstChar","CallExistsWithName","CallWithName","isArray","propValue","varPtr","isDivert","divPushType","external","target","readCountVarRef","isVarAss","isGlobalVar","varName","isNewDecl","listContent","rawList","namesAsObjs","nameToVal","JObjectToChoice","JArrayToContainer","toJson","me","removes","space","k","v","some","r","withoutName","countFlags","hasNameProperty","hasTerminator","namedContainer","WriteNull","JArrayToRuntimeObjList","terminatingObj","namedContentItem","namedSubContainer","jObj","WritePropertyNameStart","WritePropertyNameInner","WritePropertyNameEnd","listDefJson","_step9$value","defsObj","allDefs","nameValueKey","nameValue","TOTAL_VALUES","CallStack","_threadCounter","_startOfRoot","Story","storyContext","Reset","toCopy","_threads","otherThread","Copy","callStack","elements","cs","callstack","Thread","Element","jThreadObj","thread","w","WriteObject","WriteJson","newThread","currentThread","threadIndex","forkedThread","canPopThread","elementIsEvaluateFromGame","currentElement","FunctionEvaluationFromGame","externalEvaluationStackHeight","outputStreamLengthWithPushed","element","currentPointer","evaluationStackHeightWhenPushed","functionStartInOutputStream","canPop","CanPop","pop","currentElementIndex","varValue","temporaryVariables","declareNew","contextElement","RetainListOriginsForAssignment","filtered","filter","isCurrent","pointer","inExpressionEvaluation","previousPointer","jElementObj","pushPopType","currentContainerPathStr","currentContainerPathStrToken","threadPointerResult","Warning","el","temps","JObjectToDictionaryRuntimeObjs","clear","prevContentObjPath","prevPath","PointerAtPath","WriteDictionaryRuntimeObjs","resolvedPointer","VariablesState","_VariablesStateAccess","listDefsOrigin","variableChangedEventCallbacks","patch","_batchObservingVariableChanges","_defaultGlobalVariables","_changedVariablesForBatchObs","Set","_globalVariables","_callStack","_listDefsOrigin","Proxy","_assertThisInitialized","$","callback","currentValue","variableChangedEvent","varContents","TryGetGlobal","SetGlobal","globals","namedVarKey","namedVarValue","changedVariables","add","jToken","varValKey","varValValue","loadedToken","tokenInkObject","keyValKey","keyValValue","dontSaveDefaultValues","defaultVal","RuntimeObjectsEqual","obj1","obj2","constructor","GetRawVariableWithName","varPointer","ValueAtVariablePointer","variableValue","GetTemporaryVariableWithName","GetVariableWithName","setGlobal","GlobalVariableExistsWithName","ResolveVariablePointer","existingPointer","SetTemporaryVariable","batchObservingVariableChanges","AddChangedVariable","GetContextIndexOfVariableNamed","doubleRedirectionPointer","_class","PRNG","seed","next","StatePatch","_changedVariables","_visitCounts","_turnIndices","_globals","SimpleJson","Reader","ToDictionary","ToArray","_rootObject","Writer","_currentPropertyName","_currentString","_stateStack","_collectionStack","_propertyNameStack","_jsonObject","inner","StartNewObject","newObject","state","State","Property","currentCollection","currentPropertyName","propertyName","None","StateElement","Object","innerOrContent","IncrementChildCount","childCount","PropertyName","_addToCurrentObject","error","POSITIVE_INFINITY","NEGATIVE_INFINITY","currEl","ErrorType","OutputStateChange","Flow","story","SetJsonToken","outputStream","currentChoices","jChoiceThreadsObj","LoadFlowChoiceThreads","WriteListRuntimeObjs","hasChoiceThreads","ThreadWithIndex","jChoiceThreads","foundActiveThread","jSavedChoiceThread","StoryState","kInkSaveStateVersion","kMinCompatibleLoadVersion","onDidLoadState","_currentErrors","_currentWarnings","divertedPointer","_currentTurnIndex","storySeed","previousRandom","didSafeExit","_currentText","_currentTags","_outputStreamTextDirty","_outputStreamTagsDirty","_patch","_aliveFlowNames","_namedFlows","kDefaultFlowName","_aliveFlowNamesDirty","_currentFlow","OutputStreamDirty","_evaluationStack","_variablesState","currentTurnIndex","timeSeed","Date","getTime","GoToStart","indented","ToJson","json","TextToDictionary","LoadJsonObj","pathString","visitCountOut","TryGetVisitCount","containerPathStr","count2","currCount","VisitCountForContainer","SetVisitCount","SetTurnIndex","TryGetTurnIndex","index2","depth","canContinue","hasError","currentErrors","currentWarnings","inTag","outputObj","textContent","controlCommand","CleanOutputWhitespace","currentWhitespaceStart","startOfLine","charAt","Length","txt","Clear","keys","flowName","mainContentContainer","flow","variablesState","SwitchFlow_Internal","SwitchToDefaultFlow_Internal","_copy$_currentFlow$cu","_copy$_currentFlow$ou","_copy$evaluationStack","_copy$_currentErrors","_copy$_currentWarning","_step4$value","namedFlowKey","namedFlowValue","hasWarning","evaluationStack","ApplyPatch","visitCounts","ApplyCountChanges","turnIndices","newCount","isVisit","_loop","WriteIntDictionary","inkVersionCurrent","jSaveVersion","flowsObj","flowsObjDict","_i","_flowsObjDictEntries","entries","_flowsObjDictEntries$","flowObj","currFlowName","currentDivertTargetPath","divertPath","JObjectToIntDictionary","_this$outputStream","objs","listText","TrySplittingHeadTailWhitespace","textObj","PushToOutputStreamIndividual","single","headFirstNewlineIdx","headLastNewlineIdx","tailLastNewlineIdx","tailFirstNewlineIdx","listTexts","innerStrStart","innerStrEnd","leadingSpaces","innerStrText","numSpaces","trailingSpaces","glue","includeInOutput","TrimNewlinesFromOutputStream","functionTrimIndex","glueTrimIndex","o","isNonWhitespace","RemoveExistingGlue","callStackElements","outputStreamEndsInNewline","outputStreamContainsContent","removeWhitespaceFrom","cmd","numberOfObjects","functionStartPoint","popType","TrimWhitespaceFromFunctionEnd","Pop","incrementingTurnIndex","newPointer","funcContainer","Push","PassArgumentsToEvaluationStack","PushEvaluationStack","callStackTrace","originalEvaluationStackHeight","returnedObj","poppedObj","PopEvaluationStack","PopCallStack","returnVal","isWarning","Stopwatch","startTime","nVal","isFinite","exports","inkVersionMinimumCompatible","onError","onDidContinue","onMakeChoice","onEvaluateFunction","onCompleteEvaluateFunction","onChoosePathString","_prevContainers","allowExternalFunctionFallbacks","_listDefinitions","_variableObservers","_hasValidatedExternals","_temporaryEvaluationContainer","_asyncContinueActive","_stateSnapshotAtLastNewline","_sawLookaheadUnsafeFunctionAfterNewline","_recursiveContinueCount","_asyncSaving","_profiler","_mainContentContainer","jsonString","_externals","rootObject","versionObj","formatFromFile","listDefsObj","rootToken","JTokenToListDefinitions","ResetState","choices","_state","IfAsyncWeCant","currentText","currentTags","currentFlowName","currentFlowIsDefaultFlow","aliveFlowNames","shouldReturn","ObserveVariableChange","VariableStateDidChangeEvent","bind","ResetGlobals","ResetErrors","ForceEnd","originalPointer","ChoosePath","ContinueInternal","SnapshotDefaultGlobals","RemoveFlow_Internal","ContinueAsync","millisecsLimitAsync","ValidateExternalBindings","PreContinue","isAsyncTimeLimited","ResetOutput","durationStopwatch","Start","ContinueSingleStep","AddError","ElapsedMilliseconds","Stop","RestoreStateSnapshot","generatedChoices","PostContinue","PreStep","Step","PostStep","TryFollowDefaultInvisibleChoice","PreSnapshot","inStringEvaluation","change","CalculateNewlineOutputStateChange","ExtendedBeyondNewline","NewlineRemoved","DiscardSnapshot","StateSnapshot","PostSnapshot","prevText","currText","prevTagCount","currTagCount","newlineStillExists","NoChange","Continue","pathLengthToUse","CopyAndStartPatching","RestoreAfterPatch","ApplyAnyPatch","stateToSave","shouldAddToStream","containerToEnter","VisitContainer","currentContentObj","isLogicOrFlowControl","PerformLogicAndFlowControl","ProcessChoice","contextIdx","ContextForVariableNamed","PushToOutputStream","NextContent","PushThread","atStart","IncrementVisitCountForContainer","RecordTurnIndexVisitToContainer","prevAncestor","currentChildOfContainer","currentContainerAncestor","allChildrenEnteredAtStart","enteringAtStart","choiceOnlyStrVal","PeekEvaluationStack","showChoice","conditionValue","IsTruthy","startText","choiceOnlyText","PopChoiceStringAndTags","ForkThread","reverse","divTarget","currentDivert","intContent","errorMessage","CallExternalFunction","sourceName","evalCommand","output","overrideTunnelReturnTarget","popped","TryExitFunctionEvaluationFromGame","names","expected","errorMsg","contentStackForTag","outputCountConsumed","command","PopFromOutputStream","_contentStackForTag","choiceTag","contentStackForString","contentToRetain","_i3","_contentToRetain","rescuedTag","choiceCount","extraNote","eitherCount","divertTarget","correctObj","TurnsSinceForContainer","maxInt","minInt","randomRange","resultSeed","nextRandom","chosenValue","shuffleIndex","NextSequenceShuffleIndex","PopThread","listNameVal","generatedListValue","foundItem","targetList","ListWithSubRange","listItemIndex","listEnumerator","randomItem","assignedVal","Assign","foundValue","containerForCount","func","funcParams","resetCallstack","ResetCallstack","funcDetail","activityStr","SetChosenPath","VisitChangedContainersDueToDivert","choiceIdx","choiceToChoose","KnotContainerWithName","returnTextOutput","trim","outputStreamBefore","StartFunctionEvaluationFromGame","stringOutput","textOutput","CompleteFunctionEvaluationFromGame","returned","exprContainer","startCallStackHeight","evalStackHeight","funcName","numberOfArguments","funcDef","fallbackFunctionContainer","foundExternal","lookAheadSafe","valueObj","funcResult","function","returnObj","lookaheadSafe","BindExternalFunctionGeneral","coercedArgs","TryCoerce","missingExternals","from","innerContent","observer","variableNames","observers","ObserveVariable","specificVariableName","variableObservers","newValueObj","TagsAtStartOfFlowContainerWithPathString","flowContainer","firstContent","IncrementContentPointer","didPop","successfulIncrement","nextAncestor","indexInAncestor","allChoices","invisibleChoices","numElementsIntVal","seqContainer","numElements","seqCount","loopIndex","iterationIndex","seqPathStr","sequenceHash","charCodeAt","randomSeed","random","unpickedIndices","chosen","chosenIndex","currentDebugMetadata","errorType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AAS,EAAGI,GAAK,IAAKA,EAE/D,KADAssB,EAAU1tB,KAAK0zB,MAAMrI,UAAUC,SAASlqB,GAAGurB,gBAC9B/f,QAAgC,OAAtB8gB,EAAQxS,WAElB,QADXrV,EAAK6nB,EAAQxS,UAAW1V,eAEtB,OAAOK,EAKb,IAAK,IAAIzE,EAAIpB,KAAK0zB,MAAMuB,aAAaj0B,OAAS,EAAGI,GAAK,IAAKA,EAAG,CAG5D,GAAW,QADXyE,EADgB7F,KAAK0zB,MAAMuB,aAAa7zB,GACzBoE,eAEb,OAAOK,CAEV,CAED,OAAO,IACT,GAAC,CAAA/E,IAAA,uBAAAC,IAED,WACE,OAAIf,KAAKigC,8BACAjgC,KAAKigC,8BAELjgC,KAAKwgC,qBAEhB,KAAC1V,CAAA,EAn4EwB1lB,GACX0lB,EAAAA,MAAiBmQ,kBAAG,GAo6EnBnQ,GAAAA,EAAKA,QAALA,QAmBhB,CAAA,IAlBa+J,GAAA/J,GAAiB+J,oBAAjB/J,qBAIX,CAAA,IAHC+J,GAAA,SAAA,GAAA,WACAA,GAAAA,GAAA,sBAAA,GAAA,wBACAA,GAAAA,GAAA,eAAA,GAAA"} \ No newline at end of file +{"version":3,"file":"ink.js","sources":["../src/engine/Path.ts","../src/engine/Debug.ts","../src/engine/Value.ts","../src/engine/PushPop.ts","../src/engine/Error.ts","../src/engine/TypeAssertion.ts","../src/engine/NullException.ts","../src/engine/Object.ts","../src/engine/StringBuilder.ts","../src/engine/InkList.ts","../src/engine/StoryException.ts","../src/engine/TryGetResult.ts","../src/engine/SearchResult.ts","../src/engine/Container.ts","../src/engine/Glue.ts","../src/engine/ControlCommand.ts","../src/engine/Pointer.ts","../src/engine/Divert.ts","../src/engine/ChoicePoint.ts","../src/engine/VariableReference.ts","../src/engine/VariableAssignment.ts","../src/engine/Void.ts","../src/engine/NativeFunctionCall.ts","../src/engine/Tag.ts","../src/engine/Choice.ts","../src/engine/ListDefinition.ts","../src/engine/ListDefinitionsOrigin.ts","../src/engine/JsonSerialisation.ts","../src/engine/CallStack.ts","../src/engine/VariablesState.ts","../src/engine/PRNG.ts","../src/engine/StatePatch.ts","../src/engine/SimpleJson.ts","../src/engine/Flow.ts","../src/engine/StoryState.ts","../src/engine/StopWatch.ts","../src/engine/Story.ts"],"sourcesContent":["export class Path {\n public static parentId = \"^\";\n\n public _isRelative: boolean;\n public _components: Path.Component[];\n public _componentsString: string | null;\n\n constructor();\n constructor(componentsString: string);\n constructor(head: Path.Component, tail: Path);\n constructor(head: Path.Component[], relative?: boolean);\n constructor() {\n this._components = [];\n this._componentsString = null;\n this._isRelative = false;\n\n if (typeof arguments[0] == \"string\") {\n let componentsString = arguments[0] as string;\n this.componentsString = componentsString;\n } else if (\n arguments[0] instanceof Path.Component &&\n arguments[1] instanceof Path\n ) {\n let head = arguments[0] as Path.Component;\n let tail = arguments[1] as Path;\n this._components.push(head);\n this._components = this._components.concat(tail._components);\n } else if (arguments[0] instanceof Array) {\n let head = arguments[0] as Path.Component[];\n let relative = !!arguments[1] as boolean;\n this._components = this._components.concat(head);\n this._isRelative = relative;\n }\n }\n get isRelative() {\n return this._isRelative;\n }\n get componentCount(): number {\n return this._components.length;\n }\n get head(): Path.Component | null {\n if (this._components.length > 0) {\n return this._components[0];\n } else {\n return null;\n }\n }\n get tail(): Path {\n if (this._components.length >= 2) {\n // careful, the original code uses length-1 here. This is because the second argument of\n // List.GetRange is a number of elements to extract, wherease Array.slice uses an index\n let tailComps = this._components.slice(1, this._components.length);\n return new Path(tailComps);\n } else {\n return Path.self;\n }\n }\n get length(): number {\n return this._components.length;\n }\n get lastComponent(): Path.Component | null {\n let lastComponentIdx = this._components.length - 1;\n if (lastComponentIdx >= 0) {\n return this._components[lastComponentIdx];\n } else {\n return null;\n }\n }\n get containsNamedComponent(): boolean {\n for (let i = 0, l = this._components.length; i < l; i++) {\n if (!this._components[i].isIndex) {\n return true;\n }\n }\n return false;\n }\n static get self(): Path {\n let path = new Path();\n path._isRelative = true;\n return path;\n }\n\n public GetComponent(index: number): Path.Component {\n return this._components[index];\n }\n public PathByAppendingPath(pathToAppend: Path): Path {\n let p = new Path();\n\n let upwardMoves = 0;\n for (let i = 0; i < pathToAppend._components.length; ++i) {\n if (pathToAppend._components[i].isParent) {\n upwardMoves++;\n } else {\n break;\n }\n }\n\n for (let i = 0; i < this._components.length - upwardMoves; ++i) {\n p._components.push(this._components[i]);\n }\n\n for (let i = upwardMoves; i < pathToAppend._components.length; ++i) {\n p._components.push(pathToAppend._components[i]);\n }\n\n return p;\n }\n get componentsString(): string {\n if (this._componentsString == null) {\n this._componentsString = this._components.join(\".\");\n if (this.isRelative)\n this._componentsString = \".\" + this._componentsString;\n }\n\n return this._componentsString;\n }\n set componentsString(value: string) {\n this._components.length = 0;\n\n this._componentsString = value;\n\n if (this._componentsString == null || this._componentsString == \"\") return;\n\n if (this._componentsString[0] == \".\") {\n this._isRelative = true;\n this._componentsString = this._componentsString.substring(1);\n }\n\n let componentStrings = this._componentsString.split(\".\");\n for (let str of componentStrings) {\n // we need to distinguish between named components that start with a number, eg \"42somewhere\", and indexed components\n // the normal parseInt won't do for the detection because it's too relaxed.\n // see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt\n if (/^(\\-|\\+)?([0-9]+|Infinity)$/.test(str)) {\n this._components.push(new Path.Component(parseInt(str)));\n } else {\n this._components.push(new Path.Component(str));\n }\n }\n }\n public toString(): string {\n return this.componentsString;\n }\n public Equals(otherPath: Path | null): boolean {\n if (otherPath == null) return false;\n\n if (otherPath._components.length != this._components.length) return false;\n\n if (otherPath.isRelative != this.isRelative) return false;\n\n // the original code uses SequenceEqual here, so we need to iterate over the components manually.\n for (let i = 0, l = otherPath._components.length; i < l; i++) {\n // it's not quite clear whether this test should use Equals or a simple == operator,\n // see https://github.com/y-lohse/inkjs/issues/22\n if (!otherPath._components[i].Equals(this._components[i])) return false;\n }\n\n return true;\n }\n public PathByAppendingComponent(c: Path.Component): Path {\n let p = new Path();\n p._components.push(...this._components);\n p._components.push(c);\n return p;\n }\n}\n\nexport namespace Path {\n export class Component {\n public readonly index: number;\n public readonly name: string | null;\n\n constructor(indexOrName: string | number) {\n this.index = -1;\n this.name = null;\n if (typeof indexOrName == \"string\") {\n this.name = indexOrName;\n } else {\n this.index = indexOrName;\n }\n }\n get isIndex(): boolean {\n return this.index >= 0;\n }\n get isParent(): boolean {\n return this.name == Path.parentId;\n }\n\n public static ToParent(): Component {\n return new Component(Path.parentId);\n }\n public toString(): string | null {\n if (this.isIndex) {\n return this.index.toString();\n } else {\n return this.name;\n }\n }\n public Equals(otherComp: Component): boolean {\n if (otherComp != null && otherComp.isIndex == this.isIndex) {\n if (this.isIndex) {\n return this.index == otherComp.index;\n } else {\n return this.name == otherComp.name;\n }\n }\n\n return false;\n }\n }\n}\n","export namespace Debug {\n export function AssertType(\n variable: any,\n type: new () => T,\n message: string\n ): void | never {\n Assert(variable instanceof type, message);\n }\n\n export function Assert(condition: boolean, message?: string): void | never {\n if (!condition) {\n if (typeof message !== \"undefined\") {\n console.warn(message);\n }\n\n if (console.trace) {\n console.trace();\n }\n\n throw new Error(\"\");\n }\n }\n}\n","import { InkObject } from \"./Object\";\nimport { Path } from \"./Path\";\nimport { InkList, InkListItem } from \"./InkList\";\nimport { StoryException } from \"./StoryException\";\nimport { asOrNull, asOrThrows } from \"./TypeAssertion\";\nimport { tryParseInt, tryParseFloat } from \"./TryGetResult\";\nimport { throwNullException } from \"./NullException\";\n\nexport abstract class AbstractValue extends InkObject {\n public abstract get valueType(): ValueType;\n public abstract get isTruthy(): boolean;\n public abstract get valueObject(): any;\n\n public abstract Cast(newType: ValueType): Value;\n\n public static Create(\n val: any,\n preferredNumberType?: ValueType\n ): Value | null {\n // This code doesn't exist in upstream and is simply here to enforce\n // the creation of the proper number value.\n // If `preferredNumberType` is not provided or if value doesn't match\n // `preferredNumberType`, this conditional does nothing.\n if (preferredNumberType) {\n if (\n preferredNumberType === (ValueType.Int as ValueType) &&\n Number.isInteger(Number(val))\n ) {\n return new IntValue(Number(val));\n } else if (\n preferredNumberType === (ValueType.Float as ValueType) &&\n !isNaN(val)\n ) {\n return new FloatValue(Number(val));\n }\n }\n\n if (typeof val === \"boolean\") {\n return new BoolValue(Boolean(val));\n }\n\n // https://github.com/y-lohse/inkjs/issues/425\n // Changed condition sequence, because Number('') is\n // parsed to 0, which made setting string to empty\n // impossible\n if (typeof val === \"string\") {\n return new StringValue(String(val));\n } else if (Number.isInteger(Number(val))) {\n return new IntValue(Number(val));\n } else if (!isNaN(val)) {\n return new FloatValue(Number(val));\n } else if (val instanceof Path) {\n return new DivertTargetValue(asOrThrows(val, Path));\n } else if (val instanceof InkList) {\n return new ListValue(asOrThrows(val, InkList));\n }\n\n return null;\n }\n public Copy() {\n return asOrThrows(AbstractValue.Create(this.valueObject), InkObject);\n }\n public BadCastException(targetType: ValueType) {\n return new StoryException(\n \"Can't cast \" +\n this.valueObject +\n \" from \" +\n this.valueType +\n \" to \" +\n targetType\n );\n }\n}\n\nexport abstract class Value<\n T extends { toString: () => string }\n> extends AbstractValue {\n public value: T | null;\n\n constructor(val: T | null) {\n super();\n this.value = val;\n }\n public get valueObject() {\n return this.value;\n }\n public toString() {\n if (this.value === null) return throwNullException(\"Value.value\");\n return this.value.toString();\n }\n}\n\nexport class BoolValue extends Value {\n constructor(val: boolean) {\n super(val || false);\n }\n public get isTruthy() {\n return Boolean(this.value);\n }\n public get valueType() {\n return ValueType.Bool;\n }\n\n public Cast(newType: ValueType): Value {\n if (this.value === null) return throwNullException(\"Value.value\");\n\n if (newType == this.valueType) {\n return this;\n }\n\n if (newType == ValueType.Int) {\n return new IntValue(this.value ? 1 : 0);\n }\n\n if (newType == ValueType.Float) {\n return new FloatValue(this.value ? 1.0 : 0.0);\n }\n\n if (newType == ValueType.String) {\n return new StringValue(this.value ? \"true\" : \"false\");\n }\n\n throw this.BadCastException(newType);\n }\n\n public toString() {\n return this.value ? \"true\" : \"false\";\n }\n}\n\nexport class IntValue extends Value {\n constructor(val: number) {\n super(val || 0);\n }\n public get isTruthy() {\n return this.value != 0;\n }\n public get valueType() {\n return ValueType.Int;\n }\n\n public Cast(newType: ValueType): Value {\n if (this.value === null) return throwNullException(\"Value.value\");\n\n if (newType == this.valueType) {\n return this;\n }\n\n if (newType == ValueType.Bool) {\n return new BoolValue(this.value === 0 ? false : true);\n }\n\n if (newType == ValueType.Float) {\n return new FloatValue(this.value);\n }\n\n if (newType == ValueType.String) {\n return new StringValue(\"\" + this.value);\n }\n\n throw this.BadCastException(newType);\n }\n}\n\nexport class FloatValue extends Value {\n constructor(val: number) {\n super(val || 0.0);\n }\n public get isTruthy() {\n return this.value != 0.0;\n }\n public get valueType() {\n return ValueType.Float;\n }\n\n public Cast(newType: ValueType): Value {\n if (this.value === null) return throwNullException(\"Value.value\");\n\n if (newType == this.valueType) {\n return this;\n }\n\n if (newType == ValueType.Bool) {\n return new BoolValue(this.value === 0.0 ? false : true);\n }\n\n if (newType == ValueType.Int) {\n return new IntValue(this.value);\n }\n\n if (newType == ValueType.String) {\n return new StringValue(\"\" + this.value);\n }\n\n throw this.BadCastException(newType);\n }\n}\n\nexport class StringValue extends Value {\n public _isNewline: boolean;\n public _isInlineWhitespace: boolean;\n\n constructor(val: string) {\n super(val || \"\");\n\n this._isNewline = this.value == \"\\n\";\n this._isInlineWhitespace = true;\n\n if (this.value === null) return throwNullException(\"Value.value\");\n\n if (this.value.length > 0) {\n this.value.split(\"\").every((c) => {\n if (c != \" \" && c != \"\\t\") {\n this._isInlineWhitespace = false;\n return false;\n }\n\n return true;\n });\n }\n }\n public get valueType() {\n return ValueType.String;\n }\n public get isTruthy() {\n if (this.value === null) return throwNullException(\"Value.value\");\n return this.value.length > 0;\n }\n public get isNewline() {\n return this._isNewline;\n }\n public get isInlineWhitespace() {\n return this._isInlineWhitespace;\n }\n public get isNonWhitespace() {\n return !this.isNewline && !this.isInlineWhitespace;\n }\n\n public Cast(newType: ValueType): Value {\n if (newType == this.valueType) {\n return this;\n }\n\n if (newType == ValueType.Int) {\n let parsedInt = tryParseInt(this.value);\n if (parsedInt.exists) {\n return new IntValue(parsedInt.result);\n } else {\n throw this.BadCastException(newType);\n }\n }\n\n if (newType == ValueType.Float) {\n let parsedFloat = tryParseFloat(this.value);\n if (parsedFloat.exists) {\n return new FloatValue(parsedFloat.result);\n } else {\n throw this.BadCastException(newType);\n }\n }\n\n throw this.BadCastException(newType);\n }\n}\n\nexport class DivertTargetValue extends Value {\n constructor(targetPath: Path | null = null) {\n super(targetPath);\n }\n public get valueType() {\n return ValueType.DivertTarget;\n }\n public get targetPath() {\n if (this.value === null) return throwNullException(\"Value.value\");\n return this.value;\n }\n public set targetPath(value: Path) {\n this.value = value;\n }\n public get isTruthy(): never {\n throw new Error(\"Shouldn't be checking the truthiness of a divert target\");\n }\n\n public Cast(newType: ValueType): Value {\n if (newType == this.valueType) return this;\n\n throw this.BadCastException(newType);\n }\n public toString() {\n return \"DivertTargetValue(\" + this.targetPath + \")\";\n }\n}\n\nexport class VariablePointerValue extends Value {\n public _contextIndex: number;\n\n constructor(variableName: string, contextIndex: number = -1) {\n super(variableName);\n\n this._contextIndex = contextIndex;\n }\n\n public get contextIndex() {\n return this._contextIndex;\n }\n public set contextIndex(value: number) {\n this._contextIndex = value;\n }\n public get variableName() {\n if (this.value === null) return throwNullException(\"Value.value\");\n return this.value;\n }\n public set variableName(value: string) {\n this.value = value;\n }\n public get valueType() {\n return ValueType.VariablePointer;\n }\n\n public get isTruthy(): never {\n throw new Error(\n \"Shouldn't be checking the truthiness of a variable pointer\"\n );\n }\n\n public Cast(newType: ValueType): Value {\n if (newType == this.valueType) return this;\n\n throw this.BadCastException(newType);\n }\n public toString() {\n return \"VariablePointerValue(\" + this.variableName + \")\";\n }\n public Copy() {\n return new VariablePointerValue(this.variableName, this.contextIndex);\n }\n}\n\nexport class ListValue extends Value {\n public get isTruthy() {\n if (this.value === null) {\n return throwNullException(\"this.value\");\n }\n return this.value.Count > 0;\n }\n public get valueType() {\n return ValueType.List;\n }\n public Cast(newType: ValueType): Value {\n if (this.value === null) return throwNullException(\"Value.value\");\n\n if (newType == ValueType.Int) {\n let max = this.value.maxItem;\n if (max.Key.isNull) return new IntValue(0);\n else return new IntValue(max.Value);\n } else if (newType == ValueType.Float) {\n let max = this.value.maxItem;\n if (max.Key.isNull) return new FloatValue(0.0);\n else return new FloatValue(max.Value);\n } else if (newType == ValueType.String) {\n let max = this.value.maxItem;\n if (max.Key.isNull) return new StringValue(\"\");\n else {\n return new StringValue(max.Key.toString());\n }\n }\n\n if (newType == this.valueType) return this;\n\n throw this.BadCastException(newType);\n }\n constructor();\n constructor(list: InkList);\n constructor(listOrSingleItem: InkListItem, singleValue: number);\n constructor(listOrSingleItem?: InkListItem | InkList, singleValue?: number) {\n super(null);\n\n if (!listOrSingleItem && !singleValue) {\n this.value = new InkList();\n } else if (listOrSingleItem instanceof InkList) {\n this.value = new InkList(listOrSingleItem);\n } else if (\n listOrSingleItem instanceof InkListItem &&\n typeof singleValue === \"number\"\n ) {\n this.value = new InkList({\n Key: listOrSingleItem,\n Value: singleValue,\n });\n }\n }\n public static RetainListOriginsForAssignment(\n oldValue: InkObject | null,\n newValue: InkObject\n ) {\n let oldList = asOrNull(oldValue, ListValue);\n let newList = asOrNull(newValue, ListValue);\n\n if (newList && newList.value === null)\n return throwNullException(\"newList.value\");\n if (oldList && oldList.value === null)\n return throwNullException(\"oldList.value\");\n\n // When assigning the empty list, try to retain any initial origin names\n if (oldList && newList && newList.value!.Count == 0)\n newList.value!.SetInitialOriginNames(oldList.value!.originNames);\n }\n}\n\nexport enum ValueType {\n Bool = -1,\n Int = 0,\n Float = 1,\n List = 2,\n String = 3,\n DivertTarget = 4,\n VariablePointer = 5,\n}\n","export enum PushPopType {\n Tunnel = 0,\n Function = 1,\n FunctionEvaluationFromGame = 2,\n}\n","// TODO: Unify with Compiler.\n\nexport type ErrorHandler = (message: string, type: ErrorType) => void;\n\nexport enum ErrorType {\n Author,\n Warning,\n Error,\n}\n","import { INamedContent } from \"./INamedContent\";\n\nexport function asOrNull(\n obj: any,\n type: (new (...arg: any[]) => T) | (Function & { prototype: T })\n): T | null {\n if (obj instanceof type) {\n return unsafeTypeAssertion(obj, type);\n } else {\n return null;\n }\n}\n\nexport function asOrThrows(\n obj: any,\n type: (new (...arg: any[]) => T) | (Function & { prototype: T })\n): T | never {\n if (obj instanceof type) {\n return unsafeTypeAssertion(obj, type);\n } else {\n throw new Error(`${obj} is not of type ${type}`);\n }\n}\n\nexport function asNumberOrThrows(obj: any) {\n if (typeof obj === \"number\") {\n return obj as number;\n } else {\n throw new Error(`${obj} is not a number`);\n }\n}\n\nexport function asBooleanOrThrows(obj: any) {\n if (typeof obj === \"boolean\") {\n return obj as boolean;\n } else {\n throw new Error(`${obj} is not a boolean`);\n }\n}\n\n// So here, in the reference implementation, contentObj is casted to an INamedContent\n// but here we use js-style duck typing: if it implements the same props as the interface,\n// we treat it as valid.\nexport function asINamedContentOrNull(obj: any): INamedContent | null {\n if (obj.hasValidName && obj.name) {\n return obj as INamedContent;\n }\n\n return null;\n}\n\nexport function nullIfUndefined(obj: T | undefined): T | null {\n if (typeof obj === \"undefined\") {\n return null;\n }\n\n return obj;\n}\n\nexport function isEquatable(type: any) {\n return typeof type === \"object\" && typeof type.Equals === \"function\";\n}\n\nfunction unsafeTypeAssertion(\n obj: any,\n type: (new () => T) | (Function & { prototype: T })\n) {\n return obj as T;\n}\n\nexport function filterUndef(element: T | undefined): element is T {\n return element != undefined;\n}\n","/**\n * In the original C# code, a SystemException would be thrown when passing\n * null to methods expected a valid instance. Javascript has no such\n * concept, but TypeScript will not allow `null` to be passed to methods\n * explicitely requiring a valid type.\n *\n * Whenever TypeScript complain about the possibility of a `null` value,\n * check the offending value and it it's null, throw this exception using\n * `throwNullException(name: string)`.\n */\nexport class NullException extends Error {}\n\n/**\n * Throw a NullException.\n *\n * @param name a short description of the offending value (often its name within the code).\n */\nexport function throwNullException(name: string): never {\n throw new NullException(`${name} is null or undefined`);\n}\n","import { Path } from \"./Path\";\nimport { Container } from \"./Container\";\nimport { Debug } from \"./Debug\";\nimport { asOrNull, asINamedContentOrNull } from \"./TypeAssertion\";\nimport { throwNullException } from \"./NullException\";\nimport { SearchResult } from \"./SearchResult\";\nimport { DebugMetadata } from \"./DebugMetadata\";\n\nexport class InkObject {\n public parent: InkObject | null = null;\n\n get debugMetadata(): DebugMetadata | null {\n if (this._debugMetadata === null) {\n if (this.parent) {\n return this.parent.debugMetadata;\n }\n }\n\n return this._debugMetadata;\n }\n\n set debugMetadata(value) {\n this._debugMetadata = value;\n }\n\n get ownDebugMetadata() {\n return this._debugMetadata;\n }\n\n private _debugMetadata: DebugMetadata | null = null;\n\n public DebugLineNumberOfPath(path: Path) {\n if (path === null) return null;\n\n // Try to get a line number from debug metadata\n let root = this.rootContentContainer;\n if (root) {\n let targetContent = root.ContentAtPath(path).obj;\n if (targetContent) {\n let dm = targetContent.debugMetadata;\n if (dm !== null) {\n return dm.startLineNumber;\n }\n }\n }\n\n return null;\n }\n\n get path() {\n if (this._path == null) {\n if (this.parent == null) {\n this._path = new Path();\n } else {\n let comps: Path.Component[] = [];\n\n let child: InkObject = this;\n let container = asOrNull(child.parent, Container);\n\n while (container !== null) {\n let namedChild = asINamedContentOrNull(child);\n if (namedChild != null && namedChild.hasValidName) {\n if (namedChild.name === null)\n return throwNullException(\"namedChild.name\");\n comps.unshift(new Path.Component(namedChild.name!));\n } else {\n comps.unshift(new Path.Component(container.content.indexOf(child)));\n }\n\n child = container;\n container = asOrNull(container.parent, Container);\n }\n\n this._path = new Path(comps);\n }\n }\n\n return this._path;\n }\n private _path: Path | null = null;\n\n public ResolvePath(path: Path | null): SearchResult {\n if (path === null) return throwNullException(\"path\");\n if (path.isRelative) {\n let nearestContainer = asOrNull(this, Container);\n\n if (nearestContainer === null) {\n Debug.Assert(\n this.parent !== null,\n \"Can't resolve relative path because we don't have a parent\"\n );\n nearestContainer = asOrNull(this.parent, Container);\n Debug.Assert(\n nearestContainer !== null,\n \"Expected parent to be a container\"\n );\n Debug.Assert(path.GetComponent(0).isParent);\n path = path.tail;\n }\n\n if (nearestContainer === null) {\n return throwNullException(\"nearestContainer\");\n }\n return nearestContainer.ContentAtPath(path);\n } else {\n let contentContainer = this.rootContentContainer;\n if (contentContainer === null) {\n return throwNullException(\"contentContainer\");\n }\n return contentContainer.ContentAtPath(path);\n }\n }\n\n public ConvertPathToRelative(globalPath: Path) {\n let ownPath = this.path;\n\n let minPathLength = Math.min(globalPath.length, ownPath.length);\n let lastSharedPathCompIndex = -1;\n\n for (let i = 0; i < minPathLength; ++i) {\n let ownComp = ownPath.GetComponent(i);\n let otherComp = globalPath.GetComponent(i);\n\n if (ownComp.Equals(otherComp)) {\n lastSharedPathCompIndex = i;\n } else {\n break;\n }\n }\n\n // No shared path components, so just use global path\n if (lastSharedPathCompIndex == -1) return globalPath;\n\n let numUpwardsMoves = ownPath.componentCount - 1 - lastSharedPathCompIndex;\n\n let newPathComps: Path.Component[] = [];\n\n for (let up = 0; up < numUpwardsMoves; ++up)\n newPathComps.push(Path.Component.ToParent());\n\n for (\n let down = lastSharedPathCompIndex + 1;\n down < globalPath.componentCount;\n ++down\n )\n newPathComps.push(globalPath.GetComponent(down));\n\n let relativePath = new Path(newPathComps, true);\n return relativePath;\n }\n\n public CompactPathString(otherPath: Path) {\n let globalPathStr = null;\n let relativePathStr = null;\n\n if (otherPath.isRelative) {\n relativePathStr = otherPath.componentsString;\n globalPathStr = this.path.PathByAppendingPath(otherPath).componentsString;\n } else {\n let relativePath = this.ConvertPathToRelative(otherPath);\n relativePathStr = relativePath.componentsString;\n globalPathStr = otherPath.componentsString;\n }\n\n if (relativePathStr.length < globalPathStr.length) return relativePathStr;\n else return globalPathStr;\n }\n\n get rootContentContainer() {\n let ancestor: InkObject = this;\n while (ancestor.parent) {\n ancestor = ancestor.parent;\n }\n return asOrNull(ancestor, Container);\n }\n\n public Copy(): InkObject {\n throw Error(\"Not Implemented: Doesn't support copying\");\n }\n // SetChild works slightly diferently in the js implementation.\n // Since we can't pass an objets property by reference, we instead pass\n // the object and the property string.\n // TODO: This method can probably be rewritten with type-safety in mind.\n public SetChild(obj: any, prop: any, value: any) {\n if (obj[prop]) obj[prop] = null;\n\n obj[prop] = value;\n\n if (obj[prop]) obj[prop].parent = this;\n }\n\n public Equals(obj: any) {\n return obj === this;\n }\n}\n","export class StringBuilder {\n private string: string;\n\n constructor(str?: string) {\n str = typeof str !== \"undefined\" ? str.toString() : \"\";\n this.string = str;\n }\n get Length(): number {\n return this.string.length;\n }\n public Append(str: string | null) {\n if (str !== null) {\n this.string += str;\n }\n }\n public AppendLine(str?: string) {\n if (typeof str !== \"undefined\") this.Append(str);\n this.string += \"\\n\";\n }\n public AppendFormat(format: string, ...args: any[]) {\n // taken from http://stackoverflow.com/questions/610406/javascript-equivalent-to-printf-string-format\n this.string += format.replace(/{(\\d+)}/g, (match: string, num: number) =>\n typeof args[num] != \"undefined\" ? args[num] : match\n );\n }\n public toString(): string {\n return this.string;\n }\n\n public Clear() {\n this.string = \"\";\n }\n}\n","import { throwNullException } from \"./NullException\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { ListDefinition } from \"./ListDefinition\";\nimport { Story } from \"./Story\";\n\nexport class InkListItem implements IInkListItem {\n // InkListItem is a struct\n\n public readonly originName: string | null = null;\n public readonly itemName: string | null = null;\n\n constructor(originName: string | null, itemName: string | null);\n constructor(fullName: string | null);\n constructor() {\n if (typeof arguments[1] !== \"undefined\") {\n let originName = arguments[0] as string | null;\n let itemName = arguments[1] as string | null;\n\n this.originName = originName;\n this.itemName = itemName;\n } else if (arguments[0]) {\n let fullName = arguments[0] as string;\n\n let nameParts = fullName.toString().split(\".\");\n this.originName = nameParts[0];\n this.itemName = nameParts[1];\n }\n }\n public static get Null() {\n return new InkListItem(null, null);\n }\n public get isNull() {\n return this.originName == null && this.itemName == null;\n }\n get fullName() {\n return (\n (this.originName !== null ? this.originName : \"?\") + \".\" + this.itemName\n );\n }\n public toString(): string {\n return this.fullName;\n }\n public Equals(obj: InkListItem) {\n if (obj instanceof InkListItem) {\n let otherItem = obj;\n return (\n otherItem.itemName == this.itemName &&\n otherItem.originName == this.originName\n );\n }\n\n return false;\n }\n\n // These methods did not exist in the original C# code. Their purpose is to\n // make `InkListItem` mimics the value-type semantics of the original\n // struct. Please refer to the end of this file, for a more in-depth\n // explanation.\n\n /**\n * Returns a shallow clone of the current instance.\n */\n public copy() {\n return new InkListItem(this.originName, this.itemName);\n }\n /**\n * Returns a `SerializedInkListItem` representing the current\n * instance. The result is intended to be used as a key inside a Map.\n */\n public serialized(): SerializedInkListItem {\n // We are simply using a JSON representation as a value-typed key.\n return JSON.stringify({\n originName: this.originName,\n itemName: this.itemName,\n });\n }\n\n /**\n * Reconstructs a `InkListItem` from the given SerializedInkListItem.\n */\n public static fromSerializedKey(key: SerializedInkListItem): InkListItem {\n let obj = JSON.parse(key);\n if (!InkListItem.isLikeInkListItem(obj)) return InkListItem.Null;\n\n let inkListItem = obj as IInkListItem;\n\n return new InkListItem(inkListItem.originName, inkListItem.itemName);\n }\n\n /**\n * Determines whether the given item is sufficiently `InkListItem`-like\n * to be used as a template when reconstructing the InkListItem.\n */\n private static isLikeInkListItem(item: any) {\n if (typeof item !== \"object\") return false;\n if (!item.hasOwnProperty(\"originName\") || !item.hasOwnProperty(\"itemName\"))\n return false;\n if (typeof item.originName !== \"string\" && typeof item.originName !== null)\n return false;\n if (typeof item.itemName !== \"string\" && typeof item.itemName !== null)\n return false;\n\n return true;\n }\n}\n\nexport class InkList extends Map {\n public origins: ListDefinition[] | null = null;\n public _originNames: string[] | null = [];\n\n constructor();\n constructor(otherList: InkList);\n constructor(singleOriginListName: string, originStory: Story);\n constructor(singleElement: KeyValuePair);\n constructor() {\n // Trying to be smart here, this emulates the constructor inheritance found\n // in the original code, but only if otherList is an InkList. IIFE FTW.\n super(\n (() => {\n if (arguments[0] instanceof InkList) {\n return arguments[0];\n } else {\n return [];\n }\n })()\n );\n\n if (arguments[0] instanceof InkList) {\n let otherList = arguments[0] as InkList;\n\n let otherOriginNames = otherList.originNames as string[];\n if (otherOriginNames !== null)\n this._originNames = otherOriginNames.slice();\n if (otherList.origins !== null) {\n this.origins = otherList.origins.slice();\n }\n } else if (typeof arguments[0] === \"string\") {\n let singleOriginListName = arguments[0] as string;\n let originStory = arguments[1] as Story;\n this.SetInitialOriginName(singleOriginListName);\n\n if (originStory.listDefinitions === null) {\n return throwNullException(\"originStory.listDefinitions\");\n }\n let def = originStory.listDefinitions.TryListGetDefinition(\n singleOriginListName,\n null\n );\n if (def.exists) {\n // Throwing now, because if the value is `null` it will\n // eventually throw down the line.\n if (def.result === null) {\n return throwNullException(\"def.result\");\n }\n this.origins = [def.result];\n } else {\n throw new Error(\n \"InkList origin could not be found in story when constructing new list: \" +\n singleOriginListName\n );\n }\n } else if (\n typeof arguments[0] === \"object\" &&\n arguments[0].hasOwnProperty(\"Key\") &&\n arguments[0].hasOwnProperty(\"Value\")\n ) {\n let singleElement = arguments[0] as KeyValuePair;\n this.Add(singleElement.Key, singleElement.Value);\n }\n }\n\n public static FromString(myListItem: string, originStory: Story) {\n let listValue =\n originStory.listDefinitions?.FindSingleItemListWithName(myListItem);\n if (listValue) {\n if (listValue.value === null) {\n return throwNullException(\"listValue.value\");\n }\n return new InkList(listValue.value);\n } else {\n throw new Error(\n \"Could not find the InkListItem from the string '\" +\n myListItem +\n \"' to create an InkList because it doesn't exist in the original list definition in ink.\"\n );\n }\n }\n\n public AddItem(itemOrItemName: InkListItem | string | null) {\n if (itemOrItemName instanceof InkListItem) {\n let item = itemOrItemName;\n\n if (item.originName == null) {\n this.AddItem(item.itemName);\n return;\n }\n\n if (this.origins === null) return throwNullException(\"this.origins\");\n\n for (let origin of this.origins) {\n if (origin.name == item.originName) {\n let intVal = origin.TryGetValueForItem(item, 0);\n if (intVal.exists) {\n this.Add(item, intVal.result);\n return;\n } else {\n throw new Error(\n \"Could not add the item \" +\n item +\n \" to this list because it doesn't exist in the original list definition in ink.\"\n );\n }\n }\n }\n\n throw new Error(\n \"Failed to add item to list because the item was from a new list definition that wasn't previously known to this list. Only items from previously known lists can be used, so that the int value can be found.\"\n );\n } else {\n let itemName = itemOrItemName as string | null;\n\n let foundListDef: ListDefinition | null = null;\n\n if (this.origins === null) return throwNullException(\"this.origins\");\n\n for (let origin of this.origins) {\n if (itemName === null) return throwNullException(\"itemName\");\n\n if (origin.ContainsItemWithName(itemName)) {\n if (foundListDef != null) {\n throw new Error(\n \"Could not add the item \" +\n itemName +\n \" to this list because it could come from either \" +\n origin.name +\n \" or \" +\n foundListDef.name\n );\n } else {\n foundListDef = origin;\n }\n }\n }\n\n if (foundListDef == null)\n throw new Error(\n \"Could not add the item \" +\n itemName +\n \" to this list because it isn't known to any list definitions previously associated with this list.\"\n );\n\n let item = new InkListItem(foundListDef.name, itemName);\n let itemVal = foundListDef.ValueForItem(item);\n this.Add(item, itemVal);\n }\n }\n public ContainsItemNamed(itemName: string | null) {\n for (let [key] of this) {\n let item = InkListItem.fromSerializedKey(key);\n if (item.itemName == itemName) return true;\n }\n\n return false;\n }\n public ContainsKey(key: InkListItem) {\n return this.has(key.serialized());\n }\n public Add(key: InkListItem, value: number) {\n let serializedKey = key.serialized();\n if (this.has(serializedKey)) {\n // Throw an exception to match the C# behavior.\n throw new Error(`The Map already contains an entry for ${key}`);\n }\n this.set(serializedKey, value);\n }\n public Remove(key: InkListItem) {\n return this.delete(key.serialized());\n }\n get Count() {\n return this.size;\n }\n get originOfMaxItem(): ListDefinition | null {\n if (this.origins == null) return null;\n\n let maxOriginName = this.maxItem.Key.originName;\n let result = null;\n this.origins.every((origin) => {\n if (origin.name == maxOriginName) {\n result = origin;\n return false;\n } else return true;\n });\n\n return result;\n }\n get originNames(): string[] {\n if (this.Count > 0) {\n if (this._originNames == null && this.Count > 0) this._originNames = [];\n else {\n if (!this._originNames) this._originNames = [];\n this._originNames.length = 0;\n }\n\n for (let [key] of this) {\n let item = InkListItem.fromSerializedKey(key);\n if (item.originName === null)\n return throwNullException(\"item.originName\");\n this._originNames.push(item.originName);\n }\n }\n\n return this._originNames as string[];\n }\n public SetInitialOriginName(initialOriginName: string) {\n this._originNames = [initialOriginName];\n }\n public SetInitialOriginNames(initialOriginNames: string[]) {\n if (initialOriginNames == null) this._originNames = null;\n else this._originNames = initialOriginNames.slice(); // store a copy\n }\n get maxItem() {\n let max: KeyValuePair = {\n Key: InkListItem.Null,\n Value: 0,\n };\n for (let [key, value] of this) {\n let item = InkListItem.fromSerializedKey(key);\n if (max.Key.isNull || value > max.Value)\n max = { Key: item, Value: value };\n }\n\n return max;\n }\n get minItem() {\n let min: KeyValuePair = {\n Key: InkListItem.Null,\n Value: 0,\n };\n for (let [key, value] of this) {\n let item = InkListItem.fromSerializedKey(key);\n if (min.Key.isNull || value < min.Value) {\n min = { Key: item, Value: value };\n }\n }\n return min;\n }\n get inverse() {\n let list = new InkList();\n if (this.origins != null) {\n for (let origin of this.origins) {\n for (let [key, value] of origin.items) {\n let item = InkListItem.fromSerializedKey(key);\n if (!this.ContainsKey(item)) list.Add(item, value);\n }\n }\n }\n return list;\n }\n get all() {\n let list = new InkList();\n if (this.origins != null) {\n for (let origin of this.origins) {\n for (let [key, value] of origin.items) {\n let item = InkListItem.fromSerializedKey(key);\n list.set(item.serialized(), value);\n }\n }\n }\n return list;\n }\n public Union(otherList: InkList) {\n let union = new InkList(this);\n for (let [key, value] of otherList) {\n union.set(key, value);\n }\n return union;\n }\n public Intersect(otherList: InkList) {\n let intersection = new InkList();\n for (let [key, value] of this) {\n if (otherList.has(key)) intersection.set(key, value);\n }\n\n return intersection;\n }\n public HasIntersection(otherList: InkList): boolean {\n for (let [key] of this) {\n if (otherList.has(key)) return true;\n }\n return false;\n }\n public Without(listToRemove: InkList) {\n let result = new InkList(this);\n for (let [key] of listToRemove) {\n result.delete(key);\n }\n\n return result;\n }\n\n public Contains(key: string): boolean;\n public Contains(otherList: InkList): boolean;\n public Contains(what: string | InkList): boolean {\n if (typeof what == \"string\") return this.ContainsItemNamed(what);\n const otherList = what;\n if (otherList.size == 0 || this.size == 0) return false;\n for (let [key] of otherList) {\n if (!this.has(key)) return false;\n }\n\n return true;\n }\n public GreaterThan(otherList: InkList) {\n if (this.Count == 0) return false;\n if (otherList.Count == 0) return true;\n\n return this.minItem.Value > otherList.maxItem.Value;\n }\n public GreaterThanOrEquals(otherList: InkList) {\n if (this.Count == 0) return false;\n if (otherList.Count == 0) return true;\n\n return (\n this.minItem.Value >= otherList.minItem.Value &&\n this.maxItem.Value >= otherList.maxItem.Value\n );\n }\n public LessThan(otherList: InkList) {\n if (otherList.Count == 0) return false;\n if (this.Count == 0) return true;\n\n return this.maxItem.Value < otherList.minItem.Value;\n }\n public LessThanOrEquals(otherList: InkList) {\n if (otherList.Count == 0) return false;\n if (this.Count == 0) return true;\n\n return (\n this.maxItem.Value <= otherList.maxItem.Value &&\n this.minItem.Value <= otherList.minItem.Value\n );\n }\n public MaxAsList() {\n if (this.Count > 0) return new InkList(this.maxItem);\n else return new InkList();\n }\n public MinAsList() {\n if (this.Count > 0) return new InkList(this.minItem);\n else return new InkList();\n }\n public ListWithSubRange(minBound: any, maxBound: any) {\n if (this.Count == 0) return new InkList();\n\n let ordered = this.orderedItems;\n\n let minValue = 0;\n let maxValue = Number.MAX_SAFE_INTEGER;\n\n if (Number.isInteger(minBound)) {\n minValue = minBound;\n } else {\n if (minBound instanceof InkList && minBound.Count > 0)\n minValue = minBound.minItem.Value;\n }\n\n if (Number.isInteger(maxBound)) {\n maxValue = maxBound;\n } else {\n if (maxBound instanceof InkList && maxBound.Count > 0)\n maxValue = maxBound.maxItem.Value;\n }\n\n let subList = new InkList();\n subList.SetInitialOriginNames(this.originNames);\n for (let item of ordered) {\n if (item.Value >= minValue && item.Value <= maxValue) {\n subList.Add(item.Key, item.Value);\n }\n }\n\n return subList;\n }\n public Equals(otherInkList: InkList) {\n if (otherInkList instanceof InkList === false) return false;\n if (otherInkList.Count != this.Count) return false;\n\n for (let [key] of this) {\n if (!otherInkList.has(key)) return false;\n }\n\n return true;\n }\n // GetHashCode not implemented\n get orderedItems() {\n // List>\n let ordered = new Array>();\n\n for (let [key, value] of this) {\n let item = InkListItem.fromSerializedKey(key);\n ordered.push({ Key: item, Value: value });\n }\n\n ordered.sort((x, y) => {\n if (x.Key.originName === null) {\n return throwNullException(\"x.Key.originName\");\n }\n if (y.Key.originName === null) {\n return throwNullException(\"y.Key.originName\");\n }\n\n if (x.Value == y.Value) {\n return x.Key.originName.localeCompare(y.Key.originName);\n } else {\n // TODO: refactor this bit into a numberCompareTo method?\n if (x.Value < y.Value) return -1;\n return x.Value > y.Value ? 1 : 0;\n }\n });\n\n return ordered;\n }\n public toString() {\n let ordered = this.orderedItems;\n\n let sb = new StringBuilder();\n for (let i = 0; i < ordered.length; i++) {\n if (i > 0) sb.Append(\", \");\n\n let item = ordered[i].Key;\n if (item.itemName === null) return throwNullException(\"item.itemName\");\n sb.Append(item.itemName);\n }\n\n return sb.toString();\n }\n // casting a InkList to a Number, for somereason, actually gives a number.\n // This messes up the type detection when creating a Value from a InkList.\n // Returning NaN here prevents that.\n public valueOf() {\n return NaN;\n }\n}\n\n/**\n * In the original C# code, `InkListItem` was defined as value type, meaning\n * that two `InkListItem` would be considered equal as long as they held the\n * same values. This doesn't hold true in Javascript, as `InkListItem` is a\n * reference type (Javascript doesn't allow the creation of custom value types).\n *\n * The key equality of Map objects is based on the \"SameValueZero\" algorithm;\n * since `InkListItem` is a value type, two keys will only be considered\n * equal if they are, in fact, the same object. As we are trying to emulate\n * the original behavior as close as possible, this will lead to unforeseen\n * side effects.\n *\n * In order to have a key equality based on value semantics, we'll convert\n * `InkListItem` to a valid string representation and use this representation\n * as a key (strings are value types in Javascript). Rather than using the\n * type `string` directly, we'll alias it to `SerializedInkListItem` and use\n * this type as the key for our Map-based `InkList`.\n *\n * Reducing `InkListItem` to a JSON representation would not be bulletproof\n * in the general case, but for our needs it works well. The major downside of\n * this method is that we will have to to reconstruct the original `InkListItem`\n * every time we'll need to access its properties.\n */\nexport type SerializedInkListItem = string;\n\n/**\n * An interface inherited by `InkListItem`, defining exposed\n * properties. It's mainly used when deserializing a `InkListItem` from its\n * key (`SerializedInkListItem`)\n */\ninterface IInkListItem {\n readonly originName: string | null;\n readonly itemName: string | null;\n}\nexport interface KeyValuePair {\n Key: K;\n Value: V;\n}\n","export class StoryException extends Error {\n public useEndLineNumber: boolean;\n public message: string;\n public name: string;\n\n constructor(message: string) {\n super(message);\n this.useEndLineNumber = false;\n this.message = message;\n this.name = \"StoryException\";\n }\n}\n","/**\n * This interface normalize the `TryGet` behavior found in the original\n * C# project. Any `TryGet` method will return a object conforming to this\n * interface.\n *\n * The original function returns a boolean and has a second parameter called\n * item that is an `out`. Both are needed and we can't just return the item\n * because it'll always be truthy. Instead, we return an object containing\n * whether the result exists (`exists`) and the result itself (`result`).\n *\n * For instance a `TryGet` prototype would look like this:\n```\nTryGetItemWithValue(val: number, item: InkListItem): TryGetResult{\n```\n *\n * On the other hand, dealing with the result can be done in the following way:\n```\nvar item = item.TryGetItemWithValue(intVal, InkListItem.Null);\nif (item.exists) {\n\tconsole.log(item.result)\n}\n```\n *\n */\nexport interface TryGetResult {\n result: T;\n exists: boolean;\n}\n\nexport function tryGetValueFromMap(\n map: Map | null,\n key: K,\n /* out */ value: V\n): TryGetResult {\n if (map === null) {\n return { result: value, exists: false };\n }\n\n let val = map.get(key);\n\n if (typeof val === \"undefined\") {\n return { result: value, exists: false };\n } else {\n return { result: val, exists: true };\n }\n}\n\nexport function tryParseInt(\n value: any,\n /* out */ defaultValue: number = 0\n): TryGetResult {\n let val = parseInt(value);\n\n if (!Number.isNaN(val)) {\n return { result: val, exists: true };\n } else {\n return { result: defaultValue, exists: false };\n }\n}\n\nexport function tryParseFloat(\n value: any,\n /* out */ defaultValue: number = 0\n): TryGetResult {\n let val = parseFloat(value);\n\n if (!Number.isNaN(val)) {\n return { result: val, exists: true };\n } else {\n return { result: defaultValue, exists: false };\n }\n}\n","import { InkObject } from \"./Object\";\nimport { Container } from \"./Container\";\n\nexport class SearchResult {\n public obj: InkObject | null = null;\n public approximate: boolean = false;\n\n get correctObj() {\n return this.approximate ? null : this.obj;\n }\n\n get container() {\n return this.obj instanceof Container ? this.obj : null;\n }\n\n public copy() {\n let searchResult = new SearchResult();\n searchResult.obj = this.obj;\n searchResult.approximate = this.approximate;\n\n return searchResult;\n }\n}\n","import { StringValue } from \"./Value\";\nimport { throwNullException } from \"./NullException\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { INamedContent } from \"./INamedContent\";\nimport { InkObject } from \"./Object\";\nimport { SearchResult } from \"./SearchResult\";\nimport { Path } from \"./Path\";\nimport { Debug } from \"./Debug\";\nimport { tryGetValueFromMap } from \"./TryGetResult\";\nimport { asINamedContentOrNull, asOrNull, asOrThrows } from \"./TypeAssertion\";\n\nexport class Container extends InkObject implements INamedContent {\n public name: string | null = null;\n\n public _content: InkObject[] = [];\n public namedContent: Map = new Map();\n\n public visitsShouldBeCounted: boolean = false;\n public turnIndexShouldBeCounted: boolean = false;\n public countingAtStartOnly: boolean = false;\n\n public _pathToFirstLeafContent: Path | null = null;\n\n get hasValidName() {\n return this.name != null && this.name.length > 0;\n }\n get content() {\n return this._content;\n }\n set content(value: InkObject[]) {\n this.AddContent(value);\n }\n get namedOnlyContent() {\n let namedOnlyContentDict: Map | null = new Map();\n\n for (let [key, value] of this.namedContent) {\n let inkObject = asOrThrows(value, InkObject);\n namedOnlyContentDict.set(key, inkObject);\n }\n\n for (let c of this.content) {\n let named = asINamedContentOrNull(c);\n if (named != null && named.hasValidName) {\n namedOnlyContentDict.delete(named.name!);\n }\n }\n\n if (namedOnlyContentDict.size == 0) namedOnlyContentDict = null;\n\n return namedOnlyContentDict;\n }\n set namedOnlyContent(value: Map | null) {\n let existingNamedOnly = this.namedOnlyContent;\n if (existingNamedOnly != null) {\n for (let [key] of existingNamedOnly) {\n this.namedContent.delete(key);\n }\n }\n\n if (value == null) return;\n\n for (let [, val] of value) {\n let named = asINamedContentOrNull(val);\n if (named != null) this.AddToNamedContentOnly(named);\n }\n }\n get countFlags(): number {\n let flags: Container.CountFlags = 0;\n if (this.visitsShouldBeCounted) flags |= Container.CountFlags.Visits;\n if (this.turnIndexShouldBeCounted) flags |= Container.CountFlags.Turns;\n if (this.countingAtStartOnly) flags |= Container.CountFlags.CountStartOnly;\n\n if (flags == Container.CountFlags.CountStartOnly) {\n flags = 0;\n }\n\n return flags;\n }\n set countFlags(value: number) {\n let flag: Container.CountFlags = value;\n if ((flag & Container.CountFlags.Visits) > 0)\n this.visitsShouldBeCounted = true;\n if ((flag & Container.CountFlags.Turns) > 0)\n this.turnIndexShouldBeCounted = true;\n if ((flag & Container.CountFlags.CountStartOnly) > 0)\n this.countingAtStartOnly = true;\n }\n get pathToFirstLeafContent() {\n if (this._pathToFirstLeafContent == null)\n this._pathToFirstLeafContent = this.path.PathByAppendingPath(\n this.internalPathToFirstLeafContent\n );\n\n return this._pathToFirstLeafContent;\n }\n get internalPathToFirstLeafContent() {\n let components: Path.Component[] = [];\n let container: Container = this;\n while (container instanceof Container) {\n if (container.content.length > 0) {\n components.push(new Path.Component(0));\n container = container.content[0] as Container;\n }\n }\n return new Path(components);\n }\n\n public AddContent(contentObjOrList: InkObject | InkObject[]) {\n if (contentObjOrList instanceof Array) {\n let contentList = contentObjOrList as InkObject[];\n\n for (let c of contentList) {\n this.AddContent(c);\n }\n } else {\n let contentObj = contentObjOrList as InkObject;\n\n this._content.push(contentObj);\n\n if (contentObj.parent) {\n throw new Error(\"content is already in \" + contentObj.parent);\n }\n\n contentObj.parent = this;\n\n this.TryAddNamedContent(contentObj);\n }\n }\n public TryAddNamedContent(contentObj: InkObject) {\n let namedContentObj = asINamedContentOrNull(contentObj);\n if (namedContentObj != null && namedContentObj.hasValidName) {\n this.AddToNamedContentOnly(namedContentObj);\n }\n }\n public AddToNamedContentOnly(namedContentObj: INamedContent) {\n Debug.AssertType(\n namedContentObj,\n InkObject,\n \"Can only add Runtime.Objects to a Runtime.Container\"\n );\n let runtimeObj = asOrThrows(namedContentObj, InkObject);\n runtimeObj.parent = this;\n\n if (namedContentObj.name === null)\n return throwNullException(\"namedContentObj.name\");\n this.namedContent.set(namedContentObj.name!, namedContentObj);\n }\n public ContentAtPath(\n path: Path,\n partialPathStart: number = 0,\n partialPathLength: number = -1\n ) {\n if (partialPathLength == -1) partialPathLength = path.length;\n\n let result = new SearchResult();\n result.approximate = false;\n\n let currentContainer: Container | null = this;\n let currentObj: InkObject = this;\n\n for (let i = partialPathStart; i < partialPathLength; ++i) {\n let comp = path.GetComponent(i);\n if (currentContainer == null) {\n result.approximate = true;\n break;\n }\n\n let foundObj: InkObject | null =\n currentContainer.ContentWithPathComponent(comp);\n\n if (foundObj == null) {\n result.approximate = true;\n break;\n }\n\n currentObj = foundObj;\n currentContainer = asOrNull(foundObj, Container);\n }\n\n result.obj = currentObj;\n\n return result;\n }\n public InsertContent(contentObj: InkObject, index: number) {\n this.content.splice(index, 0, contentObj);\n\n if (contentObj.parent) {\n throw new Error(\"content is already in \" + contentObj.parent);\n }\n\n contentObj.parent = this;\n\n this.TryAddNamedContent(contentObj);\n }\n public AddContentsOfContainer(otherContainer: Container) {\n this.content.push(...otherContainer.content);\n\n for (let obj of otherContainer.content) {\n obj.parent = this;\n this.TryAddNamedContent(obj);\n }\n }\n public ContentWithPathComponent(component: Path.Component): InkObject | null {\n if (component.isIndex) {\n if (component.index >= 0 && component.index < this.content.length) {\n return this.content[component.index];\n } else {\n return null;\n }\n } else if (component.isParent) {\n return this.parent;\n } else {\n if (component.name === null) {\n return throwNullException(\"component.name\");\n }\n let foundContent = tryGetValueFromMap(\n this.namedContent,\n component.name,\n null\n );\n if (foundContent.exists) {\n return asOrThrows(foundContent.result, InkObject);\n } else {\n return null;\n }\n }\n }\n public BuildStringOfHierarchy(): string;\n public BuildStringOfHierarchy(\n sb: StringBuilder,\n indentation: number,\n pointedObj: InkObject | null\n ): string;\n public BuildStringOfHierarchy() {\n let sb: StringBuilder;\n if (arguments.length == 0) {\n sb = new StringBuilder();\n this.BuildStringOfHierarchy(sb, 0, null);\n return sb.toString();\n }\n\n sb = arguments[0] as StringBuilder;\n let indentation = arguments[1] as number;\n let pointedObj = arguments[2] as InkObject | null;\n\n function appendIndentation() {\n const spacesPerIndent = 4; // Truly const in the original code\n for (let i = 0; i < spacesPerIndent * indentation; ++i) {\n sb.Append(\" \");\n }\n }\n\n appendIndentation();\n sb.Append(\"[\");\n\n if (this.hasValidName) {\n sb.AppendFormat(\" ({0})\", this.name);\n }\n\n if (this == pointedObj) {\n sb.Append(\" <---\");\n }\n\n sb.AppendLine();\n\n indentation++;\n\n for (let i = 0; i < this.content.length; ++i) {\n let obj = this.content[i];\n\n if (obj instanceof Container) {\n let container = obj as Container;\n\n container.BuildStringOfHierarchy(sb, indentation, pointedObj);\n } else {\n appendIndentation();\n if (obj instanceof StringValue) {\n sb.Append('\"');\n sb.Append(obj.toString().replace(\"\\n\", \"\\\\n\"));\n sb.Append('\"');\n } else {\n sb.Append(obj.toString());\n }\n }\n\n if (i != this.content.length - 1) {\n sb.Append(\",\");\n }\n\n if (!(obj instanceof Container) && obj == pointedObj) {\n sb.Append(\" <---\");\n }\n\n sb.AppendLine();\n }\n\n let onlyNamed: Map = new Map();\n\n for (let [key, value] of this.namedContent) {\n if (this.content.indexOf(asOrThrows(value, InkObject)) >= 0) {\n continue;\n } else {\n onlyNamed.set(key, value);\n }\n }\n\n if (onlyNamed.size > 0) {\n appendIndentation();\n sb.AppendLine(\"-- named: --\");\n\n for (let [, value] of onlyNamed) {\n Debug.AssertType(\n value,\n Container,\n \"Can only print out named Containers\"\n );\n let container = value as Container;\n container.BuildStringOfHierarchy(sb, indentation, pointedObj);\n sb.AppendLine();\n }\n }\n\n indentation--;\n\n appendIndentation();\n sb.Append(\"]\");\n }\n}\n\nexport namespace Container {\n export enum CountFlags {\n Start = 0,\n Visits = 1,\n Turns = 2,\n CountStartOnly = 4,\n }\n}\n","import { InkObject } from \"./Object\";\n\nexport class Glue extends InkObject {\n public toString() {\n return \"Glue\";\n }\n}\n","import { InkObject } from \"./Object\";\n\nexport class ControlCommand extends InkObject {\n private _commandType: ControlCommand.CommandType;\n\n get commandType(): ControlCommand.CommandType {\n return this._commandType;\n }\n\n constructor(\n commandType: ControlCommand.CommandType = ControlCommand.CommandType.NotSet\n ) {\n super();\n this._commandType = commandType;\n }\n\n public Copy() {\n return new ControlCommand(this.commandType);\n }\n public static EvalStart() {\n return new ControlCommand(ControlCommand.CommandType.EvalStart);\n }\n public static EvalOutput() {\n return new ControlCommand(ControlCommand.CommandType.EvalOutput);\n }\n public static EvalEnd() {\n return new ControlCommand(ControlCommand.CommandType.EvalEnd);\n }\n public static Duplicate() {\n return new ControlCommand(ControlCommand.CommandType.Duplicate);\n }\n public static PopEvaluatedValue() {\n return new ControlCommand(ControlCommand.CommandType.PopEvaluatedValue);\n }\n public static PopFunction() {\n return new ControlCommand(ControlCommand.CommandType.PopFunction);\n }\n public static PopTunnel() {\n return new ControlCommand(ControlCommand.CommandType.PopTunnel);\n }\n public static BeginString() {\n return new ControlCommand(ControlCommand.CommandType.BeginString);\n }\n public static EndString() {\n return new ControlCommand(ControlCommand.CommandType.EndString);\n }\n public static NoOp() {\n return new ControlCommand(ControlCommand.CommandType.NoOp);\n }\n public static ChoiceCount() {\n return new ControlCommand(ControlCommand.CommandType.ChoiceCount);\n }\n public static Turns() {\n return new ControlCommand(ControlCommand.CommandType.Turns);\n }\n public static TurnsSince() {\n return new ControlCommand(ControlCommand.CommandType.TurnsSince);\n }\n public static ReadCount() {\n return new ControlCommand(ControlCommand.CommandType.ReadCount);\n }\n public static Random() {\n return new ControlCommand(ControlCommand.CommandType.Random);\n }\n public static SeedRandom() {\n return new ControlCommand(ControlCommand.CommandType.SeedRandom);\n }\n public static VisitIndex() {\n return new ControlCommand(ControlCommand.CommandType.VisitIndex);\n }\n public static SequenceShuffleIndex() {\n return new ControlCommand(ControlCommand.CommandType.SequenceShuffleIndex);\n }\n public static StartThread() {\n return new ControlCommand(ControlCommand.CommandType.StartThread);\n }\n public static Done() {\n return new ControlCommand(ControlCommand.CommandType.Done);\n }\n public static End() {\n return new ControlCommand(ControlCommand.CommandType.End);\n }\n public static ListFromInt() {\n return new ControlCommand(ControlCommand.CommandType.ListFromInt);\n }\n public static ListRange() {\n return new ControlCommand(ControlCommand.CommandType.ListRange);\n }\n public static ListRandom() {\n return new ControlCommand(ControlCommand.CommandType.ListRandom);\n }\n public static BeginTag() {\n return new ControlCommand(ControlCommand.CommandType.BeginTag);\n }\n public static EndTag() {\n return new ControlCommand(ControlCommand.CommandType.EndTag);\n }\n public toString() {\n return \"ControlCommand \" + this.commandType.toString();\n }\n}\n\nexport namespace ControlCommand {\n export enum CommandType {\n NotSet = -1,\n EvalStart, // 0\n EvalOutput, // 1\n EvalEnd, // 2\n Duplicate, // 3\n PopEvaluatedValue, // 4\n PopFunction, // 5\n PopTunnel, // 6\n BeginString, // 7\n EndString, // 8\n NoOp, // 9\n ChoiceCount, // 10\n Turns, // 11\n TurnsSince, // 12\n ReadCount, // 13\n Random, // 14\n SeedRandom, // 15\n VisitIndex, // 16\n SequenceShuffleIndex, // 17\n StartThread, // 18\n Done, // 19\n End, // 20\n ListFromInt, // 21\n ListRange, // 22\n ListRandom, // 23\n BeginTag, // 24\n EndTag, // 25\n\n TOTAL_VALUES,\n }\n}\n","import { Path } from \"./Path\";\nimport { Container } from \"./Container\";\nimport { InkObject } from \"./Object\";\n\nexport class Pointer {\n public container: Container | null = null;\n public index: number = -1;\n\n constructor();\n constructor(container: Container | null, index: number);\n constructor() {\n if (arguments.length === 2) {\n this.container = arguments[0];\n this.index = arguments[1];\n }\n }\n\n public Resolve(): InkObject | null {\n if (this.index < 0) return this.container;\n if (this.container == null) return null;\n if (this.container.content.length == 0) return this.container;\n if (this.index >= this.container.content.length) return null;\n\n return this.container.content[this.index];\n }\n\n get isNull(): boolean {\n return this.container == null;\n }\n\n get path(): Path | null {\n if (this.isNull) return null;\n\n if (this.index >= 0)\n return this.container!.path.PathByAppendingComponent(\n new Path.Component(this.index)\n );\n else return this.container!.path;\n }\n\n public toString(): string {\n if (!this.container) return \"Ink Pointer (null)\";\n\n return (\n \"Ink Pointer -> \" +\n this.container.path.toString() +\n \" -- index \" +\n this.index\n );\n }\n\n // This method does not exist in the original C# code, but is here to maintain the\n // value semantics of Pointer.\n public copy(): Pointer {\n return new Pointer(this.container, this.index);\n }\n\n public static StartOf(container: Container | null): Pointer {\n return new Pointer(container, 0);\n }\n\n public static get Null(): Pointer {\n return new Pointer(null, -1);\n }\n}\n","import { Path } from \"./Path\";\nimport { PushPopType } from \"./PushPop\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { InkObject } from \"./Object\";\nimport { Pointer } from \"./Pointer\";\nimport { Container } from \"./Container\";\nimport { throwNullException } from \"./NullException\";\n\nexport class Divert extends InkObject {\n get targetPath() {\n if (this._targetPath != null && this._targetPath.isRelative) {\n let targetObj = this.targetPointer.Resolve();\n if (targetObj) {\n this._targetPath = targetObj.path;\n }\n }\n\n return this._targetPath;\n }\n set targetPath(value: Path | null) {\n this._targetPath = value;\n this._targetPointer = Pointer.Null;\n }\n\n public _targetPath: Path | null = null;\n\n get targetPointer() {\n if (this._targetPointer.isNull) {\n let targetObj = this.ResolvePath(this._targetPath).obj;\n\n if (this._targetPath === null)\n return throwNullException(\"this._targetPath\");\n if (this._targetPath.lastComponent === null)\n return throwNullException(\"this._targetPath.lastComponent\");\n\n if (this._targetPath.lastComponent.isIndex) {\n if (targetObj === null) return throwNullException(\"targetObj\");\n this._targetPointer.container =\n targetObj.parent instanceof Container ? targetObj.parent : null;\n this._targetPointer.index = this._targetPath.lastComponent.index;\n } else {\n this._targetPointer = Pointer.StartOf(\n targetObj instanceof Container ? targetObj : null\n );\n }\n }\n\n return this._targetPointer.copy();\n }\n\n public _targetPointer: Pointer = Pointer.Null;\n\n get targetPathString() {\n if (this.targetPath == null) return null;\n\n return this.CompactPathString(this.targetPath);\n }\n set targetPathString(value: string | null) {\n if (value == null) {\n this.targetPath = null;\n } else {\n this.targetPath = new Path(value);\n }\n }\n\n public variableDivertName: string | null = null;\n get hasVariableTarget() {\n return this.variableDivertName != null;\n }\n\n public pushesToStack: boolean = false;\n public stackPushType: PushPopType = 0;\n\n public isExternal: boolean = false;\n public externalArgs: number = 0;\n\n public isConditional: boolean = false;\n\n constructor(stackPushType?: PushPopType) {\n super();\n this.pushesToStack = false;\n\n if (typeof stackPushType !== \"undefined\") {\n this.pushesToStack = true;\n this.stackPushType = stackPushType;\n }\n }\n\n public Equals(obj: Divert | null) {\n let otherDivert = obj;\n if (otherDivert instanceof Divert) {\n if (this.hasVariableTarget == otherDivert.hasVariableTarget) {\n if (this.hasVariableTarget) {\n return this.variableDivertName == otherDivert.variableDivertName;\n } else {\n if (this.targetPath === null)\n return throwNullException(\"this.targetPath\");\n return this.targetPath.Equals(otherDivert.targetPath);\n }\n }\n }\n return false;\n }\n\n public toString() {\n if (this.hasVariableTarget) {\n return \"Divert(variable: \" + this.variableDivertName + \")\";\n } else if (this.targetPath == null) {\n return \"Divert(null)\";\n } else {\n let sb = new StringBuilder();\n\n let targetStr = this.targetPath.toString();\n // int? targetLineNum = DebugLineNumberOfPath (targetPath);\n let targetLineNum = null;\n if (targetLineNum != null) {\n targetStr = \"line \" + targetLineNum;\n }\n\n sb.Append(\"Divert\");\n\n if (this.isConditional) sb.Append(\"?\");\n\n if (this.pushesToStack) {\n if (this.stackPushType == PushPopType.Function) {\n sb.Append(\" function\");\n } else {\n sb.Append(\" tunnel\");\n }\n }\n\n sb.Append(\" -> \");\n sb.Append(this.targetPathString);\n\n sb.Append(\" (\");\n sb.Append(targetStr);\n sb.Append(\")\");\n\n return sb.toString();\n }\n }\n}\n","import { InkObject } from \"./Object\";\nimport { Path } from \"./Path\";\nimport { Container } from \"./Container\";\nimport { throwNullException } from \"./NullException\";\n\nexport class ChoicePoint extends InkObject {\n public _pathOnChoice: Path | null = null;\n public hasCondition: boolean = false;\n public hasStartContent: boolean = false;\n public hasChoiceOnlyContent: boolean = false;\n public isInvisibleDefault: boolean = false;\n public onceOnly: boolean = true;\n\n constructor(onceOnly: boolean = true) {\n super();\n this.onceOnly = onceOnly;\n }\n get pathOnChoice(): Path | null {\n if (this._pathOnChoice != null && this._pathOnChoice.isRelative) {\n let choiceTargetObj = this.choiceTarget;\n if (choiceTargetObj) {\n this._pathOnChoice = choiceTargetObj.path;\n }\n }\n return this._pathOnChoice;\n }\n set pathOnChoice(value: Path | null) {\n this._pathOnChoice = value;\n }\n get choiceTarget(): Container | null {\n if (this._pathOnChoice === null)\n return throwNullException(\"ChoicePoint._pathOnChoice\");\n return this.ResolvePath(this._pathOnChoice).container;\n }\n get pathStringOnChoice(): string {\n if (this.pathOnChoice === null)\n return throwNullException(\"ChoicePoint.pathOnChoice\");\n return this.CompactPathString(this.pathOnChoice);\n }\n set pathStringOnChoice(value: string) {\n this.pathOnChoice = new Path(value);\n }\n get flags(): number {\n let flags = 0;\n if (this.hasCondition) flags |= 1;\n if (this.hasStartContent) flags |= 2;\n if (this.hasChoiceOnlyContent) flags |= 4;\n if (this.isInvisibleDefault) flags |= 8;\n if (this.onceOnly) flags |= 16;\n return flags;\n }\n set flags(value: number) {\n this.hasCondition = (value & 1) > 0;\n this.hasStartContent = (value & 2) > 0;\n this.hasChoiceOnlyContent = (value & 4) > 0;\n this.isInvisibleDefault = (value & 8) > 0;\n this.onceOnly = (value & 16) > 0;\n }\n public toString(): string {\n if (this.pathOnChoice === null)\n return throwNullException(\"ChoicePoint.pathOnChoice\");\n // int? targetLineNum = DebugLineNumberOfPath (pathOnChoice);\n let targetLineNum = null;\n let targetString = this.pathOnChoice.toString();\n\n if (targetLineNum != null) {\n targetString = \" line \" + targetLineNum + \"(\" + targetString + \")\";\n }\n\n return \"Choice: -> \" + targetString;\n }\n}\n","import { InkObject } from \"./Object\";\nimport { Path } from \"./Path\";\n\nexport class VariableReference extends InkObject {\n public name: string | null;\n public pathForCount: Path | null = null;\n\n get containerForCount() {\n if (this.pathForCount === null) return null;\n return this.ResolvePath(this.pathForCount).container;\n }\n get pathStringForCount() {\n if (this.pathForCount === null) return null;\n\n return this.CompactPathString(this.pathForCount);\n }\n set pathStringForCount(value: string | null) {\n if (value === null) this.pathForCount = null;\n else this.pathForCount = new Path(value);\n }\n\n constructor(name: string | null = null) {\n super();\n this.name = name;\n }\n\n public toString() {\n if (this.name != null) {\n return \"var(\" + this.name + \")\";\n } else {\n let pathStr = this.pathStringForCount;\n return \"read_count(\" + pathStr + \")\";\n }\n }\n}\n","import { InkObject } from \"./Object\";\n\nexport class VariableAssignment extends InkObject {\n public readonly variableName: string | null;\n public readonly isNewDeclaration: boolean;\n public isGlobal: boolean;\n\n constructor(variableName: string | null, isNewDeclaration: boolean) {\n super();\n this.variableName = variableName || null;\n this.isNewDeclaration = !!isNewDeclaration;\n this.isGlobal = false;\n }\n\n public toString(): string {\n return \"VarAssign to \" + this.variableName;\n }\n}\n","import { InkObject } from \"./Object\";\n\nexport class Void extends InkObject {\n public toString() {\n return \"Void\";\n }\n}\n","import { Value, ValueType, IntValue, ListValue, BoolValue } from \"./Value\";\nimport { StoryException } from \"./StoryException\";\nimport { Void } from \"./Void\";\nimport { Path } from \"./Path\";\nimport { InkList, InkListItem } from \"./InkList\";\nimport { InkObject } from \"./Object\";\nimport { asOrNull, asOrThrows, asBooleanOrThrows } from \"./TypeAssertion\";\nimport { throwNullException } from \"./NullException\";\n\ntype BinaryOp = (left: T, right: T) => any;\ntype UnaryOp = (val: T) => any;\n\nexport class NativeFunctionCall extends InkObject {\n public static readonly Add: string = \"+\";\n public static readonly Subtract: string = \"-\";\n public static readonly Divide: string = \"/\";\n public static readonly Multiply: string = \"*\";\n public static readonly Mod: string = \"%\";\n public static readonly Negate: string = \"_\";\n public static readonly Equal: string = \"==\";\n public static readonly Greater: string = \">\";\n public static readonly Less: string = \"<\";\n public static readonly GreaterThanOrEquals: string = \">=\";\n public static readonly LessThanOrEquals: string = \"<=\";\n public static readonly NotEquals: string = \"!=\";\n public static readonly Not: string = \"!\";\n public static readonly And: string = \"&&\";\n public static readonly Or: string = \"||\";\n public static readonly Min: string = \"MIN\";\n public static readonly Max: string = \"MAX\";\n public static readonly Pow: string = \"POW\";\n public static readonly Floor: string = \"FLOOR\";\n public static readonly Ceiling: string = \"CEILING\";\n public static readonly Int: string = \"INT\";\n public static readonly Float: string = \"FLOAT\";\n public static readonly Has: string = \"?\";\n public static readonly Hasnt: string = \"!?\";\n public static readonly Intersect: string = \"^\";\n public static readonly ListMin: string = \"LIST_MIN\";\n public static readonly ListMax: string = \"LIST_MAX\";\n public static readonly All: string = \"LIST_ALL\";\n public static readonly Count: string = \"LIST_COUNT\";\n public static readonly ValueOfList: string = \"LIST_VALUE\";\n public static readonly Invert: string = \"LIST_INVERT\";\n\n public static CallWithName(functionName: string) {\n return new NativeFunctionCall(functionName);\n }\n\n public static CallExistsWithName(functionName: string) {\n this.GenerateNativeFunctionsIfNecessary();\n return this._nativeFunctions!.get(functionName);\n }\n\n get name() {\n if (this._name === null)\n return throwNullException(\"NativeFunctionCall._name\");\n return this._name;\n }\n set name(value: string) {\n this._name = value;\n if (!this._isPrototype) {\n if (NativeFunctionCall._nativeFunctions === null)\n throwNullException(\"NativeFunctionCall._nativeFunctions\");\n else\n this._prototype =\n NativeFunctionCall._nativeFunctions.get(this._name) || null;\n }\n }\n public _name: string | null = null;\n\n get numberOfParameters() {\n if (this._prototype) {\n return this._prototype.numberOfParameters;\n } else {\n return this._numberOfParameters;\n }\n }\n set numberOfParameters(value: number) {\n this._numberOfParameters = value;\n }\n public _numberOfParameters: number = 0;\n\n public Call(parameters: InkObject[]): InkObject | null {\n if (this._prototype) {\n return this._prototype.Call(parameters);\n }\n\n if (this.numberOfParameters != parameters.length) {\n throw new Error(\"Unexpected number of parameters\");\n }\n\n let hasList = false;\n for (let p of parameters) {\n if (p instanceof Void)\n throw new StoryException(\n 'Attempting to perform operation on a void value. Did you forget to \"return\" a value from a function you called here?'\n );\n if (p instanceof ListValue) hasList = true;\n }\n\n if (parameters.length == 2 && hasList) {\n return this.CallBinaryListOperation(parameters);\n }\n\n let coercedParams = this.CoerceValuesToSingleType(parameters);\n let coercedType = coercedParams[0].valueType;\n\n if (coercedType == ValueType.Int) {\n return this.CallType(coercedParams);\n } else if (coercedType == ValueType.Float) {\n return this.CallType(coercedParams);\n } else if (coercedType == ValueType.String) {\n return this.CallType(coercedParams);\n } else if (coercedType == ValueType.DivertTarget) {\n return this.CallType(coercedParams);\n } else if (coercedType == ValueType.List) {\n return this.CallType(coercedParams);\n }\n\n return null;\n }\n\n public CallType string }>(\n parametersOfSingleType: Array>\n ) {\n let param1 = asOrThrows(parametersOfSingleType[0], Value);\n let valType = param1.valueType;\n\n let val1 = param1 as Value;\n\n let paramCount = parametersOfSingleType.length;\n\n if (paramCount == 2 || paramCount == 1) {\n if (this._operationFuncs === null)\n return throwNullException(\"NativeFunctionCall._operationFuncs\");\n let opForTypeObj = this._operationFuncs.get(valType);\n if (!opForTypeObj) {\n const key = ValueType[valType];\n throw new StoryException(\n \"Cannot perform operation \" + this.name + \" on \" + key\n );\n }\n\n if (paramCount == 2) {\n let param2 = asOrThrows(parametersOfSingleType[1], Value);\n\n let val2 = param2 as Value;\n\n let opForType = opForTypeObj as BinaryOp;\n\n if (val1.value === null || val2.value === null)\n return throwNullException(\"NativeFunctionCall.Call BinaryOp values\");\n let resultVal = opForType(val1.value, val2.value);\n\n return Value.Create(resultVal);\n } else {\n let opForType = opForTypeObj as UnaryOp;\n\n if (val1.value === null)\n return throwNullException(\"NativeFunctionCall.Call UnaryOp value\");\n let resultVal = opForType(val1.value);\n\n // This code is different from upstream. Since JavaScript treats\n // integers and floats as the same numbers, it's impossible\n // to force an number to be either an integer or a float.\n //\n // It can be useful to force a specific number type\n // (especially for divisions), so the result of INT() & FLOAT()\n // is coerced to the the proper value type.\n //\n // Note that we also force all other unary operation to\n // return the same value type, although this is only\n // meaningful for numbers. See `Value.Create`.\n if (this.name === NativeFunctionCall.Int) {\n return Value.Create(resultVal, ValueType.Int);\n } else if (this.name === NativeFunctionCall.Float) {\n return Value.Create(resultVal, ValueType.Float);\n } else {\n return Value.Create(resultVal, param1.valueType);\n }\n }\n } else {\n throw new Error(\n \"Unexpected number of parameters to NativeFunctionCall: \" +\n parametersOfSingleType.length\n );\n }\n }\n\n public CallBinaryListOperation(parameters: InkObject[]) {\n if (\n (this.name == \"+\" || this.name == \"-\") &&\n parameters[0] instanceof ListValue &&\n parameters[1] instanceof IntValue\n )\n return this.CallListIncrementOperation(parameters);\n\n let v1 = asOrThrows(parameters[0], Value);\n let v2 = asOrThrows(parameters[1], Value);\n\n if (\n (this.name == \"&&\" || this.name == \"||\") &&\n (v1.valueType != ValueType.List || v2.valueType != ValueType.List)\n ) {\n if (this._operationFuncs === null)\n return throwNullException(\"NativeFunctionCall._operationFuncs\");\n let op = this._operationFuncs.get(ValueType.Int) as BinaryOp;\n if (op === null)\n return throwNullException(\n \"NativeFunctionCall.CallBinaryListOperation op\"\n );\n let result = asBooleanOrThrows(\n op(v1.isTruthy ? 1 : 0, v2.isTruthy ? 1 : 0)\n );\n return new BoolValue(result);\n }\n\n if (v1.valueType == ValueType.List && v2.valueType == ValueType.List)\n return this.CallType([v1, v2]);\n\n throw new StoryException(\n \"Can not call use \" +\n this.name +\n \" operation on \" +\n ValueType[v1.valueType] +\n \" and \" +\n ValueType[v2.valueType]\n );\n }\n\n public CallListIncrementOperation(listIntParams: InkObject[]) {\n let listVal = asOrThrows(listIntParams[0], ListValue);\n let intVal = asOrThrows(listIntParams[1], IntValue);\n\n let resultInkList = new InkList();\n\n if (listVal.value === null)\n return throwNullException(\n \"NativeFunctionCall.CallListIncrementOperation listVal.value\"\n );\n for (let [listItemKey, listItemValue] of listVal.value) {\n let listItem = InkListItem.fromSerializedKey(listItemKey);\n\n if (this._operationFuncs === null)\n return throwNullException(\"NativeFunctionCall._operationFuncs\");\n let intOp = this._operationFuncs.get(ValueType.Int) as BinaryOp;\n\n if (intVal.value === null)\n return throwNullException(\n \"NativeFunctionCall.CallListIncrementOperation intVal.value\"\n );\n let targetInt = intOp(listItemValue, intVal.value);\n\n let itemOrigin = null;\n if (listVal.value.origins === null)\n return throwNullException(\n \"NativeFunctionCall.CallListIncrementOperation listVal.value.origins\"\n );\n for (let origin of listVal.value.origins) {\n if (origin.name == listItem.originName) {\n itemOrigin = origin;\n break;\n }\n }\n if (itemOrigin != null) {\n let incrementedItem = itemOrigin.TryGetItemWithValue(\n targetInt,\n InkListItem.Null\n );\n if (incrementedItem.exists)\n resultInkList.Add(incrementedItem.result, targetInt);\n }\n }\n\n return new ListValue(resultInkList);\n }\n\n public CoerceValuesToSingleType(parametersIn: InkObject[]) {\n let valType = ValueType.Int;\n\n let specialCaseList: null | ListValue = null;\n\n for (let obj of parametersIn) {\n let val = asOrThrows(obj, Value);\n if (val.valueType > valType) {\n valType = val.valueType;\n }\n\n if (val.valueType == ValueType.List) {\n specialCaseList = asOrNull(val, ListValue);\n }\n }\n\n let parametersOut = [];\n\n if (ValueType[valType] == ValueType[ValueType.List]) {\n for (let inkObjectVal of parametersIn) {\n let val = asOrThrows(inkObjectVal, Value);\n if (val.valueType == ValueType.List) {\n parametersOut.push(val);\n } else if (val.valueType == ValueType.Int) {\n let intVal = parseInt(val.valueObject);\n\n specialCaseList = asOrThrows(specialCaseList, ListValue);\n if (specialCaseList.value === null)\n return throwNullException(\n \"NativeFunctionCall.CoerceValuesToSingleType specialCaseList.value\"\n );\n let list = specialCaseList.value.originOfMaxItem;\n\n if (list === null)\n return throwNullException(\n \"NativeFunctionCall.CoerceValuesToSingleType list\"\n );\n let item = list.TryGetItemWithValue(intVal, InkListItem.Null);\n if (item.exists) {\n let castedValue = new ListValue(item.result, intVal);\n parametersOut.push(castedValue);\n } else\n throw new StoryException(\n \"Could not find List item with the value \" +\n intVal +\n \" in \" +\n list.name\n );\n } else {\n const key = ValueType[val.valueType];\n throw new StoryException(\n \"Cannot mix Lists and \" + key + \" values in this operation\"\n );\n }\n }\n } else {\n for (let inkObjectVal of parametersIn) {\n let val = asOrThrows(inkObjectVal, Value);\n let castedValue = val.Cast(valType);\n parametersOut.push(castedValue);\n }\n }\n\n return parametersOut;\n }\n\n constructor(name: string);\n constructor(name: string, numberOfParameters: number);\n constructor();\n constructor() {\n super();\n\n if (arguments.length === 0) {\n NativeFunctionCall.GenerateNativeFunctionsIfNecessary();\n } else if (arguments.length === 1) {\n let name = arguments[0];\n NativeFunctionCall.GenerateNativeFunctionsIfNecessary();\n this.name = name;\n } else if (arguments.length === 2) {\n let name = arguments[0];\n let numberOfParameters = arguments[1];\n\n this._isPrototype = true;\n this.name = name;\n this.numberOfParameters = numberOfParameters;\n }\n }\n\n public static Identity(t: T): any {\n return t;\n }\n\n public static GenerateNativeFunctionsIfNecessary() {\n if (this._nativeFunctions == null) {\n this._nativeFunctions = new Map();\n\n // Int operations\n this.AddIntBinaryOp(this.Add, (x, y) => x + y);\n this.AddIntBinaryOp(this.Subtract, (x, y) => x - y);\n this.AddIntBinaryOp(this.Multiply, (x, y) => x * y);\n this.AddIntBinaryOp(this.Divide, (x, y) => Math.floor(x / y));\n this.AddIntBinaryOp(this.Mod, (x, y) => x % y);\n this.AddIntUnaryOp(this.Negate, (x) => -x);\n\n this.AddIntBinaryOp(this.Equal, (x, y) => x == y);\n this.AddIntBinaryOp(this.Greater, (x, y) => x > y);\n this.AddIntBinaryOp(this.Less, (x, y) => x < y);\n this.AddIntBinaryOp(this.GreaterThanOrEquals, (x, y) => x >= y);\n this.AddIntBinaryOp(this.LessThanOrEquals, (x, y) => x <= y);\n this.AddIntBinaryOp(this.NotEquals, (x, y) => x != y);\n this.AddIntUnaryOp(this.Not, (x) => x == 0);\n\n this.AddIntBinaryOp(this.And, (x, y) => x != 0 && y != 0);\n this.AddIntBinaryOp(this.Or, (x, y) => x != 0 || y != 0);\n\n this.AddIntBinaryOp(this.Max, (x, y) => Math.max(x, y));\n this.AddIntBinaryOp(this.Min, (x, y) => Math.min(x, y));\n\n this.AddIntBinaryOp(this.Pow, (x, y) => Math.pow(x, y));\n this.AddIntUnaryOp(this.Floor, NativeFunctionCall.Identity);\n this.AddIntUnaryOp(this.Ceiling, NativeFunctionCall.Identity);\n this.AddIntUnaryOp(this.Int, NativeFunctionCall.Identity);\n this.AddIntUnaryOp(this.Float, (x) => x);\n\n // Float operations\n this.AddFloatBinaryOp(this.Add, (x, y) => x + y);\n this.AddFloatBinaryOp(this.Subtract, (x, y) => x - y);\n this.AddFloatBinaryOp(this.Multiply, (x, y) => x * y);\n this.AddFloatBinaryOp(this.Divide, (x, y) => x / y);\n this.AddFloatBinaryOp(this.Mod, (x, y) => x % y);\n this.AddFloatUnaryOp(this.Negate, (x) => -x);\n\n this.AddFloatBinaryOp(this.Equal, (x, y) => x == y);\n this.AddFloatBinaryOp(this.Greater, (x, y) => x > y);\n this.AddFloatBinaryOp(this.Less, (x, y) => x < y);\n this.AddFloatBinaryOp(this.GreaterThanOrEquals, (x, y) => x >= y);\n this.AddFloatBinaryOp(this.LessThanOrEquals, (x, y) => x <= y);\n this.AddFloatBinaryOp(this.NotEquals, (x, y) => x != y);\n this.AddFloatUnaryOp(this.Not, (x) => x == 0.0);\n\n this.AddFloatBinaryOp(this.And, (x, y) => x != 0.0 && y != 0.0);\n this.AddFloatBinaryOp(this.Or, (x, y) => x != 0.0 || y != 0.0);\n\n this.AddFloatBinaryOp(this.Max, (x, y) => Math.max(x, y));\n this.AddFloatBinaryOp(this.Min, (x, y) => Math.min(x, y));\n\n this.AddFloatBinaryOp(this.Pow, (x, y) => Math.pow(x, y));\n this.AddFloatUnaryOp(this.Floor, (x) => Math.floor(x));\n this.AddFloatUnaryOp(this.Ceiling, (x) => Math.ceil(x));\n this.AddFloatUnaryOp(this.Int, (x) => Math.floor(x));\n this.AddFloatUnaryOp(this.Float, NativeFunctionCall.Identity);\n\n // String operations\n this.AddStringBinaryOp(this.Add, (x, y) => x + y); // concat\n this.AddStringBinaryOp(this.Equal, (x, y) => x === y);\n this.AddStringBinaryOp(this.NotEquals, (x, y) => !(x === y));\n this.AddStringBinaryOp(this.Has, (x, y) => x.includes(y));\n this.AddStringBinaryOp(this.Hasnt, (x, y) => !x.includes(y));\n\n this.AddListBinaryOp(this.Add, (x, y) => x.Union(y));\n this.AddListBinaryOp(this.Subtract, (x, y) => x.Without(y));\n this.AddListBinaryOp(this.Has, (x, y) => x.Contains(y));\n this.AddListBinaryOp(this.Hasnt, (x, y) => !x.Contains(y));\n this.AddListBinaryOp(this.Intersect, (x, y) => x.Intersect(y));\n\n this.AddListBinaryOp(this.Equal, (x, y) => x.Equals(y));\n this.AddListBinaryOp(this.Greater, (x, y) => x.GreaterThan(y));\n this.AddListBinaryOp(this.Less, (x, y) => x.LessThan(y));\n this.AddListBinaryOp(this.GreaterThanOrEquals, (x, y) =>\n x.GreaterThanOrEquals(y)\n );\n this.AddListBinaryOp(this.LessThanOrEquals, (x, y) =>\n x.LessThanOrEquals(y)\n );\n this.AddListBinaryOp(this.NotEquals, (x, y) => !x.Equals(y));\n\n this.AddListBinaryOp(this.And, (x, y) => x.Count > 0 && y.Count > 0);\n this.AddListBinaryOp(this.Or, (x, y) => x.Count > 0 || y.Count > 0);\n\n this.AddListUnaryOp(this.Not, (x) => (x.Count == 0 ? 1 : 0));\n\n this.AddListUnaryOp(this.Invert, (x) => x.inverse);\n this.AddListUnaryOp(this.All, (x) => x.all);\n this.AddListUnaryOp(this.ListMin, (x) => x.MinAsList());\n this.AddListUnaryOp(this.ListMax, (x) => x.MaxAsList());\n this.AddListUnaryOp(this.Count, (x) => x.Count);\n this.AddListUnaryOp(this.ValueOfList, (x) => x.maxItem.Value);\n\n let divertTargetsEqual = (d1: Path, d2: Path) => d1.Equals(d2);\n let divertTargetsNotEqual = (d1: Path, d2: Path) => !d1.Equals(d2);\n this.AddOpToNativeFunc(\n this.Equal,\n 2,\n ValueType.DivertTarget,\n divertTargetsEqual\n );\n this.AddOpToNativeFunc(\n this.NotEquals,\n 2,\n ValueType.DivertTarget,\n divertTargetsNotEqual\n );\n }\n }\n\n public AddOpFuncForType(\n valType: ValueType,\n op: UnaryOp | BinaryOp\n ): void {\n if (this._operationFuncs == null) {\n this._operationFuncs = new Map();\n }\n\n this._operationFuncs.set(valType, op);\n }\n\n public static AddOpToNativeFunc(\n name: string,\n args: number,\n valType: ValueType,\n op: UnaryOp | BinaryOp\n ): void {\n if (this._nativeFunctions === null)\n return throwNullException(\"NativeFunctionCall._nativeFunctions\");\n let nativeFunc = this._nativeFunctions.get(name);\n if (!nativeFunc) {\n nativeFunc = new NativeFunctionCall(name, args);\n this._nativeFunctions.set(name, nativeFunc);\n }\n\n nativeFunc.AddOpFuncForType(valType, op);\n }\n\n public static AddIntBinaryOp(name: string, op: BinaryOp) {\n this.AddOpToNativeFunc(name, 2, ValueType.Int, op);\n }\n public static AddIntUnaryOp(name: string, op: UnaryOp) {\n this.AddOpToNativeFunc(name, 1, ValueType.Int, op);\n }\n\n public static AddFloatBinaryOp(name: string, op: BinaryOp) {\n this.AddOpToNativeFunc(name, 2, ValueType.Float, op);\n }\n public static AddFloatUnaryOp(name: string, op: UnaryOp) {\n this.AddOpToNativeFunc(name, 1, ValueType.Float, op);\n }\n\n public static AddStringBinaryOp(name: string, op: BinaryOp) {\n this.AddOpToNativeFunc(name, 2, ValueType.String, op);\n }\n\n public static AddListBinaryOp(name: string, op: BinaryOp) {\n this.AddOpToNativeFunc(name, 2, ValueType.List, op);\n }\n public static AddListUnaryOp(name: string, op: UnaryOp) {\n this.AddOpToNativeFunc(name, 1, ValueType.List, op);\n }\n\n public toString() {\n return 'Native \"' + this.name + '\"';\n }\n\n public _prototype: NativeFunctionCall | null = null;\n public _isPrototype: boolean = false;\n public _operationFuncs: Map | UnaryOp> | null =\n null;\n public static _nativeFunctions: Map | null = null;\n}\n","import { InkObject } from \"./Object\";\n\n// New version of tags is dynamic - it constructs the tags\n// at runtime based on BeginTag and EndTag control commands.\n// Plain text that's in the output stream is turned into tags\n// when you do story.currentTags.\n// The only place this is used is when flattening tags down\n// to string in advance, during dynamic string generation if\n// there's a tag embedded in it. See how ControlCommand.EndString\n// is implemented in Story.cs for more details + comment\nexport class Tag extends InkObject {\n public readonly text: string;\n\n constructor(tagText: string) {\n super();\n this.text = tagText.toString() || \"\";\n }\n\n public toString(): string {\n return \"# \" + this.text;\n }\n}\n","import { Path } from \"./Path\";\nimport { CallStack } from \"./CallStack\";\nimport { throwNullException } from \"./NullException\";\nimport { InkObject } from \"./Object\";\n\nexport class Choice extends InkObject {\n public text: string = \"\";\n public index: number = 0;\n public threadAtGeneration: CallStack.Thread | null = null;\n public sourcePath: string = \"\";\n public targetPath: Path | null = null;\n public isInvisibleDefault: boolean = false;\n public tags: string[] | null = null;\n public originalThreadIndex: number = 0;\n\n get pathStringOnChoice(): string {\n if (this.targetPath === null)\n return throwNullException(\"Choice.targetPath\");\n return this.targetPath.toString();\n }\n set pathStringOnChoice(value: string) {\n this.targetPath = new Path(value);\n }\n}\n","import { InkListItem, SerializedInkListItem } from \"./InkList\";\nimport { TryGetResult } from \"./TryGetResult\";\n\nexport class ListDefinition {\n public _name: string;\n public _items: Map | null;\n public _itemNameToValues: Map;\n\n constructor(name: string, items: Map | null) {\n this._name = name || \"\";\n this._items = null;\n this._itemNameToValues = items || new Map();\n }\n get name() {\n return this._name;\n }\n get items() {\n if (this._items == null) {\n this._items = new Map();\n for (let [key, value] of this._itemNameToValues) {\n let item = new InkListItem(this.name, key);\n this._items.set(item.serialized(), value);\n }\n }\n\n return this._items;\n }\n\n public ValueForItem(item: InkListItem) {\n if (!item.itemName) return 0;\n\n let intVal = this._itemNameToValues.get(item.itemName);\n if (typeof intVal !== \"undefined\") return intVal;\n else return 0;\n }\n public ContainsItem(item: InkListItem) {\n if (!item.itemName) return false;\n if (item.originName != this.name) return false;\n\n return this._itemNameToValues.has(item.itemName);\n }\n public ContainsItemWithName(itemName: string) {\n return this._itemNameToValues.has(itemName);\n }\n public TryGetItemWithValue(\n val: number,\n /* out */ item: InkListItem\n ): TryGetResult {\n for (let [key, value] of this._itemNameToValues) {\n if (value == val) {\n item = new InkListItem(this.name, key);\n return { result: item, exists: true };\n }\n }\n\n item = InkListItem.Null;\n return { result: item, exists: false };\n }\n public TryGetValueForItem(\n item: InkListItem,\n /* out */ intVal: number\n ): TryGetResult {\n if (!item.itemName) return { result: 0, exists: false };\n let value = this._itemNameToValues.get(item.itemName);\n\n if (!value) return { result: 0, exists: false };\n return { result: value, exists: true };\n }\n}\n","import { InkListItem } from \"./InkList\";\nimport { ListValue } from \"./Value\";\nimport { ListDefinition } from \"./ListDefinition\";\nimport { TryGetResult } from \"./TryGetResult\";\nimport { throwNullException } from \"./NullException\";\n\nexport class ListDefinitionsOrigin {\n protected _lists: Map;\n protected _allUnambiguousListValueCache: Map;\n\n constructor(lists: ListDefinition[]) {\n this._lists = new Map();\n this._allUnambiguousListValueCache = new Map();\n\n for (let list of lists) {\n this._lists.set(list.name, list);\n\n for (let [key, val] of list.items) {\n let item = InkListItem.fromSerializedKey(key);\n let listValue = new ListValue(item, val);\n\n if (!item.itemName) {\n throw new Error(\"item.itemName is null or undefined.\");\n }\n\n this._allUnambiguousListValueCache.set(item.itemName, listValue);\n this._allUnambiguousListValueCache.set(item.fullName, listValue);\n }\n }\n }\n get lists(): ListDefinition[] {\n let listOfLists: ListDefinition[] = [];\n\n for (let [, value] of this._lists) {\n listOfLists.push(value);\n }\n\n return listOfLists;\n }\n public TryListGetDefinition(\n name: string | null,\n /* out */ def: ListDefinition | null\n ): TryGetResult {\n if (name === null) {\n return { result: def, exists: false };\n }\n // initially, this function returns a boolean and the second parameter is an out.\n let definition = this._lists.get(name);\n if (!definition) return { result: def, exists: false };\n\n return { result: definition, exists: true };\n }\n public FindSingleItemListWithName(name: string | null) {\n if (name === null) {\n return throwNullException(\"name\");\n }\n let val = this._allUnambiguousListValueCache.get(name);\n\n if (typeof val !== \"undefined\") {\n return val;\n }\n\n return null;\n }\n}\n","import { Container } from \"./Container\";\nimport {\n Value,\n IntValue,\n FloatValue,\n StringValue,\n DivertTargetValue,\n VariablePointerValue,\n ListValue,\n BoolValue,\n} from \"./Value\";\nimport { Glue } from \"./Glue\";\nimport { ControlCommand } from \"./ControlCommand\";\nimport { PushPopType } from \"./PushPop\";\nimport { Divert } from \"./Divert\";\nimport { ChoicePoint } from \"./ChoicePoint\";\nimport { VariableReference } from \"./VariableReference\";\nimport { VariableAssignment } from \"./VariableAssignment\";\nimport { NativeFunctionCall } from \"./NativeFunctionCall\";\nimport { Void } from \"./Void\";\nimport { Tag } from \"./Tag\";\nimport { Path } from \"./Path\";\nimport { Choice } from \"./Choice\";\nimport { ListDefinition } from \"./ListDefinition\";\nimport { ListDefinitionsOrigin } from \"./ListDefinitionsOrigin\";\nimport { InkListItem, InkList } from \"./InkList\";\nimport { InkObject } from \"./Object\";\nimport { asOrNull } from \"./TypeAssertion\";\nimport { throwNullException } from \"./NullException\";\nimport { SimpleJson } from \"./SimpleJson\";\n\nexport class JsonSerialisation {\n public static JArrayToRuntimeObjList(\n jArray: any[],\n skipLast: boolean = false\n ) {\n let count = jArray.length;\n if (skipLast) count--;\n\n let list: InkObject[] = [];\n\n for (let i = 0; i < count; i++) {\n let jTok = jArray[i];\n let runtimeObj = this.JTokenToRuntimeObject(jTok);\n if (runtimeObj === null) {\n return throwNullException(\"runtimeObj\");\n }\n list.push(runtimeObj);\n }\n\n return list;\n }\n\n public static WriteDictionaryRuntimeObjs(\n writer: SimpleJson.Writer,\n dictionary: Map\n ) {\n writer.WriteObjectStart();\n for (let [key, value] of dictionary) {\n writer.WritePropertyStart(key);\n this.WriteRuntimeObject(writer, value);\n writer.WritePropertyEnd();\n }\n writer.WriteObjectEnd();\n }\n\n public static WriteListRuntimeObjs(\n writer: SimpleJson.Writer,\n list: InkObject[]\n ) {\n writer.WriteArrayStart();\n for (let value of list) {\n this.WriteRuntimeObject(writer, value);\n }\n writer.WriteArrayEnd();\n }\n\n public static WriteIntDictionary(\n writer: SimpleJson.Writer,\n dict: Map\n ) {\n writer.WriteObjectStart();\n for (let [key, value] of dict) {\n writer.WriteIntProperty(key, value);\n }\n writer.WriteObjectEnd();\n }\n\n public static WriteRuntimeObject(\n writer: SimpleJson.Writer,\n obj: InkObject\n ): void {\n let container = asOrNull(obj, Container);\n if (container) {\n this.WriteRuntimeContainer(writer, container);\n return;\n }\n\n let divert = asOrNull(obj, Divert);\n if (divert) {\n let divTypeKey = \"->\";\n if (divert.isExternal) {\n divTypeKey = \"x()\";\n } else if (divert.pushesToStack) {\n if (divert.stackPushType == PushPopType.Function) {\n divTypeKey = \"f()\";\n } else if (divert.stackPushType == PushPopType.Tunnel) {\n divTypeKey = \"->t->\";\n }\n }\n\n let targetStr;\n if (divert.hasVariableTarget) {\n targetStr = divert.variableDivertName;\n } else {\n targetStr = divert.targetPathString;\n }\n\n writer.WriteObjectStart();\n writer.WriteProperty(divTypeKey, targetStr);\n\n if (divert.hasVariableTarget) {\n writer.WriteProperty(\"var\", true);\n }\n\n if (divert.isConditional) {\n writer.WriteProperty(\"c\", true);\n }\n\n if (divert.externalArgs > 0) {\n writer.WriteIntProperty(\"exArgs\", divert.externalArgs);\n }\n\n writer.WriteObjectEnd();\n return;\n }\n\n let choicePoint = asOrNull(obj, ChoicePoint);\n if (choicePoint) {\n writer.WriteObjectStart();\n writer.WriteProperty(\"*\", choicePoint.pathStringOnChoice);\n writer.WriteIntProperty(\"flg\", choicePoint.flags);\n writer.WriteObjectEnd();\n return;\n }\n\n let boolVal = asOrNull(obj, BoolValue);\n if (boolVal) {\n writer.WriteBool(boolVal.value);\n return;\n }\n\n let intVal = asOrNull(obj, IntValue);\n if (intVal) {\n writer.WriteInt(intVal.value);\n return;\n }\n\n let floatVal = asOrNull(obj, FloatValue);\n if (floatVal) {\n writer.WriteFloat(floatVal.value);\n return;\n }\n\n let strVal = asOrNull(obj, StringValue);\n if (strVal) {\n if (strVal.isNewline) {\n writer.Write(\"\\n\", false);\n } else {\n writer.WriteStringStart();\n writer.WriteStringInner(\"^\");\n writer.WriteStringInner(strVal.value);\n writer.WriteStringEnd();\n }\n return;\n }\n\n let listVal = asOrNull(obj, ListValue);\n if (listVal) {\n this.WriteInkList(writer, listVal);\n return;\n }\n\n let divTargetVal = asOrNull(obj, DivertTargetValue);\n if (divTargetVal) {\n writer.WriteObjectStart();\n if (divTargetVal.value === null) {\n return throwNullException(\"divTargetVal.value\");\n }\n writer.WriteProperty(\"^->\", divTargetVal.value.componentsString);\n writer.WriteObjectEnd();\n\n return;\n }\n\n let varPtrVal = asOrNull(obj, VariablePointerValue);\n if (varPtrVal) {\n writer.WriteObjectStart();\n writer.WriteProperty(\"^var\", varPtrVal.value);\n writer.WriteIntProperty(\"ci\", varPtrVal.contextIndex);\n writer.WriteObjectEnd();\n return;\n }\n\n let glue = asOrNull(obj, Glue);\n if (glue) {\n writer.Write(\"<>\");\n return;\n }\n\n let controlCmd = asOrNull(obj, ControlCommand);\n if (controlCmd) {\n writer.Write(\n JsonSerialisation._controlCommandNames[controlCmd.commandType]\n );\n return;\n }\n\n let nativeFunc = asOrNull(obj, NativeFunctionCall);\n if (nativeFunc) {\n let name = nativeFunc.name;\n\n if (name == \"^\") name = \"L^\";\n\n writer.Write(name);\n return;\n }\n\n let varRef = asOrNull(obj, VariableReference);\n if (varRef) {\n writer.WriteObjectStart();\n let readCountPath = varRef.pathStringForCount;\n if (readCountPath != null) {\n writer.WriteProperty(\"CNT?\", readCountPath);\n } else {\n writer.WriteProperty(\"VAR?\", varRef.name);\n }\n\n writer.WriteObjectEnd();\n return;\n }\n\n let varAss = asOrNull(obj, VariableAssignment);\n if (varAss) {\n writer.WriteObjectStart();\n\n let key = varAss.isGlobal ? \"VAR=\" : \"temp=\";\n writer.WriteProperty(key, varAss.variableName);\n\n // Reassignment?\n if (!varAss.isNewDeclaration) writer.WriteProperty(\"re\", true);\n\n writer.WriteObjectEnd();\n\n return;\n }\n\n let voidObj = asOrNull(obj, Void);\n if (voidObj) {\n writer.Write(\"void\");\n return;\n }\n\n let tag = asOrNull(obj, Tag);\n if (tag) {\n writer.WriteObjectStart();\n writer.WriteProperty(\"#\", tag.text);\n writer.WriteObjectEnd();\n return;\n }\n\n let choice = asOrNull(obj, Choice);\n if (choice) {\n this.WriteChoice(writer, choice);\n return;\n }\n\n throw new Error(\"Failed to convert runtime object to Json token: \" + obj);\n }\n\n public static JObjectToDictionaryRuntimeObjs(jObject: Record) {\n let dict: Map = new Map();\n\n for (let key in jObject) {\n if (jObject.hasOwnProperty(key)) {\n let inkObject = this.JTokenToRuntimeObject(jObject[key]);\n if (inkObject === null) {\n return throwNullException(\"inkObject\");\n }\n dict.set(key, inkObject);\n }\n }\n\n return dict;\n }\n\n public static JObjectToIntDictionary(jObject: Record) {\n let dict: Map = new Map();\n for (let key in jObject) {\n if (jObject.hasOwnProperty(key)) {\n dict.set(key, parseInt(jObject[key]));\n }\n }\n return dict;\n }\n\n public static JTokenToRuntimeObject(token: any): InkObject | null {\n if (\n (typeof token === \"number\" && !isNaN(token)) ||\n typeof token === \"boolean\"\n ) {\n return Value.Create(token);\n }\n\n if (typeof token === \"string\") {\n let str = token.toString();\n\n // String value\n let firstChar = str[0];\n if (firstChar == \"^\") return new StringValue(str.substring(1));\n else if (firstChar == \"\\n\" && str.length == 1)\n return new StringValue(\"\\n\");\n\n // Glue\n if (str == \"<>\") return new Glue();\n\n // Control commands (would looking up in a hash set be faster?)\n for (let i = 0; i < JsonSerialisation._controlCommandNames.length; ++i) {\n let cmdName = JsonSerialisation._controlCommandNames[i];\n if (str == cmdName) {\n return new ControlCommand(i);\n }\n }\n\n // Native functions\n if (str == \"L^\") str = \"^\";\n if (NativeFunctionCall.CallExistsWithName(str))\n return NativeFunctionCall.CallWithName(str);\n\n // Pop\n if (str == \"->->\") return ControlCommand.PopTunnel();\n else if (str == \"~ret\") return ControlCommand.PopFunction();\n\n // Void\n if (str == \"void\") return new Void();\n }\n\n if (typeof token === \"object\" && !Array.isArray(token)) {\n let obj = token as Record;\n let propValue;\n\n // Divert target value to path\n if (obj[\"^->\"]) {\n propValue = obj[\"^->\"];\n return new DivertTargetValue(new Path(propValue.toString()));\n }\n\n // VariablePointerValue\n if (obj[\"^var\"]) {\n propValue = obj[\"^var\"];\n let varPtr = new VariablePointerValue(propValue.toString());\n if (\"ci\" in obj) {\n propValue = obj[\"ci\"];\n varPtr.contextIndex = parseInt(propValue);\n }\n return varPtr;\n }\n\n // Divert\n let isDivert = false;\n let pushesToStack = false;\n let divPushType = PushPopType.Function;\n let external = false;\n if ((propValue = obj[\"->\"])) {\n isDivert = true;\n } else if ((propValue = obj[\"f()\"])) {\n isDivert = true;\n pushesToStack = true;\n divPushType = PushPopType.Function;\n } else if ((propValue = obj[\"->t->\"])) {\n isDivert = true;\n pushesToStack = true;\n divPushType = PushPopType.Tunnel;\n } else if ((propValue = obj[\"x()\"])) {\n isDivert = true;\n external = true;\n pushesToStack = false;\n divPushType = PushPopType.Function;\n }\n\n if (isDivert) {\n let divert = new Divert();\n divert.pushesToStack = pushesToStack;\n divert.stackPushType = divPushType;\n divert.isExternal = external;\n\n let target = propValue.toString();\n\n if ((propValue = obj[\"var\"])) divert.variableDivertName = target;\n else divert.targetPathString = target;\n\n divert.isConditional = !!obj[\"c\"];\n\n if (external) {\n if ((propValue = obj[\"exArgs\"]))\n divert.externalArgs = parseInt(propValue);\n }\n\n return divert;\n }\n\n // Choice\n if ((propValue = obj[\"*\"])) {\n let choice = new ChoicePoint();\n choice.pathStringOnChoice = propValue.toString();\n\n if ((propValue = obj[\"flg\"])) choice.flags = parseInt(propValue);\n\n return choice;\n }\n\n // Variable reference\n if ((propValue = obj[\"VAR?\"])) {\n return new VariableReference(propValue.toString());\n } else if ((propValue = obj[\"CNT?\"])) {\n let readCountVarRef = new VariableReference();\n readCountVarRef.pathStringForCount = propValue.toString();\n return readCountVarRef;\n }\n\n // Variable assignment\n let isVarAss = false;\n let isGlobalVar = false;\n if ((propValue = obj[\"VAR=\"])) {\n isVarAss = true;\n isGlobalVar = true;\n } else if ((propValue = obj[\"temp=\"])) {\n isVarAss = true;\n isGlobalVar = false;\n }\n if (isVarAss) {\n let varName = propValue.toString();\n let isNewDecl = !obj[\"re\"];\n let varAss = new VariableAssignment(varName, isNewDecl);\n varAss.isGlobal = isGlobalVar;\n return varAss;\n }\n if (obj[\"#\"] !== undefined) {\n propValue = obj[\"#\"];\n return new Tag(propValue.toString());\n }\n\n // List value\n if ((propValue = obj[\"list\"])) {\n // var listContent = (Dictionary)propValue;\n let listContent = propValue as Record;\n let rawList = new InkList();\n if ((propValue = obj[\"origins\"])) {\n // var namesAsObjs = (List)propValue;\n let namesAsObjs = propValue as string[];\n // rawList.SetInitialOriginNames(namesAsObjs.Cast().ToList());\n rawList.SetInitialOriginNames(namesAsObjs);\n }\n\n for (let key in listContent) {\n if (listContent.hasOwnProperty(key)) {\n let nameToVal = listContent[key];\n let item = new InkListItem(key);\n let val = parseInt(nameToVal);\n rawList.Add(item, val);\n }\n }\n\n return new ListValue(rawList);\n }\n\n if (obj[\"originalChoicePath\"] != null) return this.JObjectToChoice(obj);\n }\n\n // Array is always a Runtime.Container\n if (Array.isArray(token)) {\n return this.JArrayToContainer(token);\n }\n\n if (token === null || token === undefined) return null;\n\n throw new Error(\n \"Failed to convert token to runtime object: \" +\n this.toJson(token, [\"parent\"])\n );\n }\n\n public static toJson(\n me: T,\n removes?: (keyof T)[],\n space?: number\n ): string {\n return JSON.stringify(\n me,\n (k, v) => (removes?.some((r) => r === k) ? undefined : v),\n space\n );\n }\n\n public static WriteRuntimeContainer(\n writer: SimpleJson.Writer,\n container: Container | null,\n withoutName: boolean = false\n ) {\n writer.WriteArrayStart();\n if (container === null) {\n return throwNullException(\"container\");\n }\n for (let c of container.content) this.WriteRuntimeObject(writer, c);\n\n let namedOnlyContent = container.namedOnlyContent;\n let countFlags = container.countFlags;\n let hasNameProperty = container.name != null && !withoutName;\n\n let hasTerminator =\n namedOnlyContent != null || countFlags > 0 || hasNameProperty;\n if (hasTerminator) {\n writer.WriteObjectStart();\n }\n\n if (namedOnlyContent != null) {\n for (let [key, value] of namedOnlyContent) {\n let name = key;\n let namedContainer = asOrNull(value, Container);\n writer.WritePropertyStart(name);\n this.WriteRuntimeContainer(writer, namedContainer, true);\n writer.WritePropertyEnd();\n }\n }\n\n if (countFlags > 0) writer.WriteIntProperty(\"#f\", countFlags);\n\n if (hasNameProperty) writer.WriteProperty(\"#n\", container.name);\n\n if (hasTerminator) writer.WriteObjectEnd();\n else writer.WriteNull();\n\n writer.WriteArrayEnd();\n }\n\n public static JArrayToContainer(jArray: any[]) {\n let container = new Container();\n container.content = this.JArrayToRuntimeObjList(jArray, true);\n\n let terminatingObj = jArray[jArray.length - 1] as Record;\n if (terminatingObj != null) {\n let namedOnlyContent = new Map();\n\n for (let key in terminatingObj) {\n if (key == \"#f\") {\n container.countFlags = parseInt(terminatingObj[key]);\n } else if (key == \"#n\") {\n container.name = terminatingObj[key].toString();\n } else {\n let namedContentItem = this.JTokenToRuntimeObject(\n terminatingObj[key]\n );\n // var namedSubContainer = namedContentItem as Container;\n let namedSubContainer = asOrNull(namedContentItem, Container);\n if (namedSubContainer) namedSubContainer.name = key;\n namedOnlyContent.set(key, namedContentItem);\n }\n }\n\n container.namedOnlyContent = namedOnlyContent;\n }\n\n return container;\n }\n\n public static JObjectToChoice(jObj: Record) {\n let choice = new Choice();\n choice.text = jObj[\"text\"].toString();\n choice.index = parseInt(jObj[\"index\"]);\n choice.sourcePath = jObj[\"originalChoicePath\"].toString();\n choice.originalThreadIndex = parseInt(jObj[\"originalThreadIndex\"]);\n choice.pathStringOnChoice = jObj[\"targetPath\"].toString();\n if (jObj[\"tags\"]) {\n choice.tags = jObj[\"tags\"];\n }\n return choice;\n }\n\n public static WriteChoice(writer: SimpleJson.Writer, choice: Choice) {\n writer.WriteObjectStart();\n writer.WriteProperty(\"text\", choice.text);\n writer.WriteIntProperty(\"index\", choice.index);\n writer.WriteProperty(\"originalChoicePath\", choice.sourcePath);\n writer.WriteIntProperty(\"originalThreadIndex\", choice.originalThreadIndex);\n writer.WriteProperty(\"targetPath\", choice.pathStringOnChoice);\n if (choice.tags) {\n writer.WriteProperty(\"tags\", (w) => {\n w.WriteArrayStart();\n for (const tag of choice.tags!) {\n w.WriteStringStart();\n w.WriteStringInner(tag);\n w.WriteStringEnd();\n }\n w.WriteArrayEnd();\n });\n }\n writer.WriteObjectEnd();\n }\n\n public static WriteInkList(writer: SimpleJson.Writer, listVal: ListValue) {\n let rawList = listVal.value;\n if (rawList === null) {\n return throwNullException(\"rawList\");\n }\n\n writer.WriteObjectStart();\n writer.WritePropertyStart(\"list\");\n writer.WriteObjectStart();\n\n for (let [key, val] of rawList) {\n let item = InkListItem.fromSerializedKey(key);\n let itemVal = val;\n\n if (item.itemName === null) {\n return throwNullException(\"item.itemName\");\n }\n\n writer.WritePropertyNameStart();\n writer.WritePropertyNameInner(item.originName ? item.originName : \"?\");\n writer.WritePropertyNameInner(\".\");\n writer.WritePropertyNameInner(item.itemName);\n writer.WritePropertyNameEnd();\n\n writer.Write(itemVal);\n\n writer.WritePropertyEnd();\n }\n\n writer.WriteObjectEnd();\n\n writer.WritePropertyEnd();\n\n if (\n rawList.Count == 0 &&\n rawList.originNames != null &&\n rawList.originNames.length > 0\n ) {\n writer.WritePropertyStart(\"origins\");\n writer.WriteArrayStart();\n for (let name of rawList.originNames) writer.Write(name);\n writer.WriteArrayEnd();\n writer.WritePropertyEnd();\n }\n\n writer.WriteObjectEnd();\n }\n\n public static ListDefinitionsToJToken(origin: ListDefinitionsOrigin) {\n let result: Record = {};\n\n for (let def of origin.lists) {\n let listDefJson: Record = {};\n\n for (let [key, val] of def.items) {\n let item = InkListItem.fromSerializedKey(key);\n if (item.itemName === null) {\n return throwNullException(\"item.itemName\");\n }\n listDefJson[item.itemName] = val;\n }\n\n result[def.name] = listDefJson;\n }\n\n return result;\n }\n\n public static JTokenToListDefinitions(obj: Record) {\n // var defsObj = (Dictionary)obj;\n let defsObj = obj;\n\n let allDefs: ListDefinition[] = [];\n\n for (let key in defsObj) {\n if (defsObj.hasOwnProperty(key)) {\n let name = key.toString();\n // var listDefJson = (Dictionary)kv.Value;\n let listDefJson = defsObj[key] as Record;\n\n // Cast (string, object) to (string, int) for items\n let items: Map = new Map();\n\n for (let nameValueKey in listDefJson) {\n if (defsObj.hasOwnProperty(key)) {\n let nameValue = listDefJson[nameValueKey];\n items.set(nameValueKey, parseInt(nameValue));\n }\n }\n\n let def = new ListDefinition(name, items);\n allDefs.push(def);\n }\n }\n\n return new ListDefinitionsOrigin(allDefs);\n }\n\n private static _controlCommandNames = (() => {\n let _controlCommandNames: string[] = [];\n\n _controlCommandNames[ControlCommand.CommandType.EvalStart] = \"ev\";\n _controlCommandNames[ControlCommand.CommandType.EvalOutput] = \"out\";\n _controlCommandNames[ControlCommand.CommandType.EvalEnd] = \"/ev\";\n _controlCommandNames[ControlCommand.CommandType.Duplicate] = \"du\";\n _controlCommandNames[ControlCommand.CommandType.PopEvaluatedValue] = \"pop\";\n _controlCommandNames[ControlCommand.CommandType.PopFunction] = \"~ret\";\n _controlCommandNames[ControlCommand.CommandType.PopTunnel] = \"->->\";\n _controlCommandNames[ControlCommand.CommandType.BeginString] = \"str\";\n _controlCommandNames[ControlCommand.CommandType.EndString] = \"/str\";\n _controlCommandNames[ControlCommand.CommandType.NoOp] = \"nop\";\n _controlCommandNames[ControlCommand.CommandType.ChoiceCount] = \"choiceCnt\";\n _controlCommandNames[ControlCommand.CommandType.Turns] = \"turn\";\n _controlCommandNames[ControlCommand.CommandType.TurnsSince] = \"turns\";\n _controlCommandNames[ControlCommand.CommandType.ReadCount] = \"readc\";\n _controlCommandNames[ControlCommand.CommandType.Random] = \"rnd\";\n _controlCommandNames[ControlCommand.CommandType.SeedRandom] = \"srnd\";\n _controlCommandNames[ControlCommand.CommandType.VisitIndex] = \"visit\";\n _controlCommandNames[ControlCommand.CommandType.SequenceShuffleIndex] =\n \"seq\";\n _controlCommandNames[ControlCommand.CommandType.StartThread] = \"thread\";\n _controlCommandNames[ControlCommand.CommandType.Done] = \"done\";\n _controlCommandNames[ControlCommand.CommandType.End] = \"end\";\n _controlCommandNames[ControlCommand.CommandType.ListFromInt] = \"listInt\";\n _controlCommandNames[ControlCommand.CommandType.ListRange] = \"range\";\n _controlCommandNames[ControlCommand.CommandType.ListRandom] = \"lrnd\";\n _controlCommandNames[ControlCommand.CommandType.BeginTag] = \"#\";\n _controlCommandNames[ControlCommand.CommandType.EndTag] = \"/#\";\n\n for (let i = 0; i < ControlCommand.CommandType.TOTAL_VALUES; ++i) {\n if (_controlCommandNames[i] == null)\n throw new Error(\"Control command not accounted for in serialisation\");\n }\n\n return _controlCommandNames;\n })();\n}\n","import { PushPopType } from \"./PushPop\";\nimport { Path } from \"./Path\";\nimport { Story } from \"./Story\";\nimport { JsonSerialisation } from \"./JsonSerialisation\";\nimport { ListValue } from \"./Value\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { Pointer } from \"./Pointer\";\nimport { InkObject } from \"./Object\";\nimport { Debug } from \"./Debug\";\nimport { tryGetValueFromMap } from \"./TryGetResult\";\nimport { throwNullException } from \"./NullException\";\nimport { SimpleJson } from \"./SimpleJson\";\n\nexport class CallStack {\n get elements() {\n return this.callStack;\n }\n\n get depth() {\n return this.elements.length;\n }\n\n get currentElement() {\n let thread = this._threads[this._threads.length - 1];\n let cs = thread.callstack;\n return cs[cs.length - 1];\n }\n\n get currentElementIndex() {\n return this.callStack.length - 1;\n }\n\n get currentThread(): CallStack.Thread {\n return this._threads[this._threads.length - 1];\n }\n set currentThread(value: CallStack.Thread) {\n Debug.Assert(\n this._threads.length == 1,\n \"Shouldn't be directly setting the current thread when we have a stack of them\"\n );\n\n this._threads.length = 0;\n this._threads.push(value);\n }\n\n get canPop() {\n return this.callStack.length > 1;\n }\n\n constructor(storyContext: Story);\n constructor(toCopy: CallStack);\n constructor() {\n if (arguments[0] instanceof Story) {\n let storyContext = arguments[0] as Story;\n\n this._startOfRoot = Pointer.StartOf(storyContext.rootContentContainer);\n this.Reset();\n } else {\n let toCopy = arguments[0] as CallStack;\n\n this._threads = [];\n for (let otherThread of toCopy._threads) {\n this._threads.push(otherThread.Copy());\n }\n this._threadCounter = toCopy._threadCounter;\n this._startOfRoot = toCopy._startOfRoot.copy();\n }\n }\n\n public Reset() {\n this._threads = [];\n this._threads.push(new CallStack.Thread());\n\n this._threads[0].callstack.push(\n new CallStack.Element(PushPopType.Tunnel, this._startOfRoot)\n );\n }\n\n public SetJsonToken(jObject: Record, storyContext: Story) {\n this._threads.length = 0;\n\n // TODO: (List) jObject [\"threads\"];\n let jThreads: any[] = jObject[\"threads\"];\n\n for (let jThreadTok of jThreads) {\n // TODO: var jThreadObj = (Dictionary)jThreadTok;\n let jThreadObj = jThreadTok;\n let thread = new CallStack.Thread(jThreadObj, storyContext);\n this._threads.push(thread);\n }\n\n // TODO: (int)jObject [\"threadCounter\"];\n this._threadCounter = parseInt(jObject[\"threadCounter\"]);\n this._startOfRoot = Pointer.StartOf(storyContext.rootContentContainer);\n }\n public WriteJson(w: SimpleJson.Writer) {\n w.WriteObject((writer) => {\n writer.WritePropertyStart(\"threads\");\n writer.WriteArrayStart();\n\n for (let thread of this._threads) {\n thread.WriteJson(writer);\n }\n\n writer.WriteArrayEnd();\n writer.WritePropertyEnd();\n\n writer.WritePropertyStart(\"threadCounter\");\n writer.WriteInt(this._threadCounter);\n writer.WritePropertyEnd();\n });\n }\n\n public PushThread() {\n let newThread = this.currentThread.Copy();\n this._threadCounter++;\n newThread.threadIndex = this._threadCounter;\n this._threads.push(newThread);\n }\n\n public ForkThread() {\n let forkedThread = this.currentThread.Copy();\n this._threadCounter++;\n forkedThread.threadIndex = this._threadCounter;\n return forkedThread;\n }\n\n public PopThread() {\n if (this.canPopThread) {\n this._threads.splice(this._threads.indexOf(this.currentThread), 1); // should be equivalent to a pop()\n } else {\n throw new Error(\"Can't pop thread\");\n }\n }\n\n get canPopThread() {\n return this._threads.length > 1 && !this.elementIsEvaluateFromGame;\n }\n\n get elementIsEvaluateFromGame() {\n return this.currentElement.type == PushPopType.FunctionEvaluationFromGame;\n }\n\n public Push(\n type: PushPopType,\n externalEvaluationStackHeight: number = 0,\n outputStreamLengthWithPushed: number = 0\n ) {\n let element = new CallStack.Element(\n type,\n this.currentElement.currentPointer,\n false\n );\n\n element.evaluationStackHeightWhenPushed = externalEvaluationStackHeight;\n element.functionStartInOutputStream = outputStreamLengthWithPushed;\n\n this.callStack.push(element);\n }\n\n public CanPop(type: PushPopType | null = null) {\n if (!this.canPop) return false;\n\n if (type == null) return true;\n\n return this.currentElement.type == type;\n }\n\n public Pop(type: PushPopType | null = null) {\n if (this.CanPop(type)) {\n this.callStack.pop();\n return;\n } else {\n throw new Error(\"Mismatched push/pop in Callstack\");\n }\n }\n\n public GetTemporaryVariableWithName(\n name: string | null,\n contextIndex: number = -1\n ) {\n if (contextIndex == -1) contextIndex = this.currentElementIndex + 1;\n\n let contextElement = this.callStack[contextIndex - 1];\n\n let varValue = tryGetValueFromMap(\n contextElement.temporaryVariables,\n name,\n null\n );\n if (varValue.exists) {\n return varValue.result;\n } else {\n return null;\n }\n }\n\n public SetTemporaryVariable(\n name: string,\n value: any,\n declareNew: boolean,\n contextIndex: number = -1\n ) {\n if (contextIndex == -1) contextIndex = this.currentElementIndex + 1;\n\n let contextElement = this.callStack[contextIndex - 1];\n\n if (!declareNew && !contextElement.temporaryVariables.get(name)) {\n throw new Error(\"Could not find temporary variable to set: \" + name);\n }\n\n let oldValue = tryGetValueFromMap(\n contextElement.temporaryVariables,\n name,\n null\n );\n if (oldValue.exists)\n ListValue.RetainListOriginsForAssignment(oldValue.result, value);\n\n contextElement.temporaryVariables.set(name, value);\n }\n\n public ContextForVariableNamed(name: string) {\n if (this.currentElement.temporaryVariables.get(name)) {\n return this.currentElementIndex + 1;\n } else {\n return 0;\n }\n }\n\n public ThreadWithIndex(index: number) {\n let filtered = this._threads.filter((t) => {\n if (t.threadIndex == index) return t;\n });\n\n return filtered.length > 0 ? filtered[0] : null;\n }\n\n get callStack() {\n return this.currentThread.callstack;\n }\n\n get callStackTrace() {\n let sb = new StringBuilder();\n\n for (let t = 0; t < this._threads.length; t++) {\n let thread = this._threads[t];\n let isCurrent = t == this._threads.length - 1;\n sb.AppendFormat(\n \"=== THREAD {0}/{1} {2}===\\n\",\n t + 1,\n this._threads.length,\n isCurrent ? \"(current) \" : \"\"\n );\n\n for (let i = 0; i < thread.callstack.length; i++) {\n if (thread.callstack[i].type == PushPopType.Function)\n sb.Append(\" [FUNCTION] \");\n else sb.Append(\" [TUNNEL] \");\n\n let pointer = thread.callstack[i].currentPointer;\n if (!pointer.isNull) {\n sb.Append(\"\");\n }\n }\n }\n\n return sb.toString();\n }\n\n public _threads!: CallStack.Thread[]; // Banged because it's initialized in Reset().\n public _threadCounter: number = 0;\n public _startOfRoot: Pointer = Pointer.Null;\n}\n\nexport namespace CallStack {\n export class Element {\n public currentPointer: Pointer;\n public inExpressionEvaluation: boolean;\n public temporaryVariables: Map;\n public type: PushPopType;\n\n public evaluationStackHeightWhenPushed: number = 0;\n public functionStartInOutputStream: number = 0;\n\n constructor(\n type: PushPopType,\n pointer: Pointer,\n inExpressionEvaluation: boolean = false\n ) {\n this.currentPointer = pointer.copy();\n this.inExpressionEvaluation = inExpressionEvaluation;\n this.temporaryVariables = new Map();\n this.type = type;\n }\n\n public Copy() {\n let copy = new Element(\n this.type,\n this.currentPointer,\n this.inExpressionEvaluation\n );\n copy.temporaryVariables = new Map(this.temporaryVariables);\n copy.evaluationStackHeightWhenPushed =\n this.evaluationStackHeightWhenPushed;\n copy.functionStartInOutputStream = this.functionStartInOutputStream;\n return copy;\n }\n }\n\n export class Thread {\n public callstack: Element[];\n public threadIndex: number = 0;\n public previousPointer: Pointer = Pointer.Null;\n\n constructor();\n constructor(jThreadObj: any, storyContext: Story);\n constructor() {\n this.callstack = [];\n\n if (arguments[0] && arguments[1]) {\n let jThreadObj = arguments[0];\n let storyContext = arguments[1];\n\n // TODO: (int) jThreadObj['threadIndex'] can raise;\n this.threadIndex = parseInt(jThreadObj[\"threadIndex\"]);\n\n let jThreadCallstack = jThreadObj[\"callstack\"];\n\n for (let jElTok of jThreadCallstack) {\n let jElementObj = jElTok;\n\n // TODO: (int) jElementObj['type'] can raise;\n let pushPopType: PushPopType = parseInt(jElementObj[\"type\"]);\n\n let pointer = Pointer.Null;\n\n let currentContainerPathStr: string;\n // TODO: jElementObj.TryGetValue (\"cPath\", out currentContainerPathStrToken);\n let currentContainerPathStrToken = jElementObj[\"cPath\"];\n if (typeof currentContainerPathStrToken !== \"undefined\") {\n currentContainerPathStr = currentContainerPathStrToken.toString();\n\n let threadPointerResult = storyContext.ContentAtPath(\n new Path(currentContainerPathStr)\n );\n pointer.container = threadPointerResult.container;\n pointer.index = parseInt(jElementObj[\"idx\"]);\n\n if (threadPointerResult.obj == null)\n throw new Error(\n \"When loading state, internal story location couldn't be found: \" +\n currentContainerPathStr +\n \". Has the story changed since this save data was created?\"\n );\n else if (threadPointerResult.approximate) {\n if (pointer.container === null) {\n return throwNullException(\"pointer.container\");\n }\n storyContext.Warning(\n \"When loading state, exact internal story location couldn't be found: '\" +\n currentContainerPathStr +\n \"', so it was approximated to '\" +\n pointer.container.path.toString() +\n \"' to recover. Has the story changed since this save data was created?\"\n );\n }\n }\n\n let inExpressionEvaluation = !!jElementObj[\"exp\"];\n\n let el = new Element(pushPopType, pointer, inExpressionEvaluation);\n\n let temps = jElementObj[\"temp\"];\n if (typeof temps !== \"undefined\") {\n el.temporaryVariables =\n JsonSerialisation.JObjectToDictionaryRuntimeObjs(temps);\n } else {\n el.temporaryVariables.clear();\n }\n\n this.callstack.push(el);\n }\n\n let prevContentObjPath = jThreadObj[\"previousContentObject\"];\n if (typeof prevContentObjPath !== \"undefined\") {\n let prevPath = new Path(prevContentObjPath.toString());\n this.previousPointer = storyContext.PointerAtPath(prevPath);\n }\n }\n }\n\n public Copy() {\n let copy = new Thread();\n copy.threadIndex = this.threadIndex;\n for (let e of this.callstack) {\n copy.callstack.push(e.Copy());\n }\n copy.previousPointer = this.previousPointer.copy();\n return copy;\n }\n\n public WriteJson(writer: SimpleJson.Writer) {\n writer.WriteObjectStart();\n\n writer.WritePropertyStart(\"callstack\");\n writer.WriteArrayStart();\n for (let el of this.callstack) {\n writer.WriteObjectStart();\n if (!el.currentPointer.isNull) {\n if (el.currentPointer.container === null) {\n return throwNullException(\"el.currentPointer.container\");\n }\n writer.WriteProperty(\n \"cPath\",\n el.currentPointer.container.path.componentsString\n );\n writer.WriteIntProperty(\"idx\", el.currentPointer.index);\n }\n\n writer.WriteProperty(\"exp\", el.inExpressionEvaluation);\n writer.WriteIntProperty(\"type\", el.type);\n\n if (el.temporaryVariables.size > 0) {\n writer.WritePropertyStart(\"temp\");\n JsonSerialisation.WriteDictionaryRuntimeObjs(\n writer,\n el.temporaryVariables\n );\n writer.WritePropertyEnd();\n }\n\n writer.WriteObjectEnd();\n }\n writer.WriteArrayEnd();\n writer.WritePropertyEnd();\n\n writer.WriteIntProperty(\"threadIndex\", this.threadIndex);\n\n if (!this.previousPointer.isNull) {\n let resolvedPointer = this.previousPointer.Resolve();\n if (resolvedPointer === null) {\n return throwNullException(\"this.previousPointer.Resolve()\");\n }\n writer.WriteProperty(\n \"previousContentObject\",\n resolvedPointer.path.toString()\n );\n }\n\n writer.WriteObjectEnd();\n }\n }\n}\n","import {\n AbstractValue,\n Value,\n VariablePointerValue,\n ListValue,\n IntValue,\n FloatValue,\n BoolValue,\n} from \"./Value\";\nimport { VariableAssignment } from \"./VariableAssignment\";\nimport { InkObject } from \"./Object\";\nimport { ListDefinitionsOrigin } from \"./ListDefinitionsOrigin\";\nimport { StoryException } from \"./StoryException\";\nimport { JsonSerialisation } from \"./JsonSerialisation\";\nimport { asOrThrows, asOrNull, isEquatable } from \"./TypeAssertion\";\nimport { tryGetValueFromMap } from \"./TryGetResult\";\nimport { throwNullException } from \"./NullException\";\nimport { CallStack } from \"./CallStack\";\nimport { StatePatch } from \"./StatePatch\";\nimport { SimpleJson } from \"./SimpleJson\";\nimport { InkList } from \"./Story\";\nimport { Path } from \"./Path\";\n\n// Fake class wrapper around VariableState to have correct typing\n// when using the Proxy syntax in typescript\nfunction VariablesStateAccessor(): new () => Pick {\n return class {} as any;\n}\n\ntype VariableStateValue = boolean | string | number | InkList | Path | null;\n\nexport class VariablesState extends VariablesStateAccessor<\n Record\n>() {\n // The way variableChangedEvent is a bit different than the reference implementation.\n // Originally it uses the C# += operator to add delegates, but in js we need to maintain\n // an actual collection of delegates (ie. callbacks) to register a new one, there is a\n // special ObserveVariableChange method below.\n public variableChangedEventCallbacks: Array<\n (variableName: string, newValue: InkObject) => void\n > = [];\n public variableChangedEvent(variableName: string, newValue: InkObject): void {\n for (let callback of this.variableChangedEventCallbacks) {\n callback(variableName, newValue);\n }\n }\n\n public patch: StatePatch | null = null;\n\n get batchObservingVariableChanges() {\n return this._batchObservingVariableChanges;\n }\n set batchObservingVariableChanges(value: boolean) {\n this._batchObservingVariableChanges = value;\n if (value) {\n this._changedVariablesForBatchObs = new Set();\n } else {\n if (this._changedVariablesForBatchObs != null) {\n for (let variableName of this._changedVariablesForBatchObs) {\n let currentValue = this._globalVariables.get(variableName);\n if (!currentValue) {\n throwNullException(\"currentValue\");\n } else {\n this.variableChangedEvent(variableName, currentValue);\n }\n }\n\n this._changedVariablesForBatchObs = null;\n }\n }\n }\n\n get callStack() {\n return this._callStack;\n }\n set callStack(callStack) {\n this._callStack = callStack;\n }\n\n private _batchObservingVariableChanges: boolean = false;\n\n // the original code uses a magic getter and setter for global variables,\n // allowing things like variableState['varname]. This is not quite possible\n // in js without a Proxy, so it is replaced with this $ function.\n public $(variableName: string): VariableStateValue;\n public $(variableName: string, value: VariableStateValue): void;\n public $(variableName: string, value?: any) {\n if (typeof value === \"undefined\") {\n let varContents = null;\n\n if (this.patch !== null) {\n varContents = this.patch.TryGetGlobal(variableName, null);\n if (varContents.exists)\n return (varContents.result as AbstractValue).valueObject;\n }\n\n varContents = this._globalVariables.get(variableName);\n\n if (typeof varContents === \"undefined\") {\n varContents = this._defaultGlobalVariables.get(variableName);\n }\n\n if (typeof varContents !== \"undefined\")\n return (varContents as AbstractValue).valueObject;\n else return null;\n } else {\n if (typeof this._defaultGlobalVariables.get(variableName) === \"undefined\")\n throw new StoryException(\n \"Cannot assign to a variable (\" +\n variableName +\n \") that hasn't been declared in the story\"\n );\n\n let val = Value.Create(value);\n if (val == null) {\n if (value == null) {\n throw new Error(\"Cannot pass null to VariableState\");\n } else {\n throw new Error(\n \"Invalid value passed to VariableState: \" + value.toString()\n );\n }\n }\n\n this.SetGlobal(variableName, val);\n }\n }\n\n constructor(\n callStack: CallStack,\n listDefsOrigin: ListDefinitionsOrigin | null\n ) {\n super();\n this._globalVariables = new Map();\n this._callStack = callStack;\n this._listDefsOrigin = listDefsOrigin;\n\n // if es6 proxies are available, use them.\n try {\n // the proxy is used to allow direct manipulation of global variables.\n // It first tries to access the objects own property, and if none is\n // found it delegates the call to the $ method, defined below\n let p = new Proxy(this, {\n get(target: any, name) {\n return name in target ? target[name] : target.$(name);\n },\n set(target: any, name, value) {\n if (name in target) target[name] = value;\n else target.$(name, value);\n return true; // returning a falsy value make the trap fail\n },\n });\n\n return p;\n } catch (e) {\n // the proxy object is not available in this context. we should warn the\n // dev but writing to the console feels a bit intrusive.\n // console.log(\"ES6 Proxy not available - direct manipulation of global variables can't work, use $() instead.\");\n }\n }\n\n public ApplyPatch() {\n if (this.patch === null) {\n return throwNullException(\"this.patch\");\n }\n\n for (let [namedVarKey, namedVarValue] of this.patch.globals) {\n this._globalVariables.set(namedVarKey, namedVarValue);\n }\n\n if (this._changedVariablesForBatchObs !== null) {\n for (let name of this.patch.changedVariables) {\n this._changedVariablesForBatchObs.add(name);\n }\n }\n\n this.patch = null;\n }\n\n public SetJsonToken(jToken: Record) {\n this._globalVariables.clear();\n\n for (let [varValKey, varValValue] of this._defaultGlobalVariables) {\n let loadedToken = jToken[varValKey];\n if (typeof loadedToken !== \"undefined\") {\n let tokenInkObject =\n JsonSerialisation.JTokenToRuntimeObject(loadedToken);\n if (tokenInkObject === null) {\n return throwNullException(\"tokenInkObject\");\n }\n this._globalVariables.set(varValKey, tokenInkObject);\n } else {\n this._globalVariables.set(varValKey, varValValue);\n }\n }\n }\n\n public static dontSaveDefaultValues: boolean = true;\n\n public WriteJson(writer: SimpleJson.Writer) {\n writer.WriteObjectStart();\n for (let [keyValKey, keyValValue] of this._globalVariables) {\n let name = keyValKey;\n let val = keyValValue;\n\n if (VariablesState.dontSaveDefaultValues) {\n if (this._defaultGlobalVariables.has(name)) {\n let defaultVal = this._defaultGlobalVariables.get(name)!;\n if (this.RuntimeObjectsEqual(val, defaultVal)) continue;\n }\n }\n\n writer.WritePropertyStart(name);\n JsonSerialisation.WriteRuntimeObject(writer, val);\n writer.WritePropertyEnd();\n }\n writer.WriteObjectEnd();\n }\n\n public RuntimeObjectsEqual(\n obj1: InkObject | null,\n obj2: InkObject | null\n ): boolean {\n if (obj1 === null) {\n return throwNullException(\"obj1\");\n }\n if (obj2 === null) {\n return throwNullException(\"obj2\");\n }\n\n if (obj1.constructor !== obj2.constructor) return false;\n\n let boolVal = asOrNull(obj1, BoolValue);\n if (boolVal !== null) {\n return boolVal.value === asOrThrows(obj2, BoolValue).value;\n }\n\n let intVal = asOrNull(obj1, IntValue);\n if (intVal !== null) {\n return intVal.value === asOrThrows(obj2, IntValue).value;\n }\n\n let floatVal = asOrNull(obj1, FloatValue);\n if (floatVal !== null) {\n return floatVal.value === asOrThrows(obj2, FloatValue).value;\n }\n\n let val1 = asOrNull(obj1, Value);\n let val2 = asOrNull(obj2, Value);\n if (val1 !== null && val2 !== null) {\n if (isEquatable(val1.valueObject) && isEquatable(val2.valueObject)) {\n return val1.valueObject.Equals(val2.valueObject);\n } else {\n return val1.valueObject === val2.valueObject;\n }\n }\n\n throw new Error(\n \"FastRoughDefinitelyEquals: Unsupported runtime object type: \" +\n obj1.constructor.name\n );\n }\n\n public GetVariableWithName(\n name: string | null,\n contextIndex: number = -1\n ): InkObject | null {\n let varValue = this.GetRawVariableWithName(name, contextIndex);\n\n // var varPointer = varValue as VariablePointerValue;\n let varPointer = asOrNull(varValue, VariablePointerValue);\n if (varPointer !== null) {\n varValue = this.ValueAtVariablePointer(varPointer);\n }\n\n return varValue;\n }\n\n public TryGetDefaultVariableValue(name: string | null): InkObject | null {\n let val = tryGetValueFromMap(this._defaultGlobalVariables, name, null);\n return val.exists ? val.result : null;\n }\n\n public GlobalVariableExistsWithName(name: string) {\n return (\n this._globalVariables.has(name) ||\n (this._defaultGlobalVariables !== null &&\n this._defaultGlobalVariables.has(name))\n );\n }\n\n public GetRawVariableWithName(name: string | null, contextIndex: number) {\n let varValue: InkObject | null = null;\n\n if (contextIndex == 0 || contextIndex == -1) {\n let variableValue = null;\n if (this.patch !== null) {\n variableValue = this.patch.TryGetGlobal(name, null);\n if (variableValue.exists) return variableValue.result!;\n }\n\n // this is a conditional assignment\n variableValue = tryGetValueFromMap(this._globalVariables, name, null);\n if (variableValue.exists) return variableValue.result;\n\n if (this._defaultGlobalVariables !== null) {\n variableValue = tryGetValueFromMap(\n this._defaultGlobalVariables,\n name,\n null\n );\n if (variableValue.exists) return variableValue.result;\n }\n\n if (this._listDefsOrigin === null)\n return throwNullException(\"VariablesState._listDefsOrigin\");\n let listItemValue = this._listDefsOrigin.FindSingleItemListWithName(name);\n if (listItemValue) return listItemValue;\n }\n\n varValue = this._callStack.GetTemporaryVariableWithName(name, contextIndex);\n\n return varValue;\n }\n\n public ValueAtVariablePointer(pointer: VariablePointerValue) {\n return this.GetVariableWithName(pointer.variableName, pointer.contextIndex);\n }\n\n public Assign(varAss: VariableAssignment, value: InkObject) {\n let name = varAss.variableName;\n if (name === null) {\n return throwNullException(\"name\");\n }\n let contextIndex = -1;\n\n let setGlobal = false;\n if (varAss.isNewDeclaration) {\n setGlobal = varAss.isGlobal;\n } else {\n setGlobal = this.GlobalVariableExistsWithName(name);\n }\n\n if (varAss.isNewDeclaration) {\n // var varPointer = value as VariablePointerValue;\n let varPointer = asOrNull(value, VariablePointerValue);\n if (varPointer !== null) {\n let fullyResolvedVariablePointer =\n this.ResolveVariablePointer(varPointer);\n value = fullyResolvedVariablePointer;\n }\n } else {\n let existingPointer = null;\n do {\n // existingPointer = GetRawVariableWithName (name, contextIndex) as VariablePointerValue;\n existingPointer = asOrNull(\n this.GetRawVariableWithName(name, contextIndex),\n VariablePointerValue\n );\n if (existingPointer != null) {\n name = existingPointer.variableName;\n contextIndex = existingPointer.contextIndex;\n setGlobal = contextIndex == 0;\n }\n } while (existingPointer != null);\n }\n\n if (setGlobal) {\n this.SetGlobal(name, value);\n } else {\n this._callStack.SetTemporaryVariable(\n name,\n value,\n varAss.isNewDeclaration,\n contextIndex\n );\n }\n }\n\n public SnapshotDefaultGlobals() {\n this._defaultGlobalVariables = new Map(this._globalVariables);\n }\n\n public RetainListOriginsForAssignment(\n oldValue: InkObject,\n newValue: InkObject\n ) {\n let oldList = asOrThrows(oldValue, ListValue);\n let newList = asOrThrows(newValue, ListValue);\n\n if (oldList.value && newList.value && newList.value.Count == 0) {\n newList.value.SetInitialOriginNames(oldList.value.originNames);\n }\n }\n\n public SetGlobal(variableName: string | null, value: InkObject) {\n let oldValue = null;\n\n if (this.patch === null) {\n oldValue = tryGetValueFromMap(this._globalVariables, variableName, null);\n }\n\n if (this.patch !== null) {\n oldValue = this.patch.TryGetGlobal(variableName, null);\n if (!oldValue.exists) {\n oldValue = tryGetValueFromMap(\n this._globalVariables,\n variableName,\n null\n );\n }\n }\n\n ListValue.RetainListOriginsForAssignment(oldValue!.result!, value);\n\n if (variableName === null) {\n return throwNullException(\"variableName\");\n }\n\n if (this.patch !== null) {\n this.patch.SetGlobal(variableName, value);\n } else {\n this._globalVariables.set(variableName, value);\n }\n\n // TODO: Not sure !== is equivalent to !value.Equals(oldValue)\n if (\n this.variableChangedEvent !== null &&\n oldValue !== null &&\n value !== oldValue.result\n ) {\n if (this.batchObservingVariableChanges) {\n if (this._changedVariablesForBatchObs === null) {\n return throwNullException(\"this._changedVariablesForBatchObs\");\n }\n\n if (this.patch !== null) {\n this.patch.AddChangedVariable(variableName);\n } else if (this._changedVariablesForBatchObs !== null) {\n this._changedVariablesForBatchObs.add(variableName);\n }\n } else {\n this.variableChangedEvent(variableName, value);\n }\n }\n }\n\n public ResolveVariablePointer(varPointer: VariablePointerValue) {\n let contextIndex = varPointer.contextIndex;\n\n if (contextIndex == -1)\n contextIndex = this.GetContextIndexOfVariableNamed(\n varPointer.variableName\n );\n\n let valueOfVariablePointedTo = this.GetRawVariableWithName(\n varPointer.variableName,\n contextIndex\n );\n\n // var doubleRedirectionPointer = valueOfVariablePointedTo as VariablePointerValue;\n let doubleRedirectionPointer = asOrNull(\n valueOfVariablePointedTo,\n VariablePointerValue\n );\n if (doubleRedirectionPointer != null) {\n return doubleRedirectionPointer;\n } else {\n return new VariablePointerValue(varPointer.variableName, contextIndex);\n }\n }\n\n public GetContextIndexOfVariableNamed(varName: string) {\n if (this.GlobalVariableExistsWithName(varName)) return 0;\n\n return this._callStack.currentElementIndex;\n }\n\n /**\n * This function is specific to the js version of ink. It allows to register a\n * callback that will be called when a variable changes. The original code uses\n * `state.variableChangedEvent += callback` instead.\n *\n * @param {function} callback\n */\n public ObserveVariableChange(\n callback: (variableName: string, newValue: InkObject) => void\n ) {\n this.variableChangedEventCallbacks.push(callback);\n }\n\n private _globalVariables: Map;\n private _defaultGlobalVariables: Map = new Map();\n\n private _callStack: CallStack;\n private _changedVariablesForBatchObs: Set | null = new Set();\n private _listDefsOrigin: ListDefinitionsOrigin | null;\n}\n","// Taken from https://gist.github.com/blixt/f17b47c62508be59987b\n// Ink uses a seedable PRNG of which there is none in native javascript.\nexport class PRNG {\n private seed: number;\n\n constructor(seed: number) {\n this.seed = seed % 2147483647;\n if (this.seed <= 0) this.seed += 2147483646;\n }\n public next(): number {\n return (this.seed = (this.seed * 48271) % 2147483647);\n }\n public nextFloat(): number {\n return (this.next() - 1) / 2147483646;\n }\n}\n","import { InkObject } from \"./Object\";\nimport { Container } from \"./Container\";\n\nexport class StatePatch {\n get globals() {\n return this._globals;\n }\n get changedVariables() {\n return this._changedVariables;\n }\n get visitCounts() {\n return this._visitCounts;\n }\n get turnIndices() {\n return this._turnIndices;\n }\n\n constructor();\n constructor(toCopy: StatePatch | null);\n constructor() {\n if (arguments.length === 1 && arguments[0] !== null) {\n let toCopy = arguments[0] as StatePatch;\n this._globals = new Map(toCopy._globals);\n this._changedVariables = new Set(toCopy._changedVariables);\n this._visitCounts = new Map(toCopy._visitCounts);\n this._turnIndices = new Map(toCopy._turnIndices);\n } else {\n this._globals = new Map();\n this._changedVariables = new Set();\n this._visitCounts = new Map();\n this._turnIndices = new Map();\n }\n }\n\n public TryGetGlobal(name: string | null, /* out */ value: InkObject | null) {\n if (name !== null && this._globals.has(name)) {\n return { result: this._globals.get(name), exists: true };\n }\n\n return { result: value, exists: false };\n }\n\n public SetGlobal(name: string, value: InkObject) {\n this._globals.set(name, value);\n }\n\n public AddChangedVariable(name: string) {\n return this._changedVariables.add(name);\n }\n\n public TryGetVisitCount(container: Container, /* out */ count: number) {\n if (this._visitCounts.has(container)) {\n return { result: this._visitCounts.get(container), exists: true };\n }\n\n return { result: count, exists: false };\n }\n\n public SetVisitCount(container: Container, count: number) {\n this._visitCounts.set(container, count);\n }\n\n public SetTurnIndex(container: Container, index: number) {\n this._turnIndices.set(container, index);\n }\n\n public TryGetTurnIndex(container: Container, /* out */ index: number) {\n if (this._turnIndices.has(container)) {\n return { result: this._turnIndices.get(container), exists: true };\n }\n\n return { result: index, exists: false };\n }\n\n private _globals: Map;\n private _changedVariables: Set = new Set();\n private _visitCounts: Map = new Map();\n private _turnIndices: Map = new Map();\n}\n","export class SimpleJson {\n public static TextToDictionary(text: string) {\n return new SimpleJson.Reader(text).ToDictionary();\n }\n\n public static TextToArray(text: string) {\n return new SimpleJson.Reader(text).ToArray();\n }\n}\n\nexport namespace SimpleJson {\n export class Reader {\n constructor(text: string) {\n this._rootObject = JSON.parse(text);\n }\n\n public ToDictionary() {\n return this._rootObject as Record;\n }\n\n public ToArray() {\n return this._rootObject as any[];\n }\n\n private _rootObject: any[] | Record;\n }\n\n // In C#, this class writes json tokens directly to a StringWriter or\n // another stream. Here, a temporary hierarchy is created in the form\n // of a javascript object, which is serialised in the `toString` method.\n // See individual methods and properties for more information.\n export class Writer {\n public WriteObject(inner: (w: Writer) => void) {\n this.WriteObjectStart();\n inner(this);\n this.WriteObjectEnd();\n }\n\n // Add a new object.\n public WriteObjectStart() {\n this.StartNewObject(true);\n\n let newObject: Record = {};\n\n if (this.state === SimpleJson.Writer.State.Property) {\n // This object is created as the value of a property,\n // inside an other object.\n this.Assert(this.currentCollection !== null);\n this.Assert(this.currentPropertyName !== null);\n\n let propertyName = this._propertyNameStack.pop();\n this.currentCollection![propertyName!] = newObject;\n this._collectionStack.push(newObject);\n } else if (this.state === SimpleJson.Writer.State.Array) {\n // This object is created as the child of an array.\n this.Assert(this.currentCollection !== null);\n\n this.currentCollection!.push(newObject);\n this._collectionStack.push(newObject);\n } else {\n // This object is the root object.\n this.Assert(this.state === SimpleJson.Writer.State.None);\n this._jsonObject = newObject;\n this._collectionStack.push(newObject);\n }\n\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.Object)\n );\n }\n\n public WriteObjectEnd() {\n this.Assert(this.state === SimpleJson.Writer.State.Object);\n this._collectionStack.pop();\n this._stateStack.pop();\n }\n\n // Write a property name / value pair to the current object.\n public WriteProperty(\n name: any,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n innerOrContent: ((w: Writer) => void) | string | boolean | null\n ) {\n this.WritePropertyStart(name);\n if (arguments[1] instanceof Function) {\n let inner = arguments[1];\n inner(this);\n } else {\n let content: string | boolean | null = arguments[1];\n this.Write(content);\n }\n this.WritePropertyEnd();\n }\n\n // Int and Float are separate calls, since there both are\n // numbers in JavaScript, but need to be handled differently.\n\n public WriteIntProperty(name: any, content: number) {\n this.WritePropertyStart(name);\n this.WriteInt(content);\n this.WritePropertyEnd();\n }\n\n public WriteFloatProperty(name: any, content: number) {\n this.WritePropertyStart(name);\n this.WriteFloat(content);\n this.WritePropertyEnd();\n }\n\n // Prepare a new property name, which will be use to add the\n // new object when calling _addToCurrentObject() from a Write\n // method.\n public WritePropertyStart(name: any) {\n this.Assert(this.state === SimpleJson.Writer.State.Object);\n this._propertyNameStack.push(name);\n\n this.IncrementChildCount();\n\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.Property)\n );\n }\n\n public WritePropertyEnd() {\n this.Assert(this.state === SimpleJson.Writer.State.Property);\n this.Assert(this.childCount === 1);\n this._stateStack.pop();\n }\n\n // Prepare a new property name, except this time, the property name\n // will be created by concatenating all the strings passed to\n // WritePropertyNameInner.\n public WritePropertyNameStart() {\n this.Assert(this.state === SimpleJson.Writer.State.Object);\n this.IncrementChildCount();\n\n this._currentPropertyName = \"\";\n\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.Property)\n );\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.PropertyName)\n );\n }\n\n public WritePropertyNameEnd() {\n this.Assert(this.state === SimpleJson.Writer.State.PropertyName);\n this.Assert(this._currentPropertyName !== null);\n this._propertyNameStack.push(this._currentPropertyName!);\n this._currentPropertyName = null;\n this._stateStack.pop();\n }\n\n public WritePropertyNameInner(str: string) {\n this.Assert(this.state === SimpleJson.Writer.State.PropertyName);\n this.Assert(this._currentPropertyName !== null);\n this._currentPropertyName += str;\n }\n\n // Add a new array.\n public WriteArrayStart() {\n this.StartNewObject(true);\n\n let newObject: any[] = [];\n\n if (this.state === SimpleJson.Writer.State.Property) {\n // This array is created as the value of a property,\n // inside an object.\n this.Assert(this.currentCollection !== null);\n this.Assert(this.currentPropertyName !== null);\n\n let propertyName = this._propertyNameStack.pop();\n this.currentCollection![propertyName!] = newObject;\n this._collectionStack.push(newObject);\n } else if (this.state === SimpleJson.Writer.State.Array) {\n // This array is created as the child of another array.\n this.Assert(this.currentCollection !== null);\n\n this.currentCollection!.push(newObject);\n this._collectionStack.push(newObject);\n } else {\n // This array is the root object.\n this.Assert(this.state === SimpleJson.Writer.State.None);\n this._jsonObject = newObject;\n this._collectionStack.push(newObject);\n }\n\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.Array)\n );\n }\n\n public WriteArrayEnd() {\n this.Assert(this.state === SimpleJson.Writer.State.Array);\n this._collectionStack.pop();\n this._stateStack.pop();\n }\n\n // Add the value to the appropriate collection (array / object), given the current\n // context.\n public Write(\n value: number | string | boolean | null,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n escape: boolean = true\n ) {\n if (value === null) {\n console.error(\"Warning: trying to write a null value\");\n return;\n }\n\n this.StartNewObject(false);\n this._addToCurrentObject(value);\n }\n\n public WriteBool(value: boolean | null) {\n if (value === null) {\n return;\n }\n\n this.StartNewObject(false);\n this._addToCurrentObject(value);\n }\n\n public WriteInt(value: number | null) {\n if (value === null) {\n return;\n }\n\n this.StartNewObject(false);\n\n // Math.floor is used as a precaution:\n // 1. to ensure that the value is written as an integer\n // (without a fractional part -> 1 instead of 1.0), even\n // though it should be the default behaviour of\n // JSON.serialize;\n // 2. to ensure that if a floating number is passed\n // accidentally, it's converted to an integer.\n //\n // This guarantees savegame compatibility with the reference\n // implementation.\n this._addToCurrentObject(Math.floor(value));\n }\n\n // Since JSON doesn't support NaN and Infinity, these values\n // are converted here.\n public WriteFloat(value: number | null) {\n if (value === null) {\n return;\n }\n\n this.StartNewObject(false);\n if (value == Number.POSITIVE_INFINITY) {\n this._addToCurrentObject(3.4e38);\n } else if (value == Number.NEGATIVE_INFINITY) {\n this._addToCurrentObject(-3.4e38);\n } else if (isNaN(value)) {\n this._addToCurrentObject(0.0);\n } else {\n this._addToCurrentObject(value);\n }\n }\n\n public WriteNull() {\n this.StartNewObject(false);\n this._addToCurrentObject(null);\n }\n\n // Prepare a string before adding it to the current collection in\n // WriteStringEnd(). The string will be a concatenation of all the\n // strings passed to WriteStringInner.\n public WriteStringStart() {\n this.StartNewObject(false);\n this._currentString = \"\";\n this._stateStack.push(\n new SimpleJson.Writer.StateElement(SimpleJson.Writer.State.String)\n );\n }\n\n public WriteStringEnd() {\n this.Assert(this.state == SimpleJson.Writer.State.String);\n this._stateStack.pop();\n this._addToCurrentObject(this._currentString);\n this._currentString = null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n public WriteStringInner(str: string | null, escape: boolean = true) {\n this.Assert(this.state === SimpleJson.Writer.State.String);\n\n if (str === null) {\n console.error(\"Warning: trying to write a null string\");\n return;\n }\n\n this._currentString += str;\n }\n\n // Serialise the root object into a JSON string.\n public toString() {\n if (this._jsonObject === null) {\n return \"\";\n }\n\n return JSON.stringify(this._jsonObject);\n }\n\n // Prepare the state stack when adding new objects / values.\n private StartNewObject(container: boolean) {\n if (container) {\n this.Assert(\n this.state === SimpleJson.Writer.State.None ||\n this.state === SimpleJson.Writer.State.Property ||\n this.state === SimpleJson.Writer.State.Array\n );\n } else {\n this.Assert(\n this.state === SimpleJson.Writer.State.Property ||\n this.state === SimpleJson.Writer.State.Array\n );\n }\n\n if (this.state === SimpleJson.Writer.State.Property) {\n this.Assert(this.childCount === 0);\n }\n\n if (\n this.state === SimpleJson.Writer.State.Array ||\n this.state === SimpleJson.Writer.State.Property\n ) {\n this.IncrementChildCount();\n }\n }\n\n // These getters peek all the different stacks.\n\n private get state() {\n if (this._stateStack.length > 0) {\n return this._stateStack[this._stateStack.length - 1].type;\n } else {\n return SimpleJson.Writer.State.None;\n }\n }\n\n private get childCount() {\n if (this._stateStack.length > 0) {\n return this._stateStack[this._stateStack.length - 1].childCount;\n } else {\n return 0;\n }\n }\n\n private get currentCollection() : Record | null {\n if (this._collectionStack.length > 0) {\n return this._collectionStack[this._collectionStack.length - 1];\n } else {\n return null;\n }\n }\n\n private get currentPropertyName() {\n if (this._propertyNameStack.length > 0) {\n return this._propertyNameStack[this._propertyNameStack.length - 1];\n } else {\n return null;\n }\n }\n\n private IncrementChildCount() {\n this.Assert(this._stateStack.length > 0);\n let currEl = this._stateStack.pop()!;\n currEl.childCount++;\n this._stateStack.push(currEl);\n }\n\n private Assert(condition: boolean) {\n if (!condition) throw Error(\"Assert failed while writing JSON\");\n }\n\n // This method did not exist in the original C# code. It adds\n // the given value to the current collection (used by Write methods).\n private _addToCurrentObject(value: number | string | boolean | null) {\n this.Assert(this.currentCollection !== null);\n if (this.state === SimpleJson.Writer.State.Array) {\n this.Assert(Array.isArray(this.currentCollection));\n (this.currentCollection as any[]).push(value);\n } else if (this.state === SimpleJson.Writer.State.Property) {\n this.Assert(!Array.isArray(this.currentCollection));\n this.Assert(this.currentPropertyName !== null);\n (this.currentCollection as Record)[\n this.currentPropertyName!\n ] = value;\n this._propertyNameStack.pop();\n }\n }\n\n // In addition to `_stateStack` present in the original code,\n // this implementation of SimpleJson use two other stacks and two\n // temporary variables holding the current context.\n\n // Used to keep track of the current property name being built\n // with `WritePropertyNameStart`, `WritePropertyNameInner` and\n // `WritePropertyNameEnd`.\n private _currentPropertyName: string | null = null;\n\n // Used to keep track of the current string value being built\n // with `WriteStringStart`, `WriteStringInner` and\n // `WriteStringEnd`.\n private _currentString: string | null = null;\n\n private _stateStack: SimpleJson.Writer.StateElement[] = [];\n\n // Keep track of the current collection being built (either an array\n // or an object). For instance, at the '?' step during the hiarchy\n // creation, this hierarchy:\n // [3, {a: [b, ?]}] will have this corresponding stack:\n // (bottom) [Array, Object, Array] (top)\n private _collectionStack: Array> = [];\n\n // Keep track of the current property being assigned. For instance, at\n // the '?' step during the hiarchy creation, this hierarchy:\n // [3, {a: [b, {c: ?}]}] will have this corresponding stack:\n // (bottom) [a, c] (top)\n private _propertyNameStack: string[] = [];\n\n // Object containing the entire hiearchy.\n private _jsonObject: Record | any[] | null = null;\n }\n\n export namespace Writer {\n export enum State {\n None,\n Object,\n Array,\n Property,\n PropertyName,\n String,\n }\n\n export class StateElement {\n public type: SimpleJson.Writer.State = SimpleJson.Writer.State.None;\n public childCount: number = 0;\n\n constructor(type: SimpleJson.Writer.State) {\n this.type = type;\n }\n }\n }\n}\n","import { CallStack } from \"./CallStack\";\nimport { Choice } from \"./Choice\";\nimport { JsonSerialisation } from \"./JsonSerialisation\";\nimport { InkObject } from \"./Object\";\nimport { SimpleJson } from \"./SimpleJson\";\nimport { Story } from \"./Story\";\nimport { throwNullException } from \"./NullException\";\n\nexport class Flow {\n public name: string;\n public callStack: CallStack;\n public outputStream: InkObject[];\n public currentChoices: Choice[];\n\n constructor(name: String, story: Story);\n constructor(name: String, story: Story, jObject: Record);\n constructor() {\n let name = arguments[0] as string;\n let story = arguments[1] as Story;\n\n this.name = name;\n this.callStack = new CallStack(story);\n\n if (arguments[2]) {\n let jObject = arguments[2] as Record;\n\n this.callStack.SetJsonToken(jObject[\"callstack\"], story);\n this.outputStream = JsonSerialisation.JArrayToRuntimeObjList(\n jObject[\"outputStream\"]\n );\n this.currentChoices = JsonSerialisation.JArrayToRuntimeObjList(\n jObject[\"currentChoices\"]\n ) as Choice[];\n\n let jChoiceThreadsObj = jObject[\"choiceThreads\"];\n if (typeof jChoiceThreadsObj !== \"undefined\") {\n this.LoadFlowChoiceThreads(jChoiceThreadsObj, story);\n }\n } else {\n this.outputStream = [];\n this.currentChoices = [];\n }\n }\n\n public WriteJson(writer: SimpleJson.Writer) {\n writer.WriteObjectStart();\n\n writer.WriteProperty(\"callstack\", (w) => this.callStack.WriteJson(w));\n writer.WriteProperty(\"outputStream\", (w) =>\n JsonSerialisation.WriteListRuntimeObjs(w, this.outputStream)\n );\n\n let hasChoiceThreads = false;\n for (let c of this.currentChoices) {\n if (c.threadAtGeneration === null)\n return throwNullException(\"c.threadAtGeneration\");\n\n c.originalThreadIndex = c.threadAtGeneration.threadIndex;\n\n if (this.callStack.ThreadWithIndex(c.originalThreadIndex) === null) {\n if (!hasChoiceThreads) {\n hasChoiceThreads = true;\n writer.WritePropertyStart(\"choiceThreads\");\n writer.WriteObjectStart();\n }\n\n writer.WritePropertyStart(c.originalThreadIndex);\n c.threadAtGeneration.WriteJson(writer);\n writer.WritePropertyEnd();\n }\n }\n\n if (hasChoiceThreads) {\n writer.WriteObjectEnd();\n writer.WritePropertyEnd();\n }\n\n writer.WriteProperty(\"currentChoices\", (w) => {\n w.WriteArrayStart();\n for (let c of this.currentChoices) {\n JsonSerialisation.WriteChoice(w, c);\n }\n w.WriteArrayEnd();\n });\n\n writer.WriteObjectEnd();\n }\n\n public LoadFlowChoiceThreads(\n jChoiceThreads: Record,\n story: Story\n ) {\n for (let choice of this.currentChoices) {\n let foundActiveThread = this.callStack.ThreadWithIndex(\n choice.originalThreadIndex\n );\n if (foundActiveThread !== null) {\n choice.threadAtGeneration = foundActiveThread.Copy();\n } else {\n let jSavedChoiceThread =\n jChoiceThreads[`${choice.originalThreadIndex}`];\n choice.threadAtGeneration = new CallStack.Thread(\n jSavedChoiceThread,\n story\n );\n }\n }\n }\n}\n","import { CallStack } from \"./CallStack\";\nimport { VariablesState } from \"./VariablesState\";\nimport { ValueType, Value, StringValue, ListValue } from \"./Value\";\nimport { PushPopType } from \"./PushPop\";\nimport { Tag } from \"./Tag\";\nimport { Glue } from \"./Glue\";\nimport { Path } from \"./Path\";\nimport { ControlCommand } from \"./ControlCommand\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { JsonSerialisation } from \"./JsonSerialisation\";\nimport { PRNG } from \"./PRNG\";\nimport { Void } from \"./Void\";\nimport { Pointer } from \"./Pointer\";\nimport { tryGetValueFromMap } from \"./TryGetResult\";\nimport { Choice } from \"./Choice\";\nimport { asOrNull, asOrThrows, nullIfUndefined } from \"./TypeAssertion\";\nimport { Debug } from \"./Debug\";\nimport { Container } from \"./Container\";\nimport { InkObject } from \"./Object\";\nimport { throwNullException } from \"./NullException\";\nimport { Story } from \"./Story\";\nimport { StatePatch } from \"./StatePatch\";\nimport { SimpleJson } from \"./SimpleJson\";\nimport { Flow } from \"./Flow\";\nimport { InkList } from \"./InkList\";\n\nexport class StoryState {\n // Backward compatible changes since v8:\n // v10: dynamic tags\n // v9: multi-flows\n public readonly kInkSaveStateVersion = 10;\n public readonly kMinCompatibleLoadVersion = 8;\n\n public onDidLoadState: (() => void) | null = null;\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n public ToJson(indented: boolean = false) {\n let writer = new SimpleJson.Writer();\n this.WriteJson(writer);\n return writer.toString();\n }\n public toJson(indented: boolean = false) {\n return this.ToJson(indented);\n }\n\n public LoadJson(json: string) {\n let jObject = SimpleJson.TextToDictionary(json);\n this.LoadJsonObj(jObject);\n if (this.onDidLoadState !== null) this.onDidLoadState();\n }\n\n public VisitCountAtPathString(pathString: string) {\n let visitCountOut;\n\n if (this._patch !== null) {\n let container = this.story.ContentAtPath(new Path(pathString)).container;\n if (container === null)\n throw new Error(\"Content at path not found: \" + pathString);\n\n visitCountOut = this._patch.TryGetVisitCount(container, 0);\n if (visitCountOut.exists) return visitCountOut.result;\n }\n\n visitCountOut = tryGetValueFromMap(this._visitCounts, pathString, null);\n if (visitCountOut.exists) return visitCountOut.result;\n\n return 0;\n }\n\n public VisitCountForContainer(container: Container | null): number {\n if (container === null) {\n return throwNullException(\"container\");\n }\n if (!container.visitsShouldBeCounted) {\n this.story.Error(\n \"Read count for target (\" +\n container.name +\n \" - on \" +\n container.debugMetadata +\n \") unknown. The story may need to be compiled with countAllVisits flag (-c).\"\n );\n return 0;\n }\n\n if (this._patch !== null) {\n let count = this._patch.TryGetVisitCount(container, 0);\n if (count.exists) {\n return count.result!;\n }\n }\n\n let containerPathStr = container.path.toString();\n let count2 = tryGetValueFromMap(this._visitCounts, containerPathStr, null);\n if (count2.exists) {\n return count2.result!;\n }\n\n return 0;\n }\n\n public IncrementVisitCountForContainer(container: Container) {\n if (this._patch !== null) {\n let currCount = this.VisitCountForContainer(container);\n currCount++;\n this._patch.SetVisitCount(container, currCount);\n return;\n }\n\n let containerPathStr = container.path.toString();\n let count = tryGetValueFromMap(this._visitCounts, containerPathStr, null);\n if (count.exists) {\n this._visitCounts.set(containerPathStr, count.result! + 1);\n } else {\n this._visitCounts.set(containerPathStr, 1);\n }\n }\n\n public RecordTurnIndexVisitToContainer(container: Container) {\n if (this._patch !== null) {\n this._patch.SetTurnIndex(container, this.currentTurnIndex);\n return;\n }\n\n let containerPathStr = container.path.toString();\n this._turnIndices.set(containerPathStr, this.currentTurnIndex);\n }\n\n public TurnsSinceForContainer(container: Container) {\n if (!container.turnIndexShouldBeCounted) {\n this.story.Error(\n \"TURNS_SINCE() for target (\" +\n container.name +\n \" - on \" +\n container.debugMetadata +\n \") unknown. The story may need to be compiled with countAllVisits flag (-c).\"\n );\n }\n\n if (this._patch !== null) {\n let index = this._patch.TryGetTurnIndex(container, 0);\n if (index.exists) {\n return this.currentTurnIndex - index.result!;\n }\n }\n\n let containerPathStr = container.path.toString();\n let index2 = tryGetValueFromMap(this._turnIndices, containerPathStr, 0);\n if (index2.exists) {\n return this.currentTurnIndex - index2.result!;\n } else {\n return -1;\n }\n }\n\n get callstackDepth() {\n return this.callStack.depth;\n }\n\n get outputStream() {\n return this._currentFlow.outputStream;\n }\n\n get currentChoices() {\n // If we can continue generating text content rather than choices,\n // then we reflect the choice list as being empty, since choices\n // should always come at the end.\n if (this.canContinue) return [];\n return this._currentFlow.currentChoices;\n }\n\n get generatedChoices() {\n return this._currentFlow.currentChoices;\n }\n\n get currentErrors() {\n return this._currentErrors;\n }\n private _currentErrors: string[] | null = null;\n\n get currentWarnings() {\n return this._currentWarnings;\n }\n private _currentWarnings: string[] | null = null;\n\n get variablesState() {\n return this._variablesState;\n }\n set variablesState(value) {\n this._variablesState = value;\n }\n private _variablesState: VariablesState;\n\n get callStack() {\n return this._currentFlow.callStack;\n }\n\n get evaluationStack() {\n return this._evaluationStack;\n }\n private _evaluationStack: InkObject[];\n\n public divertedPointer: Pointer = Pointer.Null;\n\n get currentTurnIndex() {\n return this._currentTurnIndex;\n }\n set currentTurnIndex(value) {\n this._currentTurnIndex = value;\n }\n private _currentTurnIndex: number = 0;\n\n public storySeed: number = 0;\n public previousRandom: number = 0;\n public didSafeExit: boolean = false;\n\n public story: Story;\n\n get currentPathString() {\n let pointer = this.currentPointer;\n if (pointer.isNull) {\n return null;\n } else {\n if (pointer.path === null) {\n return throwNullException(\"pointer.path\");\n }\n return pointer.path.toString();\n }\n }\n\n get currentPointer() {\n return this.callStack.currentElement.currentPointer.copy();\n }\n\n set currentPointer(value) {\n this.callStack.currentElement.currentPointer = value.copy();\n }\n\n get previousPointer() {\n return this.callStack.currentThread.previousPointer.copy();\n }\n\n set previousPointer(value) {\n this.callStack.currentThread.previousPointer = value.copy();\n }\n\n get canContinue() {\n return !this.currentPointer.isNull && !this.hasError;\n }\n\n get hasError() {\n return this.currentErrors != null && this.currentErrors.length > 0;\n }\n\n get hasWarning() {\n return this.currentWarnings != null && this.currentWarnings.length > 0;\n }\n\n get currentText() {\n if (this._outputStreamTextDirty) {\n let sb = new StringBuilder();\n\n let inTag: boolean = false;\n\n for (let outputObj of this.outputStream) {\n // var textContent = outputObj as StringValue;\n let textContent = asOrNull(outputObj, StringValue);\n if (!inTag && textContent !== null) {\n sb.Append(textContent.value);\n } else {\n let controlCommand = asOrNull(outputObj, ControlCommand);\n if (controlCommand !== null) {\n if (\n controlCommand.commandType == ControlCommand.CommandType.BeginTag\n ) {\n inTag = true;\n } else if (\n controlCommand.commandType == ControlCommand.CommandType.EndTag\n ) {\n inTag = false;\n }\n }\n }\n }\n\n this._currentText = this.CleanOutputWhitespace(sb.toString());\n this._outputStreamTextDirty = false;\n }\n\n return this._currentText;\n }\n private _currentText: string | null = null;\n\n public CleanOutputWhitespace(str: string) {\n let sb = new StringBuilder();\n\n let currentWhitespaceStart = -1;\n let startOfLine = 0;\n\n for (let i = 0; i < str.length; i++) {\n let c = str.charAt(i);\n\n let isInlineWhitespace = c == \" \" || c == \"\\t\";\n\n if (isInlineWhitespace && currentWhitespaceStart == -1)\n currentWhitespaceStart = i;\n\n if (!isInlineWhitespace) {\n if (\n c != \"\\n\" &&\n currentWhitespaceStart > 0 &&\n currentWhitespaceStart != startOfLine\n ) {\n sb.Append(\" \");\n }\n currentWhitespaceStart = -1;\n }\n\n if (c == \"\\n\") startOfLine = i + 1;\n\n if (!isInlineWhitespace) sb.Append(c);\n }\n\n return sb.toString();\n }\n\n get currentTags() {\n if (this._outputStreamTagsDirty) {\n this._currentTags = [];\n let inTag: boolean = false;\n let sb = new StringBuilder();\n\n for (let outputObj of this.outputStream) {\n let controlCommand = asOrNull(outputObj, ControlCommand);\n if (controlCommand != null) {\n if (\n controlCommand.commandType == ControlCommand.CommandType.BeginTag\n ) {\n if (inTag && sb.Length > 0) {\n let txt = this.CleanOutputWhitespace(sb.toString());\n this._currentTags.push(txt);\n sb.Clear();\n }\n inTag = true;\n } else if (\n controlCommand.commandType == ControlCommand.CommandType.EndTag\n ) {\n if (sb.Length > 0) {\n let txt = this.CleanOutputWhitespace(sb.toString());\n this._currentTags.push(txt);\n sb.Clear();\n }\n inTag = false;\n }\n } else if (inTag) {\n let strVal = asOrNull(outputObj, StringValue);\n if (strVal !== null) {\n sb.Append(strVal.value);\n }\n } else {\n let tag = asOrNull(outputObj, Tag);\n if (tag != null && tag.text != null && tag.text.length > 0) {\n this._currentTags.push(tag.text); // tag.text has whitespae already cleaned\n }\n }\n }\n\n if (sb.Length > 0) {\n let txt = this.CleanOutputWhitespace(sb.toString());\n this._currentTags.push(txt);\n sb.Clear();\n }\n\n this._outputStreamTagsDirty = false;\n }\n\n return this._currentTags;\n }\n private _currentTags: string[] | null = null;\n\n get currentFlowName() {\n return this._currentFlow.name;\n }\n\n get currentFlowIsDefaultFlow() {\n return this._currentFlow.name == this.kDefaultFlowName;\n }\n\n get aliveFlowNames() {\n if (this._aliveFlowNamesDirty) {\n this._aliveFlowNames = [];\n\n if (this._namedFlows != null) {\n for (let flowName of this._namedFlows.keys()) {\n if (flowName != this.kDefaultFlowName) {\n this._aliveFlowNames.push(flowName);\n }\n }\n }\n\n this._aliveFlowNamesDirty = false;\n }\n\n return this._aliveFlowNames;\n }\n\n get inExpressionEvaluation() {\n return this.callStack.currentElement.inExpressionEvaluation;\n }\n set inExpressionEvaluation(value) {\n this.callStack.currentElement.inExpressionEvaluation = value;\n }\n\n constructor(story: Story) {\n this.story = story;\n\n this._currentFlow = new Flow(this.kDefaultFlowName, story);\n this.OutputStreamDirty();\n\n this._aliveFlowNamesDirty = true;\n this._evaluationStack = [];\n\n this._variablesState = new VariablesState(\n this.callStack,\n story.listDefinitions\n );\n\n this._visitCounts = new Map();\n this._turnIndices = new Map();\n this.currentTurnIndex = -1;\n\n let timeSeed = new Date().getTime();\n this.storySeed = new PRNG(timeSeed).next() % 100;\n this.previousRandom = 0;\n\n this.GoToStart();\n }\n\n public GoToStart() {\n this.callStack.currentElement.currentPointer = Pointer.StartOf(\n this.story.mainContentContainer\n );\n }\n\n public SwitchFlow_Internal(flowName: string | null) {\n if (flowName === null)\n throw new Error(\"Must pass a non-null string to Story.SwitchFlow\");\n\n if (this._namedFlows === null) {\n this._namedFlows = new Map();\n this._namedFlows.set(this.kDefaultFlowName, this._currentFlow);\n }\n\n if (flowName === this._currentFlow.name) {\n return;\n }\n\n let flow: Flow;\n let content = tryGetValueFromMap(this._namedFlows, flowName, null);\n if (content.exists) {\n flow = content.result!;\n } else {\n flow = new Flow(flowName, this.story);\n this._namedFlows.set(flowName, flow);\n this._aliveFlowNamesDirty = true;\n }\n\n this._currentFlow = flow;\n this.variablesState.callStack = this._currentFlow.callStack;\n\n this.OutputStreamDirty();\n }\n\n public SwitchToDefaultFlow_Internal() {\n if (this._namedFlows === null) return;\n this.SwitchFlow_Internal(this.kDefaultFlowName);\n }\n\n public RemoveFlow_Internal(flowName: string | null) {\n if (flowName === null)\n throw new Error(\"Must pass a non-null string to Story.DestroyFlow\");\n if (flowName === this.kDefaultFlowName)\n throw new Error(\"Cannot destroy default flow\");\n\n if (this._currentFlow.name === flowName) {\n this.SwitchToDefaultFlow_Internal();\n }\n\n if (this._namedFlows === null)\n return throwNullException(\"this._namedFlows\");\n this._namedFlows.delete(flowName);\n this._aliveFlowNamesDirty = true;\n }\n\n public CopyAndStartPatching() {\n let copy = new StoryState(this.story);\n\n copy._patch = new StatePatch(this._patch);\n\n copy._currentFlow.name = this._currentFlow.name;\n copy._currentFlow.callStack = new CallStack(this._currentFlow.callStack);\n copy._currentFlow.currentChoices.push(...this._currentFlow.currentChoices);\n copy._currentFlow.outputStream.push(...this._currentFlow.outputStream);\n copy.OutputStreamDirty();\n\n if (this._namedFlows !== null) {\n copy._namedFlows = new Map();\n for (let [namedFlowKey, namedFlowValue] of this._namedFlows) {\n copy._namedFlows.set(namedFlowKey, namedFlowValue);\n copy._aliveFlowNamesDirty = true;\n }\n copy._namedFlows.set(this._currentFlow.name, copy._currentFlow);\n }\n\n if (this.hasError) {\n copy._currentErrors = [];\n copy._currentErrors.push(...(this.currentErrors || []));\n }\n\n if (this.hasWarning) {\n copy._currentWarnings = [];\n copy._currentWarnings.push(...(this.currentWarnings || []));\n }\n\n copy.variablesState = this.variablesState;\n copy.variablesState.callStack = copy.callStack;\n copy.variablesState.patch = copy._patch;\n\n copy.evaluationStack.push(...this.evaluationStack);\n\n if (!this.divertedPointer.isNull)\n copy.divertedPointer = this.divertedPointer.copy();\n\n copy.previousPointer = this.previousPointer.copy();\n\n copy._visitCounts = this._visitCounts;\n copy._turnIndices = this._turnIndices;\n\n copy.currentTurnIndex = this.currentTurnIndex;\n copy.storySeed = this.storySeed;\n copy.previousRandom = this.previousRandom;\n\n copy.didSafeExit = this.didSafeExit;\n\n return copy;\n }\n\n public RestoreAfterPatch() {\n this.variablesState.callStack = this.callStack;\n this.variablesState.patch = this._patch;\n }\n\n public ApplyAnyPatch() {\n if (this._patch === null) return;\n\n this.variablesState.ApplyPatch();\n\n for (let [key, value] of this._patch.visitCounts)\n this.ApplyCountChanges(key, value, true);\n\n for (let [key, value] of this._patch.turnIndices)\n this.ApplyCountChanges(key, value, false);\n\n this._patch = null;\n }\n\n public ApplyCountChanges(\n container: Container,\n newCount: number,\n isVisit: boolean\n ) {\n let counts = isVisit ? this._visitCounts : this._turnIndices;\n counts.set(container.path.toString(), newCount);\n }\n\n public WriteJson(writer: SimpleJson.Writer) {\n writer.WriteObjectStart();\n\n writer.WritePropertyStart(\"flows\");\n writer.WriteObjectStart();\n\n // NOTE: Never pass `WriteJson` directly as an argument to `WriteProperty`.\n // Call it inside a function to make sure `this` is correctly bound\n // and passed down the call hierarchy.\n\n if (this._namedFlows !== null) {\n for (let [namedFlowKey, namedFlowValue] of this._namedFlows) {\n writer.WriteProperty(namedFlowKey, (w) => namedFlowValue.WriteJson(w));\n }\n } else {\n writer.WriteProperty(this._currentFlow.name, (w) =>\n this._currentFlow.WriteJson(w)\n );\n }\n\n writer.WriteObjectEnd();\n writer.WritePropertyEnd();\n\n writer.WriteProperty(\"currentFlowName\", this._currentFlow.name);\n\n writer.WriteProperty(\"variablesState\", (w) =>\n this.variablesState.WriteJson(w)\n );\n\n writer.WriteProperty(\"evalStack\", (w) =>\n JsonSerialisation.WriteListRuntimeObjs(w, this.evaluationStack)\n );\n\n if (!this.divertedPointer.isNull) {\n if (this.divertedPointer.path === null) {\n return throwNullException(\"divertedPointer\");\n }\n writer.WriteProperty(\n \"currentDivertTarget\",\n this.divertedPointer.path.componentsString\n );\n }\n\n writer.WriteProperty(\"visitCounts\", (w) =>\n JsonSerialisation.WriteIntDictionary(w, this._visitCounts)\n );\n writer.WriteProperty(\"turnIndices\", (w) =>\n JsonSerialisation.WriteIntDictionary(w, this._turnIndices)\n );\n\n writer.WriteIntProperty(\"turnIdx\", this.currentTurnIndex);\n writer.WriteIntProperty(\"storySeed\", this.storySeed);\n writer.WriteIntProperty(\"previousRandom\", this.previousRandom);\n\n writer.WriteIntProperty(\"inkSaveVersion\", this.kInkSaveStateVersion);\n\n writer.WriteIntProperty(\"inkFormatVersion\", Story.inkVersionCurrent);\n\n writer.WriteObjectEnd();\n }\n\n public LoadJsonObj(value: Record) {\n let jObject = value;\n\n let jSaveVersion = jObject[\"inkSaveVersion\"];\n if (jSaveVersion == null) {\n throw new Error(\"ink save format incorrect, can't load.\");\n } else if (parseInt(jSaveVersion) < this.kMinCompatibleLoadVersion) {\n throw new Error(\n \"Ink save format isn't compatible with the current version (saw '\" +\n jSaveVersion +\n \"', but minimum is \" +\n this.kMinCompatibleLoadVersion +\n \"), so can't load.\"\n );\n }\n\n let flowsObj = jObject[\"flows\"];\n if (flowsObj != null) {\n let flowsObjDict = flowsObj as Record;\n\n // Single default flow\n if (Object.keys(flowsObjDict).length === 1) {\n this._namedFlows = null;\n } else if (this._namedFlows === null) {\n this._namedFlows = new Map();\n } else {\n this._namedFlows.clear();\n }\n\n let flowsObjDictEntries = Object.entries(flowsObjDict);\n for (let [namedFlowObjKey, namedFlowObjValue] of flowsObjDictEntries) {\n let name = namedFlowObjKey;\n let flowObj = namedFlowObjValue as Record;\n\n let flow = new Flow(name, this.story, flowObj);\n\n if (Object.keys(flowsObjDict).length === 1) {\n this._currentFlow = new Flow(name, this.story, flowObj);\n } else {\n if (this._namedFlows === null)\n return throwNullException(\"this._namedFlows\");\n this._namedFlows.set(name, flow);\n }\n }\n\n if (this._namedFlows != null && this._namedFlows.size > 1) {\n let currFlowName = jObject[\"currentFlowName\"] as string;\n // Adding a bang at the end, because we're trusting the save, as\n // done in upstream. If the save is corrupted, the execution\n // is undefined.\n this._currentFlow = this._namedFlows.get(currFlowName)!;\n }\n } else {\n this._namedFlows = null;\n this._currentFlow.name = this.kDefaultFlowName;\n this._currentFlow.callStack.SetJsonToken(\n jObject[\"callstackThreads\"] as Record,\n this.story\n );\n this._currentFlow.outputStream = JsonSerialisation.JArrayToRuntimeObjList(\n jObject[\"outputStream\"] as any[]\n );\n this._currentFlow.currentChoices =\n JsonSerialisation.JArrayToRuntimeObjList(\n jObject[\"currentChoices\"] as any[]\n ) as Choice[];\n\n let jChoiceThreadsObj = jObject[\"choiceThreads\"];\n this._currentFlow.LoadFlowChoiceThreads(jChoiceThreadsObj, this.story);\n }\n\n this.OutputStreamDirty();\n this._aliveFlowNamesDirty = true;\n\n this.variablesState.SetJsonToken(jObject[\"variablesState\"]);\n this.variablesState.callStack = this._currentFlow.callStack;\n\n this._evaluationStack = JsonSerialisation.JArrayToRuntimeObjList(\n jObject[\"evalStack\"]\n );\n\n let currentDivertTargetPath = jObject[\"currentDivertTarget\"];\n if (currentDivertTargetPath != null) {\n let divertPath = new Path(currentDivertTargetPath.toString());\n this.divertedPointer = this.story.PointerAtPath(divertPath);\n }\n\n this._visitCounts = JsonSerialisation.JObjectToIntDictionary(\n jObject[\"visitCounts\"]\n );\n this._turnIndices = JsonSerialisation.JObjectToIntDictionary(\n jObject[\"turnIndices\"]\n );\n this.currentTurnIndex = parseInt(jObject[\"turnIdx\"]);\n this.storySeed = parseInt(jObject[\"storySeed\"]);\n this.previousRandom = parseInt(jObject[\"previousRandom\"]);\n }\n\n public ResetErrors() {\n this._currentErrors = null;\n this._currentWarnings = null;\n }\n public ResetOutput(objs: InkObject[] | null = null) {\n this.outputStream.length = 0;\n if (objs !== null) this.outputStream.push(...objs);\n this.OutputStreamDirty();\n }\n\n public PushToOutputStream(obj: InkObject | null) {\n // var text = obj as StringValue;\n let text = asOrNull(obj, StringValue);\n if (text !== null) {\n let listText = this.TrySplittingHeadTailWhitespace(text);\n if (listText !== null) {\n for (let textObj of listText) {\n this.PushToOutputStreamIndividual(textObj);\n }\n this.OutputStreamDirty();\n return;\n }\n }\n\n this.PushToOutputStreamIndividual(obj);\n this.OutputStreamDirty();\n }\n\n public PopFromOutputStream(count: number) {\n this.outputStream.splice(this.outputStream.length - count, count);\n this.OutputStreamDirty();\n }\n\n public TrySplittingHeadTailWhitespace(single: StringValue) {\n let str = single.value;\n if (str === null) {\n return throwNullException(\"single.value\");\n }\n\n let headFirstNewlineIdx = -1;\n let headLastNewlineIdx = -1;\n for (let i = 0; i < str.length; i++) {\n let c = str[i];\n if (c == \"\\n\") {\n if (headFirstNewlineIdx == -1) headFirstNewlineIdx = i;\n headLastNewlineIdx = i;\n } else if (c == \" \" || c == \"\\t\") continue;\n else break;\n }\n\n let tailLastNewlineIdx = -1;\n let tailFirstNewlineIdx = -1;\n for (let i = str.length - 1; i >= 0; i--) {\n let c = str[i];\n if (c == \"\\n\") {\n if (tailLastNewlineIdx == -1) tailLastNewlineIdx = i;\n tailFirstNewlineIdx = i;\n } else if (c == \" \" || c == \"\\t\") continue;\n else break;\n }\n\n // No splitting to be done?\n if (headFirstNewlineIdx == -1 && tailLastNewlineIdx == -1) return null;\n\n let listTexts: StringValue[] = [];\n let innerStrStart = 0;\n let innerStrEnd = str.length;\n\n if (headFirstNewlineIdx != -1) {\n if (headFirstNewlineIdx > 0) {\n let leadingSpaces = new StringValue(\n str.substring(0, headFirstNewlineIdx)\n );\n listTexts.push(leadingSpaces);\n }\n listTexts.push(new StringValue(\"\\n\"));\n innerStrStart = headLastNewlineIdx + 1;\n }\n\n if (tailLastNewlineIdx != -1) {\n innerStrEnd = tailFirstNewlineIdx;\n }\n\n if (innerStrEnd > innerStrStart) {\n let innerStrText = str.substring(innerStrStart, innerStrEnd);\n listTexts.push(new StringValue(innerStrText));\n }\n\n if (tailLastNewlineIdx != -1 && tailFirstNewlineIdx > headLastNewlineIdx) {\n listTexts.push(new StringValue(\"\\n\"));\n if (tailLastNewlineIdx < str.length - 1) {\n let numSpaces = str.length - tailLastNewlineIdx - 1;\n let trailingSpaces = new StringValue(\n str.substring(\n tailLastNewlineIdx + 1,\n tailLastNewlineIdx + 1 + numSpaces\n )\n );\n listTexts.push(trailingSpaces);\n }\n }\n\n return listTexts;\n }\n\n public PushToOutputStreamIndividual(obj: InkObject | null) {\n let glue = asOrNull(obj, Glue);\n let text = asOrNull(obj, StringValue);\n\n let includeInOutput = true;\n\n if (glue) {\n this.TrimNewlinesFromOutputStream();\n includeInOutput = true;\n } else if (text) {\n let functionTrimIndex = -1;\n let currEl = this.callStack.currentElement;\n if (currEl.type == PushPopType.Function) {\n functionTrimIndex = currEl.functionStartInOutputStream;\n }\n\n let glueTrimIndex = -1;\n for (let i = this.outputStream.length - 1; i >= 0; i--) {\n let o = this.outputStream[i];\n let c = o instanceof ControlCommand ? o : null;\n let g = o instanceof Glue ? o : null;\n\n if (g != null) {\n glueTrimIndex = i;\n break;\n } else if (\n c != null &&\n c.commandType == ControlCommand.CommandType.BeginString\n ) {\n if (i >= functionTrimIndex) {\n functionTrimIndex = -1;\n }\n break;\n }\n }\n\n let trimIndex = -1;\n if (glueTrimIndex != -1 && functionTrimIndex != -1)\n trimIndex = Math.min(functionTrimIndex, glueTrimIndex);\n else if (glueTrimIndex != -1) trimIndex = glueTrimIndex;\n else trimIndex = functionTrimIndex;\n\n if (trimIndex != -1) {\n if (text.isNewline) {\n includeInOutput = false;\n } else if (text.isNonWhitespace) {\n if (glueTrimIndex > -1) this.RemoveExistingGlue();\n\n if (functionTrimIndex > -1) {\n let callStackElements = this.callStack.elements;\n for (let i = callStackElements.length - 1; i >= 0; i--) {\n let el = callStackElements[i];\n if (el.type == PushPopType.Function) {\n el.functionStartInOutputStream = -1;\n } else {\n break;\n }\n }\n }\n }\n } else if (text.isNewline) {\n if (this.outputStreamEndsInNewline || !this.outputStreamContainsContent)\n includeInOutput = false;\n }\n }\n\n if (includeInOutput) {\n if (obj === null) {\n return throwNullException(\"obj\");\n }\n this.outputStream.push(obj);\n this.OutputStreamDirty();\n }\n }\n\n public TrimNewlinesFromOutputStream() {\n let removeWhitespaceFrom = -1;\n\n let i = this.outputStream.length - 1;\n while (i >= 0) {\n let obj = this.outputStream[i];\n let cmd = asOrNull(obj, ControlCommand);\n let txt = asOrNull(obj, StringValue);\n\n if (cmd != null || (txt != null && txt.isNonWhitespace)) {\n break;\n } else if (txt != null && txt.isNewline) {\n removeWhitespaceFrom = i;\n }\n i--;\n }\n\n // Remove the whitespace\n if (removeWhitespaceFrom >= 0) {\n i = removeWhitespaceFrom;\n while (i < this.outputStream.length) {\n let text = asOrNull(this.outputStream[i], StringValue);\n if (text) {\n this.outputStream.splice(i, 1);\n } else {\n i++;\n }\n }\n }\n\n this.OutputStreamDirty();\n }\n\n public RemoveExistingGlue() {\n for (let i = this.outputStream.length - 1; i >= 0; i--) {\n let c = this.outputStream[i];\n if (c instanceof Glue) {\n this.outputStream.splice(i, 1);\n } else if (c instanceof ControlCommand) {\n break;\n }\n }\n\n this.OutputStreamDirty();\n }\n\n get outputStreamEndsInNewline() {\n if (this.outputStream.length > 0) {\n for (let i = this.outputStream.length - 1; i >= 0; i--) {\n let obj = this.outputStream[i];\n if (obj instanceof ControlCommand) break;\n let text = this.outputStream[i];\n if (text instanceof StringValue) {\n if (text.isNewline) return true;\n else if (text.isNonWhitespace) break;\n }\n }\n }\n\n return false;\n }\n\n get outputStreamContainsContent() {\n for (let content of this.outputStream) {\n if (content instanceof StringValue) return true;\n }\n return false;\n }\n\n get inStringEvaluation() {\n for (let i = this.outputStream.length - 1; i >= 0; i--) {\n let cmd = asOrNull(this.outputStream[i], ControlCommand);\n if (\n cmd instanceof ControlCommand &&\n cmd.commandType == ControlCommand.CommandType.BeginString\n ) {\n return true;\n }\n }\n\n return false;\n }\n\n public PushEvaluationStack(obj: InkObject | null) {\n // var listValue = obj as ListValue;\n let listValue = asOrNull(obj, ListValue);\n if (listValue) {\n // Update origin when list is has something to indicate the list origin\n let rawList = listValue.value;\n if (rawList === null) {\n return throwNullException(\"rawList\");\n }\n\n if (rawList.originNames != null) {\n if (!rawList.origins) rawList.origins = [];\n rawList.origins.length = 0;\n\n for (let n of rawList.originNames) {\n if (this.story.listDefinitions === null)\n return throwNullException(\"StoryState.story.listDefinitions\");\n let def = this.story.listDefinitions.TryListGetDefinition(n, null);\n if (def.result === null)\n return throwNullException(\"StoryState def.result\");\n if (rawList.origins.indexOf(def.result) < 0)\n rawList.origins.push(def.result);\n }\n }\n }\n\n if (obj === null) {\n return throwNullException(\"obj\");\n }\n this.evaluationStack.push(obj);\n }\n\n public PopEvaluationStack(): InkObject;\n public PopEvaluationStack(numberOfObjects: number): InkObject[];\n public PopEvaluationStack(numberOfObjects?: number) {\n if (typeof numberOfObjects === \"undefined\") {\n let obj = this.evaluationStack.pop();\n return nullIfUndefined(obj);\n } else {\n if (numberOfObjects > this.evaluationStack.length) {\n throw new Error(\"trying to pop too many objects\");\n }\n\n let popped = this.evaluationStack.splice(\n this.evaluationStack.length - numberOfObjects,\n numberOfObjects\n );\n return nullIfUndefined(popped);\n }\n }\n\n public PeekEvaluationStack() {\n return this.evaluationStack[this.evaluationStack.length - 1];\n }\n\n public ForceEnd() {\n this.callStack.Reset();\n\n this._currentFlow.currentChoices.length = 0;\n\n this.currentPointer = Pointer.Null;\n this.previousPointer = Pointer.Null;\n\n this.didSafeExit = true;\n }\n\n public TrimWhitespaceFromFunctionEnd() {\n Debug.Assert(this.callStack.currentElement.type == PushPopType.Function);\n let functionStartPoint =\n this.callStack.currentElement.functionStartInOutputStream;\n\n if (functionStartPoint == -1) {\n functionStartPoint = 0;\n }\n\n for (let i = this.outputStream.length - 1; i >= functionStartPoint; i--) {\n let obj = this.outputStream[i];\n let txt = asOrNull(obj, StringValue);\n let cmd = asOrNull(obj, ControlCommand);\n\n if (txt == null) continue;\n if (cmd) break;\n\n if (txt.isNewline || txt.isInlineWhitespace) {\n this.outputStream.splice(i, 1);\n this.OutputStreamDirty();\n } else {\n break;\n }\n }\n }\n\n public PopCallStack(popType: PushPopType | null = null) {\n if (this.callStack.currentElement.type == PushPopType.Function)\n this.TrimWhitespaceFromFunctionEnd();\n\n this.callStack.Pop(popType);\n }\n\n public SetChosenPath(path: Path, incrementingTurnIndex: boolean) {\n // Changing direction, assume we need to clear current set of choices\n this._currentFlow.currentChoices.length = 0;\n\n let newPointer = this.story.PointerAtPath(path);\n if (!newPointer.isNull && newPointer.index == -1) newPointer.index = 0;\n\n this.currentPointer = newPointer;\n\n if (incrementingTurnIndex) {\n this.currentTurnIndex++;\n }\n }\n\n public StartFunctionEvaluationFromGame(\n funcContainer: Container,\n args: any[]\n ) {\n this.callStack.Push(\n PushPopType.FunctionEvaluationFromGame,\n this.evaluationStack.length\n );\n this.callStack.currentElement.currentPointer =\n Pointer.StartOf(funcContainer);\n\n this.PassArgumentsToEvaluationStack(args);\n }\n\n public PassArgumentsToEvaluationStack(args: any[] | null) {\n if (args !== null) {\n for (let i = 0; i < args.length; i++) {\n if (\n !(\n typeof args[i] === \"number\" ||\n typeof args[i] === \"string\" ||\n typeof args[i] === \"boolean\" ||\n args[i] instanceof InkList\n )\n ) {\n throw new Error(\n \"ink arguments when calling EvaluateFunction / ChoosePathStringWithParameters must be\" +\n \"number, string, bool or InkList. Argument was \" +\n (nullIfUndefined(args[i]) === null\n ? \"null\"\n : args[i].constructor.name)\n );\n }\n\n this.PushEvaluationStack(Value.Create(args[i]));\n }\n }\n }\n\n public TryExitFunctionEvaluationFromGame() {\n if (\n this.callStack.currentElement.type ==\n PushPopType.FunctionEvaluationFromGame\n ) {\n this.currentPointer = Pointer.Null;\n this.didSafeExit = true;\n return true;\n }\n\n return false;\n }\n\n public CompleteFunctionEvaluationFromGame() {\n if (\n this.callStack.currentElement.type !=\n PushPopType.FunctionEvaluationFromGame\n ) {\n throw new Error(\n \"Expected external function evaluation to be complete. Stack trace: \" +\n this.callStack.callStackTrace\n );\n }\n\n let originalEvaluationStackHeight =\n this.callStack.currentElement.evaluationStackHeightWhenPushed;\n\n let returnedObj: InkObject | null = null;\n while (this.evaluationStack.length > originalEvaluationStackHeight) {\n let poppedObj = this.PopEvaluationStack();\n if (returnedObj === null) returnedObj = poppedObj;\n }\n\n this.PopCallStack(PushPopType.FunctionEvaluationFromGame);\n\n if (returnedObj) {\n if (returnedObj instanceof Void) return null;\n\n // Some kind of value, if not void\n // var returnVal = returnedObj as Runtime.Value;\n let returnVal = asOrThrows(returnedObj, Value);\n\n // DivertTargets get returned as the string of components\n // (rather than a Path, which isn't public)\n if (returnVal.valueType == ValueType.DivertTarget) {\n return returnVal.valueObject.toString();\n }\n\n // Other types can just have their exact object type:\n // int, float, string. VariablePointers get returned as strings.\n return returnVal.valueObject;\n }\n\n return null;\n }\n\n public AddError(message: string, isWarning: boolean) {\n if (!isWarning) {\n if (this._currentErrors == null) this._currentErrors = [];\n this._currentErrors.push(message);\n } else {\n if (this._currentWarnings == null) this._currentWarnings = [];\n this._currentWarnings.push(message);\n }\n }\n\n public OutputStreamDirty() {\n this._outputStreamTextDirty = true;\n this._outputStreamTagsDirty = true;\n }\n\n private _visitCounts: Map;\n private _turnIndices: Map;\n\n private _outputStreamTextDirty = true;\n private _outputStreamTagsDirty = true;\n\n private _patch: StatePatch | null = null;\n\n private _currentFlow: Flow;\n private _aliveFlowNames: string[] | null = null;\n private _namedFlows: Map | null = null;\n private readonly kDefaultFlowName = \"DEFAULT_FLOW\";\n private _aliveFlowNamesDirty: boolean = true;\n}\n","// This is simple replacement of the Stopwatch class from the .NET Framework.\n// The original class can count time with much more accuracy than the Javascript version.\n// It might be worth considering using `window.performance` in the browser\n// or `process.hrtime()` in node.\nexport class Stopwatch {\n private startTime: number | undefined;\n\n constructor() {\n this.startTime = undefined;\n }\n\n get ElapsedMilliseconds(): number {\n if (typeof this.startTime === \"undefined\") {\n return 0;\n }\n return new Date().getTime() - this.startTime;\n }\n\n public Start() {\n this.startTime = new Date().getTime();\n }\n public Stop() {\n this.startTime = undefined;\n }\n}\n","import { Container } from \"./Container\";\nimport { InkObject } from \"./Object\";\nimport { JsonSerialisation } from \"./JsonSerialisation\";\nimport { StoryState } from \"./StoryState\";\nimport { ControlCommand } from \"./ControlCommand\";\nimport { PushPopType } from \"./PushPop\";\nimport { ChoicePoint } from \"./ChoicePoint\";\nimport { Choice } from \"./Choice\";\nimport { Divert } from \"./Divert\";\nimport {\n Value,\n StringValue,\n IntValue,\n DivertTargetValue,\n VariablePointerValue,\n ListValue,\n} from \"./Value\";\nimport { Path } from \"./Path\";\nimport { Void } from \"./Void\";\nimport { Tag } from \"./Tag\";\nimport { VariableAssignment } from \"./VariableAssignment\";\nimport { VariableReference } from \"./VariableReference\";\nimport { NativeFunctionCall } from \"./NativeFunctionCall\";\nimport { StoryException } from \"./StoryException\";\nimport { PRNG } from \"./PRNG\";\nimport { StringBuilder } from \"./StringBuilder\";\nimport { ListDefinitionsOrigin } from \"./ListDefinitionsOrigin\";\nimport { ListDefinition } from \"./ListDefinition\";\nimport { Stopwatch } from \"./StopWatch\";\nimport { Pointer } from \"./Pointer\";\nimport { InkList, InkListItem, KeyValuePair } from \"./InkList\";\nimport { asOrNull, asOrThrows } from \"./TypeAssertion\";\nimport { DebugMetadata } from \"./DebugMetadata\";\nimport { throwNullException } from \"./NullException\";\nimport { SimpleJson } from \"./SimpleJson\";\nimport { ErrorHandler, ErrorType } from \"./Error\";\n\nexport { InkList } from \"./InkList\";\n\nif (!Number.isInteger) {\n Number.isInteger = function isInteger(nVal: any) {\n return (\n typeof nVal === \"number\" &&\n isFinite(nVal) &&\n nVal > -9007199254740992 &&\n nVal < 9007199254740992 &&\n Math.floor(nVal) === nVal\n );\n };\n}\n\nexport class Story extends InkObject {\n public static inkVersionCurrent = 21;\n\n public inkVersionMinimumCompatible = 18;\n\n get currentChoices() {\n let choices: Choice[] = [];\n\n if (this._state === null) {\n return throwNullException(\"this._state\");\n }\n for (let c of this._state.currentChoices) {\n if (!c.isInvisibleDefault) {\n c.index = choices.length;\n choices.push(c);\n }\n }\n\n return choices;\n }\n\n get currentText() {\n this.IfAsyncWeCant(\"call currentText since it's a work in progress\");\n return this.state.currentText;\n }\n\n get currentTags() {\n this.IfAsyncWeCant(\"call currentTags since it's a work in progress\");\n return this.state.currentTags;\n }\n\n get currentErrors() {\n return this.state.currentErrors;\n }\n\n get currentWarnings() {\n return this.state.currentWarnings;\n }\n\n get currentFlowName() {\n return this.state.currentFlowName;\n }\n\n get currentFlowIsDefaultFlow() {\n return this.state.currentFlowIsDefaultFlow;\n }\n\n get aliveFlowNames() {\n return this.state.aliveFlowNames;\n }\n\n get hasError() {\n return this.state.hasError;\n }\n\n get hasWarning() {\n return this.state.hasWarning;\n }\n\n get variablesState() {\n return this.state.variablesState;\n }\n\n get listDefinitions() {\n return this._listDefinitions;\n }\n\n get state() {\n return this._state;\n }\n\n public onError: ErrorHandler | null = null;\n\n public onDidContinue: (() => void) | null = null;\n\n public onMakeChoice: ((arg1: Choice) => void) | null = null;\n\n public onEvaluateFunction: ((arg1: string, arg2: any[]) => void) | null =\n null;\n\n public onCompleteEvaluateFunction:\n | ((arg1: string, arg2: any[], arg3: string, arg4: any) => void)\n | null = null;\n\n public onChoosePathString: ((arg1: string, arg2: any[]) => void) | null =\n null;\n\n // TODO: Implement Profiler\n public StartProfiling() {\n /* */\n }\n public EndProfiling() {\n /* */\n }\n\n constructor(contentContainer: Container, lists: ListDefinition[] | null);\n constructor(jsonString: string);\n constructor(json: Record);\n constructor() {\n super();\n\n // Discrimination between constructors\n let contentContainer: Container;\n let lists: ListDefinition[] | null = null;\n let json: Record | null = null;\n\n if (arguments[0] instanceof Container) {\n contentContainer = arguments[0] as Container;\n\n if (typeof arguments[1] !== \"undefined\") {\n lists = arguments[1] as ListDefinition[];\n }\n\n // ------ Story (Container contentContainer, List lists = null)\n this._mainContentContainer = contentContainer;\n // ------\n } else {\n if (typeof arguments[0] === \"string\") {\n let jsonString = arguments[0] as string;\n json = SimpleJson.TextToDictionary(jsonString);\n } else {\n json = arguments[0] as Record;\n }\n }\n\n // ------ Story (Container contentContainer, List lists = null)\n if (lists != null) this._listDefinitions = new ListDefinitionsOrigin(lists);\n\n this._externals = new Map();\n // ------\n\n // ------ Story(string jsonString) : this((Container)null)\n if (json !== null) {\n let rootObject: Record = json;\n\n let versionObj = rootObject[\"inkVersion\"];\n if (versionObj == null)\n throw new Error(\n \"ink version number not found. Are you sure it's a valid .ink.json file?\"\n );\n\n let formatFromFile = parseInt(versionObj);\n if (formatFromFile > Story.inkVersionCurrent) {\n throw new Error(\n \"Version of ink used to build story was newer than the current version of the engine\"\n );\n } else if (formatFromFile < this.inkVersionMinimumCompatible) {\n throw new Error(\n \"Version of ink used to build story is too old to be loaded by this version of the engine\"\n );\n } else if (formatFromFile != Story.inkVersionCurrent) {\n console.warn(\n \"WARNING: Version of ink used to build story doesn't match current version of engine. Non-critical, but recommend synchronising.\"\n );\n }\n\n let rootToken = rootObject[\"root\"];\n if (rootToken == null)\n throw new Error(\n \"Root node for ink not found. Are you sure it's a valid .ink.json file?\"\n );\n\n let listDefsObj;\n if ((listDefsObj = rootObject[\"listDefs\"])) {\n this._listDefinitions =\n JsonSerialisation.JTokenToListDefinitions(listDefsObj);\n }\n\n this._mainContentContainer = asOrThrows(\n JsonSerialisation.JTokenToRuntimeObject(rootToken),\n Container\n );\n\n this.ResetState();\n }\n // ------\n }\n\n // Merge together `public string ToJson()` and `void ToJson(SimpleJson.Writer writer)`.\n // Will only return a value if writer was not provided.\n public ToJson(writer?: SimpleJson.Writer): string | void {\n let shouldReturn = false;\n\n if (!writer) {\n shouldReturn = true;\n writer = new SimpleJson.Writer();\n }\n\n writer.WriteObjectStart();\n\n writer.WriteIntProperty(\"inkVersion\", Story.inkVersionCurrent);\n\n writer.WriteProperty(\"root\", (w) =>\n JsonSerialisation.WriteRuntimeContainer(w, this._mainContentContainer)\n );\n\n if (this._listDefinitions != null) {\n writer.WritePropertyStart(\"listDefs\");\n writer.WriteObjectStart();\n\n for (let def of this._listDefinitions.lists) {\n writer.WritePropertyStart(def.name);\n writer.WriteObjectStart();\n\n for (let [key, value] of def.items) {\n let item = InkListItem.fromSerializedKey(key);\n let val = value;\n writer.WriteIntProperty(item.itemName, val);\n }\n\n writer.WriteObjectEnd();\n writer.WritePropertyEnd();\n }\n\n writer.WriteObjectEnd();\n writer.WritePropertyEnd();\n }\n\n writer.WriteObjectEnd();\n\n if (shouldReturn) return writer.toString();\n }\n\n public ResetState() {\n this.IfAsyncWeCant(\"ResetState\");\n\n this._state = new StoryState(this);\n this._state.variablesState.ObserveVariableChange(\n this.VariableStateDidChangeEvent.bind(this)\n );\n\n this.ResetGlobals();\n }\n\n public ResetErrors() {\n if (this._state === null) {\n return throwNullException(\"this._state\");\n }\n this._state.ResetErrors();\n }\n\n public ResetCallstack() {\n this.IfAsyncWeCant(\"ResetCallstack\");\n if (this._state === null) {\n return throwNullException(\"this._state\");\n }\n this._state.ForceEnd();\n }\n\n public ResetGlobals() {\n if (this._mainContentContainer.namedContent.get(\"global decl\")) {\n let originalPointer = this.state.currentPointer.copy();\n\n this.ChoosePath(new Path(\"global decl\"), false);\n\n this.ContinueInternal();\n\n this.state.currentPointer = originalPointer;\n }\n\n this.state.variablesState.SnapshotDefaultGlobals();\n }\n\n public SwitchFlow(flowName: string) {\n this.IfAsyncWeCant(\"switch flow\");\n if (this._asyncSaving) {\n throw new Error(\n \"Story is already in background saving mode, can't switch flow to \" +\n flowName\n );\n }\n\n this.state.SwitchFlow_Internal(flowName);\n }\n\n public RemoveFlow(flowName: string) {\n this.state.RemoveFlow_Internal(flowName);\n }\n\n public SwitchToDefaultFlow() {\n this.state.SwitchToDefaultFlow_Internal();\n }\n\n public Continue() {\n this.ContinueAsync(0);\n return this.currentText;\n }\n\n get canContinue() {\n return this.state.canContinue;\n }\n\n get asyncContinueComplete() {\n return !this._asyncContinueActive;\n }\n\n public ContinueAsync(millisecsLimitAsync: number) {\n if (!this._hasValidatedExternals) this.ValidateExternalBindings();\n\n this.ContinueInternal(millisecsLimitAsync);\n }\n\n public ContinueInternal(millisecsLimitAsync = 0) {\n if (this._profiler != null) this._profiler.PreContinue();\n\n let isAsyncTimeLimited = millisecsLimitAsync > 0;\n this._recursiveContinueCount++;\n\n if (!this._asyncContinueActive) {\n this._asyncContinueActive = isAsyncTimeLimited;\n\n if (!this.canContinue) {\n throw new Error(\n \"Can't continue - should check canContinue before calling Continue\"\n );\n }\n\n this._state.didSafeExit = false;\n this._state.ResetOutput();\n\n if (this._recursiveContinueCount == 1)\n this._state.variablesState.batchObservingVariableChanges = true;\n }\n\n let durationStopwatch = new Stopwatch();\n durationStopwatch.Start();\n\n let outputStreamEndsInNewline = false;\n this._sawLookaheadUnsafeFunctionAfterNewline = false;\n do {\n try {\n outputStreamEndsInNewline = this.ContinueSingleStep();\n } catch (e) {\n if (!(e instanceof StoryException)) throw e;\n\n this.AddError(e.message, undefined, e.useEndLineNumber);\n break;\n }\n\n if (outputStreamEndsInNewline) break;\n\n if (\n this._asyncContinueActive &&\n durationStopwatch.ElapsedMilliseconds > millisecsLimitAsync\n ) {\n break;\n }\n } while (this.canContinue);\n\n durationStopwatch.Stop();\n\n if (outputStreamEndsInNewline || !this.canContinue) {\n if (this._stateSnapshotAtLastNewline !== null) {\n this.RestoreStateSnapshot();\n }\n\n if (!this.canContinue) {\n if (this.state.callStack.canPopThread)\n this.AddError(\n \"Thread available to pop, threads should always be flat by the end of evaluation?\"\n );\n\n if (\n this.state.generatedChoices.length == 0 &&\n !this.state.didSafeExit &&\n this._temporaryEvaluationContainer == null\n ) {\n if (this.state.callStack.CanPop(PushPopType.Tunnel))\n this.AddError(\n \"unexpectedly reached end of content. Do you need a '->->' to return from a tunnel?\"\n );\n else if (this.state.callStack.CanPop(PushPopType.Function))\n this.AddError(\n \"unexpectedly reached end of content. Do you need a '~ return'?\"\n );\n else if (!this.state.callStack.canPop)\n this.AddError(\n \"ran out of content. Do you need a '-> DONE' or '-> END'?\"\n );\n else\n this.AddError(\n \"unexpectedly reached end of content for unknown reason. Please debug compiler!\"\n );\n }\n }\n\n this.state.didSafeExit = false;\n this._sawLookaheadUnsafeFunctionAfterNewline = false;\n\n if (this._recursiveContinueCount == 1)\n this._state.variablesState.batchObservingVariableChanges = false;\n\n this._asyncContinueActive = false;\n if (this.onDidContinue !== null) this.onDidContinue();\n }\n\n this._recursiveContinueCount--;\n\n if (this._profiler != null) this._profiler.PostContinue();\n\n // In the following code, we're masking a lot of non-null assertion,\n // because testing for against `hasError` or `hasWarning` makes sure\n // the arrays are present and contain at least one element.\n if (this.state.hasError || this.state.hasWarning) {\n if (this.onError !== null) {\n if (this.state.hasError) {\n for (let err of this.state.currentErrors!) {\n this.onError(err, ErrorType.Error);\n }\n }\n if (this.state.hasWarning) {\n for (let err of this.state.currentWarnings!) {\n this.onError(err, ErrorType.Warning);\n }\n }\n this.ResetErrors();\n } else {\n let sb = new StringBuilder();\n sb.Append(\"Ink had \");\n if (this.state.hasError) {\n sb.Append(`${this.state.currentErrors!.length}`);\n sb.Append(\n this.state.currentErrors!.length == 1 ? \" error\" : \"errors\"\n );\n if (this.state.hasWarning) sb.Append(\" and \");\n }\n if (this.state.hasWarning) {\n sb.Append(`${this.state.currentWarnings!.length}`);\n sb.Append(\n this.state.currentWarnings!.length == 1 ? \" warning\" : \"warnings\"\n );\n if (this.state.hasWarning) sb.Append(\" and \");\n }\n sb.Append(\n \". It is strongly suggested that you assign an error handler to story.onError. The first issue was: \"\n );\n sb.Append(\n this.state.hasError\n ? this.state.currentErrors![0]\n : this.state.currentWarnings![0]\n );\n\n throw new StoryException(sb.toString());\n }\n }\n }\n\n public ContinueSingleStep() {\n if (this._profiler != null) this._profiler.PreStep();\n\n this.Step();\n\n if (this._profiler != null) this._profiler.PostStep();\n\n if (!this.canContinue && !this.state.callStack.elementIsEvaluateFromGame) {\n this.TryFollowDefaultInvisibleChoice();\n }\n\n if (this._profiler != null) this._profiler.PreSnapshot();\n\n if (!this.state.inStringEvaluation) {\n if (this._stateSnapshotAtLastNewline !== null) {\n if (this._stateSnapshotAtLastNewline.currentTags === null) {\n return throwNullException(\"this._stateAtLastNewline.currentTags\");\n }\n if (this.state.currentTags === null) {\n return throwNullException(\"this.state.currentTags\");\n }\n\n let change = this.CalculateNewlineOutputStateChange(\n this._stateSnapshotAtLastNewline.currentText,\n this.state.currentText,\n this._stateSnapshotAtLastNewline.currentTags.length,\n this.state.currentTags.length\n );\n\n if (\n change == Story.OutputStateChange.ExtendedBeyondNewline ||\n this._sawLookaheadUnsafeFunctionAfterNewline\n ) {\n this.RestoreStateSnapshot();\n\n return true;\n } else if (change == Story.OutputStateChange.NewlineRemoved) {\n this.DiscardSnapshot();\n }\n }\n\n if (this.state.outputStreamEndsInNewline) {\n if (this.canContinue) {\n if (this._stateSnapshotAtLastNewline == null) this.StateSnapshot();\n } else {\n this.DiscardSnapshot();\n }\n }\n }\n\n if (this._profiler != null) this._profiler.PostSnapshot();\n\n return false;\n }\n\n public CalculateNewlineOutputStateChange(\n prevText: string | null,\n currText: string | null,\n prevTagCount: number,\n currTagCount: number\n ) {\n if (prevText === null) {\n return throwNullException(\"prevText\");\n }\n if (currText === null) {\n return throwNullException(\"currText\");\n }\n\n let newlineStillExists =\n currText.length >= prevText.length &&\n prevText.length > 0 &&\n currText.charAt(prevText.length - 1) == \"\\n\";\n if (\n prevTagCount == currTagCount &&\n prevText.length == currText.length &&\n newlineStillExists\n )\n return Story.OutputStateChange.NoChange;\n\n if (!newlineStillExists) {\n return Story.OutputStateChange.NewlineRemoved;\n }\n\n if (currTagCount > prevTagCount)\n return Story.OutputStateChange.ExtendedBeyondNewline;\n\n for (let i = prevText.length; i < currText.length; i++) {\n let c = currText.charAt(i);\n if (c != \" \" && c != \"\\t\") {\n return Story.OutputStateChange.ExtendedBeyondNewline;\n }\n }\n\n return Story.OutputStateChange.NoChange;\n }\n\n public ContinueMaximally() {\n this.IfAsyncWeCant(\"ContinueMaximally\");\n\n let sb = new StringBuilder();\n\n while (this.canContinue) {\n sb.Append(this.Continue());\n }\n\n return sb.toString();\n }\n\n public ContentAtPath(path: Path) {\n return this.mainContentContainer.ContentAtPath(path);\n }\n\n public KnotContainerWithName(name: string) {\n let namedContainer = this.mainContentContainer.namedContent.get(name);\n if (namedContainer instanceof Container) return namedContainer;\n else return null;\n }\n\n public PointerAtPath(path: Path) {\n if (path.length == 0) return Pointer.Null;\n\n let p = new Pointer();\n\n let pathLengthToUse = path.length;\n\n let result = null;\n if (path.lastComponent === null) {\n return throwNullException(\"path.lastComponent\");\n }\n\n if (path.lastComponent.isIndex) {\n pathLengthToUse = path.length - 1;\n result = this.mainContentContainer.ContentAtPath(\n path,\n undefined,\n pathLengthToUse\n );\n p.container = result.container;\n p.index = path.lastComponent.index;\n } else {\n result = this.mainContentContainer.ContentAtPath(path);\n p.container = result.container;\n p.index = -1;\n }\n\n if (\n result.obj == null ||\n (result.obj == this.mainContentContainer && pathLengthToUse > 0)\n ) {\n this.Error(\n \"Failed to find content at path '\" +\n path +\n \"', and no approximation of it was possible.\"\n );\n } else if (result.approximate)\n this.Warning(\n \"Failed to find content at path '\" +\n path +\n \"', so it was approximated to: '\" +\n result.obj.path +\n \"'.\"\n );\n\n return p;\n }\n\n public StateSnapshot() {\n this._stateSnapshotAtLastNewline = this._state;\n this._state = this._state.CopyAndStartPatching();\n }\n\n public RestoreStateSnapshot() {\n if (this._stateSnapshotAtLastNewline === null) {\n throwNullException(\"_stateSnapshotAtLastNewline\");\n }\n this._stateSnapshotAtLastNewline.RestoreAfterPatch();\n\n this._state = this._stateSnapshotAtLastNewline;\n this._stateSnapshotAtLastNewline = null;\n\n if (!this._asyncSaving) {\n this._state.ApplyAnyPatch();\n }\n }\n\n public DiscardSnapshot() {\n if (!this._asyncSaving) this._state.ApplyAnyPatch();\n\n this._stateSnapshotAtLastNewline = null;\n }\n\n public CopyStateForBackgroundThreadSave() {\n this.IfAsyncWeCant(\"start saving on a background thread\");\n\n if (this._asyncSaving)\n throw new Error(\n \"Story is already in background saving mode, can't call CopyStateForBackgroundThreadSave again!\"\n );\n\n let stateToSave = this._state;\n this._state = this._state.CopyAndStartPatching();\n this._asyncSaving = true;\n return stateToSave;\n }\n\n public BackgroundSaveComplete() {\n if (this._stateSnapshotAtLastNewline === null) {\n this._state.ApplyAnyPatch();\n }\n\n this._asyncSaving = false;\n }\n\n public Step() {\n let shouldAddToStream = true;\n\n let pointer = this.state.currentPointer.copy();\n if (pointer.isNull) {\n return;\n }\n\n // Container containerToEnter = pointer.Resolve () as Container;\n let containerToEnter = asOrNull(pointer.Resolve(), Container);\n\n while (containerToEnter) {\n this.VisitContainer(containerToEnter, true);\n\n // No content? the most we can do is step past it\n if (containerToEnter.content.length == 0) {\n break;\n }\n\n pointer = Pointer.StartOf(containerToEnter);\n // containerToEnter = pointer.Resolve() as Container;\n containerToEnter = asOrNull(pointer.Resolve(), Container);\n }\n\n this.state.currentPointer = pointer.copy();\n\n if (this._profiler != null) this._profiler.Step(this.state.callStack);\n\n // Is the current content object:\n // - Normal content\n // - Or a logic/flow statement - if so, do it\n // Stop flow if we hit a stack pop when we're unable to pop (e.g. return/done statement in knot\n // that was diverted to rather than called as a function)\n let currentContentObj = pointer.Resolve();\n let isLogicOrFlowControl =\n this.PerformLogicAndFlowControl(currentContentObj);\n\n // Has flow been forced to end by flow control above?\n if (this.state.currentPointer.isNull) {\n return;\n }\n\n if (isLogicOrFlowControl) {\n shouldAddToStream = false;\n }\n\n // Choice with condition?\n // var choicePoint = currentContentObj as ChoicePoint;\n let choicePoint = asOrNull(currentContentObj, ChoicePoint);\n if (choicePoint) {\n let choice = this.ProcessChoice(choicePoint);\n if (choice) {\n this.state.generatedChoices.push(choice);\n }\n\n currentContentObj = null;\n shouldAddToStream = false;\n }\n\n // If the container has no content, then it will be\n // the \"content\" itself, but we skip over it.\n if (currentContentObj instanceof Container) {\n shouldAddToStream = false;\n }\n\n // Content to add to evaluation stack or the output stream\n if (shouldAddToStream) {\n // If we're pushing a variable pointer onto the evaluation stack, ensure that it's specific\n // to our current (possibly temporary) context index. And make a copy of the pointer\n // so that we're not editing the original runtime object.\n // var varPointer = currentContentObj as VariablePointerValue;\n let varPointer = asOrNull(currentContentObj, VariablePointerValue);\n if (varPointer && varPointer.contextIndex == -1) {\n // Create new object so we're not overwriting the story's own data\n let contextIdx = this.state.callStack.ContextForVariableNamed(\n varPointer.variableName\n );\n currentContentObj = new VariablePointerValue(\n varPointer.variableName,\n contextIdx\n );\n }\n\n // Expression evaluation content\n if (this.state.inExpressionEvaluation) {\n this.state.PushEvaluationStack(currentContentObj);\n }\n // Output stream content (i.e. not expression evaluation)\n else {\n this.state.PushToOutputStream(currentContentObj);\n }\n }\n\n // Increment the content pointer, following diverts if necessary\n this.NextContent();\n\n // Starting a thread should be done after the increment to the content pointer,\n // so that when returning from the thread, it returns to the content after this instruction.\n // var controlCmd = currentContentObj as ;\n let controlCmd = asOrNull(currentContentObj, ControlCommand);\n if (\n controlCmd &&\n controlCmd.commandType == ControlCommand.CommandType.StartThread\n ) {\n this.state.callStack.PushThread();\n }\n }\n\n public VisitContainer(container: Container, atStart: boolean) {\n if (!container.countingAtStartOnly || atStart) {\n if (container.visitsShouldBeCounted)\n this.state.IncrementVisitCountForContainer(container);\n\n if (container.turnIndexShouldBeCounted)\n this.state.RecordTurnIndexVisitToContainer(container);\n }\n }\n\n private _prevContainers: Container[] = [];\n public VisitChangedContainersDueToDivert() {\n let previousPointer = this.state.previousPointer.copy();\n let pointer = this.state.currentPointer.copy();\n\n if (pointer.isNull || pointer.index == -1) return;\n\n this._prevContainers.length = 0;\n if (!previousPointer.isNull) {\n // Container prevAncestor = previousPointer.Resolve() as Container ?? previousPointer.container as Container;\n let resolvedPreviousAncestor = previousPointer.Resolve();\n let prevAncestor =\n asOrNull(resolvedPreviousAncestor, Container) ||\n asOrNull(previousPointer.container, Container);\n while (prevAncestor) {\n this._prevContainers.push(prevAncestor);\n // prevAncestor = prevAncestor.parent as Container;\n prevAncestor = asOrNull(prevAncestor.parent, Container);\n }\n }\n\n let currentChildOfContainer = pointer.Resolve();\n\n if (currentChildOfContainer == null) return;\n\n // Container currentContainerAncestor = currentChildOfContainer.parent as Container;\n let currentContainerAncestor = asOrNull(\n currentChildOfContainer.parent,\n Container\n );\n let allChildrenEnteredAtStart = true;\n while (\n currentContainerAncestor &&\n (this._prevContainers.indexOf(currentContainerAncestor) < 0 ||\n currentContainerAncestor.countingAtStartOnly)\n ) {\n // Check whether this ancestor container is being entered at the start,\n // by checking whether the child object is the first.\n let enteringAtStart =\n currentContainerAncestor.content.length > 0 &&\n currentChildOfContainer == currentContainerAncestor.content[0] &&\n allChildrenEnteredAtStart;\n\n if (!enteringAtStart) allChildrenEnteredAtStart = false;\n\n // Mark a visit to this container\n this.VisitContainer(currentContainerAncestor, enteringAtStart);\n\n currentChildOfContainer = currentContainerAncestor;\n // currentContainerAncestor = currentContainerAncestor.parent as Container;\n currentContainerAncestor = asOrNull(\n currentContainerAncestor.parent,\n Container\n );\n }\n }\n\n public PopChoiceStringAndTags(tags: string[]) {\n let choiceOnlyStrVal = asOrThrows(\n this.state.PopEvaluationStack(),\n StringValue\n );\n\n while (\n this.state.evaluationStack.length > 0 &&\n asOrNull(this.state.PeekEvaluationStack(), Tag) != null\n ) {\n let tag = asOrNull(this.state.PopEvaluationStack(), Tag);\n if (tag) tags.push(tag.text);\n }\n return choiceOnlyStrVal.value;\n }\n\n public ProcessChoice(choicePoint: ChoicePoint) {\n let showChoice = true;\n\n // Don't create choice if choice point doesn't pass conditional\n if (choicePoint.hasCondition) {\n let conditionValue = this.state.PopEvaluationStack();\n if (!this.IsTruthy(conditionValue)) {\n showChoice = false;\n }\n }\n\n let startText = \"\";\n let choiceOnlyText = \"\";\n let tags: string[] = [];\n\n if (choicePoint.hasChoiceOnlyContent) {\n choiceOnlyText = this.PopChoiceStringAndTags(tags) || \"\";\n }\n\n if (choicePoint.hasStartContent) {\n startText = this.PopChoiceStringAndTags(tags) || \"\";\n }\n\n // Don't create choice if player has already read this content\n if (choicePoint.onceOnly) {\n let visitCount = this.state.VisitCountForContainer(\n choicePoint.choiceTarget\n );\n if (visitCount > 0) {\n showChoice = false;\n }\n }\n\n // We go through the full process of creating the choice above so\n // that we consume the content for it, since otherwise it'll\n // be shown on the output stream.\n if (!showChoice) {\n return null;\n }\n\n let choice = new Choice();\n choice.targetPath = choicePoint.pathOnChoice;\n choice.sourcePath = choicePoint.path.toString();\n choice.isInvisibleDefault = choicePoint.isInvisibleDefault;\n choice.threadAtGeneration = this.state.callStack.ForkThread();\n choice.tags = tags.reverse(); //C# is a stack\n choice.text = (startText + choiceOnlyText).replace(/^[ \\t]+|[ \\t]+$/g, \"\");\n\n return choice;\n }\n\n public IsTruthy(obj: InkObject) {\n let truthy = false;\n if (obj instanceof Value) {\n let val = obj;\n\n if (val instanceof DivertTargetValue) {\n let divTarget = val;\n this.Error(\n \"Shouldn't use a divert target (to \" +\n divTarget.targetPath +\n \") as a conditional value. Did you intend a function call 'likeThis()' or a read count check 'likeThis'? (no arrows)\"\n );\n return false;\n }\n\n return val.isTruthy;\n }\n return truthy;\n }\n\n public PerformLogicAndFlowControl(contentObj: InkObject | null) {\n if (contentObj == null) {\n return false;\n }\n\n // Divert\n if (contentObj instanceof Divert) {\n let currentDivert = contentObj;\n\n if (currentDivert.isConditional) {\n let conditionValue = this.state.PopEvaluationStack();\n\n // False conditional? Cancel divert\n if (!this.IsTruthy(conditionValue)) return true;\n }\n\n if (currentDivert.hasVariableTarget) {\n let varName = currentDivert.variableDivertName;\n\n let varContents =\n this.state.variablesState.GetVariableWithName(varName);\n\n if (varContents == null) {\n this.Error(\n \"Tried to divert using a target from a variable that could not be found (\" +\n varName +\n \")\"\n );\n } else if (!(varContents instanceof DivertTargetValue)) {\n // var intContent = varContents as IntValue;\n let intContent = asOrNull(varContents, IntValue);\n\n let errorMessage =\n \"Tried to divert to a target from a variable, but the variable (\" +\n varName +\n \") didn't contain a divert target, it \";\n if (intContent instanceof IntValue && intContent.value == 0) {\n errorMessage += \"was empty/null (the value 0).\";\n } else {\n errorMessage += \"contained '\" + varContents + \"'.\";\n }\n\n this.Error(errorMessage);\n }\n\n let target = asOrThrows(varContents, DivertTargetValue);\n this.state.divertedPointer = this.PointerAtPath(target.targetPath);\n } else if (currentDivert.isExternal) {\n this.CallExternalFunction(\n currentDivert.targetPathString,\n currentDivert.externalArgs\n );\n return true;\n } else {\n this.state.divertedPointer = currentDivert.targetPointer.copy();\n }\n\n if (currentDivert.pushesToStack) {\n this.state.callStack.Push(\n currentDivert.stackPushType,\n undefined,\n this.state.outputStream.length\n );\n }\n\n if (this.state.divertedPointer.isNull && !currentDivert.isExternal) {\n if (\n currentDivert &&\n currentDivert.debugMetadata &&\n currentDivert.debugMetadata.sourceName != null\n ) {\n this.Error(\n \"Divert target doesn't exist: \" +\n currentDivert.debugMetadata.sourceName\n );\n } else {\n this.Error(\"Divert resolution failed: \" + currentDivert);\n }\n }\n\n return true;\n }\n\n // Start/end an expression evaluation? Or print out the result?\n else if (contentObj instanceof ControlCommand) {\n let evalCommand = contentObj;\n\n switch (evalCommand.commandType) {\n case ControlCommand.CommandType.EvalStart:\n this.Assert(\n this.state.inExpressionEvaluation === false,\n \"Already in expression evaluation?\"\n );\n this.state.inExpressionEvaluation = true;\n break;\n\n case ControlCommand.CommandType.EvalEnd:\n this.Assert(\n this.state.inExpressionEvaluation === true,\n \"Not in expression evaluation mode\"\n );\n this.state.inExpressionEvaluation = false;\n break;\n\n case ControlCommand.CommandType.EvalOutput:\n // If the expression turned out to be empty, there may not be anything on the stack\n if (this.state.evaluationStack.length > 0) {\n let output = this.state.PopEvaluationStack();\n\n // Functions may evaluate to Void, in which case we skip output\n if (!(output instanceof Void)) {\n // TODO: Should we really always blanket convert to string?\n // It would be okay to have numbers in the output stream the\n // only problem is when exporting text for viewing, it skips over numbers etc.\n let text = new StringValue(output.toString());\n\n this.state.PushToOutputStream(text);\n }\n }\n break;\n\n case ControlCommand.CommandType.NoOp:\n break;\n\n case ControlCommand.CommandType.Duplicate:\n this.state.PushEvaluationStack(this.state.PeekEvaluationStack());\n break;\n\n case ControlCommand.CommandType.PopEvaluatedValue:\n this.state.PopEvaluationStack();\n break;\n\n case ControlCommand.CommandType.PopFunction:\n case ControlCommand.CommandType.PopTunnel:\n let popType =\n evalCommand.commandType == ControlCommand.CommandType.PopFunction\n ? PushPopType.Function\n : PushPopType.Tunnel;\n\n let overrideTunnelReturnTarget: DivertTargetValue | null = null;\n if (popType == PushPopType.Tunnel) {\n let popped = this.state.PopEvaluationStack();\n // overrideTunnelReturnTarget = popped as DivertTargetValue;\n overrideTunnelReturnTarget = asOrNull(popped, DivertTargetValue);\n if (overrideTunnelReturnTarget === null) {\n this.Assert(\n popped instanceof Void,\n \"Expected void if ->-> doesn't override target\"\n );\n }\n }\n\n if (this.state.TryExitFunctionEvaluationFromGame()) {\n break;\n } else if (\n this.state.callStack.currentElement.type != popType ||\n !this.state.callStack.canPop\n ) {\n let names: Map = new Map();\n names.set(\n PushPopType.Function,\n \"function return statement (~ return)\"\n );\n names.set(PushPopType.Tunnel, \"tunnel onwards statement (->->)\");\n\n let expected = names.get(this.state.callStack.currentElement.type);\n if (!this.state.callStack.canPop) {\n expected = \"end of flow (-> END or choice)\";\n }\n\n let errorMsg =\n \"Found \" + names.get(popType) + \", when expected \" + expected;\n\n this.Error(errorMsg);\n } else {\n this.state.PopCallStack();\n\n if (overrideTunnelReturnTarget)\n this.state.divertedPointer = this.PointerAtPath(\n overrideTunnelReturnTarget.targetPath\n );\n }\n break;\n\n case ControlCommand.CommandType.BeginString:\n this.state.PushToOutputStream(evalCommand);\n\n this.Assert(\n this.state.inExpressionEvaluation === true,\n \"Expected to be in an expression when evaluating a string\"\n );\n this.state.inExpressionEvaluation = false;\n break;\n\n // Leave it to story.currentText and story.currentTags to sort out the text from the tags\n // This is mostly because we can't always rely on the existence of EndTag, and we don't want\n // to try and flatten dynamic tags to strings every time \\n is pushed to output\n case ControlCommand.CommandType.BeginTag:\n this.state.PushToOutputStream(evalCommand);\n break;\n\n // EndTag has 2 modes:\n // - When in string evaluation (for choices)\n // - Normal\n //\n // The only way you could have an EndTag in the middle of\n // string evaluation is if we're currently generating text for a\n // choice, such as:\n //\n // + choice # tag\n //\n // In the above case, the ink will be run twice:\n // - First, to generate the choice text. String evaluation\n // will be on, and the final string will be pushed to the\n // evaluation stack, ready to be popped to make a Choice\n // object.\n // - Second, when ink generates text after choosing the choice.\n // On this ocassion, it's not in string evaluation mode.\n //\n // On the writing side, we disallow manually putting tags within\n // strings like this:\n //\n // {\"hello # world\"}\n //\n // So we know that the tag must be being generated as part of\n // choice content. Therefore, when the tag has been generated,\n // we push it onto the evaluation stack in the exact same way\n // as the string for the choice content.\n case ControlCommand.CommandType.EndTag: {\n if (this.state.inStringEvaluation) {\n let contentStackForTag: InkObject[] = [];\n let outputCountConsumed = 0;\n for (let i = this.state.outputStream.length - 1; i >= 0; --i) {\n let obj = this.state.outputStream[i];\n outputCountConsumed++;\n\n // var command = obj as ControlCommand;\n let command = asOrNull(obj, ControlCommand);\n if (command != null) {\n if (\n command.commandType == ControlCommand.CommandType.BeginTag\n ) {\n break;\n } else {\n this.Error(\n \"Unexpected ControlCommand while extracting tag from choice\"\n );\n break;\n }\n }\n if (obj instanceof StringValue) {\n contentStackForTag.push(obj);\n }\n }\n\n // Consume the content that was produced for this string\n this.state.PopFromOutputStream(outputCountConsumed);\n // Build string out of the content we collected\n let sb = new StringBuilder();\n for (let strVal of contentStackForTag.reverse()) {\n sb.Append(strVal.toString());\n }\n let choiceTag = new Tag(\n this.state.CleanOutputWhitespace(sb.toString())\n );\n // Pushing to the evaluation stack means it gets picked up\n // when a Choice is generated from the next Choice Point.\n this.state.PushEvaluationStack(choiceTag);\n } else {\n // Otherwise! Simply push EndTag, so that in the output stream we\n // have a structure of: [BeginTag, \"the tag content\", EndTag]\n this.state.PushToOutputStream(evalCommand);\n }\n break;\n }\n\n case ControlCommand.CommandType.EndString: {\n let contentStackForString: InkObject[] = [];\n let contentToRetain: InkObject[] = [];\n\n let outputCountConsumed = 0;\n for (let i = this.state.outputStream.length - 1; i >= 0; --i) {\n let obj = this.state.outputStream[i];\n\n outputCountConsumed++;\n\n // var command = obj as ControlCommand;\n let command = asOrNull(obj, ControlCommand);\n if (\n command &&\n command.commandType == ControlCommand.CommandType.BeginString\n ) {\n break;\n }\n if (obj instanceof Tag) {\n contentToRetain.push(obj);\n }\n if (obj instanceof StringValue) {\n contentStackForString.push(obj);\n }\n }\n\n // Consume the content that was produced for this string\n this.state.PopFromOutputStream(outputCountConsumed);\n\n // Rescue the tags that we want actually to keep on the output stack\n // rather than consume as part of the string we're building.\n // At the time of writing, this only applies to Tag objects generated\n // by choices, which are pushed to the stack during string generation.\n for (let rescuedTag of contentToRetain)\n this.state.PushToOutputStream(rescuedTag);\n\n // The C# version uses a Stack for contentStackForString, but we're\n // using a simple array, so we need to reverse it before using it\n contentStackForString = contentStackForString.reverse();\n\n // Build string out of the content we collected\n let sb = new StringBuilder();\n for (let c of contentStackForString) {\n sb.Append(c.toString());\n }\n\n // Return to expression evaluation (from content mode)\n this.state.inExpressionEvaluation = true;\n this.state.PushEvaluationStack(new StringValue(sb.toString()));\n break;\n }\n\n case ControlCommand.CommandType.ChoiceCount:\n let choiceCount = this.state.generatedChoices.length;\n this.state.PushEvaluationStack(new IntValue(choiceCount));\n break;\n\n case ControlCommand.CommandType.Turns:\n this.state.PushEvaluationStack(\n new IntValue(this.state.currentTurnIndex + 1)\n );\n break;\n\n case ControlCommand.CommandType.TurnsSince:\n case ControlCommand.CommandType.ReadCount:\n let target = this.state.PopEvaluationStack();\n if (!(target instanceof DivertTargetValue)) {\n let extraNote = \"\";\n if (target instanceof IntValue)\n extraNote =\n \". Did you accidentally pass a read count ('knot_name') instead of a target ('-> knot_name')?\";\n this.Error(\n \"TURNS_SINCE / READ_COUNT expected a divert target (knot, stitch, label name), but saw \" +\n target +\n extraNote\n );\n break;\n }\n\n // var divertTarget = target as DivertTargetValue;\n let divertTarget = asOrThrows(target, DivertTargetValue);\n // var container = ContentAtPath (divertTarget.targetPath).correctObj as Container;\n let container = asOrNull(\n this.ContentAtPath(divertTarget.targetPath).correctObj,\n Container\n );\n\n let eitherCount;\n if (container != null) {\n if (\n evalCommand.commandType == ControlCommand.CommandType.TurnsSince\n )\n eitherCount = this.state.TurnsSinceForContainer(container);\n else eitherCount = this.state.VisitCountForContainer(container);\n } else {\n if (\n evalCommand.commandType == ControlCommand.CommandType.TurnsSince\n )\n eitherCount = -1;\n else eitherCount = 0;\n\n this.Warning(\n \"Failed to find container for \" +\n evalCommand.toString() +\n \" lookup at \" +\n divertTarget.targetPath.toString()\n );\n }\n\n this.state.PushEvaluationStack(new IntValue(eitherCount));\n break;\n\n case ControlCommand.CommandType.Random: {\n let maxInt = asOrNull(this.state.PopEvaluationStack(), IntValue);\n let minInt = asOrNull(this.state.PopEvaluationStack(), IntValue);\n\n if (minInt == null || minInt instanceof IntValue === false)\n return this.Error(\n \"Invalid value for minimum parameter of RANDOM(min, max)\"\n );\n\n if (maxInt == null || maxInt instanceof IntValue === false)\n return this.Error(\n \"Invalid value for maximum parameter of RANDOM(min, max)\"\n );\n\n // Originally a primitive type, but here, can be null.\n // TODO: Replace by default value?\n if (maxInt.value === null) {\n return throwNullException(\"maxInt.value\");\n }\n if (minInt.value === null) {\n return throwNullException(\"minInt.value\");\n }\n\n // This code is differs a bit from the reference implementation, since\n // JavaScript has no true integers. Hence integer arithmetics and\n // interger overflows don't apply here. A loss of precision can\n // happen with big numbers however.\n //\n // The case where 'randomRange' is lower than zero is handled below,\n // so there's no need to test against Number.MIN_SAFE_INTEGER.\n let randomRange = maxInt.value - minInt.value + 1;\n if (!isFinite(randomRange) || randomRange > Number.MAX_SAFE_INTEGER) {\n randomRange = Number.MAX_SAFE_INTEGER;\n this.Error(\n \"RANDOM was called with a range that exceeds the size that ink numbers can use.\"\n );\n }\n if (randomRange <= 0)\n this.Error(\n \"RANDOM was called with minimum as \" +\n minInt.value +\n \" and maximum as \" +\n maxInt.value +\n \". The maximum must be larger\"\n );\n\n let resultSeed = this.state.storySeed + this.state.previousRandom;\n let random = new PRNG(resultSeed);\n\n let nextRandom = random.next();\n let chosenValue = (nextRandom % randomRange) + minInt.value;\n this.state.PushEvaluationStack(new IntValue(chosenValue));\n\n // Next random number (rather than keeping the Random object around)\n this.state.previousRandom = nextRandom;\n break;\n }\n\n case ControlCommand.CommandType.SeedRandom:\n let seed = asOrNull(this.state.PopEvaluationStack(), IntValue);\n if (seed == null || seed instanceof IntValue === false)\n return this.Error(\"Invalid value passed to SEED_RANDOM\");\n\n // Originally a primitive type, but here, can be null.\n // TODO: Replace by default value?\n if (seed.value === null) {\n return throwNullException(\"minInt.value\");\n }\n\n this.state.storySeed = seed.value;\n this.state.previousRandom = 0;\n\n this.state.PushEvaluationStack(new Void());\n break;\n\n case ControlCommand.CommandType.VisitIndex:\n let count =\n this.state.VisitCountForContainer(\n this.state.currentPointer.container\n ) - 1; // index not count\n this.state.PushEvaluationStack(new IntValue(count));\n break;\n\n case ControlCommand.CommandType.SequenceShuffleIndex:\n let shuffleIndex = this.NextSequenceShuffleIndex();\n this.state.PushEvaluationStack(new IntValue(shuffleIndex));\n break;\n\n case ControlCommand.CommandType.StartThread:\n // Handled in main step function\n break;\n\n case ControlCommand.CommandType.Done:\n // We may exist in the context of the initial\n // act of creating the thread, or in the context of\n // evaluating the content.\n if (this.state.callStack.canPopThread) {\n this.state.callStack.PopThread();\n }\n\n // In normal flow - allow safe exit without warning\n else {\n this.state.didSafeExit = true;\n\n // Stop flow in current thread\n this.state.currentPointer = Pointer.Null;\n }\n\n break;\n\n // Force flow to end completely\n case ControlCommand.CommandType.End:\n this.state.ForceEnd();\n break;\n\n case ControlCommand.CommandType.ListFromInt:\n // var intVal = state.PopEvaluationStack () as IntValue;\n let intVal = asOrNull(this.state.PopEvaluationStack(), IntValue);\n // var listNameVal = state.PopEvaluationStack () as StringValue;\n let listNameVal = asOrThrows(\n this.state.PopEvaluationStack(),\n StringValue\n );\n\n if (intVal === null) {\n throw new StoryException(\n \"Passed non-integer when creating a list element from a numerical value.\"\n );\n }\n\n let generatedListValue = null;\n\n if (this.listDefinitions === null) {\n return throwNullException(\"this.listDefinitions\");\n }\n let foundListDef = this.listDefinitions.TryListGetDefinition(\n listNameVal.value,\n null\n );\n if (foundListDef.exists) {\n // Originally a primitive type, but here, can be null.\n // TODO: Replace by default value?\n if (intVal.value === null) {\n return throwNullException(\"minInt.value\");\n }\n\n let foundItem = foundListDef.result!.TryGetItemWithValue(\n intVal.value,\n InkListItem.Null\n );\n if (foundItem.exists) {\n generatedListValue = new ListValue(\n foundItem.result!,\n intVal.value\n );\n }\n } else {\n throw new StoryException(\n \"Failed to find LIST called \" + listNameVal.value\n );\n }\n\n if (generatedListValue == null) generatedListValue = new ListValue();\n\n this.state.PushEvaluationStack(generatedListValue);\n break;\n\n case ControlCommand.CommandType.ListRange:\n let max = asOrNull(this.state.PopEvaluationStack(), Value);\n let min = asOrNull(this.state.PopEvaluationStack(), Value);\n\n // var targetList = state.PopEvaluationStack () as ListValue;\n let targetList = asOrNull(this.state.PopEvaluationStack(), ListValue);\n\n if (targetList === null || min === null || max === null)\n throw new StoryException(\n \"Expected list, minimum and maximum for LIST_RANGE\"\n );\n\n if (targetList.value === null) {\n return throwNullException(\"targetList.value\");\n }\n let result = targetList.value.ListWithSubRange(\n min.valueObject,\n max.valueObject\n );\n\n this.state.PushEvaluationStack(new ListValue(result));\n break;\n\n case ControlCommand.CommandType.ListRandom: {\n let listVal = this.state.PopEvaluationStack() as ListValue;\n if (listVal === null)\n throw new StoryException(\"Expected list for LIST_RANDOM\");\n\n let list = listVal.value;\n\n let newList: InkList | null = null;\n\n if (list === null) {\n throw throwNullException(\"list\");\n }\n if (list.Count == 0) {\n newList = new InkList();\n } else {\n // Generate a random index for the element to take\n let resultSeed = this.state.storySeed + this.state.previousRandom;\n let random = new PRNG(resultSeed);\n\n let nextRandom = random.next();\n let listItemIndex = nextRandom % list.Count;\n\n // This bit is a little different from the original\n // C# code, since iterators do not work in the same way.\n // First, we iterate listItemIndex - 1 times, calling next().\n // The listItemIndex-th time is made outside of the loop,\n // in order to retrieve the value.\n let listEnumerator = list.entries();\n for (let i = 0; i <= listItemIndex - 1; i++) {\n listEnumerator.next();\n }\n let value = listEnumerator.next().value;\n let randomItem: KeyValuePair = {\n Key: InkListItem.fromSerializedKey(value[0]),\n Value: value[1],\n };\n\n // Origin list is simply the origin of the one element\n if (randomItem.Key.originName === null) {\n return throwNullException(\"randomItem.Key.originName\");\n }\n newList = new InkList(randomItem.Key.originName, this);\n newList.Add(randomItem.Key, randomItem.Value);\n\n this.state.previousRandom = nextRandom;\n }\n\n this.state.PushEvaluationStack(new ListValue(newList));\n break;\n }\n\n default:\n this.Error(\"unhandled ControlCommand: \" + evalCommand);\n break;\n }\n\n return true;\n }\n\n // Variable assignment\n else if (contentObj instanceof VariableAssignment) {\n let varAss = contentObj;\n let assignedVal = this.state.PopEvaluationStack();\n\n this.state.variablesState.Assign(varAss, assignedVal);\n\n return true;\n }\n\n // Variable reference\n else if (contentObj instanceof VariableReference) {\n let varRef = contentObj;\n let foundValue = null;\n\n // Explicit read count value\n if (varRef.pathForCount != null) {\n let container = varRef.containerForCount;\n let count = this.state.VisitCountForContainer(container);\n foundValue = new IntValue(count);\n }\n\n // Normal variable reference\n else {\n foundValue = this.state.variablesState.GetVariableWithName(varRef.name);\n\n if (foundValue == null) {\n this.Warning(\n \"Variable not found: '\" +\n varRef.name +\n \"'. Using default value of 0 (false). This can happen with temporary variables if the declaration hasn't yet been hit. Globals are always given a default value on load if a value doesn't exist in the save state.\"\n );\n foundValue = new IntValue(0);\n }\n }\n\n this.state.PushEvaluationStack(foundValue);\n\n return true;\n }\n\n // Native function call\n else if (contentObj instanceof NativeFunctionCall) {\n let func = contentObj;\n let funcParams = this.state.PopEvaluationStack(func.numberOfParameters);\n let result = func.Call(funcParams);\n this.state.PushEvaluationStack(result);\n return true;\n }\n\n // No control content, must be ordinary content\n return false;\n }\n\n public ChoosePathString(\n path: string,\n resetCallstack = true,\n args: any[] = []\n ) {\n this.IfAsyncWeCant(\"call ChoosePathString right now\");\n if (this.onChoosePathString !== null) this.onChoosePathString(path, args);\n\n if (resetCallstack) {\n this.ResetCallstack();\n } else {\n if (this.state.callStack.currentElement.type == PushPopType.Function) {\n let funcDetail = \"\";\n let container =\n this.state.callStack.currentElement.currentPointer.container;\n if (container != null) {\n funcDetail = \"(\" + container.path.toString() + \") \";\n }\n throw new Error(\n \"Story was running a function \" +\n funcDetail +\n \"when you called ChoosePathString(\" +\n path +\n \") - this is almost certainly not not what you want! Full stack trace: \\n\" +\n this.state.callStack.callStackTrace\n );\n }\n }\n\n this.state.PassArgumentsToEvaluationStack(args);\n this.ChoosePath(new Path(path));\n }\n\n public IfAsyncWeCant(activityStr: string) {\n if (this._asyncContinueActive)\n throw new Error(\n \"Can't \" +\n activityStr +\n \". Story is in the middle of a ContinueAsync(). Make more ContinueAsync() calls or a single Continue() call beforehand.\"\n );\n }\n\n public ChoosePath(p: Path, incrementingTurnIndex: boolean = true) {\n this.state.SetChosenPath(p, incrementingTurnIndex);\n\n // Take a note of newly visited containers for read counts etc\n this.VisitChangedContainersDueToDivert();\n }\n\n public ChooseChoiceIndex(choiceIdx: number) {\n choiceIdx = choiceIdx;\n let choices = this.currentChoices;\n this.Assert(\n choiceIdx >= 0 && choiceIdx < choices.length,\n \"choice out of range\"\n );\n\n let choiceToChoose = choices[choiceIdx];\n if (this.onMakeChoice !== null) this.onMakeChoice(choiceToChoose);\n\n if (choiceToChoose.threadAtGeneration === null) {\n return throwNullException(\"choiceToChoose.threadAtGeneration\");\n }\n if (choiceToChoose.targetPath === null) {\n return throwNullException(\"choiceToChoose.targetPath\");\n }\n\n this.state.callStack.currentThread = choiceToChoose.threadAtGeneration;\n\n this.ChoosePath(choiceToChoose.targetPath);\n }\n\n public HasFunction(functionName: string) {\n try {\n return this.KnotContainerWithName(functionName) != null;\n } catch (e) {\n return false;\n }\n }\n\n public EvaluateFunction(\n functionName: string,\n args: any[] = [],\n returnTextOutput: boolean = false\n ): Story.EvaluateFunctionTextOutput | any {\n // EvaluateFunction behaves slightly differently than the C# version.\n // In C#, you can pass a (second) parameter `out textOutput` to get the\n // text outputted by the function. This is not possible in js. Instead,\n // we maintain the regular signature (functionName, args), plus an\n // optional third parameter returnTextOutput. If set to true, we will\n // return both the textOutput and the returned value, as an object.\n\n if (this.onEvaluateFunction !== null)\n this.onEvaluateFunction(functionName, args);\n\n this.IfAsyncWeCant(\"evaluate a function\");\n\n if (functionName == null) {\n throw new Error(\"Function is null\");\n } else if (functionName == \"\" || functionName.trim() == \"\") {\n throw new Error(\"Function is empty or white space.\");\n }\n\n let funcContainer = this.KnotContainerWithName(functionName);\n if (funcContainer == null) {\n throw new Error(\"Function doesn't exist: '\" + functionName + \"'\");\n }\n\n let outputStreamBefore: InkObject[] = [];\n outputStreamBefore.push(...this.state.outputStream);\n this._state.ResetOutput();\n\n this.state.StartFunctionEvaluationFromGame(funcContainer, args);\n\n // Evaluate the function, and collect the string output\n let stringOutput = new StringBuilder();\n while (this.canContinue) {\n stringOutput.Append(this.Continue());\n }\n let textOutput = stringOutput.toString();\n\n this._state.ResetOutput(outputStreamBefore);\n\n let result = this.state.CompleteFunctionEvaluationFromGame();\n if (this.onCompleteEvaluateFunction != null)\n this.onCompleteEvaluateFunction(functionName, args, textOutput, result);\n\n return returnTextOutput ? { returned: result, output: textOutput } : result;\n }\n\n public EvaluateExpression(exprContainer: Container) {\n let startCallStackHeight = this.state.callStack.elements.length;\n\n this.state.callStack.Push(PushPopType.Tunnel);\n\n this._temporaryEvaluationContainer = exprContainer;\n\n this.state.GoToStart();\n\n let evalStackHeight = this.state.evaluationStack.length;\n\n this.Continue();\n\n this._temporaryEvaluationContainer = null;\n\n // Should have fallen off the end of the Container, which should\n // have auto-popped, but just in case we didn't for some reason,\n // manually pop to restore the state (including currentPath).\n if (this.state.callStack.elements.length > startCallStackHeight) {\n this.state.PopCallStack();\n }\n\n let endStackHeight = this.state.evaluationStack.length;\n if (endStackHeight > evalStackHeight) {\n return this.state.PopEvaluationStack();\n } else {\n return null;\n }\n }\n\n public allowExternalFunctionFallbacks: boolean = false;\n\n public CallExternalFunction(\n funcName: string | null,\n numberOfArguments: number\n ) {\n if (funcName === null) {\n return throwNullException(\"funcName\");\n }\n let funcDef = this._externals.get(funcName);\n let fallbackFunctionContainer = null;\n\n let foundExternal = typeof funcDef !== \"undefined\";\n\n if (\n foundExternal &&\n !funcDef!.lookAheadSafe &&\n this._stateSnapshotAtLastNewline !== null\n ) {\n this._sawLookaheadUnsafeFunctionAfterNewline = true;\n return;\n }\n\n if (!foundExternal) {\n if (this.allowExternalFunctionFallbacks) {\n fallbackFunctionContainer = this.KnotContainerWithName(funcName);\n this.Assert(\n fallbackFunctionContainer !== null,\n \"Trying to call EXTERNAL function '\" +\n funcName +\n \"' which has not been bound, and fallback ink function could not be found.\"\n );\n\n // Divert direct into fallback function and we're done\n this.state.callStack.Push(\n PushPopType.Function,\n undefined,\n this.state.outputStream.length\n );\n this.state.divertedPointer = Pointer.StartOf(fallbackFunctionContainer);\n return;\n } else {\n this.Assert(\n false,\n \"Trying to call EXTERNAL function '\" +\n funcName +\n \"' which has not been bound (and ink fallbacks disabled).\"\n );\n }\n }\n\n // Pop arguments\n let args: any[] = [];\n for (let i = 0; i < numberOfArguments; ++i) {\n // var poppedObj = state.PopEvaluationStack () as Value;\n let poppedObj = asOrThrows(this.state.PopEvaluationStack(), Value);\n let valueObj = poppedObj.valueObject;\n args.push(valueObj);\n }\n\n // Reverse arguments from the order they were popped,\n // so they're the right way round again.\n args.reverse();\n\n // Run the function!\n let funcResult = funcDef!.function(args);\n\n // Convert return value (if any) to the a type that the ink engine can use\n let returnObj = null;\n if (funcResult != null) {\n returnObj = Value.Create(funcResult);\n this.Assert(\n returnObj !== null,\n \"Could not create ink value from returned object of type \" +\n typeof funcResult\n );\n } else {\n returnObj = new Void();\n }\n\n this.state.PushEvaluationStack(returnObj);\n }\n\n public BindExternalFunctionGeneral(\n funcName: string,\n func: Story.ExternalFunction,\n lookaheadSafe: boolean = true\n ) {\n this.IfAsyncWeCant(\"bind an external function\");\n this.Assert(\n !this._externals.has(funcName),\n \"Function '\" + funcName + \"' has already been bound.\"\n );\n this._externals.set(funcName, {\n function: func,\n lookAheadSafe: lookaheadSafe,\n });\n }\n\n public TryCoerce(value: any) {\n // We're skipping type coercition in this implementation. First of, js\n // is loosely typed, so it's not that important. Secondly, there is no\n // clean way (AFAIK) for the user to describe what type of parameters\n // they expect.\n return value;\n }\n\n public BindExternalFunction(\n funcName: string,\n func: Story.ExternalFunction,\n lookaheadSafe: boolean = false\n ) {\n this.Assert(func != null, \"Can't bind a null function\");\n\n this.BindExternalFunctionGeneral(\n funcName,\n (args: any) => {\n this.Assert(\n args.length >= func.length,\n \"External function expected \" + func.length + \" arguments\"\n );\n\n let coercedArgs = [];\n for (let i = 0, l = args.length; i < l; i++) {\n coercedArgs[i] = this.TryCoerce(args[i]);\n }\n return func.apply(null, coercedArgs);\n },\n lookaheadSafe\n );\n }\n\n public UnbindExternalFunction(funcName: string) {\n this.IfAsyncWeCant(\"unbind an external a function\");\n this.Assert(\n this._externals.has(funcName),\n \"Function '\" + funcName + \"' has not been bound.\"\n );\n this._externals.delete(funcName);\n }\n\n public ValidateExternalBindings(): void;\n public ValidateExternalBindings(\n c: Container | null,\n missingExternals: Set\n ): void;\n public ValidateExternalBindings(\n o: InkObject | null,\n missingExternals: Set\n ): void;\n public ValidateExternalBindings() {\n let c: Container | null = null;\n let o: InkObject | null = null;\n let missingExternals: Set = arguments[1] || new Set();\n\n if (arguments[0] instanceof Container) {\n c = arguments[0];\n }\n\n if (arguments[0] instanceof InkObject) {\n o = arguments[0];\n }\n\n if (c === null && o === null) {\n this.ValidateExternalBindings(\n this._mainContentContainer,\n missingExternals\n );\n this._hasValidatedExternals = true;\n\n // No problem! Validation complete\n if (missingExternals.size == 0) {\n this._hasValidatedExternals = true;\n } else {\n let message = \"Error: Missing function binding for external\";\n message += missingExternals.size > 1 ? \"s\" : \"\";\n message += \": '\";\n message += Array.from(missingExternals).join(\"', '\");\n message += \"' \";\n message += this.allowExternalFunctionFallbacks\n ? \", and no fallback ink function found.\"\n : \" (ink fallbacks disabled)\";\n\n this.Error(message);\n }\n } else if (c != null) {\n for (let innerContent of c.content) {\n let container = innerContent as Container;\n if (container == null || !container.hasValidName)\n this.ValidateExternalBindings(innerContent, missingExternals);\n }\n for (let [, value] of c.namedContent) {\n this.ValidateExternalBindings(\n asOrNull(value, InkObject),\n missingExternals\n );\n }\n } else if (o != null) {\n let divert = asOrNull(o, Divert);\n if (divert && divert.isExternal) {\n let name = divert.targetPathString;\n if (name === null) {\n return throwNullException(\"name\");\n }\n if (!this._externals.has(name)) {\n if (this.allowExternalFunctionFallbacks) {\n let fallbackFound =\n this.mainContentContainer.namedContent.has(name);\n if (!fallbackFound) {\n missingExternals.add(name);\n }\n } else {\n missingExternals.add(name);\n }\n }\n }\n }\n }\n\n public ObserveVariable(\n variableName: string,\n observer: Story.VariableObserver\n ) {\n this.IfAsyncWeCant(\"observe a new variable\");\n\n if (this._variableObservers === null) this._variableObservers = new Map();\n\n if (!this.state.variablesState.GlobalVariableExistsWithName(variableName))\n throw new Error(\n \"Cannot observe variable '\" +\n variableName +\n \"' because it wasn't declared in the ink story.\"\n );\n\n if (this._variableObservers.has(variableName)) {\n this._variableObservers.get(variableName)!.push(observer);\n } else {\n this._variableObservers.set(variableName, [observer]);\n }\n }\n\n public ObserveVariables(\n variableNames: string[],\n observers: Story.VariableObserver[]\n ) {\n for (let i = 0, l = variableNames.length; i < l; i++) {\n this.ObserveVariable(variableNames[i], observers[i]);\n }\n }\n\n public RemoveVariableObserver(\n observer?: Story.VariableObserver,\n specificVariableName?: string\n ) {\n // A couple of things to know about this method:\n //\n // 1. Since `RemoveVariableObserver` is exposed to the JavaScript world,\n // optionality is marked as `undefined` rather than `null`.\n // To keep things simple, null-checks are performed using regular\n // equality operators, where undefined == null.\n //\n // 2. Since C# delegates are translated to arrays of functions,\n // -= becomes a call to splice and null-checks are replaced by\n // emptiness-checks.\n //\n this.IfAsyncWeCant(\"remove a variable observer\");\n\n if (this._variableObservers === null) return;\n\n if (specificVariableName != null) {\n if (this._variableObservers.has(specificVariableName)) {\n if (observer != null) {\n let variableObservers =\n this._variableObservers.get(specificVariableName);\n if (variableObservers != null) {\n variableObservers.splice(variableObservers.indexOf(observer), 1);\n if (variableObservers.length === 0) {\n this._variableObservers.delete(specificVariableName);\n }\n }\n } else {\n this._variableObservers.delete(specificVariableName);\n }\n }\n } else if (observer != null) {\n let keys = this._variableObservers.keys();\n for (let varName of keys) {\n let variableObservers = this._variableObservers.get(varName);\n if (variableObservers != null) {\n variableObservers.splice(variableObservers.indexOf(observer), 1);\n if (variableObservers.length === 0) {\n this._variableObservers.delete(varName);\n }\n }\n }\n }\n }\n\n public VariableStateDidChangeEvent(\n variableName: string,\n newValueObj: InkObject\n ) {\n if (this._variableObservers === null) return;\n\n let observers = this._variableObservers.get(variableName);\n if (typeof observers !== \"undefined\") {\n if (!(newValueObj instanceof Value)) {\n throw new Error(\n \"Tried to get the value of a variable that isn't a standard type\"\n );\n }\n // var val = newValueObj as Value;\n let val = asOrThrows(newValueObj, Value);\n\n for (let observer of observers) {\n observer(variableName, val.valueObject);\n }\n }\n }\n\n get globalTags() {\n return this.TagsAtStartOfFlowContainerWithPathString(\"\");\n }\n\n public TagsForContentAtPath(path: string) {\n return this.TagsAtStartOfFlowContainerWithPathString(path);\n }\n\n public TagsAtStartOfFlowContainerWithPathString(pathString: string) {\n let path = new Path(pathString);\n\n let flowContainer = this.ContentAtPath(path).container;\n if (flowContainer === null) {\n return throwNullException(\"flowContainer\");\n }\n while (true) {\n let firstContent: InkObject = flowContainer.content[0];\n if (firstContent instanceof Container) flowContainer = firstContent;\n else break;\n }\n\n let inTag = false;\n let tags: string[] | null = null;\n\n for (let c of flowContainer.content) {\n // var tag = c as Runtime.Tag;\n let command = asOrNull(c, ControlCommand);\n\n if (command != null) {\n if (command.commandType == ControlCommand.CommandType.BeginTag) {\n inTag = true;\n } else if (command.commandType == ControlCommand.CommandType.EndTag) {\n inTag = false;\n }\n } else if (inTag) {\n let str = asOrNull(c, StringValue);\n if (str !== null) {\n if (tags === null) tags = [];\n if (str.value !== null) tags.push(str.value);\n } else {\n this.Error(\n \"Tag contained non-text content. Only plain text is allowed when using globalTags or TagsAtContentPath. If you want to evaluate dynamic content, you need to use story.Continue().\"\n );\n }\n } else {\n break;\n }\n }\n\n return tags;\n }\n\n public BuildStringOfHierarchy() {\n let sb = new StringBuilder();\n\n this.mainContentContainer.BuildStringOfHierarchy(\n sb,\n 0,\n this.state.currentPointer.Resolve()\n );\n\n return sb.toString();\n }\n\n public BuildStringOfContainer(container: Container) {\n let sb = new StringBuilder();\n container.BuildStringOfHierarchy(\n sb,\n 0,\n this.state.currentPointer.Resolve()\n );\n return sb.toString();\n }\n\n public NextContent() {\n this.state.previousPointer = this.state.currentPointer.copy();\n\n if (!this.state.divertedPointer.isNull) {\n this.state.currentPointer = this.state.divertedPointer.copy();\n this.state.divertedPointer = Pointer.Null;\n\n this.VisitChangedContainersDueToDivert();\n\n if (!this.state.currentPointer.isNull) {\n return;\n }\n }\n\n let successfulPointerIncrement = this.IncrementContentPointer();\n\n if (!successfulPointerIncrement) {\n let didPop = false;\n\n if (this.state.callStack.CanPop(PushPopType.Function)) {\n this.state.PopCallStack(PushPopType.Function);\n\n if (this.state.inExpressionEvaluation) {\n this.state.PushEvaluationStack(new Void());\n }\n\n didPop = true;\n } else if (this.state.callStack.canPopThread) {\n this.state.callStack.PopThread();\n\n didPop = true;\n } else {\n this.state.TryExitFunctionEvaluationFromGame();\n }\n\n if (didPop && !this.state.currentPointer.isNull) {\n this.NextContent();\n }\n }\n }\n\n public IncrementContentPointer() {\n let successfulIncrement = true;\n\n let pointer = this.state.callStack.currentElement.currentPointer.copy();\n pointer.index++;\n\n if (pointer.container === null) {\n return throwNullException(\"pointer.container\");\n }\n while (pointer.index >= pointer.container.content.length) {\n successfulIncrement = false;\n\n // Container nextAncestor = pointer.container.parent as Container;\n let nextAncestor = asOrNull(pointer.container.parent, Container);\n if (nextAncestor instanceof Container === false) {\n break;\n }\n\n let indexInAncestor = nextAncestor!.content.indexOf(pointer.container);\n if (indexInAncestor == -1) {\n break;\n }\n\n pointer = new Pointer(nextAncestor, indexInAncestor);\n\n pointer.index++;\n\n successfulIncrement = true;\n if (pointer.container === null) {\n return throwNullException(\"pointer.container\");\n }\n }\n\n if (!successfulIncrement) pointer = Pointer.Null;\n\n this.state.callStack.currentElement.currentPointer = pointer.copy();\n\n return successfulIncrement;\n }\n\n public TryFollowDefaultInvisibleChoice() {\n let allChoices = this._state.currentChoices;\n\n let invisibleChoices = allChoices.filter((c) => c.isInvisibleDefault);\n\n if (\n invisibleChoices.length == 0 ||\n allChoices.length > invisibleChoices.length\n )\n return false;\n\n let choice = invisibleChoices[0];\n\n if (choice.targetPath === null) {\n return throwNullException(\"choice.targetPath\");\n }\n\n if (choice.threadAtGeneration === null) {\n return throwNullException(\"choice.threadAtGeneration\");\n }\n\n this.state.callStack.currentThread = choice.threadAtGeneration;\n\n if (this._stateSnapshotAtLastNewline !== null) {\n this.state.callStack.currentThread = this.state.callStack.ForkThread();\n }\n\n this.ChoosePath(choice.targetPath, false);\n\n return true;\n }\n\n public NextSequenceShuffleIndex() {\n // var numElementsIntVal = state.PopEvaluationStack () as IntValue;\n let numElementsIntVal = asOrNull(this.state.PopEvaluationStack(), IntValue);\n if (!(numElementsIntVal instanceof IntValue)) {\n this.Error(\"expected number of elements in sequence for shuffle index\");\n return 0;\n }\n\n let seqContainer = this.state.currentPointer.container;\n if (seqContainer === null) {\n return throwNullException(\"seqContainer\");\n }\n\n // Originally a primitive type, but here, can be null.\n // TODO: Replace by default value?\n if (numElementsIntVal.value === null) {\n return throwNullException(\"numElementsIntVal.value\");\n }\n let numElements = numElementsIntVal.value;\n\n // var seqCountVal = state.PopEvaluationStack () as IntValue;\n let seqCountVal = asOrThrows(this.state.PopEvaluationStack(), IntValue);\n let seqCount = seqCountVal.value;\n\n // Originally a primitive type, but here, can be null.\n // TODO: Replace by default value?\n if (seqCount === null) {\n return throwNullException(\"seqCount\");\n }\n\n let loopIndex = seqCount / numElements;\n let iterationIndex = seqCount % numElements;\n\n let seqPathStr = seqContainer.path.toString();\n let sequenceHash = 0;\n for (let i = 0, l = seqPathStr.length; i < l; i++) {\n sequenceHash += seqPathStr.charCodeAt(i) || 0;\n }\n let randomSeed = sequenceHash + loopIndex + this.state.storySeed;\n let random = new PRNG(Math.floor(randomSeed));\n\n let unpickedIndices = [];\n for (let i = 0; i < numElements; ++i) {\n unpickedIndices.push(i);\n }\n\n for (let i = 0; i <= iterationIndex; ++i) {\n let chosen = random.next() % unpickedIndices.length;\n let chosenIndex = unpickedIndices[chosen];\n unpickedIndices.splice(chosen, 1);\n\n if (i == iterationIndex) {\n return chosenIndex;\n }\n }\n\n throw new Error(\"Should never reach here\");\n }\n\n public Error(message: string, useEndLineNumber = false): never {\n let e = new StoryException(message);\n e.useEndLineNumber = useEndLineNumber;\n throw e;\n }\n\n public Warning(message: string) {\n this.AddError(message, true);\n }\n\n public AddError(\n message: string,\n isWarning = false,\n useEndLineNumber = false\n ) {\n let dm = this.currentDebugMetadata;\n\n let errorTypeStr = isWarning ? \"WARNING\" : \"ERROR\";\n\n if (dm != null) {\n let lineNum = useEndLineNumber ? dm.endLineNumber : dm.startLineNumber;\n message =\n \"RUNTIME \" +\n errorTypeStr +\n \": '\" +\n dm.fileName +\n \"' line \" +\n lineNum +\n \": \" +\n message;\n } else if (!this.state.currentPointer.isNull) {\n message =\n \"RUNTIME \" +\n errorTypeStr +\n \": (\" +\n this.state.currentPointer +\n \"): \" +\n message;\n } else {\n message = \"RUNTIME \" + errorTypeStr + \": \" + message;\n }\n\n this.state.AddError(message, isWarning);\n\n // In a broken state don't need to know about any other errors.\n if (!isWarning) this.state.ForceEnd();\n }\n\n public Assert(condition: boolean, message: string | null = null) {\n if (condition == false) {\n if (message == null) {\n message = \"Story assert\";\n }\n\n throw new Error(message + \" \" + this.currentDebugMetadata);\n }\n }\n\n get currentDebugMetadata(): DebugMetadata | null {\n let dm: DebugMetadata | null;\n\n let pointer = this.state.currentPointer;\n if (!pointer.isNull && pointer.Resolve() !== null) {\n dm = pointer.Resolve()!.debugMetadata;\n if (dm !== null) {\n return dm;\n }\n }\n\n for (let i = this.state.callStack.elements.length - 1; i >= 0; --i) {\n pointer = this.state.callStack.elements[i].currentPointer;\n if (!pointer.isNull && pointer.Resolve() !== null) {\n dm = pointer.Resolve()!.debugMetadata;\n if (dm !== null) {\n return dm;\n }\n }\n }\n\n for (let i = this.state.outputStream.length - 1; i >= 0; --i) {\n let outputObj = this.state.outputStream[i];\n dm = outputObj.debugMetadata;\n if (dm !== null) {\n return dm;\n }\n }\n\n return null;\n }\n\n get mainContentContainer() {\n if (this._temporaryEvaluationContainer) {\n return this._temporaryEvaluationContainer;\n } else {\n return this._mainContentContainer;\n }\n }\n\n /**\n * `_mainContentContainer` is almost guaranteed to be set in the\n * constructor, unless the json is malformed.\n */\n private _mainContentContainer!: Container;\n private _listDefinitions: ListDefinitionsOrigin | null = null;\n\n private _externals: Map;\n private _variableObservers: Map | null =\n null;\n private _hasValidatedExternals: boolean = false;\n\n private _temporaryEvaluationContainer: Container | null = null;\n\n /**\n * `state` is almost guaranteed to be set in the constructor, unless\n * using the compiler-specific constructor which will likely not be used in\n * the real world.\n */\n private _state!: StoryState;\n\n private _asyncContinueActive: boolean = false;\n private _stateSnapshotAtLastNewline: StoryState | null = null;\n private _sawLookaheadUnsafeFunctionAfterNewline: boolean = false;\n\n private _recursiveContinueCount: number = 0;\n\n private _asyncSaving: boolean = false;\n\n private _profiler: any | null = null; // TODO: Profiler\n}\n\nexport namespace Story {\n export enum OutputStateChange {\n NoChange = 0,\n ExtendedBeyondNewline = 1,\n NewlineRemoved = 2,\n }\n\n export interface EvaluateFunctionTextOutput {\n returned: any;\n output: string;\n }\n\n export interface ExternalFunctionDef {\n function: ExternalFunction;\n lookAheadSafe: boolean;\n }\n\n export type VariableObserver = (variableName: string, newValue: any) => void;\n export type ExternalFunction = (...args: any) => any;\n}\n"],"names":["Path","constructor","this","_components","_componentsString","_isRelative","arguments","componentsString","Component","head","tail","push","concat","Array","relative","isRelative","componentCount","length","tailComps","slice","self","lastComponent","lastComponentIdx","containsNamedComponent","i","l","isIndex","path","GetComponent","index","PathByAppendingPath","pathToAppend","p","upwardMoves","isParent","join","value","substring","componentStrings","split","str","test","parseInt","toString","Equals","otherPath","PathByAppendingComponent","c","Debug","ValueType","PushPopType","ErrorType","asOrNull","obj","type","unsafeTypeAssertion","asOrThrows","Error","asINamedContentOrNull","hasValidName","name","nullIfUndefined","isEquatable","parentId","indexOrName","static","otherComp","Assert","condition","message","console","warn","trace","AssertType","variable","NullException","throwNullException","InkObject","parent","_debugMetadata","_path","debugMetadata","ownDebugMetadata","DebugLineNumberOfPath","root","rootContentContainer","targetContent","ContentAtPath","dm","startLineNumber","comps","child","container","Container","namedChild","unshift","content","indexOf","ResolvePath","nearestContainer","contentContainer","ConvertPathToRelative","globalPath","ownPath","minPathLength","Math","min","lastSharedPathCompIndex","ownComp","numUpwardsMoves","newPathComps","up","ToParent","down","CompactPathString","globalPathStr","relativePathStr","ancestor","Copy","SetChild","prop","StringBuilder","string","Length","Append","AppendLine","AppendFormat","format","_len","args","_key","replace","match","num","Clear","InkListItem","originName","itemName","nameParts","Null","isNull","fullName","otherItem","copy","serialized","JSON","stringify","key","parse","isLikeInkListItem","inkListItem","item","hasOwnProperty","InkList","Map","super","origins","_originNames","otherList","otherOriginNames","originNames","singleOriginListName","originStory","SetInitialOriginName","listDefinitions","def","TryListGetDefinition","exists","result","singleElement","Add","Key","Value","myListItem","listValue","_a","FindSingleItemListWithName","AddItem","itemOrItemName","origin","intVal","TryGetValueForItem","foundListDef","ContainsItemWithName","itemVal","ValueForItem","ContainsItemNamed","fromSerializedKey","ContainsKey","has","serializedKey","set","Remove","delete","Count","size","originOfMaxItem","maxOriginName","maxItem","every","initialOriginName","SetInitialOriginNames","initialOriginNames","max","minItem","inverse","list","items","all","Union","union","Intersect","intersection","HasIntersection","Without","listToRemove","Contains","what","GreaterThan","GreaterThanOrEquals","LessThan","LessThanOrEquals","MaxAsList","MinAsList","ListWithSubRange","minBound","maxBound","ordered","orderedItems","minValue","maxValue","Number","MAX_SAFE_INTEGER","isInteger","subList","otherInkList","sort","x","y","localeCompare","sb","valueOf","NaN","StoryException","useEndLineNumber","tryGetValueFromMap","map","val","get","AbstractValue","preferredNumberType","Int","IntValue","Float","isNaN","FloatValue","BoolValue","Boolean","StringValue","String","DivertTargetValue","ListValue","Create","valueObject","BadCastException","targetType","valueType","isTruthy","Bool","Cast","newType","_isNewline","_isInlineWhitespace","isNewline","isInlineWhitespace","isNonWhitespace","parsedInt","defaultValue","tryParseInt","parsedFloat","parseFloat","tryParseFloat","DivertTarget","targetPath","VariablePointerValue","variableName","contextIndex","undefined","_contextIndex","VariablePointer","List","listOrSingleItem","singleValue","oldValue","newValue","oldList","newList","SearchResult","approximate","correctObj","searchResult","_content","namedContent","visitsShouldBeCounted","turnIndexShouldBeCounted","countingAtStartOnly","_pathToFirstLeafContent","AddContent","namedOnlyContent","namedOnlyContentDict","inkObject","named","existingNamedOnly","AddToNamedContentOnly","countFlags","flags","CountFlags","Visits","Turns","CountStartOnly","flag","pathToFirstLeafContent","internalPathToFirstLeafContent","components","contentObjOrList","contentList","contentObj","TryAddNamedContent","namedContentObj","partialPathStart","partialPathLength","currentContainer","currentObj","comp","foundObj","ContentWithPathComponent","InsertContent","splice","AddContentsOfContainer","otherContainer","component","foundContent","BuildStringOfHierarchy","indentation","pointedObj","appendIndentation","onlyNamed","Glue","ControlCommand","commandType","_commandType","CommandType","NotSet","EvalStart","EvalOutput","EvalEnd","Duplicate","PopEvaluatedValue","PopFunction","PopTunnel","BeginString","EndString","NoOp","ChoiceCount","TurnsSince","ReadCount","Random","SeedRandom","VisitIndex","SequenceShuffleIndex","StartThread","Done","End","ListFromInt","ListRange","ListRandom","BeginTag","EndTag","Pointer","Resolve","Divert","_targetPath","targetObj","targetPointer","_targetPointer","StartOf","targetPathString","hasVariableTarget","variableDivertName","stackPushType","pushesToStack","isExternal","externalArgs","isConditional","otherDivert","targetStr","Function","ChoicePoint","onceOnly","_pathOnChoice","hasCondition","hasStartContent","hasChoiceOnlyContent","isInvisibleDefault","pathOnChoice","choiceTargetObj","choiceTarget","pathStringOnChoice","VariableReference","containerForCount","pathForCount","pathStringForCount","VariableAssignment","isNewDeclaration","isGlobal","Void","NativeFunctionCall","functionName","GenerateNativeFunctionsIfNecessary","_nativeFunctions","_name","_isPrototype","_prototype","numberOfParameters","_numberOfParameters","Call","parameters","hasList","CallBinaryListOperation","coercedParams","CoerceValuesToSingleType","coercedType","CallType","parametersOfSingleType","param1","valType","val1","paramCount","_operationFuncs","opForTypeObj","val2","opForType","resultVal","CallListIncrementOperation","v1","v2","op","asBooleanOrThrows","listIntParams","listVal","resultInkList","listItemKey","listItemValue","listItem","intOp","targetInt","itemOrigin","incrementedItem","TryGetItemWithValue","parametersIn","specialCaseList","parametersOut","inkObjectVal","castedValue","t","AddIntBinaryOp","Subtract","Multiply","Divide","floor","Mod","AddIntUnaryOp","Negate","Equal","Greater","Less","NotEquals","Not","And","Or","Max","Min","Pow","pow","Floor","Identity","Ceiling","AddFloatBinaryOp","AddFloatUnaryOp","ceil","AddStringBinaryOp","Has","includes","Hasnt","AddListBinaryOp","AddListUnaryOp","Invert","All","ListMin","ListMax","ValueOfList","divertTargetsEqual","d1","d2","divertTargetsNotEqual","AddOpToNativeFunc","AddOpFuncForType","nativeFunc","Tag","tagText","text","Choice","threadAtGeneration","sourcePath","tags","originalThreadIndex","ListDefinition","_items","_itemNameToValues","ContainsItem","ListDefinitionsOrigin","lists","_lists","_allUnambiguousListValueCache","listOfLists","definition","JsonSerialisation","jArray","skipLast","count","jTok","runtimeObj","JTokenToRuntimeObject","writer","dictionary","WriteObjectStart","WritePropertyStart","WriteRuntimeObject","WritePropertyEnd","WriteObjectEnd","WriteArrayStart","WriteArrayEnd","dict","WriteIntProperty","WriteRuntimeContainer","divert","divTypeKey","Tunnel","WriteProperty","choicePoint","boolVal","WriteBool","WriteInt","floatVal","WriteFloat","strVal","Write","WriteStringStart","WriteStringInner","WriteStringEnd","WriteInkList","divTargetVal","varPtrVal","controlCmd","_controlCommandNames","varRef","readCountPath","varAss","tag","choice","WriteChoice","jObject","token","firstChar","CallExistsWithName","CallWithName","isArray","propValue","varPtr","isDivert","divPushType","external","target","readCountVarRef","isVarAss","isGlobalVar","varName","isNewDecl","listContent","rawList","namesAsObjs","nameToVal","JObjectToChoice","JArrayToContainer","toJson","me","removes","space","k","v","some","r","withoutName","hasNameProperty","hasTerminator","namedContainer","WriteNull","JArrayToRuntimeObjList","terminatingObj","namedContentItem","namedSubContainer","jObj","w","WritePropertyNameStart","WritePropertyNameInner","WritePropertyNameEnd","listDefJson","defsObj","allDefs","nameValueKey","nameValue","TOTAL_VALUES","CallStack","elements","callStack","depth","currentElement","cs","_threads","callstack","currentElementIndex","currentThread","canPop","_threadCounter","_startOfRoot","Story","storyContext","Reset","toCopy","otherThread","Thread","Element","SetJsonToken","jThreads","jThreadTok","jThreadObj","thread","WriteJson","WriteObject","PushThread","newThread","threadIndex","ForkThread","forkedThread","PopThread","canPopThread","elementIsEvaluateFromGame","FunctionEvaluationFromGame","Push","externalEvaluationStackHeight","outputStreamLengthWithPushed","element","currentPointer","evaluationStackHeightWhenPushed","functionStartInOutputStream","CanPop","Pop","pop","GetTemporaryVariableWithName","varValue","temporaryVariables","SetTemporaryVariable","declareNew","contextElement","RetainListOriginsForAssignment","ContextForVariableNamed","ThreadWithIndex","filtered","filter","callStackTrace","isCurrent","pointer","inExpressionEvaluation","previousPointer","jThreadCallstack","jElTok","currentContainerPathStr","jElementObj","pushPopType","currentContainerPathStrToken","threadPointerResult","Warning","el","temps","JObjectToDictionaryRuntimeObjs","clear","prevContentObjPath","prevPath","PointerAtPath","e","WriteDictionaryRuntimeObjs","resolvedPointer","VariablesState","variableChangedEvent","callback","variableChangedEventCallbacks","batchObservingVariableChanges","_batchObservingVariableChanges","_changedVariablesForBatchObs","Set","currentValue","_globalVariables","_callStack","$","varContents","patch","TryGetGlobal","_defaultGlobalVariables","SetGlobal","listDefsOrigin","_listDefsOrigin","Proxy","ApplyPatch","namedVarKey","namedVarValue","globals","changedVariables","add","jToken","varValKey","varValValue","loadedToken","tokenInkObject","keyValKey","keyValValue","dontSaveDefaultValues","defaultVal","RuntimeObjectsEqual","obj1","obj2","GetVariableWithName","GetRawVariableWithName","varPointer","ValueAtVariablePointer","TryGetDefaultVariableValue","GlobalVariableExistsWithName","variableValue","Assign","setGlobal","ResolveVariablePointer","existingPointer","SnapshotDefaultGlobals","AddChangedVariable","GetContextIndexOfVariableNamed","doubleRedirectionPointer","ObserveVariableChange","PRNG","seed","next","nextFloat","StatePatch","_globals","_changedVariables","visitCounts","_visitCounts","turnIndices","_turnIndices","TryGetVisitCount","SetVisitCount","SetTurnIndex","TryGetTurnIndex","SimpleJson","Reader","ToDictionary","ToArray","_rootObject","Writer","_currentPropertyName","_currentString","_stateStack","_collectionStack","_propertyNameStack","_jsonObject","inner","StartNewObject","newObject","state","State","Property","currentCollection","currentPropertyName","propertyName","None","StateElement","Object","innerOrContent","WriteFloatProperty","IncrementChildCount","childCount","PropertyName","_addToCurrentObject","error","POSITIVE_INFINITY","NEGATIVE_INFINITY","currEl","Flow","story","outputStream","currentChoices","jChoiceThreadsObj","LoadFlowChoiceThreads","WriteListRuntimeObjs","hasChoiceThreads","jChoiceThreads","foundActiveThread","jSavedChoiceThread","StoryState","ToJson","indented","LoadJson","json","TextToDictionary","LoadJsonObj","onDidLoadState","VisitCountAtPathString","pathString","visitCountOut","_patch","VisitCountForContainer","containerPathStr","count2","IncrementVisitCountForContainer","currCount","RecordTurnIndexVisitToContainer","currentTurnIndex","TurnsSinceForContainer","index2","callstackDepth","_currentFlow","canContinue","generatedChoices","currentErrors","_currentErrors","currentWarnings","_currentWarnings","variablesState","_variablesState","evaluationStack","_evaluationStack","_currentTurnIndex","currentPathString","hasError","hasWarning","currentText","_outputStreamTextDirty","inTag","outputObj","textContent","controlCommand","_currentText","CleanOutputWhitespace","currentWhitespaceStart","startOfLine","charAt","currentTags","_outputStreamTagsDirty","_currentTags","txt","currentFlowName","currentFlowIsDefaultFlow","kDefaultFlowName","aliveFlowNames","_aliveFlowNamesDirty","_aliveFlowNames","_namedFlows","flowName","keys","kInkSaveStateVersion","kMinCompatibleLoadVersion","divertedPointer","storySeed","previousRandom","didSafeExit","OutputStreamDirty","timeSeed","Date","getTime","GoToStart","mainContentContainer","SwitchFlow_Internal","flow","SwitchToDefaultFlow_Internal","RemoveFlow_Internal","CopyAndStartPatching","namedFlowKey","namedFlowValue","RestoreAfterPatch","ApplyAnyPatch","ApplyCountChanges","newCount","isVisit","WriteIntDictionary","inkVersionCurrent","jSaveVersion","flowsObj","flowsObjDict","flowsObjDictEntries","entries","namedFlowObjKey","namedFlowObjValue","flowObj","currFlowName","currentDivertTargetPath","divertPath","JObjectToIntDictionary","ResetErrors","ResetOutput","objs","PushToOutputStream","listText","TrySplittingHeadTailWhitespace","textObj","PushToOutputStreamIndividual","PopFromOutputStream","single","headFirstNewlineIdx","headLastNewlineIdx","tailLastNewlineIdx","tailFirstNewlineIdx","listTexts","innerStrStart","innerStrEnd","leadingSpaces","innerStrText","numSpaces","trailingSpaces","glue","includeInOutput","TrimNewlinesFromOutputStream","functionTrimIndex","glueTrimIndex","o","trimIndex","RemoveExistingGlue","callStackElements","outputStreamEndsInNewline","outputStreamContainsContent","removeWhitespaceFrom","cmd","inStringEvaluation","PushEvaluationStack","n","PopEvaluationStack","numberOfObjects","PeekEvaluationStack","ForceEnd","TrimWhitespaceFromFunctionEnd","functionStartPoint","PopCallStack","popType","SetChosenPath","incrementingTurnIndex","newPointer","StartFunctionEvaluationFromGame","funcContainer","PassArgumentsToEvaluationStack","TryExitFunctionEvaluationFromGame","CompleteFunctionEvaluationFromGame","originalEvaluationStackHeight","returnedObj","poppedObj","returnVal","AddError","isWarning","Stopwatch","startTime","ElapsedMilliseconds","Start","Stop","nVal","isFinite","choices","_state","IfAsyncWeCant","_listDefinitions","StartProfiling","EndProfiling","inkVersionMinimumCompatible","onError","onDidContinue","onMakeChoice","onEvaluateFunction","onCompleteEvaluateFunction","onChoosePathString","_prevContainers","allowExternalFunctionFallbacks","_variableObservers","_hasValidatedExternals","_temporaryEvaluationContainer","_asyncContinueActive","_stateSnapshotAtLastNewline","_sawLookaheadUnsafeFunctionAfterNewline","_recursiveContinueCount","_asyncSaving","_profiler","_mainContentContainer","jsonString","_externals","rootObject","versionObj","formatFromFile","listDefsObj","rootToken","JTokenToListDefinitions","ResetState","shouldReturn","VariableStateDidChangeEvent","bind","ResetGlobals","ResetCallstack","originalPointer","ChoosePath","ContinueInternal","SwitchFlow","RemoveFlow","SwitchToDefaultFlow","Continue","ContinueAsync","asyncContinueComplete","millisecsLimitAsync","ValidateExternalBindings","PreContinue","isAsyncTimeLimited","durationStopwatch","ContinueSingleStep","RestoreStateSnapshot","PostContinue","err","PreStep","Step","PostStep","TryFollowDefaultInvisibleChoice","PreSnapshot","change","CalculateNewlineOutputStateChange","OutputStateChange","ExtendedBeyondNewline","NewlineRemoved","DiscardSnapshot","StateSnapshot","PostSnapshot","prevText","currText","prevTagCount","currTagCount","newlineStillExists","NoChange","ContinueMaximally","KnotContainerWithName","pathLengthToUse","CopyStateForBackgroundThreadSave","stateToSave","BackgroundSaveComplete","shouldAddToStream","containerToEnter","VisitContainer","currentContentObj","isLogicOrFlowControl","PerformLogicAndFlowControl","ProcessChoice","contextIdx","NextContent","atStart","VisitChangedContainersDueToDivert","prevAncestor","currentChildOfContainer","currentContainerAncestor","allChildrenEnteredAtStart","enteringAtStart","PopChoiceStringAndTags","choiceOnlyStrVal","showChoice","conditionValue","IsTruthy","startText","choiceOnlyText","reverse","divTarget","currentDivert","intContent","errorMessage","CallExternalFunction","sourceName","evalCommand","output","overrideTunnelReturnTarget","popped","names","expected","errorMsg","contentStackForTag","outputCountConsumed","command","choiceTag","contentStackForString","contentToRetain","rescuedTag","choiceCount","extraNote","eitherCount","divertTarget","maxInt","minInt","randomRange","resultSeed","nextRandom","chosenValue","shuffleIndex","NextSequenceShuffleIndex","listNameVal","generatedListValue","foundItem","targetList","listItemIndex","listEnumerator","randomItem","assignedVal","foundValue","func","funcParams","ChoosePathString","resetCallstack","funcDetail","activityStr","ChooseChoiceIndex","choiceIdx","choiceToChoose","HasFunction","EvaluateFunction","returnTextOutput","trim","outputStreamBefore","stringOutput","textOutput","returned","EvaluateExpression","exprContainer","startCallStackHeight","evalStackHeight","funcName","numberOfArguments","funcDef","fallbackFunctionContainer","foundExternal","lookAheadSafe","valueObj","funcResult","function","returnObj","BindExternalFunctionGeneral","lookaheadSafe","TryCoerce","BindExternalFunction","coercedArgs","apply","UnbindExternalFunction","missingExternals","from","innerContent","ObserveVariable","observer","ObserveVariables","variableNames","observers","RemoveVariableObserver","specificVariableName","variableObservers","newValueObj","globalTags","TagsAtStartOfFlowContainerWithPathString","TagsForContentAtPath","flowContainer","firstContent","BuildStringOfContainer","IncrementContentPointer","didPop","successfulIncrement","nextAncestor","indexInAncestor","allChoices","invisibleChoices","numElementsIntVal","seqContainer","numElements","seqCount","loopIndex","iterationIndex","seqPathStr","sequenceHash","charCodeAt","randomSeed","random","unpickedIndices","chosen","chosenIndex","currentDebugMetadata","errorTypeStr","lineNum","endLineNumber","fileName"],"mappings":"mPAAaA,EAWXC,cAKE,GAJAC,KAAKC,YAAc,GACnBD,KAAKE,kBAAoB,KACzBF,KAAKG,aAAc,EAEQ,iBAAhBC,UAAU,GAAgB,CACnC,IAAIC,EAAmBD,UAAU,GACjCJ,KAAKK,iBAAmBA,CAC1B,MAAO,GACLD,UAAU,aAAcN,EAAKQ,WAC7BF,UAAU,aAAcN,EACxB,CACA,IAAIS,EAAOH,UAAU,GACjBI,EAAOJ,UAAU,GACrBJ,KAAKC,YAAYQ,KAAKF,GACtBP,KAAKC,YAAcD,KAAKC,YAAYS,OAAOF,EAAKP,YACjD,MAAM,GAAIG,UAAU,aAAcO,MAAO,CACxC,IAAIJ,EAAOH,UAAU,GACjBQ,IAAaR,UAAU,GAC3BJ,KAAKC,YAAcD,KAAKC,YAAYS,OAAOH,GAC3CP,KAAKG,YAAcS,CACrB,CACF,CACIC,iBACF,OAAOb,KAAKG,WACd,CACIW,qBACF,OAAOd,KA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AAiB1Z,IAAAA,EAmBhB,CAAA"} \ No newline at end of file diff --git a/templates/typescript_player/package.json b/templates/typescript_player/package.json new file mode 100644 index 00000000..ef766b3d --- /dev/null +++ b/templates/typescript_player/package.json @@ -0,0 +1,21 @@ +{ + "name": "ts-inkjs-player", + "type": "module", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "start": "tsc --resolveJsonModule -p . && tsx src/index.ts" + }, + "keywords": [], + "author": "Sebastian Hanlon", + "license": "ISC", + "devDependencies": { + "@types/node": "^20.14.2", + "tsx": "^4.15.2", + "typescript": "^5.4.5" + }, + "dependencies": { + "inkjs": "*" + } +} diff --git a/templates/typescript_player/src/index.ts b/templates/typescript_player/src/index.ts new file mode 100644 index 00000000..ef8ed253 --- /dev/null +++ b/templates/typescript_player/src/index.ts @@ -0,0 +1,13 @@ +import { Story } from 'inkjs/types'; +import intercept from "./story.json"; + +let story:Story = new Story(intercept); + +let text = story.Continue() + +let choices = story.currentChoices + +console.log(text) +for (let c of choices){ + console.log(` * ${c.text}`) +} \ No newline at end of file diff --git a/templates/typescript_player/src/story.json b/templates/typescript_player/src/story.json new file mode 100644 index 00000000..ba618cbe --- /dev/null +++ b/templates/typescript_player/src/story.json @@ -0,0 +1 @@ +{"inkVersion":20,"root":[["ev",{"VAR?":"DEBUG"},"/ev",[{"->":".^.b","c":true},{"b":["\n","^IN DEBUG MODE!","\n","ev","str","^Beginning...","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Framing Hooper...","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^In with Hooper...","/str","/ev",{"*":".^.c-2","flg":20},{"->":"0.5"},{"c-0":["^\t",{"->":"start"},"\n",{"#f":5}],"c-1":["^ ",{"->":"claim_hooper_took_component"},"\n",{"#f":5}],"c-2":["^ ",{"->":"inside_hoopers_hut"},"\n",{"#f":5}]}]}],[{"->":".^.b"},{"b":["\n",{"->":"start"},{"->":"0.5"},null]}],"nop","\n",["done",{"#n":"g-0"}],null],"done",{"lower":[{"temp=":"x"},"ev",{"VAR?":"x"},1,"-","/ev",{"temp=":"x","re":true},null],"raise":[{"temp=":"x"},"ev",{"VAR?":"x"},1,"+","/ev",{"temp=":"x","re":true},null],"start":[[["^They are keeping me waiting.","\n",["ev",{"^->":"start.0.g-0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^Hut 14",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"start.0.g-0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],"^. The door was locked after I sat down. ","\n","^I don't even have a pen to do any work. There's a copy of the morning's intercept in my pocket, but staring at the jumbled letters will only drive me mad.","\n","^I am not a machine, whatever they say about me.","\n",{"->":".^.^.^.opts"},{"#f":5}],"#n":"g-0"}],{"opts":[["ev","visit",2,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"ev","du",2,"==","/ev",{"->":".^.s2","c":true},"nop",{"s0":["pop",{"->":".^.^.23"},null],"s1":["pop","^I rattle my fingers on the field table.",{"->":".^.^.23"},null],"s2":["pop",{"->":".^.^.23"},null],"#f":5}],"\n","ev","str","^Think","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Plan","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^Wait","/str","/ev",{"*":".^.c-3","flg":20},{"c-1":["^ ","\n","^They suspect me to be a traitor. They think I stole the component from the calculating machine. They will be searching my bunk and cases.","\n","^When they don't find it, ","ev",{"CNT?":".^.^.c-2"},"/ev",[{"->":".^.b","c":true},{"b":["^then",{"->":".^.^.^.9"},null]}],"nop","^ they'll come back and demand I talk.","\n",{"->":".^.^"},{"->":".^.^.^.g-1"},{"#f":5}],"c-2":["\n","ev",{"CNT?":".^.^.c-1"},"!","/ev",[{"->":".^.b","c":true},{"b":["^What I am is",{"->":".^.^.^.7"},null]}],[{"->":".^.b"},{"b":["^I am",{"->":".^.^.^.7"},null]}],"nop","^ a problem—solver. Good with figures, quick with crosswords, excellent at chess.","\n","^But in this scenario — in this trap — what is the winning play?","\n",["ev","str","^Co—operate","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Dissemble","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Divert","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["^ ","\n","^I must co—operate. My credibility is my main asset. To contradict myself, or another source, would be fatal.","\n","^I must simply hope they do not ask the questions I do not want to answer.","\n","ev",{"^var":"forceful","ci":-1},{"f()":"lower"},"pop","/ev","\n",{"->":"start.0.g-1"},{"#f":5}],"c-1":["^ ","\n","^Misinformation, then. Just as the war in Europe is one of plans and interceptions, not planes and bombs.","\n","^My best hope is a story they prefer to the truth.","\n","ev",{"^var":"forceful","ci":-1},{"f()":"raise"},"pop","/ev","\n",{"->":"start.0.g-1"},{"#f":5}],"c-2":["^ ","\n","^Avoidance and delay. The military machine never fights on a single front. If I move slowly enough, things will resolve themselves some other way, my reputation intact.","\n","ev",{"^var":"evasive","ci":-1},{"f()":"raise"},"pop","/ev","\n",{"->":"start.0.g-1"},{"#f":5}]}],{"#f":5}],"c-3":["^\t\t","\n",{"->":".^.^.^.g-1"},{"#f":5}]}],"g-1":[{"->":"start.waited"},null]}],{"waited":[[["^Half an hour goes by before Commander Harris returns. He closes the door behind him quickly, as though afraid a loose word might slip inside.","\n","^\"Well, then,\" he begins, awkwardly. This is an unseemly situation.","\n",["ev",{"^->":"start.waited.0.g-0.4.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^\"Commander.\"",{"->":"$r","var":true},null]}],["ev",{"^->":"start.waited.0.g-0.5.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",{"CNT?":"start.0.opts.c-2.12.c-2"},"!","/ev",{"*":".^.^.c-1","flg":19},{"s":["^\"Tell me what this is about.\"",{"->":"$r","var":true},null]}],"ev","str","^Wait","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["ev",{"^->":"start.waited.0.g-0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.4.s"},[{"#n":"$r2"}],"\n","^He nods. ","<>","\n",{"->":".^.^.^.g-1"},{"#f":5}],"c-1":["ev",{"^->":"start.waited.0.g-0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.5.s"},[{"#n":"$r2"}],"\n","^He shakes his head.","\n","^\"Now, don't let's pretend.\"","\n",{"->":".^.^.^.g-1"},{"#f":5}],"c-2":["\n","^I say nothing.","\n",{"->":".^.^.^.g-1"},{"#f":5}],"#n":"g-0"}],{"g-1":["^He has brought two cups of tea in metal mugs: he sets them down on the tabletop between us.","\n","ev","str","^Deny","/str",{"CNT?":".^.^.g-0.c-1"},"/ev",{"*":".^.c-3","flg":21},"ev","str","^Take one","/str","/ev",{"*":".^.c-4","flg":20},["ev",{"^->":"start.waited.0.g-1.15.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",{"CNT?":".^.^.^.g-0.c-1"},"!","/ev",{"*":".^.^.c-5","flg":19},{"s":["^\"What's going on?\"",{"->":"$r","var":true},null]}],"ev","str","^Wait","/str","/ev",{"*":".^.c-6","flg":20},{"c-3":["^ \"I'm not pretending anything.\"","\n","ev",{"CNT?":"start.0.opts.c-2.12.c-0"},"/ev",[{"->":".^.b","c":true},{"b":["^I'm lying already, despite my good intentions.",{"->":".^.^.^.6"},null]}],"nop","\n","^Harris looks disapproving. ",{"->":".^.^.c-6.3.pushes_cup"},"\n",{"->":".^.^.^.g-2"},{"#f":5}],"c-4":["\n","ev",true,"/ev",{"VAR=":"teacup","re":true},"^I take a mug and warm my hands. It's ","<>","\n",{"->":".^.^.^.g-2"},{"#f":5}],"c-5":["ev",{"^->":"start.waited.0.g-1.c-5.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.15.s"},[{"#n":"$r2"}],"\n","^\"You know already.\"","\n",{"->":".^.^.c-6.3.pushes_cup"},{"->":".^.^.^.g-2"},{"#f":5}],"c-6":["\n","^I wait for him to speak.","\n",[["^He pushes one mug halfway towards me: ","<>","\n",{"->":".^.^.^.^.^.g-2"},{"#n":"pushes_cup"}],null],{"#f":5}]}],"g-2":["^a small gesture of friendship.","\n","^Enough to give me hope?","\n","ev","str","^Take it","/str",{"VAR?":"teacup"},"!","/ev",{"*":".^.c-7","flg":21},"ev","str","^Don't take it","/str",{"VAR?":"teacup"},"!","/ev",{"*":".^.c-8","flg":21},"ev","str","^Drink","/str",{"VAR?":"teacup"},"/ev",{"*":".^.c-9","flg":21},"ev","str","^Wait","/str",{"VAR?":"teacup"},"/ev",{"*":".^.c-10","flg":21},{"c-7":["^ ","\n","^I ","ev",{"CNT?":".^.^.^.g-1.c-4"},"/ev",[{"->":".^.b","c":true},{"b":["^lift the mug",{"->":".^.^.^.8"},null]}],[{"->":".^.b"},{"b":["^take the mug,",{"->":".^.^.^.8"},null]}],"nop","^ and blow away the steam. It is too hot to drink.","\n","^Harris picks his own up and just holds it.","\n","ev",true,"/ev",{"VAR=":"teacup","re":true},"ev",{"^var":"forceful","ci":-1},{"f()":"lower"},"pop","/ev","\n",{"->":".^.^.^.g-3"},{"#f":5}],"c-8":["^ ","\n","^Just a cup of insipid canteen tea. I leave it where it is.","\n","ev",{"^var":"forceful","ci":-1},{"f()":"raise"},"pop","/ev","\n",{"->":".^.^.^.g-3"},{"#f":5}],"c-9":["^ ","\n","^I raise the cup to my mouth but it's too hot to drink.","\n",{"->":".^.^.^.g-3"},{"#f":5}],"c-10":["^ \t\t","\n","^I say nothing as ",{"->":".^.^.c-7"},"\n",{"->":".^.^.^.g-3"},{"#f":5}]}],"g-3":["^\"Quite a difficult situation,\" ","ev",{"CNT?":".^.^.g-2.c-7"},"/ev",[{"->":".^.b","c":true},{"b":["^he",{"->":".^.^.^.6"},null]}],[{"->":".^.b"},{"b":["^Harris",{"->":".^.^.^.6"},null]}],"nop","^ begins","ev",{"VAR?":"forceful"},0,"<=","/ev",[{"->":".^.b","c":true},{"b":["^, sternly",{"->":".^.^.^.14"},null]}],"nop","^. I've seen him adopt this stiff tone of voice before, but only when talking to the brass. \"I'm sure you agree.\"","\n","ev","str","^Agree","/str","/ev",{"*":".^.c-11","flg":20},"ev","str","^Disagree","/str","/ev",{"*":".^.c-12","flg":20},"ev","str","^Lie","/str","/ev",{"*":".^.c-13","flg":20},"ev","str","^Evade","/str","/ev",{"*":".^.c-14","flg":20},{"c-11":["^ ","\n","^\"Awkward,\" I reply","\n",{"->":".^.^.^.g-4"},{"#f":5}],"c-12":["^ ","\n","^\"I don't see why,\" I reply","\n","ev",{"^var":"forceful","ci":-1},{"f()":"raise"},"pop","/ev","\n","ev",{"^var":"evasive","ci":-1},{"f()":"raise"},"pop","/ev","\n",{"->":".^.^.^.g-4"},{"#f":5}],"c-13":["^ ",{"->":".^.^.c-12"},"\n",{"->":".^.^.^.g-4"},{"#f":5}],"c-14":["^ ","\n","^\"I'm sure you've handled worse,\" I reply casually","\n","ev",{"^var":"evasive","ci":-1},{"f()":"raise"},"pop","/ev","\n",{"->":".^.^.^.g-4"},{"#f":5}]}],"g-4":["ev",{"VAR?":"teacup"},"/ev",[{"->":".^.b","c":true},{"b":["\n","ev",true,"/ev",{"VAR=":"drugged","re":true},"<>","^, sipping at my tea as though we were old friends","\n",{"->":".^.^.^.4"},null]}],"nop","\n","<>","^.","\n",["ev","str","^Watch him","/str","/ev",{"*":".^.c-15","flg":20},"ev","str","^Wait","/str","/ev",{"*":".^.c-16","flg":20},"ev","str","^Smile","/str",{"CNT?":".^.^.^.g-3.c-12"},"!","/ev",{"*":".^.c-17","flg":21},{"c-15":["\n","^His face is telling me nothing. I've seen Harris broad and full of laughter. Today he is tight, as much part of the military machine as the device in Hut 5.","\n",{"->":".^.^.^.^.g-6"},{"#f":5}],"c-16":["\n","^I wait to see how he'll respond.","\n",{"->":".^.^.^.^.g-6"},{"#f":5}],"c-17":["\n","^I try a weak smile. It is not returned.","\n","ev",{"^var":"forceful","ci":-1},{"f()":"lower"},"pop","/ev","\n",{"->":".^.^.^.^.g-6"},{"#f":5}],"#n":"g-5"}],null],"g-6":["^\"We need that component,\" he says.","\n",["ev",{"CNT?":"missing_reel"},"!","/ev",[{"->":".^.b","c":true},{"b":["\n",{"->t->":"missing_reel"},{"->":"harris_demands_component"},{"->":".^.^.^.5"},null]}],"nop","\n",["ev","str","^Yes","/str","/ev",{"*":".^.c-18","flg":20},"ev","str","^No","/str","/ev",{"*":".^.c-19","flg":20},"ev","str","^Evade","/str","/ev",{"*":".^.c-20","flg":20},"ev","str","^Lie","/str","/ev",{"*":".^.c-21","flg":20},{"c-18":["\n","^\"Of course I do,\" I answer.","\n",{"->":".^.^.^.^.^.g-9"},{"#f":5}],"c-19":["\n","^\"No I don't. And I've got work to do...\"","\n","^\"Work that will be rather difficult for you to do, don't you think?\" Harris interrupts.","\n",{"->":".^.^.^.^.^.g-9"},{"#f":5}],"c-20":["\n",{"->":"here_at_bletchley_diversion"},{"->":".^.^.^.^.^.g-9"},{"#f":5}],"c-21":["^ ","\n",{"->":".^.^.c-19"},{"->":".^.^.^.^.^.g-9"},{"#f":5}],"#n":"g-8"}],{"#n":"g-7"}],null],"g-9":[{"->t->":"missing_reel"},{"->":"harris_demands_component"},null]}],null]}],"missing_reel":[["ev","str","^The stolen component...","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Shrug","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["\n","^I shrug.","\n","ev","void","/ev","->->",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^The reel went missing from the Bombe this afternoon. The four of us were in the Hut, working on the latest German intercept. The results were garbage. It was Russell who found the gap in the plugboard.","\n",["^Any of us could have taken it; and no one else would have known its worth.","\n","ev","str","^Panic","/str",{"VAR?":"forceful"},0,"<=","/ev",{"*":".^.c-2","flg":21},"ev","str","^Calculate","/str","/ev",{"*":".^.c-3","flg":20},"ev","str","^Deny","/str",{"VAR?":"evasive"},0,">=","/ev",{"*":".^.c-4","flg":21},{"c-2":["^ They will pin it on me. They need a scapegoat so that the work can continue. I'm a likely target. Weaker than the rest. ","\n","ev",{"^var":"forceful","ci":-1},{"f()":"lower"},"pop","/ev","\n",{"->":".^.^.^.^.g-2"},{"#f":5}],"c-3":["^ My odds, then, are one in four. Not bad; although the stakes themselves are higher than I would like.","\n","ev",{"^var":"evasive","ci":-1},{"f()":"raise"},"pop","/ev","\n",{"->":".^.^.^.^.g-2"},{"#f":5}],"c-4":["^ But this is still a mere formality. The work will not stop. A replacement component will be made and we will all be put back to work. We are too valuable to shoot. ","\n","ev",{"^var":"forceful","ci":-1},{"f()":"raise"},"pop","/ev","\n",{"->":".^.^.^.^.g-2"},{"#f":5}],"#n":"g-1"}],null],"g-2":["ev","void","/ev","->->",null]}],{"#f":1}],"here_at_bletchley_diversion":[["^\"Here at Bletchley? Of course.\"","\n","ev",{"^var":"evasive","ci":-1},{"f()":"raise"},"pop","/ev","\n","ev",{"^var":"forceful","ci":-1},{"f()":"lower"},"pop","/ev","\n","^\"Here, now,\" Harris corrects. \"We are not talking to everyone. I can imagine you might feel pretty sore about that. I can imagine you feeling picked on. ","ev",{"VAR?":"forceful"},0,"<","/ev",[{"->":".^.b","c":true},{"b":["^You're a sensitive soul.",{"->":".^.^.^.21"},null]}],"nop","^\"","\n",["ev",{"^->":"here_at_bletchley_diversion.0.24.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^.\"","/str","/ev",{"*":".^.^.c-0","flg":22},{"s":["^\"I'm fine",{"->":"$r","var":true},null]}],["ev",{"^->":"here_at_bletchley_diversion.0.25.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",{"VAR?":"forceful"},0,"<","/ev",{"*":".^.^.c-1","flg":19},{"s":["^\"What do you mean by that?\"",{"->":"$r","var":true},null]}],["ev",{"^->":"here_at_bletchley_diversion.0.26.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^.\"","/str",{"VAR?":"forceful"},0,">=","/ev",{"*":".^.^.c-2","flg":23},{"s":["^\"Damn right",{"->":"$r","var":true},null]}],"ev","str","^Be honest","/str","/ev",{"*":".^.c-3","flg":20},"ev","str","^Lie","/str","/ev",{"*":".^.c-4","flg":20},{"c-0":["ev",{"^->":"here_at_bletchley_diversion.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.24.s"},[{"#n":"$r2"}],"^,\" I reply. \"This is all some misunderstanding and the quicker we have it cleared up the better.\"","\n","ev",{"^var":"forceful","ci":-1},{"f()":"lower"},"pop","/ev","\n","^\"I couldn't agree more.\" And then he comes right out with it, with an accusation.","\n",{"->":".^.^.done"},{"#f":5}],"c-1":["ev",{"^->":"here_at_bletchley_diversion.0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.25.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.done"},{"#f":5}],"c-2":["ev",{"^->":"here_at_bletchley_diversion.0.c-2.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.26.s"},[{"#n":"$r2"}],"^ I'm sore. Was it one of the others who put you up to this? Was it Hooper? He's always been jealous of me. He's...\"","\n","ev",{"^var":"forceful","ci":-1},{"f()":"raise"},"pop","/ev","\n","ev",true,"/ev",{"VAR=":"hooper_mentioned","re":true},"^The Commander moustache bristles as he purses his lips. \"Has he now? Of your achievements, do you think?\"","\n","^It's difficult not to shake the sense that he's ","ev",{"VAR?":"evasive"},1,">","/ev",[{"->":".^.b","c":true},{"b":["^mocking",{"->":".^.^.^.28"},null]}],[{"->":".^.b"},{"b":["^simply humouring",{"->":".^.^.^.28"},null]}],"nop","^ me.","\n","^\"Or of your brain? Or something else?\"","\n",[["ev",{"^->":"here_at_bletchley_diversion.0.c-2.33.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^\"","/str","/ev",{"*":".^.^.c-0","flg":22},{"s":["^\"Of my genius.",{"->":"$r","var":true},null]}],["ev",{"^->":"here_at_bletchley_diversion.0.c-2.33.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^\"","/str","/ev",{"*":".^.^.c-1","flg":22},{"s":["^\"Of my standing.",{"->":"$r","var":true},null]}],"ev","str","^Evade","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["ev",{"^->":"here_at_bletchley_diversion.0.c-2.33.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"^ Hooper simply can't stand that I'm cleverer than he is. We work so closely together, cooped up in that Hut all day. It drives him to distraction. To worse.\"","\n","^\"You're suggesting Hooper would sabotage this country's future simply to spite you?\" Harris chooses his words like the military man he is, each lining up to create a ring around me.","\n",["ev","str","^Yes","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^No","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Evade","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["^ \t\t\t","\n","^\"","ev",{"VAR?":"forceful"},0,">","/ev",[{"->":".^.b","c":true},{"b":["^He's petty enough, certainly",{"->":".^.^.^.10"},null]}],[{"->":".^.b"},{"b":["^I wouldn't put it past him",{"->":".^.^.^.10"},null]}],"nop","^. He's a creep.\" ","ev",{"VAR?":"teacup"},"/ev",[{"->":".^.b","c":true},{"b":["^ I set the teacup down.",{"->":".^.^.^.17"},null]}],[{"->":".^.b"},{"b":["^I wipe a hand across my forehead.",{"->":".^.^.^.17"},null]}],"nop","\n","ev",{"^var":"forceful","ci":-1},{"f()":"raise"},"pop","/ev","\n","ev",false,"/ev",{"VAR=":"teacup","re":true},{"->":".^.^.suggest_its_a_lie"},{"#f":5}],"c-1":["^ \t\t\t","\n","^\"No, ","ev",{"VAR?":"forceful"},0,">","/ev",[{"->":".^.b","c":true},{"b":["^of course not",{"->":".^.^.^.10"},null]}],[{"->":".^.b"},{"b":["^I suppose not",{"->":".^.^.^.10"},null]}],"nop","^.\" ","ev",{"VAR?":"teacup"},"/ev",[{"->":".^.b","c":true},{"b":["^I put the teacup back down on the table",{"->":".^.^.^.17"},null]}],[{"->":".^.b"},{"b":["^I push the teacup around on its base",{"->":".^.^.^.17"},null]}],"nop","^.","\n","ev",{"^var":"forceful","ci":-1},{"f()":"lower"},"pop","/ev","\n","ev",false,"/ev",{"VAR=":"teacup","re":true},{"->":".^.^.suggest_its_a_lie"},{"#f":5}],"c-2":["^ \t\t","\n","^\"I don't know what I'm suggesting. I don't understand what's going on.\"","\n","ev",{"^var":"evasive","ci":-1},{"f()":"raise"},"pop","/ev","\n","^\"But of course you do.\" Harris narrows his eyes.","\n",{"->":".^.^.^.^.^.^.done"},{"->":".^.^.suggest_its_a_lie"},{"#f":5}],"suggest_its_a_lie":["^\"All I can say is, ever since I arrived here, he's been looking to ways to bring me down a peg. I wouldn't be surprised if he set this whole affair up just to have me court—martialled.\"","\n","^\"We don't court—martial civilians,\" Harris replies. \"Traitors are simply hung at her Majesty's pleasure.\"","\n",["ev",{"^->":"here_at_bletchley_diversion.0.c-2.33.c-0.10.suggest_its_a_lie.4.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^.\"","/str","/ev",{"*":".^.^.c-3","flg":22},{"s":["^\"Quite right",{"->":"$r","var":true},null]}],["ev",{"^->":"here_at_bletchley_diversion.0.c-2.33.c-0.10.suggest_its_a_lie.5.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^.\"","/str","/ev",{"*":".^.^.c-4","flg":22},{"s":["^\"I'm no traitor",{"->":"$r","var":true},null]}],"ev","str","^Lie","/str","/ev",{"*":".^.c-5","flg":20},{"c-3":["ev",{"^->":"here_at_bletchley_diversion.0.c-2.33.c-0.10.suggest_its_a_lie.c-3.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.4.s"},[{"#n":"$r2"}],"^,\" I answer smartly.","\n",{"->":".^.^.^.g-0"},{"#f":5}],"c-4":["ev",{"^->":"here_at_bletchley_diversion.0.c-2.33.c-0.10.suggest_its_a_lie.c-4.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.5.s"},[{"#n":"$r2"}],"^,\" I answer","ev",{"VAR?":"forceful"},0,">","/ev",[{"->":".^.b","c":true},{"b":["^smartly",{"->":".^.^.^.14"},null]}],[{"->":".^.b"},{"b":["^, voice quivering. \"For God's sake!\"",{"->":".^.^.^.14"},null]}],"nop","\n",{"->":".^.^.^.g-0"},{"#f":5}],"c-5":["^ ",{"->":".^.^.c-4"},"\n",{"->":".^.^.^.g-0"},{"#f":5}]}],"g-0":["^He stares back at me.","\n",{"->":".^.^.^.^.^.^.done"},null]}],{"#f":5}],"c-1":["ev",{"^->":"here_at_bletchley_diversion.0.c-2.33.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.1.s"},[{"#n":"$r2"}],"^ My reputation.\" ","ev",{"VAR?":"forceful"},0,">","/ev",[{"->":".^.b","c":true},{"b":["^I'm aware of how arrogant I must sound but I plough on all the same.",{"->":".^.^.^.14"},null]}],[{"->":".^.b"},{"b":["^I don't like to talk of myself like this, but I carry on all the same.",{"->":".^.^.^.14"},null]}],"nop","^ \"Hooper simply can't bear knowing that, once all this is over, I'll be the one receiving the knighthood and he...\"","\n","^\"No—one will be getting a knighthood if the Germans make landfall,\" Harris answers sharply. He casts a quick eye to the door of the Hut to check the latch is still down, then continues in more of a murmur: \"Not you and not Hooper. Now answer me.\"","\n","^For the first time since the door closed, I wonder what the threat might be if I do not.","\n",{"->":".^.^.^.^.done"},{"#f":5}],"c-2":["^ \t\t\t\t","\n","ev",false,"/ev",{"VAR=":"teacup","re":true},"ev",{"^var":"forceful","ci":-1},{"f()":"raise"},"pop","/ev","\n","^\"How should I know?\" I reply, defensively. ","ev",{"VAR?":"teacup"},"/ev",[{"->":".^.b","c":true},{"b":["^I set the teacup back on the table.",{"->":".^.^.^.17"},null]}],"nop","^ ",{"->":".^.^.c-0.10.suggest_its_a_lie"},"\n",{"->":".^.^.^.^.done"},{"#f":5}]}],{"#f":5}],"c-3":["^ \t",{"->":".^.^.c-2"},"\n",{"->":".^.^.done"},{"#f":5}],"c-4":["^ \t\t",{"->":".^.^.c-0"},"\n",{"->":".^.^.done"},{"#f":5}],"done":[{"->":"harris_demands_component"},null]}],{"#f":1}],"harris_demands_component":[["^\"","ev",{"CNT?":"here_at_bletchley_diversion"},"/ev",[{"->":".^.b","c":true},{"b":["^Please",{"->":".^.^.^.6"},null]}],[{"->":".^.b"},{"b":["^So",{"->":".^.^.^.6"},null]}],"nop","^. Do you have it?\" Harris is ","ev",{"VAR?":"forceful"},3,">","/ev",[{"->":".^.b","c":true},{"b":["^sweating slightly",{"->":".^.^.^.15"},null]}],[{"->":".^.b"},{"b":["^wasting no time",{"->":".^.^.^.15"},null]}],"nop","^: Bletchley is his watch. \"Do you know where it is?\"","\n","ev","str","^Yes","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^No","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Lie","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^Evade","/str","/ev",{"*":".^.c-3","flg":20},{"c-0":["\n","^\"I do.\"","\n",{"->":"admitted_to_something"},{"->":".^.^.g-0"},{"#f":5}],"c-1":["^ \"I have no idea.\" ","\n",{"->":".^.^.silence"},{"->":".^.^.g-0"},{"#f":5}],"c-2":["^ \t\t",{"->":".^.^.c-1"},"\n",{"->":".^.^.g-0"},{"#f":5}],"c-3":["^ \t\t","\n","^\"The component?\"","\n","ev",{"^var":"evasive","ci":-1},{"f()":"raise"},"pop","/ev","\n","ev",{"^var":"forceful","ci":-1},{"f()":"lower"},"pop","/ev","\n","^\"Don't play stupid,\" he replies. \"","ev",{"CNT?":"missing_reel"},"!","/ev",[{"->":".^.b","c":true},{"b":["^The component that went missing this afternoon. ",{"->":".^.^.^.22"},null]}],"nop","^Where is it?\"","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["ev",{"CNT?":"missing_reel"},"!","/ev",[{"->":".^.b","c":true},{"b":["\n",{"->t->":"missing_reel"},{"->":".^.^.^.5"},null]}],"nop","\n","ev","str","^Co-operate","/str","/ev",{"*":".^.c-4","flg":20},"ev","str","^Delay","/str","/ev",{"*":".^.c-5","flg":20},"ev","str","^Lie","/str","/ev",{"*":".^.c-6","flg":20},"ev","str","^Evade","/str","/ev",{"*":".^.c-7","flg":20},{"c-4":["^ \"I know where it is.\"","\n",{"->":"admitted_to_something"},{"->":".^.^.^.silence"},{"#f":5}],"c-5":["^ \"I know nothing about it.\" My voice shakes","ev",{"VAR?":"forceful"},0,">","/ev",[{"->":".^.b","c":true},{"b":["^ with anger",{"->":".^.^.^.8"},null]}],[{"->":".^.b"},{"b":["^; I'm unaccustomed to facing off against men with holstered guns",{"->":".^.^.^.8"},null]}],"nop","^. ","\n",{"->":".^.^.^.silence"},{"#f":5}],"c-6":["^ ",{"->":".^.^.c-5"},"\n",{"->":".^.^.^.silence"},{"#f":5}],"c-7":["^ ","\n","^\"I don't know what gives you the right to pick on me. ","ev",{"VAR?":"forceful"},0,">","/ev",[{"->":".^.b","c":true},{"b":["^I demand a lawyer.",{"->":".^.^.^.10"},null]}],[{"->":".^.b"},{"b":["^I want a lawyer.",{"->":".^.^.^.10"},null]}],"nop","^\"","\n","^\"This is time of war,\" Harris answers. \"And by God, if I have to shoot you to recover the component, I will. Understand?\" He points at the mug, ",{"->":".^.^.^.silence.drinkit"},"\n",{"->":".^.^.^.silence"},{"#f":5}]}],"silence":["^There's an icy silence. ","ev",{"VAR?":"forceful"},2,">","/ev",[{"->":".^.b","c":true},{"b":["^I've cracked him a little.",{"->":".^.^.^.8"},null]}],[{"->":".^.b"},{"b":["ev",{"VAR?":"evasive"},2,">","/ev",[{"->":".^.b","c":true},{"b":["^He's tiring of my evasiveness.",{"->":".^.^.^.6"},null]}],"nop",{"->":".^.^.^.8"},null]}],"nop","\n",["^\"Now drink your tea and talk.\"","\n","ev","str","^Drink","/str",{"VAR?":"teacup"},"/ev",{"*":".^.c-8","flg":21},"ev","str","^Put the cup down","/str",{"VAR?":"teacup"},"/ev",{"*":".^.c-9","flg":21},"ev","str","^Take the cup","/str",{"VAR?":"teacup"},"!","/ev",{"*":".^.c-10","flg":21},"ev","str","^Don't take it","/str",{"VAR?":"teacup"},"!","/ev",{"*":".^.c-11","flg":21},{"c-8":["^ \t\t\t",{"->":".^.^.c-10.2.drinkfromcup"},"\n",{"->":".^.^.^.^.g-1"},{"#f":5}],"c-9":["^ ","\n","^I set the cup carefully down on the table once more.","\n","ev",false,"/ev",{"VAR=":"teacup","re":true},"ev",{"^var":"forceful","ci":-1},{"f()":"raise"},"pop","/ev","\n",{"->":".^.^.c-11.10.whatsinit"},{"->":".^.^.^.^.g-1"},{"#f":5}],"c-10":["^ ","\n",[["^I lift the cup ","ev",{"VAR?":"teacup"},"/ev",[{"->":".^.b","c":true},{"b":["^to my lips ",{"->":".^.^.^.5"},null]}],"nop","^and sip. He waits for me to swallow before speaking again.","\n","ev",true,"/ev",{"VAR=":"drugged","re":true},"ev",true,"/ev",{"VAR=":"teacup","re":true},{"->":".^.^.^.^.^.^.g-1"},{"#f":5,"#n":"drinkfromcup"}],null],{"#f":5}],"c-11":["^ ","\n","^I leave the cup where it is.","\n","ev",{"^var":"forceful","ci":-1},{"f()":"raise"},"pop","/ev","\n",[["^\"Why?\" I ask coldly. \"What's in it?\"","\n",{"->":".^.^.^.^.^.^.g-1"},{"#n":"whatsinit"}],null],{"#f":5}],"#n":"drinkit"}],null],"g-1":["^\"Lapsang Souchong,\" he ","ev",{"CNT?":".^.^.silence.drinkit.c-10.2.drinkfromcup"},"/ev",[{"->":".^.b","c":true},{"b":["^remarks",{"->":".^.^.^.6"},null]}],[{"->":".^.b"},{"b":["^replies",{"->":".^.^.^.6"},null]}],"nop","^, placing his own cup back on the table untouched. \"Such a curious flavour. It might almost not be tea at all. You might say it hides a multitude of sins. As do you. Isn't that right?\"","\n","ev","str","^Agree","/str","/ev",{"*":".^.c-12","flg":20},"ev","str","^Disagree","/str",{"VAR?":"drugged"},"!","/ev",{"*":".^.c-13","flg":21},"ev","str","^Disagree","/str",{"VAR?":"drugged"},"/ev",{"*":".^.c-14","flg":21},"ev","str","^Lie","/str",{"VAR?":"drugged"},"/ev",{"*":".^.c-15","flg":21},"ev","str","^Lie","/str",{"VAR?":"drugged"},"!","/ev",{"*":".^.c-16","flg":21},"ev","str","^Evade","/str",{"VAR?":"drugged"},"/ev",{"*":".^.c-17","flg":21},"ev","str","^Evade","/str",{"VAR?":"drugged"},"!","/ev",{"*":".^.c-18","flg":21},{"c-12":["^ ","\n","^\"I suppose so,\" I reply. \"I've done things I shouldn't have done.\"","\n","ev",{"^var":"forceful","ci":-1},{"f()":"lower"},"pop","/ev","\n",{"->":"harris_presses_for_details"},{"#f":5}],"c-13":["\n","^\"I've done nothing that I'm ashamed of.\"","\n",{"->":"harris_asks_for_theory"},{"#f":5}],"c-14":["^ ","\n","^I open my mouth to disagree, but the words I want won't come. It is like Harris has taken a screwdriver to the sides of my jaw.","\n",{"->":"admitted_to_something.ive_done_things"},{"#f":5}],"c-15":["^ \t",{"->":".^.^.c-14"},"\n",{"#f":5}],"c-16":["^ \t",{"->":".^.^.c-13"},"\n",{"#f":5}],"c-17":["^ ",{"->":".^.^.c-14"},"\n",{"#f":5}],"c-18":["^ ","\n","^\"None of us are blameless, Harris. ","ev",{"VAR?":"forceful"},1,">","/ev",[{"->":".^.b","c":true},{"b":["^But you're not my priest and I'm not yours",{"->":".^.^.^.10"},null]}],[{"->":".^.b"},{"b":["^But I've done nothing to deserve this treatment",{"->":".^.^.^.10"},null]}],"nop","^. Now, please. Let me go. I'll help you find this damn component, of course I will.\"","\n","^He appears to consider the offer.","\n",{"->":"harris_asks_for_theory"},{"#f":5}]}]}],null],"harris_presses_for_details":[["^\"You mean you've left yourself open,\" Harris answers. \"To pressure. Is that what you're saying?\"","\n","ev","str","^Yes","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^No","/str",{"VAR?":"drugged"},"!","/ev",{"*":".^.c-1","flg":21},"ev","str","^No","/str",{"VAR?":"drugged"},"/ev",{"*":".^.c-2","flg":21},"ev","str","^Evade","/str",{"VAR?":"drugged"},"!","/ev",{"*":".^.c-3","flg":21},"ev","str","^Evade","/str",{"VAR?":"drugged"},"/ev",{"*":".^.c-4","flg":21},{"c-0":["^ ",{"->":".^.^.^.admit_open_to_pressure"},"\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["^ ","\n","^\"I'm not saying anything of the sort,\" I snap back. \"What is this, Harris? You're accusing me of treachery but I don't see a shred of evidence for it! Why don't you put your cards on the table?\"","\n","ev",{"^var":"forceful","ci":-1},{"f()":"raise"},"pop","/ev","\n",{"->":".^.^.g-0"},{"#f":5}],"c-2":["^ ","\n","^I shake my head violently, to say no, that's not it, but whatever is wrong with tongue is wrong with neck too. I look across at the table at Harris' face and realise with a start how sympathetic he is. Such a kind, generous man. How can I hold anything back from him?","\n","ev",{"^var":"forceful","ci":-1},{"f()":"lower"},"pop","/ev","\n","^I take another mouthful of the bitter, strange—tasting tea before answering.","\n",{"->":".^.^.^.admit_open_to_pressure"},{"->":".^.^.g-0"},{"#f":5}],"c-3":["^ ","\n","^\"You're the one applying pressure here,\" I answer ","ev",{"VAR?":"forceful"},1,">","/ev",[{"->":".^.b","c":true},{"b":["^smartly",{"->":".^.^.^.10"},null]}],[{"->":".^.b"},{"b":["^somewhat miserably",{"->":".^.^.^.10"},null]}],"nop","^. \"I'm just waiting until you tell me what is really going on.\"","\n","ev",{"^var":"evasive","ci":-1},{"f()":"raise"},"pop","/ev","\n",{"->":".^.^.g-0"},{"#f":5}],"c-4":["^ \t\t\t\t ","\n","^\"We're all under pressure here.\"","\n","^He looks at me with pity. ",{"->":"harris_has_seen_it_before"},"\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^\"It's simple enough,\" Harris says. ",{"->":"harris_has_seen_it_before"},"\n",null]}],{"admit_open_to_pressure":["^\"That's it,\" I reply. \"There are some things... which a man shouldn't do.\"","\n","ev",true,"/ev",{"VAR=":"admitblackmail","re":true},"^Harris doesn't stiffen. Doesn't lean away, as though my condition might be infectious. I had thought they trained them in the army to shoot my kind on sight.","\n","^He offers no sympathy either. He nods, once. His understanding of me is a mere turning cog in his calculations, with no meaning to it.","\n",{"->":"harris_has_seen_it_before"},null]}],"admitted_to_something":[["ev",{"VAR?":"drugged"},"!","/ev",[{"->":".^.b","c":true},{"b":["\n","^Harris stares back at me. ","ev",{"VAR?":"evasive"},0,"==","/ev",[{"->":".^.b","c":true},{"b":["^He cannot have expected it to be so easy to break me.",{"->":".^.^.^.8"},null]}],"nop","\n",{"->":".^.^.^.6"},null]}],[{"->":".^.b"},{"b":["\n","^Harris smiles with satisfaction, as if your willingness to talk was somehow his doing.","\n",{"->":".^.^.^.6"},null]}],"nop","\n","^\"I see.\"","\n","^There's a long pause, like the delay between feeding a line of cypher into the Bombe and waiting for its valves to warm up enough to begin processing.","\n","^\"You want to explain that?\"","\n","ev","str","^Explain","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Don't explain","/str",{"VAR?":"drugged"},"!","/ev",{"*":".^.c-1","flg":21},"ev","str","^Lie","/str",{"VAR?":"drugged"},"!","/ev",{"*":".^.c-2","flg":21},"ev","str","^Evade","/str",{"VAR?":"drugged"},"!","/ev",{"*":".^.c-3","flg":21},"ev","str","^Say nothing","/str",{"VAR?":"drugged"},"/ev",{"*":".^.c-4","flg":21},{"c-0":["^ ","\n","^I pause a moment, trying to choose my words. To just come out and say it, after a lifetime of hiding... that is a circle I cannot square.","\n",["ev","str","^Explain","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Say nothing","/str",{"VAR?":"drugged"},"/ev",{"*":".^.c-1","flg":21},"ev","str","^Lie","/str",{"VAR?":"drugged"},"!","/ev",{"*":".^.c-2","flg":21},{"c-0":["^ \t",{"->":".^.^.^.^.^.ive_done_things"},"\n",{"#f":5}],"c-1":["^ \t",{"->":".^.^.^.^.c-4"},"\n",{"#f":5}],"c-2":["^ \t",{"->":"claim_hooper_took_component"},"\n",{"#f":5}]}],{"#f":5}],"c-1":["\n","^\"There's nothing to explain,\" I reply stiffly. ",{"->":".^.^.^.i_know_where"},"\n",{"#f":5}],"c-2":["^ ",{"->":"claim_hooper_took_component"},"\n",{"#f":5}],"c-3":["\n","^\"Explain what you should be doing, do you mean, rather than bullying me? Certainly.\" I fold my arms. ",{"->":".^.^.^.i_know_where"},"\n",{"#f":5}],"c-4":["\n","^I fold my arms, intended firmly to say nothing. But somehow, watching Harris' face, I cannot bring myself to do it. I want to confess. I want to tell him everything I can, to explain myself to him, to earn his forgiveness. The sensation is so strong my will is powerless in the face of it.","\n","^Something is wrong with me, I am sure of it. There is a strange, bitter flavour on my tongue. I taste it as words start to form.","\n",{"->":".^.^.^.ive_done_things"},{"#f":5}]}],{"i_know_where":["^\"I know where your component is because it's obvious where your component is. That doesn't mean I took it, just because I can figure out a simple problem, any more than it means I'm a German spy because I can crack their codes.\"","\n",{"->":"harris_asks_for_theory"},null],"ive_done_things":["^\"I've done things,\" I begin","ev",{"CNT?":"harris_demands_component.0.g-1.c-14"},"/ev",[{"->":".^.b","c":true},{"b":["^ helplessly",{"->":".^.^.^.5"},null]}],"nop","^. \"Things I didn't want to do. I tried not to. But in the end, it felt like cutting off my own arm to resist.\"","\n",{"->":"harris_presses_for_details"},null]}],"harris_asks_for_theory":[["^\"Tell me, then,\" he asks. \"What's your theory? You're a smart fellow — as smart as they come around here, and that's saying something. What's your opinion on the missing component? Accident, perhaps? Or do you blame one of the other men? ","ev",{"VAR?":"hooper_mentioned"},"/ev",[{"->":".^.b","c":true},{"b":["^Hooper?",{"->":".^.^.^.5"},null]}],"nop","^\"","\n","ev","str","^Blame no—one","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Blame someone","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ ","\n",{"->":".^.^.^.an_accident"},{"#f":5}],"c-1":["^ ",{"->":"claim_hooper_took_component"},"\n",{"#f":5}]}],{"an_accident":[["^\"An accident, naturally.\" I risk a smile. \"That damned machine is made from spare parts and string. Even these Huts leak when it rains. It wouldn't take more than one fellow to trip over a cable to shake out a component. Have you tried looking under the thing?\"","\n","^\"Do you believe we haven't?\"","\n","^In a sudden moment I understand that his reply is a threat.","\n","^\"Now,\" he continues. \"Are you sure there isn't anything you want to tell me?\"","\n","ev","str","^Co-operate","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Evade","/str",{"VAR?":"evasive"},0,">","/ev",{"*":".^.c-1","flg":21},{"c-0":["\n","^\"All right.\" With a sigh, your defiance collapses. \"If you're searched my things then I suppose you've found ","ev",{"VAR?":"evasive"},1,">","/ev",[{"->":".^.b","c":true},{"b":["^ what you need",{"->":".^.^.^.9"},null]}],[{"->":".^.b"},{"b":["^my letters. Haven't you? In fact, if you haven't, don't tell me",{"->":".^.^.^.9"},null]}],"nop","^.","\n","ev",true,"/ev",{"VAR=":"admitblackmail","re":true},"^Harris nods once.","\n","<>","^ ",{"->":"harris_has_seen_it_before"},"\n",{"#f":5}],"c-1":["^ \"Only that you're being unreasonable, and behaving like a swine.\"","\n","^\"You imbecile,\" Harris replies, with sudden force. He is half out of his chair. \"You know the situation as well as I do. Why the fencing? The Hun are poised like rats, ready to run all over this country. They'll destroy everything. You understand that, don't you? You're not so locked up inside your crossword puzzles that you don't see that, are you? This machine we have here — you men — you are the best and only hope this country has. God help her.\"","\n","ev",true,"/ev",{"VAR=":"losttemper","re":true},"^I sit back, startled by the force of his outburst. His carefully sculpted expression has curled to angry disgust. He really does hate me, I think. He'll have my blood for the taste of it.","\n",["ev","str","^Placate","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Mock","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Dismiss","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["\n","^\"Now steady on,\" I reply, gesturing for him to be calm.","\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["^ ","\n","^\"I can imagine how being surrounded by clever men is pretty threatening for you, Commander,\" I reply with a sneer. \"They don't train you to think in the Armed Forces.\"","\n","ev",{"^var":"forceful","ci":-1},{"f()":"raise"},"pop","/ev","\n",{"->":".^.^.g-0"},{"#f":5}],"c-2":["\n","^\"Then I'll be going, on and getting on with my job of saving her, shall I?\" I even rise half to my feet, before he slams the tabletop.","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^\"Talk,\" Harris demands. \"Talk now. Tell me where you've hidden it or who you passed it to. Or God help me, I'll take your wretched pansy body to pieces looking for it.\"","\n",{"->":"harris_demands_you_speak"},null]}],{"#f":5}]}],null]}],"harris_has_seen_it_before":[["^\"I've seen it before. A young man like you — clever, removed. The kind that doesn't go to parties. Who takes himself too seriously. Who takes things too far.\"","\n","^He slides his thumb between two fingers.","\n","^\"Now they own you.\"","\n","ev","str","^Agree","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Disagree","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Lie","/str",{"VAR?":"drugged"},"!","/ev",{"*":".^.c-2","flg":21},"ev","str","^Apologise","/str",{"VAR?":"drugged"},{"VAR?":"forceful"},0,"<","&&","/ev",{"*":".^.c-3","flg":21},{"c-0":["^ ","\n","^\"What could I do?\" I'm shaking now. The night is cold and the heat—lamp in the Hut has been removed. \"","ev",{"VAR?":"forceful"},2,">","/ev",[{"->":".^.b","c":true},{"b":["^I won't",{"->":".^.^.^.10"},null]}],[{"->":".^.b"},{"b":["^I don't want to",{"->":".^.^.^.10"},null]}],"nop","^ go to prison.\"","\n","^\"Smart man,\" he replies. \"You wouldn't last.","\n",{"->":".^.^.tell_me_now"},{"#f":5}],"c-1":["^ ","\n","^\"I can still fix this.\"","\n","^Harris shakes his head. \"You'll do nothing. This is beyond you now. You may go to prison or may go to firing squad - or we can change your name and move you somewhere where your indiscretions can't hurt you. But right now, none of that matters. What happens to you doesn't matter. All that matters is where that component is.","\n",{"->":".^.^.tell_me_now"},{"#f":5}],"c-2":["^ ","\n","^\"I wanted to tell you,\" I tell him. \"I thought I could find out who they were. Lead you to them.\"","\n","^Harris looks at me with contempt. \"You wretch. You'll pay for what you've done to this country today. If a single man loses his life because of your pride and your perversions then God help your soul.","\n",{"->":".^.^.tell_me_now"},{"#f":5}],"c-3":["\n","^\"Harris, I...\"","\n","ev",{"^var":"forceful","ci":-1},{"f()":"lower"},"pop","/ev","\n","^\"Stop it,\" he interrupts. \"There's no jury here to sway. And there's no time.","\n",{"->":".^.^.tell_me_now"},{"#f":5}],"tell_me_now":["<>","^ So why don't you tell me, right now. Where is it?\"","\n",{"->":"harris_demands_you_speak"},null]}],null],"harris_demands_you_speak":[["^His eyes bear down like carbonised drill—bits.","\n","ev","str","^Confess","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Dissemble","/str",{"VAR?":"drugged"},"!","/ev",{"*":".^.c-1","flg":21},"ev","str","^Dissemble","/str",{"VAR?":"drugged"},"/ev",{"*":".^.c-2","flg":21},{"c-0":["^ ","\n","ev",{"VAR?":"forceful"},1,">","/ev",[{"->":".^.b","c":true},{"b":["\n","^\"You want me to tell you what happened? You'll be disgusted.\"","\n",{"->":".^.^.^.9"},null]}],[{"->":".^.b"},{"b":["\n","^\"All right. I'll tell you what happened.\" And never mind my shame.","\n",{"->":".^.^.^.9"},null]}],"nop","\n","^\"I can imagine how it starts,\" he replies.","\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["^ ",{"->":"claim_hooper_took_component"},"\n",{"->":".^.^.g-0"},{"#f":5}],"c-2":["\n","^My plan now is to blame Hooper, but I cannot seem to tell the story. Whatever they put in my tea, it rules my tongue. ","ev",{"VAR?":"forceful"},1,">","/ev",[{"->":".^.b","c":true},{"b":["^I fight it as hard as I can but it does no good.",{"->":".^.^.^.9"},null]}],[{"->":".^.b"},{"b":["^I am desperate to tell him everything. I am weeping with shame.",{"->":".^.^.^.9"},null]}],"nop","\n","ev",{"^var":"forceful","ci":-1},{"f()":"lower"},"pop","/ev","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":[{"->":"i_met_a_young_man"},null]}],null],"i_met_a_young_man":[["ev","str","^Talk","/str","/ev",{"*":".^.c-0","flg":20},{"c-0":["\n","^\"There was a young man. I met him in the town. A few months ago now. We got to talking. Not about work. And I used my cover story, but he seemed to know it wasn't true. That got me wondering if he might be one of us.\"","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^Harris is not letting me off any more.","\n","^\"You seriously entertained that possibility?\"","\n","ev","str","^Yes","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^No","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^Lie","/str","/ev",{"*":".^.c-3","flg":20},{"c-1":["\n","^\"Yes, I considered it. ","<>","\n",{"->":".^.^.^.g-1"},{"#f":5}],"c-2":["^ ","\n","^\"No. Not for more than a moment, of course. Everyone here is marked out by how little we would be willing to say about it.\"","\n","^\"Only you told this young man more than a little, didn't you?\"","\n","^I nod. \"","<>","\n",{"->":".^.^.^.g-1"},{"#f":5}],"c-3":["^ ","\n","^\"I was quite certain, after a while. After we'd been talking. ","<>","\n",{"->":".^.^.^.g-1"},{"#f":5}]}],"g-1":["^He seemed to know all about me. He... he was quite enchanted by my achievements.\"","\n","^The way Harris is staring I expect him to strike me, but he does not. He replies, \"I can see how that must have been attractive to you,\" with such plain—spokeness that I think I must have misheard.","\n","ev","str","^Yes","/str","/ev",{"*":".^.c-4","flg":20},"ev","str","^No","/str",{"VAR?":"drugged"},"!","/ev",{"*":".^.c-5","flg":21},"ev","str","^No","/str",{"VAR?":"drugged"},"/ev",{"*":".^.c-6","flg":21},"ev","str","^Lie","/str",{"VAR?":"drugged"},"!","/ev",{"*":".^.c-7","flg":21},{"c-4":["^ \"It's a lonely life in this place,\" I reply. \"Lonely - and still one never gets a moment to oneself.\"","\n","^\"That's how it is in the Service,\" Harris answers.","\n",["ev","str","^Argue","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Agree","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ \"I'm not in the Service.\"","\n","^Harris shakes his head. \"Yes, you are.\"","\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["^ \"Perhaps. But I didn't choose this life.\" ","\n","^Harris shakes his head. \"No. And there's plenty of others who didn't who are suffering far worse.\"","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^Then he waves the thought aside.","\n",{"->":".^.^.^.^.^.g-2"},null]}],{"#f":5}],"c-5":["^ \"The boy was a pretty simpleton. Quite inferior. His good opinion meant nothing to be. Harris, do not misunderstand. I was simply after his body.\"","\n","ev",{"^var":"evasive","ci":-1},{"f()":"raise"},"pop","/ev","\n","^Harris, to his credit, doesn't flinch; but I can see he will have nightmares of this moment later tonight. I'm tempted to reach out and take his hand to worsen it for him.","\n",{"->":".^.^.^.g-2"},{"#f":5}],"c-6":["^ ","\n","^\"It wasn't,\" I reply. \"But I doubt you'd understand.\"","\n","^He simply nods.","\n",{"->":".^.^.^.g-2"},{"#f":5}],"c-7":["^ ",{"->":".^.^.c-5"},"\n",{"->":".^.^.^.g-2"},{"#f":5}]}],"g-2":["^\"Go on with your confession.\"","\n",["ev",{"CNT?":".^.^.^.g-1.c-5"},"!","/ev",[{"->":".^.b","c":true},{"b":["\n","^That gives me pause. I hadn't thought of it as such. But I suppose he's right. I am about to admit what I did.","\n",{"->":".^.^.^.5"},null]}],"nop","\n","^\"There's not much else to say. I took the part from Bombe computing device. You seem to know that already. I had to. He was going to expose me if I didn't.\"","\n","^\"This young man was blackmailing you over your affair?\"","\n","ev",{"VAR?":"drugged"},"/ev",{"temp=":"harris_thinks_youre_drugged"},"ev",{"VAR?":"drugged"},"/ev",[{"->":".^.b","c":true},{"b":["\n","ev",false,"/ev",{"VAR=":"drugged","re":true},"^As Harris speaks I find myself suddenly sharply aware, as if waking from a long sleep. The table, the corrugated walls of the hut, everything seems suddenly more tangible than a moment before.","\n","^Whatever it was they put in my drink is wearing off.","\n",{"->":".^.^.^.19"},null]}],"nop","\n","ev","str","^Yes","/str","/ev",{"*":".^.c-8","flg":20},"ev","str","^No","/str","/ev",{"*":".^.c-9","flg":20},"ev","str","^Tell the truth","/str","/ev",{"*":".^.c-10","flg":20},"ev","str","^Lie","/str","/ev",{"*":".^.c-11","flg":20},{"c-8":["^ ","\n","^\"Yes. I suppose he was their agent. I should have realised but I didn't. Then he threatened to tell you. I thought you would have me locked up: I couldn't bear the thought of it. I love working here. I've never been so happy, so successful, anywhere before. I didn't want to lose it.\"","\n","^\"So what did you do with the component?\" Harris talks urgently. He grips his gloves tightly in one hand, perhaps prepared to lift them and strike if it is required. \"Have you passed it to this man already? Have you left it somewhere for him to find?\"","\n",["ev","str","^I have it","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^I don't have it","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Lie","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^Tell the truth","/str","/ev",{"*":".^.c-3","flg":20},{"c-0":["^ \t","\n","^\"I still have it. Not on me, of course. ",{"->":"reveal_location_of_component"},"\n",{"#f":5}],"c-1":["^ \t",{"->":".^.^.^.^.^.^.^.i_dont_have_it"},"\n",{"#f":5}],"c-2":["^ \t\t\t\t\t\t\t",{"->":".^.^.c-1"},"\n",{"#f":5}],"c-3":["^ \t\t\t\t",{"->":".^.^.c-0"},"\n",{"#f":5}]}],{"#f":5}],"c-9":["^ ","\n","^\"No, Harris. The young man wasn't blackmailing me.\" I take a deep breath. \"It was Hooper.\"","\n","ev",{"VAR?":"hooper_mentioned"},"!","/ev",[{"->":".^.b","c":true},{"b":["\n","^\"Hooper!\" Harris exclaims, in surprise. ","ev",{"VAR?":"harris_thinks_youre_drugged"},"/ev",[{"->":".^.b","c":true},{"b":["^He does not doubt me for a moment.",{"->":".^.^.^.6"},null]}],"nop","\n",{"->":".^.^.^.10"},null]}],[{"->":".^.b"},{"b":["\n","^\"Now look here,\" Harris interrupts. \"Don't start that again.\"","\n",{"->":".^.^.^.10"},null]}],"nop","\n","^\"It's the truth, Harris. If I'm going to jail, so be it, but I won't hang at Traitor's Gate. Hooper was the one who told the boy about our work. Hooper put the boy on to me. ","ev",{"VAR?":"forceful"},2,"<","/ev",[{"->":".^.b","c":true},{"b":["^I should have realised, of course. These things don't happen by chance. I was a fool to think they might.",{"->":".^.^.^.19"},null]}],"nop","^ And then, once he had me compromised, he demanded I steal the part from the machine.\"","\n","ev",true,"/ev",{"VAR=":"revealedhooperasculprit","re":true},"^\"Which you did.\" Harris leans forward. \"And then what? You still have it? You've stashed it somewhere?\"","\n",["ev","str","^Yes","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^No","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Lie","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^Evade","/str","/ev",{"*":".^.c-3","flg":20},{"c-0":["^ ","\n","^\"Yes. I only had a moment. ",{"->":"reveal_location_of_component"},"\n",{"#f":5}],"c-1":["^ ",{"->":".^.^.^.^.^.^.^.passed_onto_hooper"},"\n",{"#f":5}],"c-2":["^ \t\t\t",{"->":".^.^.c-1"},"\n",{"#f":5}],"c-3":["^ \t\t","\n","^\"I can't remember.\"","\n","^He draws his gun and lays it lightly on the field table.","\n","^\"I'm sorry to threaten you, friend. But His Majesty needs that brain of yours, and that brain alone. There are plenty of other parts to you that our country could do better without. Now I'll ask you again. Did you hide the component?\"","\n",["ev","str","^Yes","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^No","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Lie","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^Evade","/str","/ev",{"*":".^.c-3","flg":20},{"c-0":["^ ",{"->":".^.^.^.^.c-0"},"\n",{"#f":5}],"c-1":["^ ","\n","^\"Very well then.\" I swallow nervously, to make it look more genuine. ",{"->":"i_met_a_young_man.passed_onto_hooper"},"\n",{"#f":5}],"c-2":["^ ",{"->":".^.^.c-1"},"\n",{"#f":5}],"c-3":["^ ",{"->":"i_met_a_young_man.i_dont_have_it"},"\n",{"#f":5}]}],{"#f":5}]}],{"#f":5}],"c-10":["^ \t",{"->":".^.^.c-8"},"\n",{"#f":5}],"c-11":["^ \t\t\t\t",{"->":".^.^.c-9"},"\n",{"#f":5}],"#n":"paused"}],null]}],{"i_dont_have_it":[["^\"I don't have it any more. I passed it through the fence to my contact straight after taking it, before it was discovered to be missing. It would have been idiocy to do differently. It's long gone, I'm afraid.\"","\n","^\"You fool, Manning,\" Harris curses, getting quickly to his feet. \"You utter fool. Do you suppose you will be any better off living under Hitler? It's men like you who will get us all killed. Men too feeble, too weak in their hearts to stand up and take a man's responsibility for the world. You're happier to stay a child all your life and play with your little childish toys.\"","\n","ev","str","^Answer back","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Say nothing","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["\n","^\"Really, Commander,\" I reply. \"It rather sounds like you want to spank me.\"","\n","^\"For God's sake,\" he declares with thick disgust, then swoops away out of the room.","\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["^ ","\n","^I say nothing. It's true, isn't it? I can't deny that I know there is a world out there, a complicated world of pain and suffering. And I can't deny that I don't think about it a moment longer than I have to. What use is thinking on a problem that cannot be solved? It is precisely our ability to avoid such endless spirals that makes us human and not machine.","\n","^\"God have mercy on your soul,\" Harris says finally, as he gets to his feet and heads for the door. \"I fear no—one else will.\"","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":[{"->":"left_alone"},null]}],null],"passed_onto_hooper":[["ev",true,"/ev",{"VAR=":"hooper_mentioned","re":true},"^\"No. I passed it on to Hooper.\"","\n","^\"I see. And what did he do with it?\"","\n","ev","str","^Evade","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Tell the truth","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Lie","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["^ ","\n","^\"I don't know.\"","\n","^\"You can do better than that. Remember, there's a hangman's noose waiting for traitors.\"","\n",["ev","str","^Theorise","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Shrug","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ ","\n","^\"Well, then,\" I answer, nervously. \"What would he do? Either get rid of it straight away — or if that wasn't possible, which it probably wouldn't be, since he'd have to arrange things with his contacts — so most likely, he'd hide it somewhere and wait, until you had the rope around my neck and he could be sure he was safe.\"","\n",{"->":"claim_hooper_took_component.harris_being_convinced"},{"#f":5}],"c-1":["^ ",{"->":"claim_hooper_took_component.its_your_problem"},"\n",{"#f":5}]}],{"#f":5}],"c-1":["^ ","\n","^\"I don't think Hooper could have planned this in advance. So he'd need to get word to whoever he's working with, and that would take time. So I think he would have hidden it somewhere, and be waiting to make sure I soundly take the fall. That way, if anything goes wrong, he can arrange for the part to be conveniently re—found.\"","\n",{"->":"claim_hooper_took_component.harris_being_convinced"},{"#f":5}],"c-2":["\n","^\"I'm sure I saw him this evening, talking to someone by the fence on the woodland side of the compound. He's probably passed it on already. You'll have to ask him.\"","\n",{"->":"claim_hooper_took_component.harrumphs"},{"#f":5}]}],null],"#f":1}],"claim_hooper_took_component":[["^\"I saw Hooper take it.\"","\n","ev",true,"/ev",{"VAR=":"hooper_mentioned","re":true},"ev",{"VAR?":"losttemper"},"/ev",[{"->":".^.b","c":true},{"b":["\n","^\"Did you?\"","\n","^The worst of his rage is passing; he is now moving into a kind of contemptuous despair. I can imagine him wrapping up our interview soon, leaving the hut, locking the door, and dropping the key down the well in the yard.","\n","^And why wouldn't he? With my name tarnished they will not let me back to work on the Bombe — if there is the slightest smell of treachery about my name I would be lucky not be locked up for the remainder of the war.","\n",{"->":".^.^.^.11"},null]}],[{"->":".^.b"},{"b":["\n","^\"I see.\" He is starting to lose his patience. I have seen Harris angry a few times, with lackeys and secretaries. But never with us. With the 'brains' he has always been cautious, treating us like children.","\n","^And now I see that, like a father, he wants to smack us when we disobey him.","\n",{"->":".^.^.^.11"},null]}],"nop","\n","^\"Just get to the truth, man. Every minute matters.\"","\n","ev","str","^Persist with this","/str",{"VAR?":"admitblackmail"},"/ev",{"*":".^.c-0","flg":21},"ev","str","^Tell the truth","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Persist with this","/str",{"VAR?":"admitblackmail"},"!","/ev",{"*":".^.c-2","flg":21},{"c-0":["\n","^\"I know what you're thinking. If I've transgressed once then I must be guilty of everything else... But I'm not. We were close to cracking the 13th's intercept. We were getting correlations in the data. Then Hooper disappeared for a moment, and next minute the machine was down.\"","\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["^ ","\n","^\"Very well. I see there's no point in covering up. You know everything anyway.\"","\n","^Harris nods, and waits for me to continue.","\n",{"->":"i_met_a_young_man"},{"->":".^.^.g-0"},{"#f":5}],"c-2":["\n","^\"This is the truth.\"","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^I have become, somehow, an accustomed liar — the words roll easily off my tongue. Perhaps I am a traitor, I think, now that I dissemble as easily as one.","\n","^\"Go on,\" Harris says, giving me no indication of whether he believes my tale.","\n","ev","str","^Assert","/str","/ev",{"*":".^.c-3","flg":20},"ev","str","^Imply","/str","/ev",{"*":".^.c-4","flg":20},{"c-3":["^ \"I saw him take it,\" I continue. \"Collins was outside having a cigarette. Peterson was at the table. But I was at the front of the machine. I saw Hooper go around the side. He leant down and pulled something free. I even challenged him. I said, 'What's that? Someone put a nail somewhere they shouldn't have?' He didn't reply.\"","\n","^Harris watches me for a long moment.","\n",{"->":".^.^.^.g-1"},{"#f":5}],"c-4":["^ \"At the moment the machine halted, Peterson was at the bench and Collins was outside having a smoke. I was checking the dip—switches. Hooper was the only one at the back of the Bombe. No—one else could have done it.\"","\n","^\"That's not quite the same as seeing him do it,\" Harris remarks.","\n",["ev","str","^Logical","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Persuasive","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Confident","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["\n","^\"When you have eliminated the impossible...\" I begin, but Harris cuts me off.","\n",{"->":".^.^.^.^.^.g-1"},{"#f":5}],"c-1":["^ ","\n","^\"You have to believe me.\"","\n","^\"We don't have to believe anyone,\" Harris returns. \"I will only be happy with the truth, and your story doesn't tie up. We know you've been leaving yourself open to pressure. We've been watching your activities for some time. But we thought you were endangering the reputation of this site; not risking the country herself. Perhaps I put too much trust in your intellectual pride.\"","\n","^He pauses for a moment, considering something. Then he continues:","\n","^\"It might have been Hooper. It might have been you. ",{"->":".^.^.^.^.^.we_wont_guess"},"\n",{"->":".^.^.^.^.^.g-1"},{"#f":5}],"c-2":["^ ","\n","^\"Ask the others,\" I reply, leaning back. \"They'll tell you. If they haven't already, that's only because they're protecting Hooper. Hoping he'll come to his senses and stop being an idiot. I hope he does too. And if you lock him up in a freezing hut like you've done me, I'm sure he will.\"","\n","^\"We have,\" Harris replies simply.","\n","^It's all I can do not to gape.","\n",{"->":".^.^.^.^.^.g-1.hoopers_hut_3"},{"->":".^.^.^.^.^.g-1"},{"#f":5}]}],{"#f":5}]}],"g-1":["^\"We are left with two possibilities. You, or Hooper.\" The Commander pauses to smooth down his moustache. ","<>","\n",["^\"Hooper's in Hut 3 with the Captain, having a similar conversation.\"","\n",["ev",{"^->":"claim_hooper_took_component.0.g-1.hoopers_hut_3.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^\"","/str","/ev",{"*":".^.^.c-5","flg":22},{"s":["^\"And the other men?",{"->":"$r","var":true},null]}],["ev",{"^->":"claim_hooper_took_component.0.g-1.hoopers_hut_3.3.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^\"","/str","/ev",{"*":".^.^.c-6","flg":22},{"s":["^\"Then you know I'm right.",{"->":"$r","var":true},null]}],{"c-5":["ev",{"^->":"claim_hooper_took_component.0.g-1.hoopers_hut_3.c-5.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],"^ Do we have a hut each? Are there enough senior officers to go round?\"","\n","^\"Collins was outside when it happened, and Peterson can't get round the machine in that chair of his,\" Harris replies. \"That leaves you and Hooper.","\n",{"->":".^.^.^.^.we_wont_guess"},{"#f":5}],"c-6":["ev",{"^->":"claim_hooper_took_component.0.g-1.hoopers_hut_3.c-6.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.3.s"},[{"#n":"$r2"}],"^ You knew all along. Why did you threaten me?\"","\n","^\"All we know is that we have a traitor, holding the fate of the country in his hands.","\n",{"->":".^.^.^.^.we_wont_guess"},{"#f":5}],"#f":5,"#n":"hoopers_hut_3"}],null],"we_wont_guess":["<>","^ We're not in the business of guessing here at Bletchley. We are military intelligence. We get answers.\" Harris points a finger. \"And if that component has left these grounds, then every minute is critical.\"","\n","ev","str","^Co-operate","/str","/ev",{"*":".^.c-7","flg":20},"ev","str","^Block","/str","/ev",{"*":".^.c-8","flg":20},{"c-7":["^ ","\n","^\"I'd be happy to help,\" I answer, leaning forwards. \"I'm sure there's something I could do.\"","\n","^\"Like what, exactly?\"","\n",[["ev",{"^->":"claim_hooper_took_component.0.we_wont_guess.c-7.6.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^\"Put me in with Hooper.\"",{"->":"$r","var":true},null]}],["ev",{"^->":"claim_hooper_took_component.0.we_wont_guess.c-7.6.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^\"","/str","/ev",{"*":".^.^.c-1","flg":22},{"s":["^\"Tell Hooper I've confessed.",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"claim_hooper_took_component.0.we_wont_guess.c-7.6.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.^.^.^.^.putmein"},{"#f":5}],"c-1":["ev",{"^->":"claim_hooper_took_component.0.we_wont_guess.c-7.6.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.1.s"},[{"#n":"$r2"}],"^ Better yet. Let him see you marching me off in handcuffs. Then let him go, and see what he does. Ten to one he'll go straight to wherever he's hidden that component and his game will be up.\"","\n","^Harris nods slowly, chewing over the idea. It isn't a bad plan even — except, of course, Hooper has not hidden the component, and won't lead them anywhere. But that's a problem I might be able to solve once I'm out of this place; and once they're too busy dogging Hooper's steps from hut to hut.","\n","^\"Interesting,\" the Commander muses. \"But I'm not so sure he'd be that stupid. And if he's already passed the part on, the whole thing will only be a waste of time.\"","\n",[["ev",{"^->":"claim_hooper_took_component.0.we_wont_guess.c-7.6.c-1.12.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^\"","/str","/ev",{"*":".^.^.c-0","flg":22},{"s":["^\"Trust me. He hasn't.",{"->":"$r","var":true},null]}],["ev",{"^->":"claim_hooper_took_component.0.we_wont_guess.c-7.6.c-1.12.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^.\"","/str","/ev",{"*":".^.^.c-1","flg":22},{"s":["^\"You're right. Let me talk to him",{"->":"$r","var":true},null]}],["ev",{"^->":"claim_hooper_took_component.0.we_wont_guess.c-7.6.c-1.12.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-2","flg":18},{"s":["^\"You're right.\" ",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"claim_hooper_took_component.0.we_wont_guess.c-7.6.c-1.12.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"^ If I know that man, and I do, he'll be wanting to keep his options open as long as possible. If the component's gone then he's in it up to his neck. He'll take a week at least to make sure he's escaped suspicion. Then he'll pass it on.\"","\n","^\"And if we keep applying pressure to him, you think the component will eventually just turn up?\"","\n",[["ev",{"^->":"claim_hooper_took_component.0.we_wont_guess.c-7.6.c-1.12.c-0.10.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^\"","/str","/ev",{"*":".^.^.c-0","flg":22},{"s":["^\"Yes.",{"->":"$r","var":true},null]}],["ev",{"^->":"claim_hooper_took_component.0.we_wont_guess.c-7.6.c-1.12.c-0.10.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":18},{"s":["^\"Or be thrown into the river.\" ",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"claim_hooper_took_component.0.we_wont_guess.c-7.6.c-1.12.c-0.10.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"^ Probably under my bunk.\"","\n","^Harris smiles wryly. \"We'll know that for a fake, then. We've looked there already.","\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["ev",{"^->":"claim_hooper_took_component.0.we_wont_guess.c-7.6.c-1.12.c-0.10.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.1.s"},[{"#n":"$r2"}],"\n","^\"Hmm.\" Harris chews his moustache thoughtfully. \"Well, that would put us in a spot, seeing as how we'd never know for certain. We'd have to be ready to change our whole approach just in case the part had got through to the Germans.","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["<>","^ I don't mind telling you, this is a disaster, this whole thing. What I want is to find that little bit of mechanical trickery. I don't care where. In your luncheon box or under Hooper's pillow. Just somewhere, and within the grounds of this place.\"","\n",["ev",{"^->":"claim_hooper_took_component.0.we_wont_guess.c-7.6.c-1.12.c-0.10.g-0.3.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^\"","/str","/ev",{"*":".^.^.c-2","flg":22},{"s":["^\"Then let him he think he's off the hook.",{"->":"$r","var":true},null]}],["ev",{"^->":"claim_hooper_took_component.0.we_wont_guess.c-7.6.c-1.12.c-0.10.g-0.4.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^.\"","/str","/ev",{"*":".^.^.c-3","flg":22},{"s":["^\"Then you'd better get searching",{"->":"$r","var":true},null]}],{"c-2":["ev",{"^->":"claim_hooper_took_component.0.we_wont_guess.c-7.6.c-1.12.c-0.10.g-0.c-2.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.3.s"},[{"#n":"$r2"}],"^ Make a show of me. And then you'll get your man.\"","\n","^Somehow, I think. But that's the part I need to work.","\n",{"->":"harris_takes_you_to_hooper"},{"#f":5}],"c-3":["ev",{"^->":"claim_hooper_took_component.0.we_wont_guess.c-7.6.c-1.12.c-0.10.g-0.c-3.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.4.s"},[{"#n":"$r2"}],"^,\" I reply, tiring of his complaining. A war is a war, you have to expect an enemy. ",{"->":".^.^.^.^.^.^.^.^.^.^.^.its_your_problem"},"\n",{"#f":5}]}]}],{"#f":5}],"c-1":["ev",{"^->":"claim_hooper_took_component.0.we_wont_guess.c-7.6.c-1.12.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.1.s"},[{"#n":"$r2"}],"^, then. As a colleague. Maybe I can get something useful out of him.\"","\n",{"->":".^.^.^.^.^.^.^.^.putmein"},{"#f":5}],"c-2":["ev",{"^->":"claim_hooper_took_component.0.we_wont_guess.c-7.6.c-1.12.c-2.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],{"->":".^.^.^.^.^.^.^.^.shake_head"},"\n",{"#f":5}]}],{"#f":5}]}],{"#f":5}],"c-8":["^ ",{"->":".^.^.^.^.its_your_problem"},"\n",{"#f":5}]}]}],{"harris_being_convinced":[["^\"Makes sense,\" Harris agrees, cautiously. ","ev",{"VAR?":"evasive"},1,">","/ev",[{"->":".^.b","c":true},{"b":["^I can see he's still not entirely convinced by my tale, as well he might not be — I've hardly been entirely straight with him.",{"->":".^.^.^.8"},null]}],[{"->":".^.b"},{"b":["^I can see he's still not certain whether he can trust me.",{"->":".^.^.^.8"},null]}],"nop","^ \"Which means the question is, what can we do to rat him out?\"","\n","ev","str","^Offer to help","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Don't offer to help","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ ","\n","^\"Maybe I can help with that.\"","\n","^\"Oh, yes? And how, exactly?\"","\n",[["ev",{"^->":"claim_hooper_took_component.harris_being_convinced.0.c-0.6.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^\"I'll talk to him.\" ",{"->":"$r","var":true},null]}],["ev",{"^->":"claim_hooper_took_component.harris_being_convinced.0.c-0.6.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^\"","/str","/ev",{"*":".^.^.c-1","flg":22},{"s":["^\"We'll fool him.",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"claim_hooper_took_component.harris_being_convinced.0.c-0.6.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n","^\"What?\"","\n","^\"Put me in with Hooper with him. Maybe I can get something useful out of him.\"","\n",{"->":".^.^.^.^.^.^.putmein"},{"#f":5}],"c-1":["ev",{"^->":"claim_hooper_took_component.harris_being_convinced.0.c-0.6.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.1.s"},[{"#n":"$r2"}],"^ He's waiting to be sure that I've been strung up for this, so let's give him what he wants. If he sees me taken away, clapped in irons — he'll go straight to that component and set about getting rid of it.\"","\n",{"->":"harris_takes_you_to_hooper"},{"#f":5}]}],{"#f":5}],"c-1":["\n","^I lean back. ",{"->":".^.^.^.^.its_your_problem"},"\n",{"#f":5}]}],null],"putmein":[["^Harris shakes his head.","\n","^\"He despises you. I don't see why he'd give himself up to you.\"","\n","ev","str","^Insist","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Give in","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ \"Try me. Just me and him.\" ","\n",{"->":".^.^.^.^.go_in_alone"},{"#f":5}],"c-1":["^ \"You're right.\" ","\n",{"->":".^.^.^.^.shake_head"},{"#f":5}]}],{"#f":1}],"shake_head":["<>","^ I shake my head. \"You're right. I don't see how I can help you. So there's only one conclusion.\"","\n","^\"Oh, yes? And what's that?\"","\n",{"->":".^.^.its_your_problem"},null],"its_your_problem":["^\"It's your problem. Your security breach. So much for your careful vetting process.\"","\n","^I lean back in my chair and fold my arms so the way they shake will not be visible.","\n","^\"You'd better get on with solving it, instead of wasting your time in here with me.\"","\n",{"->":".^.^.harrumphs"},null],"harrumphs":[["^Harris harrumphs. He's thinking it all over.","\n","ev","str","^Wait","/str",{"CNT?":".^.^.^.putmein"},"/ev",{"*":".^.c-0","flg":21},"ev","str","^Wait","/str",{"CNT?":".^.^.^.putmein"},"!","/ev",{"*":".^.c-1","flg":21},{"c-0":["^ ","\n","^\"All right,\" he declares, gruffly. \"We'll try it. But if this doesn't work, I might just put the both of you in front of a firing squad and be done with these games. Worse things happen in time of war, you know.\"","\n","^\"Alone,\" I add.","\n",{"->":".^.^.^.^.go_in_alone"},{"#f":5}],"c-1":["^ ","\n","^\"No,\" Harris declares, finally. \"I think you're lying about Hooper. I think you're a clever, scheming young man — that's why we hired you — and you're looking for the only reasonable out this situation has to offer. But I'm not taking it. We know you were in the room with the machine, we know you're of a perverted persuasion, we know you have compromised yourself. There's nothing more to say here. Either you tell me what you've done with that component, or we will hang you and search just as hard. It's your choice.\"","\n",{"->":"harris_threatens_lynching"},{"#f":5}]}],null],"go_in_alone":[["^\"Alone?\"","\n","^\"Alone.\"","\n","^Harris considers it. I watch his eyes, flicking backwards and forwards over mine, like a ribbon—reader loading its program.","\n","ev","str","^Patient","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Impatient","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ \"Well?\"","\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["^ \"For God's sake, man, what do you have to lose?\" ","\n","ev",{"^var":"forceful","ci":-1},{"f()":"raise"},"pop","/ev","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^\"We'll be outside the door,\" Harris replies, seriously. \"The first sign of any funny business and we'll have you both on the floor in minutes. You understand? The country needs your brain, but it's not too worried about your legs. Remember that.\"","\n","^Then he gets to his feet, and opens the door, and marches me out across the yard. The evening is drawing in and there's a chill in the air. My mind is racing. I have one opportunity here — a moment in which to put the fear of God into Hooper and make him do something foolish that places him in harm's way. But how to achieve it?","\n","^\"You ready?\" Harris demands.","\n","ev","str","^Yes","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^No","/str","/ev",{"*":".^.c-3","flg":20},"ev","str","^Lie","/str","/ev",{"*":".^.c-4","flg":20},{"c-2":["\n","^\"Absolutely.\"","\n",{"->":".^.^.^.g-1"},{"#f":5}],"c-3":["\n","^\"No.\"","\n","^\"Too bad.\"","\n",{"->":".^.^.^.g-1"},{"#f":5}],"c-4":["^ ",{"->":".^.^.c-2"},"\n",{"->":".^.^.^.g-1"},{"#f":5}]}],"g-1":[{"->":"inside_hoopers_hut"},null]}],null]}],"harris_takes_you_to_hooper":[["^Harris gets to his feet. \"All right,\" he says. \"I should no better than to trust a clever man, but we'll give it a go.\"","\n","^Then, he smiles, with all his teeth, like a wolf.","\n","ev",{"CNT?":"claim_hooper_took_component.0.g-1.hoopers_hut_3"},"/ev",[{"->":".^.b","c":true},{"b":["\n","^\"Especially since this is a plan that involves keeping you in handcuffs. I don't see what I have to lose.\"","\n",{"->":".^.^.^.9"},null]}],[{"->":".^.b"},{"b":["\n","^\"Hooper's in Hut 3 being debriefed by the Captain. Let's see if we can't get his attention somehow.\"","\n",{"->":".^.^.^.9"},null]}],"nop","\n","^He raps on the door for the guard and gives the man a quick instruction. He returns a moment later with a cool pair of iron cuffs.","\n","^\"Put 'em up,\" Harris instructs, and I do so. The metal closes around my wrists like a trap. I stand and follow Harris willingly out through the door.","\n","^But whatever I'm doing with my body, my mind is scheming. Somehow, I'm thinking, I have to get away from these men long enough to get that component behind Hut 2 and put it somewhere Hooper will go. Or, otherwise, somehow get Hooper to go there himself...","\n","^Harris marches me over to Hut 3, and gestures for the guard to stand aside. Pushing me forward, he opens the door nice and wide.","\n","^\"Captain. Manning talked. If you'd step out for a moment?\"","\n","ev","str","^Play the part, head down","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Look inside the hut","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Call to Hooper","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["\n","^From where he's sitting, I know Hooper can see me, so I keep my head down and look guilty as sin. The bastard is probably smiling.","\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["\n","^I look in through the door and catch Hooper's expression. I had half expected him to be smiling be he isn't. He looks shocked, almost hurt. \"Iain,\" he murmurs. \"You couldn't...\"","\n",{"->":".^.^.g-0"},{"#f":5}],"c-2":["^ ","\n","^I have a single moment to shout something to Hooper before the door closes.","\n","^\"I'll get you Hooper, you'll see!\" I cry. Then:","\n",[["ev",{"^->":"harris_takes_you_to_hooper.0.c-2.6.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^\"Queen to rook two, checkmate!\"",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"harris_takes_you_to_hooper.0.c-2.6.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"^ I call, then laugh viciously, as if I am damning him straight to hell.","\n","ev",2,"/ev",{"VAR=":"hooperClueType","re":true},{"->":".^.^.only_catch"},{"#f":5}],"only_catch":["^I only catch Hooper's reaction for a moment — his eyebrow lifts in surprise and alarm. Good. If he thinks it is a threat then he just might be careless enough to go looking for what it might mean.","\n",["ev",{"^->":"harris_takes_you_to_hooper.0.c-2.6.only_catch.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":18},{"s":["^\"Ask not for whom the bell tolls!\"",{"->":"$r","var":true},null]}],["ev",{"^->":"harris_takes_you_to_hooper.0.c-2.6.only_catch.3.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-2","flg":18},{"s":["^\"Two words: messy, without one missing!\"",{"->":"$r","var":true},null]}],{"c-1":["ev",{"^->":"harris_takes_you_to_hooper.0.c-2.6.only_catch.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],"\n","^He stares back at me, as if were a madman and perhaps for a split second I see him shudder.","\n",{"->":".^.^.^.^.^.g-0"},{"#f":5}],"c-2":["ev",{"^->":"harris_takes_you_to_hooper.0.c-2.6.only_catch.c-2.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.3.s"},[{"#n":"$r2"}],"^ I cry, laughing. It isn't the best clue, hardly worthy of The Times, but it will have to do.","\n","ev",3,"/ev",{"VAR=":"hooperClueType","re":true},{"->":".^.^"},{"->":".^.^.^.^.^.g-0"},{"#f":5}]}]}],{"#f":5}],"g-0":["^The Captain comes outside, pulling the door to. \"What's this?\" he asks. \"A confession? Just like that?\"","\n","^\"No,\" the Commander admits, in a low voice. \"I'm afraid not. Rather more a scheme. The idea is to let Hooper go and see what he does. If he believes we have Manning here in irons, he'll try to shift the component.\"","\n","^\"If he has it.\"","\n","^\"Indeed.\"","\n","^The Captain peers at me for a moment, like I was some kind of curious insect.","\n","^\"Sometimes, I think you people are magicians,\" he remarks. \"Other times you seem more like witches. Very well.\"","\n","^With that he opens the door to the Hut and goes back inside. The Commander uses the moment to hustle me roughly forward.","\n","ev",{"CNT?":".^.^.c-2"},"/ev",[{"->":".^.b","c":true},{"b":["\n","^\"And what was all that shouting about?\" he hisses in my ear as we move towards the barracks. \"Are you trying to pull something? Or just make me look incompetent?\"","\n",{"->":".^.^.^.19"},null]}],[{"->":".^.b"},{"b":["\n","^\"This scheme of yours had better come off,\" he hisses in my ear. \"Otherwise the Captain is going to start having men tailing me to see where I go on Saturdays.\"","\n",{"->":".^.^.^.19"},null]}],"nop","\n","ev","str","^Reassure","/str","/ev",{"*":".^.c-3","flg":20},"ev","str","^Dissuade","/str","/ev",{"*":".^.c-4","flg":20},"ev","str","^Evade","/str","/ev",{"*":".^.c-5","flg":20},"ev","str","^Say nothing","/str","/ev",{"*":".^.c-6","flg":20},{"c-3":["^ ","\n","ev",{"CNT?":".^.^.^.c-2"},"!","/ev",[{"->":".^.b","c":true},{"b":["\n","^\"It will. Hooper's running scared,\" I reply, hoping I sound more confident than I feel.","\n",{"->":".^.^.^.8"},null]}],[{"->":".^.b"},{"b":["\n","^\"Just adding to the drama,\" I tell him, confidently. \"I'm sure you can understand that.\"","\n",{"->":".^.^.^.8"},null]}],"nop","\n","^\"I think we've had enough drama today already,\" Harris replies. \"Let's hope for a clean kill.\"","\n",{"->":".^.^.^.g-1"},{"#f":5}],"c-4":["^ ","\n","ev",{"CNT?":".^.^.^.c-2"},"!","/ev",[{"->":".^.b","c":true},{"b":["\n","^\"The Captain thought it was a good scheme. You'll most likely get a promotion.\"","\n",{"->":".^.^.^.8"},null]}],[{"->":".^.b"},{"b":["\n","^\"I'm not trying to do anything except save my neck.\"","\n",{"->":".^.^.^.8"},null]}],"nop","\n","^\"Let's hope things work out,\" Harris agrees darkly.","\n",{"->":".^.^.^.g-1"},{"#f":5}],"c-5":["^ ","\n","^\"We're still in ear—shot if they let Hooper go. Best get us inside and then we can talk, if we must.\"","\n","^\"I've had enough of your voice for one day,\" Harris replies grimly. ","<>","\n",{"->":".^.^.^.g-1"},{"#f":5}],"c-6":["\n","^I let him have his rant. ","<>","\n",{"->":".^.^.^.g-1"},{"#f":5}]}],"g-1":["^He hustles me up the steps of the barracks, keeping me firmly gripped as if I had any chance of giving him, a trained military man, the slip. It's all I can do not to fall into the room.","\n",{"->":"slam_door_shut_and_gone"},null]}],null],"inside_hoopers_hut":[[["^Harris opens the door and pushes me inside. \"Captain,\" he calls. \"Could I have a moment?\"","\n","^The Captain, looking puzzled, steps out. The door is closed. Hooper stares at me, open—mouthed, about to say something. I probably have less than a minute before the Captain storms back in and declares this plan to be bunkum.","\n","ev","str","^Threaten","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Bargain","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Plead","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["\n","^\"Listen to me, Hooper. We were the only men in that hut today, so we know what happened. But I want you to know this. I put the component inside a breeze—block in the foundations of Hut 2, wrapped in one of your shirts. They're going to find it eventually, and that's going to be what tips the balance. And there's nothing you can do to stop any of that from happening.\"","\n","ev",1,"/ev",{"VAR=":"hooperClueType","re":true},"^His eyes bulge with terror. \"What did I do, to you? What did I ever do?\"","\n",["ev","str","^Tell the truth","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Lie","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Evade","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["^ ","\n","^\"You treated me like vermin. Like something abhorrent.\"","\n","^\"You are something abhorrent.\"","\n","^\"I wasn't. Not when I came here. And I won't be, once you're gone.\"","\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["^ ","\n","^\"Nothing,\" I reply. \"You're just the other man in the room. One of us has to get the blame.\"","\n",{"->":".^.^.g-0"},{"#f":5}],"c-2":["^ ","\n","^\"It doesn't matter. Just remember what I said. I've beaten you, Hooper. Remember that.\"","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^I get to my feet and open the door of the Hut. The Captain storms back inside and I'm quickly thrown out. ",{"->":".^.^.^.^.^.^.hustled_out"},"\n",null]}],{"#f":5}],"c-1":["^ ","\n","^\"Hooper, I'll make a deal with you. We both know what happened in that hut this afternoon. I know because I did it, and you know because you know you didn't. But once this is done I'll be rich, and I'll split that with you. I'll let you have the results, too. Your name on the discovery of the Bombe. And it won't hurt the war effort — you know as well as me that the component on its own is worthless, it's the wiring of the Bombe, the usage, that's what's valuable. So how about it?\"","\n","^Hooper looks back at me, appalled. \"You're asking me to commit treason?\"","\n",["ev","str","^Yes","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^No","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Lie","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^Evade","/str","/ev",{"*":".^.c-3","flg":20},{"c-0":["\n","^\"Yes, perhaps. But also to ensure your name goes down in the annals of mathematics. ",{"->":".^.^.^.^.^.^.back_of_hut_2"},"\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["^ ","\n","^\"No. It's not treason. It's a trade, plain and simple.\"","\n",{"->":".^.^.g-0"},{"#f":5}],"c-2":["^ ","\n","^\"I'm suggesting you save your own skin. I've wrapped that component in one of your shirts, Hooper. They'll be searching this place top to bottom. They'll find it eventually, and when they do, that's the thing that will swing it against you. So take my advice now. Hut 2.\"","\n","ev",1,"/ev",{"VAR=":"hooperClueType","re":true},{"->":".^.^.g-0"},{"#f":5}],"c-3":["^ ",{"->":".^.^.c-2"},"\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":[{"->":".^.^.^.^.^.^.no_chance"},null]}],{"#f":5}],"c-2":["^ ","\n","^\"Please, Hooper. You don't understand. They have information on me. I don't need to tell you what I've done, you know. Have a soul. And the component — it's nothing. It's not the secret of the Bombe. It's just a part. The German's think it's a weapon — a missile component. Let them have it. Please, man. Just help me.\"","\n","^\"Help you?\" Hooper stares. \"Help you? You're a traitor. A snake in the grass. And you're queer.\"","\n",["ev","str","^Deny","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Accept","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Evade","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["^ ","\n","^\"I'm no traitor. You know I'm not. How much work have I done here against the Germans? I've given my all. And you know as well as I do, if the Reich were to invade, I would be a dead man. Please, Hooper. I'm not doing any of this lightly.\"","\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["\n","^\"I am what I am,\" I reply. \"I'm the way I was made. But they'll hang me unless you help, Hooper. Don't let them hang me.\"","\n",{"->":".^.^.g-0"},{"#f":5}],"c-2":["^ ","\n","^\"That's not important now. What matters is what you do, this evening.\"","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^\"Assuming I wanted to help you,\" he replies, carefully. \"Which I don't. What would I do?\"","\n","^\"Nothing. Almost nothing.","\n",{"->":".^.^.^.^.^.^.back_of_hut_2"},null]}],{"#f":5}],"#n":"g-0"}],null],{"back_of_hut_2":["<>","^ All you have to do is go to the back of Hut 2. There's a breeze—block with a cavity. That's where I've put it. I'll be locked up overnight. But you can pick it up and pass it to my contact. He'll be at the south fence around two AM.\"","\n","ev",1,"/ev",{"VAR=":"hooperClueType","re":true},{"->":".^.^.no_chance"},{"#f":1}],"no_chance":["^\"If you think I'll do that then you're crazy,\" Hooper replies.","\n","^At that moment the door flies open and the Captain comes storming back inside.","\n",{"->":".^.^.hustled_out"},null],"hustled_out":["^Harris hustles me over to the barracks. \"I hope that's the end of it,\" he mutters.","\n","^\"Just be sure to let him out,\" I reply. \"And then see where he goes.\"","\n",{"->":"slam_door_shut_and_gone"},null]}],"slam_door_shut_and_gone":[["^Then they slam the door shut, and it locks.","\n","ev",{"VAR?":"hooperClueType"},0,"==","/ev",[{"->":".^.b","c":true},{"b":["\n","<>","^ How am I supposed to manage anything from in here?","\n","ev","str","^Try the door","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Try the windows","/str","/ev",{"*":".^.c-1","flg":20},{"->":".^.^.^.9"},{"c-0":["^ ",{"->":".^.^.^.^.^.try_the_door"},"\n",{"#f":5}],"c-1":["^ ",{"->":".^.^.^.^.^.try_the_windows"},"\n",{"#f":5}]}]}],[{"->":".^.b"},{"b":["\n","^I can only hope that Hooper bites. If he thinks I'm bitter enough to have framed him, and arrogant enough to have taunted him with ","ev",{"VAR?":"hooperClueType"},1,">","/ev",[{"->":".^.b","c":true},{"b":["^a clue to",{"->":".^.^.^.8"},null]}],"nop","^ where the damning evidence is hidden...","\n","^If he hates me enough, and is paranoid enough, then he might ","ev",{"VAR?":"hooperClueType"},1,">","/ev",[{"->":".^.b","c":true},{"b":["^unravel my little riddle and",{"->":".^.^.^.18"},null]}],"nop","^ go searching around Hut 2.","\n",{"->":".^.^.^.9"},null]}],"nop","\n","ev","str","^Wait","/str","/ev",{"*":".^.c-0","flg":20},{"c-0":["^ \t",{"->":"night_falls"},"\n",{"#f":5}]}],{"try_the_door":["^I try the door. It's locked, of course.","\n",{"->":".^.^.from_outside_heard"},{"#f":1}],"from_outside_heard":[["^From outside, I hear a voice. Hooper's. He's haranguing someone.","\n",["ev","str","^Listen at the keyhole","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Try the window","/str",{"CNT?":".^.^.^.^.try_the_windows"},"!","/ev",{"*":".^.c-1","flg":21},"ev","str","^Try the door","/str",{"CNT?":".^.^.^.^.try_the_door"},"!",{"CNT?":".^.c-0"},"&&","/ev",{"*":".^.c-2","flg":21},"ev","str","^Smash the window","/str",{"CNT?":".^.^.^.^.try_the_windows"},"/ev",{"*":".^.c-3","flg":21},"ev","str","^Wait","/str",{"CNT?":".^.^.^.^.try_the_door"},{"CNT?":".^.^.^.^.try_the_windows"},"&&","/ev",{"*":".^.c-4","flg":21},{"c-0":["^ ","\n","^I put my ear down to the keyhole, but there's nothing now. Probably still a guard outside, of course, but they're keeping mum.","\n",{"->":".^.^"},{"#f":5}],"c-1":["^ ",{"->":".^.^.^.^.^.try_the_windows"},"\n",{"#f":5}],"c-2":["^ ",{"->":".^.^.^.^.^.try_the_door"},"\n",{"#f":5}],"c-3":["^ ",{"->":".^.^.^.^.^.try_to_smash_the_window"},"\n",{"#f":5}],"c-4":["^ ","\n","^It's useless. There's nothing I can do but hope. I sit down on one corner of the bunk to wait.","\n",{"->":"night_falls"},{"#f":5}],"#n":"opts"}],null],null],"try_the_windows":["^I go over to the window and try to jimmy it open. Not much luck, but in my struggling I notice this window only backs on the thin little brook that runs down the back of the compound. Which means, if I smashed it, I might get away with no—one seeing.","\n",{"->":".^.^.from_outside_heard"},{"#f":1}],"try_to_smash_the_window":[["^The window is my only way out of here. I just need a way to smash it.","\n","ev","str","^Punch it","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Find something","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Use something you've got","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["^ ","\n","^I suppose my fist would do a good enough job. But I'd cut myself to ribbons, most likely. ","<>","\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["^ ","\n","ev",2,"/ev",{"VAR=":"smashingWindowItem","re":true},"^I cast around the small room. There's a bucket in one corner for emergencies — I suppose I could use that. I pick it up but it's not very easy to heft. ","<>","\n",{"->":".^.^.g-0"},{"#f":5}],"c-2":["^ ","\n","^I pat down my pockets but all I'm carrying is the intercept, which is no good at all.","\n",["ev","str","^Something you're wearing?","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Look around","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ ","\n","^Ah, but of course! I slip off one shoe and heft it by the toe. The heel will make a decent enough hammer, if I give it enough wallop.","\n","ev",1,"/ev",{"VAR=":"smashingWindowItem","re":true},"^But I'll cut my hand to ribbons doing it. ","<>","\n",{"->":".^.^.^.^.g-0"},{"#f":5}],"c-1":["^ ",{"->":".^.^.^.^.c-1"},"\n",{"->":".^.^.^.^.g-0"},{"#f":5}]}],{"#f":5}],"g-0":["^And the noise would be terrible. There must be a way of making this easier. I'm supposed to be a thief now. What would a burglar do?","\n","ev","str","^Work slowly","/str","/ev",{"*":".^.c-3","flg":20},"ev","str","^Find something to help","/str","/ev",{"*":".^.c-4","flg":20},{"c-3":["^ ","\n","^Work carefully? It's difficult to work carefully when all one's has is ","ev",{"VAR?":"smashingWindowItem"},2,"==","/ev",[{"->":".^.b","c":true},{"b":["^a bucket. It's rather like the sledgehammer for the proverbial nut",{"->":".^.^.^.10"},null]}],[{"->":".^.b"},{"b":["ev",{"VAR?":"smashingWindowItem"},1,"==","/ev",[{"->":".^.b","c":true},{"b":["^a shoe",{"->":".^.^.^.7"},null]}],[{"->":".^.b"},{"b":["^nothing but brute force",{"->":".^.^.^.7"},null]}],"nop",{"->":".^.^.^.10"},null]}],"nop","^.","\n",["ev","str","^Just do it","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Look around for something","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ ",{"->":".^.^.^.^.^.^.^.time_to_move_now"},"\n",{"->":".^.^.^.^.^.g-1"},{"#f":5}],"c-1":["^ ","\n",{"->":".^.^.^.^.^.g-1"},{"#f":5}]}],{"#f":5}],"c-4":["^ ","\n",{"->":".^.^.^.g-1"},{"#f":5}]}],"g-1":[{"->":".^.^.^.^.find_something_to_smash_window"},null]}],null],"time_to_move_now":[["^Enough of this. There isn't any time to lose. Right now they'll be following Hooper as he goes to bed, and goes to sleep; and then that's it. The minute he closes his eyelids and drifts off that's the moment that this trap swings shut on me.","\n","^So I punch out the glass with my ","ev",{"VAR?":"smashingWindowItem"},2,"==","/ev",[{"->":".^.b","c":true},{"b":["^bucket",{"->":".^.^.^.10"},null]}],[{"->":".^.b"},{"b":["ev",{"VAR?":"smashingWindowItem"},1,"==","/ev",[{"->":".^.b","c":true},{"b":["^shoe",{"->":".^.^.^.7"},null]}],[{"->":".^.b"},{"b":["^fist",{"->":".^.^.^.7"},null]}],"nop",{"->":".^.^.^.10"},null]}],"nop","^ and it shatters with a terrific noise. Then I stop, and wait, to see if anyone will come in through the door.","\n","^Nothing.","\n","ev","str","^Wait a little longer","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Clear the frame of shards","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ ","\n","^I pause for a moment longer. It doesn't do to be too careless...","\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["\n","^With my jacket wrapped round my arm, I sweep out the remaining shards of glass. It's not a big window, but I'm not a big man. If I was Harris, I'd be stuffed, but as it is...","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^Then the door locks turns. The door opens. Then Jeremy — one of the guards, rather — sticks his head through the door. \"I thought I heard...\"","\n","^He stops. Looks for a moment. ","ev",{"VAR?":"smashingWindowItem"},2,"==","/ev",[{"->":".^.b","c":true},{"b":["^Sees the bucket in my hand.",{"->":".^.^.^.10"},null]}],[{"->":".^.b"},{"b":["^Sees the broken window.",{"->":".^.^.^.10"},null]}],"nop","^ Then without a moment's further thought he blows his shrill whistles and hustles into the hut, grabbing me roughly by my arms.","\n","ev",{"CNT?":".^.^.c-0"},"/ev",[{"->":".^.b","c":true},{"b":["\n","^I'll never know if I hadn't have waited that extra moment — maybe I still could have got away. But, how far?","\n",{"->":".^.^.^.17"},null]}],"nop","\n","^I'm hustled into one of the huts. Nowhere to sleep, but they're not interested in my comfort any longer. Harris comes in with the Captain.","\n","^\"So,\" Harris remarks. \"Looks like your little trap worked. Only it worked to show you out for what you are.\"","\n","ev","str","^Tell the truth","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^Lie","/str","/ev",{"*":".^.c-3","flg":20},"ev","str","^Evade","/str","/ev",{"*":".^.c-4","flg":20},{"c-2":["^ ","\n","ev",{"CNT?":"i_met_a_young_man"},"/ev",[{"->":".^.b","c":true},{"b":["\n","^\"Please, Harris. You can't understand the pressure they put me under. You can't understand what it's like, to be in love but be able to do nothing about it...\"","\n",{"->":".^.^.^.7"},null]}],[{"->":".^.b"},{"b":["\n","^\"Harris. They were blackmailing me. They knew about... certain indiscretions. You can understand, can't you, Harris? I was in an impossible bind...\"","\n",{"->":".^.^.^.7"},null]}],"nop","\n",{"->":".^.^.^.g-1"},{"#f":5}],"c-3":["\n","^\"I had to get out, Harris. I had to provoke Hooper into doing something that would incriminate himself fully. He's too clever, you see...\"","\n",{"->":".^.^.^.g-1"},{"#f":5}],"c-4":["^ ","\n","^\"This proves nothing,\" I reply stubbornly. \"You still don't have the component and without it, I don't see what you can hope to prove.\"","\n",{"->":".^.^.^.g-1"},{"#f":5}]}],"g-1":["^\"Be quiet, man. We know all about your and your sordid affairs.\" The Captain curls his lip. \"Don't you know there's a war on? Do you know the kind of place they would have sent you if it haven't had been for that brain of yours? Don't you think you owe it to your country to use it a little more?\"","\n","^Do I, I wonder? Do I owe this country anything, this country that has spurned who and what am I since the day I became a man?","\n","ev","str","^Yes","/str","/ev",{"*":".^.c-5","flg":20},"ev","str","^No","/str","/ev",{"*":".^.c-6","flg":20},"ev","str","^Lie","/str","/ev",{"*":".^.c-7","flg":20},"ev","str","^Evade","/str","/ev",{"*":".^.c-8","flg":20},{"c-5":["^ ","\n","^My anger deflates like a collapsing equation, all arguments cancelling each other out. The world, of course, owes me nothing; and I owe it everything.","\n",{"->":".^.^.^.g-2"},{"#f":5}],"c-6":["^ ","\n","^Of course not. I am alone; that is what they wanted me to be, because of who and what I love. So I have no nation, no country.","\n",{"->":".^.^.^.g-2"},{"#f":5}],"c-7":["^ \t",{"->":".^.^.c-6"},"\n",{"->":".^.^.^.g-2"},{"#f":5}],"c-8":["^ \t","\n","^But what is a country, after all? A country is not a concept, not an ideal. Every country falls, its borders shift and move, its language disappears to be replaced by another. Neither the Reich nor the British Empire will survive forever, so what use is my loyalty to either? ","\n","^I may as well, therefore, look after myself. Something I have attempted, but failed miserably, to do.","\n",{"->":".^.^.^.g-2"},{"#f":5}]}],"g-2":["^\"I'm afraid we have only one option, Manning,\" Harris says. \"Please, man. Tell us where the component is.\"","\n","ev",true,"/ev",{"VAR=":"notraitor","re":true},"ev",false,"/ev",{"VAR=":"losttemper","re":true},"ev","str","^Tell them","/str","/ev",{"*":".^.c-9","flg":20},"ev","str","^Say nothing","/str","/ev",{"*":".^.c-10","flg":20},{"c-9":["\n","ev",false,"/ev",{"VAR=":"revealedhooperasculprit","re":true},"^\"All right.\" I am beaten, after all. \"","<>",{"->":"reveal_location_of_component"},"\n",{"#f":5}],"c-10":["^ ",{"->":"my_lips_are_sealed"},"\n",{"#f":5}]}]}],{"#f":1}],"find_something_to_smash_window":[["^Let me see. There's the bunk, ","ev",{"VAR?":"smashingWindowItem"},"!",2,"==","/ev",[{"->":".^.b","c":true},{"b":["^a bucket,",{"->":".^.^.^.8"},null]}],"nop","^ nothing else. I have my jacket but nothing in the pockets — no handkerchief, for instance.","\n",["ev","str","^The bunk","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^The jacket","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^The bucket","/str",{"VAR?":"smashingWindowItem"},"!",2,"==","/ev",{"*":".^.c-2","flg":21},{"c-0":["^ \t","\n","^The bunk has a solid metal frame, a blanket, a pillow, nothing more.","\n",[["ev","str","^The frame","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^The blanket","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^The pillow","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^Something else","/str",{"CNT?":".^"},1,">","/ev",{"*":".^.c-3","flg":21},{"c-0":["\n","^The frame is heavy and solid. I couldn't lift it or shift it without help from another man. And it wouldn't do me any good here anyway. I can reach the window perfectly well.","\n",{"->":".^.^"},{"#f":5}],"c-1":["^ ","\n","^The blanket. Perfect. I scoop it up off the bed and hold it in place over the window. ",{"->":"smash_the_window"},"\n",{"#f":5}],"c-2":["^ ","\n","^The pillow is fat and fluffy. I could put it over the window and it would muffle the sound of breaking glass, certainly; but I wouldn't be able to break any glass through it either.","\n",{"->":".^.^"},{"#f":5}],"c-3":["^ ",{"->":".^.^.^.^.^"},"\n",{"#f":5}],"#f":5,"#n":"bunk_opts"}],null],{"#f":5}],"c-1":["^ ","\n","^I slip off my jacket and hold it with one hand over the glass. ",{"->":"smash_the_window"},"\n",{"#f":5}],"c-2":["^ ","\n","^The bucket? Hardly. The bucket might do some good if I wanted to sweep up the glass afterwards, but it won't help me smash the glass quietly.","\n",{"->":".^.^"},{"#f":5}],"#n":"opts"}],null],null]}],"smash_the_window":[["^Then I heft ","ev",{"VAR?":"smashingWindowItem"},2,"==","/ev",[{"->":".^.b","c":true},{"b":["^up the bucket — this really is quite a fiddly thing to be doing in cuffs — ",{"->":".^.^.^.8"},null]}],[{"->":".^.b"},{"b":["ev",{"VAR?":"smashingWindowItem"},1,"==","/ev",[{"->":".^.b","c":true},{"b":["^ my shoe by its toe, ",{"->":".^.^.^.7"},null]}],[{"->":".^.b"},{"b":["^back my arm, ",{"->":".^.^.^.7"},null]}],"nop",{"->":".^.^.^.8"},null]}],"nop","^ and take a strong swing, trying to imagine it's Harris' face on the other side.","\n","ev",true,"/ev",{"VAR=":"smashedglass","re":true},"ev",0,"/ev",{"VAR=":"smashingWindowItem","re":true},"ev","str","^Smash!","/str","/ev",{"*":".^.c-0","flg":20},{"c-0":["\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^The sound of the impact is muffled. With my arm still covered, I sweep out the remaining glass in the frame.","\n",["^I'm ready to escape. The only trouble is — when they look in on me in the morning, there will be no question what has happened. It won't help me one jot with shifting suspicion off my back.","\n","ev","str","^Wait","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Slip out","/str","/ev",{"*":".^.c-2","flg":20},{"c-1":["\n","^So perhaps I should wait it out, after all. Who knows? I might have a better opportunity later.","\n",{"->":"night_passes"},{"->":".^.^.^.^.g-2"},{"#f":5}],"c-2":["^ ","\n","^Moving quickly and quietly, I hoist myself up onto the window—frame and worm my way outside into the freezing night air. Then I am away, slipping down the paths between the Huts, sticking to the shadows, on my way to Hut 2.","\n",{"->":".^.^.^.^.g-2"},{"#f":5}],"#n":"g-1"}],null],"g-2":["ev","str","^Go the shortest way","/str","/ev",{"*":".^.c-3","flg":20},"ev","str","^Take a longer route","/str","/ev",{"*":".^.c-4","flg":20},{"c-3":["^ ","\n","^There's no time to lose. Throwing caution to the wind I make my way quickly to Hut 2, and around the back. I don't think I've been seen but if I have it is too late. My actions are suspicious enough for the noose. I have no choice but to follow through.","\n",{"->":".^.^.^.g-3"},{"#f":5}],"c-4":["\n","^In case I'm being followed, I divert around the perimeter of the compound. It's a much longer path, and it takes me across some terrain that's difficult to negotiate in the dark — muddy, and thick with thistles and nestles.","\n","ev",true,"/ev",{"VAR=":"muddyshoes","re":true},"^Still, I can be confident no—one is behind me. I crouch down behind the rear wall of Hut 2. ","<>","\n",{"->":".^.^.^.g-3"},{"#f":5}]}],"g-3":["^The component is still there, wrapped in a tea—towel and shoved into a cavity in a breeze—block at the base of the Hut wall.","\n","ev","str","^Take it","/str","/ev",{"*":".^.c-5","flg":20},"ev","str","^Leave it","/str","/ev",{"*":".^.c-6","flg":20},{"c-5":["^ ","\n","^Quickly, I pull it free, and slip it into the pocket of my jacket.","\n","ev",true,"/ev",{"VAR=":"gotcomponent","re":true},{"->":".^.^.^.g-4"},{"#f":5}],"c-6":["^ ","\n","^Still there means no—one has found it, which means it is probably well—hidden. And short of skipping the compound now, I can afford to leave it hidden there a while longer. So I leave it in place.","\n",{"->":".^.^.^.g-4"},{"#f":5}]}],"g-4":["^Where now?","\n","ev","str","^Back to the barracks","/str","/ev",{"*":".^.c-7","flg":20},"ev","str","^Go to Hooper's dorm","/str",{"VAR?":"gotcomponent"},"/ev",{"*":".^.c-8","flg":21},"ev","str","^Escape the compound","/str","/ev",{"*":".^.c-9","flg":20},{"c-7":["^ ",{"->":"return_to_room_after_excursion"},"\n",{"#f":5}],"c-8":["^ ",{"->":"go_to_hoopers_dorm"},"\n",{"#f":5}],"c-9":["^ ","\n","^Enough of this place. Time for me to get moving. I can get to the train station on foot, catch the postal train to Scotland and be somewhere else before anyone realises that I'm gone.","\n","^Of course, then they'll be looking for me in earnest. ","ev",{"VAR?":"framedhooper"},"!","/ev",[{"->":".^.b","c":true},{"b":["^As a confirmed traitor.",{"->":".^.^.^.11"},null]}],[{"->":".^.b"},{"b":["^Perhaps not as a traitor — they might take the idea that Hooper was involved with the theft — but certainly as a valuable mind, one containing valuable secrets and all too easily threatened. They will think I am running away because of my indiscretions. I suppose, in fairness, that I am.",{"->":".^.^.^.11"},null]}],"nop","\n",["ev","str","^Go","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Don't go","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ \t\t\t",{"->":"live_on_the_run"},"\n",{"#f":5}],"c-1":["^ ","\n","^It's no good. That's only half a solution. I couldn't be happy with that.","\n",["ev","str","^Back to the barracks","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^To Hooper's dorm","/str",{"VAR?":"gotcomponent"},{"CNT?":"go_to_hoopers_dorm"},"!","&&","/ev",{"*":".^.c-1","flg":21},{"c-0":["^ \t\t\t",{"->":"return_to_room_after_excursion"},"\n",{"#f":5}],"c-1":["^ ",{"->":"go_to_hoopers_dorm"},"\n",{"#f":5}]}],{"#f":5}]}],{"#f":5}]}]}],null],"go_to_hoopers_dorm":[["^I creep around the outside of the huts towards Hooper's dorm. Time to wrap up this little game once and for all. A few guards patrol the area at night but not many — after all, very few know this place even exists.","\n","^Our quarters are arranged away from the main house; where we sleep is of less importance than where we work. We each have our own hut, through some are less permanent than others. Hooper's is a military issue tent: quite a large canopy, with two rooms inside and a short porch area where he insists people leave their shoes. It's all zipped up for the night and no light shines from inside.","\n","^I hang back for a moment. If Harris is keeping to the terms of our deal then someone will be watching this place. But I can see no—one.","\n","ev","str","^Open the outer zip","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Look for another opening","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Hide the component somewhere","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["^ ","\n","^I creep forward to the tent, intent on lifting the zip to the front porch area just a little — enough to slip the component inside, and without the risk of the noise waking Hooper from his snoring.","\n","^The work is careful, and more than little fiddly — Hooper has tied the zips down on the inside, the fastidious little bastard! — but after a little work I manage to make a hole large enough for my hand.","\n",["ev","str","^Slip in the component","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^No, some other way","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ \t\t","\n","^I slide the component into the tent, work the zip closed, and move quickly away into the shadows. It takes a few minutes for my breath to slow, and my heart to stop hammering, but I see no other movement. If anyone is watching Hooper's tent, they are asleep at their posts.","\n","ev",true,"/ev",{"VAR=":"putcomponentintent","re":true},"ev",false,"/ev",{"VAR=":"gotcomponent","re":true},{"->":"return_to_room_after_excursion"},{"#f":5}],"c-1":["^ \t\t\t","\n","^Then pause. This is too transparent. Too blatant. If I leave it here, like this, Hooper will never be seen to go looking for it: he will stumble over it in plain sight, and the men watching will wonder why it was not there when he went to bed.","\n","^No, I must try something else — or nothing at all.","\n",["ev","str","^On top of the tent","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Throw the component into the long grass","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Give up","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["^ ",{"->":".^.^.^.^.^.^.^.put_component_on_tent"},"\n",{"#f":5}],"c-1":["^ ","\n","^From inspiration — or desperation, I am not certain — a simple approach occurs to me. ",{"->":".^.^.^.^.^.^.^.toss_component_into_bushes"},"\n",{"#f":5}],"c-2":["^ ","\n","^There is nothing to be gained here. I have the component now; maybe it will be of some value tomorrow.","\n",["ev","str","^Return to my barrack","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Escape the compound","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ ",{"->":"return_to_room_after_excursion"},"\n",{"#f":5}],"c-1":["^ ",{"->":"live_on_the_run"},"\n",{"#f":5}]}],{"#f":5}]}],{"#f":5}]}],{"#f":5}],"c-1":["^ ","\n","^Making a wide circuit I creep around the tent. It has plenty of other flaps and openings, tied down with Gordian complexity. But nothing afford itself to slipping the component inside.","\n",["ev","str","^Try the porch zip","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Try on top of the tent","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Give up","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["^ \t\t\t",{"->":".^.^.^.^.c-0"},"\n",{"#f":5}],"c-1":["^ \t\t",{"->":".^.^.^.^.^.put_component_on_tent"},"\n",{"#f":5}],"c-2":["^ \t\t\t\t\t\t","\n","^It's no good. Nothing I can do will be any less than obvious — something appearing where something was not there before. The men watching Hooper will know it is a deception and Hooper's protestations will be taken at face value.","\n","^If I can't find a way for Hooper to pick the component up, as if from a hiding place of his own devising, and be caught doing it, then I have no plan at all.","\n",["ev","str","^Return to my barrack","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Escape the compound","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Toss the component into the bushes","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["^ ",{"->":"return_to_room_after_excursion"},"\n",{"#f":5}],"c-1":["^ ",{"->":"live_on_the_run"},"\n",{"#f":5}],"c-2":["^ ",{"->":".^.^.^.^.^.^.^.toss_component_into_bushes"},"\n",{"#f":5}]}],{"#f":5}]}],{"#f":5}],"c-2":["^ ","\n","^If I leave the component here somewhere it should be somewhere I can rely on Hooper finding it, but no—one before Hooper. In particular.","\n",["ev","str","^Behind the tent","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Inside the porch section","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^On top of the canvas","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["^\t\t\t \t",{"->":".^.^.^.^.c-1"},"\n",{"#f":5}],"c-1":["^ \t\t",{"->":".^.^.^.^.c-0"},"\n",{"#f":5}],"c-2":["^ \t\t\t",{"->":".^.^.^.^.^.put_component_on_tent"},"\n",{"#f":5}]}],{"#f":5}]}],{"put_component_on_tent":["^A neat idea strikes me. If I could place it on top of the canvas, somewhere in the middle where it would bow the cloth inwards, then it would be invisible to anyone passing by. But to Hooper, it would be above him: a shadow staring him in the face as he awoke. What could be more natural than getting up, coming out, and looking to see what had fallen on him during the night?","\n","^It's the work of a moment. I was once an excellent bowler for the second XI back at school. This time I throw underarm, of course, but I still land the vital missing component exactly where I want it to go.","\n","ev",true,"/ev",{"VAR=":"framedhooper","re":true},"ev",false,"/ev",{"VAR=":"gotcomponent","re":true},"^For a second I hold my breath, but nothing and no—one stirs. ",{"->":"return_to_room_after_excursion"},"\n",null],"toss_component_into_bushes":["^I toss the component away into the bushes behind Hooper's tent and return to my barrack, wishing myself a long sleep followed by a morning, free of this business.","\n","ev",false,"/ev",{"VAR=":"gotcomponent","re":true},"ev",true,"/ev",{"VAR=":"throwncomponentaway","re":true},{"->":"return_to_room_after_excursion"},null],"#f":1}],"live_on_the_run":["^Better to live on the run than die on the spit. Creeping around the edge of the compound","ev",{"VAR?":"gotcomponent"},"/ev",[{"->":".^.b","c":true},{"b":["^, the Bombe component heavy in my pocket",{"->":".^.^.^.5"},null]}],"nop","^, I make my way to the front gate. As always, it's manned by two guards, but I slip past their box by crawling on my belly.","\n","^And then I'm on the road. Walking, not running. Silent. Free.","\n","^For the moment, at least.","\n","end",null],"return_to_room_after_excursion":[["ev",{"VAR?":"gotcomponent"},"/ev",[{"->":".^.b","c":true},{"b":["^The weight of the Bombe component safely in my jacket",{"->":".^.^.^.5"},null]}],[{"->":".^.b"},{"b":["^Satisfied",{"->":".^.^.^.5"},null]}],"nop","^, I return the short way up the paths between the huts to the barrack block and the broken window.","\n","^It's a little harder getting back through — the window is higher off the ground than the floor inside — but after a decent bit of jumping and hauling I manage to get my elbows up, and then one leg, and finally I collapse inside, quite winded and out breath.","\n","ev","str","^Wait","/str","/ev",{"*":".^.c-0","flg":20},{"c-0":["^ \t",{"->":"night_passes"},"\n",{"#f":5}]}],null],"night_passes":[["^The rest of the night passes slowly. I sleep a little, dozing mostly. Then I'm woken by the rooster in the yard. The door opens, and Harris comes in. He takes one look at the broken window and frowns with puzzlement.","\n","ev",{"VAR?":"putcomponentintent"},"/ev",[{"->":".^.b","c":true},{"b":["^ ",{"->":".^.^.^.^.put_component_inside_tent"},{"->":".^.^.^.6"},null]}],"nop","\n","^\"What happened there?\"","\n","ev","str","^Confess","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Deny","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Show him the component","/str",{"VAR?":"gotcomponent"},"/ev",{"*":".^.c-2","flg":21},{"c-0":["^ ","\n","^\"I broke it,\" I reply. There doesn't seem any use in trying to lie. \"I thought I could escape. But I couldn't get myself through.\"","\n","^The Commander laughs. ",{"->":".^.^.^.glad_youre_here"},"\n",{"#f":5}],"c-1":["^ ","\n","^\"I'm not sure. I was asleep: I woke up when someone broke the window. I looked out to see who it was, but they were already gone.\"","\n","^Harris looks at me with puzzlement. \"Someone came by to break the window, and then ran off? That's absurd. That's utterly absurd. Admit it, Manning. You tried to escape and you couldn't get through.\"","\n",["ev","str","^Admit it","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Deny it","/str",{"VAR?":"framedhooper"},"!","/ev",{"*":".^.c-1","flg":21},"ev","str","^Deny it","/str",{"VAR?":"framedhooper"},"/ev",{"*":".^.c-2","flg":21},{"c-0":["\n","^\"All right. ","ev",{"VAR?":"forceful"},1,">","/ev",[{"->":".^.b","c":true},{"b":["^Damn you.",{"->":".^.^.^.8"},null]}],"nop","^ That's exactly it.\"","\n",{"->":".^.^.^.^.^.glad_youre_here"},{"#f":5}],"c-1":["\n","^\"If I wanted to escape, I would have made damn sure that I could,\" I tell him sternly.","\n",{"->":"harris_certain_is_you"},{"#f":5}],"c-2":["^ ","\n","^\"I tell you, someone broke it. Someone wanted to threaten me, I think.\"","\n","^Harris shakes his head. \"Well, we can look into that matter later. For now, you probably want to hear the more pressing news. ",{"->":".^.^.^.^.^.found_missing_component"},"\n",{"#f":5}]}],{"#f":5}],"c-2":["^ ",{"->":".^.^.^.someone_threw_component"},"\n",{"#f":5}]}],{"put_component_inside_tent":[["^He takes one look around, and sighs, a deep, wistful sigh.","\n","^\"Things just get worse and worse for you, Manning,\" he remarks. \"You are your own worst enemy.\"","\n","ev","str","^Agree","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Disagree","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Evade","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["^ ","\n","^\"I've thought so before.\" ","ev",{"VAR?":"admitblackmail"},"/ev",[{"->":".^.b","c":true},{"b":["^Certainly in the matter of getting blackmailed.",{"->":".^.^.^.7"},null]}],"nop","\n","^\"Let me tell you what happened this morning. ","<>","\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["\n","^\"Right now, I think you take that role, Harris,\" I reply coolly.","\n",[["^\"Very droll,\" he replies. \"Let me tell you what happened this morning. It will take the smile off your face. ","<>","\n",{"->":".^.^.^.^.g-0"},{"#n":"droll"}],null],{"#f":5}],"c-2":["^ ","\n","^\"I'm looking forward to having a wash and a change of clothes; which should make me a little less evil to be around.\"","\n",{"->":".^.^.c-1.3.droll"},{"->":".^.^.g-0"},{"#f":5}],"g-0":["^Our men watching Hooper's tent saw Hooper wake up, get dressed, clamber out of his tent and then step on something in at the entrance of his tent.\"","\n","ev",true,"/ev",{"VAR=":"piecereturned","re":true},"ev","str","^Be interested","/str","/ev",{"*":".^.c-3","flg":20},"ev","str","^Be dismissive","/str","/ev",{"*":".^.c-4","flg":20},"ev","str","^Say nothing","/str","/ev",{"*":".^.c-5","flg":20},{"c-3":["^ ","\n","^\"You mean he didn't even hide it? He put it in his shoe?\"","\n",[["^\"No,\" Harris replies. \"That isn't really what I mean. ","<>","\n",{"->":".^.^.^.^.^.g-1"},{"#n":"not_that"}],null],{"#f":5}],"c-4":["\n","^\"So he's an idiot, and he hid it in his shoe.\"","\n",{"->":".^.^.c-3.4.not_that"},{"->":".^.^.^.g-1"},{"#f":5}],"c-5":["^ ","\n","^I say quiet, listening, not sure how this will go.","\n","^\"In case I'm not making myself clear,\" Harris continues, \"","<>","\n",{"->":".^.^.^.g-1"},{"#f":5}]}],"g-1":["^I mean, he managed to find it, by accident, somewhere where it wasn't the night before. And at the same time, you're sitting here with your window broken. So, I rather think you've played your last hand and lost. It's utterly implausible that Hooper stole that component and then left it lying around in the doorway of his tent. So I came to tell you that the game is up, for you.\"","\n","^He nods and gets to his feet. ",{"->":"left_alone"},"\n",null]}],null],"someone_threw_component":[["^\"Someone threw this in through the window over night,\" I reply, and open my jacket to reveal the component from the Bombe. \"I couldn't see who, it was too dark. But I know what it is.\"","\n","^He reaches out and takes it. \"Well, I'll be damned,\" he murmurs. \"That's it all right. And you didn't have it on you when we put you in here. But it can't have been Hooper — I had men watching him all night. And there's no—one else it could have been.\"","\n","^He turns the component over in his hands, bemused.","\n","ev",true,"/ev",{"VAR=":"piecereturned","re":true},"ev","str","^Suggest something","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Suggest nothing","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ ","\n","^\"Perhaps Hooper had an accomplice. Someone else who works on site.\"","\n","^Harris shakes his head, distractedly. \"That doesn't make sense,\" he says. \"Why go to all the trouble of stealing it only to give it back? And why like this?\"","\n",["ev","str","^Suggest something","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Suggest nothing","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ ","\n","^\"Perhaps the accomplice thought it was Hooper being kept in here. Maybe they saw the guard...\"","\n",{"->":"all_too_farfetched"},{"->":".^.^.^.^.g-0"},{"#f":5}],"c-1":["^ ","\n",{"->":".^.^.^.^.g-0"},{"#f":5}]}],{"#f":5}],"c-1":["^ ","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^I shrug, eloquently.","\n",[{"->":"all_too_farfetched"},{"#n":"g-1"}],null]}],null],"glad_youre_here":[["^\"Shame,\" he remarks. \"I should have left that window open and put a guard on you. Might have been interesting to see where you went. Anyway, I'm glad you're still here, even if you do smell like a dog.\"","\n","ev","str","^Be optimistic","/str",{"VAR?":"framedhooper"},"!","/ev",{"*":".^.c-0","flg":21},"ev","str","^Be pessimistic","/str",{"VAR?":"framedhooper"},"!","/ev",{"*":".^.c-1","flg":21},"ev","str","^Be optimistic","/str",{"VAR?":"framedhooper"},"/ev",{"*":".^.c-2","flg":21},"ev","str","^Be pessimistic","/str",{"VAR?":"framedhooper"},"/ev",{"*":".^.c-3","flg":21},{"c-0":["^ ","\n",{"->":"night_falls.morning_not_saved.0.c-0"},{"->":".^.^.g-0"},{"#f":5}],"c-1":["^ ","\n",{"->":"night_falls.morning_not_saved.0.c-1"},{"->":".^.^.g-0"},{"#f":5}],"c-2":["^ ","\n","^\"I'm looking forward to having a bath.\"","\n","^\"Well, you should enjoy it. ","<>","\n",{"->":".^.^.g-0"},{"#f":5}],"c-3":["\n","^\"I imagine I'll smell worse after another couple of days of this.\"","\n","^\"That won't be necessary. ","<>","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":[{"->":".^.^.^.^.found_missing_component"},null]}],null],"found_missing_component":[["^We found the missing component. Or rather, Hooper found it for us. He snuck out and retrieved it from on top. Of all the damnest places — you would never have known it was there. He claimed ignorance when we jumped him, of course. But it's good enough for me.\"","\n","ev","str","^Approve","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Disapprove","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["\n","^\"I can't tell you enough, I'm glad to hear it. I've had a devil of a night.\"","\n","^His gaze flicks to the broken window, but only for a moment. I think he genuinely cannot believe I could have done it.","\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["^ ","\n","^\"You should never have hired him. A below-average intelligence can't be expected to cope with the pressure of our work.\"","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^Harris rolls his eyes, but he might almost be smiling. \"You'd better get along, ","ev",{"CNT?":".^.^.c-0"},"/ev",[{"->":".^.b","c":true},{"b":["^and work through your devils",{"->":".^.^.^.6"},null]}],[{"->":".^.b"},{"b":["^Mr Intelligent",{"->":".^.^.^.6"},null]}],"nop","^. There's a 24—hour—late message to be tackled and we're a genius short. So you'd better be ready to work twice as hard.\"","\n","ev","str","^Thank him","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^Argue with him","/str","/ev",{"*":".^.c-3","flg":20},{"c-2":["^ \t","\n","^\"I'll enjoy it. Thank you for helping me clear this up.\"","\n","^\"Don't thank me yet. There's still a war to fight. Now get a move on.\"","\n","^I nod, and hurry out of the door. The air outside has never tasted fresher and more invigorating. ","<>","\n",{"->":".^.^.^.g-1"},{"#f":5}],"c-3":["^ ","\n","^\"I'll work as hard as I work.\"","\n","^\"Get out,\" Harris growls. \"Before I decide to arrest you as an accessory.\"","\n","^I do as he says. Outside the barrack, the air has never smelt sweeter.","\n",{"->":".^.^.^.g-1"},{"#f":5}]}],"g-1":[{"->":"head_for_my_dorm_free"},null]}],null]}],"night_falls":[["^Night falls. The clockwork of the heavens keeps turning, whatever state I might be in. No—one can steal the components that make the sun go down and the stars come out. I watch it performing its operations. I can't sleep.","\n","ev",{"VAR?":"hooperClueType"},0,">","/ev",[{"->":".^.b","c":true},{"b":["\n","^Has Hooper taken my bait?","\n",{"->":".^.^.^.8"},null]}],"nop","\n","ev","str","^Look of out the window","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Listen at the door","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Wait","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["^ ","\n","^I peer out of the window, but it looks out onto the little brook at the back of the compound, with no view of the other huts or the House. Who knows if there are men up, searching the base of Hut 2, following one another with flashlights...","\n","ev",{"CNT?":"inside_hoopers_hut.back_of_hut_2"},"/ev",[{"->":".^.b","c":true},{"b":["\n","^Perhaps Hooper is there, in the dark, trying to help me after all?","\n",{"->":".^.^.^.8"},null]}],"nop","\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["^ \t","\n","^I put my ear to the keyhole but can make out nothing. Are there still guards posted? ","ev",{"VAR?":"hooperClueType"},0,">","/ev",[{"->":".^.b","c":true},{"b":["^Perhaps, if Hooper has managed to incriminate himself, the guards have been removed?",{"->":".^.^.^.10"},null]}],[{"->":".^.b"},{"b":["^Perhaps the component has been found and the crisis is over.",{"->":".^.^.^.10"},null]}],"nop","\n","^Perhaps the door is unlocked and they left me to sleep?","\n",["ev","str","^Try it","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Leave it","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ I try the handle. No such luck.","\n",{"->":".^.^.^.^.g-0"},{"#f":5}],"c-1":["^ I don't touch it. I don't want anyone outside thinking I'm trying to escape.","\n",{"->":".^.^.^.^.g-0"},{"#f":5}]}],{"#f":5}],"c-2":["^ \t\t\t\t\t","\n","^There is nothing I can do to speed up time.","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^The night moves at its own pace. I suppose by morning I will know my fate.","\n","ev","str","^Wait","/str",{"VAR?":"hooperClueType"},0,">","/ev",{"*":".^.c-3","flg":21},"ev","str","^Wait","/str",{"VAR?":"hooperClueType"},0,"==","/ev",{"*":".^.c-4","flg":21},{"c-3":["^ ","\n","^Morning comes. I'm woken by a rooster calling from the yard behind the House. I must have slept after all. I pull myself up from the bunk, shivering slightly. There is condensation on the inside of the window. I have probably given myself a chill.","\n","^Without knocking, Harris comes inside. \"You're up,\" he remarks, and then, \"You smell like an animal.\"","\n",["ev","str","^Be friendly","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Be cold","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ ","\n","^\"I suppose I do rather.\" I laugh, but Harris does not.","\n","^\"This damn business gets worse and worse,\" he says, talking as he goes over to unlock and throw open the window. ","<>","\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["^ ","\n","^\"So would you,\" I reply tartly. Harris shrugs.","\n","^\"I've been through worse than this,\" he replies matter—of—factly. \"It's hardly my fault if you sleep in your clothes.\"","\n","^I glare back. He goes over to the window, unlocks it and throws it open, relishing the fresh air from outside.","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^\"Hooper's confessed, you know.\"","\n","ev","str","^Be eager","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^Be cautious","/str","/ev",{"*":".^.c-3","flg":20},{"c-2":["^ ","\n","^\"He has? I knew he would. The worm.\"","\n","^\"Steady now. Matters aren't over yet. ","<>","\n",{"->":".^.^.^.hooper_didnt_give_himself_up"},{"#f":5}],"c-3":["^ ","\n","^\"Oh, yes?\"","\n","^\"Yes. For what that's worth. ","<>","\n",{"->":".^.^.^.hooper_didnt_give_himself_up"},{"#f":5}]}],"hooper_didnt_give_himself_up":["^There's still the issue of the component. It hasn't turned up. He didn't lead us to it. I guess he figured you must have had something on him. I don't know.\"","\n","^He looks quite put out by the whole affair. He is not the kind of man to deal well with probabilities.","\n","ev","str","^Be interested","/str","/ev",{"*":".^.c-4","flg":20},"ev","str","^Be disinterested","/str","/ev",{"*":".^.c-5","flg":20},{"c-4":["^ ","\n","^\"You mean he confessed of his own accord? You didn't catch him?\"","\n",{"->":".^.^.^.g-1"},{"#f":5}],"c-5":["^ ","\n","^\"Well, I'm glad his conscience finally caught up with him,\" I reply dismissively.","\n",{"->":".^.^.^.g-1"},{"#f":5}],"#f":5}],"g-1":["^\"The Captain went back into that hut and he confessed immediately. We were so surprised we didn't let you go.\" He wrinkles his nose. \"I'm rather sorry about that now. I suggest you have a wash.\"","\n","^And with that he gestures to the doorway.","\n","ev","str","^Go","/str","/ev",{"*":".^.c-6","flg":20},"ev","str","^Wait","/str","/ev",{"*":".^.c-7","flg":20},{"c-6":["^ ","\n",{"->":".^.^.^.g-2"},{"#f":5}],"c-7":["^ ","\n","^I hang back a moment. Something does not seem quite right. After all, Hooper did not steal the component. He has no reason to confess to anything. Perhaps this is another trap?","\n","^\"Well?\" Harris asks. \"What are you waiting for? Please don't tell me you want to confess now as well, I don't think my head could stand it.\"","\n",["ev","str","^Confess","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Don't confess","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ ","\n","^After a chance like this? A chance — however real — to save my neck? To hand it over — what, to save Hooper's worthless skin?","\n",["ev","str","^Confess","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Don't confess","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ ","\n","^I see. Perhaps you think I bullied the man into giving himself up. Perhaps he understood my little clue far enough to know it was a threat against him, but not well enough to understand where he should look to find it. So he took the easy route out and folded. Gave me the hand.","\n","ev",true,"/ev",{"VAR=":"hooperConfessed","re":true},"^Hardly sporting, of course.","\n",["ev","str","^Confess","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Don't confess","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["\n","^Well, then. I suppose this must be what it feels like to have a conscience. I suppose I had always wondered.","\n","^\"Harris, sir. I don't know what Hooper's playing at, sir. But I can't let him do this.\"","\n","^\"Do what?\"","\n","^\"Take the rope for this. I took it, sir.","\n","ev",false,"/ev",{"VAR=":"revealedhooperasculprit","re":true},"ev",false,"/ev",{"VAR=":"losttemper","re":true},{"->":"reveal_location_of_component"},{"->":".^.^.^.^.^.^.g-0"},{"#f":5}],"c-1":["^ ","\n",{"->":".^.^.^.^.^.^.g-0"},{"#f":5}]}],{"#f":5}],"c-1":["^ ","\n",{"->":".^.^.^.^.g-0"},{"#f":5}]}],{"#f":5}],"c-1":["^ ","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^\"I certainly don't. But still, I'm surprised. I had Hooper down for a full—blown double agent, a traitor. He knows he'll face the rope, doesn't he?\"","\n","^\"Don't ask me to explain why he did what he did,\" Harris sighs. \"Just be grateful that he did, and you're now off the hook.\"","\n",{"->":".^.^.^.^.^.g-2"},null]}],{"#f":5}]}],"g-2":["^Curiouser and curiouser. I nod once to Harris and slip outside into the cold morning air.","\n","ev",{"VAR?":"hooperClueType"},0,"==","/ev",[{"->":".^.b","c":true},{"b":["\n","^Hooper's confession only makes sense in one fashion","ev",{"VAR?":"hooperConfessed"},"/ev",[{"->":".^.b","c":true},{"b":["^, and that is his being dim—witted and slow",{"->":".^.^.^.7"},null]}],[{"->":".^.b"},{"b":["^ — if I successfully implied to him that I had him framed, but he did not unpack my little clue well enough to go looking for the component. Well, I had figured him for a more intelligent opponent, but a resignation from the game will suffice",{"->":".^.^.^.7"},null]}],"nop","^. Or perhaps he knew he would be followed if he went to check, and decided he would be doomed either way.","\n",{"->":".^.^.^.9"},null]}],[{"->":".^.b"},{"b":["\n","^Hooper's confession only makes sense in one way — and that's that he believed me. He reasoned that he would be followed. To try and uncover the component would have got him arrested, and to confess was the same.","\n","^He simply caved, and threw in his hand.","\n",{"->":".^.^.^.9"},null]}],"nop","\n","^Of course, however, there is only one way to be certain that Harris is telling the truth, and that is to check the breeze—block at the back of Hut 2.","\n","ev","str","^Check","/str","/ev",{"*":".^.c-8","flg":20},"ev","str","^Don't check","/str","/ev",{"*":".^.c-9","flg":20},{"c-8":["^ ",{"->":"go_to_where_component_is_hidden"},"\n",{"#f":5}],"c-9":["\n","^But there will time for that later. If there is nothing there, then Hooper discovered the component after all and Harris' men will have swooped on him, and the story about his confession is just a ruse to test me out.","\n","^And if the component is still there — well. It will be just as valuable to my contact in a week's time, and his deadline of the 31st is not yet upon us.","\n",{"->":"head_for_my_dorm_free"},{"#f":5}]}]}],{"#f":5}],"c-4":["^ ",{"->":".^.^.^.^.morning_not_saved"},"\n",{"#f":5}]}]}],{"morning_not_saved":[["^Morning comes with the call of a rooster from the yard of the House. I must have slept after all. I pull myself up off the bunk, shivering slightly. There is condensation on the inside of the window. I have probably given myself a chill.","\n","^It's not long after that Harris enters the hut. He closes the door behind him, careful as ever, then takes a chair across from me.","\n","^\"You smell like a dog,\" he remarks.","\n","ev","str","^Be optimistic","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Be pessimistic","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ ","\n","^\"I'm looking forward to a long bath,\" I reply. \"And getting back to work.\"","\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["^ ","\n","^\"So would you after the night I've had.\"","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":[{"->":"harris_certain_is_you"},null]}],null]}],"harris_certain_is_you":["^\"Well, I'm afraid it is going to get worse for you,\" Harris replies soberly. \"We followed Hooper, and he took himself neatly to bed and slept like a boy scout. Which puts us back to square one, and you firmly in the frame. And I'm afraid I don't have time for any more games. I want you to tell me where that component is, or we will hang you as a traitor.\"","\n","ev",false,"/ev",{"VAR=":"revealedhooperasculprit","re":true},"ev",false,"/ev",{"VAR=":"losttemper","re":true},{"->":"harris_threatens_lynching"},{"#f":1}],"head_for_my_dorm_free":[["^I head for my dorm, intent on a bath, breakfast, a glance at the crossword before the other men get to it, and then on with work. They should have replaced the component in the Bombe by now. We will only be a day behind.","\n","ev",{"VAR?":"framedhooper"},"!","/ev",[{"->":".^.b","c":true},{"b":["\n","^And then everything will proceed as before. The component will mean nothing to the Germans — this is the one fact I could never have explained to a man like Harris, even though the principle behind the Bombe is the same as the principle behind the army. The individual pieces — the men, the components — do not matter. They are identical. It is how they are arranged that counts.","\n",{"->":".^.^.^.7"},null]}],"nop","\n","^I bump into Russell in the dorm hut.","\n","^\"Did you hear?\" he whispers. \"Terrible news about Hooper. Absolutely terrible.\"","\n","ev","str","^Yes","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^No","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Lie","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^Evade","/str","/ev",{"*":".^.c-3","flg":20},{"c-0":["^ ","\n","^\"Quite terrible. I would never have guessed.\"","\n","^\"Well.\" Russell harrumphs.","\n",[["^\"Quince was saying this morning, apparently his grandfather was German. So perhaps it's to be expected. See you there?\"","\n",{"->":".^.^.^.^.g-0"},{"#n":"quince"}],null],{"#f":5}],"c-1":["\n","^\"Heard what?\"","\n",[["^\"Hooper's been taken away. They caught him, uncovering that missing Bombe component from a hiding place somewhere, apparently about to take it to his contact.\" Russell harrumphs. ",{"->":".^.^.^.^.c-0.6.quince"},"\n",{"->":".^.^.^.^.g-0"},{"#n":"hooper_taken"}],null],{"#f":5}],"c-2":["^ ","\n","^\"I don't know what you're talking about.\"","\n",{"->":".^.^.c-1.3.hooper_taken"},{"->":".^.^.g-0"},{"#f":5}],"c-3":["\n","^\"If you'll excuse me, Russell. I was about to take a bath.\"","\n","^\"Oh, of course. Worked all night, did you? Well, you'll hear soon enough. Can hardly hide the fact there'll only be three of us from now on.\"","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^I wave to him and move away, my thoughts turning to the young man in the village. My lover. My contact. My blackmailer. Hooper may have taken the fall for the missing component, but ","ev",{"VAR?":"framedhooper"},"!","/ev",[{"->":".^.b","c":true},{"b":["^if he did recover it from Hut 2 then ",{"->":".^.^.^.7"},null]}],[{"->":".^.b"},{"b":["^ its recovery does mean ",{"->":".^.^.^.7"},null]}],"nop","^I have nothing to sell to save my reputation","ev",{"CNT?":"i_met_a_young_man"},"/ev",[{"->":".^.b","c":true},{"b":["^, if I have any left",{"->":".^.^.^.13"},null]}],"nop","^.","\n","ev",{"VAR?":"framedhooper"},"!","/ev",[{"->":".^.b","c":true},{"b":["\n","^If he didn't, of course, and Harris was telling the truth about his sudden confession, then I will be able to buy my freedom once and for all.","\n",{"->":".^.^.^.21"},null]}],"nop","\n","ev","str","^Get the component","/str",{"VAR?":"framedhooper"},"!","/ev",{"*":".^.c-4","flg":21},"ev","str","^Leave it","/str",{"VAR?":"framedhooper"},"!","/ev",{"*":".^.c-5","flg":21},"ev","str","^Act normal","/str","/ev",{"*":".^.c-6","flg":20},{"c-4":["^ ",{"->":"go_to_where_component_is_hidden"},"\n",{"#f":5}],"c-5":["^ ","\n","^I will have to leave that question for another day. To return there now, when they're probably watching my every step, would be suicide. After all, if Hooper ","ev",{"VAR?":"hooperClueType"},1,"==","/ev",[{"->":".^.b","c":true},{"b":["^followed",{"->":".^.^.^.10"},null]}],[{"->":".^.b"},{"b":["^understood",{"->":".^.^.^.10"},null]}],"nop","^ my clue, he will have explained it to them to save his neck. They won't believe him — but they won't quite disbelieve him either. We're locked in a cycle now, him and me, of half—truth and probability. There's nothing either of us can do to put the other entirely into blame.","\n",{"->":"ending_return_to_normal"},{"#f":5}],"c-6":["^ ","\n","^But there is nothing to be done about it. ",{"->":"ending_return_to_normal"},"\n",{"#f":5}]}]}],null],"ending_return_to_normal":[["^Nothing, that is, except to act as if there is no game being played. I'll have a bath, then start work as normal. I've got a week to find something to give my blackmailer","ev",{"CNT?":"i_met_a_young_man"},"/ev",[{"->":".^.b","c":true},{"b":["^ — or give him nothing: it seems my superiors know about my indiscretions now already",{"->":".^.^.^.5"},null]}],"nop","^.","\n","ev","str","^Co-operate","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Dissemble","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Lie","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^Evade","/str","/ev",{"*":".^.c-3","flg":20},{"c-0":["^ ","\n","^Something will turn up. It always does. An opportunity will present itself, and more easily now that Hooper is out of the way.","\n","^But for now, there's yesterday's intercept to be resolved.","\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["^ ","\n","^Or perhaps I might hand my young blackmailer over my superiors instead for being the spy he is.","\n","^Perhaps that would be the moral thing to do, even, and not just the most smart.","\n","^But not today. Today, there's an intercept to resolve.","\n",{"->":".^.^.g-0"},{"#f":5}],"c-2":["\n","^In a week's time, this whole affair will be in the past and quite forgotten. I'm quite sure of that. ",{"->":".^.^.c-3"},"\n",{"->":".^.^.g-0"},{"#f":5}],"c-3":["^ I've more important problems to think about now. There's still yesterday's intercept to be resolved. ","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^The Bombe needs to be set up once more and set running.","\n","^It's time I tackled a problem I can solve.","\n","end",null]}],null],"go_to_where_component_is_hidden":[["^It won't take a moment to settle the matter. I can justify a walk past Hut 2 as part of my morning stroll. It will be obvious in a moment if the component is still there.","\n","^On my way across the paddocks, between the huts and the House, I catch sight of young Miss Lyon, arriving for work on her bicycle. She giggles as she sees me and waves.","\n","ev","str","^Wave back","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Ignore her","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ ","\n","^I wave cheerily back and she giggles, almost drops her bicycle, then dashes away inside the House. Judging by the clock on the front gable, she's running a little late this morning.","\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["^ ","\n","^I give no reaction. She sighs to herself, as if this kind of behaviour is normal, and trots away inside the House to begin her duties.","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^I turn the corner of Hut 3 and walk down the short gravel path to Hut 2. It was a good spot to choose — Hut 2 is where the electricians work, and they're generally focussed on what they're doing. They don't often come outside to smoke a cigarette so it's easy to slip past the doorway unnoticed.","\n","ev","str","^Check inside","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^Go around the back","/str","/ev",{"*":".^.c-3","flg":20},{"c-2":["^ \t\t","\n","^I hop up the steps and put my head inside all the same. Nobody about. Still too early in the AM for sparks, I suppose. ","<>","\n",{"->":".^.^.^.g-1"},{"#f":5}],"c-3":["^ ","\n",{"->":".^.^.^.g-1"},{"#f":5}]}],"g-1":["^I head on around the back of the hut. The breeze—block with the cavity is on the left side.","\n","ev","str","^Check","/str","/ev",{"*":".^.c-4","flg":20},"ev","str","^Look around","/str","/ev",{"*":".^.c-5","flg":20},{"c-4":["^ \t\t","\n","^No time to waste. I drop to my knees and check the breeze—block. Sure enough, there's nothing there. Hooper took the bait.","\n","^Suddenly, there's a movement behind me. I look up to see, first a snub pistol, and then, Harris.","\n",{"->":".^.^.^.g-2"},{"#f":5}],"c-5":["^ ","\n","^I pause to glance around, and catch a glimpse of movement. Someone ducking around the corner of the hut. Or a canvas sheet flapping in the light breeze. Impossible to be sure.","\n",["ev","str","^Check the breeze—block","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Check around the side of the hut","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ ",{"->":".^.^.^.^.c-4"},"\n",{"->":".^.^.^.^.^.g-2"},{"#f":5}],"c-1":["^ ","\n","^But too important to guess. I move back around the side of the hut.","\n","^Harris is there, leaning in against the wall. He holds a stub pistol in his hand.","\n",{"->":".^.^.^.^.^.g-2"},{"#f":5}]}],{"#f":5}]}],"g-2":["ev",{"VAR?":"hooperClueType"},1,">","/ev",[{"->":".^.b","c":true},{"b":["\n","^\"","ev",{"VAR?":"hooperClueType"},2,"==","/ev",[{"->":".^.b","c":true},{"b":["^Queen to rook two",{"->":".^.^.^.9"},null]}],[{"->":".^.b"},{"b":["^Messy without one missing whatever it was",{"->":".^.^.^.9"},null]}],"nop","^,\" he declares. \"I wouldn't have fathomed it but Hooper did. Explained it right after we sprung him doing what you're doing now. We weren't sure what to believe but now, you seem to have resolved that for us.\"","\n",{"->":".^.^.^.7"},null]}],[{"->":".^.b"},{"b":["\n","^\"Hooper said you'd told him where to look. I didn't believe him. Or, well. I wasn't sure what to believe. Now I rather think you've settled it.\"","\n",{"->":".^.^.^.7"},null]}],"nop","\n","ev","str","^Agree","/str","/ev",{"*":".^.c-6","flg":20},"ev","str","^Lie","/str","/ev",{"*":".^.c-7","flg":20},"ev","str","^Evade","/str","/ev",{"*":".^.c-8","flg":20},{"c-6":["^ ","\n","^\"I have, rather.\" I put my hands into my pockets. \"I seem to have done exactly that.\"","\n","^\"I'm afraid my little story about Hooper confessing wasn't true. I wanted to see if you'd go to retrieve the part.\" Harris gestures me to start walking. \"You were close, Manning, I'll give you that. I wanted to believe you. But I'm glad I didn't.\"","\n",{"->":".^.^.^.g-3.done"},{"->":".^.^.^.g-3"},{"#f":5}],"c-7":["^ ","\n","^\"I spoke to Russell. He said he saw Hooper doing something round here. I wanted to see what it was.\"","\n",{"->":".^.^.^.g-3"},{"#f":5}],"c-8":["^ ","\n","^\"Harris, you'd better watch out. He's planted a time—bomb here.\"","\n","^Harris stares at me for a moment, then laughs. \"Oh, goodness. That's rich.\"","\n","^I almost wish I had a way to make the hut explode, but of course I don't.","\n",{"->":".^.^.^.g-3"},{"#f":5}]}],"g-3":["^\"Enough.\" Harris gestures for me to start walking. \"This story couldn't be simpler. You took it to cover your back. You hid it. You lied to get Hooper into trouble, and when you thought you'd won, you came to scoop your prize. A good hand but ultimately, ","ev",{"VAR?":"hooperClueType"},1,"<=","/ev",[{"->":".^.b","c":true},{"b":["^if it hadn't have been you who hid the component, then you wouldn't be here now",{"->":".^.^.^.8"},null]}],[{"->":".^.b"},{"b":["^you told Hooper where to look with your little riddle",{"->":".^.^.^.8"},null]}],"nop","^.\"","\n",["^He leads me across the yard. Back towards Hut 5 to be decoded, and taken to pieces, once again.","\n","end",{"#n":"done"}],null]}],null],"harris_threatens_lynching":[["ev",{"CNT?":"harris_certain_is_you"},"/ev",[{"->":".^.b","c":true},{"b":["^He passes a hand across his eyes with a long look of despair.",{"->":".^.^.^.5"},null]}],[{"->":".^.b"},{"b":["^He gets to his feet, and gathers his gloves from the table top.",{"->":".^.^.^.5"},null]}],"nop","\n","^\"I'm going to go outside and organise a rope. That'll take about twelve minutes. That's how long you have to decide.\"","\n","ev","str","^Protest","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Confess","/str",{"VAR?":"gotcomponent"},"!",{"VAR?":"throwncomponentaway"},"!","&&","/ev",{"*":".^.c-1","flg":21},"ev","str","^Stay silent","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^Show him the component","/str",{"VAR?":"gotcomponent"},"/ev",{"*":".^.c-3","flg":21},{"c-0":["^ ","\n","^\"You can't do this!\" I cry. \"It's murder! I demand a trial, a lawyer; for God's sake, man, you can't just throw me overboard, we're not barbarians...!\"","\n",[["^\"You leave me no choice,\" Harris snaps back, eyes cold as gun—metal. \"You and your damn cyphers. Your damn clever problems. If men like you didn't exist, if we could just all be straight with one another.\" He gets to his feet and heads for the door. \"I fear for the future of this world, with men like you in. Reich or no Reich, Mr Manning, people like you simply complicate matters.\"","\n",{"->":"left_alone"},{"->":".^.^.^.^.g-0"},{"#f":5,"#n":"too_clever"}],null],{"#f":5}],"c-1":["^ ","\n","^I nod. \"I don't need twelve minutes. ",{"->":"reveal_location_of_component"},"\n",{"->":".^.^.g-0"},{"#f":5}],"c-2":["^ ",{"->":"my_lips_are_sealed"},"\n",{"->":".^.^.g-0"},{"#f":5}],"c-3":["^ ","\n","^\"I don't need twelve minutes. Here it is.\"","\n","^I open my jacket and pull the Bombe component out of my pocket. Harris takes it from me, whistling, curious.","\n","^\"Well, I'll be. That's it all right.\"","\n","^\"That's it.\"","\n","^\"But you didn't have it on you yesterday.\"","\n",["ev","str","^Explain","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Don't explain","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ ","\n","^\"I climbed out of the window overnight,\" I explain. \"I went and got this from where it was hidden, and brought it back here.\"","\n",{"->":".^.^.^.^.g-0"},{"#f":5}],"c-1":["\n","^\"No. I didn't.\"","\n",{"->":".^.^.^.^.g-0"},{"#f":5}]}],{"#f":5}],"g-0":[{"->":"all_too_farfetched"},"ev","str","^Confess","/str",{"VAR?":"throwncomponentaway"},"/ev",{"*":".^.c-4","flg":21},"ev","str","^Frame Hooper","/str",{"VAR?":"throwncomponentaway"},"/ev",{"*":".^.c-5","flg":21},{"c-4":["\n","^\"I don't need twelve minutes. The component is in the long grass behind Hooper's tent. I threw it there hoping to somehow frame him, but now I see that won't be possible. I was naive, I suppose.\"","\n","ev",true,"/ev",{"VAR=":"piecereturned","re":true},{"->":"reveal_location_of_component.harris_believes"},{"#f":5}],"c-5":["^ ","\n","^\"Look, I know where it is. The missing piece of the Bombe is in the long grasses behind Hooper's tent. I saw him throw it there right after we finished work. He knew you'd scour the camp but I suppose he thought you'd more obvious places first. I suppose he was right about that. Look there. That proves his guilt.\"","\n","ev",true,"/ev",{"VAR=":"longgrasshooperframe","re":true},"ev",true,"/ev",{"VAR=":"piecereturned","re":true},"^\"That doesn't prove anything,\" Harris returns sharply. \"But we'll check what you say, all the same.\" He gets to his feet and heads out of the door.","\n",{"->":"left_alone"},{"#f":5}]}]}],null],"reveal_location_of_component":["<>","^ The missing component of the Bombe computer is hidden in a small cavity in a breeze—block supporting the left rear post of Hut 2. I put in there anticipating a search. I intended to ","ev",{"VAR?":"revealedhooperasculprit"},"/ev",[{"->":".^.b","c":true},{"b":["^pass it to Hooper",{"->":".^.^.^.7"},null]}],[{"->":".^.b"},{"b":["^dispose of it",{"->":".^.^.^.7"},null]}],"nop","^ once the fuss had died down. I suppose I was foolish to think that it might.\"","\n","ev",true,"/ev",{"VAR=":"piecereturned","re":true},{"->":".^.harris_believes"},{"harris_believes":["ev",{"CNT?":"night_falls.0.g-0.c-3.6.hooper_didnt_give_himself_up"},"!","/ev",[{"->":".^.b","c":true},{"b":["\n","^\"Indeed. And Mr Manning: God help you if you're lying to me.\"","\n",{"->":".^.^.^.6"},null]}],[{"->":".^.b"},{"b":["\n","^\"I thought as much. I hadn't expected you to give it out so easily, however. You understand, Hooper has said nothing, of course. In fact, he went to Hut 2 directly after we released him and uncovered the component. But he told us you had instructed him where to go. Hence my little double bluff. Frankly, I'll be glad when I'm shot of the lot of you mathematicians.\"","\n",{"->":".^.^.^.6"},null]}],"nop","\n","^Harris stands, and slips away smartly. ",{"->":"left_alone"},"\n",null]}],"my_lips_are_sealed":["^I say nothing, my lips tightly, firmly sealed. It's true I am a traitor, to the very laws of nature. The world has taught me that since a very early age. But not to my country — should the Reich win this war, I would hardly be treated as an honoured hero. I was doomed from the very start.","\n","ev",true,"/ev",{"VAR=":"notraitor","re":true},"^I explain none of this. How could a man like Harris understand?","\n","^The Commander takes one look back from the doorway as he pulls it to.","\n","^\"It's been a pleasure working with you, Mr Manning,\" he declares. \"You've done a great service to this country. If we come through, I'm sure they'll remember you name. I'm sorry it had to end this way and I'll do my best to keep it quiet. No—one need know what you did.\"","\n",{"->":"left_alone"},null],"all_too_farfetched":["^\"This is all too far—fetched,\" Harris says. \"I'm glad to have this back, but I need to think.\"","\n","^Getting to his feet, he nods once. \"You'll have to wait a little longer, I'm afraid, Manning.\"","\n","^Then he steps out of the door, muttering to himself.","\n",{"->":"make_your_peace"},null],"left_alone":["ev",{"CNT?":"slam_door_shut_and_gone.time_to_move_now"},"/ev",[{"->":".^.b","c":true},{"b":["^The Commander holds the door for his superior, and follows him out.",{"->":".^.^.^.4"},null]}],"nop","^ Then the door closes. I am alone again, as I have been for most of my short life.","\n",{"->":"make_your_peace"},null],"make_your_peace":[["ev","str","^Make your peace","/str","/ev",{"*":".^.c-0","flg":20},{"c-0":["\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^I am waiting again. I have no God to make my peace with. I find it difficult to believe in goodness of any kind, in a world such as this.","\n","ev",{"VAR?":"notraitor"},"!","/ev",[{"->":".^.b","c":true},{"b":["\n","ev",true,"/ev",{"VAR=":"notraitor","re":true},"^But I am no traitor. Not to my country. To my sex, perhaps. But how could I support the Reich? If the Nazis were to come to power, I would be worse off than ever.","\n",{"->":".^.^.^.7"},null]}],"nop","\n","ev",{"CNT?":"harris_threatens_lynching.0.c-0.4.too_clever"},"/ev",[{"->":".^.b","c":true},{"b":["\n","^In truth, it is men like Harris who are complex, not men like me. I live to make things ordered, systematic. I like my pencils sharpened and lined up in a row. I do not deal in difficult borders, or uncertainties, or alliances. If I could, I would reduce the world to something easier to understand, something finite.","\n","^But I cannot, not even here, in our little haven from the horrors of the war.","\n",{"->":".^.^.^.13"},null]}],"nop","\n","^I have no place here. No way to fit. I am caught, in the middle, cryptic and understood only thinly, through my machines.","\n",["ev",{"^->":"make_your_peace.0.g-0.17.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":18},{"s":["^I must seem very calm. \t\t\t",{"->":"$r","var":true},null]}],["ev",{"^->":"make_your_peace.0.g-0.18.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-2","flg":18},{"s":["^Perhaps I should try to escape.",{"->":"$r","var":true},null]}],{"c-1":["ev",{"^->":"make_your_peace.0.g-0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.17.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.^.g-1"},{"#f":5}],"c-2":["ev",{"^->":"make_your_peace.0.g-0.c-2.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.18.s"},[{"#n":"$r2"}],"^ But escape to where? I am already a prisoner. Jail would be a blessing. ",{"->":".^.^.^.g-1.monastic"},"\n",{"->":".^.^.^.g-1"},{"#f":5}]}],"g-1":["<>","^ I suppose I do not believe they will hang me. They will lock me up and continue to use my brain, if they can. I wonder what they will tell the world — perhaps that I have taken my own life. That would be simplest. The few who know me would believe it.","\n","^Well, then. Not a bad existence, in prison. Removed from temptation.","\n",["^A monastic life, with plenty of problems to keep me going.","\n","^I wonder what else I might yet unravel before I'm done?","\n",["ev",{"^->":"make_your_peace.0.g-1.monastic.4.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-3","flg":18},{"s":["^The door is opening.",{"->":"$r","var":true},null]}],{"c-3":["ev",{"^->":"make_your_peace.0.g-1.monastic.c-3.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.4.s"},[{"#n":"$r2"}],"^ Harris is returning. Our little calculation here is complete. ","ev",{"VAR?":"piecereturned"},"!","/ev",[{"->":".^.b","c":true},{"b":["^ I can only hope one of the others will be able to explain to him that the part I stole will mean nothing to the Germans.",{"->":".^.^.^.13"},null]}],[{"->":".^.b"},{"b":["^We are just pieces in this machine; interchangeable and prone to wear.",{"->":".^.^.^.13"},null]}],"nop","\n",{"->":".^.^.^.^.g-2"},{"#f":5}],"#n":"monastic"}],null],"g-2":["^That is the true secret of the calculating engine, and the source of its power. It is not the components that matter, they are quite repetitive. What matters is how they are wired; the diversity of the patterns and structures they can form. Much like people — it is how they connect that determines our victories and tragedies, and not their genius.","\n","^Which makes me wonder. Should I give ","ev",{"CNT?":"i_met_a_young_man"},"/ev",[{"->":".^.b","c":true},{"b":["^up my beautiful young man",{"->":".^.^.^.8"},null]}],[{"->":".^.b"},{"b":["^the young man who put me in this spot",{"->":".^.^.^.8"},null]}],"nop","^ to them as well as myself?","\n","ev","str","^Yes","/str","/ev",{"*":".^.c-4","flg":20},"ev","str","^No","/str","/ev",{"*":".^.c-5","flg":20},"ev","str","^Lie","/str","/ev",{"*":".^.c-6","flg":20},"ev","str","^Evade","/str","/ev",{"*":".^.c-7","flg":20},{"c-4":["^ ","\n","^But of course I will. ","ev",{"VAR?":"forceful"},2,">","/ev",[{"->":".^.b","c":true},{"b":["^Perhaps I can persuade them to put him in my cell.",{"->":".^.^.^.10"},null]}],[{"->":".^.b"},{"b":["^A little vengeance, disguised as doing something good.",{"->":".^.^.^.10"},null]}],"nop","\n",{"->":".^.^.^.g-3"},{"#f":5}],"c-5":["^ ","\n","^No. What would be the use? He will be long gone, and the name he told me is no doubt hokum. No: I was alone before in guilt, and I am thus alone again.","\n",{"->":".^.^.^.g-3"},{"#f":5}],"c-6":["^ ","\n","^No. Why would I? He is no doubt an innocent himself, trapped by some dire circumstance. Forced to act the way he did. I have every sympathy for him.","\n","^Of course I do.","\n",{"->":".^.^.^.g-3"},{"#f":5}],"c-7":["^ ","\n","^It depends, perhaps, on what his name his worth. If it were to prove valuable, well; perhaps I can concoct a few more such lovers with which to ease my later days.","\n","ev",{"VAR?":"hooper_mentioned"},"/ev",[{"->":".^.b","c":true},{"b":["^ Hooper, perhaps. He wouldn't like that. ",{"->":".^.^.^.8"},null]}],"nop","\n",{"->":".^.^.^.g-3"},{"#f":5}]}],"g-3":["ev",{"VAR?":"longgrasshooperframe"},"!","/ev",[{"->":".^.b","c":true},{"b":["\n","^Harris put the cuffs around my wrists. \"I still have the intercept in my pocket,\" I remark. \"Wherever we're going, could I have a pencil?\"","\n",{"->":".^.^.^.6"},null]}],[{"->":".^.b"},{"b":["\n","^\"We recovered the part, just where you said it was,\" Harris reports, as he puts the cuffs around my wrists. \"Of course, a couple of the men swear blind they searched there yesterday, so I'm afraid, what with the broken window... we've formed a perfectly good theory which doesn't bode well for you.\"","\n",{"->":".^.^.^.6"},null]}],"nop","\n","ev",true,"/ev",{"VAR=":"piecereturned","re":true},"ev",{"VAR?":"longgrasshooperframe"},"/ev",[{"->":".^.b","c":true},{"b":["\n","^\"I see.\" It doesn't seem worth arguing any further. \"I still have the intercept in my pocket,\" I remark. \"Wherever we're going, could I have a pencil?\"","\n",{"->":".^.^.^.16"},null]}],"nop","\n","^He looks me in the eye.","\n","ev",{"VAR?":"losttemper"},"!","/ev",[{"->":".^.b","c":true},{"b":["\n","^\"Of course. And one of your computing things, if I get my way. And when we're old, and smoking pipes together in The Rag like heroes, I'll explain to you the way that decent men have affairs.","\n",{"->":".^.^.^.26"},null]}],[{"->":".^.b"},{"b":["\n","^\"I'll give you a stone to chisel notches in the wall. And that's all the calculations you'll be doing. And as you sit there, pissing into a bucket and growing a beard down to your toes, you have a think about how a smart man would conduct his illicit affairs. With a bit of due decorum you could have learnt off any squaddie.","\n",{"->":".^.^.^.26"},null]}],"nop","\n","<>","^ You scientists.\"","\n","^He drags me up to my feet.","\n","^\"You think you have to re—invent everything.\"","\n","^With that, he hustles me out of the door and I can't help thinking that, with a little more strategy, I could still have won the day. But too late now, of course.","\n","end",null]}],null],"global decl":["ev",0,{"VAR=":"forceful"},0,{"VAR=":"evasive"},false,{"VAR=":"teacup"},false,{"VAR=":"gotcomponent"},false,{"VAR=":"drugged"},false,{"VAR=":"hooper_mentioned"},false,{"VAR=":"losttemper"},false,{"VAR=":"admitblackmail"},0,{"VAR=":"hooperClueType"},false,{"VAR=":"hooperConfessed"},0,{"VAR=":"smashingWindowItem"},false,{"VAR=":"notraitor"},false,{"VAR=":"revealedhooperasculprit"},false,{"VAR=":"smashedglass"},false,{"VAR=":"muddyshoes"},false,{"VAR=":"framedhooper"},false,{"VAR=":"putcomponentintent"},false,{"VAR=":"throwncomponentaway"},false,{"VAR=":"piecereturned"},false,{"VAR=":"longgrasshooperframe"},false,{"VAR=":"DEBUG"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/templates/typescript_player/tsconfig.json b/templates/typescript_player/tsconfig.json new file mode 100644 index 00000000..d080099f --- /dev/null +++ b/templates/typescript_player/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "lib": ["ES2022"], + "skipLibCheck": true, + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "Node16", + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "types": ["node"], + "outDir": "dist", + "declaration": true, + "resolveJsonModule": true, + + /* Linting */ + "strict": true + }, + "include": ["src"] +} diff --git a/templates/typescript_with_compiler/package.json b/templates/typescript_with_compiler/package.json new file mode 100644 index 00000000..cb956add --- /dev/null +++ b/templates/typescript_with_compiler/package.json @@ -0,0 +1,21 @@ +{ + "name": "ts-inkjs-with-compiler", + "type": "module", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "start": "tsc --resolveJsonModule -p . && tsx src/index.ts" + }, + "keywords": [], + "author": "Sebastian Hanlon", + "license": "ISC", + "devDependencies": { + "@types/node": "^20.14.2", + "tsx": "^4.15.2", + "typescript": "^5.4.5" + }, + "dependencies": { + "inkjs": "*" + } +} diff --git a/templates/typescript_with_compiler/src/index.ts b/templates/typescript_with_compiler/src/index.ts new file mode 100644 index 00000000..dd78d905 --- /dev/null +++ b/templates/typescript_with_compiler/src/index.ts @@ -0,0 +1,24 @@ +import { Story, Compiler } from 'inkjs/compiler/Compiler'; +import { Choice } from 'inkjs/engine/Choice'; + +const inkStory = ` +Once upon a time... + + * There were two choices. + * There were four lines of content. + +- They lived happily ever after. + -> END +` + +let compiler = new Compiler(inkStory); + +let story: Story = compiler.Compile() + +let text = story.Continue() +let choices: Choice[] = story.currentChoices + +console.log(text) +for (let c of choices){ + console.log(` * ${c.text}`) +} diff --git a/templates/typescript_with_compiler/tsconfig.json b/templates/typescript_with_compiler/tsconfig.json new file mode 100644 index 00000000..d080099f --- /dev/null +++ b/templates/typescript_with_compiler/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "lib": ["ES2022"], + "skipLibCheck": true, + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "Node16", + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "types": ["node"], + "outDir": "dist", + "declaration": true, + "resolveJsonModule": true, + + /* Linting */ + "strict": true + }, + "include": ["src"] +} diff --git a/tsconfig.json b/tsconfig.json index 1d1def12..d0b81a3e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,9 +6,9 @@ "rootDir": "src/", "strict": true, "sourceMap": true, - "declaration": true + "declaration": true, + "lib": ["ES2017"] }, - "include": ["src/"], "exclude": ["node_modules", "**/__tests__/*"] }