@milaboratories/pl-middle-layer 1.39.5 → 1.39.7
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/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1164 -1055
- package/dist/index.mjs.map +1 -1
- package/dist/middle_layer/project.d.ts +13 -0
- package/dist/middle_layer/project.d.ts.map +1 -1
- package/dist/model/project_model.d.ts +1 -0
- package/dist/model/project_model.d.ts.map +1 -1
- package/dist/mutator/project.d.ts +15 -2
- package/dist/mutator/project.d.ts.map +1 -1
- package/package.json +10 -10
- package/src/middle_layer/project.ts +26 -0
- package/src/model/project_model.ts +11 -0
- package/src/mutator/project.ts +146 -32
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var uo = Object.defineProperty;
|
|
2
|
+
var qr = (s, e) => (e = Symbol[s]) ? e : Symbol.for("Symbol." + s), Kr = (s) => {
|
|
3
3
|
throw TypeError(s);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var po = (s, e, t) => e in s ? uo(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
6
|
+
var S = (s, e, t) => po(s, typeof e != "symbol" ? e + "" : e, t);
|
|
7
|
+
var Hr = (s, e, t) => {
|
|
8
8
|
if (e != null) {
|
|
9
|
-
typeof e != "object" && typeof e != "function" &&
|
|
9
|
+
typeof e != "object" && typeof e != "function" && Kr("Object expected");
|
|
10
10
|
var r, n;
|
|
11
|
-
t && (r = e[
|
|
11
|
+
t && (r = e[qr("asyncDispose")]), r === void 0 && (r = e[qr("dispose")], t && (n = r)), typeof r != "function" && Kr("Object not disposable"), n && (r = function() {
|
|
12
12
|
try {
|
|
13
13
|
n.call(this);
|
|
14
14
|
} catch (i) {
|
|
@@ -17,7 +17,7 @@ var qr = (s, e, t) => {
|
|
|
17
17
|
}), s.push([t, r, e]);
|
|
18
18
|
} else t && s.push([t]);
|
|
19
19
|
return e;
|
|
20
|
-
},
|
|
20
|
+
}, Wr = (s, e, t) => {
|
|
21
21
|
var r = typeof SuppressedError == "function" ? SuppressedError : function(o, a, c, l) {
|
|
22
22
|
return l = Error(c), l.name = "SuppressedError", l.error = o, l.suppressed = a, l;
|
|
23
23
|
}, n = (o) => e = t ? new r(o, e, "An error was suppressed during disposal") : (t = !0, o), i = (o) => {
|
|
@@ -32,111 +32,111 @@ var qr = (s, e, t) => {
|
|
|
32
32
|
};
|
|
33
33
|
return i();
|
|
34
34
|
};
|
|
35
|
-
import { extractConfig as Ce, UiError as
|
|
35
|
+
import { extractConfig as Ce, UiError as zr, mapValueInVOE as gn, executePSpecPredicate as fo, mapPObjectData as me, mapPTableDef as wr, isDataInfo as mn, mapDataInfo as vn, checkBlockFlag as ho, JsRenderInternal as go, isConfigLambda as yn, extractCodeWithInfo as ft, DefaultNavigationState as mo, PFrameDriverError as ve, isPFrameDriverError as vo, ensureError as nt, extractAllColumns as yo, isAbortError as wo, RuntimeCapabilities as So } from "@platforma-sdk/model";
|
|
36
36
|
export * from "@platforma-sdk/model";
|
|
37
|
-
import { StableChannel as Ne, AnyChannel as Be, InitialBlockSettings as
|
|
37
|
+
import { StableChannel as Ne, AnyChannel as Be, InitialBlockSettings as Xr, blockPackIdToString as bo } from "@milaboratories/pl-model-middle-layer";
|
|
38
38
|
export * from "@milaboratories/pl-model-middle-layer";
|
|
39
39
|
export * from "@milaboratories/pl-deployments";
|
|
40
|
-
import { request as
|
|
41
|
-
import { RegistryV1 as
|
|
42
|
-
import
|
|
43
|
-
import * as
|
|
40
|
+
import { request as Fr, RetryAgent as ko } from "undici";
|
|
41
|
+
import { RegistryV1 as ye, tryLoadPackDescription as Sr, BlockPackMetaEmbedAbsoluteBytes as Ro, RegistryV2Reader as Co, folderReaderByUrl as Eo, loadPackDescription as Yr } from "@platforma-sdk/block-tools";
|
|
42
|
+
import ne from "node:fs";
|
|
43
|
+
import * as Po from "node:path";
|
|
44
44
|
import _ from "node:path";
|
|
45
|
-
import
|
|
46
|
-
import { assertNever as Y, notEmpty as N, canonicalJsonBytes as
|
|
47
|
-
import * as
|
|
45
|
+
import Oo from "yaml";
|
|
46
|
+
import { assertNever as Y, notEmpty as N, canonicalJsonBytes as Fo, canonicalJsonGzBytes as To, cachedDeserialize as Ue, cachedDecode as kt, deepFreeze as Qr, ConsoleLoggerAdapter as wn, ConcurrencyLimitingExecutor as Zr, emptyDir as Io, HmacSha256Signer as Tr, BlockEventDispatcher as $o } from "@milaboratories/ts-helpers";
|
|
47
|
+
import * as Sn from "node:fs/promises";
|
|
48
48
|
import at from "node:fs/promises";
|
|
49
|
-
import { tryResolve as
|
|
50
|
-
import { resourceTypesEqual as pe, field as J, Pl as D, PlClient as bn, isResourceId as
|
|
49
|
+
import { tryResolve as Ao } from "@milaboratories/resolve-helper";
|
|
50
|
+
import { resourceTypesEqual as pe, field as J, Pl as D, PlClient as bn, isResourceId as es, isNullResourceId as Me, isResource as Lo, isResourceRef as Do, isNotNullResourceId as br, ensureResourceIdNotNull as ct, resourceType as We, resourceTypeToString as No, stringifyWithResourceId as Ye, resourceIdToString as Pe, isNotFoundError as Bo, isTimeoutOrCancelError as jo, toGlobalResourceId as xo, UnauthenticatedPlClient as kn, toGlobalFieldId as Vo, poll as Uo, ContinuePolling as Mo, plAddressToConfig as Jo } from "@milaboratories/pl-client";
|
|
51
51
|
export * from "@milaboratories/pl-client";
|
|
52
|
-
import { SynchronizedTreeState as
|
|
53
|
-
import { Computable as K, ChangeSource as
|
|
54
|
-
import { randomUUID as
|
|
55
|
-
import { PlTemplateV1 as X, PlTemplateOverrideV1 as Ee, PlTemplateLibV1 as fe, PlTemplateSoftwareV1 as le, parseTemplate as
|
|
52
|
+
import { SynchronizedTreeState as Rn, treeDumpStats as Go, isPlTreeNodeAccessor as _o } from "@milaboratories/pl-tree";
|
|
53
|
+
import { Computable as K, ChangeSource as ts, PollComputablePool as qo, WatchableValue as Ko } from "@milaboratories/computable";
|
|
54
|
+
import { randomUUID as he, createHash as Fe, randomBytes as Ho } from "node:crypto";
|
|
55
|
+
import { PlTemplateV1 as X, PlTemplateOverrideV1 as Ee, PlTemplateLibV1 as fe, PlTemplateSoftwareV1 as le, parseTemplate as Wo } from "@milaboratories/pl-model-backend";
|
|
56
56
|
import { LRUCache as lt } from "lru-cache";
|
|
57
|
-
import { Worker as
|
|
58
|
-
import
|
|
57
|
+
import { Worker as zo } from "node:worker_threads";
|
|
58
|
+
import Cn from "denque";
|
|
59
59
|
import { Templates as we } from "@platforma-sdk/workflow-tengo";
|
|
60
60
|
import te from "canonicalize";
|
|
61
|
-
import
|
|
62
|
-
import { Scope as Je, errors as
|
|
63
|
-
import { PlQuickJSError as
|
|
64
|
-
import * as
|
|
65
|
-
import { setTimeout as
|
|
66
|
-
import { createDownloadClient as
|
|
67
|
-
import { PFrame as
|
|
68
|
-
import { channel as
|
|
69
|
-
import { text as
|
|
70
|
-
import
|
|
71
|
-
async function
|
|
61
|
+
import Xo from "node:assert";
|
|
62
|
+
import { Scope as Je, errors as Yo, getQuickJS as Qo } from "quickjs-emscripten";
|
|
63
|
+
import { PlQuickJSError as Zo } from "@milaboratories/pl-errors";
|
|
64
|
+
import * as rs from "remeda";
|
|
65
|
+
import { setTimeout as En } from "node:timers/promises";
|
|
66
|
+
import { createDownloadClient as Pn, createLogsClient as ei, createUploadBlobClient as On, createUploadProgressClient as ti, DownloadDriver as ri, DownloadBlobToURLDriver as si, UploadDriver as ni, LogsStreamDriver as oi, LogsDriver as ii, LsDriver as Fn, DownloadUrlDriver as ai, uploadBlob as Tn, ImportFileHandleUploadData as In, isUpload as ci, isSignMatch as li } from "@milaboratories/pl-drivers";
|
|
67
|
+
import { PFrame as $n } from "@milaboratories/pframes-rs-node";
|
|
68
|
+
import { channel as ui } from "node:diagnostics_channel";
|
|
69
|
+
import { text as di } from "node:stream/consumers";
|
|
70
|
+
import An from "node:os";
|
|
71
|
+
async function ss(s) {
|
|
72
72
|
try {
|
|
73
|
-
return await
|
|
73
|
+
return await Sn.stat(s, { bigint: !0 });
|
|
74
74
|
} catch (e) {
|
|
75
75
|
if (e.code === "ENOENT")
|
|
76
76
|
return;
|
|
77
77
|
throw e;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
const
|
|
81
|
-
Fr,
|
|
80
|
+
const pi = [ye.PlPackageYamlConfigFile], fi = [ye.PlPackageJsonConfigFile], Ir = ["backend", "dist", "tengo", "tpl", "main.plj.gz"], $r = ["config", "dist", "config.json"], Ln = ["frontend", "dist"], ns = "block-model/dist/config.json", hi = "block-ui/package.json", gi = [
|
|
82
81
|
Ir,
|
|
83
|
-
|
|
82
|
+
$r,
|
|
84
83
|
pi,
|
|
85
|
-
|
|
84
|
+
fi,
|
|
85
|
+
Ln
|
|
86
86
|
];
|
|
87
|
-
async function
|
|
88
|
-
return await
|
|
87
|
+
async function mi(s) {
|
|
88
|
+
return await ss(_.join(s, ...$r)) !== void 0 || await ss(_.join(s, ...Ir)) !== void 0;
|
|
89
89
|
}
|
|
90
90
|
function Rt(s, e) {
|
|
91
|
-
const t =
|
|
91
|
+
const t = Ao(s, e);
|
|
92
92
|
if (t === void 0) throw new Error(`Can't resolve ${e} against ${s}`);
|
|
93
93
|
return t;
|
|
94
94
|
}
|
|
95
|
-
async function
|
|
96
|
-
if (_.isAbsolute(s) || (s = _.resolve(s)), await
|
|
95
|
+
async function os(s, e) {
|
|
96
|
+
if (_.isAbsolute(s) || (s = _.resolve(s)), await mi(s))
|
|
97
97
|
return {
|
|
98
|
-
workflow: _.join(s, ...
|
|
99
|
-
config: _.join(s,
|
|
100
|
-
ui: _.join(s, ...
|
|
98
|
+
workflow: _.join(s, ...Ir),
|
|
99
|
+
config: _.join(s, ...$r),
|
|
100
|
+
ui: _.join(s, ...Ln)
|
|
101
101
|
};
|
|
102
102
|
{
|
|
103
|
-
const t = Rt(s,
|
|
103
|
+
const t = Rt(s, ns), r = Rt(s, ns), n = Rt(s, hi);
|
|
104
104
|
return { workflow: t, config: r, ui: _.resolve(n, "..", "dist") };
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
async function
|
|
107
|
+
async function vi(s) {
|
|
108
108
|
try {
|
|
109
|
-
return await
|
|
109
|
+
return await ne.promises.readFile(s, "utf8");
|
|
110
110
|
} catch (e) {
|
|
111
111
|
if (e instanceof Error && "code" in e && e.code === "ENOENT")
|
|
112
112
|
return;
|
|
113
113
|
throw e;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
async function
|
|
116
|
+
async function yi(s) {
|
|
117
117
|
try {
|
|
118
|
-
return await
|
|
118
|
+
return await ne.promises.stat(s, { bigint: !0 });
|
|
119
119
|
} catch (e) {
|
|
120
120
|
if (e instanceof Error && "code" in e && e.code === "ENOENT")
|
|
121
121
|
return;
|
|
122
122
|
throw e;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
async function
|
|
125
|
+
async function Dn(s) {
|
|
126
126
|
let e = 0n;
|
|
127
|
-
for (const t of
|
|
128
|
-
const r = _.join(s, ...t), n = await
|
|
127
|
+
for (const t of gi) {
|
|
128
|
+
const r = _.join(s, ...t), n = await yi(r);
|
|
129
129
|
n !== void 0 && e < n.mtimeNs && (e = n.mtimeNs);
|
|
130
130
|
}
|
|
131
131
|
return e.toString();
|
|
132
132
|
}
|
|
133
|
-
async function
|
|
134
|
-
const e = await
|
|
133
|
+
async function Ar(s) {
|
|
134
|
+
const e = await ne.promises.stat(s.components.workflow.main.file, {
|
|
135
135
|
bigint: !0
|
|
136
|
-
}), t = await
|
|
136
|
+
}), t = await ne.promises.stat(s.components.model.file, { bigint: !0 });
|
|
137
137
|
return (e.mtimeNs > t.mtimeNs ? e.mtimeNs : t.mtimeNs).toString();
|
|
138
138
|
}
|
|
139
|
-
class
|
|
139
|
+
class ou {
|
|
140
140
|
constructor(e, t, r) {
|
|
141
141
|
this.v2Provider = e, this.registries = t, this.http = r;
|
|
142
142
|
}
|
|
@@ -144,8 +144,8 @@ class nu {
|
|
|
144
144
|
const t = [], r = e.spec;
|
|
145
145
|
switch (r.type) {
|
|
146
146
|
case "remote-v1": {
|
|
147
|
-
const n = this.http !== void 0 ? { dispatcher: this.http } : {}, o = await (await
|
|
148
|
-
`${r.url}/${
|
|
147
|
+
const n = this.http !== void 0 ? { dispatcher: this.http } : {}, o = await (await Fr(
|
|
148
|
+
`${r.url}/${ye.GlobalOverviewPath}`,
|
|
149
149
|
n
|
|
150
150
|
)).body.json();
|
|
151
151
|
for (const a of o) {
|
|
@@ -202,13 +202,13 @@ class nu {
|
|
|
202
202
|
// registryId: regEntry.id,
|
|
203
203
|
// },
|
|
204
204
|
case "local-dev":
|
|
205
|
-
for (const n of await
|
|
205
|
+
for (const n of await ne.promises.readdir(r.path, { withFileTypes: !0 })) {
|
|
206
206
|
if (!n.isDirectory()) continue;
|
|
207
|
-
const i = _.join(r.path, n.name), o = await
|
|
208
|
-
_.join(i,
|
|
207
|
+
const i = _.join(r.path, n.name), o = await vi(
|
|
208
|
+
_.join(i, ye.PlPackageYamlConfigFile)
|
|
209
209
|
);
|
|
210
210
|
if (o !== void 0) {
|
|
211
|
-
const a =
|
|
211
|
+
const a = ye.PlPackageConfigData.parse(Oo.parse(o)), c = await Dn(i), l = {
|
|
212
212
|
organization: a.organization,
|
|
213
213
|
name: a.package,
|
|
214
214
|
version: "DEV"
|
|
@@ -238,15 +238,15 @@ class nu {
|
|
|
238
238
|
allVersions: []
|
|
239
239
|
});
|
|
240
240
|
} else {
|
|
241
|
-
let a = i, c = await
|
|
241
|
+
let a = i, c = await Sr(a);
|
|
242
242
|
if (c === void 0) {
|
|
243
243
|
for (const l of ["block", "meta"])
|
|
244
|
-
if (a = _.join(i, l), c = await
|
|
244
|
+
if (a = _.join(i, l), c = await Sr(a), c !== void 0) break;
|
|
245
245
|
}
|
|
246
246
|
if (c !== void 0) {
|
|
247
|
-
const l = await
|
|
247
|
+
const l = await Ar(c), u = {
|
|
248
248
|
id: c.id,
|
|
249
|
-
meta: await
|
|
249
|
+
meta: await Ro.parseAsync(c.meta),
|
|
250
250
|
featureFlags: c.featureFlags,
|
|
251
251
|
spec: {
|
|
252
252
|
type: "dev-v2",
|
|
@@ -288,60 +288,70 @@ class nu {
|
|
|
288
288
|
return await this.v2Provider.getRegistry(n.url).getSpecificOverview(t, r);
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
|
-
class
|
|
291
|
+
class wi {
|
|
292
292
|
constructor(e) {
|
|
293
|
-
|
|
293
|
+
S(this, "registries", /* @__PURE__ */ new Map());
|
|
294
294
|
this.http = e;
|
|
295
295
|
}
|
|
296
296
|
getRegistry(e) {
|
|
297
297
|
const t = this.registries.get(e);
|
|
298
298
|
if (t) return t;
|
|
299
|
-
const r = new
|
|
299
|
+
const r = new Co(Eo(e, this.http));
|
|
300
300
|
return this.registries.set(e, r), r;
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
const
|
|
303
|
+
const iu = {
|
|
304
304
|
type: "remote-v2",
|
|
305
305
|
url: "https://blocks.pl-open.science/"
|
|
306
|
-
},
|
|
306
|
+
}, au = {
|
|
307
307
|
type: "remote-v1",
|
|
308
308
|
url: "https://block.registry.platforma.bio/releases"
|
|
309
|
-
},
|
|
309
|
+
}, cu = {
|
|
310
310
|
type: "remote-v1",
|
|
311
311
|
url: "https://block.registry.platforma.bio/dev"
|
|
312
|
-
},
|
|
312
|
+
}, Si = {
|
|
313
313
|
groups: [{ id: "default", label: "Default", blocks: [] }]
|
|
314
314
|
}, bi = {
|
|
315
315
|
stagingRefreshTimestamp: 0,
|
|
316
316
|
blocksInLimbo: []
|
|
317
|
-
},
|
|
317
|
+
}, ki = {
|
|
318
318
|
label: "New Project"
|
|
319
|
-
},
|
|
320
|
-
function br(s) {
|
|
321
|
-
return `${Ri}${s}`;
|
|
322
|
-
}
|
|
323
|
-
const Sr = "ProjectStructureAuthor", Ci = "__serviceTemplate_";
|
|
319
|
+
}, Ri = { name: "UserProject", version: "2" }, ut = "SchemaVersion", Ge = "2", Lr = "ProjectCreated", _e = "ProjectLastModified", qe = "ProjectMeta", de = "ProjectStructure", dt = "BlockRenderingState", Ci = "BlockArgsAuthor/";
|
|
324
320
|
function kr(s) {
|
|
325
321
|
return `${Ci}${s}`;
|
|
326
322
|
}
|
|
323
|
+
const Rr = "ProjectStructureAuthor", Ei = "__serviceTemplate_";
|
|
324
|
+
function Cr(s) {
|
|
325
|
+
return `${Ei}${s}`;
|
|
326
|
+
}
|
|
327
|
+
const Ct = /* @__PURE__ */ new Set([
|
|
328
|
+
"blockPack",
|
|
329
|
+
"blockSettings",
|
|
330
|
+
"uiState",
|
|
331
|
+
"prodArgs",
|
|
332
|
+
"currentArgs",
|
|
333
|
+
"prodCtx",
|
|
334
|
+
"prodUiCtx",
|
|
335
|
+
"prodOutput"
|
|
336
|
+
]);
|
|
327
337
|
function q(s, e) {
|
|
328
338
|
return `${s}-${e}`;
|
|
329
339
|
}
|
|
330
|
-
const
|
|
331
|
-
function
|
|
332
|
-
const e = s.match(
|
|
340
|
+
const Pi = /^(?<blockId>.*)-(?<fieldName>blockPack|blockSettings|uiState|prodArgs|currentArgs|prodCtx|prodUiCtx|prodOutput|prodCtxPrevious|prodUiCtxPrevious|prodOutputPrevious|stagingCtx|stagingUiCtx|stagingOutput|stagingCtxPrevious|stagingUiCtxPrevious|stagingOutputPrevious)$/;
|
|
341
|
+
function Oi(s) {
|
|
342
|
+
const e = s.match(Pi);
|
|
333
343
|
if (e === null) return;
|
|
334
344
|
const { blockId: t, fieldName: r } = e.groups;
|
|
335
345
|
return { blockId: t, fieldName: r };
|
|
336
346
|
}
|
|
337
|
-
const
|
|
347
|
+
const Fi = "projects", Nn = { name: "Projects", version: "1" }, Ti = (s) => pe(s.type, Nn) ? s.fields : [];
|
|
338
348
|
async function Ii(s, e, t, r) {
|
|
339
|
-
const n = await
|
|
349
|
+
const n = await Rn.init(
|
|
340
350
|
s,
|
|
341
351
|
e,
|
|
342
352
|
{
|
|
343
353
|
...r.ops.defaultTreeOptions,
|
|
344
|
-
pruning:
|
|
354
|
+
pruning: Ti
|
|
345
355
|
},
|
|
346
356
|
r.logger
|
|
347
357
|
);
|
|
@@ -352,7 +362,7 @@ async function Ii(s, e, t, r) {
|
|
|
352
362
|
for (const u of a.listDynamicFields()) {
|
|
353
363
|
const d = a.traverse(u);
|
|
354
364
|
if (d === void 0) continue;
|
|
355
|
-
const p = N(d.getKeyValueAsJson(qe)), f = N(d.getKeyValueAsJson(
|
|
365
|
+
const p = N(d.getKeyValueAsJson(qe)), f = N(d.getKeyValueAsJson(Lr)), v = N(d.getKeyValueAsJson(_e));
|
|
356
366
|
l.push({
|
|
357
367
|
id: u,
|
|
358
368
|
rid: d.id,
|
|
@@ -365,36 +375,36 @@ async function Ii(s, e, t, r) {
|
|
|
365
375
|
return l.sort((u) => -u.lastModified.valueOf()), l;
|
|
366
376
|
}).withStableType(), tree: n };
|
|
367
377
|
}
|
|
368
|
-
const
|
|
378
|
+
const $i = {
|
|
369
379
|
name: "EphRenderTemplate",
|
|
370
380
|
version: "1"
|
|
371
|
-
},
|
|
381
|
+
}, Ai = {
|
|
372
382
|
name: "RenderTemplate",
|
|
373
383
|
version: "1"
|
|
374
384
|
};
|
|
375
|
-
function
|
|
385
|
+
function Dr(s, e, t, r, n) {
|
|
376
386
|
if (n.length === 0) throw new Error("Zero output names provided");
|
|
377
|
-
const i = t ? s.createEphemeral(
|
|
387
|
+
const i = t ? s.createEphemeral($i) : s.createStruct(Ai), o = J(i, "template"), a = J(i, "inputs");
|
|
378
388
|
return s.createField(o, "Input", e), s.createField(a, "Input", D.createPlMap(s, r, t)), s.lockInputs(i), D.futureRecord(s, i, n, "Output", "outputs/");
|
|
379
389
|
}
|
|
380
|
-
const
|
|
381
|
-
function
|
|
382
|
-
return
|
|
390
|
+
const Li = { name: "BContextEnd", version: "1" }, Di = { name: "BContext", version: "1" }, Ni = "id", Bi = "parent/", ji = ["context", "result"];
|
|
391
|
+
function is(s, e, t) {
|
|
392
|
+
return Dr(s, e, !0, t, ji);
|
|
383
393
|
}
|
|
384
|
-
function
|
|
385
|
-
const e = s.createEphemeral(
|
|
394
|
+
function xi(s) {
|
|
395
|
+
const e = s.createEphemeral(Li);
|
|
386
396
|
return s.lock(e), e;
|
|
387
397
|
}
|
|
388
|
-
function
|
|
389
|
-
if (e.length === 0) return
|
|
398
|
+
function as(s, e) {
|
|
399
|
+
if (e.length === 0) return xi(s);
|
|
390
400
|
if (e.length === 1) return e[0];
|
|
391
|
-
const t = s.createEphemeral(
|
|
392
|
-
s.createField(J(t,
|
|
401
|
+
const t = s.createEphemeral(Di);
|
|
402
|
+
s.createField(J(t, Ni), "Input", D.createPlString(s, he()));
|
|
393
403
|
for (let r = 0; r < e.length; r++)
|
|
394
|
-
s.createField(J(t, `${
|
|
404
|
+
s.createField(J(t, `${Bi}${r}`), "Input", e[r]);
|
|
395
405
|
return s.lock(t), t;
|
|
396
406
|
}
|
|
397
|
-
function
|
|
407
|
+
function Bn(s, e) {
|
|
398
408
|
const t = /* @__PURE__ */ new Map(), r = (n, i, o) => {
|
|
399
409
|
const a = Fe("sha256");
|
|
400
410
|
i.updateCacheKey(n, a, o);
|
|
@@ -405,9 +415,9 @@ function Nn(s, e) {
|
|
|
405
415
|
}
|
|
406
416
|
return t.get(c);
|
|
407
417
|
};
|
|
408
|
-
return r(e.template,
|
|
418
|
+
return r(e.template, jn, e.hashToSource);
|
|
409
419
|
}
|
|
410
|
-
const
|
|
420
|
+
const cs = {
|
|
411
421
|
updateCacheKey(s, e, t) {
|
|
412
422
|
e.update(fe.type.name).update(fe.type.version).update(s.name).update(s.version).update(Oe(s.name, t, s.sourceHash));
|
|
413
423
|
},
|
|
@@ -425,12 +435,12 @@ const is = {
|
|
|
425
435
|
const n = le.fromV3Data(s, Oe(s.name, r, s.sourceHash)), i = e.createStruct(le.type, n.data);
|
|
426
436
|
return e.setKValue(i, le.metaNameKey, JSON.stringify(n.name)), e.lock(i), i;
|
|
427
437
|
}
|
|
428
|
-
},
|
|
438
|
+
}, jn = {
|
|
429
439
|
updateCacheKey(s, e, t) {
|
|
430
440
|
e.update(X.type.name).update(X.type.version).update(s.hashOverride ?? "no-override").update(s.name).update(s.version).update(Oe(s.name, t, s.sourceHash));
|
|
431
441
|
const r = (n) => (n.sort((i, o) => i[0] === o[0] ? 0 : i[0] < o[0] ? -1 : 1), n);
|
|
432
442
|
for (const [n, i] of r(Object.entries(s.libs ?? {})))
|
|
433
|
-
e.update("lib:" + n),
|
|
443
|
+
e.update("lib:" + n), cs.updateCacheKey(i, e, t);
|
|
434
444
|
for (const [n, i] of r(Object.entries(s.software ?? {})))
|
|
435
445
|
e.update("soft:" + n), Qe.updateCacheKey(i, e, t);
|
|
436
446
|
for (const [n, i] of r(Object.entries(s.assets ?? {})))
|
|
@@ -445,7 +455,7 @@ const is = {
|
|
|
445
455
|
);
|
|
446
456
|
for (const [a, c] of Object.entries(s.libs ?? {})) {
|
|
447
457
|
const l = X.libField(n, a);
|
|
448
|
-
e.createField(l, "Input"), e.setField(l, t(c,
|
|
458
|
+
e.createField(l, "Input"), e.setField(l, t(c, cs, r));
|
|
449
459
|
}
|
|
450
460
|
for (const [a, c] of Object.entries(s.software ?? {})) {
|
|
451
461
|
const l = X.swField(n, a);
|
|
@@ -457,7 +467,7 @@ const is = {
|
|
|
457
467
|
}
|
|
458
468
|
for (const [a, c] of Object.entries(s.templates ?? {})) {
|
|
459
469
|
const l = X.tplField(n, a);
|
|
460
|
-
e.createField(l, "Input"), e.setField(l, t(c,
|
|
470
|
+
e.createField(l, "Input"), e.setField(l, t(c, jn, r));
|
|
461
471
|
}
|
|
462
472
|
if (e.lock(n), !s.hashOverride) return n;
|
|
463
473
|
const i = e.createStruct(
|
|
@@ -473,29 +483,29 @@ function Oe(s, e, t) {
|
|
|
473
483
|
`trying to get "${s}" source: sources map doesn't contain source hash ${t}`
|
|
474
484
|
);
|
|
475
485
|
}
|
|
476
|
-
function
|
|
477
|
-
const t =
|
|
486
|
+
function Vi(s, e) {
|
|
487
|
+
const t = Wo(e.content), r = t.type;
|
|
478
488
|
switch (r) {
|
|
479
489
|
case "pl.tengo-template.v2":
|
|
480
|
-
return
|
|
490
|
+
return Vn(s, t);
|
|
481
491
|
case "pl.tengo-template.v3":
|
|
482
|
-
return
|
|
492
|
+
return Bn(s, t);
|
|
483
493
|
default:
|
|
484
494
|
Y(r);
|
|
485
495
|
}
|
|
486
496
|
}
|
|
487
|
-
function
|
|
497
|
+
function Ui(s, e) {
|
|
488
498
|
const t = e.data, r = t.type;
|
|
489
499
|
switch (r) {
|
|
490
500
|
case "pl.tengo-template.v2":
|
|
491
|
-
return
|
|
501
|
+
return Vn(s, t);
|
|
492
502
|
case "pl.tengo-template.v3":
|
|
493
|
-
return
|
|
503
|
+
return Bn(s, t);
|
|
494
504
|
default:
|
|
495
505
|
Y(r);
|
|
496
506
|
}
|
|
497
507
|
}
|
|
498
|
-
const
|
|
508
|
+
const ls = {
|
|
499
509
|
hash(s, e) {
|
|
500
510
|
e.update(fe.type.name).update(fe.type.version).update(s.name).update(s.version).update(s.src);
|
|
501
511
|
},
|
|
@@ -513,12 +523,12 @@ const as = {
|
|
|
513
523
|
const r = le.fromV2Data(s), n = e.createStruct(le.type, r.data);
|
|
514
524
|
return e.setKValue(n, le.metaNameKey, JSON.stringify(r.name)), e.lock(n), n;
|
|
515
525
|
}
|
|
516
|
-
},
|
|
526
|
+
}, xn = {
|
|
517
527
|
hash(s, e) {
|
|
518
528
|
e.update(X.type.name).update(X.type.version).update(s.hashOverride ?? "no-override").update(s.name).update(s.version).update(s.src);
|
|
519
529
|
const t = (r) => (r.sort((n, i) => n[0] === i[0] ? 0 : n[0] < i[0] ? -1 : 1), r);
|
|
520
530
|
for (const [r, n] of t(Object.entries(s.libs ?? {})))
|
|
521
|
-
e.update("lib:" + r),
|
|
531
|
+
e.update("lib:" + r), ls.hash(n, e);
|
|
522
532
|
for (const [r, n] of t(Object.entries(s.software ?? {})))
|
|
523
533
|
e.update("soft:" + r), Ze.hash(n, e);
|
|
524
534
|
for (const [r, n] of t(Object.entries(s.assets ?? {})))
|
|
@@ -533,7 +543,7 @@ const as = {
|
|
|
533
543
|
);
|
|
534
544
|
for (const [o, a] of Object.entries(s.libs ?? {})) {
|
|
535
545
|
const c = X.libField(r, o);
|
|
536
|
-
e.createField(c, "Input"), e.setField(c, t(a,
|
|
546
|
+
e.createField(c, "Input"), e.setField(c, t(a, ls));
|
|
537
547
|
}
|
|
538
548
|
for (const [o, a] of Object.entries(s.software ?? {})) {
|
|
539
549
|
const c = X.swField(r, o);
|
|
@@ -545,7 +555,7 @@ const as = {
|
|
|
545
555
|
}
|
|
546
556
|
for (const [o, a] of Object.entries(s.templates ?? {})) {
|
|
547
557
|
const c = X.tplField(r, o);
|
|
548
|
-
e.createField(c, "Input"), e.setField(c, t(a,
|
|
558
|
+
e.createField(c, "Input"), e.setField(c, t(a, xn));
|
|
549
559
|
}
|
|
550
560
|
if (e.lock(r), !s.hashOverride) return r;
|
|
551
561
|
const n = e.createStruct(
|
|
@@ -555,7 +565,7 @@ const as = {
|
|
|
555
565
|
return e.createField(i, "Service"), e.setField(i, r), e.lock(n), n;
|
|
556
566
|
}
|
|
557
567
|
};
|
|
558
|
-
function
|
|
568
|
+
function Vn(s, e) {
|
|
559
569
|
const t = /* @__PURE__ */ new Map(), r = (n, i) => {
|
|
560
570
|
const o = Fe("sha256");
|
|
561
571
|
i.hash(n, o);
|
|
@@ -566,18 +576,18 @@ function xn(s, e) {
|
|
|
566
576
|
}
|
|
567
577
|
return t.get(a);
|
|
568
578
|
};
|
|
569
|
-
return r(e,
|
|
579
|
+
return r(e, xn);
|
|
570
580
|
}
|
|
571
|
-
const
|
|
581
|
+
const Mi = { name: "TengoTemplateGet", version: "1" }, Ji = "registry", Gi = "templateURI", _i = "template", lu = { name: "TengoTemplatePack", version: "1" }, uu = {
|
|
572
582
|
name: "TengoTemplatePackConvert",
|
|
573
583
|
version: "1"
|
|
574
|
-
},
|
|
575
|
-
async function
|
|
584
|
+
}, du = "templatePack", pu = "template";
|
|
585
|
+
async function Un(s) {
|
|
576
586
|
switch (s.type) {
|
|
577
587
|
case "from-file":
|
|
578
588
|
return {
|
|
579
589
|
type: "explicit",
|
|
580
|
-
content: await
|
|
590
|
+
content: await ne.promises.readFile(s.path)
|
|
581
591
|
};
|
|
582
592
|
case "from-registry":
|
|
583
593
|
case "explicit":
|
|
@@ -588,36 +598,36 @@ async function Vn(s) {
|
|
|
588
598
|
return Y(s);
|
|
589
599
|
}
|
|
590
600
|
}
|
|
591
|
-
function
|
|
592
|
-
const t = s.createStruct(
|
|
601
|
+
function qi(s, e) {
|
|
602
|
+
const t = s.createStruct(Mi), r = J(t, Ji), n = J(t, Gi), i = J(t, _i);
|
|
593
603
|
return s.setField(r, s.createValue(D.JsonString, Buffer.from(JSON.stringify(e.registry)))), s.setField(n, s.createValue(D.JsonString, Buffer.from(JSON.stringify(e.path)))), i;
|
|
594
604
|
}
|
|
595
605
|
function ht(s, e) {
|
|
596
606
|
switch (e.type) {
|
|
597
607
|
case "from-registry":
|
|
598
|
-
return
|
|
608
|
+
return qi(s, e);
|
|
599
609
|
case "explicit":
|
|
600
|
-
return xi(s, e);
|
|
601
|
-
case "prepared":
|
|
602
610
|
return Vi(s, e);
|
|
611
|
+
case "prepared":
|
|
612
|
+
return Ui(s, e);
|
|
603
613
|
default:
|
|
604
614
|
return Y(e);
|
|
605
615
|
}
|
|
606
616
|
}
|
|
607
|
-
const
|
|
617
|
+
const Mn = { name: "Frontend/FromUrl", version: "1" }, Jn = {
|
|
608
618
|
name: "Frontend/FromFolder",
|
|
609
619
|
version: "1"
|
|
610
620
|
};
|
|
611
|
-
function
|
|
621
|
+
function Ki(s, e) {
|
|
612
622
|
switch (e.type) {
|
|
613
623
|
case "url":
|
|
614
624
|
return s.createValue(
|
|
615
|
-
|
|
625
|
+
Mn,
|
|
616
626
|
JSON.stringify({ url: e.url })
|
|
617
627
|
);
|
|
618
628
|
case "local":
|
|
619
629
|
return s.createValue(
|
|
620
|
-
|
|
630
|
+
Jn,
|
|
621
631
|
JSON.stringify({
|
|
622
632
|
path: e.path,
|
|
623
633
|
signature: e.signature
|
|
@@ -627,12 +637,12 @@ function qi(s, e) {
|
|
|
627
637
|
return Y(e);
|
|
628
638
|
}
|
|
629
639
|
}
|
|
630
|
-
class
|
|
640
|
+
class Hi {
|
|
631
641
|
constructor() {
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
const e = typeof global < "u" && "__WORKER_PATH__" in global ? global.__WORKER_PATH__ : _.resolve(import.meta.dirname, "worker.js"), t = this.worker = new
|
|
642
|
+
S(this, "nextMessageId", 0);
|
|
643
|
+
S(this, "worker");
|
|
644
|
+
S(this, "pendingRequests", /* @__PURE__ */ new Map());
|
|
645
|
+
const e = typeof global < "u" && "__WORKER_PATH__" in global ? global.__WORKER_PATH__ : _.resolve(import.meta.dirname, "worker.js"), t = this.worker = new zo(
|
|
636
646
|
e,
|
|
637
647
|
{
|
|
638
648
|
workerData: {}
|
|
@@ -663,24 +673,24 @@ class Ki {
|
|
|
663
673
|
return this.terminate();
|
|
664
674
|
}
|
|
665
675
|
}
|
|
666
|
-
const
|
|
667
|
-
function
|
|
676
|
+
const Wi = { name: "BlockPackCustom", version: "1" }, Gn = "template", _n = "frontend";
|
|
677
|
+
function us(s) {
|
|
668
678
|
return s.endsWith("/") ? s : `${s}/`;
|
|
669
679
|
}
|
|
670
|
-
function
|
|
680
|
+
function zi(s) {
|
|
671
681
|
return Buffer.from(s).toString("utf8");
|
|
672
682
|
}
|
|
673
683
|
function et(s) {
|
|
674
|
-
return JSON.parse(
|
|
684
|
+
return JSON.parse(zi(s));
|
|
675
685
|
}
|
|
676
|
-
class
|
|
686
|
+
class Xi {
|
|
677
687
|
constructor(e, t, r) {
|
|
678
|
-
|
|
688
|
+
S(this, "remoteContentCache", new lt({
|
|
679
689
|
max: 500,
|
|
680
690
|
maxSize: 128 * 1024 * 1024,
|
|
681
691
|
fetchMethod: async (e) => {
|
|
682
692
|
const t = this.http !== void 0 ? { dispatcher: this.http } : {};
|
|
683
|
-
return await (await
|
|
693
|
+
return await (await Fr(e, t)).body.arrayBuffer();
|
|
684
694
|
},
|
|
685
695
|
sizeCalculation: (e) => e.byteLength
|
|
686
696
|
}));
|
|
@@ -693,17 +703,17 @@ class zi {
|
|
|
693
703
|
case "prepared":
|
|
694
704
|
return e.config;
|
|
695
705
|
case "dev-v1": {
|
|
696
|
-
const t = await
|
|
706
|
+
const t = await os(e.folder), r = await ne.promises.readFile(t.config, { encoding: "utf-8" });
|
|
697
707
|
return JSON.parse(r);
|
|
698
708
|
}
|
|
699
709
|
case "dev-v2": {
|
|
700
|
-
const t = await
|
|
710
|
+
const t = await Yr(e.folder), r = await ne.promises.readFile(t.components.model.file, {
|
|
701
711
|
encoding: "utf-8"
|
|
702
712
|
});
|
|
703
713
|
return JSON.parse(r);
|
|
704
714
|
}
|
|
705
715
|
case "from-registry-v1": {
|
|
706
|
-
const t = `${
|
|
716
|
+
const t = `${us(e.registryUrl)}${ye.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, r = await this.remoteContentCache.forceFetch(`${t}/config.json`);
|
|
707
717
|
return et(r);
|
|
708
718
|
}
|
|
709
719
|
case "from-registry-v2": {
|
|
@@ -720,7 +730,7 @@ class zi {
|
|
|
720
730
|
if (e.type === "prepared")
|
|
721
731
|
return e;
|
|
722
732
|
const t = await this.prepareWithoutUnpacking(e);
|
|
723
|
-
const r =
|
|
733
|
+
const r = Hr(n, new Hi(), !0);
|
|
724
734
|
return {
|
|
725
735
|
...t,
|
|
726
736
|
type: "prepared",
|
|
@@ -732,7 +742,7 @@ class zi {
|
|
|
732
742
|
} catch (i) {
|
|
733
743
|
var o = i, a = !0;
|
|
734
744
|
} finally {
|
|
735
|
-
var c =
|
|
745
|
+
var c = Wr(n, o, a);
|
|
736
746
|
c && await c;
|
|
737
747
|
}
|
|
738
748
|
}
|
|
@@ -741,8 +751,8 @@ class zi {
|
|
|
741
751
|
case "explicit":
|
|
742
752
|
return e;
|
|
743
753
|
case "dev-v1": {
|
|
744
|
-
const t = await
|
|
745
|
-
await
|
|
754
|
+
const t = await os(e.folder), r = await ne.promises.readFile(t.workflow), n = JSON.parse(
|
|
755
|
+
await ne.promises.readFile(t.config, "utf-8")
|
|
746
756
|
), i = t.ui;
|
|
747
757
|
return {
|
|
748
758
|
type: "explicit",
|
|
@@ -760,14 +770,14 @@ class zi {
|
|
|
760
770
|
};
|
|
761
771
|
}
|
|
762
772
|
case "dev-v2": {
|
|
763
|
-
const t = await
|
|
764
|
-
await
|
|
773
|
+
const t = await Yr(e.folder), r = JSON.parse(
|
|
774
|
+
await ne.promises.readFile(t.components.model.file, {
|
|
765
775
|
encoding: "utf-8"
|
|
766
776
|
})
|
|
767
|
-
), n = await
|
|
777
|
+
), n = await ne.promises.readFile(
|
|
768
778
|
t.components.workflow.main.file
|
|
769
779
|
), i = t.components.ui.folder, o = { ...e };
|
|
770
|
-
return e.mtime === void 0 && (o.mtime = await
|
|
780
|
+
return e.mtime === void 0 && (o.mtime = await Ar(t)), {
|
|
771
781
|
type: "explicit",
|
|
772
782
|
template: {
|
|
773
783
|
type: "explicit",
|
|
@@ -783,7 +793,7 @@ class zi {
|
|
|
783
793
|
};
|
|
784
794
|
}
|
|
785
795
|
case "from-registry-v1": {
|
|
786
|
-
const t = `${
|
|
796
|
+
const t = `${us(e.registryUrl)}${ye.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, r = `${t}/template.plj.gz`, n = await this.remoteContentCache.forceFetch(r), i = new Uint8Array(n), o = await this.remoteContentCache.forceFetch(`${t}/config.json`), a = et(o);
|
|
787
797
|
return {
|
|
788
798
|
type: "explicit",
|
|
789
799
|
template: {
|
|
@@ -819,14 +829,14 @@ class zi {
|
|
|
819
829
|
}
|
|
820
830
|
}
|
|
821
831
|
}
|
|
822
|
-
function
|
|
823
|
-
const t = { config: e.config, source: e.source }, r = s.createStruct(
|
|
824
|
-
return s.createField(J(r,
|
|
832
|
+
function Yi(s, e) {
|
|
833
|
+
const t = { config: e.config, source: e.source }, r = s.createStruct(Wi, JSON.stringify(t));
|
|
834
|
+
return s.createField(J(r, Gn), "Input", ht(s, e.template)), s.createField(J(r, _n), "Input", Ki(s, e.frontend)), s.lock(r), r;
|
|
825
835
|
}
|
|
826
|
-
function
|
|
836
|
+
function ds(s, e) {
|
|
827
837
|
switch (e.type) {
|
|
828
838
|
case "prepared":
|
|
829
|
-
return
|
|
839
|
+
return Yi(s, e);
|
|
830
840
|
default:
|
|
831
841
|
return Y(e.type);
|
|
832
842
|
}
|
|
@@ -834,10 +844,10 @@ function ls(s, e) {
|
|
|
834
844
|
function tt(s, e, t) {
|
|
835
845
|
return { __isRef: !0, blockId: s, name: e };
|
|
836
846
|
}
|
|
837
|
-
function
|
|
847
|
+
function Qi(s) {
|
|
838
848
|
return typeof s == "object" && s !== null && "__isRef" in s && s.__isRef === !0 && "blockId" in s && "name" in s;
|
|
839
849
|
}
|
|
840
|
-
function
|
|
850
|
+
function Er(s, e, t) {
|
|
841
851
|
const r = typeof e;
|
|
842
852
|
switch (r) {
|
|
843
853
|
case "function":
|
|
@@ -850,21 +860,21 @@ function Rr(s, e, t) {
|
|
|
850
860
|
return;
|
|
851
861
|
case "object":
|
|
852
862
|
if (e === null) return;
|
|
853
|
-
if (
|
|
863
|
+
if (Qi(e))
|
|
854
864
|
t === void 0 || t.has(e.blockId) ? (s.upstreams.add(e.blockId), e.requireEnrichments && s.upstreamsRequiringEnrichments.add(e.blockId)) : s.missingReferences = !0;
|
|
855
865
|
else if (Array.isArray(e))
|
|
856
|
-
for (const n of e)
|
|
866
|
+
for (const n of e) Er(s, n, t);
|
|
857
867
|
else
|
|
858
868
|
for (const [, n] of Object.entries(e))
|
|
859
|
-
|
|
869
|
+
Er(s, n, t);
|
|
860
870
|
return;
|
|
861
871
|
default:
|
|
862
872
|
Y(r);
|
|
863
873
|
}
|
|
864
874
|
}
|
|
865
|
-
function
|
|
875
|
+
function Zi(s, e) {
|
|
866
876
|
const t = { upstreams: /* @__PURE__ */ new Set(), upstreamsRequiringEnrichments: /* @__PURE__ */ new Set(), missingReferences: !1 };
|
|
867
|
-
return
|
|
877
|
+
return Er(t, s, e), t;
|
|
868
878
|
}
|
|
869
879
|
function re(s) {
|
|
870
880
|
return {
|
|
@@ -873,10 +883,10 @@ function re(s) {
|
|
|
873
883
|
}
|
|
874
884
|
};
|
|
875
885
|
}
|
|
876
|
-
class
|
|
886
|
+
class qn {
|
|
877
887
|
constructor(e) {
|
|
878
888
|
/** Nodes are stored in the map in topological order */
|
|
879
|
-
|
|
889
|
+
S(this, "nodes");
|
|
880
890
|
this.nodes = e;
|
|
881
891
|
}
|
|
882
892
|
traverseIds(e, ...t) {
|
|
@@ -903,7 +913,7 @@ class _n {
|
|
|
903
913
|
}
|
|
904
914
|
}
|
|
905
915
|
}
|
|
906
|
-
function
|
|
916
|
+
function Pr(s) {
|
|
907
917
|
const e = /* @__PURE__ */ new Map();
|
|
908
918
|
let t;
|
|
909
919
|
for (const { id: r } of re(s)) {
|
|
@@ -913,14 +923,14 @@ function Cr(s) {
|
|
|
913
923
|
};
|
|
914
924
|
e.set(r, n), t === void 0 ? (n.directUpstream = n.upstream = /* @__PURE__ */ new Set(), n.enrichments = n.enrichmentTargets = /* @__PURE__ */ new Set()) : (n.directUpstream = n.upstream = /* @__PURE__ */ new Set([t.id]), t.directDownstream = t.downstream = /* @__PURE__ */ new Set([n.id]), t.enrichments = t.enrichmentTargets = /* @__PURE__ */ new Set()), t = n;
|
|
915
925
|
}
|
|
916
|
-
return t !== void 0 && (t.directDownstream = t.downstream = /* @__PURE__ */ new Set()), new
|
|
926
|
+
return t !== void 0 && (t.directDownstream = t.downstream = /* @__PURE__ */ new Set()), new qn(e);
|
|
917
927
|
}
|
|
918
928
|
function ot(s, e) {
|
|
919
|
-
const t = /* @__PURE__ */ new Map(), r = new
|
|
929
|
+
const t = /* @__PURE__ */ new Map(), r = new qn(t), n = /* @__PURE__ */ new Set();
|
|
920
930
|
for (const { id: i } of re(s)) {
|
|
921
931
|
const o = e(i);
|
|
922
932
|
if (o === void 0) continue;
|
|
923
|
-
const a =
|
|
933
|
+
const a = Zi(o.args, n), c = /* @__PURE__ */ new Set([
|
|
924
934
|
...a.upstreams,
|
|
925
935
|
...r.traverseIds("enrichments", ...a.upstreamsRequiringEnrichments)
|
|
926
936
|
]), l = /* @__PURE__ */ new Set();
|
|
@@ -952,48 +962,48 @@ function ot(s, e) {
|
|
|
952
962
|
}
|
|
953
963
|
return r;
|
|
954
964
|
}
|
|
955
|
-
function
|
|
965
|
+
function ea(s, e) {
|
|
956
966
|
if (s.size !== e.size) return !1;
|
|
957
967
|
for (const t of s) if (!e.has(t)) return !1;
|
|
958
968
|
return !0;
|
|
959
969
|
}
|
|
960
|
-
function
|
|
961
|
-
if (s.size > e.size) return
|
|
970
|
+
function Or(s, e) {
|
|
971
|
+
if (s.size > e.size) return Or(e, s);
|
|
962
972
|
for (const t of s) if (e.has(t)) return !0;
|
|
963
973
|
return !1;
|
|
964
974
|
}
|
|
965
|
-
function
|
|
975
|
+
function ps(s, e) {
|
|
966
976
|
const t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
|
|
967
977
|
return s.nodes.forEach((i) => {
|
|
968
978
|
const o = e.nodes.get(i.id);
|
|
969
|
-
o === void 0 ? t.add(i.id) : (!
|
|
979
|
+
o === void 0 ? t.add(i.id) : (!ea(i.upstream, o.upstream) || Or(i.upstream, n)) && n.add(i.id);
|
|
970
980
|
}), e.nodes.forEach((i) => {
|
|
971
|
-
s.nodes.has(i.id) ?
|
|
981
|
+
s.nodes.has(i.id) ? Or(i.upstream, n) && n.add(i.id) : r.add(i.id);
|
|
972
982
|
}), { onlyInA: t, onlyInB: r, different: n };
|
|
973
983
|
}
|
|
974
|
-
let
|
|
975
|
-
async function
|
|
976
|
-
if (
|
|
977
|
-
const s = await
|
|
984
|
+
let Et;
|
|
985
|
+
async function Kn() {
|
|
986
|
+
if (Et === void 0) {
|
|
987
|
+
const s = await Un(we["pframes.export-pframe-for-ui"]);
|
|
978
988
|
if (s.type !== "explicit") throw new Error("Unexpected prepared template type.");
|
|
979
989
|
const e = Fe("sha256").update(s.content).digest("hex");
|
|
980
|
-
|
|
990
|
+
Et = { spec: s, hash: e };
|
|
981
991
|
}
|
|
982
|
-
return
|
|
992
|
+
return Et;
|
|
983
993
|
}
|
|
984
|
-
function
|
|
985
|
-
return
|
|
994
|
+
function ta(s, e, t) {
|
|
995
|
+
return Dr(s, e, !0, { pf: t }, ["result"]).result;
|
|
986
996
|
}
|
|
987
|
-
let
|
|
997
|
+
let be;
|
|
988
998
|
function Q() {
|
|
989
|
-
return
|
|
999
|
+
return be || (be = {
|
|
990
1000
|
logPFrameRequests: process.env.MI_LOG_PFRAMES !== void 0,
|
|
991
1001
|
dumpInitialTreeState: process.env.MI_DUMP_INITIAL_TREE_STATE !== void 0,
|
|
992
1002
|
logProjectMutationStat: process.env.MI_LOG_PROJECT_MUTATION_STAT !== void 0,
|
|
993
1003
|
logOutputRecalculations: process.env.MI_LOG_OUTPUT_RECALCULATIONS !== void 0
|
|
994
|
-
}, process.env.MI_LOG_OUTPUT_STATUS && (
|
|
1004
|
+
}, process.env.MI_LOG_OUTPUT_STATUS && (be.logOutputStatus = process.env.MI_LOG_OUTPUT_STATUS === "unstable-only" ? "unstable-only" : "any"), process.env.MI_LOG_TREE_STAT && (be.logTreeStats = process.env.MI_LOG_TREE_STAT === "cumulative" ? "cumulative" : "per-request"), be);
|
|
995
1005
|
}
|
|
996
|
-
function
|
|
1006
|
+
function Pt(s, e) {
|
|
997
1007
|
let t = !1, r, n;
|
|
998
1008
|
return () => {
|
|
999
1009
|
if (!t)
|
|
@@ -1002,13 +1012,13 @@ function Et(s, e) {
|
|
|
1002
1012
|
return r !== i && (r = i, n = e()), e();
|
|
1003
1013
|
};
|
|
1004
1014
|
}
|
|
1005
|
-
class
|
|
1015
|
+
class Ot {
|
|
1006
1016
|
constructor(e, t, r, n) {
|
|
1007
|
-
|
|
1017
|
+
S(this, "currentArgsC", Pt(
|
|
1008
1018
|
() => this.fields.currentArgs.modCount,
|
|
1009
1019
|
() => Ue(this.fields.currentArgs.value)
|
|
1010
1020
|
));
|
|
1011
|
-
|
|
1021
|
+
S(this, "prodArgsC", Pt(
|
|
1012
1022
|
() => {
|
|
1013
1023
|
var e;
|
|
1014
1024
|
return (e = this.fields.prodArgs) == null ? void 0 : e.modCount;
|
|
@@ -1020,7 +1030,7 @@ class ds {
|
|
|
1020
1030
|
return Ue(e);
|
|
1021
1031
|
}
|
|
1022
1032
|
));
|
|
1023
|
-
|
|
1033
|
+
S(this, "productionStaleC", Pt(
|
|
1024
1034
|
() => {
|
|
1025
1035
|
var e;
|
|
1026
1036
|
return `${this.fields.currentArgs.modCount}_${(e = this.fields.prodArgs) == null ? void 0 : e.modCount}`;
|
|
@@ -1066,33 +1076,33 @@ class ds {
|
|
|
1066
1076
|
getTemplate(e) {
|
|
1067
1077
|
return e.getFutureFieldValue(
|
|
1068
1078
|
D.unwrapHolder(e, this.fields.blockPack.ref),
|
|
1069
|
-
|
|
1079
|
+
Gn,
|
|
1070
1080
|
"Input"
|
|
1071
1081
|
);
|
|
1072
1082
|
}
|
|
1073
1083
|
}
|
|
1074
|
-
const
|
|
1084
|
+
const ra = (s) => {
|
|
1075
1085
|
throw new Error(`No new block info for ${s}`);
|
|
1076
1086
|
};
|
|
1077
1087
|
class pt {
|
|
1078
1088
|
constructor(e, t, r, n, i, o, a, c, l, u, d, p) {
|
|
1079
|
-
|
|
1080
|
-
|
|
1089
|
+
S(this, "globalModCount", 0);
|
|
1090
|
+
S(this, "fieldsChanged", !1);
|
|
1081
1091
|
//
|
|
1082
1092
|
// Change trackers
|
|
1083
1093
|
//
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1094
|
+
S(this, "lastModifiedChanged", !1);
|
|
1095
|
+
S(this, "structureChanged", !1);
|
|
1096
|
+
S(this, "metaChanged", !1);
|
|
1097
|
+
S(this, "renderingStateChanged", !1);
|
|
1088
1098
|
/** Set blocks will be assigned current mutator author marker on save */
|
|
1089
|
-
|
|
1099
|
+
S(this, "blocksWithChangedInputs", /* @__PURE__ */ new Set());
|
|
1090
1100
|
//
|
|
1091
1101
|
// Graph calculation
|
|
1092
1102
|
//
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1103
|
+
S(this, "stagingGraph");
|
|
1104
|
+
S(this, "pendingProductionGraph");
|
|
1105
|
+
S(this, "actualProductionGraph");
|
|
1096
1106
|
this.rid = e, this.tx = t, this.author = r, this.schema = n, this.lastModified = i, this.meta = o, this.struct = a, this.renderingState = c, this.blocksInLimbo = l, this.blockInfos = u, this.ctxExportTplHolder = d, this.projectHelper = p;
|
|
1097
1107
|
}
|
|
1098
1108
|
fixProblemsAndMigrate() {
|
|
@@ -1101,7 +1111,7 @@ class pt {
|
|
|
1101
1111
|
});
|
|
1102
1112
|
let e;
|
|
1103
1113
|
this.blockInfos.forEach((t) => {
|
|
1104
|
-
t.fields.blockSettings === void 0 && (e === void 0 && (e = this.createJsonFieldValue(
|
|
1114
|
+
t.fields.blockSettings === void 0 && (e === void 0 && (e = this.createJsonFieldValue(Xr)), this.setBlockFieldObj(t.id, "blockSettings", e));
|
|
1105
1115
|
});
|
|
1106
1116
|
}
|
|
1107
1117
|
get wasModified() {
|
|
@@ -1111,7 +1121,7 @@ class pt {
|
|
|
1111
1121
|
return JSON.parse(JSON.stringify(this.struct));
|
|
1112
1122
|
}
|
|
1113
1123
|
getStagingGraph() {
|
|
1114
|
-
return this.stagingGraph === void 0 && (this.stagingGraph =
|
|
1124
|
+
return this.stagingGraph === void 0 && (this.stagingGraph = Pr(this.struct)), this.stagingGraph;
|
|
1115
1125
|
}
|
|
1116
1126
|
getProductionGraphBlockInfo(e, t) {
|
|
1117
1127
|
const r = this.getBlockInfo(e);
|
|
@@ -1122,7 +1132,7 @@ class pt {
|
|
|
1122
1132
|
} else
|
|
1123
1133
|
n = N(r.fields.currentArgs), i = r.currentArgs;
|
|
1124
1134
|
const o = N(r.fields.blockPack);
|
|
1125
|
-
return
|
|
1135
|
+
return es(n.ref) && es(o.ref) ? {
|
|
1126
1136
|
args: i,
|
|
1127
1137
|
enrichmentTargets: this.projectHelper.getEnrichmentTargets(
|
|
1128
1138
|
() => r.config,
|
|
@@ -1205,11 +1215,21 @@ class pt {
|
|
|
1205
1215
|
((r = t.prodOutput) == null ? void 0 : r.status) === "Ready" && ((n = t.prodCtx) == null ? void 0 : n.status) === "Ready" && ((i = t.prodUiCtx) == null ? void 0 : i.status) === "Ready" && (this.setBlockFieldObj(e, "prodOutputPrevious", t.prodOutput), this.setBlockFieldObj(e, "prodCtxPrevious", t.prodCtx), this.setBlockFieldObj(e, "prodUiCtxPrevious", t.prodUiCtx)), this.deleteBlockFields(e, "prodOutput", "prodCtx", "prodUiCtx", "prodArgs");
|
|
1206
1216
|
}
|
|
1207
1217
|
/** Running blocks are reset, already computed moved to limbo. Returns if
|
|
1208
|
-
* either of the actions were actually performed.
|
|
1218
|
+
* either of the actions were actually performed.
|
|
1219
|
+
* This method ensures the block is left in a consistent state that passes check() constraints. */
|
|
1209
1220
|
resetOrLimboProduction(e) {
|
|
1210
1221
|
var r, n;
|
|
1211
1222
|
const t = this.getBlockInfo(e).fields;
|
|
1212
|
-
return ((r = t.prodOutput) == null ? void 0 : r.status) === "Ready" && ((n = t.prodCtx) == null ? void 0 : n.status) === "Ready" ? this.blocksInLimbo.has(e) ? !1 : (this.blocksInLimbo.add(e), this.renderingStateChanged = !0, this.deleteBlockFields(e, "prodOutputPrevious", "prodCtxPrevious", "prodUiCtxPrevious"), !0) : this.deleteBlockFields(
|
|
1223
|
+
return ((r = t.prodOutput) == null ? void 0 : r.status) === "Ready" && ((n = t.prodCtx) == null ? void 0 : n.status) === "Ready" ? this.blocksInLimbo.has(e) ? !1 : (this.blocksInLimbo.add(e), this.renderingStateChanged = !0, this.deleteBlockFields(e, "prodOutputPrevious", "prodCtxPrevious", "prodUiCtxPrevious"), !0) : this.deleteBlockFields(
|
|
1224
|
+
e,
|
|
1225
|
+
"prodOutput",
|
|
1226
|
+
"prodCtx",
|
|
1227
|
+
"prodUiCtx",
|
|
1228
|
+
"prodArgs",
|
|
1229
|
+
"prodOutputPrevious",
|
|
1230
|
+
"prodCtxPrevious",
|
|
1231
|
+
"prodUiCtxPrevious"
|
|
1232
|
+
);
|
|
1213
1233
|
}
|
|
1214
1234
|
/** Optimally sets inputs for multiple blocks in one go */
|
|
1215
1235
|
setStates(e) {
|
|
@@ -1228,9 +1248,9 @@ class pt {
|
|
|
1228
1248
|
const l = a === "args" ? "currentArgs" : "uiState";
|
|
1229
1249
|
let u, d = !1;
|
|
1230
1250
|
if (a === "args")
|
|
1231
|
-
u =
|
|
1251
|
+
u = Fo(c);
|
|
1232
1252
|
else {
|
|
1233
|
-
const { data: f, isGzipped: v } =
|
|
1253
|
+
const { data: f, isGzipped: v } = To(c);
|
|
1234
1254
|
u = f, d = v;
|
|
1235
1255
|
}
|
|
1236
1256
|
if (Buffer.compare(i.fields[l].value, u) === 0) continue;
|
|
@@ -1253,7 +1273,7 @@ class pt {
|
|
|
1253
1273
|
if (((i = n.fields.prodCtx) == null ? void 0 : i.ref) === void 0)
|
|
1254
1274
|
throw new Error("One of the upstreams staging is not rendered.");
|
|
1255
1275
|
t.push(D.unwrapHolder(this.tx, n.fields.prodCtx.ref));
|
|
1256
|
-
}),
|
|
1276
|
+
}), as(this.tx, t);
|
|
1257
1277
|
}
|
|
1258
1278
|
createStagingCtx(e) {
|
|
1259
1279
|
const t = [];
|
|
@@ -1263,16 +1283,16 @@ class pt {
|
|
|
1263
1283
|
if (((i = n.fields.stagingCtx) == null ? void 0 : i.ref) === void 0)
|
|
1264
1284
|
throw new Error("One of the upstreams staging is not rendered.");
|
|
1265
1285
|
t.push(D.unwrapHolder(this.tx, n.fields.stagingCtx.ref)), ((o = n.fields.prodCtx) == null ? void 0 : o.ref) !== void 0 && t.push(D.unwrapHolder(this.tx, n.fields.prodCtx.ref));
|
|
1266
|
-
}),
|
|
1286
|
+
}), as(this.tx, t);
|
|
1267
1287
|
}
|
|
1268
1288
|
exportCtx(e) {
|
|
1269
|
-
return
|
|
1289
|
+
return ta(this.tx, D.unwrapHolder(this.tx, this.ctxExportTplHolder), e);
|
|
1270
1290
|
}
|
|
1271
1291
|
renderStagingFor(e) {
|
|
1272
1292
|
this.resetStaging(e);
|
|
1273
1293
|
const t = this.getBlockInfo(e), r = this.createStagingCtx(this.getStagingGraph().nodes.get(e).upstream);
|
|
1274
1294
|
if (this.getBlock(e).renderingMode !== "Heavy") throw new Error("not supported yet");
|
|
1275
|
-
const n = t.getTemplate(this.tx), i =
|
|
1295
|
+
const n = t.getTemplate(this.tx), i = is(this.tx, n, {
|
|
1276
1296
|
args: t.fields.currentArgs.ref,
|
|
1277
1297
|
blockId: this.tx.createValue(D.JsonString, JSON.stringify(e)),
|
|
1278
1298
|
isProduction: this.tx.createValue(D.JsonBool, JSON.stringify(!1)),
|
|
@@ -1290,7 +1310,7 @@ class pt {
|
|
|
1290
1310
|
const t = this.getBlockInfo(e), r = this.createProdCtx(this.getPendingProductionGraph().nodes.get(e).upstream);
|
|
1291
1311
|
if (this.getBlock(e).renderingMode === "Light")
|
|
1292
1312
|
throw new Error("Can't render production for light block.");
|
|
1293
|
-
const n = t.getTemplate(this.tx), i =
|
|
1313
|
+
const n = t.getTemplate(this.tx), i = is(this.tx, n, {
|
|
1294
1314
|
args: t.fields.currentArgs.ref,
|
|
1295
1315
|
blockId: this.tx.createValue(D.JsonString, JSON.stringify(e)),
|
|
1296
1316
|
isProduction: this.tx.createValue(D.JsonBool, JSON.stringify(!0)),
|
|
@@ -1306,28 +1326,64 @@ class pt {
|
|
|
1306
1326
|
//
|
|
1307
1327
|
// Structure changes
|
|
1308
1328
|
//
|
|
1329
|
+
initializeNewBlock(e, t) {
|
|
1330
|
+
const r = new Ot(e, {}, Ce(t.blockPack.config), t.blockPack.source);
|
|
1331
|
+
this.blockInfos.set(e, r);
|
|
1332
|
+
const n = ds(this.tx, t.blockPack);
|
|
1333
|
+
this.setBlockField(e, "blockPack", D.wrapInHolder(this.tx, n), "NotReady"), this.setBlockFieldObj(
|
|
1334
|
+
e,
|
|
1335
|
+
"blockSettings",
|
|
1336
|
+
this.createJsonFieldValue(Xr)
|
|
1337
|
+
), this.setBlockFieldObj(e, "currentArgs", this.createJsonFieldValueByContent(t.args)), this.setBlockFieldObj(e, "uiState", this.createJsonFieldValueByContent(t.uiState ?? "{}")), r.check();
|
|
1338
|
+
}
|
|
1339
|
+
getFieldNamesToDuplicate(e) {
|
|
1340
|
+
var n, i;
|
|
1341
|
+
const t = this.getBlockInfo(e).fields, r = (o, a) => new Set([...o].filter((c) => !a.has(c)));
|
|
1342
|
+
return ((n = t.prodOutput) == null ? void 0 : n.status) === "Ready" && ((i = t.prodCtx) == null ? void 0 : i.status) === "Ready" ? this.blocksInLimbo.has(e) ? Ct : r(Ct, /* @__PURE__ */ new Set([
|
|
1343
|
+
"prodOutputPrevious",
|
|
1344
|
+
"prodCtxPrevious",
|
|
1345
|
+
"prodUiCtxPrevious"
|
|
1346
|
+
])) : r(Ct, /* @__PURE__ */ new Set([
|
|
1347
|
+
"prodOutput",
|
|
1348
|
+
"prodCtx",
|
|
1349
|
+
"prodUiCtx",
|
|
1350
|
+
"prodArgs",
|
|
1351
|
+
"prodOutputPrevious",
|
|
1352
|
+
"prodCtxPrevious",
|
|
1353
|
+
"prodUiCtxPrevious"
|
|
1354
|
+
]));
|
|
1355
|
+
}
|
|
1356
|
+
initializeBlockDuplicate(e, t) {
|
|
1357
|
+
const r = new Ot(
|
|
1358
|
+
e,
|
|
1359
|
+
{},
|
|
1360
|
+
t.config,
|
|
1361
|
+
t.source
|
|
1362
|
+
);
|
|
1363
|
+
this.blockInfos.set(e, r);
|
|
1364
|
+
const n = this.getFieldNamesToDuplicate(e);
|
|
1365
|
+
for (const [i, o] of Object.entries(t.fields))
|
|
1366
|
+
n.has(i) && o && o.ref && this.setBlockFieldObj(e, i, {
|
|
1367
|
+
ref: o.ref,
|
|
1368
|
+
status: o.status,
|
|
1369
|
+
value: o.value
|
|
1370
|
+
});
|
|
1371
|
+
this.resetOrLimboProduction(e), r.check();
|
|
1372
|
+
}
|
|
1309
1373
|
/** Very generic method, better check for more specialized case-specific methods first. */
|
|
1310
|
-
updateStructure(e, t =
|
|
1311
|
-
const r = this.getStagingGraph(), n = this.getActualProductionGraph(), i =
|
|
1374
|
+
updateStructure(e, t = ra) {
|
|
1375
|
+
const r = this.getStagingGraph(), n = this.getActualProductionGraph(), i = Pr(e), o = ps(r, i);
|
|
1312
1376
|
for (const l of o.onlyInA) {
|
|
1313
1377
|
const { fields: u } = this.getBlockInfo(l);
|
|
1314
1378
|
this.deleteBlockFields(l, ...Object.keys(u)), this.blockInfos.delete(l), this.blocksInLimbo.delete(l) && (this.renderingStateChanged = !0);
|
|
1315
1379
|
}
|
|
1316
|
-
for (const l of o.onlyInB)
|
|
1317
|
-
|
|
1318
|
-
this.blockInfos.set(l, d);
|
|
1319
|
-
const p = ls(this.tx, u.blockPack);
|
|
1320
|
-
this.setBlockField(l, "blockPack", D.wrapInHolder(this.tx, p), "NotReady"), this.setBlockFieldObj(
|
|
1321
|
-
l,
|
|
1322
|
-
"blockSettings",
|
|
1323
|
-
this.createJsonFieldValue(Wr)
|
|
1324
|
-
), this.setBlockFieldObj(l, "currentArgs", this.createJsonFieldValueByContent(u.args)), this.setBlockFieldObj(l, "uiState", this.createJsonFieldValueByContent(u.uiState ?? "{}")), d.check();
|
|
1325
|
-
}
|
|
1380
|
+
for (const l of o.onlyInB)
|
|
1381
|
+
t(l);
|
|
1326
1382
|
for (const l of o.different) this.resetStaging(l);
|
|
1327
1383
|
const a = ot(
|
|
1328
1384
|
e,
|
|
1329
1385
|
(l) => this.getProductionGraphBlockInfo(l, !0)
|
|
1330
|
-
), c =
|
|
1386
|
+
), c = ps(n, a);
|
|
1331
1387
|
n.traverse("downstream", [...c.different], (l) => {
|
|
1332
1388
|
this.resetOrLimboProduction(l.id);
|
|
1333
1389
|
}), (o.onlyInB.size > 0 || o.onlyInA.size > 0 || o.different.size > 0) && this.resetStagingRefreshTimestamp(), this.struct = e, this.structureChanged = !0, this.stagingGraph = void 0, this.pendingProductionGraph = void 0, this.actualProductionGraph = void 0, this.updateLastModified();
|
|
@@ -1352,7 +1408,39 @@ class pt {
|
|
|
1352
1408
|
}
|
|
1353
1409
|
this.updateStructure(n, (i) => {
|
|
1354
1410
|
if (i !== e.id) throw new Error("Unexpected");
|
|
1355
|
-
|
|
1411
|
+
this.initializeNewBlock(i, t);
|
|
1412
|
+
});
|
|
1413
|
+
}
|
|
1414
|
+
/**
|
|
1415
|
+
* Duplicates an existing block by copying all its fields and structure.
|
|
1416
|
+
* This method creates a deep copy of the block at the mutator level.
|
|
1417
|
+
*
|
|
1418
|
+
* @param originalBlockId id of the block to duplicate
|
|
1419
|
+
* @param newBlockId id for the new duplicated block
|
|
1420
|
+
* @param after id of the block to insert new block after
|
|
1421
|
+
*/
|
|
1422
|
+
duplicateBlock(e, t, r) {
|
|
1423
|
+
const n = this.getBlock(e), i = this.getBlockInfo(e), o = {
|
|
1424
|
+
id: t,
|
|
1425
|
+
label: n.label,
|
|
1426
|
+
renderingMode: n.renderingMode
|
|
1427
|
+
}, a = this.structure;
|
|
1428
|
+
if (r === void 0)
|
|
1429
|
+
a.groups[a.groups.length - 1].blocks.push(o);
|
|
1430
|
+
else {
|
|
1431
|
+
let c = !1;
|
|
1432
|
+
for (const l of a.groups) {
|
|
1433
|
+
const u = l.blocks.findIndex((d) => d.id === r);
|
|
1434
|
+
if (!(u < 0)) {
|
|
1435
|
+
l.blocks.splice(u + 1, 0, o), c = !0;
|
|
1436
|
+
break;
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
if (!c) throw new Error(`Can't find element with id: ${r}`);
|
|
1440
|
+
}
|
|
1441
|
+
this.updateStructure(a, (c) => {
|
|
1442
|
+
if (c !== t) throw new Error("Unexpected");
|
|
1443
|
+
this.initializeBlockDuplicate(c, i);
|
|
1356
1444
|
});
|
|
1357
1445
|
}
|
|
1358
1446
|
deleteBlock(e) {
|
|
@@ -1376,7 +1464,7 @@ class pt {
|
|
|
1376
1464
|
this.setBlockField(
|
|
1377
1465
|
e,
|
|
1378
1466
|
"blockPack",
|
|
1379
|
-
D.wrapInHolder(this.tx,
|
|
1467
|
+
D.wrapInHolder(this.tx, ds(this.tx, t)),
|
|
1380
1468
|
"NotReady"
|
|
1381
1469
|
), r !== void 0 ? this.setStates([{ blockId: e, args: r.args, uiState: r.uiState }]) : this.getStagingGraph().traverse("downstream", [e], ({ id: i }) => this.resetStaging(i)), n.productionRendered && this.getActualProductionGraph().traverse(
|
|
1382
1470
|
"downstream",
|
|
@@ -1425,7 +1513,7 @@ class pt {
|
|
|
1425
1513
|
* accordingly */
|
|
1426
1514
|
stopProduction(...e) {
|
|
1427
1515
|
var o, a;
|
|
1428
|
-
const t = this.getActualProductionGraph(), r = new
|
|
1516
|
+
const t = this.getActualProductionGraph(), r = new Cn(e), n = new Set(e), i = [];
|
|
1429
1517
|
for (; !r.isEmpty(); ) {
|
|
1430
1518
|
const c = r.shift(), l = this.getBlockInfo(c).fields;
|
|
1431
1519
|
if (!(((o = l.prodOutput) == null ? void 0 : o.status) === "Ready" && ((a = l.prodCtx) == null ? void 0 : a.status) === "Ready") && this.deleteBlockFields(c, "prodOutput", "prodCtx", "prodUiCtx", "prodArgs")) {
|
|
@@ -1485,8 +1573,8 @@ class pt {
|
|
|
1485
1573
|
assignAuthorMarkers() {
|
|
1486
1574
|
const e = this.author ? JSON.stringify(this.author) : void 0;
|
|
1487
1575
|
for (const t of this.blocksWithChangedInputs)
|
|
1488
|
-
e === void 0 ? this.tx.deleteKValue(this.rid,
|
|
1489
|
-
(this.metaChanged || this.structureChanged) && (e === void 0 ? this.tx.deleteKValue(this.rid,
|
|
1576
|
+
e === void 0 ? this.tx.deleteKValue(this.rid, kr(t)) : this.tx.setKValue(this.rid, kr(t), e);
|
|
1577
|
+
(this.metaChanged || this.structureChanged) && (e === void 0 ? this.tx.deleteKValue(this.rid, Rr) : this.tx.setKValue(this.rid, Rr, e));
|
|
1490
1578
|
}
|
|
1491
1579
|
save() {
|
|
1492
1580
|
this.wasModified && (this.lastModifiedChanged && this.tx.setKValue(this.rid, _e, JSON.stringify(this.lastModified)), this.structureChanged && this.tx.setKValue(this.rid, de, JSON.stringify(this.struct)), this.renderingStateChanged && this.tx.setKValue(
|
|
@@ -1501,7 +1589,7 @@ class pt {
|
|
|
1501
1589
|
static async load(e, t, r, n) {
|
|
1502
1590
|
const i = t.getResourceData(r, !0), o = t.getKValueJson(r, ut), a = t.getKValueJson(r, _e), c = t.getKValueJson(r, qe), l = t.getKValueJson(r, de), u = t.getKValueJson(r, dt), d = await i, p = /* @__PURE__ */ new Map();
|
|
1503
1591
|
for (const g of d.fields) {
|
|
1504
|
-
const m =
|
|
1592
|
+
const m = Oi(g.name);
|
|
1505
1593
|
if (m === void 0) continue;
|
|
1506
1594
|
let w = p.get(m.blockId);
|
|
1507
1595
|
w === void 0 && (w = {
|
|
@@ -1514,7 +1602,7 @@ class pt {
|
|
|
1514
1602
|
const m = g.fields;
|
|
1515
1603
|
for (const [w, y] of Object.entries(m)) {
|
|
1516
1604
|
if (y.ref === void 0) continue;
|
|
1517
|
-
if (!
|
|
1605
|
+
if (!Lo(y.ref) || Do(y.ref))
|
|
1518
1606
|
throw new Error("unexpected behaviour");
|
|
1519
1607
|
const R = w;
|
|
1520
1608
|
f.push([
|
|
@@ -1528,7 +1616,7 @@ class pt {
|
|
|
1528
1616
|
const [
|
|
1529
1617
|
v,
|
|
1530
1618
|
h,
|
|
1531
|
-
|
|
1619
|
+
b,
|
|
1532
1620
|
E,
|
|
1533
1621
|
{ stagingRefreshTimestamp: B, blocksInLimbo: F }
|
|
1534
1622
|
] = await Promise.all([
|
|
@@ -1539,11 +1627,11 @@ class pt {
|
|
|
1539
1627
|
u
|
|
1540
1628
|
]);
|
|
1541
1629
|
if (v !== Ge)
|
|
1542
|
-
throw Number(v) < Number(Ge) ? new
|
|
1630
|
+
throw Number(v) < Number(Ge) ? new zr("Can't perform this action on this project because it has older schema. Try (re)loading the project to update it.") : new zr("Can't perform this action on this project because it has newer schema. Upgrade your desktop app to the latest version.");
|
|
1543
1631
|
const j = [];
|
|
1544
1632
|
for (const [g, m, w, y] of f) {
|
|
1545
1633
|
const R = await y;
|
|
1546
|
-
if (w.value = R.data,
|
|
1634
|
+
if (w.value = R.data, br(R.error) ? w.status = "Error" : R.resourceReady || br(R.originalResourceId) ? w.status = "Ready" : w.status = "NotReady", m === "blockPack") {
|
|
1547
1635
|
const k = R.fields.find((O) => O.name === D.HolderRefField);
|
|
1548
1636
|
if (k === void 0)
|
|
1549
1637
|
throw new Error("Block pack ref field is missing");
|
|
@@ -1554,19 +1642,19 @@ class pt {
|
|
|
1554
1642
|
const w = await m, y = Ue(N(w.data));
|
|
1555
1643
|
g.blockConfig = Ce(y.config), g.blockPack = y.source;
|
|
1556
1644
|
}
|
|
1557
|
-
const V = await
|
|
1645
|
+
const V = await Kn(), P = Cr(V.hash), $ = d.fields.find(
|
|
1558
1646
|
(g) => g.name === P
|
|
1559
1647
|
);
|
|
1560
1648
|
let C;
|
|
1561
1649
|
$ !== void 0 ? C = ct($.value) : (C = D.wrapInHolder(t, ht(t, V.spec)), t.createField(
|
|
1562
|
-
J(r,
|
|
1650
|
+
J(r, Cr(V.hash)),
|
|
1563
1651
|
"Dynamic",
|
|
1564
1652
|
C
|
|
1565
1653
|
));
|
|
1566
1654
|
const G = { stagingRefreshTimestamp: B }, ce = new Set(F), z = /* @__PURE__ */ new Map();
|
|
1567
1655
|
p.forEach(({ id: g, fields: m, blockConfig: w, blockPack: y }) => z.set(
|
|
1568
1656
|
g,
|
|
1569
|
-
new
|
|
1657
|
+
new Ot(g, m, N(w), N(y))
|
|
1570
1658
|
));
|
|
1571
1659
|
const M = /* @__PURE__ */ new Set();
|
|
1572
1660
|
for (const g of re(E)) {
|
|
@@ -1585,7 +1673,7 @@ class pt {
|
|
|
1585
1673
|
n,
|
|
1586
1674
|
v,
|
|
1587
1675
|
h,
|
|
1588
|
-
|
|
1676
|
+
b,
|
|
1589
1677
|
E,
|
|
1590
1678
|
G,
|
|
1591
1679
|
ce,
|
|
@@ -1596,22 +1684,22 @@ class pt {
|
|
|
1596
1684
|
return W.fixProblemsAndMigrate(), W;
|
|
1597
1685
|
}
|
|
1598
1686
|
}
|
|
1599
|
-
async function
|
|
1600
|
-
const t = s.createEphemeral(
|
|
1687
|
+
async function sa(s, e = ki) {
|
|
1688
|
+
const t = s.createEphemeral(Ri);
|
|
1601
1689
|
s.lock(t);
|
|
1602
1690
|
const r = String(Date.now());
|
|
1603
|
-
s.setKValue(t, ut, JSON.stringify(Ge)), s.setKValue(t,
|
|
1604
|
-
const n = await
|
|
1691
|
+
s.setKValue(t, ut, JSON.stringify(Ge)), s.setKValue(t, Lr, r), s.setKValue(t, _e, r), s.setKValue(t, qe, JSON.stringify(e)), s.setKValue(t, de, JSON.stringify(Si)), s.setKValue(t, dt, JSON.stringify(bi));
|
|
1692
|
+
const n = await Kn();
|
|
1605
1693
|
return s.createField(
|
|
1606
|
-
J(t,
|
|
1694
|
+
J(t, Cr(n.hash)),
|
|
1607
1695
|
"Dynamic",
|
|
1608
1696
|
D.wrapInHolder(s, ht(s, n.spec))
|
|
1609
1697
|
), t;
|
|
1610
1698
|
}
|
|
1611
1699
|
async function rt(s, e, t, r) {
|
|
1612
|
-
return
|
|
1700
|
+
return se(s, e, t, void 0, r);
|
|
1613
1701
|
}
|
|
1614
|
-
async function
|
|
1702
|
+
async function se(s, e, t, r, n) {
|
|
1615
1703
|
if (e instanceof bn)
|
|
1616
1704
|
return await e.withWriteTx("ProjectAction", async (i) => {
|
|
1617
1705
|
const o = await pt.load(s, i, t, r), a = await n(o);
|
|
@@ -1622,7 +1710,7 @@ async function oe(s, e, t, r, n) {
|
|
|
1622
1710
|
return i.save(), o;
|
|
1623
1711
|
}
|
|
1624
1712
|
}
|
|
1625
|
-
function*
|
|
1713
|
+
function* na(s) {
|
|
1626
1714
|
switch (s.type) {
|
|
1627
1715
|
case "Json":
|
|
1628
1716
|
return;
|
|
@@ -1637,21 +1725,21 @@ function* sa(s) {
|
|
|
1637
1725
|
Y(s);
|
|
1638
1726
|
}
|
|
1639
1727
|
}
|
|
1640
|
-
function
|
|
1728
|
+
function fs(s, e) {
|
|
1641
1729
|
return Object.fromEntries(
|
|
1642
1730
|
Object.entries(s).map(([t, r]) => [t, e(r, t)])
|
|
1643
1731
|
);
|
|
1644
1732
|
}
|
|
1645
|
-
function
|
|
1733
|
+
function oa(s, e) {
|
|
1646
1734
|
switch (s.type) {
|
|
1647
1735
|
case "Json":
|
|
1648
1736
|
return { ...s };
|
|
1649
1737
|
case "JsonPartitioned":
|
|
1650
|
-
return { ...s, parts:
|
|
1738
|
+
return { ...s, parts: fs(s.parts, e) };
|
|
1651
1739
|
case "BinaryPartitioned":
|
|
1652
1740
|
return {
|
|
1653
1741
|
...s,
|
|
1654
|
-
parts:
|
|
1742
|
+
parts: fs(s.parts, (t) => ({
|
|
1655
1743
|
index: e(t.index),
|
|
1656
1744
|
values: e(t.values)
|
|
1657
1745
|
}))
|
|
@@ -1660,26 +1748,26 @@ function na(s, e) {
|
|
|
1660
1748
|
Y(s);
|
|
1661
1749
|
}
|
|
1662
1750
|
}
|
|
1663
|
-
const
|
|
1751
|
+
const ia = We("PColumnData/JsonPartitioned", "1"), aa = We(
|
|
1664
1752
|
"PColumnData/Partitioned/JsonPartitioned",
|
|
1665
1753
|
"1"
|
|
1666
|
-
),
|
|
1754
|
+
), ca = We("PColumnData/BinaryPartitioned", "1"), la = We(
|
|
1667
1755
|
"PColumnData/Partitioned/BinaryPartitioned",
|
|
1668
1756
|
"1"
|
|
1669
|
-
),
|
|
1670
|
-
function
|
|
1757
|
+
), ua = We("PColumnData/Json", "1");
|
|
1758
|
+
function da(s) {
|
|
1671
1759
|
if (!s.getIsReadyOrError()) throw new Error("Data not ready.");
|
|
1672
1760
|
const e = s.getDataAsJson();
|
|
1673
1761
|
if (e === void 0)
|
|
1674
1762
|
throw new Error("unexpected data info structure, no resource data");
|
|
1675
|
-
if (pe(s.resourceType,
|
|
1763
|
+
if (pe(s.resourceType, ua)) {
|
|
1676
1764
|
const t = e;
|
|
1677
1765
|
return {
|
|
1678
1766
|
type: "Json",
|
|
1679
1767
|
keyLength: t.keyLength,
|
|
1680
1768
|
data: t.data
|
|
1681
1769
|
};
|
|
1682
|
-
} else if (pe(s.resourceType,
|
|
1770
|
+
} else if (pe(s.resourceType, ia)) {
|
|
1683
1771
|
const t = e, r = Object.fromEntries(
|
|
1684
1772
|
s.listInputFields().map((n) => [n, s.traverse({ field: n, errorIfFieldNotSet: !0 }).resourceInfo])
|
|
1685
1773
|
);
|
|
@@ -1688,7 +1776,7 @@ function ua(s) {
|
|
|
1688
1776
|
partitionKeyLength: t.partitionKeyLength,
|
|
1689
1777
|
parts: r
|
|
1690
1778
|
};
|
|
1691
|
-
} else if (pe(s.resourceType,
|
|
1779
|
+
} else if (pe(s.resourceType, aa)) {
|
|
1692
1780
|
const t = e, r = {};
|
|
1693
1781
|
for (const n of s.listInputFields()) {
|
|
1694
1782
|
const i = s.traverse({ field: n, errorIfFieldNotSet: !0 }), o = i.listInputFields();
|
|
@@ -1706,7 +1794,7 @@ function ua(s) {
|
|
|
1706
1794
|
partitionKeyLength: t.superPartitionKeyLength + t.partitionKeyLength,
|
|
1707
1795
|
parts: r
|
|
1708
1796
|
};
|
|
1709
|
-
} else if (pe(s.resourceType,
|
|
1797
|
+
} else if (pe(s.resourceType, ca)) {
|
|
1710
1798
|
const t = e, r = {};
|
|
1711
1799
|
for (const n of s.listInputFields())
|
|
1712
1800
|
if (n.endsWith(".index")) {
|
|
@@ -1727,7 +1815,7 @@ function ua(s) {
|
|
|
1727
1815
|
partitionKeyLength: t.partitionKeyLength,
|
|
1728
1816
|
parts: r
|
|
1729
1817
|
};
|
|
1730
|
-
} else if (pe(s.resourceType,
|
|
1818
|
+
} else if (pe(s.resourceType, la)) {
|
|
1731
1819
|
const t = e, r = {};
|
|
1732
1820
|
for (const n of s.listInputFields()) {
|
|
1733
1821
|
const i = s.traverse({ field: n, errorIfFieldNotSet: !0 }), o = i.listInputFields();
|
|
@@ -1761,9 +1849,9 @@ function ua(s) {
|
|
|
1761
1849
|
parts: r
|
|
1762
1850
|
};
|
|
1763
1851
|
}
|
|
1764
|
-
throw new Error(`unsupported resource type: ${
|
|
1852
|
+
throw new Error(`unsupported resource type: ${No(s.resourceType)}`);
|
|
1765
1853
|
}
|
|
1766
|
-
function
|
|
1854
|
+
function pa(s, e) {
|
|
1767
1855
|
const t = s.axesSpec.length, r = {};
|
|
1768
1856
|
for (const { key: n, val: i } of e) {
|
|
1769
1857
|
if (n.length !== t)
|
|
@@ -1776,17 +1864,17 @@ function da(s, e) {
|
|
|
1776
1864
|
data: r
|
|
1777
1865
|
};
|
|
1778
1866
|
}
|
|
1779
|
-
function
|
|
1867
|
+
function fa(s, e) {
|
|
1780
1868
|
const t = Fe("sha256");
|
|
1781
1869
|
return t.update(te(s)), t.update(String(Me(e.originalId) ? e.id : e.originalId)), t.digest().toString("hex");
|
|
1782
1870
|
}
|
|
1783
|
-
function
|
|
1871
|
+
function hs(s, e) {
|
|
1784
1872
|
return te({ __isRef: !0, blockId: s, name: e });
|
|
1785
1873
|
}
|
|
1786
|
-
function
|
|
1874
|
+
function ha(s, e) {
|
|
1787
1875
|
return te({ resolvePath: s, name: e });
|
|
1788
1876
|
}
|
|
1789
|
-
function
|
|
1877
|
+
function Hn(s, e = !0, t = !1, r = "") {
|
|
1790
1878
|
var a, c, l;
|
|
1791
1879
|
const n = /^(?<name>.*)\.(?<type>spec|data)$/, i = /* @__PURE__ */ new Map();
|
|
1792
1880
|
for (const u of s.listInputFields()) {
|
|
@@ -1824,10 +1912,10 @@ function Kn(s, e = !0, t = !1, r = "") {
|
|
|
1824
1912
|
for (const [, u] of i) u.data === void 0 && (u.hasData = !1);
|
|
1825
1913
|
return { locked: o, results: i };
|
|
1826
1914
|
}
|
|
1827
|
-
function
|
|
1915
|
+
function ga(s, e = !0, t = "", r) {
|
|
1828
1916
|
if (!s.getIsReadyOrError()) throw new Error("resource is not ready");
|
|
1829
|
-
const n =
|
|
1830
|
-
|
|
1917
|
+
const n = Hn(s, e, !1, t);
|
|
1918
|
+
Xo(n.locked);
|
|
1831
1919
|
const i = {};
|
|
1832
1920
|
for (const [o, a] of n.results) {
|
|
1833
1921
|
if (a.spec === void 0) throw new Error(`no spec for key ${o}`);
|
|
@@ -1837,16 +1925,16 @@ function ha(s, e = !0, t = "", r) {
|
|
|
1837
1925
|
if (c === void 0) throw new Error(`no data for key ${o}`);
|
|
1838
1926
|
if (!c.ok) throw c.error;
|
|
1839
1927
|
i[o] = {
|
|
1840
|
-
id: r.length === 0 ?
|
|
1928
|
+
id: r.length === 0 ? fa(a.spec, c.value) : ha(r, o),
|
|
1841
1929
|
spec: a.spec,
|
|
1842
1930
|
data: c.value
|
|
1843
1931
|
};
|
|
1844
1932
|
}
|
|
1845
1933
|
return i;
|
|
1846
1934
|
}
|
|
1847
|
-
class
|
|
1935
|
+
class Nr {
|
|
1848
1936
|
constructor(e, t) {
|
|
1849
|
-
|
|
1937
|
+
S(this, "allSpecsAvailable");
|
|
1850
1938
|
this.ctx = e, this.blocks = t;
|
|
1851
1939
|
let r = !0;
|
|
1852
1940
|
e: for (const n of t.values())
|
|
@@ -1878,8 +1966,8 @@ class Lr {
|
|
|
1878
1966
|
if (r === void 0) return;
|
|
1879
1967
|
const n = (a = (o = r.prod) == null ? void 0 : o.results) == null ? void 0 : a.get(t), i = (c = n == null ? void 0 : n.data) == null ? void 0 : c.call(n);
|
|
1880
1968
|
if (n !== void 0 && n.spec !== void 0 && i !== void 0)
|
|
1881
|
-
return
|
|
1882
|
-
id:
|
|
1969
|
+
return gn(i, (l) => ({
|
|
1970
|
+
id: hs(e, t),
|
|
1883
1971
|
spec: n.spec,
|
|
1884
1972
|
data: l
|
|
1885
1973
|
}));
|
|
@@ -1918,7 +2006,7 @@ class Lr {
|
|
|
1918
2006
|
l !== void 0 ? e.push({
|
|
1919
2007
|
ref: tt(o, a),
|
|
1920
2008
|
obj: {
|
|
1921
|
-
id: l.ok ?
|
|
2009
|
+
id: l.ok ? hs(o, a) : void 0,
|
|
1922
2010
|
spec: c.spec,
|
|
1923
2011
|
data: l
|
|
1924
2012
|
}
|
|
@@ -1972,7 +2060,7 @@ class Lr {
|
|
|
1972
2060
|
for (const r of this.blocks.values()) {
|
|
1973
2061
|
const n = /* @__PURE__ */ new Set(), i = (o) => {
|
|
1974
2062
|
for (const [a, c] of o.results)
|
|
1975
|
-
n.has(a) || c.spec === void 0 || (n.add(a),
|
|
2063
|
+
n.has(a) || c.spec === void 0 || (n.add(a), fo(e, c.spec) && t.push({
|
|
1976
2064
|
label: r.info.label + " / " + a,
|
|
1977
2065
|
ref: tt(r.info.id, a),
|
|
1978
2066
|
spec: c.spec
|
|
@@ -1983,10 +2071,10 @@ class Lr {
|
|
|
1983
2071
|
return t;
|
|
1984
2072
|
}
|
|
1985
2073
|
static create(e, t, r) {
|
|
1986
|
-
const n = e.accessor(t).node(), i = N(n.getKeyValueAsJson(de)), a =
|
|
2074
|
+
const n = e.accessor(t).node(), i = N(n.getKeyValueAsJson(de)), a = Pr(i).traverseIds("upstream", r), c = /* @__PURE__ */ new Map();
|
|
1987
2075
|
for (const l of re(i)) {
|
|
1988
2076
|
if (!a.has(l.id)) continue;
|
|
1989
|
-
const u =
|
|
2077
|
+
const u = gs(
|
|
1990
2078
|
n.traverse({
|
|
1991
2079
|
field: q(l.id, "prodCtx"),
|
|
1992
2080
|
ignoreError: !0,
|
|
@@ -1997,7 +2085,7 @@ class Lr {
|
|
|
1997
2085
|
field: q(l.id, "prodUiCtx"),
|
|
1998
2086
|
stableIfNotFound: !0
|
|
1999
2087
|
})
|
|
2000
|
-
), d =
|
|
2088
|
+
), d = gs(
|
|
2001
2089
|
n.traverse({
|
|
2002
2090
|
field: q(l.id, "stagingCtx"),
|
|
2003
2091
|
ignoreError: !0,
|
|
@@ -2009,15 +2097,15 @@ class Lr {
|
|
|
2009
2097
|
);
|
|
2010
2098
|
c.set(l.id, { info: l, prod: u, staging: d });
|
|
2011
2099
|
}
|
|
2012
|
-
return new
|
|
2100
|
+
return new Nr(e, c);
|
|
2013
2101
|
}
|
|
2014
2102
|
}
|
|
2015
|
-
function
|
|
2103
|
+
function gs(s, e) {
|
|
2016
2104
|
if (e === void 0)
|
|
2017
2105
|
return s ? { locked: !1, results: /* @__PURE__ */ new Map() } : void 0;
|
|
2018
|
-
if (e.ok) return
|
|
2106
|
+
if (e.ok) return Hn(e.value, !1, !0);
|
|
2019
2107
|
}
|
|
2020
|
-
function
|
|
2108
|
+
function Br(s, e) {
|
|
2021
2109
|
return {
|
|
2022
2110
|
blockId: e,
|
|
2023
2111
|
args: (i) => kt(N(
|
|
@@ -2049,9 +2137,9 @@ function Dr(s, e) {
|
|
|
2049
2137
|
}
|
|
2050
2138
|
};
|
|
2051
2139
|
}
|
|
2052
|
-
function
|
|
2140
|
+
function Wn(s, e) {
|
|
2053
2141
|
return {
|
|
2054
|
-
...
|
|
2142
|
+
...Br(s, e),
|
|
2055
2143
|
prod: (t) => {
|
|
2056
2144
|
var r;
|
|
2057
2145
|
return (r = t.accessor(s).node({ ignoreError: !0 }).traverse({
|
|
@@ -2068,7 +2156,7 @@ function Hn(s, e) {
|
|
|
2068
2156
|
})) == null ? void 0 : n.persist();
|
|
2069
2157
|
return r === void 0 && t.markUnstable("staging_not_rendered"), r;
|
|
2070
2158
|
},
|
|
2071
|
-
getResultsPool: (t) =>
|
|
2159
|
+
getResultsPool: (t) => Nr.create(t, s, e)
|
|
2072
2160
|
};
|
|
2073
2161
|
}
|
|
2074
2162
|
function* ee(s, e) {
|
|
@@ -2123,7 +2211,7 @@ function* ee(s, e) {
|
|
|
2123
2211
|
Y(s);
|
|
2124
2212
|
}
|
|
2125
2213
|
}
|
|
2126
|
-
function
|
|
2214
|
+
function ma(s, e) {
|
|
2127
2215
|
const t = {};
|
|
2128
2216
|
for (const [r, n] of Object.entries(s)) t[r] = e(n);
|
|
2129
2217
|
return t;
|
|
@@ -2131,7 +2219,7 @@ function ga(s, e) {
|
|
|
2131
2219
|
function je(s, e) {
|
|
2132
2220
|
return s === void 0 ? void 0 : e(s);
|
|
2133
2221
|
}
|
|
2134
|
-
function
|
|
2222
|
+
function va(s) {
|
|
2135
2223
|
switch (s.type) {
|
|
2136
2224
|
case "GetImportProgress":
|
|
2137
2225
|
return !0;
|
|
@@ -2139,8 +2227,8 @@ function ma(s) {
|
|
|
2139
2227
|
return !1;
|
|
2140
2228
|
}
|
|
2141
2229
|
}
|
|
2142
|
-
function
|
|
2143
|
-
for (const e of ee(s)) if (
|
|
2230
|
+
function ya(s) {
|
|
2231
|
+
for (const e of ee(s)) if (va(e)) return !0;
|
|
2144
2232
|
return !1;
|
|
2145
2233
|
}
|
|
2146
2234
|
function gt(s) {
|
|
@@ -2149,53 +2237,53 @@ function gt(s) {
|
|
|
2149
2237
|
result: s
|
|
2150
2238
|
};
|
|
2151
2239
|
}
|
|
2152
|
-
function
|
|
2240
|
+
function I(s) {
|
|
2153
2241
|
return () => gt(s);
|
|
2154
2242
|
}
|
|
2155
|
-
const
|
|
2243
|
+
const wa = (s) => {
|
|
2156
2244
|
const e = {};
|
|
2157
2245
|
for (const [t, r] of Object.entries(s)) e[t] = r;
|
|
2158
|
-
return
|
|
2159
|
-
},
|
|
2246
|
+
return I(e);
|
|
2247
|
+
}, Sa = (s) => {
|
|
2160
2248
|
const e = s.source;
|
|
2161
|
-
if (e === void 0) return
|
|
2249
|
+
if (e === void 0) return I(void 0);
|
|
2162
2250
|
const t = [];
|
|
2163
2251
|
for (const r of e)
|
|
2164
2252
|
r instanceof Array ? t.push(...r) : t.push(r);
|
|
2165
|
-
return
|
|
2253
|
+
return I(t);
|
|
2166
2254
|
}, ba = (s) => {
|
|
2167
2255
|
const e = s.source, t = s.field;
|
|
2168
|
-
return e === void 0 || t === void 0 ?
|
|
2256
|
+
return e === void 0 || t === void 0 ? I(void 0) : ({ cCtx: r }) => {
|
|
2169
2257
|
var n;
|
|
2170
2258
|
return gt((n = r.accessor(e).node().traverse(t)) == null ? void 0 : n.persist());
|
|
2171
2259
|
};
|
|
2172
2260
|
};
|
|
2173
|
-
function
|
|
2261
|
+
function zn(s, e) {
|
|
2174
2262
|
const t = {}, r = s.length;
|
|
2175
2263
|
for (let n = 0; n < r; n++) t[String(n)] = e(s[n]);
|
|
2176
2264
|
return t;
|
|
2177
2265
|
}
|
|
2178
|
-
function
|
|
2266
|
+
function ka(s, e) {
|
|
2179
2267
|
return (t) => {
|
|
2180
2268
|
const r = t.source;
|
|
2181
|
-
return r === void 0 ?
|
|
2269
|
+
return r === void 0 ? I(void 0) : () => ({
|
|
2182
2270
|
type: "ScheduleSubroutine",
|
|
2183
|
-
subroutine:
|
|
2184
|
-
args:
|
|
2271
|
+
subroutine: Xn(r.length),
|
|
2272
|
+
args: zn(r, (n) => L({ ...s, [e.itVar]: n }, e.mapping))
|
|
2185
2273
|
});
|
|
2186
2274
|
};
|
|
2187
2275
|
}
|
|
2188
|
-
function
|
|
2276
|
+
function Xn(s) {
|
|
2189
2277
|
return (e) => {
|
|
2190
2278
|
const t = [];
|
|
2191
2279
|
for (let r = 0; r < s; r++) t.push(e[String(r)]);
|
|
2192
|
-
return
|
|
2280
|
+
return I(t);
|
|
2193
2281
|
};
|
|
2194
2282
|
}
|
|
2195
|
-
function
|
|
2283
|
+
function Ra(s, e) {
|
|
2196
2284
|
return (t) => {
|
|
2197
2285
|
const r = t.source;
|
|
2198
|
-
if (r === void 0) return
|
|
2286
|
+
if (r === void 0) return I(void 0);
|
|
2199
2287
|
const n = {};
|
|
2200
2288
|
for (const [i, o] of Object.entries(r)) {
|
|
2201
2289
|
const a = { ...s, [e.itVar]: o };
|
|
@@ -2203,41 +2291,41 @@ function ka(s, e) {
|
|
|
2203
2291
|
}
|
|
2204
2292
|
return () => ({
|
|
2205
2293
|
type: "ScheduleSubroutine",
|
|
2206
|
-
subroutine:
|
|
2294
|
+
subroutine: Ca,
|
|
2207
2295
|
args: n
|
|
2208
2296
|
});
|
|
2209
2297
|
};
|
|
2210
2298
|
}
|
|
2211
|
-
const
|
|
2299
|
+
const Ca = (s) => I(s), Ea = (s) => {
|
|
2212
2300
|
const e = s.arg;
|
|
2213
|
-
return
|
|
2214
|
-
}, Ea = (s) => {
|
|
2215
|
-
const e = s.operand;
|
|
2216
|
-
return T(e === void 0 ? void 0 : !e);
|
|
2301
|
+
return I(e === void 0 ? void 0 : e.length === 0);
|
|
2217
2302
|
}, Pa = (s) => {
|
|
2218
|
-
const e = s.
|
|
2219
|
-
return
|
|
2303
|
+
const e = s.operand;
|
|
2304
|
+
return I(e === void 0 ? void 0 : !e);
|
|
2220
2305
|
}, Oa = (s) => {
|
|
2221
2306
|
const e = s.operand1, t = s.operand2;
|
|
2222
|
-
return
|
|
2307
|
+
return I(e === void 0 || t === void 0 ? void 0 : e && t);
|
|
2223
2308
|
}, Fa = (s) => {
|
|
2309
|
+
const e = s.operand1, t = s.operand2;
|
|
2310
|
+
return I(e === void 0 || t === void 0 ? void 0 : e || t);
|
|
2311
|
+
}, Ta = (s) => {
|
|
2224
2312
|
const e = s.source;
|
|
2225
|
-
return e === void 0 ?
|
|
2313
|
+
return e === void 0 ? I(void 0) : ({ cCtx: t }) => {
|
|
2226
2314
|
var r;
|
|
2227
2315
|
return gt((r = t.accessor(e).node()) == null ? void 0 : r.getDataAsJson());
|
|
2228
2316
|
};
|
|
2229
2317
|
}, Ia = (s) => {
|
|
2230
2318
|
const e = s.source, t = s.field;
|
|
2231
|
-
return
|
|
2319
|
+
return I(e === void 0 || t === void 0 ? void 0 : e[t]);
|
|
2232
2320
|
};
|
|
2233
|
-
function
|
|
2321
|
+
function $a(s, e) {
|
|
2234
2322
|
return (t) => {
|
|
2235
2323
|
const r = t.source;
|
|
2236
|
-
return r === void 0 ?
|
|
2324
|
+
return r === void 0 ? I(void 0) : ({ cCtx: n }) => {
|
|
2237
2325
|
const i = n.accessor(r).node(), o = {};
|
|
2238
2326
|
for (const a of i.listInputFields()) {
|
|
2239
2327
|
const c = i.traverse(a);
|
|
2240
|
-
if (c === void 0) o[a] =
|
|
2328
|
+
if (c === void 0) o[a] = I(void 0);
|
|
2241
2329
|
else {
|
|
2242
2330
|
const l = { ...s, [e.itVar]: c.persist() };
|
|
2243
2331
|
o[a] = L(l, e.mapping);
|
|
@@ -2245,15 +2333,15 @@ function Ta(s, e) {
|
|
|
2245
2333
|
}
|
|
2246
2334
|
return {
|
|
2247
2335
|
type: "ScheduleSubroutine",
|
|
2248
|
-
subroutine:
|
|
2336
|
+
subroutine: Aa,
|
|
2249
2337
|
args: o
|
|
2250
2338
|
};
|
|
2251
2339
|
};
|
|
2252
2340
|
};
|
|
2253
2341
|
}
|
|
2254
|
-
const
|
|
2342
|
+
const Aa = (s) => I(s), La = (s) => (e) => {
|
|
2255
2343
|
const t = e.source;
|
|
2256
|
-
return t === void 0 ?
|
|
2344
|
+
return t === void 0 ? I(void 0) : ({ drivers: r }) => ({
|
|
2257
2345
|
type: "ScheduleComputable",
|
|
2258
2346
|
computable: K.make(
|
|
2259
2347
|
(n) => r.blobDriver.getDownloadedBlob(n.accessor(t).node().resourceInfo),
|
|
@@ -2265,9 +2353,9 @@ const $a = (s) => T(s), Aa = (s) => (e) => {
|
|
|
2265
2353
|
}
|
|
2266
2354
|
)
|
|
2267
2355
|
});
|
|
2268
|
-
},
|
|
2356
|
+
}, Da = (s) => (e) => {
|
|
2269
2357
|
const t = e.source;
|
|
2270
|
-
return t === void 0 ?
|
|
2358
|
+
return t === void 0 ? I(void 0) : ({ cCtx: r, drivers: n }) => {
|
|
2271
2359
|
const i = r.accessor(t).node().resourceInfo;
|
|
2272
2360
|
return {
|
|
2273
2361
|
type: "ScheduleComputable",
|
|
@@ -2276,9 +2364,9 @@ const $a = (s) => T(s), Aa = (s) => (e) => {
|
|
|
2276
2364
|
})
|
|
2277
2365
|
};
|
|
2278
2366
|
};
|
|
2279
|
-
},
|
|
2367
|
+
}, Na = (s) => (e) => {
|
|
2280
2368
|
const t = e.source;
|
|
2281
|
-
return t === void 0 ?
|
|
2369
|
+
return t === void 0 ? I(void 0) : ({ drivers: r }) => ({
|
|
2282
2370
|
type: "ScheduleComputable",
|
|
2283
2371
|
computable: K.make(
|
|
2284
2372
|
(n) => r.blobDriver.getDownloadedBlob(n.accessor(t).node().resourceInfo, n),
|
|
@@ -2292,51 +2380,51 @@ const $a = (s) => T(s), Aa = (s) => (e) => {
|
|
|
2292
2380
|
}
|
|
2293
2381
|
)
|
|
2294
2382
|
});
|
|
2295
|
-
},
|
|
2383
|
+
}, Ba = (s) => {
|
|
2296
2384
|
const e = s.source;
|
|
2297
|
-
return e === void 0 ?
|
|
2385
|
+
return e === void 0 ? I(void 0) : (t) => ({
|
|
2298
2386
|
type: "ScheduleComputable",
|
|
2299
2387
|
computable: t.drivers.blobDriver.getDownloadedBlob(e)
|
|
2300
2388
|
});
|
|
2301
|
-
},
|
|
2389
|
+
}, ja = (s) => {
|
|
2302
2390
|
const e = s.source;
|
|
2303
|
-
return e === void 0 ?
|
|
2391
|
+
return e === void 0 ? I(void 0) : ({ drivers: t }) => ({
|
|
2304
2392
|
type: "ScheduleComputable",
|
|
2305
2393
|
computable: t.blobDriver.getOnDemandBlob(e)
|
|
2306
2394
|
});
|
|
2307
|
-
},
|
|
2395
|
+
}, xa = (s) => (e) => {
|
|
2308
2396
|
const t = e.source;
|
|
2309
|
-
return t === void 0 ?
|
|
2397
|
+
return t === void 0 ? I(void 0) : ({ drivers: r }) => ({
|
|
2310
2398
|
type: "ScheduleComputable",
|
|
2311
2399
|
computable: r.blobToURLDriver.extractArchiveAndGetURL(t, s)
|
|
2312
2400
|
});
|
|
2313
|
-
},
|
|
2401
|
+
}, Va = (s) => {
|
|
2314
2402
|
const e = s.source;
|
|
2315
|
-
return e === void 0 ?
|
|
2403
|
+
return e === void 0 ? I(void 0) : ({ drivers: t }) => ({
|
|
2316
2404
|
type: "ScheduleComputable",
|
|
2317
2405
|
computable: t.uploadDriver.getProgressId(e)
|
|
2318
2406
|
});
|
|
2319
|
-
},
|
|
2407
|
+
}, Ua = (s) => (e) => {
|
|
2320
2408
|
const t = e.source;
|
|
2321
|
-
return t === void 0 ?
|
|
2409
|
+
return t === void 0 ? I(void 0) : ({ drivers: r }) => ({
|
|
2322
2410
|
type: "ScheduleComputable",
|
|
2323
2411
|
computable: r.logDriver.getLastLogs(t, s)
|
|
2324
2412
|
});
|
|
2325
|
-
},
|
|
2413
|
+
}, Ma = (s) => (e) => {
|
|
2326
2414
|
const t = e.source;
|
|
2327
|
-
return t === void 0 ?
|
|
2415
|
+
return t === void 0 ? I(void 0) : ({ drivers: r }) => ({
|
|
2328
2416
|
type: "ScheduleComputable",
|
|
2329
2417
|
computable: r.logDriver.getProgressLog(t, s)
|
|
2330
2418
|
});
|
|
2331
|
-
},
|
|
2419
|
+
}, Ja = (s) => (e) => {
|
|
2332
2420
|
const t = e.source;
|
|
2333
|
-
return t === void 0 ?
|
|
2421
|
+
return t === void 0 ? I(void 0) : ({ drivers: r }) => ({
|
|
2334
2422
|
type: "ScheduleComputable",
|
|
2335
2423
|
computable: r.logDriver.getProgressLogWithInfo(t, s)
|
|
2336
2424
|
});
|
|
2337
|
-
},
|
|
2425
|
+
}, Ga = (s) => {
|
|
2338
2426
|
const e = s.source;
|
|
2339
|
-
return e === void 0 ?
|
|
2427
|
+
return e === void 0 ? I(void 0) : ({ drivers: t }) => ({
|
|
2340
2428
|
type: "ScheduleComputable",
|
|
2341
2429
|
computable: t.logDriver.getLogHandle(e)
|
|
2342
2430
|
});
|
|
@@ -2345,15 +2433,15 @@ function L(s, e) {
|
|
|
2345
2433
|
switch (e.type) {
|
|
2346
2434
|
case "GetFromCtx": {
|
|
2347
2435
|
const t = s[e.variable];
|
|
2348
|
-
return typeof t == "function" ? (r) => gt(t(r.cCtx)) :
|
|
2436
|
+
return typeof t == "function" ? (r) => gt(t(r.cCtx)) : I(t);
|
|
2349
2437
|
}
|
|
2350
2438
|
case "Isolate":
|
|
2351
2439
|
return ({ drivers: t }) => ({
|
|
2352
2440
|
type: "ScheduleComputable",
|
|
2353
|
-
computable:
|
|
2441
|
+
computable: Zn(t, s, e.cfg)
|
|
2354
2442
|
});
|
|
2355
2443
|
case "Immediate":
|
|
2356
|
-
return
|
|
2444
|
+
return I(e.value);
|
|
2357
2445
|
case "GetJsonField":
|
|
2358
2446
|
return () => ({
|
|
2359
2447
|
type: "ScheduleSubroutine",
|
|
@@ -2366,7 +2454,7 @@ function L(s, e) {
|
|
|
2366
2454
|
case "MapArrayValues":
|
|
2367
2455
|
return () => ({
|
|
2368
2456
|
type: "ScheduleSubroutine",
|
|
2369
|
-
subroutine:
|
|
2457
|
+
subroutine: ka(s, e),
|
|
2370
2458
|
args: {
|
|
2371
2459
|
source: L(s, e.source)
|
|
2372
2460
|
}
|
|
@@ -2374,7 +2462,7 @@ function L(s, e) {
|
|
|
2374
2462
|
case "MapRecordValues":
|
|
2375
2463
|
return () => ({
|
|
2376
2464
|
type: "ScheduleSubroutine",
|
|
2377
|
-
subroutine:
|
|
2465
|
+
subroutine: Ra(s, e),
|
|
2378
2466
|
args: {
|
|
2379
2467
|
source: L(s, e.source)
|
|
2380
2468
|
}
|
|
@@ -2382,19 +2470,19 @@ function L(s, e) {
|
|
|
2382
2470
|
case "MakeObject":
|
|
2383
2471
|
return () => ({
|
|
2384
2472
|
type: "ScheduleSubroutine",
|
|
2385
|
-
subroutine:
|
|
2386
|
-
args:
|
|
2473
|
+
subroutine: wa,
|
|
2474
|
+
args: ma(e.template, (t) => L(s, t))
|
|
2387
2475
|
});
|
|
2388
2476
|
case "MakeArray":
|
|
2389
2477
|
return () => ({
|
|
2390
2478
|
type: "ScheduleSubroutine",
|
|
2391
|
-
subroutine:
|
|
2392
|
-
args:
|
|
2479
|
+
subroutine: Xn(e.template.length),
|
|
2480
|
+
args: zn(e.template, (t) => L(s, t))
|
|
2393
2481
|
});
|
|
2394
2482
|
case "Flatten":
|
|
2395
2483
|
return () => ({
|
|
2396
2484
|
type: "ScheduleSubroutine",
|
|
2397
|
-
subroutine:
|
|
2485
|
+
subroutine: Sa,
|
|
2398
2486
|
args: {
|
|
2399
2487
|
source: L(s, e.source)
|
|
2400
2488
|
}
|
|
@@ -2402,7 +2490,7 @@ function L(s, e) {
|
|
|
2402
2490
|
case "IsEmpty":
|
|
2403
2491
|
return () => ({
|
|
2404
2492
|
type: "ScheduleSubroutine",
|
|
2405
|
-
subroutine:
|
|
2493
|
+
subroutine: Ea,
|
|
2406
2494
|
args: {
|
|
2407
2495
|
arg: L(s, e.arg)
|
|
2408
2496
|
}
|
|
@@ -2410,7 +2498,7 @@ function L(s, e) {
|
|
|
2410
2498
|
case "Not":
|
|
2411
2499
|
return () => ({
|
|
2412
2500
|
type: "ScheduleSubroutine",
|
|
2413
|
-
subroutine:
|
|
2501
|
+
subroutine: Pa,
|
|
2414
2502
|
args: {
|
|
2415
2503
|
operand: L(s, e.operand)
|
|
2416
2504
|
}
|
|
@@ -2418,7 +2506,7 @@ function L(s, e) {
|
|
|
2418
2506
|
case "And":
|
|
2419
2507
|
return () => ({
|
|
2420
2508
|
type: "ScheduleSubroutine",
|
|
2421
|
-
subroutine:
|
|
2509
|
+
subroutine: Oa,
|
|
2422
2510
|
args: {
|
|
2423
2511
|
operand1: L(s, e.operand1),
|
|
2424
2512
|
operand2: L(s, e.operand2)
|
|
@@ -2427,7 +2515,7 @@ function L(s, e) {
|
|
|
2427
2515
|
case "Or":
|
|
2428
2516
|
return () => ({
|
|
2429
2517
|
type: "ScheduleSubroutine",
|
|
2430
|
-
subroutine:
|
|
2518
|
+
subroutine: Fa,
|
|
2431
2519
|
args: {
|
|
2432
2520
|
operand1: L(s, e.operand1),
|
|
2433
2521
|
operand2: L(s, e.operand2)
|
|
@@ -2436,7 +2524,7 @@ function L(s, e) {
|
|
|
2436
2524
|
case "MapResourceFields":
|
|
2437
2525
|
return () => ({
|
|
2438
2526
|
type: "ScheduleSubroutine",
|
|
2439
|
-
subroutine:
|
|
2527
|
+
subroutine: $a(s, e),
|
|
2440
2528
|
args: {
|
|
2441
2529
|
source: L(s, e.source)
|
|
2442
2530
|
}
|
|
@@ -2453,7 +2541,7 @@ function L(s, e) {
|
|
|
2453
2541
|
case "GetResourceValueAsJson":
|
|
2454
2542
|
return () => ({
|
|
2455
2543
|
type: "ScheduleSubroutine",
|
|
2456
|
-
subroutine:
|
|
2544
|
+
subroutine: Ta,
|
|
2457
2545
|
args: {
|
|
2458
2546
|
source: L(s, e.source)
|
|
2459
2547
|
}
|
|
@@ -2461,7 +2549,7 @@ function L(s, e) {
|
|
|
2461
2549
|
case "GetBlobContent":
|
|
2462
2550
|
return () => ({
|
|
2463
2551
|
type: "ScheduleSubroutine",
|
|
2464
|
-
subroutine:
|
|
2552
|
+
subroutine: La(e.range),
|
|
2465
2553
|
args: {
|
|
2466
2554
|
source: L(s, e.source)
|
|
2467
2555
|
}
|
|
@@ -2469,7 +2557,7 @@ function L(s, e) {
|
|
|
2469
2557
|
case "GetBlobContentAsString":
|
|
2470
2558
|
return () => ({
|
|
2471
2559
|
type: "ScheduleSubroutine",
|
|
2472
|
-
subroutine:
|
|
2560
|
+
subroutine: Da(e.range),
|
|
2473
2561
|
args: {
|
|
2474
2562
|
source: L(s, e.source)
|
|
2475
2563
|
}
|
|
@@ -2477,7 +2565,7 @@ function L(s, e) {
|
|
|
2477
2565
|
case "GetBlobContentAsJson":
|
|
2478
2566
|
return () => ({
|
|
2479
2567
|
type: "ScheduleSubroutine",
|
|
2480
|
-
subroutine:
|
|
2568
|
+
subroutine: Na(e.range),
|
|
2481
2569
|
args: {
|
|
2482
2570
|
source: L(s, e.source)
|
|
2483
2571
|
}
|
|
@@ -2485,7 +2573,7 @@ function L(s, e) {
|
|
|
2485
2573
|
case "GetDownloadedBlobContent":
|
|
2486
2574
|
return () => ({
|
|
2487
2575
|
type: "ScheduleSubroutine",
|
|
2488
|
-
subroutine:
|
|
2576
|
+
subroutine: Ba,
|
|
2489
2577
|
args: {
|
|
2490
2578
|
source: L(s, e.source)
|
|
2491
2579
|
}
|
|
@@ -2493,7 +2581,7 @@ function L(s, e) {
|
|
|
2493
2581
|
case "GetOnDemandBlobContent":
|
|
2494
2582
|
return () => ({
|
|
2495
2583
|
type: "ScheduleSubroutine",
|
|
2496
|
-
subroutine:
|
|
2584
|
+
subroutine: ja,
|
|
2497
2585
|
args: {
|
|
2498
2586
|
source: L(s, e.source)
|
|
2499
2587
|
}
|
|
@@ -2501,7 +2589,7 @@ function L(s, e) {
|
|
|
2501
2589
|
case "ExtractArchiveAndGetURL":
|
|
2502
2590
|
return () => ({
|
|
2503
2591
|
type: "ScheduleSubroutine",
|
|
2504
|
-
subroutine:
|
|
2592
|
+
subroutine: xa(e.format),
|
|
2505
2593
|
args: {
|
|
2506
2594
|
source: L(s, e.source)
|
|
2507
2595
|
}
|
|
@@ -2509,7 +2597,7 @@ function L(s, e) {
|
|
|
2509
2597
|
case "GetImportProgress":
|
|
2510
2598
|
return () => ({
|
|
2511
2599
|
type: "ScheduleSubroutine",
|
|
2512
|
-
subroutine:
|
|
2600
|
+
subroutine: Va,
|
|
2513
2601
|
args: {
|
|
2514
2602
|
source: L(s, e.source)
|
|
2515
2603
|
}
|
|
@@ -2517,7 +2605,7 @@ function L(s, e) {
|
|
|
2517
2605
|
case "GetLastLogs":
|
|
2518
2606
|
return () => ({
|
|
2519
2607
|
type: "ScheduleSubroutine",
|
|
2520
|
-
subroutine:
|
|
2608
|
+
subroutine: Ua(e.lines),
|
|
2521
2609
|
args: {
|
|
2522
2610
|
source: L(s, e.source)
|
|
2523
2611
|
}
|
|
@@ -2525,7 +2613,7 @@ function L(s, e) {
|
|
|
2525
2613
|
case "GetProgressLog":
|
|
2526
2614
|
return () => ({
|
|
2527
2615
|
type: "ScheduleSubroutine",
|
|
2528
|
-
subroutine:
|
|
2616
|
+
subroutine: Ma(e.patternToSearch),
|
|
2529
2617
|
args: {
|
|
2530
2618
|
source: L(s, e.source)
|
|
2531
2619
|
}
|
|
@@ -2533,7 +2621,7 @@ function L(s, e) {
|
|
|
2533
2621
|
case "GetProgressLogWithInfo":
|
|
2534
2622
|
return () => ({
|
|
2535
2623
|
type: "ScheduleSubroutine",
|
|
2536
|
-
subroutine:
|
|
2624
|
+
subroutine: Ja(e.patternToSearch),
|
|
2537
2625
|
args: {
|
|
2538
2626
|
source: L(s, e.source)
|
|
2539
2627
|
}
|
|
@@ -2541,7 +2629,7 @@ function L(s, e) {
|
|
|
2541
2629
|
case "GetLogHandle":
|
|
2542
2630
|
return () => ({
|
|
2543
2631
|
type: "ScheduleSubroutine",
|
|
2544
|
-
subroutine:
|
|
2632
|
+
subroutine: Ga,
|
|
2545
2633
|
args: {
|
|
2546
2634
|
source: L(s, e.source)
|
|
2547
2635
|
}
|
|
@@ -2550,8 +2638,8 @@ function L(s, e) {
|
|
|
2550
2638
|
return Y(e);
|
|
2551
2639
|
}
|
|
2552
2640
|
}
|
|
2553
|
-
const
|
|
2554
|
-
function
|
|
2641
|
+
const _a = ["$prod", "$staging"];
|
|
2642
|
+
function qa(s) {
|
|
2555
2643
|
return {
|
|
2556
2644
|
$blockId: s.blockId,
|
|
2557
2645
|
$args: (e) => JSON.parse(s.args(e)),
|
|
@@ -2563,16 +2651,16 @@ function _a(s) {
|
|
|
2563
2651
|
$staging: s.staging
|
|
2564
2652
|
};
|
|
2565
2653
|
}
|
|
2566
|
-
const
|
|
2567
|
-
function
|
|
2568
|
-
return s.op ==
|
|
2654
|
+
const Yn = Symbol(), Qn = "return", Ka = { op: Yn, arg: Qn };
|
|
2655
|
+
function Ha(s) {
|
|
2656
|
+
return s.op == Yn && s.arg == Qn;
|
|
2569
2657
|
}
|
|
2570
|
-
function
|
|
2658
|
+
function Wa() {
|
|
2571
2659
|
return { pendingSubroutines: /* @__PURE__ */ new Map() };
|
|
2572
2660
|
}
|
|
2573
|
-
function
|
|
2574
|
-
const n = new
|
|
2575
|
-
if (
|
|
2661
|
+
function ms(s, e, t, r) {
|
|
2662
|
+
const n = new Cn(t), i = (a, c) => {
|
|
2663
|
+
if (Ha(a))
|
|
2576
2664
|
return e.result = c, !1;
|
|
2577
2665
|
const l = N(e.pendingSubroutines.get(a.op));
|
|
2578
2666
|
if (a.arg in l.args) throw new Error("argument already set");
|
|
@@ -2625,26 +2713,26 @@ function gs(s, e, t, r) {
|
|
|
2625
2713
|
}
|
|
2626
2714
|
return o;
|
|
2627
2715
|
}
|
|
2628
|
-
function
|
|
2629
|
-
return
|
|
2716
|
+
function za(s, e, t, r = {}) {
|
|
2717
|
+
return Zn(s, qa(e), t, r);
|
|
2630
2718
|
}
|
|
2631
|
-
function
|
|
2719
|
+
function Zn(s, e, t, r = {}) {
|
|
2632
2720
|
const n = `${e.blockId}#` + te({
|
|
2633
2721
|
ctx: Object.fromEntries(
|
|
2634
|
-
Object.entries(e).filter(([i]) =>
|
|
2722
|
+
Object.entries(e).filter(([i]) => _a.indexOf(i) === -1)
|
|
2635
2723
|
),
|
|
2636
2724
|
cfg: t
|
|
2637
2725
|
});
|
|
2638
2726
|
return K.makeRaw(
|
|
2639
2727
|
(i) => {
|
|
2640
|
-
const o = { drivers: s, cCtx: i }, a =
|
|
2728
|
+
const o = { drivers: s, cCtx: i }, a = Wa();
|
|
2641
2729
|
return {
|
|
2642
|
-
ir:
|
|
2730
|
+
ir: ms(
|
|
2643
2731
|
o,
|
|
2644
2732
|
a,
|
|
2645
2733
|
[
|
|
2646
2734
|
{
|
|
2647
|
-
destination:
|
|
2735
|
+
destination: Ka,
|
|
2648
2736
|
operation: L(e, t)
|
|
2649
2737
|
}
|
|
2650
2738
|
],
|
|
@@ -2653,7 +2741,7 @@ function Qn(s, e, t, r = {}) {
|
|
|
2653
2741
|
postprocessValue(l) {
|
|
2654
2742
|
const u = [];
|
|
2655
2743
|
for (const v of l)
|
|
2656
|
-
u.push({ destination: v.destination, operation:
|
|
2744
|
+
u.push({ destination: v.destination, operation: I(v.computable) });
|
|
2657
2745
|
const d = {
|
|
2658
2746
|
drivers: s,
|
|
2659
2747
|
get cCtx() {
|
|
@@ -2666,7 +2754,7 @@ function Qn(s, e, t, r = {}) {
|
|
|
2666
2754
|
result: a.result,
|
|
2667
2755
|
pendingSubroutines: p
|
|
2668
2756
|
};
|
|
2669
|
-
if (
|
|
2757
|
+
if (ms(d, f, u, !1), !("result" in f))
|
|
2670
2758
|
throw new Error("illegal cfg rendering stack state, no result");
|
|
2671
2759
|
return f.result;
|
|
2672
2760
|
}
|
|
@@ -2675,19 +2763,19 @@ function Qn(s, e, t, r = {}) {
|
|
|
2675
2763
|
{ ...r, key: n }
|
|
2676
2764
|
);
|
|
2677
2765
|
}
|
|
2678
|
-
function
|
|
2766
|
+
function vs(s) {
|
|
2679
2767
|
return s !== void 0 ? Buffer.from(s).toString("base64") : void 0;
|
|
2680
2768
|
}
|
|
2681
|
-
class
|
|
2769
|
+
class Xa {
|
|
2682
2770
|
constructor(e, t, r, n, i) {
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2771
|
+
S(this, "computablesToResolve", {});
|
|
2772
|
+
S(this, "computableCtx");
|
|
2773
|
+
S(this, "accessors", /* @__PURE__ */ new Map());
|
|
2774
|
+
S(this, "meta");
|
|
2687
2775
|
//
|
|
2688
2776
|
// Result Pool
|
|
2689
2777
|
//
|
|
2690
|
-
|
|
2778
|
+
S(this, "_resultPool");
|
|
2691
2779
|
this.parent = e, this.blockCtx = t, this.env = r, this.featureFlags = n, this.computableCtx = i, this.meta = t.blockMeta(i);
|
|
2692
2780
|
}
|
|
2693
2781
|
resetComputableCtx() {
|
|
@@ -2745,13 +2833,13 @@ class za {
|
|
|
2745
2833
|
return this.getAccessor(e).listDynamicFields();
|
|
2746
2834
|
}
|
|
2747
2835
|
getKeyValueBase64(e, t) {
|
|
2748
|
-
return
|
|
2836
|
+
return vs(this.getAccessor(e).getKeyValue(t));
|
|
2749
2837
|
}
|
|
2750
2838
|
getKeyValueAsString(e, t) {
|
|
2751
2839
|
return this.getAccessor(e).getKeyValueAsString(t);
|
|
2752
2840
|
}
|
|
2753
2841
|
getDataBase64(e) {
|
|
2754
|
-
return
|
|
2842
|
+
return vs(this.getAccessor(e).getData());
|
|
2755
2843
|
}
|
|
2756
2844
|
getDataAsString(e) {
|
|
2757
2845
|
return this.getAccessor(e).getDataAsString();
|
|
@@ -2762,16 +2850,16 @@ class za {
|
|
|
2762
2850
|
parsePObjectCollection(e, t, r, ...n) {
|
|
2763
2851
|
const i = this.getAccessor(e);
|
|
2764
2852
|
if (!i.getIsReadyOrError()) return;
|
|
2765
|
-
const o =
|
|
2853
|
+
const o = ga(i, t, r, n), a = {};
|
|
2766
2854
|
for (const [c, l] of Object.entries(o))
|
|
2767
|
-
a[c] =
|
|
2855
|
+
a[c] = me(l, (u) => this.wrapAccessor(u));
|
|
2768
2856
|
return a;
|
|
2769
2857
|
}
|
|
2770
2858
|
//
|
|
2771
2859
|
// Blobs
|
|
2772
2860
|
//
|
|
2773
2861
|
registerComputable(e, t) {
|
|
2774
|
-
const r = `${e}_${
|
|
2862
|
+
const r = `${e}_${he()}`;
|
|
2775
2863
|
return this.computablesToResolve[r] = t, r;
|
|
2776
2864
|
}
|
|
2777
2865
|
getBlobContentAsString(e, t) {
|
|
@@ -2897,7 +2985,7 @@ class za {
|
|
|
2897
2985
|
isComplete: e.isComplete,
|
|
2898
2986
|
entries: e.entries.map((t) => ({
|
|
2899
2987
|
ref: t.ref,
|
|
2900
|
-
obj:
|
|
2988
|
+
obj: me(t.obj, (r) => this.wrapAccessor(r))
|
|
2901
2989
|
}))
|
|
2902
2990
|
};
|
|
2903
2991
|
}
|
|
@@ -2910,7 +2998,7 @@ class za {
|
|
|
2910
2998
|
obj: {
|
|
2911
2999
|
id: t.obj.id,
|
|
2912
3000
|
spec: t.obj.spec,
|
|
2913
|
-
data:
|
|
3001
|
+
data: gn(t.obj.data, (r) => this.wrapAccessor(r))
|
|
2914
3002
|
}
|
|
2915
3003
|
}))
|
|
2916
3004
|
};
|
|
@@ -2923,7 +3011,7 @@ class za {
|
|
|
2923
3011
|
return this.resultPool.getSpecByRef(e, t);
|
|
2924
3012
|
}
|
|
2925
3013
|
getDataFromResultPoolByRef(e, t) {
|
|
2926
|
-
return
|
|
3014
|
+
return me(
|
|
2927
3015
|
this.resultPool.getDataByRef(e, t),
|
|
2928
3016
|
(r) => this.wrapAccessor(r)
|
|
2929
3017
|
);
|
|
@@ -2937,7 +3025,7 @@ class za {
|
|
|
2937
3025
|
"can't instantiate PFrames from this context (most porbably called from the future mapper)"
|
|
2938
3026
|
);
|
|
2939
3027
|
return this.env.driverKit.pFrameDriver.createPFrame(
|
|
2940
|
-
e.map((t) =>
|
|
3028
|
+
e.map((t) => me(t, (r) => this.transformInputPData(r))),
|
|
2941
3029
|
this.computableCtx
|
|
2942
3030
|
);
|
|
2943
3031
|
}
|
|
@@ -2947,9 +3035,9 @@ class za {
|
|
|
2947
3035
|
"can't instantiate PTable from this context (most porbably called from the future mapper)"
|
|
2948
3036
|
);
|
|
2949
3037
|
return this.env.driverKit.pFrameDriver.createPTable(
|
|
2950
|
-
|
|
3038
|
+
wr(
|
|
2951
3039
|
e,
|
|
2952
|
-
(t) =>
|
|
3040
|
+
(t) => me(t, (r) => this.transformInputPData(r))
|
|
2953
3041
|
),
|
|
2954
3042
|
this.computableCtx
|
|
2955
3043
|
);
|
|
@@ -2961,7 +3049,7 @@ class za {
|
|
|
2961
3049
|
* - Passes through other values
|
|
2962
3050
|
*/
|
|
2963
3051
|
transformInputPData(e) {
|
|
2964
|
-
return typeof e == "string" ? this.getAccessor(e) :
|
|
3052
|
+
return typeof e == "string" ? this.getAccessor(e) : mn(e) ? vn(e, (t) => this.getAccessor(t)) : e;
|
|
2965
3053
|
}
|
|
2966
3054
|
//
|
|
2967
3055
|
// Computable
|
|
@@ -2992,7 +3080,7 @@ class za {
|
|
|
2992
3080
|
}
|
|
2993
3081
|
wrapAccessor(e) {
|
|
2994
3082
|
if (e !== void 0) {
|
|
2995
|
-
const t =
|
|
3083
|
+
const t = he();
|
|
2996
3084
|
return this.accessors.set(t, e), t;
|
|
2997
3085
|
}
|
|
2998
3086
|
}
|
|
@@ -3010,7 +3098,7 @@ class za {
|
|
|
3010
3098
|
};
|
|
3011
3099
|
r.newFunction(o, c).consume((l) => r.setProp(e, o, l)), r.newFunction(o, a).consume((l) => r.setProp(e, o + "__internal__", l));
|
|
3012
3100
|
};
|
|
3013
|
-
if (
|
|
3101
|
+
if (ho(this.featureFlags, "supportsLazyState"))
|
|
3014
3102
|
i("args", () => {
|
|
3015
3103
|
if (this.computableCtx === void 0)
|
|
3016
3104
|
throw new Error("Add dummy call to ctx.args outside the future lambda. Can't be directly used in this context.");
|
|
@@ -3115,16 +3203,16 @@ class za {
|
|
|
3115
3203
|
});
|
|
3116
3204
|
}
|
|
3117
3205
|
}
|
|
3118
|
-
function
|
|
3206
|
+
function Ya(s) {
|
|
3119
3207
|
return s instanceof ArrayBuffer || ArrayBuffer.isView(s);
|
|
3120
3208
|
}
|
|
3121
3209
|
class Ke {
|
|
3122
3210
|
constructor(e, t, r, n, i) {
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3211
|
+
S(this, "callbackRegistry");
|
|
3212
|
+
S(this, "fnJSONStringify");
|
|
3213
|
+
S(this, "fnJSONParse");
|
|
3214
|
+
S(this, "errorRepo", new Qa());
|
|
3215
|
+
S(this, "computableHelper");
|
|
3128
3216
|
if (this.scope = e, this.vm = t, this.deadlineSetter = r, this.callbackRegistry = this.scope.manage(this.vm.newObject()), this.fnJSONStringify = e.manage(
|
|
3129
3217
|
t.getProp(t.global, "JSON").consume((o) => t.getProp(o, "stringify"))
|
|
3130
3218
|
), t.typeof(this.fnJSONStringify) !== "function")
|
|
@@ -3132,7 +3220,7 @@ class Ke {
|
|
|
3132
3220
|
if (this.fnJSONParse = e.manage(
|
|
3133
3221
|
t.getProp(t.global, "JSON").consume((o) => t.getProp(o, "parse"))
|
|
3134
3222
|
), t.typeof(this.fnJSONParse) !== "function") throw new Error("JSON.parse() not found.");
|
|
3135
|
-
i !== void 0 && (this.computableHelper = new
|
|
3223
|
+
i !== void 0 && (this.computableHelper = new Xa(this, i.blockCtx, i.mlEnv, n, i.computableCtx)), this.injectCtx();
|
|
3136
3224
|
}
|
|
3137
3225
|
resetComputableCtx() {
|
|
3138
3226
|
N(this.computableHelper, "Computable context helper is not initialized").resetComputableCtx();
|
|
@@ -3209,7 +3297,7 @@ class Ke {
|
|
|
3209
3297
|
r = this.vm.null;
|
|
3210
3298
|
break;
|
|
3211
3299
|
}
|
|
3212
|
-
if (
|
|
3300
|
+
if (Ya(e)) {
|
|
3213
3301
|
r = this.vm.newArrayBuffer(e), n = !0;
|
|
3214
3302
|
break;
|
|
3215
3303
|
}
|
|
@@ -3251,18 +3339,18 @@ class Ke {
|
|
|
3251
3339
|
this.vm.setProp(t, "callbackRegistry", this.callbackRegistry), this.vm.setProp(
|
|
3252
3340
|
t,
|
|
3253
3341
|
"featureFlags",
|
|
3254
|
-
this.exportObjectUniversal(
|
|
3342
|
+
this.exportObjectUniversal(go.GlobalCfgRenderCtxFeatureFlags, e)
|
|
3255
3343
|
), this.computableHelper !== void 0 && this.computableHelper.injectCtx(t), this.vm.setProp(this.vm.global, "cfgRenderCtx", t);
|
|
3256
3344
|
});
|
|
3257
3345
|
}
|
|
3258
3346
|
}
|
|
3259
|
-
class
|
|
3347
|
+
class Qa {
|
|
3260
3348
|
constructor() {
|
|
3261
|
-
|
|
3349
|
+
S(this, "errorIdToError", /* @__PURE__ */ new Map());
|
|
3262
3350
|
}
|
|
3263
3351
|
/** Sets the error to the repository and returns a mimicrated error that also has uuid key of the original error. */
|
|
3264
3352
|
setAndRecreateForQuickJS(e) {
|
|
3265
|
-
const t =
|
|
3353
|
+
const t = he();
|
|
3266
3354
|
return this.errorIdToError.set(t, e), e instanceof Error ? {
|
|
3267
3355
|
name: `${e.name}/uuid:${t}`,
|
|
3268
3356
|
message: e.message
|
|
@@ -3273,7 +3361,7 @@ class Ya {
|
|
|
3273
3361
|
}
|
|
3274
3362
|
/** Returns the original error that was stored by parsing uuid of mimicrated error. */
|
|
3275
3363
|
getOriginal(e) {
|
|
3276
|
-
if (!(e instanceof
|
|
3364
|
+
if (!(e instanceof Yo.QuickJSUnwrapError))
|
|
3277
3365
|
return console.warn("ErrorRepo: quickJSError is not a QuickJSUnwrapError", Ye(e)), e;
|
|
3278
3366
|
if (!("name" in e.cause))
|
|
3279
3367
|
return console.warn("ErrorRepo: quickJSError.cause is not an Error", Ye(e)), e;
|
|
@@ -3283,13 +3371,13 @@ class Ya {
|
|
|
3283
3371
|
const n = this.errorIdToError.get(r);
|
|
3284
3372
|
if (n === void 0)
|
|
3285
3373
|
throw new Error(`ErrorRepo: errorId not found: ${r}, ${Ye(e)}`);
|
|
3286
|
-
return new
|
|
3374
|
+
return new Zo(e, n);
|
|
3287
3375
|
}
|
|
3288
3376
|
}
|
|
3289
|
-
function
|
|
3377
|
+
function ys(s, e, t, r, n) {
|
|
3290
3378
|
Q().logOutputStatus && (Q().logOutputStatus === "any" || !t) && console.log(t ? `Stable output ${s} calculated ${e !== void 0 ? "defined" : "undefined"}; (#${r})` : `Unstable output ${s}; marker = ${n}; ${e !== void 0 ? "defined" : "undefined"} (#${r})`);
|
|
3291
3379
|
}
|
|
3292
|
-
function
|
|
3380
|
+
function Za(s, e, t, r, n, i = {}) {
|
|
3293
3381
|
const { code: o, featureFlags: a } = r, c = `${e.blockId}#lambda#${n}#${t.handle}`;
|
|
3294
3382
|
return i = { ...i, key: c }, i.mode === void 0 && t.retentive === !0 && (i.mode = "StableOnlyRetentive"), K.makeRaw((l) => {
|
|
3295
3383
|
Q().logOutputRecalculations && console.log(`Block lambda recalculation : ${c} (${l.changeSourceMarker}; ${l.bodyInvocations} invocations)`);
|
|
@@ -3313,20 +3401,20 @@ function Qa(s, e, t, r, n, i = {}) {
|
|
|
3313
3401
|
{ computableCtx: l, blockCtx: e, mlEnv: s }
|
|
3314
3402
|
);
|
|
3315
3403
|
h.evaluateBundle(o.content);
|
|
3316
|
-
const
|
|
3404
|
+
const b = h.runCallback(t.handle);
|
|
3317
3405
|
h.resetComputableCtx();
|
|
3318
3406
|
const E = h.computableHelper.computablesToResolve;
|
|
3319
3407
|
if (Object.keys(E).length === 0) {
|
|
3320
|
-
const F = h.importObjectUniversal(
|
|
3321
|
-
return
|
|
3408
|
+
const F = h.importObjectUniversal(b);
|
|
3409
|
+
return ys(t.handle, F, l.unstableMarker === void 0, -1, l.unstableMarker), { ir: F };
|
|
3322
3410
|
}
|
|
3323
3411
|
let B = 0;
|
|
3324
3412
|
return Q().logOutputStatus && console.log(`Output ${t.handle} scaffold calculated (not all computables resolved yet).`), d = !0, {
|
|
3325
3413
|
ir: E,
|
|
3326
3414
|
postprocessValue: (F, { unstableMarker: j, stable: V }) => {
|
|
3327
3415
|
for (const [$, C] of Object.entries(F)) h.runCallback($, C);
|
|
3328
|
-
const P = h.importObjectUniversal(
|
|
3329
|
-
return B++,
|
|
3416
|
+
const P = h.importObjectUniversal(b);
|
|
3417
|
+
return B++, ys(t.handle, P, V, B, j), P;
|
|
3330
3418
|
}
|
|
3331
3419
|
};
|
|
3332
3420
|
} catch (p) {
|
|
@@ -3336,7 +3424,7 @@ function Qa(s, e, t, r, n, i = {}) {
|
|
|
3336
3424
|
}
|
|
3337
3425
|
}, i);
|
|
3338
3426
|
}
|
|
3339
|
-
function
|
|
3427
|
+
function ec(s, e, t, ...r) {
|
|
3340
3428
|
const { code: n, featureFlags: i } = t, o = new Je();
|
|
3341
3429
|
try {
|
|
3342
3430
|
const a = o.manage(s.newRuntime());
|
|
@@ -3356,14 +3444,14 @@ function Za(s, e, t, ...r) {
|
|
|
3356
3444
|
o.dispose();
|
|
3357
3445
|
}
|
|
3358
3446
|
}
|
|
3359
|
-
function
|
|
3360
|
-
return
|
|
3447
|
+
function tc(s) {
|
|
3448
|
+
return yn(s) ? s.isActive === !0 : ya(s);
|
|
3361
3449
|
}
|
|
3362
3450
|
function xe(s, e, t, r, n, i = {}) {
|
|
3363
|
-
if (
|
|
3451
|
+
if (yn(t)) {
|
|
3364
3452
|
if (r === void 0) throw new Error("No code bundle.");
|
|
3365
|
-
return
|
|
3366
|
-
} else return
|
|
3453
|
+
return Za(s, e, t, r, n, i);
|
|
3454
|
+
} else return za(s.driverKit, e, t, i);
|
|
3367
3455
|
}
|
|
3368
3456
|
function He(s, e) {
|
|
3369
3457
|
return je(
|
|
@@ -3381,17 +3469,17 @@ function He(s, e) {
|
|
|
3381
3469
|
}
|
|
3382
3470
|
);
|
|
3383
3471
|
}
|
|
3384
|
-
function
|
|
3472
|
+
function rc(s, e) {
|
|
3385
3473
|
if (s === e) return !0;
|
|
3386
3474
|
if (s === void 0 || e === void 0) return !1;
|
|
3387
|
-
const t =
|
|
3388
|
-
return
|
|
3475
|
+
const t = rs.omitBy((r, n) => n.startsWith("__"));
|
|
3476
|
+
return rs.isDeepEqual(t(s), t(e));
|
|
3389
3477
|
}
|
|
3390
|
-
function
|
|
3478
|
+
function sc(s, e, t) {
|
|
3391
3479
|
return K.make(
|
|
3392
3480
|
(r) => {
|
|
3393
|
-
var v, h,
|
|
3394
|
-
const n = r.accessor(s).node(), i = N(n.getKeyValueAsJson(
|
|
3481
|
+
var v, h, b, E, B, F, j, V;
|
|
3482
|
+
const n = r.accessor(s).node(), i = N(n.getKeyValueAsJson(Lr)), o = N(n.getKeyValueAsJson(_e)), a = N(n.getKeyValueAsJson(qe)), c = N(n.getKeyValueAsJson(de)), l = N(
|
|
3395
3483
|
n.getKeyValueAsJson(dt)
|
|
3396
3484
|
), u = /* @__PURE__ */ new Map();
|
|
3397
3485
|
for (const { id: P } of re(c)) {
|
|
@@ -3418,9 +3506,9 @@ function rc(s, e, t) {
|
|
|
3418
3506
|
});
|
|
3419
3507
|
G = {
|
|
3420
3508
|
arguments: z,
|
|
3421
|
-
stale: !
|
|
3509
|
+
stale: !rc(C, z),
|
|
3422
3510
|
outputError: M.error !== void 0 || W.error !== void 0 || ((v = M.value) == null ? void 0 : v.getError()) !== void 0 || ((h = W.value) == null ? void 0 : h.getError()) !== void 0,
|
|
3423
|
-
outputsError: ((
|
|
3511
|
+
outputsError: ((b = M.error) == null ? void 0 : b.getDataAsString()) ?? ((B = (E = M.value) == null ? void 0 : E.getError()) == null ? void 0 : B.getDataAsString()),
|
|
3424
3512
|
exportsError: ((F = W.error) == null ? void 0 : F.getDataAsString()) ?? ((V = (j = W.value) == null ? void 0 : j.getError()) == null ? void 0 : V.getDataAsString()),
|
|
3425
3513
|
finished: (M.value !== void 0 && M.value.getIsReadyOrError() || M.error !== void 0 && M.error.getIsReadyOrError()) && (W.value !== void 0 && W.value.getIsReadyOrError() || W.error !== void 0 && W.error.getIsReadyOrError())
|
|
3426
3514
|
};
|
|
@@ -3434,45 +3522,45 @@ function rc(s, e, t) {
|
|
|
3434
3522
|
enrichmentTargets: t.projectHelper.getEnrichmentTargets(() => $.cfg, () => G, { argsRid: C.argsRid, blockPackRid: $.bpResourceId })
|
|
3435
3523
|
};
|
|
3436
3524
|
}), p = new Set(l.blocksInLimbo), f = [...re(c)].map(({ id: P, label: $, renderingMode: C }) => {
|
|
3437
|
-
var A,
|
|
3525
|
+
var A, T, x, H, U;
|
|
3438
3526
|
const G = N(u.get(P)), ce = N(d.nodes.get(P));
|
|
3439
3527
|
let z = "NotCalculated";
|
|
3440
3528
|
G.prod !== void 0 && (p.has(P) ? z = "Limbo" : z = G.prod.finished ? "Done" : "Running");
|
|
3441
|
-
const M = He(n, P), { sections: W, title: g, inputsValid: m, sdkVersion: w, featureFlags: y, isIncompatibleWithRuntime: R } = je(M, ({ bpId:
|
|
3442
|
-
if (!t.runtimeCapabilities.checkCompatibility(
|
|
3529
|
+
const M = He(n, P), { sections: W, title: g, inputsValid: m, sdkVersion: w, featureFlags: y, isIncompatibleWithRuntime: R } = je(M, ({ bpId: oe, cfg: Se }) => {
|
|
3530
|
+
if (!t.runtimeCapabilities.checkCompatibility(Se.featureFlags))
|
|
3443
3531
|
return {
|
|
3444
3532
|
isIncompatibleWithRuntime: !0,
|
|
3445
|
-
featureFlags:
|
|
3533
|
+
featureFlags: Se.featureFlags
|
|
3446
3534
|
};
|
|
3447
|
-
const
|
|
3535
|
+
const bt = Br(s, P), ue = ft(Se);
|
|
3448
3536
|
return {
|
|
3449
3537
|
sections: xe(
|
|
3450
3538
|
t,
|
|
3451
|
-
|
|
3452
|
-
|
|
3539
|
+
bt,
|
|
3540
|
+
Se.sections,
|
|
3453
3541
|
ue,
|
|
3454
|
-
|
|
3542
|
+
oe
|
|
3455
3543
|
).wrap({
|
|
3456
3544
|
recover: (Le) => (t.logger.error("Error in block model sections"), t.logger.error(Le), [])
|
|
3457
3545
|
}),
|
|
3458
3546
|
title: je(
|
|
3459
|
-
|
|
3547
|
+
Se.title,
|
|
3460
3548
|
(Le) => xe(
|
|
3461
3549
|
t,
|
|
3462
|
-
|
|
3550
|
+
bt,
|
|
3463
3551
|
Le,
|
|
3464
3552
|
ue,
|
|
3465
|
-
|
|
3553
|
+
oe
|
|
3466
3554
|
).wrap({
|
|
3467
|
-
recover: (
|
|
3555
|
+
recover: (lo) => (t.logger.error("Error in block model title"), t.logger.error(lo), "Invalid title")
|
|
3468
3556
|
})
|
|
3469
3557
|
),
|
|
3470
3558
|
inputsValid: xe(
|
|
3471
3559
|
t,
|
|
3472
|
-
|
|
3473
|
-
|
|
3560
|
+
bt,
|
|
3561
|
+
Se.inputsValid,
|
|
3474
3562
|
ue,
|
|
3475
|
-
|
|
3563
|
+
oe
|
|
3476
3564
|
).wrap({
|
|
3477
3565
|
recover: (Le) => (t.logger.error("Error in block model argsValid"), t.logger.error(Le), !1)
|
|
3478
3566
|
}),
|
|
@@ -3486,7 +3574,7 @@ function rc(s, e, t) {
|
|
|
3486
3574
|
errorIfFieldNotSet: !0
|
|
3487
3575
|
}).getDataAsJson(), O = je(
|
|
3488
3576
|
M,
|
|
3489
|
-
({ info:
|
|
3577
|
+
({ info: oe }) => t.blockUpdateWatcher.get({ currentSpec: oe.source, settings: k })
|
|
3490
3578
|
);
|
|
3491
3579
|
return {
|
|
3492
3580
|
projectResourceId: Pe(s.rid),
|
|
@@ -3499,7 +3587,7 @@ function rc(s, e, t) {
|
|
|
3499
3587
|
upstreams: [...d.traverseIdsExcludingRoots("upstream", P)],
|
|
3500
3588
|
downstreams: [...d.traverseIdsExcludingRoots("downstream", P)],
|
|
3501
3589
|
calculationStatus: z,
|
|
3502
|
-
outputErrors: ((
|
|
3590
|
+
outputErrors: ((T = G.prod) == null ? void 0 : T.outputError) === !0,
|
|
3503
3591
|
outputsError: (x = G.prod) == null ? void 0 : x.outputsError,
|
|
3504
3592
|
exportsError: (H = G.prod) == null ? void 0 : H.exportsError,
|
|
3505
3593
|
settings: k,
|
|
@@ -3518,7 +3606,7 @@ function rc(s, e, t) {
|
|
|
3518
3606
|
meta: a,
|
|
3519
3607
|
created: new Date(i),
|
|
3520
3608
|
lastModified: new Date(o),
|
|
3521
|
-
authorMarker: n.getKeyValueAsJson(
|
|
3609
|
+
authorMarker: n.getKeyValueAsJson(Rr),
|
|
3522
3610
|
blocks: f
|
|
3523
3611
|
};
|
|
3524
3612
|
},
|
|
@@ -3544,13 +3632,13 @@ function rc(s, e, t) {
|
|
|
3544
3632
|
}
|
|
3545
3633
|
).withStableType();
|
|
3546
3634
|
}
|
|
3547
|
-
function
|
|
3635
|
+
function nc(s, e) {
|
|
3548
3636
|
const t = s.node();
|
|
3549
|
-
if (pe(t.resourceType,
|
|
3637
|
+
if (pe(t.resourceType, Mn)) {
|
|
3550
3638
|
const r = t.getDataAsJson();
|
|
3551
3639
|
if (r === void 0) throw new Error("No resource data.");
|
|
3552
3640
|
return e.frontendDownloadDriver.getPath(new URL(r.url)).withStableType();
|
|
3553
|
-
} else if (pe(t.resourceType,
|
|
3641
|
+
} else if (pe(t.resourceType, Jn)) {
|
|
3554
3642
|
const r = t.getDataAsJson();
|
|
3555
3643
|
if (r === void 0) throw new Error("No resource data.");
|
|
3556
3644
|
return e.signer.verify(
|
|
@@ -3561,10 +3649,10 @@ function sc(s, e) {
|
|
|
3561
3649
|
} else
|
|
3562
3650
|
throw new Error(`Unsupported resource type: ${JSON.stringify(t.resourceType)}`);
|
|
3563
3651
|
}
|
|
3564
|
-
function
|
|
3652
|
+
function oc(s, e) {
|
|
3565
3653
|
if (s !== void 0)
|
|
3566
3654
|
return K.make(
|
|
3567
|
-
(t) =>
|
|
3655
|
+
(t) => nc(t.accessor(s), e),
|
|
3568
3656
|
{
|
|
3569
3657
|
postprocessValue: (t) => {
|
|
3570
3658
|
if (t !== void 0) {
|
|
@@ -3576,7 +3664,7 @@ function nc(s, e) {
|
|
|
3576
3664
|
}
|
|
3577
3665
|
).withStableType();
|
|
3578
3666
|
}
|
|
3579
|
-
function
|
|
3667
|
+
function ic(s, e, t) {
|
|
3580
3668
|
return K.make(
|
|
3581
3669
|
(r) => {
|
|
3582
3670
|
var a;
|
|
@@ -3586,36 +3674,36 @@ function oc(s, e, t) {
|
|
|
3586
3674
|
assertFieldType: "Dynamic"
|
|
3587
3675
|
},
|
|
3588
3676
|
{ field: D.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 },
|
|
3589
|
-
{ field:
|
|
3677
|
+
{ field: _n, assertFieldType: "Input" }
|
|
3590
3678
|
)) == null ? void 0 : a.persist();
|
|
3591
3679
|
return {
|
|
3592
|
-
path:
|
|
3680
|
+
path: oc(o, t),
|
|
3593
3681
|
sdkVersion: i == null ? void 0 : i.cfg.sdkVersion
|
|
3594
3682
|
};
|
|
3595
3683
|
},
|
|
3596
3684
|
{ mode: "StableOnlyLive" }
|
|
3597
3685
|
);
|
|
3598
3686
|
}
|
|
3599
|
-
function
|
|
3687
|
+
function eo(s, e, t) {
|
|
3600
3688
|
if (t === void 0)
|
|
3601
|
-
return K.make((o) =>
|
|
3689
|
+
return K.make((o) => eo(s, e, o), {
|
|
3602
3690
|
key: `inputs#${Pe(s.rid)}#${e}`
|
|
3603
3691
|
});
|
|
3604
|
-
const r = t.accessor(s).node(), n =
|
|
3692
|
+
const r = t.accessor(s).node(), n = Br(s, e), i = n.uiState(t);
|
|
3605
3693
|
return {
|
|
3606
|
-
author: r.getKeyValueAsJson(
|
|
3694
|
+
author: r.getKeyValueAsJson(kr(e)),
|
|
3607
3695
|
// @TODO add deserialization caching
|
|
3608
|
-
args:
|
|
3696
|
+
args: Qr(JSON.parse(n.args(t))),
|
|
3609
3697
|
// @TODO add deserialization caching
|
|
3610
|
-
ui: i !== void 0 ?
|
|
3698
|
+
ui: i !== void 0 ? Qr(JSON.parse(i)) : void 0
|
|
3611
3699
|
};
|
|
3612
3700
|
}
|
|
3613
|
-
function
|
|
3701
|
+
function ac(s, e, t) {
|
|
3614
3702
|
const r = "outputs#" + Pe(s.rid) + "#" + e;
|
|
3615
3703
|
return K.make(
|
|
3616
3704
|
(n) => {
|
|
3617
3705
|
Q().logOutputRecalculations && console.log(`blockOutput recalculation : ${r} (${n.changeSourceMarker}; ${n.bodyInvocations} invocations)`);
|
|
3618
|
-
const i = n.accessor(s).node(), o =
|
|
3706
|
+
const i = n.accessor(s).node(), o = Wn(s, e);
|
|
3619
3707
|
return je(He(i, e), ({ cfg: a, bpId: c }) => {
|
|
3620
3708
|
const l = {};
|
|
3621
3709
|
for (const [u, d] of Object.entries(a.outputs)) {
|
|
@@ -3628,15 +3716,15 @@ function ic(s, e, t) {
|
|
|
3628
3716
|
{ key: r }
|
|
3629
3717
|
).withStableType();
|
|
3630
3718
|
}
|
|
3631
|
-
function
|
|
3719
|
+
function cc(s, e) {
|
|
3632
3720
|
return K.make((t) => {
|
|
3633
3721
|
const r = t.accessor(s).node(), n = N(r.getKeyValueAsJson(de)), i = [];
|
|
3634
3722
|
for (const { id: o } of re(n)) {
|
|
3635
3723
|
const a = He(r, o);
|
|
3636
3724
|
if (a === void 0) continue;
|
|
3637
|
-
const c = Object.entries(a.cfg.outputs).map(([, u]) => u).filter((u) =>
|
|
3725
|
+
const c = Object.entries(a.cfg.outputs).map(([, u]) => u).filter((u) => tc(u)).map((u) => u);
|
|
3638
3726
|
if (c.length === 0) continue;
|
|
3639
|
-
const l =
|
|
3727
|
+
const l = Wn(r.persist(), o);
|
|
3640
3728
|
for (const u of c)
|
|
3641
3729
|
i.push(
|
|
3642
3730
|
K.wrapError(xe(e, l, u, ft(a.cfg), a.bpId))
|
|
@@ -3645,21 +3733,21 @@ function ac(s, e) {
|
|
|
3645
3733
|
return i;
|
|
3646
3734
|
});
|
|
3647
3735
|
}
|
|
3648
|
-
class
|
|
3736
|
+
class lc {
|
|
3649
3737
|
constructor() {
|
|
3650
|
-
|
|
3738
|
+
S(this, "states", /* @__PURE__ */ new Map());
|
|
3651
3739
|
}
|
|
3652
3740
|
setState(e, t) {
|
|
3653
3741
|
const r = this.states.get(e);
|
|
3654
3742
|
if (r === void 0) {
|
|
3655
|
-
this.states.set(e, { state: t, change: new
|
|
3743
|
+
this.states.set(e, { state: t, change: new ts() });
|
|
3656
3744
|
return;
|
|
3657
3745
|
}
|
|
3658
3746
|
r.state = { ...t }, r.change.markChanged("navigation state changed");
|
|
3659
3747
|
}
|
|
3660
3748
|
readState(e, t) {
|
|
3661
3749
|
let r = this.states.get(t);
|
|
3662
|
-
return r === void 0 && (r = { state: { ...
|
|
3750
|
+
return r === void 0 && (r = { state: { ...mo }, change: new ts() }, this.states.set(t, r)), r.change.attachWatcher(e.watcher), r.state;
|
|
3663
3751
|
}
|
|
3664
3752
|
getState(e) {
|
|
3665
3753
|
return K.make(
|
|
@@ -3672,7 +3760,7 @@ class cc {
|
|
|
3672
3760
|
t !== void 0 && (this.states.delete(e), t.change.markChanged("block deleted"));
|
|
3673
3761
|
}
|
|
3674
3762
|
}
|
|
3675
|
-
function
|
|
3763
|
+
function uc(s) {
|
|
3676
3764
|
return K.make((e) => {
|
|
3677
3765
|
const t = e.accessor(s).node(), r = N(t.getKeyValueAsJson(de));
|
|
3678
3766
|
return {
|
|
@@ -3680,59 +3768,59 @@ function lc(s) {
|
|
|
3680
3768
|
};
|
|
3681
3769
|
});
|
|
3682
3770
|
}
|
|
3683
|
-
const
|
|
3684
|
-
async function
|
|
3771
|
+
const dc = "1", pc = "BlockFrontendState/";
|
|
3772
|
+
async function fc(s, e) {
|
|
3685
3773
|
await s.withWriteTx("ProjectMigration", async (t) => {
|
|
3686
3774
|
const r = await t.getKValueJson(e, ut);
|
|
3687
3775
|
if (r !== Ge) {
|
|
3688
|
-
if (r ===
|
|
3689
|
-
await
|
|
3776
|
+
if (r === dc)
|
|
3777
|
+
await hc(t, e);
|
|
3690
3778
|
else
|
|
3691
3779
|
throw new Error(`Unknown project schema version: ${r}`);
|
|
3692
3780
|
t.setKValue(e, ut, JSON.stringify(Ge)), await t.commit();
|
|
3693
3781
|
}
|
|
3694
3782
|
});
|
|
3695
3783
|
}
|
|
3696
|
-
async function
|
|
3784
|
+
async function hc(s, e) {
|
|
3697
3785
|
const [t, r] = await Promise.all([
|
|
3698
3786
|
s.getKValueJson(e, de),
|
|
3699
3787
|
s.listKeyValues(e)
|
|
3700
3788
|
]), n = new Map(r.map((i) => [i.key, i.value]));
|
|
3701
3789
|
for (const i of re(t)) {
|
|
3702
|
-
const o =
|
|
3790
|
+
const o = pc + i.id, a = n.get(o), c = a ? Ue(a) : {}, l = s.createJsonGzValue(c), u = J(e, q(i.id, "uiState"));
|
|
3703
3791
|
s.createField(u, "Dynamic", l), s.deleteKValue(e, o);
|
|
3704
3792
|
}
|
|
3705
3793
|
}
|
|
3706
|
-
function
|
|
3794
|
+
function ws(s) {
|
|
3707
3795
|
return JSON.stringify(s, (e, t) => typeof t == "bigint" ? Pe(t) : ArrayBuffer.isView(t) || t instanceof Int8Array || t instanceof Uint8Array || t instanceof Uint8ClampedArray || t instanceof Int16Array || t instanceof Uint16Array || t instanceof Int32Array || t instanceof Uint32Array || t instanceof Float32Array || t instanceof Float64Array || t instanceof BigInt64Array || t instanceof BigUint64Array ? Buffer.from(t.buffer, t.byteOffset, t.byteLength).toString("base64") : Buffer.isBuffer(t) ? t.toString("base64") : t);
|
|
3708
3796
|
}
|
|
3709
|
-
class
|
|
3797
|
+
class jr {
|
|
3710
3798
|
constructor(e, t, r) {
|
|
3711
3799
|
/** Underlying pl resource id */
|
|
3712
|
-
|
|
3800
|
+
S(this, "rid");
|
|
3713
3801
|
/** Data for the left panel, contain basic information about block status. */
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3802
|
+
S(this, "overview");
|
|
3803
|
+
S(this, "overviewLight");
|
|
3804
|
+
S(this, "navigationStates", new lc());
|
|
3717
3805
|
// null is set for deleted blocks
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
this.env = e, this.projectTree = r, this.overview =
|
|
3806
|
+
S(this, "blockComputables", /* @__PURE__ */ new Map());
|
|
3807
|
+
S(this, "blockFrontends", /* @__PURE__ */ new Map());
|
|
3808
|
+
S(this, "activeConfigs");
|
|
3809
|
+
S(this, "refreshLoopResult");
|
|
3810
|
+
S(this, "abortController", new AbortController());
|
|
3811
|
+
S(this, "destroyed", !1);
|
|
3812
|
+
this.env = e, this.projectTree = r, this.overview = sc(
|
|
3725
3813
|
r.entry(),
|
|
3726
3814
|
this.navigationStates,
|
|
3727
3815
|
e
|
|
3728
|
-
).withPreCalculatedValueTree(), this.overviewLight =
|
|
3816
|
+
).withPreCalculatedValueTree(), this.overviewLight = uc(r.entry()).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs = cc(r.entry(), e);
|
|
3729
3817
|
}
|
|
3730
3818
|
async refreshLoop() {
|
|
3731
3819
|
for (; !this.destroyed; )
|
|
3732
3820
|
try {
|
|
3733
3821
|
await rt(this.env.projectHelper, this.env.pl, this.rid, (r) => {
|
|
3734
3822
|
r.doRefresh(this.env.ops.stagingRenderingRate);
|
|
3735
|
-
}), await this.activeConfigs.getValue(), await
|
|
3823
|
+
}), await this.activeConfigs.getValue(), await En(this.env.ops.projectRefreshInterval, this.abortController.signal);
|
|
3736
3824
|
const e = await this.overviewLight.getValue(), t = new Set(e.listOfBlocks);
|
|
3737
3825
|
for (const r of this.blockComputables.keys())
|
|
3738
3826
|
if (!t.has(r)) {
|
|
@@ -3740,12 +3828,12 @@ class Nr {
|
|
|
3740
3828
|
n != null && n.fullState.resetState(), this.blockComputables.set(r, null);
|
|
3741
3829
|
}
|
|
3742
3830
|
} catch (e) {
|
|
3743
|
-
if (
|
|
3831
|
+
if (Bo(e)) {
|
|
3744
3832
|
console.warn(
|
|
3745
3833
|
"project refresh routine terminated, because project was externally deleted"
|
|
3746
3834
|
);
|
|
3747
3835
|
break;
|
|
3748
|
-
} else if (!
|
|
3836
|
+
} else if (!jo(e))
|
|
3749
3837
|
throw new Error("Unexpected exception", { cause: e });
|
|
3750
3838
|
}
|
|
3751
3839
|
}
|
|
@@ -3760,9 +3848,9 @@ class Nr {
|
|
|
3760
3848
|
*
|
|
3761
3849
|
* @return returns newly created block id
|
|
3762
3850
|
* */
|
|
3763
|
-
async addBlock(e, t, r, n = void 0, i =
|
|
3851
|
+
async addBlock(e, t, r, n = void 0, i = he()) {
|
|
3764
3852
|
const o = await this.env.bpPreparer.prepare(t), a = await this.env.bpPreparer.getBlockConfigContainer(t), c = Ce(a);
|
|
3765
|
-
return await
|
|
3853
|
+
return await se(
|
|
3766
3854
|
this.env.projectHelper,
|
|
3767
3855
|
this.env.pl,
|
|
3768
3856
|
this.rid,
|
|
@@ -3782,13 +3870,34 @@ class Nr {
|
|
|
3782
3870
|
)
|
|
3783
3871
|
), await this.projectTree.refreshState(), i;
|
|
3784
3872
|
}
|
|
3873
|
+
/**
|
|
3874
|
+
* Duplicates an existing block by copying all its fields and state.
|
|
3875
|
+
* This method works at the mutator level for efficient block copying.
|
|
3876
|
+
*
|
|
3877
|
+
* @param originalBlockId id of the block to duplicate
|
|
3878
|
+
* @param before id of the block to insert new block before
|
|
3879
|
+
* @param author author marker for the duplication operation
|
|
3880
|
+
* @param newBlockId internal id to be assigned for the duplicated block,
|
|
3881
|
+
* if omitted, a randomly generated UUID will be assigned
|
|
3882
|
+
*
|
|
3883
|
+
* @return returns newly created block id
|
|
3884
|
+
* */
|
|
3885
|
+
async duplicateBlock(e, t, r = void 0, n = he()) {
|
|
3886
|
+
return await se(
|
|
3887
|
+
this.env.projectHelper,
|
|
3888
|
+
this.env.pl,
|
|
3889
|
+
this.rid,
|
|
3890
|
+
r,
|
|
3891
|
+
(i) => i.duplicateBlock(e, n, t)
|
|
3892
|
+
), await this.projectTree.refreshState(), n;
|
|
3893
|
+
}
|
|
3785
3894
|
/**
|
|
3786
3895
|
* Update block to new block pack, optionally resetting args and ui state to
|
|
3787
3896
|
* initial values
|
|
3788
3897
|
* */
|
|
3789
3898
|
async updateBlockPack(e, t, r = !1, n) {
|
|
3790
3899
|
const i = await this.env.bpPreparer.prepare(t), o = Ce(await this.env.bpPreparer.getBlockConfigContainer(t));
|
|
3791
|
-
await
|
|
3900
|
+
await se(
|
|
3792
3901
|
this.env.projectHelper,
|
|
3793
3902
|
this.env.pl,
|
|
3794
3903
|
this.rid,
|
|
@@ -3802,7 +3911,7 @@ class Nr {
|
|
|
3802
3911
|
}
|
|
3803
3912
|
/** Deletes a block with all associated data. */
|
|
3804
3913
|
async deleteBlock(e, t) {
|
|
3805
|
-
await
|
|
3914
|
+
await se(this.env.projectHelper, this.env.pl, this.rid, t, (r) => r.deleteBlock(e)), this.navigationStates.deleteBlock(e), await this.projectTree.refreshState();
|
|
3806
3915
|
}
|
|
3807
3916
|
/**
|
|
3808
3917
|
* Updates block order according to the given array of block ids.
|
|
@@ -3811,7 +3920,7 @@ class Nr {
|
|
|
3811
3920
|
* an error will be thrown instead.
|
|
3812
3921
|
*/
|
|
3813
3922
|
async reorderBlocks(e, t) {
|
|
3814
|
-
await
|
|
3923
|
+
await se(this.env.projectHelper, this.env.pl, this.rid, t, (r) => {
|
|
3815
3924
|
const n = r.structure;
|
|
3816
3925
|
if (n.groups.length !== 1)
|
|
3817
3926
|
throw new Error("Unexpected project structure, non-sinular block group");
|
|
@@ -3865,7 +3974,7 @@ class Nr {
|
|
|
3865
3974
|
* in collaborative editing scenario.
|
|
3866
3975
|
* */
|
|
3867
3976
|
async setBlockArgs(e, t, r) {
|
|
3868
|
-
await
|
|
3977
|
+
await se(
|
|
3869
3978
|
this.env.projectHelper,
|
|
3870
3979
|
this.env.pl,
|
|
3871
3980
|
this.rid,
|
|
@@ -3880,7 +3989,7 @@ class Nr {
|
|
|
3880
3989
|
* in collaborative editing scenario.
|
|
3881
3990
|
* */
|
|
3882
3991
|
async setUiState(e, t, r) {
|
|
3883
|
-
await
|
|
3992
|
+
await se(
|
|
3884
3993
|
this.env.projectHelper,
|
|
3885
3994
|
this.env.pl,
|
|
3886
3995
|
this.rid,
|
|
@@ -3902,13 +4011,13 @@ class Nr {
|
|
|
3902
4011
|
* in collaborative editing scenario.
|
|
3903
4012
|
* */
|
|
3904
4013
|
async setBlockArgsAndUiState(e, t, r, n) {
|
|
3905
|
-
await
|
|
4014
|
+
await se(this.env.projectHelper, this.env.pl, this.rid, n, (i) => {
|
|
3906
4015
|
i.setStates([{ blockId: e, args: t, uiState: r }]);
|
|
3907
4016
|
}), await this.projectTree.refreshState();
|
|
3908
4017
|
}
|
|
3909
4018
|
/** Update block settings */
|
|
3910
4019
|
async setBlockSettings(e, t) {
|
|
3911
|
-
await
|
|
4020
|
+
await se(this.env.projectHelper, this.env.pl, this.rid, void 0, (r) => {
|
|
3912
4021
|
r.setBlockSettings(e, t);
|
|
3913
4022
|
}), await this.projectTree.refreshState();
|
|
3914
4023
|
}
|
|
@@ -3920,7 +4029,7 @@ class Nr {
|
|
|
3920
4029
|
), i = ct(
|
|
3921
4030
|
(await r.getField(J(n, D.HolderRefField))).value
|
|
3922
4031
|
), o = await r.getResourceData(i, !1), a = Ce(Ue(N(o.data)).config);
|
|
3923
|
-
await
|
|
4032
|
+
await se(this.env.projectHelper, r, this.rid, t, (c) => {
|
|
3924
4033
|
c.setStates([{ blockId: e, args: a.initialArgs, uiState: a.initialUiState }]);
|
|
3925
4034
|
}), await r.commit();
|
|
3926
4035
|
}), await this.projectTree.refreshState();
|
|
@@ -3929,10 +4038,10 @@ class Nr {
|
|
|
3929
4038
|
const t = this.blockComputables.get(e);
|
|
3930
4039
|
if (t === null) throw new Error(`Block ${e} is deleted`);
|
|
3931
4040
|
if (t === void 0) {
|
|
3932
|
-
const r =
|
|
4041
|
+
const r = ac(this.projectTree.entry(), e, this.env), i = {
|
|
3933
4042
|
fullState: K.make(
|
|
3934
4043
|
(o) => ({
|
|
3935
|
-
argsAndUiState:
|
|
4044
|
+
argsAndUiState: eo(this.projectTree.entry(), e, o),
|
|
3936
4045
|
outputs: r,
|
|
3937
4046
|
navigationState: this.navigationStates.getState(e),
|
|
3938
4047
|
overview: this.overview
|
|
@@ -3940,7 +4049,7 @@ class Nr {
|
|
|
3940
4049
|
{
|
|
3941
4050
|
postprocessValue: (o) => {
|
|
3942
4051
|
var u, d, p;
|
|
3943
|
-
const a = (p = (d = (u = o.overview) == null ? void 0 : u.blocks) == null ? void 0 : d.find((f) => f.id == e)) == null ? void 0 : p.sdkVersion, l = a &&
|
|
4052
|
+
const a = (p = (d = (u = o.overview) == null ? void 0 : u.blocks) == null ? void 0 : d.find((f) => f.id == e)) == null ? void 0 : p.sdkVersion, l = a && mc(a) && o.outputs !== void 0 ? yc(o.outputs) : o.outputs;
|
|
3944
4053
|
return {
|
|
3945
4054
|
...o.argsAndUiState,
|
|
3946
4055
|
outputs: l,
|
|
@@ -3968,7 +4077,7 @@ class Nr {
|
|
|
3968
4077
|
getBlockFrontend(e) {
|
|
3969
4078
|
const t = this.blockFrontends.get(e);
|
|
3970
4079
|
if (t === void 0) {
|
|
3971
|
-
const r =
|
|
4080
|
+
const r = ic(
|
|
3972
4081
|
this.projectTree.entry(),
|
|
3973
4082
|
e,
|
|
3974
4083
|
this.env
|
|
@@ -3988,14 +4097,14 @@ class Nr {
|
|
|
3988
4097
|
await this.destroy();
|
|
3989
4098
|
}
|
|
3990
4099
|
static async init(e, t) {
|
|
3991
|
-
await
|
|
4100
|
+
await fc(e.pl, t), await rt(e.projectHelper, e.pl, t, (n) => {
|
|
3992
4101
|
});
|
|
3993
|
-
const r = await
|
|
4102
|
+
const r = await Rn.init(
|
|
3994
4103
|
e.pl,
|
|
3995
4104
|
t,
|
|
3996
4105
|
{
|
|
3997
4106
|
...e.ops.defaultTreeOptions,
|
|
3998
|
-
pruning:
|
|
4107
|
+
pruning: gc
|
|
3999
4108
|
},
|
|
4000
4109
|
e.logger
|
|
4001
4110
|
);
|
|
@@ -4005,13 +4114,13 @@ class Nr {
|
|
|
4005
4114
|
var c, l;
|
|
4006
4115
|
return (((c = a.data) == null ? void 0 : c.byteLength) ?? 0) - (((l = o.data) == null ? void 0 : l.byteLength) ?? 0);
|
|
4007
4116
|
});
|
|
4008
|
-
const i =
|
|
4009
|
-
await at.writeFile(`${Pe(t)}.json`,
|
|
4117
|
+
const i = Go(n);
|
|
4118
|
+
await at.writeFile(`${Pe(t)}.json`, ws(n)), await at.writeFile(`${Pe(t)}.stats.json`, ws(i));
|
|
4010
4119
|
}
|
|
4011
|
-
return new
|
|
4120
|
+
return new jr(e, t, r);
|
|
4012
4121
|
}
|
|
4013
4122
|
}
|
|
4014
|
-
function
|
|
4123
|
+
function gc(s) {
|
|
4015
4124
|
if (s.type.name.startsWith("StreamWorkdir/"))
|
|
4016
4125
|
return [];
|
|
4017
4126
|
switch (s.type.name) {
|
|
@@ -4025,14 +4134,14 @@ function hc(s) {
|
|
|
4025
4134
|
return s.fields;
|
|
4026
4135
|
}
|
|
4027
4136
|
}
|
|
4028
|
-
function
|
|
4029
|
-
return !
|
|
4137
|
+
function mc(s) {
|
|
4138
|
+
return !vc(s, "1.26.0");
|
|
4030
4139
|
}
|
|
4031
|
-
function
|
|
4140
|
+
function vc(s, e) {
|
|
4032
4141
|
const t = s.split(".").map(Number), r = e.split(".").map(Number);
|
|
4033
4142
|
return t[0] > r[0] || t[0] === r[0] && t[1] > r[1] || t[0] === r[0] && t[1] === r[1] && t[2] > r[2];
|
|
4034
4143
|
}
|
|
4035
|
-
function
|
|
4144
|
+
function yc(s) {
|
|
4036
4145
|
const e = {};
|
|
4037
4146
|
for (const [t, r] of Object.entries(s)) {
|
|
4038
4147
|
if (r.ok) {
|
|
@@ -4047,8 +4156,8 @@ function vc(s) {
|
|
|
4047
4156
|
}
|
|
4048
4157
|
return e;
|
|
4049
4158
|
}
|
|
4050
|
-
const
|
|
4051
|
-
logger: new
|
|
4159
|
+
const to = {
|
|
4160
|
+
logger: new wn(),
|
|
4052
4161
|
blobDriverOps: {
|
|
4053
4162
|
cacheSoftSizeBytes: 8 * 1024 * 1024 * 1024,
|
|
4054
4163
|
// 8 GB
|
|
@@ -4081,7 +4190,7 @@ const eo = {
|
|
|
4081
4190
|
// 8 GB
|
|
4082
4191
|
}
|
|
4083
4192
|
};
|
|
4084
|
-
function
|
|
4193
|
+
function ro(s) {
|
|
4085
4194
|
return {
|
|
4086
4195
|
blobDownloadPath: _.join(s, "download"),
|
|
4087
4196
|
blobDownloadRangesCachePath: _.join(s, "downloadRangesCache"),
|
|
@@ -4089,8 +4198,8 @@ function to(s) {
|
|
|
4089
4198
|
pframesSpillPath: _.join(s, "pframes")
|
|
4090
4199
|
};
|
|
4091
4200
|
}
|
|
4092
|
-
const
|
|
4093
|
-
...
|
|
4201
|
+
const wc = {
|
|
4202
|
+
...to,
|
|
4094
4203
|
defaultTreeOptions: {
|
|
4095
4204
|
pollingInterval: 350,
|
|
4096
4205
|
stopPollingDelay: 2500,
|
|
@@ -4104,22 +4213,22 @@ const yc = {
|
|
|
4104
4213
|
projectRefreshInterval: 700,
|
|
4105
4214
|
stagingRenderingRate: 5
|
|
4106
4215
|
};
|
|
4107
|
-
function
|
|
4216
|
+
function Sc(s) {
|
|
4108
4217
|
return {
|
|
4109
|
-
...
|
|
4218
|
+
...ro(s),
|
|
4110
4219
|
frontendDownloadPath: _.join(s, "frontend")
|
|
4111
4220
|
};
|
|
4112
4221
|
}
|
|
4113
4222
|
function bc(s) {
|
|
4114
4223
|
return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
|
|
4115
4224
|
}
|
|
4116
|
-
var st = { exports: {} },
|
|
4225
|
+
var st = { exports: {} }, Ft, Ss;
|
|
4117
4226
|
function mt() {
|
|
4118
|
-
if (
|
|
4119
|
-
|
|
4227
|
+
if (Ss) return Ft;
|
|
4228
|
+
Ss = 1;
|
|
4120
4229
|
const s = "2.0.0", e = 256, t = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
4121
4230
|
9007199254740991, r = 16, n = e - 6;
|
|
4122
|
-
return
|
|
4231
|
+
return Ft = {
|
|
4123
4232
|
MAX_LENGTH: e,
|
|
4124
4233
|
MAX_SAFE_COMPONENT_LENGTH: r,
|
|
4125
4234
|
MAX_SAFE_BUILD_LENGTH: n,
|
|
@@ -4136,16 +4245,16 @@ function mt() {
|
|
|
4136
4245
|
SEMVER_SPEC_VERSION: s,
|
|
4137
4246
|
FLAG_INCLUDE_PRERELEASE: 1,
|
|
4138
4247
|
FLAG_LOOSE: 2
|
|
4139
|
-
},
|
|
4248
|
+
}, Ft;
|
|
4140
4249
|
}
|
|
4141
|
-
var
|
|
4250
|
+
var Tt, bs;
|
|
4142
4251
|
function vt() {
|
|
4143
|
-
return bs || (bs = 1,
|
|
4144
|
-
}),
|
|
4252
|
+
return bs || (bs = 1, Tt = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...e) => console.error("SEMVER", ...e) : () => {
|
|
4253
|
+
}), Tt;
|
|
4145
4254
|
}
|
|
4146
|
-
var
|
|
4255
|
+
var ks;
|
|
4147
4256
|
function ze() {
|
|
4148
|
-
return
|
|
4257
|
+
return ks || (ks = 1, function(s, e) {
|
|
4149
4258
|
const {
|
|
4150
4259
|
MAX_SAFE_COMPONENT_LENGTH: t,
|
|
4151
4260
|
MAX_SAFE_BUILD_LENGTH: r,
|
|
@@ -4158,42 +4267,42 @@ function ze() {
|
|
|
4158
4267
|
["\\s", 1],
|
|
4159
4268
|
["\\d", n],
|
|
4160
4269
|
[p, r]
|
|
4161
|
-
], v = (
|
|
4270
|
+
], v = (b) => {
|
|
4162
4271
|
for (const [E, B] of f)
|
|
4163
|
-
|
|
4164
|
-
return
|
|
4165
|
-
}, h = (
|
|
4272
|
+
b = b.split(`${E}*`).join(`${E}{0,${B}}`).split(`${E}+`).join(`${E}{1,${B}}`);
|
|
4273
|
+
return b;
|
|
4274
|
+
}, h = (b, E, B) => {
|
|
4166
4275
|
const F = v(E), j = d++;
|
|
4167
|
-
i(
|
|
4276
|
+
i(b, j, E), u[b] = j, c[j] = E, l[j] = F, o[j] = new RegExp(E, B ? "g" : void 0), a[j] = new RegExp(F, B ? "g" : void 0);
|
|
4168
4277
|
};
|
|
4169
4278
|
h("NUMERICIDENTIFIER", "0|[1-9]\\d*"), h("NUMERICIDENTIFIERLOOSE", "\\d+"), h("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${p}*`), h("MAINVERSION", `(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`), h("MAINVERSIONLOOSE", `(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`), h("PRERELEASEIDENTIFIER", `(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`), h("PRERELEASEIDENTIFIERLOOSE", `(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`), h("PRERELEASE", `(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`), h("PRERELEASELOOSE", `(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`), h("BUILDIDENTIFIER", `${p}+`), h("BUILD", `(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`), h("FULLPLAIN", `v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`), h("FULL", `^${c[u.FULLPLAIN]}$`), h("LOOSEPLAIN", `[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`), h("LOOSE", `^${c[u.LOOSEPLAIN]}$`), h("GTLT", "((?:<|>)?=?)"), h("XRANGEIDENTIFIERLOOSE", `${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), h("XRANGEIDENTIFIER", `${c[u.NUMERICIDENTIFIER]}|x|X|\\*`), h("XRANGEPLAIN", `[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`), h("XRANGEPLAINLOOSE", `[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`), h("XRANGE", `^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`), h("XRANGELOOSE", `^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`), h("COERCEPLAIN", `(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`), h("COERCE", `${c[u.COERCEPLAIN]}(?:$|[^\\d])`), h("COERCEFULL", c[u.COERCEPLAIN] + `(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`), h("COERCERTL", c[u.COERCE], !0), h("COERCERTLFULL", c[u.COERCEFULL], !0), h("LONETILDE", "(?:~>?)"), h("TILDETRIM", `(\\s*)${c[u.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", h("TILDE", `^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`), h("TILDELOOSE", `^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`), h("LONECARET", "(?:\\^)"), h("CARETTRIM", `(\\s*)${c[u.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", h("CARET", `^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`), h("CARETLOOSE", `^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`), h("COMPARATORLOOSE", `^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`), h("COMPARATOR", `^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`), h("COMPARATORTRIM", `(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", h("HYPHENRANGE", `^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`), h("HYPHENRANGELOOSE", `^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`), h("STAR", "(<|>)?=?\\s*\\*"), h("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), h("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
4170
4279
|
}(st, st.exports)), st.exports;
|
|
4171
4280
|
}
|
|
4172
|
-
var Ft, ks;
|
|
4173
|
-
function Br() {
|
|
4174
|
-
if (ks) return Ft;
|
|
4175
|
-
ks = 1;
|
|
4176
|
-
const s = Object.freeze({ loose: !0 }), e = Object.freeze({});
|
|
4177
|
-
return Ft = (r) => r ? typeof r != "object" ? s : r : e, Ft;
|
|
4178
|
-
}
|
|
4179
4281
|
var It, Rs;
|
|
4180
|
-
function
|
|
4282
|
+
function xr() {
|
|
4181
4283
|
if (Rs) return It;
|
|
4182
4284
|
Rs = 1;
|
|
4285
|
+
const s = Object.freeze({ loose: !0 }), e = Object.freeze({});
|
|
4286
|
+
return It = (r) => r ? typeof r != "object" ? s : r : e, It;
|
|
4287
|
+
}
|
|
4288
|
+
var $t, Cs;
|
|
4289
|
+
function so() {
|
|
4290
|
+
if (Cs) return $t;
|
|
4291
|
+
Cs = 1;
|
|
4183
4292
|
const s = /^[0-9]+$/, e = (r, n) => {
|
|
4184
4293
|
const i = s.test(r), o = s.test(n);
|
|
4185
4294
|
return i && o && (r = +r, n = +n), r === n ? 0 : i && !o ? -1 : o && !i ? 1 : r < n ? -1 : 1;
|
|
4186
4295
|
};
|
|
4187
|
-
return
|
|
4296
|
+
return $t = {
|
|
4188
4297
|
compareIdentifiers: e,
|
|
4189
4298
|
rcompareIdentifiers: (r, n) => e(n, r)
|
|
4190
|
-
},
|
|
4299
|
+
}, $t;
|
|
4191
4300
|
}
|
|
4192
|
-
var
|
|
4301
|
+
var At, Es;
|
|
4193
4302
|
function Z() {
|
|
4194
|
-
if (
|
|
4195
|
-
|
|
4196
|
-
const s = vt(), { MAX_LENGTH: e, MAX_SAFE_INTEGER: t } = mt(), { safeRe: r, t: n } = ze(), i =
|
|
4303
|
+
if (Es) return At;
|
|
4304
|
+
Es = 1;
|
|
4305
|
+
const s = vt(), { MAX_LENGTH: e, MAX_SAFE_INTEGER: t } = mt(), { safeRe: r, t: n } = ze(), i = xr(), { compareIdentifiers: o } = so();
|
|
4197
4306
|
class a {
|
|
4198
4307
|
constructor(l, u) {
|
|
4199
4308
|
if (u = i(u), l instanceof a) {
|
|
@@ -4348,14 +4457,14 @@ function Z() {
|
|
|
4348
4457
|
return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
|
|
4349
4458
|
}
|
|
4350
4459
|
}
|
|
4351
|
-
return
|
|
4460
|
+
return At = a, At;
|
|
4352
4461
|
}
|
|
4353
|
-
var
|
|
4354
|
-
function
|
|
4355
|
-
if (
|
|
4356
|
-
|
|
4462
|
+
var Lt, Ps;
|
|
4463
|
+
function Te() {
|
|
4464
|
+
if (Ps) return Lt;
|
|
4465
|
+
Ps = 1;
|
|
4357
4466
|
const s = Z();
|
|
4358
|
-
return
|
|
4467
|
+
return Lt = (t, r, n = !1) => {
|
|
4359
4468
|
if (t instanceof s)
|
|
4360
4469
|
return t;
|
|
4361
4470
|
try {
|
|
@@ -4365,34 +4474,34 @@ function Ie() {
|
|
|
4365
4474
|
return null;
|
|
4366
4475
|
throw i;
|
|
4367
4476
|
}
|
|
4368
|
-
},
|
|
4369
|
-
}
|
|
4370
|
-
var At, Ps;
|
|
4371
|
-
function Sc() {
|
|
4372
|
-
if (Ps) return At;
|
|
4373
|
-
Ps = 1;
|
|
4374
|
-
const s = Ie();
|
|
4375
|
-
return At = (t, r) => {
|
|
4376
|
-
const n = s(t, r);
|
|
4377
|
-
return n ? n.version : null;
|
|
4378
|
-
}, At;
|
|
4477
|
+
}, Lt;
|
|
4379
4478
|
}
|
|
4380
|
-
var
|
|
4479
|
+
var Dt, Os;
|
|
4381
4480
|
function kc() {
|
|
4382
|
-
if (Os) return
|
|
4481
|
+
if (Os) return Dt;
|
|
4383
4482
|
Os = 1;
|
|
4384
|
-
const s =
|
|
4385
|
-
return
|
|
4386
|
-
const n = s(t
|
|
4483
|
+
const s = Te();
|
|
4484
|
+
return Dt = (t, r) => {
|
|
4485
|
+
const n = s(t, r);
|
|
4387
4486
|
return n ? n.version : null;
|
|
4388
|
-
},
|
|
4487
|
+
}, Dt;
|
|
4389
4488
|
}
|
|
4390
|
-
var
|
|
4489
|
+
var Nt, Fs;
|
|
4391
4490
|
function Rc() {
|
|
4392
|
-
if (Fs) return
|
|
4491
|
+
if (Fs) return Nt;
|
|
4393
4492
|
Fs = 1;
|
|
4493
|
+
const s = Te();
|
|
4494
|
+
return Nt = (t, r) => {
|
|
4495
|
+
const n = s(t.trim().replace(/^[=v]+/, ""), r);
|
|
4496
|
+
return n ? n.version : null;
|
|
4497
|
+
}, Nt;
|
|
4498
|
+
}
|
|
4499
|
+
var Bt, Ts;
|
|
4500
|
+
function Cc() {
|
|
4501
|
+
if (Ts) return Bt;
|
|
4502
|
+
Ts = 1;
|
|
4394
4503
|
const s = Z();
|
|
4395
|
-
return
|
|
4504
|
+
return Bt = (t, r, n, i, o) => {
|
|
4396
4505
|
typeof n == "string" && (o = i, i = n, n = void 0);
|
|
4397
4506
|
try {
|
|
4398
4507
|
return new s(
|
|
@@ -4402,14 +4511,14 @@ function Rc() {
|
|
|
4402
4511
|
} catch {
|
|
4403
4512
|
return null;
|
|
4404
4513
|
}
|
|
4405
|
-
},
|
|
4514
|
+
}, Bt;
|
|
4406
4515
|
}
|
|
4407
|
-
var
|
|
4408
|
-
function
|
|
4409
|
-
if (Is) return
|
|
4516
|
+
var jt, Is;
|
|
4517
|
+
function Ec() {
|
|
4518
|
+
if (Is) return jt;
|
|
4410
4519
|
Is = 1;
|
|
4411
|
-
const s =
|
|
4412
|
-
return
|
|
4520
|
+
const s = Te();
|
|
4521
|
+
return jt = (t, r) => {
|
|
4413
4522
|
const n = s(t, null, !0), i = s(r, null, !0), o = n.compare(i);
|
|
4414
4523
|
if (o === 0)
|
|
4415
4524
|
return null;
|
|
@@ -4422,132 +4531,132 @@ function Cc() {
|
|
|
4422
4531
|
}
|
|
4423
4532
|
const p = u ? "pre" : "";
|
|
4424
4533
|
return n.major !== i.major ? p + "major" : n.minor !== i.minor ? p + "minor" : n.patch !== i.patch ? p + "patch" : "prerelease";
|
|
4425
|
-
},
|
|
4426
|
-
}
|
|
4427
|
-
var Bt, Ts;
|
|
4428
|
-
function Ec() {
|
|
4429
|
-
if (Ts) return Bt;
|
|
4430
|
-
Ts = 1;
|
|
4431
|
-
const s = Z();
|
|
4432
|
-
return Bt = (t, r) => new s(t, r).major, Bt;
|
|
4534
|
+
}, jt;
|
|
4433
4535
|
}
|
|
4434
|
-
var
|
|
4536
|
+
var xt, $s;
|
|
4435
4537
|
function Pc() {
|
|
4436
|
-
if ($s) return
|
|
4538
|
+
if ($s) return xt;
|
|
4437
4539
|
$s = 1;
|
|
4438
4540
|
const s = Z();
|
|
4439
|
-
return
|
|
4541
|
+
return xt = (t, r) => new s(t, r).major, xt;
|
|
4440
4542
|
}
|
|
4441
|
-
var
|
|
4543
|
+
var Vt, As;
|
|
4442
4544
|
function Oc() {
|
|
4443
|
-
if (As) return
|
|
4545
|
+
if (As) return Vt;
|
|
4444
4546
|
As = 1;
|
|
4445
4547
|
const s = Z();
|
|
4446
|
-
return
|
|
4548
|
+
return Vt = (t, r) => new s(t, r).minor, Vt;
|
|
4447
4549
|
}
|
|
4448
|
-
var
|
|
4550
|
+
var Ut, Ls;
|
|
4449
4551
|
function Fc() {
|
|
4450
|
-
if (Ls) return
|
|
4552
|
+
if (Ls) return Ut;
|
|
4451
4553
|
Ls = 1;
|
|
4452
|
-
const s =
|
|
4453
|
-
return
|
|
4554
|
+
const s = Z();
|
|
4555
|
+
return Ut = (t, r) => new s(t, r).patch, Ut;
|
|
4556
|
+
}
|
|
4557
|
+
var Mt, Ds;
|
|
4558
|
+
function Tc() {
|
|
4559
|
+
if (Ds) return Mt;
|
|
4560
|
+
Ds = 1;
|
|
4561
|
+
const s = Te();
|
|
4562
|
+
return Mt = (t, r) => {
|
|
4454
4563
|
const n = s(t, r);
|
|
4455
4564
|
return n && n.prerelease.length ? n.prerelease : null;
|
|
4456
|
-
},
|
|
4565
|
+
}, Mt;
|
|
4457
4566
|
}
|
|
4458
|
-
var
|
|
4567
|
+
var Jt, Ns;
|
|
4459
4568
|
function ie() {
|
|
4460
|
-
if (
|
|
4461
|
-
|
|
4569
|
+
if (Ns) return Jt;
|
|
4570
|
+
Ns = 1;
|
|
4462
4571
|
const s = Z();
|
|
4463
|
-
return
|
|
4572
|
+
return Jt = (t, r, n) => new s(t, n).compare(new s(r, n)), Jt;
|
|
4464
4573
|
}
|
|
4465
|
-
var
|
|
4574
|
+
var Gt, Bs;
|
|
4466
4575
|
function Ic() {
|
|
4467
|
-
if (
|
|
4468
|
-
Ns = 1;
|
|
4469
|
-
const s = ie();
|
|
4470
|
-
return Mt = (t, r, n) => s(r, t, n), Mt;
|
|
4471
|
-
}
|
|
4472
|
-
var Jt, Bs;
|
|
4473
|
-
function Tc() {
|
|
4474
|
-
if (Bs) return Jt;
|
|
4576
|
+
if (Bs) return Gt;
|
|
4475
4577
|
Bs = 1;
|
|
4476
4578
|
const s = ie();
|
|
4477
|
-
return
|
|
4579
|
+
return Gt = (t, r, n) => s(r, t, n), Gt;
|
|
4478
4580
|
}
|
|
4479
|
-
var
|
|
4480
|
-
function
|
|
4481
|
-
if (js) return
|
|
4581
|
+
var _t, js;
|
|
4582
|
+
function $c() {
|
|
4583
|
+
if (js) return _t;
|
|
4482
4584
|
js = 1;
|
|
4585
|
+
const s = ie();
|
|
4586
|
+
return _t = (t, r) => s(t, r, !0), _t;
|
|
4587
|
+
}
|
|
4588
|
+
var qt, xs;
|
|
4589
|
+
function Vr() {
|
|
4590
|
+
if (xs) return qt;
|
|
4591
|
+
xs = 1;
|
|
4483
4592
|
const s = Z();
|
|
4484
|
-
return
|
|
4593
|
+
return qt = (t, r, n) => {
|
|
4485
4594
|
const i = new s(t, n), o = new s(r, n);
|
|
4486
4595
|
return i.compare(o) || i.compareBuild(o);
|
|
4487
|
-
},
|
|
4596
|
+
}, qt;
|
|
4488
4597
|
}
|
|
4489
|
-
var
|
|
4490
|
-
function $c() {
|
|
4491
|
-
if (xs) return _t;
|
|
4492
|
-
xs = 1;
|
|
4493
|
-
const s = jr();
|
|
4494
|
-
return _t = (t, r) => t.sort((n, i) => s(n, i, r)), _t;
|
|
4495
|
-
}
|
|
4496
|
-
var qt, Vs;
|
|
4598
|
+
var Kt, Vs;
|
|
4497
4599
|
function Ac() {
|
|
4498
|
-
if (Vs) return
|
|
4600
|
+
if (Vs) return Kt;
|
|
4499
4601
|
Vs = 1;
|
|
4500
|
-
const s =
|
|
4501
|
-
return
|
|
4602
|
+
const s = Vr();
|
|
4603
|
+
return Kt = (t, r) => t.sort((n, i) => s(n, i, r)), Kt;
|
|
4502
4604
|
}
|
|
4503
|
-
var
|
|
4504
|
-
function
|
|
4505
|
-
if (Us) return
|
|
4605
|
+
var Ht, Us;
|
|
4606
|
+
function Lc() {
|
|
4607
|
+
if (Us) return Ht;
|
|
4506
4608
|
Us = 1;
|
|
4507
|
-
const s =
|
|
4508
|
-
return
|
|
4609
|
+
const s = Vr();
|
|
4610
|
+
return Ht = (t, r) => t.sort((n, i) => s(i, n, r)), Ht;
|
|
4509
4611
|
}
|
|
4510
|
-
var
|
|
4511
|
-
function
|
|
4512
|
-
if (Ms) return
|
|
4612
|
+
var Wt, Ms;
|
|
4613
|
+
function yt() {
|
|
4614
|
+
if (Ms) return Wt;
|
|
4513
4615
|
Ms = 1;
|
|
4514
4616
|
const s = ie();
|
|
4515
|
-
return
|
|
4617
|
+
return Wt = (t, r, n) => s(t, r, n) > 0, Wt;
|
|
4516
4618
|
}
|
|
4517
|
-
var
|
|
4518
|
-
function
|
|
4519
|
-
if (Js) return
|
|
4619
|
+
var zt, Js;
|
|
4620
|
+
function Ur() {
|
|
4621
|
+
if (Js) return zt;
|
|
4520
4622
|
Js = 1;
|
|
4521
4623
|
const s = ie();
|
|
4522
|
-
return
|
|
4624
|
+
return zt = (t, r, n) => s(t, r, n) < 0, zt;
|
|
4523
4625
|
}
|
|
4524
|
-
var
|
|
4626
|
+
var Xt, Gs;
|
|
4525
4627
|
function no() {
|
|
4526
|
-
if (Gs) return
|
|
4628
|
+
if (Gs) return Xt;
|
|
4527
4629
|
Gs = 1;
|
|
4528
4630
|
const s = ie();
|
|
4529
|
-
return
|
|
4631
|
+
return Xt = (t, r, n) => s(t, r, n) === 0, Xt;
|
|
4530
4632
|
}
|
|
4531
|
-
var
|
|
4532
|
-
function
|
|
4533
|
-
if (_s) return
|
|
4633
|
+
var Yt, _s;
|
|
4634
|
+
function oo() {
|
|
4635
|
+
if (_s) return Yt;
|
|
4534
4636
|
_s = 1;
|
|
4535
4637
|
const s = ie();
|
|
4536
|
-
return
|
|
4638
|
+
return Yt = (t, r, n) => s(t, r, n) !== 0, Yt;
|
|
4537
4639
|
}
|
|
4538
|
-
var
|
|
4539
|
-
function
|
|
4540
|
-
if (qs) return
|
|
4640
|
+
var Qt, qs;
|
|
4641
|
+
function Mr() {
|
|
4642
|
+
if (qs) return Qt;
|
|
4541
4643
|
qs = 1;
|
|
4542
4644
|
const s = ie();
|
|
4543
|
-
return
|
|
4645
|
+
return Qt = (t, r, n) => s(t, r, n) >= 0, Qt;
|
|
4544
4646
|
}
|
|
4545
|
-
var
|
|
4546
|
-
function
|
|
4547
|
-
if (Ks) return
|
|
4647
|
+
var Zt, Ks;
|
|
4648
|
+
function Jr() {
|
|
4649
|
+
if (Ks) return Zt;
|
|
4548
4650
|
Ks = 1;
|
|
4549
|
-
const s =
|
|
4550
|
-
return
|
|
4651
|
+
const s = ie();
|
|
4652
|
+
return Zt = (t, r, n) => s(t, r, n) <= 0, Zt;
|
|
4653
|
+
}
|
|
4654
|
+
var er, Hs;
|
|
4655
|
+
function io() {
|
|
4656
|
+
if (Hs) return er;
|
|
4657
|
+
Hs = 1;
|
|
4658
|
+
const s = no(), e = oo(), t = yt(), r = Mr(), n = Ur(), i = Jr();
|
|
4659
|
+
return er = (a, c, l, u) => {
|
|
4551
4660
|
switch (c) {
|
|
4552
4661
|
case "===":
|
|
4553
4662
|
return typeof a == "object" && (a = a.version), typeof l == "object" && (l = l.version), a === l;
|
|
@@ -4570,14 +4679,14 @@ function oo() {
|
|
|
4570
4679
|
default:
|
|
4571
4680
|
throw new TypeError(`Invalid operator: ${c}`);
|
|
4572
4681
|
}
|
|
4573
|
-
},
|
|
4682
|
+
}, er;
|
|
4574
4683
|
}
|
|
4575
|
-
var
|
|
4576
|
-
function
|
|
4577
|
-
if (
|
|
4578
|
-
|
|
4579
|
-
const s = Z(), e =
|
|
4580
|
-
return
|
|
4684
|
+
var tr, Ws;
|
|
4685
|
+
function Dc() {
|
|
4686
|
+
if (Ws) return tr;
|
|
4687
|
+
Ws = 1;
|
|
4688
|
+
const s = Z(), e = Te(), { safeRe: t, t: r } = ze();
|
|
4689
|
+
return tr = (i, o) => {
|
|
4581
4690
|
if (i instanceof s)
|
|
4582
4691
|
return i;
|
|
4583
4692
|
if (typeof i == "number" && (i = String(i)), typeof i != "string")
|
|
@@ -4597,12 +4706,12 @@ function Lc() {
|
|
|
4597
4706
|
return null;
|
|
4598
4707
|
const c = a[2], l = a[3] || "0", u = a[4] || "0", d = o.includePrerelease && a[5] ? `-${a[5]}` : "", p = o.includePrerelease && a[6] ? `+${a[6]}` : "";
|
|
4599
4708
|
return e(`${c}.${l}.${u}${d}${p}`, o);
|
|
4600
|
-
},
|
|
4709
|
+
}, tr;
|
|
4601
4710
|
}
|
|
4602
|
-
var
|
|
4603
|
-
function
|
|
4604
|
-
if (
|
|
4605
|
-
|
|
4711
|
+
var rr, zs;
|
|
4712
|
+
function Nc() {
|
|
4713
|
+
if (zs) return rr;
|
|
4714
|
+
zs = 1;
|
|
4606
4715
|
class s {
|
|
4607
4716
|
constructor() {
|
|
4608
4717
|
this.max = 1e3, this.map = /* @__PURE__ */ new Map();
|
|
@@ -4626,12 +4735,12 @@ function Dc() {
|
|
|
4626
4735
|
return this;
|
|
4627
4736
|
}
|
|
4628
4737
|
}
|
|
4629
|
-
return
|
|
4738
|
+
return rr = s, rr;
|
|
4630
4739
|
}
|
|
4631
|
-
var
|
|
4740
|
+
var sr, Xs;
|
|
4632
4741
|
function ae() {
|
|
4633
|
-
if (
|
|
4634
|
-
|
|
4742
|
+
if (Xs) return sr;
|
|
4743
|
+
Xs = 1;
|
|
4635
4744
|
const s = /\s+/g;
|
|
4636
4745
|
class e {
|
|
4637
4746
|
constructor(m, w) {
|
|
@@ -4647,7 +4756,7 @@ function ae() {
|
|
|
4647
4756
|
this.set = [y];
|
|
4648
4757
|
else if (this.set.length > 1) {
|
|
4649
4758
|
for (const R of this.set)
|
|
4650
|
-
if (R.length === 1 &&
|
|
4759
|
+
if (R.length === 1 && b(R[0])) {
|
|
4651
4760
|
this.set = [R];
|
|
4652
4761
|
break;
|
|
4653
4762
|
}
|
|
@@ -4681,14 +4790,14 @@ function ae() {
|
|
|
4681
4790
|
m = m.replace(O, M(this.options.includePrerelease)), o("hyphen replace", m), m = m.replace(c[l.COMPARATORTRIM], u), o("comparator trim", m), m = m.replace(c[l.TILDETRIM], d), o("tilde trim", m), m = m.replace(c[l.CARETTRIM], p), o("caret trim", m);
|
|
4682
4791
|
let A = m.split(" ").map((U) => B(U, this.options)).join(" ").split(/\s+/).map((U) => z(U, this.options));
|
|
4683
4792
|
k && (A = A.filter((U) => (o("loose invalid filter", U, this.options), !!U.match(c[l.COMPARATORLOOSE])))), o("range list", A);
|
|
4684
|
-
const
|
|
4793
|
+
const T = /* @__PURE__ */ new Map(), x = A.map((U) => new i(U, this.options));
|
|
4685
4794
|
for (const U of x) {
|
|
4686
4795
|
if (h(U))
|
|
4687
4796
|
return [U];
|
|
4688
|
-
|
|
4797
|
+
T.set(U.value, U);
|
|
4689
4798
|
}
|
|
4690
|
-
|
|
4691
|
-
const H = [...
|
|
4799
|
+
T.size > 1 && T.has("") && T.delete("");
|
|
4800
|
+
const H = [...T.values()];
|
|
4692
4801
|
return r.set(y, H), H;
|
|
4693
4802
|
}
|
|
4694
4803
|
intersects(m, w) {
|
|
@@ -4712,14 +4821,14 @@ function ae() {
|
|
|
4712
4821
|
return !1;
|
|
4713
4822
|
}
|
|
4714
4823
|
}
|
|
4715
|
-
|
|
4716
|
-
const t =
|
|
4824
|
+
sr = e;
|
|
4825
|
+
const t = Nc(), r = new t(), n = xr(), i = wt(), o = vt(), a = Z(), {
|
|
4717
4826
|
safeRe: c,
|
|
4718
4827
|
t: l,
|
|
4719
4828
|
comparatorTrimReplace: u,
|
|
4720
4829
|
tildeTrimReplace: d,
|
|
4721
4830
|
caretTrimReplace: p
|
|
4722
|
-
} = ze(), { FLAG_INCLUDE_PRERELEASE: f, FLAG_LOOSE: v } = mt(), h = (g) => g.value === "<0.0.0-0",
|
|
4831
|
+
} = ze(), { FLAG_INCLUDE_PRERELEASE: f, FLAG_LOOSE: v } = mt(), h = (g) => g.value === "<0.0.0-0", b = (g) => g.value === "", E = (g, m) => {
|
|
4723
4832
|
let w = !0;
|
|
4724
4833
|
const y = g.slice();
|
|
4725
4834
|
let R = y.pop();
|
|
@@ -4730,26 +4839,26 @@ function ae() {
|
|
|
4730
4839
|
const w = m.loose ? c[l.TILDELOOSE] : c[l.TILDE];
|
|
4731
4840
|
return g.replace(w, (y, R, k, O, A) => {
|
|
4732
4841
|
o("tilde", g, y, R, k, O, A);
|
|
4733
|
-
let
|
|
4734
|
-
return F(R) ?
|
|
4842
|
+
let T;
|
|
4843
|
+
return F(R) ? T = "" : F(k) ? T = `>=${R}.0.0 <${+R + 1}.0.0-0` : F(O) ? T = `>=${R}.${k}.0 <${R}.${+k + 1}.0-0` : A ? (o("replaceTilde pr", A), T = `>=${R}.${k}.${O}-${A} <${R}.${+k + 1}.0-0`) : T = `>=${R}.${k}.${O} <${R}.${+k + 1}.0-0`, o("tilde return", T), T;
|
|
4735
4844
|
});
|
|
4736
4845
|
}, P = (g, m) => g.trim().split(/\s+/).map((w) => $(w, m)).join(" "), $ = (g, m) => {
|
|
4737
4846
|
o("caret", g, m);
|
|
4738
4847
|
const w = m.loose ? c[l.CARETLOOSE] : c[l.CARET], y = m.includePrerelease ? "-0" : "";
|
|
4739
|
-
return g.replace(w, (R, k, O, A,
|
|
4740
|
-
o("caret", g, R, k, O, A,
|
|
4848
|
+
return g.replace(w, (R, k, O, A, T) => {
|
|
4849
|
+
o("caret", g, R, k, O, A, T);
|
|
4741
4850
|
let x;
|
|
4742
|
-
return F(k) ? x = "" : F(O) ? x = `>=${k}.0.0${y} <${+k + 1}.0.0-0` : F(A) ? k === "0" ? x = `>=${k}.${O}.0${y} <${k}.${+O + 1}.0-0` : x = `>=${k}.${O}.0${y} <${+k + 1}.0.0-0` :
|
|
4851
|
+
return F(k) ? x = "" : F(O) ? x = `>=${k}.0.0${y} <${+k + 1}.0.0-0` : F(A) ? k === "0" ? x = `>=${k}.${O}.0${y} <${k}.${+O + 1}.0-0` : x = `>=${k}.${O}.0${y} <${+k + 1}.0.0-0` : T ? (o("replaceCaret pr", T), k === "0" ? O === "0" ? x = `>=${k}.${O}.${A}-${T} <${k}.${O}.${+A + 1}-0` : x = `>=${k}.${O}.${A}-${T} <${k}.${+O + 1}.0-0` : x = `>=${k}.${O}.${A}-${T} <${+k + 1}.0.0-0`) : (o("no pr"), k === "0" ? O === "0" ? x = `>=${k}.${O}.${A}${y} <${k}.${O}.${+A + 1}-0` : x = `>=${k}.${O}.${A}${y} <${k}.${+O + 1}.0-0` : x = `>=${k}.${O}.${A} <${+k + 1}.0.0-0`), o("caret return", x), x;
|
|
4743
4852
|
});
|
|
4744
4853
|
}, C = (g, m) => (o("replaceXRanges", g, m), g.split(/\s+/).map((w) => G(w, m)).join(" ")), G = (g, m) => {
|
|
4745
4854
|
g = g.trim();
|
|
4746
4855
|
const w = m.loose ? c[l.XRANGELOOSE] : c[l.XRANGE];
|
|
4747
|
-
return g.replace(w, (y, R, k, O, A,
|
|
4748
|
-
o("xRange", g, y, R, k, O, A,
|
|
4749
|
-
const x = F(k), H = x || F(O), U = H || F(A),
|
|
4750
|
-
return R === "=" &&
|
|
4856
|
+
return g.replace(w, (y, R, k, O, A, T) => {
|
|
4857
|
+
o("xRange", g, y, R, k, O, A, T);
|
|
4858
|
+
const x = F(k), H = x || F(O), U = H || F(A), oe = U;
|
|
4859
|
+
return R === "=" && oe && (R = ""), T = m.includePrerelease ? "-0" : "", x ? R === ">" || R === "<" ? y = "<0.0.0-0" : y = "*" : R && oe ? (H && (O = 0), A = 0, R === ">" ? (R = ">=", H ? (k = +k + 1, O = 0, A = 0) : (O = +O + 1, A = 0)) : R === "<=" && (R = "<", H ? k = +k + 1 : O = +O + 1), R === "<" && (T = "-0"), y = `${R + k}.${O}.${A}${T}`) : H ? y = `>=${k}.0.0${T} <${+k + 1}.0.0-0` : U && (y = `>=${k}.${O}.0${T} <${k}.${+O + 1}.0-0`), o("xRange return", y), y;
|
|
4751
4860
|
});
|
|
4752
|
-
}, ce = (g, m) => (o("replaceStars", g, m), g.trim().replace(c[l.STAR], "")), z = (g, m) => (o("replaceGTE0", g, m), g.trim().replace(c[m.includePrerelease ? l.GTE0PRE : l.GTE0], "")), M = (g) => (m, w, y, R, k, O, A,
|
|
4861
|
+
}, ce = (g, m) => (o("replaceStars", g, m), g.trim().replace(c[l.STAR], "")), z = (g, m) => (o("replaceGTE0", g, m), g.trim().replace(c[m.includePrerelease ? l.GTE0PRE : l.GTE0], "")), M = (g) => (m, w, y, R, k, O, A, T, x, H, U, oe) => (F(y) ? w = "" : F(R) ? w = `>=${y}.0.0${g ? "-0" : ""}` : F(k) ? w = `>=${y}.${R}.0${g ? "-0" : ""}` : O ? w = `>=${w}` : w = `>=${w}${g ? "-0" : ""}`, F(x) ? T = "" : F(H) ? T = `<${+x + 1}.0.0-0` : F(U) ? T = `<${x}.${+H + 1}.0-0` : oe ? T = `<=${x}.${H}.${U}-${oe}` : g ? T = `<${x}.${H}.${+U + 1}-0` : T = `<=${T}`, `${w} ${T}`.trim()), W = (g, m, w) => {
|
|
4753
4862
|
for (let y = 0; y < g.length; y++)
|
|
4754
4863
|
if (!g[y].test(m))
|
|
4755
4864
|
return !1;
|
|
@@ -4764,12 +4873,12 @@ function ae() {
|
|
|
4764
4873
|
}
|
|
4765
4874
|
return !0;
|
|
4766
4875
|
};
|
|
4767
|
-
return
|
|
4876
|
+
return sr;
|
|
4768
4877
|
}
|
|
4769
|
-
var
|
|
4878
|
+
var nr, Ys;
|
|
4770
4879
|
function wt() {
|
|
4771
|
-
if (
|
|
4772
|
-
|
|
4880
|
+
if (Ys) return nr;
|
|
4881
|
+
Ys = 1;
|
|
4773
4882
|
const s = Symbol("SemVer ANY");
|
|
4774
4883
|
class e {
|
|
4775
4884
|
static get ANY() {
|
|
@@ -4809,37 +4918,37 @@ function wt() {
|
|
|
4809
4918
|
return this.operator === "" ? this.value === "" ? !0 : new c(u.value, d).test(this.value) : u.operator === "" ? u.value === "" ? !0 : new c(this.value, d).test(u.semver) : (d = t(d), d.includePrerelease && (this.value === "<0.0.0-0" || u.value === "<0.0.0-0") || !d.includePrerelease && (this.value.startsWith("<0.0.0") || u.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && u.operator.startsWith(">") || this.operator.startsWith("<") && u.operator.startsWith("<") || this.semver.version === u.semver.version && this.operator.includes("=") && u.operator.includes("=") || i(this.semver, "<", u.semver, d) && this.operator.startsWith(">") && u.operator.startsWith("<") || i(this.semver, ">", u.semver, d) && this.operator.startsWith("<") && u.operator.startsWith(">")));
|
|
4810
4919
|
}
|
|
4811
4920
|
}
|
|
4812
|
-
|
|
4813
|
-
const t =
|
|
4814
|
-
return
|
|
4921
|
+
nr = e;
|
|
4922
|
+
const t = xr(), { safeRe: r, t: n } = ze(), i = io(), o = vt(), a = Z(), c = ae();
|
|
4923
|
+
return nr;
|
|
4815
4924
|
}
|
|
4816
|
-
var
|
|
4817
|
-
function
|
|
4818
|
-
if (
|
|
4819
|
-
|
|
4925
|
+
var or, Qs;
|
|
4926
|
+
function St() {
|
|
4927
|
+
if (Qs) return or;
|
|
4928
|
+
Qs = 1;
|
|
4820
4929
|
const s = ae();
|
|
4821
|
-
return
|
|
4930
|
+
return or = (t, r, n) => {
|
|
4822
4931
|
try {
|
|
4823
4932
|
r = new s(r, n);
|
|
4824
4933
|
} catch {
|
|
4825
4934
|
return !1;
|
|
4826
4935
|
}
|
|
4827
4936
|
return r.test(t);
|
|
4828
|
-
},
|
|
4829
|
-
}
|
|
4830
|
-
var nr, Qs;
|
|
4831
|
-
function Nc() {
|
|
4832
|
-
if (Qs) return nr;
|
|
4833
|
-
Qs = 1;
|
|
4834
|
-
const s = ae();
|
|
4835
|
-
return nr = (t, r) => new s(t, r).set.map((n) => n.map((i) => i.value).join(" ").trim().split(" ")), nr;
|
|
4937
|
+
}, or;
|
|
4836
4938
|
}
|
|
4837
|
-
var
|
|
4939
|
+
var ir, Zs;
|
|
4838
4940
|
function Bc() {
|
|
4839
|
-
if (Zs) return
|
|
4941
|
+
if (Zs) return ir;
|
|
4840
4942
|
Zs = 1;
|
|
4943
|
+
const s = ae();
|
|
4944
|
+
return ir = (t, r) => new s(t, r).set.map((n) => n.map((i) => i.value).join(" ").trim().split(" ")), ir;
|
|
4945
|
+
}
|
|
4946
|
+
var ar, en;
|
|
4947
|
+
function jc() {
|
|
4948
|
+
if (en) return ar;
|
|
4949
|
+
en = 1;
|
|
4841
4950
|
const s = Z(), e = ae();
|
|
4842
|
-
return
|
|
4951
|
+
return ar = (r, n, i) => {
|
|
4843
4952
|
let o = null, a = null, c = null;
|
|
4844
4953
|
try {
|
|
4845
4954
|
c = new e(n, i);
|
|
@@ -4849,14 +4958,14 @@ function Bc() {
|
|
|
4849
4958
|
return r.forEach((l) => {
|
|
4850
4959
|
c.test(l) && (!o || a.compare(l) === -1) && (o = l, a = new s(o, i));
|
|
4851
4960
|
}), o;
|
|
4852
|
-
},
|
|
4961
|
+
}, ar;
|
|
4853
4962
|
}
|
|
4854
|
-
var
|
|
4855
|
-
function
|
|
4856
|
-
if (
|
|
4857
|
-
|
|
4963
|
+
var cr, tn;
|
|
4964
|
+
function xc() {
|
|
4965
|
+
if (tn) return cr;
|
|
4966
|
+
tn = 1;
|
|
4858
4967
|
const s = Z(), e = ae();
|
|
4859
|
-
return
|
|
4968
|
+
return cr = (r, n, i) => {
|
|
4860
4969
|
let o = null, a = null, c = null;
|
|
4861
4970
|
try {
|
|
4862
4971
|
c = new e(n, i);
|
|
@@ -4866,14 +4975,14 @@ function jc() {
|
|
|
4866
4975
|
return r.forEach((l) => {
|
|
4867
4976
|
c.test(l) && (!o || a.compare(l) === 1) && (o = l, a = new s(o, i));
|
|
4868
4977
|
}), o;
|
|
4869
|
-
},
|
|
4978
|
+
}, cr;
|
|
4870
4979
|
}
|
|
4871
|
-
var
|
|
4872
|
-
function
|
|
4873
|
-
if (
|
|
4874
|
-
|
|
4980
|
+
var lr, rn;
|
|
4981
|
+
function Vc() {
|
|
4982
|
+
if (rn) return lr;
|
|
4983
|
+
rn = 1;
|
|
4875
4984
|
const s = Z(), e = ae(), t = yt();
|
|
4876
|
-
return
|
|
4985
|
+
return lr = (n, i) => {
|
|
4877
4986
|
n = new e(n, i);
|
|
4878
4987
|
let o = new s("0.0.0");
|
|
4879
4988
|
if (n.test(o) || (o = new s("0.0.0-0"), n.test(o)))
|
|
@@ -4902,35 +5011,35 @@ function xc() {
|
|
|
4902
5011
|
}), l && (!o || t(o, l)) && (o = l);
|
|
4903
5012
|
}
|
|
4904
5013
|
return o && n.test(o) ? o : null;
|
|
4905
|
-
},
|
|
5014
|
+
}, lr;
|
|
4906
5015
|
}
|
|
4907
|
-
var
|
|
4908
|
-
function
|
|
4909
|
-
if (
|
|
4910
|
-
|
|
5016
|
+
var ur, sn;
|
|
5017
|
+
function Uc() {
|
|
5018
|
+
if (sn) return ur;
|
|
5019
|
+
sn = 1;
|
|
4911
5020
|
const s = ae();
|
|
4912
|
-
return
|
|
5021
|
+
return ur = (t, r) => {
|
|
4913
5022
|
try {
|
|
4914
5023
|
return new s(t, r).range || "*";
|
|
4915
5024
|
} catch {
|
|
4916
5025
|
return null;
|
|
4917
5026
|
}
|
|
4918
|
-
},
|
|
5027
|
+
}, ur;
|
|
4919
5028
|
}
|
|
4920
|
-
var
|
|
4921
|
-
function
|
|
4922
|
-
if (
|
|
4923
|
-
|
|
4924
|
-
const s = Z(), e = wt(), { ANY: t } = e, r = ae(), n =
|
|
4925
|
-
return
|
|
5029
|
+
var dr, nn;
|
|
5030
|
+
function Gr() {
|
|
5031
|
+
if (nn) return dr;
|
|
5032
|
+
nn = 1;
|
|
5033
|
+
const s = Z(), e = wt(), { ANY: t } = e, r = ae(), n = St(), i = yt(), o = Ur(), a = Jr(), c = Mr();
|
|
5034
|
+
return dr = (u, d, p, f) => {
|
|
4926
5035
|
u = new s(u, f), d = new r(d, f);
|
|
4927
|
-
let v, h,
|
|
5036
|
+
let v, h, b, E, B;
|
|
4928
5037
|
switch (p) {
|
|
4929
5038
|
case ">":
|
|
4930
|
-
v = i, h = a,
|
|
5039
|
+
v = i, h = a, b = o, E = ">", B = ">=";
|
|
4931
5040
|
break;
|
|
4932
5041
|
case "<":
|
|
4933
|
-
v = o, h = c,
|
|
5042
|
+
v = o, h = c, b = i, E = "<", B = "<=";
|
|
4934
5043
|
break;
|
|
4935
5044
|
default:
|
|
4936
5045
|
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
@@ -4941,42 +5050,42 @@ function Mr() {
|
|
|
4941
5050
|
const j = d.set[F];
|
|
4942
5051
|
let V = null, P = null;
|
|
4943
5052
|
if (j.forEach(($) => {
|
|
4944
|
-
$.semver === t && ($ = new e(">=0.0.0")), V = V || $, P = P || $, v($.semver, V.semver, f) ? V = $ :
|
|
5053
|
+
$.semver === t && ($ = new e(">=0.0.0")), V = V || $, P = P || $, v($.semver, V.semver, f) ? V = $ : b($.semver, P.semver, f) && (P = $);
|
|
4945
5054
|
}), V.operator === E || V.operator === B || (!P.operator || P.operator === E) && h(u, P.semver))
|
|
4946
5055
|
return !1;
|
|
4947
|
-
if (P.operator === B &&
|
|
5056
|
+
if (P.operator === B && b(u, P.semver))
|
|
4948
5057
|
return !1;
|
|
4949
5058
|
}
|
|
4950
5059
|
return !0;
|
|
4951
|
-
},
|
|
5060
|
+
}, dr;
|
|
4952
5061
|
}
|
|
4953
|
-
var
|
|
4954
|
-
function Uc() {
|
|
4955
|
-
if (nn) return ur;
|
|
4956
|
-
nn = 1;
|
|
4957
|
-
const s = Mr();
|
|
4958
|
-
return ur = (t, r, n) => s(t, r, ">", n), ur;
|
|
4959
|
-
}
|
|
4960
|
-
var dr, on;
|
|
5062
|
+
var pr, on;
|
|
4961
5063
|
function Mc() {
|
|
4962
|
-
if (on) return
|
|
5064
|
+
if (on) return pr;
|
|
4963
5065
|
on = 1;
|
|
4964
|
-
const s =
|
|
4965
|
-
return
|
|
5066
|
+
const s = Gr();
|
|
5067
|
+
return pr = (t, r, n) => s(t, r, ">", n), pr;
|
|
4966
5068
|
}
|
|
4967
|
-
var
|
|
5069
|
+
var fr, an;
|
|
4968
5070
|
function Jc() {
|
|
4969
|
-
if (an) return
|
|
5071
|
+
if (an) return fr;
|
|
4970
5072
|
an = 1;
|
|
4971
|
-
const s =
|
|
4972
|
-
return
|
|
5073
|
+
const s = Gr();
|
|
5074
|
+
return fr = (t, r, n) => s(t, r, "<", n), fr;
|
|
4973
5075
|
}
|
|
4974
|
-
var
|
|
5076
|
+
var hr, cn;
|
|
4975
5077
|
function Gc() {
|
|
4976
|
-
if (cn) return
|
|
5078
|
+
if (cn) return hr;
|
|
4977
5079
|
cn = 1;
|
|
4978
|
-
const s =
|
|
4979
|
-
return
|
|
5080
|
+
const s = ae();
|
|
5081
|
+
return hr = (t, r, n) => (t = new s(t, n), r = new s(r, n), t.intersects(r, n)), hr;
|
|
5082
|
+
}
|
|
5083
|
+
var gr, ln;
|
|
5084
|
+
function _c() {
|
|
5085
|
+
if (ln) return gr;
|
|
5086
|
+
ln = 1;
|
|
5087
|
+
const s = St(), e = ie();
|
|
5088
|
+
return gr = (t, r, n) => {
|
|
4980
5089
|
const i = [];
|
|
4981
5090
|
let o = null, a = null;
|
|
4982
5091
|
const c = t.sort((p, f) => e(p, f, n));
|
|
@@ -4988,20 +5097,20 @@ function Gc() {
|
|
|
4988
5097
|
p === f ? l.push(p) : !f && p === c[0] ? l.push("*") : f ? p === c[0] ? l.push(`<=${f}`) : l.push(`${p} - ${f}`) : l.push(`>=${p}`);
|
|
4989
5098
|
const u = l.join(" || "), d = typeof r.raw == "string" ? r.raw : String(r);
|
|
4990
5099
|
return u.length < d.length ? u : r;
|
|
4991
|
-
},
|
|
5100
|
+
}, gr;
|
|
4992
5101
|
}
|
|
4993
|
-
var
|
|
4994
|
-
function
|
|
4995
|
-
if (
|
|
4996
|
-
|
|
4997
|
-
const s = ae(), e = wt(), { ANY: t } = e, r =
|
|
5102
|
+
var mr, un;
|
|
5103
|
+
function qc() {
|
|
5104
|
+
if (un) return mr;
|
|
5105
|
+
un = 1;
|
|
5106
|
+
const s = ae(), e = wt(), { ANY: t } = e, r = St(), n = ie(), i = (d, p, f = {}) => {
|
|
4998
5107
|
if (d === p)
|
|
4999
5108
|
return !0;
|
|
5000
5109
|
d = new s(d, f), p = new s(p, f);
|
|
5001
5110
|
let v = !1;
|
|
5002
5111
|
e: for (const h of d.set) {
|
|
5003
|
-
for (const
|
|
5004
|
-
const E = c(h,
|
|
5112
|
+
for (const b of p.set) {
|
|
5113
|
+
const E = c(h, b, f);
|
|
5005
5114
|
if (v = v || E !== null, E)
|
|
5006
5115
|
continue e;
|
|
5007
5116
|
}
|
|
@@ -5023,28 +5132,28 @@ function _c() {
|
|
|
5023
5132
|
p = a;
|
|
5024
5133
|
}
|
|
5025
5134
|
const v = /* @__PURE__ */ new Set();
|
|
5026
|
-
let h,
|
|
5135
|
+
let h, b;
|
|
5027
5136
|
for (const C of d)
|
|
5028
|
-
C.operator === ">" || C.operator === ">=" ? h = l(h, C, f) : C.operator === "<" || C.operator === "<=" ?
|
|
5137
|
+
C.operator === ">" || C.operator === ">=" ? h = l(h, C, f) : C.operator === "<" || C.operator === "<=" ? b = u(b, C, f) : v.add(C.semver);
|
|
5029
5138
|
if (v.size > 1)
|
|
5030
5139
|
return null;
|
|
5031
5140
|
let E;
|
|
5032
|
-
if (h &&
|
|
5033
|
-
if (E = n(h.semver,
|
|
5141
|
+
if (h && b) {
|
|
5142
|
+
if (E = n(h.semver, b.semver, f), E > 0)
|
|
5034
5143
|
return null;
|
|
5035
|
-
if (E === 0 && (h.operator !== ">=" ||
|
|
5144
|
+
if (E === 0 && (h.operator !== ">=" || b.operator !== "<="))
|
|
5036
5145
|
return null;
|
|
5037
5146
|
}
|
|
5038
5147
|
for (const C of v) {
|
|
5039
|
-
if (h && !r(C, String(h), f) ||
|
|
5148
|
+
if (h && !r(C, String(h), f) || b && !r(C, String(b), f))
|
|
5040
5149
|
return null;
|
|
5041
5150
|
for (const G of p)
|
|
5042
5151
|
if (!r(C, String(G), f))
|
|
5043
5152
|
return !1;
|
|
5044
5153
|
return !0;
|
|
5045
5154
|
}
|
|
5046
|
-
let B, F, j, V, P =
|
|
5047
|
-
P && P.prerelease.length === 1 &&
|
|
5155
|
+
let B, F, j, V, P = b && !f.includePrerelease && b.semver.prerelease.length ? b.semver : !1, $ = h && !f.includePrerelease && h.semver.prerelease.length ? h.semver : !1;
|
|
5156
|
+
P && P.prerelease.length === 1 && b.operator === "<" && P.prerelease[0] === 0 && (P = !1);
|
|
5048
5157
|
for (const C of p) {
|
|
5049
5158
|
if (V = V || C.operator === ">" || C.operator === ">=", j = j || C.operator === "<" || C.operator === "<=", h) {
|
|
5050
5159
|
if ($ && C.semver.prerelease && C.semver.prerelease.length && C.semver.major === $.major && C.semver.minor === $.minor && C.semver.patch === $.patch && ($ = !1), C.operator === ">" || C.operator === ">=") {
|
|
@@ -5053,17 +5162,17 @@ function _c() {
|
|
|
5053
5162
|
} else if (h.operator === ">=" && !r(h.semver, String(C), f))
|
|
5054
5163
|
return !1;
|
|
5055
5164
|
}
|
|
5056
|
-
if (
|
|
5165
|
+
if (b) {
|
|
5057
5166
|
if (P && C.semver.prerelease && C.semver.prerelease.length && C.semver.major === P.major && C.semver.minor === P.minor && C.semver.patch === P.patch && (P = !1), C.operator === "<" || C.operator === "<=") {
|
|
5058
|
-
if (F = u(
|
|
5167
|
+
if (F = u(b, C, f), F === C && F !== b)
|
|
5059
5168
|
return !1;
|
|
5060
|
-
} else if (
|
|
5169
|
+
} else if (b.operator === "<=" && !r(b.semver, String(C), f))
|
|
5061
5170
|
return !1;
|
|
5062
5171
|
}
|
|
5063
|
-
if (!C.operator && (
|
|
5172
|
+
if (!C.operator && (b || h) && E !== 0)
|
|
5064
5173
|
return !1;
|
|
5065
5174
|
}
|
|
5066
|
-
return !(h && j && !
|
|
5175
|
+
return !(h && j && !b && E !== 0 || b && V && !h && E !== 0 || $ || P);
|
|
5067
5176
|
}, l = (d, p, f) => {
|
|
5068
5177
|
if (!d)
|
|
5069
5178
|
return p;
|
|
@@ -5075,14 +5184,14 @@ function _c() {
|
|
|
5075
5184
|
const v = n(d.semver, p.semver, f);
|
|
5076
5185
|
return v < 0 ? d : v > 0 || p.operator === "<" && d.operator === "<=" ? p : d;
|
|
5077
5186
|
};
|
|
5078
|
-
return
|
|
5079
|
-
}
|
|
5080
|
-
var
|
|
5081
|
-
function
|
|
5082
|
-
if (
|
|
5083
|
-
|
|
5084
|
-
const s = ze(), e = mt(), t = Z(), r =
|
|
5085
|
-
return
|
|
5187
|
+
return mr = i, mr;
|
|
5188
|
+
}
|
|
5189
|
+
var vr, dn;
|
|
5190
|
+
function Kc() {
|
|
5191
|
+
if (dn) return vr;
|
|
5192
|
+
dn = 1;
|
|
5193
|
+
const s = ze(), e = mt(), t = Z(), r = so(), n = Te(), i = kc(), o = Rc(), a = Cc(), c = Ec(), l = Pc(), u = Oc(), d = Fc(), p = Tc(), f = ie(), v = Ic(), h = $c(), b = Vr(), E = Ac(), B = Lc(), F = yt(), j = Ur(), V = no(), P = oo(), $ = Mr(), C = Jr(), G = io(), ce = Dc(), z = wt(), M = ae(), W = St(), g = Bc(), m = jc(), w = xc(), y = Vc(), R = Uc(), k = Gr(), O = Mc(), A = Jc(), T = Gc(), x = _c(), H = qc();
|
|
5194
|
+
return vr = {
|
|
5086
5195
|
parse: n,
|
|
5087
5196
|
valid: i,
|
|
5088
5197
|
clean: o,
|
|
@@ -5095,7 +5204,7 @@ function qc() {
|
|
|
5095
5204
|
compare: f,
|
|
5096
5205
|
rcompare: v,
|
|
5097
5206
|
compareLoose: h,
|
|
5098
|
-
compareBuild:
|
|
5207
|
+
compareBuild: b,
|
|
5099
5208
|
sort: E,
|
|
5100
5209
|
rsort: B,
|
|
5101
5210
|
gt: F,
|
|
@@ -5117,7 +5226,7 @@ function qc() {
|
|
|
5117
5226
|
outside: k,
|
|
5118
5227
|
gtr: O,
|
|
5119
5228
|
ltr: A,
|
|
5120
|
-
intersects:
|
|
5229
|
+
intersects: T,
|
|
5121
5230
|
simplifyRange: x,
|
|
5122
5231
|
subset: H,
|
|
5123
5232
|
SemVer: t,
|
|
@@ -5128,17 +5237,17 @@ function qc() {
|
|
|
5128
5237
|
RELEASE_TYPES: e.RELEASE_TYPES,
|
|
5129
5238
|
compareIdentifiers: r.compareIdentifiers,
|
|
5130
5239
|
rcompareIdentifiers: r.rcompareIdentifiers
|
|
5131
|
-
},
|
|
5240
|
+
}, vr;
|
|
5132
5241
|
}
|
|
5133
|
-
var
|
|
5134
|
-
const
|
|
5242
|
+
var Hc = Kc();
|
|
5243
|
+
const Wc = /* @__PURE__ */ bc(Hc), zc = {
|
|
5135
5244
|
minDelay: 1500
|
|
5136
|
-
},
|
|
5137
|
-
class
|
|
5245
|
+
}, Xc = "__no_updates__";
|
|
5246
|
+
class Yc extends qo {
|
|
5138
5247
|
constructor(t, r, n = {}) {
|
|
5139
|
-
super({ ...n, ...
|
|
5140
|
-
|
|
5141
|
-
|
|
5248
|
+
super({ ...n, ...zc }, r);
|
|
5249
|
+
S(this, "http");
|
|
5250
|
+
S(this, "preferredUpdateChannel");
|
|
5142
5251
|
this.registryProvider = t, this.http = n.http, this.preferredUpdateChannel = n.preferredUpdateChannel;
|
|
5143
5252
|
}
|
|
5144
5253
|
getKey(t) {
|
|
@@ -5150,7 +5259,7 @@ class Xc extends _o {
|
|
|
5150
5259
|
case "from-registry-v2":
|
|
5151
5260
|
return `from_registry_v2_${te(t)}`;
|
|
5152
5261
|
default:
|
|
5153
|
-
return
|
|
5262
|
+
return Xc;
|
|
5154
5263
|
}
|
|
5155
5264
|
}
|
|
5156
5265
|
async readValue(t) {
|
|
@@ -5160,16 +5269,16 @@ class Xc extends _o {
|
|
|
5160
5269
|
switch (i.type) {
|
|
5161
5270
|
case "dev-v1":
|
|
5162
5271
|
try {
|
|
5163
|
-
const o = await
|
|
5272
|
+
const o = await Dn(i.folder);
|
|
5164
5273
|
return o === i.mtime ? { suggestions: [] } : { mainSuggestion: { ...i, mtime: o }, suggestions: [] };
|
|
5165
5274
|
} catch (o) {
|
|
5166
5275
|
return this.logger.warn(o), { suggestions: [] };
|
|
5167
5276
|
}
|
|
5168
5277
|
case "dev-v2":
|
|
5169
5278
|
try {
|
|
5170
|
-
const o = await
|
|
5279
|
+
const o = await Sr(i.folder, this.logger);
|
|
5171
5280
|
if (o === void 0) return { suggestions: [] };
|
|
5172
|
-
const a = await
|
|
5281
|
+
const a = await Ar(o);
|
|
5173
5282
|
return a === i.mtime ? { suggestions: [] } : { mainSuggestion: { ...i, mtime: a }, suggestions: [] };
|
|
5174
5283
|
} catch (o) {
|
|
5175
5284
|
return this.logger.warn(o), { suggestions: [] };
|
|
@@ -5211,7 +5320,7 @@ class Xc extends _o {
|
|
|
5211
5320
|
update: { ...i, id: { ...i.id, version: h } }
|
|
5212
5321
|
}));
|
|
5213
5322
|
if (d === void 0) return { suggestions: p };
|
|
5214
|
-
if (a !== void 0 &&
|
|
5323
|
+
if (a !== void 0 && Wc.lte(d, a))
|
|
5215
5324
|
return { suggestions: p };
|
|
5216
5325
|
const f = {
|
|
5217
5326
|
...i,
|
|
@@ -5238,9 +5347,9 @@ class Xc extends _o {
|
|
|
5238
5347
|
return te(t) === te(r);
|
|
5239
5348
|
}
|
|
5240
5349
|
}
|
|
5241
|
-
class
|
|
5350
|
+
class pn {
|
|
5242
5351
|
constructor() {
|
|
5243
|
-
|
|
5352
|
+
S(this, "resources", /* @__PURE__ */ new Map());
|
|
5244
5353
|
}
|
|
5245
5354
|
check(e) {
|
|
5246
5355
|
const t = this.resources.get(e);
|
|
@@ -5273,7 +5382,7 @@ class dn {
|
|
|
5273
5382
|
function Ve(s) {
|
|
5274
5383
|
return String(s.id);
|
|
5275
5384
|
}
|
|
5276
|
-
const
|
|
5385
|
+
const Qc = ["Int", "Long", "Float", "Double", "String", "Bytes"];
|
|
5277
5386
|
function De(s) {
|
|
5278
5387
|
const e = [], t = [];
|
|
5279
5388
|
for (const r of s)
|
|
@@ -5289,7 +5398,7 @@ function De(s) {
|
|
|
5289
5398
|
}
|
|
5290
5399
|
return t;
|
|
5291
5400
|
}
|
|
5292
|
-
function
|
|
5401
|
+
function fn(s) {
|
|
5293
5402
|
return "partitionFilters" in s ? {
|
|
5294
5403
|
...s,
|
|
5295
5404
|
partitionFilters: De(s.partitionFilters),
|
|
@@ -5301,11 +5410,11 @@ function pn(s) {
|
|
|
5301
5410
|
};
|
|
5302
5411
|
}
|
|
5303
5412
|
const ke = (s, e) => typeof e == "bigint" ? e.toString() : e;
|
|
5304
|
-
class
|
|
5413
|
+
class Zc {
|
|
5305
5414
|
constructor(e, t) {
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5415
|
+
S(this, "perFrame", /* @__PURE__ */ new Map());
|
|
5416
|
+
S(this, "global");
|
|
5417
|
+
S(this, "disposeListeners", /* @__PURE__ */ new Map());
|
|
5309
5418
|
this.logger = e, this.ops = t, this.global = new lt({
|
|
5310
5419
|
maxSize: this.ops.pFramesCacheMaxSize,
|
|
5311
5420
|
dispose: (r, n, i) => {
|
|
@@ -5333,48 +5442,48 @@ class Qc {
|
|
|
5333
5442
|
this.disposeListeners.set(r, i), e.resource.disposeSignal.addEventListener("abort", i);
|
|
5334
5443
|
}
|
|
5335
5444
|
}
|
|
5336
|
-
class
|
|
5445
|
+
class el {
|
|
5337
5446
|
constructor(e, t, r, n) {
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5447
|
+
S(this, "pFrame");
|
|
5448
|
+
S(this, "abortController", new AbortController());
|
|
5449
|
+
S(this, "blobIdToResource", /* @__PURE__ */ new Map());
|
|
5450
|
+
S(this, "blobHandleComputables", /* @__PURE__ */ new Map());
|
|
5451
|
+
S(this, "preloadBlob", async (e) => {
|
|
5343
5452
|
const t = e.map((r) => this.getOrCreateComputableForBlob(r));
|
|
5344
5453
|
for (const r of t)
|
|
5345
5454
|
try {
|
|
5346
5455
|
await r.awaitStableFullValue(this.disposeSignal);
|
|
5347
5456
|
} catch (n) {
|
|
5348
|
-
if (
|
|
5457
|
+
if (wo(n))
|
|
5349
5458
|
break;
|
|
5350
5459
|
throw n;
|
|
5351
5460
|
}
|
|
5352
5461
|
});
|
|
5353
|
-
|
|
5462
|
+
S(this, "resolveBlobContent", async (e) => {
|
|
5354
5463
|
const t = this.getOrCreateComputableForBlob(e), r = this.blobDriver.getLocalPath((await t.awaitStableValue(this.disposeSignal)).handle);
|
|
5355
|
-
return await
|
|
5464
|
+
return await Sn.readFile(r);
|
|
5356
5465
|
});
|
|
5357
5466
|
this.blobDriver = e, this.logger = t, this.spillPath = r;
|
|
5358
5467
|
const i = (a, c) => this.logger[a](c);
|
|
5359
5468
|
for (const a of n)
|
|
5360
|
-
for (const c of
|
|
5469
|
+
for (const c of na(a.data))
|
|
5361
5470
|
this.blobIdToResource.set(Ve(c), c);
|
|
5362
5471
|
const o = [
|
|
5363
5472
|
...new Map(n.map((a) => ({
|
|
5364
5473
|
...a,
|
|
5365
|
-
data:
|
|
5474
|
+
data: oa(a.data, Ve)
|
|
5366
5475
|
})).map(
|
|
5367
5476
|
(a) => [te(a), a]
|
|
5368
5477
|
)).values()
|
|
5369
5478
|
];
|
|
5370
5479
|
try {
|
|
5371
|
-
const a = new
|
|
5480
|
+
const a = new $n(this.spillPath, i);
|
|
5372
5481
|
a.setDataSource(this);
|
|
5373
5482
|
for (const c of o)
|
|
5374
5483
|
a.addColumnSpec(c.id, c.spec), a.setColumnData(c.id, c.data);
|
|
5375
5484
|
this.pFrame = a;
|
|
5376
5485
|
} catch (a) {
|
|
5377
|
-
throw new
|
|
5486
|
+
throw new ve(
|
|
5378
5487
|
`PFrame creation failed, columns: ${JSON.stringify(o)}, error: ${nt(a)}`
|
|
5379
5488
|
);
|
|
5380
5489
|
}
|
|
@@ -5383,7 +5492,7 @@ class Zc {
|
|
|
5383
5492
|
let t = this.blobHandleComputables.get(e);
|
|
5384
5493
|
if (t !== void 0) return t;
|
|
5385
5494
|
const r = this.blobIdToResource.get(e);
|
|
5386
|
-
if (r === void 0) throw new
|
|
5495
|
+
if (r === void 0) throw new ve(`Blob with id ${e} not found.`);
|
|
5387
5496
|
return t = this.blobDriver.getDownloadedBlob(r).withPreCalculatedValueTree(), this.blobHandleComputables.set(e, t), t;
|
|
5388
5497
|
}
|
|
5389
5498
|
get disposeSignal() {
|
|
@@ -5395,10 +5504,10 @@ class Zc {
|
|
|
5395
5504
|
this.pFrame.dispose();
|
|
5396
5505
|
}
|
|
5397
5506
|
}
|
|
5398
|
-
class
|
|
5507
|
+
class yr {
|
|
5399
5508
|
constructor(e, t, r, n) {
|
|
5400
|
-
|
|
5401
|
-
|
|
5509
|
+
S(this, "abortController", new AbortController());
|
|
5510
|
+
S(this, "combinedDisposeSignal");
|
|
5402
5511
|
this.pFrame = e, this.pTable = r, this.predecessor = n, this.combinedDisposeSignal = AbortSignal.any([t, this.abortController.signal]);
|
|
5403
5512
|
}
|
|
5404
5513
|
get disposeSignal() {
|
|
@@ -5409,16 +5518,16 @@ class mr {
|
|
|
5409
5518
|
this.abortController.abort(), this.pTable.dispose(), (e = this.predecessor) == null || e.unref();
|
|
5410
5519
|
}
|
|
5411
5520
|
}
|
|
5412
|
-
class
|
|
5521
|
+
class _r {
|
|
5413
5522
|
constructor(e, t, r, n) {
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5523
|
+
S(this, "pFrames");
|
|
5524
|
+
S(this, "pTables");
|
|
5525
|
+
S(this, "pTableCache");
|
|
5526
|
+
S(this, "frameConcurrencyLimiter");
|
|
5527
|
+
S(this, "tableConcurrencyLimiter");
|
|
5419
5528
|
this.blobDriver = e, this.logger = t, this.spillPath = r;
|
|
5420
|
-
const i = new
|
|
5421
|
-
this.frameConcurrencyLimiter = i, this.tableConcurrencyLimiter = new
|
|
5529
|
+
const i = new Zr(n.pFrameConcurrency);
|
|
5530
|
+
this.frameConcurrencyLimiter = i, this.tableConcurrencyLimiter = new Zr(n.pTableConcurrency), this.pTableCache = new Zc(this.logger, n), this.pFrames = new class extends pn {
|
|
5422
5531
|
constructor(o, a, c) {
|
|
5423
5532
|
super(), this.blobDriver = o, this.logger = a, this.spillPath = c;
|
|
5424
5533
|
}
|
|
@@ -5427,28 +5536,28 @@ class Jr {
|
|
|
5427
5536
|
}
|
|
5428
5537
|
getByKey(o) {
|
|
5429
5538
|
const a = super.tryGetByKey(o);
|
|
5430
|
-
if (!a) throw new
|
|
5539
|
+
if (!a) throw new ve(`PFrame not found, handle = ${o}`);
|
|
5431
5540
|
return a;
|
|
5432
5541
|
}
|
|
5433
5542
|
createNewResource(o) {
|
|
5434
5543
|
return Q().logPFrameRequests && t.info(
|
|
5435
5544
|
`PFrame creation (pFrameHandle = ${this.calculateParamsKey(o)}): ${JSON.stringify(o, ke)}`
|
|
5436
|
-
), new
|
|
5545
|
+
), new el(this.blobDriver, this.logger, this.spillPath, o);
|
|
5437
5546
|
}
|
|
5438
5547
|
calculateParamsKey(o) {
|
|
5439
5548
|
try {
|
|
5440
|
-
return
|
|
5549
|
+
return rl(o);
|
|
5441
5550
|
} catch (a) {
|
|
5442
|
-
throw
|
|
5551
|
+
throw vo(a) ? a : new ve(`PFrame handle calculation failed, request: ${JSON.stringify(o, ke)}, error: ${nt(a)}`);
|
|
5443
5552
|
}
|
|
5444
5553
|
}
|
|
5445
|
-
}(this.blobDriver, this.logger, this.spillPath), this.pTables = new class extends
|
|
5554
|
+
}(this.blobDriver, this.logger, this.spillPath), this.pTables = new class extends pn {
|
|
5446
5555
|
constructor(o) {
|
|
5447
5556
|
super(), this.pFrames = o;
|
|
5448
5557
|
}
|
|
5449
5558
|
getByKey(o) {
|
|
5450
5559
|
const a = super.tryGetByKey(o);
|
|
5451
|
-
if (!a) throw new
|
|
5560
|
+
if (!a) throw new ve(`PTable not found, handle = ${o}`);
|
|
5452
5561
|
return a;
|
|
5453
5562
|
}
|
|
5454
5563
|
createNewResource(o) {
|
|
@@ -5464,7 +5573,7 @@ class Jr {
|
|
|
5464
5573
|
sorting: []
|
|
5465
5574
|
}
|
|
5466
5575
|
}), { resource: { pTable: p } } = d, f = p.sort(o.def.sorting);
|
|
5467
|
-
return new
|
|
5576
|
+
return new yr(a, l, f, d);
|
|
5468
5577
|
}
|
|
5469
5578
|
if (o.def.filters.length > 0) {
|
|
5470
5579
|
const d = this.acquire({
|
|
@@ -5474,47 +5583,47 @@ class Jr {
|
|
|
5474
5583
|
filters: []
|
|
5475
5584
|
}
|
|
5476
5585
|
}), { resource: { pTable: p } } = d, f = p.filter(o.def.filters);
|
|
5477
|
-
return new
|
|
5586
|
+
return new yr(a, l, f, d);
|
|
5478
5587
|
}
|
|
5479
5588
|
const u = c.createTable({
|
|
5480
5589
|
src: it(o.def.src),
|
|
5481
5590
|
filters: o.def.partitionFilters
|
|
5482
5591
|
});
|
|
5483
|
-
return new
|
|
5592
|
+
return new yr(a, l, u);
|
|
5484
5593
|
}
|
|
5485
5594
|
calculateParamsKey(o) {
|
|
5486
5595
|
try {
|
|
5487
|
-
return
|
|
5596
|
+
return tl(o);
|
|
5488
5597
|
} catch (a) {
|
|
5489
|
-
throw new
|
|
5598
|
+
throw new ve(`PTable handle calculation failed, request: ${JSON.stringify(o)}, error: ${nt(a)}`);
|
|
5490
5599
|
}
|
|
5491
5600
|
}
|
|
5492
5601
|
}(this.pFrames);
|
|
5493
5602
|
}
|
|
5494
5603
|
async pprofDump() {
|
|
5495
|
-
return await
|
|
5604
|
+
return await $n.pprofDump();
|
|
5496
5605
|
}
|
|
5497
5606
|
static async init(e, t, r, n) {
|
|
5498
|
-
const i =
|
|
5499
|
-
return await Io(i), new
|
|
5607
|
+
const i = Po.resolve(r);
|
|
5608
|
+
return await Io(i), new _r(e, t, i, n);
|
|
5500
5609
|
}
|
|
5501
5610
|
//
|
|
5502
5611
|
// Internal / Config API Methods
|
|
5503
5612
|
//
|
|
5504
5613
|
createPFrame(e, t) {
|
|
5505
|
-
const r = e.filter((i) =>
|
|
5506
|
-
(i) =>
|
|
5614
|
+
const r = e.filter((i) => Qc.find((o) => o === i.spec.valueType)).map(
|
|
5615
|
+
(i) => me(
|
|
5507
5616
|
i,
|
|
5508
|
-
(o) =>
|
|
5617
|
+
(o) => _o(o) ? da(o) : mn(o) ? vn(o, (a) => a.resourceInfo) : pa(i.spec, o)
|
|
5509
5618
|
)
|
|
5510
5619
|
), n = this.pFrames.acquire(r);
|
|
5511
5620
|
return t.addOnDestroy(n.unref), n.key;
|
|
5512
5621
|
}
|
|
5513
5622
|
createPTable(e, t) {
|
|
5514
|
-
const r =
|
|
5623
|
+
const r = fn(e), n = this.createPFrame(yo(r.src), t), i = wr(r, (a) => a.id), o = this.pTables.acquire({ def: i, pFrameHandle: n });
|
|
5515
5624
|
return Q().logPFrameRequests && this.logger.info(
|
|
5516
5625
|
`Create PTable call (pFrameHandle = ${n}; pTableHandle = ${JSON.stringify(o)}): ${JSON.stringify(
|
|
5517
|
-
|
|
5626
|
+
wr(r, (a) => a.spec),
|
|
5518
5627
|
ke
|
|
5519
5628
|
)}`
|
|
5520
5629
|
), t.addOnDestroy(o.unref), o.key;
|
|
@@ -5555,7 +5664,7 @@ class Jr {
|
|
|
5555
5664
|
);
|
|
5556
5665
|
const i = this.pTables.acquire({
|
|
5557
5666
|
pFrameHandle: e,
|
|
5558
|
-
def:
|
|
5667
|
+
def: fn(t)
|
|
5559
5668
|
}), { resource: { pTable: o, disposeSignal: a } } = i, c = AbortSignal.any([n, a].filter((l) => !!l));
|
|
5560
5669
|
return await this.frameConcurrencyLimiter.run(async () => {
|
|
5561
5670
|
try {
|
|
@@ -5653,13 +5762,13 @@ function it(s) {
|
|
|
5653
5762
|
Y(s);
|
|
5654
5763
|
}
|
|
5655
5764
|
}
|
|
5656
|
-
function
|
|
5765
|
+
function tl(s) {
|
|
5657
5766
|
const e = Fe("sha256");
|
|
5658
5767
|
return e.update(te(s)), e.digest().toString("hex");
|
|
5659
5768
|
}
|
|
5660
|
-
function
|
|
5769
|
+
function rl(s) {
|
|
5661
5770
|
const e = [...s].map(
|
|
5662
|
-
(r) =>
|
|
5771
|
+
(r) => me(r, (n) => {
|
|
5663
5772
|
let i;
|
|
5664
5773
|
const o = n.type;
|
|
5665
5774
|
switch (o) {
|
|
@@ -5694,7 +5803,7 @@ function tl(s) {
|
|
|
5694
5803
|
};
|
|
5695
5804
|
break;
|
|
5696
5805
|
default:
|
|
5697
|
-
throw new
|
|
5806
|
+
throw new ve(`unsupported resource type: ${JSON.stringify(o)}`);
|
|
5698
5807
|
}
|
|
5699
5808
|
return i.payload.sort((a, c) => a.key.localeCompare(c.key)), i;
|
|
5700
5809
|
})
|
|
@@ -5703,12 +5812,12 @@ function tl(s) {
|
|
|
5703
5812
|
const t = Fe("sha256");
|
|
5704
5813
|
return t.update(te(e)), t.digest().toString("hex");
|
|
5705
5814
|
}
|
|
5706
|
-
async function
|
|
5815
|
+
async function sl(s, e, t) {
|
|
5707
5816
|
const r = {
|
|
5708
|
-
...
|
|
5709
|
-
...
|
|
5817
|
+
...to,
|
|
5818
|
+
...ro(e),
|
|
5710
5819
|
...t
|
|
5711
|
-
}, n = new
|
|
5820
|
+
}, n = new Tr(r.localSecret), i = Pn(r.logger, s, r.localProjections), o = ei(s, r.logger), a = On(s, r.logger), c = ti(s, r.logger), l = await ri.init(
|
|
5712
5821
|
r.logger,
|
|
5713
5822
|
i,
|
|
5714
5823
|
o,
|
|
@@ -5716,26 +5825,26 @@ async function rl(s, e, t) {
|
|
|
5716
5825
|
r.blobDownloadRangesCachePath,
|
|
5717
5826
|
n,
|
|
5718
5827
|
r.blobDriverOps
|
|
5719
|
-
), u = new
|
|
5828
|
+
), u = new si(
|
|
5720
5829
|
r.logger,
|
|
5721
5830
|
n,
|
|
5722
5831
|
i,
|
|
5723
5832
|
r.downloadBlobToURLPath,
|
|
5724
5833
|
r.downloadBlobToURLDriverOps
|
|
5725
|
-
), d = new
|
|
5834
|
+
), d = new ni(
|
|
5726
5835
|
r.logger,
|
|
5727
5836
|
n,
|
|
5728
5837
|
a,
|
|
5729
5838
|
c,
|
|
5730
5839
|
r.uploadDriverOps
|
|
5731
|
-
), p = new
|
|
5840
|
+
), p = new oi(r.logger, o, r.logStreamDriverOps), f = new ii(r.logger, p, l), v = await Fn.init(
|
|
5732
5841
|
r.logger,
|
|
5733
5842
|
s,
|
|
5734
5843
|
n,
|
|
5735
5844
|
r.localProjections,
|
|
5736
5845
|
r.openFileDialogCallback,
|
|
5737
5846
|
r.virtualLocalStoragesOverride
|
|
5738
|
-
), h = await
|
|
5847
|
+
), h = await _r.init(
|
|
5739
5848
|
l,
|
|
5740
5849
|
r.logger,
|
|
5741
5850
|
r.pframesSpillPath,
|
|
@@ -5751,9 +5860,9 @@ async function rl(s, e, t) {
|
|
|
5751
5860
|
pFrameDriver: h
|
|
5752
5861
|
};
|
|
5753
5862
|
}
|
|
5754
|
-
class
|
|
5863
|
+
class nl {
|
|
5755
5864
|
constructor(e) {
|
|
5756
|
-
|
|
5865
|
+
S(this, "enrichmentTargetsCache", new lt({
|
|
5757
5866
|
max: 256,
|
|
5758
5867
|
memoMethod: (e, t, { context: r }) => ({ value: this.calculateEnrichmentTargets(r) })
|
|
5759
5868
|
}));
|
|
@@ -5763,7 +5872,7 @@ class sl {
|
|
|
5763
5872
|
const t = e.blockConfig();
|
|
5764
5873
|
if (t.enrichmentTargets === void 0) return;
|
|
5765
5874
|
const r = e.args();
|
|
5766
|
-
return
|
|
5875
|
+
return ec(this.quickJs, t.enrichmentTargets, ft(t), r);
|
|
5767
5876
|
}
|
|
5768
5877
|
getEnrichmentTargets(e, t, r) {
|
|
5769
5878
|
const n = { blockConfig: e, args: t };
|
|
@@ -5773,15 +5882,15 @@ class sl {
|
|
|
5773
5882
|
return this.enrichmentTargetsCache.memo(i, { context: n }).value;
|
|
5774
5883
|
}
|
|
5775
5884
|
}
|
|
5776
|
-
class
|
|
5885
|
+
class ao {
|
|
5777
5886
|
constructor(e, t, r, n, i, o, a, c) {
|
|
5778
|
-
|
|
5887
|
+
S(this, "pl");
|
|
5779
5888
|
/** Contains a reactive list of projects along with their meta information. */
|
|
5780
|
-
|
|
5889
|
+
S(this, "projectList");
|
|
5781
5890
|
//
|
|
5782
5891
|
// Projects
|
|
5783
5892
|
//
|
|
5784
|
-
|
|
5893
|
+
S(this, "openedProjectsByRid", /* @__PURE__ */ new Map());
|
|
5785
5894
|
this.env = e, this.driverKit = t, this.signer = r, this.projectListResourceId = n, this.openedProjectsList = i, this.projectListTree = o, this.blockRegistryProvider = a, this.projectList = c, this.pl = this.env.pl;
|
|
5786
5895
|
}
|
|
5787
5896
|
/** Adds a runtime capability to the middle layer. */
|
|
@@ -5796,16 +5905,16 @@ class io {
|
|
|
5796
5905
|
// Project List Manipulation
|
|
5797
5906
|
//
|
|
5798
5907
|
/** Creates a project with initial state and adds it to project list. */
|
|
5799
|
-
async createProject(e, t =
|
|
5908
|
+
async createProject(e, t = he()) {
|
|
5800
5909
|
const r = await this.pl.withWriteTx("MLCreateProject", async (n) => {
|
|
5801
|
-
const i = await
|
|
5802
|
-
return n.createField(J(this.projectListResourceId, t), "Dynamic", i), await n.commit(), await
|
|
5910
|
+
const i = await sa(n, e);
|
|
5911
|
+
return n.createField(J(this.projectListResourceId, t), "Dynamic", i), await n.commit(), await xo(i);
|
|
5803
5912
|
});
|
|
5804
5913
|
return await this.projectListTree.refreshState(), r;
|
|
5805
5914
|
}
|
|
5806
5915
|
/** Updates project metadata */
|
|
5807
5916
|
async setProjectMeta(e, t, r) {
|
|
5808
|
-
await
|
|
5917
|
+
await se(this.env.projectHelper, this.pl, e, r, (n) => {
|
|
5809
5918
|
n.setMeta(t);
|
|
5810
5919
|
}), await this.projectListTree.refreshState();
|
|
5811
5920
|
}
|
|
@@ -5830,7 +5939,7 @@ class io {
|
|
|
5830
5939
|
async openProject(e) {
|
|
5831
5940
|
const t = await this.ensureProjectRid(e);
|
|
5832
5941
|
if (this.openedProjectsByRid.has(t)) throw new Error(`Project ${t} already opened`);
|
|
5833
|
-
this.openedProjectsByRid.set(t, await
|
|
5942
|
+
this.openedProjectsByRid.set(t, await jr.init(this.env, t)), this.openedProjectsList.setValue([...this.openedProjectsByRid.keys()]);
|
|
5834
5943
|
}
|
|
5835
5944
|
/** Closes the project, and deallocate all corresponding resources. */
|
|
5836
5945
|
async closeProject(e) {
|
|
@@ -5858,7 +5967,7 @@ class io {
|
|
|
5858
5967
|
/** Generates sufficiently random string to be used as local secret for the
|
|
5859
5968
|
* middle layer */
|
|
5860
5969
|
static generateLocalSecret() {
|
|
5861
|
-
return
|
|
5970
|
+
return Tr.generateSecret();
|
|
5862
5971
|
}
|
|
5863
5972
|
/** Returns a block event dispatcher, which can be used to listen to block events. */
|
|
5864
5973
|
get blockEventDispatcher() {
|
|
@@ -5867,33 +5976,33 @@ class io {
|
|
|
5867
5976
|
/** Initialize middle layer */
|
|
5868
5977
|
static async init(e, t, r) {
|
|
5869
5978
|
const n = {
|
|
5870
|
-
...
|
|
5871
|
-
...
|
|
5979
|
+
...wc,
|
|
5980
|
+
...Sc(t),
|
|
5872
5981
|
...r
|
|
5873
5982
|
};
|
|
5874
5983
|
n.defaultTreeOptions.logStat = Q().logTreeStats, n.debugOps.dumpInitialTreeState = Q().dumpInitialTreeState;
|
|
5875
5984
|
const i = await e.withWriteTx("MLInitialization", async (E) => {
|
|
5876
|
-
const B = J(E.clientRoot,
|
|
5985
|
+
const B = J(E.clientRoot, Fi);
|
|
5877
5986
|
E.createField(B, "Dynamic");
|
|
5878
5987
|
const F = await E.getField(B);
|
|
5879
5988
|
if (Me(F.value)) {
|
|
5880
|
-
const j = E.createEphemeral(
|
|
5989
|
+
const j = E.createEphemeral(Nn);
|
|
5881
5990
|
return E.lock(j), E.setField(B, j), await E.commit(), await j.globalId;
|
|
5882
5991
|
} else
|
|
5883
5992
|
return F.value;
|
|
5884
|
-
}), o = n.logger, a = await
|
|
5993
|
+
}), o = n.logger, a = await sl(e, t, n), c = new ko(e.httpDispatcher), l = new wi(c), u = new Xi(
|
|
5885
5994
|
l,
|
|
5886
5995
|
a.signer,
|
|
5887
5996
|
c
|
|
5888
|
-
), d = new
|
|
5997
|
+
), d = new ai(
|
|
5889
5998
|
o,
|
|
5890
5999
|
e.httpDispatcher,
|
|
5891
6000
|
n.frontendDownloadPath
|
|
5892
|
-
), p = await
|
|
6001
|
+
), p = await Qo(), f = new So();
|
|
5893
6002
|
f.addSupportedRequirement("requiresModelAPIVersion", 1);
|
|
5894
6003
|
const v = {
|
|
5895
6004
|
pl: e,
|
|
5896
|
-
blockEventDispatcher: new
|
|
6005
|
+
blockEventDispatcher: new $o(),
|
|
5897
6006
|
signer: a.signer,
|
|
5898
6007
|
logger: o,
|
|
5899
6008
|
httpDispatcher: e.httpDispatcher,
|
|
@@ -5902,71 +6011,71 @@ class io {
|
|
|
5902
6011
|
bpPreparer: u,
|
|
5903
6012
|
frontendDownloadDriver: d,
|
|
5904
6013
|
driverKit: a,
|
|
5905
|
-
blockUpdateWatcher: new
|
|
6014
|
+
blockUpdateWatcher: new Yc(l, o, {
|
|
5906
6015
|
minDelay: n.devBlockUpdateRecheckInterval,
|
|
5907
6016
|
http: c,
|
|
5908
6017
|
preferredUpdateChannel: n.preferredUpdateChannel
|
|
5909
6018
|
}),
|
|
5910
6019
|
runtimeCapabilities: f,
|
|
5911
6020
|
quickJs: p,
|
|
5912
|
-
projectHelper: new
|
|
5913
|
-
}, h = new
|
|
5914
|
-
return new
|
|
6021
|
+
projectHelper: new nl(p)
|
|
6022
|
+
}, h = new Ko([]), b = await Ii(e, i, h, v);
|
|
6023
|
+
return new ao(
|
|
5915
6024
|
v,
|
|
5916
6025
|
a,
|
|
5917
6026
|
a.signer,
|
|
5918
6027
|
i,
|
|
5919
6028
|
h,
|
|
5920
|
-
|
|
6029
|
+
b.tree,
|
|
5921
6030
|
l,
|
|
5922
|
-
|
|
6031
|
+
b.computable
|
|
5923
6032
|
);
|
|
5924
6033
|
}
|
|
5925
6034
|
}
|
|
5926
|
-
async function
|
|
5927
|
-
return await
|
|
5928
|
-
const r = await new
|
|
6035
|
+
async function ol(s, e) {
|
|
6036
|
+
return await Ie(s.pingCheckDurationMs, s.maxPingsPerSecond, async () => {
|
|
6037
|
+
const r = await new kn(e).ping();
|
|
5929
6038
|
return JSON.stringify(r).slice(0, s.bodyLimit) + "...";
|
|
5930
6039
|
});
|
|
5931
6040
|
}
|
|
5932
|
-
async function
|
|
5933
|
-
return await
|
|
6041
|
+
async function il(s, e) {
|
|
6042
|
+
return await Ie(
|
|
5934
6043
|
s.blockRegistryDurationMs,
|
|
5935
6044
|
s.maxRegistryChecksPerSecond,
|
|
5936
6045
|
async () => await Xe(new URL(s.blockOverviewPath, s.blockRegistryUrl), s, e)
|
|
5937
6046
|
);
|
|
5938
6047
|
}
|
|
5939
|
-
async function
|
|
5940
|
-
return await
|
|
6048
|
+
async function al(s, e) {
|
|
6049
|
+
return await Ie(
|
|
5941
6050
|
s.blockRegistryDurationMs,
|
|
5942
6051
|
s.maxRegistryChecksPerSecond,
|
|
5943
6052
|
async () => await Xe(new URL(s.blockOverviewPath, s.blockGARegistryUrl), s, e)
|
|
5944
6053
|
);
|
|
5945
6054
|
}
|
|
5946
|
-
async function
|
|
5947
|
-
return await
|
|
6055
|
+
async function cl(s, e) {
|
|
6056
|
+
return await Ie(
|
|
5948
6057
|
s.blockRegistryDurationMs,
|
|
5949
6058
|
s.maxRegistryChecksPerSecond,
|
|
5950
6059
|
async () => await Xe(new URL(s.blockUiPath, s.blockRegistryUrl), s, e)
|
|
5951
6060
|
);
|
|
5952
6061
|
}
|
|
5953
|
-
async function
|
|
5954
|
-
return await
|
|
6062
|
+
async function ll(s, e) {
|
|
6063
|
+
return await Ie(
|
|
5955
6064
|
s.blockRegistryDurationMs,
|
|
5956
6065
|
s.maxRegistryChecksPerSecond,
|
|
5957
6066
|
async () => await Xe(new URL(s.blockUiPath, s.blockGARegistryUrl), s, e)
|
|
5958
6067
|
);
|
|
5959
6068
|
}
|
|
5960
|
-
async function
|
|
5961
|
-
return await
|
|
6069
|
+
async function ul(s, e) {
|
|
6070
|
+
return await Ie(
|
|
5962
6071
|
s.autoUpdateCdnDurationMs,
|
|
5963
6072
|
s.maxAutoUpdateCdnChecksPerSecond,
|
|
5964
6073
|
async () => await Xe(s.autoUpdateCdnUrl, s, e)
|
|
5965
6074
|
);
|
|
5966
6075
|
}
|
|
5967
|
-
async function
|
|
6076
|
+
async function Ie(s, e, t) {
|
|
5968
6077
|
const r = Date.now(), n = [];
|
|
5969
|
-
for (;
|
|
6078
|
+
for (; hn(r) < s; ) {
|
|
5970
6079
|
const i = Date.now();
|
|
5971
6080
|
let o;
|
|
5972
6081
|
try {
|
|
@@ -5974,18 +6083,18 @@ async function Te(s, e, t) {
|
|
|
5974
6083
|
} catch (l) {
|
|
5975
6084
|
o = { ok: !1, error: l };
|
|
5976
6085
|
}
|
|
5977
|
-
const a =
|
|
6086
|
+
const a = hn(i);
|
|
5978
6087
|
n.push({
|
|
5979
6088
|
elapsedMs: a,
|
|
5980
6089
|
response: o
|
|
5981
6090
|
});
|
|
5982
6091
|
const c = 1e3 / e - a;
|
|
5983
|
-
c > 0 && await
|
|
6092
|
+
c > 0 && await En(c);
|
|
5984
6093
|
}
|
|
5985
6094
|
return n;
|
|
5986
6095
|
}
|
|
5987
6096
|
async function Xe(s, e, t) {
|
|
5988
|
-
const { body: r, statusCode: n } = await
|
|
6097
|
+
const { body: r, statusCode: n } = await Fr(s, {
|
|
5989
6098
|
dispatcher: t,
|
|
5990
6099
|
headersTimeout: e.httpTimeoutMs,
|
|
5991
6100
|
bodyTimeout: e.httpTimeoutMs
|
|
@@ -5995,11 +6104,11 @@ async function Xe(s, e, t) {
|
|
|
5995
6104
|
beginningOfBody: i.slice(0, e.bodyLimit) + "..."
|
|
5996
6105
|
};
|
|
5997
6106
|
}
|
|
5998
|
-
function
|
|
6107
|
+
function hn(s) {
|
|
5999
6108
|
return Date.now() - s;
|
|
6000
6109
|
}
|
|
6001
6110
|
function Re(s) {
|
|
6002
|
-
const e = s.filter((o) => o.response.ok), t = s.length - e.length, { mean: r, median: n } =
|
|
6111
|
+
const e = s.filter((o) => o.response.ok), t = s.length - e.length, { mean: r, median: n } = dl(s), i = `
|
|
6003
6112
|
total: ${s.length};
|
|
6004
6113
|
successes: ${e.length};
|
|
6005
6114
|
errors: ${t};
|
|
@@ -6011,7 +6120,7 @@ function Re(s) {
|
|
|
6011
6120
|
details: i
|
|
6012
6121
|
};
|
|
6013
6122
|
}
|
|
6014
|
-
function
|
|
6123
|
+
function dl(s) {
|
|
6015
6124
|
const e = s.map((n) => n.elapsedMs).sort(), t = e.reduce((n, i) => n + i) / e.length;
|
|
6016
6125
|
let r;
|
|
6017
6126
|
if (e.length > 0) {
|
|
@@ -6020,15 +6129,15 @@ function ul(s) {
|
|
|
6020
6129
|
}
|
|
6021
6130
|
return { mean: t, median: r };
|
|
6022
6131
|
}
|
|
6023
|
-
async function
|
|
6132
|
+
async function pl(s, e, t) {
|
|
6024
6133
|
try {
|
|
6025
|
-
const r = await
|
|
6134
|
+
const r = await fl(s, e, t);
|
|
6026
6135
|
return r !== `Hello, ${t}` ? { status: "failed", message: `Template uploading failed: expected: ${t}, got: ${r}` } : { status: "ok", message: `Template uploading succeeded: ${r}` };
|
|
6027
6136
|
} catch (r) {
|
|
6028
6137
|
return { status: "failed", message: `Template uploading failed: error occurred: ${r}` };
|
|
6029
6138
|
}
|
|
6030
6139
|
}
|
|
6031
|
-
async function
|
|
6140
|
+
async function fl(s, e, t) {
|
|
6032
6141
|
var n;
|
|
6033
6142
|
const r = await $e(
|
|
6034
6143
|
e,
|
|
@@ -6040,20 +6149,20 @@ async function pl(s, e, t) {
|
|
|
6040
6149
|
["greeting"]
|
|
6041
6150
|
);
|
|
6042
6151
|
try {
|
|
6043
|
-
return JSON.parse(N((n = (await
|
|
6152
|
+
return JSON.parse(N((n = (await ge(e, r.greeting)).data) == null ? void 0 : n.toString()));
|
|
6044
6153
|
} finally {
|
|
6045
6154
|
r != null && await Ae(e, Object.values(r));
|
|
6046
6155
|
}
|
|
6047
6156
|
}
|
|
6048
|
-
async function
|
|
6157
|
+
async function hl(s, e, t, r, n, i) {
|
|
6049
6158
|
try {
|
|
6050
|
-
const o = await
|
|
6159
|
+
const o = await gl(s, e, t, r, n, i);
|
|
6051
6160
|
return o.type.name !== "Blob" ? { status: "failed", message: `File uploading failed: ${o.type.name}` } : { status: "ok", message: `File uploading succeeded: ${o.type.name}` };
|
|
6052
6161
|
} catch (o) {
|
|
6053
6162
|
return { status: "failed", message: `File uploading failed: error occurred: ${o}` };
|
|
6054
6163
|
}
|
|
6055
6164
|
}
|
|
6056
|
-
async function
|
|
6165
|
+
async function gl(s, e, t, r, n, i) {
|
|
6057
6166
|
var c;
|
|
6058
6167
|
const o = await t.getLocalFileHandle(i), a = await $e(
|
|
6059
6168
|
n,
|
|
@@ -6065,10 +6174,10 @@ async function hl(s, e, t, r, n, i) {
|
|
|
6065
6174
|
["progress", "file"]
|
|
6066
6175
|
);
|
|
6067
6176
|
try {
|
|
6068
|
-
const l = await
|
|
6069
|
-
if (
|
|
6177
|
+
const l = await ge(n, a.progress);
|
|
6178
|
+
if (ci(l)) {
|
|
6070
6179
|
const u = In.parse(JSON.parse(N((c = l.data) == null ? void 0 : c.toString())));
|
|
6071
|
-
|
|
6180
|
+
li(e, u.localPath, u.pathSignature) && await Tn(
|
|
6072
6181
|
s,
|
|
6073
6182
|
r,
|
|
6074
6183
|
l,
|
|
@@ -6082,20 +6191,20 @@ async function hl(s, e, t, r, n, i) {
|
|
|
6082
6191
|
}
|
|
6083
6192
|
);
|
|
6084
6193
|
}
|
|
6085
|
-
return await
|
|
6194
|
+
return await ge(n, a.file);
|
|
6086
6195
|
} finally {
|
|
6087
6196
|
await Ae(n, Object.values(a));
|
|
6088
6197
|
}
|
|
6089
6198
|
}
|
|
6090
|
-
async function
|
|
6199
|
+
async function ml(s, e, t, r, n, i, o) {
|
|
6091
6200
|
try {
|
|
6092
|
-
const a = await
|
|
6201
|
+
const a = await vl(s, e, t, r, n, i);
|
|
6093
6202
|
return a !== o ? { status: "failed", message: `File downloading failed: expected: ${o}, got: ${a}` } : { status: "ok", message: `File downloading succeeded: ${a}` };
|
|
6094
6203
|
} catch (a) {
|
|
6095
6204
|
return { status: "failed", message: `File downloading failed: error occurred: ${a}` };
|
|
6096
6205
|
}
|
|
6097
6206
|
}
|
|
6098
|
-
async function
|
|
6207
|
+
async function vl(s, e, t, r, n, i) {
|
|
6099
6208
|
var c;
|
|
6100
6209
|
const o = await t.getLocalFileHandle(i), a = await $e(
|
|
6101
6210
|
e,
|
|
@@ -6105,8 +6214,8 @@ async function ml(s, e, t, r, n, i) {
|
|
|
6105
6214
|
["progress", "file"]
|
|
6106
6215
|
);
|
|
6107
6216
|
try {
|
|
6108
|
-
const l = await
|
|
6109
|
-
await
|
|
6217
|
+
const l = await ge(e, a.progress);
|
|
6218
|
+
await Tn(
|
|
6110
6219
|
s,
|
|
6111
6220
|
r,
|
|
6112
6221
|
l,
|
|
@@ -6119,22 +6228,22 @@ async function ml(s, e, t, r, n, i) {
|
|
|
6119
6228
|
maxSpeed: 1
|
|
6120
6229
|
}
|
|
6121
6230
|
);
|
|
6122
|
-
const u = await
|
|
6123
|
-
return await
|
|
6231
|
+
const u = await ge(e, a.file), { content: d } = await n.downloadBlob(u);
|
|
6232
|
+
return await di(d);
|
|
6124
6233
|
} finally {
|
|
6125
6234
|
await Ae(e, Object.values(a));
|
|
6126
6235
|
}
|
|
6127
6236
|
}
|
|
6128
|
-
async function
|
|
6237
|
+
async function yl(s) {
|
|
6129
6238
|
try {
|
|
6130
|
-
const e = await
|
|
6239
|
+
const e = await wl(s);
|
|
6131
6240
|
return e !== `Hello from go binary
|
|
6132
6241
|
` ? { status: "failed", message: `Software check failed: got: ${e}` } : { status: "ok", message: `Software check succeeded: ${e}` };
|
|
6133
6242
|
} catch (e) {
|
|
6134
6243
|
return { status: "failed", message: `Software check failed: error occurred: ${e}` };
|
|
6135
6244
|
}
|
|
6136
6245
|
}
|
|
6137
|
-
async function
|
|
6246
|
+
async function wl(s) {
|
|
6138
6247
|
var t;
|
|
6139
6248
|
const e = await $e(
|
|
6140
6249
|
s,
|
|
@@ -6144,12 +6253,12 @@ async function yl(s) {
|
|
|
6144
6253
|
["greeting"]
|
|
6145
6254
|
);
|
|
6146
6255
|
try {
|
|
6147
|
-
return N((t = (await
|
|
6256
|
+
return N((t = (await ge(s, e.greeting)).data) == null ? void 0 : t.toString());
|
|
6148
6257
|
} finally {
|
|
6149
6258
|
await Ae(s, Object.values(e));
|
|
6150
6259
|
}
|
|
6151
6260
|
}
|
|
6152
|
-
async function
|
|
6261
|
+
async function Sl(s, e) {
|
|
6153
6262
|
try {
|
|
6154
6263
|
const t = await bl(s, e);
|
|
6155
6264
|
return t !== `Hello, ${e}!
|
|
@@ -6168,17 +6277,17 @@ async function bl(s, e) {
|
|
|
6168
6277
|
["greeting"]
|
|
6169
6278
|
);
|
|
6170
6279
|
try {
|
|
6171
|
-
return N((r = (await
|
|
6280
|
+
return N((r = (await ge(s, t.greeting)).data) == null ? void 0 : r.toString());
|
|
6172
6281
|
} finally {
|
|
6173
6282
|
await Ae(s, Object.values(t));
|
|
6174
6283
|
}
|
|
6175
6284
|
}
|
|
6176
|
-
async function
|
|
6285
|
+
async function kl(s, e, t, r) {
|
|
6177
6286
|
var n, i;
|
|
6178
6287
|
try {
|
|
6179
6288
|
const o = await t.getStorageList(), a = {};
|
|
6180
6289
|
for (const c of o) {
|
|
6181
|
-
const l = await
|
|
6290
|
+
const l = await Rl(t, c, r.nFilesToCheck, r.minFileSize, r.maxFileSize, r.minLsRequests);
|
|
6182
6291
|
if (l.file === void 0) {
|
|
6183
6292
|
a[c.name] = {
|
|
6184
6293
|
status: "warn",
|
|
@@ -6195,7 +6304,7 @@ async function Sl(s, e, t, r) {
|
|
|
6195
6304
|
["workdirTypeName"]
|
|
6196
6305
|
);
|
|
6197
6306
|
try {
|
|
6198
|
-
const d = JSON.parse(Buffer.from((await
|
|
6307
|
+
const d = JSON.parse(Buffer.from((await ge(e, u.workdirTypeName)).data).toString());
|
|
6199
6308
|
d != null && d.startsWith("WorkingDirectory") ? a[c.name] = {
|
|
6200
6309
|
status: "ok",
|
|
6201
6310
|
message: `Workdir creation succeeded, size of file: ${(n = l.file) == null ? void 0 : n.size}, checked ${l.nCheckedFiles} files, did ${l.nLsRequests} ls requests`
|
|
@@ -6212,8 +6321,8 @@ async function Sl(s, e, t, r) {
|
|
|
6212
6321
|
return { unknown: { status: "failed", message: `Download from every storage failed: error occurred: ${o}` } };
|
|
6213
6322
|
}
|
|
6214
6323
|
}
|
|
6215
|
-
async function
|
|
6216
|
-
const o =
|
|
6324
|
+
async function Rl(s, e, t, r, n, i) {
|
|
6325
|
+
const o = co(s, e, "", 0);
|
|
6217
6326
|
let a, c = 0, l = 0;
|
|
6218
6327
|
for await (const { file: u, nLsRequests: d } of o) {
|
|
6219
6328
|
if (l = Math.max(l, d), c >= t && l > i)
|
|
@@ -6224,7 +6333,7 @@ async function kl(s, e, t, r, n, i) {
|
|
|
6224
6333
|
}
|
|
6225
6334
|
return { file: a, nLsRequests: l, nCheckedFiles: c };
|
|
6226
6335
|
}
|
|
6227
|
-
async function*
|
|
6336
|
+
async function* co(s, e, t, r) {
|
|
6228
6337
|
r++;
|
|
6229
6338
|
const n = await s.listRemoteFilesWithAdditionalInfo(e.handle, t);
|
|
6230
6339
|
for (const i of n.entries)
|
|
@@ -6234,20 +6343,20 @@ async function* ao(s, e, t, r) {
|
|
|
6234
6343
|
nLsRequests: r
|
|
6235
6344
|
};
|
|
6236
6345
|
else if (i.type === "dir")
|
|
6237
|
-
for await (const o of
|
|
6346
|
+
for await (const o of co(s, e, i.fullPath, r))
|
|
6238
6347
|
r = Math.max(o.nLsRequests, r), yield o;
|
|
6239
6348
|
}
|
|
6240
|
-
async function
|
|
6241
|
-
const s = _.join(
|
|
6349
|
+
async function Cl() {
|
|
6350
|
+
const s = _.join(An.tmpdir(), `check-network-big-temp-${Date.now()}.bin`), e = 20 * 1024 * 1024, t = Ho(e);
|
|
6242
6351
|
return await at.appendFile(s, t), { filePath: s };
|
|
6243
6352
|
}
|
|
6244
|
-
async function
|
|
6245
|
-
const s = _.join(
|
|
6353
|
+
async function El() {
|
|
6354
|
+
const s = _.join(An.tmpdir(), `check-network-temp-${Date.now()}.txt`), e = "Hello, world! " + (/* @__PURE__ */ new Date()).toISOString();
|
|
6246
6355
|
return await at.writeFile(s, e), { filePath: s, fileContent: e };
|
|
6247
6356
|
}
|
|
6248
6357
|
async function $e(s, e, t, r, n) {
|
|
6249
6358
|
return await s.withWriteTx("TemplateRender", async (i) => {
|
|
6250
|
-
const o = await
|
|
6359
|
+
const o = await Un(e), a = ht(i, o), c = Dr(
|
|
6251
6360
|
i,
|
|
6252
6361
|
a,
|
|
6253
6362
|
t,
|
|
@@ -6256,20 +6365,20 @@ async function $e(s, e, t, r, n) {
|
|
|
6256
6365
|
), l = {};
|
|
6257
6366
|
for (const u of n) {
|
|
6258
6367
|
const d = J(s.clientRoot, u);
|
|
6259
|
-
i.createField(d, "Dynamic", c[u]), l[u] = await
|
|
6368
|
+
i.createField(d, "Dynamic", c[u]), l[u] = await Vo(d);
|
|
6260
6369
|
}
|
|
6261
6370
|
return await i.commit(), l;
|
|
6262
6371
|
});
|
|
6263
6372
|
}
|
|
6264
|
-
async function
|
|
6265
|
-
return await
|
|
6373
|
+
async function ge(s, e) {
|
|
6374
|
+
return await Uo(s, async (t) => {
|
|
6266
6375
|
const r = await t.tx.getField(e);
|
|
6267
|
-
if (
|
|
6376
|
+
if (br(r.error)) {
|
|
6268
6377
|
const n = await t.tx.getResourceData(r.error, !0);
|
|
6269
6378
|
throw new Error(`getFieldValue of "${e.fieldName}" field failed: ${n.data}`);
|
|
6270
6379
|
}
|
|
6271
6380
|
if (Me(r.value))
|
|
6272
|
-
throw new
|
|
6381
|
+
throw new Mo();
|
|
6273
6382
|
return await t.tx.getResourceData(r.value, !0);
|
|
6274
6383
|
});
|
|
6275
6384
|
}
|
|
@@ -6280,10 +6389,10 @@ async function Ae(s, e) {
|
|
|
6280
6389
|
await t.commit();
|
|
6281
6390
|
});
|
|
6282
6391
|
}
|
|
6283
|
-
async function
|
|
6392
|
+
async function fu(s, e, t, r = {}) {
|
|
6284
6393
|
const n = [];
|
|
6285
|
-
|
|
6286
|
-
|
|
6394
|
+
Fl.forEach((i) => {
|
|
6395
|
+
ui(i).subscribe((a) => {
|
|
6287
6396
|
var u, d;
|
|
6288
6397
|
const c = (/* @__PURE__ */ new Date()).toISOString(), l = { ...a };
|
|
6289
6398
|
(u = l == null ? void 0 : l.response) != null && u.headers && (l.response = { ...l.response }, l.response.headers = l.response.headers.slice(), l.response.headers = l.response.headers.map((p) => p.toString())), (d = l == null ? void 0 : l.request) != null && d.body && (l.request = { ...l.request }, l.request.body = "too big"), n.push(
|
|
@@ -6306,19 +6415,19 @@ async function pu(s, e, t, r = {}) {
|
|
|
6306
6415
|
lsDriver: d,
|
|
6307
6416
|
httpClient: p,
|
|
6308
6417
|
ops: f
|
|
6309
|
-
} = await
|
|
6310
|
-
plPings: await
|
|
6311
|
-
blockRegistryOverviewChecks: await
|
|
6312
|
-
blockGARegistryOverviewChecks: await
|
|
6313
|
-
blockRegistryUiChecks: await
|
|
6314
|
-
blockGARegistryUiChecks: await
|
|
6315
|
-
autoUpdateCdnChecks: await
|
|
6316
|
-
uploadTemplateCheck: await
|
|
6317
|
-
uploadFileCheck: await
|
|
6318
|
-
downloadFileCheck: await
|
|
6319
|
-
softwareCheck: await
|
|
6320
|
-
pythonSoftwareCheck: await
|
|
6321
|
-
storageToDownloadReport: await
|
|
6418
|
+
} = await Pl(s, e, t, r), { filePath: v, fileContent: h } = await El(), { filePath: b } = await Cl(), E = {
|
|
6419
|
+
plPings: await ol(f, o),
|
|
6420
|
+
blockRegistryOverviewChecks: await il(f, p),
|
|
6421
|
+
blockGARegistryOverviewChecks: await al(f, p),
|
|
6422
|
+
blockRegistryUiChecks: await cl(f, p),
|
|
6423
|
+
blockGARegistryUiChecks: await ll(f, p),
|
|
6424
|
+
autoUpdateCdnChecks: await ul(f, p),
|
|
6425
|
+
uploadTemplateCheck: await pl(i, a, "Jack"),
|
|
6426
|
+
uploadFileCheck: await hl(i, c, d, u, a, b),
|
|
6427
|
+
downloadFileCheck: await ml(i, a, d, u, l, v, h),
|
|
6428
|
+
softwareCheck: await yl(a),
|
|
6429
|
+
pythonSoftwareCheck: await Sl(a, "Jack"),
|
|
6430
|
+
storageToDownloadReport: await kl(
|
|
6322
6431
|
i,
|
|
6323
6432
|
a,
|
|
6324
6433
|
d,
|
|
@@ -6331,12 +6440,12 @@ async function pu(s, e, t, r = {}) {
|
|
|
6331
6440
|
}
|
|
6332
6441
|
)
|
|
6333
6442
|
};
|
|
6334
|
-
return
|
|
6443
|
+
return Ol(E, s, f, n);
|
|
6335
6444
|
} catch (i) {
|
|
6336
6445
|
return `Unhandled error while checking the network: ${i}`;
|
|
6337
6446
|
}
|
|
6338
6447
|
}
|
|
6339
|
-
async function
|
|
6448
|
+
async function Pl(s, e, t, r = {}) {
|
|
6340
6449
|
const n = {
|
|
6341
6450
|
pingCheckDurationMs: 1e4,
|
|
6342
6451
|
pingTimeoutMs: 3e3,
|
|
@@ -6359,14 +6468,14 @@ async function El(s, e, t, r = {}) {
|
|
|
6359
6468
|
everyStorageNFilesToCheck: 300,
|
|
6360
6469
|
everyStorageMinLsRequests: 50,
|
|
6361
6470
|
...r
|
|
6362
|
-
}, i =
|
|
6471
|
+
}, i = Jo(s, {
|
|
6363
6472
|
defaultRequestTimeout: n.pingTimeoutMs
|
|
6364
6473
|
});
|
|
6365
|
-
i.alternativeRoot = `check_network_${
|
|
6366
|
-
const o = new
|
|
6474
|
+
i.alternativeRoot = `check_network_${he()}`;
|
|
6475
|
+
const o = new kn(i);
|
|
6367
6476
|
let a = {};
|
|
6368
6477
|
e && t && (a = await o.login(e, t));
|
|
6369
|
-
const c = await bn.init(s, { authInformation: a }), l = o.ll.httpDispatcher, u = new
|
|
6478
|
+
const c = await bn.init(s, { authInformation: a }), l = o.ll.httpDispatcher, u = new wn(), d = new Tr("localSecret"), p = Pn(u, c, []), f = On(c, u), v = await Fn.init(
|
|
6370
6479
|
u,
|
|
6371
6480
|
c,
|
|
6372
6481
|
d,
|
|
@@ -6389,10 +6498,10 @@ async function El(s, e, t, r = {}) {
|
|
|
6389
6498
|
}
|
|
6390
6499
|
};
|
|
6391
6500
|
}
|
|
6392
|
-
function
|
|
6393
|
-
const n = s.plPings.filter((
|
|
6394
|
-
...new Set(n.map((
|
|
6395
|
-
], a = (
|
|
6501
|
+
function Ol(s, e, t, r) {
|
|
6502
|
+
const n = s.plPings.filter((b) => b.response.ok), i = s.plPings.filter((b) => !b.response.ok), o = [
|
|
6503
|
+
...new Set(n.map((b) => JSON.stringify(b.response.value)))
|
|
6504
|
+
], a = (b) => b ? "OK" : "FAILED", c = (b) => b.status === "ok" ? "OK" : b.status === "warn" ? "WARN" : "FAILED", l = Re(s.plPings), u = Re(s.blockRegistryOverviewChecks), d = Re(s.blockGARegistryOverviewChecks), p = Re(s.blockRegistryUiChecks), f = Re(s.blockGARegistryUiChecks), v = Re(s.autoUpdateCdnChecks), h = Object.entries(s.storageToDownloadReport).map(([b, E]) => `${c(E)} ${b} storage check`).join(`
|
|
6396
6505
|
`);
|
|
6397
6506
|
return `
|
|
6398
6507
|
${a(l.ok)} pings to Platforma Backend
|
|
@@ -6461,7 +6570,7 @@ ${r.join(`
|
|
|
6461
6570
|
`)}
|
|
6462
6571
|
`;
|
|
6463
6572
|
}
|
|
6464
|
-
const
|
|
6573
|
+
const Fl = [
|
|
6465
6574
|
"undici:request:create",
|
|
6466
6575
|
// When a new request is created
|
|
6467
6576
|
"undici:request:bodySent",
|
|
@@ -6500,34 +6609,34 @@ const Ol = [
|
|
|
6500
6609
|
// When a dispatcher retries a request
|
|
6501
6610
|
];
|
|
6502
6611
|
export {
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6612
|
+
ou as BlockPackRegistry,
|
|
6613
|
+
iu as CentralBlockRegistry,
|
|
6614
|
+
ro as DefaultDriverKitOpsPaths,
|
|
6615
|
+
to as DefaultDriverKitOpsSettings,
|
|
6616
|
+
Sc as DefaultMiddleLayerOpsPaths,
|
|
6617
|
+
wc as DefaultMiddleLayerOpsSettings,
|
|
6618
|
+
Jn as FrontendFromFolderResourceType,
|
|
6619
|
+
Mn as FrontendFromUrlResourceType,
|
|
6620
|
+
ao as MiddleLayer,
|
|
6621
|
+
jr as Project,
|
|
6622
|
+
Mi as TengoTemplateGet,
|
|
6623
|
+
Ji as TengoTemplateGetRegistry,
|
|
6624
|
+
_i as TengoTemplateGetTemplate,
|
|
6625
|
+
Gi as TengoTemplateGetTemplateURI,
|
|
6626
|
+
lu as TengoTemplatePack,
|
|
6627
|
+
uu as TengoTemplatePackConvert,
|
|
6628
|
+
pu as TengoTemplatePackConvertTemplate,
|
|
6629
|
+
du as TengoTemplatePackConvertTemplatePack,
|
|
6630
|
+
cu as V1CentralDevSnapshotRegistry,
|
|
6631
|
+
au as V1CentralRegistry,
|
|
6632
|
+
wi as V2RegistryProvider,
|
|
6633
|
+
fu as checkNetwork,
|
|
6634
|
+
Dr as createRenderTemplate,
|
|
6635
|
+
Dn as getDevV1PacketMtime,
|
|
6636
|
+
Ar as getDevV2PacketMtime,
|
|
6637
|
+
sl as initDriverKit,
|
|
6638
|
+
Pl as initNetworkCheck,
|
|
6530
6639
|
ht as loadTemplate,
|
|
6531
|
-
|
|
6640
|
+
Un as prepareTemplateSpec
|
|
6532
6641
|
};
|
|
6533
6642
|
//# sourceMappingURL=index.mjs.map
|