@cuxt/sandboxjs 0.1.0 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +198 -185
- package/{build → dist/cjs}/Sandbox.d.ts +15 -6
- package/dist/cjs/Sandbox.js +126 -0
- package/dist/{SandboxExec.d.ts → cjs/SandboxExec.d.ts} +8 -17
- package/dist/cjs/SandboxExec.js +227 -0
- package/{build/eval.d.ts → dist/cjs/eval/index.d.ts} +10 -2
- package/dist/cjs/eval/index.js +233 -0
- package/dist/cjs/executor/executorUtils.d.ts +161 -0
- package/dist/cjs/executor/executorUtils.js +930 -0
- package/dist/cjs/executor/index.d.ts +1 -0
- package/dist/cjs/executor/index.js +2 -0
- package/dist/cjs/executor/ops/assignment.d.ts +1 -0
- package/dist/cjs/executor/ops/assignment.js +88 -0
- package/dist/cjs/executor/ops/call.d.ts +1 -0
- package/dist/cjs/executor/ops/call.js +160 -0
- package/dist/cjs/executor/ops/comparison.d.ts +1 -0
- package/dist/cjs/executor/ops/comparison.js +36 -0
- package/dist/cjs/executor/ops/control.d.ts +1 -0
- package/dist/cjs/executor/ops/control.js +203 -0
- package/dist/cjs/executor/ops/functions.d.ts +1 -0
- package/dist/cjs/executor/ops/functions.js +55 -0
- package/dist/cjs/executor/ops/index.d.ts +0 -0
- package/dist/cjs/executor/ops/index.js +11 -0
- package/dist/cjs/executor/ops/literals.d.ts +1 -0
- package/dist/cjs/executor/ops/literals.js +45 -0
- package/dist/cjs/executor/ops/misc.d.ts +1 -0
- package/dist/cjs/executor/ops/misc.js +25 -0
- package/dist/cjs/executor/ops/object.d.ts +1 -0
- package/dist/cjs/executor/ops/object.js +51 -0
- package/dist/cjs/executor/ops/prop.d.ts +1 -0
- package/dist/cjs/executor/ops/prop.js +70 -0
- package/dist/cjs/executor/ops/unary.d.ts +1 -0
- package/dist/cjs/executor/ops/unary.js +48 -0
- package/dist/cjs/executor/ops/variables.d.ts +1 -0
- package/dist/cjs/executor/ops/variables.js +16 -0
- package/dist/cjs/executor/opsRegistry.d.ts +33 -0
- package/dist/cjs/executor/opsRegistry.js +8 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/parser/index.d.ts +3 -0
- package/dist/cjs/parser/index.js +1 -0
- package/dist/{parser.d.ts → cjs/parser/lisp.d.ts} +29 -42
- package/dist/cjs/parser/lispTypes/conditionals.d.ts +2 -0
- package/dist/cjs/parser/lispTypes/conditionals.js +135 -0
- package/dist/cjs/parser/lispTypes/control.d.ts +2 -0
- package/dist/cjs/parser/lispTypes/control.js +204 -0
- package/dist/cjs/parser/lispTypes/declarations.d.ts +2 -0
- package/dist/cjs/parser/lispTypes/declarations.js +99 -0
- package/dist/cjs/parser/lispTypes/index.d.ts +3 -0
- package/dist/cjs/parser/lispTypes/index.js +17 -0
- package/dist/cjs/parser/lispTypes/operators.d.ts +2 -0
- package/dist/cjs/parser/lispTypes/operators.js +252 -0
- package/dist/cjs/parser/lispTypes/shared.d.ts +38 -0
- package/dist/cjs/parser/lispTypes/structures.d.ts +2 -0
- package/dist/cjs/parser/lispTypes/structures.js +188 -0
- package/dist/cjs/parser/lispTypes/values.d.ts +2 -0
- package/dist/cjs/parser/lispTypes/values.js +89 -0
- package/dist/cjs/parser/parserUtils.d.ts +34 -0
- package/dist/cjs/parser/parserUtils.js +968 -0
- package/dist/cjs/utils/CodeString.d.ts +16 -0
- package/dist/cjs/utils/CodeString.js +64 -0
- package/dist/cjs/utils/ExecContext.d.ts +34 -0
- package/dist/cjs/utils/ExecContext.js +171 -0
- package/dist/cjs/utils/Prop.d.ts +16 -0
- package/dist/cjs/utils/Prop.js +81 -0
- package/dist/cjs/utils/Scope.d.ts +47 -0
- package/dist/cjs/utils/Scope.js +127 -0
- package/dist/cjs/utils/errors.d.ts +10 -0
- package/dist/cjs/utils/errors.js +12 -0
- package/dist/cjs/utils/functionReplacements.d.ts +11 -0
- package/dist/cjs/utils/functionReplacements.js +362 -0
- package/dist/cjs/utils/index.d.ts +7 -0
- package/dist/cjs/utils/index.js +7 -0
- package/dist/cjs/utils/types.d.ts +221 -0
- package/dist/cjs/utils/types.js +164 -0
- package/dist/cjs/utils/unraw.js +145 -0
- package/dist/{node → esm}/Sandbox.d.ts +15 -6
- package/dist/esm/Sandbox.js +115 -0
- package/dist/esm/Sandbox.js.map +1 -0
- package/{build → dist/esm}/SandboxExec.d.ts +8 -17
- package/dist/esm/SandboxExec.js +224 -0
- package/dist/esm/SandboxExec.js.map +1 -0
- package/dist/{eval.d.ts → esm/eval/index.d.ts} +10 -2
- package/dist/esm/eval/index.js +235 -0
- package/dist/esm/eval/index.js.map +1 -0
- package/dist/esm/executor/executorUtils.d.ts +161 -0
- package/dist/esm/executor/executorUtils.js +898 -0
- package/dist/esm/executor/executorUtils.js.map +1 -0
- package/dist/esm/executor/index.d.ts +1 -0
- package/dist/esm/executor/index.js +2 -0
- package/dist/esm/executor/ops/assignment.d.ts +1 -0
- package/dist/esm/executor/ops/assignment.js +90 -0
- package/dist/esm/executor/ops/assignment.js.map +1 -0
- package/dist/esm/executor/ops/call.d.ts +1 -0
- package/dist/esm/executor/ops/call.js +162 -0
- package/dist/esm/executor/ops/call.js.map +1 -0
- package/dist/esm/executor/ops/comparison.d.ts +1 -0
- package/dist/esm/executor/ops/comparison.js +38 -0
- package/dist/esm/executor/ops/comparison.js.map +1 -0
- package/dist/esm/executor/ops/control.d.ts +1 -0
- package/dist/esm/executor/ops/control.js +205 -0
- package/dist/esm/executor/ops/control.js.map +1 -0
- package/dist/esm/executor/ops/functions.d.ts +1 -0
- package/dist/esm/executor/ops/functions.js +57 -0
- package/dist/esm/executor/ops/functions.js.map +1 -0
- package/dist/esm/executor/ops/index.d.ts +0 -0
- package/dist/esm/executor/ops/index.js +11 -0
- package/dist/esm/executor/ops/literals.d.ts +1 -0
- package/dist/esm/executor/ops/literals.js +47 -0
- package/dist/esm/executor/ops/literals.js.map +1 -0
- package/dist/esm/executor/ops/misc.d.ts +1 -0
- package/dist/esm/executor/ops/misc.js +27 -0
- package/dist/esm/executor/ops/misc.js.map +1 -0
- package/dist/esm/executor/ops/object.d.ts +1 -0
- package/dist/esm/executor/ops/object.js +53 -0
- package/dist/esm/executor/ops/object.js.map +1 -0
- package/dist/esm/executor/ops/prop.d.ts +1 -0
- package/dist/esm/executor/ops/prop.js +72 -0
- package/dist/esm/executor/ops/prop.js.map +1 -0
- package/dist/esm/executor/ops/unary.d.ts +1 -0
- package/dist/esm/executor/ops/unary.js +50 -0
- package/dist/esm/executor/ops/unary.js.map +1 -0
- package/dist/esm/executor/ops/variables.d.ts +1 -0
- package/dist/esm/executor/ops/variables.js +18 -0
- package/dist/esm/executor/ops/variables.js.map +1 -0
- package/dist/esm/executor/opsRegistry.d.ts +33 -0
- package/dist/esm/executor/opsRegistry.js +9 -0
- package/dist/esm/executor/opsRegistry.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/parser/index.d.ts +3 -0
- package/dist/esm/parser/index.js +1 -0
- package/{build/parser.d.ts → dist/esm/parser/lisp.d.ts} +29 -42
- package/dist/esm/parser/lispTypes/conditionals.d.ts +2 -0
- package/dist/esm/parser/lispTypes/conditionals.js +137 -0
- package/dist/esm/parser/lispTypes/conditionals.js.map +1 -0
- package/dist/esm/parser/lispTypes/control.d.ts +2 -0
- package/dist/esm/parser/lispTypes/control.js +206 -0
- package/dist/esm/parser/lispTypes/control.js.map +1 -0
- package/dist/esm/parser/lispTypes/declarations.d.ts +2 -0
- package/dist/esm/parser/lispTypes/declarations.js +101 -0
- package/dist/esm/parser/lispTypes/declarations.js.map +1 -0
- package/dist/esm/parser/lispTypes/index.d.ts +3 -0
- package/dist/esm/parser/lispTypes/index.js +19 -0
- package/dist/esm/parser/lispTypes/index.js.map +1 -0
- package/dist/esm/parser/lispTypes/operators.d.ts +2 -0
- package/dist/esm/parser/lispTypes/operators.js +254 -0
- package/dist/esm/parser/lispTypes/operators.js.map +1 -0
- package/dist/esm/parser/lispTypes/shared.d.ts +38 -0
- package/dist/esm/parser/lispTypes/structures.d.ts +2 -0
- package/dist/esm/parser/lispTypes/structures.js +190 -0
- package/dist/esm/parser/lispTypes/structures.js.map +1 -0
- package/dist/esm/parser/lispTypes/values.d.ts +2 -0
- package/dist/esm/parser/lispTypes/values.js +91 -0
- package/dist/esm/parser/lispTypes/values.js.map +1 -0
- package/dist/esm/parser/parserUtils.d.ts +34 -0
- package/dist/esm/parser/parserUtils.js +959 -0
- package/dist/esm/parser/parserUtils.js.map +1 -0
- package/dist/esm/utils/CodeString.d.ts +16 -0
- package/dist/esm/utils/CodeString.js +66 -0
- package/dist/esm/utils/CodeString.js.map +1 -0
- package/dist/esm/utils/ExecContext.d.ts +34 -0
- package/dist/esm/utils/ExecContext.js +168 -0
- package/dist/esm/utils/ExecContext.js.map +1 -0
- package/dist/esm/utils/Prop.d.ts +16 -0
- package/dist/esm/utils/Prop.js +80 -0
- package/dist/esm/utils/Prop.js.map +1 -0
- package/dist/esm/utils/Scope.d.ts +47 -0
- package/dist/esm/utils/Scope.js +122 -0
- package/dist/esm/utils/Scope.js.map +1 -0
- package/dist/esm/utils/errors.d.ts +10 -0
- package/dist/esm/utils/errors.js +10 -0
- package/dist/esm/utils/errors.js.map +1 -0
- package/dist/esm/utils/functionReplacements.d.ts +11 -0
- package/dist/esm/utils/functionReplacements.js +361 -0
- package/dist/esm/utils/functionReplacements.js.map +1 -0
- package/dist/esm/utils/index.d.ts +7 -0
- package/dist/esm/utils/index.js +7 -0
- package/dist/esm/utils/types.d.ts +221 -0
- package/dist/esm/utils/types.js +160 -0
- package/dist/esm/utils/types.js.map +1 -0
- package/dist/esm/utils/unraw.js +147 -0
- package/dist/esm/utils/unraw.js.map +1 -0
- package/dist/umd/Sandbox.min.js +2 -0
- package/dist/umd/Sandbox.min.js.map +1 -0
- package/dist/umd/SandboxExec.min.js +2 -0
- package/dist/umd/SandboxExec.min.js.map +1 -0
- package/package.json +70 -68
- package/build/Sandbox.js +0 -62
- package/build/SandboxExec.js +0 -214
- package/build/eval.js +0 -205
- package/build/executor.d.ts +0 -124
- package/build/executor.js +0 -1546
- package/build/parser.js +0 -1527
- package/build/unraw.js +0 -168
- package/build/utils.d.ts +0 -264
- package/build/utils.js +0 -362
- package/dist/Sandbox.d.ts +0 -25
- package/dist/Sandbox.js +0 -270
- package/dist/Sandbox.js.map +0 -1
- package/dist/Sandbox.min.js +0 -2
- package/dist/Sandbox.min.js.map +0 -1
- package/dist/SandboxExec.js +0 -218
- package/dist/SandboxExec.js.map +0 -1
- package/dist/SandboxExec.min.js +0 -2
- package/dist/SandboxExec.min.js.map +0 -1
- package/dist/executor.d.ts +0 -124
- package/dist/executor.js +0 -1550
- package/dist/executor.js.map +0 -1
- package/dist/node/Sandbox.js +0 -277
- package/dist/node/SandboxExec.d.ts +0 -66
- package/dist/node/SandboxExec.js +0 -225
- package/dist/node/eval.d.ts +0 -27
- package/dist/node/executor.d.ts +0 -124
- package/dist/node/executor.js +0 -1567
- package/dist/node/parser.d.ts +0 -154
- package/dist/node/parser.js +0 -1704
- package/dist/node/utils.d.ts +0 -264
- package/dist/node/utils.js +0 -385
- package/dist/parser.js +0 -1690
- package/dist/parser.js.map +0 -1
- package/dist/unraw.d.ts +0 -11
- package/dist/utils.d.ts +0 -264
- package/dist/utils.js +0 -365
- package/dist/utils.js.map +0 -1
- /package/{build → dist/cjs/utils}/unraw.d.ts +0 -0
- /package/dist/{node → esm/utils}/unraw.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SandboxExec.min.js","names":[],"sources":["../../src/utils/errors.ts","../../src/utils/CodeString.ts","../../src/utils/types.ts","../../src/utils/functionReplacements.ts","../../src/utils/Prop.ts","../../src/utils/Scope.ts","../../src/utils/ExecContext.ts","../../src/executor/opsRegistry.ts","../../src/executor/ops/prop.ts","../../src/executor/ops/call.ts","../../src/executor/ops/object.ts","../../src/executor/ops/literals.ts","../../src/executor/ops/unary.ts","../../src/executor/ops/assignment.ts","../../src/executor/ops/comparison.ts","../../src/executor/ops/variables.ts","../../src/executor/ops/misc.ts","../../src/executor/ops/functions.ts","../../src/executor/ops/control.ts","../../src/executor/executorUtils.ts","../../src/SandboxExec.ts"],"sourcesContent":["import { IExecContext, IScope } from './types';\n\nexport class SandboxError extends Error {}\n\nexport class SandboxExecutionQuotaExceededError extends SandboxError {}\n\nexport class SandboxExecutionTreeError extends SandboxError {}\n\nexport class SandboxCapabilityError extends SandboxError {}\n\nexport class SandboxAccessError extends SandboxError {}\n","export class CodeString {\n start: number;\n end: number;\n ref: { str: string };\n constructor(str: string | CodeString) {\n this.ref = { str: '' };\n if (str instanceof CodeString) {\n this.ref = str.ref;\n this.start = str.start;\n this.end = str.end;\n } else {\n this.ref.str = str;\n this.start = 0;\n this.end = str.length;\n }\n }\n\n substring(start: number, end?: number): CodeString {\n if (!this.length) return this;\n start = this.start + start;\n if (start < 0) {\n start = 0;\n }\n if (start > this.end) {\n start = this.end;\n }\n end = end === undefined ? this.end : this.start + end;\n if (end < 0) {\n end = 0;\n }\n if (end > this.end) {\n end = this.end;\n }\n const code = new CodeString(this);\n code.start = start;\n code.end = end;\n return code;\n }\n\n get length() {\n const len = this.end - this.start;\n return len < 0 ? 0 : len;\n }\n\n char(i: number) {\n if (this.start === this.end) return undefined;\n return this.ref.str[this.start + i];\n }\n\n toString() {\n return this.ref.str.substring(this.start, this.end);\n }\n\n trimStart() {\n const found = /^\\s+/.exec(this.toString());\n const code = new CodeString(this);\n if (found) {\n code.start += found[0].length;\n }\n return code;\n }\n\n slice(start: number, end?: number) {\n if (start < 0) {\n start = this.end - this.start + start;\n }\n if (start < 0) {\n start = 0;\n }\n if (end === undefined) {\n end = this.end - this.start;\n }\n\n if (end < 0) {\n end = this.end - this.start + end;\n }\n if (end < 0) {\n end = 0;\n }\n return this.substring(start, end);\n }\n\n trim() {\n const code = this.trimStart();\n const found = /\\s+$/.exec(code.toString());\n if (found) {\n code.end -= found[0].length;\n }\n return code;\n }\n\n valueOf() {\n return this.toString();\n }\n}\n","// Reusable AsyncFunction constructor references\nexport const AsyncFunction: Function = Object.getPrototypeOf(async function () {}).constructor;\nexport const GeneratorFunction: Function = Object.getPrototypeOf(function* () {}).constructor;\nexport const AsyncGeneratorFunction: Function = Object.getPrototypeOf(\n async function* () {},\n).constructor;\n\nimport type { IEvalContext } from '../eval';\nimport type { Change } from '../executor';\nimport type { IExecutionTree } from '../parser';\nimport type SandboxExec from '../SandboxExec';\nimport type { Scope } from './Scope';\n\nexport interface IOptionParams {\n audit?: boolean;\n forbidFunctionCalls?: boolean;\n forbidFunctionCreation?: boolean;\n prototypeWhitelist?: Map<Function, Set<string>>;\n globals?: IGlobals;\n symbolWhitelist?: ISymbolWhitelist;\n executionQuota?: bigint;\n nonBlocking?: boolean;\n haltOnSandboxError?: boolean;\n maxParserRecursionDepth?: number;\n /**\n * Additional function replacements to merge with the built-in tick-checking replacements.\n * Maps a native function to a factory that receives the IContext and returns the replacement.\n * When sandboxed code accesses a property that returns a mapped function, the factory is\n * called once per context and the result is cached and returned instead.\n */\n functionReplacements?: Map<Function, (ctx: IContext) => Function>;\n}\n\nexport interface IOptions {\n audit: boolean;\n forbidFunctionCalls: boolean;\n forbidFunctionCreation: boolean;\n prototypeWhitelist: Map<Function, Set<PropertyKey>>;\n globals: IGlobals;\n symbolWhitelist: ISymbolWhitelist;\n executionQuota?: bigint;\n haltOnSandboxError?: boolean;\n maxParserRecursionDepth: number;\n nonBlocking: boolean;\n functionReplacements: Map<\n Function,\n (ctx: IExecContext, builtInReplacement?: Function) => Function\n >;\n}\n\nexport interface IContext {\n sandbox: SandboxExec;\n globalScope: Scope;\n sandboxGlobal: ISandboxGlobal;\n globalsWhitelist: Set<any>;\n prototypeWhitelist: Map<any, Set<PropertyKey>>;\n sandboxedFunctions: WeakSet<Function>;\n sandboxSymbols: SandboxSymbolContext;\n options: IOptions;\n auditReport?: IAuditReport;\n ticks: Ticks;\n}\n\nexport interface IAuditReport {\n globalsAccess: Set<unknown>;\n prototypeAccess: { [name: string]: Set<PropertyKey> };\n}\n\nexport interface Ticks {\n ticks: bigint;\n tickLimit?: bigint;\n nextYield?: bigint;\n}\n\nexport type SubscriptionSubject = object;\n\nexport type HaltContext =\n | {\n type: 'error';\n error: Error;\n ticks: Ticks;\n scope: Scope;\n context: IExecContext;\n }\n | {\n type: 'manual';\n error?: never;\n ticks?: never;\n scope?: never;\n context?: never;\n }\n | {\n type: 'yield';\n error?: never;\n ticks?: never;\n scope?: never;\n context?: never;\n };\n\nexport interface IExecContext extends IExecutionTree {\n ctx: IContext;\n getSubscriptions: Set<(obj: SubscriptionSubject, name: string) => void>;\n setSubscriptions: WeakMap<SubscriptionSubject, Map<string, Set<(modification: Change) => void>>>;\n changeSubscriptions: WeakMap<SubscriptionSubject, Set<(modification: Change) => void>>;\n setSubscriptionsGlobal: WeakMap<\n SubscriptionSubject,\n Map<string, Set<(modification: Change) => void>>\n >;\n changeSubscriptionsGlobal: WeakMap<SubscriptionSubject, Set<(modification: Change) => void>>;\n registerSandboxFunction: (fn: (...args: any[]) => any) => void;\n evals: Map<Function, Function>;\n allowJit: boolean;\n evalContext?: IEvalContext;\n}\n\nexport interface ISandboxGlobal {\n [key: string]: unknown;\n}\n\nexport interface ISymbolWhitelist {\n [key: string]: symbol;\n}\n\nexport interface SandboxSymbolContext {\n ctor?: Function;\n registry: Map<string, symbol>;\n reverseRegistry: Map<symbol, string>;\n whitelist: ISymbolWhitelist;\n}\n\nexport type IGlobals = ISandboxGlobal;\n\nexport interface IScope {\n [key: string]: any;\n}\n\nexport const NON_BLOCKING_THRESHOLD = 50_000n;\n\nexport const reservedWords = new Set([\n 'await',\n 'break',\n 'case',\n 'catch',\n 'class',\n 'const',\n 'continue',\n 'debugger',\n 'default',\n 'delete',\n 'do',\n 'else',\n 'enum',\n 'export',\n 'extends',\n 'false',\n 'finally',\n 'for',\n 'function',\n 'if',\n 'implements',\n 'import',\n 'in',\n 'instanceof',\n 'let',\n 'new',\n 'null',\n 'return',\n 'super',\n 'switch',\n 'this',\n 'throw',\n 'true',\n 'try',\n 'typeof',\n 'var',\n 'void',\n 'while',\n 'with',\n]);\n\nexport const enum VarType {\n let = 'let',\n const = 'const',\n var = 'var',\n internal = 'internal',\n}\n\nexport const enum LispType {\n None,\n Prop,\n StringIndex,\n Let,\n Const,\n Call,\n KeyVal,\n Number,\n Return,\n Assign,\n InlineFunction,\n ArrowFunction,\n CreateArray,\n If,\n IfCase,\n InlineIf,\n InlineIfCase,\n SpreadObject,\n SpreadArray,\n ArrayProp,\n PropOptional,\n CallOptional,\n CreateObject,\n Group,\n Not,\n IncrementBefore,\n IncrementAfter,\n DecrementBefore,\n DecrementAfter,\n And,\n Or,\n StrictNotEqual,\n StrictEqual,\n Plus,\n Var,\n GlobalSymbol,\n Literal,\n Function,\n Loop,\n Try,\n Switch,\n SwitchCase,\n InternalBlock,\n Expression,\n Await,\n New,\n Throw,\n Minus,\n Divide,\n Power,\n Multiply,\n Modulus,\n Equal,\n NotEqual,\n SmallerEqualThan,\n LargerEqualThan,\n SmallerThan,\n LargerThan,\n Negative,\n Positive,\n Typeof,\n Delete,\n Instanceof,\n In,\n Inverse,\n SubractEquals,\n AddEquals,\n DivideEquals,\n PowerEquals,\n MultiplyEquals,\n ModulusEquals,\n BitNegateEquals,\n BitAndEquals,\n BitOrEquals,\n UnsignedShiftRightEquals,\n ShiftRightEquals,\n ShiftLeftEquals,\n BitAnd,\n BitOr,\n BitNegate,\n BitShiftLeft,\n BitShiftRight,\n BitUnsignedShiftRight,\n BigInt,\n LiteralIndex,\n RegexIndex,\n LoopAction,\n Void,\n True,\n NullishCoalescing,\n AndEquals,\n OrEquals,\n NullishCoalescingEquals,\n Block,\n Labeled,\n Internal,\n Yield,\n YieldDelegate,\n Hole,\n\n LispEnumSize,\n}\n","import type { IContext, IExecContext } from './types';\nimport { SandboxExecutionQuotaExceededError } from './errors';\n\n/**\n * Checks if adding `expectTicks` would exceed the tick limit, and throws SandboxExecutionQuotaExceededError\n * (which bypasses user try/catch) if so. Otherwise increments the tick counter.\n */\nexport function checkTicksAndThrow(ctx: IExecContext, expectTicks: bigint): void {\n const { ticks } = ctx.ctx;\n if (ticks.tickLimit !== undefined && ticks.tickLimit <= ticks.ticks + expectTicks) {\n throw new SandboxExecutionQuotaExceededError('Execution quota exceeded');\n }\n ticks.ticks += expectTicks;\n}\n\n// ---------------------------------------------------------------------------\n// TypedArray shared prototype detection (mirrors call.ts)\n// ---------------------------------------------------------------------------\n\nconst _typedArrayCtors = [\n Int8Array,\n Uint8Array,\n Uint8ClampedArray,\n Int16Array,\n Uint16Array,\n Int32Array,\n Uint32Array,\n Float32Array,\n Float64Array,\n];\nexport const typedArrayProtos = new Set(\n _typedArrayCtors.map((T) => Object.getPrototypeOf(T.prototype) as any),\n);\n\nfunction isTypedArray(obj: unknown): obj is { length: number } {\n return (\n ArrayBuffer.isView(obj) &&\n !(obj instanceof DataView) &&\n typedArrayProtos.has(Object.getPrototypeOf(Object.getPrototypeOf(obj)))\n );\n}\n\n// ---------------------------------------------------------------------------\n// Helpers to build replacements\n// ---------------------------------------------------------------------------\n\ntype Factory = (ctx: IExecContext) => Function;\n\nfunction makeReplacement(\n original: Function,\n getTicks: (thisArg: unknown, args: unknown[]) => bigint,\n): Factory {\n return (ctx: IExecContext) =>\n function (this: unknown, ...args: unknown[]) {\n checkTicksAndThrow(ctx, getTicks(this, args));\n return (original as any).apply(this, args);\n };\n}\n\n// ---------------------------------------------------------------------------\n// Array replacements\n// ---------------------------------------------------------------------------\n\nconst arr: any[] = [];\nconst arrProto = Array.prototype as any;\n\nfunction arrayTicks(\n complexity: 'one' | 'n' | 'nlogn' | 'arrs',\n original: Function,\n): (thisArg: unknown, args: unknown[]) => bigint {\n return (thisArg, args) => {\n if (!Array.isArray(thisArg)) return 0n;\n const n = BigInt(thisArg.length);\n switch (complexity) {\n case 'one':\n return 1n;\n case 'n':\n return n;\n case 'nlogn':\n return thisArg.length <= 1 ? 1n : n * BigInt(Math.round(Math.log2(thisArg.length)));\n case 'arrs': {\n let ticks = 0n;\n const maxDepth = original === arr.flat ? (typeof args[0] === 'number' ? args[0] : 1) : 1;\n const recurse = (a: unknown[], depth = 0) => {\n ticks += BigInt(a.length);\n if (depth >= maxDepth) return;\n for (const item of a) {\n if (Array.isArray(item)) recurse(item, depth + 1);\n }\n };\n recurse(thisArg);\n return ticks;\n }\n }\n };\n}\n\nconst arrayReplacementDefs: [Function, 'one' | 'n' | 'nlogn' | 'arrs'][] = [\n // O(1)\n [arr.push, 'one'],\n [arr.pop, 'one'],\n [arrProto.at, 'one'],\n // O(n)\n [arr.fill, 'n'],\n [arr.includes, 'n'],\n [arr.indexOf, 'n'],\n [arr.lastIndexOf, 'n'],\n [arr.find, 'n'],\n [arr.findIndex, 'n'],\n [arrProto.findLast, 'n'],\n [arrProto.findLastIndex, 'n'],\n [arr.forEach, 'n'],\n [arr.map, 'n'],\n [arr.filter, 'n'],\n [arr.reduce, 'n'],\n [arr.reduceRight, 'n'],\n [arr.every, 'n'],\n [arr.some, 'n'],\n [arr.join, 'n'],\n [arr.reverse, 'n'],\n [arr.shift, 'n'],\n [arr.unshift, 'n'],\n [arr.splice, 'n'],\n [arr.slice, 'n'],\n [arr.copyWithin, 'n'],\n [arr.entries, 'n'],\n [arr.keys, 'n'],\n [arr.values, 'n'],\n [arrProto.toReversed, 'n'],\n [arrProto.toSpliced, 'n'],\n [arrProto.with, 'n'],\n [arr.toString, 'n'],\n [arr.toLocaleString, 'n'],\n // O(n log n)\n [arr.sort, 'nlogn'],\n [arrProto.toSorted, 'nlogn'],\n // O(n) across arrays\n [arr.flat, 'arrs'],\n [arr.flatMap, 'arrs'],\n [arr.concat, 'arrs'],\n];\n\n// ---------------------------------------------------------------------------\n// String replacements\n// ---------------------------------------------------------------------------\n\nconst str = '';\nconst strProto = String.prototype as any;\n\nfunction stringTicks(complexity: 'one' | 'n'): (thisArg: unknown, _args: unknown[]) => bigint {\n return (thisArg) => {\n if (typeof thisArg !== 'string') return 0n;\n return complexity === 'one' ? 1n : BigInt(thisArg.length);\n };\n}\n\nconst stringReplacementDefs: [Function, 'one' | 'n'][] = [\n // O(1)\n [str.charAt, 'one'],\n [str.charCodeAt, 'one'],\n [str.codePointAt, 'one'],\n [strProto.at, 'one'],\n // O(n)\n [str.indexOf, 'n'],\n [str.lastIndexOf, 'n'],\n [str.includes, 'n'],\n [str.startsWith, 'n'],\n [str.endsWith, 'n'],\n [str.slice, 'n'],\n [str.substring, 'n'],\n [str.padStart, 'n'],\n [str.padEnd, 'n'],\n [str.repeat, 'n'],\n [str.split, 'n'],\n [str.replace, 'n'],\n [strProto.replaceAll, 'n'],\n [str.match, 'n'],\n [str.matchAll, 'n'],\n [str.search, 'n'],\n [str.trim, 'n'],\n [str.trimStart, 'n'],\n [str.trimEnd, 'n'],\n [str.toLowerCase, 'n'],\n [str.toUpperCase, 'n'],\n [str.toLocaleLowerCase, 'n'],\n [str.toLocaleUpperCase, 'n'],\n [str.normalize, 'n'],\n [str.concat, 'n'],\n [str.toString, 'n'],\n [str.valueOf, 'n'],\n];\n\n// ---------------------------------------------------------------------------\n// Map replacements\n// ---------------------------------------------------------------------------\n\nconst _map = new Map<never, never>();\n\nconst mapReplacementDefs: [Function, 'one' | 'n'][] = [\n [_map.get, 'one'],\n [_map.set, 'one'],\n [_map.has, 'one'],\n [_map.delete, 'one'],\n [_map.keys, 'n'],\n [_map.values, 'n'],\n [_map.entries, 'n'],\n [_map.forEach, 'n'],\n [_map.clear, 'n'],\n];\n\nfunction mapTicks(complexity: 'one' | 'n'): (thisArg: unknown, _args: unknown[]) => bigint {\n return (thisArg) => {\n if (!(thisArg instanceof Map)) return 0n;\n return complexity === 'one' ? 1n : BigInt(thisArg.size);\n };\n}\n\n// ---------------------------------------------------------------------------\n// Set replacements\n// ---------------------------------------------------------------------------\n\nconst _set = new Set<never>();\n\nconst setReplacementDefs: [Function, 'one' | 'n'][] = [\n [_set.add, 'one'],\n [_set.has, 'one'],\n [_set.delete, 'one'],\n [_set.values, 'n'],\n [_set.keys, 'n'],\n [_set.entries, 'n'],\n [_set.forEach, 'n'],\n [_set.clear, 'n'],\n];\n\nfunction setTicks(complexity: 'one' | 'n'): (thisArg: unknown, _args: unknown[]) => bigint {\n return (thisArg) => {\n if (!(thisArg instanceof Set)) return 0n;\n return complexity === 'one' ? 1n : BigInt(thisArg.size);\n };\n}\n\n// ---------------------------------------------------------------------------\n// TypedArray replacements\n// ---------------------------------------------------------------------------\n\nconst typedArrayReplacementDefs: [Function, 'one' | 'n' | 'nlogn'][] = [];\nfor (const proto of typedArrayProtos) {\n if (proto.at) typedArrayReplacementDefs.push([proto.at, 'one']);\n if (proto.set) typedArrayReplacementDefs.push([proto.set, 'one']);\n const nMethods = [\n 'fill',\n 'find',\n 'findIndex',\n 'findLast',\n 'findLastIndex',\n 'includes',\n 'indexOf',\n 'lastIndexOf',\n 'forEach',\n 'map',\n 'filter',\n 'reduce',\n 'reduceRight',\n 'every',\n 'some',\n 'join',\n 'reverse',\n 'slice',\n 'subarray',\n 'copyWithin',\n 'entries',\n 'keys',\n 'values',\n 'toReversed',\n 'with',\n 'toString',\n 'toLocaleString',\n ] as const;\n for (const m of nMethods) {\n if (proto[m]) typedArrayReplacementDefs.push([proto[m], 'n']);\n }\n if (proto.sort) typedArrayReplacementDefs.push([proto.sort, 'nlogn']);\n if (proto.toSorted) typedArrayReplacementDefs.push([proto.toSorted, 'nlogn']);\n}\n\nfunction typedArrayTicks(\n complexity: 'one' | 'n' | 'nlogn',\n): (thisArg: unknown, _args: unknown[]) => bigint {\n return (thisArg) => {\n if (!isTypedArray(thisArg)) return 0n;\n const n = BigInt(thisArg.length);\n switch (complexity) {\n case 'one':\n return 1n;\n case 'n':\n return n;\n case 'nlogn':\n return (thisArg as any).length <= 1\n ? 1n\n : n * BigInt(Math.round(Math.log2((thisArg as any).length)));\n }\n };\n}\n\n// ---------------------------------------------------------------------------\n// Math replacements\n// ---------------------------------------------------------------------------\n\nconst mathReplacementDefs: [Function][] = [[Math.max], [Math.min], [Math.hypot]];\n\n// ---------------------------------------------------------------------------\n// JSON replacements\n// ---------------------------------------------------------------------------\n\n// (JSON.stringify with subscription traversal is handled separately in LispType.Call)\n\n// ---------------------------------------------------------------------------\n// RegExp replacements\n// ---------------------------------------------------------------------------\n\nconst _re = /x/;\n\nconst regexpReplacementDefs: Function[] = [\n _re.exec,\n _re.test,\n (_re as any)[Symbol.match],\n (_re as any)[Symbol.matchAll],\n (_re as any)[Symbol.replace],\n (_re as any)[Symbol.search],\n (_re as any)[Symbol.split],\n];\n\n// ---------------------------------------------------------------------------\n// Promise replacements\n// ---------------------------------------------------------------------------\n\nconst promiseReplacementDefs: Function[] = [\n Promise.all,\n Promise.allSettled,\n Promise.race,\n ...(typeof (Promise as any).any === 'function' ? [(Promise as any).any] : []),\n];\n\n// ---------------------------------------------------------------------------\n// Object replacements\n// ---------------------------------------------------------------------------\n\nconst objectReplacementDefs: [Function, 'one' | 'n'][] = [\n [Object.prototype.hasOwnProperty, 'one'],\n [Object.prototype.propertyIsEnumerable, 'one'],\n [Object.prototype.isPrototypeOf, 'one'],\n [Object.create, 'one'],\n [Object.getPrototypeOf, 'one'],\n [Object.setPrototypeOf, 'one'],\n [Object.is, 'one'],\n [Object.defineProperty, 'one'],\n [Object.getOwnPropertyDescriptor, 'one'],\n [Object.isExtensible, 'one'],\n [Object.preventExtensions, 'one'],\n [Object.keys, 'n'],\n [Object.values, 'n'],\n [Object.entries, 'n'],\n [Object.assign, 'n'],\n [Object.fromEntries, 'n'],\n [Object.getOwnPropertyNames, 'n'],\n [Object.getOwnPropertySymbols, 'n'],\n [Object.getOwnPropertyDescriptors, 'n'],\n [Object.freeze, 'n'],\n [Object.seal, 'n'],\n [Object.isFrozen, 'n'],\n [Object.isSealed, 'n'],\n];\n\nfunction objectTicks(\n complexity: 'one' | 'n',\n isStatic: boolean,\n): (thisArg: unknown, args: unknown[]) => bigint {\n return (thisArg, args) => {\n if (complexity === 'one') return 1n;\n const target = isStatic ? args[0] : thisArg;\n if (target !== null && typeof target === 'object')\n return BigInt(Object.keys(target as object).length);\n return 1n;\n };\n}\n\n// Static Object methods whose tick count is based on args[0] key count\nconst staticObjectMethods = new Set<Function>([\n Object.keys,\n Object.values,\n Object.entries,\n Object.assign,\n Object.fromEntries,\n Object.getOwnPropertyNames,\n Object.getOwnPropertySymbols,\n Object.getOwnPropertyDescriptors,\n Object.freeze,\n Object.seal,\n Object.isFrozen,\n Object.isSealed,\n]);\n\n// ---------------------------------------------------------------------------\n// Array.from / Array.fromAsync\n// ---------------------------------------------------------------------------\n\n// ---------------------------------------------------------------------------\n// Build the default replacements map\n// ---------------------------------------------------------------------------\n\nexport const DEFAULT_FUNCTION_REPLACEMENTS = new Map<Function, Factory>();\nexport const THIS_DEPENDENT_FUNCTION_REPLACEMENTS = new Set<Function>();\n\n// Array\nfor (const [original, complexity] of arrayReplacementDefs) {\n if (!original) continue;\n DEFAULT_FUNCTION_REPLACEMENTS.set(\n original,\n makeReplacement(original, arrayTicks(complexity, original)),\n );\n THIS_DEPENDENT_FUNCTION_REPLACEMENTS.add(original);\n}\n\n// String\nfor (const [original, complexity] of stringReplacementDefs) {\n if (!original) continue;\n DEFAULT_FUNCTION_REPLACEMENTS.set(original, makeReplacement(original, stringTicks(complexity)));\n THIS_DEPENDENT_FUNCTION_REPLACEMENTS.add(original);\n}\n\n// Map\nfor (const [original, complexity] of mapReplacementDefs) {\n if (!original) continue;\n DEFAULT_FUNCTION_REPLACEMENTS.set(original, makeReplacement(original, mapTicks(complexity)));\n THIS_DEPENDENT_FUNCTION_REPLACEMENTS.add(original);\n}\n\n// Set\nfor (const [original, complexity] of setReplacementDefs) {\n if (!original) continue;\n DEFAULT_FUNCTION_REPLACEMENTS.set(original, makeReplacement(original, setTicks(complexity)));\n THIS_DEPENDENT_FUNCTION_REPLACEMENTS.add(original);\n}\n\n// TypedArray\nfor (const [original, complexity] of typedArrayReplacementDefs) {\n if (!original) continue;\n DEFAULT_FUNCTION_REPLACEMENTS.set(\n original,\n makeReplacement(original, typedArrayTicks(complexity)),\n );\n THIS_DEPENDENT_FUNCTION_REPLACEMENTS.add(original);\n}\n\n// Math — O(n) on arg count\nfor (const [original] of mathReplacementDefs) {\n if (!original) continue;\n DEFAULT_FUNCTION_REPLACEMENTS.set(\n original,\n makeReplacement(original, (_thisArg, args) => BigInt(args.length)),\n );\n}\n\n// JSON — O(n) on string/object size\nfor (const original of [JSON.parse, JSON.stringify]) {\n DEFAULT_FUNCTION_REPLACEMENTS.set(\n original,\n makeReplacement(original, (_thisArg, args) => {\n const target = args[0];\n if (typeof target === 'string') return BigInt(target.length);\n if (target !== null && typeof target === 'object')\n return BigInt(Object.keys(target as object).length);\n return 1n;\n }),\n );\n}\n\n// RegExp — O(n) on input string length\nfor (const original of regexpReplacementDefs) {\n if (!original) continue;\n DEFAULT_FUNCTION_REPLACEMENTS.set(\n original,\n makeReplacement(original, (_thisArg, args) => {\n const input = args[0];\n return typeof input === 'string' ? BigInt(input.length) : 1n;\n }),\n );\n THIS_DEPENDENT_FUNCTION_REPLACEMENTS.add(original);\n}\n\n// Promise.all/allSettled/race/any — O(n) on iterable length\nfor (const original of promiseReplacementDefs) {\n if (!original) continue;\n DEFAULT_FUNCTION_REPLACEMENTS.set(\n original,\n makeReplacement(original, (_thisArg, args) => {\n const iterable = args[0];\n return Array.isArray(iterable) ? BigInt(iterable.length) : 0n;\n }),\n );\n}\n\n// Object static & instance methods\nfor (const [original, complexity] of objectReplacementDefs) {\n if (!original) continue;\n const isStatic = staticObjectMethods.has(original);\n DEFAULT_FUNCTION_REPLACEMENTS.set(\n original,\n makeReplacement(original, objectTicks(complexity, isStatic)),\n );\n if (!isStatic) {\n THIS_DEPENDENT_FUNCTION_REPLACEMENTS.add(original);\n }\n}\n\n// Array.from — O(n) on source length\nif (Array.from) {\n DEFAULT_FUNCTION_REPLACEMENTS.set(\n Array.from,\n makeReplacement(Array.from, (_thisArg, args) => {\n const source = args[0];\n if (source != null && typeof (source as any).length === 'number')\n return BigInt((source as any).length);\n return 0n;\n }),\n );\n}\n\n// Array.fromAsync — O(n) on source length (if available)\nif (typeof (Array as any).fromAsync === 'function') {\n const fromAsync = (Array as any).fromAsync as Function;\n DEFAULT_FUNCTION_REPLACEMENTS.set(\n fromAsync,\n makeReplacement(fromAsync, (_thisArg, args) => {\n const source = args[0];\n if (source != null && typeof (source as any).length === 'number')\n return BigInt((source as any).length);\n return 0n;\n }),\n );\n}\n","import type { IExecContext } from './types';\nimport { THIS_DEPENDENT_FUNCTION_REPLACEMENTS } from './functionReplacements';\n\nconst boundFunctionCache = new WeakMap<Function, WeakMap<object, Function>>();\nconst replacementReceiver = new WeakMap<Function, object>();\n\nexport class Prop<T = unknown> {\n constructor(\n public context: T,\n public prop: PropertyKey,\n public isConst = false,\n public isGlobal = false,\n public isVariable = false,\n public isInternal = false,\n ) {}\n\n get<T = unknown>(context: IExecContext): T {\n const ctx = this.context;\n if (ctx === undefined) throw new ReferenceError(`${this.prop.toString()} is not defined`);\n if (ctx === null)\n throw new TypeError(`Cannot read properties of null, (reading '${this.prop.toString()}')`);\n context.getSubscriptions.forEach((cb) => cb(ctx, this.prop.toString()));\n const val = (ctx as any)[this.prop];\n return getReplacementValue(val, context, ctx) as T;\n }\n}\n\nexport function hasOwnProperty(obj: unknown, prop: PropertyKey): boolean {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function getReplacementReceiver(fn: Function) {\n return replacementReceiver.get(fn);\n}\n\nexport function resolveSandboxProp(val: unknown, context: IExecContext, prop?: Prop) {\n if (!val) return;\n if (val instanceof Prop) {\n if (!prop) {\n prop = val;\n }\n val = val.get(context);\n }\n const p = prop?.prop || 'prop';\n if (val === globalThis) {\n return new Prop(\n {\n [p]: context.ctx.sandboxGlobal,\n },\n p,\n prop?.isConst || false,\n false,\n prop?.isVariable || false,\n );\n }\n if (prop && !prop.isVariable) {\n return;\n }\n const replacement = getReplacementValue(val, context, prop?.context);\n if (replacement !== val) {\n return new Prop(\n { [p]: replacement },\n p,\n prop?.isConst || false,\n prop?.isGlobal || false,\n prop?.isVariable || false,\n );\n }\n}\n\nfunction getReplacementValue(val: unknown, context: IExecContext, bindContext?: unknown) {\n if (typeof val !== 'function') {\n return val;\n }\n const replacement = context.evals.get(val as Function);\n if (replacement === undefined) {\n return val;\n }\n if (!shouldBindReplacement(val as Function, bindContext, context)) {\n return replacement;\n }\n return bindReplacement(replacement, bindContext as object, val as Function, context);\n}\n\nfunction shouldBindReplacement(original: Function, bindContext: unknown, context: IExecContext) {\n return (\n THIS_DEPENDENT_FUNCTION_REPLACEMENTS.has(original) &&\n bindContext !== null &&\n (typeof bindContext === 'object' || typeof bindContext === 'function') &&\n bindContext !== context.ctx.sandboxGlobal &&\n !context.ctx.globalsWhitelist.has(bindContext)\n );\n}\n\nfunction bindReplacement(\n replacement: Function,\n bindContext: object,\n original: Function,\n context: IExecContext,\n) {\n let cache = boundFunctionCache.get(replacement);\n if (!cache) {\n cache = new WeakMap<object, Function>();\n boundFunctionCache.set(replacement, cache);\n }\n\n let bound = cache.get(bindContext);\n if (bound) {\n return bound;\n }\n\n bound = function (this: unknown, ...args: unknown[]) {\n return replacement.apply(this, args);\n };\n\n redefineFunctionMetadata(bound, original);\n context.ctx.sandboxedFunctions.add(bound);\n replacementReceiver.set(bound, bindContext);\n cache.set(bindContext, bound);\n return bound;\n}\n\nfunction redefineFunctionMetadata(\n target: Function,\n source: Function,\n overrides: Partial<Record<'name' | 'length', string | number>> = {},\n) {\n for (const key of ['name', 'length'] as const) {\n const descriptor = Object.getOwnPropertyDescriptor(source, key);\n if (descriptor?.configurable) {\n Object.defineProperty(target, key, {\n ...descriptor,\n value: overrides[key] ?? source[key],\n });\n }\n }\n}\n","import { reservedWords, VarType } from './types';\nimport { Prop, resolveSandboxProp, hasOwnProperty } from './Prop';\nimport { SandboxError } from './errors';\nimport type { IExecContext, IScope } from './types';\n\nfunction keysOnly(obj: unknown): Record<string, true> {\n const ret: Record<string, true> = Object.assign({}, obj);\n for (const key in ret) {\n ret[key] = true;\n }\n return ret;\n}\n\nexport type Unknown = undefined | null | Record<string | number, unknown>;\n\nexport class Scope {\n parent: Scope | null;\n const: { [key: string]: true } = {};\n let: { [key: string]: true } = {};\n var: { [key: string]: true } = {};\n internal: { [key: string]: true } = {};\n globals: { [key: string]: true };\n allVars: { [key: string]: unknown } & object;\n internalVars: { [key: string]: unknown } = {};\n functionThis?: Unknown;\n constructor(parent: Scope | null, vars = {}, functionThis?: Unknown) {\n const isFuncScope = functionThis !== undefined || parent === null;\n this.parent = parent;\n this.allVars = vars;\n this.let = isFuncScope ? this.let : keysOnly(vars);\n this.var = isFuncScope ? keysOnly(vars) : this.var;\n this.globals = parent === null ? keysOnly(vars) : {};\n this.functionThis = functionThis;\n }\n\n get(key: string, internal: boolean): Prop {\n const isThis = key === 'this';\n const scope = this.getWhereValScope(key, isThis, internal);\n if (scope && isThis) {\n return new Prop({ this: scope.functionThis }, key, false, false, true);\n }\n if (!scope) {\n return new Prop(undefined, key);\n }\n if (internal && scope.internalVars[key]) {\n return new Prop(scope.internalVars, key, false, false, true, true);\n }\n return new Prop(\n scope.allVars,\n key,\n hasOwnProperty(scope.const, key),\n hasOwnProperty(scope.globals, key),\n true,\n );\n }\n\n set(key: string, val: unknown, internal: boolean) {\n if (key === 'this') throw new SyntaxError('\"this\" cannot be assigned');\n if (reservedWords.has(key)) throw new SyntaxError(\"Unexepected token '\" + key + \"'\");\n const prop = this.get(key, internal);\n if (prop.context === undefined) {\n throw new ReferenceError(`Variable '${key}' was not declared.`);\n }\n if (prop.context === null) {\n throw new TypeError(`Cannot set properties of null, (setting '${key}')`);\n }\n if (prop.isConst) {\n throw new TypeError(`Assignment to constant variable`);\n }\n if (prop.isGlobal) {\n throw new SandboxError(`Cannot override global variable '${key}'`);\n }\n (prop.context as any)[prop.prop] = val;\n return prop;\n }\n\n getWhereValScope(key: string, isThis: boolean, internal: boolean): Scope | null {\n let scope: Scope = this;\n if (isThis) {\n do {\n if (scope.functionThis !== undefined) return scope;\n scope = scope.parent!;\n } while (scope !== null);\n return null;\n }\n do {\n if (\n internal &&\n key in scope.internalVars &&\n !(key in {} && !hasOwnProperty(scope.internalVars, key))\n ) {\n return scope;\n }\n if (key in scope.allVars && !(key in {} && !hasOwnProperty(scope.allVars, key))) {\n return scope;\n }\n scope = scope.parent!;\n } while (scope !== null);\n return null;\n }\n\n getWhereVarScope(key: string, localScope: boolean, internal: boolean): Scope {\n let scope: Scope = this;\n do {\n if (\n internal &&\n key in scope.internalVars &&\n !(key in {} && !hasOwnProperty(scope.internalVars, key))\n ) {\n return scope;\n }\n if (key in scope.allVars && !(key in {} && !hasOwnProperty(scope.allVars, key))) {\n return scope;\n }\n if (scope.parent === null || localScope || scope.functionThis !== undefined) {\n return scope;\n }\n scope = scope.parent!;\n } while (scope !== null);\n return scope;\n }\n\n declare(key: string, type: VarType, value: unknown, isGlobal: boolean, internal: boolean): Prop {\n if (key === 'this') throw new SyntaxError('\"this\" cannot be declared');\n if (reservedWords.has(key)) throw new SyntaxError(\"Unexepected token '\" + key + \"'\");\n const existingScope = this.getWhereVarScope(key, type !== VarType.var, internal);\n if (type === VarType.var) {\n if (existingScope.var[key]) {\n existingScope.allVars[key] = value;\n if (!isGlobal) {\n delete existingScope.globals[key];\n } else {\n existingScope.globals[key] = true;\n }\n return new Prop(existingScope.allVars, key, false, existingScope.globals[key], true);\n } else if (key in existingScope.allVars) {\n throw new SyntaxError(`Identifier '${key}' has already been declared`);\n }\n }\n if (key in existingScope.allVars || key in existingScope.internalVars) {\n throw new SyntaxError(`Identifier '${key}' has already been declared`);\n }\n\n if (isGlobal) {\n existingScope.globals[key] = true;\n }\n existingScope[type][key] = true;\n if (type === VarType.internal) {\n existingScope.internalVars[key] = value;\n } else {\n existingScope.allVars[key] = value;\n }\n\n return new Prop(\n type === VarType.internal ? this.internalVars : this.allVars,\n key,\n type === VarType.const,\n isGlobal,\n true,\n type === VarType.internal,\n );\n }\n}\n\nexport class FunctionScope implements IScope {}\n\nexport class LocalScope implements IScope {}\n\nexport const optional = {};\n\nexport class DelayedSynchronousResult {\n readonly result: unknown;\n constructor(cb: () => unknown) {\n this.result = cb();\n }\n}\n\nexport function delaySynchronousResult(cb: () => Promise<unknown>) {\n return new DelayedSynchronousResult(cb);\n}\n\nexport function sanitizeProp(\n value: unknown,\n context: IExecContext,\n cache = new WeakSet<object>(),\n): unknown {\n if (value === null || (typeof value !== 'object' && typeof value !== 'function')) return value;\n\n value = resolveSandboxProp(value, context) || value;\n\n if (value instanceof Prop) {\n value = value.get(context);\n }\n\n if (value === optional) {\n return undefined;\n }\n\n return value;\n}\n\nexport function sanitizeScope(scope: IScope, context: IExecContext, cache = new WeakSet<object>()) {\n if (cache.has(scope)) return;\n cache.add(scope);\n for (const key in scope) {\n const val = scope[key];\n if (val !== null && typeof val === 'object') {\n sanitizeScope(val, context, cache);\n }\n scope[key] = sanitizeProp(val, context);\n }\n}\n\nexport function sanitizeScopes(\n scopes: IScope[],\n context: IExecContext,\n cache = new WeakSet<object>(),\n) {\n for (const scope of scopes) {\n sanitizeScope(scope, context, cache);\n }\n}\n","import type { IEvalContext } from '../eval';\nimport type { Change } from '../executor';\nimport { DEFAULT_FUNCTION_REPLACEMENTS } from './functionReplacements';\nimport type { IConstants, IExecutionTree, Lisp, LispItem } from '../parser';\nimport type SandboxExec from '../SandboxExec';\nimport {\n AsyncFunction,\n GeneratorFunction,\n AsyncGeneratorFunction,\n NON_BLOCKING_THRESHOLD,\n LispType,\n type IContext,\n type IExecContext,\n type IOptions,\n type ISymbolWhitelist,\n type ISandboxGlobal,\n type SandboxSymbolContext,\n type SubscriptionSubject,\n} from './types';\nimport { Scope } from './Scope';\nimport { hasOwnProperty } from './Prop';\n\nexport class ExecContext implements IExecContext {\n constructor(\n public ctx: IContext,\n public constants: IConstants,\n public tree: Lisp[],\n public getSubscriptions: Set<(obj: SubscriptionSubject, name: string) => void>,\n public setSubscriptions: WeakMap<\n SubscriptionSubject,\n Map<string, Set<(modification: Change) => void>>\n >,\n public changeSubscriptions: WeakMap<SubscriptionSubject, Set<(modification: Change) => void>>,\n public setSubscriptionsGlobal: WeakMap<\n SubscriptionSubject,\n Map<string, Set<(modification: Change) => void>>\n >,\n public changeSubscriptionsGlobal: WeakMap<\n SubscriptionSubject,\n Set<(modification: Change) => void>\n >,\n public evals: Map<any, any>,\n public registerSandboxFunction: (fn: (...args: any[]) => any) => void,\n public allowJit: boolean,\n public evalContext?: IEvalContext,\n ) {}\n}\n\nfunction createSandboxSymbolContext(symbolWhitelist: ISymbolWhitelist): SandboxSymbolContext {\n return {\n registry: new Map<string, symbol>(),\n reverseRegistry: new Map<symbol, string>(),\n whitelist: { ...symbolWhitelist },\n };\n}\n\nconst RESERVED_SYMBOL_PROPERTIES = new Set(['length', 'name', 'prototype', 'for', 'keyFor']);\n\nfunction copyWhitelistedSymbols(target: Function, symbolWhitelist: ISymbolWhitelist) {\n for (const [key, value] of Object.entries(symbolWhitelist)) {\n if (RESERVED_SYMBOL_PROPERTIES.has(key)) continue;\n const descriptor = Object.getOwnPropertyDescriptor(Symbol, key);\n if (descriptor) {\n Object.defineProperty(target, key, descriptor);\n }\n }\n}\n\nexport function getSandboxSymbolCtor(symbols: SandboxSymbolContext) {\n if (symbols.ctor) {\n return symbols.ctor;\n }\n\n function SandboxSymbol(this: unknown, description?: unknown) {\n if (new.target) {\n throw new TypeError('Symbol is not a constructor');\n }\n return Symbol(description === undefined ? undefined : String(description));\n }\n\n copyWhitelistedSymbols(SandboxSymbol, symbols.whitelist);\n Object.defineProperties(SandboxSymbol, {\n prototype: {\n value: Symbol.prototype,\n enumerable: false,\n configurable: false,\n writable: false,\n },\n for: {\n value(key: unknown) {\n const stringKey = String(key);\n let symbol = symbols.registry.get(stringKey);\n if (!symbol) {\n symbol = Symbol(stringKey);\n symbols.registry.set(stringKey, symbol);\n symbols.reverseRegistry.set(symbol, stringKey);\n }\n return symbol;\n },\n enumerable: false,\n configurable: true,\n writable: true,\n },\n keyFor: {\n value(symbol: unknown) {\n return typeof symbol === 'symbol' ? symbols.reverseRegistry.get(symbol) : undefined;\n },\n enumerable: false,\n configurable: true,\n writable: true,\n },\n });\n\n symbols.ctor = SandboxSymbol;\n return SandboxSymbol;\n}\n\nfunction SandboxGlobal() {}\ninterface SandboxGlobalConstructor {\n new (): ISandboxGlobal;\n}\nexport function sandboxedGlobal(globals: ISandboxGlobal): SandboxGlobalConstructor {\n SG.prototype = SandboxGlobal.prototype;\n return SG as unknown as SandboxGlobalConstructor;\n function SG(this: ISandboxGlobal) {\n for (const i in globals) {\n this[i] = globals[i];\n }\n }\n}\n\nexport function createContext(sandbox: SandboxExec, options: IOptions): IContext {\n const sandboxSymbols = createSandboxSymbolContext(options.symbolWhitelist);\n const SandboxGlobal = sandboxedGlobal(options.globals);\n const sandboxGlobal = new SandboxGlobal();\n const context: IContext = {\n sandbox: sandbox,\n globalsWhitelist: new Set(Object.values(options.globals)),\n prototypeWhitelist: new Map([...options.prototypeWhitelist].map((a) => [a[0].prototype, a[1]])),\n sandboxSymbols,\n options,\n globalScope: new Scope(null, sandboxGlobal, sandboxGlobal),\n sandboxGlobal,\n ticks: {\n ticks: 0n,\n tickLimit: options.executionQuota,\n nextYield: options.nonBlocking ? NON_BLOCKING_THRESHOLD : undefined,\n },\n sandboxedFunctions: new WeakSet<Function>(),\n };\n context.prototypeWhitelist.set(Object.getPrototypeOf(sandboxGlobal), new Set());\n context.prototypeWhitelist.set(Object.getPrototypeOf([][Symbol.iterator]()) as object, new Set());\n // Whitelist Generator and AsyncGenerator prototype chains\n const genProto = Object.getPrototypeOf((function* () {})());\n context.prototypeWhitelist.set(Object.getPrototypeOf(genProto), new Set());\n const asyncGenProto = Object.getPrototypeOf((async function* () {})());\n context.prototypeWhitelist.set(Object.getPrototypeOf(asyncGenProto), new Set());\n // Fetch API 构造函数本身(静态方法如 Response.json)也加白名单\n if (typeof Response !== 'undefined')\n context.prototypeWhitelist.set(Response.prototype, new Set());\n if (typeof Request !== 'undefined') context.prototypeWhitelist.set(Request.prototype, new Set());\n if (typeof Headers !== 'undefined') context.prototypeWhitelist.set(Headers.prototype, new Set());\n if (typeof FormData !== 'undefined')\n context.prototypeWhitelist.set(FormData.prototype, new Set());\n if (typeof Blob !== 'undefined') context.prototypeWhitelist.set(Blob.prototype, new Set());\n if (typeof URLSearchParams !== 'undefined')\n context.prototypeWhitelist.set(URLSearchParams.prototype, new Set());\n if (typeof AbortController !== 'undefined')\n context.prototypeWhitelist.set(AbortController.prototype, new Set());\n if (typeof ReadableStream !== 'undefined')\n context.prototypeWhitelist.set(ReadableStream.prototype, new Set());\n if (typeof TransformStream !== 'undefined')\n context.prototypeWhitelist.set(TransformStream.prototype, new Set());\n if (typeof WritableStream !== 'undefined')\n context.prototypeWhitelist.set(WritableStream.prototype, new Set());\n if (typeof TextEncoder !== 'undefined')\n context.prototypeWhitelist.set(TextEncoder.prototype, new Set());\n if (typeof TextDecoder !== 'undefined')\n context.prototypeWhitelist.set(TextDecoder.prototype, new Set());\n return context;\n}\n\nexport function createExecContext(\n sandbox: {\n readonly setSubscriptions: WeakMap<\n SubscriptionSubject,\n Map<string, Set<(modification: Change) => void>>\n >;\n readonly changeSubscriptions: WeakMap<SubscriptionSubject, Set<(modification: Change) => void>>;\n readonly sandboxFunctions: WeakMap<(...args: any[]) => any, IExecContext>;\n readonly context: IContext;\n },\n executionTree: IExecutionTree,\n evalContext?: IEvalContext,\n): IExecContext {\n const evals = new Map();\n const execContext: IExecContext = new ExecContext(\n sandbox.context,\n executionTree.constants,\n executionTree.tree,\n new Set<(obj: SubscriptionSubject, name: string) => void>(),\n new WeakMap<SubscriptionSubject, Map<string, Set<(modification: Change) => void>>>(),\n new WeakMap<SubscriptionSubject, Set<(modification: Change) => void>>(),\n sandbox.setSubscriptions,\n sandbox.changeSubscriptions,\n evals,\n (fn: any) => sandbox.sandboxFunctions.set(fn, execContext),\n !!evalContext,\n evalContext,\n );\n if (evalContext) {\n const func = evalContext.sandboxFunction(execContext);\n const asyncFunc = evalContext.sandboxAsyncFunction(execContext);\n const genFunc = evalContext.sandboxGeneratorFunction(execContext);\n const asyncGenFunc = evalContext.sandboxAsyncGeneratorFunction(execContext);\n const sandboxSymbol = evalContext.sandboxedSymbol(execContext);\n evals.set(Function, func);\n evals.set(AsyncFunction, asyncFunc);\n evals.set(GeneratorFunction, genFunc);\n evals.set(AsyncGeneratorFunction, asyncGenFunc);\n evals.set(Symbol, sandboxSymbol);\n evals.set(eval, evalContext.sandboxedEval(func, execContext));\n evals.set(setTimeout, evalContext.sandboxedSetTimeout(func, execContext));\n evals.set(setInterval, evalContext.sandboxedSetInterval(func, execContext));\n evals.set(clearTimeout, evalContext.sandboxedClearTimeout(execContext));\n evals.set(clearInterval, evalContext.sandboxedClearInterval(execContext));\n\n for (const [original, factory] of DEFAULT_FUNCTION_REPLACEMENTS) {\n evals.set(original, factory(execContext));\n }\n\n for (const [original, factory] of sandbox.context.options.functionReplacements) {\n evals.set(original, factory(execContext, evals.get(original)));\n }\n\n const ptwl = sandbox.context.prototypeWhitelist;\n\n for (const [key, value] of evals) {\n if (!ptwl.has(key.prototype)) {\n ptwl.set(key.prototype, new Set());\n }\n if (!ptwl.has(value.prototype)) {\n ptwl.set(value.prototype, ptwl.get(key.prototype) || new Set());\n }\n if (sandbox.context.globalsWhitelist.has(key)) {\n sandbox.context.globalsWhitelist.add(value);\n }\n if (hasOwnProperty(sandbox.context.sandboxGlobal, key.name)) {\n sandbox.context.sandboxGlobal[key.name] = value;\n }\n }\n if (sandbox.context.sandboxGlobal.globalThis) {\n sandbox.context.sandboxGlobal.globalThis = sandbox.context.sandboxGlobal;\n }\n }\n return execContext;\n}\n\nexport function isLisp<Type extends Lisp = Lisp>(item: LispItem | LispItem): item is Type {\n return (\n Array.isArray(item) &&\n typeof item[0] === 'number' &&\n item[0] !== LispType.None &&\n item[0] !== LispType.True\n );\n}\n","/**\n * Ops registry — kept separate from executorUtils.ts so that ops/*.ts files\n * can import addOps without creating a circular initialization problem.\n *\n * executorUtils.ts imports from here; ops/*.ts imports from here too.\n * No imports from executorUtils.ts allowed in this file.\n */\nimport { LispType } from '../utils';\nimport type { LispItem } from '../parser';\nimport type { IExecContext, Ticks } from '../utils';\nimport type { Scope } from '../utils';\nimport type { YieldValue, Done } from './executorUtils';\n\nexport type ControlFlowAction = 'break' | 'continue';\n\nexport interface ControlFlowTarget {\n label?: string;\n acceptsBreak: boolean;\n acceptsContinue: boolean;\n acceptsUnlabeledBreak: boolean;\n acceptsUnlabeledContinue: boolean;\n}\n\nexport type ControlFlowTargets = readonly ControlFlowTarget[] | undefined;\n\nexport type Execution = <T = any>(\n ticks: Ticks,\n tree: LispItem,\n scope: Scope,\n context: IExecContext,\n done: Done<T>,\n statementLabels: ControlFlowTargets,\n internal: boolean,\n generatorYield: ((yv: YieldValue, done?: Done) => void) | undefined,\n) => void;\n\nexport type OpsCallbackParams<a, b, obj, bobj> = {\n op: LispType;\n exec: Execution;\n a: a;\n b: b;\n obj: obj;\n bobj: bobj;\n ticks: Ticks;\n tree: LispItem;\n scope: Scope;\n context: IExecContext;\n done: Done;\n statementLabels: ControlFlowTargets;\n internal: boolean;\n generatorYield: ((yv: YieldValue, done?: Done) => void) | undefined;\n};\n\ntype OpCallback<a, b, obj, bobj> = (params: OpsCallbackParams<a, b, obj, bobj>) => void;\n\nexport const ops = new Map<LispType, OpCallback<any, any, any, any>>();\n\nexport function addOps<a = unknown, b = unknown, obj = unknown, bobj = unknown>(\n type: LispType,\n cb: OpCallback<a, b, obj, bobj>,\n) {\n ops.set(type, cb);\n}\n","import { addOps, hasPossibleProperties, isPropertyKey } from '../executorUtils';\nimport {\n LispType,\n Prop,\n SandboxAccessError,\n resolveSandboxProp,\n hasOwnProperty,\n} from '../../utils';\n\naddOps<unknown, PropertyKey>(LispType.Prop, ({ done, a, b, obj, context, scope, internal }) => {\n if (a === null) {\n throw new TypeError(`Cannot read properties of null (reading '${b?.toString()}')`);\n }\n\n if (!isPropertyKey(b)) {\n b = `${b}`;\n }\n\n if (a === undefined && obj === undefined && typeof b === 'string') {\n // is variable access\n const prop = scope.get(b, internal);\n if (prop.context === undefined) {\n throw new ReferenceError(`${b} is not defined`);\n }\n if (prop.context === context.ctx.sandboxGlobal) {\n if (context.ctx.options.audit) {\n context.ctx.auditReport?.globalsAccess.add(b);\n }\n }\n const val = (prop.context as any)[prop.prop];\n const p = resolveSandboxProp(val, context, prop) || prop;\n\n done(undefined, p);\n return;\n } else if (a === undefined) {\n throw new TypeError(`Cannot read properties of undefined (reading '${b.toString()}')`);\n }\n\n if (!hasPossibleProperties(a)) {\n done(undefined, new Prop(undefined, b));\n return;\n }\n\n const prototypeAccess = typeof a === 'function' || !hasOwnProperty(a, b);\n\n if (context.ctx.options.audit && prototypeAccess) {\n let prot: {} = Object.getPrototypeOf(a);\n do {\n if (hasOwnProperty(prot, b)) {\n if (\n context.ctx.auditReport &&\n !context.ctx.auditReport.prototypeAccess[prot.constructor.name]\n ) {\n context.ctx.auditReport.prototypeAccess[prot.constructor.name] = new Set();\n }\n context.ctx.auditReport?.prototypeAccess[prot.constructor.name].add(b);\n }\n } while ((prot = Object.getPrototypeOf(prot)));\n }\n\n if (prototypeAccess) {\n if (typeof a === 'function') {\n if (hasOwnProperty(a, b)) {\n const whitelist = context.ctx.prototypeWhitelist.get(a.prototype);\n if (\n !(whitelist && (!whitelist.size || whitelist.has(b))) &&\n !context.ctx.sandboxedFunctions.has(a)\n ) {\n throw new SandboxAccessError(\n `Static method or property access not permitted: ${a.name}.${b.toString()}`,\n );\n }\n }\n }\n\n let prot: {} = a;\n while ((prot = Object.getPrototypeOf(prot))) {\n if (hasOwnProperty(prot, b) || b === '__proto__') {\n const whitelist = context.ctx.prototypeWhitelist.get(prot);\n if (\n (whitelist && (!whitelist.size || whitelist.has(b))) ||\n context.ctx.sandboxedFunctions.has(prot.constructor)\n ) {\n break;\n }\n if (b === '__proto__') {\n throw new SandboxAccessError(`Access to prototype of global object is not permitted`);\n }\n throw new SandboxAccessError(\n `Method or property access not permitted: ${prot.constructor.name}.${b.toString()}`,\n );\n }\n }\n }\n\n if (typeof a === 'function') {\n if (b === 'prototype' && !context.ctx.sandboxedFunctions.has(a)) {\n throw new SandboxAccessError(`Access to prototype of global object is not permitted`);\n }\n if (['caller', 'callee', 'arguments'].includes(b as string)) {\n throw new SandboxAccessError(`Access to '${b as string}' property is not permitted`);\n }\n }\n const val = a[b as keyof typeof a] as unknown;\n\n if (b === '__proto__' && !context.ctx.sandboxedFunctions.has(val?.constructor as any)) {\n throw new SandboxAccessError(`Access to prototype of global object is not permitted`);\n }\n\n const p = resolveSandboxProp(val, context, new Prop(a, b, false, false));\n if (p) {\n done(undefined, p);\n return;\n }\n\n const isSandboxGlobal = a === context.ctx.sandboxGlobal;\n const g =\n (!isSandboxGlobal && obj instanceof Prop && obj.isGlobal) ||\n (typeof a === 'function' && !context.ctx.sandboxedFunctions.has(a)) ||\n context.ctx.globalsWhitelist.has(a) ||\n (isSandboxGlobal &&\n typeof b === 'string' &&\n hasOwnProperty(context.ctx.globalScope.globals, b));\n\n done(undefined, new Prop(a, b, false, g, false));\n});\n\naddOps<unknown, string>(LispType.StringIndex, ({ done, b, context }) =>\n done(undefined, context.constants.strings[parseInt(b)]),\n);\n","import { addOps, arrayChange, Change, checkHaltExpectedTicks, SpreadArray } from '../executorUtils';\nimport {\n checkTicksAndThrow,\n typedArrayProtos as _typedArrayProtos,\n} from '../../utils/functionReplacements';\nimport type { Lisp } from '../../parser';\nimport {\n DelayedSynchronousResult,\n getReplacementReceiver,\n LispType,\n SandboxAccessError,\n SandboxCapabilityError,\n sanitizeProp,\n} from '../../utils';\n\naddOps<unknown, Lisp[], any>(LispType.Call, (params) => {\n const { done, a, b, obj, context } = params;\n if (context.ctx.options.forbidFunctionCalls)\n throw new SandboxCapabilityError('Function invocations are not allowed');\n if (typeof a !== 'function') {\n throw new TypeError(\n `${typeof obj?.prop === 'symbol' ? 'Symbol' : obj?.prop} is not a function`,\n );\n }\n const vals = new Array<unknown>(b.length);\n let valsLen = 0;\n for (let i = 0; i < b.length; i++) {\n const item = b[i];\n if (item instanceof SpreadArray) {\n const expanded = Array.isArray(item.item) ? item.item : [...(item.item as Iterable<unknown>)];\n if (checkHaltExpectedTicks(params, BigInt(expanded.length))) return;\n for (let j = 0; j < expanded.length; j++)\n vals[valsLen++] = sanitizeProp(expanded[j], context);\n } else {\n vals[valsLen++] = sanitizeProp(item, context);\n }\n }\n vals.length = valsLen;\n\n if (a === String) {\n const result = String(vals[0]);\n checkTicksAndThrow(context, BigInt(result.length));\n done(undefined, result);\n return;\n }\n\n if (typeof obj === 'function') {\n // Direct function call (not a method): obj is the function itself\n const evl = context.evals.get(obj);\n const receiver = getReplacementReceiver(obj);\n let ret = evl\n ? evl(obj, ...vals)\n : receiver === undefined\n ? obj(...vals)\n : obj.call(receiver, ...vals);\n ret = sanitizeProp(ret, context);\n if (ret !== null && typeof ret === 'object' && ret instanceof DelayedSynchronousResult) {\n Promise.resolve(ret.result).then(\n (res) => done(undefined, res),\n (err) => done(err),\n );\n } else {\n done(undefined, ret);\n }\n return;\n }\n\n // Method call: obj is a Prop. `a` is already the replacement (from Prop.get()).\n // The original function is still accessible via obj.context[obj.prop] for subscription checks.\n const originalFn: unknown = obj.context[obj.prop];\n\n if (originalFn === JSON.stringify && context.getSubscriptions.size) {\n const cache = new WeakSet<any>();\n let ticks = 0n;\n const recurse = (x: unknown) => {\n if (!x || !(typeof x === 'object') || cache.has(x)) return;\n cache.add(x);\n const keys = Object.keys(x) as (keyof typeof x)[];\n ticks += BigInt(keys.length);\n for (const y of keys) {\n context.getSubscriptions.forEach((cb) => cb(x, y));\n recurse(x[y]);\n }\n };\n recurse(vals[0]);\n checkTicksAndThrow(context, ticks);\n }\n\n if (\n obj.context instanceof Array &&\n arrayChange.has(originalFn as any) &&\n (context.changeSubscriptions.get(obj.context) ||\n context.changeSubscriptionsGlobal.get(obj.context))\n ) {\n let change: Change = undefined!;\n let changed = false;\n if (obj.prop === 'push') {\n change = { type: 'push', added: vals };\n changed = !!vals.length;\n } else if (obj.prop === 'pop') {\n change = { type: 'pop', removed: obj.context.slice(-1) };\n changed = !!change.removed.length;\n } else if (obj.prop === 'shift') {\n change = { type: 'shift', removed: obj.context.slice(0, 1) };\n changed = !!change.removed.length;\n } else if (obj.prop === 'unshift') {\n change = { type: 'unshift', added: vals };\n changed = !!vals.length;\n } else if (obj.prop === 'splice') {\n change = {\n type: 'splice',\n startIndex: vals[0] as number,\n deleteCount: vals[1] === undefined ? obj.context.length : vals[1],\n added: vals.slice(2),\n removed: obj.context.slice(\n vals[0],\n vals[1] === undefined ? undefined : (vals[0] as number) + (vals[1] as number),\n ),\n };\n changed = !!change.added.length || !!change.removed.length;\n } else if (obj.prop === 'reverse' || obj.prop === 'sort') {\n change = { type: obj.prop };\n changed = !!obj.context.length;\n } else if (obj.prop === 'copyWithin') {\n const len =\n vals[2] === undefined\n ? obj.context.length - (vals[1] as number)\n : Math.min(obj.context.length, (vals[2] as number) - (vals[1] as number));\n change = {\n type: 'copyWithin',\n startIndex: vals[0] as number,\n endIndex: (vals[0] as number) + len,\n added: obj.context.slice(vals[1] as number, (vals[1] as number) + len),\n removed: obj.context.slice(vals[0] as number, (vals[0] as number) + len),\n };\n changed = !!change.added.length || !!change.removed.length;\n }\n if (changed) {\n const subs = context.changeSubscriptions.get(obj.context);\n if (subs !== undefined) for (const cb of subs) cb(change);\n const subsG = context.changeSubscriptionsGlobal.get(obj.context);\n if (subsG !== undefined) for (const cb of subsG) cb(change);\n }\n }\n\n // Trigger get-subscriptions, then call via `a` (which may be a replacement from evals).\n // Sandboxed wrappers for globals (Function, eval, etc.) must be called without `this`;\n // tick-checking replacements must be called with `this`.\n obj.get(context);\n const evl = context.evals.get(originalFn as Function);\n const receiver = getReplacementReceiver(originalFn as Function);\n const thisArg = obj.isVariable && receiver !== undefined ? receiver : obj.context;\n let ret = evl ? evl.call(thisArg, ...vals) : (a as Function).call(thisArg, ...vals);\n ret = sanitizeProp(ret, context);\n if (ret !== null && typeof ret === 'object' && ret instanceof DelayedSynchronousResult) {\n Promise.resolve(ret.result).then(\n (res) => done(undefined, res),\n (err) => done(err),\n );\n } else {\n done(undefined, ret);\n }\n});\n\naddOps<new (...args: unknown[]) => void, unknown[]>(LispType.New, (params) => {\n const { done, a, b, context } = params;\n if (!context.ctx.globalsWhitelist.has(a) && !context.ctx.sandboxedFunctions.has(a)) {\n throw new SandboxAccessError(`Object construction not allowed: ${a.constructor.name}`);\n }\n const vals = b.map((item) => sanitizeProp(item, context));\n const replacement = context.evals.get(a);\n if (replacement) {\n const ret = new (replacement as new (...args: unknown[]) => unknown)(...vals);\n done(undefined, ret);\n return;\n }\n const expectedTicks = getNewTicks(a, vals);\n if (expectedTicks > 0n && checkHaltExpectedTicks(params, expectedTicks)) return;\n const ret = new a(...vals);\n done(undefined, ret);\n});\n\nfunction getNewTicks(ctor: Function, args: unknown[]): bigint {\n // new Array(n) or new TypedArray(n) — allocates n elements\n if (ctor === Array) {\n const n = args[0];\n if (typeof n === 'number' && args.length === 1) return BigInt(n);\n return BigInt(args.length);\n }\n if (_typedArrayProtos.has(Object.getPrototypeOf(ctor.prototype))) {\n const n = args[0];\n if (typeof n === 'number') return BigInt(n);\n if (Array.isArray(n) || ArrayBuffer.isView(n)) return BigInt((n as ArrayLike<unknown>).length);\n return 0n;\n }\n // new Map(iterable) or new Set(iterable) — O(n) of iterable length\n if (ctor === Map || ctor === Set) {\n const iterable = args[0];\n if (Array.isArray(iterable)) return BigInt(iterable.length);\n return 0n;\n }\n // new String(s) or new RegExp(pattern) — O(n) of string length\n if (ctor === String || ctor === RegExp) {\n const s = args[0];\n if (typeof s === 'string') return BigInt(s.length);\n return 0n;\n }\n return 0n;\n}\n","import {\n addOps,\n checkHaltExpectedTicks,\n SpreadArray,\n SpreadObject,\n KeyVal,\n ArrayHole,\n} from '../executorUtils';\nimport type { Lisp, LispItem } from '../../parser';\nimport { LispType, sanitizeProp } from '../../utils';\n\naddOps<unknown, KeyVal[]>(LispType.CreateObject, (params) => {\n const { done, b } = params;\n let res = {} as any;\n for (const item of b) {\n if (item.key instanceof SpreadObject) {\n const keys = Object.keys(item.key.item);\n if (checkHaltExpectedTicks(params, BigInt(keys.length))) return;\n res = { ...res, ...item.key.item };\n } else {\n res[item.key] = item.val;\n }\n }\n done(undefined, res);\n});\n\naddOps<PropertyKey, LispItem>(LispType.KeyVal, ({ done, a, b }) =>\n done(undefined, new KeyVal(a, b)),\n);\n\naddOps<unknown, Lisp[]>(LispType.CreateArray, (params) => {\n const { done, b, context } = params;\n const items: unknown[] = [];\n for (const item of b) {\n if (item instanceof SpreadArray) {\n const expanded = Array.isArray(item.item) ? item.item : [...(item.item as Iterable<unknown>)];\n if (checkHaltExpectedTicks(params, BigInt(expanded.length))) return;\n for (const v of expanded) items.push(sanitizeProp(v, context));\n } else if (item instanceof ArrayHole) {\n items.length++;\n } else {\n items.push(sanitizeProp(item, context));\n }\n }\n done(undefined, items);\n});\n\naddOps(LispType.Hole, ({ done }) => done(undefined, new ArrayHole()));\n\naddOps<unknown, unknown>(LispType.Group, ({ done, b }) => done(undefined, b));\n\naddOps<unknown, string>(LispType.GlobalSymbol, ({ done, b }) => {\n switch (b) {\n case 'true':\n return done(undefined, true);\n case 'false':\n return done(undefined, false);\n case 'null':\n return done(undefined, null);\n case 'undefined':\n return done(undefined, undefined);\n case 'NaN':\n return done(undefined, NaN);\n case 'Infinity':\n return done(undefined, Infinity);\n }\n done(new Error('Unknown symbol: ' + b));\n});\n\naddOps<unknown, unknown[]>(LispType.SpreadArray, ({ done, b }) => {\n done(undefined, new SpreadArray(b));\n});\n\naddOps<unknown, Record<string, unknown>>(LispType.SpreadObject, ({ done, b }) => {\n done(undefined, new SpreadObject(b));\n});\n","import { addOps, literalRegex, checkHaltExpectedTicks } from '../executorUtils';\nimport type { Lisp, IRegEx } from '../../parser';\nimport { LispType, SandboxCapabilityError, sanitizeProp } from '../../utils';\n\naddOps<unknown, string>(LispType.Number, ({ done, b }) =>\n done(undefined, Number(b.replace(/_/g, ''))),\n);\n\naddOps<unknown, string>(LispType.BigInt, ({ done, b }) =>\n done(undefined, BigInt(b.replace(/_/g, ''))),\n);\n\naddOps<unknown, string>(LispType.RegexIndex, ({ done, b, context }) => {\n const reg: IRegEx = context.constants.regexes[parseInt(b)];\n if (!context.ctx.globalsWhitelist.has(RegExp)) {\n throw new SandboxCapabilityError('Regex not permitted');\n } else {\n const RegExpCtor =\n (context.evals.get(RegExp) as\n | (new (pattern: string, flags?: string) => unknown)\n | undefined) ?? RegExp;\n done(undefined, new RegExpCtor(reg.regex, reg.flags));\n }\n});\n\naddOps<unknown, string>(LispType.LiteralIndex, (params) => {\n const { exec, done, ticks, b, context, scope, internal, generatorYield } = params;\n const item = context.constants.literals[parseInt(b)];\n const [, name, js] = item;\n const found: Lisp[] = [];\n let f: RegExpExecArray | null;\n const resnums: string[] = [];\n while ((f = literalRegex.exec(name))) {\n if (!f[2]) {\n found.push(js[parseInt(f[3], 10)]);\n resnums.push(f[3]);\n }\n }\n\n exec<unknown[]>(\n ticks,\n found,\n scope,\n context,\n (...args: unknown[]) => {\n const reses: Record<string, unknown> = {};\n if (args.length === 1) {\n done(args[0]);\n return;\n }\n const processed = args[1];\n for (const i of Object.keys(processed!) as (keyof typeof processed)[]) {\n const num = resnums[i];\n reses[num] = processed![i];\n }\n const result = name.replace(/(\\\\\\\\)*(\\\\)?\\${(\\d+)}/g, (match, $$, $, num) => {\n if ($) return match;\n const res = reses[num];\n return ($$ ? $$ : '') + `${sanitizeProp(res, context)}`;\n });\n if (checkHaltExpectedTicks(params, BigInt(result.length))) return;\n done(undefined, result);\n },\n undefined,\n internal,\n generatorYield,\n );\n});\n","import { addOps, assignCheck } from '../executorUtils';\nimport type { LispItem } from '../../parser';\nimport { LispType, Prop, sanitizeProp } from '../../utils';\n\naddOps<unknown, unknown>(LispType.Not, ({ done, b }) => done(undefined, !b));\n\naddOps<unknown, number>(LispType.Inverse, ({ done, b }) => done(undefined, ~b));\n\naddOps<unknown, unknown, Prop<any>>(LispType.IncrementBefore, ({ done, obj, context }) => {\n assignCheck(obj, context);\n done(undefined, ++obj.context[obj.prop]);\n});\n\naddOps<unknown, unknown, Prop<any>>(LispType.IncrementAfter, ({ done, obj, context }) => {\n assignCheck(obj, context);\n done(undefined, obj.context[obj.prop]++);\n});\n\naddOps<unknown, unknown, Prop<any>>(LispType.DecrementBefore, ({ done, obj, context }) => {\n assignCheck(obj, context);\n done(undefined, --obj.context[obj.prop]);\n});\n\naddOps<unknown, unknown, Prop<any>>(LispType.DecrementAfter, ({ done, obj, context }) => {\n assignCheck(obj, context);\n done(undefined, obj.context[obj.prop]--);\n});\n\naddOps<number, number>(LispType.Positive, ({ done, b }) => done(undefined, +b));\n\naddOps<number, number>(LispType.Negative, ({ done, b }) => done(undefined, -b));\n\naddOps<unknown, LispItem>(\n LispType.Typeof,\n ({ exec, done, ticks, b, context, scope, internal, generatorYield }) => {\n exec(\n ticks,\n b,\n scope,\n context,\n (e, prop) => {\n done(undefined, typeof sanitizeProp(prop, context));\n },\n undefined,\n internal,\n generatorYield,\n );\n },\n);\n\naddOps<unknown, unknown>(LispType.Delete, ({ done, context, bobj }) => {\n if (!(bobj instanceof Prop)) {\n done(undefined, true);\n return;\n }\n assignCheck(bobj, context, 'delete');\n if (bobj.isVariable) {\n done(undefined, false);\n return;\n }\n done(undefined, delete (bobj.context as any)?.[bobj.prop]);\n});\n\naddOps(LispType.Void, ({ done }) => {\n done();\n});\n","import { addOps, assignCheck, checkHaltExpectedTicks } from '../executorUtils';\nimport { LispType, Prop } from '../../utils';\n\naddOps<unknown, unknown, Prop<any>, Prop<any>>(LispType.Assign, (params) => {\n const { done, b, obj, context, scope, bobj, internal } = params;\n assignCheck(obj, context);\n obj.isGlobal = bobj?.isGlobal || false;\n if (obj.isVariable) {\n const s = scope.getWhereValScope(obj.prop as string, obj.prop === 'this', internal);\n if (s === null) {\n throw new ReferenceError(`Cannot assign to undeclared variable '${obj.prop.toString()}'`);\n }\n s.set(obj.prop as string, b, internal);\n if (obj.isGlobal) {\n s.globals[obj.prop.toString()] = true;\n } else {\n delete s.globals[obj.prop.toString()];\n }\n done(undefined, b);\n return;\n }\n if (obj.prop === 'length' && Array.isArray(obj.context) && typeof b === 'number') {\n const delta = BigInt(Math.abs(b - obj.context.length));\n if (delta > 0n && checkHaltExpectedTicks(params, delta)) return;\n }\n done(undefined, (obj.context[obj.prop] = b));\n});\n\naddOps<unknown, unknown, Prop<any>>(LispType.AddEquals, (params) => {\n const { done, b, obj, context } = params;\n assignCheck(obj, context);\n const result = (obj.context[obj.prop] as any) + (b as any);\n if (typeof result === 'string' && checkHaltExpectedTicks(params, BigInt(result.length))) return;\n done(undefined, (obj.context[obj.prop] = result));\n});\n\naddOps<unknown, number, Prop<any>>(LispType.SubractEquals, ({ done, b, obj, context }) => {\n assignCheck(obj, context);\n done(undefined, (obj.context[obj.prop] -= b));\n});\n\naddOps<unknown, number, Prop<any>>(LispType.DivideEquals, ({ done, b, obj, context }) => {\n assignCheck(obj, context);\n done(undefined, (obj.context[obj.prop] /= b));\n});\n\naddOps<unknown, number, Prop<any>>(LispType.MultiplyEquals, ({ done, b, obj, context }) => {\n assignCheck(obj, context);\n done(undefined, (obj.context[obj.prop] *= b));\n});\n\naddOps<unknown, number, Prop<any>>(LispType.PowerEquals, ({ done, b, obj, context }) => {\n assignCheck(obj, context);\n done(undefined, (obj.context[obj.prop] **= b));\n});\n\naddOps<unknown, number, Prop<any>>(LispType.ModulusEquals, ({ done, b, obj, context }) => {\n assignCheck(obj, context);\n done(undefined, (obj.context[obj.prop] %= b));\n});\n\naddOps<unknown, number, Prop<any>>(LispType.BitNegateEquals, ({ done, b, obj, context }) => {\n assignCheck(obj, context);\n done(undefined, (obj.context[obj.prop] ^= b));\n});\n\naddOps<unknown, number, Prop<any>>(LispType.BitAndEquals, ({ done, b, obj, context }) => {\n assignCheck(obj, context);\n done(undefined, (obj.context[obj.prop] &= b));\n});\n\naddOps<unknown, number, Prop<any>>(LispType.BitOrEquals, ({ done, b, obj, context }) => {\n assignCheck(obj, context);\n done(undefined, (obj.context[obj.prop] |= b));\n});\n\naddOps<unknown, number, Prop<any>>(LispType.ShiftLeftEquals, ({ done, b, obj, context }) => {\n assignCheck(obj, context);\n done(undefined, (obj.context[obj.prop] <<= b));\n});\n\naddOps<unknown, number, Prop<any>>(LispType.ShiftRightEquals, ({ done, b, obj, context }) => {\n assignCheck(obj, context);\n done(undefined, (obj.context[obj.prop] >>= b));\n});\n\naddOps<unknown, number, Prop<any>>(\n LispType.UnsignedShiftRightEquals,\n ({ done, b, obj, context }) => {\n assignCheck(obj, context);\n done(undefined, (obj.context[obj.prop] >>>= b));\n },\n);\n\naddOps<unknown, unknown, Prop<any>>(LispType.AndEquals, ({ done, b, obj, context }) => {\n assignCheck(obj, context);\n done(undefined, (obj.context[obj.prop] &&= b));\n});\n\naddOps<unknown, unknown, Prop<any>>(LispType.OrEquals, ({ done, b, obj, context }) => {\n assignCheck(obj, context);\n done(undefined, (obj.context[obj.prop] ||= b));\n});\n\naddOps<unknown, unknown, Prop<any>>(\n LispType.NullishCoalescingEquals,\n ({ done, b, obj, context }) => {\n assignCheck(obj, context);\n done(undefined, (obj.context[obj.prop] ??= b));\n },\n);\n","import { addOps, checkHaltExpectedTicks } from '../executorUtils';\nimport { LispType } from '../../utils';\n\naddOps<number, number>(LispType.LargerThan, ({ done, a, b }) => done(undefined, a > b));\n\naddOps<number, number>(LispType.SmallerThan, ({ done, a, b }) => done(undefined, a < b));\n\naddOps<number, number>(LispType.LargerEqualThan, ({ done, a, b }) => done(undefined, a >= b));\n\naddOps<number, number>(LispType.SmallerEqualThan, ({ done, a, b }) => done(undefined, a <= b));\n\naddOps<number, number>(LispType.Equal, ({ done, a, b }) => done(undefined, a == b));\n\naddOps<number, number>(LispType.StrictEqual, ({ done, a, b }) => done(undefined, a === b));\n\naddOps<number, number>(LispType.NotEqual, ({ done, a, b }) => done(undefined, a != b));\n\naddOps<number, number>(LispType.StrictNotEqual, ({ done, a, b }) => done(undefined, a !== b));\n\naddOps<number, number>(LispType.And, ({ done, a, b }) => done(undefined, a && b));\n\naddOps<number, number>(LispType.Or, ({ done, a, b }) => done(undefined, a || b));\n\naddOps<number, number>(LispType.NullishCoalescing, ({ done, a, b }) => done(undefined, a ?? b));\n\naddOps<number, number>(LispType.BitAnd, ({ done, a, b }) => done(undefined, a & b));\n\naddOps<number, number>(LispType.BitOr, ({ done, a, b }) => done(undefined, a | b));\n\naddOps<number, number>(LispType.Plus, (params) => {\n const { done, a, b } = params;\n const result = (a as any) + (b as any);\n if (typeof result === 'string' && checkHaltExpectedTicks(params, BigInt(result.length))) return;\n done(undefined, result);\n});\n\naddOps<number, number>(LispType.Minus, ({ done, a, b }) => done(undefined, a - b));\n\naddOps<number, number>(LispType.Divide, ({ done, a, b }) => done(undefined, a / b));\n\naddOps<number, number>(LispType.Power, ({ done, a, b }) => done(undefined, a ** b));\n\naddOps<number, number>(LispType.BitNegate, ({ done, a, b }) => done(undefined, a ^ b));\n\naddOps<number, number>(LispType.Multiply, ({ done, a, b }) => done(undefined, a * b));\n\naddOps<number, number>(LispType.Modulus, ({ done, a, b }) => done(undefined, a % b));\n\naddOps<number, number>(LispType.BitShiftLeft, ({ done, a, b }) => done(undefined, a << b));\n\naddOps<number, number>(LispType.BitShiftRight, ({ done, a, b }) => done(undefined, a >> b));\n\naddOps<number, number>(LispType.BitUnsignedShiftRight, ({ done, a, b }) =>\n done(undefined, a >>> b),\n);\n\naddOps<unknown, { new (): unknown }>(LispType.Instanceof, ({ done, a, b }) =>\n done(undefined, a instanceof b),\n);\n\naddOps<string, {}>(LispType.In, ({ done, a, b }) => done(undefined, a in b));\n","import { addOps } from '../executorUtils';\nimport { LispType, Prop, VarType } from '../../utils';\n\naddOps(LispType.Return, ({ done, b }) => done(undefined, b));\n\naddOps<string, unknown, unknown, Prop>(LispType.Var, ({ done, a, b, scope, bobj, internal }) => {\n done(undefined, scope.declare(a, VarType.var, b, bobj?.isGlobal || false, internal));\n});\n\naddOps<string, unknown, unknown, Prop>(LispType.Let, ({ done, a, b, scope, bobj, internal }) => {\n done(undefined, scope.declare(a, VarType.let, b, bobj?.isGlobal || false, internal));\n});\n\naddOps<string, unknown, unknown, Prop>(LispType.Const, ({ done, a, b, scope, bobj, internal }) => {\n done(undefined, scope.declare(a, VarType.const, b, bobj?.isGlobal || false, internal));\n});\n","import {\n addOps,\n findControlFlowTarget,\n ExecReturn,\n normalizeStatementLabel,\n} from '../executorUtils';\nimport type { ControlFlowAction } from '../executorUtils';\nimport type { LispItem, StatementLabel } from '../../parser';\nimport { LispType, Prop, VarType, SandboxCapabilityError } from '../../utils';\n\naddOps<string, unknown, unknown, Prop>(\n LispType.Internal,\n ({ done, a, b, scope, bobj, internal }) => {\n if (!internal) {\n throw new SandboxCapabilityError('Internal variables are not accessible');\n }\n done(undefined, scope.declare(a, VarType.internal, b, bobj?.isGlobal || false, internal));\n },\n);\n\naddOps<LispItem, StatementLabel>(\n LispType.LoopAction,\n ({ done, a, b, context, statementLabels }) => {\n const label = normalizeStatementLabel(b);\n const target = findControlFlowTarget(statementLabels, a as ControlFlowAction, label);\n if (target === null) {\n throw new TypeError('Illegal continue statement');\n }\n if (!target) {\n throw new TypeError(label ? `Undefined label '${label}'` : 'Illegal ' + a + ' statement');\n }\n done(\n undefined,\n new ExecReturn(context.ctx.auditReport, undefined, false, {\n type: a as ControlFlowAction,\n label,\n }),\n );\n },\n);\n\naddOps(LispType.Throw, ({ done, b }) => {\n done(b);\n});\n\naddOps(LispType.None, ({ done }) => done());\n","import {\n addOps,\n createAsyncGeneratorFunction,\n createFunction,\n createFunctionAsync,\n createGeneratorFunction,\n} from '../executorUtils';\nimport type { Lisp } from '../../parser';\nimport { LispType, SandboxCapabilityError, CodeString, Scope, VarType } from '../../utils';\n\naddOps<string[], Lisp[], Lisp>(\n LispType.ArrowFunction,\n ({ done, ticks, a, b, obj, context, scope, internal }) => {\n if (typeof obj[2] === 'string' || obj[2] instanceof CodeString) {\n if (context.allowJit && context.evalContext) {\n obj[2] = b = context.evalContext.lispifyFunction(new CodeString(obj[2]), context.constants);\n } else {\n throw new SandboxCapabilityError('Unevaluated code detected, JIT not allowed');\n }\n }\n const argNames = a.slice(1);\n if (a[0]) {\n done(undefined, createFunctionAsync(argNames, b, ticks, context, scope, undefined, internal));\n } else {\n done(undefined, createFunction(argNames, b, ticks, context, scope, undefined, internal));\n }\n },\n);\n\naddOps<(string | LispType)[], Lisp[], Lisp>(\n LispType.Function,\n ({ done, ticks, a, b, obj, context, scope, internal }) => {\n if (typeof obj[2] === 'string' || obj[2] instanceof CodeString) {\n if (context.allowJit && context.evalContext) {\n obj[2] = b = context.evalContext.lispifyFunction(\n new CodeString(obj[2]),\n context.constants,\n false,\n {\n generatorDepth: a[1] === LispType.True ? 1 : 0,\n asyncDepth: a[0] === LispType.True ? 1 : 0,\n lispDepth: 0,\n },\n );\n } else {\n throw new SandboxCapabilityError('Unevaluated code detected, JIT not allowed');\n }\n }\n const isAsync = a[0];\n const isGenerator = a[1];\n const name = a[2] as string;\n const argNames = a.slice(3) as string[];\n let func;\n if (isAsync === LispType.True && isGenerator === LispType.True) {\n func = createAsyncGeneratorFunction(argNames, b, ticks, context, scope, name, internal);\n } else if (isGenerator === LispType.True) {\n func = createGeneratorFunction(argNames, b, ticks, context, scope, name, internal);\n } else if (isAsync === LispType.True) {\n func = createFunctionAsync(argNames, b, ticks, context, scope, name, internal);\n } else {\n func = createFunction(argNames, b, ticks, context, scope, name, internal);\n }\n if (name) {\n scope.declare(name, VarType.var, func, false, internal);\n }\n done(undefined, func);\n },\n);\n\naddOps<(string | LispType)[], Lisp[], Lisp>(\n LispType.InlineFunction,\n ({ done, ticks, a, b, obj, context, scope, internal }) => {\n if (typeof obj[2] === 'string' || obj[2] instanceof CodeString) {\n if (context.allowJit && context.evalContext) {\n obj[2] = b = context.evalContext.lispifyFunction(\n new CodeString(obj[2]),\n context.constants,\n false,\n {\n generatorDepth: a[1] === LispType.True ? 1 : 0,\n asyncDepth: a[0] === LispType.True ? 1 : 0,\n lispDepth: 0,\n },\n );\n } else {\n throw new SandboxCapabilityError('Unevaluated code detected, JIT not allowed');\n }\n }\n const isAsync = a[0];\n const isGenerator = a[1];\n const name = a[2] as string;\n const argNames = a.slice(3) as string[];\n if (name) {\n scope = new Scope(scope, {});\n }\n let func;\n if (isAsync === LispType.True && isGenerator === LispType.True) {\n func = createAsyncGeneratorFunction(argNames, b, ticks, context, scope, name, internal);\n } else if (isGenerator === LispType.True) {\n func = createGeneratorFunction(argNames, b, ticks, context, scope, name, internal);\n } else if (isAsync === LispType.True) {\n func = createFunctionAsync(argNames, b, ticks, context, scope, name, internal);\n } else {\n func = createFunction(argNames, b, ticks, context, scope, name, internal);\n }\n if (name) {\n scope.declare(name, VarType.let, func, false, internal);\n }\n done(undefined, func);\n },\n);\n","import {\n addOps,\n execAsync,\n execSync,\n asyncDone,\n executeTreeWithDone,\n normalizeStatementLabels,\n addControlFlowTargets,\n createLoopTarget,\n createSwitchTarget,\n createLabeledStatementTarget,\n matchesControlFlowTarget,\n If,\n ExecReturn,\n executeTreeAsync,\n syncDone,\n executeTree,\n normalizeStatementLabel,\n addControlFlowTarget,\n} from '../executorUtils';\nimport type { AsyncDoneRet } from '../executorUtils';\nimport type { Lisp, LispItem, StatementLabel, SwitchCase } from '../../parser';\nimport { LispType, Scope, SandboxError, sanitizeProp } from '../../utils';\n\naddOps<Lisp[], Lisp[]>(\n LispType.Loop,\n ({ exec, done, ticks, a, b, context, scope, statementLabels, internal, generatorYield }) => {\n const [\n checkFirst,\n startInternal,\n getIterator,\n startStep,\n step,\n condition,\n beforeStep,\n isForAwait,\n label,\n ] = a;\n const loopStatementTargets = [\n ...normalizeStatementLabels(label).map((loopLabel) => createLoopTarget(loopLabel, false)),\n createLoopTarget(),\n ];\n const loopTargets = addControlFlowTargets(statementLabels, loopStatementTargets);\n if ((isForAwait as unknown as LispType) === LispType.True && exec !== execAsync) {\n done(new SyntaxError('for-await-of loops are only allowed inside async functions'));\n return;\n }\n let loop = true;\n const loopScope = new Scope(scope, {});\n const internalVars: Record<string, unknown> = {\n $$obj: undefined,\n };\n const interalScope = new Scope(loopScope, internalVars);\n if (exec === execAsync) {\n (async () => {\n let ad: AsyncDoneRet;\n ad = asyncDone((d) =>\n exec(ticks, startStep, loopScope, context, d, undefined, internal, generatorYield),\n );\n internalVars['$$obj'] =\n (ad = asyncDone((d) =>\n exec(ticks, getIterator, loopScope, context, d, undefined, internal, generatorYield),\n )).isInstant === true\n ? ad.instant\n : (await ad.p).result;\n // for-await-of: override $$obj with the correct async iterator\n if ((isForAwait as unknown as LispType) === LispType.True) {\n const obj = internalVars['$$obj'] as any;\n internalVars['$$obj'] = obj[Symbol.asyncIterator]\n ? obj[Symbol.asyncIterator]()\n : obj[Symbol.iterator]\n ? obj[Symbol.iterator]()\n : obj;\n }\n ad = asyncDone((d) =>\n exec(ticks, startInternal, interalScope, context, d, undefined, internal, generatorYield),\n );\n // for-await-of: await the $$next promise after startInternal sets it\n if ((isForAwait as unknown as LispType) === LispType.True) {\n internalVars['$$next'] = await internalVars['$$next'];\n }\n if (checkFirst)\n loop =\n (ad = asyncDone((d) =>\n exec(ticks, condition, interalScope, context, d, undefined, internal, generatorYield),\n )).isInstant === true\n ? ad.instant\n : (await ad.p).result;\n while (loop) {\n const innerLoopVars = {};\n const iterScope = new Scope(interalScope, innerLoopVars);\n ad = asyncDone((d) =>\n exec(ticks, beforeStep, iterScope, context, d, undefined, internal, generatorYield),\n );\n ad.isInstant === true ? ad.instant : (await ad.p).result;\n const res = await executeTreeAsync(\n ticks,\n context,\n b,\n [iterScope],\n loopTargets,\n internal,\n generatorYield,\n );\n if (res instanceof ExecReturn && res.returned) {\n done(undefined, res);\n return;\n }\n if (res instanceof ExecReturn && res.controlFlow) {\n if (\n !loopStatementTargets.some((target) =>\n matchesControlFlowTarget(res.controlFlow!, target),\n )\n ) {\n done(undefined, res);\n return;\n }\n if (res.breakLoop) {\n break;\n }\n }\n ad = asyncDone((d) =>\n exec(ticks, step, interalScope, context, d, undefined, internal, generatorYield),\n );\n // for-await-of: await the $$next promise after step updates it\n if ((isForAwait as unknown as LispType) === LispType.True) {\n internalVars['$$next'] = await internalVars['$$next'];\n }\n loop =\n (ad = asyncDone((d) =>\n exec(ticks, condition, interalScope, context, d, undefined, internal, generatorYield),\n )).isInstant === true\n ? ad.instant\n : (await ad.p).result;\n }\n done();\n })().catch(done);\n } else {\n syncDone((d) =>\n exec(ticks, startStep, loopScope, context, d, undefined, internal, generatorYield),\n );\n internalVars['$$obj'] = syncDone((d) =>\n exec(ticks, getIterator, loopScope, context, d, undefined, internal, generatorYield),\n ).result;\n syncDone((d) =>\n exec(ticks, startInternal, interalScope, context, d, undefined, internal, generatorYield),\n );\n if (checkFirst)\n loop = syncDone((d) =>\n exec(ticks, condition, interalScope, context, d, undefined, internal, generatorYield),\n ).result;\n while (loop) {\n const innerLoopVars = {};\n const iterScope = new Scope(interalScope, innerLoopVars);\n syncDone((d) =>\n exec(ticks, beforeStep, iterScope, context, d, undefined, internal, generatorYield),\n );\n const res = executeTree(\n ticks,\n context,\n b,\n [iterScope],\n loopTargets,\n internal,\n generatorYield,\n );\n if (res instanceof ExecReturn && res.returned) {\n done(undefined, res);\n return;\n }\n if (res instanceof ExecReturn && res.controlFlow) {\n if (\n !loopStatementTargets.some((target) =>\n matchesControlFlowTarget(res.controlFlow!, target),\n )\n ) {\n done(undefined, res);\n return;\n }\n if (res.breakLoop) {\n break;\n }\n }\n syncDone((d) =>\n exec(ticks, step, interalScope, context, d, undefined, internal, generatorYield),\n );\n loop = syncDone((d) =>\n exec(ticks, condition, interalScope, context, d, undefined, internal, generatorYield),\n ).result;\n }\n done();\n }\n },\n);\n\naddOps<LispItem, If>(\n LispType.If,\n ({ exec, done, ticks, a, b, context, scope, statementLabels, internal, generatorYield }) => {\n exec(\n ticks,\n sanitizeProp(a, context) ? b.t : b.f,\n scope,\n context,\n done,\n statementLabels,\n internal,\n generatorYield,\n );\n },\n);\n\naddOps<LispItem, If>(\n LispType.InlineIf,\n ({ exec, done, ticks, a, b, context, scope, internal, generatorYield }) => {\n exec(\n ticks,\n sanitizeProp(a, context) ? b.t : b.f,\n scope,\n context,\n done,\n undefined,\n internal,\n generatorYield,\n );\n },\n);\n\naddOps<Lisp, Lisp>(LispType.InlineIfCase, ({ done, a, b }) => done(undefined, new If(a, b)));\n\naddOps<Lisp, Lisp>(LispType.IfCase, ({ done, a, b }) => done(undefined, new If(a, b)));\n\naddOps<StatementLabel, Lisp>(\n LispType.Labeled,\n ({ exec, done, ticks, a, b, context, scope, statementLabels, internal, generatorYield }) => {\n const target = createLabeledStatementTarget(normalizeStatementLabel(a));\n exec(\n ticks,\n b,\n scope,\n context,\n (...args: unknown[]) => {\n if (args.length === 1) {\n done(args[0]);\n return;\n }\n const res = args[1];\n if (res instanceof ExecReturn && res.controlFlow && target) {\n if (matchesControlFlowTarget(res.controlFlow, target)) {\n done();\n return;\n }\n }\n done(undefined, res as any);\n },\n addControlFlowTarget(statementLabels, target),\n internal,\n generatorYield,\n );\n },\n);\n\naddOps<LispItem, SwitchCase[]>(\n LispType.Switch,\n ({ exec, done, ticks, a, b, context, scope, statementLabels, internal, generatorYield }) => {\n const switchTarget = createSwitchTarget();\n const switchTargets = addControlFlowTarget(statementLabels, switchTarget);\n exec(\n ticks,\n a,\n scope,\n context,\n (...args: unknown[]) => {\n if (args.length === 1) {\n done(args[0]);\n return;\n }\n let toTest = args[1];\n toTest = sanitizeProp(toTest, context);\n if (exec === execSync) {\n let res: ExecReturn<unknown>;\n let isTrue = false;\n for (const caseItem of b) {\n if (\n isTrue ||\n (isTrue =\n !caseItem[1] ||\n toTest ===\n sanitizeProp(\n syncDone((d) =>\n exec(\n ticks,\n caseItem[1],\n scope,\n context,\n d,\n undefined,\n internal,\n generatorYield,\n ),\n ).result,\n context,\n ))\n ) {\n if (!caseItem[2]) continue;\n res = executeTree(\n ticks,\n context,\n caseItem[2],\n [scope],\n switchTargets,\n internal,\n generatorYield,\n );\n if (res.controlFlow) {\n if (!matchesControlFlowTarget(res.controlFlow, switchTarget)) {\n done(undefined, res);\n return;\n }\n if (res.breakLoop) break;\n }\n if (res.returned) {\n done(undefined, res);\n return;\n }\n if (!caseItem[1]) {\n // default case\n break;\n }\n }\n }\n done();\n } else {\n (async () => {\n let res: ExecReturn<unknown>;\n let isTrue = false;\n for (const caseItem of b) {\n let ad: AsyncDoneRet;\n if (\n isTrue ||\n (isTrue =\n !caseItem[1] ||\n toTest ===\n sanitizeProp(\n (ad = asyncDone((d) =>\n exec(\n ticks,\n caseItem[1],\n scope,\n context,\n d,\n undefined,\n internal,\n generatorYield,\n ),\n )).isInstant === true\n ? ad.instant\n : (await ad.p).result,\n context,\n ))\n ) {\n if (!caseItem[2]) continue;\n res = await executeTreeAsync(\n ticks,\n context,\n caseItem[2],\n [scope],\n switchTargets,\n internal,\n generatorYield,\n );\n if (res.controlFlow) {\n if (!matchesControlFlowTarget(res.controlFlow, switchTarget)) {\n done(undefined, res);\n return;\n }\n if (res.breakLoop) break;\n }\n if (res.returned) {\n done(undefined, res);\n return;\n }\n if (!caseItem[1]) {\n // default case\n break;\n }\n }\n }\n done();\n })().catch(done);\n }\n },\n undefined,\n internal,\n generatorYield,\n );\n },\n);\n\naddOps<Lisp[], [string, Lisp[], Lisp[]]>(\n LispType.Try,\n ({ exec, done, ticks, a, b, context, scope, statementLabels, internal, generatorYield }) => {\n const [exception, catchBody, finallyBody] = b;\n\n // Execute try block\n executeTreeWithDone(\n exec,\n (...tryArgs: unknown[]) => {\n const tryHadError = tryArgs.length === 1;\n const tryError = tryHadError ? tryArgs[0] : undefined;\n const tryResult = !tryHadError && tryArgs.length > 1 ? tryArgs[1] : undefined;\n\n // Handler to execute finally and complete\n const executeFinallyAndComplete = (hadError: boolean, errorOrResult: unknown) => {\n if (finallyBody && finallyBody.length > 0) {\n // Execute finally block\n executeTreeWithDone(\n exec,\n (...finallyArgs: unknown[]) => {\n const finallyHadError = finallyArgs.length === 1;\n const finallyResult =\n !finallyHadError && finallyArgs.length > 1 ? finallyArgs[1] : undefined;\n\n // If finally throws an error, it overrides everything\n if (finallyHadError) {\n done(finallyArgs[0]);\n return;\n }\n\n // If finally has a control flow statement (return/break/continue), it overrides everything\n if (\n finallyResult instanceof ExecReturn &&\n (finallyResult.returned || finallyResult.breakLoop || finallyResult.continueLoop)\n ) {\n done(undefined, finallyResult);\n return;\n }\n\n // Otherwise, return the original try/catch result/error\n if (hadError) {\n done(errorOrResult);\n } else if (errorOrResult instanceof ExecReturn) {\n // If try/catch returned or has some other control flow, pass that through\n if (\n errorOrResult.returned ||\n errorOrResult.breakLoop ||\n errorOrResult.continueLoop\n ) {\n done(undefined, errorOrResult);\n } else {\n // Normal completion - don't return a value\n done();\n }\n } else {\n // Try/catch completed normally, just signal completion with no return value\n done();\n }\n },\n ticks,\n context,\n finallyBody,\n [new Scope(scope, {})],\n statementLabels,\n internal,\n generatorYield,\n );\n } else {\n // No finally block, just return result/error\n if (hadError) {\n done(errorOrResult);\n } else if (errorOrResult instanceof ExecReturn) {\n // If try/catch returned or has some other control flow, pass that through\n if (errorOrResult.returned || errorOrResult.breakLoop || errorOrResult.continueLoop) {\n done(undefined, errorOrResult);\n } else {\n // Normal completion - don't return a value\n done();\n }\n } else {\n done();\n }\n }\n };\n\n // SandboxErrors bypass both catch and finally — propagate immediately.\n if (tryHadError && tryError instanceof SandboxError) {\n done(tryError);\n return;\n }\n\n // If try had an error and there's a catch block, execute catch.\n if (tryHadError && catchBody && catchBody.length > 0) {\n const sc: Record<string, unknown> = {};\n if (exception) sc[exception] = tryError;\n\n executeTreeWithDone(\n exec,\n (...catchArgs: unknown[]) => {\n const catchHadError = catchArgs.length === 1;\n const catchErrorOrResult = catchHadError\n ? catchArgs[0]\n : catchArgs.length > 1\n ? catchArgs[1]\n : undefined;\n\n // Execute finally with catch result\n executeFinallyAndComplete(catchHadError, catchErrorOrResult);\n },\n ticks,\n context,\n catchBody,\n [new Scope(scope, sc)],\n statementLabels,\n internal,\n generatorYield,\n );\n } else {\n // No catch or no error, execute finally with try result\n executeFinallyAndComplete(tryHadError, tryHadError ? tryError : tryResult);\n }\n },\n ticks,\n context,\n a,\n [new Scope(scope)],\n statementLabels,\n internal,\n generatorYield,\n );\n },\n);\n\naddOps<unknown[]>(LispType.Expression, ({ done, a }) => done(undefined, a.pop()));\n","import type { LispItem, Lisp, StatementLabel } from '../parser';\nimport {\n hasOwnProperty,\n isLisp,\n LispType,\n LocalScope,\n Prop,\n SandboxExecutionQuotaExceededError,\n SandboxError,\n SandboxExecutionTreeError,\n Scope,\n GeneratorFunction,\n AsyncGeneratorFunction,\n SandboxCapabilityError,\n SandboxAccessError,\n NON_BLOCKING_THRESHOLD,\n sanitizeProp,\n Unknown,\n} from '../utils';\nimport { IAuditReport, IExecContext, IScope, optional, Ticks } from '../utils';\n\nexport type Done<T = any> = (err?: any, res?: T | typeof optional) => void;\n\nexport type ControlFlowAction = 'break' | 'continue';\n\nexport interface ControlFlowSignal {\n type: ControlFlowAction;\n label?: string;\n}\n\ninterface ControlFlowTarget {\n label?: string;\n acceptsBreak: boolean;\n acceptsContinue: boolean;\n acceptsUnlabeledBreak: boolean;\n acceptsUnlabeledContinue: boolean;\n}\n\nexport type ControlFlowTargets = readonly ControlFlowTarget[] | undefined;\n\nexport class ExecReturn<T> {\n constructor(\n public auditReport: IAuditReport | undefined,\n public result: T,\n public returned: boolean,\n public controlFlow?: ControlFlowSignal,\n ) {}\n\n get breakLoop() {\n return this.controlFlow?.type === 'break';\n }\n\n get continueLoop() {\n return this.controlFlow?.type === 'continue';\n }\n}\n\nexport interface IChange {\n type: string;\n}\n\nexport interface ICreate extends IChange {\n type: 'create';\n prop: number | string;\n}\n\nexport interface IReplace extends IChange {\n type: 'replace';\n}\n\nexport interface IDelete extends IChange {\n type: 'delete';\n prop: number | string;\n}\n\nexport interface IReverse extends IChange {\n type: 'reverse';\n}\n\nexport interface ISort extends IChange {\n type: 'sort';\n}\n\nexport interface IPush extends IChange {\n type: 'push';\n added: unknown[];\n}\n\nexport interface IPop extends IChange {\n type: 'pop';\n removed: unknown[];\n}\n\nexport interface IShift extends IChange {\n type: 'shift';\n removed: unknown[];\n}\n\nexport interface IUnShift extends IChange {\n type: 'unshift';\n added: unknown[];\n}\n\nexport interface ISplice extends IChange {\n type: 'splice';\n startIndex: number;\n deleteCount: number;\n added: unknown[];\n removed: unknown[];\n}\n\nexport interface ICopyWithin extends IChange {\n type: 'copyWithin';\n startIndex: number;\n endIndex: number;\n added: unknown[];\n removed: unknown[];\n}\n\nexport type Change =\n | ICreate\n | IReplace\n | IDelete\n | IReverse\n | ISort\n | IPush\n | IPop\n | IUnShift\n | IShift\n | ISplice\n | ICopyWithin;\n\nconst emptyControlFlowTargets: readonly ControlFlowTarget[] = [];\n\nexport function normalizeStatementLabel(label: StatementLabel | undefined) {\n return label === undefined || label === LispType.None ? undefined : label;\n}\n\nexport function normalizeStatementLabels(label: LispItem | StatementLabel | undefined) {\n if (label === undefined || label === LispType.None) return [] as string[];\n if (Array.isArray(label) && !isLisp(label)) {\n return label.filter((item): item is string => typeof item === 'string');\n }\n return [label as string];\n}\n\nexport function createLoopTarget(label?: string, acceptsUnlabeled = true): ControlFlowTarget {\n return {\n label,\n acceptsBreak: true,\n acceptsContinue: true,\n acceptsUnlabeledBreak: acceptsUnlabeled,\n acceptsUnlabeledContinue: acceptsUnlabeled,\n };\n}\n\nexport function createSwitchTarget(label?: string): ControlFlowTarget {\n return {\n label,\n acceptsBreak: true,\n acceptsContinue: false,\n acceptsUnlabeledBreak: true,\n acceptsUnlabeledContinue: false,\n };\n}\n\nexport function createLabeledStatementTarget(label?: string): ControlFlowTarget | undefined {\n if (!label) return undefined;\n return {\n label,\n acceptsBreak: true,\n acceptsContinue: false,\n acceptsUnlabeledBreak: false,\n acceptsUnlabeledContinue: false,\n };\n}\n\nexport function addControlFlowTarget(\n controlFlowTargets: ControlFlowTargets,\n target?: ControlFlowTarget,\n): ControlFlowTargets {\n if (!target) return controlFlowTargets;\n return [...(controlFlowTargets || emptyControlFlowTargets), target];\n}\n\nexport function addControlFlowTargets(\n controlFlowTargets: ControlFlowTargets,\n targets: ControlFlowTarget[],\n): ControlFlowTargets {\n return targets.reduce(\n (currentTargets, target) => addControlFlowTarget(currentTargets, target),\n controlFlowTargets,\n );\n}\n\nexport function matchesControlFlowTarget(signal: ControlFlowSignal, target: ControlFlowTarget) {\n if (signal.type === 'continue') {\n if (!target.acceptsContinue) return false;\n return signal.label ? target.label === signal.label : target.acceptsUnlabeledContinue;\n }\n if (!target.acceptsBreak) return false;\n return signal.label ? target.label === signal.label : target.acceptsUnlabeledBreak;\n}\n\nexport function findControlFlowTarget(\n controlFlowTargets: ControlFlowTargets,\n type: ControlFlowAction,\n label?: string,\n) {\n if (!controlFlowTargets) return undefined;\n for (let i = controlFlowTargets.length - 1; i >= 0; i--) {\n const target = controlFlowTargets[i];\n if (label) {\n if (target.label !== label) continue;\n if (type === 'continue' ? target.acceptsContinue : target.acceptsBreak) {\n return target;\n }\n return null;\n }\n if (type === 'continue' ? target.acceptsUnlabeledContinue : target.acceptsUnlabeledBreak) {\n return target;\n }\n }\n return undefined;\n}\n\nfunction generateArgs(argNames: string[], args: unknown[]) {\n const vars: Record<string, unknown> = {};\n argNames.forEach((arg, i) => {\n if (arg.startsWith('...')) {\n vars[arg.substring(3)] = args.slice(i);\n } else {\n vars[arg] = args[i];\n }\n });\n return vars;\n}\n\nexport function createFunction(\n argNames: string[],\n parsed: Lisp[],\n ticks: Ticks,\n context: IExecContext,\n scope?: Scope,\n name?: string,\n internal = false,\n) {\n if (context.ctx.options.forbidFunctionCreation) {\n throw new SandboxCapabilityError('Function creation is forbidden');\n }\n let func;\n if (name === undefined) {\n func = (...args: unknown[]) => {\n const vars = generateArgs(argNames, args);\n const res = executeTree(\n ticks,\n context,\n parsed,\n scope === undefined ? [] : [new Scope(scope, vars)],\n undefined,\n internal,\n );\n return res.result;\n };\n } else {\n func = function sandboxedObject(this: Unknown, ...args: unknown[]) {\n const vars = generateArgs(argNames, args);\n const res = executeTree(\n ticks,\n context,\n parsed,\n scope === undefined ? [] : [new Scope(scope, vars, this)],\n undefined,\n internal,\n );\n return res.result;\n };\n }\n context.registerSandboxFunction(func);\n context.ctx.sandboxedFunctions.add(func);\n return func;\n}\n\nexport function createFunctionAsync(\n argNames: string[],\n parsed: Lisp[],\n ticks: Ticks,\n context: IExecContext,\n scope?: Scope,\n name?: string,\n internal = false,\n) {\n if (context.ctx.options.forbidFunctionCreation) {\n throw new SandboxCapabilityError('Function creation is forbidden');\n }\n if (!context.ctx.prototypeWhitelist?.has(Promise.prototype)) {\n throw new SandboxCapabilityError('Async/await not permitted');\n }\n let func;\n if (name === undefined) {\n func = async (...args: unknown[]) => {\n const vars = generateArgs(argNames, args);\n const res = await executeTreeAsync(\n ticks,\n context,\n parsed,\n scope === undefined ? [] : [new Scope(scope, vars)],\n undefined,\n internal,\n );\n return res.result;\n };\n } else {\n func = async function sandboxedObject(this: Unknown, ...args: unknown[]) {\n const vars = generateArgs(argNames, args);\n const res = await executeTreeAsync(\n ticks,\n context,\n parsed,\n scope === undefined ? [] : [new Scope(scope, vars, this)],\n undefined,\n internal,\n );\n return res.result;\n };\n }\n context.registerSandboxFunction(func);\n context.ctx.sandboxedFunctions.add(func);\n return func;\n}\n\n// Sentinel class used to communicate yield values from the executor back to the generator.\nexport class YieldValue {\n constructor(\n public value: unknown,\n public delegate: boolean,\n ) {}\n}\n\n// Unique sentinel thrown by captureYieldFn in executeGenBody's default case when a new\n// synchronous yield is encountered. Propagates through the call stack back to the restart loop.\nconst syncYieldPauseSentinel = Symbol('syncYieldPause');\n\nfunction asIterableIterator(value: unknown): Iterator<unknown> & Iterable<unknown> {\n const iterator =\n (value as { [Symbol.iterator]?: () => Iterator<unknown> })?.[Symbol.iterator]?.() ??\n (value as Iterator<unknown>);\n\n if (!iterator || typeof iterator.next !== 'function') {\n throw new TypeError('yield* target is not iterable');\n }\n\n if (typeof (iterator as Iterator<unknown> & Iterable<unknown>)[Symbol.iterator] === 'function') {\n return iterator as Iterator<unknown> & Iterable<unknown>;\n }\n\n return {\n next: iterator.next.bind(iterator),\n throw: iterator.throw?.bind(iterator),\n return: iterator.return?.bind(iterator),\n [Symbol.iterator]() {\n return this;\n },\n };\n}\n\nfunction asAsyncIterableIterator(value: unknown): AsyncIterator<unknown> & AsyncIterable<unknown> {\n const asyncIterator = (value as { [Symbol.asyncIterator]?: () => AsyncIterator<unknown> })?.[\n Symbol.asyncIterator\n ]?.();\n\n if (asyncIterator) {\n return {\n next: asyncIterator.next.bind(asyncIterator),\n throw: asyncIterator.throw?.bind(asyncIterator),\n return: asyncIterator.return?.bind(asyncIterator),\n [Symbol.asyncIterator]() {\n return this;\n },\n };\n }\n\n const iterator = asIterableIterator(value);\n return {\n async next(nextValue?: unknown) {\n return iterator.next(nextValue);\n },\n async throw(err?: unknown) {\n if (typeof iterator.throw === 'function') {\n return iterator.throw(err);\n }\n throw err;\n },\n async return(valueToReturn?: unknown) {\n if (typeof iterator.return === 'function') {\n return iterator.return(valueToReturn);\n }\n return { value: valueToReturn, done: true };\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n };\n}\n\n// executeGenBody: a native generator that lazily executes a generator function body.\n// It handles compound control-flow nodes (statements, if, loop, try, yield) with yield*\n// recursion, and falls back to the existing execSync for all leaf expressions.\n// Only used by createGeneratorFunction — nothing else in the executor is changed.\nfunction* executeGenBody(\n ticks: Ticks,\n tree: Lisp | Lisp[],\n scope: Scope,\n context: IExecContext,\n statementLabels: ControlFlowTargets,\n internal: boolean,\n): Generator<unknown, ExecReturn<unknown> | unknown, unknown> {\n // ── Statement list ──────────────────────────────────────────────────────────\n if (!isLisp(tree as Lisp) && Array.isArray(tree)) {\n const stmts = tree as Lisp[];\n if (stmts.length === 0 || (stmts[0] as unknown) === LispType.None) {\n return new ExecReturn(context.ctx.auditReport, undefined, false);\n }\n for (const stmt of stmts) {\n const res = (yield* executeGenBody(\n ticks,\n stmt,\n scope,\n context,\n statementLabels,\n internal,\n )) as ExecReturn<unknown>;\n if (res instanceof ExecReturn && (res.returned || res.controlFlow)) return res;\n // Mirror _executeWithDoneSync: wrap the result of a return statement\n if (isLisp(stmt) && (stmt as Lisp)[0] === LispType.Return) {\n return new ExecReturn(context.ctx.auditReport, res.result, true);\n }\n }\n return new ExecReturn(context.ctx.auditReport, undefined, false);\n }\n\n const [op, a, b] = tree as Lisp;\n\n switch (op) {\n // ── yield expr ────────────────────────────────────────────────────────────\n case LispType.Yield: {\n const valResult = (yield* executeGenBody(\n ticks,\n a as Lisp,\n scope,\n context,\n statementLabels,\n internal,\n )) as ExecReturn<unknown>;\n const sanitized = sanitizeProp(valResult.result, context);\n const injected: unknown = yield sanitized; // ← real pause point\n return new ExecReturn(context.ctx.auditReport, injected, false);\n }\n\n // ── yield* expr ───────────────────────────────────────────────────────────\n case LispType.YieldDelegate: {\n const iterResult = (yield* executeGenBody(\n ticks,\n a as Lisp,\n scope,\n context,\n statementLabels,\n internal,\n )) as ExecReturn<unknown>;\n const delegatee = sanitizeProp(iterResult.result, context);\n const result: unknown = yield* asIterableIterator(delegatee);\n return new ExecReturn(context.ctx.auditReport, result, false);\n }\n\n // ── if / else ─────────────────────────────────────────────────────────────\n // LispType.If is NOT in unexecTypes — its `a` is the raw condition Lisp,\n // `b` is the raw IfCase node that evaluates to an If object with .t/.f.\n case LispType.If: {\n const condResult = (yield* executeGenBody(\n ticks,\n a as Lisp,\n scope,\n context,\n statementLabels,\n internal,\n )) as ExecReturn<unknown>;\n const ifCase = syncDone((d) =>\n execSync(ticks, b as Lisp, scope, context, d, statementLabels, internal, undefined),\n ).result as If;\n const branch = sanitizeProp(condResult.result, context) ? ifCase.t : ifCase.f;\n if (branch) {\n return (yield* executeGenBody(\n ticks,\n branch,\n scope,\n context,\n statementLabels,\n internal,\n )) as ExecReturn<unknown>;\n }\n return new ExecReturn(context.ctx.auditReport, undefined, false);\n }\n\n // ── loops (while / for / for-of / for-in / do-while) ─────────────────────\n // Mirror the sync path of the existing Loop handler (executor.ts ~1421-1475)\n // but replace `executeTree(b, ...)` with `yield*`.\n case LispType.Loop: {\n const [\n checkFirst,\n startInternal,\n getIterator,\n startStep,\n step,\n condition,\n beforeStep,\n isForAwait,\n label,\n ] = a as Lisp[];\n if ((isForAwait as unknown as LispType) === LispType.True) {\n throw new SyntaxError('for-await-of loops are only allowed inside async functions');\n }\n const loopStatementTargets = [\n ...normalizeStatementLabels(label).map((loopLabel) => createLoopTarget(loopLabel, false)),\n createLoopTarget(),\n ];\n const loopTargets = addControlFlowTargets(statementLabels, loopStatementTargets);\n const loopScope = new Scope(scope, {});\n const internalVars: Record<string, unknown> = { $$obj: undefined };\n const interalScope = new Scope(loopScope, internalVars);\n\n syncDone((d) =>\n execSync(ticks, startStep, loopScope, context, d, undefined, internal, undefined),\n );\n internalVars['$$obj'] = syncDone((d) =>\n execSync(ticks, getIterator, loopScope, context, d, undefined, internal, undefined),\n ).result;\n syncDone((d) =>\n execSync(ticks, startInternal, interalScope, context, d, undefined, internal, undefined),\n );\n\n let loop: unknown = true;\n if (checkFirst) {\n loop = syncDone((d) =>\n execSync(ticks, condition, interalScope, context, d, undefined, internal, undefined),\n ).result;\n }\n\n while (loop) {\n const iterScope = new Scope(interalScope, {});\n syncDone((d) =>\n execSync(ticks, beforeStep, iterScope, context, d, undefined, internal, undefined),\n );\n\n const res = (yield* executeGenBody(\n ticks,\n b as Lisp[],\n iterScope,\n context,\n loopTargets,\n internal,\n )) as ExecReturn<unknown>;\n\n if (res.returned) return res;\n if (res.controlFlow) {\n if (!loopStatementTargets.some((t) => matchesControlFlowTarget(res.controlFlow!, t))) {\n return res; // break/continue targeting an outer labeled loop\n }\n if (res.breakLoop) break;\n // continueLoop: fall through to step + condition check\n }\n syncDone((d) =>\n execSync(ticks, step, interalScope, context, d, undefined, internal, undefined),\n );\n loop = syncDone((d) =>\n execSync(ticks, condition, interalScope, context, d, undefined, internal, undefined),\n ).result;\n }\n return new ExecReturn(context.ctx.auditReport, undefined, false);\n }\n\n // ── try / catch / finally ─────────────────────────────────────────────────\n // Using real native try/catch/finally gives us correct gen.throw() and\n // gen.return() semantics for free (the native generator machinery handles them).\n case LispType.Try: {\n const [exception, catchBody, finallyBody] = b as [string, Lisp[], Lisp[]];\n let result!: ExecReturn<unknown>;\n let finalOverride: ExecReturn<unknown> | undefined;\n try {\n result = (yield* executeGenBody(\n ticks,\n a as Lisp[],\n scope,\n context,\n statementLabels,\n internal,\n )) as ExecReturn<unknown>;\n } catch (e) {\n if (exception && catchBody?.length > 0) {\n const catchScope = new Scope(scope, { [exception]: e });\n result = (yield* executeGenBody(\n ticks,\n catchBody,\n catchScope,\n context,\n statementLabels,\n internal,\n )) as ExecReturn<unknown>;\n } else {\n throw e;\n }\n } finally {\n if (finallyBody?.length > 0) {\n const fr = (yield* executeGenBody(\n ticks,\n finallyBody,\n scope,\n context,\n statementLabels,\n internal,\n )) as ExecReturn<unknown>;\n // finally control flow (return/break/continue) overrides everything\n if (fr.returned || fr.controlFlow) {\n finalOverride = fr;\n }\n }\n }\n if (finalOverride) return finalOverride;\n return result;\n }\n\n // ── labeled statement ─────────────────────────────────────────────────────\n case LispType.Labeled: {\n const target = createLabeledStatementTarget(normalizeStatementLabel(a as StatementLabel));\n const newTargets = addControlFlowTargets(statementLabels, target ? [target] : []);\n const res = (yield* executeGenBody(\n ticks,\n b as Lisp,\n scope,\n context,\n newTargets,\n internal,\n )) as ExecReturn<unknown>;\n if (res.controlFlow && target && matchesControlFlowTarget(res.controlFlow, target)) {\n return new ExecReturn(context.ctx.auditReport, res.result, false);\n }\n return res;\n }\n\n // ── everything else ───────────────────────────────────────────────────────\n // Arithmetic, property access, function calls, assignments, etc. are\n // delegated to execSync. However, a yield expression may be nested inside\n // a non-unexecType node (e.g. `const x = yield 1`). In that case the\n // existing sync yield handler throws syncYieldPauseSentinel. We restart\n // execSync from scratch on each such pause, skipping already-completed\n // yields by immediately calling their continuation with the stored result.\n default: {\n let completedYields = 0;\n const yieldResults: unknown[] = [];\n while (true) {\n let currentYieldIdx = 0;\n let capturedValue: unknown = undefined;\n let capturedDelegate = false;\n let yielded = false;\n const captureYieldFn = (yv: YieldValue, continueDone?: Done) => {\n if (currentYieldIdx < completedYields) {\n // This yield already happened in a prior iteration; fast-forward.\n continueDone!(undefined, yieldResults[currentYieldIdx]);\n currentYieldIdx++;\n return;\n }\n // New yield: capture the value and pause.\n capturedValue = yv.value;\n capturedDelegate = yv.delegate;\n yielded = true;\n currentYieldIdx++;\n throw syncYieldPauseSentinel;\n };\n try {\n const result = syncDone((d) =>\n execSync(\n ticks,\n tree as Lisp,\n scope,\n context,\n d,\n statementLabels,\n internal,\n captureYieldFn,\n ),\n ).result;\n if (result instanceof ExecReturn) return result;\n return new ExecReturn(context.ctx.auditReport, result, false);\n } catch (e) {\n if (!yielded || e !== syncYieldPauseSentinel) throw e;\n const resumedValue: unknown = capturedDelegate\n ? yield* asIterableIterator(capturedValue)\n : yield capturedValue;\n yieldResults.push(resumedValue);\n completedYields++;\n }\n }\n }\n }\n}\n\nexport function createGeneratorFunction(\n argNames: string[],\n parsed: Lisp[],\n ticks: Ticks,\n context: IExecContext,\n scope?: Scope,\n name?: string,\n internal = false,\n) {\n if (context.ctx.options.forbidFunctionCreation) {\n throw new SandboxCapabilityError('Function creation is forbidden');\n }\n const makeGen = (thisArg: Unknown, args: unknown[]) => {\n const vars = generateArgs(argNames, args);\n const genScope =\n scope === undefined ? new Scope(null, vars, thisArg) : new Scope(scope, vars, thisArg);\n\n const executionGen = executeGenBody(ticks, parsed, genScope, context, undefined, internal);\n let isDone = false;\n\n function drive(action: () => IteratorResult<unknown>): IteratorResult<unknown> {\n if (isDone) return { value: undefined, done: true };\n try {\n const r = action();\n if (r.done) {\n isDone = true;\n return {\n value: r.value instanceof ExecReturn ? r.value.result : r.value,\n done: true,\n };\n }\n return { value: r.value, done: false };\n } catch (e) {\n isDone = true;\n throw e;\n }\n }\n\n const iterator: Iterator<unknown> & Iterable<unknown> = {\n next(value?: unknown) {\n return drive(() => executionGen.next(value));\n },\n return(value?: unknown) {\n return drive(() => executionGen.return(value));\n },\n throw(err?: unknown) {\n return drive(() => executionGen.throw(err));\n },\n [Symbol.iterator]() {\n return this;\n },\n };\n return iterator;\n };\n const func = function sandboxedObject(this: Unknown, ...args: unknown[]) {\n return makeGen(this, args);\n };\n Object.setPrototypeOf(func, GeneratorFunction.prototype);\n context.registerSandboxFunction(func);\n context.ctx.sandboxedFunctions.add(func);\n return func;\n}\n\nexport function createAsyncGeneratorFunction(\n argNames: string[],\n parsed: Lisp[],\n ticks: Ticks,\n context: IExecContext,\n scope?: Scope,\n name?: string,\n internal = false,\n) {\n if (context.ctx.options.forbidFunctionCreation) {\n throw new SandboxCapabilityError('Function creation is forbidden');\n }\n if (!context.ctx.prototypeWhitelist?.has(Promise.prototype)) {\n throw new SandboxCapabilityError('Async/await not permitted');\n }\n const makeGen = (thisArg: Unknown, args: unknown[]) => {\n const vars = generateArgs(argNames, args);\n const genScope =\n scope === undefined ? [new Scope(null, vars, thisArg)] : [new Scope(scope, vars, thisArg)];\n return (async function* sandboxedAsyncGenerator(): AsyncGenerator<unknown, unknown, unknown> {\n const yieldQueue: Array<{ yieldValue: YieldValue; continueDone?: Done }> = [];\n let resolveYield: (() => void) | null = null;\n const yieldFn = (yv: YieldValue, continueDone?: Done) => {\n yieldQueue.push({ yieldValue: yv, continueDone });\n if (resolveYield) {\n resolveYield();\n resolveYield = null;\n }\n };\n const bodyPromise = executeTreeAsync(\n ticks,\n context,\n parsed,\n genScope,\n undefined,\n internal,\n yieldFn,\n );\n let bodyDone = false;\n let bodyResult: ExecReturn<unknown> | undefined;\n let bodyError: unknown;\n bodyPromise.then(\n (r) => {\n bodyDone = true;\n bodyResult = r;\n resolveYield?.();\n },\n (e) => {\n bodyDone = true;\n bodyError = e;\n resolveYield?.();\n },\n );\n while (true) {\n if (yieldQueue.length === 0 && !bodyDone) {\n await new Promise<void>((res) => {\n resolveYield = res;\n });\n }\n while (yieldQueue.length > 0) {\n const { yieldValue, continueDone } = yieldQueue.shift()!;\n try {\n const resumedValue = yieldValue.delegate\n ? yield* asAsyncIterableIterator(yieldValue.value)\n : yield yieldValue.value;\n continueDone?.(undefined, resumedValue);\n } catch (err) {\n continueDone?.(err);\n }\n }\n if (bodyDone) break;\n }\n if (bodyError !== undefined) throw bodyError;\n return bodyResult?.result;\n })();\n };\n const func = function sandboxedObject(this: Unknown, ...args: unknown[]) {\n return makeGen(this, args) as unknown as AsyncGenerator;\n };\n Object.setPrototypeOf(func, AsyncGeneratorFunction.prototype);\n context.registerSandboxFunction(func);\n context.ctx.sandboxedFunctions.add(func);\n return func;\n}\n\nexport function assignCheck(obj: Prop, context: IExecContext, op = 'assign') {\n if (obj.context === undefined) {\n throw new ReferenceError(`Cannot ${op} value to undefined.`);\n }\n if (obj.isConst) {\n throw new TypeError(`Assignment to constant variable.`);\n }\n if (obj.isGlobal) {\n throw new SandboxAccessError(\n `Cannot ${op} property '${obj.prop.toString()}' of a global object`,\n );\n }\n if (obj.context === null) {\n throw new TypeError('Cannot set properties of null');\n }\n if (\n typeof (obj.context as any)[obj.prop] === 'function' &&\n !hasOwnProperty(obj.context, obj.prop)\n ) {\n throw new SandboxAccessError(\n `Override prototype property '${obj.prop.toString()}' not allowed`,\n );\n }\n if (op === 'delete') {\n if (hasOwnProperty(obj.context, obj.prop)) {\n context.changeSubscriptions\n .get(obj.context)\n ?.forEach((cb) => cb({ type: 'delete', prop: obj.prop.toString() }));\n context.changeSubscriptionsGlobal\n .get(obj.context)\n ?.forEach((cb) => cb({ type: 'delete', prop: obj.prop.toString() }));\n }\n } else if (hasOwnProperty(obj.context, obj.prop)) {\n context.setSubscriptions\n .get(obj.context)\n ?.get(obj.prop.toString())\n ?.forEach((cb) =>\n cb({\n type: 'replace',\n }),\n );\n context.setSubscriptionsGlobal\n .get(obj.context)\n ?.get(obj.prop.toString())\n ?.forEach((cb) =>\n cb({\n type: 'replace',\n }),\n );\n } else {\n context.changeSubscriptions\n .get(obj.context)\n ?.forEach((cb) => cb({ type: 'create', prop: obj.prop.toString() }));\n context.changeSubscriptionsGlobal\n .get(obj.context)\n ?.forEach((cb) => cb({ type: 'create', prop: obj.prop.toString() }));\n }\n}\nexport const arrayChange = new Set([\n [].push,\n [].pop,\n [].shift,\n [].unshift,\n [].splice,\n [].reverse,\n [].sort,\n [].copyWithin,\n]);\n\nexport class KeyVal {\n constructor(\n public key: PropertyKey | SpreadObject,\n public val: unknown,\n ) {}\n}\n\nexport class SpreadObject {\n constructor(public item: { [key: string]: unknown }) {}\n}\n\nexport class SpreadArray {\n constructor(public item: unknown[]) {}\n}\n\nexport class ArrayHole {}\n\nexport class If {\n constructor(\n public t: Lisp,\n public f: Lisp,\n public label?: string,\n ) {}\n}\n\nexport const literalRegex = /(\\$\\$)*(\\$)?\\${(\\d+)}/g;\n\nexport { ops, addOps } from './opsRegistry';\nimport { ops, Execution } from './opsRegistry';\n\nexport const prorptyKeyTypes = ['string', 'number', 'symbol'];\n\nexport function isPropertyKey(val: unknown): val is PropertyKey {\n return prorptyKeyTypes.includes(typeof val);\n}\n\nexport function hasPossibleProperties(val: unknown): val is {} {\n return val !== null && val !== undefined;\n}\n\nimport './ops/index';\n\nexport function execMany(\n ticks: Ticks,\n exec: Execution,\n tree: Lisp[],\n done: Done,\n scope: Scope,\n context: IExecContext,\n statementLabels: ControlFlowTargets,\n internal: boolean,\n generatorYield: ((yv: YieldValue, done?: Done) => void) | undefined,\n) {\n if (exec === execSync) {\n _execManySync(ticks, tree, done, scope, context, statementLabels, internal, generatorYield);\n } else {\n _execManyAsync(\n ticks,\n tree,\n done,\n scope,\n context,\n statementLabels,\n internal,\n generatorYield,\n ).catch(done);\n }\n}\n\nfunction _execManySync(\n ticks: Ticks,\n tree: Lisp[],\n done: Done,\n scope: Scope,\n context: IExecContext,\n statementLabels: ControlFlowTargets,\n internal: boolean,\n generatorYield: ((yv: YieldValue, done?: Done) => void) | undefined,\n) {\n const ret: any[] = [];\n for (let i = 0; i < tree.length; i++) {\n let res = syncDone((d) =>\n execSync(ticks, tree[i], scope, context, d, statementLabels, internal, generatorYield),\n ).result;\n if (res instanceof ExecReturn && (res.returned || res.breakLoop || res.continueLoop)) {\n done(undefined, res);\n return;\n }\n if (isLisp(tree[i]) && tree[i][0] === LispType.Return) {\n done(undefined, new ExecReturn(context.ctx.auditReport, res, true));\n return;\n }\n ret.push(res);\n }\n done(undefined, ret);\n}\n\nasync function _execManyAsync(\n ticks: Ticks,\n tree: Lisp[],\n done: Done,\n scope: Scope,\n context: IExecContext,\n statementLabels: ControlFlowTargets,\n internal: boolean,\n generatorYield: ((yv: YieldValue, done?: Done) => void) | undefined,\n) {\n const ret: any[] = [];\n for (let i = 0; i < tree.length; i++) {\n let res;\n try {\n let ad: AsyncDoneRet;\n res =\n (ad = asyncDone((d) =>\n execAsync(ticks, tree[i], scope, context, d, statementLabels, internal, generatorYield),\n )).isInstant === true\n ? ad.instant\n : (await ad.p).result;\n } catch (e) {\n done(e);\n return;\n }\n if (res instanceof ExecReturn && (res.returned || res.breakLoop || res.continueLoop)) {\n done(undefined, res);\n return;\n }\n if (isLisp(tree[i]) && tree[i][0] === LispType.Return) {\n done(undefined, new ExecReturn(context.ctx.auditReport, res, true));\n return;\n }\n ret.push(res);\n }\n done(undefined, ret);\n}\n\nexport interface AsyncDoneRet {\n isInstant: boolean;\n instant: any;\n p: Promise<{ result: any }>;\n}\n\nexport function asyncDone(callback: (done: Done) => void): AsyncDoneRet {\n let isInstant = false;\n let instant: unknown;\n const p = new Promise<any>((resolve, reject) => {\n callback((...args: unknown[]) => {\n if (args.length === 1) reject(args[0]);\n else {\n isInstant = true;\n instant = args[1];\n resolve({ result: args[1] });\n }\n });\n });\n return {\n isInstant,\n instant,\n p,\n };\n}\n\nexport function syncDone(callback: (done: Done) => void): { result: any } {\n let result;\n let err: { error: unknown } | undefined;\n callback((...args: unknown[]) => {\n err = args.length === 1 ? { error: args[0] } : undefined;\n result = args[1];\n });\n if (err) throw err.error;\n return { result };\n}\n\nexport async function execAsync<T = any>(\n ticks: Ticks,\n tree: LispItem,\n scope: Scope,\n context: IExecContext,\n doneOriginal: Done<T>,\n statementLabels: ControlFlowTargets,\n internal: boolean,\n generatorYield: ((yv: YieldValue, done?: Done) => void) | undefined,\n): Promise<void> {\n let done: Done<T> = doneOriginal;\n const p = new Promise<void>((resolve) => {\n done = (...args: unknown[]) => {\n doneOriginal(...args);\n resolve();\n };\n });\n if (\n !_execNoneRecurse(\n ticks,\n tree,\n scope,\n context,\n done,\n true,\n statementLabels,\n internal,\n generatorYield,\n ) &&\n isLisp(tree)\n ) {\n let op = tree[0];\n let obj;\n try {\n let ad: AsyncDoneRet;\n obj =\n (ad = asyncDone((d) =>\n execAsync(ticks, tree[1], scope, context, d, statementLabels, internal, generatorYield),\n )).isInstant === true\n ? ad.instant\n : (await ad.p).result;\n } catch (e) {\n done(e);\n return;\n }\n let a = obj;\n try {\n a = obj instanceof Prop ? obj.get(context) : obj;\n } catch (e) {\n done(e);\n return;\n }\n if (op === LispType.PropOptional || op === LispType.CallOptional) {\n if (a === undefined || a === null) {\n done(undefined, optional);\n return;\n }\n op = op === LispType.PropOptional ? LispType.Prop : LispType.Call;\n }\n if (a === optional) {\n if (op === LispType.Prop || op === LispType.Call) {\n done(undefined, a);\n return;\n } else {\n a = undefined;\n }\n }\n // Short-circuit for nullish coalescing: if a is not null/undefined, return a without evaluating b\n if (op === LispType.NullishCoalescing && a !== undefined && a !== null) {\n done(undefined, a);\n return;\n }\n let bobj;\n try {\n let ad: AsyncDoneRet;\n bobj =\n (ad = asyncDone((d) =>\n execAsync(ticks, tree[2], scope, context, d, statementLabels, internal, generatorYield),\n )).isInstant === true\n ? ad.instant\n : (await ad.p).result;\n } catch (e) {\n done(e);\n return;\n }\n let b = bobj;\n try {\n b = bobj instanceof Prop ? bobj.get(context) : bobj;\n } catch (e) {\n done(e);\n return;\n }\n if (b === optional) {\n b = undefined;\n }\n performOp({\n op,\n exec: execAsync,\n done,\n ticks,\n a,\n b,\n obj,\n context,\n scope,\n bobj,\n statementLabels,\n internal,\n generatorYield,\n tree,\n });\n }\n await p;\n}\n\nexport function execSync<T = any>(\n ticks: Ticks,\n tree: LispItem,\n scope: Scope,\n context: IExecContext,\n done: Done<T>,\n statementLabels: ControlFlowTargets,\n internal: boolean,\n generatorYield: ((yv: YieldValue, done?: Done) => void) | undefined,\n) {\n if (\n !_execNoneRecurse(\n ticks,\n tree,\n scope,\n context,\n done,\n false,\n statementLabels,\n internal,\n generatorYield,\n ) &&\n isLisp(tree)\n ) {\n let op = tree[0];\n let obj = syncDone((d) =>\n execSync(ticks, tree[1], scope, context, d, statementLabels, internal, generatorYield),\n ).result;\n let a = obj instanceof Prop ? obj.get(context) : obj;\n if (op === LispType.PropOptional || op === LispType.CallOptional) {\n if (a === undefined || a === null) {\n done(undefined, optional);\n return;\n }\n op = op === LispType.PropOptional ? LispType.Prop : LispType.Call;\n }\n if (a === optional) {\n if (op === LispType.Prop || op === LispType.Call) {\n done(undefined, a);\n return;\n } else {\n a = undefined;\n }\n }\n // Short-circuit for nullish coalescing: if a is not null/undefined, return a without evaluating b\n if (op === LispType.NullishCoalescing && a !== undefined && a !== null) {\n done(undefined, a);\n return;\n }\n let bobj = syncDone((d) =>\n execSync(ticks, tree[2], scope, context, d, statementLabels, internal, generatorYield),\n ).result;\n let b = bobj instanceof Prop ? bobj.get(context) : bobj;\n if (b === optional) {\n b = undefined;\n }\n performOp({\n op,\n exec: execSync,\n done,\n ticks,\n a,\n b,\n obj,\n context,\n scope,\n bobj,\n statementLabels,\n internal,\n generatorYield,\n tree,\n });\n }\n}\n\ntype OpsCallbackParams<a, b, obj, bobj> = {\n op: LispType;\n exec: Execution;\n a: a;\n b: b;\n obj: obj;\n bobj: bobj;\n ticks: Ticks;\n tree: LispItem;\n scope: Scope;\n context: IExecContext;\n done: Done;\n statementLabels: ControlFlowTargets;\n internal: boolean;\n generatorYield: ((yv: YieldValue, done?: Done) => void) | undefined;\n};\n\nexport function checkHaltExpectedTicks(\n params: OpsCallbackParams<any, any, any, any>,\n expectTicks = 0n,\n): boolean {\n const sandbox = params.context.ctx.sandbox;\n const { ticks, scope, context } = params;\n if (sandbox.halted) {\n const sub = sandbox.subscribeResume(() => {\n sub.unsubscribe();\n performOp(params, false);\n });\n return true;\n } else if (ticks.tickLimit !== undefined && ticks.tickLimit <= ticks.ticks + expectTicks) {\n const error = new SandboxExecutionQuotaExceededError('Execution quota exceeded');\n if (context.ctx.options.haltOnSandboxError) {\n const sub = sandbox.subscribeResume(() => {\n sub.unsubscribe();\n performOp(params);\n });\n sandbox.haltExecution({\n type: 'error',\n error,\n ticks,\n scope,\n context,\n });\n } else {\n params.done(error);\n }\n return true;\n } else if (ticks.nextYield && ticks.ticks > ticks.nextYield) {\n const sub = sandbox.subscribeResume(() => {\n sub.unsubscribe();\n performOp(params, false);\n });\n ticks.nextYield += NON_BLOCKING_THRESHOLD;\n sandbox.haltExecution({ type: 'yield' });\n setTimeout(() => sandbox.resumeExecution());\n return true;\n }\n ticks.ticks += expectTicks;\n return false;\n}\n\nfunction performOp(params: OpsCallbackParams<any, any, any, any>, count = true) {\n const { done, op, ticks, context, scope } = params;\n if (count) {\n ticks.ticks++;\n }\n const sandbox = context.ctx.sandbox;\n\n try {\n if (checkHaltExpectedTicks(params)) {\n return;\n }\n const o = ops.get(op);\n if (o === undefined) {\n done(new SandboxExecutionTreeError('Unknown operator: ' + op));\n return;\n }\n o(params);\n } catch (err) {\n if (context.ctx.options.haltOnSandboxError && err instanceof SandboxError) {\n const sub = sandbox.subscribeResume(() => {\n sub.unsubscribe();\n done(err);\n });\n sandbox.haltExecution({\n type: 'error',\n error: err,\n ticks,\n scope,\n context,\n });\n } else {\n done(err);\n }\n }\n}\n\nconst unexecTypes = new Set([\n LispType.ArrowFunction,\n LispType.Function,\n LispType.InlineFunction,\n LispType.Loop,\n LispType.Try,\n LispType.Switch,\n LispType.IfCase,\n LispType.InlineIfCase,\n LispType.Labeled,\n LispType.Typeof,\n]);\n\nfunction _execNoneRecurse<T = any>(\n ticks: Ticks,\n tree: LispItem,\n scope: Scope,\n context: IExecContext,\n done: Done<T>,\n isAsync: boolean,\n statementLabels: ControlFlowTargets,\n internal: boolean,\n generatorYield: ((yv: YieldValue, done?: Done) => void) | undefined,\n): boolean {\n const exec = isAsync ? execAsync : execSync;\n if (tree instanceof Prop) {\n done(undefined, tree.get(context));\n } else if (tree === optional) {\n done();\n } else if (Array.isArray(tree) && !isLisp(tree)) {\n if (tree[0] === LispType.None) {\n done();\n } else {\n execMany(\n ticks,\n exec,\n tree as Lisp[],\n done,\n scope,\n context,\n statementLabels,\n internal,\n generatorYield,\n );\n }\n } else if (!isLisp(tree)) {\n done(undefined, tree);\n } else if (tree[0] === LispType.Block) {\n execMany(\n ticks,\n exec,\n tree[1] as Lisp[],\n done,\n new Scope(scope),\n context,\n statementLabels,\n internal,\n generatorYield,\n );\n } else if (tree[0] === LispType.InternalBlock) {\n execMany(\n ticks,\n exec,\n tree[1] as Lisp[],\n done,\n scope,\n context,\n statementLabels,\n true,\n generatorYield,\n );\n } else if (tree[0] === LispType.Await) {\n if (!isAsync) {\n done(new SyntaxError(\"Illegal use of 'await', must be inside async function\"));\n } else if (context.ctx.prototypeWhitelist?.has(Promise.prototype)) {\n execAsync(\n ticks,\n tree[1],\n scope,\n context,\n async (...args: unknown[]) => {\n if (args.length === 1) done(args[0]);\n else\n try {\n done(undefined, (await sanitizeProp(args[1], context)) as any);\n } catch (err) {\n done(err);\n }\n },\n statementLabels,\n internal,\n generatorYield,\n ).catch(done);\n } else {\n done(new SandboxCapabilityError('Async/await is not permitted'));\n }\n } else if (tree[0] === LispType.Yield || tree[0] === LispType.YieldDelegate) {\n const yieldFn = generatorYield;\n if (!yieldFn) {\n done(new SyntaxError(\"Illegal use of 'yield', must be inside a generator function\"));\n return true;\n }\n const isDelegate = tree[0] === LispType.YieldDelegate;\n if (isAsync) {\n execAsync(\n ticks,\n tree[1],\n scope,\n context,\n async (...args: unknown[]) => {\n if (args.length === 1) {\n done(args[0]);\n return;\n }\n try {\n const val = await sanitizeProp(args[1], context);\n yieldFn(new YieldValue(val, isDelegate), done);\n } catch (err) {\n done(err);\n }\n },\n statementLabels,\n internal,\n generatorYield,\n ).catch(done);\n } else {\n try {\n const val = syncDone((d) =>\n execSync(ticks, tree[1], scope, context, d, statementLabels, internal, generatorYield),\n ).result;\n const sanitized = sanitizeProp(val, context);\n // Pass `done` as second arg so the yieldFn can call it with the injected value.\n // For capture-mode yieldFns (executeGenBody default case), this enables the restart loop.\n // For plain yieldFns (eager mode), done? is ignored and done() is called below.\n yieldFn(new YieldValue(sanitized, isDelegate), done);\n // If yieldFn did not call done (it threw syncYieldPauseSentinel instead), we fall through\n // to the catch which re-throws the sentinel. Otherwise yieldFn called done itself.\n } catch (err) {\n if (err === syncYieldPauseSentinel) throw err; // propagate pause up to restart loop\n done(err);\n }\n }\n } else if (unexecTypes.has(tree[0])) {\n performOp({\n op: tree[0],\n exec,\n done,\n ticks,\n a: tree[1],\n b: tree[2],\n obj: tree,\n tree,\n context,\n scope,\n bobj: undefined,\n statementLabels,\n internal,\n generatorYield,\n });\n } else {\n return false;\n }\n return true;\n}\nexport function executeTree<T>(\n ticks: Ticks,\n context: IExecContext,\n executionTree: Lisp[],\n scopes: IScope[] = [],\n statementLabels: ControlFlowTargets,\n internal: boolean,\n generatorYield?: ((yv: YieldValue, done?: Done) => void) | undefined,\n): ExecReturn<T> {\n return syncDone((done) =>\n executeTreeWithDone(\n execSync,\n done,\n ticks,\n context,\n executionTree,\n scopes,\n statementLabels,\n internal,\n generatorYield,\n ),\n ).result;\n}\n\nexport async function executeTreeAsync<T>(\n ticks: Ticks,\n context: IExecContext,\n executionTree: Lisp[],\n scopes: IScope[] = [],\n statementLabels: ControlFlowTargets,\n internal: boolean,\n generatorYield?: ((yv: YieldValue, done?: Done) => void) | undefined,\n): Promise<ExecReturn<T>> {\n let ad: AsyncDoneRet;\n return (ad = asyncDone((done) =>\n executeTreeWithDone(\n execAsync,\n done,\n ticks,\n context,\n executionTree,\n scopes,\n statementLabels,\n internal,\n generatorYield,\n ),\n )).isInstant === true\n ? ad.instant\n : (await ad.p).result;\n}\n\nexport function executeTreeWithDone(\n exec: Execution,\n done: Done,\n ticks: Ticks,\n context: IExecContext,\n executionTree: Lisp[],\n scopes: IScope[] = [],\n statementLabels: ControlFlowTargets,\n internal: boolean,\n generatorYield?: ((yv: YieldValue, done?: Done) => void) | undefined,\n) {\n if (!executionTree) {\n done();\n return;\n }\n if (!(executionTree instanceof Array)) {\n throw new SyntaxError('Bad execution tree');\n }\n let scope = context.ctx.globalScope;\n let s;\n while ((s = scopes.shift())) {\n if (typeof s !== 'object') continue;\n if (s instanceof Scope) {\n scope = s;\n } else {\n scope = new Scope(scope, s, s instanceof LocalScope ? undefined : null);\n }\n }\n if (context.ctx.options.audit && !context.ctx.auditReport) {\n context.ctx.auditReport = {\n globalsAccess: new Set(),\n prototypeAccess: {},\n };\n }\n if (exec === execSync) {\n _executeWithDoneSync(\n done,\n ticks,\n context,\n executionTree,\n scope,\n statementLabels,\n internal,\n generatorYield,\n );\n } else {\n _executeWithDoneAsync(\n done,\n ticks,\n context,\n executionTree,\n scope,\n statementLabels,\n internal,\n generatorYield,\n ).catch(done);\n }\n}\n\nfunction _executeWithDoneSync(\n done: Done,\n ticks: Ticks,\n context: IExecContext,\n executionTree: Lisp[],\n scope: Scope,\n statementLabels: ControlFlowTargets,\n internal: boolean,\n generatorYield: ((yv: YieldValue, done?: Done) => void) | undefined,\n) {\n if (!(executionTree instanceof Array)) throw new SyntaxError('Bad execution tree');\n let i = 0;\n for (i = 0; i < executionTree.length; i++) {\n let res: unknown;\n let err: { error: unknown } | undefined;\n const current = executionTree[i];\n try {\n execSync(\n ticks,\n current,\n scope,\n context,\n (...args: unknown[]) => {\n if (args.length === 1) err = { error: args[0] };\n else res = args[1];\n },\n statementLabels,\n internal,\n generatorYield,\n );\n } catch (e) {\n err = { error: e };\n }\n if (err) {\n done(err.error);\n return;\n }\n if (res instanceof ExecReturn) {\n done(undefined, res);\n return;\n }\n if (isLisp(current) && current[0] === LispType.Return) {\n done(undefined, new ExecReturn(context.ctx.auditReport, res, true));\n return;\n }\n }\n done(undefined, new ExecReturn(context.ctx.auditReport, undefined, false));\n}\n\nasync function _executeWithDoneAsync(\n done: Done,\n ticks: Ticks,\n context: IExecContext,\n executionTree: Lisp[],\n scope: Scope,\n statementLabels: ControlFlowTargets,\n internal: boolean,\n generatorYield: ((yv: YieldValue, done?: Done) => void) | undefined,\n) {\n if (!(executionTree instanceof Array)) throw new SyntaxError('Bad execution tree');\n let i = 0;\n for (i = 0; i < executionTree.length; i++) {\n let res: unknown;\n let err: { error: unknown } | undefined;\n const current = executionTree[i];\n try {\n await execAsync(\n ticks,\n current,\n scope,\n context,\n (...args: unknown[]) => {\n if (args.length === 1) err = { error: args[0] };\n else res = args[1];\n },\n statementLabels,\n internal,\n generatorYield,\n );\n } catch (e) {\n err = { error: e };\n }\n if (err) {\n done(err.error);\n return;\n }\n if (res instanceof ExecReturn) {\n done(undefined, res);\n return;\n }\n if (isLisp(current) && current[0] === LispType.Return) {\n done(undefined, new ExecReturn(context.ctx.auditReport, res, true));\n return;\n }\n }\n done(undefined, new ExecReturn(context.ctx.auditReport, undefined, false));\n}\n","import type { IEvalContext } from './eval';\nimport { Change, ExecReturn, executeTree, executeTreeAsync } from './executor';\nimport { createContext, SandboxExecutionQuotaExceededError } from './utils';\nimport type {\n IContext,\n IExecContext,\n IGlobals,\n IOptionParams,\n IOptions,\n IScope,\n ISymbolWhitelist,\n SubscriptionSubject,\n HaltContext,\n} from './utils';\n\nfunction subscribeSet(\n obj: object,\n name: string,\n callback: (modification: Change) => void,\n context: {\n setSubscriptions: WeakMap<\n SubscriptionSubject,\n Map<string, Set<(modification: Change) => void>>\n >;\n changeSubscriptions: WeakMap<SubscriptionSubject, Set<(modification: Change) => void>>;\n },\n): { unsubscribe: () => void } {\n const names =\n context.setSubscriptions.get(obj) || new Map<string, Set<(modification: Change) => void>>();\n context.setSubscriptions.set(obj, names);\n const callbacks = names.get(name) || new Set();\n names.set(name, callbacks);\n callbacks.add(callback);\n let changeCbs: Set<(modification: Change) => void>;\n const val = (obj as any)[name] as unknown;\n if (val instanceof Object) {\n changeCbs = context.changeSubscriptions.get(val) || new Set();\n changeCbs.add(callback);\n context.changeSubscriptions.set(val, changeCbs);\n }\n return {\n unsubscribe: () => {\n callbacks.delete(callback);\n changeCbs?.delete(callback);\n },\n };\n}\n\nexport class SandboxExec {\n public readonly context: IContext;\n public readonly setSubscriptions: WeakMap<\n SubscriptionSubject,\n Map<string, Set<(modification: Change) => void>>\n > = new WeakMap();\n public readonly changeSubscriptions: WeakMap<\n SubscriptionSubject,\n Set<(modification: Change) => void>\n > = new WeakMap();\n public readonly sandboxFunctions: WeakMap<Function, IExecContext> = new WeakMap();\n private haltSubscriptions: Set<(context: HaltContext) => void> = new Set();\n private resumeSubscriptions: Set<() => void> = new Set();\n public halted = false;\n timeoutHandleCounter = 0;\n public readonly setTimeoutHandles = new Map<\n number,\n {\n handle: number;\n haltsub: { unsubscribe: () => void };\n contsub: { unsubscribe: () => void };\n }\n >();\n public readonly setIntervalHandles = new Map<\n number,\n {\n handle: number;\n haltsub: { unsubscribe: () => void };\n contsub: { unsubscribe: () => void };\n }\n >();\n constructor(\n options?: IOptionParams,\n public evalContext?: IEvalContext,\n ) {\n const opt: IOptions = Object.assign(\n {\n audit: false,\n forbidFunctionCalls: false,\n forbidFunctionCreation: false,\n globals: SandboxExec.SAFE_GLOBALS,\n symbolWhitelist: SandboxExec.SAFE_SYMBOLS,\n prototypeWhitelist: SandboxExec.SAFE_PROTOTYPES,\n maxParserRecursionDepth: 256,\n nonBlocking: false,\n functionReplacements: new Map<\n Function,\n (ctx: IExecContext, builtInReplacement?: Function) => Function\n >(),\n },\n options || {},\n );\n this.context = createContext(this, opt);\n }\n\n static get SAFE_GLOBALS(): IGlobals {\n return {\n globalThis,\n Function,\n eval,\n console: {\n debug: console.debug,\n error: console.error,\n info: console.info,\n log: console.log,\n table: console.table,\n warn: console.warn,\n },\n isFinite,\n isNaN,\n parseFloat,\n parseInt,\n decodeURI,\n decodeURIComponent,\n encodeURI,\n encodeURIComponent,\n escape,\n unescape,\n Boolean,\n Number,\n BigInt,\n String,\n Object,\n Array,\n Symbol,\n Error,\n EvalError,\n RangeError,\n ReferenceError,\n SyntaxError,\n TypeError,\n URIError,\n Int8Array,\n Uint8Array,\n Uint8ClampedArray,\n Int16Array,\n Uint16Array,\n Int32Array,\n Uint32Array,\n Float32Array,\n Float64Array,\n Map,\n Set,\n WeakMap,\n WeakSet,\n Promise,\n Intl,\n JSON,\n Math,\n Date,\n RegExp,\n };\n }\n\n static get SAFE_SYMBOLS(): ISymbolWhitelist {\n const safeSymbols: ISymbolWhitelist = {};\n for (const key of [\n 'asyncIterator',\n 'iterator',\n 'match',\n 'matchAll',\n 'replace',\n 'search',\n 'split',\n ]) {\n const value = (Symbol as unknown as Record<string, symbol | undefined>)[key];\n if (typeof value === 'symbol') {\n safeSymbols[key] = value;\n }\n }\n return safeSymbols;\n }\n\n static get SAFE_PROTOTYPES(): Map<any, Set<string>> {\n const protos = [\n Function,\n Boolean,\n Number,\n BigInt,\n String,\n Date,\n Error,\n Array,\n Int8Array,\n Uint8Array,\n Uint8ClampedArray,\n Int16Array,\n Uint16Array,\n Int32Array,\n Uint32Array,\n Float32Array,\n Float64Array,\n Map,\n Set,\n WeakMap,\n WeakSet,\n Promise,\n Symbol,\n Date,\n RegExp,\n // Fetch API\n Response,\n Request,\n Headers,\n FormData,\n ];\n const map = new Map<any, Set<string>>();\n protos.forEach((proto) => {\n map.set(proto, new Set());\n });\n map.set(\n Object,\n new Set([\n 'constructor',\n 'name',\n 'entries',\n 'fromEntries',\n 'getOwnPropertyNames',\n 'is',\n 'keys',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf',\n 'values',\n ]),\n );\n return map;\n }\n\n subscribeGet(\n callback: (obj: SubscriptionSubject, name: string) => void,\n context: IExecContext,\n ): { unsubscribe: () => void } {\n context.getSubscriptions.add(callback);\n return { unsubscribe: () => context.getSubscriptions.delete(callback) };\n }\n\n subscribeSet(\n obj: object,\n name: string,\n callback: (modification: Change) => void,\n context: SandboxExec | IExecContext,\n ): { unsubscribe: () => void } {\n return subscribeSet(obj, name, callback, context);\n }\n\n subscribeSetGlobal(\n obj: SubscriptionSubject,\n name: string,\n callback: (modification: Change) => void,\n ): { unsubscribe: () => void } {\n return subscribeSet(obj, name, callback, this);\n }\n\n subscribeHalt(cb: (context: HaltContext) => void) {\n this.haltSubscriptions.add(cb);\n return {\n unsubscribe: () => {\n this.haltSubscriptions.delete(cb);\n },\n };\n }\n subscribeResume(cb: () => void) {\n this.resumeSubscriptions.add(cb);\n return {\n unsubscribe: () => {\n this.resumeSubscriptions.delete(cb);\n },\n };\n }\n\n haltExecution(haltContext: HaltContext = { type: 'manual' }) {\n if (this.halted) return;\n this.halted = true;\n for (const cb of this.haltSubscriptions) {\n cb(haltContext);\n }\n }\n\n resumeExecution() {\n if (!this.halted) return;\n if (\n this.context.ticks.tickLimit !== undefined &&\n this.context.ticks.ticks >= this.context.ticks.tickLimit\n ) {\n throw new SandboxExecutionQuotaExceededError('Cannot resume execution: tick limit exceeded');\n }\n this.halted = false;\n for (const cb of this.resumeSubscriptions) {\n cb();\n }\n }\n\n getContext(fn: (...args: any[]) => any) {\n return this.sandboxFunctions.get(fn);\n }\n\n executeTree<T>(context: IExecContext, scopes: IScope[] = []): ExecReturn<T> {\n return executeTree(context.ctx.ticks, context, context.tree, scopes, undefined, false);\n }\n\n executeTreeAsync<T>(context: IExecContext, scopes: IScope[] = []): Promise<ExecReturn<T>> {\n return executeTreeAs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B,QAAS,EAAY,aACrB,gBAAiB,EAAY,aAC7B,mBAAoB,EAAY,gBAChC,wBAAyB,IACzB,aAAa,EACb,qBAAsB,IAAI,KAK5B,GAAW,CAAA,GAEb,KAAK,QAAU,GAAc,KAAM,GAGrC,uBAAW,GACT,MAAO,CACL,sBACA,kBACA,UACA,QAAS,CACP,MAAO,QAAQ,MACf,MAAO,QAAQ,MACf,KAAM,QAAQ,KACd,IAAK,QAAQ,IACb,MAAO,QAAQ,MACf,KAAM,QAAQ,MAEhB,kBACA,YACA,sBACA,kBACA,oBACA,sCACA,oBACA,sCACA,cACA,kBACA,gBACA,cACA,cACA,cACA,cACA,YACA,cACA,YACA,oBACA,sBACA,8BACA,wBACA,oBACA,kBACA,oBACA,sBACA,oCACA,sBACA,wBACA,sBACA,wBACA,0BACA,0BACA,QACA,QACA,gBACA,gBACA,gBACA,UACA,UACA,UACA,UACA,eAIJ,uBAAW,GACT,MAAM,EAAgC,CAAA,EACtC,IAAK,MAAM,IAAO,CAChB,gBACA,WACA,QACA,WACA,UACA,SACA,SACC,CACD,MAAM,EAAS,OAAyD,GACnD,iBAAV,IACT,EAAY,GAAO,GAGvB,OAAO,EAGT,0BAAW,GACT,MAAM,EAAS,CACb,SACA,QACA,OACA,OACA,OACA,KACA,MACA,MACA,UACA,WACA,kBACA,WACA,YACA,WACA,YACA,aACA,aACA,IACA,IACA,QACA,QACA,QACA,OACA,KACA,OAEA,SACA,QACA,QACA,UAEI,EAAM,IAAI,IAuBhB,OAtBA,EAAO,QAAS,IACd,EAAI,IAAI,EAAO,IAAI,OAErB,EAAI,IACF,OACA,IAAI,IAAI,CACN,cACA,OACA,UACA,cACA,sBACA,KACA,OACA,iBACA,gBACA,uBACA,iBACA,WACA,UACA,YAGG,EAGT,YAAA,CACE,EACA,GAGA,OADA,EAAQ,iBAAiB,IAAI,GACtB,CAAE,YAAA,IAAmB,EAAQ,iBAAiB,OAAO,IAG9D,YAAA,CACE,EACA,EACA,EACA,GAEA,OAAO,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