@microtronics/studio-cli 0.5.1 → 0.6.0
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/CHANGELOG.md +7 -0
- package/dist/studio-cli.d.ts +16 -0
- package/out/dde/dde.d.ts.map +1 -1
- package/out/dde/dde.js +29 -4
- package/out/dde/fileGenerators/dlo.d.ts.map +1 -1
- package/out/dde/fileGenerators/dlo.js +55 -0
- package/out/dependencies.d.ts.map +1 -1
- package/out/dependencies.js +36 -0
- package/out/main.js +17 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## 0.6.0 (2024-12-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **studio-cli:** moved generation of `default.inc` to the cli ([e78ce9e](https://bitbucket.org/microtronics-core/vscode-studio/commits/e78ce9ed8dc6fd73a74a25ad8c89c3a2013ca32d))
|
|
9
|
+
|
|
3
10
|
## 0.5.1 (2024-12-11)
|
|
4
11
|
|
|
5
12
|
|
package/dist/studio-cli.d.ts
CHANGED
|
@@ -1051,6 +1051,12 @@ export declare namespace DDE {
|
|
|
1051
1051
|
* @param ddeMap
|
|
1052
1052
|
*/
|
|
1053
1053
|
export function exportOpenApi(cwd: URI, fs: LocalFS, ddeMap: DDEJson): Promise<void>;
|
|
1054
|
+
/**
|
|
1055
|
+
* Generate and export the default.inc file
|
|
1056
|
+
* @param cwd
|
|
1057
|
+
* @param fs
|
|
1058
|
+
*/
|
|
1059
|
+
export function exportDefaultInc(cwd: URI, fs: LocalFS): Promise<void>;
|
|
1054
1060
|
}
|
|
1055
1061
|
|
|
1056
1062
|
export declare namespace DDE_Core {
|
|
@@ -1474,6 +1480,16 @@ export declare namespace Dependencies {
|
|
|
1474
1480
|
* @param libraryName
|
|
1475
1481
|
*/
|
|
1476
1482
|
export function uninstallDependency(cwd: URI, fs: LocalFS, publisherId: string, libraryName: string): Promise<void>;
|
|
1483
|
+
export interface DLOLibrary {
|
|
1484
|
+
name: string;
|
|
1485
|
+
path: URI;
|
|
1486
|
+
}
|
|
1487
|
+
/**
|
|
1488
|
+
* Get all libraries that have dlo source
|
|
1489
|
+
* @param cwd
|
|
1490
|
+
* @param fs
|
|
1491
|
+
*/
|
|
1492
|
+
export function getDloDependencies(cwd: URI, fs: LocalFS): Promise<DLOLibrary[]>;
|
|
1477
1493
|
}
|
|
1478
1494
|
|
|
1479
1495
|
export declare const DeviceProfiles: any;
|
package/out/dde/dde.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dde.d.ts","sourceRoot":"","sources":["../../src/dde/dde.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAS,MAAM,YAAY,CAAC;AACxC,OAAO,EAAuB,OAAO,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAKvC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"dde.d.ts","sourceRoot":"","sources":["../../src/dde/dde.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAS,MAAM,YAAY,CAAC;AACxC,OAAO,EAAuB,OAAO,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAKvC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAc7C,eAAO,MAAM,QAAQ,QAAkC,CAAC;AAKxD,yBAAiB,GAAG,C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B,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,iBAK3D;CACD"}
|
package/out/dde/dde.js
CHANGED
|
@@ -226,6 +226,8 @@ var DDE;
|
|
|
226
226
|
const autoInc = (0, dlo_1.generateAutoIncFromMap)(ddeJSON, globalDefines, manifest);
|
|
227
227
|
const appAutoDDE = new dlo_1.AutoDDEGenerator(ddeJSON, null);
|
|
228
228
|
const appDDEInc = appAutoDDE.generate();
|
|
229
|
+
// clean the .studio/auto/dlo directory
|
|
230
|
+
await fs.rm(vscode_uri_1.Utils.joinPath(cwd, defaultFiles_1.DefaultFiles.filePaths.studio.auto.dlo.path));
|
|
229
231
|
// generate AutoDDe Files for the libraries:
|
|
230
232
|
for (const dependency of dependencies) {
|
|
231
233
|
const libAutoDDE = new dlo_1.AutoDDEGenerator(ddeJSON, dependency.libraryName);
|
|
@@ -233,8 +235,10 @@ var DDE;
|
|
|
233
235
|
const libraryInc = [...globals, ...helper].join('\r\n');
|
|
234
236
|
const autoIncName = defaultFiles_1.DefaultFiles.filePaths.studio.auto.dlo.autoDdeInc.replace('X', dependency.libraryName);
|
|
235
237
|
const incPath = vscode_uri_1.Utils.joinPath(cwd, autoIncName);
|
|
236
|
-
|
|
237
|
-
|
|
238
|
+
if (libraryInc.length) {
|
|
239
|
+
console.log(`Generated`, autoIncName);
|
|
240
|
+
await fs.writeFile(incPath, libraryInc);
|
|
241
|
+
}
|
|
238
242
|
}
|
|
239
243
|
const mainDDEInc = (0, dlo_1.generateMainDDEIncFromMap)(ddeJSON);
|
|
240
244
|
const autoUplink = (0, dlo_1.generateAutoUplinkIncFromMap)(ddeJSON, dependencies.map(dep => dep.libraryName));
|
|
@@ -270,12 +274,33 @@ var DDE;
|
|
|
270
274
|
// generate the api description for the library part of the project
|
|
271
275
|
if (isLibrary) {
|
|
272
276
|
const libPath = vscode_uri_1.Utils.joinPath(cwd, defaultFiles_1.DefaultFiles.filePaths.dist.ddeApiPath, `${manifest.name}.yaml`);
|
|
273
|
-
|
|
274
|
-
|
|
277
|
+
const content = (0, api_1.generateAPIFromMap)(ddeMap, manifest, manifest.name);
|
|
278
|
+
if (content.length) {
|
|
279
|
+
await fs.writeFile(libPath, content);
|
|
280
|
+
console.log(`Generated`, defaultFiles_1.DefaultFiles.filePaths.dist.ddeApiPath + `${manifest.name}.yaml`);
|
|
281
|
+
}
|
|
275
282
|
}
|
|
276
283
|
}
|
|
277
284
|
DDE.exportOpenApi = exportOpenApi;
|
|
285
|
+
/**
|
|
286
|
+
* Generate and export the default.inc file
|
|
287
|
+
* @param cwd
|
|
288
|
+
* @param fs
|
|
289
|
+
*/
|
|
290
|
+
async function exportDefaultInc(cwd, fs) {
|
|
291
|
+
const defaultIncPaht = vscode_uri_1.Utils.joinPath(cwd, defaultFiles_1.DefaultFiles.filePaths.studio.auto.dlo.defaultInc);
|
|
292
|
+
const content = await (0, dlo_1.buildDefaultInc)(cwd, fs);
|
|
293
|
+
await fs.writeFile(defaultIncPaht, content);
|
|
294
|
+
console.log('Generated', defaultFiles_1.DefaultFiles.filePaths.studio.auto.dlo.defaultInc);
|
|
295
|
+
}
|
|
296
|
+
DDE.exportDefaultInc = exportDefaultInc;
|
|
278
297
|
})(DDE || (exports.DDE = DDE = {}));
|
|
298
|
+
/**
|
|
299
|
+
* Get dde files from any included library
|
|
300
|
+
* @param cwd
|
|
301
|
+
* @param fs
|
|
302
|
+
* @param manifest
|
|
303
|
+
*/
|
|
279
304
|
async function getDependencies(cwd, fs, manifest) {
|
|
280
305
|
const ddeFiles = [];
|
|
281
306
|
const allDependencies = await dependencies_1.Dependencies.getAll(manifest);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dlo.d.ts","sourceRoot":"","sources":["../../../src/dde/fileGenerators/dlo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,OAAO,OA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CAAC,uBAAuB;IAY/B,OAAO,CAAC,yBAAyB;IAgBjC,OAAO,CAAC,uBAAuB;IA8D/B,OAAO,CAAC,6BAA6B;IASrC,OAAO,CAAC,2BAA2B;IAmBnC;;;;;;OAMG;IACH,OAAO,CAAC,SAAS;IAcjB,OAAO,CAAC,0BAA0B;IA8BlC,OAAO,CAAC,mBAAmB;IAiD3B;;;;;;OAMG;IACH,OAAO,CAAC,4BAA4B;IAIpC,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,sBAAsB;IAmC9B,OAAO,CAAC,iBAAiB;IAoDzB;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;CA6B7B;AAGD,wBAAgB,4BAA4B,CAC3C,MAAM,EAAE,OAAO;AACf;;GAEG;AACH,gBAAgB,EAAE,MAAM,EAAE,UAsI1B;AAID,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,OAAO,UAqExD;AAqBD;;GAEG;AAEH;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,mBAmB1D"}
|
|
@@ -27,6 +27,7 @@ exports.AutoDDEGenerator = void 0;
|
|
|
27
27
|
exports.generateAutoIncFromMap = generateAutoIncFromMap;
|
|
28
28
|
exports.generateAutoUplinkIncFromMap = generateAutoUplinkIncFromMap;
|
|
29
29
|
exports.generateMainDDEIncFromMap = generateMainDDEIncFromMap;
|
|
30
|
+
exports.buildDefaultInc = buildDefaultInc;
|
|
30
31
|
const semver = __importStar(require("semver"));
|
|
31
32
|
const coreDefinitions_1 = require("../coreDefinitions");
|
|
32
33
|
const DeviceProfiles_1 = require("../../DeviceProfiles");
|
|
@@ -38,6 +39,9 @@ var CONFIG_CONTAINER = coreDefinitions_1.DDE_Core.CONFIG_CONTAINER;
|
|
|
38
39
|
var CONTAINER_DEF_DLO_CID_BASE = coreDefinitions_1.DDE_Core.CONTAINER_DEF_DLO_CID_BASE;
|
|
39
40
|
var CONTAINER_DEFS = coreDefinitions_1.DDE_Core.CONTAINER_DEFS;
|
|
40
41
|
var fieldTypeDefinitions = coreDefinitions_1.DDE_Core.fieldTypeDefinitions;
|
|
42
|
+
const vscode_uri_1 = require("vscode-uri");
|
|
43
|
+
const defaultFiles_1 = require("../../defaultFiles");
|
|
44
|
+
const dependencies_1 = require("../../dependencies");
|
|
41
45
|
/** get effective field type for pawn access (may be overriden or skipped using attribute dlorw=...)
|
|
42
46
|
* @return {*} | 'skip' | null - null=error occured
|
|
43
47
|
*/
|
|
@@ -880,4 +884,55 @@ function generateMainDDEFunctionBody(pawnSource, containerDefinition, readWrite)
|
|
|
880
884
|
pawnSource(`\t#endif`);
|
|
881
885
|
}
|
|
882
886
|
}
|
|
887
|
+
/**
|
|
888
|
+
* Default INC handling
|
|
889
|
+
*/
|
|
890
|
+
/**
|
|
891
|
+
* Generate the default.inc file
|
|
892
|
+
* @param cwd
|
|
893
|
+
* @param fs
|
|
894
|
+
* @param dependencies
|
|
895
|
+
*/
|
|
896
|
+
async function buildDefaultInc(cwd, fs) {
|
|
897
|
+
const fileContent = [];
|
|
898
|
+
const dloLibs = await dependencies_1.Dependencies.getDloDependencies(cwd, fs);
|
|
899
|
+
await addInclude(cwd, fs, fileContent, defaultFiles_1.DefaultFiles.fileNames.autoInc);
|
|
900
|
+
const autoDdeIncs = await getAutoDDEIncludes(cwd, fs, dloLibs);
|
|
901
|
+
for (const dloLib of dloLibs) {
|
|
902
|
+
// todo use relative path as include?
|
|
903
|
+
fileContent.push(`#include <${dloLib.name}>`);
|
|
904
|
+
if (dloLib.name === 'dlo-core') {
|
|
905
|
+
fileContent.push(...autoDdeIncs);
|
|
906
|
+
await addInclude(cwd, fs, fileContent, defaultFiles_1.DefaultFiles.fileNames.autoDdeInc.replace('X', 'app'));
|
|
907
|
+
await addInclude(cwd, fs, fileContent, defaultFiles_1.DefaultFiles.fileNames.autoDdeInc.replace('X', 'main'));
|
|
908
|
+
await addInclude(cwd, fs, fileContent, defaultFiles_1.DefaultFiles.fileNames.autoUplinkInc);
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
return fileContent.join('\n');
|
|
912
|
+
}
|
|
913
|
+
/**
|
|
914
|
+
* Get all <library-name>-dde.inc files
|
|
915
|
+
* @param cwd
|
|
916
|
+
* @param fs
|
|
917
|
+
* @param dependencies
|
|
918
|
+
*/
|
|
919
|
+
async function getAutoDDEIncludes(cwd, fs, dependencies) {
|
|
920
|
+
const includes = [];
|
|
921
|
+
for (const dependency of dependencies) {
|
|
922
|
+
const includePath = defaultFiles_1.DefaultFiles.filePaths.studio.auto.dlo.autoDdeInc.replace('X', dependency.name);
|
|
923
|
+
if (await fs.stat(vscode_uri_1.Utils.joinPath(cwd, includePath))) {
|
|
924
|
+
includes.push(`#include "${defaultFiles_1.DefaultFiles.fileNames.autoDdeInc.replace('X', dependency.name)}"`);
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
return includes;
|
|
928
|
+
}
|
|
929
|
+
/**
|
|
930
|
+
* Validate if the given file exist within the .studio/auto/dlo directory
|
|
931
|
+
*/
|
|
932
|
+
async function addInclude(cwd, fs, fileContent, fileName) {
|
|
933
|
+
const basePath = vscode_uri_1.Utils.joinPath(cwd, defaultFiles_1.DefaultFiles.filePaths.studio.auto.dlo.path, fileName);
|
|
934
|
+
if (await fs.stat(basePath)) {
|
|
935
|
+
fileContent.push(`#include "${fileName}"`);
|
|
936
|
+
}
|
|
937
|
+
}
|
|
883
938
|
//# sourceMappingURL=dlo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../src/dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAS,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
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AAE,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAK9E;IAED;;;;;;OAMG;IACH,SAAsB,qBAAqB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,iBAYjH;IAED;;;;;;;;OAQG;IACH,SAAsB,iBAAiB,CACtC,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,OAAO,EACX,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,WAAW,UAAQ,GACjB,OAAO,CAAC,SAAS,CAAC,CA+DpB;IAED;;;;;OAKG;IACH,SAAsB,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,iBAapF;IAED;;;;;;;OAOG;IACH,SAAsB,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAmBxG;IAED,UAAiB,UAAU;QAC1B,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,GAAG,CAAC;KACV;IAED;;;;OAIG;IACH,SAAsB,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,yBA+B7D;CACD"}
|
package/out/dependencies.js
CHANGED
|
@@ -28,11 +28,13 @@ const vscode_uri_1 = require("vscode-uri");
|
|
|
28
28
|
const manifest_1 = require("./manifest");
|
|
29
29
|
const semver = __importStar(require("semver"));
|
|
30
30
|
const registryAPI_1 = require("./registryAPI");
|
|
31
|
+
const defaultFiles_1 = require("./defaultFiles");
|
|
31
32
|
const tinytar = require('tinytar-fix');
|
|
32
33
|
const pako = require('pako');
|
|
33
34
|
exports.LIB_DEPS_PATH = '.studio/libdeps';
|
|
34
35
|
var Dependencies;
|
|
35
36
|
(function (Dependencies) {
|
|
37
|
+
var isLibraryProject = manifest_1.Manifest.isLibraryProject;
|
|
36
38
|
/**
|
|
37
39
|
* Just combine all dependencies in one object
|
|
38
40
|
* Optional devDependencies can be excluded
|
|
@@ -294,6 +296,40 @@ var Dependencies;
|
|
|
294
296
|
}
|
|
295
297
|
}
|
|
296
298
|
Dependencies.uninstallDependency = uninstallDependency;
|
|
299
|
+
/**
|
|
300
|
+
* Get all libraries that have dlo source
|
|
301
|
+
* @param cwd
|
|
302
|
+
* @param fs
|
|
303
|
+
*/
|
|
304
|
+
async function getDloDependencies(cwd, fs) {
|
|
305
|
+
const manifest = await manifest_1.Manifest.read(cwd, fs);
|
|
306
|
+
const allDependencies = await getAll(manifest);
|
|
307
|
+
const dloDependencies = [];
|
|
308
|
+
for (const dependencyId in allDependencies) {
|
|
309
|
+
const depPath = Dependencies.dependencyToPath(cwd, dependencyId);
|
|
310
|
+
const name = Dependencies.dependencyIdToName(dependencyId);
|
|
311
|
+
const incPath = vscode_uri_1.Utils.joinPath(depPath, defaultFiles_1.DefaultFiles.filePaths.dlo.path, `${name}.inc`);
|
|
312
|
+
const exists = await fs.stat(incPath);
|
|
313
|
+
if (exists) {
|
|
314
|
+
dloDependencies.push({
|
|
315
|
+
name,
|
|
316
|
+
path: incPath
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
// add current project file if it is a library project
|
|
321
|
+
if (isLibraryProject(manifest)) {
|
|
322
|
+
const incPath = vscode_uri_1.Utils.joinPath(cwd, defaultFiles_1.DefaultFiles.filePaths.dlo.path, `${manifest.name}.inc`);
|
|
323
|
+
if (await fs.stat(incPath)) {
|
|
324
|
+
dloDependencies.push({
|
|
325
|
+
name: manifest.name,
|
|
326
|
+
path: incPath
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
return dloDependencies;
|
|
331
|
+
}
|
|
332
|
+
Dependencies.getDloDependencies = getDloDependencies;
|
|
297
333
|
})(Dependencies || (exports.Dependencies = Dependencies = {}));
|
|
298
334
|
async function fetchStudioJson(token, studioJsonURL) {
|
|
299
335
|
return await registryAPI_1.Registry.fetchLibraryContent(token, studioJsonURL, true);
|
package/out/main.js
CHANGED
|
@@ -57,12 +57,27 @@ program
|
|
|
57
57
|
.action(async (apmPart) => {
|
|
58
58
|
if (apmPart === 'dde') {
|
|
59
59
|
const result = await dde_1.DDE.compileDDE(cwd, cliFS_1.cliFS);
|
|
60
|
-
|
|
60
|
+
result.diagnostics.forEach(diagnostic => {
|
|
61
|
+
const message = `${diagnostic.file.path}: ${diagnostic.message}`;
|
|
62
|
+
if (diagnostic.level === 'error') {
|
|
63
|
+
console.error(message);
|
|
64
|
+
}
|
|
65
|
+
else if (diagnostic.level === 'warning') {
|
|
66
|
+
console.warn(message);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
console.log(message);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
61
72
|
if (result.ddeJSON) {
|
|
62
73
|
await dde_1.DDE.exportMyDatanetXML(cwd, cliFS_1.cliFS, result.ddeJSON);
|
|
63
74
|
await dde_1.DDE.exportHistoryJson(cwd, cliFS_1.cliFS, result.ddeJSON);
|
|
64
|
-
await dde_1.DDE.exportAutoDloFiles(cwd, cliFS_1.cliFS, result.ddeJSON);
|
|
65
75
|
await dde_1.DDE.exportOpenApi(cwd, cliFS_1.cliFS, result.ddeJSON);
|
|
76
|
+
await dde_1.DDE.exportAutoDloFiles(cwd, cliFS_1.cliFS, result.ddeJSON);
|
|
77
|
+
await dde_1.DDE.exportDefaultInc(cwd, cliFS_1.cliFS);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
console.error('Project has errors!');
|
|
66
81
|
}
|
|
67
82
|
}
|
|
68
83
|
});
|