@nest-boot/crypt 7.0.0 → 7.0.2

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 nest-boot
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Configuration options for the CryptModule.
3
+ */
1
4
  export interface CryptModuleOptions {
2
- secret: string;
5
+ /**
6
+ * The secret key used for encryption and decryption.
7
+ * If not provided, falls back to CRYPT_SECRET or APP_SECRET environment variables.
8
+ */
9
+ secret?: string;
3
10
  }
@@ -1,8 +1,2 @@
1
1
  import { type CryptModuleOptions } from "./crypt-module-options.interface";
2
- export declare const ConfigurableModuleClass: import("@nestjs/common").ConfigurableModuleCls<CryptModuleOptions, "register", "create", {
3
- isGlobal: boolean;
4
- }>, MODULE_OPTIONS_TOKEN: string | symbol, OPTIONS_TYPE: CryptModuleOptions & Partial<{
5
- isGlobal: boolean;
6
- }>, ASYNC_OPTIONS_TYPE: import("@nestjs/common").ConfigurableModuleAsyncOptions<CryptModuleOptions, "create"> & Partial<{
7
- isGlobal: boolean;
8
- }>;
2
+ export declare const ConfigurableModuleClass: import("@nestjs/common").ConfigurableModuleCls<CryptModuleOptions, "register", "create", {}>, MODULE_OPTIONS_TOKEN: string | symbol, OPTIONS_TYPE: CryptModuleOptions & Partial<{}>, ASYNC_OPTIONS_TYPE: import("@nestjs/common").ConfigurableModuleAsyncOptions<CryptModuleOptions, "create"> & Partial<{}>;
@@ -3,12 +3,5 @@ var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.ASYNC_OPTIONS_TYPE = exports.OPTIONS_TYPE = exports.MODULE_OPTIONS_TOKEN = exports.ConfigurableModuleClass = void 0;
5
5
  const common_1 = require("@nestjs/common");
6
- _a = new common_1.ConfigurableModuleBuilder()
7
- .setExtras({
8
- isGlobal: false,
9
- }, (definition, extras) => ({
10
- ...definition,
11
- global: extras.isGlobal,
12
- }))
13
- .build(), exports.ConfigurableModuleClass = _a.ConfigurableModuleClass, exports.MODULE_OPTIONS_TOKEN = _a.MODULE_OPTIONS_TOKEN, exports.OPTIONS_TYPE = _a.OPTIONS_TYPE, exports.ASYNC_OPTIONS_TYPE = _a.ASYNC_OPTIONS_TYPE;
6
+ _a = new common_1.ConfigurableModuleBuilder().build(), exports.ConfigurableModuleClass = _a.ConfigurableModuleClass, exports.MODULE_OPTIONS_TOKEN = _a.MODULE_OPTIONS_TOKEN, exports.OPTIONS_TYPE = _a.OPTIONS_TYPE, exports.ASYNC_OPTIONS_TYPE = _a.ASYNC_OPTIONS_TYPE;
14
7
  //# sourceMappingURL=crypt.module-definition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"crypt.module-definition.js","sourceRoot":"","sources":["../src/crypt.module-definition.ts"],"names":[],"mappings":";;;;AAAA,2CAA2D;AAI9C,KAKT,IAAI,kCAAyB,EAAsB;KACpD,SAAS,CACR;IACE,QAAQ,EAAE,KAAK;CAChB,EACD,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;IACvB,GAAG,UAAU;IACb,MAAM,EAAE,MAAM,CAAC,QAAQ;CACxB,CAAC,CACH;KACA,KAAK,EAAE,EAdR,+BAAuB,+BACvB,4BAAoB,4BACpB,oBAAY,oBACZ,0BAAkB,yBAWT"}
1
+ {"version":3,"file":"crypt.module-definition.js","sourceRoot":"","sources":["../src/crypt.module-definition.ts"],"names":[],"mappings":";;;;AAAA,2CAA2D;AAI9C,KAKT,IAAI,kCAAyB,EAAsB,CAAC,KAAK,EAAE,EAJ7D,+BAAuB,+BACvB,4BAAoB,4BACpB,oBAAY,oBACZ,0BAAkB,yBAC4C"}
@@ -1,3 +1,34 @@
1
- import { ConfigurableModuleClass } from "./crypt.module-definition";
1
+ import { type DynamicModule } from "@nestjs/common";
2
+ import { ASYNC_OPTIONS_TYPE, ConfigurableModuleClass, OPTIONS_TYPE } from "./crypt.module-definition";
3
+ /**
4
+ * Module that provides encryption and decryption services using AES-256-GCM.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * import { CryptModule } from '@nest-boot/crypt';
9
+ *
10
+ * @Module({
11
+ * imports: [
12
+ * CryptModule.register({
13
+ * secret: 'your-secret-key',
14
+ * isGlobal: true,
15
+ * }),
16
+ * ],
17
+ * })
18
+ * export class AppModule {}
19
+ * ```
20
+ */
2
21
  export declare class CryptModule extends ConfigurableModuleClass {
22
+ /**
23
+ * Registers the CryptModule with the given options.
24
+ * @param options - Configuration options including secret and isGlobal
25
+ * @returns Dynamic module configuration
26
+ */
27
+ static register(options: typeof OPTIONS_TYPE): DynamicModule;
28
+ /**
29
+ * Registers the CryptModule asynchronously with factory functions.
30
+ * @param options - Async configuration options
31
+ * @returns Dynamic module configuration
32
+ */
33
+ static registerAsync(options: typeof ASYNC_OPTIONS_TYPE): DynamicModule;
3
34
  }
@@ -10,10 +10,45 @@ exports.CryptModule = void 0;
10
10
  const common_1 = require("@nestjs/common");
11
11
  const crypt_module_definition_1 = require("./crypt.module-definition");
12
12
  const crypt_service_1 = require("./crypt.service");
13
+ /**
14
+ * Module that provides encryption and decryption services using AES-256-GCM.
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * import { CryptModule } from '@nest-boot/crypt';
19
+ *
20
+ * @Module({
21
+ * imports: [
22
+ * CryptModule.register({
23
+ * secret: 'your-secret-key',
24
+ * isGlobal: true,
25
+ * }),
26
+ * ],
27
+ * })
28
+ * export class AppModule {}
29
+ * ```
30
+ */
13
31
  let CryptModule = class CryptModule extends crypt_module_definition_1.ConfigurableModuleClass {
32
+ /**
33
+ * Registers the CryptModule with the given options.
34
+ * @param options - Configuration options including secret and isGlobal
35
+ * @returns Dynamic module configuration
36
+ */
37
+ static register(options) {
38
+ return super.register(options);
39
+ }
40
+ /**
41
+ * Registers the CryptModule asynchronously with factory functions.
42
+ * @param options - Async configuration options
43
+ * @returns Dynamic module configuration
44
+ */
45
+ static registerAsync(options) {
46
+ return super.registerAsync(options);
47
+ }
14
48
  };
15
49
  exports.CryptModule = CryptModule;
16
50
  exports.CryptModule = CryptModule = __decorate([
51
+ (0, common_1.Global)(),
17
52
  (0, common_1.Module)({ providers: [crypt_service_1.CryptService], exports: [crypt_service_1.CryptService] })
18
53
  ], CryptModule);
19
54
  //# sourceMappingURL=crypt.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"crypt.module.js","sourceRoot":"","sources":["../src/crypt.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AAExC,uEAAoE;AACpE,mDAA+C;AAGxC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,iDAAuB;CAAG,CAAA;AAA9C,kCAAW;sBAAX,WAAW;IADvB,IAAA,eAAM,EAAC,EAAE,SAAS,EAAE,CAAC,4BAAY,CAAC,EAAE,OAAO,EAAE,CAAC,4BAAY,CAAC,EAAE,CAAC;GAClD,WAAW,CAAmC"}
1
+ {"version":3,"file":"crypt.module.js","sourceRoot":"","sources":["../src/crypt.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoE;AAEpE,uEAImC;AACnC,mDAA+C;AAE/C;;;;;;;;;;;;;;;;;GAiBG;AAGI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,iDAAuB;IACtD;;;;OAIG;IACH,MAAM,CAAU,QAAQ,CAAC,OAA4B;QACnD,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAU,aAAa,CAC3B,OAAkC;QAElC,OAAO,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;CACF,CAAA;AApBY,kCAAW;sBAAX,WAAW;IAFvB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,SAAS,EAAE,CAAC,4BAAY,CAAC,EAAE,OAAO,EAAE,CAAC,4BAAY,CAAC,EAAE,CAAC;GAClD,WAAW,CAoBvB"}
@@ -1,8 +1,45 @@
1
1
  import { CryptModuleOptions } from "./crypt-module-options.interface";
2
+ /**
3
+ * Service that provides encryption and decryption functionality using AES-256-GCM algorithm.
4
+ *
5
+ * @example
6
+ * ```typescript
7
+ * import { CryptService } from '@nest-boot/crypt';
8
+ *
9
+ * @Injectable()
10
+ * export class MyService {
11
+ * constructor(private readonly cryptService: CryptService) {}
12
+ *
13
+ * async encryptData(data: string): Promise<string> {
14
+ * return this.cryptService.encrypt(data);
15
+ * }
16
+ *
17
+ * async decryptData(encrypted: string): Promise<string> {
18
+ * return this.cryptService.decrypt(encrypted);
19
+ * }
20
+ * }
21
+ * ```
22
+ */
2
23
  export declare class CryptService {
3
24
  #private;
4
- private readonly options;
5
- constructor(options: CryptModuleOptions);
25
+ /**
26
+ * Creates an instance of CryptService.
27
+ * @param options - Configuration options for the crypt service
28
+ * @throws Error if no secret is provided via options or environment variables
29
+ */
30
+ constructor(options?: CryptModuleOptions);
31
+ /**
32
+ * Encrypts a string value using AES-256-GCM algorithm.
33
+ * @param value - The plaintext string to encrypt
34
+ * @param secret - Optional secret key to use instead of the default
35
+ * @returns A base64-encoded encrypted string containing IV, auth tag, data, and salt
36
+ */
6
37
  encrypt(value: string, secret?: string): Promise<string>;
38
+ /**
39
+ * Decrypts an encrypted string value.
40
+ * @param value - The base64-encoded encrypted string to decrypt
41
+ * @param secret - Optional secret key to use instead of the default
42
+ * @returns The decrypted plaintext string
43
+ */
7
44
  decrypt(value: string, secret?: string): Promise<string>;
8
45
  }
@@ -11,30 +11,73 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  var __param = (this && this.__param) || function (paramIndex, decorator) {
12
12
  return function (target, key) { decorator(target, key, paramIndex); }
13
13
  };
14
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
15
+ if (kind === "m") throw new TypeError("Private method is not writable");
16
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
17
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
18
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
19
+ };
14
20
  var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
15
21
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
16
22
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
17
23
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
18
24
  };
19
- var _CryptService_instances, _CryptService_algorithm, _CryptService_encoding, _CryptService_keyByteLength, _CryptService_saltByteLength, _CryptService_viByteLength, _CryptService_getKeyAndSalt;
25
+ var _CryptService_instances, _CryptService_algorithm, _CryptService_encoding, _CryptService_keyByteLength, _CryptService_saltByteLength, _CryptService_viByteLength, _CryptService_secret, _CryptService_getKeyAndSalt;
20
26
  Object.defineProperty(exports, "__esModule", { value: true });
21
27
  exports.CryptService = void 0;
22
28
  const common_1 = require("@nestjs/common");
23
29
  const crypto_1 = require("crypto");
24
30
  const util_1 = require("util");
25
31
  const crypt_module_definition_1 = require("./crypt.module-definition");
32
+ /**
33
+ * Service that provides encryption and decryption functionality using AES-256-GCM algorithm.
34
+ *
35
+ * @example
36
+ * ```typescript
37
+ * import { CryptService } from '@nest-boot/crypt';
38
+ *
39
+ * @Injectable()
40
+ * export class MyService {
41
+ * constructor(private readonly cryptService: CryptService) {}
42
+ *
43
+ * async encryptData(data: string): Promise<string> {
44
+ * return this.cryptService.encrypt(data);
45
+ * }
46
+ *
47
+ * async decryptData(encrypted: string): Promise<string> {
48
+ * return this.cryptService.decrypt(encrypted);
49
+ * }
50
+ * }
51
+ * ```
52
+ */
26
53
  let CryptService = class CryptService {
27
- constructor(options) {
54
+ /**
55
+ * Creates an instance of CryptService.
56
+ * @param options - Configuration options for the crypt service
57
+ * @throws Error if no secret is provided via options or environment variables
58
+ */
59
+ constructor(options = {}) {
28
60
  _CryptService_instances.add(this);
29
- this.options = options;
30
61
  _CryptService_algorithm.set(this, "aes-256-gcm");
31
62
  _CryptService_encoding.set(this, "base64");
32
63
  _CryptService_keyByteLength.set(this, 32);
33
64
  _CryptService_saltByteLength.set(this, 16);
34
65
  _CryptService_viByteLength.set(this, 16);
66
+ _CryptService_secret.set(this, void 0);
67
+ const secret = options.secret ?? process.env.CRYPT_SECRET ?? process.env.APP_SECRET;
68
+ if (!secret) {
69
+ throw new Error("Crypt secret is missing. Set CRYPT_SECRET or APP_SECRET or pass a secret option.");
70
+ }
71
+ __classPrivateFieldSet(this, _CryptService_secret, secret, "f");
35
72
  }
73
+ /**
74
+ * Encrypts a string value using AES-256-GCM algorithm.
75
+ * @param value - The plaintext string to encrypt
76
+ * @param secret - Optional secret key to use instead of the default
77
+ * @returns A base64-encoded encrypted string containing IV, auth tag, data, and salt
78
+ */
36
79
  async encrypt(value, secret) {
37
- const { key, salt } = await __classPrivateFieldGet(this, _CryptService_instances, "m", _CryptService_getKeyAndSalt).call(this, secret ?? this.options.secret);
80
+ const { key, salt } = await __classPrivateFieldGet(this, _CryptService_instances, "m", _CryptService_getKeyAndSalt).call(this, secret ?? __classPrivateFieldGet(this, _CryptService_secret, "f"));
38
81
  const iv = (0, crypto_1.randomBytes)(__classPrivateFieldGet(this, _CryptService_viByteLength, "f"));
39
82
  const cipher = (0, crypto_1.createCipheriv)(__classPrivateFieldGet(this, _CryptService_algorithm, "f"), key, iv);
40
83
  const data = Buffer.concat([cipher.update(value), cipher.final()]);
@@ -46,9 +89,15 @@ let CryptService = class CryptService {
46
89
  salt: salt.toString(__classPrivateFieldGet(this, _CryptService_encoding, "f")),
47
90
  })).toString(__classPrivateFieldGet(this, _CryptService_encoding, "f"));
48
91
  }
92
+ /**
93
+ * Decrypts an encrypted string value.
94
+ * @param value - The base64-encoded encrypted string to decrypt
95
+ * @param secret - Optional secret key to use instead of the default
96
+ * @returns The decrypted plaintext string
97
+ */
49
98
  async decrypt(value, secret) {
50
99
  const payload = JSON.parse(Buffer.from(value, __classPrivateFieldGet(this, _CryptService_encoding, "f")).toString("utf8"));
51
- const key = (await (0, util_1.promisify)(crypto_1.scrypt)(secret ?? this.options.secret, Buffer.from(payload.salt, __classPrivateFieldGet(this, _CryptService_encoding, "f")), __classPrivateFieldGet(this, _CryptService_keyByteLength, "f")));
100
+ const key = (await (0, util_1.promisify)(crypto_1.scrypt)(secret ?? __classPrivateFieldGet(this, _CryptService_secret, "f"), Buffer.from(payload.salt, __classPrivateFieldGet(this, _CryptService_encoding, "f")), __classPrivateFieldGet(this, _CryptService_keyByteLength, "f")));
52
101
  const iv = Buffer.from(payload.iv, __classPrivateFieldGet(this, _CryptService_encoding, "f"));
53
102
  const tag = Buffer.from(payload.tag, __classPrivateFieldGet(this, _CryptService_encoding, "f"));
54
103
  const data = Buffer.from(payload.data, __classPrivateFieldGet(this, _CryptService_encoding, "f"));
@@ -63,6 +112,7 @@ _CryptService_encoding = new WeakMap();
63
112
  _CryptService_keyByteLength = new WeakMap();
64
113
  _CryptService_saltByteLength = new WeakMap();
65
114
  _CryptService_viByteLength = new WeakMap();
115
+ _CryptService_secret = new WeakMap();
66
116
  _CryptService_instances = new WeakSet();
67
117
  _CryptService_getKeyAndSalt = async function _CryptService_getKeyAndSalt(secret) {
68
118
  const salt = (0, crypto_1.randomBytes)(__classPrivateFieldGet(this, _CryptService_saltByteLength, "f"));
@@ -73,6 +123,7 @@ _CryptService_getKeyAndSalt = async function _CryptService_getKeyAndSalt(secret)
73
123
  };
74
124
  exports.CryptService = CryptService = __decorate([
75
125
  (0, common_1.Injectable)(),
126
+ __param(0, (0, common_1.Optional)()),
76
127
  __param(0, (0, common_1.Inject)(crypt_module_definition_1.MODULE_OPTIONS_TOKEN)),
77
128
  __metadata("design:paramtypes", [Object])
78
129
  ], CryptService);
@@ -1 +1 @@
1
- {"version":3,"file":"crypt.service.js","sourceRoot":"","sources":["../src/crypt.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,mCAMgB;AAChB,+BAAiC;AAEjC,uEAAiE;AAI1D,IAAM,YAAY,GAAlB,MAAM,YAAY;IAWvB,YACgC,OAA4C;;QAA3B,YAAO,GAAP,OAAO,CAAoB;QAXnE,kCAAa,aAAa,EAAC;QAE3B,iCAAsB,QAAQ,EAAC;QAE/B,sCAAyB,EAAE,EAAC;QAE5B,uCAA0B,EAAE,EAAC;QAE7B,qCAAwB,EAAE,EAAC;IAIjC,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,KAAa,EAAE,MAAe;QAC1C,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,MAAM,uBAAA,IAAI,4DAAe,MAAnB,IAAI,EAC9B,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,CAC9B,CAAC;QAEF,MAAM,EAAE,GAA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,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,QAAQ,CACtE,MAAM,CACP,CAAC;IACJ,CAAC;CAcF,CAAA;AAtGY,oCAAY;;;;;;;;8BA0FvB,KAAK,sCAAgB,MAAc;IACjC,MAAM,IAAI,GAAG,IAAA,oBAAW,EAAC,uBAAA,IAAI,oCAAgB,CAAC,CAAC;IAE/C,OAAO;QACL,GAAG,EAAE,CAAC,MAAM,IAAA,gBAAS,EAAC,eAAM,CAAC,CAC3B,MAAM,EACN,IAAI,EACJ,uBAAA,IAAI,mCAAe,CACpB,CAAW;QACZ,IAAI;KACL,CAAC;AACJ,CAAC;uBArGU,YAAY;IADxB,IAAA,mBAAU,GAAE;IAoBR,WAAA,IAAA,iBAAQ,GAAE,CAAA;IACV,WAAA,IAAA,eAAM,EAAC,8CAAoB,CAAC,CAAA;;GApBpB,YAAY,CAsGxB"}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from "./crypt.module";
2
2
  export * from "./crypt.service";
3
+ export * from "./crypt-module-options.interface";
package/dist/index.js CHANGED
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./crypt.module"), exports);
18
18
  __exportStar(require("./crypt.service"), exports);
19
+ __exportStar(require("./crypt-module-options.interface"), exports);
19
20
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,kDAAgC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,kDAAgC;AAChC,mEAAiD"}