@typespec/http-server-csharp 0.58.0-alpha.1

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 (39) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +40 -0
  3. package/dist/src/attributes.d.ts +43 -0
  4. package/dist/src/attributes.d.ts.map +1 -0
  5. package/dist/src/attributes.js +344 -0
  6. package/dist/src/attributes.js.map +1 -0
  7. package/dist/src/boilerplate.d.ts +4 -0
  8. package/dist/src/boilerplate.d.ts.map +1 -0
  9. package/dist/src/boilerplate.js +605 -0
  10. package/dist/src/boilerplate.js.map +1 -0
  11. package/dist/src/index.d.ts +4 -0
  12. package/dist/src/index.d.ts.map +1 -0
  13. package/dist/src/index.js +4 -0
  14. package/dist/src/index.js.map +1 -0
  15. package/dist/src/interfaces.d.ts +129 -0
  16. package/dist/src/interfaces.d.ts.map +1 -0
  17. package/dist/src/interfaces.js +222 -0
  18. package/dist/src/interfaces.js.map +1 -0
  19. package/dist/src/lib.d.ts +58 -0
  20. package/dist/src/lib.d.ts.map +1 -0
  21. package/dist/src/lib.js +60 -0
  22. package/dist/src/lib.js.map +1 -0
  23. package/dist/src/service.d.ts +4 -0
  24. package/dist/src/service.d.ts.map +1 -0
  25. package/dist/src/service.js +829 -0
  26. package/dist/src/service.js.map +1 -0
  27. package/dist/src/testing/index.d.ts +3 -0
  28. package/dist/src/testing/index.d.ts.map +1 -0
  29. package/dist/src/testing/index.js +6 -0
  30. package/dist/src/testing/index.js.map +1 -0
  31. package/dist/src/type-helpers.d.ts +40 -0
  32. package/dist/src/type-helpers.d.ts.map +1 -0
  33. package/dist/src/type-helpers.js +77 -0
  34. package/dist/src/type-helpers.js.map +1 -0
  35. package/dist/src/utils.d.ts +48 -0
  36. package/dist/src/utils.d.ts.map +1 -0
  37. package/dist/src/utils.js +628 -0
  38. package/dist/src/utils.js.map +1 -0
  39. package/package.json +77 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Microsoft Corporation. All rights reserved.
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
package/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # @typespec/http-server-csharp
2
+
3
+ TypeSpec service code generator for c-sharp
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @typespec/http-server-csharp
9
+ ```
10
+
11
+ ## Emitter
12
+
13
+ ### Usage
14
+
15
+ 1. Via the command line
16
+
17
+ ```bash
18
+ tsp compile . --emit=@typespec/http-server-csharp
19
+ ```
20
+
21
+ 2. Via the config
22
+
23
+ ```yaml
24
+ emit:
25
+ - "@typespec/http-server-csharp"
26
+ ```
27
+
28
+ ### Emitter options
29
+
30
+ #### `skip-format`
31
+
32
+ **Type:** `boolean`
33
+
34
+ Skips formatting of generated C# Types. By default, C# files are formatted using 'dotnet format'.
35
+
36
+ #### `output-type`
37
+
38
+ **Type:** `"models" | "all"`
39
+
40
+ Chooses which service artifacts to emit. choices include 'models' or 'all' artifacts.
@@ -0,0 +1,43 @@
1
+ import { ModelProperty, Program, Scalar, Type } from "@typespec/compiler";
2
+ import { Attribute } from "./interfaces.js";
3
+ export declare const JsonNamespace: string;
4
+ export declare function getEncodingValue(program: Program, type: Scalar | ModelProperty): string | undefined;
5
+ export declare function getFormatValue(program: Program, type: Scalar | ModelProperty): string | undefined;
6
+ /**
7
+ * Return name encoding attributes
8
+ * @param program The program being processed
9
+ * @param type The type to check
10
+ * @returns The attributes associated with the type, or none
11
+ */
12
+ export declare function getEncodedNameAttribute(program: Program, type: ModelProperty): Attribute | undefined;
13
+ /**
14
+ * Return the encoding attributes for model properties
15
+ * @param program The program being processed
16
+ * @param type The type to check
17
+ * @returns The appropriate serialization attributes for the type, or none
18
+ */
19
+ export declare function getEncodingAttributes(program: Program, type: ModelProperty): Attribute[];
20
+ /**
21
+ * Return min and max length attributes for string
22
+ * @param program The program being processed
23
+ * @param type The type to check
24
+ * @returns The attributes associated with the type, or none
25
+ */
26
+ export declare function getStringConstraintAttribute(program: Program, type: ModelProperty | Scalar): Attribute | undefined;
27
+ /**
28
+ * Return min and max length attributes for string
29
+ * @param program The program being processed
30
+ * @param type The type to check
31
+ * @returns The attributes associated with the type, or none
32
+ */
33
+ export declare function getArrayConstraintAttribute(program: Program, type: ModelProperty | Scalar): Attribute | undefined;
34
+ /**
35
+ * Return min and max length attributes for string
36
+ * @param program The program being processed
37
+ * @param type The type to check
38
+ * @returns The attributes associated with the type, or none
39
+ */
40
+ export declare function getNumericConstraintAttribute(program: Program, type: ModelProperty | Scalar): Attribute | undefined;
41
+ export declare function getSafeIntAttribute(type: Scalar): Attribute | undefined;
42
+ export declare function getAttributes(program: Program, type: Type, cSharpName?: string): Attribute[];
43
+ //# sourceMappingURL=attributes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../src/attributes.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,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
+ import { getEncode, getFormat, getMaxItems, getMaxValue, getMaxValueExclusive, getMinItems, getMinValue, getMinValueExclusive, resolveEncodedName, } from "@typespec/compiler";
2
+ import { Attribute, AttributeType, BooleanValue, CSharpType, HelperNamespace, NumericValue, Parameter, RawValue, StringValue, } from "./interfaces.js";
3
+ import { getStringConstraint, isArrayType } from "./type-helpers.js";
4
+ import { getCSharpIdentifier, getCSharpTypeForScalar } from "./utils.js";
5
+ export const JsonNamespace = "System.Text.Json";
6
+ export function getEncodingValue(program, type) {
7
+ const value = getEncode(program, type);
8
+ return value ? value.encoding : undefined;
9
+ }
10
+ export function getFormatValue(program, type) {
11
+ return getFormat(program, type);
12
+ }
13
+ /**
14
+ * Return name encoding attributes
15
+ * @param program The program being processed
16
+ * @param type The type to check
17
+ * @returns The attributes associated with the type, or none
18
+ */
19
+ export function getEncodedNameAttribute(program, type) {
20
+ const encodedName = resolveEncodedName(program, type, "application/json");
21
+ if (encodedName !== type.name) {
22
+ const attr = new Attribute(new AttributeType({
23
+ name: "JsonPropertyName",
24
+ namespace: JsonNamespace,
25
+ }), []);
26
+ attr.parameters.push(new Parameter({
27
+ name: "name",
28
+ value: new StringValue(encodedName),
29
+ optional: false,
30
+ type: new CSharpType({
31
+ name: "string",
32
+ namespace: "System",
33
+ isBuiltIn: true,
34
+ isValueType: true,
35
+ }),
36
+ }));
37
+ return attr;
38
+ }
39
+ return undefined;
40
+ }
41
+ /**
42
+ * Return the encoding attributes for model properties
43
+ * @param program The program being processed
44
+ * @param type The type to check
45
+ * @returns The appropriate serialization attributes for the type, or none
46
+ */
47
+ export function getEncodingAttributes(program, type) {
48
+ const result = [];
49
+ const propertyType = getScalarType(program, type);
50
+ if (propertyType !== undefined) {
51
+ switch (propertyType.scalar.name) {
52
+ case "unixTimestamp32":
53
+ result.push(getJsonConverterAttribute("UnixEpochDateTimeOffsetConverter"));
54
+ break;
55
+ case "duration":
56
+ result.push(getJsonConverterAttribute("TimeSpanDurationConverter"));
57
+ break;
58
+ default:
59
+ if (propertyType.encoding !== undefined) {
60
+ switch (propertyType.encoding.name.toLowerCase()) {
61
+ case "base64url":
62
+ result.push(getJsonConverterAttribute("Base64UrlConverter"));
63
+ break;
64
+ case "unixtimestamp":
65
+ result.push(getJsonConverterAttribute("UnixEpochDateTimeOffsetConverter"));
66
+ break;
67
+ }
68
+ }
69
+ }
70
+ }
71
+ return result;
72
+ }
73
+ function getScalarType(program, property) {
74
+ if (property.type.kind !== "Scalar")
75
+ return undefined;
76
+ let scalarType = property.type;
77
+ let encoding = getScalarEncoding(program, property) || getScalarEncoding(program, scalarType);
78
+ while (scalarType.baseScalar !== undefined) {
79
+ scalarType = scalarType.baseScalar;
80
+ if (encoding === undefined) {
81
+ encoding = getScalarEncoding(program, scalarType);
82
+ }
83
+ }
84
+ return { scalar: scalarType, encoding: encoding };
85
+ }
86
+ function getScalarEncoding(program, scalar) {
87
+ const encode = getEncode(program, scalar);
88
+ if (encode === undefined)
89
+ return undefined;
90
+ return { name: encode.encoding ?? "string", wireType: encode.type };
91
+ }
92
+ function getTypeType() {
93
+ return new CSharpType({ name: "Type", namespace: "System", isValueType: false, isBuiltIn: true });
94
+ }
95
+ function getJsonConverterAttributeType() {
96
+ return new CSharpType({
97
+ name: "JsonConverter",
98
+ namespace: "System.Text.Json",
99
+ isValueType: false,
100
+ isBuiltIn: true,
101
+ });
102
+ }
103
+ function getJsonConverterAttribute(converterType) {
104
+ return new Attribute(getJsonConverterAttributeType(), [
105
+ new Parameter({
106
+ name: "",
107
+ type: getTypeType(),
108
+ optional: false,
109
+ value: new RawValue(`typeof(${converterType})`),
110
+ }),
111
+ ]);
112
+ }
113
+ /**
114
+ * Return min and max length attributes for string
115
+ * @param program The program being processed
116
+ * @param type The type to check
117
+ * @returns The attributes associated with the type, or none
118
+ */
119
+ export function getStringConstraintAttribute(program, type) {
120
+ const constraint = getStringConstraint(program, type);
121
+ if (constraint === undefined)
122
+ return undefined;
123
+ const minLength = constraint.minLength;
124
+ const maxLength = constraint.maxLength;
125
+ const pattern = constraint.pattern;
126
+ if (minLength === undefined && maxLength === undefined && pattern === undefined)
127
+ return undefined;
128
+ const attr = new Attribute(new AttributeType({
129
+ name: "StringConstraint",
130
+ namespace: HelperNamespace,
131
+ }), []);
132
+ if (minLength !== undefined) {
133
+ attr.parameters.push(new Parameter({
134
+ name: "MinLength",
135
+ value: new NumericValue(minLength),
136
+ optional: true,
137
+ type: new CSharpType({
138
+ name: "int",
139
+ namespace: "System",
140
+ isBuiltIn: true,
141
+ isValueType: true,
142
+ }),
143
+ }));
144
+ }
145
+ if (maxLength !== undefined) {
146
+ attr.parameters.push(new Parameter({
147
+ name: "MaxLength",
148
+ value: new NumericValue(maxLength),
149
+ optional: true,
150
+ type: new CSharpType({
151
+ name: "int",
152
+ namespace: "System",
153
+ isBuiltIn: true,
154
+ isValueType: true,
155
+ }),
156
+ }));
157
+ }
158
+ if (pattern !== undefined) {
159
+ attr.parameters.push(new Parameter({
160
+ name: "Pattern",
161
+ value: new StringValue(pattern),
162
+ optional: true,
163
+ type: new CSharpType({
164
+ name: "string",
165
+ namespace: "System",
166
+ isBuiltIn: true,
167
+ isValueType: true,
168
+ }),
169
+ }));
170
+ }
171
+ return attr;
172
+ }
173
+ /**
174
+ * Return min and max length attributes for string
175
+ * @param program The program being processed
176
+ * @param type The type to check
177
+ * @returns The attributes associated with the type, or none
178
+ */
179
+ export function getArrayConstraintAttribute(program, type) {
180
+ if (!isArrayType(program, type))
181
+ return undefined;
182
+ const minItems = getMinItems(program, type);
183
+ const maxItems = getMaxItems(program, type);
184
+ if (minItems === undefined && maxItems === undefined)
185
+ return undefined;
186
+ const attr = new Attribute(new AttributeType({
187
+ name: "ArrayConstraint",
188
+ namespace: HelperNamespace,
189
+ }), []);
190
+ if (minItems !== undefined) {
191
+ attr.parameters.push(new Parameter({
192
+ name: "MinItems",
193
+ value: new NumericValue(minItems),
194
+ optional: true,
195
+ type: new CSharpType({
196
+ name: "int",
197
+ namespace: "System",
198
+ isBuiltIn: true,
199
+ isValueType: true,
200
+ }),
201
+ }));
202
+ }
203
+ if (maxItems !== undefined) {
204
+ attr.parameters.push(new Parameter({
205
+ name: "MaxItems",
206
+ value: new NumericValue(maxItems),
207
+ optional: true,
208
+ type: new CSharpType({
209
+ name: "int",
210
+ namespace: "System",
211
+ isBuiltIn: true,
212
+ isValueType: true,
213
+ }),
214
+ }));
215
+ }
216
+ return attr;
217
+ }
218
+ /**
219
+ * Return min and max length attributes for string
220
+ * @param program The program being processed
221
+ * @param type The type to check
222
+ * @returns The attributes associated with the type, or none
223
+ */
224
+ export function getNumericConstraintAttribute(program, type) {
225
+ if (type.kind === "Scalar" || type.type.kind !== "Scalar")
226
+ return undefined;
227
+ const minValue = getMinValue(program, type);
228
+ const maxValue = getMaxValue(program, type);
229
+ const minValueExclusive = getMinValueExclusive(program, type);
230
+ const maxValueExclusive = getMaxValueExclusive(program, type);
231
+ if (minValue === undefined &&
232
+ maxValue === undefined &&
233
+ minValueExclusive === undefined &&
234
+ maxValueExclusive === undefined)
235
+ return undefined;
236
+ const scalarType = getCSharpTypeForScalar(program, type.type);
237
+ if (scalarType === undefined)
238
+ return undefined;
239
+ const attr = new Attribute(new AttributeType({
240
+ name: `NumericConstraint<${scalarType.getTypeReference()}>`,
241
+ namespace: HelperNamespace,
242
+ }), []);
243
+ const actualMin = minValue === undefined ? minValueExclusive : minValue;
244
+ if (actualMin !== undefined) {
245
+ attr.parameters.push(new Parameter({
246
+ name: "MinValue",
247
+ value: new NumericValue(actualMin),
248
+ optional: true,
249
+ type: scalarType,
250
+ }));
251
+ }
252
+ const actualMax = maxValue === undefined ? maxValueExclusive : maxValue;
253
+ if (actualMax !== undefined) {
254
+ attr.parameters.push(new Parameter({
255
+ name: "MaxValue",
256
+ value: new NumericValue(actualMax),
257
+ optional: true,
258
+ type: scalarType,
259
+ }));
260
+ }
261
+ if (minValueExclusive !== undefined) {
262
+ attr.parameters.push(new Parameter({
263
+ name: "MinValueExclusive",
264
+ value: new BooleanValue(true),
265
+ optional: true,
266
+ type: new CSharpType({
267
+ name: "bool",
268
+ namespace: "System",
269
+ isBuiltIn: true,
270
+ isValueType: true,
271
+ }),
272
+ }));
273
+ }
274
+ if (maxValueExclusive !== undefined) {
275
+ attr.parameters.push(new Parameter({
276
+ name: "MaxValueExclusive",
277
+ value: new BooleanValue(true),
278
+ optional: true,
279
+ type: new CSharpType({
280
+ name: "bool",
281
+ namespace: "System",
282
+ isBuiltIn: true,
283
+ isValueType: true,
284
+ }),
285
+ }));
286
+ }
287
+ return attr;
288
+ }
289
+ export function getSafeIntAttribute(type) {
290
+ if (type.name.toLowerCase() !== "safeint")
291
+ return undefined;
292
+ return new Attribute(new AttributeType({
293
+ name: "SafeInt",
294
+ namespace: HelperNamespace,
295
+ }), []);
296
+ }
297
+ function getEnumAttribute(type, cSharpName) {
298
+ return new Attribute(new AttributeType({
299
+ name: `StringEnumConverter<${cSharpName !== undefined ? cSharpName : getCSharpIdentifier(type.name)}>`,
300
+ namespace: "System.Text.Json",
301
+ }), []);
302
+ }
303
+ export function getAttributes(program, type, cSharpName) {
304
+ const result = new Set();
305
+ switch (type.kind) {
306
+ case "Enum":
307
+ result.add(getEnumAttribute(type, cSharpName));
308
+ break;
309
+ case "Model":
310
+ break;
311
+ case "ModelProperty": {
312
+ const arrayAttr = getArrayConstraintAttribute(program, type);
313
+ const stringAttr = getStringConstraintAttribute(program, type);
314
+ const numberAttr = getNumericConstraintAttribute(program, type);
315
+ const name = getEncodedNameAttribute(program, type);
316
+ if (arrayAttr)
317
+ result.add(arrayAttr);
318
+ if (stringAttr)
319
+ result.add(stringAttr);
320
+ if (numberAttr)
321
+ result.add(numberAttr);
322
+ if (name)
323
+ result.add(name);
324
+ const encodingAttributes = getEncodingAttributes(program, type);
325
+ for (const encoder of encodingAttributes) {
326
+ result.add(encoder);
327
+ }
328
+ const typeAttributes = getAttributes(program, type.type);
329
+ for (const typeAttribute of typeAttributes) {
330
+ result.add(typeAttribute);
331
+ }
332
+ break;
333
+ }
334
+ case "Scalar":
335
+ {
336
+ const safeInt = getSafeIntAttribute(type);
337
+ if (safeInt)
338
+ result.add(safeInt);
339
+ }
340
+ break;
341
+ }
342
+ return [...result.values()];
343
+ }
344
+ //# sourceMappingURL=attributes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attributes.js","sourceRoot":"","sources":["../../src/attributes.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,SAAS,EACT,SAAS,EACT,WAAW,EACX,WAAW,EACX,oBAAoB,EACpB,WAAW,EACX,WAAW,EACX,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,SAAS,EACT,aAAa,EACb,YAAY,EACZ,UAAU,EACV,eAAe,EACf,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzE,MAAM,CAAC,MAAM,aAAa,GAAW,kBAAkB,CAAC;AAExD,MAAM,UAAU,gBAAgB,CAC9B,OAAgB,EAChB,IAA4B;IAE5B,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACvC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,OAAgB,EAAE,IAA4B;IAC3E,OAAO,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAClC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAgB,EAChB,IAAmB;IAEnB,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,EAAE,IAAI,EAAE,kBAAkB,CAAC,CAAC;IAC1E,IAAI,WAAW,KA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U;gBAAE,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACvC,IAAI,IAAI;gBAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC3B,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YAChE,KAAK,MAAM,OAAO,IAAI,kBAAkB,EAAE,CAAC;gBACzC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACtB,CAAC;YACD,MAAM,cAAc,GAAG,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YACzD,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE,CAAC;gBAC3C,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;YAC5B,CAAC;YACD,MAAM;QACR,CAAC;QACD,KAAK,QAAQ;YACX,CAAC;gBACC,MAAM,OAAO,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;gBAC1C,IAAI,OAAO;oBAAE,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACnC,CAAC;YAED,MAAM;IACV,CAAC;IAED,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { AssetEmitter } from "@typespec/compiler/emitter-framework";
2
+ import { LibrarySourceFile } from "./interfaces.js";
3
+ export declare function getSerializationSourceFiles(emitter: AssetEmitter<string, Record<string, never>>): LibrarySourceFile[];
4
+ //# sourceMappingURL=boilerplate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boilerplate.d.ts","sourceRoot":"","sources":["../../src/boilerplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,GACnD,iBAAiB,EAAE,CAkDrB"}