@milaboratories/pl-middle-layer 1.28.18 → 1.28.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1225 -1209
- package/dist/index.mjs.map +1 -1
- package/dist/pool/driver.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/pool/driver.ts +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
var Ps = Object.defineProperty;
|
|
2
|
-
var
|
|
2
|
+
var Kt = (s, e) => (e = Symbol[s]) ? e : Symbol.for("Symbol." + s), Ht = (s) => {
|
|
3
3
|
throw TypeError(s);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var w = (s, e, t) =>
|
|
5
|
+
var ks = (s, e, t) => e in s ? Ps(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
6
|
+
var w = (s, e, t) => ks(s, typeof e != "symbol" ? e + "" : e, t);
|
|
7
7
|
var je = (s, e, t) => {
|
|
8
8
|
if (e != null) {
|
|
9
|
-
typeof e != "object" && typeof e != "function" &&
|
|
9
|
+
typeof e != "object" && typeof e != "function" && Ht("Object expected");
|
|
10
10
|
var r;
|
|
11
|
-
t && (r = e[
|
|
11
|
+
t && (r = e[Kt("asyncDispose")]), r === void 0 && (r = e[Kt("dispose")]), typeof r != "function" && Ht("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
|
-
var r = typeof SuppressedError == "function" ? SuppressedError : function(i, a, c,
|
|
16
|
-
return
|
|
15
|
+
var r = typeof SuppressedError == "function" ? SuppressedError : function(i, a, c, u) {
|
|
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) => {
|
|
18
18
|
for (; i = s.pop(); )
|
|
19
19
|
try {
|
|
@@ -26,105 +26,105 @@ var je = (s, e, t) => {
|
|
|
26
26
|
};
|
|
27
27
|
return n();
|
|
28
28
|
};
|
|
29
|
-
import { mapValueInVOE as
|
|
29
|
+
import { mapValueInVOE as jr, executePSpecPredicate as Os, mapPObjectData as de, mapPTableDef as mt, JsRenderInternal as $s, extractConfig as Vr, isConfigLambda as Ur, DefaultNavigationState as Fs, extractAllColumns as Is } from "@platforma-sdk/model";
|
|
30
30
|
export * from "@platforma-sdk/model";
|
|
31
|
-
import { AnyChannel as we, StableChannel as ce, InitialBlockSettings as
|
|
31
|
+
import { AnyChannel as we, StableChannel as ce, InitialBlockSettings as Wt, blockPackIdToString as As } 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 le, RetryAgent as
|
|
35
|
-
import { RegistryV1 as he, tryLoadPackDescription as
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import { assertNever as
|
|
40
|
-
import * as
|
|
41
|
-
import { tryResolve as
|
|
42
|
-
import { resourceTypesEqual as ue, field as x, Pl as A, PlClient as
|
|
34
|
+
import { request as le, RetryAgent as Ts } from "undici";
|
|
35
|
+
import { RegistryV1 as he, tryLoadPackDescription as vt, BlockPackMetaEmbedAbsoluteBytes as Ls, RegistryV2Reader as Ds, folderReaderByUrl as Ns, loadPackDescription as zt } from "@platforma-sdk/block-tools";
|
|
36
|
+
import Y from "node:fs";
|
|
37
|
+
import _ from "node:path";
|
|
38
|
+
import Bs from "yaml";
|
|
39
|
+
import { assertNever as K, notEmpty as B, ConsoleLoggerAdapter as xs, ConcurrencyLimitingExecutor as js, HmacSha256Signer as Jr } from "@milaboratories/ts-helpers";
|
|
40
|
+
import * as Gr from "node:fs/promises";
|
|
41
|
+
import { tryResolve as Vs } from "@milaboratories/resolve-helper";
|
|
42
|
+
import { resourceTypesEqual as ue, field as x, Pl as A, PlClient as Us, isNullResourceId as Ye, ensureResourceIdNotNull as yt, isResource as Js, isResourceRef as Gs, isNotNullResourceId as qt, resourceType as Ne, resourceTypeToString as Ms, resourceIdToString as Mr, isNotFoundError as _s, isTimeoutOrCancelError as Ks, toGlobalResourceId as Hs, plAddressToConfig as Ws, UnauthenticatedPlClient as Xt } from "@milaboratories/pl-client";
|
|
43
43
|
export * from "@milaboratories/pl-client";
|
|
44
|
-
import { SynchronizedTreeState as
|
|
45
|
-
import { Computable as
|
|
44
|
+
import { SynchronizedTreeState as _r, PlError as zs, isPlTreeNodeAccessor as qs } from "@milaboratories/pl-tree";
|
|
45
|
+
import { Computable as J, ChangeSource as Yt, PollComputablePool as Xs, WatchableValue as Ys } from "@milaboratories/computable";
|
|
46
46
|
import { randomUUID as Te, createHash as Be } from "node:crypto";
|
|
47
|
-
import { parseTemplate as
|
|
48
|
-
import
|
|
49
|
-
import { Templates as
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import { Scope as
|
|
53
|
-
import { setTimeout as
|
|
54
|
-
import { createDownloadClient as
|
|
55
|
-
import { PFrame as
|
|
56
|
-
import { PFrame as
|
|
57
|
-
import { LRUCache as
|
|
58
|
-
import { channel as
|
|
59
|
-
async function
|
|
47
|
+
import { parseTemplate as Qs, PlTemplateV1 as ae, PlTemplateOverrideV1 as $e, PlTemplateLibV1 as Ue, PlTemplateSoftwareV1 as Re } from "@milaboratories/pl-model-backend";
|
|
48
|
+
import Kr from "denque";
|
|
49
|
+
import { Templates as Zs } from "@platforma-sdk/workflow-tengo";
|
|
50
|
+
import Z from "canonicalize";
|
|
51
|
+
import eo from "node:assert";
|
|
52
|
+
import { Scope as St, getQuickJS as to } from "quickjs-emscripten";
|
|
53
|
+
import { setTimeout as Hr } from "node:timers/promises";
|
|
54
|
+
import { createDownloadClient as ro, createLogsClient as so, createUploadBlobClient as oo, createUploadProgressClient as no, DownloadDriver as io, DownloadBlobToURLDriver as ao, UploadDriver as co, LogsStreamDriver as lo, LogsDriver as uo, LsDriver as po, DownloadUrlDriver as ho } from "@milaboratories/pl-drivers";
|
|
55
|
+
import { PFrame as Qt } from "@milaboratories/pframes-node";
|
|
56
|
+
import { PFrame as fo } from "@milaboratories/pframes-rs-node";
|
|
57
|
+
import { LRUCache as go } from "lru-cache";
|
|
58
|
+
import { channel as mo } from "node:diagnostics_channel";
|
|
59
|
+
async function Zt(s) {
|
|
60
60
|
try {
|
|
61
|
-
return await
|
|
61
|
+
return await Gr.stat(s, { bigint: !0 });
|
|
62
62
|
} catch (e) {
|
|
63
63
|
if (e.code === "ENOENT")
|
|
64
64
|
return;
|
|
65
65
|
throw e;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
const
|
|
69
|
-
$t,
|
|
68
|
+
const vo = [he.PlPackageYamlConfigFile], yo = [he.PlPackageJsonConfigFile], Ft = ["backend", "dist", "tengo", "tpl", "main.plj.gz"], It = ["config", "dist", "config.json"], Wr = ["frontend", "dist"], er = "block-model/dist/config.json", So = "block-ui/package.json", wo = [
|
|
70
69
|
Ft,
|
|
71
|
-
|
|
70
|
+
It,
|
|
72
71
|
vo,
|
|
73
|
-
|
|
72
|
+
yo,
|
|
73
|
+
Wr
|
|
74
74
|
];
|
|
75
|
-
async function
|
|
76
|
-
return await
|
|
75
|
+
async function bo(s) {
|
|
76
|
+
return await Zt(_.join(s, ...It)) !== void 0 || await Zt(_.join(s, ...Ft)) !== void 0;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
const t =
|
|
78
|
+
function ct(s, e) {
|
|
79
|
+
const t = Vs(s, e);
|
|
80
80
|
if (t === void 0) throw new Error(`Can't resolve ${e} against ${s}`);
|
|
81
81
|
return t;
|
|
82
82
|
}
|
|
83
|
-
async function
|
|
84
|
-
if (
|
|
83
|
+
async function tr(s, e) {
|
|
84
|
+
if (_.isAbsolute(s) || (s = _.resolve(s)), await bo(s))
|
|
85
85
|
return {
|
|
86
|
-
workflow:
|
|
87
|
-
config:
|
|
88
|
-
ui:
|
|
86
|
+
workflow: _.join(s, ...Ft),
|
|
87
|
+
config: _.join(s, ...It),
|
|
88
|
+
ui: _.join(s, ...Wr)
|
|
89
89
|
};
|
|
90
90
|
{
|
|
91
|
-
const t =
|
|
92
|
-
return { workflow: t, config: r, ui:
|
|
91
|
+
const t = ct(s, er), r = ct(s, er), o = ct(s, So);
|
|
92
|
+
return { workflow: t, config: r, ui: _.resolve(o, "..", "dist") };
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
async function
|
|
95
|
+
async function Ro(s) {
|
|
96
96
|
try {
|
|
97
|
-
return await
|
|
97
|
+
return await Y.promises.readFile(s, "utf8");
|
|
98
98
|
} catch (e) {
|
|
99
99
|
if (e instanceof Error && "code" in e && e.code === "ENOENT")
|
|
100
100
|
return;
|
|
101
101
|
throw e;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
async function
|
|
104
|
+
async function Eo(s) {
|
|
105
105
|
try {
|
|
106
|
-
return await
|
|
106
|
+
return await Y.promises.stat(s, { bigint: !0 });
|
|
107
107
|
} catch (e) {
|
|
108
108
|
if (e instanceof Error && "code" in e && e.code === "ENOENT")
|
|
109
109
|
return;
|
|
110
110
|
throw e;
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
async function
|
|
113
|
+
async function zr(s) {
|
|
114
114
|
let e = 0n;
|
|
115
|
-
for (const t of
|
|
116
|
-
const r =
|
|
115
|
+
for (const t of wo) {
|
|
116
|
+
const r = _.join(s, ...t), o = await Eo(r);
|
|
117
117
|
o !== void 0 && e < o.mtimeNs && (e = o.mtimeNs);
|
|
118
118
|
}
|
|
119
119
|
return e.toString();
|
|
120
120
|
}
|
|
121
|
-
async function
|
|
122
|
-
const e = await
|
|
121
|
+
async function At(s) {
|
|
122
|
+
const e = await Y.promises.stat(s.components.workflow.main.file, {
|
|
123
123
|
bigint: !0
|
|
124
|
-
}), t = await
|
|
124
|
+
}), t = await Y.promises.stat(s.components.model.file, { bigint: !0 });
|
|
125
125
|
return (e.mtimeNs > t.mtimeNs ? e.mtimeNs : t.mtimeNs).toString();
|
|
126
126
|
}
|
|
127
|
-
class
|
|
127
|
+
class Yl {
|
|
128
128
|
constructor(e, t, r) {
|
|
129
129
|
this.v2Provider = e, this.registries = t, this.http = r;
|
|
130
130
|
}
|
|
@@ -137,15 +137,15 @@ class Xl {
|
|
|
137
137
|
o
|
|
138
138
|
)).body.json();
|
|
139
139
|
for (const a of i) {
|
|
140
|
-
const { organization: c, package:
|
|
140
|
+
const { organization: c, package: u, latestMeta: l, latestVersion: d } = a, f = {
|
|
141
141
|
organization: c,
|
|
142
|
-
name:
|
|
142
|
+
name: u,
|
|
143
143
|
version: d
|
|
144
|
-
},
|
|
145
|
-
id:
|
|
144
|
+
}, h = {
|
|
145
|
+
id: f,
|
|
146
146
|
meta: {
|
|
147
|
-
title:
|
|
148
|
-
description:
|
|
147
|
+
title: l.title ?? "No title",
|
|
148
|
+
description: l.description ?? "No Description",
|
|
149
149
|
organization: {
|
|
150
150
|
name: c,
|
|
151
151
|
url: "https://unknown.com"
|
|
@@ -153,18 +153,18 @@ class Xl {
|
|
|
153
153
|
},
|
|
154
154
|
spec: {
|
|
155
155
|
type: "from-registry-v1",
|
|
156
|
-
id:
|
|
156
|
+
id: f,
|
|
157
157
|
registryUrl: r.url
|
|
158
158
|
}
|
|
159
159
|
};
|
|
160
160
|
t.push({
|
|
161
161
|
registryId: e.id,
|
|
162
|
-
id:
|
|
162
|
+
id: f,
|
|
163
163
|
latestByChannel: {
|
|
164
|
-
[we]:
|
|
165
|
-
[ce]:
|
|
164
|
+
[we]: h,
|
|
165
|
+
[ce]: h
|
|
166
166
|
},
|
|
167
|
-
allVersions: a.allVersions.map((
|
|
167
|
+
allVersions: a.allVersions.map((E) => ({ version: E, channels: [] }))
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
return t;
|
|
@@ -184,18 +184,18 @@ class Xl {
|
|
|
184
184
|
}
|
|
185
185
|
);
|
|
186
186
|
case "local-dev":
|
|
187
|
-
for (const o of await
|
|
187
|
+
for (const o of await Y.promises.readdir(r.path, { withFileTypes: !0 })) {
|
|
188
188
|
if (!o.isDirectory()) continue;
|
|
189
|
-
const n =
|
|
190
|
-
|
|
189
|
+
const n = _.join(r.path, o.name), i = await Ro(
|
|
190
|
+
_.join(n, he.PlPackageYamlConfigFile)
|
|
191
191
|
);
|
|
192
192
|
if (i !== void 0) {
|
|
193
|
-
const a = he.PlPackageConfigData.parse(
|
|
193
|
+
const a = he.PlPackageConfigData.parse(Bs.parse(i)), c = await zr(n), u = {
|
|
194
194
|
organization: a.organization,
|
|
195
195
|
name: a.package,
|
|
196
196
|
version: "DEV"
|
|
197
|
-
},
|
|
198
|
-
id:
|
|
197
|
+
}, l = {
|
|
198
|
+
id: u,
|
|
199
199
|
meta: {
|
|
200
200
|
title: a.meta.title ?? "No title",
|
|
201
201
|
description: a.meta.description ?? "No Description",
|
|
@@ -212,35 +212,35 @@ class Xl {
|
|
|
212
212
|
};
|
|
213
213
|
t.push({
|
|
214
214
|
registryId: e.id,
|
|
215
|
-
id:
|
|
215
|
+
id: u,
|
|
216
216
|
latestByChannel: {
|
|
217
|
-
[we]:
|
|
218
|
-
[ce]:
|
|
217
|
+
[we]: l,
|
|
218
|
+
[ce]: l
|
|
219
219
|
},
|
|
220
220
|
allVersions: []
|
|
221
221
|
});
|
|
222
222
|
} else {
|
|
223
|
-
let a = n, c = await
|
|
223
|
+
let a = n, c = await vt(a);
|
|
224
224
|
if (c === void 0) {
|
|
225
|
-
for (const
|
|
226
|
-
if (a =
|
|
225
|
+
for (const u of ["block", "meta"])
|
|
226
|
+
if (a = _.join(n, u), c = await vt(a), c !== void 0) break;
|
|
227
227
|
}
|
|
228
228
|
if (c !== void 0) {
|
|
229
|
-
const
|
|
229
|
+
const u = await At(c), l = {
|
|
230
230
|
id: c.id,
|
|
231
|
-
meta: await
|
|
231
|
+
meta: await Ls.parseAsync(c.meta),
|
|
232
232
|
spec: {
|
|
233
233
|
type: "dev-v2",
|
|
234
234
|
folder: a,
|
|
235
|
-
mtime:
|
|
235
|
+
mtime: u
|
|
236
236
|
}
|
|
237
237
|
};
|
|
238
238
|
t.push({
|
|
239
239
|
registryId: e.id,
|
|
240
240
|
id: c.id,
|
|
241
241
|
latestByChannel: {
|
|
242
|
-
[we]:
|
|
243
|
-
[ce]:
|
|
242
|
+
[we]: l,
|
|
243
|
+
[ce]: l
|
|
244
244
|
},
|
|
245
245
|
allVersions: []
|
|
246
246
|
});
|
|
@@ -249,7 +249,7 @@ class Xl {
|
|
|
249
249
|
}
|
|
250
250
|
return t;
|
|
251
251
|
default:
|
|
252
|
-
return
|
|
252
|
+
return K(r);
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
async listBlockPacks() {
|
|
@@ -277,124 +277,124 @@ class Co {
|
|
|
277
277
|
getRegistry(e) {
|
|
278
278
|
const t = this.registries.get(e);
|
|
279
279
|
if (t) return t;
|
|
280
|
-
const r = new
|
|
280
|
+
const r = new Ds(Ns(e, this.http));
|
|
281
281
|
return this.registries.set(e, r), r;
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
|
-
const
|
|
284
|
+
const Ql = {
|
|
285
285
|
type: "remote-v2",
|
|
286
286
|
url: "https://blocks.pl-open.science/"
|
|
287
|
-
},
|
|
287
|
+
}, Zl = {
|
|
288
288
|
type: "remote-v1",
|
|
289
289
|
url: "https://block.registry.platforma.bio/releases"
|
|
290
|
-
},
|
|
290
|
+
}, eu = {
|
|
291
291
|
type: "remote-v1",
|
|
292
292
|
url: "https://block.registry.platforma.bio/dev"
|
|
293
293
|
}, Po = {
|
|
294
294
|
groups: [{ id: "default", label: "Default", blocks: [] }]
|
|
295
|
-
},
|
|
295
|
+
}, ko = {
|
|
296
296
|
stagingRefreshTimestamp: 0,
|
|
297
297
|
blocksInLimbo: []
|
|
298
|
-
},
|
|
298
|
+
}, Oo = {
|
|
299
299
|
label: "New Project"
|
|
300
|
-
},
|
|
301
|
-
function St(s) {
|
|
302
|
-
return `${$o}${s}`;
|
|
303
|
-
}
|
|
304
|
-
const Io = "BlockArgsAuthor/";
|
|
300
|
+
}, $o = { name: "UserProject", version: "2" }, qr = "SchemaVersion", Xr = "1", Tt = "ProjectCreated", Le = "ProjectLastModified", De = "ProjectMeta", fe = "ProjectStructure", Qe = "BlockRenderingState", Fo = "BlockFrontendState/", Io = /^BlockFrontendState\/(?<blockid>.*)$/;
|
|
305
301
|
function wt(s) {
|
|
306
|
-
return `${
|
|
302
|
+
return `${Fo}${s}`;
|
|
307
303
|
}
|
|
308
|
-
const
|
|
309
|
-
function
|
|
310
|
-
|
|
304
|
+
const Ao = "BlockArgsAuthor/";
|
|
305
|
+
function bt(s) {
|
|
306
|
+
return `${Ao}${s}`;
|
|
307
|
+
}
|
|
308
|
+
const Rt = "ProjectStructureAuthor";
|
|
309
|
+
function To(s) {
|
|
310
|
+
const e = s.match(Io);
|
|
311
311
|
if (e !== null)
|
|
312
312
|
return e.groups.blockid;
|
|
313
313
|
}
|
|
314
|
-
const
|
|
315
|
-
function
|
|
316
|
-
return `${
|
|
314
|
+
const Lo = "__serviceTemplate_";
|
|
315
|
+
function Et(s) {
|
|
316
|
+
return `${Lo}${s}`;
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function U(s, e) {
|
|
319
319
|
return `${s}-${e}`;
|
|
320
320
|
}
|
|
321
|
-
const
|
|
322
|
-
function
|
|
323
|
-
const e = s.match(
|
|
321
|
+
const Do = /^(?<blockId>.*)-(?<fieldName>blockPack|blockSettings|prodArgs|currentArgs|prodCtx|prodUiCtx|prodOutput|prodCtxPrevious|prodUiCtxPrevious|prodOutputPrevious|stagingCtx|stagingUiCtx|stagingOutput|stagingCtxPrevious|stagingUiCtxPrevious|stagingOutputPrevious)$/;
|
|
322
|
+
function No(s) {
|
|
323
|
+
const e = s.match(Do);
|
|
324
324
|
if (e === null) return;
|
|
325
325
|
const { blockId: t, fieldName: r } = e.groups;
|
|
326
326
|
return { blockId: t, fieldName: r };
|
|
327
327
|
}
|
|
328
|
-
const
|
|
329
|
-
async function
|
|
330
|
-
const o = await
|
|
328
|
+
const Bo = "projects", Yr = { name: "Projects", version: "1" }, xo = (s) => ue(s.type, Yr) ? s.fields : [];
|
|
329
|
+
async function jo(s, e, t, r) {
|
|
330
|
+
const o = await _r.init(
|
|
331
331
|
s,
|
|
332
332
|
e,
|
|
333
333
|
{
|
|
334
334
|
...r.ops.defaultTreeOptions,
|
|
335
|
-
pruning:
|
|
335
|
+
pruning: xo
|
|
336
336
|
},
|
|
337
337
|
r.logger
|
|
338
338
|
);
|
|
339
|
-
return { computable:
|
|
339
|
+
return { computable: J.make((i) => {
|
|
340
340
|
const a = i.accessor(o.entry()).node(), c = t.getValue(i);
|
|
341
341
|
if (a === void 0) return;
|
|
342
|
-
const
|
|
343
|
-
for (const
|
|
344
|
-
const d = a.traverse(
|
|
342
|
+
const u = [];
|
|
343
|
+
for (const l of a.listDynamicFields()) {
|
|
344
|
+
const d = a.traverse(l);
|
|
345
345
|
if (d === void 0) continue;
|
|
346
|
-
const
|
|
347
|
-
|
|
348
|
-
id:
|
|
346
|
+
const f = B(d.getKeyValueAsJson(De)), h = B(d.getKeyValueAsJson(Tt)), E = B(d.getKeyValueAsJson(Le));
|
|
347
|
+
u.push({
|
|
348
|
+
id: l,
|
|
349
349
|
rid: d.id,
|
|
350
|
-
created: new Date(
|
|
351
|
-
lastModified: new Date(
|
|
350
|
+
created: new Date(h),
|
|
351
|
+
lastModified: new Date(E),
|
|
352
352
|
opened: c.indexOf(d.id) >= 0,
|
|
353
|
-
meta:
|
|
353
|
+
meta: f
|
|
354
354
|
});
|
|
355
355
|
}
|
|
356
|
-
return
|
|
356
|
+
return u.sort((l) => -l.lastModified.valueOf()), u;
|
|
357
357
|
}).withStableType(), tree: o };
|
|
358
358
|
}
|
|
359
|
-
const
|
|
359
|
+
const Vo = {
|
|
360
360
|
name: "EphRenderTemplate",
|
|
361
361
|
version: "1"
|
|
362
|
-
},
|
|
362
|
+
}, Uo = {
|
|
363
363
|
name: "RenderTemplate",
|
|
364
364
|
version: "1"
|
|
365
365
|
};
|
|
366
|
-
function
|
|
366
|
+
function Qr(s, e, t, r, o) {
|
|
367
367
|
if (o.length === 0) throw new Error("Zero output names provided");
|
|
368
|
-
const n = t ? s.createEphemeral(
|
|
368
|
+
const n = t ? s.createEphemeral(Vo) : s.createStruct(Uo), i = x(n, "template"), a = x(n, "inputs");
|
|
369
369
|
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/");
|
|
370
370
|
}
|
|
371
|
-
const
|
|
372
|
-
function
|
|
373
|
-
return
|
|
371
|
+
const Jo = { name: "BContextEnd", version: "1" }, Go = { name: "BContext", version: "1" }, Mo = "id", _o = "parent/", Ko = ["context", "result"];
|
|
372
|
+
function rr(s, e, t) {
|
|
373
|
+
return Qr(s, e, !0, t, Ko);
|
|
374
374
|
}
|
|
375
|
-
function
|
|
376
|
-
const e = s.createEphemeral(
|
|
375
|
+
function Ho(s) {
|
|
376
|
+
const e = s.createEphemeral(Jo);
|
|
377
377
|
return s.lock(e), e;
|
|
378
378
|
}
|
|
379
|
-
function
|
|
380
|
-
if (e.length === 0) return
|
|
379
|
+
function sr(s, e) {
|
|
380
|
+
if (e.length === 0) return Ho(s);
|
|
381
381
|
if (e.length === 1) return e[0];
|
|
382
|
-
const t = s.createEphemeral(
|
|
383
|
-
s.createField(x(t,
|
|
382
|
+
const t = s.createEphemeral(Go);
|
|
383
|
+
s.createField(x(t, Mo), "Input", A.createPlString(s, Te()));
|
|
384
384
|
for (let r = 0; r < e.length; r++)
|
|
385
|
-
s.createField(x(t, `${
|
|
385
|
+
s.createField(x(t, `${_o}${r}`), "Input", e[r]);
|
|
386
386
|
return s.lock(t), t;
|
|
387
387
|
}
|
|
388
|
-
function
|
|
389
|
-
const t =
|
|
388
|
+
function Wo(s, e) {
|
|
389
|
+
const t = Qs(e.content), r = t.type;
|
|
390
390
|
switch (r) {
|
|
391
391
|
case "pl.tengo-template.v2":
|
|
392
|
-
return
|
|
392
|
+
return qo(s, t);
|
|
393
393
|
default:
|
|
394
|
-
|
|
394
|
+
K(r);
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
-
const
|
|
397
|
+
const or = {
|
|
398
398
|
hash(s, e) {
|
|
399
399
|
e.update(Ue.type.name).update(Ue.type.version).update(s.name).update(s.version).update(s.src);
|
|
400
400
|
},
|
|
@@ -412,7 +412,7 @@ const sr = {
|
|
|
412
412
|
const r = Re.fromV2Data(s), o = e.createStruct(Re.type, r.data);
|
|
413
413
|
return e.setKValue(o, Re.metaNameKey, JSON.stringify(r.name)), e.lock(o), o;
|
|
414
414
|
}
|
|
415
|
-
},
|
|
415
|
+
}, zo = {
|
|
416
416
|
hash(s, e) {
|
|
417
417
|
e.update($e.type.name).update($e.type.version).update(s.hashOverride ?? "");
|
|
418
418
|
},
|
|
@@ -422,12 +422,12 @@ const sr = {
|
|
|
422
422
|
JSON.stringify($e.fromV2Data(s))
|
|
423
423
|
);
|
|
424
424
|
}
|
|
425
|
-
},
|
|
425
|
+
}, Zr = {
|
|
426
426
|
hash(s, e) {
|
|
427
427
|
e.update(ae.type.name).update(ae.type.version).update(s.hashOverride ?? "").update(s.name).update(s.version).update(s.src);
|
|
428
428
|
const t = (r) => (r.sort((o, n) => o[0] === n[0] ? 0 : o[0] < n[0] ? -1 : 1), r);
|
|
429
429
|
for (const [r, o] of t(Object.entries(s.libs ?? {})))
|
|
430
|
-
e.update("lib:" + r),
|
|
430
|
+
e.update("lib:" + r), or.hash(o, e);
|
|
431
431
|
for (const [r, o] of t(Object.entries(s.software ?? {})))
|
|
432
432
|
e.update("soft:" + r), Je.hash(o, e);
|
|
433
433
|
for (const [r, o] of t(Object.entries(s.assets ?? {})))
|
|
@@ -442,7 +442,7 @@ const sr = {
|
|
|
442
442
|
);
|
|
443
443
|
for (const [i, a] of Object.entries(s.libs ?? {})) {
|
|
444
444
|
const c = ae.libField(r, i);
|
|
445
|
-
e.createField(c, "Input"), e.setField(c, t(a,
|
|
445
|
+
e.createField(c, "Input"), e.setField(c, t(a, or));
|
|
446
446
|
}
|
|
447
447
|
for (const [i, a] of Object.entries(s.software ?? {})) {
|
|
448
448
|
const c = ae.swField(r, i);
|
|
@@ -454,14 +454,14 @@ const sr = {
|
|
|
454
454
|
}
|
|
455
455
|
for (const [i, a] of Object.entries(s.templates ?? {})) {
|
|
456
456
|
const c = ae.tplField(r, i);
|
|
457
|
-
e.createField(c, "Input"), e.setField(c, t(a,
|
|
457
|
+
e.createField(c, "Input"), e.setField(c, t(a, Zr));
|
|
458
458
|
}
|
|
459
459
|
if (e.lock(r), !s.hashOverride) return r;
|
|
460
|
-
const o = t(s,
|
|
460
|
+
const o = t(s, zo), n = $e.tplField(o);
|
|
461
461
|
return e.createField(n, "Service"), e.setField(n, r), e.lock(r), o;
|
|
462
462
|
}
|
|
463
463
|
};
|
|
464
|
-
function
|
|
464
|
+
function qo(s, e) {
|
|
465
465
|
const t = /* @__PURE__ */ new Map(), r = (o, n) => {
|
|
466
466
|
const i = Be("sha256");
|
|
467
467
|
n.hash(o, i);
|
|
@@ -472,68 +472,68 @@ function zo(s, e) {
|
|
|
472
472
|
}
|
|
473
473
|
return t.get(a);
|
|
474
474
|
};
|
|
475
|
-
return r(e,
|
|
475
|
+
return r(e, Zr);
|
|
476
476
|
}
|
|
477
|
-
const
|
|
477
|
+
const Xo = { name: "TengoTemplateGet", version: "1" }, Yo = "registry", Qo = "templateURI", Zo = "template", tu = { name: "TengoTemplatePack", version: "1" }, ru = {
|
|
478
478
|
name: "TengoTemplatePackConvert",
|
|
479
479
|
version: "1"
|
|
480
|
-
},
|
|
481
|
-
async function
|
|
480
|
+
}, su = "templatePack", ou = "template";
|
|
481
|
+
async function en(s) {
|
|
482
482
|
switch (s.type) {
|
|
483
483
|
case "from-file":
|
|
484
484
|
return {
|
|
485
485
|
type: "explicit",
|
|
486
|
-
content: await
|
|
486
|
+
content: await Y.promises.readFile(s.path)
|
|
487
487
|
};
|
|
488
488
|
case "from-registry":
|
|
489
489
|
case "explicit":
|
|
490
490
|
return s;
|
|
491
491
|
default:
|
|
492
|
-
return
|
|
492
|
+
return K(s);
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
|
-
function
|
|
496
|
-
const t = s.createStruct(
|
|
495
|
+
function tn(s, e) {
|
|
496
|
+
const t = s.createStruct(Xo), r = x(t, Yo), o = x(t, Qo), n = x(t, Zo);
|
|
497
497
|
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;
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function Lt(s, e) {
|
|
500
500
|
switch (e.type) {
|
|
501
501
|
case "from-registry":
|
|
502
|
-
return
|
|
502
|
+
return tn(s, e);
|
|
503
503
|
case "explicit":
|
|
504
|
-
return
|
|
504
|
+
return Wo(s, e);
|
|
505
505
|
default:
|
|
506
|
-
return
|
|
506
|
+
return K(e);
|
|
507
507
|
}
|
|
508
508
|
}
|
|
509
|
-
const
|
|
509
|
+
const es = { name: "Frontend/FromUrl", version: "1" }, ts = {
|
|
510
510
|
name: "Frontend/FromFolder",
|
|
511
511
|
version: "1"
|
|
512
512
|
};
|
|
513
|
-
function
|
|
513
|
+
function rn(s, e) {
|
|
514
514
|
switch (e.type) {
|
|
515
515
|
case "url":
|
|
516
516
|
return s.createValue(
|
|
517
|
-
|
|
517
|
+
es,
|
|
518
518
|
JSON.stringify({ url: e.url })
|
|
519
519
|
);
|
|
520
520
|
case "local":
|
|
521
521
|
return s.createValue(
|
|
522
|
-
|
|
522
|
+
ts,
|
|
523
523
|
JSON.stringify({
|
|
524
524
|
path: e.path,
|
|
525
525
|
signature: e.signature
|
|
526
526
|
})
|
|
527
527
|
);
|
|
528
528
|
default:
|
|
529
|
-
return
|
|
529
|
+
return K(e);
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
|
-
const
|
|
533
|
-
function
|
|
532
|
+
const sn = { name: "BlockPackCustom", version: "1" }, rs = "template", ss = "frontend";
|
|
533
|
+
function nr(s) {
|
|
534
534
|
return s.endsWith("/") ? s : `${s}/`;
|
|
535
535
|
}
|
|
536
|
-
class
|
|
536
|
+
class on {
|
|
537
537
|
constructor(e, t, r) {
|
|
538
538
|
this.v2RegistryProvider = e, this.signer = t, this.http = r;
|
|
539
539
|
}
|
|
@@ -542,17 +542,17 @@ class sn {
|
|
|
542
542
|
case "explicit":
|
|
543
543
|
return e.config;
|
|
544
544
|
case "dev-v1": {
|
|
545
|
-
const t = await
|
|
545
|
+
const t = await tr(e.folder), r = await Y.promises.readFile(t.config, { encoding: "utf-8" });
|
|
546
546
|
return JSON.parse(r);
|
|
547
547
|
}
|
|
548
548
|
case "dev-v2": {
|
|
549
|
-
const t = await
|
|
549
|
+
const t = await zt(e.folder), r = await Y.promises.readFile(t.components.model.file, {
|
|
550
550
|
encoding: "utf-8"
|
|
551
551
|
});
|
|
552
552
|
return JSON.parse(r);
|
|
553
553
|
}
|
|
554
554
|
case "from-registry-v1": {
|
|
555
|
-
const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${
|
|
555
|
+
const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${nr(e.registryUrl)}${he.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`;
|
|
556
556
|
return await (await le(`${r}/config.json`, t)).body.json();
|
|
557
557
|
}
|
|
558
558
|
case "from-registry-v2": {
|
|
@@ -560,7 +560,7 @@ class sn {
|
|
|
560
560
|
return await (await le(o.model.url, t)).body.json();
|
|
561
561
|
}
|
|
562
562
|
default:
|
|
563
|
-
return
|
|
563
|
+
return K(e);
|
|
564
564
|
}
|
|
565
565
|
}
|
|
566
566
|
async prepare(e) {
|
|
@@ -568,8 +568,8 @@ class sn {
|
|
|
568
568
|
case "explicit":
|
|
569
569
|
return e;
|
|
570
570
|
case "dev-v1": {
|
|
571
|
-
const t = await
|
|
572
|
-
await
|
|
571
|
+
const t = await tr(e.folder), r = await Y.promises.readFile(t.workflow), o = JSON.parse(
|
|
572
|
+
await Y.promises.readFile(t.config, "utf-8")
|
|
573
573
|
), n = t.ui;
|
|
574
574
|
return {
|
|
575
575
|
type: "explicit",
|
|
@@ -587,14 +587,14 @@ class sn {
|
|
|
587
587
|
};
|
|
588
588
|
}
|
|
589
589
|
case "dev-v2": {
|
|
590
|
-
const t = await
|
|
591
|
-
await
|
|
590
|
+
const t = await zt(e.folder), r = JSON.parse(
|
|
591
|
+
await Y.promises.readFile(t.components.model.file, {
|
|
592
592
|
encoding: "utf-8"
|
|
593
593
|
})
|
|
594
|
-
), o = await
|
|
594
|
+
), o = await Y.promises.readFile(
|
|
595
595
|
t.components.workflow.main.file
|
|
596
596
|
), n = t.components.ui.folder, i = { ...e };
|
|
597
|
-
return e.mtime === void 0 && (i.mtime = await
|
|
597
|
+
return e.mtime === void 0 && (i.mtime = await At(t)), {
|
|
598
598
|
type: "explicit",
|
|
599
599
|
template: {
|
|
600
600
|
type: "explicit",
|
|
@@ -610,7 +610,7 @@ class sn {
|
|
|
610
610
|
};
|
|
611
611
|
}
|
|
612
612
|
case "from-registry-v1": {
|
|
613
|
-
const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${
|
|
613
|
+
const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${nr(e.registryUrl)}${he.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, o = `${r}/template.plj.gz`, n = await le(o, t);
|
|
614
614
|
if (n.statusCode !== 200)
|
|
615
615
|
throw new Error(
|
|
616
616
|
`Block not found in registry (url = ${o} ; code = ${n.statusCode}): ` + JSON.stringify(e)
|
|
@@ -647,26 +647,26 @@ class sn {
|
|
|
647
647
|
};
|
|
648
648
|
}
|
|
649
649
|
default:
|
|
650
|
-
return
|
|
650
|
+
return K(e);
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
653
|
}
|
|
654
|
-
function
|
|
655
|
-
const t = { config: e.config, source: e.source }, r = s.createStruct(
|
|
656
|
-
return s.createField(x(r,
|
|
654
|
+
function nn(s, e) {
|
|
655
|
+
const t = { config: e.config, source: e.source }, r = s.createStruct(sn, JSON.stringify(t));
|
|
656
|
+
return s.createField(x(r, rs), "Input", Lt(s, e.template)), s.createField(x(r, ss), "Input", rn(s, e.frontend)), s.lock(r), r;
|
|
657
657
|
}
|
|
658
|
-
function
|
|
658
|
+
function ir(s, e) {
|
|
659
659
|
switch (e.type) {
|
|
660
660
|
case "explicit":
|
|
661
|
-
return
|
|
661
|
+
return nn(s, e);
|
|
662
662
|
default:
|
|
663
|
-
return
|
|
663
|
+
return K(e.type);
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
666
|
function Ge(s, e) {
|
|
667
667
|
return { __isRef: !0, blockId: s, name: e };
|
|
668
668
|
}
|
|
669
|
-
function
|
|
669
|
+
function an(s) {
|
|
670
670
|
return typeof s == "object" && s !== null && "__isRef" in s && s.__isRef === !0 && "blockId" in s && "name" in s;
|
|
671
671
|
}
|
|
672
672
|
function Ct(s, e, t) {
|
|
@@ -682,7 +682,7 @@ function Ct(s, e, t) {
|
|
|
682
682
|
return;
|
|
683
683
|
case "object":
|
|
684
684
|
if (e === null) return;
|
|
685
|
-
if (
|
|
685
|
+
if (an(e))
|
|
686
686
|
t === void 0 || t.has(e.blockId) ? s.upstreams.add(e.blockId) : s.missingReferences = !0;
|
|
687
687
|
else if (Array.isArray(e))
|
|
688
688
|
for (const o of e) Ct(s, o, t);
|
|
@@ -691,21 +691,21 @@ function Ct(s, e, t) {
|
|
|
691
691
|
Ct(s, o, t);
|
|
692
692
|
return;
|
|
693
693
|
default:
|
|
694
|
-
|
|
694
|
+
K(r);
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function cn(s, e) {
|
|
698
698
|
const t = { upstreams: /* @__PURE__ */ new Set(), missingReferences: !1 };
|
|
699
699
|
return Ct(t, s, e), t;
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function oe(s) {
|
|
702
702
|
return {
|
|
703
703
|
*[Symbol.iterator]() {
|
|
704
704
|
for (const e of s.groups) for (const t of e.blocks) yield t;
|
|
705
705
|
}
|
|
706
706
|
};
|
|
707
707
|
}
|
|
708
|
-
class
|
|
708
|
+
class os {
|
|
709
709
|
constructor(e) {
|
|
710
710
|
/** Nodes are stored in the map in topological order */
|
|
711
711
|
w(this, "nodes");
|
|
@@ -727,8 +727,8 @@ class ss {
|
|
|
727
727
|
const i = [];
|
|
728
728
|
for (const a of o) {
|
|
729
729
|
const c = this.nodes.get(a);
|
|
730
|
-
r(c), c[e].forEach((
|
|
731
|
-
n.has(
|
|
730
|
+
r(c), c[e].forEach((u) => {
|
|
731
|
+
n.has(u) || (n.add(u), i.push(u));
|
|
732
732
|
});
|
|
733
733
|
}
|
|
734
734
|
o = i;
|
|
@@ -738,21 +738,21 @@ class ss {
|
|
|
738
738
|
function Pt(s) {
|
|
739
739
|
const e = /* @__PURE__ */ new Map();
|
|
740
740
|
let t;
|
|
741
|
-
for (const { id: r } of
|
|
741
|
+
for (const { id: r } of oe(s)) {
|
|
742
742
|
const o = {
|
|
743
743
|
id: r,
|
|
744
744
|
missingReferences: !1
|
|
745
745
|
};
|
|
746
746
|
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;
|
|
747
747
|
}
|
|
748
|
-
return t !== void 0 && (t.downstream = /* @__PURE__ */ new Set()), new
|
|
748
|
+
return t !== void 0 && (t.downstream = /* @__PURE__ */ new Set()), new os(e);
|
|
749
749
|
}
|
|
750
|
-
function
|
|
750
|
+
function Xe(s, e) {
|
|
751
751
|
const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
|
|
752
|
-
for (const { id: o } of
|
|
752
|
+
for (const { id: o } of oe(s)) {
|
|
753
753
|
const n = e(o);
|
|
754
754
|
if (n === void 0) continue;
|
|
755
|
-
const i =
|
|
755
|
+
const i = cn(n, r), a = {
|
|
756
756
|
id: o,
|
|
757
757
|
missingReferences: i.missingReferences,
|
|
758
758
|
upstream: i.upstreams,
|
|
@@ -761,41 +761,41 @@ function qe(s, e) {
|
|
|
761
761
|
};
|
|
762
762
|
t.set(o, a), i.upstreams.forEach((c) => t.get(c).downstream.add(o)), r.add(o);
|
|
763
763
|
}
|
|
764
|
-
return new
|
|
764
|
+
return new os(t);
|
|
765
765
|
}
|
|
766
|
-
function
|
|
766
|
+
function ln(s, e) {
|
|
767
767
|
if (s.size !== e.size) return !1;
|
|
768
768
|
for (const t of s) if (!e.has(t)) return !1;
|
|
769
769
|
return !0;
|
|
770
770
|
}
|
|
771
|
-
function
|
|
772
|
-
if (s.size > e.size) return
|
|
771
|
+
function kt(s, e) {
|
|
772
|
+
if (s.size > e.size) return kt(e, s);
|
|
773
773
|
for (const t of s) if (e.has(t)) return !0;
|
|
774
774
|
return !1;
|
|
775
775
|
}
|
|
776
|
-
function
|
|
776
|
+
function ar(s, e) {
|
|
777
777
|
const t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
|
|
778
778
|
return s.nodes.forEach((n) => {
|
|
779
779
|
const i = e.nodes.get(n.id);
|
|
780
|
-
i === void 0 ? t.add(n.id) : (!
|
|
780
|
+
i === void 0 ? t.add(n.id) : (!ln(n.upstream, i.upstream) || kt(n.upstream, o)) && o.add(n.id);
|
|
781
781
|
}), e.nodes.forEach((n) => {
|
|
782
|
-
s.nodes.has(n.id) ?
|
|
782
|
+
s.nodes.has(n.id) ? kt(n.upstream, o) && o.add(n.id) : r.add(n.id);
|
|
783
783
|
}), { onlyInA: t, onlyInB: r, different: o };
|
|
784
784
|
}
|
|
785
|
-
let
|
|
786
|
-
async function
|
|
787
|
-
if (
|
|
788
|
-
const s = await
|
|
785
|
+
let lt;
|
|
786
|
+
async function ns() {
|
|
787
|
+
if (lt === void 0) {
|
|
788
|
+
const s = await en(Zs["pframes.export-pframe"]);
|
|
789
789
|
if (s.type !== "explicit") throw new Error("Unexpected prepared template type.");
|
|
790
790
|
const e = Be("sha256").update(s.content).digest("hex");
|
|
791
|
-
|
|
791
|
+
lt = { spec: s, hash: e };
|
|
792
792
|
}
|
|
793
|
-
return
|
|
793
|
+
return lt;
|
|
794
794
|
}
|
|
795
|
-
function
|
|
796
|
-
return
|
|
795
|
+
function un(s, e, t) {
|
|
796
|
+
return Qr(s, e, !0, { pf: t }, ["result"]).result;
|
|
797
797
|
}
|
|
798
|
-
function
|
|
798
|
+
function ut(s, e) {
|
|
799
799
|
let t = !1, r, o;
|
|
800
800
|
return () => {
|
|
801
801
|
if (!t)
|
|
@@ -804,13 +804,13 @@ function lt(s, e) {
|
|
|
804
804
|
return r !== n && (r = n, o = e()), e();
|
|
805
805
|
};
|
|
806
806
|
}
|
|
807
|
-
class
|
|
807
|
+
class cr {
|
|
808
808
|
constructor(e, t) {
|
|
809
|
-
w(this, "currentInputsC",
|
|
809
|
+
w(this, "currentInputsC", ut(
|
|
810
810
|
() => this.fields.currentArgs.modCount,
|
|
811
811
|
() => JSON.parse(Buffer.from(this.fields.currentArgs.value).toString())
|
|
812
812
|
));
|
|
813
|
-
w(this, "actualProductionInputsC",
|
|
813
|
+
w(this, "actualProductionInputsC", ut(
|
|
814
814
|
() => {
|
|
815
815
|
var e;
|
|
816
816
|
return (e = this.fields.prodArgs) == null ? void 0 : e.modCount;
|
|
@@ -822,7 +822,7 @@ class ar {
|
|
|
822
822
|
return JSON.parse(Buffer.from(e).toString());
|
|
823
823
|
}
|
|
824
824
|
));
|
|
825
|
-
w(this, "productionStaleC",
|
|
825
|
+
w(this, "productionStaleC", ut(
|
|
826
826
|
() => {
|
|
827
827
|
var e;
|
|
828
828
|
return `${this.fields.currentArgs.modCount}_${(e = this.fields.prodArgs) == null ? void 0 : e.modCount}`;
|
|
@@ -868,16 +868,16 @@ class ar {
|
|
|
868
868
|
getTemplate(e) {
|
|
869
869
|
return e.getFutureFieldValue(
|
|
870
870
|
A.unwrapHolder(e, this.fields.blockPack.ref),
|
|
871
|
-
|
|
871
|
+
rs,
|
|
872
872
|
"Input"
|
|
873
873
|
);
|
|
874
874
|
}
|
|
875
875
|
}
|
|
876
|
-
const
|
|
876
|
+
const dn = (s) => {
|
|
877
877
|
throw new Error(`No new block info for ${s}`);
|
|
878
878
|
};
|
|
879
|
-
class
|
|
880
|
-
constructor(e, t, r, o, n, i, a, c,
|
|
879
|
+
class Ze {
|
|
880
|
+
constructor(e, t, r, o, n, i, a, c, u, l, d, f) {
|
|
881
881
|
w(this, "globalModCount", 0);
|
|
882
882
|
w(this, "fieldsChanged", !1);
|
|
883
883
|
//
|
|
@@ -896,7 +896,7 @@ class Qe {
|
|
|
896
896
|
w(this, "stagingGraph");
|
|
897
897
|
w(this, "pendingProductionGraph");
|
|
898
898
|
w(this, "actualProductionGraph");
|
|
899
|
-
this.rid = e, this.tx = t, this.author = r, this.schema = o, this.lastModified = n, this.meta = i, this.struct = a, this.renderingState = c, this.blocksInLimbo =
|
|
899
|
+
this.rid = e, this.tx = t, this.author = r, this.schema = o, this.lastModified = n, this.meta = i, this.struct = a, this.renderingState = c, this.blocksInLimbo = u, this.blockInfos = l, this.blockFrontendStates = d, this.ctxExportTplHolder = f;
|
|
900
900
|
}
|
|
901
901
|
fixProblemsAndMigrate() {
|
|
902
902
|
this.blockInfos.forEach((t) => {
|
|
@@ -904,7 +904,7 @@ class Qe {
|
|
|
904
904
|
});
|
|
905
905
|
let e;
|
|
906
906
|
this.blockInfos.forEach((t) => {
|
|
907
|
-
t.fields.blockSettings === void 0 && (e === void 0 && (e = this.createJsonFieldValue(
|
|
907
|
+
t.fields.blockSettings === void 0 && (e === void 0 && (e = this.createJsonFieldValue(Wt)), this.setBlockFieldObj(t.id, "blockSettings", e));
|
|
908
908
|
});
|
|
909
909
|
}
|
|
910
910
|
get wasModified() {
|
|
@@ -917,13 +917,13 @@ class Qe {
|
|
|
917
917
|
return this.stagingGraph === void 0 && (this.stagingGraph = Pt(this.struct)), this.stagingGraph;
|
|
918
918
|
}
|
|
919
919
|
getPendingProductionGraph() {
|
|
920
|
-
return this.pendingProductionGraph === void 0 && (this.pendingProductionGraph =
|
|
920
|
+
return this.pendingProductionGraph === void 0 && (this.pendingProductionGraph = Xe(
|
|
921
921
|
this.struct,
|
|
922
922
|
(e) => this.getBlockInfo(e).currentInputs
|
|
923
923
|
)), this.pendingProductionGraph;
|
|
924
924
|
}
|
|
925
925
|
getActualProductionGraph() {
|
|
926
|
-
return this.actualProductionGraph === void 0 && (this.actualProductionGraph =
|
|
926
|
+
return this.actualProductionGraph === void 0 && (this.actualProductionGraph = Xe(
|
|
927
927
|
this.struct,
|
|
928
928
|
(e) => this.getBlockInfo(e).actualProductionInputs
|
|
929
929
|
)), this.actualProductionGraph;
|
|
@@ -944,11 +944,11 @@ class Qe {
|
|
|
944
944
|
return this.createJsonFieldValueByContent(JSON.stringify(e));
|
|
945
945
|
}
|
|
946
946
|
getBlock(e) {
|
|
947
|
-
for (const t of
|
|
947
|
+
for (const t of oe(this.struct)) if (t.id === e) return t;
|
|
948
948
|
throw new Error("block not found");
|
|
949
949
|
}
|
|
950
950
|
setBlockFieldObj(e, t, r) {
|
|
951
|
-
const o = x(this.rid,
|
|
951
|
+
const o = x(this.rid, U(e, t));
|
|
952
952
|
if (r.ref === void 0) throw new Error("Can't set value with empty ref");
|
|
953
953
|
this.getBlockInfo(e).fields[t] === void 0 ? this.tx.createField(o, "Dynamic", r.ref) : this.tx.setField(o, r.ref), this.getBlockInfo(e).fields[t] = {
|
|
954
954
|
modCount: this.globalModCount++,
|
|
@@ -963,7 +963,7 @@ class Qe {
|
|
|
963
963
|
const o = this.getBlockInfo(e);
|
|
964
964
|
for (const n of t) {
|
|
965
965
|
const i = o.fields;
|
|
966
|
-
n in i && (this.tx.removeField(x(this.rid,
|
|
966
|
+
n in i && (this.tx.removeField(x(this.rid, U(e, n))), delete i[n], this.fieldsChanged = !0, r = !0);
|
|
967
967
|
}
|
|
968
968
|
return r;
|
|
969
969
|
}
|
|
@@ -1035,7 +1035,7 @@ class Qe {
|
|
|
1035
1035
|
if (((n = o.fields.prodCtx) == null ? void 0 : n.ref) === void 0)
|
|
1036
1036
|
throw new Error("One of the upstreams staging is not rendered.");
|
|
1037
1037
|
t.push(A.unwrapHolder(this.tx, o.fields.prodCtx.ref));
|
|
1038
|
-
}),
|
|
1038
|
+
}), sr(this.tx, t);
|
|
1039
1039
|
}
|
|
1040
1040
|
createStagingCtx(e) {
|
|
1041
1041
|
const t = [];
|
|
@@ -1045,16 +1045,16 @@ class Qe {
|
|
|
1045
1045
|
if (((n = o.fields.stagingCtx) == null ? void 0 : n.ref) === void 0)
|
|
1046
1046
|
throw new Error("One of the upstreams staging is not rendered.");
|
|
1047
1047
|
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));
|
|
1048
|
-
}),
|
|
1048
|
+
}), sr(this.tx, t);
|
|
1049
1049
|
}
|
|
1050
1050
|
exportCtx(e) {
|
|
1051
|
-
return
|
|
1051
|
+
return un(this.tx, A.unwrapHolder(this.tx, this.ctxExportTplHolder), e);
|
|
1052
1052
|
}
|
|
1053
1053
|
renderStagingFor(e) {
|
|
1054
1054
|
this.resetStaging(e);
|
|
1055
1055
|
const t = this.getBlockInfo(e), r = this.createStagingCtx(this.getStagingGraph().nodes.get(e).upstream);
|
|
1056
1056
|
if (this.getBlock(e).renderingMode !== "Heavy") throw new Error("not supported yet");
|
|
1057
|
-
const o = t.getTemplate(this.tx), n =
|
|
1057
|
+
const o = t.getTemplate(this.tx), n = rr(this.tx, o, {
|
|
1058
1058
|
args: t.fields.currentArgs.ref,
|
|
1059
1059
|
blockId: this.tx.createValue(A.JsonString, JSON.stringify(e)),
|
|
1060
1060
|
isProduction: this.tx.createValue(A.JsonBool, JSON.stringify(!1)),
|
|
@@ -1072,7 +1072,7 @@ class Qe {
|
|
|
1072
1072
|
const t = this.getBlockInfo(e), r = this.createProdCtx(this.getPendingProductionGraph().nodes.get(e).upstream);
|
|
1073
1073
|
if (this.getBlock(e).renderingMode === "Light")
|
|
1074
1074
|
throw new Error("Can't render production for light block.");
|
|
1075
|
-
const o = t.getTemplate(this.tx), n =
|
|
1075
|
+
const o = t.getTemplate(this.tx), n = rr(this.tx, o, {
|
|
1076
1076
|
args: t.fields.currentArgs.ref,
|
|
1077
1077
|
blockId: this.tx.createValue(A.JsonString, JSON.stringify(e)),
|
|
1078
1078
|
isProduction: this.tx.createValue(A.JsonBool, JSON.stringify(!0)),
|
|
@@ -1089,31 +1089,31 @@ class Qe {
|
|
|
1089
1089
|
// Structure changes
|
|
1090
1090
|
//
|
|
1091
1091
|
/** Very generic method, better check for more specialized case-specific methods first. */
|
|
1092
|
-
updateStructure(e, t =
|
|
1093
|
-
const r = this.getStagingGraph(), o = this.getActualProductionGraph(), n = Pt(e), i =
|
|
1092
|
+
updateStructure(e, t = dn) {
|
|
1093
|
+
const r = this.getStagingGraph(), o = this.getActualProductionGraph(), n = Pt(e), i = Xe(
|
|
1094
1094
|
e,
|
|
1095
|
-
(
|
|
1096
|
-
var
|
|
1097
|
-
return (
|
|
1095
|
+
(u) => {
|
|
1096
|
+
var l;
|
|
1097
|
+
return (l = this.blockInfos.get(u)) == null ? void 0 : l.actualProductionInputs;
|
|
1098
1098
|
}
|
|
1099
|
-
), a =
|
|
1100
|
-
for (const
|
|
1101
|
-
const { fields:
|
|
1102
|
-
this.deleteBlockFields(
|
|
1099
|
+
), a = ar(r, n), c = ar(o, i);
|
|
1100
|
+
for (const u of a.onlyInA) {
|
|
1101
|
+
const { fields: l } = this.getBlockInfo(u);
|
|
1102
|
+
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);
|
|
1103
1103
|
}
|
|
1104
|
-
for (const
|
|
1105
|
-
const
|
|
1106
|
-
this.blockInfos.set(
|
|
1107
|
-
const d = t(
|
|
1108
|
-
this.setBlockField(
|
|
1109
|
-
|
|
1104
|
+
for (const u of a.onlyInB) {
|
|
1105
|
+
const l = new cr(u, {});
|
|
1106
|
+
this.blockInfos.set(u, l);
|
|
1107
|
+
const d = t(u), f = ir(this.tx, d.blockPack);
|
|
1108
|
+
this.setBlockField(u, "blockPack", A.wrapInHolder(this.tx, f), "NotReady"), this.setBlockFieldObj(
|
|
1109
|
+
u,
|
|
1110
1110
|
"blockSettings",
|
|
1111
|
-
this.createJsonFieldValue(
|
|
1112
|
-
), this.setBlockFieldObj(
|
|
1111
|
+
this.createJsonFieldValue(Wt)
|
|
1112
|
+
), this.setBlockFieldObj(u, "currentArgs", this.createJsonFieldValueByContent(d.args)), d.uiState && (this.blockFrontendStates.set(u, d.uiState), this.changedBlockFrontendStates.add(u)), l.check();
|
|
1113
1113
|
}
|
|
1114
|
-
for (const
|
|
1115
|
-
o.traverse("downstream", [...c.different], (
|
|
1116
|
-
this.resetOrLimboProduction(
|
|
1114
|
+
for (const u of a.different) this.resetStaging(u);
|
|
1115
|
+
o.traverse("downstream", [...c.different], (u) => {
|
|
1116
|
+
this.resetOrLimboProduction(u.id);
|
|
1117
1117
|
}), (a.onlyInB.size > 0 || a.onlyInA.size > 0 || a.different.size > 0) && this.resetStagingRefreshTimestamp(), this.struct = e, this.structureChanged = !0, this.stagingGraph = void 0, this.pendingProductionGraph = void 0, this.actualProductionGraph = void 0, this.updateLastModified();
|
|
1118
1118
|
}
|
|
1119
1119
|
//
|
|
@@ -1160,7 +1160,7 @@ class Qe {
|
|
|
1160
1160
|
this.setBlockField(
|
|
1161
1161
|
e,
|
|
1162
1162
|
"blockPack",
|
|
1163
|
-
A.wrapInHolder(this.tx,
|
|
1163
|
+
A.wrapInHolder(this.tx, ir(this.tx, t)),
|
|
1164
1164
|
"NotReady"
|
|
1165
1165
|
), 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(
|
|
1166
1166
|
"downstream",
|
|
@@ -1181,17 +1181,17 @@ class Qe {
|
|
|
1181
1181
|
for (const a of r) {
|
|
1182
1182
|
const c = o.nodes.get(a);
|
|
1183
1183
|
if (c === void 0) throw new Error(`Can't find block with id: ${a}`);
|
|
1184
|
-
for (const
|
|
1185
|
-
if (!r.has(
|
|
1184
|
+
for (const u of c.upstream)
|
|
1185
|
+
if (!r.has(u))
|
|
1186
1186
|
throw new Error("Can't render blocks not including all upstreams.");
|
|
1187
1187
|
}
|
|
1188
1188
|
const n = /* @__PURE__ */ new Set();
|
|
1189
|
-
for (const a of
|
|
1189
|
+
for (const a of oe(this.structure)) {
|
|
1190
1190
|
if (!r.has(a.id)) continue;
|
|
1191
1191
|
let c = this.getBlockInfo(a.id).requireProductionRendering || this.blocksInLimbo.has(a.id);
|
|
1192
1192
|
if (!c) {
|
|
1193
|
-
for (const
|
|
1194
|
-
if (n.has(
|
|
1193
|
+
for (const u of o.nodes.get(a.id).upstream)
|
|
1194
|
+
if (n.has(u)) {
|
|
1195
1195
|
c = !0;
|
|
1196
1196
|
break;
|
|
1197
1197
|
}
|
|
@@ -1209,13 +1209,13 @@ class Qe {
|
|
|
1209
1209
|
* accordingly */
|
|
1210
1210
|
stopProduction(...e) {
|
|
1211
1211
|
var i, a;
|
|
1212
|
-
const t = this.getActualProductionGraph(), r = new
|
|
1212
|
+
const t = this.getActualProductionGraph(), r = new Kr(e), o = new Set(e), n = [];
|
|
1213
1213
|
for (; !r.isEmpty(); ) {
|
|
1214
|
-
const c = r.shift(),
|
|
1215
|
-
if (!(((i =
|
|
1214
|
+
const c = r.shift(), u = this.getBlockInfo(c).fields;
|
|
1215
|
+
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")) {
|
|
1216
1216
|
n.push(c);
|
|
1217
|
-
for (const
|
|
1218
|
-
o.has(
|
|
1217
|
+
for (const l of t.traverseIdsExcludingRoots("downstream", c))
|
|
1218
|
+
o.has(l) || (r.push(l), o.add(l));
|
|
1219
1219
|
}
|
|
1220
1220
|
}
|
|
1221
1221
|
for (const c of t.traverseIdsExcludingRoots("downstream", ...n))
|
|
@@ -1269,14 +1269,14 @@ class Qe {
|
|
|
1269
1269
|
assignAuthorMarkers() {
|
|
1270
1270
|
const e = this.author ? JSON.stringify(this.author) : void 0;
|
|
1271
1271
|
for (const t of this.blocksWithChangedInputs)
|
|
1272
|
-
e === void 0 ? this.tx.deleteKValue(this.rid,
|
|
1273
|
-
(this.metaChanged || this.structureChanged) && (e === void 0 ? this.tx.deleteKValue(this.rid,
|
|
1272
|
+
e === void 0 ? this.tx.deleteKValue(this.rid, bt(t)) : this.tx.setKValue(this.rid, bt(t), e);
|
|
1273
|
+
(this.metaChanged || this.structureChanged) && (e === void 0 ? this.tx.deleteKValue(this.rid, Rt) : this.tx.setKValue(this.rid, Rt, e));
|
|
1274
1274
|
}
|
|
1275
1275
|
save() {
|
|
1276
1276
|
if (this.wasModified) {
|
|
1277
1277
|
this.lastModifiedChanged && this.tx.setKValue(this.rid, Le, JSON.stringify(this.lastModified)), this.structureChanged && this.tx.setKValue(this.rid, fe, JSON.stringify(this.struct)), this.renderingStateChanged && this.tx.setKValue(
|
|
1278
1278
|
this.rid,
|
|
1279
|
-
|
|
1279
|
+
Qe,
|
|
1280
1280
|
JSON.stringify({
|
|
1281
1281
|
...this.renderingState,
|
|
1282
1282
|
blocksInLimbo: [...this.blocksInLimbo]
|
|
@@ -1284,127 +1284,127 @@ class Qe {
|
|
|
1284
1284
|
), this.metaChanged && this.tx.setKValue(this.rid, De, JSON.stringify(this.meta));
|
|
1285
1285
|
for (const e of this.changedBlockFrontendStates) {
|
|
1286
1286
|
const t = this.blockFrontendStates.get(e);
|
|
1287
|
-
t === void 0 ? this.tx.deleteKValue(this.rid,
|
|
1287
|
+
t === void 0 ? this.tx.deleteKValue(this.rid, wt(e)) : this.tx.setKValue(this.rid, wt(e), t);
|
|
1288
1288
|
}
|
|
1289
1289
|
this.assignAuthorMarkers();
|
|
1290
1290
|
}
|
|
1291
1291
|
}
|
|
1292
1292
|
static async load(e, t, r) {
|
|
1293
|
-
const o = e.getResourceData(t, !0), n = e.getKValueJson(t,
|
|
1293
|
+
const o = e.getResourceData(t, !0), n = e.getKValueJson(t, qr), i = e.getKValueJson(t, Le), a = e.getKValueJson(t, De), c = e.getKValueJson(t, fe), u = e.getKValueJson(t, Qe), l = e.listKeyValuesString(t), [
|
|
1294
1294
|
d,
|
|
1295
|
-
g,
|
|
1296
1295
|
f,
|
|
1297
1296
|
h,
|
|
1298
1297
|
E,
|
|
1299
|
-
|
|
1300
|
-
|
|
1298
|
+
g,
|
|
1299
|
+
{ stagingRefreshTimestamp: D, blocksInLimbo: T },
|
|
1300
|
+
j
|
|
1301
1301
|
] = await Promise.all([
|
|
1302
1302
|
o,
|
|
1303
1303
|
n,
|
|
1304
1304
|
i,
|
|
1305
1305
|
a,
|
|
1306
1306
|
c,
|
|
1307
|
-
|
|
1308
|
-
|
|
1307
|
+
u,
|
|
1308
|
+
l
|
|
1309
1309
|
]);
|
|
1310
|
-
if (
|
|
1310
|
+
if (f !== Xr)
|
|
1311
1311
|
throw new Error(
|
|
1312
|
-
`Can't act on this project resource because it has a wrong schema version: ${
|
|
1312
|
+
`Can't act on this project resource because it has a wrong schema version: ${f}`
|
|
1313
1313
|
);
|
|
1314
|
-
const
|
|
1314
|
+
const $ = /* @__PURE__ */ new Map();
|
|
1315
1315
|
for (const p of d.fields) {
|
|
1316
|
-
const m =
|
|
1316
|
+
const m = No(p.name);
|
|
1317
1317
|
if (m === void 0) continue;
|
|
1318
|
-
let y =
|
|
1318
|
+
let y = $.get(m.blockId);
|
|
1319
1319
|
y === void 0 && (y = {
|
|
1320
1320
|
id: m.blockId,
|
|
1321
1321
|
fields: {}
|
|
1322
|
-
},
|
|
1322
|
+
}, $.set(m.blockId, y)), y.fields[m.fieldName] = Ye(p.value) ? { modCount: 0 } : { modCount: 0, ref: p.value };
|
|
1323
1323
|
}
|
|
1324
|
-
const
|
|
1324
|
+
const G = await ns(), ge = Et(G.hash), L = d.fields.find(
|
|
1325
1325
|
(p) => p.name === ge
|
|
1326
1326
|
);
|
|
1327
|
-
let
|
|
1328
|
-
L !== void 0 ?
|
|
1329
|
-
x(t,
|
|
1327
|
+
let q;
|
|
1328
|
+
L !== void 0 ? q = yt(L.value) : (q = A.wrapInHolder(e, Lt(e, G.spec)), e.createField(
|
|
1329
|
+
x(t, Et(G.hash)),
|
|
1330
1330
|
"Dynamic",
|
|
1331
|
-
|
|
1331
|
+
q
|
|
1332
1332
|
));
|
|
1333
|
-
const ie = { stagingRefreshTimestamp:
|
|
1334
|
-
for (const p of
|
|
1335
|
-
const m =
|
|
1336
|
-
m !== void 0 &&
|
|
1333
|
+
const ie = { stagingRefreshTimestamp: D }, W = new Set(T), M = /* @__PURE__ */ new Map();
|
|
1334
|
+
for (const p of j) {
|
|
1335
|
+
const m = To(p.key);
|
|
1336
|
+
m !== void 0 && M.set(m, p.value);
|
|
1337
1337
|
}
|
|
1338
|
-
const
|
|
1339
|
-
|
|
1338
|
+
const V = [];
|
|
1339
|
+
$.forEach(({ fields: p }) => {
|
|
1340
1340
|
for (const [, m] of Object.entries(p))
|
|
1341
1341
|
if (m.ref !== void 0) {
|
|
1342
|
-
if (!
|
|
1342
|
+
if (!Js(m.ref) || Gs(m.ref))
|
|
1343
1343
|
throw new Error("unexpected behaviour");
|
|
1344
|
-
|
|
1344
|
+
V.push([m, e.getResourceData(m.ref, !1)]);
|
|
1345
1345
|
}
|
|
1346
1346
|
});
|
|
1347
|
-
for (const [p, m] of
|
|
1347
|
+
for (const [p, m] of V) {
|
|
1348
1348
|
const y = await m;
|
|
1349
|
-
p.value = y.data,
|
|
1349
|
+
p.value = y.data, qt(y.error) ? p.status = "Error" : y.resourceReady || qt(y.originalResourceId) ? p.status = "Ready" : p.status = "NotReady";
|
|
1350
1350
|
}
|
|
1351
|
-
const
|
|
1352
|
-
|
|
1351
|
+
const X = /* @__PURE__ */ new Map();
|
|
1352
|
+
$.forEach(({ id: p, fields: m }) => X.set(p, new cr(p, m)));
|
|
1353
1353
|
const me = /* @__PURE__ */ new Set();
|
|
1354
|
-
for (const p of
|
|
1355
|
-
if (!
|
|
1354
|
+
for (const p of oe(g)) {
|
|
1355
|
+
if (!X.has(p.id))
|
|
1356
1356
|
throw new Error(`Inconsistent project structure: no inputs for ${p.id}`);
|
|
1357
1357
|
me.add(p.id);
|
|
1358
1358
|
}
|
|
1359
|
-
|
|
1359
|
+
X.forEach((p) => {
|
|
1360
1360
|
if (!me.has(p.id))
|
|
1361
1361
|
throw new Error(`Inconsistent project structure: no structure entry for ${p.id}`);
|
|
1362
1362
|
p.check();
|
|
1363
1363
|
});
|
|
1364
|
-
const v = new
|
|
1364
|
+
const v = new Ze(
|
|
1365
1365
|
t,
|
|
1366
1366
|
e,
|
|
1367
1367
|
r,
|
|
1368
|
-
g,
|
|
1369
1368
|
f,
|
|
1370
1369
|
h,
|
|
1371
1370
|
E,
|
|
1371
|
+
g,
|
|
1372
1372
|
ie,
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1373
|
+
W,
|
|
1374
|
+
X,
|
|
1375
|
+
M,
|
|
1376
|
+
q
|
|
1377
1377
|
);
|
|
1378
1378
|
return v.fixProblemsAndMigrate(), v;
|
|
1379
1379
|
}
|
|
1380
1380
|
}
|
|
1381
|
-
async function
|
|
1382
|
-
const t = s.createEphemeral(
|
|
1381
|
+
async function pn(s, e = Oo) {
|
|
1382
|
+
const t = s.createEphemeral($o);
|
|
1383
1383
|
s.lock(t);
|
|
1384
1384
|
const r = String(Date.now());
|
|
1385
|
-
s.setKValue(t,
|
|
1386
|
-
const o = await
|
|
1385
|
+
s.setKValue(t, qr, JSON.stringify(Xr)), s.setKValue(t, Tt, r), s.setKValue(t, Le, r), s.setKValue(t, De, JSON.stringify(e)), s.setKValue(t, fe, JSON.stringify(Po)), s.setKValue(t, Qe, JSON.stringify(ko));
|
|
1386
|
+
const o = await ns();
|
|
1387
1387
|
return s.createField(
|
|
1388
|
-
x(t,
|
|
1388
|
+
x(t, Et(o.hash)),
|
|
1389
1389
|
"Dynamic",
|
|
1390
|
-
A.wrapInHolder(s,
|
|
1390
|
+
A.wrapInHolder(s, Lt(s, o.spec))
|
|
1391
1391
|
), t;
|
|
1392
1392
|
}
|
|
1393
1393
|
async function Me(s, e, t) {
|
|
1394
|
-
return
|
|
1394
|
+
return Q(s, e, void 0, t);
|
|
1395
1395
|
}
|
|
1396
|
-
async function
|
|
1397
|
-
if (s instanceof
|
|
1396
|
+
async function Q(s, e, t, r) {
|
|
1397
|
+
if (s instanceof Us)
|
|
1398
1398
|
return await s.withWriteTx("ProjectAction", async (o) => {
|
|
1399
|
-
const n = await
|
|
1399
|
+
const n = await Ze.load(o, e, t), i = await r(n);
|
|
1400
1400
|
return n.wasModified && (n.save(), await o.commit()), i;
|
|
1401
1401
|
});
|
|
1402
1402
|
{
|
|
1403
|
-
const o = await
|
|
1403
|
+
const o = await Ze.load(s, e, t), n = await r(o);
|
|
1404
1404
|
return o.save(), n;
|
|
1405
1405
|
}
|
|
1406
1406
|
}
|
|
1407
|
-
function*
|
|
1407
|
+
function* hn(s) {
|
|
1408
1408
|
switch (s.type) {
|
|
1409
1409
|
case "Json":
|
|
1410
1410
|
return;
|
|
@@ -1416,52 +1416,52 @@ function* pn(s) {
|
|
|
1416
1416
|
yield e, yield t;
|
|
1417
1417
|
return;
|
|
1418
1418
|
default:
|
|
1419
|
-
|
|
1419
|
+
K(s);
|
|
1420
1420
|
}
|
|
1421
1421
|
}
|
|
1422
|
-
function
|
|
1422
|
+
function lr(s, e) {
|
|
1423
1423
|
return Object.fromEntries(
|
|
1424
1424
|
Object.entries(s).map(([t, r]) => [t, e(r, t)])
|
|
1425
1425
|
);
|
|
1426
1426
|
}
|
|
1427
|
-
function
|
|
1427
|
+
function fn(s, e) {
|
|
1428
1428
|
switch (s.type) {
|
|
1429
1429
|
case "Json":
|
|
1430
1430
|
return { ...s };
|
|
1431
1431
|
case "JsonPartitioned":
|
|
1432
|
-
return { ...s, parts:
|
|
1432
|
+
return { ...s, parts: lr(s.parts, e) };
|
|
1433
1433
|
case "BinaryPartitioned":
|
|
1434
1434
|
return {
|
|
1435
1435
|
...s,
|
|
1436
|
-
parts:
|
|
1436
|
+
parts: lr(s.parts, (t) => ({
|
|
1437
1437
|
index: e(t.index),
|
|
1438
1438
|
values: e(t.values)
|
|
1439
1439
|
}))
|
|
1440
1440
|
};
|
|
1441
1441
|
default:
|
|
1442
|
-
|
|
1442
|
+
K(s);
|
|
1443
1443
|
}
|
|
1444
1444
|
}
|
|
1445
|
-
const
|
|
1445
|
+
const gn = Ne("PColumnData/JsonPartitioned", "1"), mn = Ne(
|
|
1446
1446
|
"PColumnData/Partitioned/JsonPartitioned",
|
|
1447
1447
|
"1"
|
|
1448
|
-
),
|
|
1448
|
+
), vn = Ne("PColumnData/BinaryPartitioned", "1"), yn = Ne(
|
|
1449
1449
|
"PColumnData/Partitioned/BinaryPartitioned",
|
|
1450
1450
|
"1"
|
|
1451
|
-
),
|
|
1452
|
-
function
|
|
1451
|
+
), Sn = Ne("PColumnData/Json", "1");
|
|
1452
|
+
function wn(s) {
|
|
1453
1453
|
if (!s.getIsReadyOrError()) throw new Error("Data not ready.");
|
|
1454
1454
|
const e = s.getDataAsJson();
|
|
1455
1455
|
if (e === void 0)
|
|
1456
1456
|
throw new Error("unexpected data info structure, no resource data");
|
|
1457
|
-
if (ue(s.resourceType,
|
|
1457
|
+
if (ue(s.resourceType, Sn)) {
|
|
1458
1458
|
const t = e;
|
|
1459
1459
|
return {
|
|
1460
1460
|
type: "Json",
|
|
1461
1461
|
keyLength: t.keyLength,
|
|
1462
1462
|
data: t.data
|
|
1463
1463
|
};
|
|
1464
|
-
} else if (ue(s.resourceType,
|
|
1464
|
+
} else if (ue(s.resourceType, gn)) {
|
|
1465
1465
|
const t = e, r = Object.fromEntries(
|
|
1466
1466
|
s.listInputFields().map((o) => [o, s.traverse({ field: o, errorIfFieldNotSet: !0 }).resourceInfo])
|
|
1467
1467
|
);
|
|
@@ -1470,7 +1470,7 @@ function Sn(s) {
|
|
|
1470
1470
|
partitionKeyLength: t.partitionKeyLength,
|
|
1471
1471
|
parts: r
|
|
1472
1472
|
};
|
|
1473
|
-
} else if (ue(s.resourceType,
|
|
1473
|
+
} else if (ue(s.resourceType, mn)) {
|
|
1474
1474
|
const t = e, r = {};
|
|
1475
1475
|
for (const o of s.listInputFields()) {
|
|
1476
1476
|
const n = s.traverse({ field: o, errorIfFieldNotSet: !0 }), i = n.listInputFields();
|
|
@@ -1488,7 +1488,7 @@ function Sn(s) {
|
|
|
1488
1488
|
partitionKeyLength: t.superPartitionKeyLength + t.partitionKeyLength,
|
|
1489
1489
|
parts: r
|
|
1490
1490
|
};
|
|
1491
|
-
} else if (ue(s.resourceType,
|
|
1491
|
+
} else if (ue(s.resourceType, vn)) {
|
|
1492
1492
|
const t = e, r = {};
|
|
1493
1493
|
for (const o of s.listInputFields())
|
|
1494
1494
|
if (o.endsWith(".index")) {
|
|
@@ -1509,29 +1509,29 @@ function Sn(s) {
|
|
|
1509
1509
|
partitionKeyLength: t.partitionKeyLength,
|
|
1510
1510
|
parts: r
|
|
1511
1511
|
};
|
|
1512
|
-
} else if (ue(s.resourceType,
|
|
1512
|
+
} else if (ue(s.resourceType, yn)) {
|
|
1513
1513
|
const t = e, r = {};
|
|
1514
1514
|
for (const o of s.listInputFields()) {
|
|
1515
1515
|
const n = s.traverse({ field: o, errorIfFieldNotSet: !0 }), i = n.listInputFields();
|
|
1516
1516
|
if (i === void 0) throw new Error(`no partition keys for super key ${o}`);
|
|
1517
1517
|
for (const a of i)
|
|
1518
1518
|
if (a.endsWith(".index")) {
|
|
1519
|
-
const c = a.slice(0, a.length - 6),
|
|
1519
|
+
const c = a.slice(0, a.length - 6), u = JSON.stringify([
|
|
1520
1520
|
...JSON.parse(o),
|
|
1521
1521
|
...JSON.parse(c)
|
|
1522
1522
|
]);
|
|
1523
|
-
let
|
|
1524
|
-
|
|
1523
|
+
let l = r[u];
|
|
1524
|
+
l === void 0 && (l = {}, r[u] = l), r[u].index = n.traverse({
|
|
1525
1525
|
field: a,
|
|
1526
1526
|
errorIfFieldNotSet: !0
|
|
1527
1527
|
}).resourceInfo;
|
|
1528
1528
|
} else if (a.endsWith(".values")) {
|
|
1529
|
-
const c = a.slice(0, a.length - 7),
|
|
1529
|
+
const c = a.slice(0, a.length - 7), u = JSON.stringify([
|
|
1530
1530
|
...JSON.parse(o),
|
|
1531
1531
|
...JSON.parse(c)
|
|
1532
1532
|
]);
|
|
1533
|
-
let
|
|
1534
|
-
|
|
1533
|
+
let l = r[u];
|
|
1534
|
+
l === void 0 && (l = {}, r[u] = l), r[u].values = n.traverse({
|
|
1535
1535
|
field: a,
|
|
1536
1536
|
errorIfFieldNotSet: !0
|
|
1537
1537
|
}).resourceInfo;
|
|
@@ -1543,9 +1543,9 @@ function Sn(s) {
|
|
|
1543
1543
|
parts: r
|
|
1544
1544
|
};
|
|
1545
1545
|
}
|
|
1546
|
-
throw new Error(`unsupported resource type: ${
|
|
1546
|
+
throw new Error(`unsupported resource type: ${Ms(s.resourceType)}`);
|
|
1547
1547
|
}
|
|
1548
|
-
function
|
|
1548
|
+
function bn(s, e) {
|
|
1549
1549
|
const t = s.axesSpec.length, r = {};
|
|
1550
1550
|
for (const { key: o, val: n } of e) {
|
|
1551
1551
|
if (o.length !== t)
|
|
@@ -1558,44 +1558,44 @@ function wn(s, e) {
|
|
|
1558
1558
|
data: r
|
|
1559
1559
|
};
|
|
1560
1560
|
}
|
|
1561
|
-
function
|
|
1561
|
+
function Rn(s, e) {
|
|
1562
1562
|
const t = Be("sha256");
|
|
1563
|
-
return t.update(
|
|
1563
|
+
return t.update(Z(s)), t.update(String(Ye(e.originalId) ? e.id : e.originalId)), t.digest().toString("hex");
|
|
1564
1564
|
}
|
|
1565
|
-
function
|
|
1566
|
-
return
|
|
1565
|
+
function ur(s, e) {
|
|
1566
|
+
return Z({ __isRef: !0, blockId: s, name: e });
|
|
1567
1567
|
}
|
|
1568
|
-
function
|
|
1569
|
-
return
|
|
1568
|
+
function En(s, e) {
|
|
1569
|
+
return Z({ resolvePath: s, name: e });
|
|
1570
1570
|
}
|
|
1571
|
-
function
|
|
1572
|
-
var a, c,
|
|
1571
|
+
function is(s, e = !0, t = !1, r = "") {
|
|
1572
|
+
var a, c, u;
|
|
1573
1573
|
const o = /^(?<name>.*)\.(?<type>spec|data)$/, n = /* @__PURE__ */ new Map();
|
|
1574
|
-
for (const
|
|
1575
|
-
const d =
|
|
1574
|
+
for (const l of s.listInputFields()) {
|
|
1575
|
+
const d = l.match(o);
|
|
1576
1576
|
if (!d) {
|
|
1577
|
-
if (e) throw new Error(`unexpected field name ${
|
|
1577
|
+
if (e) throw new Error(`unexpected field name ${l}`);
|
|
1578
1578
|
continue;
|
|
1579
1579
|
}
|
|
1580
|
-
let
|
|
1581
|
-
if (!
|
|
1582
|
-
if (e) throw new Error(`unexpected field name ${
|
|
1580
|
+
let f = B((a = d.groups) == null ? void 0 : a.name);
|
|
1581
|
+
if (!f.startsWith(r)) {
|
|
1582
|
+
if (e) throw new Error(`unexpected field name ${l}`);
|
|
1583
1583
|
continue;
|
|
1584
1584
|
}
|
|
1585
|
-
|
|
1586
|
-
const
|
|
1587
|
-
let
|
|
1588
|
-
switch (
|
|
1585
|
+
f = f.slice(r.length);
|
|
1586
|
+
const h = B((c = d.groups) == null ? void 0 : c.type);
|
|
1587
|
+
let E = n.get(f);
|
|
1588
|
+
switch (E === void 0 && (E = {}, n.set(f, E)), h) {
|
|
1589
1589
|
case "spec":
|
|
1590
|
-
|
|
1591
|
-
field:
|
|
1590
|
+
E.spec = (u = s.traverse({
|
|
1591
|
+
field: l,
|
|
1592
1592
|
ignoreError: t,
|
|
1593
1593
|
pureFieldErrorToUndefined: t
|
|
1594
|
-
})) == null ? void 0 :
|
|
1594
|
+
})) == null ? void 0 : u.getDataAsJson();
|
|
1595
1595
|
break;
|
|
1596
1596
|
case "data":
|
|
1597
|
-
|
|
1598
|
-
field:
|
|
1597
|
+
E.hasData = !0, E.data = () => s.traverseOrError({
|
|
1598
|
+
field: l,
|
|
1599
1599
|
ignoreError: t
|
|
1600
1600
|
});
|
|
1601
1601
|
break;
|
|
@@ -1603,13 +1603,13 @@ function ns(s, e = !0, t = !1, r = "") {
|
|
|
1603
1603
|
}
|
|
1604
1604
|
const i = s.getInputsLocked();
|
|
1605
1605
|
if (i)
|
|
1606
|
-
for (const [,
|
|
1606
|
+
for (const [, l] of n) l.data === void 0 && (l.hasData = !1);
|
|
1607
1607
|
return { locked: i, results: n };
|
|
1608
1608
|
}
|
|
1609
1609
|
function Cn(s, e = !0, t = "", r) {
|
|
1610
1610
|
if (!s.getIsReadyOrError()) throw new Error("resource is not ready");
|
|
1611
|
-
const o =
|
|
1612
|
-
|
|
1611
|
+
const o = is(s, e, !1, t);
|
|
1612
|
+
eo(o.locked);
|
|
1613
1613
|
const n = {};
|
|
1614
1614
|
for (const [i, a] of o.results) {
|
|
1615
1615
|
if (a.spec === void 0) throw new Error(`no spec for key ${i}`);
|
|
@@ -1617,16 +1617,16 @@ function Cn(s, e = !0, t = "", r) {
|
|
|
1617
1617
|
throw new Error(`no data for key ${i}`);
|
|
1618
1618
|
const c = a.data();
|
|
1619
1619
|
if (c === void 0) throw new Error(`no data for key ${i}`);
|
|
1620
|
-
if (!c.ok) throw new
|
|
1620
|
+
if (!c.ok) throw new zs(c.error);
|
|
1621
1621
|
n[i] = {
|
|
1622
|
-
id: r.length === 0 ?
|
|
1622
|
+
id: r.length === 0 ? Rn(a.spec, c.value) : En(r, i),
|
|
1623
1623
|
spec: a.spec,
|
|
1624
1624
|
data: c.value
|
|
1625
1625
|
};
|
|
1626
1626
|
}
|
|
1627
1627
|
return n;
|
|
1628
1628
|
}
|
|
1629
|
-
class
|
|
1629
|
+
class Dt {
|
|
1630
1630
|
constructor(e, t) {
|
|
1631
1631
|
w(this, "allSpecsAvailable");
|
|
1632
1632
|
this.ctx = e, this.blocks = t;
|
|
@@ -1647,11 +1647,11 @@ class Lt {
|
|
|
1647
1647
|
this.allSpecsAvailable = r;
|
|
1648
1648
|
}
|
|
1649
1649
|
getSpecByRef(e, t) {
|
|
1650
|
-
var n, i, a, c,
|
|
1650
|
+
var n, i, a, c, u, l;
|
|
1651
1651
|
const r = this.blocks.get(e);
|
|
1652
1652
|
if (r === void 0) return;
|
|
1653
1653
|
let o = (a = (i = (n = r.prod) == null ? void 0 : n.results) == null ? void 0 : i.get(t)) == null ? void 0 : a.spec;
|
|
1654
|
-
if (o !== void 0 || (o = (
|
|
1654
|
+
if (o !== void 0 || (o = (l = (u = (c = r.staging) == null ? void 0 : c.results) == null ? void 0 : u.get(t)) == null ? void 0 : l.spec, o !== void 0)) return o;
|
|
1655
1655
|
r.staging === void 0 ? this.ctx.markUnstable(`staging_not_rendered:${e}`) : r.staging.locked ? r.prod !== void 0 && !r.prod.locked && this.ctx.markUnstable(`prod_not_locked:${e}`) : this.ctx.markUnstable(`staging_not_locked:${e}`);
|
|
1656
1656
|
}
|
|
1657
1657
|
getDataOrErrorByRef(e, t) {
|
|
@@ -1660,10 +1660,10 @@ class Lt {
|
|
|
1660
1660
|
if (r === void 0) return;
|
|
1661
1661
|
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);
|
|
1662
1662
|
if (o !== void 0 && o.spec !== void 0 && n !== void 0)
|
|
1663
|
-
return
|
|
1664
|
-
id:
|
|
1663
|
+
return jr(n, (u) => ({
|
|
1664
|
+
id: ur(e, t),
|
|
1665
1665
|
spec: o.spec,
|
|
1666
|
-
data:
|
|
1666
|
+
data: u
|
|
1667
1667
|
}));
|
|
1668
1668
|
o !== void 0 && this.ctx.markUnstable(`no_data:${e}:${t}`), r.prod !== void 0 && !r.prod.locked && this.ctx.markUnstable(`prod_not_locked:${e}`);
|
|
1669
1669
|
}
|
|
@@ -1696,13 +1696,13 @@ class Lt {
|
|
|
1696
1696
|
r === void 0 && (r = i), t = !1;
|
|
1697
1697
|
}, n = (i, a, c) => {
|
|
1698
1698
|
if (c.spec !== void 0 && c.hasData === !0 && c.data !== void 0) {
|
|
1699
|
-
const
|
|
1700
|
-
|
|
1699
|
+
const u = c.data();
|
|
1700
|
+
u !== void 0 ? e.push({
|
|
1701
1701
|
ref: Ge(i, a),
|
|
1702
1702
|
obj: {
|
|
1703
|
-
id:
|
|
1703
|
+
id: u.ok ? ur(i, a) : void 0,
|
|
1704
1704
|
spec: c.spec,
|
|
1705
|
-
data:
|
|
1705
|
+
data: u
|
|
1706
1706
|
}
|
|
1707
1707
|
}) : o(`no_data:${i}:${a}`);
|
|
1708
1708
|
}
|
|
@@ -1711,13 +1711,13 @@ class Lt {
|
|
|
1711
1711
|
const c = /* @__PURE__ */ new Set();
|
|
1712
1712
|
if (a.prod !== void 0) {
|
|
1713
1713
|
a.prod.locked || o(`prod_not_locked:${i}`);
|
|
1714
|
-
for (const [
|
|
1715
|
-
c.add(
|
|
1714
|
+
for (const [u, l] of a.prod.results)
|
|
1715
|
+
c.add(u), n(i, u, l);
|
|
1716
1716
|
}
|
|
1717
1717
|
if (a.staging !== void 0) {
|
|
1718
1718
|
a.staging.locked || o(`staging_not_locked:${i}`);
|
|
1719
|
-
for (const [
|
|
1720
|
-
c.has(
|
|
1719
|
+
for (const [u, l] of a.staging.results)
|
|
1720
|
+
c.has(u) || n(i, u, l);
|
|
1721
1721
|
}
|
|
1722
1722
|
}
|
|
1723
1723
|
return { entries: e, isComplete: t, instabilityMarker: r };
|
|
@@ -1732,18 +1732,18 @@ class Lt {
|
|
|
1732
1732
|
const a = /* @__PURE__ */ new Set();
|
|
1733
1733
|
if (i.staging !== void 0) {
|
|
1734
1734
|
i.staging.locked || o(`staging_not_locked:${n}`);
|
|
1735
|
-
for (const [c,
|
|
1736
|
-
|
|
1735
|
+
for (const [c, u] of i.staging.results)
|
|
1736
|
+
u.spec !== void 0 && (e.push({
|
|
1737
1737
|
ref: Ge(n, c),
|
|
1738
|
-
obj:
|
|
1738
|
+
obj: u.spec
|
|
1739
1739
|
}), a.add(c));
|
|
1740
1740
|
} else o(`staging_not_rendered:${n}`);
|
|
1741
1741
|
if (i.prod !== void 0) {
|
|
1742
1742
|
i.prod.locked || o(`prod_not_locked:${n}`);
|
|
1743
|
-
for (const [c,
|
|
1744
|
-
a.has(c) ||
|
|
1743
|
+
for (const [c, u] of i.prod.results)
|
|
1744
|
+
a.has(c) || u.spec !== void 0 && e.push({
|
|
1745
1745
|
ref: Ge(n, c),
|
|
1746
|
-
obj:
|
|
1746
|
+
obj: u.spec
|
|
1747
1747
|
});
|
|
1748
1748
|
}
|
|
1749
1749
|
}
|
|
@@ -1754,7 +1754,7 @@ class Lt {
|
|
|
1754
1754
|
for (const r of this.blocks.values()) {
|
|
1755
1755
|
const o = /* @__PURE__ */ new Set(), n = (i) => {
|
|
1756
1756
|
for (const [a, c] of i.results)
|
|
1757
|
-
o.has(a) || c.spec === void 0 || (o.add(a),
|
|
1757
|
+
o.has(a) || c.spec === void 0 || (o.add(a), Os(e, c.spec) && t.push({
|
|
1758
1758
|
label: r.info.label + " / " + a,
|
|
1759
1759
|
ref: Ge(r.info.id, a),
|
|
1760
1760
|
spec: c.spec
|
|
@@ -1766,70 +1766,70 @@ class Lt {
|
|
|
1766
1766
|
}
|
|
1767
1767
|
static create(e, t, r) {
|
|
1768
1768
|
const o = e.accessor(t).node(), n = B(o.getKeyValueAsJson(fe)), a = Pt(n).traverseIds("upstream", r), c = /* @__PURE__ */ new Map();
|
|
1769
|
-
for (const
|
|
1770
|
-
if (!a.has(
|
|
1771
|
-
const
|
|
1769
|
+
for (const u of oe(n)) {
|
|
1770
|
+
if (!a.has(u.id)) continue;
|
|
1771
|
+
const l = dr(
|
|
1772
1772
|
o.traverse({
|
|
1773
|
-
field:
|
|
1773
|
+
field: U(u.id, "prodCtx"),
|
|
1774
1774
|
ignoreError: !0,
|
|
1775
1775
|
pureFieldErrorToUndefined: !0,
|
|
1776
1776
|
stableIfNotFound: !0
|
|
1777
1777
|
}) !== void 0,
|
|
1778
1778
|
o.traverseOrError({
|
|
1779
|
-
field:
|
|
1779
|
+
field: U(u.id, "prodUiCtx"),
|
|
1780
1780
|
stableIfNotFound: !0
|
|
1781
1781
|
})
|
|
1782
|
-
), d =
|
|
1782
|
+
), d = dr(
|
|
1783
1783
|
o.traverse({
|
|
1784
|
-
field:
|
|
1784
|
+
field: U(u.id, "stagingCtx"),
|
|
1785
1785
|
ignoreError: !0,
|
|
1786
1786
|
pureFieldErrorToUndefined: !0
|
|
1787
1787
|
}) !== void 0,
|
|
1788
1788
|
o.traverseOrError({
|
|
1789
|
-
field:
|
|
1789
|
+
field: U(u.id, "stagingUiCtx")
|
|
1790
1790
|
})
|
|
1791
1791
|
);
|
|
1792
|
-
c.set(
|
|
1792
|
+
c.set(u.id, { info: u, prod: l, staging: d });
|
|
1793
1793
|
}
|
|
1794
|
-
return new
|
|
1794
|
+
return new Dt(e, c);
|
|
1795
1795
|
}
|
|
1796
1796
|
}
|
|
1797
|
-
function
|
|
1797
|
+
function dr(s, e) {
|
|
1798
1798
|
if (e === void 0)
|
|
1799
1799
|
return s ? { locked: !1, results: /* @__PURE__ */ new Map() } : void 0;
|
|
1800
|
-
if (e.ok) return
|
|
1800
|
+
if (e.ok) return is(e.value, !1, !0);
|
|
1801
1801
|
}
|
|
1802
|
-
function
|
|
1802
|
+
function Nt(s, e) {
|
|
1803
1803
|
return {
|
|
1804
1804
|
blockId: e,
|
|
1805
1805
|
args: (n) => B(
|
|
1806
1806
|
n.accessor(s).node().traverse({
|
|
1807
|
-
field:
|
|
1807
|
+
field: U(e, "currentArgs"),
|
|
1808
1808
|
errorIfFieldNotSet: !0
|
|
1809
1809
|
}).getDataAsString()
|
|
1810
1810
|
),
|
|
1811
1811
|
activeArgs: (n) => {
|
|
1812
1812
|
var i;
|
|
1813
1813
|
return (i = n.accessor(s).node().traverse({
|
|
1814
|
-
field:
|
|
1814
|
+
field: U(e, "prodArgs"),
|
|
1815
1815
|
stableIfNotFound: !0
|
|
1816
1816
|
})) == null ? void 0 : i.getDataAsString();
|
|
1817
1817
|
},
|
|
1818
|
-
uiState: (n) => n.accessor(s).node().getKeyValueAsString(
|
|
1818
|
+
uiState: (n) => n.accessor(s).node().getKeyValueAsString(wt(e)),
|
|
1819
1819
|
blockMeta: (n) => {
|
|
1820
1820
|
const i = n.accessor(s).node(), a = B(i.getKeyValueAsJson(fe)), c = /* @__PURE__ */ new Map();
|
|
1821
|
-
for (const
|
|
1821
|
+
for (const u of oe(a)) c.set(u.id, u);
|
|
1822
1822
|
return c;
|
|
1823
1823
|
}
|
|
1824
1824
|
};
|
|
1825
1825
|
}
|
|
1826
|
-
function
|
|
1826
|
+
function as(s, e) {
|
|
1827
1827
|
return {
|
|
1828
|
-
...
|
|
1828
|
+
...Nt(s, e),
|
|
1829
1829
|
prod: (t) => {
|
|
1830
1830
|
var r;
|
|
1831
1831
|
return (r = t.accessor(s).node({ ignoreError: !0 }).traverse({
|
|
1832
|
-
field:
|
|
1832
|
+
field: U(e, "prodOutput"),
|
|
1833
1833
|
stableIfNotFound: !0,
|
|
1834
1834
|
ignoreError: !0
|
|
1835
1835
|
})) == null ? void 0 : r.persist();
|
|
@@ -1837,36 +1837,36 @@ function is(s, e) {
|
|
|
1837
1837
|
staging: (t) => {
|
|
1838
1838
|
var o;
|
|
1839
1839
|
const r = (o = t.accessor(s).node({ ignoreError: !0 }).traverse({
|
|
1840
|
-
field:
|
|
1840
|
+
field: U(e, "stagingOutput"),
|
|
1841
1841
|
ignoreError: !0
|
|
1842
1842
|
})) == null ? void 0 : o.persist();
|
|
1843
1843
|
return r === void 0 && t.markUnstable("staging_not_rendered"), r;
|
|
1844
1844
|
},
|
|
1845
|
-
getResultsPool: (t) =>
|
|
1845
|
+
getResultsPool: (t) => Dt.create(t, s, e)
|
|
1846
1846
|
};
|
|
1847
1847
|
}
|
|
1848
|
-
function*
|
|
1848
|
+
function* z(s, e) {
|
|
1849
1849
|
switch (yield s, s.type) {
|
|
1850
1850
|
case "GetFromCtx":
|
|
1851
1851
|
case "Immediate":
|
|
1852
1852
|
return;
|
|
1853
1853
|
case "Isolate":
|
|
1854
|
-
yield*
|
|
1854
|
+
yield* z(s.cfg);
|
|
1855
1855
|
return;
|
|
1856
1856
|
case "MakeObject":
|
|
1857
|
-
for (const [, t] of Object.entries(s.template)) yield*
|
|
1857
|
+
for (const [, t] of Object.entries(s.template)) yield* z(t);
|
|
1858
1858
|
return;
|
|
1859
1859
|
case "MakeArray":
|
|
1860
|
-
for (const t of s.template) yield*
|
|
1860
|
+
for (const t of s.template) yield* z(t);
|
|
1861
1861
|
return;
|
|
1862
1862
|
case "GetJsonField":
|
|
1863
1863
|
case "GetResourceField":
|
|
1864
|
-
yield*
|
|
1864
|
+
yield* z(s.source), yield* z(s.field);
|
|
1865
1865
|
return;
|
|
1866
1866
|
case "MapRecordValues":
|
|
1867
1867
|
case "MapArrayValues":
|
|
1868
1868
|
case "MapResourceFields":
|
|
1869
|
-
yield*
|
|
1869
|
+
yield* z(s.source), yield* z(s.mapping);
|
|
1870
1870
|
return;
|
|
1871
1871
|
case "Flatten":
|
|
1872
1872
|
case "GetResourceValueAsJson":
|
|
@@ -1881,20 +1881,20 @@ function* W(s, e) {
|
|
|
1881
1881
|
case "GetProgressLog":
|
|
1882
1882
|
case "GetProgressLogWithInfo":
|
|
1883
1883
|
case "GetLogHandle":
|
|
1884
|
-
yield*
|
|
1884
|
+
yield* z(s.source);
|
|
1885
1885
|
return;
|
|
1886
1886
|
case "IsEmpty":
|
|
1887
|
-
yield*
|
|
1887
|
+
yield* z(s.arg);
|
|
1888
1888
|
return;
|
|
1889
1889
|
case "Not":
|
|
1890
|
-
yield*
|
|
1890
|
+
yield* z(s.operand);
|
|
1891
1891
|
return;
|
|
1892
1892
|
case "And":
|
|
1893
1893
|
case "Or":
|
|
1894
|
-
yield*
|
|
1894
|
+
yield* z(s.operand1), yield* z(s.operand2);
|
|
1895
1895
|
return;
|
|
1896
1896
|
default:
|
|
1897
|
-
|
|
1897
|
+
K(s);
|
|
1898
1898
|
}
|
|
1899
1899
|
}
|
|
1900
1900
|
function Pn(s, e) {
|
|
@@ -1905,7 +1905,7 @@ function Pn(s, e) {
|
|
|
1905
1905
|
function Fe(s, e) {
|
|
1906
1906
|
return s === void 0 ? void 0 : e(s);
|
|
1907
1907
|
}
|
|
1908
|
-
function
|
|
1908
|
+
function kn(s) {
|
|
1909
1909
|
switch (s.type) {
|
|
1910
1910
|
case "GetImportProgress":
|
|
1911
1911
|
return !0;
|
|
@@ -1913,60 +1913,60 @@ function En(s) {
|
|
|
1913
1913
|
return !1;
|
|
1914
1914
|
}
|
|
1915
1915
|
}
|
|
1916
|
-
function
|
|
1917
|
-
for (const e of
|
|
1916
|
+
function On(s) {
|
|
1917
|
+
for (const e of z(s)) if (kn(e)) return !0;
|
|
1918
1918
|
return !1;
|
|
1919
1919
|
}
|
|
1920
|
-
function
|
|
1920
|
+
function tt(s) {
|
|
1921
1921
|
return {
|
|
1922
1922
|
type: "ReturnResult",
|
|
1923
1923
|
result: s
|
|
1924
1924
|
};
|
|
1925
1925
|
}
|
|
1926
1926
|
function P(s) {
|
|
1927
|
-
return () =>
|
|
1927
|
+
return () => tt(s);
|
|
1928
1928
|
}
|
|
1929
|
-
const
|
|
1929
|
+
const $n = (s) => {
|
|
1930
1930
|
const e = {};
|
|
1931
1931
|
for (const [t, r] of Object.entries(s)) e[t] = r;
|
|
1932
1932
|
return P(e);
|
|
1933
|
-
},
|
|
1933
|
+
}, Fn = (s) => {
|
|
1934
1934
|
const e = s.source;
|
|
1935
1935
|
if (e === void 0) return P(void 0);
|
|
1936
1936
|
const t = [];
|
|
1937
1937
|
for (const r of e)
|
|
1938
1938
|
r instanceof Array ? t.push(...r) : t.push(r);
|
|
1939
1939
|
return P(t);
|
|
1940
|
-
},
|
|
1940
|
+
}, In = (s) => {
|
|
1941
1941
|
const e = s.source, t = s.field;
|
|
1942
1942
|
return e === void 0 || t === void 0 ? P(void 0) : ({ cCtx: r }) => {
|
|
1943
1943
|
var o;
|
|
1944
|
-
return
|
|
1944
|
+
return tt((o = r.accessor(e).node().traverse(t)) == null ? void 0 : o.persist());
|
|
1945
1945
|
};
|
|
1946
1946
|
};
|
|
1947
|
-
function
|
|
1947
|
+
function cs(s, e) {
|
|
1948
1948
|
const t = {}, r = s.length;
|
|
1949
1949
|
for (let o = 0; o < r; o++) t[String(o)] = e(s[o]);
|
|
1950
1950
|
return t;
|
|
1951
1951
|
}
|
|
1952
|
-
function
|
|
1952
|
+
function An(s, e) {
|
|
1953
1953
|
return (t) => {
|
|
1954
1954
|
const r = t.source;
|
|
1955
1955
|
return r === void 0 ? P(void 0) : () => ({
|
|
1956
1956
|
type: "ScheduleSubroutine",
|
|
1957
|
-
subroutine:
|
|
1958
|
-
args:
|
|
1957
|
+
subroutine: ls(r.length),
|
|
1958
|
+
args: cs(r, (o) => k({ ...s, [e.itVar]: o }, e.mapping))
|
|
1959
1959
|
});
|
|
1960
1960
|
};
|
|
1961
1961
|
}
|
|
1962
|
-
function
|
|
1962
|
+
function ls(s) {
|
|
1963
1963
|
return (e) => {
|
|
1964
1964
|
const t = [];
|
|
1965
1965
|
for (let r = 0; r < s; r++) t.push(e[String(r)]);
|
|
1966
1966
|
return P(t);
|
|
1967
1967
|
};
|
|
1968
1968
|
}
|
|
1969
|
-
function
|
|
1969
|
+
function Tn(s, e) {
|
|
1970
1970
|
return (t) => {
|
|
1971
1971
|
const r = t.source;
|
|
1972
1972
|
if (r === void 0) return P(void 0);
|
|
@@ -1977,34 +1977,34 @@ function An(s, e) {
|
|
|
1977
1977
|
}
|
|
1978
1978
|
return () => ({
|
|
1979
1979
|
type: "ScheduleSubroutine",
|
|
1980
|
-
subroutine:
|
|
1980
|
+
subroutine: Ln,
|
|
1981
1981
|
args: o
|
|
1982
1982
|
});
|
|
1983
1983
|
};
|
|
1984
1984
|
}
|
|
1985
|
-
const
|
|
1985
|
+
const Ln = (s) => P(s), Dn = (s) => {
|
|
1986
1986
|
const e = s.arg;
|
|
1987
1987
|
return P(e === void 0 ? void 0 : e.length === 0);
|
|
1988
|
-
},
|
|
1988
|
+
}, Nn = (s) => {
|
|
1989
1989
|
const e = s.operand;
|
|
1990
1990
|
return P(e === void 0 ? void 0 : !e);
|
|
1991
|
-
},
|
|
1991
|
+
}, Bn = (s) => {
|
|
1992
1992
|
const e = s.operand1, t = s.operand2;
|
|
1993
1993
|
return P(e === void 0 || t === void 0 ? void 0 : e && t);
|
|
1994
|
-
},
|
|
1994
|
+
}, xn = (s) => {
|
|
1995
1995
|
const e = s.operand1, t = s.operand2;
|
|
1996
1996
|
return P(e === void 0 || t === void 0 ? void 0 : e || t);
|
|
1997
|
-
},
|
|
1997
|
+
}, jn = (s) => {
|
|
1998
1998
|
const e = s.source;
|
|
1999
1999
|
return e === void 0 ? P(void 0) : ({ cCtx: t }) => {
|
|
2000
2000
|
var r;
|
|
2001
|
-
return
|
|
2001
|
+
return tt((r = t.accessor(e).node()) == null ? void 0 : r.getDataAsJson());
|
|
2002
2002
|
};
|
|
2003
|
-
},
|
|
2003
|
+
}, Vn = (s) => {
|
|
2004
2004
|
const e = s.source, t = s.field;
|
|
2005
2005
|
return P(e === void 0 || t === void 0 ? void 0 : e[t]);
|
|
2006
2006
|
};
|
|
2007
|
-
function
|
|
2007
|
+
function Un(s, e) {
|
|
2008
2008
|
return (t) => {
|
|
2009
2009
|
const r = t.source;
|
|
2010
2010
|
return r === void 0 ? P(void 0) : ({ cCtx: o }) => {
|
|
@@ -2013,23 +2013,23 @@ function Vn(s, e) {
|
|
|
2013
2013
|
const c = n.traverse(a);
|
|
2014
2014
|
if (c === void 0) i[a] = P(void 0);
|
|
2015
2015
|
else {
|
|
2016
|
-
const
|
|
2017
|
-
i[a] = k(
|
|
2016
|
+
const u = { ...s, [e.itVar]: c.persist() };
|
|
2017
|
+
i[a] = k(u, e.mapping);
|
|
2018
2018
|
}
|
|
2019
2019
|
}
|
|
2020
2020
|
return {
|
|
2021
2021
|
type: "ScheduleSubroutine",
|
|
2022
|
-
subroutine:
|
|
2022
|
+
subroutine: Jn,
|
|
2023
2023
|
args: i
|
|
2024
2024
|
};
|
|
2025
2025
|
};
|
|
2026
2026
|
};
|
|
2027
2027
|
}
|
|
2028
|
-
const
|
|
2028
|
+
const Jn = (s) => P(s), Gn = (s) => {
|
|
2029
2029
|
const e = s.source;
|
|
2030
2030
|
return e === void 0 ? P(void 0) : ({ drivers: t }) => ({
|
|
2031
2031
|
type: "ScheduleComputable",
|
|
2032
|
-
computable:
|
|
2032
|
+
computable: J.make(
|
|
2033
2033
|
(r) => t.blobDriver.getDownloadedBlob(r.accessor(e).node().resourceInfo),
|
|
2034
2034
|
{
|
|
2035
2035
|
postprocessValue: async (r) => {
|
|
@@ -2039,22 +2039,22 @@ const Un = (s) => P(s), Jn = (s) => {
|
|
|
2039
2039
|
}
|
|
2040
2040
|
)
|
|
2041
2041
|
});
|
|
2042
|
-
},
|
|
2042
|
+
}, Mn = (s) => {
|
|
2043
2043
|
const e = s.source;
|
|
2044
2044
|
return e === void 0 ? P(void 0) : ({ cCtx: t, drivers: r }) => {
|
|
2045
2045
|
const o = t.accessor(e).node().resourceInfo;
|
|
2046
2046
|
return {
|
|
2047
2047
|
type: "ScheduleComputable",
|
|
2048
|
-
computable:
|
|
2048
|
+
computable: J.make(() => r.blobDriver.getDownloadedBlob(o), {
|
|
2049
2049
|
postprocessValue: async (n) => n === void 0 ? void 0 : (await r.blobDriver.getContent(n.handle)).toString()
|
|
2050
2050
|
})
|
|
2051
2051
|
};
|
|
2052
2052
|
};
|
|
2053
|
-
},
|
|
2053
|
+
}, _n = (s) => {
|
|
2054
2054
|
const e = s.source;
|
|
2055
2055
|
return e === void 0 ? P(void 0) : ({ drivers: t }) => ({
|
|
2056
2056
|
type: "ScheduleComputable",
|
|
2057
|
-
computable:
|
|
2057
|
+
computable: J.make(
|
|
2058
2058
|
(r) => t.blobDriver.getDownloadedBlob(r.accessor(e).node().resourceInfo),
|
|
2059
2059
|
{
|
|
2060
2060
|
postprocessValue: async (r) => {
|
|
@@ -2066,49 +2066,49 @@ const Un = (s) => P(s), Jn = (s) => {
|
|
|
2066
2066
|
}
|
|
2067
2067
|
)
|
|
2068
2068
|
});
|
|
2069
|
-
},
|
|
2069
|
+
}, Kn = (s) => {
|
|
2070
2070
|
const e = s.source;
|
|
2071
2071
|
return e === void 0 ? P(void 0) : ({ drivers: t }) => ({
|
|
2072
2072
|
type: "ScheduleComputable",
|
|
2073
2073
|
computable: t.blobDriver.getDownloadedBlob(e)
|
|
2074
2074
|
});
|
|
2075
|
-
},
|
|
2075
|
+
}, Hn = (s) => {
|
|
2076
2076
|
const e = s.source;
|
|
2077
2077
|
return e === void 0 ? P(void 0) : ({ drivers: t }) => ({
|
|
2078
2078
|
type: "ScheduleComputable",
|
|
2079
2079
|
computable: t.blobDriver.getOnDemandBlob(e)
|
|
2080
2080
|
});
|
|
2081
|
-
},
|
|
2081
|
+
}, Wn = (s) => (e) => {
|
|
2082
2082
|
const t = e.source;
|
|
2083
2083
|
return t === void 0 ? P(void 0) : ({ drivers: r }) => ({
|
|
2084
2084
|
type: "ScheduleComputable",
|
|
2085
2085
|
computable: r.blobToURLDriver.extractArchiveAndGetURL(t, s)
|
|
2086
2086
|
});
|
|
2087
|
-
},
|
|
2087
|
+
}, zn = (s) => {
|
|
2088
2088
|
const e = s.source;
|
|
2089
2089
|
return e === void 0 ? P(void 0) : ({ drivers: t }) => ({
|
|
2090
2090
|
type: "ScheduleComputable",
|
|
2091
2091
|
computable: t.uploadDriver.getProgressId(e)
|
|
2092
2092
|
});
|
|
2093
|
-
},
|
|
2093
|
+
}, qn = (s) => (e) => {
|
|
2094
2094
|
const t = e.source;
|
|
2095
2095
|
return t === void 0 ? P(void 0) : ({ drivers: r }) => ({
|
|
2096
2096
|
type: "ScheduleComputable",
|
|
2097
2097
|
computable: r.logDriver.getLastLogs(t, s)
|
|
2098
2098
|
});
|
|
2099
|
-
},
|
|
2099
|
+
}, Xn = (s) => (e) => {
|
|
2100
2100
|
const t = e.source;
|
|
2101
2101
|
return t === void 0 ? P(void 0) : ({ drivers: r }) => ({
|
|
2102
2102
|
type: "ScheduleComputable",
|
|
2103
2103
|
computable: r.logDriver.getProgressLog(t, s)
|
|
2104
2104
|
});
|
|
2105
|
-
},
|
|
2105
|
+
}, Yn = (s) => (e) => {
|
|
2106
2106
|
const t = e.source;
|
|
2107
2107
|
return t === void 0 ? P(void 0) : ({ drivers: r }) => ({
|
|
2108
2108
|
type: "ScheduleComputable",
|
|
2109
2109
|
computable: r.logDriver.getProgressLogWithInfo(t, s)
|
|
2110
2110
|
});
|
|
2111
|
-
},
|
|
2111
|
+
}, Qn = (s) => {
|
|
2112
2112
|
const e = s.source;
|
|
2113
2113
|
return e === void 0 ? P(void 0) : ({ drivers: t }) => ({
|
|
2114
2114
|
type: "ScheduleComputable",
|
|
@@ -2119,19 +2119,19 @@ function k(s, e) {
|
|
|
2119
2119
|
switch (e.type) {
|
|
2120
2120
|
case "GetFromCtx": {
|
|
2121
2121
|
const t = s[e.variable];
|
|
2122
|
-
return typeof t == "function" ? (r) =>
|
|
2122
|
+
return typeof t == "function" ? (r) => tt(t(r.cCtx)) : P(t);
|
|
2123
2123
|
}
|
|
2124
2124
|
case "Isolate":
|
|
2125
2125
|
return ({ drivers: t }) => ({
|
|
2126
2126
|
type: "ScheduleComputable",
|
|
2127
|
-
computable:
|
|
2127
|
+
computable: ps(t, s, e.cfg)
|
|
2128
2128
|
});
|
|
2129
2129
|
case "Immediate":
|
|
2130
2130
|
return P(e.value);
|
|
2131
2131
|
case "GetJsonField":
|
|
2132
2132
|
return () => ({
|
|
2133
2133
|
type: "ScheduleSubroutine",
|
|
2134
|
-
subroutine:
|
|
2134
|
+
subroutine: Vn,
|
|
2135
2135
|
args: {
|
|
2136
2136
|
source: k(s, e.source),
|
|
2137
2137
|
field: k(s, e.field)
|
|
@@ -2140,7 +2140,7 @@ function k(s, e) {
|
|
|
2140
2140
|
case "MapArrayValues":
|
|
2141
2141
|
return () => ({
|
|
2142
2142
|
type: "ScheduleSubroutine",
|
|
2143
|
-
subroutine:
|
|
2143
|
+
subroutine: An(s, e),
|
|
2144
2144
|
args: {
|
|
2145
2145
|
source: k(s, e.source)
|
|
2146
2146
|
}
|
|
@@ -2148,7 +2148,7 @@ function k(s, e) {
|
|
|
2148
2148
|
case "MapRecordValues":
|
|
2149
2149
|
return () => ({
|
|
2150
2150
|
type: "ScheduleSubroutine",
|
|
2151
|
-
subroutine:
|
|
2151
|
+
subroutine: Tn(s, e),
|
|
2152
2152
|
args: {
|
|
2153
2153
|
source: k(s, e.source)
|
|
2154
2154
|
}
|
|
@@ -2156,19 +2156,19 @@ function k(s, e) {
|
|
|
2156
2156
|
case "MakeObject":
|
|
2157
2157
|
return () => ({
|
|
2158
2158
|
type: "ScheduleSubroutine",
|
|
2159
|
-
subroutine:
|
|
2159
|
+
subroutine: $n,
|
|
2160
2160
|
args: Pn(e.template, (t) => k(s, t))
|
|
2161
2161
|
});
|
|
2162
2162
|
case "MakeArray":
|
|
2163
2163
|
return () => ({
|
|
2164
2164
|
type: "ScheduleSubroutine",
|
|
2165
|
-
subroutine:
|
|
2166
|
-
args:
|
|
2165
|
+
subroutine: ls(e.template.length),
|
|
2166
|
+
args: cs(e.template, (t) => k(s, t))
|
|
2167
2167
|
});
|
|
2168
2168
|
case "Flatten":
|
|
2169
2169
|
return () => ({
|
|
2170
2170
|
type: "ScheduleSubroutine",
|
|
2171
|
-
subroutine:
|
|
2171
|
+
subroutine: Fn,
|
|
2172
2172
|
args: {
|
|
2173
2173
|
source: k(s, e.source)
|
|
2174
2174
|
}
|
|
@@ -2176,7 +2176,7 @@ function k(s, e) {
|
|
|
2176
2176
|
case "IsEmpty":
|
|
2177
2177
|
return () => ({
|
|
2178
2178
|
type: "ScheduleSubroutine",
|
|
2179
|
-
subroutine:
|
|
2179
|
+
subroutine: Dn,
|
|
2180
2180
|
args: {
|
|
2181
2181
|
arg: k(s, e.arg)
|
|
2182
2182
|
}
|
|
@@ -2184,7 +2184,7 @@ function k(s, e) {
|
|
|
2184
2184
|
case "Not":
|
|
2185
2185
|
return () => ({
|
|
2186
2186
|
type: "ScheduleSubroutine",
|
|
2187
|
-
subroutine:
|
|
2187
|
+
subroutine: Nn,
|
|
2188
2188
|
args: {
|
|
2189
2189
|
operand: k(s, e.operand)
|
|
2190
2190
|
}
|
|
@@ -2192,7 +2192,7 @@ function k(s, e) {
|
|
|
2192
2192
|
case "And":
|
|
2193
2193
|
return () => ({
|
|
2194
2194
|
type: "ScheduleSubroutine",
|
|
2195
|
-
subroutine:
|
|
2195
|
+
subroutine: Bn,
|
|
2196
2196
|
args: {
|
|
2197
2197
|
operand1: k(s, e.operand1),
|
|
2198
2198
|
operand2: k(s, e.operand2)
|
|
@@ -2201,7 +2201,7 @@ function k(s, e) {
|
|
|
2201
2201
|
case "Or":
|
|
2202
2202
|
return () => ({
|
|
2203
2203
|
type: "ScheduleSubroutine",
|
|
2204
|
-
subroutine:
|
|
2204
|
+
subroutine: xn,
|
|
2205
2205
|
args: {
|
|
2206
2206
|
operand1: k(s, e.operand1),
|
|
2207
2207
|
operand2: k(s, e.operand2)
|
|
@@ -2210,7 +2210,7 @@ function k(s, e) {
|
|
|
2210
2210
|
case "MapResourceFields":
|
|
2211
2211
|
return () => ({
|
|
2212
2212
|
type: "ScheduleSubroutine",
|
|
2213
|
-
subroutine:
|
|
2213
|
+
subroutine: Un(s, e),
|
|
2214
2214
|
args: {
|
|
2215
2215
|
source: k(s, e.source)
|
|
2216
2216
|
}
|
|
@@ -2218,7 +2218,7 @@ function k(s, e) {
|
|
|
2218
2218
|
case "GetResourceField":
|
|
2219
2219
|
return () => ({
|
|
2220
2220
|
type: "ScheduleSubroutine",
|
|
2221
|
-
subroutine:
|
|
2221
|
+
subroutine: In,
|
|
2222
2222
|
args: {
|
|
2223
2223
|
source: k(s, e.source),
|
|
2224
2224
|
field: k(s, e.field)
|
|
@@ -2227,7 +2227,7 @@ function k(s, e) {
|
|
|
2227
2227
|
case "GetResourceValueAsJson":
|
|
2228
2228
|
return () => ({
|
|
2229
2229
|
type: "ScheduleSubroutine",
|
|
2230
|
-
subroutine:
|
|
2230
|
+
subroutine: jn,
|
|
2231
2231
|
args: {
|
|
2232
2232
|
source: k(s, e.source)
|
|
2233
2233
|
}
|
|
@@ -2235,7 +2235,7 @@ function k(s, e) {
|
|
|
2235
2235
|
case "GetBlobContent":
|
|
2236
2236
|
return () => ({
|
|
2237
2237
|
type: "ScheduleSubroutine",
|
|
2238
|
-
subroutine:
|
|
2238
|
+
subroutine: Gn,
|
|
2239
2239
|
args: {
|
|
2240
2240
|
source: k(s, e.source)
|
|
2241
2241
|
}
|
|
@@ -2243,7 +2243,7 @@ function k(s, e) {
|
|
|
2243
2243
|
case "GetBlobContentAsString":
|
|
2244
2244
|
return () => ({
|
|
2245
2245
|
type: "ScheduleSubroutine",
|
|
2246
|
-
subroutine:
|
|
2246
|
+
subroutine: Mn,
|
|
2247
2247
|
args: {
|
|
2248
2248
|
source: k(s, e.source)
|
|
2249
2249
|
}
|
|
@@ -2251,7 +2251,7 @@ function k(s, e) {
|
|
|
2251
2251
|
case "GetBlobContentAsJson":
|
|
2252
2252
|
return () => ({
|
|
2253
2253
|
type: "ScheduleSubroutine",
|
|
2254
|
-
subroutine:
|
|
2254
|
+
subroutine: _n,
|
|
2255
2255
|
args: {
|
|
2256
2256
|
source: k(s, e.source)
|
|
2257
2257
|
}
|
|
@@ -2259,7 +2259,7 @@ function k(s, e) {
|
|
|
2259
2259
|
case "GetDownloadedBlobContent":
|
|
2260
2260
|
return () => ({
|
|
2261
2261
|
type: "ScheduleSubroutine",
|
|
2262
|
-
subroutine:
|
|
2262
|
+
subroutine: Kn,
|
|
2263
2263
|
args: {
|
|
2264
2264
|
source: k(s, e.source)
|
|
2265
2265
|
}
|
|
@@ -2267,7 +2267,7 @@ function k(s, e) {
|
|
|
2267
2267
|
case "GetOnDemandBlobContent":
|
|
2268
2268
|
return () => ({
|
|
2269
2269
|
type: "ScheduleSubroutine",
|
|
2270
|
-
subroutine:
|
|
2270
|
+
subroutine: Hn,
|
|
2271
2271
|
args: {
|
|
2272
2272
|
source: k(s, e.source)
|
|
2273
2273
|
}
|
|
@@ -2275,7 +2275,7 @@ function k(s, e) {
|
|
|
2275
2275
|
case "ExtractArchiveAndGetURL":
|
|
2276
2276
|
return () => ({
|
|
2277
2277
|
type: "ScheduleSubroutine",
|
|
2278
|
-
subroutine:
|
|
2278
|
+
subroutine: Wn(e.format),
|
|
2279
2279
|
args: {
|
|
2280
2280
|
source: k(s, e.source)
|
|
2281
2281
|
}
|
|
@@ -2283,7 +2283,7 @@ function k(s, e) {
|
|
|
2283
2283
|
case "GetImportProgress":
|
|
2284
2284
|
return () => ({
|
|
2285
2285
|
type: "ScheduleSubroutine",
|
|
2286
|
-
subroutine:
|
|
2286
|
+
subroutine: zn,
|
|
2287
2287
|
args: {
|
|
2288
2288
|
source: k(s, e.source)
|
|
2289
2289
|
}
|
|
@@ -2291,7 +2291,7 @@ function k(s, e) {
|
|
|
2291
2291
|
case "GetLastLogs":
|
|
2292
2292
|
return () => ({
|
|
2293
2293
|
type: "ScheduleSubroutine",
|
|
2294
|
-
subroutine:
|
|
2294
|
+
subroutine: qn(e.lines),
|
|
2295
2295
|
args: {
|
|
2296
2296
|
source: k(s, e.source)
|
|
2297
2297
|
}
|
|
@@ -2299,7 +2299,7 @@ function k(s, e) {
|
|
|
2299
2299
|
case "GetProgressLog":
|
|
2300
2300
|
return () => ({
|
|
2301
2301
|
type: "ScheduleSubroutine",
|
|
2302
|
-
subroutine:
|
|
2302
|
+
subroutine: Xn(e.patternToSearch),
|
|
2303
2303
|
args: {
|
|
2304
2304
|
source: k(s, e.source)
|
|
2305
2305
|
}
|
|
@@ -2307,7 +2307,7 @@ function k(s, e) {
|
|
|
2307
2307
|
case "GetProgressLogWithInfo":
|
|
2308
2308
|
return () => ({
|
|
2309
2309
|
type: "ScheduleSubroutine",
|
|
2310
|
-
subroutine:
|
|
2310
|
+
subroutine: Yn(e.patternToSearch),
|
|
2311
2311
|
args: {
|
|
2312
2312
|
source: k(s, e.source)
|
|
2313
2313
|
}
|
|
@@ -2315,17 +2315,17 @@ function k(s, e) {
|
|
|
2315
2315
|
case "GetLogHandle":
|
|
2316
2316
|
return () => ({
|
|
2317
2317
|
type: "ScheduleSubroutine",
|
|
2318
|
-
subroutine:
|
|
2318
|
+
subroutine: Qn,
|
|
2319
2319
|
args: {
|
|
2320
2320
|
source: k(s, e.source)
|
|
2321
2321
|
}
|
|
2322
2322
|
});
|
|
2323
2323
|
default:
|
|
2324
|
-
return
|
|
2324
|
+
return K(e);
|
|
2325
2325
|
}
|
|
2326
2326
|
}
|
|
2327
|
-
const
|
|
2328
|
-
function
|
|
2327
|
+
const Zn = ["$prod", "$staging"];
|
|
2328
|
+
function ei(s) {
|
|
2329
2329
|
return {
|
|
2330
2330
|
$blockId: s.blockId,
|
|
2331
2331
|
$args: (e) => JSON.parse(s.args(e)),
|
|
@@ -2337,22 +2337,22 @@ function Zn(s) {
|
|
|
2337
2337
|
$staging: s.staging
|
|
2338
2338
|
};
|
|
2339
2339
|
}
|
|
2340
|
-
const
|
|
2341
|
-
function
|
|
2342
|
-
return s.op ==
|
|
2340
|
+
const us = Symbol(), ds = "return", ti = { op: us, arg: ds };
|
|
2341
|
+
function ri(s) {
|
|
2342
|
+
return s.op == us && s.arg == ds;
|
|
2343
2343
|
}
|
|
2344
|
-
function
|
|
2344
|
+
function si() {
|
|
2345
2345
|
return { pendingSubroutines: /* @__PURE__ */ new Map() };
|
|
2346
2346
|
}
|
|
2347
|
-
function
|
|
2348
|
-
const o = new
|
|
2349
|
-
if (
|
|
2347
|
+
function pr(s, e, t, r) {
|
|
2348
|
+
const o = new Kr(t), n = (a, c) => {
|
|
2349
|
+
if (ri(a))
|
|
2350
2350
|
return e.result = c, !1;
|
|
2351
|
-
const
|
|
2352
|
-
if (a.arg in
|
|
2353
|
-
return
|
|
2354
|
-
destination:
|
|
2355
|
-
operation:
|
|
2351
|
+
const u = B(e.pendingSubroutines.get(a.op));
|
|
2352
|
+
if (a.arg in u.args) throw new Error("argument already set");
|
|
2353
|
+
return u.args[a.arg] = c, u.argCounter--, u.argCounter === 0 && (e.pendingSubroutines.delete(a.op), o.push({
|
|
2354
|
+
destination: u.destination,
|
|
2355
|
+
operation: u.subroutine(u.args)
|
|
2356
2356
|
})), !0;
|
|
2357
2357
|
}, i = [];
|
|
2358
2358
|
e: for (; o.length > 0; ) {
|
|
@@ -2363,19 +2363,19 @@ function dr(s, e, t, r) {
|
|
|
2363
2363
|
break;
|
|
2364
2364
|
case "ScheduleSubroutine":
|
|
2365
2365
|
{
|
|
2366
|
-
const
|
|
2366
|
+
const u = Symbol(), l = Object.entries(c.args), d = l.length;
|
|
2367
2367
|
if (d === 0)
|
|
2368
2368
|
o.push({
|
|
2369
2369
|
destination: a.destination,
|
|
2370
2370
|
operation: c.subroutine({})
|
|
2371
2371
|
});
|
|
2372
2372
|
else {
|
|
2373
|
-
for (const [
|
|
2373
|
+
for (const [f, h] of l)
|
|
2374
2374
|
o.push({
|
|
2375
|
-
destination: { op:
|
|
2376
|
-
operation:
|
|
2375
|
+
destination: { op: u, arg: f },
|
|
2376
|
+
operation: h
|
|
2377
2377
|
});
|
|
2378
|
-
e.pendingSubroutines.set(
|
|
2378
|
+
e.pendingSubroutines.set(u, {
|
|
2379
2379
|
argCounter: d,
|
|
2380
2380
|
args: {},
|
|
2381
2381
|
subroutine: c.subroutine,
|
|
@@ -2393,68 +2393,68 @@ function dr(s, e, t, r) {
|
|
|
2393
2393
|
});
|
|
2394
2394
|
break;
|
|
2395
2395
|
default:
|
|
2396
|
-
|
|
2396
|
+
K(c);
|
|
2397
2397
|
}
|
|
2398
2398
|
}
|
|
2399
2399
|
return i;
|
|
2400
2400
|
}
|
|
2401
|
-
function
|
|
2402
|
-
return
|
|
2401
|
+
function oi(s, e, t, r = {}) {
|
|
2402
|
+
return ps(s, ei(e), t, r);
|
|
2403
2403
|
}
|
|
2404
|
-
function
|
|
2405
|
-
const o = `${e.blockId}#` +
|
|
2404
|
+
function ps(s, e, t, r = {}) {
|
|
2405
|
+
const o = `${e.blockId}#` + Z({
|
|
2406
2406
|
ctx: Object.fromEntries(
|
|
2407
|
-
Object.entries(e).filter(([n]) =>
|
|
2407
|
+
Object.entries(e).filter(([n]) => Zn.indexOf(n) === -1)
|
|
2408
2408
|
),
|
|
2409
2409
|
cfg: t
|
|
2410
2410
|
});
|
|
2411
|
-
return
|
|
2411
|
+
return J.makeRaw(
|
|
2412
2412
|
(n) => {
|
|
2413
|
-
const i = { drivers: s, cCtx: n }, a =
|
|
2413
|
+
const i = { drivers: s, cCtx: n }, a = si();
|
|
2414
2414
|
return {
|
|
2415
|
-
ir:
|
|
2415
|
+
ir: pr(
|
|
2416
2416
|
i,
|
|
2417
2417
|
a,
|
|
2418
2418
|
[
|
|
2419
2419
|
{
|
|
2420
|
-
destination:
|
|
2420
|
+
destination: ti,
|
|
2421
2421
|
operation: k(e, t)
|
|
2422
2422
|
}
|
|
2423
2423
|
],
|
|
2424
2424
|
!0
|
|
2425
2425
|
),
|
|
2426
|
-
postprocessValue(
|
|
2427
|
-
const
|
|
2428
|
-
for (const
|
|
2429
|
-
|
|
2426
|
+
postprocessValue(u) {
|
|
2427
|
+
const l = [];
|
|
2428
|
+
for (const E of u)
|
|
2429
|
+
l.push({ destination: E.destination, operation: P(E.computable) });
|
|
2430
2430
|
const d = {
|
|
2431
2431
|
drivers: s,
|
|
2432
2432
|
get cCtx() {
|
|
2433
2433
|
throw new Error("asynchronous operations are forbidden in this context");
|
|
2434
2434
|
}
|
|
2435
|
-
},
|
|
2436
|
-
for (const [
|
|
2437
|
-
|
|
2438
|
-
const
|
|
2435
|
+
}, f = /* @__PURE__ */ new Map();
|
|
2436
|
+
for (const [E, g] of a.pendingSubroutines)
|
|
2437
|
+
f.set(E, { ...g, args: { ...g.args } });
|
|
2438
|
+
const h = {
|
|
2439
2439
|
result: a.result,
|
|
2440
|
-
pendingSubroutines:
|
|
2440
|
+
pendingSubroutines: f
|
|
2441
2441
|
};
|
|
2442
|
-
if (
|
|
2442
|
+
if (pr(d, h, l, !1), !("result" in h))
|
|
2443
2443
|
throw new Error("illegal cfg rendering stack state, no result");
|
|
2444
|
-
return
|
|
2444
|
+
return h.result;
|
|
2445
2445
|
}
|
|
2446
2446
|
};
|
|
2447
2447
|
},
|
|
2448
2448
|
{ ...r, key: o }
|
|
2449
2449
|
);
|
|
2450
2450
|
}
|
|
2451
|
-
function
|
|
2451
|
+
function ni(s) {
|
|
2452
2452
|
return s instanceof ArrayBuffer || ArrayBuffer.isView(s);
|
|
2453
2453
|
}
|
|
2454
|
-
function
|
|
2454
|
+
function hr(s) {
|
|
2455
2455
|
return s !== void 0 ? Buffer.from(s).toString("base64") : void 0;
|
|
2456
2456
|
}
|
|
2457
|
-
class
|
|
2457
|
+
class et {
|
|
2458
2458
|
constructor(e, t, r, o, n) {
|
|
2459
2459
|
w(this, "callbackRegistry");
|
|
2460
2460
|
w(this, "fnJSONStringify");
|
|
@@ -2486,12 +2486,12 @@ class Ze {
|
|
|
2486
2486
|
try {
|
|
2487
2487
|
this.vm.unwrapResult(this.vm.evalCode(e, "bundle.js", { type: "global" })).dispose();
|
|
2488
2488
|
} catch (t) {
|
|
2489
|
-
throw
|
|
2489
|
+
throw et.cleanErrorContext(t), t;
|
|
2490
2490
|
}
|
|
2491
2491
|
}
|
|
2492
2492
|
runCallback(e, ...t) {
|
|
2493
2493
|
try {
|
|
2494
|
-
return
|
|
2494
|
+
return St.withScope((r) => {
|
|
2495
2495
|
const o = r.manage(this.vm.getProp(this.callbackRegistry, e));
|
|
2496
2496
|
if (this.vm.typeof(o) !== "function")
|
|
2497
2497
|
throw new Error(`No such callback: ${e}`);
|
|
@@ -2506,7 +2506,7 @@ class Ze {
|
|
|
2506
2506
|
);
|
|
2507
2507
|
});
|
|
2508
2508
|
} catch (r) {
|
|
2509
|
-
throw
|
|
2509
|
+
throw et.cleanErrorContext(r), r;
|
|
2510
2510
|
}
|
|
2511
2511
|
}
|
|
2512
2512
|
//
|
|
@@ -2561,13 +2561,13 @@ class Ze {
|
|
|
2561
2561
|
return this.getAccessor(e).listDynamicFields();
|
|
2562
2562
|
}
|
|
2563
2563
|
getKeyValueBase64(e, t) {
|
|
2564
|
-
return
|
|
2564
|
+
return hr(this.getAccessor(e).getKeyValue(t));
|
|
2565
2565
|
}
|
|
2566
2566
|
getKeyValueAsString(e, t) {
|
|
2567
2567
|
return this.getAccessor(e).getKeyValueAsString(t);
|
|
2568
2568
|
}
|
|
2569
2569
|
getDataBase64(e) {
|
|
2570
|
-
return
|
|
2570
|
+
return hr(this.getAccessor(e).getData());
|
|
2571
2571
|
}
|
|
2572
2572
|
getDataAsString(e) {
|
|
2573
2573
|
return this.getAccessor(e).getDataAsString();
|
|
@@ -2579,8 +2579,8 @@ class Ze {
|
|
|
2579
2579
|
const n = this.getAccessor(e);
|
|
2580
2580
|
if (!n.getIsReadyOrError()) return;
|
|
2581
2581
|
const i = Cn(n, t, r, o), a = {};
|
|
2582
|
-
for (const [c,
|
|
2583
|
-
a[c] = de(
|
|
2582
|
+
for (const [c, u] of Object.entries(i))
|
|
2583
|
+
a[c] = de(u, (l) => this.wrapAccessor(l));
|
|
2584
2584
|
return a;
|
|
2585
2585
|
}
|
|
2586
2586
|
//
|
|
@@ -2594,7 +2594,7 @@ class Ze {
|
|
|
2594
2594
|
const t = this.getAccessor(e).resourceInfo;
|
|
2595
2595
|
return this.registerComputable(
|
|
2596
2596
|
"getBlobContentAsString",
|
|
2597
|
-
|
|
2597
|
+
J.make((r) => this.env.driverKit.blobDriver.getDownloadedBlob(t, r), {
|
|
2598
2598
|
postprocessValue: async (r) => {
|
|
2599
2599
|
if (r !== void 0)
|
|
2600
2600
|
return Buffer.from(await this.env.driverKit.blobDriver.getContent(r.handle)).toString(
|
|
@@ -2608,7 +2608,7 @@ class Ze {
|
|
|
2608
2608
|
const t = this.getAccessor(e).resourceInfo;
|
|
2609
2609
|
return this.registerComputable(
|
|
2610
2610
|
"getBlobContentAsBase64",
|
|
2611
|
-
|
|
2611
|
+
J.make((r) => this.env.driverKit.blobDriver.getDownloadedBlob(t, r), {
|
|
2612
2612
|
postprocessValue: async (r) => {
|
|
2613
2613
|
if (r !== void 0)
|
|
2614
2614
|
return Buffer.from(await this.env.driverKit.blobDriver.getContent(r.handle)).toString(
|
|
@@ -2726,7 +2726,7 @@ class Ze {
|
|
|
2726
2726
|
obj: {
|
|
2727
2727
|
id: t.obj.id,
|
|
2728
2728
|
spec: t.obj.spec,
|
|
2729
|
-
data:
|
|
2729
|
+
data: jr(t.obj.data, (r) => this.wrapAccessor(r))
|
|
2730
2730
|
}
|
|
2731
2731
|
}))
|
|
2732
2732
|
};
|
|
@@ -2763,7 +2763,7 @@ class Ze {
|
|
|
2763
2763
|
"can't instantiate PTable from this context (most porbably called from the future mapper)"
|
|
2764
2764
|
);
|
|
2765
2765
|
return this.env.driverKit.pFrameDriver.createPTable(
|
|
2766
|
-
|
|
2766
|
+
mt(
|
|
2767
2767
|
e,
|
|
2768
2768
|
(t) => de(t, (r) => typeof r == "string" ? this.getAccessor(r) : r)
|
|
2769
2769
|
),
|
|
@@ -2820,7 +2820,7 @@ class Ze {
|
|
|
2820
2820
|
r = this.vm.null;
|
|
2821
2821
|
break;
|
|
2822
2822
|
}
|
|
2823
|
-
if (
|
|
2823
|
+
if (ni(e)) {
|
|
2824
2824
|
r = this.vm.newArrayBuffer(e), o = !0;
|
|
2825
2825
|
break;
|
|
2826
2826
|
}
|
|
@@ -2856,25 +2856,25 @@ class Ze {
|
|
|
2856
2856
|
return JSON.parse(t);
|
|
2857
2857
|
}
|
|
2858
2858
|
injectCtx() {
|
|
2859
|
-
|
|
2859
|
+
St.withScope((e) => {
|
|
2860
2860
|
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);
|
|
2861
2861
|
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(
|
|
2862
2862
|
t,
|
|
2863
2863
|
"featureFlags",
|
|
2864
|
-
this.exportObjectUniversal(
|
|
2864
|
+
this.exportObjectUniversal($s.GlobalCfgRenderCtxFeatureFlags, e)
|
|
2865
2865
|
);
|
|
2866
2866
|
const i = (a, c) => {
|
|
2867
|
-
this.vm.newFunction(a, c).consume((
|
|
2867
|
+
this.vm.newFunction(a, c).consume((u) => this.vm.setProp(t, a, u));
|
|
2868
2868
|
};
|
|
2869
2869
|
i("getAccessorHandleByName", (a) => this.exportSingleValue(
|
|
2870
2870
|
this.getAccessorHandleByName(this.vm.getString(a)),
|
|
2871
2871
|
void 0
|
|
2872
|
-
)), i("resolveWithCommon", (a, c, ...
|
|
2872
|
+
)), i("resolveWithCommon", (a, c, ...u) => this.exportSingleValue(
|
|
2873
2873
|
this.resolveWithCommon(
|
|
2874
2874
|
this.vm.getString(a),
|
|
2875
2875
|
this.importObjectViaJson(c),
|
|
2876
|
-
...
|
|
2877
|
-
(
|
|
2876
|
+
...u.map(
|
|
2877
|
+
(l) => this.importObjectViaJson(l)
|
|
2878
2878
|
)
|
|
2879
2879
|
),
|
|
2880
2880
|
void 0
|
|
@@ -2886,12 +2886,12 @@ class Ze {
|
|
|
2886
2886
|
void 0
|
|
2887
2887
|
)), i("getDataBase64", (a) => this.exportSingleValue(this.getDataBase64(this.vm.getString(a)), void 0)), i("getDataAsString", (a) => this.exportSingleValue(this.getDataAsString(this.vm.getString(a)), void 0)), i(
|
|
2888
2888
|
"parsePObjectCollection",
|
|
2889
|
-
(a, c,
|
|
2889
|
+
(a, c, u, ...l) => this.exportObjectUniversal(
|
|
2890
2890
|
this.parsePObjectCollection(
|
|
2891
2891
|
this.vm.getString(a),
|
|
2892
2892
|
this.vm.dump(c),
|
|
2893
|
-
this.vm.getString(
|
|
2894
|
-
...
|
|
2893
|
+
this.vm.getString(u),
|
|
2894
|
+
...l.map((d) => this.vm.getString(d))
|
|
2895
2895
|
),
|
|
2896
2896
|
void 0
|
|
2897
2897
|
)
|
|
@@ -2946,107 +2946,107 @@ class Ze {
|
|
|
2946
2946
|
});
|
|
2947
2947
|
}
|
|
2948
2948
|
}
|
|
2949
|
-
function
|
|
2949
|
+
function rt(s, e) {
|
|
2950
2950
|
return Fe(
|
|
2951
2951
|
s.traverse(
|
|
2952
2952
|
{
|
|
2953
|
-
field:
|
|
2953
|
+
field: U(e, "blockPack"),
|
|
2954
2954
|
assertFieldType: "Dynamic",
|
|
2955
2955
|
errorIfFieldNotSet: !0
|
|
2956
2956
|
},
|
|
2957
2957
|
{ field: A.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 }
|
|
2958
2958
|
),
|
|
2959
2959
|
(t) => {
|
|
2960
|
-
const r = t.getDataAsJson(), o =
|
|
2960
|
+
const r = t.getDataAsJson(), o = Vr(r.config);
|
|
2961
2961
|
return { bpId: t.resourceInfo.id.toString(), info: r, cfg: o };
|
|
2962
2962
|
}
|
|
2963
2963
|
);
|
|
2964
2964
|
}
|
|
2965
2965
|
const _e = process.env.MI_LOG_OUTPUT_STATUS;
|
|
2966
|
-
function
|
|
2966
|
+
function ii(s, e, t, r, o, n = {}) {
|
|
2967
2967
|
const i = `${e.blockId}#lambda#${o}#${t.handle}`;
|
|
2968
|
-
return n = { ...n, key: i }, n.mode === void 0 && t.retentive === !0 && (n.mode = "StableOnlyRetentive"),
|
|
2969
|
-
const c = new
|
|
2968
|
+
return n = { ...n, key: i }, n.mode === void 0 && t.retentive === !0 && (n.mode = "StableOnlyRetentive"), J.makeRaw((a) => {
|
|
2969
|
+
const c = new St();
|
|
2970
2970
|
a.addOnDestroy(() => c.dispose());
|
|
2971
|
-
const
|
|
2972
|
-
|
|
2973
|
-
const
|
|
2971
|
+
const u = c.manage(s.quickJs.newRuntime());
|
|
2972
|
+
u.setMemoryLimit(1024 * 640), u.setMaxStackSize(1024 * 320);
|
|
2973
|
+
const l = c.manage(u.newContext()), d = new et(c, l, e, s, a);
|
|
2974
2974
|
d.evaluateBundle(r.content);
|
|
2975
|
-
const
|
|
2975
|
+
const f = d.runCallback(t.handle);
|
|
2976
2976
|
d.resetComputableCtx();
|
|
2977
|
-
let
|
|
2977
|
+
let h = 0;
|
|
2978
2978
|
return _e && _e !== "unstable-only" && console.log(`Output ${t.handle} scaffold calculated.`), {
|
|
2979
2979
|
ir: d.computablesToResolve,
|
|
2980
|
-
postprocessValue: (
|
|
2981
|
-
for (const [
|
|
2982
|
-
const
|
|
2983
|
-
return
|
|
2984
|
-
|
|
2985
|
-
),
|
|
2980
|
+
postprocessValue: (E, { unstableMarker: g, stable: D }) => {
|
|
2981
|
+
for (const [j, $] of Object.entries(E)) d.runCallback(j, $);
|
|
2982
|
+
const T = d.importObjectUniversal(f);
|
|
2983
|
+
return h++, _e && (_e !== "unstable-only" || !D) && console.log(
|
|
2984
|
+
D ? `Stable output ${t.handle} calculated ${T !== void 0 ? "defined" : "undefined"}; (#${h})` : `Unstable output ${t.handle}; marker = ${g}; ${T !== void 0 ? "defined" : "undefined"} (#${h})`
|
|
2985
|
+
), T;
|
|
2986
2986
|
}
|
|
2987
2987
|
};
|
|
2988
2988
|
}, n);
|
|
2989
2989
|
}
|
|
2990
|
-
function
|
|
2991
|
-
return
|
|
2990
|
+
function ai(s) {
|
|
2991
|
+
return Ur(s) ? s.isActive === !0 : On(s);
|
|
2992
2992
|
}
|
|
2993
2993
|
function Ie(s, e, t, r, o, n = {}) {
|
|
2994
|
-
if (
|
|
2994
|
+
if (Ur(t)) {
|
|
2995
2995
|
if (r === void 0) throw new Error("No code bundle.");
|
|
2996
|
-
return
|
|
2997
|
-
} else return
|
|
2996
|
+
return ii(s, e, t, r, o, n);
|
|
2997
|
+
} else return oi(s.driverKit, e, t, n);
|
|
2998
2998
|
}
|
|
2999
|
-
function
|
|
3000
|
-
return
|
|
2999
|
+
function ci(s, e, t) {
|
|
3000
|
+
return J.make(
|
|
3001
3001
|
(r) => {
|
|
3002
|
-
var
|
|
3003
|
-
const o = r.accessor(s).node(), n = B(o.getKeyValueAsJson(
|
|
3004
|
-
o.getKeyValueAsJson(
|
|
3005
|
-
),
|
|
3006
|
-
for (const { id: L } of
|
|
3007
|
-
const
|
|
3008
|
-
field:
|
|
3002
|
+
var E, g, D, T, j, $, G, ge;
|
|
3003
|
+
const o = r.accessor(s).node(), n = B(o.getKeyValueAsJson(Tt)), i = B(o.getKeyValueAsJson(Le)), a = B(o.getKeyValueAsJson(De)), c = B(o.getKeyValueAsJson(fe)), u = B(
|
|
3004
|
+
o.getKeyValueAsJson(Qe)
|
|
3005
|
+
), l = /* @__PURE__ */ new Map();
|
|
3006
|
+
for (const { id: L } of oe(c)) {
|
|
3007
|
+
const q = o.traverse({
|
|
3008
|
+
field: U(L, "currentArgs"),
|
|
3009
3009
|
assertFieldType: "Dynamic",
|
|
3010
3010
|
errorIfFieldNotSet: !0
|
|
3011
3011
|
});
|
|
3012
3012
|
let ie;
|
|
3013
|
-
const
|
|
3014
|
-
field:
|
|
3013
|
+
const W = o.traverse({
|
|
3014
|
+
field: U(L, "prodArgs"),
|
|
3015
3015
|
assertFieldType: "Dynamic",
|
|
3016
3016
|
stableIfNotFound: !0
|
|
3017
3017
|
});
|
|
3018
|
-
if (
|
|
3019
|
-
const
|
|
3020
|
-
field:
|
|
3018
|
+
if (W !== void 0) {
|
|
3019
|
+
const M = o.getField({
|
|
3020
|
+
field: U(L, "prodOutput"),
|
|
3021
3021
|
assertFieldType: "Dynamic",
|
|
3022
3022
|
errorIfFieldNotFound: !0
|
|
3023
|
-
}),
|
|
3024
|
-
field:
|
|
3023
|
+
}), V = o.getField({
|
|
3024
|
+
field: U(L, "prodUiCtx"),
|
|
3025
3025
|
assertFieldType: "Dynamic",
|
|
3026
3026
|
errorIfFieldNotFound: !0
|
|
3027
3027
|
});
|
|
3028
3028
|
ie = {
|
|
3029
|
-
arguments:
|
|
3030
|
-
stale:
|
|
3031
|
-
outputError:
|
|
3032
|
-
outputsError: ((
|
|
3033
|
-
exportsError: ((
|
|
3034
|
-
finished: (
|
|
3029
|
+
arguments: W.getDataAsJson(),
|
|
3030
|
+
stale: q.id !== W.id,
|
|
3031
|
+
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,
|
|
3032
|
+
outputsError: ((D = M.error) == null ? void 0 : D.getDataAsString()) ?? ((j = (T = M.value) == null ? void 0 : T.getError()) == null ? void 0 : j.getDataAsString()),
|
|
3033
|
+
exportsError: (($ = V.error) == null ? void 0 : $.getDataAsString()) ?? ((ge = (G = V.value) == null ? void 0 : G.getError()) == null ? void 0 : ge.getDataAsString()),
|
|
3034
|
+
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())
|
|
3035
3035
|
};
|
|
3036
3036
|
}
|
|
3037
|
-
|
|
3037
|
+
l.set(L, { currentArguments: q.getDataAsJson(), prod: ie });
|
|
3038
3038
|
}
|
|
3039
|
-
const d =
|
|
3040
|
-
var S, R,
|
|
3041
|
-
const
|
|
3042
|
-
let
|
|
3043
|
-
|
|
3044
|
-
const
|
|
3045
|
-
const
|
|
3039
|
+
const d = Xe(c, (L) => l.get(L).currentArguments), f = new Set(u.blocksInLimbo), h = [...oe(c)].map(({ id: L, label: q, renderingMode: ie }) => {
|
|
3040
|
+
var S, R, O, C, I;
|
|
3041
|
+
const W = B(l.get(L)), M = B(d.nodes.get(L));
|
|
3042
|
+
let V = "NotCalculated";
|
|
3043
|
+
W.prod !== void 0 && (f.has(L) ? V = "Limbo" : V = W.prod.finished ? "Done" : "Running");
|
|
3044
|
+
const X = rt(o, L), { sections: me, title: v, inputsValid: p, sdkVersion: m } = Fe(X, ({ bpId: N, cfg: F }) => {
|
|
3045
|
+
const ne = Nt(s, L);
|
|
3046
3046
|
return {
|
|
3047
3047
|
sections: Ie(
|
|
3048
3048
|
t,
|
|
3049
|
-
|
|
3049
|
+
ne,
|
|
3050
3050
|
F.sections,
|
|
3051
3051
|
F.code,
|
|
3052
3052
|
N
|
|
@@ -3055,7 +3055,7 @@ function ai(s, e, t) {
|
|
|
3055
3055
|
F.title,
|
|
3056
3056
|
(Cs) => Ie(
|
|
3057
3057
|
t,
|
|
3058
|
-
|
|
3058
|
+
ne,
|
|
3059
3059
|
Cs,
|
|
3060
3060
|
F.code,
|
|
3061
3061
|
N
|
|
@@ -3063,7 +3063,7 @@ function ai(s, e, t) {
|
|
|
3063
3063
|
),
|
|
3064
3064
|
inputsValid: Ie(
|
|
3065
3065
|
t,
|
|
3066
|
-
|
|
3066
|
+
ne,
|
|
3067
3067
|
F.inputsValid,
|
|
3068
3068
|
F.code,
|
|
3069
3069
|
N
|
|
@@ -3071,31 +3071,31 @@ function ai(s, e, t) {
|
|
|
3071
3071
|
sdkVersion: F.sdkVersion
|
|
3072
3072
|
};
|
|
3073
3073
|
}) || {}, y = o.traverse({
|
|
3074
|
-
field:
|
|
3074
|
+
field: U(L, "blockSettings"),
|
|
3075
3075
|
assertFieldType: "Dynamic",
|
|
3076
3076
|
errorIfFieldNotSet: !0
|
|
3077
3077
|
}).getDataAsJson(), b = Fe(
|
|
3078
|
-
|
|
3078
|
+
X,
|
|
3079
3079
|
({ info: N }) => t.blockUpdateWatcher.get({ currentSpec: N.source, settings: y })
|
|
3080
3080
|
);
|
|
3081
3081
|
return {
|
|
3082
3082
|
id: L,
|
|
3083
|
-
label: v ??
|
|
3084
|
-
title: v ??
|
|
3083
|
+
label: v ?? q,
|
|
3084
|
+
title: v ?? q,
|
|
3085
3085
|
renderingMode: ie,
|
|
3086
|
-
stale: ((S =
|
|
3087
|
-
missingReference:
|
|
3086
|
+
stale: ((S = W.prod) == null ? void 0 : S.stale) !== !1 || V === "Limbo",
|
|
3087
|
+
missingReference: M.missingReferences,
|
|
3088
3088
|
upstreams: [...d.traverseIdsExcludingRoots("upstream", L)],
|
|
3089
3089
|
downstreams: [...d.traverseIdsExcludingRoots("downstream", L)],
|
|
3090
|
-
calculationStatus:
|
|
3091
|
-
outputErrors: ((R =
|
|
3092
|
-
outputsError: (
|
|
3093
|
-
exportsError: (C =
|
|
3090
|
+
calculationStatus: V,
|
|
3091
|
+
outputErrors: ((R = W.prod) == null ? void 0 : R.outputError) === !0,
|
|
3092
|
+
outputsError: (O = W.prod) == null ? void 0 : O.outputsError,
|
|
3093
|
+
exportsError: (C = W.prod) == null ? void 0 : C.exportsError,
|
|
3094
3094
|
settings: y,
|
|
3095
3095
|
sections: me,
|
|
3096
3096
|
inputsValid: p,
|
|
3097
3097
|
updateInfo: {},
|
|
3098
|
-
currentBlockPack: (I =
|
|
3098
|
+
currentBlockPack: (I = X == null ? void 0 : X.info) == null ? void 0 : I.source,
|
|
3099
3099
|
updates: b,
|
|
3100
3100
|
sdkVersion: m,
|
|
3101
3101
|
navigationState: e.getState(L)
|
|
@@ -3105,8 +3105,8 @@ function ai(s, e, t) {
|
|
|
3105
3105
|
meta: a,
|
|
3106
3106
|
created: new Date(n),
|
|
3107
3107
|
lastModified: new Date(i),
|
|
3108
|
-
authorMarker: o.getKeyValueAsJson(
|
|
3109
|
-
blocks:
|
|
3108
|
+
authorMarker: o.getKeyValueAsJson(Rt),
|
|
3109
|
+
blocks: h
|
|
3110
3110
|
};
|
|
3111
3111
|
},
|
|
3112
3112
|
{
|
|
@@ -3115,29 +3115,29 @@ function ai(s, e, t) {
|
|
|
3115
3115
|
return {
|
|
3116
3116
|
...r,
|
|
3117
3117
|
blocks: r.blocks.map((i) => {
|
|
3118
|
-
var
|
|
3118
|
+
var l, d;
|
|
3119
3119
|
i.inputsValid || o.add(i.id), i.stale && n.add(i.id);
|
|
3120
|
-
const a = i.stale || i.upstreams.findIndex((
|
|
3120
|
+
const a = i.stale || i.upstreams.findIndex((f) => n.has(f)) !== -1, c = (a || i.outputErrors) && !!i.inputsValid && !i.missingReference && i.upstreams.findIndex((f) => o.has(f)) === -1, u = {
|
|
3121
3121
|
...i,
|
|
3122
3122
|
canRun: c,
|
|
3123
3123
|
stale: a,
|
|
3124
|
-
updateSuggestions: ((
|
|
3124
|
+
updateSuggestions: ((l = i.updates) == null ? void 0 : l.suggestions) ?? [],
|
|
3125
3125
|
updatedBlockPack: (d = i.updates) == null ? void 0 : d.mainSuggestion
|
|
3126
3126
|
};
|
|
3127
|
-
return delete
|
|
3127
|
+
return delete u.updates, u;
|
|
3128
3128
|
})
|
|
3129
3129
|
};
|
|
3130
3130
|
}
|
|
3131
3131
|
}
|
|
3132
3132
|
).withStableType();
|
|
3133
3133
|
}
|
|
3134
|
-
function
|
|
3134
|
+
function li(s, e) {
|
|
3135
3135
|
const t = s.node();
|
|
3136
|
-
if (ue(t.resourceType,
|
|
3136
|
+
if (ue(t.resourceType, es)) {
|
|
3137
3137
|
const r = t.getDataAsJson();
|
|
3138
3138
|
if (r === void 0) throw new Error("No resource data.");
|
|
3139
3139
|
return e.frontendDownloadDriver.getPath(new URL(r.url)).withStableType();
|
|
3140
|
-
} else if (ue(t.resourceType,
|
|
3140
|
+
} else if (ue(t.resourceType, ts)) {
|
|
3141
3141
|
const r = t.getDataAsJson();
|
|
3142
3142
|
if (r === void 0) throw new Error("No resource data.");
|
|
3143
3143
|
return e.signer.verify(
|
|
@@ -3148,10 +3148,10 @@ function ci(s, e) {
|
|
|
3148
3148
|
} else
|
|
3149
3149
|
throw new Error(`Unsupported resource type: ${JSON.stringify(t.resourceType)}`);
|
|
3150
3150
|
}
|
|
3151
|
-
function
|
|
3151
|
+
function ui(s, e) {
|
|
3152
3152
|
if (s !== void 0)
|
|
3153
|
-
return
|
|
3154
|
-
(t) =>
|
|
3153
|
+
return J.make(
|
|
3154
|
+
(t) => li(t.accessor(s), e),
|
|
3155
3155
|
{
|
|
3156
3156
|
postprocessValue: (t) => {
|
|
3157
3157
|
if (t !== void 0) {
|
|
@@ -3163,89 +3163,89 @@ function li(s, e) {
|
|
|
3163
3163
|
}
|
|
3164
3164
|
).withStableType();
|
|
3165
3165
|
}
|
|
3166
|
-
function
|
|
3167
|
-
return
|
|
3166
|
+
function di(s, e, t) {
|
|
3167
|
+
return J.make(
|
|
3168
3168
|
(r) => {
|
|
3169
3169
|
var a;
|
|
3170
|
-
const o = r.accessor(s).node(), n =
|
|
3170
|
+
const o = r.accessor(s).node(), n = rt(o, e), i = (a = o.traverse(
|
|
3171
3171
|
{
|
|
3172
|
-
field:
|
|
3172
|
+
field: U(e, "blockPack"),
|
|
3173
3173
|
assertFieldType: "Dynamic"
|
|
3174
3174
|
},
|
|
3175
3175
|
{ field: A.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 },
|
|
3176
|
-
{ field:
|
|
3176
|
+
{ field: ss, assertFieldType: "Input" }
|
|
3177
3177
|
)) == null ? void 0 : a.persist();
|
|
3178
3178
|
return {
|
|
3179
|
-
path:
|
|
3179
|
+
path: ui(i, t),
|
|
3180
3180
|
sdkVersion: n == null ? void 0 : n.cfg.sdkVersion
|
|
3181
3181
|
};
|
|
3182
3182
|
},
|
|
3183
3183
|
{ mode: "StableOnlyLive" }
|
|
3184
3184
|
);
|
|
3185
3185
|
}
|
|
3186
|
-
function
|
|
3186
|
+
function hs(s, e, t) {
|
|
3187
3187
|
if (t === void 0)
|
|
3188
|
-
return
|
|
3189
|
-
key: `inputs#${
|
|
3188
|
+
return J.make((i) => hs(s, e, i), {
|
|
3189
|
+
key: `inputs#${Mr(s.rid)}#${e}`
|
|
3190
3190
|
});
|
|
3191
|
-
const r = t.accessor(s).node(), o =
|
|
3191
|
+
const r = t.accessor(s).node(), o = Nt(s, e), n = o.uiState(t);
|
|
3192
3192
|
return {
|
|
3193
|
-
author: r.getKeyValueAsJson(
|
|
3193
|
+
author: r.getKeyValueAsJson(bt(e)),
|
|
3194
3194
|
args: JSON.parse(o.args(t)),
|
|
3195
3195
|
ui: n !== void 0 ? JSON.parse(n) : void 0
|
|
3196
3196
|
};
|
|
3197
3197
|
}
|
|
3198
|
-
function
|
|
3199
|
-
return
|
|
3198
|
+
function pi(s, e, t) {
|
|
3199
|
+
return J.make(
|
|
3200
3200
|
(r) => {
|
|
3201
|
-
const o = r.accessor(s).node(), n =
|
|
3202
|
-
return Fe(
|
|
3201
|
+
const o = r.accessor(s).node(), n = as(s, e);
|
|
3202
|
+
return Fe(rt(o, e), ({ cfg: i, bpId: a }) => {
|
|
3203
3203
|
const c = {};
|
|
3204
|
-
for (const [
|
|
3205
|
-
const d = Ie(t, n,
|
|
3206
|
-
c[
|
|
3204
|
+
for (const [u, l] of Object.entries(i.outputs)) {
|
|
3205
|
+
const d = Ie(t, n, l, i.code, a);
|
|
3206
|
+
c[u] = J.wrapError(d);
|
|
3207
3207
|
}
|
|
3208
3208
|
return c;
|
|
3209
3209
|
});
|
|
3210
3210
|
},
|
|
3211
|
-
{ key: "outputs#" +
|
|
3211
|
+
{ key: "outputs#" + Mr(s.rid) + "#" + e }
|
|
3212
3212
|
).withStableType();
|
|
3213
3213
|
}
|
|
3214
|
-
function
|
|
3215
|
-
return
|
|
3214
|
+
function hi(s, e) {
|
|
3215
|
+
return J.make((t) => {
|
|
3216
3216
|
const r = t.accessor(s).node(), o = B(r.getKeyValueAsJson(fe)), n = [];
|
|
3217
|
-
for (const { id: i } of
|
|
3218
|
-
const a =
|
|
3217
|
+
for (const { id: i } of oe(o)) {
|
|
3218
|
+
const a = rt(r, i);
|
|
3219
3219
|
if (a === void 0) continue;
|
|
3220
|
-
const c = Object.entries(a.cfg.outputs).map(([,
|
|
3220
|
+
const c = Object.entries(a.cfg.outputs).map(([, l]) => l).filter((l) => ai(l)).map((l) => l);
|
|
3221
3221
|
if (c.length === 0) continue;
|
|
3222
|
-
const
|
|
3223
|
-
for (const
|
|
3222
|
+
const u = as(r.persist(), i);
|
|
3223
|
+
for (const l of c)
|
|
3224
3224
|
n.push(
|
|
3225
|
-
|
|
3225
|
+
J.wrapError(Ie(e, u, l, a.cfg.code, a.bpId))
|
|
3226
3226
|
);
|
|
3227
3227
|
}
|
|
3228
3228
|
return n;
|
|
3229
3229
|
});
|
|
3230
3230
|
}
|
|
3231
|
-
class
|
|
3231
|
+
class fi {
|
|
3232
3232
|
constructor() {
|
|
3233
3233
|
w(this, "states", /* @__PURE__ */ new Map());
|
|
3234
3234
|
}
|
|
3235
3235
|
setState(e, t) {
|
|
3236
3236
|
const r = this.states.get(e);
|
|
3237
3237
|
if (r === void 0) {
|
|
3238
|
-
this.states.set(e, { state: t, change: new
|
|
3238
|
+
this.states.set(e, { state: t, change: new Yt() });
|
|
3239
3239
|
return;
|
|
3240
3240
|
}
|
|
3241
3241
|
r.state = { ...t }, r.change.markChanged();
|
|
3242
3242
|
}
|
|
3243
3243
|
readState(e, t) {
|
|
3244
3244
|
let r = this.states.get(t);
|
|
3245
|
-
return r === void 0 && (r = { state: {
|
|
3245
|
+
return r === void 0 && (r = { state: { ...Fs }, change: new Yt() }, this.states.set(t, r)), r.change.attachWatcher(e.watcher), r.state;
|
|
3246
3246
|
}
|
|
3247
3247
|
getState(e) {
|
|
3248
|
-
return
|
|
3248
|
+
return J.make(
|
|
3249
3249
|
(t) => this.readState(t, e),
|
|
3250
3250
|
{ key: `navigationState#${e}` }
|
|
3251
3251
|
);
|
|
@@ -3255,38 +3255,38 @@ class hi {
|
|
|
3255
3255
|
t !== void 0 && (this.states.delete(e), t.change.markChanged());
|
|
3256
3256
|
}
|
|
3257
3257
|
}
|
|
3258
|
-
class
|
|
3258
|
+
class Bt {
|
|
3259
3259
|
constructor(e, t, r) {
|
|
3260
3260
|
/** Underlying pl resource id */
|
|
3261
3261
|
w(this, "rid");
|
|
3262
3262
|
/** Data for the left panel, contain basic information about block status. */
|
|
3263
3263
|
w(this, "overview");
|
|
3264
|
-
w(this, "navigationStates", new
|
|
3264
|
+
w(this, "navigationStates", new fi());
|
|
3265
3265
|
w(this, "blockComputables", /* @__PURE__ */ new Map());
|
|
3266
3266
|
w(this, "blockFrontends", /* @__PURE__ */ new Map());
|
|
3267
3267
|
w(this, "activeConfigs");
|
|
3268
3268
|
w(this, "refreshLoopResult");
|
|
3269
3269
|
w(this, "abortController", new AbortController());
|
|
3270
3270
|
w(this, "destroyed", !1);
|
|
3271
|
-
this.env = e, this.projectTree = r, this.overview =
|
|
3271
|
+
this.env = e, this.projectTree = r, this.overview = ci(
|
|
3272
3272
|
r.entry(),
|
|
3273
3273
|
this.navigationStates,
|
|
3274
3274
|
e
|
|
3275
|
-
).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs =
|
|
3275
|
+
).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs = hi(r.entry(), e);
|
|
3276
3276
|
}
|
|
3277
3277
|
async refreshLoop() {
|
|
3278
3278
|
for (; !this.destroyed; )
|
|
3279
3279
|
try {
|
|
3280
3280
|
await Me(this.env.pl, this.rid, (e) => {
|
|
3281
3281
|
e.doRefresh(this.env.ops.stagingRenderingRate);
|
|
3282
|
-
}), await this.activeConfigs.getValue(), await
|
|
3282
|
+
}), await this.activeConfigs.getValue(), await Hr(this.env.ops.projectRefreshInterval, this.abortController.signal);
|
|
3283
3283
|
} catch (e) {
|
|
3284
|
-
if (
|
|
3284
|
+
if (_s(e)) {
|
|
3285
3285
|
console.warn(
|
|
3286
3286
|
"project refresh routine terminated, because project was externally deleted"
|
|
3287
3287
|
);
|
|
3288
3288
|
break;
|
|
3289
|
-
} else if (!
|
|
3289
|
+
} else if (!Ks(e))
|
|
3290
3290
|
throw new Error("Unexpected exception", { cause: e });
|
|
3291
3291
|
}
|
|
3292
3292
|
}
|
|
@@ -3302,12 +3302,12 @@ class Nt {
|
|
|
3302
3302
|
* @return returns newly created block id
|
|
3303
3303
|
* */
|
|
3304
3304
|
async addBlock(e, t, r, o = void 0, n = Te()) {
|
|
3305
|
-
const i = await this.env.bpPreparer.prepare(t), a = await this.env.bpPreparer.getBlockConfigContainer(t), c =
|
|
3306
|
-
return await
|
|
3305
|
+
const i = await this.env.bpPreparer.prepare(t), a = await this.env.bpPreparer.getBlockConfigContainer(t), c = Vr(a);
|
|
3306
|
+
return await Q(
|
|
3307
3307
|
this.env.pl,
|
|
3308
3308
|
this.rid,
|
|
3309
3309
|
o,
|
|
3310
|
-
(
|
|
3310
|
+
(u) => u.addBlock(
|
|
3311
3311
|
{
|
|
3312
3312
|
id: n,
|
|
3313
3313
|
label: e,
|
|
@@ -3328,7 +3328,7 @@ class Nt {
|
|
|
3328
3328
|
* */
|
|
3329
3329
|
async updateBlockPack(e, t, r = !1, o) {
|
|
3330
3330
|
const n = await this.env.bpPreparer.prepare(t), i = await this.env.bpPreparer.getBlockConfigContainer(t);
|
|
3331
|
-
await
|
|
3331
|
+
await Q(
|
|
3332
3332
|
this.env.pl,
|
|
3333
3333
|
this.rid,
|
|
3334
3334
|
o,
|
|
@@ -3341,7 +3341,7 @@ class Nt {
|
|
|
3341
3341
|
}
|
|
3342
3342
|
/** Deletes a block with all associated data. */
|
|
3343
3343
|
async deleteBlock(e, t) {
|
|
3344
|
-
await
|
|
3344
|
+
await Q(this.env.pl, this.rid, t, (r) => r.deleteBlock(e)), this.navigationStates.deleteBlock(e), await this.projectTree.refreshState();
|
|
3345
3345
|
}
|
|
3346
3346
|
/**
|
|
3347
3347
|
* Updates block order according to the given array of block ids.
|
|
@@ -3350,7 +3350,7 @@ class Nt {
|
|
|
3350
3350
|
* an error will be thrown instead.
|
|
3351
3351
|
*/
|
|
3352
3352
|
async reorderBlocks(e, t) {
|
|
3353
|
-
await
|
|
3353
|
+
await Q(this.env.pl, this.rid, t, (r) => {
|
|
3354
3354
|
const o = r.structure;
|
|
3355
3355
|
if (o.groups.length !== 1)
|
|
3356
3356
|
throw new Error("Unexpected project structure, non-sinular block group");
|
|
@@ -3364,7 +3364,7 @@ class Nt {
|
|
|
3364
3364
|
id: n.id,
|
|
3365
3365
|
label: n.label,
|
|
3366
3366
|
blocks: e.map((a) => {
|
|
3367
|
-
const c = n.blocks.find((
|
|
3367
|
+
const c = n.blocks.find((u) => u.id === a);
|
|
3368
3368
|
if (c === void 0) throw new Error(`Can't find block: ${a}`);
|
|
3369
3369
|
return c;
|
|
3370
3370
|
})
|
|
@@ -3404,7 +3404,7 @@ class Nt {
|
|
|
3404
3404
|
* in collaborative editing scenario.
|
|
3405
3405
|
* */
|
|
3406
3406
|
async setBlockArgs(e, t, r) {
|
|
3407
|
-
await
|
|
3407
|
+
await Q(
|
|
3408
3408
|
this.env.pl,
|
|
3409
3409
|
this.rid,
|
|
3410
3410
|
r,
|
|
@@ -3418,7 +3418,7 @@ class Nt {
|
|
|
3418
3418
|
* in collaborative editing scenario.
|
|
3419
3419
|
* */
|
|
3420
3420
|
async setUiState(e, t, r) {
|
|
3421
|
-
await
|
|
3421
|
+
await Q(
|
|
3422
3422
|
this.env.pl,
|
|
3423
3423
|
this.rid,
|
|
3424
3424
|
r,
|
|
@@ -3438,27 +3438,27 @@ class Nt {
|
|
|
3438
3438
|
* in collaborative editing scenario.
|
|
3439
3439
|
* */
|
|
3440
3440
|
async setBlockArgsAndUiState(e, t, r, o) {
|
|
3441
|
-
await
|
|
3441
|
+
await Q(this.env.pl, this.rid, o, (n) => {
|
|
3442
3442
|
n.setArgs([{ blockId: e, args: JSON.stringify(t) }]), n.setUiState(e, JSON.stringify(r));
|
|
3443
3443
|
}), await this.projectTree.refreshState();
|
|
3444
3444
|
}
|
|
3445
3445
|
/** Update block settings */
|
|
3446
3446
|
async setBlockSettings(e, t) {
|
|
3447
|
-
await
|
|
3447
|
+
await Q(this.env.pl, this.rid, void 0, (r) => {
|
|
3448
3448
|
r.setBlockSettings(e, t);
|
|
3449
3449
|
}), await this.projectTree.refreshState();
|
|
3450
3450
|
}
|
|
3451
3451
|
/** Resets arguments and ui state of the block to initial state */
|
|
3452
3452
|
async resetBlockArgsAndUiState(e, t) {
|
|
3453
3453
|
await this.env.pl.withWriteTx("BlockInputsReset", async (r) => {
|
|
3454
|
-
const o =
|
|
3455
|
-
(await r.getField(x(this.rid,
|
|
3456
|
-
), n =
|
|
3454
|
+
const o = yt(
|
|
3455
|
+
(await r.getField(x(this.rid, U(e, "blockPack")))).value
|
|
3456
|
+
), n = yt(
|
|
3457
3457
|
(await r.getField(x(o, A.HolderRefField))).value
|
|
3458
3458
|
), i = await r.getResourceData(n, !1), a = JSON.parse(
|
|
3459
3459
|
Buffer.from(B(i.data)).toString("utf-8")
|
|
3460
3460
|
);
|
|
3461
|
-
await
|
|
3461
|
+
await Q(r, this.rid, t, (c) => {
|
|
3462
3462
|
c.setArgs([{ blockId: e, args: JSON.stringify(a.config.initialArgs) }]), c.setUiState(e, void 0);
|
|
3463
3463
|
}), await r.commit();
|
|
3464
3464
|
}), await this.projectTree.refreshState();
|
|
@@ -3466,10 +3466,10 @@ class Nt {
|
|
|
3466
3466
|
getBlockComputables(e) {
|
|
3467
3467
|
const t = this.blockComputables.get(e);
|
|
3468
3468
|
if (t === void 0) {
|
|
3469
|
-
const r =
|
|
3470
|
-
fullState:
|
|
3469
|
+
const r = pi(this.projectTree.entry(), e, this.env), n = {
|
|
3470
|
+
fullState: J.make(
|
|
3471
3471
|
(i) => ({
|
|
3472
|
-
argsAndUiState:
|
|
3472
|
+
argsAndUiState: hs(this.projectTree.entry(), e, i),
|
|
3473
3473
|
outputs: r,
|
|
3474
3474
|
navigationState: this.navigationStates.getState(e)
|
|
3475
3475
|
}),
|
|
@@ -3500,7 +3500,7 @@ class Nt {
|
|
|
3500
3500
|
getBlockFrontend(e) {
|
|
3501
3501
|
const t = this.blockFrontends.get(e);
|
|
3502
3502
|
if (t === void 0) {
|
|
3503
|
-
const r =
|
|
3503
|
+
const r = di(
|
|
3504
3504
|
this.projectTree.entry(),
|
|
3505
3505
|
e,
|
|
3506
3506
|
this.env
|
|
@@ -3522,19 +3522,19 @@ class Nt {
|
|
|
3522
3522
|
static async init(e, t) {
|
|
3523
3523
|
await Me(e.pl, t, (o) => {
|
|
3524
3524
|
});
|
|
3525
|
-
const r = await
|
|
3525
|
+
const r = await _r.init(
|
|
3526
3526
|
e.pl,
|
|
3527
3527
|
t,
|
|
3528
3528
|
{
|
|
3529
3529
|
...e.ops.defaultTreeOptions,
|
|
3530
|
-
pruning:
|
|
3530
|
+
pruning: gi
|
|
3531
3531
|
},
|
|
3532
3532
|
e.logger
|
|
3533
3533
|
);
|
|
3534
|
-
return new
|
|
3534
|
+
return new Bt(e, t, r);
|
|
3535
3535
|
}
|
|
3536
3536
|
}
|
|
3537
|
-
function
|
|
3537
|
+
function gi(s) {
|
|
3538
3538
|
switch (s.type.name) {
|
|
3539
3539
|
case "BlockPackCustom":
|
|
3540
3540
|
return s.fields.filter((e) => e.name !== "template");
|
|
@@ -3546,8 +3546,8 @@ function fi(s) {
|
|
|
3546
3546
|
return s.fields;
|
|
3547
3547
|
}
|
|
3548
3548
|
}
|
|
3549
|
-
const
|
|
3550
|
-
logger: new
|
|
3549
|
+
const fs = {
|
|
3550
|
+
logger: new xs(),
|
|
3551
3551
|
blobDriverOps: {
|
|
3552
3552
|
cacheSoftSizeBytes: 100 * 1024 * 1024,
|
|
3553
3553
|
// 100MB
|
|
@@ -3570,14 +3570,14 @@ const hs = {
|
|
|
3570
3570
|
stopPollingDelay: 1e3
|
|
3571
3571
|
}
|
|
3572
3572
|
};
|
|
3573
|
-
function
|
|
3573
|
+
function gs(s) {
|
|
3574
3574
|
return {
|
|
3575
|
-
blobDownloadPath:
|
|
3576
|
-
downloadBlobToURLPath:
|
|
3575
|
+
blobDownloadPath: _.join(s, "download"),
|
|
3576
|
+
downloadBlobToURLPath: _.join(s, "downloadToURL")
|
|
3577
3577
|
};
|
|
3578
3578
|
}
|
|
3579
|
-
const
|
|
3580
|
-
...
|
|
3579
|
+
const mi = {
|
|
3580
|
+
...fs,
|
|
3581
3581
|
defaultTreeOptions: {
|
|
3582
3582
|
pollingInterval: 350,
|
|
3583
3583
|
stopPollingDelay: 2500
|
|
@@ -3586,18 +3586,18 @@ const gi = {
|
|
|
3586
3586
|
projectRefreshInterval: 700,
|
|
3587
3587
|
stagingRenderingRate: 5
|
|
3588
3588
|
};
|
|
3589
|
-
function
|
|
3589
|
+
function vi(s) {
|
|
3590
3590
|
return {
|
|
3591
|
-
...
|
|
3592
|
-
frontendDownloadPath:
|
|
3591
|
+
...gs(s),
|
|
3592
|
+
frontendDownloadPath: _.join(s, "frontend")
|
|
3593
3593
|
};
|
|
3594
3594
|
}
|
|
3595
|
-
function
|
|
3595
|
+
function yi(s) {
|
|
3596
3596
|
return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
|
|
3597
3597
|
}
|
|
3598
|
-
var
|
|
3599
|
-
const
|
|
3600
|
-
9007199254740991,
|
|
3598
|
+
var Ot = { exports: {} };
|
|
3599
|
+
const Si = "2.0.0", ms = 256, wi = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
3600
|
+
9007199254740991, bi = 16, Ri = ms - 6, Ei = [
|
|
3601
3601
|
"major",
|
|
3602
3602
|
"premajor",
|
|
3603
3603
|
"minor",
|
|
@@ -3606,68 +3606,68 @@ const yi = "2.0.0", gs = 256, Si = Number.MAX_SAFE_INTEGER || /* istanbul ignore
|
|
|
3606
3606
|
"prepatch",
|
|
3607
3607
|
"prerelease"
|
|
3608
3608
|
];
|
|
3609
|
-
var
|
|
3610
|
-
MAX_LENGTH:
|
|
3611
|
-
MAX_SAFE_COMPONENT_LENGTH:
|
|
3612
|
-
MAX_SAFE_BUILD_LENGTH:
|
|
3613
|
-
MAX_SAFE_INTEGER:
|
|
3614
|
-
RELEASE_TYPES:
|
|
3615
|
-
SEMVER_SPEC_VERSION:
|
|
3609
|
+
var st = {
|
|
3610
|
+
MAX_LENGTH: ms,
|
|
3611
|
+
MAX_SAFE_COMPONENT_LENGTH: bi,
|
|
3612
|
+
MAX_SAFE_BUILD_LENGTH: Ri,
|
|
3613
|
+
MAX_SAFE_INTEGER: wi,
|
|
3614
|
+
RELEASE_TYPES: Ei,
|
|
3615
|
+
SEMVER_SPEC_VERSION: Si,
|
|
3616
3616
|
FLAG_INCLUDE_PRERELEASE: 1,
|
|
3617
3617
|
FLAG_LOOSE: 2
|
|
3618
3618
|
};
|
|
3619
3619
|
const Ci = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...s) => console.error("SEMVER", ...s) : () => {
|
|
3620
3620
|
};
|
|
3621
|
-
var
|
|
3621
|
+
var ot = Ci;
|
|
3622
3622
|
(function(s, e) {
|
|
3623
3623
|
const {
|
|
3624
3624
|
MAX_SAFE_COMPONENT_LENGTH: t,
|
|
3625
3625
|
MAX_SAFE_BUILD_LENGTH: r,
|
|
3626
3626
|
MAX_LENGTH: o
|
|
3627
|
-
} =
|
|
3627
|
+
} = st, n = ot;
|
|
3628
3628
|
e = s.exports = {};
|
|
3629
|
-
const i = e.re = [], a = e.safeRe = [], c = e.src = [], l = e.t = {};
|
|
3630
|
-
let
|
|
3631
|
-
const
|
|
3629
|
+
const i = e.re = [], a = e.safeRe = [], c = e.src = [], u = e.safeSrc = [], l = e.t = {};
|
|
3630
|
+
let d = 0;
|
|
3631
|
+
const f = "[a-zA-Z0-9-]", h = [
|
|
3632
3632
|
["\\s", 1],
|
|
3633
3633
|
["\\d", o],
|
|
3634
|
-
[
|
|
3635
|
-
],
|
|
3636
|
-
for (const [T,
|
|
3637
|
-
|
|
3638
|
-
return
|
|
3639
|
-
},
|
|
3640
|
-
const
|
|
3641
|
-
n(
|
|
3634
|
+
[f, r]
|
|
3635
|
+
], E = (D) => {
|
|
3636
|
+
for (const [T, j] of h)
|
|
3637
|
+
D = D.split(`${T}*`).join(`${T}{0,${j}}`).split(`${T}+`).join(`${T}{1,${j}}`);
|
|
3638
|
+
return D;
|
|
3639
|
+
}, g = (D, T, j) => {
|
|
3640
|
+
const $ = E(T), G = d++;
|
|
3641
|
+
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);
|
|
3642
3642
|
};
|
|
3643
|
-
|
|
3644
|
-
})(
|
|
3645
|
-
var xe =
|
|
3646
|
-
const Pi = Object.freeze({ loose: !0 }),
|
|
3647
|
-
var
|
|
3648
|
-
const
|
|
3649
|
-
const t =
|
|
3643
|
+
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*$");
|
|
3644
|
+
})(Ot, Ot.exports);
|
|
3645
|
+
var xe = Ot.exports;
|
|
3646
|
+
const Pi = Object.freeze({ loose: !0 }), ki = Object.freeze({}), Oi = (s) => s ? typeof s != "object" ? Pi : s : ki;
|
|
3647
|
+
var xt = Oi;
|
|
3648
|
+
const fr = /^[0-9]+$/, vs = (s, e) => {
|
|
3649
|
+
const t = fr.test(s), r = fr.test(e);
|
|
3650
3650
|
return t && r && (s = +s, e = +e), s === e ? 0 : t && !r ? -1 : r && !t ? 1 : s < e ? -1 : 1;
|
|
3651
|
-
},
|
|
3652
|
-
var
|
|
3653
|
-
compareIdentifiers:
|
|
3654
|
-
rcompareIdentifiers:
|
|
3651
|
+
}, $i = (s, e) => vs(e, s);
|
|
3652
|
+
var ys = {
|
|
3653
|
+
compareIdentifiers: vs,
|
|
3654
|
+
rcompareIdentifiers: $i
|
|
3655
3655
|
};
|
|
3656
|
-
const Ke =
|
|
3657
|
-
let
|
|
3656
|
+
const Ke = ot, { MAX_LENGTH: gr, MAX_SAFE_INTEGER: He } = st, { safeRe: mr, safeSrc: vr, t: We } = xe, Fi = xt, { compareIdentifiers: ve } = ys;
|
|
3657
|
+
let Ii = class re {
|
|
3658
3658
|
constructor(e, t) {
|
|
3659
|
-
if (t =
|
|
3659
|
+
if (t = Fi(t), e instanceof re) {
|
|
3660
3660
|
if (e.loose === !!t.loose && e.includePrerelease === !!t.includePrerelease)
|
|
3661
3661
|
return e;
|
|
3662
3662
|
e = e.version;
|
|
3663
3663
|
} else if (typeof e != "string")
|
|
3664
3664
|
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);
|
|
3665
|
-
if (e.length >
|
|
3665
|
+
if (e.length > gr)
|
|
3666
3666
|
throw new TypeError(
|
|
3667
|
-
`version is longer than ${
|
|
3667
|
+
`version is longer than ${gr} characters`
|
|
3668
3668
|
);
|
|
3669
3669
|
Ke("SemVer", e, t), this.options = t, this.loose = !!t.loose, this.includePrerelease = !!t.includePrerelease;
|
|
3670
|
-
const r = e.trim().match(t.loose ?
|
|
3670
|
+
const r = e.trim().match(t.loose ? mr[We.LOOSE] : mr[We.FULL]);
|
|
3671
3671
|
if (!r)
|
|
3672
3672
|
throw new TypeError(`Invalid Version: ${e}`);
|
|
3673
3673
|
if (this.raw = e, this.major = +r[1], this.minor = +r[2], this.patch = +r[3], this.major > He || this.major < 0)
|
|
@@ -3692,18 +3692,18 @@ let Fi = class te {
|
|
|
3692
3692
|
return this.version;
|
|
3693
3693
|
}
|
|
3694
3694
|
compare(e) {
|
|
3695
|
-
if (Ke("SemVer.compare", this.version, this.options, e), !(e instanceof
|
|
3695
|
+
if (Ke("SemVer.compare", this.version, this.options, e), !(e instanceof re)) {
|
|
3696
3696
|
if (typeof e == "string" && e === this.version)
|
|
3697
3697
|
return 0;
|
|
3698
|
-
e = new
|
|
3698
|
+
e = new re(e, this.options);
|
|
3699
3699
|
}
|
|
3700
3700
|
return e.version === this.version ? 0 : this.compareMain(e) || this.comparePre(e);
|
|
3701
3701
|
}
|
|
3702
3702
|
compareMain(e) {
|
|
3703
|
-
return e instanceof
|
|
3703
|
+
return e instanceof re || (e = new re(e, this.options)), ve(this.major, e.major) || ve(this.minor, e.minor) || ve(this.patch, e.patch);
|
|
3704
3704
|
}
|
|
3705
3705
|
comparePre(e) {
|
|
3706
|
-
if (e instanceof
|
|
3706
|
+
if (e instanceof re || (e = new re(e, this.options)), this.prerelease.length && !e.prerelease.length)
|
|
3707
3707
|
return -1;
|
|
3708
3708
|
if (!this.prerelease.length && e.prerelease.length)
|
|
3709
3709
|
return 1;
|
|
@@ -3724,7 +3724,7 @@ let Fi = class te {
|
|
|
3724
3724
|
} while (++t);
|
|
3725
3725
|
}
|
|
3726
3726
|
compareBuild(e) {
|
|
3727
|
-
e instanceof
|
|
3727
|
+
e instanceof re || (e = new re(e, this.options));
|
|
3728
3728
|
let t = 0;
|
|
3729
3729
|
do {
|
|
3730
3730
|
const r = this.build[t], o = e.build[t];
|
|
@@ -3742,6 +3742,15 @@ let Fi = class te {
|
|
|
3742
3742
|
// preminor will bump the version up to the next minor release, and immediately
|
|
3743
3743
|
// down to pre-release. premajor and prepatch work the same way.
|
|
3744
3744
|
inc(e, t, r) {
|
|
3745
|
+
if (e.startsWith("pre")) {
|
|
3746
|
+
if (!t && r === !1)
|
|
3747
|
+
throw new Error("invalid increment argument: identifier is empty");
|
|
3748
|
+
if (t) {
|
|
3749
|
+
const o = new RegExp(`^${this.options.loose ? vr[We.PRERELEASELOOSE] : vr[We.PRERELEASE]}$`), n = `-${t}`.match(o);
|
|
3750
|
+
if (!n || n[1] !== t)
|
|
3751
|
+
throw new Error(`invalid identifier: ${t}`);
|
|
3752
|
+
}
|
|
3753
|
+
}
|
|
3745
3754
|
switch (e) {
|
|
3746
3755
|
case "premajor":
|
|
3747
3756
|
this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", t, r);
|
|
@@ -3755,6 +3764,11 @@ let Fi = class te {
|
|
|
3755
3764
|
case "prerelease":
|
|
3756
3765
|
this.prerelease.length === 0 && this.inc("patch", t, r), this.inc("pre", t, r);
|
|
3757
3766
|
break;
|
|
3767
|
+
case "release":
|
|
3768
|
+
if (this.prerelease.length === 0)
|
|
3769
|
+
throw new Error(`version ${this.raw} is not a prerelease`);
|
|
3770
|
+
this.prerelease.length = 0;
|
|
3771
|
+
break;
|
|
3758
3772
|
case "major":
|
|
3759
3773
|
(this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) && this.major++, this.minor = 0, this.patch = 0, this.prerelease = [];
|
|
3760
3774
|
break;
|
|
@@ -3766,8 +3780,6 @@ let Fi = class te {
|
|
|
3766
3780
|
break;
|
|
3767
3781
|
case "pre": {
|
|
3768
3782
|
const o = Number(r) ? 1 : 0;
|
|
3769
|
-
if (!t && r === !1)
|
|
3770
|
-
throw new Error("invalid increment argument: identifier is empty");
|
|
3771
3783
|
if (this.prerelease.length === 0)
|
|
3772
3784
|
this.prerelease = [o];
|
|
3773
3785
|
else {
|
|
@@ -3792,91 +3804,95 @@ let Fi = class te {
|
|
|
3792
3804
|
return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
|
|
3793
3805
|
}
|
|
3794
3806
|
};
|
|
3795
|
-
var
|
|
3796
|
-
const
|
|
3797
|
-
if (s instanceof
|
|
3807
|
+
var H = Ii;
|
|
3808
|
+
const yr = H, Ai = (s, e, t = !1) => {
|
|
3809
|
+
if (s instanceof yr)
|
|
3798
3810
|
return s;
|
|
3799
3811
|
try {
|
|
3800
|
-
return new
|
|
3812
|
+
return new yr(s, e);
|
|
3801
3813
|
} catch (r) {
|
|
3802
3814
|
if (!t)
|
|
3803
3815
|
return null;
|
|
3804
3816
|
throw r;
|
|
3805
3817
|
}
|
|
3806
3818
|
};
|
|
3807
|
-
var be =
|
|
3808
|
-
const
|
|
3809
|
-
const t =
|
|
3819
|
+
var be = Ai;
|
|
3820
|
+
const Ti = be, Li = (s, e) => {
|
|
3821
|
+
const t = Ti(s, e);
|
|
3810
3822
|
return t ? t.version : null;
|
|
3811
3823
|
};
|
|
3812
|
-
var
|
|
3813
|
-
const
|
|
3814
|
-
const t =
|
|
3824
|
+
var Di = Li;
|
|
3825
|
+
const Ni = be, Bi = (s, e) => {
|
|
3826
|
+
const t = Ni(s.trim().replace(/^[=v]+/, ""), e);
|
|
3815
3827
|
return t ? t.version : null;
|
|
3816
3828
|
};
|
|
3817
|
-
var
|
|
3818
|
-
const
|
|
3829
|
+
var xi = Bi;
|
|
3830
|
+
const Sr = H, ji = (s, e, t, r, o) => {
|
|
3819
3831
|
typeof t == "string" && (o = r, r = t, t = void 0);
|
|
3820
3832
|
try {
|
|
3821
|
-
return new
|
|
3822
|
-
s instanceof
|
|
3833
|
+
return new Sr(
|
|
3834
|
+
s instanceof Sr ? s.version : s,
|
|
3823
3835
|
t
|
|
3824
3836
|
).inc(e, r, o).version;
|
|
3825
3837
|
} catch {
|
|
3826
3838
|
return null;
|
|
3827
3839
|
}
|
|
3828
3840
|
};
|
|
3829
|
-
var
|
|
3830
|
-
const
|
|
3831
|
-
const t =
|
|
3841
|
+
var Vi = ji;
|
|
3842
|
+
const wr = be, Ui = (s, e) => {
|
|
3843
|
+
const t = wr(s, null, !0), r = wr(e, null, !0), o = t.compare(r);
|
|
3832
3844
|
if (o === 0)
|
|
3833
3845
|
return null;
|
|
3834
3846
|
const n = o > 0, i = n ? t : r, a = n ? r : t, c = !!i.prerelease.length;
|
|
3835
|
-
if (!!a.prerelease.length && !c)
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3847
|
+
if (!!a.prerelease.length && !c) {
|
|
3848
|
+
if (!a.patch && !a.minor)
|
|
3849
|
+
return "major";
|
|
3850
|
+
if (a.compareMain(i) === 0)
|
|
3851
|
+
return a.minor && !a.patch ? "minor" : "patch";
|
|
3852
|
+
}
|
|
3853
|
+
const l = c ? "pre" : "";
|
|
3854
|
+
return t.major !== r.major ? l + "major" : t.minor !== r.minor ? l + "minor" : t.patch !== r.patch ? l + "patch" : "prerelease";
|
|
3839
3855
|
};
|
|
3840
|
-
var
|
|
3841
|
-
const
|
|
3842
|
-
var
|
|
3843
|
-
const
|
|
3844
|
-
var
|
|
3845
|
-
const
|
|
3846
|
-
var
|
|
3847
|
-
const
|
|
3848
|
-
const t =
|
|
3856
|
+
var Ji = Ui;
|
|
3857
|
+
const Gi = H, Mi = (s, e) => new Gi(s, e).major;
|
|
3858
|
+
var _i = Mi;
|
|
3859
|
+
const Ki = H, Hi = (s, e) => new Ki(s, e).minor;
|
|
3860
|
+
var Wi = Hi;
|
|
3861
|
+
const zi = H, qi = (s, e) => new zi(s, e).patch;
|
|
3862
|
+
var Xi = qi;
|
|
3863
|
+
const Yi = be, Qi = (s, e) => {
|
|
3864
|
+
const t = Yi(s, e);
|
|
3849
3865
|
return t && t.prerelease.length ? t.prerelease : null;
|
|
3850
3866
|
};
|
|
3851
|
-
var
|
|
3852
|
-
const
|
|
3853
|
-
var
|
|
3854
|
-
const
|
|
3855
|
-
var
|
|
3856
|
-
const
|
|
3857
|
-
var
|
|
3858
|
-
const
|
|
3859
|
-
const r = new
|
|
3867
|
+
var Zi = Qi;
|
|
3868
|
+
const br = H, ea = (s, e, t) => new br(s, t).compare(new br(e, t));
|
|
3869
|
+
var ee = ea;
|
|
3870
|
+
const ta = ee, ra = (s, e, t) => ta(e, s, t);
|
|
3871
|
+
var sa = ra;
|
|
3872
|
+
const oa = ee, na = (s, e) => oa(s, e, !0);
|
|
3873
|
+
var ia = na;
|
|
3874
|
+
const Rr = H, aa = (s, e, t) => {
|
|
3875
|
+
const r = new Rr(s, t), o = new Rr(e, t);
|
|
3860
3876
|
return r.compare(o) || r.compareBuild(o);
|
|
3861
3877
|
};
|
|
3862
|
-
var
|
|
3863
|
-
const
|
|
3864
|
-
var
|
|
3865
|
-
const
|
|
3866
|
-
var
|
|
3867
|
-
const
|
|
3868
|
-
var
|
|
3869
|
-
const
|
|
3870
|
-
var
|
|
3871
|
-
const
|
|
3872
|
-
var
|
|
3873
|
-
const
|
|
3874
|
-
var
|
|
3875
|
-
const
|
|
3876
|
-
var
|
|
3877
|
-
const Ca =
|
|
3878
|
-
var
|
|
3879
|
-
const
|
|
3878
|
+
var jt = aa;
|
|
3879
|
+
const ca = jt, la = (s, e) => s.sort((t, r) => ca(t, r, e));
|
|
3880
|
+
var ua = la;
|
|
3881
|
+
const da = jt, pa = (s, e) => s.sort((t, r) => da(r, t, e));
|
|
3882
|
+
var ha = pa;
|
|
3883
|
+
const fa = ee, ga = (s, e, t) => fa(s, e, t) > 0;
|
|
3884
|
+
var nt = ga;
|
|
3885
|
+
const ma = ee, va = (s, e, t) => ma(s, e, t) < 0;
|
|
3886
|
+
var Vt = va;
|
|
3887
|
+
const ya = ee, Sa = (s, e, t) => ya(s, e, t) === 0;
|
|
3888
|
+
var Ss = Sa;
|
|
3889
|
+
const wa = ee, ba = (s, e, t) => wa(s, e, t) !== 0;
|
|
3890
|
+
var ws = ba;
|
|
3891
|
+
const Ra = ee, Ea = (s, e, t) => Ra(s, e, t) >= 0;
|
|
3892
|
+
var Ut = Ea;
|
|
3893
|
+
const Ca = ee, Pa = (s, e, t) => Ca(s, e, t) <= 0;
|
|
3894
|
+
var Jt = Pa;
|
|
3895
|
+
const ka = Ss, Oa = ws, $a = nt, Fa = Ut, Ia = Vt, Aa = Jt, Ta = (s, e, t, r) => {
|
|
3880
3896
|
switch (e) {
|
|
3881
3897
|
case "===":
|
|
3882
3898
|
return typeof s == "object" && (s = s.version), typeof t == "object" && (t = t.version), s === t;
|
|
@@ -3885,45 +3901,45 @@ const Ea = ys, ka = Ss, Oa = ot, $a = Vt, Fa = jt, Ia = Ut, Aa = (s, e, t, r) =>
|
|
|
3885
3901
|
case "":
|
|
3886
3902
|
case "=":
|
|
3887
3903
|
case "==":
|
|
3888
|
-
return Ea(s, t, r);
|
|
3889
|
-
case "!=":
|
|
3890
3904
|
return ka(s, t, r);
|
|
3891
|
-
case "
|
|
3905
|
+
case "!=":
|
|
3892
3906
|
return Oa(s, t, r);
|
|
3893
|
-
case "
|
|
3907
|
+
case ">":
|
|
3894
3908
|
return $a(s, t, r);
|
|
3895
|
-
case "
|
|
3909
|
+
case ">=":
|
|
3896
3910
|
return Fa(s, t, r);
|
|
3897
|
-
case "
|
|
3911
|
+
case "<":
|
|
3898
3912
|
return Ia(s, t, r);
|
|
3913
|
+
case "<=":
|
|
3914
|
+
return Aa(s, t, r);
|
|
3899
3915
|
default:
|
|
3900
3916
|
throw new TypeError(`Invalid operator: ${e}`);
|
|
3901
3917
|
}
|
|
3902
3918
|
};
|
|
3903
|
-
var
|
|
3904
|
-
const
|
|
3905
|
-
if (s instanceof
|
|
3919
|
+
var bs = Ta;
|
|
3920
|
+
const La = H, Da = be, { safeRe: ze, t: qe } = xe, Na = (s, e) => {
|
|
3921
|
+
if (s instanceof La)
|
|
3906
3922
|
return s;
|
|
3907
3923
|
if (typeof s == "number" && (s = String(s)), typeof s != "string")
|
|
3908
3924
|
return null;
|
|
3909
3925
|
e = e || {};
|
|
3910
3926
|
let t = null;
|
|
3911
3927
|
if (!e.rtl)
|
|
3912
|
-
t = s.match(e.includePrerelease ?
|
|
3928
|
+
t = s.match(e.includePrerelease ? ze[qe.COERCEFULL] : ze[qe.COERCE]);
|
|
3913
3929
|
else {
|
|
3914
|
-
const c = e.includePrerelease ?
|
|
3915
|
-
let
|
|
3916
|
-
for (; (
|
|
3917
|
-
(!t ||
|
|
3930
|
+
const c = e.includePrerelease ? ze[qe.COERCERTLFULL] : ze[qe.COERCERTL];
|
|
3931
|
+
let u;
|
|
3932
|
+
for (; (u = c.exec(s)) && (!t || t.index + t[0].length !== s.length); )
|
|
3933
|
+
(!t || u.index + u[0].length !== t.index + t[0].length) && (t = u), c.lastIndex = u.index + u[1].length + u[2].length;
|
|
3918
3934
|
c.lastIndex = -1;
|
|
3919
3935
|
}
|
|
3920
3936
|
if (t === null)
|
|
3921
3937
|
return null;
|
|
3922
3938
|
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]}` : "";
|
|
3923
|
-
return
|
|
3939
|
+
return Da(`${r}.${o}.${n}${i}${a}`, e);
|
|
3924
3940
|
};
|
|
3925
|
-
var
|
|
3926
|
-
class
|
|
3941
|
+
var Ba = Na;
|
|
3942
|
+
class xa {
|
|
3927
3943
|
constructor() {
|
|
3928
3944
|
this.max = 1e3, this.map = /* @__PURE__ */ new Map();
|
|
3929
3945
|
}
|
|
@@ -3946,10 +3962,10 @@ class Ba {
|
|
|
3946
3962
|
return this;
|
|
3947
3963
|
}
|
|
3948
3964
|
}
|
|
3949
|
-
var
|
|
3950
|
-
function
|
|
3951
|
-
if (
|
|
3952
|
-
|
|
3965
|
+
var ja = xa, dt, Er;
|
|
3966
|
+
function te() {
|
|
3967
|
+
if (Er) return dt;
|
|
3968
|
+
Er = 1;
|
|
3953
3969
|
const s = /\s+/g;
|
|
3954
3970
|
class e {
|
|
3955
3971
|
constructor(p, m) {
|
|
@@ -3961,11 +3977,11 @@ function ee() {
|
|
|
3961
3977
|
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
3962
3978
|
if (this.set.length > 1) {
|
|
3963
3979
|
const y = this.set[0];
|
|
3964
|
-
if (this.set = this.set.filter((b) => !
|
|
3980
|
+
if (this.set = this.set.filter((b) => !g(b[0])), this.set.length === 0)
|
|
3965
3981
|
this.set = [y];
|
|
3966
3982
|
else if (this.set.length > 1) {
|
|
3967
3983
|
for (const b of this.set)
|
|
3968
|
-
if (b.length === 1 &&
|
|
3984
|
+
if (b.length === 1 && D(b[0])) {
|
|
3969
3985
|
this.set = [b];
|
|
3970
3986
|
break;
|
|
3971
3987
|
}
|
|
@@ -3992,16 +4008,16 @@ function ee() {
|
|
|
3992
4008
|
return this.range;
|
|
3993
4009
|
}
|
|
3994
4010
|
parseRange(p) {
|
|
3995
|
-
const y = ((this.options.includePrerelease &&
|
|
4011
|
+
const y = ((this.options.includePrerelease && h) | (this.options.loose && E)) + ":" + p, b = r.get(y);
|
|
3996
4012
|
if (b)
|
|
3997
4013
|
return b;
|
|
3998
|
-
const S = this.options.loose, R = S ? c[
|
|
3999
|
-
p = p.replace(R,
|
|
4000
|
-
let
|
|
4001
|
-
S && (
|
|
4002
|
-
const C = /* @__PURE__ */ new Map(), I =
|
|
4014
|
+
const S = this.options.loose, R = S ? c[u.HYPHENRANGELOOSE] : c[u.HYPHENRANGE];
|
|
4015
|
+
p = p.replace(R, X(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);
|
|
4016
|
+
let O = p.split(" ").map((F) => j(F, this.options)).join(" ").split(/\s+/).map((F) => V(F, this.options));
|
|
4017
|
+
S && (O = O.filter((F) => (i("loose invalid filter", F, this.options), !!F.match(c[u.COMPARATORLOOSE])))), i("range list", O);
|
|
4018
|
+
const C = /* @__PURE__ */ new Map(), I = O.map((F) => new n(F, this.options));
|
|
4003
4019
|
for (const F of I) {
|
|
4004
|
-
if (
|
|
4020
|
+
if (g(F))
|
|
4005
4021
|
return [F];
|
|
4006
4022
|
C.set(F.value, F);
|
|
4007
4023
|
}
|
|
@@ -4012,7 +4028,7 @@ function ee() {
|
|
|
4012
4028
|
intersects(p, m) {
|
|
4013
4029
|
if (!(p instanceof e))
|
|
4014
4030
|
throw new TypeError("a Range is required");
|
|
4015
|
-
return this.set.some((y) =>
|
|
4031
|
+
return this.set.some((y) => T(y, m) && p.set.some((b) => T(b, m) && y.every((S) => b.every((R) => S.intersects(R, m)))));
|
|
4016
4032
|
}
|
|
4017
4033
|
// if ANY of the sets match ALL of its comparators, then pass
|
|
4018
4034
|
test(p) {
|
|
@@ -4030,44 +4046,44 @@ function ee() {
|
|
|
4030
4046
|
return !1;
|
|
4031
4047
|
}
|
|
4032
4048
|
}
|
|
4033
|
-
|
|
4034
|
-
const t =
|
|
4049
|
+
dt = e;
|
|
4050
|
+
const t = ja, r = new t(), o = xt, n = it(), i = ot, a = H, {
|
|
4035
4051
|
safeRe: c,
|
|
4036
|
-
t:
|
|
4037
|
-
comparatorTrimReplace:
|
|
4052
|
+
t: u,
|
|
4053
|
+
comparatorTrimReplace: l,
|
|
4038
4054
|
tildeTrimReplace: d,
|
|
4039
|
-
caretTrimReplace:
|
|
4040
|
-
} = xe, { FLAG_INCLUDE_PRERELEASE:
|
|
4055
|
+
caretTrimReplace: f
|
|
4056
|
+
} = xe, { FLAG_INCLUDE_PRERELEASE: h, FLAG_LOOSE: E } = st, g = (v) => v.value === "<0.0.0-0", D = (v) => v.value === "", T = (v, p) => {
|
|
4041
4057
|
let m = !0;
|
|
4042
4058
|
const y = v.slice();
|
|
4043
4059
|
let b = y.pop();
|
|
4044
4060
|
for (; m && y.length; )
|
|
4045
4061
|
m = y.every((S) => b.intersects(S, p)), b = y.pop();
|
|
4046
4062
|
return m;
|
|
4047
|
-
},
|
|
4048
|
-
const m = p.loose ? c[
|
|
4049
|
-
return v.replace(m, (y, b, S, R,
|
|
4050
|
-
i("tilde", v, y, b, S, R,
|
|
4063
|
+
}, 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) => ge(m, p)).join(" "), ge = (v, p) => {
|
|
4064
|
+
const m = p.loose ? c[u.TILDELOOSE] : c[u.TILDE];
|
|
4065
|
+
return v.replace(m, (y, b, S, R, O) => {
|
|
4066
|
+
i("tilde", v, y, b, S, R, O);
|
|
4051
4067
|
let C;
|
|
4052
|
-
return
|
|
4068
|
+
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;
|
|
4053
4069
|
});
|
|
4054
|
-
}, L = (v, p) => v.trim().split(/\s+/).map((m) =>
|
|
4070
|
+
}, L = (v, p) => v.trim().split(/\s+/).map((m) => q(m, p)).join(" "), q = (v, p) => {
|
|
4055
4071
|
i("caret", v, p);
|
|
4056
|
-
const m = p.loose ? c[
|
|
4057
|
-
return v.replace(m, (b, S, R,
|
|
4058
|
-
i("caret", v, b, S, R,
|
|
4072
|
+
const m = p.loose ? c[u.CARETLOOSE] : c[u.CARET], y = p.includePrerelease ? "-0" : "";
|
|
4073
|
+
return v.replace(m, (b, S, R, O, C) => {
|
|
4074
|
+
i("caret", v, b, S, R, O, C);
|
|
4059
4075
|
let I;
|
|
4060
|
-
return
|
|
4076
|
+
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;
|
|
4061
4077
|
});
|
|
4062
|
-
}, ie = (v, p) => (i("replaceXRanges", v, p), v.split(/\s+/).map((m) =>
|
|
4078
|
+
}, ie = (v, p) => (i("replaceXRanges", v, p), v.split(/\s+/).map((m) => W(m, p)).join(" ")), W = (v, p) => {
|
|
4063
4079
|
v = v.trim();
|
|
4064
|
-
const m = p.loose ? c[
|
|
4065
|
-
return v.replace(m, (y, b, S, R,
|
|
4066
|
-
i("xRange", v, y, b, S, R,
|
|
4067
|
-
const I =
|
|
4068
|
-
return b === "=" &&
|
|
4080
|
+
const m = p.loose ? c[u.XRANGELOOSE] : c[u.XRANGE];
|
|
4081
|
+
return v.replace(m, (y, b, S, R, O, C) => {
|
|
4082
|
+
i("xRange", v, y, b, S, R, O, C);
|
|
4083
|
+
const I = $(S), N = I || $(R), F = N || $(O), ne = F;
|
|
4084
|
+
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;
|
|
4069
4085
|
});
|
|
4070
|
-
},
|
|
4086
|
+
}, 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], "")), X = (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()), me = (v, p, m) => {
|
|
4071
4087
|
for (let y = 0; y < v.length; y++)
|
|
4072
4088
|
if (!v[y].test(p))
|
|
4073
4089
|
return !1;
|
|
@@ -4082,101 +4098,101 @@ function ee() {
|
|
|
4082
4098
|
}
|
|
4083
4099
|
return !0;
|
|
4084
4100
|
};
|
|
4085
|
-
return
|
|
4101
|
+
return dt;
|
|
4086
4102
|
}
|
|
4087
|
-
var
|
|
4088
|
-
function
|
|
4089
|
-
if (Cr) return
|
|
4103
|
+
var pt, Cr;
|
|
4104
|
+
function it() {
|
|
4105
|
+
if (Cr) return pt;
|
|
4090
4106
|
Cr = 1;
|
|
4091
4107
|
const s = Symbol("SemVer ANY");
|
|
4092
4108
|
class e {
|
|
4093
4109
|
static get ANY() {
|
|
4094
4110
|
return s;
|
|
4095
4111
|
}
|
|
4096
|
-
constructor(
|
|
4097
|
-
if (d = t(d),
|
|
4098
|
-
if (
|
|
4099
|
-
return
|
|
4100
|
-
|
|
4112
|
+
constructor(l, d) {
|
|
4113
|
+
if (d = t(d), l instanceof e) {
|
|
4114
|
+
if (l.loose === !!d.loose)
|
|
4115
|
+
return l;
|
|
4116
|
+
l = l.value;
|
|
4101
4117
|
}
|
|
4102
|
-
|
|
4118
|
+
l = l.trim().split(/\s+/).join(" "), i("comparator", l, d), this.options = d, this.loose = !!d.loose, this.parse(l), this.semver === s ? this.value = "" : this.value = this.operator + this.semver.version, i("comp", this);
|
|
4103
4119
|
}
|
|
4104
|
-
parse(
|
|
4105
|
-
const d = this.options.loose ? r[o.COMPARATORLOOSE] : r[o.COMPARATOR],
|
|
4106
|
-
if (!
|
|
4107
|
-
throw new TypeError(`Invalid comparator: ${
|
|
4108
|
-
this.operator =
|
|
4120
|
+
parse(l) {
|
|
4121
|
+
const d = this.options.loose ? r[o.COMPARATORLOOSE] : r[o.COMPARATOR], f = l.match(d);
|
|
4122
|
+
if (!f)
|
|
4123
|
+
throw new TypeError(`Invalid comparator: ${l}`);
|
|
4124
|
+
this.operator = f[1] !== void 0 ? f[1] : "", this.operator === "=" && (this.operator = ""), f[2] ? this.semver = new a(f[2], this.options.loose) : this.semver = s;
|
|
4109
4125
|
}
|
|
4110
4126
|
toString() {
|
|
4111
4127
|
return this.value;
|
|
4112
4128
|
}
|
|
4113
|
-
test(
|
|
4114
|
-
if (i("Comparator.test",
|
|
4129
|
+
test(l) {
|
|
4130
|
+
if (i("Comparator.test", l, this.options.loose), this.semver === s || l === s)
|
|
4115
4131
|
return !0;
|
|
4116
|
-
if (typeof
|
|
4132
|
+
if (typeof l == "string")
|
|
4117
4133
|
try {
|
|
4118
|
-
|
|
4134
|
+
l = new a(l, this.options);
|
|
4119
4135
|
} catch {
|
|
4120
4136
|
return !1;
|
|
4121
4137
|
}
|
|
4122
|
-
return n(
|
|
4138
|
+
return n(l, this.operator, this.semver, this.options);
|
|
4123
4139
|
}
|
|
4124
|
-
intersects(
|
|
4125
|
-
if (!(
|
|
4140
|
+
intersects(l, d) {
|
|
4141
|
+
if (!(l instanceof e))
|
|
4126
4142
|
throw new TypeError("a Comparator is required");
|
|
4127
|
-
return this.operator === "" ? this.value === "" ? !0 : new c(
|
|
4143
|
+
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(">")));
|
|
4128
4144
|
}
|
|
4129
4145
|
}
|
|
4130
|
-
|
|
4131
|
-
const t =
|
|
4132
|
-
return
|
|
4146
|
+
pt = e;
|
|
4147
|
+
const t = xt, { safeRe: r, t: o } = xe, n = bs, i = ot, a = H, c = te();
|
|
4148
|
+
return pt;
|
|
4133
4149
|
}
|
|
4134
|
-
const
|
|
4150
|
+
const Va = te(), Ua = (s, e, t) => {
|
|
4135
4151
|
try {
|
|
4136
|
-
e = new
|
|
4152
|
+
e = new Va(e, t);
|
|
4137
4153
|
} catch {
|
|
4138
4154
|
return !1;
|
|
4139
4155
|
}
|
|
4140
4156
|
return e.test(s);
|
|
4141
4157
|
};
|
|
4142
|
-
var
|
|
4143
|
-
const
|
|
4144
|
-
var
|
|
4145
|
-
const
|
|
4158
|
+
var at = Ua;
|
|
4159
|
+
const Ja = te(), Ga = (s, e) => new Ja(s, e).set.map((t) => t.map((r) => r.value).join(" ").trim().split(" "));
|
|
4160
|
+
var Ma = Ga;
|
|
4161
|
+
const _a = H, Ka = te(), Ha = (s, e, t) => {
|
|
4146
4162
|
let r = null, o = null, n = null;
|
|
4147
4163
|
try {
|
|
4148
|
-
n = new
|
|
4164
|
+
n = new Ka(e, t);
|
|
4149
4165
|
} catch {
|
|
4150
4166
|
return null;
|
|
4151
4167
|
}
|
|
4152
4168
|
return s.forEach((i) => {
|
|
4153
|
-
n.test(i) && (!r || o.compare(i) === -1) && (r = i, o = new
|
|
4169
|
+
n.test(i) && (!r || o.compare(i) === -1) && (r = i, o = new _a(r, t));
|
|
4154
4170
|
}), r;
|
|
4155
4171
|
};
|
|
4156
|
-
var
|
|
4157
|
-
const
|
|
4172
|
+
var Wa = Ha;
|
|
4173
|
+
const za = H, qa = te(), Xa = (s, e, t) => {
|
|
4158
4174
|
let r = null, o = null, n = null;
|
|
4159
4175
|
try {
|
|
4160
|
-
n = new
|
|
4176
|
+
n = new qa(e, t);
|
|
4161
4177
|
} catch {
|
|
4162
4178
|
return null;
|
|
4163
4179
|
}
|
|
4164
4180
|
return s.forEach((i) => {
|
|
4165
|
-
n.test(i) && (!r || o.compare(i) === 1) && (r = i, o = new
|
|
4181
|
+
n.test(i) && (!r || o.compare(i) === 1) && (r = i, o = new za(r, t));
|
|
4166
4182
|
}), r;
|
|
4167
4183
|
};
|
|
4168
|
-
var
|
|
4169
|
-
const
|
|
4170
|
-
s = new
|
|
4171
|
-
let t = new
|
|
4172
|
-
if (s.test(t) || (t = new
|
|
4184
|
+
var Ya = Xa;
|
|
4185
|
+
const ht = H, Qa = te(), Pr = nt, Za = (s, e) => {
|
|
4186
|
+
s = new Qa(s, e);
|
|
4187
|
+
let t = new ht("0.0.0");
|
|
4188
|
+
if (s.test(t) || (t = new ht("0.0.0-0"), s.test(t)))
|
|
4173
4189
|
return t;
|
|
4174
4190
|
t = null;
|
|
4175
4191
|
for (let r = 0; r < s.set.length; ++r) {
|
|
4176
4192
|
const o = s.set[r];
|
|
4177
4193
|
let n = null;
|
|
4178
4194
|
o.forEach((i) => {
|
|
4179
|
-
const a = new
|
|
4195
|
+
const a = new ht(i.semver.version);
|
|
4180
4196
|
switch (i.operator) {
|
|
4181
4197
|
case ">":
|
|
4182
4198
|
a.prerelease.length === 0 ? a.patch++ : a.prerelease.push(0), a.raw = a.format();
|
|
@@ -4194,67 +4210,67 @@ const pt = _, Ya = ee(), Pr = ot, Qa = (s, e) => {
|
|
|
4194
4210
|
}
|
|
4195
4211
|
return t && s.test(t) ? t : null;
|
|
4196
4212
|
};
|
|
4197
|
-
var
|
|
4198
|
-
const
|
|
4213
|
+
var ec = Za;
|
|
4214
|
+
const tc = te(), rc = (s, e) => {
|
|
4199
4215
|
try {
|
|
4200
|
-
return new
|
|
4216
|
+
return new tc(s, e).range || "*";
|
|
4201
4217
|
} catch {
|
|
4202
4218
|
return null;
|
|
4203
4219
|
}
|
|
4204
4220
|
};
|
|
4205
|
-
var
|
|
4206
|
-
const
|
|
4207
|
-
s = new
|
|
4221
|
+
var sc = rc;
|
|
4222
|
+
const oc = H, Rs = it(), { ANY: nc } = Rs, ic = te(), ac = at, kr = nt, Or = Vt, cc = Jt, lc = Ut, uc = (s, e, t, r) => {
|
|
4223
|
+
s = new oc(s, r), e = new ic(e, r);
|
|
4208
4224
|
let o, n, i, a, c;
|
|
4209
4225
|
switch (t) {
|
|
4210
4226
|
case ">":
|
|
4211
|
-
o =
|
|
4227
|
+
o = kr, n = cc, i = Or, a = ">", c = ">=";
|
|
4212
4228
|
break;
|
|
4213
4229
|
case "<":
|
|
4214
|
-
o =
|
|
4230
|
+
o = Or, n = lc, i = kr, a = "<", c = "<=";
|
|
4215
4231
|
break;
|
|
4216
4232
|
default:
|
|
4217
4233
|
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
4218
4234
|
}
|
|
4219
|
-
if (
|
|
4235
|
+
if (ac(s, e, r))
|
|
4220
4236
|
return !1;
|
|
4221
|
-
for (let
|
|
4222
|
-
const
|
|
4223
|
-
let d = null,
|
|
4224
|
-
if (
|
|
4225
|
-
|
|
4226
|
-
}), d.operator === a || d.operator === c || (!
|
|
4237
|
+
for (let u = 0; u < e.set.length; ++u) {
|
|
4238
|
+
const l = e.set[u];
|
|
4239
|
+
let d = null, f = null;
|
|
4240
|
+
if (l.forEach((h) => {
|
|
4241
|
+
h.semver === nc && (h = new Rs(">=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);
|
|
4242
|
+
}), d.operator === a || d.operator === c || (!f.operator || f.operator === a) && n(s, f.semver))
|
|
4227
4243
|
return !1;
|
|
4228
|
-
if (
|
|
4244
|
+
if (f.operator === c && i(s, f.semver))
|
|
4229
4245
|
return !1;
|
|
4230
4246
|
}
|
|
4231
4247
|
return !0;
|
|
4232
4248
|
};
|
|
4233
|
-
var
|
|
4234
|
-
const
|
|
4235
|
-
var
|
|
4236
|
-
const
|
|
4237
|
-
var
|
|
4238
|
-
const
|
|
4239
|
-
var
|
|
4240
|
-
const
|
|
4241
|
-
var
|
|
4249
|
+
var Gt = uc;
|
|
4250
|
+
const dc = Gt, pc = (s, e, t) => dc(s, e, ">", t);
|
|
4251
|
+
var hc = pc;
|
|
4252
|
+
const fc = Gt, gc = (s, e, t) => fc(s, e, "<", t);
|
|
4253
|
+
var mc = gc;
|
|
4254
|
+
const $r = te(), vc = (s, e, t) => (s = new $r(s, t), e = new $r(e, t), s.intersects(e, t));
|
|
4255
|
+
var yc = vc;
|
|
4256
|
+
const Sc = at, wc = ee;
|
|
4257
|
+
var bc = (s, e, t) => {
|
|
4242
4258
|
const r = [];
|
|
4243
4259
|
let o = null, n = null;
|
|
4244
|
-
const i = s.sort((
|
|
4245
|
-
for (const
|
|
4246
|
-
|
|
4260
|
+
const i = s.sort((l, d) => wc(l, d, t));
|
|
4261
|
+
for (const l of i)
|
|
4262
|
+
Sc(l, e, t) ? (n = l, o || (o = l)) : (n && r.push([o, n]), n = null, o = null);
|
|
4247
4263
|
o && r.push([o, null]);
|
|
4248
4264
|
const a = [];
|
|
4249
|
-
for (const [
|
|
4250
|
-
|
|
4251
|
-
const c = a.join(" || "),
|
|
4252
|
-
return c.length <
|
|
4265
|
+
for (const [l, d] of r)
|
|
4266
|
+
l === d ? a.push(l) : !d && l === i[0] ? a.push("*") : d ? l === i[0] ? a.push(`<=${d}`) : a.push(`${l} - ${d}`) : a.push(`>=${l}`);
|
|
4267
|
+
const c = a.join(" || "), u = typeof e.raw == "string" ? e.raw : String(e);
|
|
4268
|
+
return c.length < u.length ? c : e;
|
|
4253
4269
|
};
|
|
4254
|
-
const
|
|
4270
|
+
const Fr = te(), Mt = it(), { ANY: ft } = Mt, Ee = at, _t = ee, Rc = (s, e, t = {}) => {
|
|
4255
4271
|
if (s === e)
|
|
4256
4272
|
return !0;
|
|
4257
|
-
s = new
|
|
4273
|
+
s = new Fr(s, t), e = new Fr(e, t);
|
|
4258
4274
|
let r = !1;
|
|
4259
4275
|
e: for (const o of s.set) {
|
|
4260
4276
|
for (const n of e.set) {
|
|
@@ -4266,127 +4282,127 @@ const $r = ee(), Gt = nt(), { ANY: ht } = Gt, Ce = it, Mt = Z, bc = (s, e, t = {
|
|
|
4266
4282
|
return !1;
|
|
4267
4283
|
}
|
|
4268
4284
|
return !0;
|
|
4269
|
-
},
|
|
4285
|
+
}, Ec = [new Mt(">=0.0.0-0")], Ir = [new Mt(">=0.0.0")], Cc = (s, e, t) => {
|
|
4270
4286
|
if (s === e)
|
|
4271
4287
|
return !0;
|
|
4272
|
-
if (s.length === 1 && s[0].semver ===
|
|
4273
|
-
if (e.length === 1 && e[0].semver ===
|
|
4288
|
+
if (s.length === 1 && s[0].semver === ft) {
|
|
4289
|
+
if (e.length === 1 && e[0].semver === ft)
|
|
4274
4290
|
return !0;
|
|
4275
|
-
t.includePrerelease ? s =
|
|
4291
|
+
t.includePrerelease ? s = Ec : s = Ir;
|
|
4276
4292
|
}
|
|
4277
|
-
if (e.length === 1 && e[0].semver ===
|
|
4293
|
+
if (e.length === 1 && e[0].semver === ft) {
|
|
4278
4294
|
if (t.includePrerelease)
|
|
4279
4295
|
return !0;
|
|
4280
|
-
e =
|
|
4296
|
+
e = Ir;
|
|
4281
4297
|
}
|
|
4282
4298
|
const r = /* @__PURE__ */ new Set();
|
|
4283
4299
|
let o, n;
|
|
4284
|
-
for (const
|
|
4285
|
-
|
|
4300
|
+
for (const h of s)
|
|
4301
|
+
h.operator === ">" || h.operator === ">=" ? o = Ar(o, h, t) : h.operator === "<" || h.operator === "<=" ? n = Tr(n, h, t) : r.add(h.semver);
|
|
4286
4302
|
if (r.size > 1)
|
|
4287
4303
|
return null;
|
|
4288
4304
|
let i;
|
|
4289
4305
|
if (o && n) {
|
|
4290
|
-
if (i =
|
|
4306
|
+
if (i = _t(o.semver, n.semver, t), i > 0)
|
|
4291
4307
|
return null;
|
|
4292
4308
|
if (i === 0 && (o.operator !== ">=" || n.operator !== "<="))
|
|
4293
4309
|
return null;
|
|
4294
4310
|
}
|
|
4295
|
-
for (const
|
|
4296
|
-
if (o && !
|
|
4311
|
+
for (const h of r) {
|
|
4312
|
+
if (o && !Ee(h, String(o), t) || n && !Ee(h, String(n), t))
|
|
4297
4313
|
return null;
|
|
4298
|
-
for (const
|
|
4299
|
-
if (!
|
|
4314
|
+
for (const E of e)
|
|
4315
|
+
if (!Ee(h, String(E), t))
|
|
4300
4316
|
return !1;
|
|
4301
4317
|
return !0;
|
|
4302
4318
|
}
|
|
4303
|
-
let a, c,
|
|
4319
|
+
let a, c, u, l, d = n && !t.includePrerelease && n.semver.prerelease.length ? n.semver : !1, f = o && !t.includePrerelease && o.semver.prerelease.length ? o.semver : !1;
|
|
4304
4320
|
d && d.prerelease.length === 1 && n.operator === "<" && d.prerelease[0] === 0 && (d = !1);
|
|
4305
|
-
for (const
|
|
4306
|
-
if (
|
|
4307
|
-
if (
|
|
4308
|
-
if (a =
|
|
4321
|
+
for (const h of e) {
|
|
4322
|
+
if (l = l || h.operator === ">" || h.operator === ">=", u = u || h.operator === "<" || h.operator === "<=", o) {
|
|
4323
|
+
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 === ">=") {
|
|
4324
|
+
if (a = Ar(o, h, t), a === h && a !== o)
|
|
4309
4325
|
return !1;
|
|
4310
|
-
} else if (o.operator === ">=" && !
|
|
4326
|
+
} else if (o.operator === ">=" && !Ee(o.semver, String(h), t))
|
|
4311
4327
|
return !1;
|
|
4312
4328
|
}
|
|
4313
4329
|
if (n) {
|
|
4314
|
-
if (d &&
|
|
4315
|
-
if (c =
|
|
4330
|
+
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 === "<=") {
|
|
4331
|
+
if (c = Tr(n, h, t), c === h && c !== n)
|
|
4316
4332
|
return !1;
|
|
4317
|
-
} else if (n.operator === "<=" && !
|
|
4333
|
+
} else if (n.operator === "<=" && !Ee(n.semver, String(h), t))
|
|
4318
4334
|
return !1;
|
|
4319
4335
|
}
|
|
4320
|
-
if (!
|
|
4336
|
+
if (!h.operator && (n || o) && i !== 0)
|
|
4321
4337
|
return !1;
|
|
4322
4338
|
}
|
|
4323
|
-
return !(o &&
|
|
4324
|
-
},
|
|
4339
|
+
return !(o && u && !n && i !== 0 || n && l && !o && i !== 0 || f || d);
|
|
4340
|
+
}, Ar = (s, e, t) => {
|
|
4325
4341
|
if (!s)
|
|
4326
4342
|
return e;
|
|
4327
|
-
const r =
|
|
4343
|
+
const r = _t(s.semver, e.semver, t);
|
|
4328
4344
|
return r > 0 ? s : r < 0 || e.operator === ">" && s.operator === ">=" ? e : s;
|
|
4329
|
-
},
|
|
4345
|
+
}, Tr = (s, e, t) => {
|
|
4330
4346
|
if (!s)
|
|
4331
4347
|
return e;
|
|
4332
|
-
const r =
|
|
4348
|
+
const r = _t(s.semver, e.semver, t);
|
|
4333
4349
|
return r < 0 ? s : r > 0 || e.operator === "<" && s.operator === "<=" ? e : s;
|
|
4334
4350
|
};
|
|
4335
|
-
var Pc =
|
|
4336
|
-
const
|
|
4337
|
-
var
|
|
4338
|
-
parse:
|
|
4339
|
-
valid:
|
|
4340
|
-
clean:
|
|
4341
|
-
inc:
|
|
4342
|
-
diff:
|
|
4343
|
-
major:
|
|
4344
|
-
minor:
|
|
4345
|
-
patch:
|
|
4346
|
-
prerelease:
|
|
4347
|
-
compare:
|
|
4348
|
-
rcompare:
|
|
4349
|
-
compareLoose:
|
|
4350
|
-
compareBuild:
|
|
4351
|
-
sort:
|
|
4352
|
-
rsort:
|
|
4353
|
-
gt:
|
|
4354
|
-
lt:
|
|
4355
|
-
eq:
|
|
4356
|
-
neq:
|
|
4357
|
-
gte:
|
|
4358
|
-
lte:
|
|
4359
|
-
cmp:
|
|
4360
|
-
coerce:
|
|
4361
|
-
Comparator:
|
|
4362
|
-
Range:
|
|
4363
|
-
satisfies:
|
|
4364
|
-
toComparators:
|
|
4365
|
-
maxSatisfying:
|
|
4366
|
-
minSatisfying:
|
|
4367
|
-
minVersion:
|
|
4368
|
-
validRange:
|
|
4369
|
-
outside:
|
|
4370
|
-
gtr:
|
|
4371
|
-
ltr:
|
|
4372
|
-
intersects:
|
|
4373
|
-
simplifyRange:
|
|
4374
|
-
subset:
|
|
4375
|
-
SemVer:
|
|
4376
|
-
re:
|
|
4377
|
-
src:
|
|
4378
|
-
tokens:
|
|
4379
|
-
SEMVER_SPEC_VERSION:
|
|
4380
|
-
RELEASE_TYPES:
|
|
4381
|
-
compareIdentifiers:
|
|
4382
|
-
rcompareIdentifiers:
|
|
4351
|
+
var Pc = Rc;
|
|
4352
|
+
const gt = xe, Lr = st, kc = H, Dr = ys, Oc = be, $c = Di, Fc = xi, Ic = Vi, Ac = Ji, Tc = _i, Lc = Wi, Dc = Xi, Nc = Zi, Bc = ee, xc = sa, jc = ia, Vc = jt, Uc = ua, Jc = ha, Gc = nt, Mc = Vt, _c = Ss, Kc = ws, Hc = Ut, Wc = Jt, zc = bs, qc = Ba, Xc = it(), Yc = te(), Qc = at, Zc = Ma, el = Wa, tl = Ya, rl = ec, sl = sc, ol = Gt, nl = hc, il = mc, al = yc, cl = bc, ll = Pc;
|
|
4353
|
+
var ul = {
|
|
4354
|
+
parse: Oc,
|
|
4355
|
+
valid: $c,
|
|
4356
|
+
clean: Fc,
|
|
4357
|
+
inc: Ic,
|
|
4358
|
+
diff: Ac,
|
|
4359
|
+
major: Tc,
|
|
4360
|
+
minor: Lc,
|
|
4361
|
+
patch: Dc,
|
|
4362
|
+
prerelease: Nc,
|
|
4363
|
+
compare: Bc,
|
|
4364
|
+
rcompare: xc,
|
|
4365
|
+
compareLoose: jc,
|
|
4366
|
+
compareBuild: Vc,
|
|
4367
|
+
sort: Uc,
|
|
4368
|
+
rsort: Jc,
|
|
4369
|
+
gt: Gc,
|
|
4370
|
+
lt: Mc,
|
|
4371
|
+
eq: _c,
|
|
4372
|
+
neq: Kc,
|
|
4373
|
+
gte: Hc,
|
|
4374
|
+
lte: Wc,
|
|
4375
|
+
cmp: zc,
|
|
4376
|
+
coerce: qc,
|
|
4377
|
+
Comparator: Xc,
|
|
4378
|
+
Range: Yc,
|
|
4379
|
+
satisfies: Qc,
|
|
4380
|
+
toComparators: Zc,
|
|
4381
|
+
maxSatisfying: el,
|
|
4382
|
+
minSatisfying: tl,
|
|
4383
|
+
minVersion: rl,
|
|
4384
|
+
validRange: sl,
|
|
4385
|
+
outside: ol,
|
|
4386
|
+
gtr: nl,
|
|
4387
|
+
ltr: il,
|
|
4388
|
+
intersects: al,
|
|
4389
|
+
simplifyRange: cl,
|
|
4390
|
+
subset: ll,
|
|
4391
|
+
SemVer: kc,
|
|
4392
|
+
re: gt.re,
|
|
4393
|
+
src: gt.src,
|
|
4394
|
+
tokens: gt.t,
|
|
4395
|
+
SEMVER_SPEC_VERSION: Lr.SEMVER_SPEC_VERSION,
|
|
4396
|
+
RELEASE_TYPES: Lr.RELEASE_TYPES,
|
|
4397
|
+
compareIdentifiers: Dr.compareIdentifiers,
|
|
4398
|
+
rcompareIdentifiers: Dr.rcompareIdentifiers
|
|
4383
4399
|
};
|
|
4384
|
-
const
|
|
4400
|
+
const dl = /* @__PURE__ */ yi(ul), pl = {
|
|
4385
4401
|
minDelay: 1500
|
|
4386
|
-
},
|
|
4387
|
-
class
|
|
4402
|
+
}, hl = "__no_updates__";
|
|
4403
|
+
class fl extends Xs {
|
|
4388
4404
|
constructor(t, r, o = {}) {
|
|
4389
|
-
super({ ...o, ...
|
|
4405
|
+
super({ ...o, ...pl }, r);
|
|
4390
4406
|
w(this, "http");
|
|
4391
4407
|
w(this, "preferredUpdateChannel");
|
|
4392
4408
|
this.registryProvider = t, this.http = o.http, this.preferredUpdateChannel = o.preferredUpdateChannel;
|
|
@@ -4398,9 +4414,9 @@ class hl extends qs {
|
|
|
4398
4414
|
case "dev-v2":
|
|
4399
4415
|
return `dev_2_${t.currentSpec.folder}_${t.currentSpec.mtime}`;
|
|
4400
4416
|
case "from-registry-v2":
|
|
4401
|
-
return `from_registry_v2_${
|
|
4417
|
+
return `from_registry_v2_${Z(t)}`;
|
|
4402
4418
|
default:
|
|
4403
|
-
return
|
|
4419
|
+
return hl;
|
|
4404
4420
|
}
|
|
4405
4421
|
}
|
|
4406
4422
|
async readValue(t) {
|
|
@@ -4410,16 +4426,16 @@ class hl extends qs {
|
|
|
4410
4426
|
switch (n.type) {
|
|
4411
4427
|
case "dev-v1":
|
|
4412
4428
|
try {
|
|
4413
|
-
const i = await
|
|
4429
|
+
const i = await zr(n.folder);
|
|
4414
4430
|
return i === n.mtime ? { suggestions: [] } : { mainSuggestion: { ...n, mtime: i }, suggestions: [] };
|
|
4415
4431
|
} catch (i) {
|
|
4416
4432
|
return this.logger.warn(i), { suggestions: [] };
|
|
4417
4433
|
}
|
|
4418
4434
|
case "dev-v2":
|
|
4419
4435
|
try {
|
|
4420
|
-
const i = await
|
|
4436
|
+
const i = await vt(n.folder, this.logger);
|
|
4421
4437
|
if (i === void 0) return { suggestions: [] };
|
|
4422
|
-
const a = await
|
|
4438
|
+
const a = await At(i);
|
|
4423
4439
|
return a === n.mtime ? { suggestions: [] } : { mainSuggestion: { ...n, mtime: a }, suggestions: [] };
|
|
4424
4440
|
} catch (i) {
|
|
4425
4441
|
return this.logger.warn(i), { suggestions: [] };
|
|
@@ -4429,51 +4445,51 @@ class hl extends qs {
|
|
|
4429
4445
|
const { versionLock: i, skipVersion: a } = t.settings;
|
|
4430
4446
|
if (i === "patch") return { suggestions: [] };
|
|
4431
4447
|
const c = this.registryProvider.getRegistry(n.registryUrl);
|
|
4432
|
-
let
|
|
4433
|
-
if (
|
|
4448
|
+
let u = this.preferredUpdateChannel;
|
|
4449
|
+
if (u === void 0)
|
|
4434
4450
|
if (n.channel === void 0)
|
|
4435
|
-
if (await c.getLatestOverview(n.id, ce))
|
|
4451
|
+
if (await c.getLatestOverview(n.id, ce)) u = ce;
|
|
4436
4452
|
else {
|
|
4437
4453
|
if (await c.getLatestOverview(n.id, we) === void 0)
|
|
4438
4454
|
return this.logger.error(
|
|
4439
|
-
`No "any" channel record for ${
|
|
4455
|
+
`No "any" channel record for ${As(n.id)}`
|
|
4440
4456
|
), { suggestions: [] };
|
|
4441
|
-
|
|
4457
|
+
u = we;
|
|
4442
4458
|
}
|
|
4443
|
-
else
|
|
4444
|
-
const
|
|
4445
|
-
if (
|
|
4446
|
-
|
|
4459
|
+
else u = n.channel;
|
|
4460
|
+
const l = await c.getUpdateSuggestions(n.id, u);
|
|
4461
|
+
if (l === void 0 || l.length === 0) return { suggestions: [] };
|
|
4462
|
+
l.reverse();
|
|
4447
4463
|
let d;
|
|
4448
4464
|
switch (i) {
|
|
4449
4465
|
case void 0:
|
|
4450
|
-
d =
|
|
4466
|
+
d = l[0].update;
|
|
4451
4467
|
break;
|
|
4452
4468
|
case "major":
|
|
4453
|
-
d = (r =
|
|
4469
|
+
d = (r = l.find((E) => E.type !== "major")) == null ? void 0 : r.update;
|
|
4454
4470
|
break;
|
|
4455
4471
|
case "minor":
|
|
4456
|
-
d = (o =
|
|
4472
|
+
d = (o = l.find((E) => E.type === "patch")) == null ? void 0 : o.update;
|
|
4457
4473
|
break;
|
|
4458
4474
|
}
|
|
4459
|
-
const
|
|
4460
|
-
type:
|
|
4461
|
-
update: { ...n, id: { ...n.id, version:
|
|
4475
|
+
const f = l.map(({ type: E, update: g }) => ({
|
|
4476
|
+
type: E,
|
|
4477
|
+
update: { ...n, id: { ...n.id, version: g } }
|
|
4462
4478
|
}));
|
|
4463
|
-
if (d === void 0) return { suggestions:
|
|
4464
|
-
if (a !== void 0 &&
|
|
4465
|
-
return { suggestions:
|
|
4466
|
-
const
|
|
4479
|
+
if (d === void 0) return { suggestions: f };
|
|
4480
|
+
if (a !== void 0 && dl.lte(d, a))
|
|
4481
|
+
return { suggestions: f };
|
|
4482
|
+
const h = {
|
|
4467
4483
|
...n,
|
|
4468
4484
|
id: { ...n.id, version: d }
|
|
4469
4485
|
};
|
|
4470
4486
|
return (async () => {
|
|
4471
4487
|
try {
|
|
4472
|
-
await c.getComponents(
|
|
4473
|
-
} catch (
|
|
4474
|
-
this.logger.warn(
|
|
4488
|
+
await c.getComponents(h.id);
|
|
4489
|
+
} catch (E) {
|
|
4490
|
+
this.logger.warn(E);
|
|
4475
4491
|
}
|
|
4476
|
-
})(), { suggestions:
|
|
4492
|
+
})(), { suggestions: f, mainSuggestion: h };
|
|
4477
4493
|
} catch (i) {
|
|
4478
4494
|
return this.logger.warn(i), { suggestions: [] };
|
|
4479
4495
|
}
|
|
@@ -4485,10 +4501,10 @@ class hl extends qs {
|
|
|
4485
4501
|
}
|
|
4486
4502
|
}
|
|
4487
4503
|
resultsEqual(t, r) {
|
|
4488
|
-
return
|
|
4504
|
+
return Z(t) === Z(r);
|
|
4489
4505
|
}
|
|
4490
4506
|
}
|
|
4491
|
-
class
|
|
4507
|
+
class Nr {
|
|
4492
4508
|
constructor() {
|
|
4493
4509
|
w(this, "resources", /* @__PURE__ */ new Map());
|
|
4494
4510
|
}
|
|
@@ -4519,18 +4535,18 @@ class Dr {
|
|
|
4519
4535
|
return (t = this.resources.get(e)) == null ? void 0 : t.resource;
|
|
4520
4536
|
}
|
|
4521
4537
|
}
|
|
4522
|
-
let
|
|
4523
|
-
function
|
|
4524
|
-
return
|
|
4538
|
+
let Ce;
|
|
4539
|
+
function se() {
|
|
4540
|
+
return Ce || (Ce = {
|
|
4525
4541
|
logPFrameRequests: process.env.MI_LOG_PFRAMES !== void 0,
|
|
4526
4542
|
usePFrameRs: process.env.MI_USE_PFRAMES_RS !== void 0
|
|
4527
|
-
}, process.env.MI_LOG_TREE_STAT && (
|
|
4543
|
+
}, process.env.MI_LOG_TREE_STAT && (Ce.logTreeStats = process.env.MI_LOG_TREE_STAT === "cumulative" ? "cumulative" : "per-request"), Ce);
|
|
4528
4544
|
}
|
|
4529
4545
|
function Ae(s) {
|
|
4530
4546
|
return String(s.id);
|
|
4531
4547
|
}
|
|
4532
|
-
const
|
|
4533
|
-
function
|
|
4548
|
+
const gl = ["Int", "Long", "Float", "Double", "String", "Bytes"];
|
|
4549
|
+
function Pe(s) {
|
|
4534
4550
|
const e = [], t = [];
|
|
4535
4551
|
for (const r of s)
|
|
4536
4552
|
r.type === "bySingleColumn" ? (e.push(r), t.push({
|
|
@@ -4545,7 +4561,7 @@ function Ee(s) {
|
|
|
4545
4561
|
}
|
|
4546
4562
|
return t;
|
|
4547
4563
|
}
|
|
4548
|
-
function
|
|
4564
|
+
function Br(s) {
|
|
4549
4565
|
const e = (t) => {
|
|
4550
4566
|
switch (t.operator) {
|
|
4551
4567
|
case "Matches":
|
|
@@ -4564,7 +4580,7 @@ function Nr(s) {
|
|
|
4564
4580
|
return s.every((t) => e(t.predicate));
|
|
4565
4581
|
}
|
|
4566
4582
|
const ke = (s, e) => typeof e == "bigint" ? e.toString() : e;
|
|
4567
|
-
class
|
|
4583
|
+
class ml {
|
|
4568
4584
|
constructor(e, t, r, o) {
|
|
4569
4585
|
w(this, "rustPFrame");
|
|
4570
4586
|
w(this, "blobIdToResource", /* @__PURE__ */ new Map());
|
|
@@ -4600,19 +4616,19 @@ class gl {
|
|
|
4600
4616
|
}
|
|
4601
4617
|
};
|
|
4602
4618
|
for (const a of o)
|
|
4603
|
-
for (const c of
|
|
4619
|
+
for (const c of hn(a.data))
|
|
4604
4620
|
this.blobIdToResource.set(Ae(c), c);
|
|
4605
4621
|
const i = [
|
|
4606
4622
|
...new Map(o.map((a) => ({
|
|
4607
4623
|
...a,
|
|
4608
|
-
data:
|
|
4624
|
+
data: fn(a.data, Ae)
|
|
4609
4625
|
})).map(
|
|
4610
|
-
(a) => [
|
|
4626
|
+
(a) => [Z(a), a]
|
|
4611
4627
|
)).values()
|
|
4612
4628
|
];
|
|
4613
4629
|
this.rustPFrame = (() => {
|
|
4614
4630
|
try {
|
|
4615
|
-
const a = new
|
|
4631
|
+
const a = new fo(se().logPFrameRequests ? n : void 0);
|
|
4616
4632
|
a.setDataSource(this);
|
|
4617
4633
|
for (const c of i)
|
|
4618
4634
|
a.addColumnSpec(c.id, c.spec), a.setColumnData(c.id, c.data);
|
|
@@ -4624,14 +4640,14 @@ class gl {
|
|
|
4624
4640
|
}
|
|
4625
4641
|
})(), this.createDataPFrame = () => {
|
|
4626
4642
|
try {
|
|
4627
|
-
const a =
|
|
4643
|
+
const a = se().logPFrameRequests ? new Qt(n) : new Qt();
|
|
4628
4644
|
a.setDataSource(this);
|
|
4629
4645
|
for (const c of i)
|
|
4630
4646
|
try {
|
|
4631
4647
|
a.addColumnSpec(c.id, c.spec), a.setColumnData(c.id, c.data);
|
|
4632
|
-
} catch (
|
|
4648
|
+
} catch (u) {
|
|
4633
4649
|
throw new Error(
|
|
4634
|
-
`Adding column ${c.id} to PFrame failed: ${
|
|
4650
|
+
`Adding column ${c.id} to PFrame failed: ${u}; Spec: ${JSON.stringify(c.spec)}, DataInfo: ${JSON.stringify(c.data)}.`
|
|
4635
4651
|
);
|
|
4636
4652
|
}
|
|
4637
4653
|
return a;
|
|
@@ -4663,7 +4679,7 @@ class gl {
|
|
|
4663
4679
|
this.rustPFrame.dispose();
|
|
4664
4680
|
}
|
|
4665
4681
|
}
|
|
4666
|
-
class
|
|
4682
|
+
class vl {
|
|
4667
4683
|
constructor(e) {
|
|
4668
4684
|
this.table = e;
|
|
4669
4685
|
}
|
|
@@ -4671,7 +4687,7 @@ class ml {
|
|
|
4671
4687
|
this.table.then((e) => e.dispose());
|
|
4672
4688
|
}
|
|
4673
4689
|
}
|
|
4674
|
-
class
|
|
4690
|
+
class yl {
|
|
4675
4691
|
constructor(e, t) {
|
|
4676
4692
|
w(this, "pFrames");
|
|
4677
4693
|
w(this, "pTables");
|
|
@@ -4679,58 +4695,58 @@ class vl {
|
|
|
4679
4695
|
/** Limits concurrent requests to PFrame API to prevent deadlock with Node's IO threads */
|
|
4680
4696
|
w(this, "concurrencyLimiter");
|
|
4681
4697
|
this.blobDriver = e, this.logger = t;
|
|
4682
|
-
const r = new
|
|
4698
|
+
const r = new go({
|
|
4683
4699
|
maxSize: 1e9,
|
|
4684
4700
|
// 1Gb
|
|
4685
|
-
fetchMethod: async (n) => await
|
|
4701
|
+
fetchMethod: async (n) => await Gr.readFile(n),
|
|
4686
4702
|
sizeCalculation: (n) => n.length
|
|
4687
4703
|
});
|
|
4688
4704
|
this.blobContentCache = r;
|
|
4689
|
-
const o = new
|
|
4690
|
-
this.concurrencyLimiter = o, this.pFrames = new class extends
|
|
4705
|
+
const o = new js(1);
|
|
4706
|
+
this.concurrencyLimiter = o, this.pFrames = new class extends Nr {
|
|
4691
4707
|
constructor(n, i) {
|
|
4692
4708
|
super(), this.blobDriver = n, this.logger = i;
|
|
4693
4709
|
}
|
|
4694
4710
|
createNewResource(n) {
|
|
4695
|
-
return
|
|
4711
|
+
return se().logPFrameRequests && t.info(
|
|
4696
4712
|
`PFrame creation (pFrameHandle = ${this.calculateParamsKey(n)}): ${JSON.stringify(n, ke)}`
|
|
4697
|
-
), new
|
|
4713
|
+
), new ml(this.blobDriver, this.logger, r, n);
|
|
4698
4714
|
}
|
|
4699
4715
|
calculateParamsKey(n) {
|
|
4700
|
-
return
|
|
4716
|
+
return wl(n);
|
|
4701
4717
|
}
|
|
4702
|
-
}(this.blobDriver, this.logger), this.pTables = new class extends
|
|
4718
|
+
}(this.blobDriver, this.logger), this.pTables = new class extends Nr {
|
|
4703
4719
|
constructor(n) {
|
|
4704
4720
|
super(), this.pFrames = n;
|
|
4705
4721
|
}
|
|
4706
4722
|
createNewResource(n) {
|
|
4707
4723
|
const i = n.pFrameHandle, a = o.run(async () => {
|
|
4708
|
-
if (
|
|
4724
|
+
if (se().logPFrameRequests && t.info(
|
|
4709
4725
|
`PTable creation (pTableHandle = ${this.calculateParamsKey(n)}): ${JSON.stringify(n, ke)}`
|
|
4710
|
-
),
|
|
4726
|
+
), se().usePFrameRs && Br(n.def.filters))
|
|
4711
4727
|
return await this.pFrames.getByKey(i).rustPFrame.createTable({
|
|
4712
4728
|
src: pe(n.def.src),
|
|
4713
|
-
filters:
|
|
4729
|
+
filters: Pe(n.def.filters)
|
|
4714
4730
|
}, n.signal);
|
|
4715
4731
|
var c = [];
|
|
4716
4732
|
try {
|
|
4717
|
-
const
|
|
4718
|
-
return await
|
|
4733
|
+
const f = je(c, this.pFrames.getByKey(i).disposableDataPFrame);
|
|
4734
|
+
return await f.dataPFrame.createTable({
|
|
4719
4735
|
src: pe(n.def.src),
|
|
4720
|
-
filters:
|
|
4736
|
+
filters: Pe(n.def.filters)
|
|
4721
4737
|
}, n.signal);
|
|
4722
|
-
} catch (
|
|
4723
|
-
var
|
|
4738
|
+
} catch (u) {
|
|
4739
|
+
var l = u, d = !0;
|
|
4724
4740
|
} finally {
|
|
4725
|
-
Ve(c,
|
|
4741
|
+
Ve(c, l, d);
|
|
4726
4742
|
}
|
|
4727
4743
|
}).then(
|
|
4728
4744
|
async (c) => n.def.sorting.length !== 0 ? await c.sort(n.def.sorting, n.signal) : c
|
|
4729
4745
|
);
|
|
4730
|
-
return new
|
|
4746
|
+
return new vl(a);
|
|
4731
4747
|
}
|
|
4732
4748
|
calculateParamsKey(n) {
|
|
4733
|
-
return
|
|
4749
|
+
return Sl(n);
|
|
4734
4750
|
}
|
|
4735
4751
|
}(this.pFrames);
|
|
4736
4752
|
}
|
|
@@ -4738,19 +4754,19 @@ class vl {
|
|
|
4738
4754
|
// Internal / Config API Methods
|
|
4739
4755
|
//
|
|
4740
4756
|
createPFrame(e, t) {
|
|
4741
|
-
const r = e.filter((n) =>
|
|
4757
|
+
const r = e.filter((n) => gl.find((i) => i === n.spec.valueType)).map(
|
|
4742
4758
|
(n) => de(
|
|
4743
4759
|
n,
|
|
4744
|
-
(i) =>
|
|
4760
|
+
(i) => qs(i) ? wn(i) : bn(n.spec, i)
|
|
4745
4761
|
)
|
|
4746
4762
|
), o = this.pFrames.acquire(r);
|
|
4747
4763
|
return t.addOnDestroy(o.unref), o.key;
|
|
4748
4764
|
}
|
|
4749
4765
|
createPTable(e, t, r) {
|
|
4750
|
-
const o = this.createPFrame(
|
|
4751
|
-
return
|
|
4766
|
+
const o = this.createPFrame(Is(e.src), t), n = mt(e, (a) => a.id), i = this.pTables.acquire({ def: n, pFrameHandle: o, signal: r });
|
|
4767
|
+
return se().logPFrameRequests && this.logger.info(
|
|
4752
4768
|
`Create PTable call (pFrameHandle = ${o}; pTableHandle = ${JSON.stringify(i)}): ${JSON.stringify(
|
|
4753
|
-
|
|
4769
|
+
mt(e, (a) => a.spec),
|
|
4754
4770
|
ke
|
|
4755
4771
|
)}`
|
|
4756
4772
|
), t.addOnDestroy(i.unref), i.key;
|
|
@@ -4764,7 +4780,7 @@ class vl {
|
|
|
4764
4780
|
compatibleWith: t.compatibleWith.length !== 0 ? [{
|
|
4765
4781
|
axesSpec: [
|
|
4766
4782
|
...new Map(t.compatibleWith.map(
|
|
4767
|
-
(n) => [
|
|
4783
|
+
(n) => [Z(n), n]
|
|
4768
4784
|
)).values()
|
|
4769
4785
|
],
|
|
4770
4786
|
qualifications: []
|
|
@@ -4785,24 +4801,24 @@ class vl {
|
|
|
4785
4801
|
}
|
|
4786
4802
|
async calculateTableData(e, t, r) {
|
|
4787
4803
|
let o = await this.concurrencyLimiter.run(async () => {
|
|
4788
|
-
if (
|
|
4804
|
+
if (se().logPFrameRequests && this.logger.info(
|
|
4789
4805
|
`Call calculateTableData, handle = ${e}, request = ${JSON.stringify(t, ke)}`
|
|
4790
|
-
),
|
|
4806
|
+
), se().usePFrameRs && Br(t.filters))
|
|
4791
4807
|
return await this.pFrames.getByKey(e).rustPFrame.createTable({
|
|
4792
4808
|
src: pe(t.src),
|
|
4793
|
-
filters:
|
|
4809
|
+
filters: Pe(t.filters)
|
|
4794
4810
|
}, r);
|
|
4795
4811
|
var a = [];
|
|
4796
4812
|
try {
|
|
4797
4813
|
const d = je(a, this.pFrames.getByKey(e).disposableDataPFrame);
|
|
4798
4814
|
return await d.dataPFrame.createTable({
|
|
4799
4815
|
src: pe(t.src),
|
|
4800
|
-
filters:
|
|
4816
|
+
filters: Pe(t.filters)
|
|
4801
4817
|
}, r);
|
|
4802
4818
|
} catch (c) {
|
|
4803
|
-
var
|
|
4819
|
+
var u = c, l = !0;
|
|
4804
4820
|
} finally {
|
|
4805
|
-
Ve(a,
|
|
4821
|
+
Ve(a, u, l);
|
|
4806
4822
|
}
|
|
4807
4823
|
});
|
|
4808
4824
|
if (t.sorting.length > 0) {
|
|
@@ -4823,13 +4839,13 @@ class vl {
|
|
|
4823
4839
|
return await this.concurrencyLimiter.run(async () => {
|
|
4824
4840
|
var n = [];
|
|
4825
4841
|
try {
|
|
4826
|
-
|
|
4842
|
+
se().logPFrameRequests && this.logger.info(
|
|
4827
4843
|
`Call getUniqueValues, handle = ${e}, request = ${JSON.stringify(t, ke)}`
|
|
4828
4844
|
);
|
|
4829
4845
|
const o = je(n, this.pFrames.getByKey(e).disposableDataPFrame);
|
|
4830
4846
|
return await o.dataPFrame.getUniqueValues({
|
|
4831
4847
|
...t,
|
|
4832
|
-
filters:
|
|
4848
|
+
filters: Pe(t.filters)
|
|
4833
4849
|
}, r);
|
|
4834
4850
|
} catch (i) {
|
|
4835
4851
|
var a = i, c = !0;
|
|
@@ -4875,14 +4891,14 @@ function pe(s) {
|
|
|
4875
4891
|
secondary: s.secondary.map((e) => pe(e))
|
|
4876
4892
|
};
|
|
4877
4893
|
default:
|
|
4878
|
-
|
|
4894
|
+
K(s);
|
|
4879
4895
|
}
|
|
4880
4896
|
}
|
|
4881
|
-
function
|
|
4897
|
+
function Sl(s) {
|
|
4882
4898
|
const e = Be("sha256");
|
|
4883
|
-
return e.update(
|
|
4899
|
+
return e.update(Z(s)), e.digest().toString("hex");
|
|
4884
4900
|
}
|
|
4885
|
-
function
|
|
4901
|
+
function wl(s) {
|
|
4886
4902
|
const e = [...s].map(
|
|
4887
4903
|
(r) => de(r, (o) => {
|
|
4888
4904
|
let n;
|
|
@@ -4926,51 +4942,51 @@ function Sl(s) {
|
|
|
4926
4942
|
);
|
|
4927
4943
|
e.sort((r, o) => r.id.localeCompare(o.id));
|
|
4928
4944
|
const t = Be("sha256");
|
|
4929
|
-
return t.update(
|
|
4945
|
+
return t.update(Z(e)), t.digest().toString("hex");
|
|
4930
4946
|
}
|
|
4931
|
-
async function
|
|
4947
|
+
async function bl(s, e, t) {
|
|
4932
4948
|
const r = {
|
|
4933
|
-
...
|
|
4934
|
-
...
|
|
4949
|
+
...fs,
|
|
4950
|
+
...gs(e),
|
|
4935
4951
|
...t
|
|
4936
|
-
}, o = new
|
|
4952
|
+
}, o = new Jr(r.localSecret), n = ro(r.logger, s, r.localProjections), i = so(s, r.logger), a = oo(s, r.logger), c = no(s, r.logger), u = new io(
|
|
4937
4953
|
r.logger,
|
|
4938
4954
|
n,
|
|
4939
4955
|
i,
|
|
4940
4956
|
r.blobDownloadPath,
|
|
4941
4957
|
o,
|
|
4942
4958
|
r.blobDriverOps
|
|
4943
|
-
),
|
|
4959
|
+
), l = new ao(
|
|
4944
4960
|
r.logger,
|
|
4945
4961
|
o,
|
|
4946
4962
|
n,
|
|
4947
4963
|
r.downloadBlobToURLPath,
|
|
4948
4964
|
r.downloadBlobToURLDriverOps
|
|
4949
|
-
), d = new
|
|
4965
|
+
), d = new co(
|
|
4950
4966
|
r.logger,
|
|
4951
4967
|
o,
|
|
4952
4968
|
a,
|
|
4953
4969
|
c,
|
|
4954
4970
|
r.uploadDriverOps
|
|
4955
|
-
),
|
|
4971
|
+
), f = new lo(r.logger, i, r.logStreamDriverOps), h = new uo(r.logger, f, u), E = await po.init(
|
|
4956
4972
|
r.logger,
|
|
4957
4973
|
s,
|
|
4958
4974
|
o,
|
|
4959
4975
|
r.localProjections,
|
|
4960
4976
|
r.openFileDialogCallback,
|
|
4961
4977
|
r.virtualLocalStoragesOverride
|
|
4962
|
-
),
|
|
4978
|
+
), g = new yl(u, r.logger);
|
|
4963
4979
|
return {
|
|
4964
|
-
blobDriver:
|
|
4965
|
-
blobToURLDriver:
|
|
4966
|
-
logDriver:
|
|
4967
|
-
lsDriver:
|
|
4980
|
+
blobDriver: u,
|
|
4981
|
+
blobToURLDriver: l,
|
|
4982
|
+
logDriver: h,
|
|
4983
|
+
lsDriver: E,
|
|
4968
4984
|
signer: o,
|
|
4969
4985
|
uploadDriver: d,
|
|
4970
|
-
pFrameDriver:
|
|
4986
|
+
pFrameDriver: g
|
|
4971
4987
|
};
|
|
4972
4988
|
}
|
|
4973
|
-
class
|
|
4989
|
+
class Es {
|
|
4974
4990
|
constructor(e, t, r, o, n, i, a, c) {
|
|
4975
4991
|
w(this, "pl");
|
|
4976
4992
|
/** Contains a reactive list of projects along with their meta information. */
|
|
@@ -4991,14 +5007,14 @@ class Rs {
|
|
|
4991
5007
|
/** Creates a project with initial state and adds it to project list. */
|
|
4992
5008
|
async createProject(e, t = Te()) {
|
|
4993
5009
|
const r = await this.pl.withWriteTx("MLCreateProject", async (o) => {
|
|
4994
|
-
const n = await
|
|
4995
|
-
return o.createField(x(this.projectListResourceId, t), "Dynamic", n), await o.commit(), await
|
|
5010
|
+
const n = await pn(o, e);
|
|
5011
|
+
return o.createField(x(this.projectListResourceId, t), "Dynamic", n), await o.commit(), await Hs(n);
|
|
4996
5012
|
});
|
|
4997
5013
|
return await this.projectListTree.refreshState(), r;
|
|
4998
5014
|
}
|
|
4999
5015
|
/** Updates project metadata */
|
|
5000
5016
|
async setProjectMeta(e, t, r) {
|
|
5001
|
-
await
|
|
5017
|
+
await Q(this.pl, e, r, (o) => {
|
|
5002
5018
|
o.setMeta(t);
|
|
5003
5019
|
}), await this.projectListTree.refreshState();
|
|
5004
5020
|
}
|
|
@@ -5012,7 +5028,7 @@ class Rs {
|
|
|
5012
5028
|
async projectIdToResourceId(e) {
|
|
5013
5029
|
return await this.pl.withReadTx("Project id to resource id", async (t) => {
|
|
5014
5030
|
const r = (await t.getField(x(this.projectListResourceId, e))).value;
|
|
5015
|
-
if (
|
|
5031
|
+
if (Ye(r)) throw new Error("Unexpected project list structure.");
|
|
5016
5032
|
return r;
|
|
5017
5033
|
});
|
|
5018
5034
|
}
|
|
@@ -5023,7 +5039,7 @@ class Rs {
|
|
|
5023
5039
|
async openProject(e) {
|
|
5024
5040
|
const t = await this.ensureProjectRid(e);
|
|
5025
5041
|
if (this.openedProjectsByRid.has(t)) throw new Error(`Project ${t} already opened`);
|
|
5026
|
-
this.openedProjectsByRid.set(t, await
|
|
5042
|
+
this.openedProjectsByRid.set(t, await Bt.init(this.env, t)), this.openedProjectsList.setValue([...this.openedProjectsByRid.keys()]);
|
|
5027
5043
|
}
|
|
5028
5044
|
/** Closes the project, and deallocate all corresponding resources. */
|
|
5029
5045
|
async closeProject(e) {
|
|
@@ -5051,66 +5067,66 @@ class Rs {
|
|
|
5051
5067
|
/** Generates sufficiently random string to be used as local secret for the
|
|
5052
5068
|
* middle layer */
|
|
5053
5069
|
static generateLocalSecret() {
|
|
5054
|
-
return
|
|
5070
|
+
return Jr.generateSecret();
|
|
5055
5071
|
}
|
|
5056
5072
|
/** Initialize middle layer */
|
|
5057
5073
|
static async init(e, t, r) {
|
|
5058
5074
|
const o = {
|
|
5059
|
-
...
|
|
5060
|
-
...
|
|
5075
|
+
...mi,
|
|
5076
|
+
...vi(t),
|
|
5061
5077
|
...r
|
|
5062
5078
|
};
|
|
5063
|
-
o.defaultTreeOptions.logStat =
|
|
5064
|
-
const n = await e.withWriteTx("MLInitialization", async (
|
|
5065
|
-
const
|
|
5066
|
-
|
|
5067
|
-
const
|
|
5068
|
-
if (
|
|
5069
|
-
const
|
|
5070
|
-
return
|
|
5079
|
+
o.defaultTreeOptions.logStat = se().logTreeStats;
|
|
5080
|
+
const n = await e.withWriteTx("MLInitialization", async (g) => {
|
|
5081
|
+
const D = x(g.clientRoot, Bo);
|
|
5082
|
+
g.createField(D, "Dynamic");
|
|
5083
|
+
const T = await g.getField(D);
|
|
5084
|
+
if (Ye(T.value)) {
|
|
5085
|
+
const j = g.createEphemeral(Yr);
|
|
5086
|
+
return g.lock(j), g.setField(D, j), await g.commit(), await j.globalId;
|
|
5071
5087
|
} else
|
|
5072
|
-
return
|
|
5073
|
-
}), i = o.logger, a = await
|
|
5088
|
+
return T.value;
|
|
5089
|
+
}), i = o.logger, a = await bl(e, t, o), c = new Ts(e.httpDispatcher, {
|
|
5074
5090
|
minTimeout: 250,
|
|
5075
5091
|
maxRetries: 4
|
|
5076
|
-
}),
|
|
5077
|
-
|
|
5092
|
+
}), u = new Co(c), l = new on(
|
|
5093
|
+
u,
|
|
5078
5094
|
a.signer,
|
|
5079
5095
|
c
|
|
5080
|
-
), d = new
|
|
5096
|
+
), d = new ho(
|
|
5081
5097
|
i,
|
|
5082
5098
|
e.httpDispatcher,
|
|
5083
5099
|
o.frontendDownloadPath
|
|
5084
|
-
),
|
|
5100
|
+
), f = {
|
|
5085
5101
|
pl: e,
|
|
5086
5102
|
signer: a.signer,
|
|
5087
5103
|
logger: i,
|
|
5088
5104
|
httpDispatcher: e.httpDispatcher,
|
|
5089
5105
|
retryHttpDispatcher: c,
|
|
5090
5106
|
ops: o,
|
|
5091
|
-
bpPreparer:
|
|
5107
|
+
bpPreparer: l,
|
|
5092
5108
|
frontendDownloadDriver: d,
|
|
5093
5109
|
driverKit: a,
|
|
5094
|
-
blockUpdateWatcher: new
|
|
5110
|
+
blockUpdateWatcher: new fl(u, i, {
|
|
5095
5111
|
minDelay: o.devBlockUpdateRecheckInterval,
|
|
5096
5112
|
http: c,
|
|
5097
5113
|
preferredUpdateChannel: o.preferredUpdateChannel
|
|
5098
5114
|
}),
|
|
5099
|
-
quickJs: await
|
|
5100
|
-
},
|
|
5101
|
-
return new
|
|
5102
|
-
|
|
5115
|
+
quickJs: await to()
|
|
5116
|
+
}, h = new Ys([]), E = await jo(e, n, h, f);
|
|
5117
|
+
return new Es(
|
|
5118
|
+
f,
|
|
5103
5119
|
a,
|
|
5104
5120
|
a.signer,
|
|
5105
5121
|
n,
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5122
|
+
h,
|
|
5123
|
+
E.tree,
|
|
5124
|
+
u,
|
|
5125
|
+
E.computable
|
|
5110
5126
|
);
|
|
5111
5127
|
}
|
|
5112
5128
|
}
|
|
5113
|
-
const
|
|
5129
|
+
const Rl = [
|
|
5114
5130
|
"undici:request:create",
|
|
5115
5131
|
// When a new request is created
|
|
5116
5132
|
"undici:request:bodySent",
|
|
@@ -5148,7 +5164,7 @@ const bl = [
|
|
|
5148
5164
|
"undici:dispatcher:retry"
|
|
5149
5165
|
// When a dispatcher retries a request
|
|
5150
5166
|
];
|
|
5151
|
-
async function
|
|
5167
|
+
async function nu(s, e = {}) {
|
|
5152
5168
|
const t = {
|
|
5153
5169
|
pingCheckDurationMs: 1e4,
|
|
5154
5170
|
pingTimeoutMs: 3e3,
|
|
@@ -5166,15 +5182,15 @@ async function ou(s, e = {}) {
|
|
|
5166
5182
|
bodyLimit: 300,
|
|
5167
5183
|
...e
|
|
5168
5184
|
}, r = [];
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
var
|
|
5185
|
+
Rl.forEach((c) => {
|
|
5186
|
+
mo(c).subscribe((l) => {
|
|
5187
|
+
var f;
|
|
5172
5188
|
const d = (/* @__PURE__ */ new Date()).toISOString();
|
|
5173
|
-
(
|
|
5189
|
+
(f = l == null ? void 0 : l.response) != null && f.headers && (l.response.headers = l.response.headers.map((h) => h.toString())), r.push(
|
|
5174
5190
|
JSON.stringify({
|
|
5175
5191
|
timestamp: d,
|
|
5176
5192
|
event: c,
|
|
5177
|
-
data:
|
|
5193
|
+
data: l
|
|
5178
5194
|
})
|
|
5179
5195
|
);
|
|
5180
5196
|
});
|
|
@@ -5186,12 +5202,12 @@ async function ou(s, e = {}) {
|
|
|
5186
5202
|
blockRegistryUiChecks: [],
|
|
5187
5203
|
blockGARegistryUiChecks: [],
|
|
5188
5204
|
autoUpdateCdnChecks: []
|
|
5189
|
-
}, n =
|
|
5205
|
+
}, n = Ws(s, { defaultRequestTimeout: t.pingTimeoutMs });
|
|
5190
5206
|
o.plPings = await ye(t.pingCheckDurationMs, t.maxPingsPerSecond, async () => {
|
|
5191
|
-
const
|
|
5192
|
-
return JSON.stringify(
|
|
5207
|
+
const u = await new Xt(n).ping();
|
|
5208
|
+
return JSON.stringify(u).slice(0, t.bodyLimit) + "...";
|
|
5193
5209
|
});
|
|
5194
|
-
const a = new
|
|
5210
|
+
const a = new Xt(n).ll.httpDispatcher;
|
|
5195
5211
|
return o.blockRegistryOverviewChecks = await ye(
|
|
5196
5212
|
t.blockRegistryDurationMs,
|
|
5197
5213
|
t.maxRegistryChecksPerSecond,
|
|
@@ -5212,25 +5228,25 @@ async function ou(s, e = {}) {
|
|
|
5212
5228
|
t.autoUpdateCdnDurationMs,
|
|
5213
5229
|
t.maxAutoUpdateCdnChecksPerSecond,
|
|
5214
5230
|
async () => await Oe(t.autoUpdateCdnUrl, t, a)
|
|
5215
|
-
),
|
|
5231
|
+
), El(o, s, t, r);
|
|
5216
5232
|
}
|
|
5217
5233
|
async function ye(s, e, t) {
|
|
5218
|
-
const r =
|
|
5219
|
-
for (;
|
|
5220
|
-
const n =
|
|
5234
|
+
const r = $t(), o = [];
|
|
5235
|
+
for (; xr(r) < s; ) {
|
|
5236
|
+
const n = $t();
|
|
5221
5237
|
let i;
|
|
5222
5238
|
try {
|
|
5223
5239
|
i = { ok: !0, value: await t() };
|
|
5224
|
-
} catch (
|
|
5225
|
-
i = { ok: !1, error:
|
|
5240
|
+
} catch (u) {
|
|
5241
|
+
i = { ok: !1, error: u };
|
|
5226
5242
|
}
|
|
5227
|
-
const a =
|
|
5243
|
+
const a = xr(n);
|
|
5228
5244
|
o.push({
|
|
5229
5245
|
elapsedMs: a,
|
|
5230
5246
|
response: i
|
|
5231
5247
|
});
|
|
5232
5248
|
const c = 1e3 / e - a;
|
|
5233
|
-
c > 0 && await
|
|
5249
|
+
c > 0 && await Hr(c);
|
|
5234
5250
|
}
|
|
5235
5251
|
return o;
|
|
5236
5252
|
}
|
|
@@ -5245,7 +5261,7 @@ async function Oe(s, e, t) {
|
|
|
5245
5261
|
beginningOfBody: n.slice(0, e.bodyLimit) + "..."
|
|
5246
5262
|
};
|
|
5247
5263
|
}
|
|
5248
|
-
function
|
|
5264
|
+
function El(s, e, t, r) {
|
|
5249
5265
|
const o = s.plPings.filter((a) => a.response.ok), n = s.plPings.filter((a) => !a.response.ok), i = [
|
|
5250
5266
|
...new Set(o.map((a) => JSON.stringify(a.response.value)))
|
|
5251
5267
|
];
|
|
@@ -5311,40 +5327,40 @@ function Cl(s) {
|
|
|
5311
5327
|
}
|
|
5312
5328
|
return { mean: t, median: r };
|
|
5313
5329
|
}
|
|
5314
|
-
function
|
|
5330
|
+
function $t() {
|
|
5315
5331
|
return Date.now();
|
|
5316
5332
|
}
|
|
5317
|
-
function
|
|
5318
|
-
return
|
|
5333
|
+
function xr(s) {
|
|
5334
|
+
return $t() - s;
|
|
5319
5335
|
}
|
|
5320
5336
|
export {
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5337
|
+
Yl as BlockPackRegistry,
|
|
5338
|
+
Ql as CentralBlockRegistry,
|
|
5339
|
+
gs as DefaultDriverKitOpsPaths,
|
|
5340
|
+
fs as DefaultDriverKitOpsSettings,
|
|
5341
|
+
vi as DefaultMiddleLayerOpsPaths,
|
|
5342
|
+
mi as DefaultMiddleLayerOpsSettings,
|
|
5343
|
+
ts as FrontendFromFolderResourceType,
|
|
5344
|
+
es as FrontendFromUrlResourceType,
|
|
5345
|
+
Es as MiddleLayer,
|
|
5346
|
+
Bt as Project,
|
|
5347
|
+
Xo as TengoTemplateGet,
|
|
5348
|
+
Yo as TengoTemplateGetRegistry,
|
|
5349
|
+
Zo as TengoTemplateGetTemplate,
|
|
5350
|
+
Qo as TengoTemplateGetTemplateURI,
|
|
5351
|
+
tu as TengoTemplatePack,
|
|
5352
|
+
ru as TengoTemplatePackConvert,
|
|
5353
|
+
ou as TengoTemplatePackConvertTemplate,
|
|
5354
|
+
su as TengoTemplatePackConvertTemplatePack,
|
|
5355
|
+
eu as V1CentralDevSnapshotRegistry,
|
|
5356
|
+
Zl as V1CentralRegistry,
|
|
5341
5357
|
Co as V2RegistryProvider,
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5358
|
+
nu as checkNetwork,
|
|
5359
|
+
Qr as createRenderTemplate,
|
|
5360
|
+
zr as getDevV1PacketMtime,
|
|
5361
|
+
At as getDevV2PacketMtime,
|
|
5362
|
+
bl as initDriverKit,
|
|
5363
|
+
Lt as loadTemplate,
|
|
5364
|
+
en as prepareTemplateSpec
|
|
5349
5365
|
};
|
|
5350
5366
|
//# sourceMappingURL=index.mjs.map
|