@clef-sh/core 0.1.14 → 0.1.15-beta.106

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.
Files changed (37) hide show
  1. package/dist/__mocks__/write-file-atomic.d.ts +5 -0
  2. package/dist/__mocks__/write-file-atomic.d.ts.map +1 -0
  3. package/dist/bulk/ops.d.ts +13 -4
  4. package/dist/bulk/ops.d.ts.map +1 -1
  5. package/dist/git/integration.d.ts +73 -2
  6. package/dist/git/integration.d.ts.map +1 -1
  7. package/dist/import/index.d.ts +12 -3
  8. package/dist/import/index.d.ts.map +1 -1
  9. package/dist/index.d.mts +8 -2
  10. package/dist/index.d.ts +8 -2
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +4695 -1433
  13. package/dist/index.js.map +4 -4
  14. package/dist/index.mjs +3971 -692
  15. package/dist/index.mjs.map +4 -4
  16. package/dist/lint/runner.d.ts.map +1 -1
  17. package/dist/manifest/io.d.ts +16 -0
  18. package/dist/manifest/io.d.ts.map +1 -1
  19. package/dist/manifest/parser.d.ts.map +1 -1
  20. package/dist/migration/backend.d.ts +20 -3
  21. package/dist/migration/backend.d.ts.map +1 -1
  22. package/dist/recipients/index.d.ts +9 -4
  23. package/dist/recipients/index.d.ts.map +1 -1
  24. package/dist/reset/manager.d.ts +118 -0
  25. package/dist/reset/manager.d.ts.map +1 -0
  26. package/dist/service-identity/manager.d.ts +67 -10
  27. package/dist/service-identity/manager.d.ts.map +1 -1
  28. package/dist/sops/client.d.ts.map +1 -1
  29. package/dist/structure/manager.d.ts +155 -0
  30. package/dist/structure/manager.d.ts.map +1 -0
  31. package/dist/tx/errors.d.ts +32 -0
  32. package/dist/tx/errors.d.ts.map +1 -0
  33. package/dist/tx/index.d.ts +4 -0
  34. package/dist/tx/index.d.ts.map +1 -0
  35. package/dist/tx/transaction-manager.d.ts +66 -0
  36. package/dist/tx/transaction-manager.d.ts.map +1 -0
  37. package/package.json +5 -1
@@ -0,0 +1,5 @@
1
+ declare const writeFileAtomic: jest.Mock<any, any, any> & {
2
+ sync: jest.Mock<any, any, any>;
3
+ };
4
+ export default writeFileAtomic;
5
+ //# sourceMappingURL=write-file-atomic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-file-atomic.d.ts","sourceRoot":"","sources":["../../src/__mocks__/write-file-atomic.ts"],"names":[],"mappings":"AAYA,QAAA,MAAM,eAAe;;CAAkE,CAAC;AACxF,eAAe,eAAe,CAAC"}
@@ -1,15 +1,24 @@
1
1
  import { ClefManifest, MatrixCell } from "../types";
2
2
  import { EncryptionBackend } from "../types";
3
+ import { TransactionManager } from "../tx";
3
4
  /**
4
5
  * Performs bulk set, delete, and copy operations across multiple environments.
5
6
  *
7
+ * Each public method wraps its work in a single TransactionManager commit so
8
+ * any cell-write failure rolls back ALL writes via `git reset --hard`. The
9
+ * previous "collect errors and continue" behavior is gone — bulk ops are now
10
+ * all-or-nothing.
11
+ *
6
12
  * @example
7
13
  * ```ts
8
- * const bulk = new BulkOps();
14
+ * const tx = new TransactionManager(new GitIntegration(runner));
15
+ * const bulk = new BulkOps(tx);
9
16
  * await bulk.setAcrossEnvironments("app", "DATABASE_URL", { staging: "...", production: "..." }, manifest, sopsClient, repoRoot);
10
17
  * ```
11
18
  */
12
19
  export declare class BulkOps {
20
+ private readonly tx;
21
+ constructor(tx: TransactionManager);
13
22
  /**
14
23
  * Set a key to different values in multiple environments at once.
15
24
  *
@@ -19,7 +28,7 @@ export declare class BulkOps {
19
28
  * @param manifest - Parsed manifest.
20
29
  * @param sopsClient - SOPS client used to decrypt and re-encrypt each file.
21
30
  * @param repoRoot - Absolute path to the repository root.
22
- * @throws `Error` with details if any environment fails.
31
+ * @throws Whatever the underlying encrypt throws the transaction rolls back.
23
32
  */
24
33
  setAcrossEnvironments(namespace: string, key: string, values: Record<string, string>, manifest: ClefManifest, sopsClient: EncryptionBackend, repoRoot: string): Promise<void>;
25
34
  /**
@@ -30,7 +39,6 @@ export declare class BulkOps {
30
39
  * @param manifest - Parsed manifest.
31
40
  * @param sopsClient - SOPS client.
32
41
  * @param repoRoot - Absolute path to the repository root.
33
- * @throws `Error` with details if any environment fails.
34
42
  */
35
43
  deleteAcrossEnvironments(namespace: string, key: string, manifest: ClefManifest, sopsClient: EncryptionBackend, repoRoot: string): Promise<void>;
36
44
  /**
@@ -41,8 +49,9 @@ export declare class BulkOps {
41
49
  * @param toCell - Destination matrix cell.
42
50
  * @param sopsClient - SOPS client.
43
51
  * @param manifest - Parsed manifest.
52
+ * @param repoRoot - Absolute path to the repository root.
44
53
  * @throws `Error` if the key does not exist in the source cell.
45
54
  */
46
- copyValue(key: string, fromCell: MatrixCell, toCell: MatrixCell, sopsClient: EncryptionBackend, manifest: ClefManifest): Promise<void>;
55
+ copyValue(key: string, fromCell: MatrixCell, toCell: MatrixCell, sopsClient: EncryptionBackend, manifest: ClefManifest, repoRoot: string): Promise<void>;
47
56
  }
48
57
  //# sourceMappingURL=ops.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ops.d.ts","sourceRoot":"","sources":["../../src/bulk/ops.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C;;;;;;;;GAQG;AACH,qBAAa,OAAO;IAClB;;;;;;;;;;OAUG;IACG,qBAAqB,CACzB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,QAAQ,EAAE,YAAY,EACtB,UAAU,EAAE,iBAAiB,EAC7B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;IA+BhB;;;;;;;;;OASG;IACG,wBAAwB,CAC5B,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,YAAY,EACtB,UAAU,EAAE,iBAAiB,EA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C,IAAI,CAAC;CAmBjB"}
@@ -25,10 +25,81 @@ export declare class GitIntegration {
25
25
  *
26
26
  * @param message - Commit message.
27
27
  * @param repoRoot - Working directory for the git command.
28
- * @returns The short commit hash, or an empty string if parsing fails.
28
+ * @param options - Optional commit options (env vars, no-verify).
29
+ * @returns The full commit hash.
29
30
  * @throws {@link GitOperationError} On failure.
30
31
  */
31
- commit(message: string, repoRoot: string): Promise<string>;
32
+ commit(message: string, repoRoot: string, options?: {
33
+ env?: Record<string, string>;
34
+ noVerify?: boolean;
35
+ }): Promise<string>;
36
+ /**
37
+ * Get the current HEAD commit SHA.
38
+ *
39
+ * @param repoRoot - Working directory for the git command.
40
+ * @returns The full commit hash.
41
+ * @throws {@link GitOperationError} On failure.
42
+ */
43
+ getHead(repoRoot: string): Promise<string>;
44
+ /**
45
+ * Reset HEAD and the working tree to a specific commit (`git reset --hard`).
46
+ * Used by the transaction manager to roll back failed mutations.
47
+ *
48
+ * WARNING: this discards uncommitted changes in the working tree. Callers
49
+ * must verify the working tree state before calling.
50
+ *
51
+ * @param repoRoot - Working directory for the git command.
52
+ * @param sha - Commit SHA to reset to.
53
+ * @throws {@link GitOperationError} On failure.
54
+ */
55
+ resetHard(repoRoot: string, sha: string): Promise<void>;
56
+ /**
57
+ * Remove untracked files matching the given paths (`git clean -fd <paths>`).
58
+ * Scoped to the declared paths so unrelated untracked files are preserved.
59
+ *
60
+ * @param repoRoot - Working directory for the git command.
61
+ * @param paths - Paths to clean (relative to repoRoot).
62
+ * @throws {@link GitOperationError} On failure.
63
+ */
64
+ cleanFiles(repoRoot: string, paths: string[]): Promise<void>;
65
+ /**
66
+ * Check whether the working tree has uncommitted changes (staged or unstaged).
67
+ *
68
+ * @param repoRoot - Working directory for the git command.
69
+ * @returns True if there are uncommitted changes.
70
+ * @throws {@link GitOperationError} On failure.
71
+ */
72
+ isDirty(repoRoot: string): Promise<boolean>;
73
+ /**
74
+ * Check whether the repository is in the middle of a multi-step git operation
75
+ * (merge, rebase, cherry-pick, revert). Mutating during these operations is
76
+ * dangerous because rollback via `git reset --hard` would corrupt them.
77
+ *
78
+ * @param repoRoot - Absolute path to the repository root.
79
+ * @returns The kind of operation in progress, or null if none.
80
+ */
81
+ isMidOperation(repoRoot: string): Promise<{
82
+ midOp: boolean;
83
+ kind?: "merge" | "rebase" | "cherry-pick" | "revert";
84
+ }>;
85
+ /**
86
+ * Check whether the directory is inside a git repository.
87
+ *
88
+ * @param repoRoot - Working directory for the git command.
89
+ * @returns True if `git rev-parse --git-dir` succeeds.
90
+ */
91
+ isRepo(repoRoot: string): Promise<boolean>;
92
+ /**
93
+ * Check whether the user has configured a git author identity.
94
+ * `git commit` will fail if either `user.name` or `user.email` is unset.
95
+ *
96
+ * @param repoRoot - Working directory for the git command.
97
+ * @returns The configured name and email, or null if unset.
98
+ */
99
+ getAuthorIdentity(repoRoot: string): Promise<{
100
+ name: string;
101
+ email: string;
102
+ } | null>;
32
103
  /**
33
104
  * Retrieve recent commits for a specific file.
34
105
  *
@@ -1 +1 @@
1
- {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../src/git/integration.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAqB,SAAS,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAyCrF;;;;;;;;;GASG;AACH,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,gBAAgB;IAErD;;;;;;OAMG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAatE;;;;;;;OAOG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAehE;;;;;;;OAOG;IACG,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,GAAG,OAAO,C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AM,GACf,OAAO,CAAC;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,aAAa,EAAE,OAAO,CAAA;KAAE,CAAC;YAe5C,mBAAmB;IAyBjC;;;;;;OAMG;IACG,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAyB5D"}
@@ -1,6 +1,7 @@
1
1
  import { ClefManifest } from "../types";
2
2
  import { EncryptionBackend } from "../types";
3
3
  import { ImportFormat } from "./parsers";
4
+ import { TransactionManager } from "../tx";
4
5
  export type { ImportFormat, ParsedImport } from "./parsers";
5
6
  export interface ImportOptions {
6
7
  format?: ImportFormat;
@@ -23,15 +24,23 @@ export interface ImportResult {
23
24
  /**
24
25
  * Imports secrets from `.env`, JSON, or YAML files into encrypted matrix cells.
25
26
  *
27
+ * Real (non-dry-run) imports run inside a single TransactionManager commit:
28
+ * one encrypt of the merged value set, one commit, all-or-nothing rollback
29
+ * via `git reset --hard`. The previous per-key encrypt-then-continue
30
+ * behavior is gone — partial imports were a footgun and N file rewrites for
31
+ * N keys was wasteful.
32
+ *
26
33
  * @example
27
34
  * ```ts
28
- * const runner = new ImportRunner(sopsClient);
29
- * const result = await runner.import("app/staging", null, envContent, manifest, repoRoot, { format: "dotenv" });
35
+ * const tx = new TransactionManager(new GitIntegration(runner));
36
+ * const importer = new ImportRunner(sopsClient, tx);
37
+ * const result = await importer.import("app/staging", null, envContent, manifest, repoRoot, { format: "dotenv" });
30
38
  * ```
31
39
  */
32
40
  export declare class ImportRunner {
33
41
  private readonly sopsClient;
34
- constructor(sopsClient: EncryptionBackend);
42
+ private readonly tx;
43
+ constructor(sopsClient: EncryptionBackend, tx: TransactionManager);
35
44
  /**
36
45
  * Parse a source file and import its key/value pairs into a target `namespace/environment` cell.
37
46
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/import/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CA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WAAW,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAC3C,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE5D,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9C,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,YAAY;IAErB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,EAAE;gBADF,UAAU,EAAE,iBAAiB,EAC7B,EAAE,EAAE,kBAAkB;IAGzC;;;;;;;;;OASG;IACG,MAAM,CACV,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,YAAY,CAAC;CAiFzB"}
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from "./types";
2
2
  export { ManifestParser, CLEF_MANIFEST_FILENAME } from "./manifest/parser";
3
- export { readManifestYaml, writeManifestYaml } from "./manifest/io";
3
+ export { readManifestYaml, writeManifestYaml, writeManifestYamlRaw } from "./manifest/io";
4
4
  export { ScanRunner, shannonEntropy, isHighEntropy, matchPatterns, redactValue, loadIgnoreRules, shouldIgnoreFile, shouldIgnoreMatch, parseIgnoreContent, } from "./scanner";
5
5
  export type { ScanMatch, ScanResult, ScanOptions, ClefIgnoreRules } from "./scanner";
6
6
  export { MatrixManager } from "./matrix/manager";
@@ -8,6 +8,8 @@ export { SchemaValidator } from "./schema/validator";
8
8
  export { DiffEngine } from "./diff/engine";
9
9
  export { BulkOps } from "./bulk/ops";
10
10
  export { GitIntegration } from "./git/integration";
11
+ export { TransactionManager, TransactionLockError, TransactionPreflightError, TransactionRollbackError, } from "./tx";
12
+ export type { TransactionOptions, TransactionResult } from "./tx";
11
13
  export { SopsClient } from "./sops/client";
12
14
  export { resolveSopsPath, resetSopsResolution } from "./sops/resolver";
13
15
  export type { SopsResolution, SopsSource } from "./sops/resolver";
@@ -31,7 +33,9 @@ export { DriftDetector } from "./drift/detector";
31
33
  export { ReportGenerator, ReportSanitizer, ReportTransformer, CloudClient, collectCIContext, } from "./report";
32
34
  export { SopsMergeDriver } from "./merge/driver";
33
35
  export type { MergeResult, MergeKey, MergeKeyStatus } from "./merge/driver";
34
- export { ServiceIdentityManager, PartialRotationError } from "./service-identity/manager";
36
+ export { ServiceIdentityManager } from "./service-identity/manager";
37
+ export { StructureManager } from "./structure/manager";
38
+ export type { NamespaceEditOptions, EnvironmentEditOptions, AddNamespaceOptions, AddEnvironmentOptions, } from "./structure/manager";
35
39
  export { resolveIdentitySecrets } from "./artifact/resolve";
36
40
  export type { ResolvedSecrets } from "./artifact/resolve";
37
41
  export { ArtifactPacker } from "./artifact/packer";
@@ -42,6 +46,8 @@ export type { KmsProvider, KmsWrapResult, KmsProviderType } from "./kms";
42
46
  export { VALID_KMS_PROVIDERS } from "./kms";
43
47
  export { BackendMigrator } from "./migration/backend";
44
48
  export type { MigrationTarget, MigrationOptions, MigrationResult, MigrationProgressEvent, } from "./migration/backend";
49
+ export { ResetManager, describeScope, validateResetScope } from "./reset/manager";
50
+ export type { ResetScope, ResetOptions, ResetResult } from "./reset/manager";
45
51
  export { spawnKeyservice, resolveKeyservicePath, resetKeyserviceResolution, readCloudCredentials, writeCloudCredentials, initiateDeviceFlow, pollDeviceFlow, CloudPackClient, CloudArtifactClient, } from "./cloud";
46
52
  export type { KeyserviceHandle, KeyserviceResolution, KeyserviceSource, DeviceSession, DevicePollResult, DeviceFlowType, RemotePackConfig, RemotePackResult, } from "./cloud";
47
53
  //# sourceMappingURL=index.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from "./types";
2
2
  export { ManifestParser, CLEF_MANIFEST_FILENAME } from "./manifest/parser";
3
- export { readManifestYaml, writeManifestYaml } from "./manifest/io";
3
+ export { readManifestYaml, writeManifestYaml, writeManifestYamlRaw } from "./manifest/io";
4
4
  export { ScanRunner, shannonEntropy, isHighEntropy, matchPatterns, redactValue, loadIgnoreRules, shouldIgnoreFile, shouldIgnoreMatch, parseIgnoreContent, } from "./scanner";
5
5
  export type { ScanMatch, ScanResult, ScanOptions, ClefIgnoreRules } from "./scanner";
6
6
  export { MatrixManager } from "./matrix/manager";
@@ -8,6 +8,8 @@ export { SchemaValidator } from "./schema/validator";
8
8
  export { DiffEngine } from "./diff/engine";
9
9
  export { BulkOps } from "./bulk/ops";
10
10
  export { GitIntegration } from "./git/integration";
11
+ export { TransactionManager, TransactionLockError, TransactionPreflightError, TransactionRollbackError, } from "./tx";
12
+ export type { TransactionOptions, TransactionResult } from "./tx";
11
13
  export { SopsClient } from "./sops/client";
12
14
  export { resolveSopsPath, resetSopsResolution } from "./sops/resolver";
13
15
  export type { SopsResolution, SopsSource } from "./sops/resolver";
@@ -31,7 +33,9 @@ export { DriftDetector } from "./drift/detector";
31
33
  export { ReportGenerator, ReportSanitizer, ReportTransformer, CloudClient, collectCIContext, } from "./report";
32
34
  export { SopsMergeDriver } from "./merge/driver";
33
35
  export type { MergeResult, MergeKey, MergeKeyStatus } from "./merge/driver";
34
- export { ServiceIdentityManager, PartialRotationError } from "./service-identity/manager";
36
+ export { ServiceIdentityManager } from "./service-identity/manager";
37
+ export { StructureManager } from "./structure/manager";
38
+ export type { NamespaceEditOptions, EnvironmentEditOptions, AddNamespaceOptions, AddEnvironmentOptions, } from "./structure/manager";
35
39
  export { resolveIdentitySecrets } from "./artifact/resolve";
36
40
  export type { ResolvedSecrets } from "./artifact/resolve";
37
41
  export { ArtifactPacker } from "./artifact/packer";
@@ -42,6 +46,8 @@ export type { KmsProvider, KmsWrapResult, KmsProviderType } from "./kms";
42
46
  export { VALID_KMS_PROVIDERS } from "./kms";
43
47
  export { BackendMigrator } from "./migration/backend";
44
48
  export type { MigrationTarget, MigrationOptions, MigrationResult, MigrationProgressEvent, } from "./migration/backend";
49
+ export { ResetManager, describeScope, validateResetScope } from "./reset/manager";
50
+ export type { ResetScope, ResetOptions, ResetResult } from "./reset/manager";
45
51
  export { spawnKeyservice, resolveKeyservicePath, resetKeyserviceResolution, readCloudCredentials, writeCloudCredentials, initiateDeviceFlow, pollDeviceFlow, CloudPackClient, CloudArtifactClient, } from "./cloud";
46
52
  export type { KeyserviceHandle, KeyserviceResolution, KeyserviceSource, DeviceSession, DevicePollResult, DeviceFlowType, RemotePackConfig, RemotePackResult, } from "./cloud";
47
53
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EACL,UAAU,EACV,cAAc,EACd,aAAa,EACb,aAAa,EACb,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,WAAW,CAAC;AACnB,YA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