sandlot 0.1.1 → 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/README.md +145 -518
- package/dist/build-emitter.d.ts +47 -0
- package/dist/build-emitter.d.ts.map +1 -0
- package/dist/builder.d.ts +370 -0
- package/dist/builder.d.ts.map +1 -0
- package/dist/bundler.d.ts +3 -3
- package/dist/bundler.d.ts.map +1 -1
- package/dist/commands/compile.d.ts +13 -0
- package/dist/commands/compile.d.ts.map +1 -0
- package/dist/commands/index.d.ts +17 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/packages.d.ts +17 -0
- package/dist/commands/packages.d.ts.map +1 -0
- package/dist/commands/run.d.ts +40 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/types.d.ts +141 -0
- package/dist/commands/types.d.ts.map +1 -0
- package/dist/fs.d.ts +60 -42
- package/dist/fs.d.ts.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +304 -491
- package/dist/internal.d.ts +5 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +174 -95
- package/dist/runner.d.ts +314 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/sandbox-manager.d.ts +45 -33
- package/dist/sandbox-manager.d.ts.map +1 -1
- package/dist/sandbox.d.ts +144 -70
- package/dist/sandbox.d.ts.map +1 -1
- package/dist/shared-modules.d.ts +22 -3
- package/dist/shared-modules.d.ts.map +1 -1
- package/dist/shared-resources.d.ts +0 -3
- package/dist/shared-resources.d.ts.map +1 -1
- package/dist/typechecker.d.ts +1 -1
- package/package.json +3 -17
- package/src/build-emitter.ts +64 -0
- package/src/builder.ts +498 -0
- package/src/bundler.ts +86 -57
- package/src/commands/compile.ts +236 -0
- package/src/commands/index.ts +51 -0
- package/src/commands/packages.ts +154 -0
- package/src/commands/run.ts +245 -0
- package/src/commands/types.ts +172 -0
- package/src/fs.ts +90 -216
- package/src/index.ts +34 -12
- package/src/internal.ts +5 -2
- package/src/sandbox.ts +214 -220
- package/src/shared-modules.ts +74 -4
- package/src/shared-resources.ts +0 -3
- package/src/ts-libs.ts +1 -1
- package/src/typechecker.ts +1 -1
- package/dist/react.d.ts +0 -159
- package/dist/react.d.ts.map +0 -1
- package/dist/react.js +0 -149
- package/src/commands.ts +0 -733
- package/src/react.tsx +0 -331
- package/src/sandbox-manager.ts +0 -490
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types and utilities for sandbox bash commands.
|
|
3
|
+
*/
|
|
4
|
+
import type { IFileSystem } from "just-bash/browser";
|
|
5
|
+
import type { BundleResult } from "../bundler";
|
|
6
|
+
import type { TypesCache } from "../packages";
|
|
7
|
+
/**
|
|
8
|
+
* The result of a successful build, including the bundle and loaded module.
|
|
9
|
+
*/
|
|
10
|
+
export interface BuildOutput {
|
|
11
|
+
/**
|
|
12
|
+
* The compiled bundle (code, metadata, etc.)
|
|
13
|
+
*/
|
|
14
|
+
bundle: BundleResult;
|
|
15
|
+
/**
|
|
16
|
+
* The loaded module exports.
|
|
17
|
+
* If validation was provided, this is the validated module.
|
|
18
|
+
*/
|
|
19
|
+
module: Record<string, unknown>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Validation function type for module validation.
|
|
23
|
+
* Takes the raw module exports and returns validated exports (or throws).
|
|
24
|
+
*/
|
|
25
|
+
export type ValidateFn = (module: Record<string, unknown>) => Record<string, unknown>;
|
|
26
|
+
/**
|
|
27
|
+
* Dependencies required by command factories
|
|
28
|
+
*/
|
|
29
|
+
export interface CommandDeps {
|
|
30
|
+
/**
|
|
31
|
+
* The virtual filesystem to operate on
|
|
32
|
+
*/
|
|
33
|
+
fs: IFileSystem;
|
|
34
|
+
/**
|
|
35
|
+
* Pre-loaded TypeScript lib files for type checking
|
|
36
|
+
*/
|
|
37
|
+
libFiles: Map<string, string>;
|
|
38
|
+
/**
|
|
39
|
+
* Path to tsconfig.json in the virtual filesystem
|
|
40
|
+
*/
|
|
41
|
+
tsconfigPath: string;
|
|
42
|
+
/**
|
|
43
|
+
* Callback invoked when a build succeeds (after loading and validation).
|
|
44
|
+
*/
|
|
45
|
+
onBuild?: (result: BuildOutput) => void | Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Getter for the current validation function.
|
|
48
|
+
* Called during build to check if validation should be performed.
|
|
49
|
+
*/
|
|
50
|
+
getValidation?: () => ValidateFn | null;
|
|
51
|
+
/**
|
|
52
|
+
* Cache for package type definitions.
|
|
53
|
+
* When provided, avoids redundant network fetches for packages
|
|
54
|
+
* that have already been installed in other sandboxes.
|
|
55
|
+
*/
|
|
56
|
+
typesCache?: TypesCache;
|
|
57
|
+
/**
|
|
58
|
+
* Options for the `run` command
|
|
59
|
+
*/
|
|
60
|
+
runOptions?: RunOptions;
|
|
61
|
+
/**
|
|
62
|
+
* Module IDs that should be resolved from the host's SharedModuleRegistry
|
|
63
|
+
* instead of esm.sh CDN. The host must have registered these modules.
|
|
64
|
+
*
|
|
65
|
+
* Example: ['react', 'react-dom/client']
|
|
66
|
+
*/
|
|
67
|
+
sharedModules?: string[];
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Runtime context passed to the `main()` function when code is executed.
|
|
71
|
+
* This provides sandboxed code with access to sandbox capabilities.
|
|
72
|
+
*/
|
|
73
|
+
export interface RunContext {
|
|
74
|
+
/**
|
|
75
|
+
* The virtual filesystem - read/write files within the sandbox
|
|
76
|
+
*/
|
|
77
|
+
fs: IFileSystem;
|
|
78
|
+
/**
|
|
79
|
+
* Environment variables (configurable per-sandbox)
|
|
80
|
+
*/
|
|
81
|
+
env: Record<string, string>;
|
|
82
|
+
/**
|
|
83
|
+
* Command-line arguments passed to `run`
|
|
84
|
+
*/
|
|
85
|
+
args: string[];
|
|
86
|
+
/**
|
|
87
|
+
* Explicit logging function (alternative to console.log)
|
|
88
|
+
*/
|
|
89
|
+
log: (...args: unknown[]) => void;
|
|
90
|
+
/**
|
|
91
|
+
* Explicit error logging function (alternative to console.error)
|
|
92
|
+
*/
|
|
93
|
+
error: (...args: unknown[]) => void;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Options for configuring the `run` command behavior
|
|
97
|
+
*/
|
|
98
|
+
export interface RunOptions {
|
|
99
|
+
/**
|
|
100
|
+
* Environment variables available via ctx.env
|
|
101
|
+
*/
|
|
102
|
+
env?: Record<string, string>;
|
|
103
|
+
/**
|
|
104
|
+
* Maximum execution time in milliseconds (default: 30000 = 30s)
|
|
105
|
+
* Set to 0 to disable timeout.
|
|
106
|
+
*/
|
|
107
|
+
timeout?: number;
|
|
108
|
+
/**
|
|
109
|
+
* Whether to skip type checking before running (default: false)
|
|
110
|
+
*/
|
|
111
|
+
skipTypecheck?: boolean;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Result of running code via the `run` command
|
|
115
|
+
*/
|
|
116
|
+
export interface RunResult {
|
|
117
|
+
/**
|
|
118
|
+
* Captured console output (log, warn, error)
|
|
119
|
+
*/
|
|
120
|
+
logs: string[];
|
|
121
|
+
/**
|
|
122
|
+
* Return value from main() if present
|
|
123
|
+
*/
|
|
124
|
+
returnValue?: unknown;
|
|
125
|
+
/**
|
|
126
|
+
* Execution time in milliseconds
|
|
127
|
+
*/
|
|
128
|
+
executionTimeMs: number;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Format esbuild messages (warnings/errors) for display
|
|
132
|
+
*/
|
|
133
|
+
export declare function formatEsbuildMessages(messages: {
|
|
134
|
+
text: string;
|
|
135
|
+
location?: {
|
|
136
|
+
file?: string;
|
|
137
|
+
line?: number;
|
|
138
|
+
column?: number;
|
|
139
|
+
} | null;
|
|
140
|
+
}[]): string;
|
|
141
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/commands/types.ts"],"names":[],"mappings":"AA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;IACH,GAAG,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IAElC;;OAEG;IACH,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE7B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,IAAI,EAAE,MAAM,EAAE,CAAC;IAEf;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CAAE,EAAE,GAChG,MAAM,CAaR"}
|
package/dist/fs.d.ts
CHANGED
|
@@ -10,9 +10,12 @@ interface ReadFileOptions {
|
|
|
10
10
|
encoding?: BufferEncoding | null;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Options for writing files
|
|
13
|
+
* Options for writing files.
|
|
14
|
+
* Note: In this browser-based filesystem, content is stored as-is.
|
|
15
|
+
* The encoding option is accepted for API compatibility but not used.
|
|
14
16
|
*/
|
|
15
17
|
interface WriteFileOptions {
|
|
18
|
+
/** Accepted for API compatibility but not used - content is stored as-is */
|
|
16
19
|
encoding?: BufferEncoding;
|
|
17
20
|
}
|
|
18
21
|
/**
|
|
@@ -25,59 +28,76 @@ interface DirentEntry {
|
|
|
25
28
|
isSymbolicLink: boolean;
|
|
26
29
|
}
|
|
27
30
|
/**
|
|
28
|
-
* Options for creating
|
|
31
|
+
* Options for creating a Filesystem instance
|
|
29
32
|
*/
|
|
30
|
-
export interface
|
|
31
|
-
/** Database name in IndexedDB */
|
|
32
|
-
dbName?: string;
|
|
33
|
+
export interface FilesystemOptions {
|
|
33
34
|
/** Maximum total size in bytes (default: 50MB) */
|
|
34
35
|
maxSizeBytes?: number;
|
|
35
|
-
/** Initial files to populate
|
|
36
|
+
/** Initial files to populate */
|
|
36
37
|
initialFiles?: InitialFiles;
|
|
37
38
|
}
|
|
38
39
|
/**
|
|
39
|
-
* In-memory filesystem
|
|
40
|
-
*
|
|
40
|
+
* In-memory virtual filesystem for sandlot sandboxes.
|
|
41
|
+
*
|
|
42
|
+
* All operations are synchronous in-memory. Use `getFiles()` to export
|
|
43
|
+
* the current state for persistence, and `initialFiles` to restore.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* // Create filesystem
|
|
48
|
+
* const fs = Filesystem.create({ initialFiles: { '/src/index.ts': 'export const x = 1;' } });
|
|
49
|
+
*
|
|
50
|
+
* // Use filesystem
|
|
51
|
+
* await fs.writeFile('/src/app.ts', 'console.log("hello")');
|
|
52
|
+
*
|
|
53
|
+
* // Export for persistence
|
|
54
|
+
* const files = fs.getFiles();
|
|
55
|
+
* localStorage.setItem('my-project', JSON.stringify(files));
|
|
56
|
+
*
|
|
57
|
+
* // Later, restore
|
|
58
|
+
* const saved = JSON.parse(localStorage.getItem('my-project'));
|
|
59
|
+
* const fs2 = Filesystem.create({ initialFiles: saved });
|
|
60
|
+
* ```
|
|
41
61
|
*/
|
|
42
|
-
export declare class
|
|
62
|
+
export declare class Filesystem implements IFileSystem {
|
|
43
63
|
private entries;
|
|
44
|
-
private db;
|
|
45
|
-
private dbName;
|
|
46
64
|
private maxSizeBytes;
|
|
47
|
-
private dirty;
|
|
48
65
|
private constructor();
|
|
49
66
|
/**
|
|
50
|
-
* Create
|
|
67
|
+
* Create a new Filesystem instance
|
|
51
68
|
*/
|
|
52
|
-
static create(options?:
|
|
69
|
+
static create(options?: FilesystemOptions): Filesystem;
|
|
53
70
|
/**
|
|
54
|
-
*
|
|
71
|
+
* Get all files as a serializable object.
|
|
72
|
+
*
|
|
73
|
+
* Returns a Record<string, string> that can be JSON-serialized and
|
|
74
|
+
* used as `initialFiles` when creating a new filesystem.
|
|
75
|
+
*
|
|
76
|
+
* Note: Only includes files, not directories (directories are
|
|
77
|
+
* automatically created from file paths). Binary files are
|
|
78
|
+
* base64-encoded with a `data:` prefix.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* const files = fs.getFiles();
|
|
83
|
+
* // { '/src/index.ts': 'export const x = 1;', '/package.json': '{"name":"app"}' }
|
|
84
|
+
*
|
|
85
|
+
* // Persist however you want
|
|
86
|
+
* localStorage.setItem('project', JSON.stringify(files));
|
|
87
|
+
*
|
|
88
|
+
* // Restore later
|
|
89
|
+
* const saved = JSON.parse(localStorage.getItem('project'));
|
|
90
|
+
* const fs2 = Filesystem.create({ initialFiles: saved });
|
|
91
|
+
* ```
|
|
55
92
|
*/
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Save all entries to IndexedDB
|
|
59
|
-
* @returns true if saved, false if no db or not dirty
|
|
60
|
-
*/
|
|
61
|
-
save(): Promise<boolean>;
|
|
62
|
-
/**
|
|
63
|
-
* Reload entries from IndexedDB, discarding unsaved changes
|
|
64
|
-
*/
|
|
65
|
-
reload(): Promise<void>;
|
|
66
|
-
/**
|
|
67
|
-
* Check if there are unsaved changes
|
|
68
|
-
*/
|
|
69
|
-
isDirty(): boolean;
|
|
93
|
+
getFiles(): Record<string, string>;
|
|
70
94
|
/**
|
|
71
95
|
* Get approximate size of all stored data in bytes
|
|
72
96
|
*/
|
|
73
97
|
getSize(): number;
|
|
74
|
-
/**
|
|
75
|
-
* Close the database connection
|
|
76
|
-
*/
|
|
77
|
-
close(): void;
|
|
78
98
|
readFile(path: string, options?: ReadFileOptions | BufferEncoding): Promise<string>;
|
|
79
99
|
readFileBuffer(path: string): Promise<Uint8Array>;
|
|
80
|
-
writeFile(path: string, content: FileContent,
|
|
100
|
+
writeFile(path: string, content: FileContent, _options?: WriteFileOptions | BufferEncoding): Promise<void>;
|
|
81
101
|
appendFile(path: string, content: FileContent, options?: WriteFileOptions | BufferEncoding): Promise<void>;
|
|
82
102
|
exists(path: string): Promise<boolean>;
|
|
83
103
|
stat(path: string): Promise<FsStat>;
|
|
@@ -108,18 +128,16 @@ export declare class IndexedDbFs implements IFileSystem {
|
|
|
108
128
|
private checkSizeLimit;
|
|
109
129
|
private getEncoding;
|
|
110
130
|
private decodeBuffer;
|
|
131
|
+
private encodeBase64;
|
|
111
132
|
private concatBuffers;
|
|
112
133
|
private static parseFileInit;
|
|
113
|
-
private static openDatabase;
|
|
114
|
-
private static loadEntries;
|
|
115
|
-
private serializeEntry;
|
|
116
|
-
private static deserializeEntry;
|
|
117
|
-
private promisifyRequest;
|
|
118
|
-
private promisifyTransaction;
|
|
119
134
|
}
|
|
120
135
|
/**
|
|
121
|
-
*
|
|
136
|
+
* Create an in-memory filesystem.
|
|
137
|
+
*
|
|
138
|
+
* @param initialFiles - Optional initial files to populate the filesystem
|
|
139
|
+
* @returns A new Filesystem instance
|
|
122
140
|
*/
|
|
123
|
-
export declare function
|
|
141
|
+
export declare function createFilesystem(options?: FilesystemOptions): Filesystem;
|
|
124
142
|
export {};
|
|
125
143
|
//# sourceMappingURL=fs.d.ts.map
|
package/dist/fs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../src/fs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EAEX,MAAM,EACN,YAAY,EACZ,SAAS,EACT,SAAS,EACT,WAAW,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ED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,UAAU,CAExE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
export { createSandbox,
|
|
2
|
-
export {
|
|
1
|
+
export { createSandbox, type Sandbox, type SandboxOptions, type SandboxState, type SandboxBashOptions, } from "./sandbox";
|
|
2
|
+
export { createBuilder, type BuildResult, type CreateBuilderOptions, type BuildCallOptions, type BuilderFn, } from "./builder";
|
|
3
3
|
export { loadModule, loadExport, loadDefault, getExportNames, hasExport, ModuleLoadError, ExportNotFoundError, } from "./loader";
|
|
4
4
|
export { registerSharedModules, unregisterSharedModule, clearSharedModules, } from "./shared-modules";
|
|
5
5
|
export type { BundleResult } from "./bundler";
|
|
6
|
+
export type { BuildOutput, ValidateFn } from "./commands/types";
|
|
6
7
|
export type { TypecheckResult, Diagnostic } from "./typechecker";
|
|
7
8
|
export type { PackageManifest, InstallResult } from "./packages";
|
|
8
9
|
export { initBundler, bundle, bundleToUrl, bundleAndImport, type BundleOptions, type NpmImportsMode, } from "./bundler";
|
|
9
10
|
export { typecheck, formatDiagnostics, formatDiagnosticsForAgent, type TypecheckOptions, } from "./typechecker";
|
|
10
11
|
export { installPackage, uninstallPackage, listPackages, getPackageManifest, type InstallOptions, } from "./packages";
|
|
11
12
|
export { createSharedResources, getDefaultResources, clearDefaultResources, hasDefaultResources, type SharedResourcesOptions, type SharedResources, type TypesCache, } from "./shared-resources";
|
|
12
|
-
export {
|
|
13
|
+
export { Filesystem, createFilesystem, type FilesystemOptions, } from "./fs";
|
|
13
14
|
export type { IFileSystem, FsEntry } from "just-bash/browser";
|
|
14
15
|
export { getDefaultBrowserLibs, fetchAndCacheLibs, } from "./ts-libs";
|
|
15
|
-
export { createTscCommand, createBuildCommand, createInstallCommand, createUninstallCommand, createListCommand, createRunCommand, createDefaultCommands, type CommandDeps, type RunContext, type RunOptions, type RunResult, } from "./commands";
|
|
16
|
+
export { createTscCommand, createBuildCommand, createInstallCommand, createUninstallCommand, createListCommand, createRunCommand, createDefaultCommands, type CommandDeps, type RunContext, type RunOptions, type RunResult, } from "./commands/index";
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAyBA,OAAO,EACL,aAAa,EACb,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,kBAAkB,GACxB,MAAM,WAAW,CAAC;AAMnB,OAAO,EACL,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,SAAS,GACf,MAAM,WAAW,CAAC;AAMnB,OAAO,EACL,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,SAAS,EACT,eAAe,EACf,mBAAmB,GACpB,MAAM,UAAU,CAAC;AAMlB,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAM1B,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAChE,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACjE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAWjE,OAAO,EACL,WAAW,EACX,MAAM,EACN,WAAW,EACX,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,cAAc,GACpB,MAAM,WAAW,CAAC;AAMnB,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,yBAAyB,EACzB,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAC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