@milaboratories/pl-middle-layer 1.30.32 → 1.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/debug/index.d.ts +1 -0
- package/dist/debug/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +891 -872
- package/dist/index.mjs.map +1 -1
- package/dist/middle_layer/middle_layer.d.ts.map +1 -1
- package/dist/middle_layer/ops.d.ts +8 -1
- package/dist/middle_layer/ops.d.ts.map +1 -1
- package/dist/middle_layer/project.d.ts.map +1 -1
- package/dist/middle_layer/types.d.ts +1 -1
- package/dist/middle_layer/types.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/debug/index.ts +2 -0
- package/src/middle_layer/middle_layer.ts +2 -0
- package/src/middle_layer/ops.ts +14 -0
- package/src/middle_layer/project.ts +38 -1
- package/src/middle_layer/types.ts +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
1
|
+
var As = Object.defineProperty;
|
|
2
2
|
var qt = (s, e) => (e = Symbol[s]) ? e : Symbol.for("Symbol." + s), Yt = (s) => {
|
|
3
3
|
throw TypeError(s);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var w = (s, e, t) =>
|
|
7
|
-
var
|
|
5
|
+
var Ts = (s, e, t) => e in s ? As(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
6
|
+
var w = (s, e, t) => Ts(s, typeof e != "symbol" ? e + "" : e, t);
|
|
7
|
+
var je = (s, e, t) => {
|
|
8
8
|
if (e != null) {
|
|
9
9
|
typeof e != "object" && typeof e != "function" && Yt("Object expected");
|
|
10
10
|
var r;
|
|
11
11
|
t && (r = e[qt("asyncDispose")]), r === void 0 && (r = e[qt("dispose")]), typeof r != "function" && Yt("Object not disposable"), s.push([t, r, e]);
|
|
12
12
|
} else t && s.push([t]);
|
|
13
13
|
return e;
|
|
14
|
-
},
|
|
14
|
+
}, Ve = (s, e, t) => {
|
|
15
15
|
var r = typeof SuppressedError == "function" ? SuppressedError : function(i, a, c, u) {
|
|
16
16
|
return u = Error(c), u.name = "SuppressedError", u.error = i, u.suppressed = a, u;
|
|
17
17
|
}, o = (i) => e = t ? new r(i, e, "An error was suppressed during disposal") : (t = !0, i), n = (i) => {
|
|
@@ -26,74 +26,75 @@ var xe = (s, e, t) => {
|
|
|
26
26
|
};
|
|
27
27
|
return n();
|
|
28
28
|
};
|
|
29
|
-
import { mapValueInVOE as
|
|
29
|
+
import { mapValueInVOE as _r, executePSpecPredicate as Ls, mapPObjectData as le, mapPTableDef as St, JsRenderInternal as Ds, extractConfig as Kr, isConfigLambda as Hr, DefaultNavigationState as Ns, extractAllColumns as Bs } from "@platforma-sdk/model";
|
|
30
30
|
export * from "@platforma-sdk/model";
|
|
31
|
-
import { AnyChannel as $e, StableChannel as
|
|
31
|
+
import { AnyChannel as $e, StableChannel as Fe, InitialBlockSettings as Qt, blockPackIdToString as xs } from "@milaboratories/pl-model-middle-layer";
|
|
32
32
|
export * from "@milaboratories/pl-model-middle-layer";
|
|
33
33
|
export * from "@milaboratories/pl-deployments";
|
|
34
|
-
import { request as
|
|
35
|
-
import { RegistryV1 as de, tryLoadPackDescription as
|
|
34
|
+
import { request as Lt, RetryAgent as js } from "undici";
|
|
35
|
+
import { RegistryV1 as de, tryLoadPackDescription as bt, BlockPackMetaEmbedAbsoluteBytes as Vs, RegistryV2Reader as Us, folderReaderByUrl as Js, loadPackDescription as Zt } from "@platforma-sdk/block-tools";
|
|
36
36
|
import Y from "node:fs";
|
|
37
37
|
import _ from "node:path";
|
|
38
|
-
import
|
|
39
|
-
import { assertNever as K, notEmpty as B, ConsoleLoggerAdapter as
|
|
40
|
-
import * as
|
|
41
|
-
import
|
|
42
|
-
import {
|
|
38
|
+
import Gs from "yaml";
|
|
39
|
+
import { assertNever as K, notEmpty as B, ConsoleLoggerAdapter as Ms, ConcurrencyLimitingExecutor as _s, HmacSha256Signer as Wr } from "@milaboratories/ts-helpers";
|
|
40
|
+
import * as zr from "node:fs/promises";
|
|
41
|
+
import er from "node:fs/promises";
|
|
42
|
+
import { tryResolve as Ks } from "@milaboratories/resolve-helper";
|
|
43
|
+
import { resourceTypesEqual as ce, field as x, Pl as A, PlClient as Hs, isNullResourceId as Ze, ensureResourceIdNotNull as Rt, isResource as Ws, isResourceRef as zs, isNotNullResourceId as tr, resourceType as Ne, resourceTypeToString as Xs, stringifyWithResourceId as Ue, resourceIdToString as we, isNotFoundError as qs, isTimeoutOrCancelError as Ys, toGlobalResourceId as Qs, plAddressToConfig as Zs, UnauthenticatedPlClient as rr } from "@milaboratories/pl-client";
|
|
43
44
|
export * from "@milaboratories/pl-client";
|
|
44
|
-
import { SynchronizedTreeState as
|
|
45
|
-
import { Computable as J, ChangeSource as
|
|
46
|
-
import { randomUUID as
|
|
47
|
-
import { parseTemplate as
|
|
48
|
-
import { LRUCache as
|
|
49
|
-
import
|
|
50
|
-
import { Templates as
|
|
45
|
+
import { SynchronizedTreeState as Xr, treeDumpStats as eo, isPlTreeNodeAccessor as to } from "@milaboratories/pl-tree";
|
|
46
|
+
import { Computable as J, ChangeSource as sr, PollComputablePool as ro, WatchableValue as so } from "@milaboratories/computable";
|
|
47
|
+
import { randomUUID as Se, createHash as Be } from "node:crypto";
|
|
48
|
+
import { parseTemplate as oo, PlTemplateV1 as ae, PlTemplateOverrideV1 as ut, PlTemplateLibV1 as Je, PlTemplateSoftwareV1 as Ee } from "@milaboratories/pl-model-backend";
|
|
49
|
+
import { LRUCache as qr } from "lru-cache";
|
|
50
|
+
import Yr from "denque";
|
|
51
|
+
import { Templates as no } from "@platforma-sdk/workflow-tengo";
|
|
51
52
|
import Z from "canonicalize";
|
|
52
|
-
import { parsePlError as
|
|
53
|
-
import
|
|
54
|
-
import { Scope as
|
|
55
|
-
import { setTimeout as
|
|
56
|
-
import { createDownloadClient as
|
|
57
|
-
import { PFrame as
|
|
58
|
-
import { PFrame as
|
|
59
|
-
import { channel as
|
|
60
|
-
async function
|
|
53
|
+
import { parsePlError as io } from "@milaboratories/pl-errors";
|
|
54
|
+
import ao from "node:assert";
|
|
55
|
+
import { Scope as Et, errors as co, getQuickJS as lo } from "quickjs-emscripten";
|
|
56
|
+
import { setTimeout as Qr } from "node:timers/promises";
|
|
57
|
+
import { createDownloadClient as uo, createLogsClient as po, createUploadBlobClient as ho, createUploadProgressClient as fo, DownloadDriver as go, DownloadBlobToURLDriver as mo, UploadDriver as vo, LogsStreamDriver as yo, LogsDriver as wo, LsDriver as So, DownloadUrlDriver as bo } from "@milaboratories/pl-drivers";
|
|
58
|
+
import { PFrame as or } from "@milaboratories/pframes-node";
|
|
59
|
+
import { PFrame as Ro } from "@milaboratories/pframes-rs-node";
|
|
60
|
+
import { channel as Eo } from "node:diagnostics_channel";
|
|
61
|
+
async function nr(s) {
|
|
61
62
|
try {
|
|
62
|
-
return await
|
|
63
|
+
return await zr.stat(s, { bigint: !0 });
|
|
63
64
|
} catch (e) {
|
|
64
65
|
if (e.code === "ENOENT")
|
|
65
66
|
return;
|
|
66
67
|
throw e;
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
|
-
const
|
|
70
|
+
const Co = [de.PlPackageYamlConfigFile], Po = [de.PlPackageJsonConfigFile], Dt = ["backend", "dist", "tengo", "tpl", "main.plj.gz"], Nt = ["config", "dist", "config.json"], Zr = ["frontend", "dist"], ir = "block-model/dist/config.json", ko = "block-ui/package.json", Oo = [
|
|
70
71
|
Dt,
|
|
71
72
|
Nt,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
Co,
|
|
74
|
+
Po,
|
|
75
|
+
Zr
|
|
75
76
|
];
|
|
76
|
-
async function
|
|
77
|
-
return await
|
|
77
|
+
async function $o(s) {
|
|
78
|
+
return await nr(_.join(s, ...Nt)) !== void 0 || await nr(_.join(s, ...Dt)) !== void 0;
|
|
78
79
|
}
|
|
79
|
-
function
|
|
80
|
-
const t =
|
|
80
|
+
function dt(s, e) {
|
|
81
|
+
const t = Ks(s, e);
|
|
81
82
|
if (t === void 0) throw new Error(`Can't resolve ${e} against ${s}`);
|
|
82
83
|
return t;
|
|
83
84
|
}
|
|
84
|
-
async function
|
|
85
|
-
if (_.isAbsolute(s) || (s = _.resolve(s)), await
|
|
85
|
+
async function ar(s, e) {
|
|
86
|
+
if (_.isAbsolute(s) || (s = _.resolve(s)), await $o(s))
|
|
86
87
|
return {
|
|
87
88
|
workflow: _.join(s, ...Dt),
|
|
88
89
|
config: _.join(s, ...Nt),
|
|
89
|
-
ui: _.join(s, ...
|
|
90
|
+
ui: _.join(s, ...Zr)
|
|
90
91
|
};
|
|
91
92
|
{
|
|
92
|
-
const t =
|
|
93
|
+
const t = dt(s, ir), r = dt(s, ir), o = dt(s, ko);
|
|
93
94
|
return { workflow: t, config: r, ui: _.resolve(o, "..", "dist") };
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
|
-
async function
|
|
97
|
+
async function Fo(s) {
|
|
97
98
|
try {
|
|
98
99
|
return await Y.promises.readFile(s, "utf8");
|
|
99
100
|
} catch (e) {
|
|
@@ -102,7 +103,7 @@ async function ko(s) {
|
|
|
102
103
|
throw e;
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
|
-
async function
|
|
106
|
+
async function Io(s) {
|
|
106
107
|
try {
|
|
107
108
|
return await Y.promises.stat(s, { bigint: !0 });
|
|
108
109
|
} catch (e) {
|
|
@@ -111,10 +112,10 @@ async function $o(s) {
|
|
|
111
112
|
throw e;
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
|
-
async function
|
|
115
|
+
async function es(s) {
|
|
115
116
|
let e = 0n;
|
|
116
|
-
for (const t of
|
|
117
|
-
const r = _.join(s, ...t), o = await
|
|
117
|
+
for (const t of Oo) {
|
|
118
|
+
const r = _.join(s, ...t), o = await Io(r);
|
|
118
119
|
o !== void 0 && e < o.mtimeNs && (e = o.mtimeNs);
|
|
119
120
|
}
|
|
120
121
|
return e.toString();
|
|
@@ -125,7 +126,7 @@ async function Bt(s) {
|
|
|
125
126
|
}), t = await Y.promises.stat(s.components.model.file, { bigint: !0 });
|
|
126
127
|
return (e.mtimeNs > t.mtimeNs ? e.mtimeNs : t.mtimeNs).toString();
|
|
127
128
|
}
|
|
128
|
-
class
|
|
129
|
+
class cu {
|
|
129
130
|
constructor(e, t, r) {
|
|
130
131
|
this.v2Provider = e, this.registries = t, this.http = r;
|
|
131
132
|
}
|
|
@@ -133,7 +134,7 @@ class ou {
|
|
|
133
134
|
const t = [], r = e.spec;
|
|
134
135
|
switch (r.type) {
|
|
135
136
|
case "remote-v1": {
|
|
136
|
-
const o = this.http !== void 0 ? { dispatcher: this.http } : {}, i = await (await
|
|
137
|
+
const o = this.http !== void 0 ? { dispatcher: this.http } : {}, i = await (await Lt(
|
|
137
138
|
`${r.url}/${de.GlobalOverviewPath}`,
|
|
138
139
|
o
|
|
139
140
|
)).body.json();
|
|
@@ -163,7 +164,7 @@ class ou {
|
|
|
163
164
|
id: f,
|
|
164
165
|
latestByChannel: {
|
|
165
166
|
[$e]: h,
|
|
166
|
-
[
|
|
167
|
+
[Fe]: h
|
|
167
168
|
},
|
|
168
169
|
allVersions: a.allVersions.map((E) => ({ version: E, channels: [] }))
|
|
169
170
|
});
|
|
@@ -175,11 +176,11 @@ class ou {
|
|
|
175
176
|
case "local-dev":
|
|
176
177
|
for (const o of await Y.promises.readdir(r.path, { withFileTypes: !0 })) {
|
|
177
178
|
if (!o.isDirectory()) continue;
|
|
178
|
-
const n = _.join(r.path, o.name), i = await
|
|
179
|
+
const n = _.join(r.path, o.name), i = await Fo(
|
|
179
180
|
_.join(n, de.PlPackageYamlConfigFile)
|
|
180
181
|
);
|
|
181
182
|
if (i !== void 0) {
|
|
182
|
-
const a = de.PlPackageConfigData.parse(
|
|
183
|
+
const a = de.PlPackageConfigData.parse(Gs.parse(i)), c = await es(n), u = {
|
|
183
184
|
organization: a.organization,
|
|
184
185
|
name: a.package,
|
|
185
186
|
version: "DEV"
|
|
@@ -204,20 +205,20 @@ class ou {
|
|
|
204
205
|
id: u,
|
|
205
206
|
latestByChannel: {
|
|
206
207
|
[$e]: l,
|
|
207
|
-
[
|
|
208
|
+
[Fe]: l
|
|
208
209
|
},
|
|
209
210
|
allVersions: []
|
|
210
211
|
});
|
|
211
212
|
} else {
|
|
212
|
-
let a = n, c = await
|
|
213
|
+
let a = n, c = await bt(a);
|
|
213
214
|
if (c === void 0) {
|
|
214
215
|
for (const u of ["block", "meta"])
|
|
215
|
-
if (a = _.join(n, u), c = await
|
|
216
|
+
if (a = _.join(n, u), c = await bt(a), c !== void 0) break;
|
|
216
217
|
}
|
|
217
218
|
if (c !== void 0) {
|
|
218
219
|
const u = await Bt(c), l = {
|
|
219
220
|
id: c.id,
|
|
220
|
-
meta: await
|
|
221
|
+
meta: await Vs.parseAsync(c.meta),
|
|
221
222
|
spec: {
|
|
222
223
|
type: "dev-v2",
|
|
223
224
|
folder: a,
|
|
@@ -229,7 +230,7 @@ class ou {
|
|
|
229
230
|
id: c.id,
|
|
230
231
|
latestByChannel: {
|
|
231
232
|
[$e]: l,
|
|
232
|
-
[
|
|
233
|
+
[Fe]: l
|
|
233
234
|
},
|
|
234
235
|
allVersions: []
|
|
235
236
|
});
|
|
@@ -258,7 +259,7 @@ class ou {
|
|
|
258
259
|
return await this.v2Provider.getRegistry(o.url).getSpecificOverview(t, r);
|
|
259
260
|
}
|
|
260
261
|
}
|
|
261
|
-
class
|
|
262
|
+
class Ao {
|
|
262
263
|
constructor(e) {
|
|
263
264
|
w(this, "registries", /* @__PURE__ */ new Map());
|
|
264
265
|
this.http = e;
|
|
@@ -266,62 +267,62 @@ class Oo {
|
|
|
266
267
|
getRegistry(e) {
|
|
267
268
|
const t = this.registries.get(e);
|
|
268
269
|
if (t) return t;
|
|
269
|
-
const r = new
|
|
270
|
+
const r = new Us(Js(e, this.http));
|
|
270
271
|
return this.registries.set(e, r), r;
|
|
271
272
|
}
|
|
272
273
|
}
|
|
273
|
-
const
|
|
274
|
+
const lu = {
|
|
274
275
|
type: "remote-v2",
|
|
275
276
|
url: "https://blocks.pl-open.science/"
|
|
276
|
-
},
|
|
277
|
+
}, uu = {
|
|
277
278
|
type: "remote-v1",
|
|
278
279
|
url: "https://block.registry.platforma.bio/releases"
|
|
279
|
-
},
|
|
280
|
+
}, du = {
|
|
280
281
|
type: "remote-v1",
|
|
281
282
|
url: "https://block.registry.platforma.bio/dev"
|
|
282
|
-
},
|
|
283
|
+
}, To = {
|
|
283
284
|
groups: [{ id: "default", label: "Default", blocks: [] }]
|
|
284
|
-
},
|
|
285
|
+
}, Lo = {
|
|
285
286
|
stagingRefreshTimestamp: 0,
|
|
286
287
|
blocksInLimbo: []
|
|
287
|
-
},
|
|
288
|
+
}, Do = {
|
|
288
289
|
label: "New Project"
|
|
289
|
-
},
|
|
290
|
-
function Et(s) {
|
|
291
|
-
return `${Lo}${s}`;
|
|
292
|
-
}
|
|
293
|
-
const No = "BlockArgsAuthor/";
|
|
290
|
+
}, No = { name: "UserProject", version: "2" }, ts = "SchemaVersion", rs = "1", xt = "ProjectCreated", Le = "ProjectLastModified", De = "ProjectMeta", pe = "ProjectStructure", et = "BlockRenderingState", Bo = "BlockFrontendState/", xo = /^BlockFrontendState\/(?<blockid>.*)$/;
|
|
294
291
|
function Ct(s) {
|
|
295
|
-
return `${
|
|
292
|
+
return `${Bo}${s}`;
|
|
296
293
|
}
|
|
297
|
-
const
|
|
298
|
-
function
|
|
299
|
-
|
|
294
|
+
const jo = "BlockArgsAuthor/";
|
|
295
|
+
function Pt(s) {
|
|
296
|
+
return `${jo}${s}`;
|
|
297
|
+
}
|
|
298
|
+
const kt = "ProjectStructureAuthor";
|
|
299
|
+
function Vo(s) {
|
|
300
|
+
const e = s.match(xo);
|
|
300
301
|
if (e !== null)
|
|
301
302
|
return e.groups.blockid;
|
|
302
303
|
}
|
|
303
|
-
const
|
|
304
|
-
function
|
|
305
|
-
return `${
|
|
304
|
+
const Uo = "__serviceTemplate_";
|
|
305
|
+
function Ot(s) {
|
|
306
|
+
return `${Uo}${s}`;
|
|
306
307
|
}
|
|
307
308
|
function U(s, e) {
|
|
308
309
|
return `${s}-${e}`;
|
|
309
310
|
}
|
|
310
|
-
const
|
|
311
|
-
function
|
|
312
|
-
const e = s.match(
|
|
311
|
+
const Jo = /^(?<blockId>.*)-(?<fieldName>blockPack|blockSettings|prodArgs|currentArgs|prodCtx|prodUiCtx|prodOutput|prodCtxPrevious|prodUiCtxPrevious|prodOutputPrevious|stagingCtx|stagingUiCtx|stagingOutput|stagingCtxPrevious|stagingUiCtxPrevious|stagingOutputPrevious)$/;
|
|
312
|
+
function Go(s) {
|
|
313
|
+
const e = s.match(Jo);
|
|
313
314
|
if (e === null) return;
|
|
314
315
|
const { blockId: t, fieldName: r } = e.groups;
|
|
315
316
|
return { blockId: t, fieldName: r };
|
|
316
317
|
}
|
|
317
|
-
const
|
|
318
|
-
async function
|
|
319
|
-
const o = await
|
|
318
|
+
const Mo = "projects", ss = { name: "Projects", version: "1" }, _o = (s) => ce(s.type, ss) ? s.fields : [];
|
|
319
|
+
async function Ko(s, e, t, r) {
|
|
320
|
+
const o = await Xr.init(
|
|
320
321
|
s,
|
|
321
322
|
e,
|
|
322
323
|
{
|
|
323
324
|
...r.ops.defaultTreeOptions,
|
|
324
|
-
pruning:
|
|
325
|
+
pruning: _o
|
|
325
326
|
},
|
|
326
327
|
r.logger
|
|
327
328
|
);
|
|
@@ -332,7 +333,7 @@ async function Go(s, e, t, r) {
|
|
|
332
333
|
for (const l of a.listDynamicFields()) {
|
|
333
334
|
const d = a.traverse(l);
|
|
334
335
|
if (d === void 0) continue;
|
|
335
|
-
const f = B(d.getKeyValueAsJson(
|
|
336
|
+
const f = B(d.getKeyValueAsJson(De)), h = B(d.getKeyValueAsJson(xt)), E = B(d.getKeyValueAsJson(Le));
|
|
336
337
|
u.push({
|
|
337
338
|
id: l,
|
|
338
339
|
rid: d.id,
|
|
@@ -345,72 +346,72 @@ async function Go(s, e, t, r) {
|
|
|
345
346
|
return u.sort((l) => -l.lastModified.valueOf()), u;
|
|
346
347
|
}).withStableType(), tree: o };
|
|
347
348
|
}
|
|
348
|
-
const
|
|
349
|
+
const Ho = {
|
|
349
350
|
name: "EphRenderTemplate",
|
|
350
351
|
version: "1"
|
|
351
|
-
},
|
|
352
|
+
}, Wo = {
|
|
352
353
|
name: "RenderTemplate",
|
|
353
354
|
version: "1"
|
|
354
355
|
};
|
|
355
|
-
function
|
|
356
|
+
function os(s, e, t, r, o) {
|
|
356
357
|
if (o.length === 0) throw new Error("Zero output names provided");
|
|
357
|
-
const n = t ? s.createEphemeral(
|
|
358
|
+
const n = t ? s.createEphemeral(Ho) : s.createStruct(Wo), i = x(n, "template"), a = x(n, "inputs");
|
|
358
359
|
return s.createField(i, "Input", e), s.createField(a, "Input", A.createPlMap(s, r, t)), s.lockInputs(n), A.futureRecord(s, n, o, "Output", "outputs/");
|
|
359
360
|
}
|
|
360
|
-
const
|
|
361
|
-
function
|
|
362
|
-
return
|
|
361
|
+
const zo = { name: "BContextEnd", version: "1" }, Xo = { name: "BContext", version: "1" }, qo = "id", Yo = "parent/", Qo = ["context", "result"];
|
|
362
|
+
function cr(s, e, t) {
|
|
363
|
+
return os(s, e, !0, t, Qo);
|
|
363
364
|
}
|
|
364
|
-
function
|
|
365
|
-
const e = s.createEphemeral(
|
|
365
|
+
function Zo(s) {
|
|
366
|
+
const e = s.createEphemeral(zo);
|
|
366
367
|
return s.lock(e), e;
|
|
367
368
|
}
|
|
368
|
-
function
|
|
369
|
-
if (e.length === 0) return
|
|
369
|
+
function lr(s, e) {
|
|
370
|
+
if (e.length === 0) return Zo(s);
|
|
370
371
|
if (e.length === 1) return e[0];
|
|
371
|
-
const t = s.createEphemeral(
|
|
372
|
-
s.createField(x(t,
|
|
372
|
+
const t = s.createEphemeral(Xo);
|
|
373
|
+
s.createField(x(t, qo), "Input", A.createPlString(s, Se()));
|
|
373
374
|
for (let r = 0; r < e.length; r++)
|
|
374
|
-
s.createField(x(t, `${
|
|
375
|
+
s.createField(x(t, `${Yo}${r}`), "Input", e[r]);
|
|
375
376
|
return s.lock(t), t;
|
|
376
377
|
}
|
|
377
|
-
function
|
|
378
|
-
const t =
|
|
378
|
+
function en(s, e) {
|
|
379
|
+
const t = oo(e.content), r = t.type;
|
|
379
380
|
switch (r) {
|
|
380
381
|
case "pl.tengo-template.v2":
|
|
381
|
-
return
|
|
382
|
+
return tn(s, t);
|
|
382
383
|
default:
|
|
383
384
|
K(r);
|
|
384
385
|
}
|
|
385
386
|
}
|
|
386
|
-
const
|
|
387
|
+
const ur = {
|
|
387
388
|
hash(s, e) {
|
|
388
|
-
e.update(
|
|
389
|
+
e.update(Je.type.name).update(Je.type.version).update(s.name).update(s.version).update(s.src);
|
|
389
390
|
},
|
|
390
391
|
render(s, e, t) {
|
|
391
392
|
return e.createValue(
|
|
392
|
-
|
|
393
|
-
JSON.stringify(
|
|
393
|
+
Je.type,
|
|
394
|
+
JSON.stringify(Je.fromV2Data(s).data)
|
|
394
395
|
);
|
|
395
396
|
}
|
|
396
|
-
},
|
|
397
|
+
}, Ge = {
|
|
397
398
|
hash(s, e) {
|
|
398
|
-
e.update(
|
|
399
|
+
e.update(Ee.type.name).update(Ee.type.version).update(s.name).update(s.version).update(s.src);
|
|
399
400
|
},
|
|
400
401
|
render(s, e, t) {
|
|
401
|
-
const r =
|
|
402
|
-
return e.setKValue(o,
|
|
402
|
+
const r = Ee.fromV2Data(s), o = e.createStruct(Ee.type, r.data);
|
|
403
|
+
return e.setKValue(o, Ee.metaNameKey, JSON.stringify(r.name)), e.lock(o), o;
|
|
403
404
|
}
|
|
404
|
-
},
|
|
405
|
+
}, ns = {
|
|
405
406
|
hash(s, e) {
|
|
406
407
|
e.update(ae.type.name).update(ae.type.version).update(s.hashOverride ?? "no-override").update(s.name).update(s.version).update(s.src);
|
|
407
408
|
const t = (r) => (r.sort((o, n) => o[0] === n[0] ? 0 : o[0] < n[0] ? -1 : 1), r);
|
|
408
409
|
for (const [r, o] of t(Object.entries(s.libs ?? {})))
|
|
409
|
-
e.update("lib:" + r),
|
|
410
|
+
e.update("lib:" + r), ur.hash(o, e);
|
|
410
411
|
for (const [r, o] of t(Object.entries(s.software ?? {})))
|
|
411
|
-
e.update("soft:" + r),
|
|
412
|
+
e.update("soft:" + r), Ge.hash(o, e);
|
|
412
413
|
for (const [r, o] of t(Object.entries(s.assets ?? {})))
|
|
413
|
-
e.update("asset:" + r),
|
|
414
|
+
e.update("asset:" + r), Ge.hash(o, e);
|
|
414
415
|
for (const [r, o] of t(Object.entries(s.templates ?? {})))
|
|
415
416
|
e.update("tpl:" + r), this.hash(o, e);
|
|
416
417
|
},
|
|
@@ -421,31 +422,31 @@ const lr = {
|
|
|
421
422
|
);
|
|
422
423
|
for (const [i, a] of Object.entries(s.libs ?? {})) {
|
|
423
424
|
const c = ae.libField(r, i);
|
|
424
|
-
e.createField(c, "Input"), e.setField(c, t(a,
|
|
425
|
+
e.createField(c, "Input"), e.setField(c, t(a, ur));
|
|
425
426
|
}
|
|
426
427
|
for (const [i, a] of Object.entries(s.software ?? {})) {
|
|
427
428
|
const c = ae.swField(r, i);
|
|
428
|
-
e.createField(c, "Input"), e.setField(c, t(a,
|
|
429
|
+
e.createField(c, "Input"), e.setField(c, t(a, Ge));
|
|
429
430
|
}
|
|
430
431
|
for (const [i, a] of Object.entries(s.assets ?? {})) {
|
|
431
432
|
const c = ae.swField(r, i);
|
|
432
|
-
e.createField(c, "Input"), e.setField(c, t(a,
|
|
433
|
+
e.createField(c, "Input"), e.setField(c, t(a, Ge));
|
|
433
434
|
}
|
|
434
435
|
for (const [i, a] of Object.entries(s.templates ?? {})) {
|
|
435
436
|
const c = ae.tplField(r, i);
|
|
436
|
-
e.createField(c, "Input"), e.setField(c, t(a,
|
|
437
|
+
e.createField(c, "Input"), e.setField(c, t(a, ns));
|
|
437
438
|
}
|
|
438
439
|
if (e.lock(r), !s.hashOverride) return r;
|
|
439
440
|
const o = e.createStruct(
|
|
440
|
-
|
|
441
|
-
JSON.stringify(
|
|
442
|
-
), n =
|
|
441
|
+
ut.type,
|
|
442
|
+
JSON.stringify(ut.fromV2Data(s))
|
|
443
|
+
), n = ut.tplField(o);
|
|
443
444
|
return e.createField(n, "Service"), e.setField(n, r), e.lock(o), o;
|
|
444
445
|
}
|
|
445
446
|
};
|
|
446
|
-
function
|
|
447
|
+
function tn(s, e) {
|
|
447
448
|
const t = /* @__PURE__ */ new Map(), r = (o, n) => {
|
|
448
|
-
const i =
|
|
449
|
+
const i = Be("sha256");
|
|
449
450
|
n.hash(o, i);
|
|
450
451
|
const a = i.digest("hex");
|
|
451
452
|
if (!t.has(a)) {
|
|
@@ -454,13 +455,13 @@ function Qo(s, e) {
|
|
|
454
455
|
}
|
|
455
456
|
return t.get(a);
|
|
456
457
|
};
|
|
457
|
-
return r(e,
|
|
458
|
+
return r(e, ns);
|
|
458
459
|
}
|
|
459
|
-
const
|
|
460
|
+
const rn = { name: "TengoTemplateGet", version: "1" }, sn = "registry", on = "templateURI", nn = "template", pu = { name: "TengoTemplatePack", version: "1" }, hu = {
|
|
460
461
|
name: "TengoTemplatePackConvert",
|
|
461
462
|
version: "1"
|
|
462
|
-
},
|
|
463
|
-
async function
|
|
463
|
+
}, fu = "templatePack", gu = "template";
|
|
464
|
+
async function an(s) {
|
|
464
465
|
switch (s.type) {
|
|
465
466
|
case "from-file":
|
|
466
467
|
return {
|
|
@@ -474,34 +475,34 @@ async function sn(s) {
|
|
|
474
475
|
return K(s);
|
|
475
476
|
}
|
|
476
477
|
}
|
|
477
|
-
function
|
|
478
|
-
const t = s.createStruct(
|
|
478
|
+
function cn(s, e) {
|
|
479
|
+
const t = s.createStruct(rn), r = x(t, sn), o = x(t, on), n = x(t, nn);
|
|
479
480
|
return s.setField(r, s.createValue(A.JsonString, Buffer.from(JSON.stringify(e.registry)))), s.setField(o, s.createValue(A.JsonString, Buffer.from(JSON.stringify(e.path)))), n;
|
|
480
481
|
}
|
|
481
482
|
function jt(s, e) {
|
|
482
483
|
switch (e.type) {
|
|
483
484
|
case "from-registry":
|
|
484
|
-
return
|
|
485
|
+
return cn(s, e);
|
|
485
486
|
case "explicit":
|
|
486
|
-
return
|
|
487
|
+
return en(s, e);
|
|
487
488
|
default:
|
|
488
489
|
return K(e);
|
|
489
490
|
}
|
|
490
491
|
}
|
|
491
|
-
const
|
|
492
|
+
const is = { name: "Frontend/FromUrl", version: "1" }, as = {
|
|
492
493
|
name: "Frontend/FromFolder",
|
|
493
494
|
version: "1"
|
|
494
495
|
};
|
|
495
|
-
function
|
|
496
|
+
function ln(s, e) {
|
|
496
497
|
switch (e.type) {
|
|
497
498
|
case "url":
|
|
498
499
|
return s.createValue(
|
|
499
|
-
|
|
500
|
+
is,
|
|
500
501
|
JSON.stringify({ url: e.url })
|
|
501
502
|
);
|
|
502
503
|
case "local":
|
|
503
504
|
return s.createValue(
|
|
504
|
-
|
|
505
|
+
as,
|
|
505
506
|
JSON.stringify({
|
|
506
507
|
path: e.path,
|
|
507
508
|
signature: e.signature
|
|
@@ -511,24 +512,24 @@ function nn(s, e) {
|
|
|
511
512
|
return K(e);
|
|
512
513
|
}
|
|
513
514
|
}
|
|
514
|
-
const
|
|
515
|
-
function
|
|
515
|
+
const un = { name: "BlockPackCustom", version: "1" }, cs = "template", ls = "frontend";
|
|
516
|
+
function dr(s) {
|
|
516
517
|
return s.endsWith("/") ? s : `${s}/`;
|
|
517
518
|
}
|
|
518
|
-
function
|
|
519
|
+
function dn(s) {
|
|
519
520
|
return Buffer.from(s).toString("utf8");
|
|
520
521
|
}
|
|
521
|
-
function
|
|
522
|
-
return JSON.parse(
|
|
522
|
+
function Me(s) {
|
|
523
|
+
return JSON.parse(dn(s));
|
|
523
524
|
}
|
|
524
|
-
class
|
|
525
|
+
class pn {
|
|
525
526
|
constructor(e, t, r) {
|
|
526
|
-
w(this, "remoteContentCache", new
|
|
527
|
+
w(this, "remoteContentCache", new qr({
|
|
527
528
|
max: 500,
|
|
528
529
|
maxSize: 128 * 1024 * 1024,
|
|
529
530
|
fetchMethod: async (e) => {
|
|
530
531
|
const t = this.http !== void 0 ? { dispatcher: this.http } : {};
|
|
531
|
-
return await (await
|
|
532
|
+
return await (await Lt(e, t)).body.arrayBuffer();
|
|
532
533
|
},
|
|
533
534
|
sizeCalculation: (e) => e.byteLength
|
|
534
535
|
}));
|
|
@@ -539,7 +540,7 @@ class ln {
|
|
|
539
540
|
case "explicit":
|
|
540
541
|
return e.config;
|
|
541
542
|
case "dev-v1": {
|
|
542
|
-
const t = await
|
|
543
|
+
const t = await ar(e.folder), r = await Y.promises.readFile(t.config, { encoding: "utf-8" });
|
|
543
544
|
return JSON.parse(r);
|
|
544
545
|
}
|
|
545
546
|
case "dev-v2": {
|
|
@@ -549,12 +550,12 @@ class ln {
|
|
|
549
550
|
return JSON.parse(r);
|
|
550
551
|
}
|
|
551
552
|
case "from-registry-v1": {
|
|
552
|
-
const t = `${
|
|
553
|
-
return
|
|
553
|
+
const t = `${dr(e.registryUrl)}${de.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, r = await this.remoteContentCache.forceFetch(`${t}/config.json`);
|
|
554
|
+
return Me(r);
|
|
554
555
|
}
|
|
555
556
|
case "from-registry-v2": {
|
|
556
557
|
const r = await this.v2RegistryProvider.getRegistry(e.registryUrl).getComponents(e.id), o = await this.remoteContentCache.forceFetch(r.model.url);
|
|
557
|
-
return
|
|
558
|
+
return Me(o);
|
|
558
559
|
}
|
|
559
560
|
default:
|
|
560
561
|
return K(e);
|
|
@@ -565,7 +566,7 @@ class ln {
|
|
|
565
566
|
case "explicit":
|
|
566
567
|
return e;
|
|
567
568
|
case "dev-v1": {
|
|
568
|
-
const t = await
|
|
569
|
+
const t = await ar(e.folder), r = await Y.promises.readFile(t.workflow), o = JSON.parse(
|
|
569
570
|
await Y.promises.readFile(t.config, "utf-8")
|
|
570
571
|
), n = t.ui;
|
|
571
572
|
return {
|
|
@@ -607,7 +608,7 @@ class ln {
|
|
|
607
608
|
};
|
|
608
609
|
}
|
|
609
610
|
case "from-registry-v1": {
|
|
610
|
-
const t = `${
|
|
611
|
+
const t = `${dr(e.registryUrl)}${de.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, r = `${t}/template.plj.gz`, o = await this.remoteContentCache.forceFetch(r), n = new Uint8Array(o), i = await this.remoteContentCache.forceFetch(`${t}/config.json`), a = Me(i);
|
|
611
612
|
return {
|
|
612
613
|
type: "explicit",
|
|
613
614
|
template: {
|
|
@@ -623,7 +624,7 @@ class ln {
|
|
|
623
624
|
};
|
|
624
625
|
}
|
|
625
626
|
case "from-registry-v2": {
|
|
626
|
-
const r = await this.v2RegistryProvider.getRegistry(e.registryUrl).getComponents(e.id), o = async () =>
|
|
627
|
+
const r = await this.v2RegistryProvider.getRegistry(e.registryUrl).getComponents(e.id), o = async () => Me(await this.remoteContentCache.forceFetch(r.model.url)), n = async () => await this.remoteContentCache.forceFetch(r.workflow.main.url), [i, a] = await Promise.all([o(), n()]);
|
|
627
628
|
return {
|
|
628
629
|
type: "explicit",
|
|
629
630
|
template: {
|
|
@@ -643,22 +644,22 @@ class ln {
|
|
|
643
644
|
}
|
|
644
645
|
}
|
|
645
646
|
}
|
|
646
|
-
function
|
|
647
|
-
const t = { config: e.config, source: e.source }, r = s.createStruct(
|
|
648
|
-
return s.createField(x(r,
|
|
647
|
+
function hn(s, e) {
|
|
648
|
+
const t = { config: e.config, source: e.source }, r = s.createStruct(un, JSON.stringify(t));
|
|
649
|
+
return s.createField(x(r, cs), "Input", jt(s, e.template)), s.createField(x(r, ls), "Input", ln(s, e.frontend)), s.lock(r), r;
|
|
649
650
|
}
|
|
650
|
-
function
|
|
651
|
+
function pr(s, e) {
|
|
651
652
|
switch (e.type) {
|
|
652
653
|
case "explicit":
|
|
653
|
-
return
|
|
654
|
+
return hn(s, e);
|
|
654
655
|
default:
|
|
655
656
|
return K(e.type);
|
|
656
657
|
}
|
|
657
658
|
}
|
|
658
|
-
function
|
|
659
|
+
function _e(s, e) {
|
|
659
660
|
return { __isRef: !0, blockId: s, name: e };
|
|
660
661
|
}
|
|
661
|
-
function
|
|
662
|
+
function fn(s) {
|
|
662
663
|
return typeof s == "object" && s !== null && "__isRef" in s && s.__isRef === !0 && "blockId" in s && "name" in s;
|
|
663
664
|
}
|
|
664
665
|
function $t(s, e, t) {
|
|
@@ -674,7 +675,7 @@ function $t(s, e, t) {
|
|
|
674
675
|
return;
|
|
675
676
|
case "object":
|
|
676
677
|
if (e === null) return;
|
|
677
|
-
if (
|
|
678
|
+
if (fn(e))
|
|
678
679
|
t === void 0 || t.has(e.blockId) ? s.upstreams.add(e.blockId) : s.missingReferences = !0;
|
|
679
680
|
else if (Array.isArray(e))
|
|
680
681
|
for (const o of e) $t(s, o, t);
|
|
@@ -686,18 +687,18 @@ function $t(s, e, t) {
|
|
|
686
687
|
K(r);
|
|
687
688
|
}
|
|
688
689
|
}
|
|
689
|
-
function
|
|
690
|
+
function gn(s, e) {
|
|
690
691
|
const t = { upstreams: /* @__PURE__ */ new Set(), missingReferences: !1 };
|
|
691
692
|
return $t(t, s, e), t;
|
|
692
693
|
}
|
|
693
|
-
function
|
|
694
|
+
function oe(s) {
|
|
694
695
|
return {
|
|
695
696
|
*[Symbol.iterator]() {
|
|
696
697
|
for (const e of s.groups) for (const t of e.blocks) yield t;
|
|
697
698
|
}
|
|
698
699
|
};
|
|
699
700
|
}
|
|
700
|
-
class
|
|
701
|
+
class us {
|
|
701
702
|
constructor(e) {
|
|
702
703
|
/** Nodes are stored in the map in topological order */
|
|
703
704
|
w(this, "nodes");
|
|
@@ -727,24 +728,24 @@ class cs {
|
|
|
727
728
|
}
|
|
728
729
|
}
|
|
729
730
|
}
|
|
730
|
-
function
|
|
731
|
+
function Ft(s) {
|
|
731
732
|
const e = /* @__PURE__ */ new Map();
|
|
732
733
|
let t;
|
|
733
|
-
for (const { id: r } of
|
|
734
|
+
for (const { id: r } of oe(s)) {
|
|
734
735
|
const o = {
|
|
735
736
|
id: r,
|
|
736
737
|
missingReferences: !1
|
|
737
738
|
};
|
|
738
739
|
e.set(r, o), t === void 0 ? o.upstream = /* @__PURE__ */ new Set() : (o.upstream = /* @__PURE__ */ new Set([t.id]), t.downstream = /* @__PURE__ */ new Set([o.id])), t = o;
|
|
739
740
|
}
|
|
740
|
-
return t !== void 0 && (t.downstream = /* @__PURE__ */ new Set()), new
|
|
741
|
+
return t !== void 0 && (t.downstream = /* @__PURE__ */ new Set()), new us(e);
|
|
741
742
|
}
|
|
742
|
-
function
|
|
743
|
+
function Qe(s, e) {
|
|
743
744
|
const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
|
|
744
|
-
for (const { id: o } of
|
|
745
|
+
for (const { id: o } of oe(s)) {
|
|
745
746
|
const n = e(o);
|
|
746
747
|
if (n === void 0) continue;
|
|
747
|
-
const i =
|
|
748
|
+
const i = gn(n, r), a = {
|
|
748
749
|
id: o,
|
|
749
750
|
missingReferences: i.missingReferences,
|
|
750
751
|
upstream: i.upstreams,
|
|
@@ -753,41 +754,41 @@ function Ye(s, e) {
|
|
|
753
754
|
};
|
|
754
755
|
t.set(o, a), i.upstreams.forEach((c) => t.get(c).downstream.add(o)), r.add(o);
|
|
755
756
|
}
|
|
756
|
-
return new
|
|
757
|
+
return new us(t);
|
|
757
758
|
}
|
|
758
|
-
function
|
|
759
|
+
function mn(s, e) {
|
|
759
760
|
if (s.size !== e.size) return !1;
|
|
760
761
|
for (const t of s) if (!e.has(t)) return !1;
|
|
761
762
|
return !0;
|
|
762
763
|
}
|
|
763
|
-
function
|
|
764
|
-
if (s.size > e.size) return
|
|
764
|
+
function It(s, e) {
|
|
765
|
+
if (s.size > e.size) return It(e, s);
|
|
765
766
|
for (const t of s) if (e.has(t)) return !0;
|
|
766
767
|
return !1;
|
|
767
768
|
}
|
|
768
|
-
function
|
|
769
|
+
function hr(s, e) {
|
|
769
770
|
const t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
|
|
770
771
|
return s.nodes.forEach((n) => {
|
|
771
772
|
const i = e.nodes.get(n.id);
|
|
772
|
-
i === void 0 ? t.add(n.id) : (!
|
|
773
|
+
i === void 0 ? t.add(n.id) : (!mn(n.upstream, i.upstream) || It(n.upstream, o)) && o.add(n.id);
|
|
773
774
|
}), e.nodes.forEach((n) => {
|
|
774
|
-
s.nodes.has(n.id) ?
|
|
775
|
+
s.nodes.has(n.id) ? It(n.upstream, o) && o.add(n.id) : r.add(n.id);
|
|
775
776
|
}), { onlyInA: t, onlyInB: r, different: o };
|
|
776
777
|
}
|
|
777
|
-
let
|
|
778
|
-
async function
|
|
779
|
-
if (
|
|
780
|
-
const s = await
|
|
778
|
+
let pt;
|
|
779
|
+
async function ds() {
|
|
780
|
+
if (pt === void 0) {
|
|
781
|
+
const s = await an(no["pframes.export-pframe"]);
|
|
781
782
|
if (s.type !== "explicit") throw new Error("Unexpected prepared template type.");
|
|
782
|
-
const e =
|
|
783
|
-
|
|
783
|
+
const e = Be("sha256").update(s.content).digest("hex");
|
|
784
|
+
pt = { spec: s, hash: e };
|
|
784
785
|
}
|
|
785
|
-
return
|
|
786
|
+
return pt;
|
|
786
787
|
}
|
|
787
|
-
function
|
|
788
|
-
return
|
|
788
|
+
function vn(s, e, t) {
|
|
789
|
+
return os(s, e, !0, { pf: t }, ["result"]).result;
|
|
789
790
|
}
|
|
790
|
-
function
|
|
791
|
+
function ht(s, e) {
|
|
791
792
|
let t = !1, r, o;
|
|
792
793
|
return () => {
|
|
793
794
|
if (!t)
|
|
@@ -796,13 +797,13 @@ function pt(s, e) {
|
|
|
796
797
|
return r !== n && (r = n, o = e()), e();
|
|
797
798
|
};
|
|
798
799
|
}
|
|
799
|
-
class
|
|
800
|
+
class fr {
|
|
800
801
|
constructor(e, t) {
|
|
801
|
-
w(this, "currentInputsC",
|
|
802
|
+
w(this, "currentInputsC", ht(
|
|
802
803
|
() => this.fields.currentArgs.modCount,
|
|
803
804
|
() => JSON.parse(Buffer.from(this.fields.currentArgs.value).toString())
|
|
804
805
|
));
|
|
805
|
-
w(this, "actualProductionInputsC",
|
|
806
|
+
w(this, "actualProductionInputsC", ht(
|
|
806
807
|
() => {
|
|
807
808
|
var e;
|
|
808
809
|
return (e = this.fields.prodArgs) == null ? void 0 : e.modCount;
|
|
@@ -814,7 +815,7 @@ class hr {
|
|
|
814
815
|
return JSON.parse(Buffer.from(e).toString());
|
|
815
816
|
}
|
|
816
817
|
));
|
|
817
|
-
w(this, "productionStaleC",
|
|
818
|
+
w(this, "productionStaleC", ht(
|
|
818
819
|
() => {
|
|
819
820
|
var e;
|
|
820
821
|
return `${this.fields.currentArgs.modCount}_${(e = this.fields.prodArgs) == null ? void 0 : e.modCount}`;
|
|
@@ -860,15 +861,15 @@ class hr {
|
|
|
860
861
|
getTemplate(e) {
|
|
861
862
|
return e.getFutureFieldValue(
|
|
862
863
|
A.unwrapHolder(e, this.fields.blockPack.ref),
|
|
863
|
-
|
|
864
|
+
cs,
|
|
864
865
|
"Input"
|
|
865
866
|
);
|
|
866
867
|
}
|
|
867
868
|
}
|
|
868
|
-
const
|
|
869
|
+
const yn = (s) => {
|
|
869
870
|
throw new Error(`No new block info for ${s}`);
|
|
870
871
|
};
|
|
871
|
-
class
|
|
872
|
+
class tt {
|
|
872
873
|
constructor(e, t, r, o, n, i, a, c, u, l, d, f) {
|
|
873
874
|
w(this, "globalModCount", 0);
|
|
874
875
|
w(this, "fieldsChanged", !1);
|
|
@@ -906,16 +907,16 @@ class et {
|
|
|
906
907
|
return JSON.parse(JSON.stringify(this.struct));
|
|
907
908
|
}
|
|
908
909
|
getStagingGraph() {
|
|
909
|
-
return this.stagingGraph === void 0 && (this.stagingGraph =
|
|
910
|
+
return this.stagingGraph === void 0 && (this.stagingGraph = Ft(this.struct)), this.stagingGraph;
|
|
910
911
|
}
|
|
911
912
|
getPendingProductionGraph() {
|
|
912
|
-
return this.pendingProductionGraph === void 0 && (this.pendingProductionGraph =
|
|
913
|
+
return this.pendingProductionGraph === void 0 && (this.pendingProductionGraph = Qe(
|
|
913
914
|
this.struct,
|
|
914
915
|
(e) => this.getBlockInfo(e).currentInputs
|
|
915
916
|
)), this.pendingProductionGraph;
|
|
916
917
|
}
|
|
917
918
|
getActualProductionGraph() {
|
|
918
|
-
return this.actualProductionGraph === void 0 && (this.actualProductionGraph =
|
|
919
|
+
return this.actualProductionGraph === void 0 && (this.actualProductionGraph = Qe(
|
|
919
920
|
this.struct,
|
|
920
921
|
(e) => this.getBlockInfo(e).actualProductionInputs
|
|
921
922
|
)), this.actualProductionGraph;
|
|
@@ -936,7 +937,7 @@ class et {
|
|
|
936
937
|
return this.createJsonFieldValueByContent(JSON.stringify(e));
|
|
937
938
|
}
|
|
938
939
|
getBlock(e) {
|
|
939
|
-
for (const t of
|
|
940
|
+
for (const t of oe(this.struct)) if (t.id === e) return t;
|
|
940
941
|
throw new Error("block not found");
|
|
941
942
|
}
|
|
942
943
|
setBlockFieldObj(e, t, r) {
|
|
@@ -1013,7 +1014,7 @@ class et {
|
|
|
1013
1014
|
if (((n = o.fields.prodCtx) == null ? void 0 : n.ref) === void 0)
|
|
1014
1015
|
throw new Error("One of the upstreams staging is not rendered.");
|
|
1015
1016
|
t.push(A.unwrapHolder(this.tx, o.fields.prodCtx.ref));
|
|
1016
|
-
}),
|
|
1017
|
+
}), lr(this.tx, t);
|
|
1017
1018
|
}
|
|
1018
1019
|
createStagingCtx(e) {
|
|
1019
1020
|
const t = [];
|
|
@@ -1023,16 +1024,16 @@ class et {
|
|
|
1023
1024
|
if (((n = o.fields.stagingCtx) == null ? void 0 : n.ref) === void 0)
|
|
1024
1025
|
throw new Error("One of the upstreams staging is not rendered.");
|
|
1025
1026
|
t.push(A.unwrapHolder(this.tx, o.fields.stagingCtx.ref)), ((i = o.fields.prodCtx) == null ? void 0 : i.ref) !== void 0 && t.push(A.unwrapHolder(this.tx, o.fields.prodCtx.ref));
|
|
1026
|
-
}),
|
|
1027
|
+
}), lr(this.tx, t);
|
|
1027
1028
|
}
|
|
1028
1029
|
exportCtx(e) {
|
|
1029
|
-
return
|
|
1030
|
+
return vn(this.tx, A.unwrapHolder(this.tx, this.ctxExportTplHolder), e);
|
|
1030
1031
|
}
|
|
1031
1032
|
renderStagingFor(e) {
|
|
1032
1033
|
this.resetStaging(e);
|
|
1033
1034
|
const t = this.getBlockInfo(e), r = this.createStagingCtx(this.getStagingGraph().nodes.get(e).upstream);
|
|
1034
1035
|
if (this.getBlock(e).renderingMode !== "Heavy") throw new Error("not supported yet");
|
|
1035
|
-
const o = t.getTemplate(this.tx), n =
|
|
1036
|
+
const o = t.getTemplate(this.tx), n = cr(this.tx, o, {
|
|
1036
1037
|
args: t.fields.currentArgs.ref,
|
|
1037
1038
|
blockId: this.tx.createValue(A.JsonString, JSON.stringify(e)),
|
|
1038
1039
|
isProduction: this.tx.createValue(A.JsonBool, JSON.stringify(!1)),
|
|
@@ -1050,7 +1051,7 @@ class et {
|
|
|
1050
1051
|
const t = this.getBlockInfo(e), r = this.createProdCtx(this.getPendingProductionGraph().nodes.get(e).upstream);
|
|
1051
1052
|
if (this.getBlock(e).renderingMode === "Light")
|
|
1052
1053
|
throw new Error("Can't render production for light block.");
|
|
1053
|
-
const o = t.getTemplate(this.tx), n =
|
|
1054
|
+
const o = t.getTemplate(this.tx), n = cr(this.tx, o, {
|
|
1054
1055
|
args: t.fields.currentArgs.ref,
|
|
1055
1056
|
blockId: this.tx.createValue(A.JsonString, JSON.stringify(e)),
|
|
1056
1057
|
isProduction: this.tx.createValue(A.JsonBool, JSON.stringify(!0)),
|
|
@@ -1067,22 +1068,22 @@ class et {
|
|
|
1067
1068
|
// Structure changes
|
|
1068
1069
|
//
|
|
1069
1070
|
/** Very generic method, better check for more specialized case-specific methods first. */
|
|
1070
|
-
updateStructure(e, t =
|
|
1071
|
-
const r = this.getStagingGraph(), o = this.getActualProductionGraph(), n =
|
|
1071
|
+
updateStructure(e, t = yn) {
|
|
1072
|
+
const r = this.getStagingGraph(), o = this.getActualProductionGraph(), n = Ft(e), i = Qe(
|
|
1072
1073
|
e,
|
|
1073
1074
|
(u) => {
|
|
1074
1075
|
var l;
|
|
1075
1076
|
return (l = this.blockInfos.get(u)) == null ? void 0 : l.actualProductionInputs;
|
|
1076
1077
|
}
|
|
1077
|
-
), a =
|
|
1078
|
+
), a = hr(r, n), c = hr(o, i);
|
|
1078
1079
|
for (const u of a.onlyInA) {
|
|
1079
1080
|
const { fields: l } = this.getBlockInfo(u);
|
|
1080
1081
|
this.deleteBlockFields(u, ...Object.keys(l)), this.blockInfos.delete(u), this.blocksInLimbo.delete(u) && (this.renderingStateChanged = !0), this.blockFrontendStates.delete(u) && this.changedBlockFrontendStates.add(u);
|
|
1081
1082
|
}
|
|
1082
1083
|
for (const u of a.onlyInB) {
|
|
1083
|
-
const l = new
|
|
1084
|
+
const l = new fr(u, {});
|
|
1084
1085
|
this.blockInfos.set(u, l);
|
|
1085
|
-
const d = t(u), f =
|
|
1086
|
+
const d = t(u), f = pr(this.tx, d.blockPack);
|
|
1086
1087
|
this.setBlockField(u, "blockPack", A.wrapInHolder(this.tx, f), "NotReady"), this.setBlockFieldObj(
|
|
1087
1088
|
u,
|
|
1088
1089
|
"blockSettings",
|
|
@@ -1138,7 +1139,7 @@ class et {
|
|
|
1138
1139
|
this.setBlockField(
|
|
1139
1140
|
e,
|
|
1140
1141
|
"blockPack",
|
|
1141
|
-
A.wrapInHolder(this.tx,
|
|
1142
|
+
A.wrapInHolder(this.tx, pr(this.tx, t)),
|
|
1142
1143
|
"NotReady"
|
|
1143
1144
|
), r !== void 0 ? (this.setArgs([{ blockId: e, args: r }]), this.setUiState(e, void 0)) : this.getStagingGraph().traverse("downstream", [e], ({ id: n }) => this.resetStaging(n)), o.productionRendered && this.getActualProductionGraph().traverse(
|
|
1144
1145
|
"downstream",
|
|
@@ -1164,7 +1165,7 @@ class et {
|
|
|
1164
1165
|
throw new Error("Can't render blocks not including all upstreams.");
|
|
1165
1166
|
}
|
|
1166
1167
|
const n = /* @__PURE__ */ new Set();
|
|
1167
|
-
for (const a of
|
|
1168
|
+
for (const a of oe(this.structure)) {
|
|
1168
1169
|
if (!r.has(a.id)) continue;
|
|
1169
1170
|
let c = this.getBlockInfo(a.id).requireProductionRendering || this.blocksInLimbo.has(a.id);
|
|
1170
1171
|
if (!c) {
|
|
@@ -1187,7 +1188,7 @@ class et {
|
|
|
1187
1188
|
* accordingly */
|
|
1188
1189
|
stopProduction(...e) {
|
|
1189
1190
|
var i, a;
|
|
1190
|
-
const t = this.getActualProductionGraph(), r = new
|
|
1191
|
+
const t = this.getActualProductionGraph(), r = new Yr(e), o = new Set(e), n = [];
|
|
1191
1192
|
for (; !r.isEmpty(); ) {
|
|
1192
1193
|
const c = r.shift(), u = this.getBlockInfo(c).fields;
|
|
1193
1194
|
if (!(((i = u.prodOutput) == null ? void 0 : i.status) === "Ready" && ((a = u.prodCtx) == null ? void 0 : a.status) === "Ready") && this.deleteBlockFields(c, "prodOutput", "prodCtx", "prodUiCtx", "prodArgs")) {
|
|
@@ -1247,28 +1248,28 @@ class et {
|
|
|
1247
1248
|
assignAuthorMarkers() {
|
|
1248
1249
|
const e = this.author ? JSON.stringify(this.author) : void 0;
|
|
1249
1250
|
for (const t of this.blocksWithChangedInputs)
|
|
1250
|
-
e === void 0 ? this.tx.deleteKValue(this.rid,
|
|
1251
|
-
(this.metaChanged || this.structureChanged) && (e === void 0 ? this.tx.deleteKValue(this.rid,
|
|
1251
|
+
e === void 0 ? this.tx.deleteKValue(this.rid, Pt(t)) : this.tx.setKValue(this.rid, Pt(t), e);
|
|
1252
|
+
(this.metaChanged || this.structureChanged) && (e === void 0 ? this.tx.deleteKValue(this.rid, kt) : this.tx.setKValue(this.rid, kt, e));
|
|
1252
1253
|
}
|
|
1253
1254
|
save() {
|
|
1254
1255
|
if (this.wasModified) {
|
|
1255
|
-
this.lastModifiedChanged && this.tx.setKValue(this.rid,
|
|
1256
|
+
this.lastModifiedChanged && this.tx.setKValue(this.rid, Le, JSON.stringify(this.lastModified)), this.structureChanged && this.tx.setKValue(this.rid, pe, JSON.stringify(this.struct)), this.renderingStateChanged && this.tx.setKValue(
|
|
1256
1257
|
this.rid,
|
|
1257
|
-
|
|
1258
|
+
et,
|
|
1258
1259
|
JSON.stringify({
|
|
1259
1260
|
...this.renderingState,
|
|
1260
1261
|
blocksInLimbo: [...this.blocksInLimbo]
|
|
1261
1262
|
})
|
|
1262
|
-
), this.metaChanged && this.tx.setKValue(this.rid,
|
|
1263
|
+
), this.metaChanged && this.tx.setKValue(this.rid, De, JSON.stringify(this.meta));
|
|
1263
1264
|
for (const e of this.changedBlockFrontendStates) {
|
|
1264
1265
|
const t = this.blockFrontendStates.get(e);
|
|
1265
|
-
t === void 0 ? this.tx.deleteKValue(this.rid,
|
|
1266
|
+
t === void 0 ? this.tx.deleteKValue(this.rid, Ct(e)) : this.tx.setKValue(this.rid, Ct(e), t);
|
|
1266
1267
|
}
|
|
1267
1268
|
this.assignAuthorMarkers();
|
|
1268
1269
|
}
|
|
1269
1270
|
}
|
|
1270
1271
|
static async load(e, t, r) {
|
|
1271
|
-
const o = e.getResourceData(t, !0), n = e.getKValueJson(t,
|
|
1272
|
+
const o = e.getResourceData(t, !0), n = e.getKValueJson(t, ts), i = e.getKValueJson(t, Le), a = e.getKValueJson(t, De), c = e.getKValueJson(t, pe), u = e.getKValueJson(t, et), l = e.listKeyValuesString(t), [
|
|
1272
1273
|
d,
|
|
1273
1274
|
f,
|
|
1274
1275
|
h,
|
|
@@ -1285,51 +1286,51 @@ class et {
|
|
|
1285
1286
|
u,
|
|
1286
1287
|
l
|
|
1287
1288
|
]);
|
|
1288
|
-
if (f !==
|
|
1289
|
+
if (f !== rs)
|
|
1289
1290
|
throw new Error(
|
|
1290
1291
|
`Can't act on this project resource because it has a wrong schema version: ${f}`
|
|
1291
1292
|
);
|
|
1292
|
-
const
|
|
1293
|
+
const $ = /* @__PURE__ */ new Map();
|
|
1293
1294
|
for (const p of d.fields) {
|
|
1294
|
-
const m =
|
|
1295
|
+
const m = Go(p.name);
|
|
1295
1296
|
if (m === void 0) continue;
|
|
1296
|
-
let y =
|
|
1297
|
+
let y = $.get(m.blockId);
|
|
1297
1298
|
y === void 0 && (y = {
|
|
1298
1299
|
id: m.blockId,
|
|
1299
1300
|
fields: {}
|
|
1300
|
-
},
|
|
1301
|
+
}, $.set(m.blockId, y)), y.fields[m.fieldName] = Ze(p.value) ? { modCount: 0 } : { modCount: 0, ref: p.value };
|
|
1301
1302
|
}
|
|
1302
|
-
const G = await
|
|
1303
|
+
const G = await ds(), he = Ot(G.hash), L = d.fields.find(
|
|
1303
1304
|
(p) => p.name === he
|
|
1304
1305
|
);
|
|
1305
1306
|
let X;
|
|
1306
|
-
L !== void 0 ? X =
|
|
1307
|
-
x(t,
|
|
1307
|
+
L !== void 0 ? X = Rt(L.value) : (X = A.wrapInHolder(e, jt(e, G.spec)), e.createField(
|
|
1308
|
+
x(t, Ot(G.hash)),
|
|
1308
1309
|
"Dynamic",
|
|
1309
1310
|
X
|
|
1310
1311
|
));
|
|
1311
1312
|
const ie = { stagingRefreshTimestamp: D }, W = new Set(T), M = /* @__PURE__ */ new Map();
|
|
1312
1313
|
for (const p of j) {
|
|
1313
|
-
const m =
|
|
1314
|
+
const m = Vo(p.key);
|
|
1314
1315
|
m !== void 0 && M.set(m, p.value);
|
|
1315
1316
|
}
|
|
1316
1317
|
const V = [];
|
|
1317
|
-
|
|
1318
|
+
$.forEach(({ fields: p }) => {
|
|
1318
1319
|
for (const [, m] of Object.entries(p))
|
|
1319
1320
|
if (m.ref !== void 0) {
|
|
1320
|
-
if (!
|
|
1321
|
+
if (!Ws(m.ref) || zs(m.ref))
|
|
1321
1322
|
throw new Error("unexpected behaviour");
|
|
1322
1323
|
V.push([m, e.getResourceData(m.ref, !1)]);
|
|
1323
1324
|
}
|
|
1324
1325
|
});
|
|
1325
1326
|
for (const [p, m] of V) {
|
|
1326
1327
|
const y = await m;
|
|
1327
|
-
p.value = y.data,
|
|
1328
|
+
p.value = y.data, tr(y.error) ? p.status = "Error" : y.resourceReady || tr(y.originalResourceId) ? p.status = "Ready" : p.status = "NotReady";
|
|
1328
1329
|
}
|
|
1329
1330
|
const q = /* @__PURE__ */ new Map();
|
|
1330
|
-
|
|
1331
|
+
$.forEach(({ id: p, fields: m }) => q.set(p, new fr(p, m)));
|
|
1331
1332
|
const fe = /* @__PURE__ */ new Set();
|
|
1332
|
-
for (const p of
|
|
1333
|
+
for (const p of oe(g)) {
|
|
1333
1334
|
if (!q.has(p.id))
|
|
1334
1335
|
throw new Error(`Inconsistent project structure: no inputs for ${p.id}`);
|
|
1335
1336
|
fe.add(p.id);
|
|
@@ -1339,7 +1340,7 @@ class et {
|
|
|
1339
1340
|
throw new Error(`Inconsistent project structure: no structure entry for ${p.id}`);
|
|
1340
1341
|
p.check();
|
|
1341
1342
|
});
|
|
1342
|
-
const v = new
|
|
1343
|
+
const v = new tt(
|
|
1343
1344
|
t,
|
|
1344
1345
|
e,
|
|
1345
1346
|
r,
|
|
@@ -1356,33 +1357,33 @@ class et {
|
|
|
1356
1357
|
return v.fixProblemsAndMigrate(), v;
|
|
1357
1358
|
}
|
|
1358
1359
|
}
|
|
1359
|
-
async function
|
|
1360
|
-
const t = s.createEphemeral(
|
|
1360
|
+
async function wn(s, e = Do) {
|
|
1361
|
+
const t = s.createEphemeral(No);
|
|
1361
1362
|
s.lock(t);
|
|
1362
1363
|
const r = String(Date.now());
|
|
1363
|
-
s.setKValue(t,
|
|
1364
|
-
const o = await
|
|
1364
|
+
s.setKValue(t, ts, JSON.stringify(rs)), s.setKValue(t, xt, r), s.setKValue(t, Le, r), s.setKValue(t, De, JSON.stringify(e)), s.setKValue(t, pe, JSON.stringify(To)), s.setKValue(t, et, JSON.stringify(Lo));
|
|
1365
|
+
const o = await ds();
|
|
1365
1366
|
return s.createField(
|
|
1366
|
-
x(t,
|
|
1367
|
+
x(t, Ot(o.hash)),
|
|
1367
1368
|
"Dynamic",
|
|
1368
1369
|
A.wrapInHolder(s, jt(s, o.spec))
|
|
1369
1370
|
), t;
|
|
1370
1371
|
}
|
|
1371
|
-
async function
|
|
1372
|
+
async function Ke(s, e, t) {
|
|
1372
1373
|
return Q(s, e, void 0, t);
|
|
1373
1374
|
}
|
|
1374
1375
|
async function Q(s, e, t, r) {
|
|
1375
|
-
if (s instanceof
|
|
1376
|
+
if (s instanceof Hs)
|
|
1376
1377
|
return await s.withWriteTx("ProjectAction", async (o) => {
|
|
1377
|
-
const n = await
|
|
1378
|
+
const n = await tt.load(o, e, t), i = await r(n);
|
|
1378
1379
|
return n.wasModified && (n.save(), await o.commit()), i;
|
|
1379
1380
|
});
|
|
1380
1381
|
{
|
|
1381
|
-
const o = await
|
|
1382
|
+
const o = await tt.load(s, e, t), n = await r(o);
|
|
1382
1383
|
return o.save(), n;
|
|
1383
1384
|
}
|
|
1384
1385
|
}
|
|
1385
|
-
function*
|
|
1386
|
+
function* Sn(s) {
|
|
1386
1387
|
switch (s.type) {
|
|
1387
1388
|
case "Json":
|
|
1388
1389
|
return;
|
|
@@ -1397,21 +1398,21 @@ function* vn(s) {
|
|
|
1397
1398
|
K(s);
|
|
1398
1399
|
}
|
|
1399
1400
|
}
|
|
1400
|
-
function
|
|
1401
|
+
function gr(s, e) {
|
|
1401
1402
|
return Object.fromEntries(
|
|
1402
1403
|
Object.entries(s).map(([t, r]) => [t, e(r, t)])
|
|
1403
1404
|
);
|
|
1404
1405
|
}
|
|
1405
|
-
function
|
|
1406
|
+
function bn(s, e) {
|
|
1406
1407
|
switch (s.type) {
|
|
1407
1408
|
case "Json":
|
|
1408
1409
|
return { ...s };
|
|
1409
1410
|
case "JsonPartitioned":
|
|
1410
|
-
return { ...s, parts:
|
|
1411
|
+
return { ...s, parts: gr(s.parts, e) };
|
|
1411
1412
|
case "BinaryPartitioned":
|
|
1412
1413
|
return {
|
|
1413
1414
|
...s,
|
|
1414
|
-
parts:
|
|
1415
|
+
parts: gr(s.parts, (t) => ({
|
|
1415
1416
|
index: e(t.index),
|
|
1416
1417
|
values: e(t.values)
|
|
1417
1418
|
}))
|
|
@@ -1420,26 +1421,26 @@ function yn(s, e) {
|
|
|
1420
1421
|
K(s);
|
|
1421
1422
|
}
|
|
1422
1423
|
}
|
|
1423
|
-
const
|
|
1424
|
+
const Rn = Ne("PColumnData/JsonPartitioned", "1"), En = Ne(
|
|
1424
1425
|
"PColumnData/Partitioned/JsonPartitioned",
|
|
1425
1426
|
"1"
|
|
1426
|
-
),
|
|
1427
|
+
), Cn = Ne("PColumnData/BinaryPartitioned", "1"), Pn = Ne(
|
|
1427
1428
|
"PColumnData/Partitioned/BinaryPartitioned",
|
|
1428
1429
|
"1"
|
|
1429
|
-
),
|
|
1430
|
-
function
|
|
1430
|
+
), kn = Ne("PColumnData/Json", "1");
|
|
1431
|
+
function On(s) {
|
|
1431
1432
|
if (!s.getIsReadyOrError()) throw new Error("Data not ready.");
|
|
1432
1433
|
const e = s.getDataAsJson();
|
|
1433
1434
|
if (e === void 0)
|
|
1434
1435
|
throw new Error("unexpected data info structure, no resource data");
|
|
1435
|
-
if (ce(s.resourceType,
|
|
1436
|
+
if (ce(s.resourceType, kn)) {
|
|
1436
1437
|
const t = e;
|
|
1437
1438
|
return {
|
|
1438
1439
|
type: "Json",
|
|
1439
1440
|
keyLength: t.keyLength,
|
|
1440
1441
|
data: t.data
|
|
1441
1442
|
};
|
|
1442
|
-
} else if (ce(s.resourceType,
|
|
1443
|
+
} else if (ce(s.resourceType, Rn)) {
|
|
1443
1444
|
const t = e, r = Object.fromEntries(
|
|
1444
1445
|
s.listInputFields().map((o) => [o, s.traverse({ field: o, errorIfFieldNotSet: !0 }).resourceInfo])
|
|
1445
1446
|
);
|
|
@@ -1448,7 +1449,7 @@ function Cn(s) {
|
|
|
1448
1449
|
partitionKeyLength: t.partitionKeyLength,
|
|
1449
1450
|
parts: r
|
|
1450
1451
|
};
|
|
1451
|
-
} else if (ce(s.resourceType,
|
|
1452
|
+
} else if (ce(s.resourceType, En)) {
|
|
1452
1453
|
const t = e, r = {};
|
|
1453
1454
|
for (const o of s.listInputFields()) {
|
|
1454
1455
|
const n = s.traverse({ field: o, errorIfFieldNotSet: !0 }), i = n.listInputFields();
|
|
@@ -1466,7 +1467,7 @@ function Cn(s) {
|
|
|
1466
1467
|
partitionKeyLength: t.superPartitionKeyLength + t.partitionKeyLength,
|
|
1467
1468
|
parts: r
|
|
1468
1469
|
};
|
|
1469
|
-
} else if (ce(s.resourceType,
|
|
1470
|
+
} else if (ce(s.resourceType, Cn)) {
|
|
1470
1471
|
const t = e, r = {};
|
|
1471
1472
|
for (const o of s.listInputFields())
|
|
1472
1473
|
if (o.endsWith(".index")) {
|
|
@@ -1487,7 +1488,7 @@ function Cn(s) {
|
|
|
1487
1488
|
partitionKeyLength: t.partitionKeyLength,
|
|
1488
1489
|
parts: r
|
|
1489
1490
|
};
|
|
1490
|
-
} else if (ce(s.resourceType,
|
|
1491
|
+
} else if (ce(s.resourceType, Pn)) {
|
|
1491
1492
|
const t = e, r = {};
|
|
1492
1493
|
for (const o of s.listInputFields()) {
|
|
1493
1494
|
const n = s.traverse({ field: o, errorIfFieldNotSet: !0 }), i = n.listInputFields();
|
|
@@ -1521,9 +1522,9 @@ function Cn(s) {
|
|
|
1521
1522
|
parts: r
|
|
1522
1523
|
};
|
|
1523
1524
|
}
|
|
1524
|
-
throw new Error(`unsupported resource type: ${
|
|
1525
|
+
throw new Error(`unsupported resource type: ${Xs(s.resourceType)}`);
|
|
1525
1526
|
}
|
|
1526
|
-
function
|
|
1527
|
+
function $n(s, e) {
|
|
1527
1528
|
const t = s.axesSpec.length, r = {};
|
|
1528
1529
|
for (const { key: o, val: n } of e) {
|
|
1529
1530
|
if (o.length !== t)
|
|
@@ -1536,17 +1537,17 @@ function Pn(s, e) {
|
|
|
1536
1537
|
data: r
|
|
1537
1538
|
};
|
|
1538
1539
|
}
|
|
1539
|
-
function
|
|
1540
|
-
const t =
|
|
1541
|
-
return t.update(Z(s)), t.update(String(
|
|
1540
|
+
function Fn(s, e) {
|
|
1541
|
+
const t = Be("sha256");
|
|
1542
|
+
return t.update(Z(s)), t.update(String(Ze(e.originalId) ? e.id : e.originalId)), t.digest().toString("hex");
|
|
1542
1543
|
}
|
|
1543
|
-
function
|
|
1544
|
+
function mr(s, e) {
|
|
1544
1545
|
return Z({ __isRef: !0, blockId: s, name: e });
|
|
1545
1546
|
}
|
|
1546
|
-
function
|
|
1547
|
+
function In(s, e) {
|
|
1547
1548
|
return Z({ resolvePath: s, name: e });
|
|
1548
1549
|
}
|
|
1549
|
-
function
|
|
1550
|
+
function ps(s, e = !0, t = !1, r = "") {
|
|
1550
1551
|
var a, c, u;
|
|
1551
1552
|
const o = /^(?<name>.*)\.(?<type>spec|data)$/, n = /* @__PURE__ */ new Map();
|
|
1552
1553
|
for (const l of s.listInputFields()) {
|
|
@@ -1584,10 +1585,10 @@ function us(s, e = !0, t = !1, r = "") {
|
|
|
1584
1585
|
for (const [, l] of n) l.data === void 0 && (l.hasData = !1);
|
|
1585
1586
|
return { locked: i, results: n };
|
|
1586
1587
|
}
|
|
1587
|
-
function
|
|
1588
|
+
function An(s, e = !0, t = "", r) {
|
|
1588
1589
|
if (!s.getIsReadyOrError()) throw new Error("resource is not ready");
|
|
1589
|
-
const o =
|
|
1590
|
-
|
|
1590
|
+
const o = ps(s, e, !1, t);
|
|
1591
|
+
ao(o.locked);
|
|
1591
1592
|
const n = {};
|
|
1592
1593
|
for (const [i, a] of o.results) {
|
|
1593
1594
|
if (a.spec === void 0) throw new Error(`no spec for key ${i}`);
|
|
@@ -1595,9 +1596,9 @@ function On(s, e = !0, t = "", r) {
|
|
|
1595
1596
|
throw new Error(`no data for key ${i}`);
|
|
1596
1597
|
const c = a.data();
|
|
1597
1598
|
if (c === void 0) throw new Error(`no data for key ${i}`);
|
|
1598
|
-
if (!c.ok) throw
|
|
1599
|
+
if (!c.ok) throw io(c.error);
|
|
1599
1600
|
n[i] = {
|
|
1600
|
-
id: r.length === 0 ?
|
|
1601
|
+
id: r.length === 0 ? Fn(a.spec, c.value) : In(r, i),
|
|
1601
1602
|
spec: a.spec,
|
|
1602
1603
|
data: c.value
|
|
1603
1604
|
};
|
|
@@ -1638,8 +1639,8 @@ class Vt {
|
|
|
1638
1639
|
if (r === void 0) return;
|
|
1639
1640
|
const o = (a = (i = r.prod) == null ? void 0 : i.results) == null ? void 0 : a.get(t), n = (c = o == null ? void 0 : o.data) == null ? void 0 : c.call(o);
|
|
1640
1641
|
if (o !== void 0 && o.spec !== void 0 && n !== void 0)
|
|
1641
|
-
return
|
|
1642
|
-
id:
|
|
1642
|
+
return _r(n, (u) => ({
|
|
1643
|
+
id: mr(e, t),
|
|
1643
1644
|
spec: o.spec,
|
|
1644
1645
|
data: u
|
|
1645
1646
|
}));
|
|
@@ -1676,9 +1677,9 @@ class Vt {
|
|
|
1676
1677
|
if (c.spec !== void 0 && c.hasData === !0 && c.data !== void 0) {
|
|
1677
1678
|
const u = c.data();
|
|
1678
1679
|
u !== void 0 ? e.push({
|
|
1679
|
-
ref:
|
|
1680
|
+
ref: _e(i, a),
|
|
1680
1681
|
obj: {
|
|
1681
|
-
id: u.ok ?
|
|
1682
|
+
id: u.ok ? mr(i, a) : void 0,
|
|
1682
1683
|
spec: c.spec,
|
|
1683
1684
|
data: u
|
|
1684
1685
|
}
|
|
@@ -1712,7 +1713,7 @@ class Vt {
|
|
|
1712
1713
|
i.staging.locked || o(`staging_not_locked:${n}`);
|
|
1713
1714
|
for (const [c, u] of i.staging.results)
|
|
1714
1715
|
u.spec !== void 0 && (e.push({
|
|
1715
|
-
ref:
|
|
1716
|
+
ref: _e(n, c),
|
|
1716
1717
|
obj: u.spec
|
|
1717
1718
|
}), a.add(c));
|
|
1718
1719
|
} else o(`staging_not_rendered:${n}`);
|
|
@@ -1720,7 +1721,7 @@ class Vt {
|
|
|
1720
1721
|
i.prod.locked || o(`prod_not_locked:${n}`);
|
|
1721
1722
|
for (const [c, u] of i.prod.results)
|
|
1722
1723
|
a.has(c) || u.spec !== void 0 && e.push({
|
|
1723
|
-
ref:
|
|
1724
|
+
ref: _e(n, c),
|
|
1724
1725
|
obj: u.spec
|
|
1725
1726
|
});
|
|
1726
1727
|
}
|
|
@@ -1732,9 +1733,9 @@ class Vt {
|
|
|
1732
1733
|
for (const r of this.blocks.values()) {
|
|
1733
1734
|
const o = /* @__PURE__ */ new Set(), n = (i) => {
|
|
1734
1735
|
for (const [a, c] of i.results)
|
|
1735
|
-
o.has(a) || c.spec === void 0 || (o.add(a),
|
|
1736
|
+
o.has(a) || c.spec === void 0 || (o.add(a), Ls(e, c.spec) && t.push({
|
|
1736
1737
|
label: r.info.label + " / " + a,
|
|
1737
|
-
ref:
|
|
1738
|
+
ref: _e(r.info.id, a),
|
|
1738
1739
|
spec: c.spec
|
|
1739
1740
|
}));
|
|
1740
1741
|
};
|
|
@@ -1743,10 +1744,10 @@ class Vt {
|
|
|
1743
1744
|
return t;
|
|
1744
1745
|
}
|
|
1745
1746
|
static create(e, t, r) {
|
|
1746
|
-
const o = e.accessor(t).node(), n = B(o.getKeyValueAsJson(pe)), a =
|
|
1747
|
-
for (const u of
|
|
1747
|
+
const o = e.accessor(t).node(), n = B(o.getKeyValueAsJson(pe)), a = Ft(n).traverseIds("upstream", r), c = /* @__PURE__ */ new Map();
|
|
1748
|
+
for (const u of oe(n)) {
|
|
1748
1749
|
if (!a.has(u.id)) continue;
|
|
1749
|
-
const l =
|
|
1750
|
+
const l = vr(
|
|
1750
1751
|
o.traverse({
|
|
1751
1752
|
field: U(u.id, "prodCtx"),
|
|
1752
1753
|
ignoreError: !0,
|
|
@@ -1757,7 +1758,7 @@ class Vt {
|
|
|
1757
1758
|
field: U(u.id, "prodUiCtx"),
|
|
1758
1759
|
stableIfNotFound: !0
|
|
1759
1760
|
})
|
|
1760
|
-
), d =
|
|
1761
|
+
), d = vr(
|
|
1761
1762
|
o.traverse({
|
|
1762
1763
|
field: U(u.id, "stagingCtx"),
|
|
1763
1764
|
ignoreError: !0,
|
|
@@ -1772,10 +1773,10 @@ class Vt {
|
|
|
1772
1773
|
return new Vt(e, c);
|
|
1773
1774
|
}
|
|
1774
1775
|
}
|
|
1775
|
-
function
|
|
1776
|
+
function vr(s, e) {
|
|
1776
1777
|
if (e === void 0)
|
|
1777
1778
|
return s ? { locked: !1, results: /* @__PURE__ */ new Map() } : void 0;
|
|
1778
|
-
if (e.ok) return
|
|
1779
|
+
if (e.ok) return ps(e.value, !1, !0);
|
|
1779
1780
|
}
|
|
1780
1781
|
function Ut(s, e) {
|
|
1781
1782
|
return {
|
|
@@ -1793,15 +1794,15 @@ function Ut(s, e) {
|
|
|
1793
1794
|
stableIfNotFound: !0
|
|
1794
1795
|
})) == null ? void 0 : i.getDataAsString();
|
|
1795
1796
|
},
|
|
1796
|
-
uiState: (n) => n.accessor(s).node().getKeyValueAsString(
|
|
1797
|
+
uiState: (n) => n.accessor(s).node().getKeyValueAsString(Ct(e)),
|
|
1797
1798
|
blockMeta: (n) => {
|
|
1798
1799
|
const i = n.accessor(s).node(), a = B(i.getKeyValueAsJson(pe)), c = /* @__PURE__ */ new Map();
|
|
1799
|
-
for (const u of
|
|
1800
|
+
for (const u of oe(a)) c.set(u.id, u);
|
|
1800
1801
|
return c;
|
|
1801
1802
|
}
|
|
1802
1803
|
};
|
|
1803
1804
|
}
|
|
1804
|
-
function
|
|
1805
|
+
function hs(s, e) {
|
|
1805
1806
|
return {
|
|
1806
1807
|
...Ut(s, e),
|
|
1807
1808
|
prod: (t) => {
|
|
@@ -1875,15 +1876,15 @@ function* z(s, e) {
|
|
|
1875
1876
|
K(s);
|
|
1876
1877
|
}
|
|
1877
1878
|
}
|
|
1878
|
-
function
|
|
1879
|
+
function Tn(s, e) {
|
|
1879
1880
|
const t = {};
|
|
1880
1881
|
for (const [r, o] of Object.entries(s)) t[r] = e(o);
|
|
1881
1882
|
return t;
|
|
1882
1883
|
}
|
|
1883
|
-
function
|
|
1884
|
+
function Ie(s, e) {
|
|
1884
1885
|
return s === void 0 ? void 0 : e(s);
|
|
1885
1886
|
}
|
|
1886
|
-
function
|
|
1887
|
+
function Ln(s) {
|
|
1887
1888
|
switch (s.type) {
|
|
1888
1889
|
case "GetImportProgress":
|
|
1889
1890
|
return !0;
|
|
@@ -1891,60 +1892,60 @@ function In(s) {
|
|
|
1891
1892
|
return !1;
|
|
1892
1893
|
}
|
|
1893
1894
|
}
|
|
1894
|
-
function
|
|
1895
|
-
for (const e of z(s)) if (
|
|
1895
|
+
function Dn(s) {
|
|
1896
|
+
for (const e of z(s)) if (Ln(e)) return !0;
|
|
1896
1897
|
return !1;
|
|
1897
1898
|
}
|
|
1898
|
-
function
|
|
1899
|
+
function st(s) {
|
|
1899
1900
|
return {
|
|
1900
1901
|
type: "ReturnResult",
|
|
1901
1902
|
result: s
|
|
1902
1903
|
};
|
|
1903
1904
|
}
|
|
1904
1905
|
function P(s) {
|
|
1905
|
-
return () =>
|
|
1906
|
+
return () => st(s);
|
|
1906
1907
|
}
|
|
1907
|
-
const
|
|
1908
|
+
const Nn = (s) => {
|
|
1908
1909
|
const e = {};
|
|
1909
1910
|
for (const [t, r] of Object.entries(s)) e[t] = r;
|
|
1910
1911
|
return P(e);
|
|
1911
|
-
},
|
|
1912
|
+
}, Bn = (s) => {
|
|
1912
1913
|
const e = s.source;
|
|
1913
1914
|
if (e === void 0) return P(void 0);
|
|
1914
1915
|
const t = [];
|
|
1915
1916
|
for (const r of e)
|
|
1916
1917
|
r instanceof Array ? t.push(...r) : t.push(r);
|
|
1917
1918
|
return P(t);
|
|
1918
|
-
},
|
|
1919
|
+
}, xn = (s) => {
|
|
1919
1920
|
const e = s.source, t = s.field;
|
|
1920
1921
|
return e === void 0 || t === void 0 ? P(void 0) : ({ cCtx: r }) => {
|
|
1921
1922
|
var o;
|
|
1922
|
-
return
|
|
1923
|
+
return st((o = r.accessor(e).node().traverse(t)) == null ? void 0 : o.persist());
|
|
1923
1924
|
};
|
|
1924
1925
|
};
|
|
1925
|
-
function
|
|
1926
|
+
function fs(s, e) {
|
|
1926
1927
|
const t = {}, r = s.length;
|
|
1927
1928
|
for (let o = 0; o < r; o++) t[String(o)] = e(s[o]);
|
|
1928
1929
|
return t;
|
|
1929
1930
|
}
|
|
1930
|
-
function
|
|
1931
|
+
function jn(s, e) {
|
|
1931
1932
|
return (t) => {
|
|
1932
1933
|
const r = t.source;
|
|
1933
1934
|
return r === void 0 ? P(void 0) : () => ({
|
|
1934
1935
|
type: "ScheduleSubroutine",
|
|
1935
|
-
subroutine:
|
|
1936
|
-
args:
|
|
1936
|
+
subroutine: gs(r.length),
|
|
1937
|
+
args: fs(r, (o) => k({ ...s, [e.itVar]: o }, e.mapping))
|
|
1937
1938
|
});
|
|
1938
1939
|
};
|
|
1939
1940
|
}
|
|
1940
|
-
function
|
|
1941
|
+
function gs(s) {
|
|
1941
1942
|
return (e) => {
|
|
1942
1943
|
const t = [];
|
|
1943
1944
|
for (let r = 0; r < s; r++) t.push(e[String(r)]);
|
|
1944
1945
|
return P(t);
|
|
1945
1946
|
};
|
|
1946
1947
|
}
|
|
1947
|
-
function
|
|
1948
|
+
function Vn(s, e) {
|
|
1948
1949
|
return (t) => {
|
|
1949
1950
|
const r = t.source;
|
|
1950
1951
|
if (r === void 0) return P(void 0);
|
|
@@ -1955,34 +1956,34 @@ function Bn(s, e) {
|
|
|
1955
1956
|
}
|
|
1956
1957
|
return () => ({
|
|
1957
1958
|
type: "ScheduleSubroutine",
|
|
1958
|
-
subroutine:
|
|
1959
|
+
subroutine: Un,
|
|
1959
1960
|
args: o
|
|
1960
1961
|
});
|
|
1961
1962
|
};
|
|
1962
1963
|
}
|
|
1963
|
-
const
|
|
1964
|
+
const Un = (s) => P(s), Jn = (s) => {
|
|
1964
1965
|
const e = s.arg;
|
|
1965
1966
|
return P(e === void 0 ? void 0 : e.length === 0);
|
|
1966
|
-
},
|
|
1967
|
+
}, Gn = (s) => {
|
|
1967
1968
|
const e = s.operand;
|
|
1968
1969
|
return P(e === void 0 ? void 0 : !e);
|
|
1969
|
-
},
|
|
1970
|
+
}, Mn = (s) => {
|
|
1970
1971
|
const e = s.operand1, t = s.operand2;
|
|
1971
1972
|
return P(e === void 0 || t === void 0 ? void 0 : e && t);
|
|
1972
|
-
},
|
|
1973
|
+
}, _n = (s) => {
|
|
1973
1974
|
const e = s.operand1, t = s.operand2;
|
|
1974
1975
|
return P(e === void 0 || t === void 0 ? void 0 : e || t);
|
|
1975
|
-
},
|
|
1976
|
+
}, Kn = (s) => {
|
|
1976
1977
|
const e = s.source;
|
|
1977
1978
|
return e === void 0 ? P(void 0) : ({ cCtx: t }) => {
|
|
1978
1979
|
var r;
|
|
1979
|
-
return
|
|
1980
|
+
return st((r = t.accessor(e).node()) == null ? void 0 : r.getDataAsJson());
|
|
1980
1981
|
};
|
|
1981
|
-
},
|
|
1982
|
+
}, Hn = (s) => {
|
|
1982
1983
|
const e = s.source, t = s.field;
|
|
1983
1984
|
return P(e === void 0 || t === void 0 ? void 0 : e[t]);
|
|
1984
1985
|
};
|
|
1985
|
-
function
|
|
1986
|
+
function Wn(s, e) {
|
|
1986
1987
|
return (t) => {
|
|
1987
1988
|
const r = t.source;
|
|
1988
1989
|
return r === void 0 ? P(void 0) : ({ cCtx: o }) => {
|
|
@@ -1997,13 +1998,13 @@ function _n(s, e) {
|
|
|
1997
1998
|
}
|
|
1998
1999
|
return {
|
|
1999
2000
|
type: "ScheduleSubroutine",
|
|
2000
|
-
subroutine:
|
|
2001
|
+
subroutine: zn,
|
|
2001
2002
|
args: i
|
|
2002
2003
|
};
|
|
2003
2004
|
};
|
|
2004
2005
|
};
|
|
2005
2006
|
}
|
|
2006
|
-
const
|
|
2007
|
+
const zn = (s) => P(s), Xn = (s) => {
|
|
2007
2008
|
const e = s.source;
|
|
2008
2009
|
return e === void 0 ? P(void 0) : ({ drivers: t }) => ({
|
|
2009
2010
|
type: "ScheduleComputable",
|
|
@@ -2017,7 +2018,7 @@ const Kn = (s) => P(s), Hn = (s) => {
|
|
|
2017
2018
|
}
|
|
2018
2019
|
)
|
|
2019
2020
|
});
|
|
2020
|
-
},
|
|
2021
|
+
}, qn = (s) => {
|
|
2021
2022
|
const e = s.source;
|
|
2022
2023
|
return e === void 0 ? P(void 0) : ({ cCtx: t, drivers: r }) => {
|
|
2023
2024
|
const o = t.accessor(e).node().resourceInfo;
|
|
@@ -2028,7 +2029,7 @@ const Kn = (s) => P(s), Hn = (s) => {
|
|
|
2028
2029
|
})
|
|
2029
2030
|
};
|
|
2030
2031
|
};
|
|
2031
|
-
},
|
|
2032
|
+
}, Yn = (s) => {
|
|
2032
2033
|
const e = s.source;
|
|
2033
2034
|
return e === void 0 ? P(void 0) : ({ drivers: t }) => ({
|
|
2034
2035
|
type: "ScheduleComputable",
|
|
@@ -2044,49 +2045,49 @@ const Kn = (s) => P(s), Hn = (s) => {
|
|
|
2044
2045
|
}
|
|
2045
2046
|
)
|
|
2046
2047
|
});
|
|
2047
|
-
},
|
|
2048
|
+
}, Qn = (s) => {
|
|
2048
2049
|
const e = s.source;
|
|
2049
2050
|
return e === void 0 ? P(void 0) : ({ drivers: t }) => ({
|
|
2050
2051
|
type: "ScheduleComputable",
|
|
2051
2052
|
computable: t.blobDriver.getDownloadedBlob(e)
|
|
2052
2053
|
});
|
|
2053
|
-
},
|
|
2054
|
+
}, Zn = (s) => {
|
|
2054
2055
|
const e = s.source;
|
|
2055
2056
|
return e === void 0 ? P(void 0) : ({ drivers: t }) => ({
|
|
2056
2057
|
type: "ScheduleComputable",
|
|
2057
2058
|
computable: t.blobDriver.getOnDemandBlob(e)
|
|
2058
2059
|
});
|
|
2059
|
-
},
|
|
2060
|
+
}, ei = (s) => (e) => {
|
|
2060
2061
|
const t = e.source;
|
|
2061
2062
|
return t === void 0 ? P(void 0) : ({ drivers: r }) => ({
|
|
2062
2063
|
type: "ScheduleComputable",
|
|
2063
2064
|
computable: r.blobToURLDriver.extractArchiveAndGetURL(t, s)
|
|
2064
2065
|
});
|
|
2065
|
-
},
|
|
2066
|
+
}, ti = (s) => {
|
|
2066
2067
|
const e = s.source;
|
|
2067
2068
|
return e === void 0 ? P(void 0) : ({ drivers: t }) => ({
|
|
2068
2069
|
type: "ScheduleComputable",
|
|
2069
2070
|
computable: t.uploadDriver.getProgressId(e)
|
|
2070
2071
|
});
|
|
2071
|
-
},
|
|
2072
|
+
}, ri = (s) => (e) => {
|
|
2072
2073
|
const t = e.source;
|
|
2073
2074
|
return t === void 0 ? P(void 0) : ({ drivers: r }) => ({
|
|
2074
2075
|
type: "ScheduleComputable",
|
|
2075
2076
|
computable: r.logDriver.getLastLogs(t, s)
|
|
2076
2077
|
});
|
|
2077
|
-
},
|
|
2078
|
+
}, si = (s) => (e) => {
|
|
2078
2079
|
const t = e.source;
|
|
2079
2080
|
return t === void 0 ? P(void 0) : ({ drivers: r }) => ({
|
|
2080
2081
|
type: "ScheduleComputable",
|
|
2081
2082
|
computable: r.logDriver.getProgressLog(t, s)
|
|
2082
2083
|
});
|
|
2083
|
-
},
|
|
2084
|
+
}, oi = (s) => (e) => {
|
|
2084
2085
|
const t = e.source;
|
|
2085
2086
|
return t === void 0 ? P(void 0) : ({ drivers: r }) => ({
|
|
2086
2087
|
type: "ScheduleComputable",
|
|
2087
2088
|
computable: r.logDriver.getProgressLogWithInfo(t, s)
|
|
2088
2089
|
});
|
|
2089
|
-
},
|
|
2090
|
+
}, ni = (s) => {
|
|
2090
2091
|
const e = s.source;
|
|
2091
2092
|
return e === void 0 ? P(void 0) : ({ drivers: t }) => ({
|
|
2092
2093
|
type: "ScheduleComputable",
|
|
@@ -2097,19 +2098,19 @@ function k(s, e) {
|
|
|
2097
2098
|
switch (e.type) {
|
|
2098
2099
|
case "GetFromCtx": {
|
|
2099
2100
|
const t = s[e.variable];
|
|
2100
|
-
return typeof t == "function" ? (r) =>
|
|
2101
|
+
return typeof t == "function" ? (r) => st(t(r.cCtx)) : P(t);
|
|
2101
2102
|
}
|
|
2102
2103
|
case "Isolate":
|
|
2103
2104
|
return ({ drivers: t }) => ({
|
|
2104
2105
|
type: "ScheduleComputable",
|
|
2105
|
-
computable:
|
|
2106
|
+
computable: ys(t, s, e.cfg)
|
|
2106
2107
|
});
|
|
2107
2108
|
case "Immediate":
|
|
2108
2109
|
return P(e.value);
|
|
2109
2110
|
case "GetJsonField":
|
|
2110
2111
|
return () => ({
|
|
2111
2112
|
type: "ScheduleSubroutine",
|
|
2112
|
-
subroutine:
|
|
2113
|
+
subroutine: Hn,
|
|
2113
2114
|
args: {
|
|
2114
2115
|
source: k(s, e.source),
|
|
2115
2116
|
field: k(s, e.field)
|
|
@@ -2118,7 +2119,7 @@ function k(s, e) {
|
|
|
2118
2119
|
case "MapArrayValues":
|
|
2119
2120
|
return () => ({
|
|
2120
2121
|
type: "ScheduleSubroutine",
|
|
2121
|
-
subroutine:
|
|
2122
|
+
subroutine: jn(s, e),
|
|
2122
2123
|
args: {
|
|
2123
2124
|
source: k(s, e.source)
|
|
2124
2125
|
}
|
|
@@ -2126,7 +2127,7 @@ function k(s, e) {
|
|
|
2126
2127
|
case "MapRecordValues":
|
|
2127
2128
|
return () => ({
|
|
2128
2129
|
type: "ScheduleSubroutine",
|
|
2129
|
-
subroutine:
|
|
2130
|
+
subroutine: Vn(s, e),
|
|
2130
2131
|
args: {
|
|
2131
2132
|
source: k(s, e.source)
|
|
2132
2133
|
}
|
|
@@ -2134,19 +2135,19 @@ function k(s, e) {
|
|
|
2134
2135
|
case "MakeObject":
|
|
2135
2136
|
return () => ({
|
|
2136
2137
|
type: "ScheduleSubroutine",
|
|
2137
|
-
subroutine:
|
|
2138
|
-
args:
|
|
2138
|
+
subroutine: Nn,
|
|
2139
|
+
args: Tn(e.template, (t) => k(s, t))
|
|
2139
2140
|
});
|
|
2140
2141
|
case "MakeArray":
|
|
2141
2142
|
return () => ({
|
|
2142
2143
|
type: "ScheduleSubroutine",
|
|
2143
|
-
subroutine:
|
|
2144
|
-
args:
|
|
2144
|
+
subroutine: gs(e.template.length),
|
|
2145
|
+
args: fs(e.template, (t) => k(s, t))
|
|
2145
2146
|
});
|
|
2146
2147
|
case "Flatten":
|
|
2147
2148
|
return () => ({
|
|
2148
2149
|
type: "ScheduleSubroutine",
|
|
2149
|
-
subroutine:
|
|
2150
|
+
subroutine: Bn,
|
|
2150
2151
|
args: {
|
|
2151
2152
|
source: k(s, e.source)
|
|
2152
2153
|
}
|
|
@@ -2154,7 +2155,7 @@ function k(s, e) {
|
|
|
2154
2155
|
case "IsEmpty":
|
|
2155
2156
|
return () => ({
|
|
2156
2157
|
type: "ScheduleSubroutine",
|
|
2157
|
-
subroutine:
|
|
2158
|
+
subroutine: Jn,
|
|
2158
2159
|
args: {
|
|
2159
2160
|
arg: k(s, e.arg)
|
|
2160
2161
|
}
|
|
@@ -2162,7 +2163,7 @@ function k(s, e) {
|
|
|
2162
2163
|
case "Not":
|
|
2163
2164
|
return () => ({
|
|
2164
2165
|
type: "ScheduleSubroutine",
|
|
2165
|
-
subroutine:
|
|
2166
|
+
subroutine: Gn,
|
|
2166
2167
|
args: {
|
|
2167
2168
|
operand: k(s, e.operand)
|
|
2168
2169
|
}
|
|
@@ -2170,7 +2171,7 @@ function k(s, e) {
|
|
|
2170
2171
|
case "And":
|
|
2171
2172
|
return () => ({
|
|
2172
2173
|
type: "ScheduleSubroutine",
|
|
2173
|
-
subroutine:
|
|
2174
|
+
subroutine: Mn,
|
|
2174
2175
|
args: {
|
|
2175
2176
|
operand1: k(s, e.operand1),
|
|
2176
2177
|
operand2: k(s, e.operand2)
|
|
@@ -2179,7 +2180,7 @@ function k(s, e) {
|
|
|
2179
2180
|
case "Or":
|
|
2180
2181
|
return () => ({
|
|
2181
2182
|
type: "ScheduleSubroutine",
|
|
2182
|
-
subroutine:
|
|
2183
|
+
subroutine: _n,
|
|
2183
2184
|
args: {
|
|
2184
2185
|
operand1: k(s, e.operand1),
|
|
2185
2186
|
operand2: k(s, e.operand2)
|
|
@@ -2188,7 +2189,7 @@ function k(s, e) {
|
|
|
2188
2189
|
case "MapResourceFields":
|
|
2189
2190
|
return () => ({
|
|
2190
2191
|
type: "ScheduleSubroutine",
|
|
2191
|
-
subroutine:
|
|
2192
|
+
subroutine: Wn(s, e),
|
|
2192
2193
|
args: {
|
|
2193
2194
|
source: k(s, e.source)
|
|
2194
2195
|
}
|
|
@@ -2196,7 +2197,7 @@ function k(s, e) {
|
|
|
2196
2197
|
case "GetResourceField":
|
|
2197
2198
|
return () => ({
|
|
2198
2199
|
type: "ScheduleSubroutine",
|
|
2199
|
-
subroutine:
|
|
2200
|
+
subroutine: xn,
|
|
2200
2201
|
args: {
|
|
2201
2202
|
source: k(s, e.source),
|
|
2202
2203
|
field: k(s, e.field)
|
|
@@ -2205,7 +2206,7 @@ function k(s, e) {
|
|
|
2205
2206
|
case "GetResourceValueAsJson":
|
|
2206
2207
|
return () => ({
|
|
2207
2208
|
type: "ScheduleSubroutine",
|
|
2208
|
-
subroutine:
|
|
2209
|
+
subroutine: Kn,
|
|
2209
2210
|
args: {
|
|
2210
2211
|
source: k(s, e.source)
|
|
2211
2212
|
}
|
|
@@ -2213,7 +2214,7 @@ function k(s, e) {
|
|
|
2213
2214
|
case "GetBlobContent":
|
|
2214
2215
|
return () => ({
|
|
2215
2216
|
type: "ScheduleSubroutine",
|
|
2216
|
-
subroutine:
|
|
2217
|
+
subroutine: Xn,
|
|
2217
2218
|
args: {
|
|
2218
2219
|
source: k(s, e.source)
|
|
2219
2220
|
}
|
|
@@ -2221,7 +2222,7 @@ function k(s, e) {
|
|
|
2221
2222
|
case "GetBlobContentAsString":
|
|
2222
2223
|
return () => ({
|
|
2223
2224
|
type: "ScheduleSubroutine",
|
|
2224
|
-
subroutine:
|
|
2225
|
+
subroutine: qn,
|
|
2225
2226
|
args: {
|
|
2226
2227
|
source: k(s, e.source)
|
|
2227
2228
|
}
|
|
@@ -2229,7 +2230,7 @@ function k(s, e) {
|
|
|
2229
2230
|
case "GetBlobContentAsJson":
|
|
2230
2231
|
return () => ({
|
|
2231
2232
|
type: "ScheduleSubroutine",
|
|
2232
|
-
subroutine:
|
|
2233
|
+
subroutine: Yn,
|
|
2233
2234
|
args: {
|
|
2234
2235
|
source: k(s, e.source)
|
|
2235
2236
|
}
|
|
@@ -2237,7 +2238,7 @@ function k(s, e) {
|
|
|
2237
2238
|
case "GetDownloadedBlobContent":
|
|
2238
2239
|
return () => ({
|
|
2239
2240
|
type: "ScheduleSubroutine",
|
|
2240
|
-
subroutine:
|
|
2241
|
+
subroutine: Qn,
|
|
2241
2242
|
args: {
|
|
2242
2243
|
source: k(s, e.source)
|
|
2243
2244
|
}
|
|
@@ -2245,7 +2246,7 @@ function k(s, e) {
|
|
|
2245
2246
|
case "GetOnDemandBlobContent":
|
|
2246
2247
|
return () => ({
|
|
2247
2248
|
type: "ScheduleSubroutine",
|
|
2248
|
-
subroutine:
|
|
2249
|
+
subroutine: Zn,
|
|
2249
2250
|
args: {
|
|
2250
2251
|
source: k(s, e.source)
|
|
2251
2252
|
}
|
|
@@ -2253,7 +2254,7 @@ function k(s, e) {
|
|
|
2253
2254
|
case "ExtractArchiveAndGetURL":
|
|
2254
2255
|
return () => ({
|
|
2255
2256
|
type: "ScheduleSubroutine",
|
|
2256
|
-
subroutine:
|
|
2257
|
+
subroutine: ei(e.format),
|
|
2257
2258
|
args: {
|
|
2258
2259
|
source: k(s, e.source)
|
|
2259
2260
|
}
|
|
@@ -2261,7 +2262,7 @@ function k(s, e) {
|
|
|
2261
2262
|
case "GetImportProgress":
|
|
2262
2263
|
return () => ({
|
|
2263
2264
|
type: "ScheduleSubroutine",
|
|
2264
|
-
subroutine:
|
|
2265
|
+
subroutine: ti,
|
|
2265
2266
|
args: {
|
|
2266
2267
|
source: k(s, e.source)
|
|
2267
2268
|
}
|
|
@@ -2269,7 +2270,7 @@ function k(s, e) {
|
|
|
2269
2270
|
case "GetLastLogs":
|
|
2270
2271
|
return () => ({
|
|
2271
2272
|
type: "ScheduleSubroutine",
|
|
2272
|
-
subroutine:
|
|
2273
|
+
subroutine: ri(e.lines),
|
|
2273
2274
|
args: {
|
|
2274
2275
|
source: k(s, e.source)
|
|
2275
2276
|
}
|
|
@@ -2277,7 +2278,7 @@ function k(s, e) {
|
|
|
2277
2278
|
case "GetProgressLog":
|
|
2278
2279
|
return () => ({
|
|
2279
2280
|
type: "ScheduleSubroutine",
|
|
2280
|
-
subroutine:
|
|
2281
|
+
subroutine: si(e.patternToSearch),
|
|
2281
2282
|
args: {
|
|
2282
2283
|
source: k(s, e.source)
|
|
2283
2284
|
}
|
|
@@ -2285,7 +2286,7 @@ function k(s, e) {
|
|
|
2285
2286
|
case "GetProgressLogWithInfo":
|
|
2286
2287
|
return () => ({
|
|
2287
2288
|
type: "ScheduleSubroutine",
|
|
2288
|
-
subroutine:
|
|
2289
|
+
subroutine: oi(e.patternToSearch),
|
|
2289
2290
|
args: {
|
|
2290
2291
|
source: k(s, e.source)
|
|
2291
2292
|
}
|
|
@@ -2293,7 +2294,7 @@ function k(s, e) {
|
|
|
2293
2294
|
case "GetLogHandle":
|
|
2294
2295
|
return () => ({
|
|
2295
2296
|
type: "ScheduleSubroutine",
|
|
2296
|
-
subroutine:
|
|
2297
|
+
subroutine: ni,
|
|
2297
2298
|
args: {
|
|
2298
2299
|
source: k(s, e.source)
|
|
2299
2300
|
}
|
|
@@ -2302,8 +2303,8 @@ function k(s, e) {
|
|
|
2302
2303
|
return K(e);
|
|
2303
2304
|
}
|
|
2304
2305
|
}
|
|
2305
|
-
const
|
|
2306
|
-
function
|
|
2306
|
+
const ii = ["$prod", "$staging"];
|
|
2307
|
+
function ai(s) {
|
|
2307
2308
|
return {
|
|
2308
2309
|
$blockId: s.blockId,
|
|
2309
2310
|
$args: (e) => JSON.parse(s.args(e)),
|
|
@@ -2315,16 +2316,16 @@ function oi(s) {
|
|
|
2315
2316
|
$staging: s.staging
|
|
2316
2317
|
};
|
|
2317
2318
|
}
|
|
2318
|
-
const
|
|
2319
|
-
function
|
|
2320
|
-
return s.op ==
|
|
2319
|
+
const ms = Symbol(), vs = "return", ci = { op: ms, arg: vs };
|
|
2320
|
+
function li(s) {
|
|
2321
|
+
return s.op == ms && s.arg == vs;
|
|
2321
2322
|
}
|
|
2322
|
-
function
|
|
2323
|
+
function ui() {
|
|
2323
2324
|
return { pendingSubroutines: /* @__PURE__ */ new Map() };
|
|
2324
2325
|
}
|
|
2325
|
-
function
|
|
2326
|
-
const o = new
|
|
2327
|
-
if (
|
|
2326
|
+
function yr(s, e, t, r) {
|
|
2327
|
+
const o = new Yr(t), n = (a, c) => {
|
|
2328
|
+
if (li(a))
|
|
2328
2329
|
return e.result = c, !1;
|
|
2329
2330
|
const u = B(e.pendingSubroutines.get(a.op));
|
|
2330
2331
|
if (a.arg in u.args) throw new Error("argument already set");
|
|
@@ -2376,26 +2377,26 @@ function vr(s, e, t, r) {
|
|
|
2376
2377
|
}
|
|
2377
2378
|
return i;
|
|
2378
2379
|
}
|
|
2379
|
-
function
|
|
2380
|
-
return
|
|
2380
|
+
function di(s, e, t, r = {}) {
|
|
2381
|
+
return ys(s, ai(e), t, r);
|
|
2381
2382
|
}
|
|
2382
|
-
function
|
|
2383
|
+
function ys(s, e, t, r = {}) {
|
|
2383
2384
|
const o = `${e.blockId}#` + Z({
|
|
2384
2385
|
ctx: Object.fromEntries(
|
|
2385
|
-
Object.entries(e).filter(([n]) =>
|
|
2386
|
+
Object.entries(e).filter(([n]) => ii.indexOf(n) === -1)
|
|
2386
2387
|
),
|
|
2387
2388
|
cfg: t
|
|
2388
2389
|
});
|
|
2389
2390
|
return J.makeRaw(
|
|
2390
2391
|
(n) => {
|
|
2391
|
-
const i = { drivers: s, cCtx: n }, a =
|
|
2392
|
+
const i = { drivers: s, cCtx: n }, a = ui();
|
|
2392
2393
|
return {
|
|
2393
|
-
ir:
|
|
2394
|
+
ir: yr(
|
|
2394
2395
|
i,
|
|
2395
2396
|
a,
|
|
2396
2397
|
[
|
|
2397
2398
|
{
|
|
2398
|
-
destination:
|
|
2399
|
+
destination: ci,
|
|
2399
2400
|
operation: k(e, t)
|
|
2400
2401
|
}
|
|
2401
2402
|
],
|
|
@@ -2417,7 +2418,7 @@ function ms(s, e, t, r = {}) {
|
|
|
2417
2418
|
result: a.result,
|
|
2418
2419
|
pendingSubroutines: f
|
|
2419
2420
|
};
|
|
2420
|
-
if (
|
|
2421
|
+
if (yr(d, h, l, !1), !("result" in h))
|
|
2421
2422
|
throw new Error("illegal cfg rendering stack state, no result");
|
|
2422
2423
|
return h.result;
|
|
2423
2424
|
}
|
|
@@ -2426,13 +2427,13 @@ function ms(s, e, t, r = {}) {
|
|
|
2426
2427
|
{ ...r, key: o }
|
|
2427
2428
|
);
|
|
2428
2429
|
}
|
|
2429
|
-
function
|
|
2430
|
+
function pi(s) {
|
|
2430
2431
|
return s instanceof ArrayBuffer || ArrayBuffer.isView(s);
|
|
2431
2432
|
}
|
|
2432
|
-
function
|
|
2433
|
+
function wr(s) {
|
|
2433
2434
|
return s !== void 0 ? Buffer.from(s).toString("base64") : void 0;
|
|
2434
2435
|
}
|
|
2435
|
-
class
|
|
2436
|
+
class rt {
|
|
2436
2437
|
constructor(e, t, r, o, n) {
|
|
2437
2438
|
w(this, "callbackRegistry");
|
|
2438
2439
|
w(this, "fnJSONStringify");
|
|
@@ -2441,7 +2442,7 @@ class tt {
|
|
|
2441
2442
|
w(this, "computableCtx");
|
|
2442
2443
|
w(this, "accessors", /* @__PURE__ */ new Map());
|
|
2443
2444
|
w(this, "meta");
|
|
2444
|
-
w(this, "errorRepo", new
|
|
2445
|
+
w(this, "errorRepo", new hi());
|
|
2445
2446
|
//
|
|
2446
2447
|
// Result Pool
|
|
2447
2448
|
//
|
|
@@ -2465,12 +2466,12 @@ class tt {
|
|
|
2465
2466
|
try {
|
|
2466
2467
|
this.vm.unwrapResult(this.vm.evalCode(e, "bundle.js", { type: "global" })).dispose();
|
|
2467
2468
|
} catch (t) {
|
|
2468
|
-
throw
|
|
2469
|
+
throw rt.cleanErrorContext(t), t;
|
|
2469
2470
|
}
|
|
2470
2471
|
}
|
|
2471
2472
|
runCallback(e, ...t) {
|
|
2472
2473
|
try {
|
|
2473
|
-
return
|
|
2474
|
+
return Et.withScope((r) => {
|
|
2474
2475
|
const o = r.manage(this.vm.getProp(this.callbackRegistry, e));
|
|
2475
2476
|
if (this.vm.typeof(o) !== "function")
|
|
2476
2477
|
throw new Error(`No such callback: ${e}`);
|
|
@@ -2485,7 +2486,7 @@ class tt {
|
|
|
2485
2486
|
);
|
|
2486
2487
|
});
|
|
2487
2488
|
} catch (r) {
|
|
2488
|
-
throw
|
|
2489
|
+
throw rt.cleanErrorContext(r), this.errorRepo.getOriginal(r);
|
|
2489
2490
|
}
|
|
2490
2491
|
}
|
|
2491
2492
|
//
|
|
@@ -2540,13 +2541,13 @@ class tt {
|
|
|
2540
2541
|
return this.getAccessor(e).listDynamicFields();
|
|
2541
2542
|
}
|
|
2542
2543
|
getKeyValueBase64(e, t) {
|
|
2543
|
-
return
|
|
2544
|
+
return wr(this.getAccessor(e).getKeyValue(t));
|
|
2544
2545
|
}
|
|
2545
2546
|
getKeyValueAsString(e, t) {
|
|
2546
2547
|
return this.getAccessor(e).getKeyValueAsString(t);
|
|
2547
2548
|
}
|
|
2548
2549
|
getDataBase64(e) {
|
|
2549
|
-
return
|
|
2550
|
+
return wr(this.getAccessor(e).getData());
|
|
2550
2551
|
}
|
|
2551
2552
|
getDataAsString(e) {
|
|
2552
2553
|
return this.getAccessor(e).getDataAsString();
|
|
@@ -2557,7 +2558,7 @@ class tt {
|
|
|
2557
2558
|
parsePObjectCollection(e, t, r, ...o) {
|
|
2558
2559
|
const n = this.getAccessor(e);
|
|
2559
2560
|
if (!n.getIsReadyOrError()) return;
|
|
2560
|
-
const i =
|
|
2561
|
+
const i = An(n, t, r, o), a = {};
|
|
2561
2562
|
for (const [c, u] of Object.entries(i))
|
|
2562
2563
|
a[c] = le(u, (l) => this.wrapAccessor(l));
|
|
2563
2564
|
return a;
|
|
@@ -2566,7 +2567,7 @@ class tt {
|
|
|
2566
2567
|
// Blobs
|
|
2567
2568
|
//
|
|
2568
2569
|
registerComputable(e, t) {
|
|
2569
|
-
const r = `${e}_${
|
|
2570
|
+
const r = `${e}_${Se()}`;
|
|
2570
2571
|
return this.computablesToResolve[r] = t, r;
|
|
2571
2572
|
}
|
|
2572
2573
|
getBlobContentAsString(e) {
|
|
@@ -2705,7 +2706,7 @@ class tt {
|
|
|
2705
2706
|
obj: {
|
|
2706
2707
|
id: t.obj.id,
|
|
2707
2708
|
spec: t.obj.spec,
|
|
2708
|
-
data:
|
|
2709
|
+
data: _r(t.obj.data, (r) => this.wrapAccessor(r))
|
|
2709
2710
|
}
|
|
2710
2711
|
}))
|
|
2711
2712
|
};
|
|
@@ -2742,7 +2743,7 @@ class tt {
|
|
|
2742
2743
|
"can't instantiate PTable from this context (most porbably called from the future mapper)"
|
|
2743
2744
|
);
|
|
2744
2745
|
return this.env.driverKit.pFrameDriver.createPTable(
|
|
2745
|
-
|
|
2746
|
+
St(
|
|
2746
2747
|
e,
|
|
2747
2748
|
(t) => le(t, (r) => typeof r == "string" ? this.getAccessor(r) : r)
|
|
2748
2749
|
),
|
|
@@ -2766,7 +2767,7 @@ class tt {
|
|
|
2766
2767
|
}
|
|
2767
2768
|
wrapAccessor(e) {
|
|
2768
2769
|
if (e !== void 0) {
|
|
2769
|
-
const t =
|
|
2770
|
+
const t = Se();
|
|
2770
2771
|
return this.accessors.set(t, e), t;
|
|
2771
2772
|
}
|
|
2772
2773
|
}
|
|
@@ -2799,7 +2800,7 @@ class tt {
|
|
|
2799
2800
|
r = this.vm.null;
|
|
2800
2801
|
break;
|
|
2801
2802
|
}
|
|
2802
|
-
if (
|
|
2803
|
+
if (pi(e)) {
|
|
2803
2804
|
r = this.vm.newArrayBuffer(e), o = !0;
|
|
2804
2805
|
break;
|
|
2805
2806
|
}
|
|
@@ -2835,12 +2836,12 @@ class tt {
|
|
|
2835
2836
|
return JSON.parse(t);
|
|
2836
2837
|
}
|
|
2837
2838
|
injectCtx() {
|
|
2838
|
-
|
|
2839
|
+
Et.withScope((e) => {
|
|
2839
2840
|
const t = e.manage(this.vm.newObject()), r = this.blockCtx.args(this.computableCtx), o = this.blockCtx.activeArgs(this.computableCtx), n = this.blockCtx.uiState(this.computableCtx);
|
|
2840
2841
|
this.vm.setProp(t, "args", e.manage(this.vm.newString(r))), n !== void 0 && this.vm.setProp(t, "uiState", e.manage(this.vm.newString(n))), o !== void 0 && this.vm.setProp(t, "activeArgs", e.manage(this.vm.newString(o))), this.vm.setProp(t, "callbackRegistry", this.callbackRegistry), this.vm.setProp(
|
|
2841
2842
|
t,
|
|
2842
2843
|
"featureFlags",
|
|
2843
|
-
this.exportObjectUniversal(
|
|
2844
|
+
this.exportObjectUniversal(Ds.GlobalCfgRenderCtxFeatureFlags, e)
|
|
2844
2845
|
);
|
|
2845
2846
|
const i = (a, c) => {
|
|
2846
2847
|
const u = (...l) => {
|
|
@@ -2933,13 +2934,13 @@ class tt {
|
|
|
2933
2934
|
});
|
|
2934
2935
|
}
|
|
2935
2936
|
}
|
|
2936
|
-
class
|
|
2937
|
+
class hi {
|
|
2937
2938
|
constructor() {
|
|
2938
2939
|
w(this, "errorIdToError", /* @__PURE__ */ new Map());
|
|
2939
2940
|
}
|
|
2940
2941
|
/** Sets the error to the repository and returns a mimicrated error that also has uuid key of the original error. */
|
|
2941
2942
|
setAndRecreateForQuickJS(e) {
|
|
2942
|
-
const t =
|
|
2943
|
+
const t = Se();
|
|
2943
2944
|
return this.errorIdToError.set(t, e), e instanceof Error ? {
|
|
2944
2945
|
name: `${e.name}/uuid:${t}`,
|
|
2945
2946
|
message: e.message
|
|
@@ -2950,20 +2951,20 @@ class ui {
|
|
|
2950
2951
|
}
|
|
2951
2952
|
/** Returns the original error that was stored by parsing uuid of mimicrated error. */
|
|
2952
2953
|
getOriginal(e) {
|
|
2953
|
-
if (!(e instanceof
|
|
2954
|
-
return console.warn("ErrorRepo: quickJSError is not a QuickJSUnwrapError",
|
|
2954
|
+
if (!(e instanceof co.QuickJSUnwrapError))
|
|
2955
|
+
return console.warn("ErrorRepo: quickJSError is not a QuickJSUnwrapError", Ue(e)), e;
|
|
2955
2956
|
if (!("name" in e.cause))
|
|
2956
|
-
return console.warn("ErrorRepo: quickJSError.cause is not an Error",
|
|
2957
|
+
return console.warn("ErrorRepo: quickJSError.cause is not an Error", Ue(e)), e;
|
|
2957
2958
|
const t = e.cause.name, r = t.slice(t.indexOf("/uuid:") + 6);
|
|
2958
2959
|
if (!r)
|
|
2959
|
-
throw new Error(`ErrorRepo: quickJSError.cause.name does not contain errorId: ${t}, ${
|
|
2960
|
+
throw new Error(`ErrorRepo: quickJSError.cause.name does not contain errorId: ${t}, ${Ue(e)}`);
|
|
2960
2961
|
const o = this.errorIdToError.get(r);
|
|
2961
2962
|
if (o === void 0)
|
|
2962
|
-
throw new Error(`ErrorRepo: errorId not found: ${r}, ${
|
|
2963
|
-
return new
|
|
2963
|
+
throw new Error(`ErrorRepo: errorId not found: ${r}, ${Ue(e)}`);
|
|
2964
|
+
return new fi(e, o);
|
|
2964
2965
|
}
|
|
2965
2966
|
}
|
|
2966
|
-
class
|
|
2967
|
+
class fi extends Error {
|
|
2967
2968
|
constructor(t, r) {
|
|
2968
2969
|
var o;
|
|
2969
2970
|
super("", { cause: r });
|
|
@@ -2978,8 +2979,8 @@ ${this.stack}
|
|
|
2978
2979
|
`;
|
|
2979
2980
|
}
|
|
2980
2981
|
}
|
|
2981
|
-
function
|
|
2982
|
-
return
|
|
2982
|
+
function ot(s, e) {
|
|
2983
|
+
return Ie(
|
|
2983
2984
|
s.traverse(
|
|
2984
2985
|
{
|
|
2985
2986
|
field: U(e, "blockPack"),
|
|
@@ -2989,53 +2990,53 @@ function st(s, e) {
|
|
|
2989
2990
|
{ field: A.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 }
|
|
2990
2991
|
),
|
|
2991
2992
|
(t) => {
|
|
2992
|
-
const r = t.getDataAsJson(), o =
|
|
2993
|
+
const r = t.getDataAsJson(), o = Kr(r.config);
|
|
2993
2994
|
return { bpId: t.resourceInfo.id.toString(), info: r, cfg: o };
|
|
2994
2995
|
}
|
|
2995
2996
|
);
|
|
2996
2997
|
}
|
|
2997
|
-
const
|
|
2998
|
-
function
|
|
2998
|
+
const He = process.env.MI_LOG_OUTPUT_STATUS;
|
|
2999
|
+
function gi(s, e, t, r, o, n = {}) {
|
|
2999
3000
|
const i = `${e.blockId}#lambda#${o}#${t.handle}`;
|
|
3000
3001
|
return n = { ...n, key: i }, n.mode === void 0 && t.retentive === !0 && (n.mode = "StableOnlyRetentive"), J.makeRaw((a) => {
|
|
3001
|
-
const c = new
|
|
3002
|
+
const c = new Et();
|
|
3002
3003
|
a.addOnDestroy(() => c.dispose());
|
|
3003
3004
|
const u = c.manage(s.quickJs.newRuntime());
|
|
3004
3005
|
u.setMemoryLimit(1024 * 1024 * 8), u.setMaxStackSize(1024 * 320);
|
|
3005
|
-
const l = c.manage(u.newContext()), d = new
|
|
3006
|
+
const l = c.manage(u.newContext()), d = new rt(c, l, e, s, a);
|
|
3006
3007
|
d.evaluateBundle(r.content);
|
|
3007
3008
|
const f = d.runCallback(t.handle);
|
|
3008
3009
|
d.resetComputableCtx();
|
|
3009
3010
|
let h = 0;
|
|
3010
|
-
return
|
|
3011
|
+
return He && He !== "unstable-only" && console.log(`Output ${t.handle} scaffold calculated.`), {
|
|
3011
3012
|
ir: d.computablesToResolve,
|
|
3012
3013
|
postprocessValue: (E, { unstableMarker: g, stable: D }) => {
|
|
3013
|
-
for (const [j,
|
|
3014
|
+
for (const [j, $] of Object.entries(E)) d.runCallback(j, $);
|
|
3014
3015
|
const T = d.importObjectUniversal(f);
|
|
3015
|
-
return h++,
|
|
3016
|
+
return h++, He && (He !== "unstable-only" || !D) && console.log(
|
|
3016
3017
|
D ? `Stable output ${t.handle} calculated ${T !== void 0 ? "defined" : "undefined"}; (#${h})` : `Unstable output ${t.handle}; marker = ${g}; ${T !== void 0 ? "defined" : "undefined"} (#${h})`
|
|
3017
3018
|
), T;
|
|
3018
3019
|
}
|
|
3019
3020
|
};
|
|
3020
3021
|
}, n);
|
|
3021
3022
|
}
|
|
3022
|
-
function
|
|
3023
|
-
return
|
|
3023
|
+
function mi(s) {
|
|
3024
|
+
return Hr(s) ? s.isActive === !0 : Dn(s);
|
|
3024
3025
|
}
|
|
3025
|
-
function
|
|
3026
|
-
if (
|
|
3026
|
+
function Ae(s, e, t, r, o, n = {}) {
|
|
3027
|
+
if (Hr(t)) {
|
|
3027
3028
|
if (r === void 0) throw new Error("No code bundle.");
|
|
3028
|
-
return
|
|
3029
|
-
} else return
|
|
3029
|
+
return gi(s, e, t, r, o, n);
|
|
3030
|
+
} else return di(s.driverKit, e, t, n);
|
|
3030
3031
|
}
|
|
3031
|
-
function
|
|
3032
|
+
function vi(s, e, t) {
|
|
3032
3033
|
return J.make(
|
|
3033
3034
|
(r) => {
|
|
3034
|
-
var E, g, D, T, j,
|
|
3035
|
-
const o = r.accessor(s).node(), n = B(o.getKeyValueAsJson(xt)), i = B(o.getKeyValueAsJson(
|
|
3036
|
-
o.getKeyValueAsJson(
|
|
3035
|
+
var E, g, D, T, j, $, G, he;
|
|
3036
|
+
const o = r.accessor(s).node(), n = B(o.getKeyValueAsJson(xt)), i = B(o.getKeyValueAsJson(Le)), a = B(o.getKeyValueAsJson(De)), c = B(o.getKeyValueAsJson(pe)), u = B(
|
|
3037
|
+
o.getKeyValueAsJson(et)
|
|
3037
3038
|
), l = /* @__PURE__ */ new Map();
|
|
3038
|
-
for (const { id: L } of
|
|
3039
|
+
for (const { id: L } of oe(c)) {
|
|
3039
3040
|
const X = o.traverse({
|
|
3040
3041
|
field: U(L, "currentArgs"),
|
|
3041
3042
|
assertFieldType: "Dynamic",
|
|
@@ -3062,49 +3063,49 @@ function fi(s, e, t) {
|
|
|
3062
3063
|
stale: X.id !== W.id,
|
|
3063
3064
|
outputError: M.error !== void 0 || V.error !== void 0 || ((E = M.value) == null ? void 0 : E.getError()) !== void 0 || ((g = V.value) == null ? void 0 : g.getError()) !== void 0,
|
|
3064
3065
|
outputsError: ((D = M.error) == null ? void 0 : D.getDataAsString()) ?? ((j = (T = M.value) == null ? void 0 : T.getError()) == null ? void 0 : j.getDataAsString()),
|
|
3065
|
-
exportsError: ((
|
|
3066
|
+
exportsError: (($ = V.error) == null ? void 0 : $.getDataAsString()) ?? ((he = (G = V.value) == null ? void 0 : G.getError()) == null ? void 0 : he.getDataAsString()),
|
|
3066
3067
|
finished: (M.value !== void 0 && M.value.getIsReadyOrError() || M.error !== void 0 && M.error.getIsReadyOrError()) && (V.value !== void 0 && V.value.getIsReadyOrError() || V.error !== void 0 && V.error.getIsReadyOrError())
|
|
3067
3068
|
};
|
|
3068
3069
|
}
|
|
3069
3070
|
l.set(L, { currentArguments: X.getDataAsJson(), prod: ie });
|
|
3070
3071
|
}
|
|
3071
|
-
const d =
|
|
3072
|
-
var S, R,
|
|
3072
|
+
const d = Qe(c, (L) => l.get(L).currentArguments), f = new Set(u.blocksInLimbo), h = [...oe(c)].map(({ id: L, label: X, renderingMode: ie }) => {
|
|
3073
|
+
var S, R, O, C, I;
|
|
3073
3074
|
const W = B(l.get(L)), M = B(d.nodes.get(L));
|
|
3074
3075
|
let V = "NotCalculated";
|
|
3075
3076
|
W.prod !== void 0 && (f.has(L) ? V = "Limbo" : V = W.prod.finished ? "Done" : "Running");
|
|
3076
|
-
const q =
|
|
3077
|
-
const
|
|
3077
|
+
const q = ot(o, L), { sections: fe, title: v, inputsValid: p, sdkVersion: m } = Ie(q, ({ bpId: N, cfg: F }) => {
|
|
3078
|
+
const ne = Ut(s, L);
|
|
3078
3079
|
return {
|
|
3079
|
-
sections:
|
|
3080
|
+
sections: Ae(
|
|
3080
3081
|
t,
|
|
3081
|
-
|
|
3082
|
+
ne,
|
|
3082
3083
|
F.sections,
|
|
3083
3084
|
F.code,
|
|
3084
3085
|
N
|
|
3085
3086
|
).wrap({
|
|
3086
|
-
recover: (
|
|
3087
|
+
recover: (Re) => (t.logger.error("Error in block model sections"), t.logger.error(Re), [])
|
|
3087
3088
|
}),
|
|
3088
|
-
title:
|
|
3089
|
+
title: Ie(
|
|
3089
3090
|
F.title,
|
|
3090
|
-
(
|
|
3091
|
+
(Re) => Ae(
|
|
3091
3092
|
t,
|
|
3092
|
-
|
|
3093
|
-
|
|
3093
|
+
ne,
|
|
3094
|
+
Re,
|
|
3094
3095
|
F.code,
|
|
3095
3096
|
N
|
|
3096
3097
|
).wrap({
|
|
3097
|
-
recover: (
|
|
3098
|
+
recover: (Is) => (t.logger.error("Error in block model title"), t.logger.error(Is), "Invalid title")
|
|
3098
3099
|
})
|
|
3099
3100
|
),
|
|
3100
|
-
inputsValid:
|
|
3101
|
+
inputsValid: Ae(
|
|
3101
3102
|
t,
|
|
3102
|
-
|
|
3103
|
+
ne,
|
|
3103
3104
|
F.inputsValid,
|
|
3104
3105
|
F.code,
|
|
3105
3106
|
N
|
|
3106
3107
|
).wrap({
|
|
3107
|
-
recover: (
|
|
3108
|
+
recover: (Re) => (t.logger.error("Error in block model argsValid"), t.logger.error(Re), !1)
|
|
3108
3109
|
}),
|
|
3109
3110
|
sdkVersion: F.sdkVersion
|
|
3110
3111
|
};
|
|
@@ -3112,12 +3113,12 @@ function fi(s, e, t) {
|
|
|
3112
3113
|
field: U(L, "blockSettings"),
|
|
3113
3114
|
assertFieldType: "Dynamic",
|
|
3114
3115
|
errorIfFieldNotSet: !0
|
|
3115
|
-
}).getDataAsJson(), b =
|
|
3116
|
+
}).getDataAsJson(), b = Ie(
|
|
3116
3117
|
q,
|
|
3117
3118
|
({ info: N }) => t.blockUpdateWatcher.get({ currentSpec: N.source, settings: y })
|
|
3118
3119
|
);
|
|
3119
3120
|
return {
|
|
3120
|
-
projectResourceId:
|
|
3121
|
+
projectResourceId: we(s.rid),
|
|
3121
3122
|
id: L,
|
|
3122
3123
|
label: v ?? X,
|
|
3123
3124
|
title: v ?? X,
|
|
@@ -3128,7 +3129,7 @@ function fi(s, e, t) {
|
|
|
3128
3129
|
downstreams: [...d.traverseIdsExcludingRoots("downstream", L)],
|
|
3129
3130
|
calculationStatus: V,
|
|
3130
3131
|
outputErrors: ((R = W.prod) == null ? void 0 : R.outputError) === !0,
|
|
3131
|
-
outputsError: (
|
|
3132
|
+
outputsError: (O = W.prod) == null ? void 0 : O.outputsError,
|
|
3132
3133
|
exportsError: (C = W.prod) == null ? void 0 : C.exportsError,
|
|
3133
3134
|
settings: y,
|
|
3134
3135
|
sections: fe,
|
|
@@ -3144,7 +3145,7 @@ function fi(s, e, t) {
|
|
|
3144
3145
|
meta: a,
|
|
3145
3146
|
created: new Date(n),
|
|
3146
3147
|
lastModified: new Date(i),
|
|
3147
|
-
authorMarker: o.getKeyValueAsJson(
|
|
3148
|
+
authorMarker: o.getKeyValueAsJson(kt),
|
|
3148
3149
|
blocks: h
|
|
3149
3150
|
};
|
|
3150
3151
|
},
|
|
@@ -3170,13 +3171,13 @@ function fi(s, e, t) {
|
|
|
3170
3171
|
}
|
|
3171
3172
|
).withStableType();
|
|
3172
3173
|
}
|
|
3173
|
-
function
|
|
3174
|
+
function yi(s, e) {
|
|
3174
3175
|
const t = s.node();
|
|
3175
|
-
if (ce(t.resourceType,
|
|
3176
|
+
if (ce(t.resourceType, is)) {
|
|
3176
3177
|
const r = t.getDataAsJson();
|
|
3177
3178
|
if (r === void 0) throw new Error("No resource data.");
|
|
3178
3179
|
return e.frontendDownloadDriver.getPath(new URL(r.url)).withStableType();
|
|
3179
|
-
} else if (ce(t.resourceType,
|
|
3180
|
+
} else if (ce(t.resourceType, as)) {
|
|
3180
3181
|
const r = t.getDataAsJson();
|
|
3181
3182
|
if (r === void 0) throw new Error("No resource data.");
|
|
3182
3183
|
return e.signer.verify(
|
|
@@ -3187,10 +3188,10 @@ function gi(s, e) {
|
|
|
3187
3188
|
} else
|
|
3188
3189
|
throw new Error(`Unsupported resource type: ${JSON.stringify(t.resourceType)}`);
|
|
3189
3190
|
}
|
|
3190
|
-
function
|
|
3191
|
+
function wi(s, e) {
|
|
3191
3192
|
if (s !== void 0)
|
|
3192
3193
|
return J.make(
|
|
3193
|
-
(t) =>
|
|
3194
|
+
(t) => yi(t.accessor(s), e),
|
|
3194
3195
|
{
|
|
3195
3196
|
postprocessValue: (t) => {
|
|
3196
3197
|
if (t !== void 0) {
|
|
@@ -3202,86 +3203,86 @@ function mi(s, e) {
|
|
|
3202
3203
|
}
|
|
3203
3204
|
).withStableType();
|
|
3204
3205
|
}
|
|
3205
|
-
function
|
|
3206
|
+
function Si(s, e, t) {
|
|
3206
3207
|
return J.make(
|
|
3207
3208
|
(r) => {
|
|
3208
3209
|
var a;
|
|
3209
|
-
const o = r.accessor(s).node(), n =
|
|
3210
|
+
const o = r.accessor(s).node(), n = ot(o, e), i = (a = o.traverse(
|
|
3210
3211
|
{
|
|
3211
3212
|
field: U(e, "blockPack"),
|
|
3212
3213
|
assertFieldType: "Dynamic"
|
|
3213
3214
|
},
|
|
3214
3215
|
{ field: A.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 },
|
|
3215
|
-
{ field:
|
|
3216
|
+
{ field: ls, assertFieldType: "Input" }
|
|
3216
3217
|
)) == null ? void 0 : a.persist();
|
|
3217
3218
|
return {
|
|
3218
|
-
path:
|
|
3219
|
+
path: wi(i, t),
|
|
3219
3220
|
sdkVersion: n == null ? void 0 : n.cfg.sdkVersion
|
|
3220
3221
|
};
|
|
3221
3222
|
},
|
|
3222
3223
|
{ mode: "StableOnlyLive" }
|
|
3223
3224
|
);
|
|
3224
3225
|
}
|
|
3225
|
-
function
|
|
3226
|
+
function ws(s, e, t) {
|
|
3226
3227
|
if (t === void 0)
|
|
3227
|
-
return J.make((i) =>
|
|
3228
|
-
key: `inputs#${
|
|
3228
|
+
return J.make((i) => ws(s, e, i), {
|
|
3229
|
+
key: `inputs#${we(s.rid)}#${e}`
|
|
3229
3230
|
});
|
|
3230
3231
|
const r = t.accessor(s).node(), o = Ut(s, e), n = o.uiState(t);
|
|
3231
3232
|
return {
|
|
3232
|
-
author: r.getKeyValueAsJson(
|
|
3233
|
+
author: r.getKeyValueAsJson(Pt(e)),
|
|
3233
3234
|
args: JSON.parse(o.args(t)),
|
|
3234
3235
|
ui: n !== void 0 ? JSON.parse(n) : void 0
|
|
3235
3236
|
};
|
|
3236
3237
|
}
|
|
3237
|
-
function
|
|
3238
|
+
function bi(s, e, t) {
|
|
3238
3239
|
return J.make(
|
|
3239
3240
|
(r) => {
|
|
3240
|
-
const o = r.accessor(s).node(), n =
|
|
3241
|
-
return
|
|
3241
|
+
const o = r.accessor(s).node(), n = hs(s, e);
|
|
3242
|
+
return Ie(ot(o, e), ({ cfg: i, bpId: a }) => {
|
|
3242
3243
|
const c = {};
|
|
3243
3244
|
for (const [u, l] of Object.entries(i.outputs)) {
|
|
3244
|
-
const d =
|
|
3245
|
+
const d = Ae(t, n, l, i.code, a);
|
|
3245
3246
|
c[u] = J.wrapError(d);
|
|
3246
3247
|
}
|
|
3247
3248
|
return c;
|
|
3248
3249
|
});
|
|
3249
3250
|
},
|
|
3250
|
-
{ key: "outputs#" +
|
|
3251
|
+
{ key: "outputs#" + we(s.rid) + "#" + e }
|
|
3251
3252
|
).withStableType();
|
|
3252
3253
|
}
|
|
3253
|
-
function
|
|
3254
|
+
function Ri(s, e) {
|
|
3254
3255
|
return J.make((t) => {
|
|
3255
3256
|
const r = t.accessor(s).node(), o = B(r.getKeyValueAsJson(pe)), n = [];
|
|
3256
|
-
for (const { id: i } of
|
|
3257
|
-
const a =
|
|
3257
|
+
for (const { id: i } of oe(o)) {
|
|
3258
|
+
const a = ot(r, i);
|
|
3258
3259
|
if (a === void 0) continue;
|
|
3259
|
-
const c = Object.entries(a.cfg.outputs).map(([, l]) => l).filter((l) =>
|
|
3260
|
+
const c = Object.entries(a.cfg.outputs).map(([, l]) => l).filter((l) => mi(l)).map((l) => l);
|
|
3260
3261
|
if (c.length === 0) continue;
|
|
3261
|
-
const u =
|
|
3262
|
+
const u = hs(r.persist(), i);
|
|
3262
3263
|
for (const l of c)
|
|
3263
3264
|
n.push(
|
|
3264
|
-
J.wrapError(
|
|
3265
|
+
J.wrapError(Ae(e, u, l, a.cfg.code, a.bpId))
|
|
3265
3266
|
);
|
|
3266
3267
|
}
|
|
3267
3268
|
return n;
|
|
3268
3269
|
});
|
|
3269
3270
|
}
|
|
3270
|
-
class
|
|
3271
|
+
class Ei {
|
|
3271
3272
|
constructor() {
|
|
3272
3273
|
w(this, "states", /* @__PURE__ */ new Map());
|
|
3273
3274
|
}
|
|
3274
3275
|
setState(e, t) {
|
|
3275
3276
|
const r = this.states.get(e);
|
|
3276
3277
|
if (r === void 0) {
|
|
3277
|
-
this.states.set(e, { state: t, change: new
|
|
3278
|
+
this.states.set(e, { state: t, change: new sr() });
|
|
3278
3279
|
return;
|
|
3279
3280
|
}
|
|
3280
3281
|
r.state = { ...t }, r.change.markChanged();
|
|
3281
3282
|
}
|
|
3282
3283
|
readState(e, t) {
|
|
3283
3284
|
let r = this.states.get(t);
|
|
3284
|
-
return r === void 0 && (r = { state: { ...
|
|
3285
|
+
return r === void 0 && (r = { state: { ...Ns }, change: new sr() }, this.states.set(t, r)), r.change.attachWatcher(e.watcher), r.state;
|
|
3285
3286
|
}
|
|
3286
3287
|
getState(e) {
|
|
3287
3288
|
return J.make(
|
|
@@ -3294,38 +3295,41 @@ class Si {
|
|
|
3294
3295
|
t !== void 0 && (this.states.delete(e), t.change.markChanged());
|
|
3295
3296
|
}
|
|
3296
3297
|
}
|
|
3298
|
+
function Sr(s) {
|
|
3299
|
+
return JSON.stringify(s, (e, t) => typeof t == "bigint" ? we(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);
|
|
3300
|
+
}
|
|
3297
3301
|
class Jt {
|
|
3298
3302
|
constructor(e, t, r) {
|
|
3299
3303
|
/** Underlying pl resource id */
|
|
3300
3304
|
w(this, "rid");
|
|
3301
3305
|
/** Data for the left panel, contain basic information about block status. */
|
|
3302
3306
|
w(this, "overview");
|
|
3303
|
-
w(this, "navigationStates", new
|
|
3307
|
+
w(this, "navigationStates", new Ei());
|
|
3304
3308
|
w(this, "blockComputables", /* @__PURE__ */ new Map());
|
|
3305
3309
|
w(this, "blockFrontends", /* @__PURE__ */ new Map());
|
|
3306
3310
|
w(this, "activeConfigs");
|
|
3307
3311
|
w(this, "refreshLoopResult");
|
|
3308
3312
|
w(this, "abortController", new AbortController());
|
|
3309
3313
|
w(this, "destroyed", !1);
|
|
3310
|
-
this.env = e, this.projectTree = r, this.overview =
|
|
3314
|
+
this.env = e, this.projectTree = r, this.overview = vi(
|
|
3311
3315
|
r.entry(),
|
|
3312
3316
|
this.navigationStates,
|
|
3313
3317
|
e
|
|
3314
|
-
).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs =
|
|
3318
|
+
).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs = Ri(r.entry(), e);
|
|
3315
3319
|
}
|
|
3316
3320
|
async refreshLoop() {
|
|
3317
3321
|
for (; !this.destroyed; )
|
|
3318
3322
|
try {
|
|
3319
|
-
await
|
|
3323
|
+
await Ke(this.env.pl, this.rid, (e) => {
|
|
3320
3324
|
e.doRefresh(this.env.ops.stagingRenderingRate);
|
|
3321
|
-
}), await this.activeConfigs.getValue(), await
|
|
3325
|
+
}), await this.activeConfigs.getValue(), await Qr(this.env.ops.projectRefreshInterval, this.abortController.signal);
|
|
3322
3326
|
} catch (e) {
|
|
3323
|
-
if (
|
|
3327
|
+
if (qs(e)) {
|
|
3324
3328
|
console.warn(
|
|
3325
3329
|
"project refresh routine terminated, because project was externally deleted"
|
|
3326
3330
|
);
|
|
3327
3331
|
break;
|
|
3328
|
-
} else if (!
|
|
3332
|
+
} else if (!Ys(e))
|
|
3329
3333
|
throw new Error("Unexpected exception", { cause: e });
|
|
3330
3334
|
}
|
|
3331
3335
|
}
|
|
@@ -3340,8 +3344,8 @@ class Jt {
|
|
|
3340
3344
|
*
|
|
3341
3345
|
* @return returns newly created block id
|
|
3342
3346
|
* */
|
|
3343
|
-
async addBlock(e, t, r, o = void 0, n =
|
|
3344
|
-
const i = await this.env.bpPreparer.prepare(t), a = await this.env.bpPreparer.getBlockConfigContainer(t), c =
|
|
3347
|
+
async addBlock(e, t, r, o = void 0, n = Se()) {
|
|
3348
|
+
const i = await this.env.bpPreparer.prepare(t), a = await this.env.bpPreparer.getBlockConfigContainer(t), c = Kr(a);
|
|
3345
3349
|
return await Q(
|
|
3346
3350
|
this.env.pl,
|
|
3347
3351
|
this.rid,
|
|
@@ -3419,7 +3423,7 @@ class Jt {
|
|
|
3419
3423
|
* stale state.
|
|
3420
3424
|
* */
|
|
3421
3425
|
async runBlock(e) {
|
|
3422
|
-
await
|
|
3426
|
+
await Ke(this.env.pl, this.rid, (t) => t.renderProduction([e], !0)), await this.projectTree.refreshState();
|
|
3423
3427
|
}
|
|
3424
3428
|
/**
|
|
3425
3429
|
* Stops the block if it is running by destroying its production state. All
|
|
@@ -3427,7 +3431,7 @@ class Jt {
|
|
|
3427
3431
|
* calculated.
|
|
3428
3432
|
* */
|
|
3429
3433
|
async stopBlock(e) {
|
|
3430
|
-
await
|
|
3434
|
+
await Ke(this.env.pl, this.rid, (t) => t.stopProduction(e)), await this.projectTree.refreshState();
|
|
3431
3435
|
}
|
|
3432
3436
|
// /** Update block label. */
|
|
3433
3437
|
// public async setBlockLabel(blockId: string, label: string, author?: AuthorMarker) {
|
|
@@ -3490,9 +3494,9 @@ class Jt {
|
|
|
3490
3494
|
/** Resets arguments and ui state of the block to initial state */
|
|
3491
3495
|
async resetBlockArgsAndUiState(e, t) {
|
|
3492
3496
|
await this.env.pl.withWriteTx("BlockInputsReset", async (r) => {
|
|
3493
|
-
const o =
|
|
3497
|
+
const o = Rt(
|
|
3494
3498
|
(await r.getField(x(this.rid, U(e, "blockPack")))).value
|
|
3495
|
-
), n =
|
|
3499
|
+
), n = Rt(
|
|
3496
3500
|
(await r.getField(x(o, A.HolderRefField))).value
|
|
3497
3501
|
), i = await r.getResourceData(n, !1), a = JSON.parse(
|
|
3498
3502
|
Buffer.from(B(i.data)).toString("utf-8")
|
|
@@ -3505,10 +3509,10 @@ class Jt {
|
|
|
3505
3509
|
getBlockComputables(e) {
|
|
3506
3510
|
const t = this.blockComputables.get(e);
|
|
3507
3511
|
if (t === void 0) {
|
|
3508
|
-
const r =
|
|
3512
|
+
const r = bi(this.projectTree.entry(), e, this.env), n = {
|
|
3509
3513
|
fullState: J.make(
|
|
3510
3514
|
(i) => ({
|
|
3511
|
-
argsAndUiState:
|
|
3515
|
+
argsAndUiState: ws(this.projectTree.entry(), e, i),
|
|
3512
3516
|
outputs: r,
|
|
3513
3517
|
navigationState: this.navigationStates.getState(e)
|
|
3514
3518
|
}),
|
|
@@ -3539,7 +3543,7 @@ class Jt {
|
|
|
3539
3543
|
getBlockFrontend(e) {
|
|
3540
3544
|
const t = this.blockFrontends.get(e);
|
|
3541
3545
|
if (t === void 0) {
|
|
3542
|
-
const r =
|
|
3546
|
+
const r = Si(
|
|
3543
3547
|
this.projectTree.entry(),
|
|
3544
3548
|
e,
|
|
3545
3549
|
this.env
|
|
@@ -3559,21 +3563,30 @@ class Jt {
|
|
|
3559
3563
|
await this.destroy();
|
|
3560
3564
|
}
|
|
3561
3565
|
static async init(e, t) {
|
|
3562
|
-
await
|
|
3566
|
+
await Ke(e.pl, t, (o) => {
|
|
3563
3567
|
});
|
|
3564
|
-
const r = await
|
|
3568
|
+
const r = await Xr.init(
|
|
3565
3569
|
e.pl,
|
|
3566
3570
|
t,
|
|
3567
3571
|
{
|
|
3568
3572
|
...e.ops.defaultTreeOptions,
|
|
3569
|
-
pruning:
|
|
3573
|
+
pruning: Ci
|
|
3570
3574
|
},
|
|
3571
3575
|
e.logger
|
|
3572
3576
|
);
|
|
3577
|
+
if (e.ops.debugOps.dumpInitialTreeState) {
|
|
3578
|
+
const o = r.dumpState();
|
|
3579
|
+
o.sort((i, a) => {
|
|
3580
|
+
var c, u;
|
|
3581
|
+
return (((c = a.data) == null ? void 0 : c.byteLength) ?? 0) - (((u = i.data) == null ? void 0 : u.byteLength) ?? 0);
|
|
3582
|
+
});
|
|
3583
|
+
const n = eo(o);
|
|
3584
|
+
await er.writeFile(`${we(t)}.json`, Sr(o)), await er.writeFile(`${we(t)}.stats.json`, Sr(n));
|
|
3585
|
+
}
|
|
3573
3586
|
return new Jt(e, t, r);
|
|
3574
3587
|
}
|
|
3575
3588
|
}
|
|
3576
|
-
function
|
|
3589
|
+
function Ci(s) {
|
|
3577
3590
|
switch (s.type.name) {
|
|
3578
3591
|
case "BlockPackCustom":
|
|
3579
3592
|
return s.fields.filter((e) => e.name !== "template");
|
|
@@ -3585,8 +3598,8 @@ function bi(s) {
|
|
|
3585
3598
|
return s.fields;
|
|
3586
3599
|
}
|
|
3587
3600
|
}
|
|
3588
|
-
const
|
|
3589
|
-
logger: new
|
|
3601
|
+
const Ss = {
|
|
3602
|
+
logger: new Ms(),
|
|
3590
3603
|
blobDriverOps: {
|
|
3591
3604
|
cacheSoftSizeBytes: 8 * 1024 * 1024 * 1024,
|
|
3592
3605
|
// 8 GB
|
|
@@ -3609,34 +3622,39 @@ const ys = {
|
|
|
3609
3622
|
stopPollingDelay: 1e3
|
|
3610
3623
|
}
|
|
3611
3624
|
};
|
|
3612
|
-
function
|
|
3625
|
+
function bs(s) {
|
|
3613
3626
|
return {
|
|
3614
3627
|
blobDownloadPath: _.join(s, "download"),
|
|
3615
3628
|
downloadBlobToURLPath: _.join(s, "downloadToURL")
|
|
3616
3629
|
};
|
|
3617
3630
|
}
|
|
3618
|
-
const
|
|
3619
|
-
...
|
|
3631
|
+
const Pi = {
|
|
3632
|
+
...Ss,
|
|
3620
3633
|
defaultTreeOptions: {
|
|
3621
3634
|
pollingInterval: 350,
|
|
3622
|
-
stopPollingDelay: 2500
|
|
3635
|
+
stopPollingDelay: 2500,
|
|
3636
|
+
initialTreeLoadingTimeout: 100 * 60 * 60 * 1e3
|
|
3637
|
+
// disable timeout for loading project tree (100 hours)
|
|
3638
|
+
},
|
|
3639
|
+
debugOps: {
|
|
3640
|
+
dumpInitialTreeState: !1
|
|
3623
3641
|
},
|
|
3624
3642
|
devBlockUpdateRecheckInterval: 1e3,
|
|
3625
3643
|
projectRefreshInterval: 700,
|
|
3626
3644
|
stagingRenderingRate: 5
|
|
3627
3645
|
};
|
|
3628
|
-
function
|
|
3646
|
+
function ki(s) {
|
|
3629
3647
|
return {
|
|
3630
|
-
...
|
|
3648
|
+
...bs(s),
|
|
3631
3649
|
frontendDownloadPath: _.join(s, "frontend")
|
|
3632
3650
|
};
|
|
3633
3651
|
}
|
|
3634
|
-
function
|
|
3652
|
+
function Oi(s) {
|
|
3635
3653
|
return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
|
|
3636
3654
|
}
|
|
3637
|
-
var
|
|
3638
|
-
const
|
|
3639
|
-
9007199254740991,
|
|
3655
|
+
var At = { exports: {} };
|
|
3656
|
+
const $i = "2.0.0", Rs = 256, Fi = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
3657
|
+
9007199254740991, Ii = 16, Ai = Rs - 6, Ti = [
|
|
3640
3658
|
"major",
|
|
3641
3659
|
"premajor",
|
|
3642
3660
|
"minor",
|
|
@@ -3645,25 +3663,25 @@ const Pi = "2.0.0", Ss = 256, ki = Number.MAX_SAFE_INTEGER || /* istanbul ignore
|
|
|
3645
3663
|
"prepatch",
|
|
3646
3664
|
"prerelease"
|
|
3647
3665
|
];
|
|
3648
|
-
var
|
|
3649
|
-
MAX_LENGTH:
|
|
3650
|
-
MAX_SAFE_COMPONENT_LENGTH:
|
|
3651
|
-
MAX_SAFE_BUILD_LENGTH:
|
|
3652
|
-
MAX_SAFE_INTEGER:
|
|
3653
|
-
RELEASE_TYPES:
|
|
3654
|
-
SEMVER_SPEC_VERSION:
|
|
3666
|
+
var nt = {
|
|
3667
|
+
MAX_LENGTH: Rs,
|
|
3668
|
+
MAX_SAFE_COMPONENT_LENGTH: Ii,
|
|
3669
|
+
MAX_SAFE_BUILD_LENGTH: Ai,
|
|
3670
|
+
MAX_SAFE_INTEGER: Fi,
|
|
3671
|
+
RELEASE_TYPES: Ti,
|
|
3672
|
+
SEMVER_SPEC_VERSION: $i,
|
|
3655
3673
|
FLAG_INCLUDE_PRERELEASE: 1,
|
|
3656
3674
|
FLAG_LOOSE: 2
|
|
3657
3675
|
};
|
|
3658
|
-
const
|
|
3676
|
+
const Li = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...s) => console.error("SEMVER", ...s) : () => {
|
|
3659
3677
|
};
|
|
3660
|
-
var
|
|
3678
|
+
var it = Li;
|
|
3661
3679
|
(function(s, e) {
|
|
3662
3680
|
const {
|
|
3663
3681
|
MAX_SAFE_COMPONENT_LENGTH: t,
|
|
3664
3682
|
MAX_SAFE_BUILD_LENGTH: r,
|
|
3665
3683
|
MAX_LENGTH: o
|
|
3666
|
-
} =
|
|
3684
|
+
} = nt, n = it;
|
|
3667
3685
|
e = s.exports = {};
|
|
3668
3686
|
const i = e.re = [], a = e.safeRe = [], c = e.src = [], u = e.safeSrc = [], l = e.t = {};
|
|
3669
3687
|
let d = 0;
|
|
@@ -3676,49 +3694,49 @@ var nt = Ii;
|
|
|
3676
3694
|
D = D.split(`${T}*`).join(`${T}{0,${j}}`).split(`${T}+`).join(`${T}{1,${j}}`);
|
|
3677
3695
|
return D;
|
|
3678
3696
|
}, g = (D, T, j) => {
|
|
3679
|
-
const
|
|
3680
|
-
n(D, G, T), l[D] = G, c[G] = T, u[G] =
|
|
3697
|
+
const $ = E(T), G = d++;
|
|
3698
|
+
n(D, G, T), l[D] = G, c[G] = T, u[G] = $, i[G] = new RegExp(T, j ? "g" : void 0), a[G] = new RegExp($, j ? "g" : void 0);
|
|
3681
3699
|
};
|
|
3682
3700
|
g("NUMERICIDENTIFIER", "0|[1-9]\\d*"), g("NUMERICIDENTIFIERLOOSE", "\\d+"), g("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${f}*`), g("MAINVERSION", `(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`), g("MAINVERSIONLOOSE", `(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`), g("PRERELEASEIDENTIFIER", `(?:${c[l.NUMERICIDENTIFIER]}|${c[l.NONNUMERICIDENTIFIER]})`), g("PRERELEASEIDENTIFIERLOOSE", `(?:${c[l.NUMERICIDENTIFIERLOOSE]}|${c[l.NONNUMERICIDENTIFIER]})`), g("PRERELEASE", `(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`), g("PRERELEASELOOSE", `(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`), g("BUILDIDENTIFIER", `${f}+`), g("BUILD", `(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`), g("FULLPLAIN", `v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`), g("FULL", `^${c[l.FULLPLAIN]}$`), g("LOOSEPLAIN", `[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`), g("LOOSE", `^${c[l.LOOSEPLAIN]}$`), g("GTLT", "((?:<|>)?=?)"), g("XRANGEIDENTIFIERLOOSE", `${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), g("XRANGEIDENTIFIER", `${c[l.NUMERICIDENTIFIER]}|x|X|\\*`), g("XRANGEPLAIN", `[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`), g("XRANGEPLAINLOOSE", `[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`), g("XRANGE", `^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`), g("XRANGELOOSE", `^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`), g("COERCEPLAIN", `(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`), g("COERCE", `${c[l.COERCEPLAIN]}(?:$|[^\\d])`), g("COERCEFULL", c[l.COERCEPLAIN] + `(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`), g("COERCERTL", c[l.COERCE], !0), g("COERCERTLFULL", c[l.COERCEFULL], !0), g("LONETILDE", "(?:~>?)"), g("TILDETRIM", `(\\s*)${c[l.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", g("TILDE", `^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`), g("TILDELOOSE", `^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`), g("LONECARET", "(?:\\^)"), g("CARETTRIM", `(\\s*)${c[l.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", g("CARET", `^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`), g("CARETLOOSE", `^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`), g("COMPARATORLOOSE", `^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`), g("COMPARATOR", `^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`), g("COMPARATORTRIM", `(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", g("HYPHENRANGE", `^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`), g("HYPHENRANGELOOSE", `^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`), g("STAR", "(<|>)?=?\\s*\\*"), g("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), g("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
3683
|
-
})(
|
|
3684
|
-
var
|
|
3685
|
-
const
|
|
3686
|
-
var Gt =
|
|
3687
|
-
const
|
|
3688
|
-
const t =
|
|
3701
|
+
})(At, At.exports);
|
|
3702
|
+
var xe = At.exports;
|
|
3703
|
+
const Di = Object.freeze({ loose: !0 }), Ni = Object.freeze({}), Bi = (s) => s ? typeof s != "object" ? Di : s : Ni;
|
|
3704
|
+
var Gt = Bi;
|
|
3705
|
+
const br = /^[0-9]+$/, Es = (s, e) => {
|
|
3706
|
+
const t = br.test(s), r = br.test(e);
|
|
3689
3707
|
return t && r && (s = +s, e = +e), s === e ? 0 : t && !r ? -1 : r && !t ? 1 : s < e ? -1 : 1;
|
|
3690
|
-
},
|
|
3691
|
-
var
|
|
3692
|
-
compareIdentifiers:
|
|
3693
|
-
rcompareIdentifiers:
|
|
3708
|
+
}, xi = (s, e) => Es(e, s);
|
|
3709
|
+
var Cs = {
|
|
3710
|
+
compareIdentifiers: Es,
|
|
3711
|
+
rcompareIdentifiers: xi
|
|
3694
3712
|
};
|
|
3695
|
-
const
|
|
3696
|
-
let
|
|
3713
|
+
const We = it, { MAX_LENGTH: Rr, MAX_SAFE_INTEGER: ze } = nt, { safeRe: Er, safeSrc: Cr, t: Xe } = xe, ji = Gt, { compareIdentifiers: ge } = Cs;
|
|
3714
|
+
let Vi = class re {
|
|
3697
3715
|
constructor(e, t) {
|
|
3698
|
-
if (t =
|
|
3716
|
+
if (t = ji(t), e instanceof re) {
|
|
3699
3717
|
if (e.loose === !!t.loose && e.includePrerelease === !!t.includePrerelease)
|
|
3700
3718
|
return e;
|
|
3701
3719
|
e = e.version;
|
|
3702
3720
|
} else if (typeof e != "string")
|
|
3703
3721
|
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);
|
|
3704
|
-
if (e.length >
|
|
3722
|
+
if (e.length > Rr)
|
|
3705
3723
|
throw new TypeError(
|
|
3706
|
-
`version is longer than ${
|
|
3724
|
+
`version is longer than ${Rr} characters`
|
|
3707
3725
|
);
|
|
3708
|
-
|
|
3709
|
-
const r = e.trim().match(t.loose ?
|
|
3726
|
+
We("SemVer", e, t), this.options = t, this.loose = !!t.loose, this.includePrerelease = !!t.includePrerelease;
|
|
3727
|
+
const r = e.trim().match(t.loose ? Er[Xe.LOOSE] : Er[Xe.FULL]);
|
|
3710
3728
|
if (!r)
|
|
3711
3729
|
throw new TypeError(`Invalid Version: ${e}`);
|
|
3712
|
-
if (this.raw = e, this.major = +r[1], this.minor = +r[2], this.patch = +r[3], this.major >
|
|
3730
|
+
if (this.raw = e, this.major = +r[1], this.minor = +r[2], this.patch = +r[3], this.major > ze || this.major < 0)
|
|
3713
3731
|
throw new TypeError("Invalid major version");
|
|
3714
|
-
if (this.minor >
|
|
3732
|
+
if (this.minor > ze || this.minor < 0)
|
|
3715
3733
|
throw new TypeError("Invalid minor version");
|
|
3716
|
-
if (this.patch >
|
|
3734
|
+
if (this.patch > ze || this.patch < 0)
|
|
3717
3735
|
throw new TypeError("Invalid patch version");
|
|
3718
3736
|
r[4] ? this.prerelease = r[4].split(".").map((o) => {
|
|
3719
3737
|
if (/^[0-9]+$/.test(o)) {
|
|
3720
3738
|
const n = +o;
|
|
3721
|
-
if (n >= 0 && n <
|
|
3739
|
+
if (n >= 0 && n < ze)
|
|
3722
3740
|
return n;
|
|
3723
3741
|
}
|
|
3724
3742
|
return o;
|
|
@@ -3731,7 +3749,7 @@ let Bi = class re {
|
|
|
3731
3749
|
return this.version;
|
|
3732
3750
|
}
|
|
3733
3751
|
compare(e) {
|
|
3734
|
-
if (
|
|
3752
|
+
if (We("SemVer.compare", this.version, this.options, e), !(e instanceof re)) {
|
|
3735
3753
|
if (typeof e == "string" && e === this.version)
|
|
3736
3754
|
return 0;
|
|
3737
3755
|
e = new re(e, this.options);
|
|
@@ -3751,7 +3769,7 @@ let Bi = class re {
|
|
|
3751
3769
|
let t = 0;
|
|
3752
3770
|
do {
|
|
3753
3771
|
const r = this.prerelease[t], o = e.prerelease[t];
|
|
3754
|
-
if (
|
|
3772
|
+
if (We("prerelease compare", t, r, o), r === void 0 && o === void 0)
|
|
3755
3773
|
return 0;
|
|
3756
3774
|
if (o === void 0)
|
|
3757
3775
|
return 1;
|
|
@@ -3767,7 +3785,7 @@ let Bi = class re {
|
|
|
3767
3785
|
let t = 0;
|
|
3768
3786
|
do {
|
|
3769
3787
|
const r = this.build[t], o = e.build[t];
|
|
3770
|
-
if (
|
|
3788
|
+
if (We("build compare", t, r, o), r === void 0 && o === void 0)
|
|
3771
3789
|
return 0;
|
|
3772
3790
|
if (o === void 0)
|
|
3773
3791
|
return 1;
|
|
@@ -3785,7 +3803,7 @@ let Bi = class re {
|
|
|
3785
3803
|
if (!t && r === !1)
|
|
3786
3804
|
throw new Error("invalid increment argument: identifier is empty");
|
|
3787
3805
|
if (t) {
|
|
3788
|
-
const o = new RegExp(`^${this.options.loose ?
|
|
3806
|
+
const o = new RegExp(`^${this.options.loose ? Cr[Xe.PRERELEASELOOSE] : Cr[Xe.PRERELEASE]}$`), n = `-${t}`.match(o);
|
|
3789
3807
|
if (!n || n[1] !== t)
|
|
3790
3808
|
throw new Error(`invalid identifier: ${t}`);
|
|
3791
3809
|
}
|
|
@@ -3843,43 +3861,43 @@ let Bi = class re {
|
|
|
3843
3861
|
return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
|
|
3844
3862
|
}
|
|
3845
3863
|
};
|
|
3846
|
-
var H =
|
|
3847
|
-
const
|
|
3848
|
-
if (s instanceof
|
|
3864
|
+
var H = Vi;
|
|
3865
|
+
const Pr = H, Ui = (s, e, t = !1) => {
|
|
3866
|
+
if (s instanceof Pr)
|
|
3849
3867
|
return s;
|
|
3850
3868
|
try {
|
|
3851
|
-
return new
|
|
3869
|
+
return new Pr(s, e);
|
|
3852
3870
|
} catch (r) {
|
|
3853
3871
|
if (!t)
|
|
3854
3872
|
return null;
|
|
3855
3873
|
throw r;
|
|
3856
3874
|
}
|
|
3857
3875
|
};
|
|
3858
|
-
var
|
|
3859
|
-
const
|
|
3860
|
-
const t =
|
|
3876
|
+
var be = Ui;
|
|
3877
|
+
const Ji = be, Gi = (s, e) => {
|
|
3878
|
+
const t = Ji(s, e);
|
|
3861
3879
|
return t ? t.version : null;
|
|
3862
3880
|
};
|
|
3863
|
-
var
|
|
3864
|
-
const
|
|
3865
|
-
const t =
|
|
3881
|
+
var Mi = Gi;
|
|
3882
|
+
const _i = be, Ki = (s, e) => {
|
|
3883
|
+
const t = _i(s.trim().replace(/^[=v]+/, ""), e);
|
|
3866
3884
|
return t ? t.version : null;
|
|
3867
3885
|
};
|
|
3868
|
-
var
|
|
3869
|
-
const
|
|
3886
|
+
var Hi = Ki;
|
|
3887
|
+
const kr = H, Wi = (s, e, t, r, o) => {
|
|
3870
3888
|
typeof t == "string" && (o = r, r = t, t = void 0);
|
|
3871
3889
|
try {
|
|
3872
|
-
return new
|
|
3873
|
-
s instanceof
|
|
3890
|
+
return new kr(
|
|
3891
|
+
s instanceof kr ? s.version : s,
|
|
3874
3892
|
t
|
|
3875
3893
|
).inc(e, r, o).version;
|
|
3876
3894
|
} catch {
|
|
3877
3895
|
return null;
|
|
3878
3896
|
}
|
|
3879
3897
|
};
|
|
3880
|
-
var
|
|
3881
|
-
const
|
|
3882
|
-
const t =
|
|
3898
|
+
var zi = Wi;
|
|
3899
|
+
const Or = be, Xi = (s, e) => {
|
|
3900
|
+
const t = Or(s, null, !0), r = Or(e, null, !0), o = t.compare(r);
|
|
3883
3901
|
if (o === 0)
|
|
3884
3902
|
return null;
|
|
3885
3903
|
const n = o > 0, i = n ? t : r, a = n ? r : t, c = !!i.prerelease.length;
|
|
@@ -3892,46 +3910,46 @@ const Pr = Se, Hi = (s, e) => {
|
|
|
3892
3910
|
const l = c ? "pre" : "";
|
|
3893
3911
|
return t.major !== r.major ? l + "major" : t.minor !== r.minor ? l + "minor" : t.patch !== r.patch ? l + "patch" : "prerelease";
|
|
3894
3912
|
};
|
|
3895
|
-
var Wi = Hi;
|
|
3896
|
-
const zi = H, Xi = (s, e) => new zi(s, e).major;
|
|
3897
3913
|
var qi = Xi;
|
|
3898
|
-
const Yi = H, Qi = (s, e) => new Yi(s, e).
|
|
3914
|
+
const Yi = H, Qi = (s, e) => new Yi(s, e).major;
|
|
3899
3915
|
var Zi = Qi;
|
|
3900
|
-
const ea = H, ta = (s, e) => new ea(s, e).
|
|
3916
|
+
const ea = H, ta = (s, e) => new ea(s, e).minor;
|
|
3901
3917
|
var ra = ta;
|
|
3902
|
-
const sa =
|
|
3903
|
-
|
|
3918
|
+
const sa = H, oa = (s, e) => new sa(s, e).patch;
|
|
3919
|
+
var na = oa;
|
|
3920
|
+
const ia = be, aa = (s, e) => {
|
|
3921
|
+
const t = ia(s, e);
|
|
3904
3922
|
return t && t.prerelease.length ? t.prerelease : null;
|
|
3905
3923
|
};
|
|
3906
|
-
var
|
|
3907
|
-
const
|
|
3908
|
-
var ee =
|
|
3909
|
-
const
|
|
3910
|
-
var la = ca;
|
|
3911
|
-
const ua = ee, da = (s, e) => ua(s, e, !0);
|
|
3924
|
+
var ca = aa;
|
|
3925
|
+
const $r = H, la = (s, e, t) => new $r(s, t).compare(new $r(e, t));
|
|
3926
|
+
var ee = la;
|
|
3927
|
+
const ua = ee, da = (s, e, t) => ua(e, s, t);
|
|
3912
3928
|
var pa = da;
|
|
3913
|
-
const
|
|
3914
|
-
|
|
3929
|
+
const ha = ee, fa = (s, e) => ha(s, e, !0);
|
|
3930
|
+
var ga = fa;
|
|
3931
|
+
const Fr = H, ma = (s, e, t) => {
|
|
3932
|
+
const r = new Fr(s, t), o = new Fr(e, t);
|
|
3915
3933
|
return r.compare(o) || r.compareBuild(o);
|
|
3916
3934
|
};
|
|
3917
|
-
var Mt =
|
|
3918
|
-
const
|
|
3919
|
-
var ma = ga;
|
|
3920
|
-
const va = Mt, ya = (s, e) => s.sort((t, r) => va(r, t, e));
|
|
3935
|
+
var Mt = ma;
|
|
3936
|
+
const va = Mt, ya = (s, e) => s.sort((t, r) => va(t, r, e));
|
|
3921
3937
|
var wa = ya;
|
|
3922
|
-
const Sa =
|
|
3923
|
-
var
|
|
3924
|
-
const
|
|
3925
|
-
var
|
|
3926
|
-
const
|
|
3927
|
-
var
|
|
3928
|
-
const
|
|
3929
|
-
var
|
|
3930
|
-
const
|
|
3931
|
-
var
|
|
3932
|
-
const
|
|
3933
|
-
var
|
|
3934
|
-
const
|
|
3938
|
+
const Sa = Mt, ba = (s, e) => s.sort((t, r) => Sa(r, t, e));
|
|
3939
|
+
var Ra = ba;
|
|
3940
|
+
const Ea = ee, Ca = (s, e, t) => Ea(s, e, t) > 0;
|
|
3941
|
+
var at = Ca;
|
|
3942
|
+
const Pa = ee, ka = (s, e, t) => Pa(s, e, t) < 0;
|
|
3943
|
+
var _t = ka;
|
|
3944
|
+
const Oa = ee, $a = (s, e, t) => Oa(s, e, t) === 0;
|
|
3945
|
+
var Ps = $a;
|
|
3946
|
+
const Fa = ee, Ia = (s, e, t) => Fa(s, e, t) !== 0;
|
|
3947
|
+
var ks = Ia;
|
|
3948
|
+
const Aa = ee, Ta = (s, e, t) => Aa(s, e, t) >= 0;
|
|
3949
|
+
var Kt = Ta;
|
|
3950
|
+
const La = ee, Da = (s, e, t) => La(s, e, t) <= 0;
|
|
3951
|
+
var Ht = Da;
|
|
3952
|
+
const Na = Ps, Ba = ks, xa = at, ja = Kt, Va = _t, Ua = Ht, Ja = (s, e, t, r) => {
|
|
3935
3953
|
switch (e) {
|
|
3936
3954
|
case "===":
|
|
3937
3955
|
return typeof s == "object" && (s = s.version), typeof t == "object" && (t = t.version), s === t;
|
|
@@ -3940,33 +3958,33 @@ const Ta = Es, La = Cs, Da = it, Na = Kt, Ba = _t, xa = Ht, ja = (s, e, t, r) =>
|
|
|
3940
3958
|
case "":
|
|
3941
3959
|
case "=":
|
|
3942
3960
|
case "==":
|
|
3943
|
-
return
|
|
3961
|
+
return Na(s, t, r);
|
|
3944
3962
|
case "!=":
|
|
3945
|
-
return
|
|
3963
|
+
return Ba(s, t, r);
|
|
3946
3964
|
case ">":
|
|
3947
|
-
return
|
|
3965
|
+
return xa(s, t, r);
|
|
3948
3966
|
case ">=":
|
|
3949
|
-
return
|
|
3967
|
+
return ja(s, t, r);
|
|
3950
3968
|
case "<":
|
|
3951
|
-
return
|
|
3969
|
+
return Va(s, t, r);
|
|
3952
3970
|
case "<=":
|
|
3953
|
-
return
|
|
3971
|
+
return Ua(s, t, r);
|
|
3954
3972
|
default:
|
|
3955
3973
|
throw new TypeError(`Invalid operator: ${e}`);
|
|
3956
3974
|
}
|
|
3957
3975
|
};
|
|
3958
|
-
var
|
|
3959
|
-
const
|
|
3960
|
-
if (s instanceof
|
|
3976
|
+
var Os = Ja;
|
|
3977
|
+
const Ga = H, Ma = be, { safeRe: qe, t: Ye } = xe, _a = (s, e) => {
|
|
3978
|
+
if (s instanceof Ga)
|
|
3961
3979
|
return s;
|
|
3962
3980
|
if (typeof s == "number" && (s = String(s)), typeof s != "string")
|
|
3963
3981
|
return null;
|
|
3964
3982
|
e = e || {};
|
|
3965
3983
|
let t = null;
|
|
3966
3984
|
if (!e.rtl)
|
|
3967
|
-
t = s.match(e.includePrerelease ?
|
|
3985
|
+
t = s.match(e.includePrerelease ? qe[Ye.COERCEFULL] : qe[Ye.COERCE]);
|
|
3968
3986
|
else {
|
|
3969
|
-
const c = e.includePrerelease ?
|
|
3987
|
+
const c = e.includePrerelease ? qe[Ye.COERCERTLFULL] : qe[Ye.COERCERTL];
|
|
3970
3988
|
let u;
|
|
3971
3989
|
for (; (u = c.exec(s)) && (!t || t.index + t[0].length !== s.length); )
|
|
3972
3990
|
(!t || u.index + u[0].length !== t.index + t[0].length) && (t = u), c.lastIndex = u.index + u[1].length + u[2].length;
|
|
@@ -3975,10 +3993,10 @@ const Va = H, Ua = Se, { safeRe: Xe, t: qe } = Be, Ja = (s, e) => {
|
|
|
3975
3993
|
if (t === null)
|
|
3976
3994
|
return null;
|
|
3977
3995
|
const r = t[2], o = t[3] || "0", n = t[4] || "0", i = e.includePrerelease && t[5] ? `-${t[5]}` : "", a = e.includePrerelease && t[6] ? `+${t[6]}` : "";
|
|
3978
|
-
return
|
|
3996
|
+
return Ma(`${r}.${o}.${n}${i}${a}`, e);
|
|
3979
3997
|
};
|
|
3980
|
-
var
|
|
3981
|
-
class
|
|
3998
|
+
var Ka = _a;
|
|
3999
|
+
class Ha {
|
|
3982
4000
|
constructor() {
|
|
3983
4001
|
this.max = 1e3, this.map = /* @__PURE__ */ new Map();
|
|
3984
4002
|
}
|
|
@@ -4001,10 +4019,10 @@ class Ma {
|
|
|
4001
4019
|
return this;
|
|
4002
4020
|
}
|
|
4003
4021
|
}
|
|
4004
|
-
var
|
|
4022
|
+
var Wa = Ha, ft, Ir;
|
|
4005
4023
|
function te() {
|
|
4006
|
-
if (
|
|
4007
|
-
|
|
4024
|
+
if (Ir) return ft;
|
|
4025
|
+
Ir = 1;
|
|
4008
4026
|
const s = /\s+/g;
|
|
4009
4027
|
class e {
|
|
4010
4028
|
constructor(p, m) {
|
|
@@ -4052,9 +4070,9 @@ function te() {
|
|
|
4052
4070
|
return b;
|
|
4053
4071
|
const S = this.options.loose, R = S ? c[u.HYPHENRANGELOOSE] : c[u.HYPHENRANGE];
|
|
4054
4072
|
p = p.replace(R, q(this.options.includePrerelease)), i("hyphen replace", p), p = p.replace(c[u.COMPARATORTRIM], l), i("comparator trim", p), p = p.replace(c[u.TILDETRIM], d), i("tilde trim", p), p = p.replace(c[u.CARETTRIM], f), i("caret trim", p);
|
|
4055
|
-
let
|
|
4056
|
-
S && (
|
|
4057
|
-
const C = /* @__PURE__ */ new Map(), I =
|
|
4073
|
+
let O = p.split(" ").map((F) => j(F, this.options)).join(" ").split(/\s+/).map((F) => V(F, this.options));
|
|
4074
|
+
S && (O = O.filter((F) => (i("loose invalid filter", F, this.options), !!F.match(c[u.COMPARATORLOOSE])))), i("range list", O);
|
|
4075
|
+
const C = /* @__PURE__ */ new Map(), I = O.map((F) => new n(F, this.options));
|
|
4058
4076
|
for (const F of I) {
|
|
4059
4077
|
if (g(F))
|
|
4060
4078
|
return [F];
|
|
@@ -4085,44 +4103,44 @@ function te() {
|
|
|
4085
4103
|
return !1;
|
|
4086
4104
|
}
|
|
4087
4105
|
}
|
|
4088
|
-
|
|
4089
|
-
const t =
|
|
4106
|
+
ft = e;
|
|
4107
|
+
const t = Wa, r = new t(), o = Gt, n = ct(), i = it, a = H, {
|
|
4090
4108
|
safeRe: c,
|
|
4091
4109
|
t: u,
|
|
4092
4110
|
comparatorTrimReplace: l,
|
|
4093
4111
|
tildeTrimReplace: d,
|
|
4094
4112
|
caretTrimReplace: f
|
|
4095
|
-
} =
|
|
4113
|
+
} = xe, { FLAG_INCLUDE_PRERELEASE: h, FLAG_LOOSE: E } = nt, g = (v) => v.value === "<0.0.0-0", D = (v) => v.value === "", T = (v, p) => {
|
|
4096
4114
|
let m = !0;
|
|
4097
4115
|
const y = v.slice();
|
|
4098
4116
|
let b = y.pop();
|
|
4099
4117
|
for (; m && y.length; )
|
|
4100
4118
|
m = y.every((S) => b.intersects(S, p)), b = y.pop();
|
|
4101
4119
|
return m;
|
|
4102
|
-
}, j = (v, p) => (i("comp", v, p), v = L(v, p), i("caret", v), v = G(v, p), i("tildes", v), v = ie(v, p), i("xrange", v), v = M(v, p), i("stars", v), v),
|
|
4120
|
+
}, j = (v, p) => (i("comp", v, p), v = L(v, p), i("caret", v), v = G(v, p), i("tildes", v), v = ie(v, p), i("xrange", v), v = M(v, p), i("stars", v), v), $ = (v) => !v || v.toLowerCase() === "x" || v === "*", G = (v, p) => v.trim().split(/\s+/).map((m) => he(m, p)).join(" "), he = (v, p) => {
|
|
4103
4121
|
const m = p.loose ? c[u.TILDELOOSE] : c[u.TILDE];
|
|
4104
|
-
return v.replace(m, (y, b, S, R,
|
|
4105
|
-
i("tilde", v, y, b, S, R,
|
|
4122
|
+
return v.replace(m, (y, b, S, R, O) => {
|
|
4123
|
+
i("tilde", v, y, b, S, R, O);
|
|
4106
4124
|
let C;
|
|
4107
|
-
return
|
|
4125
|
+
return $(b) ? C = "" : $(S) ? C = `>=${b}.0.0 <${+b + 1}.0.0-0` : $(R) ? C = `>=${b}.${S}.0 <${b}.${+S + 1}.0-0` : O ? (i("replaceTilde pr", O), C = `>=${b}.${S}.${R}-${O} <${b}.${+S + 1}.0-0`) : C = `>=${b}.${S}.${R} <${b}.${+S + 1}.0-0`, i("tilde return", C), C;
|
|
4108
4126
|
});
|
|
4109
4127
|
}, L = (v, p) => v.trim().split(/\s+/).map((m) => X(m, p)).join(" "), X = (v, p) => {
|
|
4110
4128
|
i("caret", v, p);
|
|
4111
4129
|
const m = p.loose ? c[u.CARETLOOSE] : c[u.CARET], y = p.includePrerelease ? "-0" : "";
|
|
4112
|
-
return v.replace(m, (b, S, R,
|
|
4113
|
-
i("caret", v, b, S, R,
|
|
4130
|
+
return v.replace(m, (b, S, R, O, C) => {
|
|
4131
|
+
i("caret", v, b, S, R, O, C);
|
|
4114
4132
|
let I;
|
|
4115
|
-
return
|
|
4133
|
+
return $(S) ? I = "" : $(R) ? I = `>=${S}.0.0${y} <${+S + 1}.0.0-0` : $(O) ? S === "0" ? I = `>=${S}.${R}.0${y} <${S}.${+R + 1}.0-0` : I = `>=${S}.${R}.0${y} <${+S + 1}.0.0-0` : C ? (i("replaceCaret pr", C), S === "0" ? R === "0" ? I = `>=${S}.${R}.${O}-${C} <${S}.${R}.${+O + 1}-0` : I = `>=${S}.${R}.${O}-${C} <${S}.${+R + 1}.0-0` : I = `>=${S}.${R}.${O}-${C} <${+S + 1}.0.0-0`) : (i("no pr"), S === "0" ? R === "0" ? I = `>=${S}.${R}.${O}${y} <${S}.${R}.${+O + 1}-0` : I = `>=${S}.${R}.${O}${y} <${S}.${+R + 1}.0-0` : I = `>=${S}.${R}.${O} <${+S + 1}.0.0-0`), i("caret return", I), I;
|
|
4116
4134
|
});
|
|
4117
4135
|
}, ie = (v, p) => (i("replaceXRanges", v, p), v.split(/\s+/).map((m) => W(m, p)).join(" ")), W = (v, p) => {
|
|
4118
4136
|
v = v.trim();
|
|
4119
4137
|
const m = p.loose ? c[u.XRANGELOOSE] : c[u.XRANGE];
|
|
4120
|
-
return v.replace(m, (y, b, S, R,
|
|
4121
|
-
i("xRange", v, y, b, S, R,
|
|
4122
|
-
const I =
|
|
4123
|
-
return b === "=" &&
|
|
4138
|
+
return v.replace(m, (y, b, S, R, O, C) => {
|
|
4139
|
+
i("xRange", v, y, b, S, R, O, C);
|
|
4140
|
+
const I = $(S), N = I || $(R), F = N || $(O), ne = F;
|
|
4141
|
+
return b === "=" && ne && (b = ""), C = p.includePrerelease ? "-0" : "", I ? b === ">" || b === "<" ? y = "<0.0.0-0" : y = "*" : b && ne ? (N && (R = 0), O = 0, b === ">" ? (b = ">=", N ? (S = +S + 1, R = 0, O = 0) : (R = +R + 1, O = 0)) : b === "<=" && (b = "<", N ? S = +S + 1 : R = +R + 1), b === "<" && (C = "-0"), y = `${b + S}.${R}.${O}${C}`) : N ? y = `>=${S}.0.0${C} <${+S + 1}.0.0-0` : F && (y = `>=${S}.${R}.0${C} <${S}.${+R + 1}.0-0`), i("xRange return", y), y;
|
|
4124
4142
|
});
|
|
4125
|
-
}, M = (v, p) => (i("replaceStars", v, p), v.trim().replace(c[u.STAR], "")), V = (v, p) => (i("replaceGTE0", v, p), v.trim().replace(c[p.includePrerelease ? u.GTE0PRE : u.GTE0], "")), q = (v) => (p, m, y, b, S, R,
|
|
4143
|
+
}, M = (v, p) => (i("replaceStars", v, p), v.trim().replace(c[u.STAR], "")), V = (v, p) => (i("replaceGTE0", v, p), v.trim().replace(c[p.includePrerelease ? u.GTE0PRE : u.GTE0], "")), q = (v) => (p, m, y, b, S, R, O, C, I, N, F, ne) => ($(y) ? m = "" : $(b) ? m = `>=${y}.0.0${v ? "-0" : ""}` : $(S) ? m = `>=${y}.${b}.0${v ? "-0" : ""}` : R ? m = `>=${m}` : m = `>=${m}${v ? "-0" : ""}`, $(I) ? C = "" : $(N) ? C = `<${+I + 1}.0.0-0` : $(F) ? C = `<${I}.${+N + 1}.0-0` : ne ? C = `<=${I}.${N}.${F}-${ne}` : v ? C = `<${I}.${N}.${+F + 1}-0` : C = `<=${C}`, `${m} ${C}`.trim()), fe = (v, p, m) => {
|
|
4126
4144
|
for (let y = 0; y < v.length; y++)
|
|
4127
4145
|
if (!v[y].test(p))
|
|
4128
4146
|
return !1;
|
|
@@ -4137,12 +4155,12 @@ function te() {
|
|
|
4137
4155
|
}
|
|
4138
4156
|
return !0;
|
|
4139
4157
|
};
|
|
4140
|
-
return
|
|
4158
|
+
return ft;
|
|
4141
4159
|
}
|
|
4142
|
-
var
|
|
4143
|
-
function
|
|
4144
|
-
if (
|
|
4145
|
-
|
|
4160
|
+
var gt, Ar;
|
|
4161
|
+
function ct() {
|
|
4162
|
+
if (Ar) return gt;
|
|
4163
|
+
Ar = 1;
|
|
4146
4164
|
const s = Symbol("SemVer ANY");
|
|
4147
4165
|
class e {
|
|
4148
4166
|
static get ANY() {
|
|
@@ -4182,62 +4200,62 @@ function at() {
|
|
|
4182
4200
|
return this.operator === "" ? this.value === "" ? !0 : new c(l.value, d).test(this.value) : l.operator === "" ? l.value === "" ? !0 : new c(this.value, d).test(l.semver) : (d = t(d), d.includePrerelease && (this.value === "<0.0.0-0" || l.value === "<0.0.0-0") || !d.includePrerelease && (this.value.startsWith("<0.0.0") || l.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && l.operator.startsWith(">") || this.operator.startsWith("<") && l.operator.startsWith("<") || this.semver.version === l.semver.version && this.operator.includes("=") && l.operator.includes("=") || n(this.semver, "<", l.semver, d) && this.operator.startsWith(">") && l.operator.startsWith("<") || n(this.semver, ">", l.semver, d) && this.operator.startsWith("<") && l.operator.startsWith(">")));
|
|
4183
4201
|
}
|
|
4184
4202
|
}
|
|
4185
|
-
|
|
4186
|
-
const t = Gt, { safeRe: r, t: o } =
|
|
4187
|
-
return
|
|
4203
|
+
gt = e;
|
|
4204
|
+
const t = Gt, { safeRe: r, t: o } = xe, n = Os, i = it, a = H, c = te();
|
|
4205
|
+
return gt;
|
|
4188
4206
|
}
|
|
4189
|
-
const
|
|
4207
|
+
const za = te(), Xa = (s, e, t) => {
|
|
4190
4208
|
try {
|
|
4191
|
-
e = new
|
|
4209
|
+
e = new za(e, t);
|
|
4192
4210
|
} catch {
|
|
4193
4211
|
return !1;
|
|
4194
4212
|
}
|
|
4195
4213
|
return e.test(s);
|
|
4196
4214
|
};
|
|
4197
|
-
var
|
|
4198
|
-
const
|
|
4199
|
-
var
|
|
4200
|
-
const
|
|
4215
|
+
var lt = Xa;
|
|
4216
|
+
const qa = te(), Ya = (s, e) => new qa(s, e).set.map((t) => t.map((r) => r.value).join(" ").trim().split(" "));
|
|
4217
|
+
var Qa = Ya;
|
|
4218
|
+
const Za = H, ec = te(), tc = (s, e, t) => {
|
|
4201
4219
|
let r = null, o = null, n = null;
|
|
4202
4220
|
try {
|
|
4203
|
-
n = new
|
|
4221
|
+
n = new ec(e, t);
|
|
4204
4222
|
} catch {
|
|
4205
4223
|
return null;
|
|
4206
4224
|
}
|
|
4207
4225
|
return s.forEach((i) => {
|
|
4208
|
-
n.test(i) && (!r || o.compare(i) === -1) && (r = i, o = new
|
|
4226
|
+
n.test(i) && (!r || o.compare(i) === -1) && (r = i, o = new Za(r, t));
|
|
4209
4227
|
}), r;
|
|
4210
4228
|
};
|
|
4211
|
-
var
|
|
4212
|
-
const
|
|
4229
|
+
var rc = tc;
|
|
4230
|
+
const sc = H, oc = te(), nc = (s, e, t) => {
|
|
4213
4231
|
let r = null, o = null, n = null;
|
|
4214
4232
|
try {
|
|
4215
|
-
n = new
|
|
4233
|
+
n = new oc(e, t);
|
|
4216
4234
|
} catch {
|
|
4217
4235
|
return null;
|
|
4218
4236
|
}
|
|
4219
4237
|
return s.forEach((i) => {
|
|
4220
|
-
n.test(i) && (!r || o.compare(i) === 1) && (r = i, o = new
|
|
4238
|
+
n.test(i) && (!r || o.compare(i) === 1) && (r = i, o = new sc(r, t));
|
|
4221
4239
|
}), r;
|
|
4222
4240
|
};
|
|
4223
|
-
var
|
|
4224
|
-
const
|
|
4225
|
-
s = new
|
|
4226
|
-
let t = new
|
|
4227
|
-
if (s.test(t) || (t = new
|
|
4241
|
+
var ic = nc;
|
|
4242
|
+
const mt = H, ac = te(), Tr = at, cc = (s, e) => {
|
|
4243
|
+
s = new ac(s, e);
|
|
4244
|
+
let t = new mt("0.0.0");
|
|
4245
|
+
if (s.test(t) || (t = new mt("0.0.0-0"), s.test(t)))
|
|
4228
4246
|
return t;
|
|
4229
4247
|
t = null;
|
|
4230
4248
|
for (let r = 0; r < s.set.length; ++r) {
|
|
4231
4249
|
const o = s.set[r];
|
|
4232
4250
|
let n = null;
|
|
4233
4251
|
o.forEach((i) => {
|
|
4234
|
-
const a = new
|
|
4252
|
+
const a = new mt(i.semver.version);
|
|
4235
4253
|
switch (i.operator) {
|
|
4236
4254
|
case ">":
|
|
4237
4255
|
a.prerelease.length === 0 ? a.patch++ : a.prerelease.push(0), a.raw = a.format();
|
|
4238
4256
|
case "":
|
|
4239
4257
|
case ">=":
|
|
4240
|
-
(!n ||
|
|
4258
|
+
(!n || Tr(a, n)) && (n = a);
|
|
4241
4259
|
break;
|
|
4242
4260
|
case "<":
|
|
4243
4261
|
case "<=":
|
|
@@ -4245,39 +4263,39 @@ const gt = H, oc = te(), Ir = it, nc = (s, e) => {
|
|
|
4245
4263
|
default:
|
|
4246
4264
|
throw new Error(`Unexpected operation: ${i.operator}`);
|
|
4247
4265
|
}
|
|
4248
|
-
}), n && (!t ||
|
|
4266
|
+
}), n && (!t || Tr(t, n)) && (t = n);
|
|
4249
4267
|
}
|
|
4250
4268
|
return t && s.test(t) ? t : null;
|
|
4251
4269
|
};
|
|
4252
|
-
var
|
|
4253
|
-
const
|
|
4270
|
+
var lc = cc;
|
|
4271
|
+
const uc = te(), dc = (s, e) => {
|
|
4254
4272
|
try {
|
|
4255
|
-
return new
|
|
4273
|
+
return new uc(s, e).range || "*";
|
|
4256
4274
|
} catch {
|
|
4257
4275
|
return null;
|
|
4258
4276
|
}
|
|
4259
4277
|
};
|
|
4260
|
-
var
|
|
4261
|
-
const
|
|
4262
|
-
s = new
|
|
4278
|
+
var pc = dc;
|
|
4279
|
+
const hc = H, $s = ct(), { ANY: fc } = $s, gc = te(), mc = lt, Lr = at, Dr = _t, vc = Ht, yc = Kt, wc = (s, e, t, r) => {
|
|
4280
|
+
s = new hc(s, r), e = new gc(e, r);
|
|
4263
4281
|
let o, n, i, a, c;
|
|
4264
4282
|
switch (t) {
|
|
4265
4283
|
case ">":
|
|
4266
|
-
o =
|
|
4284
|
+
o = Lr, n = vc, i = Dr, a = ">", c = ">=";
|
|
4267
4285
|
break;
|
|
4268
4286
|
case "<":
|
|
4269
|
-
o =
|
|
4287
|
+
o = Dr, n = yc, i = Lr, a = "<", c = "<=";
|
|
4270
4288
|
break;
|
|
4271
4289
|
default:
|
|
4272
4290
|
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
4273
4291
|
}
|
|
4274
|
-
if (
|
|
4292
|
+
if (mc(s, e, r))
|
|
4275
4293
|
return !1;
|
|
4276
4294
|
for (let u = 0; u < e.set.length; ++u) {
|
|
4277
4295
|
const l = e.set[u];
|
|
4278
4296
|
let d = null, f = null;
|
|
4279
4297
|
if (l.forEach((h) => {
|
|
4280
|
-
h.semver ===
|
|
4298
|
+
h.semver === fc && (h = new $s(">=0.0.0")), d = d || h, f = f || h, o(h.semver, d.semver, r) ? d = h : i(h.semver, f.semver, r) && (f = h);
|
|
4281
4299
|
}), d.operator === a || d.operator === c || (!f.operator || f.operator === a) && n(s, f.semver))
|
|
4282
4300
|
return !1;
|
|
4283
4301
|
if (f.operator === c && i(s, f.semver))
|
|
@@ -4285,20 +4303,20 @@ const uc = H, ks = at(), { ANY: dc } = ks, pc = te(), hc = ct, Ar = it, Tr = _t,
|
|
|
4285
4303
|
}
|
|
4286
4304
|
return !0;
|
|
4287
4305
|
};
|
|
4288
|
-
var Wt =
|
|
4289
|
-
const
|
|
4290
|
-
var wc = yc;
|
|
4291
|
-
const Sc = Wt, bc = (s, e, t) => Sc(s, e, "<", t);
|
|
4306
|
+
var Wt = wc;
|
|
4307
|
+
const Sc = Wt, bc = (s, e, t) => Sc(s, e, ">", t);
|
|
4292
4308
|
var Rc = bc;
|
|
4293
|
-
const
|
|
4294
|
-
var
|
|
4295
|
-
const
|
|
4296
|
-
var
|
|
4309
|
+
const Ec = Wt, Cc = (s, e, t) => Ec(s, e, "<", t);
|
|
4310
|
+
var Pc = Cc;
|
|
4311
|
+
const Nr = te(), kc = (s, e, t) => (s = new Nr(s, t), e = new Nr(e, t), s.intersects(e, t));
|
|
4312
|
+
var Oc = kc;
|
|
4313
|
+
const $c = lt, Fc = ee;
|
|
4314
|
+
var Ic = (s, e, t) => {
|
|
4297
4315
|
const r = [];
|
|
4298
4316
|
let o = null, n = null;
|
|
4299
|
-
const i = s.sort((l, d) =>
|
|
4317
|
+
const i = s.sort((l, d) => Fc(l, d, t));
|
|
4300
4318
|
for (const l of i)
|
|
4301
|
-
|
|
4319
|
+
$c(l, e, t) ? (n = l, o || (o = l)) : (n && r.push([o, n]), n = null, o = null);
|
|
4302
4320
|
o && r.push([o, null]);
|
|
4303
4321
|
const a = [];
|
|
4304
4322
|
for (const [l, d] of r)
|
|
@@ -4306,14 +4324,14 @@ var $c = (s, e, t) => {
|
|
|
4306
4324
|
const c = a.join(" || "), u = typeof e.raw == "string" ? e.raw : String(e);
|
|
4307
4325
|
return c.length < u.length ? c : e;
|
|
4308
4326
|
};
|
|
4309
|
-
const
|
|
4327
|
+
const Br = te(), zt = ct(), { ANY: vt } = zt, Ce = lt, Xt = ee, Ac = (s, e, t = {}) => {
|
|
4310
4328
|
if (s === e)
|
|
4311
4329
|
return !0;
|
|
4312
|
-
s = new
|
|
4330
|
+
s = new Br(s, t), e = new Br(e, t);
|
|
4313
4331
|
let r = !1;
|
|
4314
4332
|
e: for (const o of s.set) {
|
|
4315
4333
|
for (const n of e.set) {
|
|
4316
|
-
const i =
|
|
4334
|
+
const i = Lc(o, n, t);
|
|
4317
4335
|
if (r = r || i !== null, i)
|
|
4318
4336
|
continue e;
|
|
4319
4337
|
}
|
|
@@ -4321,23 +4339,23 @@ const Dr = te(), zt = at(), { ANY: mt } = zt, Ee = ct, Xt = ee, Oc = (s, e, t =
|
|
|
4321
4339
|
return !1;
|
|
4322
4340
|
}
|
|
4323
4341
|
return !0;
|
|
4324
|
-
},
|
|
4342
|
+
}, Tc = [new zt(">=0.0.0-0")], xr = [new zt(">=0.0.0")], Lc = (s, e, t) => {
|
|
4325
4343
|
if (s === e)
|
|
4326
4344
|
return !0;
|
|
4327
|
-
if (s.length === 1 && s[0].semver ===
|
|
4328
|
-
if (e.length === 1 && e[0].semver ===
|
|
4345
|
+
if (s.length === 1 && s[0].semver === vt) {
|
|
4346
|
+
if (e.length === 1 && e[0].semver === vt)
|
|
4329
4347
|
return !0;
|
|
4330
|
-
t.includePrerelease ? s =
|
|
4348
|
+
t.includePrerelease ? s = Tc : s = xr;
|
|
4331
4349
|
}
|
|
4332
|
-
if (e.length === 1 && e[0].semver ===
|
|
4350
|
+
if (e.length === 1 && e[0].semver === vt) {
|
|
4333
4351
|
if (t.includePrerelease)
|
|
4334
4352
|
return !0;
|
|
4335
|
-
e =
|
|
4353
|
+
e = xr;
|
|
4336
4354
|
}
|
|
4337
4355
|
const r = /* @__PURE__ */ new Set();
|
|
4338
4356
|
let o, n;
|
|
4339
4357
|
for (const h of s)
|
|
4340
|
-
h.operator === ">" || h.operator === ">=" ? o =
|
|
4358
|
+
h.operator === ">" || h.operator === ">=" ? o = jr(o, h, t) : h.operator === "<" || h.operator === "<=" ? n = Vr(n, h, t) : r.add(h.semver);
|
|
4341
4359
|
if (r.size > 1)
|
|
4342
4360
|
return null;
|
|
4343
4361
|
let i;
|
|
@@ -4348,10 +4366,10 @@ const Dr = te(), zt = at(), { ANY: mt } = zt, Ee = ct, Xt = ee, Oc = (s, e, t =
|
|
|
4348
4366
|
return null;
|
|
4349
4367
|
}
|
|
4350
4368
|
for (const h of r) {
|
|
4351
|
-
if (o && !
|
|
4369
|
+
if (o && !Ce(h, String(o), t) || n && !Ce(h, String(n), t))
|
|
4352
4370
|
return null;
|
|
4353
4371
|
for (const E of e)
|
|
4354
|
-
if (!
|
|
4372
|
+
if (!Ce(h, String(E), t))
|
|
4355
4373
|
return !1;
|
|
4356
4374
|
return !0;
|
|
4357
4375
|
}
|
|
@@ -4360,88 +4378,88 @@ const Dr = te(), zt = at(), { ANY: mt } = zt, Ee = ct, Xt = ee, Oc = (s, e, t =
|
|
|
4360
4378
|
for (const h of e) {
|
|
4361
4379
|
if (l = l || h.operator === ">" || h.operator === ">=", u = u || h.operator === "<" || h.operator === "<=", o) {
|
|
4362
4380
|
if (f && h.semver.prerelease && h.semver.prerelease.length && h.semver.major === f.major && h.semver.minor === f.minor && h.semver.patch === f.patch && (f = !1), h.operator === ">" || h.operator === ">=") {
|
|
4363
|
-
if (a =
|
|
4381
|
+
if (a = jr(o, h, t), a === h && a !== o)
|
|
4364
4382
|
return !1;
|
|
4365
|
-
} else if (o.operator === ">=" && !
|
|
4383
|
+
} else if (o.operator === ">=" && !Ce(o.semver, String(h), t))
|
|
4366
4384
|
return !1;
|
|
4367
4385
|
}
|
|
4368
4386
|
if (n) {
|
|
4369
4387
|
if (d && h.semver.prerelease && h.semver.prerelease.length && h.semver.major === d.major && h.semver.minor === d.minor && h.semver.patch === d.patch && (d = !1), h.operator === "<" || h.operator === "<=") {
|
|
4370
|
-
if (c =
|
|
4388
|
+
if (c = Vr(n, h, t), c === h && c !== n)
|
|
4371
4389
|
return !1;
|
|
4372
|
-
} else if (n.operator === "<=" && !
|
|
4390
|
+
} else if (n.operator === "<=" && !Ce(n.semver, String(h), t))
|
|
4373
4391
|
return !1;
|
|
4374
4392
|
}
|
|
4375
4393
|
if (!h.operator && (n || o) && i !== 0)
|
|
4376
4394
|
return !1;
|
|
4377
4395
|
}
|
|
4378
4396
|
return !(o && u && !n && i !== 0 || n && l && !o && i !== 0 || f || d);
|
|
4379
|
-
},
|
|
4397
|
+
}, jr = (s, e, t) => {
|
|
4380
4398
|
if (!s)
|
|
4381
4399
|
return e;
|
|
4382
4400
|
const r = Xt(s.semver, e.semver, t);
|
|
4383
4401
|
return r > 0 ? s : r < 0 || e.operator === ">" && s.operator === ">=" ? e : s;
|
|
4384
|
-
},
|
|
4402
|
+
}, Vr = (s, e, t) => {
|
|
4385
4403
|
if (!s)
|
|
4386
4404
|
return e;
|
|
4387
4405
|
const r = Xt(s.semver, e.semver, t);
|
|
4388
4406
|
return r < 0 ? s : r > 0 || e.operator === "<" && s.operator === "<=" ? e : s;
|
|
4389
4407
|
};
|
|
4390
|
-
var
|
|
4391
|
-
const
|
|
4392
|
-
var
|
|
4393
|
-
parse:
|
|
4394
|
-
valid:
|
|
4395
|
-
clean:
|
|
4396
|
-
inc:
|
|
4397
|
-
diff:
|
|
4398
|
-
major:
|
|
4399
|
-
minor:
|
|
4400
|
-
patch:
|
|
4401
|
-
prerelease:
|
|
4402
|
-
compare:
|
|
4403
|
-
rcompare:
|
|
4404
|
-
compareLoose:
|
|
4405
|
-
compareBuild:
|
|
4406
|
-
sort:
|
|
4407
|
-
rsort:
|
|
4408
|
-
gt:
|
|
4409
|
-
lt:
|
|
4410
|
-
eq:
|
|
4411
|
-
neq:
|
|
4412
|
-
gte:
|
|
4413
|
-
lte:
|
|
4414
|
-
cmp:
|
|
4415
|
-
coerce:
|
|
4416
|
-
Comparator:
|
|
4417
|
-
Range:
|
|
4418
|
-
satisfies:
|
|
4419
|
-
toComparators:
|
|
4420
|
-
maxSatisfying:
|
|
4421
|
-
minSatisfying:
|
|
4422
|
-
minVersion:
|
|
4423
|
-
validRange:
|
|
4424
|
-
outside:
|
|
4425
|
-
gtr:
|
|
4426
|
-
ltr:
|
|
4427
|
-
intersects:
|
|
4428
|
-
simplifyRange:
|
|
4429
|
-
subset:
|
|
4430
|
-
SemVer:
|
|
4431
|
-
re:
|
|
4432
|
-
src:
|
|
4433
|
-
tokens:
|
|
4434
|
-
SEMVER_SPEC_VERSION:
|
|
4435
|
-
RELEASE_TYPES:
|
|
4436
|
-
compareIdentifiers:
|
|
4437
|
-
rcompareIdentifiers:
|
|
4408
|
+
var Dc = Ac;
|
|
4409
|
+
const yt = xe, Ur = nt, Nc = H, Jr = Cs, Bc = be, xc = Mi, jc = Hi, Vc = zi, Uc = qi, Jc = Zi, Gc = ra, Mc = na, _c = ca, Kc = ee, Hc = pa, Wc = ga, zc = Mt, Xc = wa, qc = Ra, Yc = at, Qc = _t, Zc = Ps, el = ks, tl = Kt, rl = Ht, sl = Os, ol = Ka, nl = ct(), il = te(), al = lt, cl = Qa, ll = rc, ul = ic, dl = lc, pl = pc, hl = Wt, fl = Rc, gl = Pc, ml = Oc, vl = Ic, yl = Dc;
|
|
4410
|
+
var wl = {
|
|
4411
|
+
parse: Bc,
|
|
4412
|
+
valid: xc,
|
|
4413
|
+
clean: jc,
|
|
4414
|
+
inc: Vc,
|
|
4415
|
+
diff: Uc,
|
|
4416
|
+
major: Jc,
|
|
4417
|
+
minor: Gc,
|
|
4418
|
+
patch: Mc,
|
|
4419
|
+
prerelease: _c,
|
|
4420
|
+
compare: Kc,
|
|
4421
|
+
rcompare: Hc,
|
|
4422
|
+
compareLoose: Wc,
|
|
4423
|
+
compareBuild: zc,
|
|
4424
|
+
sort: Xc,
|
|
4425
|
+
rsort: qc,
|
|
4426
|
+
gt: Yc,
|
|
4427
|
+
lt: Qc,
|
|
4428
|
+
eq: Zc,
|
|
4429
|
+
neq: el,
|
|
4430
|
+
gte: tl,
|
|
4431
|
+
lte: rl,
|
|
4432
|
+
cmp: sl,
|
|
4433
|
+
coerce: ol,
|
|
4434
|
+
Comparator: nl,
|
|
4435
|
+
Range: il,
|
|
4436
|
+
satisfies: al,
|
|
4437
|
+
toComparators: cl,
|
|
4438
|
+
maxSatisfying: ll,
|
|
4439
|
+
minSatisfying: ul,
|
|
4440
|
+
minVersion: dl,
|
|
4441
|
+
validRange: pl,
|
|
4442
|
+
outside: hl,
|
|
4443
|
+
gtr: fl,
|
|
4444
|
+
ltr: gl,
|
|
4445
|
+
intersects: ml,
|
|
4446
|
+
simplifyRange: vl,
|
|
4447
|
+
subset: yl,
|
|
4448
|
+
SemVer: Nc,
|
|
4449
|
+
re: yt.re,
|
|
4450
|
+
src: yt.src,
|
|
4451
|
+
tokens: yt.t,
|
|
4452
|
+
SEMVER_SPEC_VERSION: Ur.SEMVER_SPEC_VERSION,
|
|
4453
|
+
RELEASE_TYPES: Ur.RELEASE_TYPES,
|
|
4454
|
+
compareIdentifiers: Jr.compareIdentifiers,
|
|
4455
|
+
rcompareIdentifiers: Jr.rcompareIdentifiers
|
|
4438
4456
|
};
|
|
4439
|
-
const
|
|
4457
|
+
const Sl = /* @__PURE__ */ Oi(wl), bl = {
|
|
4440
4458
|
minDelay: 1500
|
|
4441
|
-
},
|
|
4442
|
-
class
|
|
4459
|
+
}, Rl = "__no_updates__";
|
|
4460
|
+
class El extends ro {
|
|
4443
4461
|
constructor(t, r, o = {}) {
|
|
4444
|
-
super({ ...o, ...
|
|
4462
|
+
super({ ...o, ...bl }, r);
|
|
4445
4463
|
w(this, "http");
|
|
4446
4464
|
w(this, "preferredUpdateChannel");
|
|
4447
4465
|
this.registryProvider = t, this.http = o.http, this.preferredUpdateChannel = o.preferredUpdateChannel;
|
|
@@ -4455,7 +4473,7 @@ class Sl extends Zs {
|
|
|
4455
4473
|
case "from-registry-v2":
|
|
4456
4474
|
return `from_registry_v2_${Z(t)}`;
|
|
4457
4475
|
default:
|
|
4458
|
-
return
|
|
4476
|
+
return Rl;
|
|
4459
4477
|
}
|
|
4460
4478
|
}
|
|
4461
4479
|
async readValue(t) {
|
|
@@ -4465,14 +4483,14 @@ class Sl extends Zs {
|
|
|
4465
4483
|
switch (n.type) {
|
|
4466
4484
|
case "dev-v1":
|
|
4467
4485
|
try {
|
|
4468
|
-
const i = await
|
|
4486
|
+
const i = await es(n.folder);
|
|
4469
4487
|
return i === n.mtime ? { suggestions: [] } : { mainSuggestion: { ...n, mtime: i }, suggestions: [] };
|
|
4470
4488
|
} catch (i) {
|
|
4471
4489
|
return this.logger.warn(i), { suggestions: [] };
|
|
4472
4490
|
}
|
|
4473
4491
|
case "dev-v2":
|
|
4474
4492
|
try {
|
|
4475
|
-
const i = await
|
|
4493
|
+
const i = await bt(n.folder, this.logger);
|
|
4476
4494
|
if (i === void 0) return { suggestions: [] };
|
|
4477
4495
|
const a = await Bt(i);
|
|
4478
4496
|
return a === n.mtime ? { suggestions: [] } : { mainSuggestion: { ...n, mtime: a }, suggestions: [] };
|
|
@@ -4487,11 +4505,11 @@ class Sl extends Zs {
|
|
|
4487
4505
|
let u = this.preferredUpdateChannel;
|
|
4488
4506
|
if (u === void 0)
|
|
4489
4507
|
if (n.channel === void 0)
|
|
4490
|
-
if (await c.getLatestOverview(n.id,
|
|
4508
|
+
if (await c.getLatestOverview(n.id, Fe)) u = Fe;
|
|
4491
4509
|
else {
|
|
4492
4510
|
if (await c.getLatestOverview(n.id, $e) === void 0)
|
|
4493
4511
|
return this.logger.error(
|
|
4494
|
-
`No "any" channel record for ${
|
|
4512
|
+
`No "any" channel record for ${xs(n.id)}`
|
|
4495
4513
|
), { suggestions: [] };
|
|
4496
4514
|
u = $e;
|
|
4497
4515
|
}
|
|
@@ -4516,7 +4534,7 @@ class Sl extends Zs {
|
|
|
4516
4534
|
update: { ...n, id: { ...n.id, version: g } }
|
|
4517
4535
|
}));
|
|
4518
4536
|
if (d === void 0) return { suggestions: f };
|
|
4519
|
-
if (a !== void 0 &&
|
|
4537
|
+
if (a !== void 0 && Sl.lte(d, a))
|
|
4520
4538
|
return { suggestions: f };
|
|
4521
4539
|
const h = {
|
|
4522
4540
|
...n,
|
|
@@ -4543,7 +4561,7 @@ class Sl extends Zs {
|
|
|
4543
4561
|
return Z(t) === Z(r);
|
|
4544
4562
|
}
|
|
4545
4563
|
}
|
|
4546
|
-
class
|
|
4564
|
+
class Gr {
|
|
4547
4565
|
constructor() {
|
|
4548
4566
|
w(this, "resources", /* @__PURE__ */ new Map());
|
|
4549
4567
|
}
|
|
@@ -4574,17 +4592,18 @@ class Ur {
|
|
|
4574
4592
|
return (t = this.resources.get(e)) == null ? void 0 : t.resource;
|
|
4575
4593
|
}
|
|
4576
4594
|
}
|
|
4577
|
-
let
|
|
4578
|
-
function
|
|
4579
|
-
return
|
|
4595
|
+
let Pe;
|
|
4596
|
+
function se() {
|
|
4597
|
+
return Pe || (Pe = {
|
|
4580
4598
|
logPFrameRequests: process.env.MI_LOG_PFRAMES !== void 0,
|
|
4581
|
-
usePFrameRs: process.env.MI_USE_PFRAMES_RS !== void 0
|
|
4582
|
-
|
|
4599
|
+
usePFrameRs: process.env.MI_USE_PFRAMES_RS !== void 0,
|
|
4600
|
+
dumpInitialTreeState: process.env.MI_DUMP_INITIAL_TREE_STATE !== void 0
|
|
4601
|
+
}, process.env.MI_LOG_TREE_STAT && (Pe.logTreeStats = process.env.MI_LOG_TREE_STAT === "cumulative" ? "cumulative" : "per-request"), Pe);
|
|
4583
4602
|
}
|
|
4584
|
-
function
|
|
4603
|
+
function Te(s) {
|
|
4585
4604
|
return String(s.id);
|
|
4586
4605
|
}
|
|
4587
|
-
const
|
|
4606
|
+
const Cl = ["Int", "Long", "Float", "Double", "String", "Bytes"];
|
|
4588
4607
|
function me(s) {
|
|
4589
4608
|
const e = [], t = [];
|
|
4590
4609
|
for (const r of s)
|
|
@@ -4600,16 +4619,16 @@ function me(s) {
|
|
|
4600
4619
|
}
|
|
4601
4620
|
return t;
|
|
4602
4621
|
}
|
|
4603
|
-
function
|
|
4604
|
-
return
|
|
4622
|
+
function wt(s) {
|
|
4623
|
+
return se().usePFrameRs ? s.rustCallback() : s.rustCallback().catch((e) => {
|
|
4605
4624
|
var t;
|
|
4606
4625
|
if (((t = s.signal) == null ? void 0 : t.aborted) === !1)
|
|
4607
4626
|
return e instanceof Error && s.logger.warn(`PFrames Rust failed, error: ${e.message}`), s.cppCallback();
|
|
4608
4627
|
throw e;
|
|
4609
4628
|
});
|
|
4610
4629
|
}
|
|
4611
|
-
const
|
|
4612
|
-
class
|
|
4630
|
+
const ke = (s, e) => typeof e == "bigint" ? e.toString() : e;
|
|
4631
|
+
class Pl {
|
|
4613
4632
|
constructor(e, t, r, o) {
|
|
4614
4633
|
w(this, "rustPFrame");
|
|
4615
4634
|
w(this, "blobIdToResource", /* @__PURE__ */ new Map());
|
|
@@ -4645,19 +4664,19 @@ class Rl {
|
|
|
4645
4664
|
}
|
|
4646
4665
|
};
|
|
4647
4666
|
for (const a of o)
|
|
4648
|
-
for (const c of
|
|
4649
|
-
this.blobIdToResource.set(
|
|
4667
|
+
for (const c of Sn(a.data))
|
|
4668
|
+
this.blobIdToResource.set(Te(c), c);
|
|
4650
4669
|
const i = [
|
|
4651
4670
|
...new Map(o.map((a) => ({
|
|
4652
4671
|
...a,
|
|
4653
|
-
data:
|
|
4672
|
+
data: bn(a.data, Te)
|
|
4654
4673
|
})).map(
|
|
4655
4674
|
(a) => [Z(a), a]
|
|
4656
4675
|
)).values()
|
|
4657
4676
|
];
|
|
4658
4677
|
this.rustPFrame = (() => {
|
|
4659
4678
|
try {
|
|
4660
|
-
const a = new
|
|
4679
|
+
const a = new Ro(se().logPFrameRequests ? n : void 0);
|
|
4661
4680
|
a.setDataSource(this);
|
|
4662
4681
|
for (const c of i)
|
|
4663
4682
|
a.addColumnSpec(c.id, c.spec), a.setColumnData(c.id, c.data);
|
|
@@ -4669,7 +4688,7 @@ class Rl {
|
|
|
4669
4688
|
}
|
|
4670
4689
|
})(), this.createDataPFrame = () => {
|
|
4671
4690
|
try {
|
|
4672
|
-
const a =
|
|
4691
|
+
const a = se().logPFrameRequests ? new or(n) : new or();
|
|
4673
4692
|
a.setDataSource(this);
|
|
4674
4693
|
for (const c of i)
|
|
4675
4694
|
try {
|
|
@@ -4708,7 +4727,7 @@ class Rl {
|
|
|
4708
4727
|
this.rustPFrame.dispose();
|
|
4709
4728
|
}
|
|
4710
4729
|
}
|
|
4711
|
-
class
|
|
4730
|
+
class kl {
|
|
4712
4731
|
constructor(e) {
|
|
4713
4732
|
this.table = e;
|
|
4714
4733
|
}
|
|
@@ -4716,7 +4735,7 @@ class El {
|
|
|
4716
4735
|
this.table.then((e) => e.dispose());
|
|
4717
4736
|
}
|
|
4718
4737
|
}
|
|
4719
|
-
class
|
|
4738
|
+
class Ol {
|
|
4720
4739
|
constructor(e, t) {
|
|
4721
4740
|
w(this, "pFrames");
|
|
4722
4741
|
w(this, "pTables");
|
|
@@ -4724,40 +4743,40 @@ class Cl {
|
|
|
4724
4743
|
/** Limits concurrent requests to PFrame API to prevent deadlock with Node's IO threads */
|
|
4725
4744
|
w(this, "concurrencyLimiter");
|
|
4726
4745
|
this.blobDriver = e, this.logger = t;
|
|
4727
|
-
const r = new
|
|
4746
|
+
const r = new qr({
|
|
4728
4747
|
maxSize: 1e9,
|
|
4729
4748
|
// 1Gb
|
|
4730
|
-
fetchMethod: async (n) => await
|
|
4749
|
+
fetchMethod: async (n) => await zr.readFile(n),
|
|
4731
4750
|
sizeCalculation: (n) => n.length
|
|
4732
4751
|
});
|
|
4733
4752
|
this.blobContentCache = r;
|
|
4734
|
-
const o = new
|
|
4735
|
-
this.concurrencyLimiter = o, this.pFrames = new class extends
|
|
4753
|
+
const o = new _s(1);
|
|
4754
|
+
this.concurrencyLimiter = o, this.pFrames = new class extends Gr {
|
|
4736
4755
|
constructor(n, i) {
|
|
4737
4756
|
super(), this.blobDriver = n, this.logger = i;
|
|
4738
4757
|
}
|
|
4739
4758
|
createNewResource(n) {
|
|
4740
|
-
return
|
|
4741
|
-
`PFrame creation (pFrameHandle = ${this.calculateParamsKey(n)}): ${JSON.stringify(n,
|
|
4742
|
-
), new
|
|
4759
|
+
return se().logPFrameRequests && t.info(
|
|
4760
|
+
`PFrame creation (pFrameHandle = ${this.calculateParamsKey(n)}): ${JSON.stringify(n, ke)}`
|
|
4761
|
+
), new Pl(this.blobDriver, this.logger, r, n);
|
|
4743
4762
|
}
|
|
4744
4763
|
calculateParamsKey(n) {
|
|
4745
|
-
return
|
|
4764
|
+
return Fl(n);
|
|
4746
4765
|
}
|
|
4747
|
-
}(this.blobDriver, this.logger), this.pTables = new class extends
|
|
4766
|
+
}(this.blobDriver, this.logger), this.pTables = new class extends Gr {
|
|
4748
4767
|
constructor(n) {
|
|
4749
4768
|
super(), this.pFrames = n;
|
|
4750
4769
|
}
|
|
4751
4770
|
createNewResource(n) {
|
|
4752
4771
|
const i = n.pFrameHandle;
|
|
4753
|
-
|
|
4754
|
-
`PTable creation (pTableHandle = ${this.calculateParamsKey(n)}): ${JSON.stringify(n,
|
|
4772
|
+
se().logPFrameRequests && t.info(
|
|
4773
|
+
`PTable creation (pTableHandle = ${this.calculateParamsKey(n)}): ${JSON.stringify(n, ke)}`
|
|
4755
4774
|
);
|
|
4756
|
-
const a =
|
|
4775
|
+
const a = wt({
|
|
4757
4776
|
cppCallback: () => o.run(async () => {
|
|
4758
4777
|
var u = [];
|
|
4759
4778
|
try {
|
|
4760
|
-
const c =
|
|
4779
|
+
const c = je(u, this.pFrames.getByKey(i).disposableDataPFrame);
|
|
4761
4780
|
return await c.dataPFrame.createTable({
|
|
4762
4781
|
src: ue(n.def.src),
|
|
4763
4782
|
filters: me(n.def.filters)
|
|
@@ -4765,7 +4784,7 @@ class Cl {
|
|
|
4765
4784
|
} catch (l) {
|
|
4766
4785
|
var d = l, f = !0;
|
|
4767
4786
|
} finally {
|
|
4768
|
-
|
|
4787
|
+
Ve(u, d, f);
|
|
4769
4788
|
}
|
|
4770
4789
|
}).then(async (c) => {
|
|
4771
4790
|
if (n.def.sorting.length === 0) return c;
|
|
@@ -4790,10 +4809,10 @@ class Cl {
|
|
|
4790
4809
|
filters: n.def.filters,
|
|
4791
4810
|
signal: n.signal
|
|
4792
4811
|
});
|
|
4793
|
-
return new
|
|
4812
|
+
return new kl(a);
|
|
4794
4813
|
}
|
|
4795
4814
|
calculateParamsKey(n) {
|
|
4796
|
-
return
|
|
4815
|
+
return $l(n);
|
|
4797
4816
|
}
|
|
4798
4817
|
}(this.pFrames);
|
|
4799
4818
|
}
|
|
@@ -4801,20 +4820,20 @@ class Cl {
|
|
|
4801
4820
|
// Internal / Config API Methods
|
|
4802
4821
|
//
|
|
4803
4822
|
createPFrame(e, t) {
|
|
4804
|
-
const r = e.filter((n) =>
|
|
4823
|
+
const r = e.filter((n) => Cl.find((i) => i === n.spec.valueType)).map(
|
|
4805
4824
|
(n) => le(
|
|
4806
4825
|
n,
|
|
4807
|
-
(i) =>
|
|
4826
|
+
(i) => to(i) ? On(i) : $n(n.spec, i)
|
|
4808
4827
|
)
|
|
4809
4828
|
), o = this.pFrames.acquire(r);
|
|
4810
4829
|
return t.addOnDestroy(o.unref), o.key;
|
|
4811
4830
|
}
|
|
4812
4831
|
createPTable(e, t, r) {
|
|
4813
|
-
const o = this.createPFrame(
|
|
4814
|
-
return
|
|
4832
|
+
const o = this.createPFrame(Bs(e.src), t), n = St(e, (a) => a.id), i = this.pTables.acquire({ def: n, pFrameHandle: o, signal: r });
|
|
4833
|
+
return se().logPFrameRequests && this.logger.info(
|
|
4815
4834
|
`Create PTable call (pFrameHandle = ${o}; pTableHandle = ${JSON.stringify(i)}): ${JSON.stringify(
|
|
4816
|
-
|
|
4817
|
-
|
|
4835
|
+
St(e, (a) => a.spec),
|
|
4836
|
+
ke
|
|
4818
4837
|
)}`
|
|
4819
4838
|
), t.addOnDestroy(i.unref), i.key;
|
|
4820
4839
|
}
|
|
@@ -4847,13 +4866,13 @@ class Cl {
|
|
|
4847
4866
|
return await this.pFrames.getByKey(e).rustPFrame.listColumns();
|
|
4848
4867
|
}
|
|
4849
4868
|
async calculateTableData(e, t, r) {
|
|
4850
|
-
return
|
|
4851
|
-
`Call calculateTableData, handle = ${e}, request = ${JSON.stringify(t,
|
|
4852
|
-
), await
|
|
4869
|
+
return se().logPFrameRequests && this.logger.info(
|
|
4870
|
+
`Call calculateTableData, handle = ${e}, request = ${JSON.stringify(t, ke)}`
|
|
4871
|
+
), await wt({
|
|
4853
4872
|
cppCallback: async () => await this.concurrencyLimiter.run(async () => {
|
|
4854
4873
|
var n = [];
|
|
4855
4874
|
try {
|
|
4856
|
-
const o =
|
|
4875
|
+
const o = je(n, this.pFrames.getByKey(e).disposableDataPFrame);
|
|
4857
4876
|
return await o.dataPFrame.createTable({
|
|
4858
4877
|
src: ue(t.src),
|
|
4859
4878
|
filters: me(t.filters)
|
|
@@ -4861,7 +4880,7 @@ class Cl {
|
|
|
4861
4880
|
} catch (i) {
|
|
4862
4881
|
var a = i, c = !0;
|
|
4863
4882
|
} finally {
|
|
4864
|
-
|
|
4883
|
+
Ve(n, a, c);
|
|
4865
4884
|
}
|
|
4866
4885
|
}).then(async (o) => {
|
|
4867
4886
|
if (t.sorting.length === 0) return o;
|
|
@@ -4910,13 +4929,13 @@ class Cl {
|
|
|
4910
4929
|
});
|
|
4911
4930
|
}
|
|
4912
4931
|
async getUniqueValues(e, t, r) {
|
|
4913
|
-
return
|
|
4914
|
-
`Call getUniqueValues, handle = ${e}, request = ${JSON.stringify(t,
|
|
4915
|
-
), await
|
|
4932
|
+
return se().logPFrameRequests && this.logger.info(
|
|
4933
|
+
`Call getUniqueValues, handle = ${e}, request = ${JSON.stringify(t, ke)}`
|
|
4934
|
+
), await wt({
|
|
4916
4935
|
cppCallback: async () => await this.concurrencyLimiter.run(async () => {
|
|
4917
4936
|
var n = [];
|
|
4918
4937
|
try {
|
|
4919
|
-
const o =
|
|
4938
|
+
const o = je(n, this.pFrames.getByKey(e).disposableDataPFrame);
|
|
4920
4939
|
return await o.dataPFrame.getUniqueValues({
|
|
4921
4940
|
...t,
|
|
4922
4941
|
filters: me(t.filters)
|
|
@@ -4924,7 +4943,7 @@ class Cl {
|
|
|
4924
4943
|
} catch (i) {
|
|
4925
4944
|
var a = i, c = !0;
|
|
4926
4945
|
} finally {
|
|
4927
|
-
|
|
4946
|
+
Ve(n, a, c);
|
|
4928
4947
|
}
|
|
4929
4948
|
}),
|
|
4930
4949
|
rustCallback: async () => await this.pFrames.getByKey(e).rustPFrame.getUniqueValues({
|
|
@@ -4976,11 +4995,11 @@ function ue(s) {
|
|
|
4976
4995
|
K(s);
|
|
4977
4996
|
}
|
|
4978
4997
|
}
|
|
4979
|
-
function
|
|
4980
|
-
const e =
|
|
4998
|
+
function $l(s) {
|
|
4999
|
+
const e = Be("sha256");
|
|
4981
5000
|
return e.update(Z(s)), e.digest().toString("hex");
|
|
4982
5001
|
}
|
|
4983
|
-
function
|
|
5002
|
+
function Fl(s) {
|
|
4984
5003
|
const e = [...s].map(
|
|
4985
5004
|
(r) => le(r, (o) => {
|
|
4986
5005
|
let n;
|
|
@@ -5002,7 +5021,7 @@ function kl(s) {
|
|
|
5002
5021
|
keyLength: o.partitionKeyLength,
|
|
5003
5022
|
payload: Object.entries(o.parts).map(([a, c]) => ({
|
|
5004
5023
|
key: a,
|
|
5005
|
-
value:
|
|
5024
|
+
value: Te(c)
|
|
5006
5025
|
}))
|
|
5007
5026
|
};
|
|
5008
5027
|
break;
|
|
@@ -5012,7 +5031,7 @@ function kl(s) {
|
|
|
5012
5031
|
keyLength: o.partitionKeyLength,
|
|
5013
5032
|
payload: Object.entries(o.parts).map(([a, c]) => ({
|
|
5014
5033
|
key: a,
|
|
5015
|
-
value: [
|
|
5034
|
+
value: [Te(c.index), Te(c.values)]
|
|
5016
5035
|
}))
|
|
5017
5036
|
};
|
|
5018
5037
|
break;
|
|
@@ -5023,41 +5042,41 @@ function kl(s) {
|
|
|
5023
5042
|
})
|
|
5024
5043
|
);
|
|
5025
5044
|
e.sort((r, o) => r.id.localeCompare(o.id));
|
|
5026
|
-
const t =
|
|
5045
|
+
const t = Be("sha256");
|
|
5027
5046
|
return t.update(Z(e)), t.digest().toString("hex");
|
|
5028
5047
|
}
|
|
5029
|
-
async function
|
|
5048
|
+
async function Il(s, e, t) {
|
|
5030
5049
|
const r = {
|
|
5031
|
-
...
|
|
5032
|
-
...
|
|
5050
|
+
...Ss,
|
|
5051
|
+
...bs(e),
|
|
5033
5052
|
...t
|
|
5034
|
-
}, o = new
|
|
5053
|
+
}, o = new Wr(r.localSecret), n = uo(r.logger, s, r.localProjections), i = po(s, r.logger), a = ho(s, r.logger), c = fo(s, r.logger), u = new go(
|
|
5035
5054
|
r.logger,
|
|
5036
5055
|
n,
|
|
5037
5056
|
i,
|
|
5038
5057
|
r.blobDownloadPath,
|
|
5039
5058
|
o,
|
|
5040
5059
|
r.blobDriverOps
|
|
5041
|
-
), l = new
|
|
5060
|
+
), l = new mo(
|
|
5042
5061
|
r.logger,
|
|
5043
5062
|
o,
|
|
5044
5063
|
n,
|
|
5045
5064
|
r.downloadBlobToURLPath,
|
|
5046
5065
|
r.downloadBlobToURLDriverOps
|
|
5047
|
-
), d = new
|
|
5066
|
+
), d = new vo(
|
|
5048
5067
|
r.logger,
|
|
5049
5068
|
o,
|
|
5050
5069
|
a,
|
|
5051
5070
|
c,
|
|
5052
5071
|
r.uploadDriverOps
|
|
5053
|
-
), f = new
|
|
5072
|
+
), f = new yo(r.logger, i, r.logStreamDriverOps), h = new wo(r.logger, f, u), E = await So.init(
|
|
5054
5073
|
r.logger,
|
|
5055
5074
|
s,
|
|
5056
5075
|
o,
|
|
5057
5076
|
r.localProjections,
|
|
5058
5077
|
r.openFileDialogCallback,
|
|
5059
5078
|
r.virtualLocalStoragesOverride
|
|
5060
|
-
), g = new
|
|
5079
|
+
), g = new Ol(u, r.logger);
|
|
5061
5080
|
return {
|
|
5062
5081
|
blobDriver: u,
|
|
5063
5082
|
blobToURLDriver: l,
|
|
@@ -5068,7 +5087,7 @@ async function $l(s, e, t) {
|
|
|
5068
5087
|
pFrameDriver: g
|
|
5069
5088
|
};
|
|
5070
5089
|
}
|
|
5071
|
-
class
|
|
5090
|
+
class Fs {
|
|
5072
5091
|
constructor(e, t, r, o, n, i, a, c) {
|
|
5073
5092
|
w(this, "pl");
|
|
5074
5093
|
/** Contains a reactive list of projects along with their meta information. */
|
|
@@ -5087,10 +5106,10 @@ class $s {
|
|
|
5087
5106
|
// Project List Manipulation
|
|
5088
5107
|
//
|
|
5089
5108
|
/** Creates a project with initial state and adds it to project list. */
|
|
5090
|
-
async createProject(e, t =
|
|
5109
|
+
async createProject(e, t = Se()) {
|
|
5091
5110
|
const r = await this.pl.withWriteTx("MLCreateProject", async (o) => {
|
|
5092
|
-
const n = await
|
|
5093
|
-
return o.createField(x(this.projectListResourceId, t), "Dynamic", n), await o.commit(), await
|
|
5111
|
+
const n = await wn(o, e);
|
|
5112
|
+
return o.createField(x(this.projectListResourceId, t), "Dynamic", n), await o.commit(), await Qs(n);
|
|
5094
5113
|
});
|
|
5095
5114
|
return await this.projectListTree.refreshState(), r;
|
|
5096
5115
|
}
|
|
@@ -5110,7 +5129,7 @@ class $s {
|
|
|
5110
5129
|
async projectIdToResourceId(e) {
|
|
5111
5130
|
return await this.pl.withReadTx("Project id to resource id", async (t) => {
|
|
5112
5131
|
const r = (await t.getField(x(this.projectListResourceId, e))).value;
|
|
5113
|
-
if (
|
|
5132
|
+
if (Ze(r)) throw new Error("Unexpected project list structure.");
|
|
5114
5133
|
return r;
|
|
5115
5134
|
});
|
|
5116
5135
|
}
|
|
@@ -5149,33 +5168,33 @@ class $s {
|
|
|
5149
5168
|
/** Generates sufficiently random string to be used as local secret for the
|
|
5150
5169
|
* middle layer */
|
|
5151
5170
|
static generateLocalSecret() {
|
|
5152
|
-
return
|
|
5171
|
+
return Wr.generateSecret();
|
|
5153
5172
|
}
|
|
5154
5173
|
/** Initialize middle layer */
|
|
5155
5174
|
static async init(e, t, r) {
|
|
5156
5175
|
const o = {
|
|
5157
|
-
...
|
|
5158
|
-
...
|
|
5176
|
+
...Pi,
|
|
5177
|
+
...ki(t),
|
|
5159
5178
|
...r
|
|
5160
5179
|
};
|
|
5161
|
-
o.defaultTreeOptions.logStat =
|
|
5180
|
+
o.defaultTreeOptions.logStat = se().logTreeStats, o.debugOps.dumpInitialTreeState = se().dumpInitialTreeState;
|
|
5162
5181
|
const n = await e.withWriteTx("MLInitialization", async (g) => {
|
|
5163
|
-
const D = x(g.clientRoot,
|
|
5182
|
+
const D = x(g.clientRoot, Mo);
|
|
5164
5183
|
g.createField(D, "Dynamic");
|
|
5165
5184
|
const T = await g.getField(D);
|
|
5166
|
-
if (
|
|
5167
|
-
const j = g.createEphemeral(
|
|
5185
|
+
if (Ze(T.value)) {
|
|
5186
|
+
const j = g.createEphemeral(ss);
|
|
5168
5187
|
return g.lock(j), g.setField(D, j), await g.commit(), await j.globalId;
|
|
5169
5188
|
} else
|
|
5170
5189
|
return T.value;
|
|
5171
|
-
}), i = o.logger, a = await
|
|
5190
|
+
}), i = o.logger, a = await Il(e, t, o), c = new js(e.httpDispatcher, {
|
|
5172
5191
|
minTimeout: 250,
|
|
5173
5192
|
maxRetries: 4
|
|
5174
|
-
}), u = new
|
|
5193
|
+
}), u = new Ao(c), l = new pn(
|
|
5175
5194
|
u,
|
|
5176
5195
|
a.signer,
|
|
5177
5196
|
c
|
|
5178
|
-
), d = new
|
|
5197
|
+
), d = new bo(
|
|
5179
5198
|
i,
|
|
5180
5199
|
e.httpDispatcher,
|
|
5181
5200
|
o.frontendDownloadPath
|
|
@@ -5189,14 +5208,14 @@ class $s {
|
|
|
5189
5208
|
bpPreparer: l,
|
|
5190
5209
|
frontendDownloadDriver: d,
|
|
5191
5210
|
driverKit: a,
|
|
5192
|
-
blockUpdateWatcher: new
|
|
5211
|
+
blockUpdateWatcher: new El(u, i, {
|
|
5193
5212
|
minDelay: o.devBlockUpdateRecheckInterval,
|
|
5194
5213
|
http: c,
|
|
5195
5214
|
preferredUpdateChannel: o.preferredUpdateChannel
|
|
5196
5215
|
}),
|
|
5197
|
-
quickJs: await
|
|
5198
|
-
}, h = new
|
|
5199
|
-
return new
|
|
5216
|
+
quickJs: await lo()
|
|
5217
|
+
}, h = new so([]), E = await Ko(e, n, h, f);
|
|
5218
|
+
return new Fs(
|
|
5200
5219
|
f,
|
|
5201
5220
|
a,
|
|
5202
5221
|
a.signer,
|
|
@@ -5208,7 +5227,7 @@ class $s {
|
|
|
5208
5227
|
);
|
|
5209
5228
|
}
|
|
5210
5229
|
}
|
|
5211
|
-
const
|
|
5230
|
+
const Al = [
|
|
5212
5231
|
"undici:request:create",
|
|
5213
5232
|
// When a new request is created
|
|
5214
5233
|
"undici:request:bodySent",
|
|
@@ -5246,7 +5265,7 @@ const Ol = [
|
|
|
5246
5265
|
"undici:dispatcher:retry"
|
|
5247
5266
|
// When a dispatcher retries a request
|
|
5248
5267
|
];
|
|
5249
|
-
async function
|
|
5268
|
+
async function mu(s, e = {}) {
|
|
5250
5269
|
const t = {
|
|
5251
5270
|
pingCheckDurationMs: 1e4,
|
|
5252
5271
|
pingTimeoutMs: 3e3,
|
|
@@ -5264,8 +5283,8 @@ async function pu(s, e = {}) {
|
|
|
5264
5283
|
bodyLimit: 300,
|
|
5265
5284
|
...e
|
|
5266
5285
|
}, r = [];
|
|
5267
|
-
|
|
5268
|
-
|
|
5286
|
+
Al.forEach((c) => {
|
|
5287
|
+
Eo(c).subscribe((l) => {
|
|
5269
5288
|
var f;
|
|
5270
5289
|
const d = (/* @__PURE__ */ new Date()).toISOString();
|
|
5271
5290
|
(f = l == null ? void 0 : l.response) != null && f.headers && (l.response.headers = l.response.headers.map((h) => h.toString())), r.push(
|
|
@@ -5284,56 +5303,56 @@ async function pu(s, e = {}) {
|
|
|
5284
5303
|
blockRegistryUiChecks: [],
|
|
5285
5304
|
blockGARegistryUiChecks: [],
|
|
5286
5305
|
autoUpdateCdnChecks: []
|
|
5287
|
-
}, n =
|
|
5306
|
+
}, n = Zs(s, { defaultRequestTimeout: t.pingTimeoutMs });
|
|
5288
5307
|
o.plPings = await ve(t.pingCheckDurationMs, t.maxPingsPerSecond, async () => {
|
|
5289
|
-
const u = await new
|
|
5308
|
+
const u = await new rr(n).ping();
|
|
5290
5309
|
return JSON.stringify(u).slice(0, t.bodyLimit) + "...";
|
|
5291
5310
|
});
|
|
5292
|
-
const a = new
|
|
5311
|
+
const a = new rr(n).ll.httpDispatcher;
|
|
5293
5312
|
return o.blockRegistryOverviewChecks = await ve(
|
|
5294
5313
|
t.blockRegistryDurationMs,
|
|
5295
5314
|
t.maxRegistryChecksPerSecond,
|
|
5296
|
-
async () => await
|
|
5315
|
+
async () => await Oe(new URL(t.blockOverviewPath, t.blockRegistryUrl), t, a)
|
|
5297
5316
|
), o.blockGARegistryOverviewChecks = await ve(
|
|
5298
5317
|
t.blockRegistryDurationMs,
|
|
5299
5318
|
t.maxRegistryChecksPerSecond,
|
|
5300
|
-
async () => await
|
|
5319
|
+
async () => await Oe(new URL(t.blockOverviewPath, t.blockGARegistryUrl), t, a)
|
|
5301
5320
|
), o.blockRegistryUiChecks = await ve(
|
|
5302
5321
|
t.blockRegistryDurationMs,
|
|
5303
5322
|
t.maxRegistryChecksPerSecond,
|
|
5304
|
-
async () => await
|
|
5323
|
+
async () => await Oe(new URL(t.blockUiPath, t.blockRegistryUrl), t, a)
|
|
5305
5324
|
), o.blockGARegistryUiChecks = await ve(
|
|
5306
5325
|
t.blockRegistryDurationMs,
|
|
5307
5326
|
t.maxRegistryChecksPerSecond,
|
|
5308
|
-
async () => await
|
|
5327
|
+
async () => await Oe(new URL(t.blockUiPath, t.blockGARegistryUrl), t, a)
|
|
5309
5328
|
), o.autoUpdateCdnChecks = await ve(
|
|
5310
5329
|
t.autoUpdateCdnDurationMs,
|
|
5311
5330
|
t.maxAutoUpdateCdnChecksPerSecond,
|
|
5312
|
-
async () => await
|
|
5313
|
-
),
|
|
5331
|
+
async () => await Oe(t.autoUpdateCdnUrl, t, a)
|
|
5332
|
+
), Tl(o, s, t, r);
|
|
5314
5333
|
}
|
|
5315
5334
|
async function ve(s, e, t) {
|
|
5316
|
-
const r =
|
|
5317
|
-
for (;
|
|
5318
|
-
const n =
|
|
5335
|
+
const r = Tt(), o = [];
|
|
5336
|
+
for (; Mr(r) < s; ) {
|
|
5337
|
+
const n = Tt();
|
|
5319
5338
|
let i;
|
|
5320
5339
|
try {
|
|
5321
5340
|
i = { ok: !0, value: await t() };
|
|
5322
5341
|
} catch (u) {
|
|
5323
5342
|
i = { ok: !1, error: u };
|
|
5324
5343
|
}
|
|
5325
|
-
const a =
|
|
5344
|
+
const a = Mr(n);
|
|
5326
5345
|
o.push({
|
|
5327
5346
|
elapsedMs: a,
|
|
5328
5347
|
response: i
|
|
5329
5348
|
});
|
|
5330
5349
|
const c = 1e3 / e - a;
|
|
5331
|
-
c > 0 && await
|
|
5350
|
+
c > 0 && await Qr(c);
|
|
5332
5351
|
}
|
|
5333
5352
|
return o;
|
|
5334
5353
|
}
|
|
5335
|
-
async function
|
|
5336
|
-
const { body: r, statusCode: o } = await
|
|
5354
|
+
async function Oe(s, e, t) {
|
|
5355
|
+
const { body: r, statusCode: o } = await Lt(s, {
|
|
5337
5356
|
dispatcher: t,
|
|
5338
5357
|
headersTimeout: e.httpTimeoutMs,
|
|
5339
5358
|
bodyTimeout: e.httpTimeoutMs
|
|
@@ -5343,7 +5362,7 @@ async function ke(s, e, t) {
|
|
|
5343
5362
|
beginningOfBody: n.slice(0, e.bodyLimit) + "..."
|
|
5344
5363
|
};
|
|
5345
5364
|
}
|
|
5346
|
-
function
|
|
5365
|
+
function Tl(s, e, t, r) {
|
|
5347
5366
|
const o = s.plPings.filter((a) => a.response.ok), n = s.plPings.filter((a) => !a.response.ok), i = [
|
|
5348
5367
|
...new Set(o.map((a) => JSON.stringify(a.response.value)))
|
|
5349
5368
|
];
|
|
@@ -5391,7 +5410,7 @@ ${r.join(`
|
|
|
5391
5410
|
`;
|
|
5392
5411
|
}
|
|
5393
5412
|
function ye(s) {
|
|
5394
|
-
const e = s.filter((o) => o.response.ok), { mean: t, median: r } =
|
|
5413
|
+
const e = s.filter((o) => o.response.ok), { mean: t, median: r } = Ll(s);
|
|
5395
5414
|
return `
|
|
5396
5415
|
total: ${s.length};
|
|
5397
5416
|
successes: ${e.length};
|
|
@@ -5400,7 +5419,7 @@ mean in ms: ${t};
|
|
|
5400
5419
|
median in ms: ${r};
|
|
5401
5420
|
`;
|
|
5402
5421
|
}
|
|
5403
|
-
function
|
|
5422
|
+
function Ll(s) {
|
|
5404
5423
|
const e = s.map((o) => o.elapsedMs), t = e.reduce((o, n) => o + n) / e.length;
|
|
5405
5424
|
let r;
|
|
5406
5425
|
if (e.length > 0) {
|
|
@@ -5409,40 +5428,40 @@ function Il(s) {
|
|
|
5409
5428
|
}
|
|
5410
5429
|
return { mean: t, median: r };
|
|
5411
5430
|
}
|
|
5412
|
-
function
|
|
5431
|
+
function Tt() {
|
|
5413
5432
|
return Date.now();
|
|
5414
5433
|
}
|
|
5415
|
-
function
|
|
5416
|
-
return
|
|
5434
|
+
function Mr(s) {
|
|
5435
|
+
return Tt() - s;
|
|
5417
5436
|
}
|
|
5418
5437
|
export {
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5438
|
+
cu as BlockPackRegistry,
|
|
5439
|
+
lu as CentralBlockRegistry,
|
|
5440
|
+
bs as DefaultDriverKitOpsPaths,
|
|
5441
|
+
Ss as DefaultDriverKitOpsSettings,
|
|
5442
|
+
ki as DefaultMiddleLayerOpsPaths,
|
|
5443
|
+
Pi as DefaultMiddleLayerOpsSettings,
|
|
5444
|
+
as as FrontendFromFolderResourceType,
|
|
5445
|
+
is as FrontendFromUrlResourceType,
|
|
5446
|
+
Fs as MiddleLayer,
|
|
5428
5447
|
Jt as Project,
|
|
5429
|
-
|
|
5430
|
-
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5448
|
+
rn as TengoTemplateGet,
|
|
5449
|
+
sn as TengoTemplateGetRegistry,
|
|
5450
|
+
nn as TengoTemplateGetTemplate,
|
|
5451
|
+
on as TengoTemplateGetTemplateURI,
|
|
5452
|
+
pu as TengoTemplatePack,
|
|
5453
|
+
hu as TengoTemplatePackConvert,
|
|
5454
|
+
gu as TengoTemplatePackConvertTemplate,
|
|
5455
|
+
fu as TengoTemplatePackConvertTemplatePack,
|
|
5456
|
+
du as V1CentralDevSnapshotRegistry,
|
|
5457
|
+
uu as V1CentralRegistry,
|
|
5458
|
+
Ao as V2RegistryProvider,
|
|
5459
|
+
mu as checkNetwork,
|
|
5460
|
+
os as createRenderTemplate,
|
|
5461
|
+
es as getDevV1PacketMtime,
|
|
5443
5462
|
Bt as getDevV2PacketMtime,
|
|
5444
|
-
|
|
5463
|
+
Il as initDriverKit,
|
|
5445
5464
|
jt as loadTemplate,
|
|
5446
|
-
|
|
5465
|
+
an as prepareTemplateSpec
|
|
5447
5466
|
};
|
|
5448
5467
|
//# sourceMappingURL=index.mjs.map
|