@nrwl/nx-cloud 15.3.1 → 15.3.3-beta.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.
- package/lib/core/api/error-reporter.api.js +36 -1
- package/lib/core/api/run-group.api.js +73 -1
- package/lib/core/api/run-group.api.js.map +1 -1
- package/lib/core/commands/record-output.js +6 -2
- package/lib/core/commands/record-output.js.map +1 -1
- package/lib/core/commands/upload-and-show-run-details.js +2 -1
- package/lib/core/commands/upload-and-show-run-details.js.map +1 -1
- package/lib/core/file-storage/file-storage.js +1 -1
- package/lib/core/file-storage/file-storage.js.map +1 -1
- package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.js +93 -1
- package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js +320 -1
- package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js.map +1 -1
- package/lib/core/runners/cloud-enabled/cloud-remote-cache.js +133 -1
- package/lib/core/runners/cloud-enabled/cloud-run.api.js +168 -1
- package/lib/core/runners/cloud-enabled/id-generator.js +16 -1
- package/lib/core/runners/distributed-agent/distributed-agent.api.js +93 -1
- package/lib/core/runners/distributed-agent/distributed-agent.impl.js +157 -1
- package/lib/core/runners/distributed-agent/execute-tasks.js +114 -1
- package/lib/core/runners/distributed-agent/invoke-tasks-using-nx-imperative-api.js +58 -1
- package/lib/core/runners/distributed-agent/invoke-tasks-using-run-many.js +97 -1
- package/lib/core/runners/distributed-execution/distributed-execution.api.d.ts +1 -1
- package/lib/core/runners/distributed-execution/distributed-execution.api.js +152 -1
- package/lib/core/runners/distributed-execution/distributed-execution.api.js.map +1 -1
- package/lib/core/runners/distributed-execution/distributed-execution.runner.js +118 -1
- package/lib/core/runners/distributed-execution/process-task.js +45 -1
- package/lib/core/runners/distributed-execution/process-tasks.js +67 -1
- package/lib/core/runners/distributed-execution/split-task-graph-into-stages.js +37 -1
- package/lib/core/runners/distributed-execution/task-graph-creator.js +100 -1
- package/lib/utilities/environment.js +8 -2
- package/lib/utilities/environment.js.map +1 -1
- package/lib/utilities/is-private-cloud.d.ts +1 -0
- package/lib/utilities/is-private-cloud.js +30 -0
- package/lib/utilities/is-private-cloud.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1,67 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.processTasks = void 0;
|
|
13
|
+
const create_unchanged_value_timeout_1 = require("../../../utilities/create-unchanged-value-timeout");
|
|
14
|
+
const environment_1 = require("../../../utilities/environment");
|
|
15
|
+
const waiter_1 = require("../../../utilities/waiter");
|
|
16
|
+
const process_task_1 = require("./process-task");
|
|
17
|
+
const { output } = require('../../../utilities/nx-imports');
|
|
18
|
+
function processTasks(api, dteArtifactStorage, executionId, tasks) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
const processedTasks = {};
|
|
21
|
+
const failIfNumberOfCompletedTasksDoesNotChangeAfterTimeout = (0, create_unchanged_value_timeout_1.createUnchangedValueTimeout)({
|
|
22
|
+
title: `No new completed tasks after ${environment_1.NO_COMPLETED_TASKS_TIMEOUT / 1000} seconds.`,
|
|
23
|
+
timeout: environment_1.NO_COMPLETED_TASKS_TIMEOUT,
|
|
24
|
+
});
|
|
25
|
+
const waiter = new waiter_1.Waiter();
|
|
26
|
+
while (true) {
|
|
27
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
28
|
+
output.note({
|
|
29
|
+
title: 'Waiting...',
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
yield waiter.wait();
|
|
33
|
+
const r = yield api.status(executionId);
|
|
34
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
35
|
+
output.note({
|
|
36
|
+
title: `Status update`,
|
|
37
|
+
bodyLines: [
|
|
38
|
+
`executionId: ${executionId}`,
|
|
39
|
+
`executionStatus: ${r.executionStatus}`,
|
|
40
|
+
`number of completed tasks: ${r.completedTasks.length}`,
|
|
41
|
+
`error: ${r.criticalErrorMessage}`,
|
|
42
|
+
],
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
if (r.criticalErrorMessage) {
|
|
46
|
+
output.error({
|
|
47
|
+
title: 'Distributed Execution Terminated',
|
|
48
|
+
bodyLines: ['Error:', r.criticalErrorMessage],
|
|
49
|
+
});
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
failIfNumberOfCompletedTasksDoesNotChangeAfterTimeout(r.completedTasks.length);
|
|
53
|
+
for (const t of r.completedTasks) {
|
|
54
|
+
if (processedTasks[t.taskId])
|
|
55
|
+
continue;
|
|
56
|
+
yield (0, process_task_1.processTask)(dteArtifactStorage, tasks, t);
|
|
57
|
+
waiter.reset();
|
|
58
|
+
processedTasks[t.taskId] = true;
|
|
59
|
+
}
|
|
60
|
+
if (r.executionStatus === 'COMPLETED') {
|
|
61
|
+
return { commandStatus: r.commandStatus, runUrl: r.runUrl };
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
exports.processTasks = processTasks;
|
|
67
|
+
//# sourceMappingURL=process-tasks.js.map
|
|
@@ -1 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.splitTasksIntoStages = void 0;
|
|
4
|
+
function splitTasksIntoStages(taskGraph) {
|
|
5
|
+
const stages = [];
|
|
6
|
+
const notStagedTaskIds = new Set(Object.values(taskGraph.tasks).map((t) => t.id));
|
|
7
|
+
let stageIndex = 0;
|
|
8
|
+
// Loop through tasks and try to stage them. As tasks are staged, they are removed from the loop
|
|
9
|
+
while (notStagedTaskIds.size > 0) {
|
|
10
|
+
const currentStage = (stages[stageIndex] = []);
|
|
11
|
+
for (const taskId of notStagedTaskIds) {
|
|
12
|
+
let ready = true;
|
|
13
|
+
for (const dependency of taskGraph.dependencies[taskId]) {
|
|
14
|
+
if (notStagedTaskIds.has(dependency)) {
|
|
15
|
+
// dependency has not been staged yet, this task is not ready to be staged.
|
|
16
|
+
ready = false;
|
|
17
|
+
break;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
// Some dependency still has not been staged, skip it for now, it will be processed again
|
|
21
|
+
if (!ready) {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
// All the dependencies have been staged, let's stage it.
|
|
25
|
+
const task = taskGraph.tasks[taskId];
|
|
26
|
+
currentStage.push(task);
|
|
27
|
+
}
|
|
28
|
+
// Remove the entire new stage of tasks from the list
|
|
29
|
+
for (const task of currentStage) {
|
|
30
|
+
notStagedTaskIds.delete(task.id);
|
|
31
|
+
}
|
|
32
|
+
stageIndex++;
|
|
33
|
+
}
|
|
34
|
+
return stages;
|
|
35
|
+
}
|
|
36
|
+
exports.splitTasksIntoStages = splitTasksIntoStages;
|
|
37
|
+
//# sourceMappingURL=split-task-graph-into-stages.js.map
|
|
@@ -1 +1,100 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskGraphCreator = exports.createTaskGraphCompat = void 0;
|
|
4
|
+
const stripJsonComments = require("strip-json-comments");
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const { getDependencyConfigs, workspaceRoot, } = require('../../../utilities/nx-imports');
|
|
7
|
+
function createTaskGraphCompat(options, projectGraph, tasks) {
|
|
8
|
+
const nxjson = JSON.parse(stripJsonComments((0, fs_1.readFileSync)(`${workspaceRoot}/nx.json`).toString()));
|
|
9
|
+
return new TaskGraphCreator(projectGraph, getDefaultDependencyConfigs(nxjson, options)).createTaskGraph(tasks);
|
|
10
|
+
}
|
|
11
|
+
exports.createTaskGraphCompat = createTaskGraphCompat;
|
|
12
|
+
function getDefaultDependencyConfigs(nxJson, runnerOptions) {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
const defaults = (_a = nxJson.targetDependencies) !== null && _a !== void 0 ? _a : {};
|
|
15
|
+
const strictlyOrderedTargets = runnerOptions
|
|
16
|
+
? (_b = runnerOptions.strictlyOrderedTargets) !== null && _b !== void 0 ? _b : ['build']
|
|
17
|
+
: [];
|
|
18
|
+
// Strictly Ordered Targets depend on their dependencies
|
|
19
|
+
for (const target of strictlyOrderedTargets) {
|
|
20
|
+
defaults[target] = defaults[target] || [];
|
|
21
|
+
defaults[target].push({
|
|
22
|
+
target,
|
|
23
|
+
projects: 'dependencies',
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return defaults;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* This is only used for versions of Nx prior to 14 where the task graph
|
|
30
|
+
* wasn't part of the context so we have to recreate it
|
|
31
|
+
*/
|
|
32
|
+
class TaskGraphCreator {
|
|
33
|
+
constructor(projectGraph, defaultTargetDependencies) {
|
|
34
|
+
this.projectGraph = projectGraph;
|
|
35
|
+
this.defaultTargetDependencies = defaultTargetDependencies;
|
|
36
|
+
}
|
|
37
|
+
createTaskGraph(tasks) {
|
|
38
|
+
const graph = {
|
|
39
|
+
roots: [],
|
|
40
|
+
tasks: {},
|
|
41
|
+
dependencies: {},
|
|
42
|
+
};
|
|
43
|
+
for (const task of tasks) {
|
|
44
|
+
this.addTaskToGraph(task, graph);
|
|
45
|
+
const dependencyConfigs = getDependencyConfigs(task.target, this.defaultTargetDependencies, this.projectGraph);
|
|
46
|
+
if (!dependencyConfigs) {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
this.addTaskDependencies(task, dependencyConfigs, tasks, graph);
|
|
50
|
+
}
|
|
51
|
+
graph.roots = Object.keys(graph.dependencies).filter((k) => graph.dependencies[k].length === 0);
|
|
52
|
+
return graph;
|
|
53
|
+
}
|
|
54
|
+
addTaskDependencies(task, dependencyConfigs, tasks, graph) {
|
|
55
|
+
for (const dependencyConfig of dependencyConfigs) {
|
|
56
|
+
if (dependencyConfig.projects === 'self') {
|
|
57
|
+
for (const t of tasks) {
|
|
58
|
+
if (t.target.project === task.target.project &&
|
|
59
|
+
t.target.target === dependencyConfig.target) {
|
|
60
|
+
graph.dependencies[task.id].push(t.id);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else if (dependencyConfig.projects === 'dependencies') {
|
|
65
|
+
const seen = new Set();
|
|
66
|
+
this.addDependencies(task.target.project, dependencyConfig.target, tasks, graph, task.id, seen);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
addDependencies(project, target, tasks, graph, taskId, seen) {
|
|
71
|
+
seen.add(project);
|
|
72
|
+
const dependencies = this.projectGraph.dependencies[project];
|
|
73
|
+
if (dependencies) {
|
|
74
|
+
const projectDependencies = dependencies.map((dependency) => dependency.target);
|
|
75
|
+
for (const projectDependency of projectDependencies) {
|
|
76
|
+
if (seen.has(projectDependency)) {
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const dependency = this.findTask({ project: projectDependency, target }, tasks);
|
|
80
|
+
if (dependency) {
|
|
81
|
+
if (graph.dependencies[taskId].indexOf(dependency.id) === -1) {
|
|
82
|
+
graph.dependencies[taskId].push(dependency.id);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
this.addDependencies(projectDependency, target, tasks, graph, taskId, seen);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
findTask({ project, target }, tasks) {
|
|
92
|
+
return tasks.find((t) => t.target.project === project && t.target.target === target);
|
|
93
|
+
}
|
|
94
|
+
addTaskToGraph(task, graph) {
|
|
95
|
+
graph.tasks[task.id] = task;
|
|
96
|
+
graph.dependencies[task.id] = [];
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.TaskGraphCreator = TaskGraphCreator;
|
|
100
|
+
//# sourceMappingURL=task-graph-creator.js.map
|
|
@@ -6,6 +6,7 @@ const dotenv = require("dotenv");
|
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const is_ci_1 = require("./is-ci");
|
|
9
|
+
const is_private_cloud_1 = require("./is-private-cloud");
|
|
9
10
|
const { workspaceRoot } = require('./nx-imports');
|
|
10
11
|
// Set once
|
|
11
12
|
exports.NX_DEFAULT_CACHE_LOCATION = './node_modules/.cache/nx';
|
|
@@ -77,6 +78,12 @@ function loadEnvVars() {
|
|
|
77
78
|
parsed.NX_CLOUD_NO_TIMEOUTS === 'true';
|
|
78
79
|
}
|
|
79
80
|
function getCIExecutionId() {
|
|
81
|
+
if ((0, is_private_cloud_1.isConnectedToPrivateCloud)())
|
|
82
|
+
return undefined;
|
|
83
|
+
return _ciExecutionId();
|
|
84
|
+
}
|
|
85
|
+
exports.getCIExecutionId = getCIExecutionId;
|
|
86
|
+
function _ciExecutionId() {
|
|
80
87
|
if (process.env.NX_CI_EXECUTION_ID !== undefined) {
|
|
81
88
|
return process.env.NX_CI_EXECUTION_ID;
|
|
82
89
|
}
|
|
@@ -111,7 +118,6 @@ function getCIExecutionId() {
|
|
|
111
118
|
}
|
|
112
119
|
return null;
|
|
113
120
|
}
|
|
114
|
-
exports.getCIExecutionId = getCIExecutionId;
|
|
115
121
|
function getCIExecutionEnv() {
|
|
116
122
|
var _a;
|
|
117
123
|
return (_a = process.env.NX_CI_EXECUTION_ENV) !== null && _a !== void 0 ? _a : '';
|
|
@@ -121,7 +127,7 @@ function getRunGroup() {
|
|
|
121
127
|
if (process.env.NX_RUN_GROUP !== undefined) {
|
|
122
128
|
return process.env.NX_RUN_GROUP;
|
|
123
129
|
}
|
|
124
|
-
const ciExecutionId =
|
|
130
|
+
const ciExecutionId = _ciExecutionId();
|
|
125
131
|
if (ciExecutionId) {
|
|
126
132
|
return `${ciExecutionId}${getCIExecutionEnv()}`;
|
|
127
133
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../../../../libs/nx-packages/nx-cloud/lib/utilities/environment.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../../../../libs/nx-packages/nx-cloud/lib/utilities/environment.ts"],"names":[],"mappings":";;;AAAA,iDAAuC;AACvC,iCAAiC;AACjC,2BAAgC;AAEhC,+BAAiC;AAIjC,mCAA6B;AAC7B,yDAA6D;AAE7D,MAAM,EAAC,aAAa,EAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAEhD,WAAW;AACE,QAAA,yBAAyB,GAAG,0BAA0B,CAAC;AACvD,QAAA,iBAAiB,GAAG,OAAO,CAAC;AAC5B,QAAA,mBAAmB,GAAG,OAAO,CAAC,GAAG,CAAC,yBAAyB;IACtE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC;IAC/C,CAAC,CAAC,OAAO,CAAC,CAAC,aAAa;AACb,QAAA,0BAA0B,GAAG,OAAO,CAAC,GAAG;KAClD,gCAAgC;IACjC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC;IACtD,CAAC,CAAC,OAAO,CAAC,CAAC,aAAa;AACb,QAAA,mBAAmB,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAC1C,QAAA,yBAAyB,GACpC,OA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AAC,mBAAmB,mCAC/B,OAAO,CAAC,GAAG,CAAC,iBAAiB,mCAC7B,SAAS,CAAC;IACZ,MAAM,OAAO,GAAG,IAAA,YAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC5C,MAAM,IAAI,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IAClD,MAAM,GAAG,GAAG,GAAG,OAAO,IAAI,IAAI,EAAE,CAAC;IACjC,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;AACrC,CAAC;AATD,oCASC;AAED,SAAgB,mBAAmB,CAAC,OAA+B;IACjE,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB;QAAE,OAAO,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;IAC1E,IAAI,OAAO,CAAC,cAAc;QAAE,OAAO,OAAO,CAAC,cAAc,CAAC;IAC1D,OAAO,iCAAyB,CAAC;AACnC,CAAC;AAJD,kDAIC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isConnectedToPrivateCloud(): boolean;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isConnectedToPrivateCloud = void 0;
|
|
4
|
+
const stripJsonComments = require("strip-json-comments");
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const { workspaceRoot } = require("./nx-imports");
|
|
8
|
+
function isConnectedToPrivateCloud() {
|
|
9
|
+
const options = readOptions();
|
|
10
|
+
if (!options.url)
|
|
11
|
+
return false;
|
|
12
|
+
if (options.url.endsWith('snapshot.nx.app'))
|
|
13
|
+
return true;
|
|
14
|
+
if (options.url.endsWith('.nx.app'))
|
|
15
|
+
return false;
|
|
16
|
+
if (options.url.indexOf('localhost') > -1)
|
|
17
|
+
return false;
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
exports.isConnectedToPrivateCloud = isConnectedToPrivateCloud;
|
|
21
|
+
function readOptions() {
|
|
22
|
+
var _a, _b, _c;
|
|
23
|
+
try {
|
|
24
|
+
return (_c = (_b = (_a = JSON.parse(stripJsonComments((0, fs_1.readFileSync)((0, path_1.join)(workspaceRoot, 'nx.json')).toString()))) === null || _a === void 0 ? void 0 : _a.tasksRunnerOptions) === null || _b === void 0 ? void 0 : _b.default) === null || _c === void 0 ? void 0 : _c.options;
|
|
25
|
+
}
|
|
26
|
+
catch (e) {
|
|
27
|
+
return {};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=is-private-cloud.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-private-cloud.js","sourceRoot":"","sources":["../../../../../../libs/nx-packages/nx-cloud/lib/utilities/is-private-cloud.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AACzD,2BAAgC;AAEhC,+BAA0B;AAE1B,MAAM,EAAC,aAAa,EAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAEhD,SAAgB,yBAAyB;IACrC,MAAM,OAAO,GAAG,WAAW,EAAE,CAAC;IAC9B,IAAI,CAAC,OAAO,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IAC/B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,iBAAiB,CAAC;QAAE,OAAO,IAAI,CAAC;IACzD,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC;QAAE,OAAO,KAAK,CAAC;IAClD,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACxD,OAAO,IAAI,CAAC;AAChB,CAAC;AAPD,8DAOC;AAED,SAAS,WAAW;;IAChB,IAAI;QACA,OAAO,MAAA,MAAA,MAAA,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAA,iBAAY,EAAC,IAAA,WAAI,EAAC,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,0CACvF,kBAAkB,0CAAE,OAAO,0CAAE,OAAO,CAAC;KAC9C;IAAC,OAAO,CAAC,EAAE;QACR,OAAO,EAA4B,CAAC;KACvC;AACL,CAAC"}
|