i18next-cli 1.70.3 → 1.70.4
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/dist/cjs/cli.js +1 -1
- package/dist/cjs/extractor/core/ast-visitors.js +29 -0
- package/dist/cjs/extractor/parsers/scope-manager.js +17 -1
- package/dist/esm/cli.js +1 -1
- package/dist/esm/extractor/core/ast-visitors.js +29 -0
- package/dist/esm/extractor/parsers/scope-manager.js +17 -1
- package/package.json +1 -1
- package/types/extractor/core/ast-visitors.d.ts.map +1 -1
- package/types/extractor/parsers/scope-manager.d.ts +4 -0
- package/types/extractor/parsers/scope-manager.d.ts.map +1 -1
package/dist/cjs/cli.js
CHANGED
|
@@ -37,7 +37,7 @@ const program = new commander.Command();
|
|
|
37
37
|
program
|
|
38
38
|
.name('i18next-cli')
|
|
39
39
|
.description('A unified, high-performance i18next CLI.')
|
|
40
|
-
.version('1.70.
|
|
40
|
+
.version('1.70.4'); // This string is replaced with the actual version at build time by rollup
|
|
41
41
|
// new: global config override option
|
|
42
42
|
program.option('-c, --config <path>', 'Path to i18next-cli config file (overrides detection)');
|
|
43
43
|
program
|
|
@@ -59,6 +59,9 @@ class ASTVisitors {
|
|
|
59
59
|
resolvePossibleContextStringValues: hooks?.resolvePossibleContextStringValues
|
|
60
60
|
};
|
|
61
61
|
this.scopeManager = new scopeManager.ScopeManager(config);
|
|
62
|
+
// `useTranslation(ns)` where `ns` is a param typed `'a' | 'b'` → first member
|
|
63
|
+
// (same rule as `TFunction<'a' | 'b'>`).
|
|
64
|
+
this.scopeManager.identifierFallback = (name) => this.expressionResolver.getVariableValues(name)?.[0];
|
|
62
65
|
// use shared resolver when provided so captured enums/objects are visible across files
|
|
63
66
|
this.expressionResolver = expressionResolver$1 ?? new expressionResolver.ExpressionResolver(this.hooks);
|
|
64
67
|
this.callExpressionHandler = new callExpressionHandler.CallExpressionHandler(config, pluginContext, logger, this.expressionResolver, () => this.getCurrentFile(), () => this.getCurrentCode(), (name) => this.scopeManager.resolveSimpleStringIdentifier(name));
|
|
@@ -174,6 +177,7 @@ class ASTVisitors {
|
|
|
174
177
|
let isNewScope = false;
|
|
175
178
|
let isNewClassScope = false;
|
|
176
179
|
let paramTemporaries;
|
|
180
|
+
let paramDefaults;
|
|
177
181
|
let paramObjectTemporaries;
|
|
178
182
|
let paramArrayTemporaries;
|
|
179
183
|
// ENTER CLASS SCOPE for class declarations / expressions and pre-register
|
|
@@ -247,6 +251,16 @@ class ASTVisitors {
|
|
|
247
251
|
const localName = localNode?.type === 'Identifier' ? localNode.value : undefined;
|
|
248
252
|
if (!memberName || !localName)
|
|
249
253
|
continue;
|
|
254
|
+
// `({ ns = 'x' })` → `useTranslation(ns)` resolves to the default
|
|
255
|
+
const defaultNode = prop?.type === 'AssignmentPatternProperty'
|
|
256
|
+
? prop.value
|
|
257
|
+
: (prop?.value?.type === 'AssignmentPattern' ? prop.value.right : undefined);
|
|
258
|
+
if (defaultNode?.type === 'StringLiteral') {
|
|
259
|
+
this.scopeManager.setParamDefault(localName, defaultNode.value);
|
|
260
|
+
if (!paramDefaults)
|
|
261
|
+
paramDefaults = [];
|
|
262
|
+
paramDefaults.push(localName);
|
|
263
|
+
}
|
|
250
264
|
// `({ t }: { t: TFunction<'ns'> })` → bind `t` to that namespace
|
|
251
265
|
this.bindTFunctionParam(localName, this.getMemberTypeNode(patType, memberName), typeParamConstraints);
|
|
252
266
|
if (!members?.[memberName])
|
|
@@ -274,6 +288,9 @@ class ASTVisitors {
|
|
|
274
288
|
ident = p.pattern;
|
|
275
289
|
else if (p.pat && p.pat.type === 'Identifier')
|
|
276
290
|
ident = p.pat;
|
|
291
|
+
// function f(ns = 'x') → Param { pat: AssignmentPattern }
|
|
292
|
+
else if (p.pat?.type === 'AssignmentPattern' && p.pat.left?.type === 'Identifier')
|
|
293
|
+
ident = p.pat.left;
|
|
277
294
|
else if (p.pattern && p.pattern.type === 'Identifier')
|
|
278
295
|
ident = p.pattern;
|
|
279
296
|
// some parsers expose .param or .left.param shapes
|
|
@@ -286,6 +303,14 @@ class ASTVisitors {
|
|
|
286
303
|
const paramKey = (ident.value ?? ident.name);
|
|
287
304
|
if (!paramKey)
|
|
288
305
|
continue;
|
|
306
|
+
// `(ns = 'x') =>` → `useTranslation(ns)` resolves to the default
|
|
307
|
+
const assign = p.type === 'AssignmentPattern' ? p : (p.pat?.type === 'AssignmentPattern' ? p.pat : undefined);
|
|
308
|
+
if (assign?.right?.type === 'StringLiteral') {
|
|
309
|
+
this.scopeManager.setParamDefault(paramKey, assign.right.value);
|
|
310
|
+
if (!paramDefaults)
|
|
311
|
+
paramDefaults = [];
|
|
312
|
+
paramDefaults.push(paramKey);
|
|
313
|
+
}
|
|
289
314
|
// Try to locate TypeScript type node carried on the identifier.
|
|
290
315
|
const rawTypeAnn = (ident.typeAnnotation ?? p.typeAnnotation ?? (p.left && p.left.typeAnnotation));
|
|
291
316
|
let typeAnn;
|
|
@@ -550,6 +575,10 @@ class ASTVisitors {
|
|
|
550
575
|
this.expressionResolver.deleteTemporaryVariable(name);
|
|
551
576
|
}
|
|
552
577
|
}
|
|
578
|
+
if (paramDefaults) {
|
|
579
|
+
for (const name of paramDefaults)
|
|
580
|
+
this.scopeManager.deleteParamDefault(name);
|
|
581
|
+
}
|
|
553
582
|
if (paramObjectTemporaries) {
|
|
554
583
|
for (const name of paramObjectTemporaries) {
|
|
555
584
|
this.expressionResolver.deleteTemporaryObjectVariable(name);
|
|
@@ -17,6 +17,11 @@ class ScopeManager {
|
|
|
17
17
|
simpleConstantObjects = new Map();
|
|
18
18
|
// `const NS = ['a', 'b']` → used by resolveNsArg for `useTranslation(NS)`.
|
|
19
19
|
simpleConstantArrays = new Map();
|
|
20
|
+
// `({ ns = 'x' }) =>` / `(ns = 'x') =>` param defaults, set/cleared per function by the visitor.
|
|
21
|
+
paramDefaults = new Map();
|
|
22
|
+
// Last-resort identifier resolution for `useTranslation(ns)` (e.g. first member of
|
|
23
|
+
// a param's union type), wired up by the visitor.
|
|
24
|
+
identifierFallback;
|
|
20
25
|
// Shared (cross-file) tables so that exported constants from one file can be
|
|
21
26
|
// resolved when imported in another. These are NOT cleared by reset().
|
|
22
27
|
sharedConstants = new Map();
|
|
@@ -71,6 +76,7 @@ class ScopeManager {
|
|
|
71
76
|
this.simpleConstants.clear();
|
|
72
77
|
this.simpleConstantObjects.clear();
|
|
73
78
|
this.simpleConstantArrays.clear();
|
|
79
|
+
this.paramDefaults.clear();
|
|
74
80
|
this.thisFieldStack = [];
|
|
75
81
|
}
|
|
76
82
|
/**
|
|
@@ -189,6 +195,12 @@ class ScopeManager {
|
|
|
189
195
|
/**
|
|
190
196
|
* Resolve simple identifier declared in-file to its string literal value, if known.
|
|
191
197
|
*/
|
|
198
|
+
setParamDefault(name, value) {
|
|
199
|
+
this.paramDefaults.set(name, value);
|
|
200
|
+
}
|
|
201
|
+
deleteParamDefault(name) {
|
|
202
|
+
this.paramDefaults.delete(name);
|
|
203
|
+
}
|
|
192
204
|
resolveSimpleStringIdentifier(name) {
|
|
193
205
|
return this.simpleConstants.get(name) ?? this.sharedConstants.get(name);
|
|
194
206
|
}
|
|
@@ -574,7 +586,11 @@ class ScopeManager {
|
|
|
574
586
|
const arr = this.simpleConstantArrays.get(nsNode.value);
|
|
575
587
|
if (arr)
|
|
576
588
|
return { defaultNs: arr[0], namespaces: arr };
|
|
577
|
-
return {
|
|
589
|
+
return {
|
|
590
|
+
defaultNs: this.paramDefaults.get(nsNode.value) ??
|
|
591
|
+
this.resolveSimpleStringIdentifier(nsNode.value) ??
|
|
592
|
+
this.identifierFallback?.(nsNode.value)
|
|
593
|
+
};
|
|
578
594
|
}
|
|
579
595
|
if (nsNode.type === 'MemberExpression')
|
|
580
596
|
return { defaultNs: this.resolveSimpleMemberExpression(nsNode) };
|
package/dist/esm/cli.js
CHANGED
|
@@ -31,7 +31,7 @@ const program = new Command();
|
|
|
31
31
|
program
|
|
32
32
|
.name('i18next-cli')
|
|
33
33
|
.description('A unified, high-performance i18next CLI.')
|
|
34
|
-
.version('1.70.
|
|
34
|
+
.version('1.70.4'); // This string is replaced with the actual version at build time by rollup
|
|
35
35
|
// new: global config override option
|
|
36
36
|
program.option('-c, --config <path>', 'Path to i18next-cli config file (overrides detection)');
|
|
37
37
|
program
|
|
@@ -57,6 +57,9 @@ class ASTVisitors {
|
|
|
57
57
|
resolvePossibleContextStringValues: hooks?.resolvePossibleContextStringValues
|
|
58
58
|
};
|
|
59
59
|
this.scopeManager = new ScopeManager(config);
|
|
60
|
+
// `useTranslation(ns)` where `ns` is a param typed `'a' | 'b'` → first member
|
|
61
|
+
// (same rule as `TFunction<'a' | 'b'>`).
|
|
62
|
+
this.scopeManager.identifierFallback = (name) => this.expressionResolver.getVariableValues(name)?.[0];
|
|
60
63
|
// use shared resolver when provided so captured enums/objects are visible across files
|
|
61
64
|
this.expressionResolver = expressionResolver ?? new ExpressionResolver(this.hooks);
|
|
62
65
|
this.callExpressionHandler = new CallExpressionHandler(config, pluginContext, logger, this.expressionResolver, () => this.getCurrentFile(), () => this.getCurrentCode(), (name) => this.scopeManager.resolveSimpleStringIdentifier(name));
|
|
@@ -172,6 +175,7 @@ class ASTVisitors {
|
|
|
172
175
|
let isNewScope = false;
|
|
173
176
|
let isNewClassScope = false;
|
|
174
177
|
let paramTemporaries;
|
|
178
|
+
let paramDefaults;
|
|
175
179
|
let paramObjectTemporaries;
|
|
176
180
|
let paramArrayTemporaries;
|
|
177
181
|
// ENTER CLASS SCOPE for class declarations / expressions and pre-register
|
|
@@ -245,6 +249,16 @@ class ASTVisitors {
|
|
|
245
249
|
const localName = localNode?.type === 'Identifier' ? localNode.value : undefined;
|
|
246
250
|
if (!memberName || !localName)
|
|
247
251
|
continue;
|
|
252
|
+
// `({ ns = 'x' })` → `useTranslation(ns)` resolves to the default
|
|
253
|
+
const defaultNode = prop?.type === 'AssignmentPatternProperty'
|
|
254
|
+
? prop.value
|
|
255
|
+
: (prop?.value?.type === 'AssignmentPattern' ? prop.value.right : undefined);
|
|
256
|
+
if (defaultNode?.type === 'StringLiteral') {
|
|
257
|
+
this.scopeManager.setParamDefault(localName, defaultNode.value);
|
|
258
|
+
if (!paramDefaults)
|
|
259
|
+
paramDefaults = [];
|
|
260
|
+
paramDefaults.push(localName);
|
|
261
|
+
}
|
|
248
262
|
// `({ t }: { t: TFunction<'ns'> })` → bind `t` to that namespace
|
|
249
263
|
this.bindTFunctionParam(localName, this.getMemberTypeNode(patType, memberName), typeParamConstraints);
|
|
250
264
|
if (!members?.[memberName])
|
|
@@ -272,6 +286,9 @@ class ASTVisitors {
|
|
|
272
286
|
ident = p.pattern;
|
|
273
287
|
else if (p.pat && p.pat.type === 'Identifier')
|
|
274
288
|
ident = p.pat;
|
|
289
|
+
// function f(ns = 'x') → Param { pat: AssignmentPattern }
|
|
290
|
+
else if (p.pat?.type === 'AssignmentPattern' && p.pat.left?.type === 'Identifier')
|
|
291
|
+
ident = p.pat.left;
|
|
275
292
|
else if (p.pattern && p.pattern.type === 'Identifier')
|
|
276
293
|
ident = p.pattern;
|
|
277
294
|
// some parsers expose .param or .left.param shapes
|
|
@@ -284,6 +301,14 @@ class ASTVisitors {
|
|
|
284
301
|
const paramKey = (ident.value ?? ident.name);
|
|
285
302
|
if (!paramKey)
|
|
286
303
|
continue;
|
|
304
|
+
// `(ns = 'x') =>` → `useTranslation(ns)` resolves to the default
|
|
305
|
+
const assign = p.type === 'AssignmentPattern' ? p : (p.pat?.type === 'AssignmentPattern' ? p.pat : undefined);
|
|
306
|
+
if (assign?.right?.type === 'StringLiteral') {
|
|
307
|
+
this.scopeManager.setParamDefault(paramKey, assign.right.value);
|
|
308
|
+
if (!paramDefaults)
|
|
309
|
+
paramDefaults = [];
|
|
310
|
+
paramDefaults.push(paramKey);
|
|
311
|
+
}
|
|
287
312
|
// Try to locate TypeScript type node carried on the identifier.
|
|
288
313
|
const rawTypeAnn = (ident.typeAnnotation ?? p.typeAnnotation ?? (p.left && p.left.typeAnnotation));
|
|
289
314
|
let typeAnn;
|
|
@@ -548,6 +573,10 @@ class ASTVisitors {
|
|
|
548
573
|
this.expressionResolver.deleteTemporaryVariable(name);
|
|
549
574
|
}
|
|
550
575
|
}
|
|
576
|
+
if (paramDefaults) {
|
|
577
|
+
for (const name of paramDefaults)
|
|
578
|
+
this.scopeManager.deleteParamDefault(name);
|
|
579
|
+
}
|
|
551
580
|
if (paramObjectTemporaries) {
|
|
552
581
|
for (const name of paramObjectTemporaries) {
|
|
553
582
|
this.expressionResolver.deleteTemporaryObjectVariable(name);
|
|
@@ -15,6 +15,11 @@ class ScopeManager {
|
|
|
15
15
|
simpleConstantObjects = new Map();
|
|
16
16
|
// `const NS = ['a', 'b']` → used by resolveNsArg for `useTranslation(NS)`.
|
|
17
17
|
simpleConstantArrays = new Map();
|
|
18
|
+
// `({ ns = 'x' }) =>` / `(ns = 'x') =>` param defaults, set/cleared per function by the visitor.
|
|
19
|
+
paramDefaults = new Map();
|
|
20
|
+
// Last-resort identifier resolution for `useTranslation(ns)` (e.g. first member of
|
|
21
|
+
// a param's union type), wired up by the visitor.
|
|
22
|
+
identifierFallback;
|
|
18
23
|
// Shared (cross-file) tables so that exported constants from one file can be
|
|
19
24
|
// resolved when imported in another. These are NOT cleared by reset().
|
|
20
25
|
sharedConstants = new Map();
|
|
@@ -69,6 +74,7 @@ class ScopeManager {
|
|
|
69
74
|
this.simpleConstants.clear();
|
|
70
75
|
this.simpleConstantObjects.clear();
|
|
71
76
|
this.simpleConstantArrays.clear();
|
|
77
|
+
this.paramDefaults.clear();
|
|
72
78
|
this.thisFieldStack = [];
|
|
73
79
|
}
|
|
74
80
|
/**
|
|
@@ -187,6 +193,12 @@ class ScopeManager {
|
|
|
187
193
|
/**
|
|
188
194
|
* Resolve simple identifier declared in-file to its string literal value, if known.
|
|
189
195
|
*/
|
|
196
|
+
setParamDefault(name, value) {
|
|
197
|
+
this.paramDefaults.set(name, value);
|
|
198
|
+
}
|
|
199
|
+
deleteParamDefault(name) {
|
|
200
|
+
this.paramDefaults.delete(name);
|
|
201
|
+
}
|
|
190
202
|
resolveSimpleStringIdentifier(name) {
|
|
191
203
|
return this.simpleConstants.get(name) ?? this.sharedConstants.get(name);
|
|
192
204
|
}
|
|
@@ -572,7 +584,11 @@ class ScopeManager {
|
|
|
572
584
|
const arr = this.simpleConstantArrays.get(nsNode.value);
|
|
573
585
|
if (arr)
|
|
574
586
|
return { defaultNs: arr[0], namespaces: arr };
|
|
575
|
-
return {
|
|
587
|
+
return {
|
|
588
|
+
defaultNs: this.paramDefaults.get(nsNode.value) ??
|
|
589
|
+
this.resolveSimpleStringIdentifier(nsNode.value) ??
|
|
590
|
+
this.identifierFallback?.(nsNode.value)
|
|
591
|
+
};
|
|
576
592
|
}
|
|
577
593
|
if (nsNode.type === 'MemberExpression')
|
|
578
594
|
return { defaultNs: this.resolveSimpleMemberExpression(nsNode) };
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast-visitors.d.ts","sourceRoot":"","sources":["../../../src/extractor/core/ast-visitors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAQ,MAAM,WAAW,CAAA;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC7G,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAItE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAe;IAC7C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuC;IAC9D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;IAC/B,OAAO,CAAC,KAAK,CAAiB;IAE9B,IAAW,UAAU,gBAEpB;IAED,SAAgB,YAAY,EAAE,YAAY,CAAA;IAC1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Aa;IAEhC;;;;;;OAMG;gBAED,MAAM,EAAE,IAAI,CAAC,oBAAoB,EAAE,SAAS,CAAC,EAC7C,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM,EACd,KAAK,CAAC,EAAE,eAAe,EACvB,kBAAkB,CAAC,EAAE,kBAAkB;IAoCzC;;;;;;;;;;;;;OAaG;IACI,mBAAmB,CAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAK/C;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAqDzB;;;;;OAKG;IACI,KAAK,CAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAUjC;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,IAAI;IAsaZ;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAiH1B;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAIzB,mFAAmF;IACnF,OAAO,CAAC,oBAAoB;IAoB5B;;;;;;;;OAQG;IACH,OAAO,CAAC,gCAAgC;IAqDxC;;;;;;;;;OASG;IACH,OAAO,CAAC,0BAA0B;IA+ClC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAqB5B;;;;;;;;OAQG;IACI,eAAe,CAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAI5D;;OAEG;IACI,cAAc,CAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAKxD;;;;;;OAMG;IACI,cAAc,IAAK,MAAM;IAIhC;;OAEG;IACI,cAAc,IAAK,MAAM;CAGjC"}
|
|
@@ -8,6 +8,8 @@ export declare class ScopeManager {
|
|
|
8
8
|
private simpleConstants;
|
|
9
9
|
private simpleConstantObjects;
|
|
10
10
|
private simpleConstantArrays;
|
|
11
|
+
private paramDefaults;
|
|
12
|
+
identifierFallback?: (name: string) => string | undefined;
|
|
11
13
|
private sharedConstants;
|
|
12
14
|
private sharedConstantObjects;
|
|
13
15
|
constructor(config: Omit<I18nextToolkitConfig, 'plugins'>);
|
|
@@ -86,6 +88,8 @@ export declare class ScopeManager {
|
|
|
86
88
|
/**
|
|
87
89
|
* Resolve simple identifier declared in-file to its string literal value, if known.
|
|
88
90
|
*/
|
|
91
|
+
setParamDefault(name: string, value: string): void;
|
|
92
|
+
deleteParamDefault(name: string): void;
|
|
89
93
|
resolveSimpleStringIdentifier(name: string): string | undefined;
|
|
90
94
|
/**
|
|
91
95
|
* Resolve a MemberExpression node (e.g., `ns.custom`) to its string value
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-manager.d.ts","sourceRoot":"","sources":["../../../src/extractor/parsers/scope-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EAEV,kBAAkB,EAMnB,MAAM,WAAW,CAAA;AAClB,OAAO,KAAK,EAAE,SAAS,EAA4B,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAG/F,qBAAa,YAAY;IACvB,OAAO,CAAC,UAAU,CAAoC;IACtD,OAAO,CAAC,MAAM,CAAuC;IACrD,OAAO,CAAC,KAAK,CAAqE;IAMlF,OAAO,CAAC,cAAc,CAAoC;IAG1D,OAAO,CAAC,eAAe,CAAiC;IAGxD,OAAO,CAAC,qBAAqB,CAAiD;IAE9E,OAAO,CAAC,oBAAoB,CAAmC;
|
|
1
|
+
{"version":3,"file":"scope-manager.d.ts","sourceRoot":"","sources":["../../../src/extractor/parsers/scope-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EAEV,kBAAkB,EAMnB,MAAM,WAAW,CAAA;AAClB,OAAO,KAAK,EAAE,SAAS,EAA4B,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAG/F,qBAAa,YAAY;IACvB,OAAO,CAAC,UAAU,CAAoC;IACtD,OAAO,CAAC,MAAM,CAAuC;IACrD,OAAO,CAAC,KAAK,CAAqE;IAMlF,OAAO,CAAC,cAAc,CAAoC;IAG1D,OAAO,CAAC,eAAe,CAAiC;IAGxD,OAAO,CAAC,qBAAqB,C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