@milaboratories/pl-middle-layer 1.22.4 → 1.22.6

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.mjs CHANGED
@@ -1,34 +1,34 @@
1
1
  var cs = Object.defineProperty;
2
2
  var ls = (s, e, t) => e in s ? cs(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
3
  var S = (s, e, t) => ls(s, typeof e != "symbol" ? e + "" : e, t);
4
- import { mapValueInVOE as br, executePSpecPredicate as us, mapPObjectData as ge, mapPTableDef as Cr, JsRenderInternal as ds, extractConfig as Er, isConfigLambda as Rr, DefaultNavigationState as ps, extractAllColumns as hs } from "@platforma-sdk/model";
4
+ import { mapValueInVOE as br, executePSpecPredicate as us, mapPObjectData as ce, mapPTableDef as Cr, JsRenderInternal as ds, extractConfig as Er, isConfigLambda as Rr, DefaultNavigationState as ps, extractAllColumns as hs } from "@platforma-sdk/model";
5
5
  export * from "@platforma-sdk/model";
6
- import { AnyChannel as we, StableChannel as ne, blockPackIdToString as Lt, blockPackIdEquals as Nt } from "@milaboratories/pl-model-middle-layer";
6
+ import { AnyChannel as Se, StableChannel as ne, blockPackIdToString as Ft, blockPackIdEquals as Lt } from "@milaboratories/pl-model-middle-layer";
7
7
  export * from "@milaboratories/pl-model-middle-layer";
8
8
  import { request as ie, RetryAgent as fs } from "undici";
9
- import { RegistryV1 as ce, tryLoadPackDescription as st, BlockPackMetaEmbedAbsoluteBytes as gs, RegistryV2Reader as ms, folderReaderByUrl as vs, loadPackDescription as Dt } from "@platforma-sdk/block-tools";
9
+ import { RegistryV1 as le, tryLoadPackDescription as ot, BlockPackMetaEmbedAbsoluteBytes as gs, RegistryV2Reader as ms, folderReaderByUrl as vs, loadPackDescription as Nt } from "@platforma-sdk/block-tools";
10
10
  import q from "node:fs";
11
11
  import H from "node:path";
12
12
  import ys from "yaml";
13
13
  import { assertNever as J, notEmpty as x, ConsoleLoggerAdapter as ws, ConcurrencyLimitingExecutor as Ss, HmacSha256Signer as kr } from "@milaboratories/ts-helpers";
14
14
  import * as Pr from "node:fs/promises";
15
15
  import { tryResolve as bs } from "@milaboratories/resolve-helper";
16
- import { resourceTypesEqual as ae, field as D, Pl as F, PlClient as Cs, isNullResourceId as De, ensureResourceIdNotNull as ot, isResource as Es, isResourceRef as Rs, isNotNullResourceId as Bt, resourceType as Pe, resourceTypeToString as ks, resourceIdToString as $r, isNotFoundError as Ps, isTimeoutOrCancelError as $s, toGlobalResourceId as Os, plAddressToConfig as Is, UnauthenticatedPlClient as xt } from "@milaboratories/pl-client";
16
+ import { resourceTypesEqual as ae, field as D, Pl as T, PlClient as Cs, isNullResourceId as Be, ensureResourceIdNotNull as nt, isResource as Es, isResourceRef as Rs, isNotNullResourceId as Dt, resourceType as $e, resourceTypeToString as ks, resourceIdToString as $r, isNotFoundError as Ps, isTimeoutOrCancelError as $s, toGlobalResourceId as Os, plAddressToConfig as Is, UnauthenticatedPlClient as Bt } from "@milaboratories/pl-client";
17
17
  export * from "@milaboratories/pl-client";
18
- import { SynchronizedTreeState as Or, PlError as As, isPlTreeNodeAccessor as Fs } from "@milaboratories/pl-tree";
19
- import { Computable as V, ChangeSource as jt, PollComputablePool as Ts, WatchableValue as Ls } from "@milaboratories/computable";
20
- import { randomUUID as Ee, createHash as Ve } from "node:crypto";
18
+ import { SynchronizedTreeState as Or, PlError as As, isPlTreeNodeAccessor as Ts } from "@milaboratories/pl-tree";
19
+ import { Computable as V, ChangeSource as xt, PollComputablePool as Fs, WatchableValue as Ls } from "@milaboratories/computable";
20
+ import { randomUUID as Re, createHash as Ue } from "node:crypto";
21
21
  import Ir from "denque";
22
22
  import { Templates as Ns } from "@platforma-sdk/workflow-tengo";
23
- import mt from "canonicalize";
23
+ import me from "canonicalize";
24
24
  import Ds from "node:assert";
25
- import { Scope as nt, getQuickJS as Bs } from "quickjs-emscripten";
25
+ import { Scope as it, getQuickJS as Bs } from "quickjs-emscripten";
26
26
  import { setTimeout as Ar } from "node:timers/promises";
27
27
  import { createDownloadClient as xs, createLogsClient as js, createUploadBlobClient as Vs, createUploadProgressClient as Us, DownloadDriver as Gs, UploadDriver as Js, LogsStreamDriver as Ms, LogsDriver as _s, LsDriver as Ks, DownloadUrlDriver as Hs } from "@milaboratories/pl-drivers";
28
28
  import { PFrame as Ws } from "@milaboratories/pframes-node";
29
29
  import { LRUCache as zs } from "lru-cache";
30
30
  import { channel as Xs } from "node:diagnostics_channel";
31
- async function Vt(s) {
31
+ async function jt(s) {
32
32
  try {
33
33
  return await Pr.stat(s, { bigint: !0 });
34
34
  } catch (e) {
@@ -37,30 +37,30 @@ async function Vt(s) {
37
37
  throw e;
38
38
  }
39
39
  }
40
- const qs = [ce.PlPackageYamlConfigFile], Ys = [ce.PlPackageJsonConfigFile], vt = ["backend", "dist", "tengo", "tpl", "main.plj.gz"], yt = ["config", "dist", "config.json"], Fr = ["frontend", "dist"], Ut = "block-model/dist/config.json", Zs = "block-ui/package.json", Qs = [
40
+ const qs = [le.PlPackageYamlConfigFile], Ys = [le.PlPackageJsonConfigFile], mt = ["backend", "dist", "tengo", "tpl", "main.plj.gz"], vt = ["config", "dist", "config.json"], Tr = ["frontend", "dist"], Vt = "block-model/dist/config.json", Zs = "block-ui/package.json", Qs = [
41
+ mt,
41
42
  vt,
42
- yt,
43
43
  qs,
44
44
  Ys,
45
- Fr
45
+ Tr
46
46
  ];
47
47
  async function eo(s) {
48
- return await Vt(H.join(s, ...yt)) !== void 0 || await Vt(H.join(s, ...vt)) !== void 0;
48
+ return await jt(H.join(s, ...vt)) !== void 0 || await jt(H.join(s, ...mt)) !== void 0;
49
49
  }
50
- function We(s, e) {
50
+ function ze(s, e) {
51
51
  const t = bs(s, e);
52
52
  if (t === void 0) throw new Error(`Can't resolve ${e} against ${s}`);
53
53
  return t;
54
54
  }
55
- async function Gt(s, e) {
55
+ async function Ut(s, e) {
56
56
  if (H.isAbsolute(s) || (s = H.resolve(s)), await eo(s))
57
57
  return {
58
- workflow: H.join(s, ...vt),
59
- config: H.join(s, ...yt),
60
- ui: H.join(s, ...Fr)
58
+ workflow: H.join(s, ...mt),
59
+ config: H.join(s, ...vt),
60
+ ui: H.join(s, ...Tr)
61
61
  };
62
62
  {
63
- const t = We(s, Ut), r = We(s, Ut), o = We(s, Zs);
63
+ const t = ze(s, Vt), r = ze(s, Vt), o = ze(s, Zs);
64
64
  return { workflow: t, config: r, ui: H.resolve(o, "..", "dist") };
65
65
  }
66
66
  }
@@ -82,7 +82,7 @@ async function ro(s) {
82
82
  throw e;
83
83
  }
84
84
  }
85
- async function Tr(s) {
85
+ async function Fr(s) {
86
86
  let e = 0n;
87
87
  for (const t of Qs) {
88
88
  const r = H.join(s, ...t), o = await ro(r);
@@ -90,13 +90,13 @@ async function Tr(s) {
90
90
  }
91
91
  return e.toString();
92
92
  }
93
- async function wt(s) {
93
+ async function yt(s) {
94
94
  const e = await q.promises.stat(s.components.workflow.main.file, {
95
95
  bigint: !0
96
96
  }), t = await q.promises.stat(s.components.model.file, { bigint: !0 });
97
97
  return (e.mtimeNs > t.mtimeNs ? e.mtimeNs : t.mtimeNs).toString();
98
98
  }
99
- class $l {
99
+ class Il {
100
100
  constructor(e, t, r) {
101
101
  this.v2Provider = e, this.registries = t, this.http = r;
102
102
  }
@@ -105,13 +105,13 @@ class $l {
105
105
  switch (r.type) {
106
106
  case "remote-v1":
107
107
  const o = this.http !== void 0 ? { dispatcher: this.http } : {}, i = await (await ie(
108
- `${r.url}/${ce.GlobalOverviewPath}`,
108
+ `${r.url}/${le.GlobalOverviewPath}`,
109
109
  o
110
110
  )).body.json();
111
- for (const l of i) {
112
- const { organization: a, package: c, latestMeta: u, latestVersion: d } = l, m = {
111
+ for (const c of i) {
112
+ const { organization: a, package: l, latestMeta: u, latestVersion: d } = c, m = {
113
113
  organization: a,
114
- name: c,
114
+ name: l,
115
115
  version: d
116
116
  }, h = {
117
117
  id: m,
@@ -133,35 +133,35 @@ class $l {
133
133
  registryId: e.id,
134
134
  id: m,
135
135
  latestByChannel: {
136
- [we]: h,
136
+ [Se]: h,
137
137
  [ne]: h
138
138
  },
139
- allVersions: l.allVersions.map((f) => ({ version: f, channels: [] }))
139
+ allVersions: c.allVersions.map((f) => ({ version: f, channels: [] }))
140
140
  });
141
141
  }
142
142
  return t;
143
143
  case "remote-v2":
144
144
  return (await this.v2Provider.getRegistry(r.url).listBlockPacks()).map(
145
- (l) => l.latestByChannel[ne] ? {
146
- ...l,
145
+ (c) => c.latestByChannel[ne] ? {
146
+ ...c,
147
147
  registryId: e.id
148
148
  } : {
149
- ...l,
149
+ ...c,
150
150
  latestByChannel: {
151
- ...l.latestByChannel,
152
- [ne]: ((a) => a.spec.type === "from-registry-v2" ? { ...a, spec: { ...a.spec, channel: ne } } : a)(l.latestByChannel[we])
151
+ ...c.latestByChannel,
152
+ [ne]: ((a) => a.spec.type === "from-registry-v2" ? { ...a, spec: { ...a.spec, channel: ne } } : a)(c.latestByChannel[Se])
153
153
  },
154
154
  registryId: e.id
155
155
  }
156
156
  );
157
157
  case "local-dev":
158
- for (const l of await q.promises.readdir(r.path, { withFileTypes: !0 })) {
159
- if (!l.isDirectory()) continue;
160
- const a = H.join(r.path, l.name), c = await to(
161
- H.join(a, ce.PlPackageYamlConfigFile)
158
+ for (const c of await q.promises.readdir(r.path, { withFileTypes: !0 })) {
159
+ if (!c.isDirectory()) continue;
160
+ const a = H.join(r.path, c.name), l = await to(
161
+ H.join(a, le.PlPackageYamlConfigFile)
162
162
  );
163
- if (c !== void 0) {
164
- const u = ce.PlPackageConfigData.parse(ys.parse(c)), d = await Tr(a), m = {
163
+ if (l !== void 0) {
164
+ const u = le.PlPackageConfigData.parse(ys.parse(l)), d = await Fr(a), m = {
165
165
  organization: u.organization,
166
166
  name: u.package,
167
167
  version: "DEV"
@@ -185,19 +185,19 @@ class $l {
185
185
  registryId: e.id,
186
186
  id: m,
187
187
  latestByChannel: {
188
- [we]: h,
188
+ [Se]: h,
189
189
  [ne]: h
190
190
  },
191
191
  allVersions: []
192
192
  });
193
193
  } else {
194
- let u = a, d = await st(u);
194
+ let u = a, d = await ot(u);
195
195
  if (d === void 0) {
196
196
  for (const m of ["block", "meta"])
197
- if (u = H.join(a, m), d = await st(u), d !== void 0) break;
197
+ if (u = H.join(a, m), d = await ot(u), d !== void 0) break;
198
198
  }
199
199
  if (d !== void 0) {
200
- const m = await wt(d), h = {
200
+ const m = await yt(d), h = {
201
201
  id: d.id,
202
202
  meta: await gs.parseAsync(d.meta),
203
203
  spec: {
@@ -210,7 +210,7 @@ class $l {
210
210
  registryId: e.id,
211
211
  id: d.id,
212
212
  latestByChannel: {
213
- [we]: h,
213
+ [Se]: h,
214
214
  [ne]: h
215
215
  },
216
216
  allVersions: []
@@ -231,7 +231,7 @@ class $l {
231
231
  }
232
232
  async getOverview(e, t, r) {
233
233
  var i;
234
- const o = (i = this.registries.find((l) => l.id === e)) == null ? void 0 : i.spec;
234
+ const o = (i = this.registries.find((c) => c.id === e)) == null ? void 0 : i.spec;
235
235
  if (!o) throw new Error(`Registry with id "${e}" not found`);
236
236
  if (o.type !== "remote-v2")
237
237
  throw new Error(
@@ -252,13 +252,13 @@ class so {
252
252
  return this.registries.set(e, r), r;
253
253
  }
254
254
  }
255
- const Ol = {
255
+ const Al = {
256
256
  type: "remote-v2",
257
257
  url: "https://blocks.pl-open.science/"
258
- }, Il = {
258
+ }, Tl = {
259
259
  type: "remote-v1",
260
260
  url: "https://block.registry.platforma.bio/releases"
261
- }, Al = {
261
+ }, Fl = {
262
262
  type: "remote-v1",
263
263
  url: "https://block.registry.platforma.bio/dev"
264
264
  }, oo = {
@@ -268,22 +268,22 @@ const Ol = {
268
268
  blocksInLimbo: []
269
269
  }, io = {
270
270
  label: "New Project"
271
- }, ao = { name: "UserProject", version: "2" }, Lr = "SchemaVersion", Nr = "1", St = "ProjectCreated", Re = "ProjectLastModified", ke = "ProjectMeta", le = "ProjectStructure", Be = "BlockRenderingState", co = "BlockFrontendState/", lo = /^BlockFrontendState\/(?<blockid>.*)$/;
272
- function it(s) {
271
+ }, ao = { name: "UserProject", version: "2" }, Lr = "SchemaVersion", Nr = "1", wt = "ProjectCreated", ke = "ProjectLastModified", Pe = "ProjectMeta", ue = "ProjectStructure", xe = "BlockRenderingState", co = "BlockFrontendState/", lo = /^BlockFrontendState\/(?<blockid>.*)$/;
272
+ function at(s) {
273
273
  return `${co}${s}`;
274
274
  }
275
275
  const uo = "BlockArgsAuthor/";
276
- function at(s) {
276
+ function ct(s) {
277
277
  return `${uo}${s}`;
278
278
  }
279
- const ct = "ProjectStructureAuthor";
279
+ const lt = "ProjectStructureAuthor";
280
280
  function po(s) {
281
281
  const e = s.match(lo);
282
282
  if (e !== null)
283
283
  return e.groups.blockid;
284
284
  }
285
285
  const ho = "__serviceTemplate_";
286
- function lt(s) {
286
+ function ut(s) {
287
287
  return `${ho}${s}`;
288
288
  }
289
289
  function U(s, e) {
@@ -308,14 +308,14 @@ async function yo(s, e, t, r) {
308
308
  r.logger
309
309
  );
310
310
  return { computable: V.make((i) => {
311
- const l = i.accessor(o.entry()).node(), a = t.getValue(i);
312
- if (l === void 0) return;
313
- const c = [];
314
- for (const u of l.listDynamicFields()) {
315
- const d = l.traverse(u);
311
+ const c = i.accessor(o.entry()).node(), a = t.getValue(i);
312
+ if (c === void 0) return;
313
+ const l = [];
314
+ for (const u of c.listDynamicFields()) {
315
+ const d = c.traverse(u);
316
316
  if (d === void 0) continue;
317
- const m = x(d.getKeyValueAsJson(ke)), h = x(d.getKeyValueAsJson(St)), f = x(d.getKeyValueAsJson(Re));
318
- c.push({
317
+ const m = x(d.getKeyValueAsJson(Pe)), h = x(d.getKeyValueAsJson(wt)), f = x(d.getKeyValueAsJson(ke));
318
+ l.push({
319
319
  id: u,
320
320
  rid: d.id,
321
321
  created: new Date(h),
@@ -324,7 +324,7 @@ async function yo(s, e, t, r) {
324
324
  meta: m
325
325
  });
326
326
  }
327
- return c.sort((u) => -u.lastModified.valueOf()), c;
327
+ return l.sort((u) => -u.lastModified.valueOf()), l;
328
328
  }).withStableType(), tree: o };
329
329
  }
330
330
  const wo = {
@@ -336,11 +336,11 @@ const wo = {
336
336
  };
337
337
  function Br(s, e, t, r, o) {
338
338
  if (o.length === 0) throw new Error("Zero output names provided");
339
- const n = t ? s.createEphemeral(wo) : s.createStruct(So), i = D(n, "template"), l = D(n, "inputs");
340
- return s.createField(i, "Input", e), s.createField(l, "Input", F.createPlMap(s, r, t)), s.lockInputs(n), F.futureRecord(s, n, o, "Output", "outputs/");
339
+ const n = t ? s.createEphemeral(wo) : s.createStruct(So), i = D(n, "template"), c = D(n, "inputs");
340
+ return s.createField(i, "Input", e), s.createField(c, "Input", T.createPlMap(s, r, t)), s.lockInputs(n), T.futureRecord(s, n, o, "Output", "outputs/");
341
341
  }
342
342
  const bo = { name: "BContextEnd", version: "1" }, Co = { name: "BContext", version: "1" }, Eo = "id", Ro = "parent/", ko = ["context", "result"];
343
- function Jt(s, e, t) {
343
+ function Gt(s, e, t) {
344
344
  return Br(s, e, !0, t, ko);
345
345
  }
346
346
  function Po(s) {
@@ -351,12 +351,12 @@ function $o(s, e) {
351
351
  if (e.length === 0) return Po(s);
352
352
  if (e.length === 1) return e[0];
353
353
  const t = s.createEphemeral(Co);
354
- s.createField(D(t, Eo), "Input", F.createPlString(s, Ee()));
354
+ s.createField(D(t, Eo), "Input", T.createPlString(s, Re()));
355
355
  for (let r = 0; r < e.length; r++)
356
356
  s.createField(D(t, `${Ro}${r}`), "Input", e[r]);
357
357
  return s.lock(t), t;
358
358
  }
359
- const Oo = { name: "TengoTemplateGet", version: "1" }, Io = "registry", Ao = "templateURI", Fo = "template", To = { name: "TengoTemplatePack", version: "1" }, Lo = {
359
+ const Oo = { name: "TengoTemplateGet", version: "1" }, Io = "registry", Ao = "templateURI", To = "template", Fo = { name: "TengoTemplatePack", version: "1" }, Lo = {
360
360
  name: "TengoTemplatePackConvert",
361
361
  version: "1"
362
362
  }, No = "templatePack", Do = "template";
@@ -375,14 +375,14 @@ async function Bo(s) {
375
375
  }
376
376
  }
377
377
  function xo(s, e) {
378
- const t = s.createStruct(Oo), r = D(t, Io), o = D(t, Ao), n = D(t, Fo);
379
- return s.setField(r, s.createValue(F.JsonString, Buffer.from(JSON.stringify(e.registry)))), s.setField(o, s.createValue(F.JsonString, Buffer.from(JSON.stringify(e.path)))), n;
378
+ const t = s.createStruct(Oo), r = D(t, Io), o = D(t, Ao), n = D(t, To);
379
+ return s.setField(r, s.createValue(T.JsonString, Buffer.from(JSON.stringify(e.registry)))), s.setField(o, s.createValue(T.JsonString, Buffer.from(JSON.stringify(e.path)))), n;
380
380
  }
381
381
  function jo(s, e) {
382
- const t = s.createValue(To, e.content), r = s.createStruct(Lo), o = D(r, No), n = D(r, Do);
382
+ const t = s.createValue(Fo, e.content), r = s.createStruct(Lo), o = D(r, No), n = D(r, Do);
383
383
  return s.setField(o, t), n;
384
384
  }
385
- function bt(s, e) {
385
+ function St(s, e) {
386
386
  switch (e.type) {
387
387
  case "from-registry":
388
388
  return xo(s, e);
@@ -416,7 +416,7 @@ function Vo(s, e) {
416
416
  }
417
417
  }
418
418
  const Uo = { name: "BlockPackCustom", version: "1" }, Vr = "template", Ur = "frontend";
419
- function Mt(s) {
419
+ function Jt(s) {
420
420
  return s.endsWith("/") ? s : `${s}/`;
421
421
  }
422
422
  class Go {
@@ -428,17 +428,17 @@ class Go {
428
428
  case "explicit":
429
429
  return e.config;
430
430
  case "dev-v1": {
431
- const t = await Gt(e.folder), r = await q.promises.readFile(t.config, { encoding: "utf-8" });
431
+ const t = await Ut(e.folder), r = await q.promises.readFile(t.config, { encoding: "utf-8" });
432
432
  return JSON.parse(r);
433
433
  }
434
434
  case "dev-v2": {
435
- const t = await Dt(e.folder), r = await q.promises.readFile(t.components.model.file, {
435
+ const t = await Nt(e.folder), r = await q.promises.readFile(t.components.model.file, {
436
436
  encoding: "utf-8"
437
437
  });
438
438
  return JSON.parse(r);
439
439
  }
440
440
  case "from-registry-v1": {
441
- const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${Mt(e.registryUrl)}${ce.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`;
441
+ const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${Jt(e.registryUrl)}${le.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`;
442
442
  return await (await ie(`${r}/config.json`, t)).body.json();
443
443
  }
444
444
  case "from-registry-v2": {
@@ -454,7 +454,7 @@ class Go {
454
454
  case "explicit":
455
455
  return e;
456
456
  case "dev-v1": {
457
- const t = await Gt(e.folder), r = await q.promises.readFile(t.workflow), o = JSON.parse(
457
+ const t = await Ut(e.folder), r = await q.promises.readFile(t.workflow), o = JSON.parse(
458
458
  await q.promises.readFile(t.config, "utf-8")
459
459
  ), n = t.ui;
460
460
  return {
@@ -473,14 +473,14 @@ class Go {
473
473
  };
474
474
  }
475
475
  case "dev-v2": {
476
- const t = await Dt(e.folder), r = JSON.parse(
476
+ const t = await Nt(e.folder), r = JSON.parse(
477
477
  await q.promises.readFile(t.components.model.file, {
478
478
  encoding: "utf-8"
479
479
  })
480
480
  ), o = await q.promises.readFile(
481
481
  t.components.workflow.main.file
482
482
  ), n = t.components.ui.folder, i = { ...e };
483
- return e.mtime === void 0 && (i.mtime = await wt(t)), {
483
+ return e.mtime === void 0 && (i.mtime = await yt(t)), {
484
484
  type: "explicit",
485
485
  template: {
486
486
  type: "explicit",
@@ -496,7 +496,7 @@ class Go {
496
496
  };
497
497
  }
498
498
  case "from-registry-v1": {
499
- const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${Mt(e.registryUrl)}${ce.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, o = `${r}/template.plj.gz`, n = await ie(o, t);
499
+ const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${Jt(e.registryUrl)}${le.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, o = `${r}/template.plj.gz`, n = await ie(o, t);
500
500
  if (n.statusCode !== 200)
501
501
  throw new Error(
502
502
  `Block not found in registry (url = ${o} ; code = ${n.statusCode}): ` + JSON.stringify(e)
@@ -517,14 +517,14 @@ class Go {
517
517
  };
518
518
  }
519
519
  case "from-registry-v2": {
520
- const t = this.http !== void 0 ? { dispatcher: this.http } : {}, o = await this.v2RegistryProvider.getRegistry(e.registryUrl).getComponents(e.id), n = async () => await (await ie(o.model.url, t)).body.json(), i = async () => await (await ie(o.workflow.main.url, t)).body.arrayBuffer(), [l, a] = await Promise.all([n(), i()]);
520
+ const t = this.http !== void 0 ? { dispatcher: this.http } : {}, o = await this.v2RegistryProvider.getRegistry(e.registryUrl).getComponents(e.id), n = async () => await (await ie(o.model.url, t)).body.json(), i = async () => await (await ie(o.workflow.main.url, t)).body.arrayBuffer(), [c, a] = await Promise.all([n(), i()]);
521
521
  return {
522
522
  type: "explicit",
523
523
  template: {
524
524
  type: "explicit",
525
525
  content: Buffer.from(a)
526
526
  },
527
- config: l,
527
+ config: c,
528
528
  frontend: {
529
529
  type: "url",
530
530
  url: o.ui.url
@@ -539,9 +539,9 @@ class Go {
539
539
  }
540
540
  function Jo(s, e) {
541
541
  const t = { config: e.config, source: e.source }, r = s.createStruct(Uo, JSON.stringify(t));
542
- return s.createField(D(r, Vr), "Input", bt(s, e.template)), s.createField(D(r, Ur), "Input", Vo(s, e.frontend)), s.lock(r), r;
542
+ return s.createField(D(r, Vr), "Input", St(s, e.template)), s.createField(D(r, Ur), "Input", Vo(s, e.frontend)), s.lock(r), r;
543
543
  }
544
- function _t(s, e) {
544
+ function Mt(s, e) {
545
545
  switch (e.type) {
546
546
  case "explicit":
547
547
  return Jo(s, e);
@@ -549,13 +549,13 @@ function _t(s, e) {
549
549
  return J(e.type);
550
550
  }
551
551
  }
552
- function Oe(s, e) {
552
+ function Ie(s, e) {
553
553
  return { __isRef: !0, blockId: s, name: e };
554
554
  }
555
555
  function Mo(s) {
556
556
  return typeof s == "object" && s !== null && s.__isRef === !0 && "blockId" in s && "name" in s;
557
557
  }
558
- function ut(s, e, t) {
558
+ function dt(s, e, t) {
559
559
  const r = typeof e;
560
560
  switch (r) {
561
561
  case "function":
@@ -571,10 +571,10 @@ function ut(s, e, t) {
571
571
  if (Mo(e))
572
572
  t === void 0 || t.has(e.blockId) ? s.upstreams.add(e.blockId) : s.missingReferences = !0;
573
573
  else if (Array.isArray(e))
574
- for (const o of e) ut(s, o, t);
574
+ for (const o of e) dt(s, o, t);
575
575
  else
576
576
  for (const [, o] of Object.entries(e))
577
- ut(s, o, t);
577
+ dt(s, o, t);
578
578
  return;
579
579
  default:
580
580
  J(r);
@@ -582,7 +582,7 @@ function ut(s, e, t) {
582
582
  }
583
583
  function _o(s, e) {
584
584
  const t = { upstreams: /* @__PURE__ */ new Set(), missingReferences: !1 };
585
- return ut(t, s, e), t;
585
+ return dt(t, s, e), t;
586
586
  }
587
587
  function te(s) {
588
588
  return {
@@ -611,17 +611,17 @@ class Gr {
611
611
  const n = new Set(o);
612
612
  for (; o.length > 0; ) {
613
613
  let i = [];
614
- for (const l of o) {
615
- const a = this.nodes.get(l);
616
- r(a), a[e].forEach((c) => {
617
- n.has(c) || (n.add(c), i.push(c));
614
+ for (const c of o) {
615
+ const a = this.nodes.get(c);
616
+ r(a), a[e].forEach((l) => {
617
+ n.has(l) || (n.add(l), i.push(l));
618
618
  });
619
619
  }
620
620
  o = i;
621
621
  }
622
622
  }
623
623
  }
624
- function dt(s) {
624
+ function pt(s) {
625
625
  const e = /* @__PURE__ */ new Map();
626
626
  let t;
627
627
  for (const { id: r } of te(s)) {
@@ -633,19 +633,19 @@ function dt(s) {
633
633
  }
634
634
  return t !== void 0 && (t.downstream = /* @__PURE__ */ new Set()), new Gr(e);
635
635
  }
636
- function Ne(s, e) {
636
+ function De(s, e) {
637
637
  const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
638
638
  for (const { id: o } of te(s)) {
639
639
  const n = e(o);
640
640
  if (n === void 0) continue;
641
- const i = _o(n, r), l = {
641
+ const i = _o(n, r), c = {
642
642
  id: o,
643
643
  missingReferences: i.missingReferences,
644
644
  upstream: i.upstreams,
645
645
  downstream: /* @__PURE__ */ new Set()
646
646
  // will be populated from downstream blocks
647
647
  };
648
- t.set(o, l), i.upstreams.forEach((a) => t.get(a).downstream.add(o)), r.add(o);
648
+ t.set(o, c), i.upstreams.forEach((a) => t.get(a).downstream.add(o)), r.add(o);
649
649
  }
650
650
  return new Gr(t);
651
651
  }
@@ -654,34 +654,34 @@ function Ko(s, e) {
654
654
  for (const t of s) if (!e.has(t)) return !1;
655
655
  return !0;
656
656
  }
657
- function pt(s, e) {
658
- if (s.size > e.size) return pt(e, s);
657
+ function ht(s, e) {
658
+ if (s.size > e.size) return ht(e, s);
659
659
  for (const t of s) if (e.has(t)) return !0;
660
660
  return !1;
661
661
  }
662
- function Kt(s, e) {
662
+ function _t(s, e) {
663
663
  const t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
664
664
  return s.nodes.forEach((n) => {
665
665
  const i = e.nodes.get(n.id);
666
- i === void 0 ? t.add(n.id) : (!Ko(n.upstream, i.upstream) || pt(n.upstream, o)) && o.add(n.id);
666
+ i === void 0 ? t.add(n.id) : (!Ko(n.upstream, i.upstream) || ht(n.upstream, o)) && o.add(n.id);
667
667
  }), e.nodes.forEach((n) => {
668
- s.nodes.has(n.id) ? pt(n.upstream, o) && o.add(n.id) : r.add(n.id);
668
+ s.nodes.has(n.id) ? ht(n.upstream, o) && o.add(n.id) : r.add(n.id);
669
669
  }), { onlyInA: t, onlyInB: r, different: o };
670
670
  }
671
- let ze;
671
+ let Xe;
672
672
  async function Jr() {
673
- if (ze === void 0) {
673
+ if (Xe === void 0) {
674
674
  const s = await Bo(Ns["pframes.export-pframe"]);
675
675
  if (s.type !== "explicit") throw new Error("Unexpected prepared template type.");
676
- const e = Ve("sha256").update(s.content).digest("hex");
677
- ze = { spec: s, hash: e };
676
+ const e = Ue("sha256").update(s.content).digest("hex");
677
+ Xe = { spec: s, hash: e };
678
678
  }
679
- return ze;
679
+ return Xe;
680
680
  }
681
681
  function Ho(s, e, t) {
682
682
  return Br(s, e, !0, { pf: t }, ["result"]).result;
683
683
  }
684
- function Xe(s, e) {
684
+ function qe(s, e) {
685
685
  let t = !1, r, o;
686
686
  return () => {
687
687
  if (!t)
@@ -690,13 +690,13 @@ function Xe(s, e) {
690
690
  return r !== n && (r = n, o = e()), e();
691
691
  };
692
692
  }
693
- class Ht {
693
+ class Kt {
694
694
  constructor(e, t) {
695
- S(this, "currentInputsC", Xe(
695
+ S(this, "currentInputsC", qe(
696
696
  () => this.fields.currentArgs.modCount,
697
697
  () => JSON.parse(Buffer.from(this.fields.currentArgs.value).toString())
698
698
  ));
699
- S(this, "actualProductionInputsC", Xe(
699
+ S(this, "actualProductionInputsC", qe(
700
700
  () => {
701
701
  var e;
702
702
  return (e = this.fields.prodArgs) == null ? void 0 : e.modCount;
@@ -708,7 +708,7 @@ class Ht {
708
708
  return JSON.parse(Buffer.from(e).toString());
709
709
  }
710
710
  ));
711
- S(this, "productionStaleC", Xe(
711
+ S(this, "productionStaleC", qe(
712
712
  () => {
713
713
  var e;
714
714
  return `${this.fields.currentArgs.modCount}_${(e = this.fields.prodArgs) == null ? void 0 : e.modCount}`;
@@ -749,7 +749,7 @@ class Ht {
749
749
  }
750
750
  getTemplate(e) {
751
751
  return e.getFutureFieldValue(
752
- F.unwrapHolder(e, this.fields.blockPack.ref),
752
+ T.unwrapHolder(e, this.fields.blockPack.ref),
753
753
  Vr,
754
754
  "Input"
755
755
  );
@@ -758,8 +758,8 @@ class Ht {
758
758
  const Wo = (s) => {
759
759
  throw new Error(`No new block info for ${s}`);
760
760
  };
761
- class xe {
762
- constructor(e, t, r, o, n, i, l, a, c, u, d, m) {
761
+ class je {
762
+ constructor(e, t, r, o, n, i, c, a, l, u, d, m) {
763
763
  S(this, "globalModCount", 0);
764
764
  S(this, "fieldsChanged", !1);
765
765
  //
@@ -778,7 +778,7 @@ class xe {
778
778
  S(this, "stagingGraph");
779
779
  S(this, "pendingProductionGraph");
780
780
  S(this, "actualProductionGraph");
781
- this.rid = e, this.tx = t, this.author = r, this.schema = o, this.lastModified = n, this.meta = i, this.struct = l, this.renderingState = a, this.blocksInLimbo = c, this.blockInfos = u, this.blockFrontendStates = d, this.ctxExportTplHolder = m;
781
+ this.rid = e, this.tx = t, this.author = r, this.schema = o, this.lastModified = n, this.meta = i, this.struct = c, this.renderingState = a, this.blocksInLimbo = l, this.blockInfos = u, this.blockFrontendStates = d, this.ctxExportTplHolder = m;
782
782
  }
783
783
  fixProblems() {
784
784
  this.blockInfos.forEach((e) => {
@@ -792,16 +792,16 @@ class xe {
792
792
  return JSON.parse(JSON.stringify(this.struct));
793
793
  }
794
794
  getStagingGraph() {
795
- return this.stagingGraph === void 0 && (this.stagingGraph = dt(this.struct)), this.stagingGraph;
795
+ return this.stagingGraph === void 0 && (this.stagingGraph = pt(this.struct)), this.stagingGraph;
796
796
  }
797
797
  getPendingProductionGraph() {
798
- return this.pendingProductionGraph === void 0 && (this.pendingProductionGraph = Ne(
798
+ return this.pendingProductionGraph === void 0 && (this.pendingProductionGraph = De(
799
799
  this.struct,
800
800
  (e) => this.getBlockInfo(e).currentInputs
801
801
  )), this.pendingProductionGraph;
802
802
  }
803
803
  getActualProductionGraph() {
804
- return this.actualProductionGraph === void 0 && (this.actualProductionGraph = Ne(
804
+ return this.actualProductionGraph === void 0 && (this.actualProductionGraph = De(
805
805
  this.struct,
806
806
  (e) => this.getBlockInfo(e).actualProductionInputs
807
807
  )), this.actualProductionGraph;
@@ -870,8 +870,8 @@ class xe {
870
870
  JSON.parse(o);
871
871
  const i = Buffer.from(o);
872
872
  if (Buffer.compare(n.fields.currentArgs.value, i) === 0) continue;
873
- const l = this.tx.createValue(F.JsonObject, i);
874
- this.setBlockField(r, "currentArgs", l, "Ready", i), this.blocksWithChangedInputs.add(r), t.push(r);
873
+ const c = this.tx.createValue(T.JsonObject, i);
874
+ this.setBlockField(r, "currentArgs", c, "Ready", i), this.blocksWithChangedInputs.add(r), t.push(r);
875
875
  }
876
876
  this.getStagingGraph().traverse("downstream", t, ({ id: r }) => this.resetStaging(r)), t.length > 0 && this.updateLastModified();
877
877
  }
@@ -899,26 +899,26 @@ class xe {
899
899
  const n = this.getBlockInfo(o);
900
900
  if (n.fields[t] === void 0 || n.fields[t].ref === void 0)
901
901
  throw new Error("One of the upstreams staging is not rendered.");
902
- r.push(F.unwrapHolder(this.tx, n.fields[t].ref));
902
+ r.push(T.unwrapHolder(this.tx, n.fields[t].ref));
903
903
  }), $o(this.tx, r);
904
904
  }
905
905
  exportCtx(e) {
906
- return Ho(this.tx, F.unwrapHolder(this.tx, this.ctxExportTplHolder), e);
906
+ return Ho(this.tx, T.unwrapHolder(this.tx, this.ctxExportTplHolder), e);
907
907
  }
908
908
  renderStagingFor(e) {
909
909
  this.resetStaging(e);
910
910
  const t = this.getBlockInfo(e), r = this.createCtx(this.getStagingGraph().nodes.get(e).upstream, "stagingCtx");
911
911
  if (this.getBlock(e).renderingMode !== "Heavy") throw new Error("not supported yet");
912
- const o = t.getTemplate(this.tx), n = Jt(this.tx, o, {
912
+ const o = t.getTemplate(this.tx), n = Gt(this.tx, o, {
913
913
  args: t.fields.currentArgs.ref,
914
- blockId: this.tx.createValue(F.JsonString, JSON.stringify(e)),
915
- isProduction: this.tx.createValue(F.JsonBool, JSON.stringify(!1)),
914
+ blockId: this.tx.createValue(T.JsonString, JSON.stringify(e)),
915
+ isProduction: this.tx.createValue(T.JsonBool, JSON.stringify(!1)),
916
916
  context: r
917
917
  });
918
918
  this.setBlockField(
919
919
  e,
920
920
  "stagingCtx",
921
- F.wrapInEphHolder(this.tx, n.context),
921
+ T.wrapInEphHolder(this.tx, n.context),
922
922
  "NotReady"
923
923
  ), this.setBlockField(e, "stagingUiCtx", this.exportCtx(n.context), "NotReady"), this.setBlockField(e, "stagingOutput", n.result, "NotReady");
924
924
  }
@@ -930,16 +930,16 @@ class xe {
930
930
  );
931
931
  if (this.getBlock(e).renderingMode === "Light")
932
932
  throw new Error("Can't render production for light block.");
933
- const o = t.getTemplate(this.tx), n = Jt(this.tx, o, {
933
+ const o = t.getTemplate(this.tx), n = Gt(this.tx, o, {
934
934
  args: t.fields.currentArgs.ref,
935
- blockId: this.tx.createValue(F.JsonString, JSON.stringify(e)),
936
- isProduction: this.tx.createValue(F.JsonBool, JSON.stringify(!0)),
935
+ blockId: this.tx.createValue(T.JsonString, JSON.stringify(e)),
936
+ isProduction: this.tx.createValue(T.JsonBool, JSON.stringify(!0)),
937
937
  context: r
938
938
  });
939
939
  this.setBlockField(
940
940
  e,
941
941
  "prodCtx",
942
- F.wrapInEphHolder(this.tx, n.context),
942
+ T.wrapInEphHolder(this.tx, n.context),
943
943
  "NotReady"
944
944
  ), this.setBlockField(e, "prodUiCtx", this.exportCtx(n.context), "NotReady"), this.setBlockField(e, "prodOutput", n.result, "NotReady"), this.setBlockFieldObj(e, "prodArgs", t.fields.currentArgs), this.blocksInLimbo.delete(e) && (this.renderingStateChanged = !0);
945
945
  }
@@ -948,29 +948,29 @@ class xe {
948
948
  //
949
949
  /** Very generic method, better check for more specialized case-specific methods first. */
950
950
  updateStructure(e, t = Wo) {
951
- const r = this.getStagingGraph(), o = this.getActualProductionGraph(), n = dt(e), i = Ne(
951
+ const r = this.getStagingGraph(), o = this.getActualProductionGraph(), n = pt(e), i = De(
952
952
  e,
953
- (c) => {
953
+ (l) => {
954
954
  var u;
955
- return (u = this.blockInfos.get(c)) == null ? void 0 : u.actualProductionInputs;
955
+ return (u = this.blockInfos.get(l)) == null ? void 0 : u.actualProductionInputs;
956
956
  }
957
- ), l = Kt(r, n), a = Kt(o, i);
958
- for (const c of l.onlyInA) {
959
- const { fields: u } = this.getBlockInfo(c);
960
- this.deleteBlockFields(c, ...Object.keys(u)), this.blockInfos.delete(c), this.blocksInLimbo.delete(c) && (this.renderingStateChanged = !0), this.blockFrontendStates.delete(c) && this.changedBlockFrontendStates.add(c);
957
+ ), c = _t(r, n), a = _t(o, i);
958
+ for (const l of c.onlyInA) {
959
+ const { fields: u } = this.getBlockInfo(l);
960
+ this.deleteBlockFields(l, ...Object.keys(u)), this.blockInfos.delete(l), this.blocksInLimbo.delete(l) && (this.renderingStateChanged = !0), this.blockFrontendStates.delete(l) && this.changedBlockFrontendStates.add(l);
961
961
  }
962
- for (const c of l.onlyInB) {
963
- const u = new Ht(c, {});
964
- this.blockInfos.set(c, u);
965
- const d = t(c), m = _t(this.tx, d.blockPack);
966
- this.setBlockField(c, "blockPack", F.wrapInHolder(this.tx, m), "NotReady");
967
- const h = Buffer.from(d.args), f = this.tx.createValue(F.JsonObject, h);
968
- this.setBlockField(c, "currentArgs", f, "Ready", h), d.uiState && (this.blockFrontendStates.set(c, d.uiState), this.changedBlockFrontendStates.add(c)), u.check();
962
+ for (const l of c.onlyInB) {
963
+ const u = new Kt(l, {});
964
+ this.blockInfos.set(l, u);
965
+ const d = t(l), m = Mt(this.tx, d.blockPack);
966
+ this.setBlockField(l, "blockPack", T.wrapInHolder(this.tx, m), "NotReady");
967
+ const h = Buffer.from(d.args), f = this.tx.createValue(T.JsonObject, h);
968
+ this.setBlockField(l, "currentArgs", f, "Ready", h), d.uiState && (this.blockFrontendStates.set(l, d.uiState), this.changedBlockFrontendStates.add(l)), u.check();
969
969
  }
970
- for (const c of l.different) this.resetStaging(c);
971
- o.traverse("downstream", [...a.different], (c) => {
972
- this.resetOrLimboProduction(c.id);
973
- }), (l.onlyInB.size > 0 || l.onlyInA.size > 0 || l.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();
970
+ for (const l of c.different) this.resetStaging(l);
971
+ o.traverse("downstream", [...a.different], (l) => {
972
+ this.resetOrLimboProduction(l.id);
973
+ }), (c.onlyInB.size > 0 || c.onlyInA.size > 0 || c.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();
974
974
  }
975
975
  //
976
976
  // Structure change helpers
@@ -982,9 +982,9 @@ class xe {
982
982
  else {
983
983
  let n = !1;
984
984
  for (const i of o.groups) {
985
- const l = i.blocks.findIndex((a) => a.id === r);
986
- if (!(l < 0)) {
987
- i.blocks.splice(l, 0, e), n = !0;
985
+ const c = i.blocks.findIndex((a) => a.id === r);
986
+ if (!(c < 0)) {
987
+ i.blocks.splice(c, 0, e), n = !0;
988
988
  break;
989
989
  }
990
990
  }
@@ -1016,7 +1016,7 @@ class xe {
1016
1016
  this.setBlockField(
1017
1017
  e,
1018
1018
  "blockPack",
1019
- F.wrapInHolder(this.tx, _t(this.tx, t)),
1019
+ T.wrapInHolder(this.tx, Mt(this.tx, t)),
1020
1020
  "NotReady"
1021
1021
  ), 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(
1022
1022
  "downstream",
@@ -1035,24 +1035,24 @@ class xe {
1035
1035
  });
1036
1036
  else
1037
1037
  for (const i of r) {
1038
- const l = o.nodes.get(i);
1039
- if (l === void 0) throw new Error(`Can't find block with id: ${i}`);
1040
- for (const a of l.upstream)
1038
+ const c = o.nodes.get(i);
1039
+ if (c === void 0) throw new Error(`Can't find block with id: ${i}`);
1040
+ for (const a of c.upstream)
1041
1041
  if (!r.has(a))
1042
1042
  throw new Error("Can't render blocks not including all upstreams.");
1043
1043
  }
1044
1044
  const n = /* @__PURE__ */ new Set();
1045
1045
  for (const i of te(this.structure)) {
1046
1046
  if (!r.has(i.id)) continue;
1047
- let l = this.getBlockInfo(i.id).requireProductionRendering || this.blocksInLimbo.has(i.id);
1048
- if (!l) {
1047
+ let c = this.getBlockInfo(i.id).requireProductionRendering || this.blocksInLimbo.has(i.id);
1048
+ if (!c) {
1049
1049
  for (const a of o.nodes.get(i.id).upstream)
1050
1050
  if (n.has(a)) {
1051
- l = !0;
1051
+ c = !0;
1052
1052
  break;
1053
1053
  }
1054
1054
  }
1055
- l && (this.renderProductionFor(i.id), n.add(i.id));
1055
+ c && (this.renderProductionFor(i.id), n.add(i.id));
1056
1056
  }
1057
1057
  return o.traverse("downstream", [...n], (i) => {
1058
1058
  n.has(i.id) || this.resetOrLimboProduction(i.id);
@@ -1061,11 +1061,11 @@ class xe {
1061
1061
  /** Stops running blocks from the list and modify states of other blocks
1062
1062
  * accordingly */
1063
1063
  stopProduction(...e) {
1064
- var i, l;
1064
+ var i, c;
1065
1065
  const t = this.getActualProductionGraph(), r = new Ir(e), o = new Set(e), n = [];
1066
1066
  for (; !r.isEmpty(); ) {
1067
- const a = r.shift(), c = this.getBlockInfo(a).fields;
1068
- if (!(((i = c.prodOutput) == null ? void 0 : i.status) === "Ready" && ((l = c.prodCtx) == null ? void 0 : l.status) === "Ready") && this.deleteBlockFields(a, "prodOutput", "prodCtx", "prodUiCtx", "prodArgs")) {
1067
+ const a = r.shift(), l = this.getBlockInfo(a).fields;
1068
+ if (!(((i = l.prodOutput) == null ? void 0 : i.status) === "Ready" && ((c = l.prodCtx) == null ? void 0 : c.status) === "Ready") && this.deleteBlockFields(a, "prodOutput", "prodCtx", "prodUiCtx", "prodArgs")) {
1069
1069
  n.push(a);
1070
1070
  for (const u of t.traverseIdsExcludingRoots("downstream", a))
1071
1071
  o.has(u) || (r.push(u), o.add(u));
@@ -1078,8 +1078,8 @@ class xe {
1078
1078
  const t = /* @__PURE__ */ new Map();
1079
1079
  this.getStagingGraph().nodes.forEach((o) => {
1080
1080
  let i = this.getBlockInfo(o.id).stagingRendered ? 0 : 1;
1081
- o.upstream.forEach((l) => {
1082
- const a = t.get(l);
1081
+ o.upstream.forEach((c) => {
1082
+ const a = t.get(c);
1083
1083
  a !== 0 && (i = Math.max(a + 1, i));
1084
1084
  }), e(o.id, i), t.set(o.id, i);
1085
1085
  });
@@ -1122,28 +1122,28 @@ class xe {
1122
1122
  assignAuthorMarkers() {
1123
1123
  const e = this.author ? JSON.stringify(this.author) : void 0;
1124
1124
  for (const t of this.blocksWithChangedInputs)
1125
- e === void 0 ? this.tx.deleteKValue(this.rid, at(t)) : this.tx.setKValue(this.rid, at(t), e);
1126
- (this.metaChanged || this.structureChanged) && (e === void 0 ? this.tx.deleteKValue(this.rid, ct) : this.tx.setKValue(this.rid, ct, e));
1125
+ e === void 0 ? this.tx.deleteKValue(this.rid, ct(t)) : this.tx.setKValue(this.rid, ct(t), e);
1126
+ (this.metaChanged || this.structureChanged) && (e === void 0 ? this.tx.deleteKValue(this.rid, lt) : this.tx.setKValue(this.rid, lt, e));
1127
1127
  }
1128
1128
  save() {
1129
1129
  if (this.wasModified) {
1130
- this.lastModifiedChanged && this.tx.setKValue(this.rid, Re, JSON.stringify(this.lastModified)), this.structureChanged && this.tx.setKValue(this.rid, le, JSON.stringify(this.struct)), this.renderingStateChanged && this.tx.setKValue(
1130
+ this.lastModifiedChanged && this.tx.setKValue(this.rid, ke, JSON.stringify(this.lastModified)), this.structureChanged && this.tx.setKValue(this.rid, ue, JSON.stringify(this.struct)), this.renderingStateChanged && this.tx.setKValue(
1131
1131
  this.rid,
1132
- Be,
1132
+ xe,
1133
1133
  JSON.stringify({
1134
1134
  ...this.renderingState,
1135
1135
  blocksInLimbo: [...this.blocksInLimbo]
1136
1136
  })
1137
- ), this.metaChanged && this.tx.setKValue(this.rid, ke, JSON.stringify(this.meta));
1137
+ ), this.metaChanged && this.tx.setKValue(this.rid, Pe, JSON.stringify(this.meta));
1138
1138
  for (const e of this.changedBlockFrontendStates) {
1139
1139
  const t = this.blockFrontendStates.get(e);
1140
- t === void 0 ? this.tx.deleteKValue(this.rid, it(e)) : this.tx.setKValue(this.rid, it(e), t);
1140
+ t === void 0 ? this.tx.deleteKValue(this.rid, at(e)) : this.tx.setKValue(this.rid, at(e), t);
1141
1141
  }
1142
1142
  this.assignAuthorMarkers();
1143
1143
  }
1144
1144
  }
1145
1145
  static async load(e, t, r) {
1146
- const o = e.getResourceData(t, !0), n = e.getKValueJson(t, Lr), i = e.getKValueJson(t, Re), l = e.getKValueJson(t, ke), a = e.getKValueJson(t, le), c = e.getKValueJson(t, Be), u = e.listKeyValuesString(t), [
1146
+ const o = e.getResourceData(t, !0), n = e.getKValueJson(t, Lr), i = e.getKValueJson(t, ke), c = e.getKValueJson(t, Pe), a = e.getKValueJson(t, ue), l = e.getKValueJson(t, xe), u = e.listKeyValuesString(t), [
1147
1147
  d,
1148
1148
  m,
1149
1149
  h,
@@ -1155,9 +1155,9 @@ class xe {
1155
1155
  o,
1156
1156
  n,
1157
1157
  i,
1158
- l,
1159
- a,
1160
1158
  c,
1159
+ a,
1160
+ l,
1161
1161
  u
1162
1162
  ]);
1163
1163
  if (m !== Nr)
@@ -1172,14 +1172,14 @@ class xe {
1172
1172
  g === void 0 && (g = {
1173
1173
  id: y.blockId,
1174
1174
  fields: {}
1175
- }, k.set(y.blockId, g)), g.fields[y.fieldName] = De(p.value) ? { modCount: 0 } : { modCount: 0, ref: p.value };
1175
+ }, k.set(y.blockId, g)), g.fields[y.fieldName] = Be(p.value) ? { modCount: 0 } : { modCount: 0, ref: p.value };
1176
1176
  }
1177
- const se = await Jr(), ue = lt(se.hash), T = d.fields.find(
1178
- (p) => p.name === ue
1177
+ const se = await Jr(), de = ut(se.hash), F = d.fields.find(
1178
+ (p) => p.name === de
1179
1179
  );
1180
1180
  let z;
1181
- T !== void 0 ? z = ot(T.value) : (z = F.wrapInHolder(e, bt(e, se.spec)), e.createField(
1182
- D(t, lt(se.hash)),
1181
+ F !== void 0 ? z = nt(F.value) : (z = T.wrapInHolder(e, St(e, se.spec)), e.createField(
1182
+ D(t, ut(se.hash)),
1183
1183
  "Dynamic",
1184
1184
  z
1185
1185
  ));
@@ -1199,22 +1199,22 @@ class xe {
1199
1199
  });
1200
1200
  for (const [p, y] of j) {
1201
1201
  const g = await y;
1202
- p.value = g.data, Bt(g.error) ? p.status = "Error" : g.resourceReady || Bt(g.originalResourceId) ? p.status = "Ready" : p.status = "NotReady";
1202
+ p.value = g.data, Dt(g.error) ? p.status = "Error" : g.resourceReady || Dt(g.originalResourceId) ? p.status = "Ready" : p.status = "NotReady";
1203
1203
  }
1204
1204
  const X = /* @__PURE__ */ new Map();
1205
- k.forEach(({ id: p, fields: y }) => X.set(p, new Ht(p, y)));
1206
- const de = /* @__PURE__ */ new Set();
1205
+ k.forEach(({ id: p, fields: y }) => X.set(p, new Kt(p, y)));
1206
+ const pe = /* @__PURE__ */ new Set();
1207
1207
  for (const p of te(I)) {
1208
1208
  if (!X.has(p.id))
1209
1209
  throw new Error(`Inconsistent project structure: no inputs for ${p.id}`);
1210
- de.add(p.id);
1210
+ pe.add(p.id);
1211
1211
  }
1212
1212
  X.forEach((p) => {
1213
- if (!de.has(p.id))
1213
+ if (!pe.has(p.id))
1214
1214
  throw new Error(`Inconsistent project structure: no structure entry for ${p.id}`);
1215
1215
  p.check();
1216
1216
  });
1217
- const v = new xe(
1217
+ const v = new je(
1218
1218
  t,
1219
1219
  e,
1220
1220
  r,
@@ -1235,25 +1235,25 @@ async function zo(s, e = io) {
1235
1235
  const t = s.createEphemeral(ao);
1236
1236
  s.lock(t);
1237
1237
  const r = String(Date.now());
1238
- s.setKValue(t, Lr, JSON.stringify(Nr)), s.setKValue(t, St, r), s.setKValue(t, Re, r), s.setKValue(t, ke, JSON.stringify(e)), s.setKValue(t, le, JSON.stringify(oo)), s.setKValue(t, Be, JSON.stringify(no));
1238
+ s.setKValue(t, Lr, JSON.stringify(Nr)), s.setKValue(t, wt, r), s.setKValue(t, ke, r), s.setKValue(t, Pe, JSON.stringify(e)), s.setKValue(t, ue, JSON.stringify(oo)), s.setKValue(t, xe, JSON.stringify(no));
1239
1239
  const o = await Jr();
1240
1240
  return s.createField(
1241
- D(t, lt(o.hash)),
1241
+ D(t, ut(o.hash)),
1242
1242
  "Dynamic",
1243
- F.wrapInHolder(s, bt(s, o.spec))
1243
+ T.wrapInHolder(s, St(s, o.spec))
1244
1244
  ), t;
1245
1245
  }
1246
- async function qe(s, e, t) {
1246
+ async function Ye(s, e, t) {
1247
1247
  return ee(s, e, void 0, t);
1248
1248
  }
1249
1249
  async function ee(s, e, t, r) {
1250
1250
  if (s instanceof Cs)
1251
1251
  return await s.withWriteTx("ProjectAction", async (o) => {
1252
- const n = await xe.load(o, e, t), i = await r(n);
1252
+ const n = await je.load(o, e, t), i = await r(n);
1253
1253
  return n.wasModified && (n.save(), await o.commit()), i;
1254
1254
  });
1255
1255
  {
1256
- const o = await xe.load(s, e, t), n = await r(o);
1256
+ const o = await je.load(s, e, t), n = await r(o);
1257
1257
  return o.save(), n;
1258
1258
  }
1259
1259
  }
@@ -1272,7 +1272,7 @@ function* Xo(s) {
1272
1272
  J(s);
1273
1273
  }
1274
1274
  }
1275
- function Wt(s, e) {
1275
+ function Ht(s, e) {
1276
1276
  return Object.fromEntries(
1277
1277
  Object.entries(s).map(([t, r]) => [t, e(r, t)])
1278
1278
  );
@@ -1282,11 +1282,11 @@ function qo(s, e) {
1282
1282
  case "Json":
1283
1283
  return { ...s };
1284
1284
  case "JsonPartitioned":
1285
- return { ...s, parts: Wt(s.parts, e) };
1285
+ return { ...s, parts: Ht(s.parts, e) };
1286
1286
  case "BinaryPartitioned":
1287
1287
  return {
1288
1288
  ...s,
1289
- parts: Wt(s.parts, (t) => ({
1289
+ parts: Ht(s.parts, (t) => ({
1290
1290
  index: e(t.index),
1291
1291
  values: e(t.values)
1292
1292
  }))
@@ -1295,13 +1295,13 @@ function qo(s, e) {
1295
1295
  J(s);
1296
1296
  }
1297
1297
  }
1298
- const Yo = Pe("PColumnData/JsonPartitioned", "1"), Zo = Pe(
1298
+ const Yo = $e("PColumnData/JsonPartitioned", "1"), Zo = $e(
1299
1299
  "PColumnData/Partitioned/JsonPartitioned",
1300
1300
  "1"
1301
- ), Qo = Pe("PColumnData/BinaryPartitioned", "1"), en = Pe(
1301
+ ), Qo = $e("PColumnData/BinaryPartitioned", "1"), en = $e(
1302
1302
  "PColumnData/Partitioned/BinaryPartitioned",
1303
1303
  "1"
1304
- ), tn = Pe("PColumnData/Json", "1");
1304
+ ), tn = $e("PColumnData/Json", "1");
1305
1305
  function rn(s) {
1306
1306
  if (!s.getIsReadyOrError()) throw new Error("Data not ready.");
1307
1307
  const e = s.getDataAsJson();
@@ -1328,9 +1328,9 @@ function rn(s) {
1328
1328
  for (const o of s.listInputFields()) {
1329
1329
  const n = s.traverse({ field: o, errorIfFieldNotSet: !0 }), i = n.listInputFields();
1330
1330
  if (i === void 0) throw new Error(`no partition keys for super key ${o}`);
1331
- for (const l of i) {
1332
- const a = JSON.stringify([...JSON.parse(o), ...JSON.parse(l)]);
1333
- r[a] = n.traverse({ field: l, errorIfFieldNotSet: !0 }).resourceInfo;
1331
+ for (const c of i) {
1332
+ const a = JSON.stringify([...JSON.parse(o), ...JSON.parse(c)]);
1333
+ r[a] = n.traverse({ field: c, errorIfFieldNotSet: !0 }).resourceInfo;
1334
1334
  }
1335
1335
  }
1336
1336
  return {
@@ -1364,22 +1364,22 @@ function rn(s) {
1364
1364
  for (const o of s.listInputFields()) {
1365
1365
  const n = s.traverse({ field: o, errorIfFieldNotSet: !0 }), i = n.listInputFields();
1366
1366
  if (i === void 0) throw new Error(`no partition keys for super key ${o}`);
1367
- for (const l of i)
1368
- if (l.endsWith(".index")) {
1369
- const a = l.slice(0, l.length - 6), c = JSON.stringify([...JSON.parse(o), ...JSON.parse(a)]);
1370
- let u = r[c];
1371
- u === void 0 && (u = {}, r[c] = u), r[c].index = n.traverse({
1372
- field: l,
1367
+ for (const c of i)
1368
+ if (c.endsWith(".index")) {
1369
+ const a = c.slice(0, c.length - 6), l = JSON.stringify([...JSON.parse(o), ...JSON.parse(a)]);
1370
+ let u = r[l];
1371
+ u === void 0 && (u = {}, r[l] = u), r[l].index = n.traverse({
1372
+ field: c,
1373
1373
  errorIfFieldNotSet: !0
1374
1374
  }).resourceInfo;
1375
- } else if (l.endsWith(".values")) {
1376
- const a = l.slice(0, l.length - 7), c = JSON.stringify([...JSON.parse(o), ...JSON.parse(a)]);
1377
- let u = r[c];
1378
- u === void 0 && (u = {}, r[c] = u), r[c].values = n.traverse({
1379
- field: l,
1375
+ } else if (c.endsWith(".values")) {
1376
+ const a = c.slice(0, c.length - 7), l = JSON.stringify([...JSON.parse(o), ...JSON.parse(a)]);
1377
+ let u = r[l];
1378
+ u === void 0 && (u = {}, r[l] = u), r[l].values = n.traverse({
1379
+ field: c,
1380
1380
  errorIfFieldNotSet: !0
1381
1381
  }).resourceInfo;
1382
- } else throw new Error(`unrecognized part field name: ${l}`);
1382
+ } else throw new Error(`unrecognized part field name: ${c}`);
1383
1383
  }
1384
1384
  return {
1385
1385
  type: "BinaryPartitioned",
@@ -1402,12 +1402,18 @@ function sn(s, e) {
1402
1402
  data: r
1403
1403
  };
1404
1404
  }
1405
- function ht(s, e) {
1406
- const t = Ve("sha256");
1407
- return t.update(mt(s)), t.update(String(De(e.originalId) ? e.id : e.originalId)), t.digest().toString("hex");
1405
+ function on(s, e) {
1406
+ const t = Ue("sha256");
1407
+ return t.update(me(s)), t.update(String(Be(e.originalId) ? e.id : e.originalId)), t.digest().toString("hex");
1408
+ }
1409
+ function Wt(s, e) {
1410
+ return me({ __isRef: !0, blockId: s, name: e });
1411
+ }
1412
+ function nn(s, e) {
1413
+ return me({ resolvePath: s, name: e });
1408
1414
  }
1409
1415
  function Mr(s, e = !0, t = !1, r = "") {
1410
- var l, a, c;
1416
+ var c, a, l;
1411
1417
  const o = /^(?<name>.*)\.(?<type>spec|data)$/, n = /* @__PURE__ */ new Map();
1412
1418
  for (const u of s.listInputFields()) {
1413
1419
  const d = u.match(o);
@@ -1415,7 +1421,7 @@ function Mr(s, e = !0, t = !1, r = "") {
1415
1421
  if (e) throw new Error(`unexpected field name ${u}`);
1416
1422
  continue;
1417
1423
  }
1418
- let m = x((l = d.groups) == null ? void 0 : l.name);
1424
+ let m = x((c = d.groups) == null ? void 0 : c.name);
1419
1425
  if (!m.startsWith(r)) {
1420
1426
  if (e) throw new Error(`unexpected field name ${u}`);
1421
1427
  continue;
@@ -1425,11 +1431,11 @@ function Mr(s, e = !0, t = !1, r = "") {
1425
1431
  let f = n.get(m);
1426
1432
  switch (f === void 0 && (f = {}, n.set(m, f)), h) {
1427
1433
  case "spec":
1428
- f.spec = (c = s.traverse({
1434
+ f.spec = (l = s.traverse({
1429
1435
  field: u,
1430
1436
  ignoreError: t,
1431
1437
  pureFieldErrorToUndefined: t
1432
- })) == null ? void 0 : c.getDataAsJson();
1438
+ })) == null ? void 0 : l.getDataAsJson();
1433
1439
  break;
1434
1440
  case "data":
1435
1441
  f.hasData = !0, f.data = () => s.traverseOrError({
@@ -1445,27 +1451,27 @@ function Mr(s, e = !0, t = !1, r = "") {
1445
1451
  for (const [, u] of n) u.data === void 0 && (u.hasData = !1);
1446
1452
  return { locked: i, results: n };
1447
1453
  }
1448
- function on(s, e = !0, t = "") {
1454
+ function an(s, e = !0, t = "", r) {
1449
1455
  if (!s.getIsReadyOrError()) throw new Error("resource is not ready");
1450
- const r = Mr(s, e, !1, t);
1451
- Ds(r.locked);
1452
- const o = {};
1453
- for (const [n, i] of r.results) {
1454
- if (i.spec === void 0) throw new Error(`no spec for key ${n}`);
1455
- if (i.hasData !== !0 || i.data === void 0)
1456
- throw new Error(`no data for key ${n}`);
1457
- const l = i.data();
1458
- if (l === void 0) throw new Error(`no data for key ${n}`);
1459
- if (!l.ok) throw new As(l.error);
1460
- o[n] = {
1461
- id: ht(i.spec, l.value),
1462
- spec: i.spec,
1463
- data: l.value
1456
+ const o = Mr(s, e, !1, t);
1457
+ Ds(o.locked);
1458
+ const n = {};
1459
+ for (const [i, c] of o.results) {
1460
+ if (c.spec === void 0) throw new Error(`no spec for key ${i}`);
1461
+ if (c.hasData !== !0 || c.data === void 0)
1462
+ throw new Error(`no data for key ${i}`);
1463
+ const a = c.data();
1464
+ if (a === void 0) throw new Error(`no data for key ${i}`);
1465
+ if (!a.ok) throw new As(a.error);
1466
+ n[i] = {
1467
+ id: r.length === 0 ? on(c.spec, a.value) : nn(r, i),
1468
+ spec: c.spec,
1469
+ data: a.value
1464
1470
  };
1465
1471
  }
1466
- return o;
1472
+ return n;
1467
1473
  }
1468
- class Ct {
1474
+ class bt {
1469
1475
  constructor(e, t) {
1470
1476
  S(this, "allSpecsAvailable");
1471
1477
  this.ctx = e, this.blocks = t;
@@ -1486,23 +1492,23 @@ class Ct {
1486
1492
  this.allSpecsAvailable = r;
1487
1493
  }
1488
1494
  getSpecByRef(e, t) {
1489
- var n, i, l, a, c, u;
1495
+ var n, i, c, a, l, u;
1490
1496
  const r = this.blocks.get(e);
1491
1497
  if (r === void 0) return;
1492
- let o = (l = (i = (n = r.prod) == null ? void 0 : n.results) == null ? void 0 : i.get(t)) == null ? void 0 : l.spec;
1493
- if (o !== void 0 || (o = (u = (c = (a = r.staging) == null ? void 0 : a.results) == null ? void 0 : c.get(t)) == null ? void 0 : u.spec, o !== void 0)) return o;
1498
+ let o = (c = (i = (n = r.prod) == null ? void 0 : n.results) == null ? void 0 : i.get(t)) == null ? void 0 : c.spec;
1499
+ if (o !== void 0 || (o = (u = (l = (a = r.staging) == null ? void 0 : a.results) == null ? void 0 : l.get(t)) == null ? void 0 : u.spec, o !== void 0)) return o;
1494
1500
  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}`);
1495
1501
  }
1496
1502
  getDataOrErrorByRef(e, t) {
1497
- var i, l, a;
1503
+ var i, c, a;
1498
1504
  const r = this.blocks.get(e);
1499
1505
  if (r === void 0) return;
1500
- let o = (l = (i = r.prod) == null ? void 0 : i.results) == null ? void 0 : l.get(t), n = (a = o == null ? void 0 : o.data) == null ? void 0 : a.call(o);
1506
+ let o = (c = (i = r.prod) == null ? void 0 : i.results) == null ? void 0 : c.get(t), n = (a = o == null ? void 0 : o.data) == null ? void 0 : a.call(o);
1501
1507
  if (o !== void 0 && o.spec !== void 0 && n !== void 0)
1502
- return br(n, (c) => ({
1503
- id: ht(o.spec, c),
1508
+ return br(n, (l) => ({
1509
+ id: Wt(e, t),
1504
1510
  spec: o.spec,
1505
- data: c
1511
+ data: l
1506
1512
  }));
1507
1513
  o !== void 0 && this.ctx.markUnstable(`no_data:${e}:${t}`), r.prod !== void 0 && !r.prod.locked && this.ctx.markUnstable(`prod_not_locked:${e}`);
1508
1514
  }
@@ -1533,30 +1539,30 @@ class Ct {
1533
1539
  let t = !0, r;
1534
1540
  const o = (i) => {
1535
1541
  r === void 0 && (r = i), t = !1;
1536
- }, n = (i, l, a) => {
1542
+ }, n = (i, c, a) => {
1537
1543
  if (a.spec !== void 0 && a.hasData === !0 && a.data !== void 0) {
1538
- const c = a.data();
1539
- c !== void 0 ? e.push({
1540
- ref: Oe(i, l),
1544
+ const l = a.data();
1545
+ l !== void 0 ? e.push({
1546
+ ref: Ie(i, c),
1541
1547
  obj: {
1542
- id: c.ok ? ht(a.spec, c.value) : void 0,
1548
+ id: l.ok ? Wt(i, c) : void 0,
1543
1549
  spec: a.spec,
1544
- data: c
1550
+ data: l
1545
1551
  }
1546
- }) : o(`no_data:${i}:${l}`);
1552
+ }) : o(`no_data:${i}:${c}`);
1547
1553
  }
1548
1554
  };
1549
- for (const [i, l] of this.blocks) {
1555
+ for (const [i, c] of this.blocks) {
1550
1556
  const a = /* @__PURE__ */ new Set();
1551
- if (l.prod !== void 0) {
1552
- l.prod.locked || o(`prod_not_locked:${i}`);
1553
- for (const [c, u] of l.prod.results)
1554
- a.add(c), n(i, c, u);
1557
+ if (c.prod !== void 0) {
1558
+ c.prod.locked || o(`prod_not_locked:${i}`);
1559
+ for (const [l, u] of c.prod.results)
1560
+ a.add(l), n(i, l, u);
1555
1561
  }
1556
- if (l.staging !== void 0) {
1557
- l.staging.locked || o(`staging_not_locked:${i}`);
1558
- for (const [c, u] of l.staging.results)
1559
- a.has(c) || n(i, c, u);
1562
+ if (c.staging !== void 0) {
1563
+ c.staging.locked || o(`staging_not_locked:${i}`);
1564
+ for (const [l, u] of c.staging.results)
1565
+ a.has(l) || n(i, l, u);
1560
1566
  }
1561
1567
  }
1562
1568
  return { entries: e, isComplete: t, instabilityMarker: r };
@@ -1568,21 +1574,21 @@ class Ct {
1568
1574
  r === void 0 && (r = n), t = !1;
1569
1575
  };
1570
1576
  for (const [n, i] of this.blocks) {
1571
- const l = /* @__PURE__ */ new Set();
1577
+ const c = /* @__PURE__ */ new Set();
1572
1578
  if (i.staging !== void 0) {
1573
1579
  i.staging.locked || o(`staging_not_locked:${n}`);
1574
- for (const [a, c] of i.staging.results)
1575
- c.spec !== void 0 && (e.push({
1576
- ref: Oe(n, a),
1577
- obj: c.spec
1578
- }), l.add(a));
1580
+ for (const [a, l] of i.staging.results)
1581
+ l.spec !== void 0 && (e.push({
1582
+ ref: Ie(n, a),
1583
+ obj: l.spec
1584
+ }), c.add(a));
1579
1585
  } else o(`staging_not_rendered:${n}`);
1580
1586
  if (i.prod !== void 0) {
1581
1587
  i.prod.locked || o(`prod_not_locked:${n}`);
1582
- for (const [a, c] of i.prod.results)
1583
- l.has(a) || c.spec !== void 0 && e.push({
1584
- ref: Oe(n, a),
1585
- obj: c.spec
1588
+ for (const [a, l] of i.prod.results)
1589
+ c.has(a) || l.spec !== void 0 && e.push({
1590
+ ref: Ie(n, a),
1591
+ obj: l.spec
1586
1592
  });
1587
1593
  }
1588
1594
  }
@@ -1592,10 +1598,10 @@ class Ct {
1592
1598
  const t = [];
1593
1599
  for (const r of this.blocks.values()) {
1594
1600
  const o = /* @__PURE__ */ new Set(), n = (i) => {
1595
- for (const [l, a] of i.results)
1596
- o.has(l) || a.spec === void 0 || (o.add(l), us(e, a.spec) && t.push({
1597
- label: r.info.label + " / " + l,
1598
- ref: Oe(r.info.id, l),
1601
+ for (const [c, a] of i.results)
1602
+ o.has(c) || a.spec === void 0 || (o.add(c), us(e, a.spec) && t.push({
1603
+ label: r.info.label + " / " + c,
1604
+ ref: Ie(r.info.id, c),
1599
1605
  spec: a.spec
1600
1606
  }));
1601
1607
  };
@@ -1604,33 +1610,33 @@ class Ct {
1604
1610
  return t;
1605
1611
  }
1606
1612
  static create(e, t, r) {
1607
- const o = e.accessor(t).node(), n = x(o.getKeyValueAsJson(le)), l = dt(n).traverseIds("upstream", r), a = /* @__PURE__ */ new Map();
1608
- for (const c of te(n)) {
1609
- if (!l.has(c.id)) continue;
1613
+ const o = e.accessor(t).node(), n = x(o.getKeyValueAsJson(ue)), c = pt(n).traverseIds("upstream", r), a = /* @__PURE__ */ new Map();
1614
+ for (const l of te(n)) {
1615
+ if (!c.has(l.id)) continue;
1610
1616
  const u = zt(
1611
1617
  o.traverse({
1612
- field: U(c.id, "prodCtx"),
1618
+ field: U(l.id, "prodCtx"),
1613
1619
  ignoreError: !0,
1614
1620
  pureFieldErrorToUndefined: !0,
1615
1621
  stableIfNotFound: !0
1616
1622
  }) !== void 0,
1617
1623
  o.traverseOrError({
1618
- field: U(c.id, "prodUiCtx"),
1624
+ field: U(l.id, "prodUiCtx"),
1619
1625
  stableIfNotFound: !0
1620
1626
  })
1621
1627
  ), d = zt(
1622
1628
  o.traverse({
1623
- field: U(c.id, "stagingCtx"),
1629
+ field: U(l.id, "stagingCtx"),
1624
1630
  ignoreError: !0,
1625
1631
  pureFieldErrorToUndefined: !0
1626
1632
  }) !== void 0,
1627
1633
  o.traverseOrError({
1628
- field: U(c.id, "stagingUiCtx")
1634
+ field: U(l.id, "stagingUiCtx")
1629
1635
  })
1630
1636
  );
1631
- a.set(c.id, { info: c, prod: u, staging: d });
1637
+ a.set(l.id, { info: l, prod: u, staging: d });
1632
1638
  }
1633
- return new Ct(e, a);
1639
+ return new bt(e, a);
1634
1640
  }
1635
1641
  }
1636
1642
  function zt(s, e) {
@@ -1638,7 +1644,7 @@ function zt(s, e) {
1638
1644
  return s ? { locked: !1, results: /* @__PURE__ */ new Map() } : void 0;
1639
1645
  if (e.ok) return Mr(e.value, !1, !0);
1640
1646
  }
1641
- function Et(s, e) {
1647
+ function Ct(s, e) {
1642
1648
  return {
1643
1649
  blockId: e,
1644
1650
  args: (o) => x(
@@ -1647,17 +1653,17 @@ function Et(s, e) {
1647
1653
  errorIfFieldNotSet: !0
1648
1654
  }).getDataAsString()
1649
1655
  ),
1650
- uiState: (o) => o.accessor(s).node().getKeyValueAsString(it(e)),
1656
+ uiState: (o) => o.accessor(s).node().getKeyValueAsString(at(e)),
1651
1657
  blockMeta: (o) => {
1652
- const n = o.accessor(s).node(), i = x(n.getKeyValueAsJson(le)), l = /* @__PURE__ */ new Map();
1653
- for (const a of te(i)) l.set(a.id, a);
1654
- return l;
1658
+ const n = o.accessor(s).node(), i = x(n.getKeyValueAsJson(ue)), c = /* @__PURE__ */ new Map();
1659
+ for (const a of te(i)) c.set(a.id, a);
1660
+ return c;
1655
1661
  }
1656
1662
  };
1657
1663
  }
1658
1664
  function _r(s, e) {
1659
1665
  return {
1660
- ...Et(s, e),
1666
+ ...Ct(s, e),
1661
1667
  prod: (t) => {
1662
1668
  var r;
1663
1669
  return (r = t.accessor(s).node({ ignoreError: !0 }).traverse({
@@ -1674,7 +1680,7 @@ function _r(s, e) {
1674
1680
  })) == null ? void 0 : o.persist();
1675
1681
  return r === void 0 && t.markUnstable("staging_not_rendered"), r;
1676
1682
  },
1677
- getResultsPool: (t) => Ct.create(t, s, e)
1683
+ getResultsPool: (t) => bt.create(t, s, e)
1678
1684
  };
1679
1685
  }
1680
1686
  function* W(s, e) {
@@ -1727,15 +1733,15 @@ function* W(s, e) {
1727
1733
  J(s);
1728
1734
  }
1729
1735
  }
1730
- function nn(s, e) {
1736
+ function cn(s, e) {
1731
1737
  const t = {};
1732
1738
  for (const [r, o] of Object.entries(s)) t[r] = e(o);
1733
1739
  return t;
1734
1740
  }
1735
- function Se(s, e) {
1741
+ function be(s, e) {
1736
1742
  return s === void 0 ? void 0 : e(s);
1737
1743
  }
1738
- function an(s) {
1744
+ function ln(s) {
1739
1745
  switch (s.type) {
1740
1746
  case "GetImportProgress":
1741
1747
  return !0;
@@ -1743,35 +1749,35 @@ function an(s) {
1743
1749
  return !1;
1744
1750
  }
1745
1751
  }
1746
- function cn(s) {
1747
- for (const e of W(s)) if (an(e)) return !0;
1752
+ function un(s) {
1753
+ for (const e of W(s)) if (ln(e)) return !0;
1748
1754
  return !1;
1749
1755
  }
1750
- function Ue(s) {
1756
+ function Ge(s) {
1751
1757
  return {
1752
1758
  type: "ReturnResult",
1753
1759
  result: s
1754
1760
  };
1755
1761
  }
1756
1762
  function R(s) {
1757
- return () => Ue(s);
1763
+ return () => Ge(s);
1758
1764
  }
1759
- const ln = (s) => {
1765
+ const dn = (s) => {
1760
1766
  const e = {};
1761
1767
  for (const [t, r] of Object.entries(s)) e[t] = r;
1762
1768
  return R(e);
1763
- }, un = (s) => {
1769
+ }, pn = (s) => {
1764
1770
  const e = s.source;
1765
1771
  if (e === void 0) return R(void 0);
1766
1772
  const t = [];
1767
1773
  for (const r of e)
1768
1774
  r instanceof Array ? t.push(...r) : t.push(r);
1769
1775
  return R(t);
1770
- }, dn = (s) => {
1776
+ }, hn = (s) => {
1771
1777
  const e = s.source, t = s.field;
1772
1778
  return e === void 0 || t === void 0 ? R(void 0) : ({ cCtx: r }) => {
1773
1779
  var o;
1774
- return Ue((o = r.accessor(e).node().traverse(t)) == null ? void 0 : o.persist());
1780
+ return Ge((o = r.accessor(e).node().traverse(t)) == null ? void 0 : o.persist());
1775
1781
  };
1776
1782
  };
1777
1783
  function Kr(s, e) {
@@ -1779,7 +1785,7 @@ function Kr(s, e) {
1779
1785
  for (let o = 0; o < r; o++) t[String(o)] = e(s[o]);
1780
1786
  return t;
1781
1787
  }
1782
- function pn(s, e) {
1788
+ function fn(s, e) {
1783
1789
  return (t) => {
1784
1790
  const r = t.source;
1785
1791
  return r === void 0 ? R(void 0) : () => ({
@@ -1796,66 +1802,66 @@ function Hr(s) {
1796
1802
  return R(t);
1797
1803
  };
1798
1804
  }
1799
- function hn(s, e) {
1805
+ function gn(s, e) {
1800
1806
  return (t) => {
1801
1807
  const r = t.source;
1802
1808
  if (r === void 0) return R(void 0);
1803
1809
  const o = {};
1804
1810
  for (const [n, i] of Object.entries(r)) {
1805
- const l = { ...s, [e.itVar]: i };
1806
- o[n] = $(l, e.mapping);
1811
+ const c = { ...s, [e.itVar]: i };
1812
+ o[n] = $(c, e.mapping);
1807
1813
  }
1808
1814
  return () => ({
1809
1815
  type: "ScheduleSubroutine",
1810
- subroutine: fn,
1816
+ subroutine: mn,
1811
1817
  args: o
1812
1818
  });
1813
1819
  };
1814
1820
  }
1815
- const fn = (s) => R(s), gn = (s) => {
1821
+ const mn = (s) => R(s), vn = (s) => {
1816
1822
  const e = s.arg;
1817
1823
  return R(e === void 0 ? void 0 : e.length === 0);
1818
- }, mn = (s) => {
1824
+ }, yn = (s) => {
1819
1825
  const e = s.operand;
1820
1826
  return R(e === void 0 ? void 0 : !e);
1821
- }, vn = (s) => {
1827
+ }, wn = (s) => {
1822
1828
  const e = s.operand1, t = s.operand2;
1823
1829
  return R(e === void 0 || t === void 0 ? void 0 : e && t);
1824
- }, yn = (s) => {
1830
+ }, Sn = (s) => {
1825
1831
  const e = s.operand1, t = s.operand2;
1826
1832
  return R(e === void 0 || t === void 0 ? void 0 : e || t);
1827
- }, wn = (s) => {
1833
+ }, bn = (s) => {
1828
1834
  const e = s.source;
1829
1835
  return e === void 0 ? R(void 0) : ({ cCtx: t }) => {
1830
1836
  var r;
1831
- return Ue((r = t.accessor(e).node()) == null ? void 0 : r.getDataAsJson());
1837
+ return Ge((r = t.accessor(e).node()) == null ? void 0 : r.getDataAsJson());
1832
1838
  };
1833
- }, Sn = (s) => {
1839
+ }, Cn = (s) => {
1834
1840
  const e = s.source, t = s.field;
1835
1841
  return R(e === void 0 || t === void 0 ? void 0 : e[t]);
1836
1842
  };
1837
- function bn(s, e) {
1843
+ function En(s, e) {
1838
1844
  return (t) => {
1839
1845
  const r = t.source;
1840
1846
  return r === void 0 ? R(void 0) : ({ cCtx: o }) => {
1841
1847
  const n = o.accessor(r).node(), i = {};
1842
- for (const l of n.listInputFields()) {
1843
- const a = n.traverse(l);
1844
- if (a === void 0) i[l] = R(void 0);
1848
+ for (const c of n.listInputFields()) {
1849
+ const a = n.traverse(c);
1850
+ if (a === void 0) i[c] = R(void 0);
1845
1851
  else {
1846
- const c = { ...s, [e.itVar]: a.persist() };
1847
- i[l] = $(c, e.mapping);
1852
+ const l = { ...s, [e.itVar]: a.persist() };
1853
+ i[c] = $(l, e.mapping);
1848
1854
  }
1849
1855
  }
1850
1856
  return {
1851
1857
  type: "ScheduleSubroutine",
1852
- subroutine: Cn,
1858
+ subroutine: Rn,
1853
1859
  args: i
1854
1860
  };
1855
1861
  };
1856
1862
  };
1857
1863
  }
1858
- const Cn = (s) => R(s), En = (s) => {
1864
+ const Rn = (s) => R(s), kn = (s) => {
1859
1865
  const e = s.source;
1860
1866
  return e === void 0 ? R(void 0) : ({ drivers: t }) => ({
1861
1867
  type: "ScheduleComputable",
@@ -1869,7 +1875,7 @@ const Cn = (s) => R(s), En = (s) => {
1869
1875
  }
1870
1876
  )
1871
1877
  });
1872
- }, Rn = (s) => {
1878
+ }, Pn = (s) => {
1873
1879
  const e = s.source;
1874
1880
  return e === void 0 ? R(void 0) : ({ cCtx: t, drivers: r }) => {
1875
1881
  const o = t.accessor(e).node().resourceInfo;
@@ -1880,7 +1886,7 @@ const Cn = (s) => R(s), En = (s) => {
1880
1886
  })
1881
1887
  };
1882
1888
  };
1883
- }, kn = (s) => {
1889
+ }, $n = (s) => {
1884
1890
  const e = s.source;
1885
1891
  return e === void 0 ? R(void 0) : ({ drivers: t }) => ({
1886
1892
  type: "ScheduleComputable",
@@ -1896,37 +1902,37 @@ const Cn = (s) => R(s), En = (s) => {
1896
1902
  }
1897
1903
  )
1898
1904
  });
1899
- }, Pn = (s) => {
1905
+ }, On = (s) => {
1900
1906
  const e = s.source;
1901
1907
  return e === void 0 ? R(void 0) : ({ drivers: t }) => ({
1902
1908
  type: "ScheduleComputable",
1903
1909
  computable: t.blobDriver.getDownloadedBlob(e)
1904
1910
  });
1905
- }, $n = (s) => {
1911
+ }, In = (s) => {
1906
1912
  const e = s.source;
1907
1913
  return e === void 0 ? R(void 0) : ({ drivers: t }) => ({
1908
1914
  type: "ScheduleComputable",
1909
1915
  computable: t.blobDriver.getOnDemandBlob(e)
1910
1916
  });
1911
- }, On = (s) => {
1917
+ }, An = (s) => {
1912
1918
  const e = s.source;
1913
1919
  return e === void 0 ? R(void 0) : ({ drivers: t }) => ({
1914
1920
  type: "ScheduleComputable",
1915
1921
  computable: t.uploadDriver.getProgressId(e)
1916
1922
  });
1917
- }, In = (s) => (e) => {
1923
+ }, Tn = (s) => (e) => {
1918
1924
  const t = e.source;
1919
1925
  return t === void 0 ? R(void 0) : ({ drivers: r }) => ({
1920
1926
  type: "ScheduleComputable",
1921
1927
  computable: r.logDriver.getLastLogs(t, s)
1922
1928
  });
1923
- }, An = (s) => (e) => {
1929
+ }, Fn = (s) => (e) => {
1924
1930
  const t = e.source;
1925
1931
  return t === void 0 ? R(void 0) : ({ drivers: r }) => ({
1926
1932
  type: "ScheduleComputable",
1927
1933
  computable: r.logDriver.getProgressLog(t, s)
1928
1934
  });
1929
- }, Fn = (s) => {
1935
+ }, Ln = (s) => {
1930
1936
  const e = s.source;
1931
1937
  return e === void 0 ? R(void 0) : ({ drivers: t }) => ({
1932
1938
  type: "ScheduleComputable",
@@ -1937,7 +1943,7 @@ function $(s, e) {
1937
1943
  switch (e.type) {
1938
1944
  case "GetFromCtx":
1939
1945
  const t = s[e.variable];
1940
- return typeof t == "function" ? (r) => Ue(t(r.cCtx)) : R(t);
1946
+ return typeof t == "function" ? (r) => Ge(t(r.cCtx)) : R(t);
1941
1947
  case "Isolate":
1942
1948
  return ({ drivers: r }) => ({
1943
1949
  type: "ScheduleComputable",
@@ -1948,7 +1954,7 @@ function $(s, e) {
1948
1954
  case "GetJsonField":
1949
1955
  return () => ({
1950
1956
  type: "ScheduleSubroutine",
1951
- subroutine: Sn,
1957
+ subroutine: Cn,
1952
1958
  args: {
1953
1959
  source: $(s, e.source),
1954
1960
  field: $(s, e.field)
@@ -1957,7 +1963,7 @@ function $(s, e) {
1957
1963
  case "MapArrayValues":
1958
1964
  return () => ({
1959
1965
  type: "ScheduleSubroutine",
1960
- subroutine: pn(s, e),
1966
+ subroutine: fn(s, e),
1961
1967
  args: {
1962
1968
  source: $(s, e.source)
1963
1969
  }
@@ -1965,7 +1971,7 @@ function $(s, e) {
1965
1971
  case "MapRecordValues":
1966
1972
  return () => ({
1967
1973
  type: "ScheduleSubroutine",
1968
- subroutine: hn(s, e),
1974
+ subroutine: gn(s, e),
1969
1975
  args: {
1970
1976
  source: $(s, e.source)
1971
1977
  }
@@ -1973,8 +1979,8 @@ function $(s, e) {
1973
1979
  case "MakeObject":
1974
1980
  return () => ({
1975
1981
  type: "ScheduleSubroutine",
1976
- subroutine: ln,
1977
- args: nn(e.template, (r) => $(s, r))
1982
+ subroutine: dn,
1983
+ args: cn(e.template, (r) => $(s, r))
1978
1984
  });
1979
1985
  case "MakeArray":
1980
1986
  return () => ({
@@ -1985,7 +1991,7 @@ function $(s, e) {
1985
1991
  case "Flatten":
1986
1992
  return () => ({
1987
1993
  type: "ScheduleSubroutine",
1988
- subroutine: un,
1994
+ subroutine: pn,
1989
1995
  args: {
1990
1996
  source: $(s, e.source)
1991
1997
  }
@@ -1993,7 +1999,7 @@ function $(s, e) {
1993
1999
  case "IsEmpty":
1994
2000
  return () => ({
1995
2001
  type: "ScheduleSubroutine",
1996
- subroutine: gn,
2002
+ subroutine: vn,
1997
2003
  args: {
1998
2004
  arg: $(s, e.arg)
1999
2005
  }
@@ -2001,7 +2007,7 @@ function $(s, e) {
2001
2007
  case "Not":
2002
2008
  return () => ({
2003
2009
  type: "ScheduleSubroutine",
2004
- subroutine: mn,
2010
+ subroutine: yn,
2005
2011
  args: {
2006
2012
  operand: $(s, e.operand)
2007
2013
  }
@@ -2009,7 +2015,7 @@ function $(s, e) {
2009
2015
  case "And":
2010
2016
  return () => ({
2011
2017
  type: "ScheduleSubroutine",
2012
- subroutine: vn,
2018
+ subroutine: wn,
2013
2019
  args: {
2014
2020
  operand1: $(s, e.operand1),
2015
2021
  operand2: $(s, e.operand2)
@@ -2018,7 +2024,7 @@ function $(s, e) {
2018
2024
  case "Or":
2019
2025
  return () => ({
2020
2026
  type: "ScheduleSubroutine",
2021
- subroutine: yn,
2027
+ subroutine: Sn,
2022
2028
  args: {
2023
2029
  operand1: $(s, e.operand1),
2024
2030
  operand2: $(s, e.operand2)
@@ -2027,7 +2033,7 @@ function $(s, e) {
2027
2033
  case "MapResourceFields":
2028
2034
  return () => ({
2029
2035
  type: "ScheduleSubroutine",
2030
- subroutine: bn(s, e),
2036
+ subroutine: En(s, e),
2031
2037
  args: {
2032
2038
  source: $(s, e.source)
2033
2039
  }
@@ -2035,7 +2041,7 @@ function $(s, e) {
2035
2041
  case "GetResourceField":
2036
2042
  return () => ({
2037
2043
  type: "ScheduleSubroutine",
2038
- subroutine: dn,
2044
+ subroutine: hn,
2039
2045
  args: {
2040
2046
  source: $(s, e.source),
2041
2047
  field: $(s, e.field)
@@ -2044,7 +2050,7 @@ function $(s, e) {
2044
2050
  case "GetResourceValueAsJson":
2045
2051
  return () => ({
2046
2052
  type: "ScheduleSubroutine",
2047
- subroutine: wn,
2053
+ subroutine: bn,
2048
2054
  args: {
2049
2055
  source: $(s, e.source)
2050
2056
  }
@@ -2052,7 +2058,7 @@ function $(s, e) {
2052
2058
  case "GetBlobContent":
2053
2059
  return () => ({
2054
2060
  type: "ScheduleSubroutine",
2055
- subroutine: En,
2061
+ subroutine: kn,
2056
2062
  args: {
2057
2063
  source: $(s, e.source)
2058
2064
  }
@@ -2060,7 +2066,7 @@ function $(s, e) {
2060
2066
  case "GetBlobContentAsString":
2061
2067
  return () => ({
2062
2068
  type: "ScheduleSubroutine",
2063
- subroutine: Rn,
2069
+ subroutine: Pn,
2064
2070
  args: {
2065
2071
  source: $(s, e.source)
2066
2072
  }
@@ -2068,7 +2074,7 @@ function $(s, e) {
2068
2074
  case "GetBlobContentAsJson":
2069
2075
  return () => ({
2070
2076
  type: "ScheduleSubroutine",
2071
- subroutine: kn,
2077
+ subroutine: $n,
2072
2078
  args: {
2073
2079
  source: $(s, e.source)
2074
2080
  }
@@ -2076,7 +2082,7 @@ function $(s, e) {
2076
2082
  case "GetDownloadedBlobContent":
2077
2083
  return () => ({
2078
2084
  type: "ScheduleSubroutine",
2079
- subroutine: Pn,
2085
+ subroutine: On,
2080
2086
  args: {
2081
2087
  source: $(s, e.source)
2082
2088
  }
@@ -2084,7 +2090,7 @@ function $(s, e) {
2084
2090
  case "GetOnDemandBlobContent":
2085
2091
  return () => ({
2086
2092
  type: "ScheduleSubroutine",
2087
- subroutine: $n,
2093
+ subroutine: In,
2088
2094
  args: {
2089
2095
  source: $(s, e.source)
2090
2096
  }
@@ -2092,7 +2098,7 @@ function $(s, e) {
2092
2098
  case "GetImportProgress":
2093
2099
  return () => ({
2094
2100
  type: "ScheduleSubroutine",
2095
- subroutine: On,
2101
+ subroutine: An,
2096
2102
  args: {
2097
2103
  source: $(s, e.source)
2098
2104
  }
@@ -2100,7 +2106,7 @@ function $(s, e) {
2100
2106
  case "GetLastLogs":
2101
2107
  return () => ({
2102
2108
  type: "ScheduleSubroutine",
2103
- subroutine: In(e.lines),
2109
+ subroutine: Tn(e.lines),
2104
2110
  args: {
2105
2111
  source: $(s, e.source)
2106
2112
  }
@@ -2108,7 +2114,7 @@ function $(s, e) {
2108
2114
  case "GetProgressLog":
2109
2115
  return () => ({
2110
2116
  type: "ScheduleSubroutine",
2111
- subroutine: An(e.patternToSearch),
2117
+ subroutine: Fn(e.patternToSearch),
2112
2118
  args: {
2113
2119
  source: $(s, e.source)
2114
2120
  }
@@ -2116,7 +2122,7 @@ function $(s, e) {
2116
2122
  case "GetLogHandle":
2117
2123
  return () => ({
2118
2124
  type: "ScheduleSubroutine",
2119
- subroutine: Fn,
2125
+ subroutine: Ln,
2120
2126
  args: {
2121
2127
  source: $(s, e.source)
2122
2128
  }
@@ -2125,8 +2131,8 @@ function $(s, e) {
2125
2131
  return J(e);
2126
2132
  }
2127
2133
  }
2128
- const Tn = ["$prod", "$staging"];
2129
- function Ln(s) {
2134
+ const Nn = ["$prod", "$staging"];
2135
+ function Dn(s) {
2130
2136
  return {
2131
2137
  $blockId: s.blockId,
2132
2138
  $args: (e) => JSON.parse(s.args(e)),
@@ -2138,48 +2144,48 @@ function Ln(s) {
2138
2144
  $staging: s.staging
2139
2145
  };
2140
2146
  }
2141
- const Wr = Symbol(), zr = "return", Nn = { op: Wr, arg: zr };
2142
- function Dn(s) {
2147
+ const Wr = Symbol(), zr = "return", Bn = { op: Wr, arg: zr };
2148
+ function xn(s) {
2143
2149
  return s.op == Wr && s.arg == zr;
2144
2150
  }
2145
- function Bn() {
2151
+ function jn() {
2146
2152
  return { pendingSubroutines: /* @__PURE__ */ new Map() };
2147
2153
  }
2148
2154
  function Xt(s, e, t, r) {
2149
- const o = new Ir(t), n = (l, a) => {
2150
- if (Dn(l))
2155
+ const o = new Ir(t), n = (c, a) => {
2156
+ if (xn(c))
2151
2157
  return e.result = a, !1;
2152
- const c = x(e.pendingSubroutines.get(l.op));
2153
- if (l.arg in c.args) throw new Error("argument already set");
2154
- return c.args[l.arg] = a, c.argCounter--, c.argCounter === 0 && (e.pendingSubroutines.delete(l.op), o.push({
2155
- destination: c.destination,
2156
- operation: c.subroutine(c.args)
2158
+ const l = x(e.pendingSubroutines.get(c.op));
2159
+ if (c.arg in l.args) throw new Error("argument already set");
2160
+ return l.args[c.arg] = a, l.argCounter--, l.argCounter === 0 && (e.pendingSubroutines.delete(c.op), o.push({
2161
+ destination: l.destination,
2162
+ operation: l.subroutine(l.args)
2157
2163
  })), !0;
2158
2164
  }, i = [];
2159
2165
  e: for (; o.length > 0; ) {
2160
- const l = o.shift(), a = l.operation(s);
2166
+ const c = o.shift(), a = c.operation(s);
2161
2167
  switch (a.type) {
2162
2168
  case "ReturnResult":
2163
- if (!n(l.destination, a.result)) break e;
2169
+ if (!n(c.destination, a.result)) break e;
2164
2170
  break;
2165
2171
  case "ScheduleSubroutine":
2166
- const c = Symbol(), u = Object.entries(a.args), d = u.length;
2172
+ const l = Symbol(), u = Object.entries(a.args), d = u.length;
2167
2173
  if (d === 0)
2168
2174
  o.push({
2169
- destination: l.destination,
2175
+ destination: c.destination,
2170
2176
  operation: a.subroutine({})
2171
2177
  });
2172
2178
  else {
2173
2179
  for (const [m, h] of u)
2174
2180
  o.push({
2175
- destination: { op: c, arg: m },
2181
+ destination: { op: l, arg: m },
2176
2182
  operation: h
2177
2183
  });
2178
- e.pendingSubroutines.set(c, {
2184
+ e.pendingSubroutines.set(l, {
2179
2185
  argCounter: d,
2180
2186
  args: {},
2181
2187
  subroutine: a.subroutine,
2182
- destination: l.destination
2188
+ destination: c.destination
2183
2189
  });
2184
2190
  }
2185
2191
  break;
@@ -2187,7 +2193,7 @@ function Xt(s, e, t, r) {
2187
2193
  if (!r)
2188
2194
  throw new Error("asynchronous operations are forbidden in this context");
2189
2195
  i.push({
2190
- destination: l.destination,
2196
+ destination: c.destination,
2191
2197
  computable: a.computable
2192
2198
  });
2193
2199
  break;
@@ -2197,34 +2203,34 @@ function Xt(s, e, t, r) {
2197
2203
  }
2198
2204
  return i;
2199
2205
  }
2200
- function xn(s, e, t, r = {}) {
2201
- return Xr(s, Ln(e), t, r);
2206
+ function Vn(s, e, t, r = {}) {
2207
+ return Xr(s, Dn(e), t, r);
2202
2208
  }
2203
2209
  function Xr(s, e, t, r = {}) {
2204
- const o = `${e.blockId}#` + mt({
2210
+ const o = `${e.blockId}#` + me({
2205
2211
  ctx: Object.fromEntries(
2206
- Object.entries(e).filter(([n]) => Tn.indexOf(n) === -1)
2212
+ Object.entries(e).filter(([n]) => Nn.indexOf(n) === -1)
2207
2213
  ),
2208
2214
  cfg: t
2209
2215
  });
2210
2216
  return V.makeRaw(
2211
2217
  (n) => {
2212
- const i = { drivers: s, cCtx: n }, l = Bn();
2218
+ const i = { drivers: s, cCtx: n }, c = jn();
2213
2219
  return {
2214
2220
  ir: Xt(
2215
2221
  i,
2216
- l,
2222
+ c,
2217
2223
  [
2218
2224
  {
2219
- destination: Nn,
2225
+ destination: Bn,
2220
2226
  operation: $(e, t)
2221
2227
  }
2222
2228
  ],
2223
2229
  !0
2224
2230
  ),
2225
- async postprocessValue(c) {
2231
+ async postprocessValue(l) {
2226
2232
  const u = [];
2227
- for (const f of c)
2233
+ for (const f of l)
2228
2234
  u.push({ destination: f.destination, operation: R(f.computable) });
2229
2235
  const d = {
2230
2236
  drivers: s,
@@ -2232,10 +2238,10 @@ function Xr(s, e, t, r = {}) {
2232
2238
  throw new Error("asynchronous operations are forbidden in this context");
2233
2239
  }
2234
2240
  }, m = /* @__PURE__ */ new Map();
2235
- for (const [f, I] of l.pendingSubroutines)
2241
+ for (const [f, I] of c.pendingSubroutines)
2236
2242
  m.set(f, { ...I, args: { ...I.args } });
2237
2243
  const h = {
2238
- result: l.result,
2244
+ result: c.result,
2239
2245
  pendingSubroutines: m
2240
2246
  };
2241
2247
  if (Xt(d, h, u, !1), !("result" in h))
@@ -2247,13 +2253,13 @@ function Xr(s, e, t, r = {}) {
2247
2253
  { ...r, key: o }
2248
2254
  );
2249
2255
  }
2250
- function jn(s) {
2256
+ function Un(s) {
2251
2257
  return s instanceof ArrayBuffer || ArrayBuffer.isView(s);
2252
2258
  }
2253
2259
  function qt(s) {
2254
2260
  return s !== void 0 ? Buffer.from(s).toString("base64") : void 0;
2255
2261
  }
2256
- class je {
2262
+ class Ve {
2257
2263
  constructor(e, t, r, o, n) {
2258
2264
  S(this, "callbackRegistry");
2259
2265
  S(this, "fnJSONStringify");
@@ -2285,12 +2291,12 @@ class je {
2285
2291
  try {
2286
2292
  this.vm.unwrapResult(this.vm.evalCode(e, "bundle.js", { type: "global" })).dispose();
2287
2293
  } catch (t) {
2288
- throw je.cleanErrorContext(t), t;
2294
+ throw Ve.cleanErrorContext(t), t;
2289
2295
  }
2290
2296
  }
2291
2297
  runCallback(e, ...t) {
2292
2298
  try {
2293
- return nt.withScope((r) => {
2299
+ return it.withScope((r) => {
2294
2300
  const o = r.manage(this.vm.getProp(this.callbackRegistry, e));
2295
2301
  if (this.vm.typeof(o) !== "function")
2296
2302
  throw new Error(`No such callback: ${e}`);
@@ -2305,7 +2311,7 @@ class je {
2305
2311
  );
2306
2312
  });
2307
2313
  } catch (r) {
2308
- throw je.cleanErrorContext(r), r;
2314
+ throw Ve.cleanErrorContext(r), r;
2309
2315
  }
2310
2316
  }
2311
2317
  //
@@ -2374,19 +2380,19 @@ class je {
2374
2380
  //
2375
2381
  // Accessor helpers
2376
2382
  //
2377
- parsePObjectCollection(e, t, r) {
2378
- const o = this.getAccessor(e);
2379
- if (!o.getIsReadyOrError()) return;
2380
- const n = on(o, t, r), i = {};
2381
- for (const [l, a] of Object.entries(n))
2382
- i[l] = ge(a, (c) => this.wrapAccessor(c));
2383
- return i;
2383
+ parsePObjectCollection(e, t, r, ...o) {
2384
+ const n = this.getAccessor(e);
2385
+ if (!n.getIsReadyOrError()) return;
2386
+ const i = an(n, t, r, o), c = {};
2387
+ for (const [a, l] of Object.entries(i))
2388
+ c[a] = ce(l, (u) => this.wrapAccessor(u));
2389
+ return c;
2384
2390
  }
2385
2391
  //
2386
2392
  // Blobs
2387
2393
  //
2388
2394
  registerComputable(e, t) {
2389
- const r = `${e}_${Ee()}`;
2395
+ const r = `${e}_${Re()}`;
2390
2396
  return this.computablesToResolve[r] = t, r;
2391
2397
  }
2392
2398
  getBlobContentAsString(e) {
@@ -2495,7 +2501,7 @@ class je {
2495
2501
  isComplete: e.isComplete,
2496
2502
  entries: e.entries.map((t) => ({
2497
2503
  ref: t.ref,
2498
- obj: ge(t.obj, (r) => this.wrapAccessor(r))
2504
+ obj: ce(t.obj, (r) => this.wrapAccessor(r))
2499
2505
  }))
2500
2506
  };
2501
2507
  }
@@ -2521,7 +2527,7 @@ class je {
2521
2527
  return this.resultPool.getSpecByRef(e, t);
2522
2528
  }
2523
2529
  getDataFromResultPoolByRef(e, t) {
2524
- return ge(
2530
+ return ce(
2525
2531
  this.resultPool.getDataByRef(e, t),
2526
2532
  (r) => this.wrapAccessor(r)
2527
2533
  );
@@ -2535,7 +2541,7 @@ class je {
2535
2541
  "can't instantiate PFrames from this context (most porbably called from the future mapper)"
2536
2542
  );
2537
2543
  return this.env.driverKit.pFrameDriver.createPFrame(
2538
- e.map((t) => ge(
2544
+ e.map((t) => ce(
2539
2545
  t,
2540
2546
  (r) => typeof r == "string" ? this.getAccessor(r) : r
2541
2547
  )),
@@ -2548,7 +2554,7 @@ class je {
2548
2554
  "can't instantiate PTable from this context (most porbably called from the future mapper)"
2549
2555
  );
2550
2556
  return this.env.driverKit.pFrameDriver.createPTable(
2551
- Cr(e, (t) => ge(
2557
+ Cr(e, (t) => ce(
2552
2558
  t,
2553
2559
  (r) => typeof r == "string" ? this.getAccessor(r) : r
2554
2560
  )),
@@ -2572,7 +2578,7 @@ class je {
2572
2578
  }
2573
2579
  wrapAccessor(e) {
2574
2580
  if (e !== void 0) {
2575
- const t = Ee();
2581
+ const t = Re();
2576
2582
  return this.accessors.set(t, e), t;
2577
2583
  }
2578
2584
  }
@@ -2604,7 +2610,7 @@ class je {
2604
2610
  r = this.vm.null;
2605
2611
  break;
2606
2612
  }
2607
- if (jn(e)) {
2613
+ if (Un(e)) {
2608
2614
  r = this.vm.newArrayBuffer(e), o = !0;
2609
2615
  break;
2610
2616
  }
@@ -2640,39 +2646,40 @@ class je {
2640
2646
  return JSON.parse(t);
2641
2647
  }
2642
2648
  injectCtx() {
2643
- nt.withScope((e) => {
2649
+ it.withScope((e) => {
2644
2650
  const t = e.manage(this.vm.newObject()), r = this.blockCtx.args(this.computableCtx), o = this.blockCtx.uiState(this.computableCtx);
2645
2651
  this.vm.setProp(t, "args", e.manage(this.vm.newString(r))), o !== void 0 && this.vm.setProp(t, "uiState", e.manage(this.vm.newString(o))), this.vm.setProp(t, "callbackRegistry", this.callbackRegistry), this.vm.setProp(
2646
2652
  t,
2647
2653
  "featureFlags",
2648
2654
  this.exportObjectUniversal(ds.GlobalCfgRenderCtxFeatureFlags, e)
2649
2655
  );
2650
- const n = (i, l) => {
2651
- this.vm.newFunction(i, l).consume((a) => this.vm.setProp(t, i, a));
2656
+ const n = (i, c) => {
2657
+ this.vm.newFunction(i, c).consume((a) => this.vm.setProp(t, i, a));
2652
2658
  };
2653
2659
  n("getAccessorHandleByName", (i) => this.exportSingleValue(
2654
2660
  this.getAccessorHandleByName(this.vm.getString(i)),
2655
2661
  void 0
2656
- )), n("resolveWithCommon", (i, l, ...a) => this.exportSingleValue(
2662
+ )), n("resolveWithCommon", (i, c, ...a) => this.exportSingleValue(
2657
2663
  this.resolveWithCommon(
2658
2664
  this.vm.getString(i),
2659
- this.importObjectViaJson(l),
2665
+ this.importObjectViaJson(c),
2660
2666
  ...a.map(
2661
- (c) => this.importObjectViaJson(c)
2667
+ (l) => this.importObjectViaJson(l)
2662
2668
  )
2663
2669
  ),
2664
2670
  void 0
2665
- )), n("getResourceType", (i) => this.exportObjectViaJson(this.getResourceType(this.vm.getString(i)), void 0)), n("getInputsLocked", (i) => this.exportSingleValue(this.getInputsLocked(this.vm.getString(i)), void 0)), n("getOutputsLocked", (i) => this.exportSingleValue(this.getOutputsLocked(this.vm.getString(i)), void 0)), n("getIsReadyOrError", (i) => this.exportSingleValue(this.getIsReadyOrError(this.vm.getString(i)), void 0)), n("getIsFinal", (i) => this.exportSingleValue(this.getIsFinal(this.vm.getString(i)), void 0)), n("getError", (i) => this.exportSingleValue(this.getError(this.vm.getString(i)), void 0)), n("listInputFields", (i) => this.exportObjectViaJson(this.listInputFields(this.vm.getString(i)), void 0)), n("listOutputFields", (i) => this.exportObjectViaJson(this.listInputFields(this.vm.getString(i)), void 0)), n("listDynamicFields", (i) => this.exportObjectViaJson(this.listInputFields(this.vm.getString(i)), void 0)), n("getKeyValueBase64", (i, l) => this.exportSingleValue(
2666
- this.getKeyValueBase64(this.vm.getString(i), this.vm.getString(l)),
2671
+ )), n("getResourceType", (i) => this.exportObjectViaJson(this.getResourceType(this.vm.getString(i)), void 0)), n("getInputsLocked", (i) => this.exportSingleValue(this.getInputsLocked(this.vm.getString(i)), void 0)), n("getOutputsLocked", (i) => this.exportSingleValue(this.getOutputsLocked(this.vm.getString(i)), void 0)), n("getIsReadyOrError", (i) => this.exportSingleValue(this.getIsReadyOrError(this.vm.getString(i)), void 0)), n("getIsFinal", (i) => this.exportSingleValue(this.getIsFinal(this.vm.getString(i)), void 0)), n("getError", (i) => this.exportSingleValue(this.getError(this.vm.getString(i)), void 0)), n("listInputFields", (i) => this.exportObjectViaJson(this.listInputFields(this.vm.getString(i)), void 0)), n("listOutputFields", (i) => this.exportObjectViaJson(this.listInputFields(this.vm.getString(i)), void 0)), n("listDynamicFields", (i) => this.exportObjectViaJson(this.listInputFields(this.vm.getString(i)), void 0)), n("getKeyValueBase64", (i, c) => this.exportSingleValue(
2672
+ this.getKeyValueBase64(this.vm.getString(i), this.vm.getString(c)),
2667
2673
  void 0
2668
- )), n("getKeyValueAsString", (i, l) => this.exportSingleValue(
2669
- this.getKeyValueAsString(this.vm.getString(i), this.vm.getString(l)),
2674
+ )), n("getKeyValueAsString", (i, c) => this.exportSingleValue(
2675
+ this.getKeyValueAsString(this.vm.getString(i), this.vm.getString(c)),
2670
2676
  void 0
2671
- )), n("getDataBase64", (i) => this.exportSingleValue(this.getDataBase64(this.vm.getString(i)), void 0)), n("getDataAsString", (i) => this.exportSingleValue(this.getDataAsString(this.vm.getString(i)), void 0)), n("parsePObjectCollection", (i, l, a) => this.exportObjectUniversal(
2677
+ )), n("getDataBase64", (i) => this.exportSingleValue(this.getDataBase64(this.vm.getString(i)), void 0)), n("getDataAsString", (i) => this.exportSingleValue(this.getDataAsString(this.vm.getString(i)), void 0)), n("parsePObjectCollection", (i, c, a, ...l) => this.exportObjectUniversal(
2672
2678
  this.parsePObjectCollection(
2673
2679
  this.vm.getString(i),
2674
- this.vm.dump(l),
2675
- this.vm.getString(a)
2680
+ this.vm.dump(c),
2681
+ this.vm.getString(a),
2682
+ ...l.map(this.vm.getString)
2676
2683
  ),
2677
2684
  void 0
2678
2685
  )), n("getBlobContentAsBase64", (i) => this.exportSingleValue(
@@ -2687,25 +2694,25 @@ class je {
2687
2694
  )), n("getOnDemandBlobContentHandle", (i) => this.exportSingleValue(
2688
2695
  this.getOnDemandBlobContentHandle(this.vm.getString(i)),
2689
2696
  void 0
2690
- )), n("getImportProgress", (i) => this.exportSingleValue(this.getImportProgress(this.vm.getString(i)), void 0)), n("getLastLogs", (i, l) => this.exportSingleValue(
2691
- this.getLastLogs(this.vm.getString(i), this.vm.getNumber(l)),
2697
+ )), n("getImportProgress", (i) => this.exportSingleValue(this.getImportProgress(this.vm.getString(i)), void 0)), n("getLastLogs", (i, c) => this.exportSingleValue(
2698
+ this.getLastLogs(this.vm.getString(i), this.vm.getNumber(c)),
2692
2699
  void 0
2693
- )), n("getProgressLog", (i, l) => this.exportSingleValue(
2694
- this.getProgressLog(this.vm.getString(i), this.vm.getString(l)),
2700
+ )), n("getProgressLog", (i, c) => this.exportSingleValue(
2701
+ this.getProgressLog(this.vm.getString(i), this.vm.getString(c)),
2695
2702
  void 0
2696
2703
  )), n("getLogHandle", (i) => this.exportSingleValue(this.getLogHandle(this.vm.getString(i)), void 0)), n("getBlockLabel", (i) => this.exportSingleValue(this.getBlockLabel(this.vm.getString(i)), void 0)), n("getDataFromResultPool", (i) => this.exportObjectUniversal(this.getDataFromResultPool(), void 0)), n("getDataWithErrorsFromResultPool", (i) => this.exportObjectUniversal(this.getDataWithErrorsFromResultPool(), void 0)), n("getSpecsFromResultPool", (i) => this.exportObjectUniversal(this.getSpecsFromResultPool(), void 0)), n("calculateOptions", (i) => this.exportObjectUniversal(
2697
2704
  this.calculateOptions(this.importObjectViaJson(i)),
2698
2705
  void 0
2699
- )), n("getSpecFromResultPoolByRef", (i, l) => this.exportObjectUniversal(
2706
+ )), n("getSpecFromResultPoolByRef", (i, c) => this.exportObjectUniversal(
2700
2707
  this.getSpecFromResultPoolByRef(
2701
2708
  this.vm.getString(i),
2702
- this.vm.getString(l)
2709
+ this.vm.getString(c)
2703
2710
  ),
2704
2711
  void 0
2705
- )), n("getDataFromResultPoolByRef", (i, l) => this.exportObjectUniversal(
2712
+ )), n("getDataFromResultPoolByRef", (i, c) => this.exportObjectUniversal(
2706
2713
  this.getDataFromResultPoolByRef(
2707
2714
  this.vm.getString(i),
2708
- this.vm.getString(l)
2715
+ this.vm.getString(c)
2709
2716
  ),
2710
2717
  void 0
2711
2718
  )), n("createPFrame", (i) => this.exportSingleValue(
@@ -2722,15 +2729,15 @@ class je {
2722
2729
  });
2723
2730
  }
2724
2731
  }
2725
- function Ge(s, e) {
2726
- return Se(
2732
+ function Je(s, e) {
2733
+ return be(
2727
2734
  s.traverse(
2728
2735
  {
2729
2736
  field: U(e, "blockPack"),
2730
2737
  assertFieldType: "Dynamic",
2731
2738
  errorIfFieldNotSet: !0
2732
2739
  },
2733
- { field: F.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 }
2740
+ { field: T.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 }
2734
2741
  ),
2735
2742
  (t) => {
2736
2743
  const r = t.getDataAsJson(), o = Er(r.config);
@@ -2738,66 +2745,66 @@ function Ge(s, e) {
2738
2745
  }
2739
2746
  );
2740
2747
  }
2741
- const Ie = process.env.MI_LOG_OUTPUT_STATUS;
2742
- function Vn(s, e, t, r, o, n = {}) {
2748
+ const Ae = process.env.MI_LOG_OUTPUT_STATUS;
2749
+ function Gn(s, e, t, r, o, n = {}) {
2743
2750
  const i = `${e.blockId}#lambda#${o}#${t.handle}`;
2744
- return n = { ...n, key: i }, n.mode === void 0 && t.retentive === !0 && (n.mode = "StableOnlyRetentive"), V.makeRaw((l) => {
2745
- const a = new nt();
2746
- l.addOnDestroy(() => a.dispose());
2747
- const c = a.manage(s.quickJs.newRuntime());
2748
- c.setMemoryLimit(1024 * 640), c.setMaxStackSize(1024 * 320);
2749
- const u = a.manage(c.newContext()), d = new je(a, u, e, s, l);
2751
+ return n = { ...n, key: i }, n.mode === void 0 && t.retentive === !0 && (n.mode = "StableOnlyRetentive"), V.makeRaw((c) => {
2752
+ const a = new it();
2753
+ c.addOnDestroy(() => a.dispose());
2754
+ const l = a.manage(s.quickJs.newRuntime());
2755
+ l.setMemoryLimit(1024 * 640), l.setMaxStackSize(1024 * 320);
2756
+ const u = a.manage(l.newContext()), d = new Ve(a, u, e, s, c);
2750
2757
  d.evaluateBundle(r.content);
2751
2758
  const m = d.runCallback(t.handle);
2752
2759
  d.resetComputableCtx();
2753
2760
  let h = 0;
2754
- return Ie && Ie !== "unstable-only" && console.log(`Output ${t.handle} scaffold calculated.`), {
2761
+ return Ae && Ae !== "unstable-only" && console.log(`Output ${t.handle} scaffold calculated.`), {
2755
2762
  ir: d.computablesToResolve,
2756
2763
  postprocessValue: async (f, { unstableMarker: I, stable: A }) => {
2757
2764
  for (const [_, k] of Object.entries(f)) d.runCallback(_, k);
2758
2765
  const B = d.importObjectUniversal(m);
2759
- return h++, Ie && (Ie !== "unstable-only" || !A) && console.log(
2766
+ return h++, Ae && (Ae !== "unstable-only" || !A) && console.log(
2760
2767
  A ? `Stable output ${t.handle} calculated ${B !== void 0 ? "defined" : "undefined"}; (#${h})` : `Unstable output ${t.handle}; marker = ${I}; ${B !== void 0 ? "defined" : "undefined"} (#${h})`
2761
2768
  ), B;
2762
2769
  }
2763
2770
  };
2764
2771
  }, n);
2765
2772
  }
2766
- function Un(s) {
2767
- return Rr(s) ? s.isActive === !0 : cn(s);
2773
+ function Jn(s) {
2774
+ return Rr(s) ? s.isActive === !0 : un(s);
2768
2775
  }
2769
- function be(s, e, t, r, o, n = {}) {
2776
+ function Ce(s, e, t, r, o, n = {}) {
2770
2777
  if (Rr(t)) {
2771
2778
  if (r === void 0) throw new Error("No code bundle.");
2772
- return Vn(s, e, t, r, o, n);
2773
- } else return xn(s.driverKit, e, t, n);
2779
+ return Gn(s, e, t, r, o, n);
2780
+ } else return Vn(s.driverKit, e, t, n);
2774
2781
  }
2775
- function Gn(s, e, t) {
2782
+ function Mn(s, e, t) {
2776
2783
  return V.make(
2777
2784
  (r) => {
2778
- var f, I, A, B, _, k, se, ue;
2779
- const o = r.accessor(s).node(), n = x(o.getKeyValueAsJson(St)), i = x(o.getKeyValueAsJson(Re)), l = x(o.getKeyValueAsJson(ke)), a = x(o.getKeyValueAsJson(le)), c = x(
2780
- o.getKeyValueAsJson(Be)
2785
+ var f, I, A, B, _, k, se, de;
2786
+ const o = r.accessor(s).node(), n = x(o.getKeyValueAsJson(wt)), i = x(o.getKeyValueAsJson(ke)), c = x(o.getKeyValueAsJson(Pe)), a = x(o.getKeyValueAsJson(ue)), l = x(
2787
+ o.getKeyValueAsJson(xe)
2781
2788
  ), u = /* @__PURE__ */ new Map();
2782
- for (const { id: T } of te(a)) {
2789
+ for (const { id: F } of te(a)) {
2783
2790
  const z = o.traverse({
2784
- field: U(T, "currentArgs"),
2791
+ field: U(F, "currentArgs"),
2785
2792
  assertFieldType: "Dynamic",
2786
2793
  errorIfFieldNotSet: !0
2787
2794
  });
2788
2795
  let oe;
2789
2796
  const K = o.traverse({
2790
- field: U(T, "prodArgs"),
2797
+ field: U(F, "prodArgs"),
2791
2798
  assertFieldType: "Dynamic",
2792
2799
  stableIfNotFound: !0
2793
2800
  });
2794
2801
  if (K !== void 0) {
2795
2802
  const G = o.getField({
2796
- field: U(T, "prodOutput"),
2803
+ field: U(F, "prodOutput"),
2797
2804
  assertFieldType: "Dynamic",
2798
2805
  errorIfFieldNotFound: !0
2799
2806
  }), j = o.getField({
2800
- field: U(T, "prodUiCtx"),
2807
+ field: U(F, "prodUiCtx"),
2801
2808
  assertFieldType: "Dynamic",
2802
2809
  errorIfFieldNotFound: !0
2803
2810
  });
@@ -2806,30 +2813,30 @@ function Gn(s, e, t) {
2806
2813
  stale: z.id !== K.id,
2807
2814
  outputError: G.error !== void 0 || j.error !== void 0 || ((f = G.value) == null ? void 0 : f.getError()) !== void 0 || ((I = j.value) == null ? void 0 : I.getError()) !== void 0,
2808
2815
  outputsError: ((A = G.error) == null ? void 0 : A.getDataAsString()) ?? ((_ = (B = G.value) == null ? void 0 : B.getError()) == null ? void 0 : _.getDataAsString()),
2809
- exportsError: ((k = j.error) == null ? void 0 : k.getDataAsString()) ?? ((ue = (se = j.value) == null ? void 0 : se.getError()) == null ? void 0 : ue.getDataAsString()),
2816
+ exportsError: ((k = j.error) == null ? void 0 : k.getDataAsString()) ?? ((de = (se = j.value) == null ? void 0 : se.getError()) == null ? void 0 : de.getDataAsString()),
2810
2817
  finished: (G.value !== void 0 && G.value.getIsReadyOrError() || G.error !== void 0 && G.error.getIsReadyOrError()) && (j.value !== void 0 && j.value.getIsReadyOrError() || j.error !== void 0 && j.error.getIsReadyOrError())
2811
2818
  };
2812
2819
  }
2813
- u.set(T, { currentArguments: z.getDataAsJson(), prod: oe });
2820
+ u.set(F, { currentArguments: z.getDataAsJson(), prod: oe });
2814
2821
  }
2815
- const d = Ne(a, (T) => u.get(T).currentArguments), m = new Set(c.blocksInLimbo), h = [...te(a)].map(({ id: T, label: z, renderingMode: oe }) => {
2822
+ const d = De(a, (F) => u.get(F).currentArguments), m = new Set(l.blocksInLimbo), h = [...te(a)].map(({ id: F, label: z, renderingMode: oe }) => {
2816
2823
  var b, w, C, P, E;
2817
- const K = x(u.get(T)), G = x(d.nodes.get(T));
2824
+ const K = x(u.get(F)), G = x(d.nodes.get(F));
2818
2825
  let j = "NotCalculated";
2819
- K.prod !== void 0 && (m.has(T) ? j = "Limbo" : j = K.prod.finished ? "Done" : "Running");
2820
- const X = Ge(o, T), { sections: de, title: v, inputsValid: p, sdkVersion: y } = Se(X, ({ bpId: O, cfg: L, info: N }) => {
2821
- const re = Et(s, T);
2826
+ K.prod !== void 0 && (m.has(F) ? j = "Limbo" : j = K.prod.finished ? "Done" : "Running");
2827
+ const X = Je(o, F), { sections: pe, title: v, inputsValid: p, sdkVersion: y } = be(X, ({ bpId: O, cfg: L, info: N }) => {
2828
+ const re = Ct(s, F);
2822
2829
  return {
2823
- sections: be(
2830
+ sections: Ce(
2824
2831
  t,
2825
2832
  re,
2826
2833
  L.sections,
2827
2834
  L.code,
2828
2835
  O
2829
2836
  ),
2830
- title: Se(
2837
+ title: be(
2831
2838
  L.title,
2832
- (as) => be(
2839
+ (as) => Ce(
2833
2840
  t,
2834
2841
  re,
2835
2842
  as,
@@ -2837,7 +2844,7 @@ function Gn(s, e, t) {
2837
2844
  O
2838
2845
  )
2839
2846
  ),
2840
- inputsValid: be(
2847
+ inputsValid: Ce(
2841
2848
  t,
2842
2849
  re,
2843
2850
  L.inputsValid,
@@ -2846,36 +2853,36 @@ function Gn(s, e, t) {
2846
2853
  ),
2847
2854
  sdkVersion: L.sdkVersion
2848
2855
  };
2849
- }) || {}, g = Se(
2856
+ }) || {}, g = be(
2850
2857
  X,
2851
2858
  ({ info: O }) => t.blockUpdateWatcher.get(O.source)
2852
2859
  );
2853
2860
  return {
2854
- id: T,
2861
+ id: F,
2855
2862
  label: v ?? z,
2856
2863
  title: v ?? z,
2857
2864
  renderingMode: oe,
2858
2865
  stale: ((b = K.prod) == null ? void 0 : b.stale) !== !1 || j === "Limbo",
2859
2866
  missingReference: G.missingReferences,
2860
- upstreams: [...d.traverseIdsExcludingRoots("upstream", T)],
2861
- downstreams: [...d.traverseIdsExcludingRoots("downstream", T)],
2867
+ upstreams: [...d.traverseIdsExcludingRoots("upstream", F)],
2868
+ downstreams: [...d.traverseIdsExcludingRoots("downstream", F)],
2862
2869
  calculationStatus: j,
2863
2870
  outputErrors: ((w = K.prod) == null ? void 0 : w.outputError) === !0,
2864
2871
  outputsError: (C = K.prod) == null ? void 0 : C.outputsError,
2865
2872
  exportsError: (P = K.prod) == null ? void 0 : P.exportsError,
2866
- sections: de,
2873
+ sections: pe,
2867
2874
  inputsValid: p,
2868
2875
  currentBlockPack: (E = X == null ? void 0 : X.info) == null ? void 0 : E.source,
2869
2876
  updatedBlockPack: g,
2870
2877
  sdkVersion: y,
2871
- navigationState: e.getState(T)
2878
+ navigationState: e.getState(F)
2872
2879
  };
2873
2880
  });
2874
2881
  return {
2875
- meta: l,
2882
+ meta: c,
2876
2883
  created: new Date(n),
2877
2884
  lastModified: new Date(i),
2878
- authorMarker: o.getKeyValueAsJson(ct),
2885
+ authorMarker: o.getKeyValueAsJson(lt),
2879
2886
  blocks: h
2880
2887
  };
2881
2888
  },
@@ -2886,15 +2893,15 @@ function Gn(s, e, t) {
2886
2893
  ...r,
2887
2894
  blocks: r.blocks.map((i) => {
2888
2895
  i.inputsValid || o.add(i.id), i.stale && n.add(i.id);
2889
- const l = i.stale || i.upstreams.findIndex((c) => n.has(c)) !== -1, a = (l || i.outputErrors) && !!i.inputsValid && !i.missingReference && i.upstreams.findIndex((c) => o.has(c)) === -1;
2890
- return { ...i, canRun: a, stale: l };
2896
+ const c = i.stale || i.upstreams.findIndex((l) => n.has(l)) !== -1, a = (c || i.outputErrors) && !!i.inputsValid && !i.missingReference && i.upstreams.findIndex((l) => o.has(l)) === -1;
2897
+ return { ...i, canRun: a, stale: c };
2891
2898
  })
2892
2899
  };
2893
2900
  }
2894
2901
  }
2895
2902
  ).withStableType();
2896
2903
  }
2897
- function Jn(s, e) {
2904
+ function _n(s, e) {
2898
2905
  const t = s.node();
2899
2906
  if (ae(t.resourceType, xr)) {
2900
2907
  const r = t.getDataAsJson();
@@ -2911,10 +2918,10 @@ function Jn(s, e) {
2911
2918
  } else
2912
2919
  throw new Error(`Unsupported resource type: ${JSON.stringify(t.resourceType)}`);
2913
2920
  }
2914
- function Mn(s, e) {
2921
+ function Kn(s, e) {
2915
2922
  if (s !== void 0)
2916
2923
  return V.make(
2917
- (t) => Jn(t.accessor(s), e),
2924
+ (t) => _n(t.accessor(s), e),
2918
2925
  {
2919
2926
  postprocessValue: (t) => {
2920
2927
  if (t !== void 0) {
@@ -2926,20 +2933,20 @@ function Mn(s, e) {
2926
2933
  }
2927
2934
  ).withStableType();
2928
2935
  }
2929
- function _n(s, e, t) {
2936
+ function Hn(s, e, t) {
2930
2937
  return V.make(
2931
2938
  (r) => {
2932
- var l;
2933
- const o = r.accessor(s).node(), n = Ge(o, e), i = (l = o.traverse(
2939
+ var c;
2940
+ const o = r.accessor(s).node(), n = Je(o, e), i = (c = o.traverse(
2934
2941
  {
2935
2942
  field: U(e, "blockPack"),
2936
2943
  assertFieldType: "Dynamic"
2937
2944
  },
2938
- { field: F.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 },
2945
+ { field: T.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 },
2939
2946
  { field: Ur, assertFieldType: "Input" }
2940
- )) == null ? void 0 : l.persist();
2947
+ )) == null ? void 0 : c.persist();
2941
2948
  return {
2942
- path: Mn(i, t),
2949
+ path: Kn(i, t),
2943
2950
  sdkVersion: n == null ? void 0 : n.cfg.sdkVersion
2944
2951
  };
2945
2952
  },
@@ -2951,22 +2958,22 @@ function qr(s, e, t) {
2951
2958
  return V.make((i) => qr(s, e, i), {
2952
2959
  key: `inputs#${$r(s.rid)}#${e}`
2953
2960
  });
2954
- const r = t.accessor(s).node(), o = Et(s, e), n = o.uiState(t);
2961
+ const r = t.accessor(s).node(), o = Ct(s, e), n = o.uiState(t);
2955
2962
  return {
2956
- author: r.getKeyValueAsJson(at(e)),
2963
+ author: r.getKeyValueAsJson(ct(e)),
2957
2964
  args: JSON.parse(o.args(t)),
2958
2965
  ui: n !== void 0 ? JSON.parse(n) : void 0
2959
2966
  };
2960
2967
  }
2961
- function Kn(s, e, t) {
2968
+ function Wn(s, e, t) {
2962
2969
  return V.make(
2963
2970
  (r) => {
2964
2971
  const o = r.accessor(s).node(), n = _r(s, e);
2965
- return Se(Ge(o, e), ({ cfg: i, bpId: l }) => {
2972
+ return be(Je(o, e), ({ cfg: i, bpId: c }) => {
2966
2973
  const a = {};
2967
- for (const [c, u] of Object.entries(i.outputs)) {
2968
- const d = be(t, n, u, i.code, l);
2969
- a[c] = V.wrapError(d);
2974
+ for (const [l, u] of Object.entries(i.outputs)) {
2975
+ const d = Ce(t, n, u, i.code, c);
2976
+ a[l] = V.wrapError(d);
2970
2977
  }
2971
2978
  return a;
2972
2979
  });
@@ -2974,38 +2981,38 @@ function Kn(s, e, t) {
2974
2981
  { key: "outputs#" + $r(s.rid) + "#" + e }
2975
2982
  ).withStableType();
2976
2983
  }
2977
- function Hn(s, e) {
2984
+ function zn(s, e) {
2978
2985
  return V.make((t) => {
2979
- const r = t.accessor(s).node(), o = x(r.getKeyValueAsJson(le)), n = [];
2980
- for (const { id: i, renderingMode: l } of te(o)) {
2981
- const a = Ge(r, i);
2986
+ const r = t.accessor(s).node(), o = x(r.getKeyValueAsJson(ue)), n = [];
2987
+ for (const { id: i, renderingMode: c } of te(o)) {
2988
+ const a = Je(r, i);
2982
2989
  if (a === void 0) continue;
2983
- const c = Object.entries(a.cfg.outputs).map(([, d]) => d).filter((d) => Un(d)).map((d) => d);
2984
- if (c.length === 0) continue;
2990
+ const l = Object.entries(a.cfg.outputs).map(([, d]) => d).filter((d) => Jn(d)).map((d) => d);
2991
+ if (l.length === 0) continue;
2985
2992
  const u = _r(r.persist(), i);
2986
- for (const d of c)
2993
+ for (const d of l)
2987
2994
  n.push(
2988
- V.wrapError(be(e, u, d, a.cfg.code, a.bpId))
2995
+ V.wrapError(Ce(e, u, d, a.cfg.code, a.bpId))
2989
2996
  );
2990
2997
  }
2991
2998
  return n;
2992
2999
  });
2993
3000
  }
2994
- class Wn {
3001
+ class Xn {
2995
3002
  constructor() {
2996
3003
  S(this, "states", /* @__PURE__ */ new Map());
2997
3004
  }
2998
3005
  setState(e, t) {
2999
3006
  const r = this.states.get(e);
3000
3007
  if (r === void 0) {
3001
- this.states.set(e, { state: t, change: new jt() });
3008
+ this.states.set(e, { state: t, change: new xt() });
3002
3009
  return;
3003
3010
  }
3004
3011
  r.state = { ...t }, r.change.markChanged();
3005
3012
  }
3006
3013
  readState(e, t) {
3007
3014
  let r = this.states.get(t);
3008
- return r === void 0 && (r = { state: { ...ps }, change: new jt() }, this.states.set(t, r)), r.change.attachWatcher(e.watcher), r.state;
3015
+ return r === void 0 && (r = { state: { ...ps }, change: new xt() }, this.states.set(t, r)), r.change.attachWatcher(e.watcher), r.state;
3009
3016
  }
3010
3017
  getState(e) {
3011
3018
  return V.make(
@@ -3018,29 +3025,29 @@ class Wn {
3018
3025
  t !== void 0 && (this.states.delete(e), t.change.markChanged());
3019
3026
  }
3020
3027
  }
3021
- class Rt {
3028
+ class Et {
3022
3029
  constructor(e, t, r) {
3023
3030
  /** Underlying pl resource id */
3024
3031
  S(this, "rid");
3025
3032
  /** Data for the left panel, contain basic information about block status. */
3026
3033
  S(this, "overview");
3027
- S(this, "navigationStates", new Wn());
3034
+ S(this, "navigationStates", new Xn());
3028
3035
  S(this, "blockComputables", /* @__PURE__ */ new Map());
3029
3036
  S(this, "blockFrontends", /* @__PURE__ */ new Map());
3030
3037
  S(this, "activeConfigs");
3031
3038
  S(this, "refreshLoopResult");
3032
3039
  S(this, "abortController", new AbortController());
3033
3040
  S(this, "destroyed", !1);
3034
- this.env = e, this.projectTree = r, this.overview = Gn(
3041
+ this.env = e, this.projectTree = r, this.overview = Mn(
3035
3042
  r.entry(),
3036
3043
  this.navigationStates,
3037
3044
  e
3038
- ).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs = Hn(r.entry(), e);
3045
+ ).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs = zn(r.entry(), e);
3039
3046
  }
3040
3047
  async refreshLoop() {
3041
3048
  for (; !this.destroyed; )
3042
3049
  try {
3043
- await qe(this.env.pl, this.rid, (e) => {
3050
+ await Ye(this.env.pl, this.rid, (e) => {
3044
3051
  e.doRefresh(this.env.ops.stagingRenderingRate);
3045
3052
  }), await this.activeConfigs.getValue(), await Ar(this.env.ops.projectRefreshInterval, this.abortController.signal);
3046
3053
  } catch (e) {
@@ -3064,13 +3071,13 @@ class Rt {
3064
3071
  *
3065
3072
  * @return returns newly created block id
3066
3073
  * */
3067
- async addBlock(e, t, r, o = void 0, n = Ee()) {
3068
- const i = await this.env.bpPreparer.prepare(t), l = await this.env.bpPreparer.getBlockConfigContainer(t), a = Er(l);
3074
+ async addBlock(e, t, r, o = void 0, n = Re()) {
3075
+ const i = await this.env.bpPreparer.prepare(t), c = await this.env.bpPreparer.getBlockConfigContainer(t), a = Er(c);
3069
3076
  return await ee(
3070
3077
  this.env.pl,
3071
3078
  this.rid,
3072
3079
  o,
3073
- (c) => c.addBlock(
3080
+ (l) => l.addBlock(
3074
3081
  {
3075
3082
  id: n,
3076
3083
  label: e,
@@ -3095,7 +3102,7 @@ class Rt {
3095
3102
  this.env.pl,
3096
3103
  this.rid,
3097
3104
  o,
3098
- (l) => l.migrateBlockPack(
3105
+ (c) => c.migrateBlockPack(
3099
3106
  e,
3100
3107
  n,
3101
3108
  r ? JSON.stringify(i.initialArgs) : void 0
@@ -3126,9 +3133,9 @@ class Rt {
3126
3133
  {
3127
3134
  id: n.id,
3128
3135
  label: n.label,
3129
- blocks: e.map((l) => {
3130
- const a = n.blocks.find((c) => c.id === l);
3131
- if (a === void 0) throw new Error(`Can't find block: ${l}`);
3136
+ blocks: e.map((c) => {
3137
+ const a = n.blocks.find((l) => l.id === c);
3138
+ if (a === void 0) throw new Error(`Can't find block: ${c}`);
3132
3139
  return a;
3133
3140
  })
3134
3141
  }
@@ -3143,7 +3150,7 @@ class Rt {
3143
3150
  * stale state.
3144
3151
  * */
3145
3152
  async runBlock(e) {
3146
- await qe(this.env.pl, this.rid, (t) => t.renderProduction([e], !0)), await this.projectTree.refreshState();
3153
+ await Ye(this.env.pl, this.rid, (t) => t.renderProduction([e], !0)), await this.projectTree.refreshState();
3147
3154
  }
3148
3155
  /**
3149
3156
  * Stops the block if it is running by destroying its production state. All
@@ -3151,7 +3158,7 @@ class Rt {
3151
3158
  * calculated.
3152
3159
  * */
3153
3160
  async stopBlock(e) {
3154
- await qe(this.env.pl, this.rid, (t) => t.stopProduction(e)), await this.projectTree.refreshState();
3161
+ await Ye(this.env.pl, this.rid, (t) => t.stopProduction(e)), await this.projectTree.refreshState();
3155
3162
  }
3156
3163
  // /** Update block label. */
3157
3164
  // public async setBlockLabel(blockId: string, label: string, author?: AuthorMarker) {
@@ -3208,22 +3215,22 @@ class Rt {
3208
3215
  /** Resets arguments and ui state of the block to initial state */
3209
3216
  async resetBlockArgsAndUiState(e, t) {
3210
3217
  await this.env.pl.withWriteTx("BlockInputsReset", async (r) => {
3211
- const o = ot(
3218
+ const o = nt(
3212
3219
  (await r.getField(D(this.rid, U(e, "blockPack")))).value
3213
- ), n = ot(
3214
- (await r.getField(D(o, F.HolderRefField))).value
3215
- ), i = await r.getResourceData(n, !1), l = JSON.parse(
3220
+ ), n = nt(
3221
+ (await r.getField(D(o, T.HolderRefField))).value
3222
+ ), i = await r.getResourceData(n, !1), c = JSON.parse(
3216
3223
  Buffer.from(x(i.data)).toString("utf-8")
3217
3224
  );
3218
3225
  await ee(r, this.rid, t, (a) => {
3219
- a.setArgs([{ blockId: e, args: JSON.stringify(l.config.initialArgs) }]), a.setUiState(e, void 0);
3226
+ a.setArgs([{ blockId: e, args: JSON.stringify(c.config.initialArgs) }]), a.setUiState(e, void 0);
3220
3227
  }), await r.commit();
3221
3228
  }), await this.projectTree.refreshState();
3222
3229
  }
3223
3230
  getBlockComputables(e) {
3224
3231
  const t = this.blockComputables.get(e);
3225
3232
  if (t === void 0) {
3226
- const r = Kn(this.projectTree.entry(), e, this.env), n = {
3233
+ const r = Wn(this.projectTree.entry(), e, this.env), n = {
3227
3234
  fullState: V.make(
3228
3235
  (i) => ({
3229
3236
  argsAndUiState: qr(this.projectTree.entry(), e, i),
@@ -3257,7 +3264,7 @@ class Rt {
3257
3264
  getBlockFrontend(e) {
3258
3265
  const t = this.blockFrontends.get(e);
3259
3266
  if (t === void 0) {
3260
- const r = _n(
3267
+ const r = Hn(
3261
3268
  this.projectTree.entry(),
3262
3269
  e,
3263
3270
  this.env
@@ -3282,14 +3289,14 @@ class Rt {
3282
3289
  t,
3283
3290
  {
3284
3291
  ...e.ops.defaultTreeOptions,
3285
- pruning: zn
3292
+ pruning: qn
3286
3293
  },
3287
3294
  e.logger
3288
3295
  );
3289
- return new Rt(e, t, r);
3296
+ return new Et(e, t, r);
3290
3297
  }
3291
3298
  }
3292
- function zn(s) {
3299
+ function qn(s) {
3293
3300
  switch (s.type.name) {
3294
3301
  case "BlockPackCustom":
3295
3302
  return s.fields.filter((e) => e.name !== "template");
@@ -3325,7 +3332,7 @@ function Zr(s) {
3325
3332
  blobDownloadPath: H.join(s, "download")
3326
3333
  };
3327
3334
  }
3328
- const Xn = {
3335
+ const Yn = {
3329
3336
  ...Yr,
3330
3337
  defaultTreeOptions: {
3331
3338
  pollingInterval: 350,
@@ -3335,18 +3342,18 @@ const Xn = {
3335
3342
  projectRefreshInterval: 700,
3336
3343
  stagingRenderingRate: 5
3337
3344
  };
3338
- function qn(s) {
3345
+ function Zn(s) {
3339
3346
  return {
3340
3347
  ...Zr(s),
3341
3348
  frontendDownloadPath: H.join(s, "frontend")
3342
3349
  };
3343
3350
  }
3344
- function Yn(s) {
3351
+ function Qn(s) {
3345
3352
  return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
3346
3353
  }
3347
3354
  var ft = { exports: {} };
3348
- const Zn = "2.0.0", Qr = 256, Qn = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
3349
- 9007199254740991, ei = 16, ti = Qr - 6, ri = [
3355
+ const ei = "2.0.0", Qr = 256, ti = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
3356
+ 9007199254740991, ri = 16, si = Qr - 6, oi = [
3350
3357
  "major",
3351
3358
  "premajor",
3352
3359
  "minor",
@@ -3355,27 +3362,27 @@ const Zn = "2.0.0", Qr = 256, Qn = Number.MAX_SAFE_INTEGER || /* istanbul ignore
3355
3362
  "prepatch",
3356
3363
  "prerelease"
3357
3364
  ];
3358
- var Je = {
3365
+ var Me = {
3359
3366
  MAX_LENGTH: Qr,
3360
- MAX_SAFE_COMPONENT_LENGTH: ei,
3361
- MAX_SAFE_BUILD_LENGTH: ti,
3362
- MAX_SAFE_INTEGER: Qn,
3363
- RELEASE_TYPES: ri,
3364
- SEMVER_SPEC_VERSION: Zn,
3367
+ MAX_SAFE_COMPONENT_LENGTH: ri,
3368
+ MAX_SAFE_BUILD_LENGTH: si,
3369
+ MAX_SAFE_INTEGER: ti,
3370
+ RELEASE_TYPES: oi,
3371
+ SEMVER_SPEC_VERSION: ei,
3365
3372
  FLAG_INCLUDE_PRERELEASE: 1,
3366
3373
  FLAG_LOOSE: 2
3367
3374
  };
3368
- const si = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...s) => console.error("SEMVER", ...s) : () => {
3375
+ const ni = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...s) => console.error("SEMVER", ...s) : () => {
3369
3376
  };
3370
- var Me = si;
3377
+ var _e = ni;
3371
3378
  (function(s, e) {
3372
3379
  const {
3373
3380
  MAX_SAFE_COMPONENT_LENGTH: t,
3374
3381
  MAX_SAFE_BUILD_LENGTH: r,
3375
3382
  MAX_LENGTH: o
3376
- } = Je, n = Me;
3383
+ } = Me, n = _e;
3377
3384
  e = s.exports = {};
3378
- const i = e.re = [], l = e.safeRe = [], a = e.src = [], c = e.t = {};
3385
+ const i = e.re = [], c = e.safeRe = [], a = e.src = [], l = e.t = {};
3379
3386
  let u = 0;
3380
3387
  const d = "[a-zA-Z0-9-]", m = [
3381
3388
  ["\\s", 1],
@@ -3387,25 +3394,25 @@ var Me = si;
3387
3394
  return I;
3388
3395
  }, f = (I, A, B) => {
3389
3396
  const _ = h(A), k = u++;
3390
- n(I, k, A), c[I] = k, a[k] = A, i[k] = new RegExp(A, B ? "g" : void 0), l[k] = new RegExp(_, B ? "g" : void 0);
3397
+ n(I, k, A), l[I] = k, a[k] = A, i[k] = new RegExp(A, B ? "g" : void 0), c[k] = new RegExp(_, B ? "g" : void 0);
3391
3398
  };
3392
- f("NUMERICIDENTIFIER", "0|[1-9]\\d*"), f("NUMERICIDENTIFIERLOOSE", "\\d+"), f("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${d}*`), f("MAINVERSION", `(${a[c.NUMERICIDENTIFIER]})\\.(${a[c.NUMERICIDENTIFIER]})\\.(${a[c.NUMERICIDENTIFIER]})`), f("MAINVERSIONLOOSE", `(${a[c.NUMERICIDENTIFIERLOOSE]})\\.(${a[c.NUMERICIDENTIFIERLOOSE]})\\.(${a[c.NUMERICIDENTIFIERLOOSE]})`), f("PRERELEASEIDENTIFIER", `(?:${a[c.NUMERICIDENTIFIER]}|${a[c.NONNUMERICIDENTIFIER]})`), f("PRERELEASEIDENTIFIERLOOSE", `(?:${a[c.NUMERICIDENTIFIERLOOSE]}|${a[c.NONNUMERICIDENTIFIER]})`), f("PRERELEASE", `(?:-(${a[c.PRERELEASEIDENTIFIER]}(?:\\.${a[c.PRERELEASEIDENTIFIER]})*))`), f("PRERELEASELOOSE", `(?:-?(${a[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[c.PRERELEASEIDENTIFIERLOOSE]})*))`), f("BUILDIDENTIFIER", `${d}+`), f("BUILD", `(?:\\+(${a[c.BUILDIDENTIFIER]}(?:\\.${a[c.BUILDIDENTIFIER]})*))`), f("FULLPLAIN", `v?${a[c.MAINVERSION]}${a[c.PRERELEASE]}?${a[c.BUILD]}?`), f("FULL", `^${a[c.FULLPLAIN]}$`), f("LOOSEPLAIN", `[v=\\s]*${a[c.MAINVERSIONLOOSE]}${a[c.PRERELEASELOOSE]}?${a[c.BUILD]}?`), f("LOOSE", `^${a[c.LOOSEPLAIN]}$`), f("GTLT", "((?:<|>)?=?)"), f("XRANGEIDENTIFIERLOOSE", `${a[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), f("XRANGEIDENTIFIER", `${a[c.NUMERICIDENTIFIER]}|x|X|\\*`), f("XRANGEPLAIN", `[v=\\s]*(${a[c.XRANGEIDENTIFIER]})(?:\\.(${a[c.XRANGEIDENTIFIER]})(?:\\.(${a[c.XRANGEIDENTIFIER]})(?:${a[c.PRERELEASE]})?${a[c.BUILD]}?)?)?`), f("XRANGEPLAINLOOSE", `[v=\\s]*(${a[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[c.XRANGEIDENTIFIERLOOSE]})(?:${a[c.PRERELEASELOOSE]})?${a[c.BUILD]}?)?)?`), f("XRANGE", `^${a[c.GTLT]}\\s*${a[c.XRANGEPLAIN]}$`), f("XRANGELOOSE", `^${a[c.GTLT]}\\s*${a[c.XRANGEPLAINLOOSE]}$`), f("COERCEPLAIN", `(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`), f("COERCE", `${a[c.COERCEPLAIN]}(?:$|[^\\d])`), f("COERCEFULL", a[c.COERCEPLAIN] + `(?:${a[c.PRERELEASE]})?(?:${a[c.BUILD]})?(?:$|[^\\d])`), f("COERCERTL", a[c.COERCE], !0), f("COERCERTLFULL", a[c.COERCEFULL], !0), f("LONETILDE", "(?:~>?)"), f("TILDETRIM", `(\\s*)${a[c.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", f("TILDE", `^${a[c.LONETILDE]}${a[c.XRANGEPLAIN]}$`), f("TILDELOOSE", `^${a[c.LONETILDE]}${a[c.XRANGEPLAINLOOSE]}$`), f("LONECARET", "(?:\\^)"), f("CARETTRIM", `(\\s*)${a[c.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", f("CARET", `^${a[c.LONECARET]}${a[c.XRANGEPLAIN]}$`), f("CARETLOOSE", `^${a[c.LONECARET]}${a[c.XRANGEPLAINLOOSE]}$`), f("COMPARATORLOOSE", `^${a[c.GTLT]}\\s*(${a[c.LOOSEPLAIN]})$|^$`), f("COMPARATOR", `^${a[c.GTLT]}\\s*(${a[c.FULLPLAIN]})$|^$`), f("COMPARATORTRIM", `(\\s*)${a[c.GTLT]}\\s*(${a[c.LOOSEPLAIN]}|${a[c.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", f("HYPHENRANGE", `^\\s*(${a[c.XRANGEPLAIN]})\\s+-\\s+(${a[c.XRANGEPLAIN]})\\s*$`), f("HYPHENRANGELOOSE", `^\\s*(${a[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[c.XRANGEPLAINLOOSE]})\\s*$`), f("STAR", "(<|>)?=?\\s*\\*"), f("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), f("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
3399
+ f("NUMERICIDENTIFIER", "0|[1-9]\\d*"), f("NUMERICIDENTIFIERLOOSE", "\\d+"), f("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${d}*`), f("MAINVERSION", `(${a[l.NUMERICIDENTIFIER]})\\.(${a[l.NUMERICIDENTIFIER]})\\.(${a[l.NUMERICIDENTIFIER]})`), f("MAINVERSIONLOOSE", `(${a[l.NUMERICIDENTIFIERLOOSE]})\\.(${a[l.NUMERICIDENTIFIERLOOSE]})\\.(${a[l.NUMERICIDENTIFIERLOOSE]})`), f("PRERELEASEIDENTIFIER", `(?:${a[l.NUMERICIDENTIFIER]}|${a[l.NONNUMERICIDENTIFIER]})`), f("PRERELEASEIDENTIFIERLOOSE", `(?:${a[l.NUMERICIDENTIFIERLOOSE]}|${a[l.NONNUMERICIDENTIFIER]})`), f("PRERELEASE", `(?:-(${a[l.PRERELEASEIDENTIFIER]}(?:\\.${a[l.PRERELEASEIDENTIFIER]})*))`), f("PRERELEASELOOSE", `(?:-?(${a[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[l.PRERELEASEIDENTIFIERLOOSE]})*))`), f("BUILDIDENTIFIER", `${d}+`), f("BUILD", `(?:\\+(${a[l.BUILDIDENTIFIER]}(?:\\.${a[l.BUILDIDENTIFIER]})*))`), f("FULLPLAIN", `v?${a[l.MAINVERSION]}${a[l.PRERELEASE]}?${a[l.BUILD]}?`), f("FULL", `^${a[l.FULLPLAIN]}$`), f("LOOSEPLAIN", `[v=\\s]*${a[l.MAINVERSIONLOOSE]}${a[l.PRERELEASELOOSE]}?${a[l.BUILD]}?`), f("LOOSE", `^${a[l.LOOSEPLAIN]}$`), f("GTLT", "((?:<|>)?=?)"), f("XRANGEIDENTIFIERLOOSE", `${a[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), f("XRANGEIDENTIFIER", `${a[l.NUMERICIDENTIFIER]}|x|X|\\*`), f("XRANGEPLAIN", `[v=\\s]*(${a[l.XRANGEIDENTIFIER]})(?:\\.(${a[l.XRANGEIDENTIFIER]})(?:\\.(${a[l.XRANGEIDENTIFIER]})(?:${a[l.PRERELEASE]})?${a[l.BUILD]}?)?)?`), f("XRANGEPLAINLOOSE", `[v=\\s]*(${a[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[l.XRANGEIDENTIFIERLOOSE]})(?:${a[l.PRERELEASELOOSE]})?${a[l.BUILD]}?)?)?`), f("XRANGE", `^${a[l.GTLT]}\\s*${a[l.XRANGEPLAIN]}$`), f("XRANGELOOSE", `^${a[l.GTLT]}\\s*${a[l.XRANGEPLAINLOOSE]}$`), f("COERCEPLAIN", `(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`), f("COERCE", `${a[l.COERCEPLAIN]}(?:$|[^\\d])`), f("COERCEFULL", a[l.COERCEPLAIN] + `(?:${a[l.PRERELEASE]})?(?:${a[l.BUILD]})?(?:$|[^\\d])`), f("COERCERTL", a[l.COERCE], !0), f("COERCERTLFULL", a[l.COERCEFULL], !0), f("LONETILDE", "(?:~>?)"), f("TILDETRIM", `(\\s*)${a[l.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", f("TILDE", `^${a[l.LONETILDE]}${a[l.XRANGEPLAIN]}$`), f("TILDELOOSE", `^${a[l.LONETILDE]}${a[l.XRANGEPLAINLOOSE]}$`), f("LONECARET", "(?:\\^)"), f("CARETTRIM", `(\\s*)${a[l.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", f("CARET", `^${a[l.LONECARET]}${a[l.XRANGEPLAIN]}$`), f("CARETLOOSE", `^${a[l.LONECARET]}${a[l.XRANGEPLAINLOOSE]}$`), f("COMPARATORLOOSE", `^${a[l.GTLT]}\\s*(${a[l.LOOSEPLAIN]})$|^$`), f("COMPARATOR", `^${a[l.GTLT]}\\s*(${a[l.FULLPLAIN]})$|^$`), f("COMPARATORTRIM", `(\\s*)${a[l.GTLT]}\\s*(${a[l.LOOSEPLAIN]}|${a[l.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", f("HYPHENRANGE", `^\\s*(${a[l.XRANGEPLAIN]})\\s+-\\s+(${a[l.XRANGEPLAIN]})\\s*$`), f("HYPHENRANGELOOSE", `^\\s*(${a[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[l.XRANGEPLAINLOOSE]})\\s*$`), f("STAR", "(<|>)?=?\\s*\\*"), f("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), f("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
3393
3400
  })(ft, ft.exports);
3394
- var $e = ft.exports;
3395
- const oi = Object.freeze({ loose: !0 }), ni = Object.freeze({}), ii = (s) => s ? typeof s != "object" ? oi : s : ni;
3396
- var kt = ii;
3401
+ var Oe = ft.exports;
3402
+ const ii = Object.freeze({ loose: !0 }), ai = Object.freeze({}), ci = (s) => s ? typeof s != "object" ? ii : s : ai;
3403
+ var Rt = ci;
3397
3404
  const Yt = /^[0-9]+$/, es = (s, e) => {
3398
3405
  const t = Yt.test(s), r = Yt.test(e);
3399
3406
  return t && r && (s = +s, e = +e), s === e ? 0 : t && !r ? -1 : r && !t ? 1 : s < e ? -1 : 1;
3400
- }, ai = (s, e) => es(e, s);
3407
+ }, li = (s, e) => es(e, s);
3401
3408
  var ts = {
3402
3409
  compareIdentifiers: es,
3403
- rcompareIdentifiers: ai
3410
+ rcompareIdentifiers: li
3404
3411
  };
3405
- const Ae = Me, { MAX_LENGTH: Zt, MAX_SAFE_INTEGER: Fe } = Je, { safeRe: Qt, t: er } = $e, ci = kt, { compareIdentifiers: pe } = ts;
3406
- let li = class Q {
3412
+ const Te = _e, { MAX_LENGTH: Zt, MAX_SAFE_INTEGER: Fe } = Me, { safeRe: Qt, t: er } = Oe, ui = Rt, { compareIdentifiers: he } = ts;
3413
+ let di = class Q {
3407
3414
  constructor(e, t) {
3408
- if (t = ci(t), e instanceof Q) {
3415
+ if (t = ui(t), e instanceof Q) {
3409
3416
  if (e.loose === !!t.loose && e.includePrerelease === !!t.includePrerelease)
3410
3417
  return e;
3411
3418
  e = e.version;
@@ -3415,7 +3422,7 @@ let li = class Q {
3415
3422
  throw new TypeError(
3416
3423
  `version is longer than ${Zt} characters`
3417
3424
  );
3418
- Ae("SemVer", e, t), this.options = t, this.loose = !!t.loose, this.includePrerelease = !!t.includePrerelease;
3425
+ Te("SemVer", e, t), this.options = t, this.loose = !!t.loose, this.includePrerelease = !!t.includePrerelease;
3419
3426
  const r = e.trim().match(t.loose ? Qt[er.LOOSE] : Qt[er.FULL]);
3420
3427
  if (!r)
3421
3428
  throw new TypeError(`Invalid Version: ${e}`);
@@ -3441,7 +3448,7 @@ let li = class Q {
3441
3448
  return this.version;
3442
3449
  }
3443
3450
  compare(e) {
3444
- if (Ae("SemVer.compare", this.version, this.options, e), !(e instanceof Q)) {
3451
+ if (Te("SemVer.compare", this.version, this.options, e), !(e instanceof Q)) {
3445
3452
  if (typeof e == "string" && e === this.version)
3446
3453
  return 0;
3447
3454
  e = new Q(e, this.options);
@@ -3449,7 +3456,7 @@ let li = class Q {
3449
3456
  return e.version === this.version ? 0 : this.compareMain(e) || this.comparePre(e);
3450
3457
  }
3451
3458
  compareMain(e) {
3452
- return e instanceof Q || (e = new Q(e, this.options)), pe(this.major, e.major) || pe(this.minor, e.minor) || pe(this.patch, e.patch);
3459
+ return e instanceof Q || (e = new Q(e, this.options)), he(this.major, e.major) || he(this.minor, e.minor) || he(this.patch, e.patch);
3453
3460
  }
3454
3461
  comparePre(e) {
3455
3462
  if (e instanceof Q || (e = new Q(e, this.options)), this.prerelease.length && !e.prerelease.length)
@@ -3461,7 +3468,7 @@ let li = class Q {
3461
3468
  let t = 0;
3462
3469
  do {
3463
3470
  const r = this.prerelease[t], o = e.prerelease[t];
3464
- if (Ae("prerelease compare", t, r, o), r === void 0 && o === void 0)
3471
+ if (Te("prerelease compare", t, r, o), r === void 0 && o === void 0)
3465
3472
  return 0;
3466
3473
  if (o === void 0)
3467
3474
  return 1;
@@ -3469,7 +3476,7 @@ let li = class Q {
3469
3476
  return -1;
3470
3477
  if (r === o)
3471
3478
  continue;
3472
- return pe(r, o);
3479
+ return he(r, o);
3473
3480
  } while (++t);
3474
3481
  }
3475
3482
  compareBuild(e) {
@@ -3477,7 +3484,7 @@ let li = class Q {
3477
3484
  let t = 0;
3478
3485
  do {
3479
3486
  const r = this.build[t], o = e.build[t];
3480
- if (Ae("build compare", t, r, o), r === void 0 && o === void 0)
3487
+ if (Te("build compare", t, r, o), r === void 0 && o === void 0)
3481
3488
  return 0;
3482
3489
  if (o === void 0)
3483
3490
  return 1;
@@ -3485,7 +3492,7 @@ let li = class Q {
3485
3492
  return -1;
3486
3493
  if (r === o)
3487
3494
  continue;
3488
- return pe(r, o);
3495
+ return he(r, o);
3489
3496
  } while (++t);
3490
3497
  }
3491
3498
  // preminor will bump the version up to the next minor release, and immediately
@@ -3531,7 +3538,7 @@ let li = class Q {
3531
3538
  }
3532
3539
  if (t) {
3533
3540
  let n = [t, o];
3534
- r === !1 && (n = [t]), pe(this.prerelease[0], t) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = n) : this.prerelease = n;
3541
+ r === !1 && (n = [t]), he(this.prerelease[0], t) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = n) : this.prerelease = n;
3535
3542
  }
3536
3543
  break;
3537
3544
  }
@@ -3541,8 +3548,8 @@ let li = class Q {
3541
3548
  return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
3542
3549
  }
3543
3550
  };
3544
- var M = li;
3545
- const tr = M, ui = (s, e, t = !1) => {
3551
+ var M = di;
3552
+ const tr = M, pi = (s, e, t = !1) => {
3546
3553
  if (s instanceof tr)
3547
3554
  return s;
3548
3555
  try {
@@ -3553,18 +3560,18 @@ const tr = M, ui = (s, e, t = !1) => {
3553
3560
  throw r;
3554
3561
  }
3555
3562
  };
3556
- var me = ui;
3557
- const di = me, pi = (s, e) => {
3558
- const t = di(s, e);
3563
+ var ve = pi;
3564
+ const hi = ve, fi = (s, e) => {
3565
+ const t = hi(s, e);
3559
3566
  return t ? t.version : null;
3560
3567
  };
3561
- var hi = pi;
3562
- const fi = me, gi = (s, e) => {
3563
- const t = fi(s.trim().replace(/^[=v]+/, ""), e);
3568
+ var gi = fi;
3569
+ const mi = ve, vi = (s, e) => {
3570
+ const t = mi(s.trim().replace(/^[=v]+/, ""), e);
3564
3571
  return t ? t.version : null;
3565
3572
  };
3566
- var mi = gi;
3567
- const rr = M, vi = (s, e, t, r, o) => {
3573
+ var yi = vi;
3574
+ const rr = M, wi = (s, e, t, r, o) => {
3568
3575
  typeof t == "string" && (o = r, r = t, t = void 0);
3569
3576
  try {
3570
3577
  return new rr(
@@ -3575,57 +3582,57 @@ const rr = M, vi = (s, e, t, r, o) => {
3575
3582
  return null;
3576
3583
  }
3577
3584
  };
3578
- var yi = vi;
3579
- const sr = me, wi = (s, e) => {
3585
+ var Si = wi;
3586
+ const sr = ve, bi = (s, e) => {
3580
3587
  const t = sr(s, null, !0), r = sr(e, null, !0), o = t.compare(r);
3581
3588
  if (o === 0)
3582
3589
  return null;
3583
- const n = o > 0, i = n ? t : r, l = n ? r : t, a = !!i.prerelease.length;
3584
- if (!!l.prerelease.length && !a)
3585
- return !l.patch && !l.minor ? "major" : i.patch ? "patch" : i.minor ? "minor" : "major";
3590
+ const n = o > 0, i = n ? t : r, c = n ? r : t, a = !!i.prerelease.length;
3591
+ if (!!c.prerelease.length && !a)
3592
+ return !c.patch && !c.minor ? "major" : i.patch ? "patch" : i.minor ? "minor" : "major";
3586
3593
  const u = a ? "pre" : "";
3587
3594
  return t.major !== r.major ? u + "major" : t.minor !== r.minor ? u + "minor" : t.patch !== r.patch ? u + "patch" : "prerelease";
3588
3595
  };
3589
- var Si = wi;
3590
- const bi = M, Ci = (s, e) => new bi(s, e).major;
3591
- var Ei = Ci;
3592
- const Ri = M, ki = (s, e) => new Ri(s, e).minor;
3593
- var Pi = ki;
3594
- const $i = M, Oi = (s, e) => new $i(s, e).patch;
3595
- var Ii = Oi;
3596
- const Ai = me, Fi = (s, e) => {
3597
- const t = Ai(s, e);
3596
+ var Ci = bi;
3597
+ const Ei = M, Ri = (s, e) => new Ei(s, e).major;
3598
+ var ki = Ri;
3599
+ const Pi = M, $i = (s, e) => new Pi(s, e).minor;
3600
+ var Oi = $i;
3601
+ const Ii = M, Ai = (s, e) => new Ii(s, e).patch;
3602
+ var Ti = Ai;
3603
+ const Fi = ve, Li = (s, e) => {
3604
+ const t = Fi(s, e);
3598
3605
  return t && t.prerelease.length ? t.prerelease : null;
3599
3606
  };
3600
- var Ti = Fi;
3601
- const or = M, Li = (s, e, t) => new or(s, t).compare(new or(e, t));
3602
- var Y = Li;
3603
- const Ni = Y, Di = (s, e, t) => Ni(e, s, t);
3604
- var Bi = Di;
3605
- const xi = Y, ji = (s, e) => xi(s, e, !0);
3606
- var Vi = ji;
3607
- const nr = M, Ui = (s, e, t) => {
3607
+ var Ni = Li;
3608
+ const or = M, Di = (s, e, t) => new or(s, t).compare(new or(e, t));
3609
+ var Y = Di;
3610
+ const Bi = Y, xi = (s, e, t) => Bi(e, s, t);
3611
+ var ji = xi;
3612
+ const Vi = Y, Ui = (s, e) => Vi(s, e, !0);
3613
+ var Gi = Ui;
3614
+ const nr = M, Ji = (s, e, t) => {
3608
3615
  const r = new nr(s, t), o = new nr(e, t);
3609
3616
  return r.compare(o) || r.compareBuild(o);
3610
3617
  };
3611
- var Pt = Ui;
3612
- const Gi = Pt, Ji = (s, e) => s.sort((t, r) => Gi(t, r, e));
3613
- var Mi = Ji;
3614
- const _i = Pt, Ki = (s, e) => s.sort((t, r) => _i(r, t, e));
3615
- var Hi = Ki;
3616
- const Wi = Y, zi = (s, e, t) => Wi(s, e, t) > 0;
3617
- var _e = zi;
3618
- const Xi = Y, qi = (s, e, t) => Xi(s, e, t) < 0;
3619
- var $t = qi;
3620
- const Yi = Y, Zi = (s, e, t) => Yi(s, e, t) === 0;
3621
- var rs = Zi;
3622
- const Qi = Y, ea = (s, e, t) => Qi(s, e, t) !== 0;
3623
- var ss = ea;
3624
- const ta = Y, ra = (s, e, t) => ta(s, e, t) >= 0;
3625
- var Ot = ra;
3626
- const sa = Y, oa = (s, e, t) => sa(s, e, t) <= 0;
3627
- var It = oa;
3628
- const na = rs, ia = ss, aa = _e, ca = Ot, la = $t, ua = It, da = (s, e, t, r) => {
3618
+ var kt = Ji;
3619
+ const Mi = kt, _i = (s, e) => s.sort((t, r) => Mi(t, r, e));
3620
+ var Ki = _i;
3621
+ const Hi = kt, Wi = (s, e) => s.sort((t, r) => Hi(r, t, e));
3622
+ var zi = Wi;
3623
+ const Xi = Y, qi = (s, e, t) => Xi(s, e, t) > 0;
3624
+ var Ke = qi;
3625
+ const Yi = Y, Zi = (s, e, t) => Yi(s, e, t) < 0;
3626
+ var Pt = Zi;
3627
+ const Qi = Y, ea = (s, e, t) => Qi(s, e, t) === 0;
3628
+ var rs = ea;
3629
+ const ta = Y, ra = (s, e, t) => ta(s, e, t) !== 0;
3630
+ var ss = ra;
3631
+ const sa = Y, oa = (s, e, t) => sa(s, e, t) >= 0;
3632
+ var $t = oa;
3633
+ const na = Y, ia = (s, e, t) => na(s, e, t) <= 0;
3634
+ var Ot = ia;
3635
+ const aa = rs, ca = ss, la = Ke, ua = $t, da = Pt, pa = Ot, ha = (s, e, t, r) => {
3629
3636
  switch (e) {
3630
3637
  case "===":
3631
3638
  return typeof s == "object" && (s = s.version), typeof t == "object" && (t = t.version), s === t;
@@ -3634,45 +3641,45 @@ const na = rs, ia = ss, aa = _e, ca = Ot, la = $t, ua = It, da = (s, e, t, r) =>
3634
3641
  case "":
3635
3642
  case "=":
3636
3643
  case "==":
3637
- return na(s, t, r);
3644
+ return aa(s, t, r);
3638
3645
  case "!=":
3639
- return ia(s, t, r);
3646
+ return ca(s, t, r);
3640
3647
  case ">":
3641
- return aa(s, t, r);
3648
+ return la(s, t, r);
3642
3649
  case ">=":
3643
- return ca(s, t, r);
3650
+ return ua(s, t, r);
3644
3651
  case "<":
3645
- return la(s, t, r);
3652
+ return da(s, t, r);
3646
3653
  case "<=":
3647
- return ua(s, t, r);
3654
+ return pa(s, t, r);
3648
3655
  default:
3649
3656
  throw new TypeError(`Invalid operator: ${e}`);
3650
3657
  }
3651
3658
  };
3652
- var os = da;
3653
- const pa = M, ha = me, { safeRe: Te, t: Le } = $e, fa = (s, e) => {
3654
- if (s instanceof pa)
3659
+ var os = ha;
3660
+ const fa = M, ga = ve, { safeRe: Le, t: Ne } = Oe, ma = (s, e) => {
3661
+ if (s instanceof fa)
3655
3662
  return s;
3656
3663
  if (typeof s == "number" && (s = String(s)), typeof s != "string")
3657
3664
  return null;
3658
3665
  e = e || {};
3659
3666
  let t = null;
3660
3667
  if (!e.rtl)
3661
- t = s.match(e.includePrerelease ? Te[Le.COERCEFULL] : Te[Le.COERCE]);
3668
+ t = s.match(e.includePrerelease ? Le[Ne.COERCEFULL] : Le[Ne.COERCE]);
3662
3669
  else {
3663
- const a = e.includePrerelease ? Te[Le.COERCERTLFULL] : Te[Le.COERCERTL];
3664
- let c;
3665
- for (; (c = a.exec(s)) && (!t || t.index + t[0].length !== s.length); )
3666
- (!t || c.index + c[0].length !== t.index + t[0].length) && (t = c), a.lastIndex = c.index + c[1].length + c[2].length;
3670
+ const a = e.includePrerelease ? Le[Ne.COERCERTLFULL] : Le[Ne.COERCERTL];
3671
+ let l;
3672
+ for (; (l = a.exec(s)) && (!t || t.index + t[0].length !== s.length); )
3673
+ (!t || l.index + l[0].length !== t.index + t[0].length) && (t = l), a.lastIndex = l.index + l[1].length + l[2].length;
3667
3674
  a.lastIndex = -1;
3668
3675
  }
3669
3676
  if (t === null)
3670
3677
  return null;
3671
- const r = t[2], o = t[3] || "0", n = t[4] || "0", i = e.includePrerelease && t[5] ? `-${t[5]}` : "", l = e.includePrerelease && t[6] ? `+${t[6]}` : "";
3672
- return ha(`${r}.${o}.${n}${i}${l}`, e);
3678
+ const r = t[2], o = t[3] || "0", n = t[4] || "0", i = e.includePrerelease && t[5] ? `-${t[5]}` : "", c = e.includePrerelease && t[6] ? `+${t[6]}` : "";
3679
+ return ga(`${r}.${o}.${n}${i}${c}`, e);
3673
3680
  };
3674
- var ga = fa;
3675
- class ma {
3681
+ var va = ma;
3682
+ class ya {
3676
3683
  constructor() {
3677
3684
  this.max = 1e3, this.map = /* @__PURE__ */ new Map();
3678
3685
  }
@@ -3695,9 +3702,9 @@ class ma {
3695
3702
  return this;
3696
3703
  }
3697
3704
  }
3698
- var va = ma, Ye, ir;
3705
+ var wa = ya, Ze, ir;
3699
3706
  function Z() {
3700
- if (ir) return Ye;
3707
+ if (ir) return Ze;
3701
3708
  ir = 1;
3702
3709
  const s = /\s+/g;
3703
3710
  class e {
@@ -3744,10 +3751,10 @@ function Z() {
3744
3751
  const g = ((this.options.includePrerelease && h) | (this.options.loose && f)) + ":" + p, b = r.get(g);
3745
3752
  if (b)
3746
3753
  return b;
3747
- const w = this.options.loose, C = w ? a[c.HYPHENRANGELOOSE] : a[c.HYPHENRANGE];
3748
- p = p.replace(C, X(this.options.includePrerelease)), i("hyphen replace", p), p = p.replace(a[c.COMPARATORTRIM], u), i("comparator trim", p), p = p.replace(a[c.TILDETRIM], d), i("tilde trim", p), p = p.replace(a[c.CARETTRIM], m), i("caret trim", p);
3754
+ const w = this.options.loose, C = w ? a[l.HYPHENRANGELOOSE] : a[l.HYPHENRANGE];
3755
+ p = p.replace(C, X(this.options.includePrerelease)), i("hyphen replace", p), p = p.replace(a[l.COMPARATORTRIM], u), i("comparator trim", p), p = p.replace(a[l.TILDETRIM], d), i("tilde trim", p), p = p.replace(a[l.CARETTRIM], m), i("caret trim", p);
3749
3756
  let P = p.split(" ").map((N) => _(N, this.options)).join(" ").split(/\s+/).map((N) => j(N, this.options));
3750
- w && (P = P.filter((N) => (i("loose invalid filter", N, this.options), !!N.match(a[c.COMPARATORLOOSE])))), i("range list", P);
3757
+ w && (P = P.filter((N) => (i("loose invalid filter", N, this.options), !!N.match(a[l.COMPARATORLOOSE])))), i("range list", P);
3751
3758
  const E = /* @__PURE__ */ new Map(), O = P.map((N) => new n(N, this.options));
3752
3759
  for (const N of O) {
3753
3760
  if (I(N))
@@ -3769,40 +3776,40 @@ function Z() {
3769
3776
  return !1;
3770
3777
  if (typeof p == "string")
3771
3778
  try {
3772
- p = new l(p, this.options);
3779
+ p = new c(p, this.options);
3773
3780
  } catch {
3774
3781
  return !1;
3775
3782
  }
3776
3783
  for (let y = 0; y < this.set.length; y++)
3777
- if (de(this.set[y], p, this.options))
3784
+ if (pe(this.set[y], p, this.options))
3778
3785
  return !0;
3779
3786
  return !1;
3780
3787
  }
3781
3788
  }
3782
- Ye = e;
3783
- const t = va, r = new t(), o = kt, n = Ke(), i = Me, l = M, {
3789
+ Ze = e;
3790
+ const t = wa, r = new t(), o = Rt, n = He(), i = _e, c = M, {
3784
3791
  safeRe: a,
3785
- t: c,
3792
+ t: l,
3786
3793
  comparatorTrimReplace: u,
3787
3794
  tildeTrimReplace: d,
3788
3795
  caretTrimReplace: m
3789
- } = $e, { FLAG_INCLUDE_PRERELEASE: h, FLAG_LOOSE: f } = Je, I = (v) => v.value === "<0.0.0-0", A = (v) => v.value === "", B = (v, p) => {
3796
+ } = Oe, { FLAG_INCLUDE_PRERELEASE: h, FLAG_LOOSE: f } = Me, I = (v) => v.value === "<0.0.0-0", A = (v) => v.value === "", B = (v, p) => {
3790
3797
  let y = !0;
3791
3798
  const g = v.slice();
3792
3799
  let b = g.pop();
3793
3800
  for (; y && g.length; )
3794
3801
  y = g.every((w) => b.intersects(w, p)), b = g.pop();
3795
3802
  return y;
3796
- }, _ = (v, p) => (i("comp", v, p), v = T(v, p), i("caret", v), v = se(v, p), i("tildes", v), v = oe(v, p), i("xrange", v), v = G(v, p), i("stars", v), v), k = (v) => !v || v.toLowerCase() === "x" || v === "*", se = (v, p) => v.trim().split(/\s+/).map((y) => ue(y, p)).join(" "), ue = (v, p) => {
3797
- const y = p.loose ? a[c.TILDELOOSE] : a[c.TILDE];
3803
+ }, _ = (v, p) => (i("comp", v, p), v = F(v, p), i("caret", v), v = se(v, p), i("tildes", v), v = oe(v, p), i("xrange", v), v = G(v, p), i("stars", v), v), k = (v) => !v || v.toLowerCase() === "x" || v === "*", se = (v, p) => v.trim().split(/\s+/).map((y) => de(y, p)).join(" "), de = (v, p) => {
3804
+ const y = p.loose ? a[l.TILDELOOSE] : a[l.TILDE];
3798
3805
  return v.replace(y, (g, b, w, C, P) => {
3799
3806
  i("tilde", v, g, b, w, C, P);
3800
3807
  let E;
3801
3808
  return k(b) ? E = "" : k(w) ? E = `>=${b}.0.0 <${+b + 1}.0.0-0` : k(C) ? E = `>=${b}.${w}.0 <${b}.${+w + 1}.0-0` : P ? (i("replaceTilde pr", P), E = `>=${b}.${w}.${C}-${P} <${b}.${+w + 1}.0-0`) : E = `>=${b}.${w}.${C} <${b}.${+w + 1}.0-0`, i("tilde return", E), E;
3802
3809
  });
3803
- }, T = (v, p) => v.trim().split(/\s+/).map((y) => z(y, p)).join(" "), z = (v, p) => {
3810
+ }, F = (v, p) => v.trim().split(/\s+/).map((y) => z(y, p)).join(" "), z = (v, p) => {
3804
3811
  i("caret", v, p);
3805
- const y = p.loose ? a[c.CARETLOOSE] : a[c.CARET], g = p.includePrerelease ? "-0" : "";
3812
+ const y = p.loose ? a[l.CARETLOOSE] : a[l.CARET], g = p.includePrerelease ? "-0" : "";
3806
3813
  return v.replace(y, (b, w, C, P, E) => {
3807
3814
  i("caret", v, b, w, C, P, E);
3808
3815
  let O;
@@ -3810,13 +3817,13 @@ function Z() {
3810
3817
  });
3811
3818
  }, oe = (v, p) => (i("replaceXRanges", v, p), v.split(/\s+/).map((y) => K(y, p)).join(" ")), K = (v, p) => {
3812
3819
  v = v.trim();
3813
- const y = p.loose ? a[c.XRANGELOOSE] : a[c.XRANGE];
3820
+ const y = p.loose ? a[l.XRANGELOOSE] : a[l.XRANGE];
3814
3821
  return v.replace(y, (g, b, w, C, P, E) => {
3815
3822
  i("xRange", v, g, b, w, C, P, E);
3816
3823
  const O = k(w), L = O || k(C), N = L || k(P), re = N;
3817
3824
  return b === "=" && re && (b = ""), E = p.includePrerelease ? "-0" : "", O ? b === ">" || b === "<" ? g = "<0.0.0-0" : g = "*" : b && re ? (L && (C = 0), P = 0, b === ">" ? (b = ">=", L ? (w = +w + 1, C = 0, P = 0) : (C = +C + 1, P = 0)) : b === "<=" && (b = "<", L ? w = +w + 1 : C = +C + 1), b === "<" && (E = "-0"), g = `${b + w}.${C}.${P}${E}`) : L ? g = `>=${w}.0.0${E} <${+w + 1}.0.0-0` : N && (g = `>=${w}.${C}.0${E} <${w}.${+C + 1}.0-0`), i("xRange return", g), g;
3818
3825
  });
3819
- }, G = (v, p) => (i("replaceStars", v, p), v.trim().replace(a[c.STAR], "")), j = (v, p) => (i("replaceGTE0", v, p), v.trim().replace(a[p.includePrerelease ? c.GTE0PRE : c.GTE0], "")), X = (v) => (p, y, g, b, w, C, P, E, O, L, N, re) => (k(g) ? y = "" : k(b) ? y = `>=${g}.0.0${v ? "-0" : ""}` : k(w) ? y = `>=${g}.${b}.0${v ? "-0" : ""}` : C ? y = `>=${y}` : y = `>=${y}${v ? "-0" : ""}`, k(O) ? E = "" : k(L) ? E = `<${+O + 1}.0.0-0` : k(N) ? E = `<${O}.${+L + 1}.0-0` : re ? E = `<=${O}.${L}.${N}-${re}` : v ? E = `<${O}.${L}.${+N + 1}-0` : E = `<=${E}`, `${y} ${E}`.trim()), de = (v, p, y) => {
3826
+ }, G = (v, p) => (i("replaceStars", v, p), v.trim().replace(a[l.STAR], "")), j = (v, p) => (i("replaceGTE0", v, p), v.trim().replace(a[p.includePrerelease ? l.GTE0PRE : l.GTE0], "")), X = (v) => (p, y, g, b, w, C, P, E, O, L, N, re) => (k(g) ? y = "" : k(b) ? y = `>=${g}.0.0${v ? "-0" : ""}` : k(w) ? y = `>=${g}.${b}.0${v ? "-0" : ""}` : C ? y = `>=${y}` : y = `>=${y}${v ? "-0" : ""}`, k(O) ? E = "" : k(L) ? E = `<${+O + 1}.0.0-0` : k(N) ? E = `<${O}.${+L + 1}.0-0` : re ? E = `<=${O}.${L}.${N}-${re}` : v ? E = `<${O}.${L}.${+N + 1}-0` : E = `<=${E}`, `${y} ${E}`.trim()), pe = (v, p, y) => {
3820
3827
  for (let g = 0; g < v.length; g++)
3821
3828
  if (!v[g].test(p))
3822
3829
  return !1;
@@ -3831,11 +3838,11 @@ function Z() {
3831
3838
  }
3832
3839
  return !0;
3833
3840
  };
3834
- return Ye;
3841
+ return Ze;
3835
3842
  }
3836
- var Ze, ar;
3837
- function Ke() {
3838
- if (ar) return Ze;
3843
+ var Qe, ar;
3844
+ function He() {
3845
+ if (ar) return Qe;
3839
3846
  ar = 1;
3840
3847
  const s = Symbol("SemVer ANY");
3841
3848
  class e {
@@ -3854,7 +3861,7 @@ function Ke() {
3854
3861
  const d = this.options.loose ? r[o.COMPARATORLOOSE] : r[o.COMPARATOR], m = u.match(d);
3855
3862
  if (!m)
3856
3863
  throw new TypeError(`Invalid comparator: ${u}`);
3857
- this.operator = m[1] !== void 0 ? m[1] : "", this.operator === "=" && (this.operator = ""), m[2] ? this.semver = new l(m[2], this.options.loose) : this.semver = s;
3864
+ this.operator = m[1] !== void 0 ? m[1] : "", this.operator === "=" && (this.operator = ""), m[2] ? this.semver = new c(m[2], this.options.loose) : this.semver = s;
3858
3865
  }
3859
3866
  toString() {
3860
3867
  return this.value;
@@ -3864,7 +3871,7 @@ function Ke() {
3864
3871
  return !0;
3865
3872
  if (typeof u == "string")
3866
3873
  try {
3867
- u = new l(u, this.options);
3874
+ u = new c(u, this.options);
3868
3875
  } catch {
3869
3876
  return !1;
3870
3877
  }
@@ -3876,62 +3883,62 @@ function Ke() {
3876
3883
  return this.operator === "" ? this.value === "" ? !0 : new a(u.value, d).test(this.value) : u.operator === "" ? u.value === "" ? !0 : new a(this.value, d).test(u.semver) : (d = t(d), d.includePrerelease && (this.value === "<0.0.0-0" || u.value === "<0.0.0-0") || !d.includePrerelease && (this.value.startsWith("<0.0.0") || u.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && u.operator.startsWith(">") || this.operator.startsWith("<") && u.operator.startsWith("<") || this.semver.version === u.semver.version && this.operator.includes("=") && u.operator.includes("=") || n(this.semver, "<", u.semver, d) && this.operator.startsWith(">") && u.operator.startsWith("<") || n(this.semver, ">", u.semver, d) && this.operator.startsWith("<") && u.operator.startsWith(">")));
3877
3884
  }
3878
3885
  }
3879
- Ze = e;
3880
- const t = kt, { safeRe: r, t: o } = $e, n = os, i = Me, l = M, a = Z();
3881
- return Ze;
3886
+ Qe = e;
3887
+ const t = Rt, { safeRe: r, t: o } = Oe, n = os, i = _e, c = M, a = Z();
3888
+ return Qe;
3882
3889
  }
3883
- const ya = Z(), wa = (s, e, t) => {
3890
+ const Sa = Z(), ba = (s, e, t) => {
3884
3891
  try {
3885
- e = new ya(e, t);
3892
+ e = new Sa(e, t);
3886
3893
  } catch {
3887
3894
  return !1;
3888
3895
  }
3889
3896
  return e.test(s);
3890
3897
  };
3891
- var He = wa;
3892
- const Sa = Z(), ba = (s, e) => new Sa(s, e).set.map((t) => t.map((r) => r.value).join(" ").trim().split(" "));
3893
- var Ca = ba;
3894
- const Ea = M, Ra = Z(), ka = (s, e, t) => {
3898
+ var We = ba;
3899
+ const Ca = Z(), Ea = (s, e) => new Ca(s, e).set.map((t) => t.map((r) => r.value).join(" ").trim().split(" "));
3900
+ var Ra = Ea;
3901
+ const ka = M, Pa = Z(), $a = (s, e, t) => {
3895
3902
  let r = null, o = null, n = null;
3896
3903
  try {
3897
- n = new Ra(e, t);
3904
+ n = new Pa(e, t);
3898
3905
  } catch {
3899
3906
  return null;
3900
3907
  }
3901
3908
  return s.forEach((i) => {
3902
- n.test(i) && (!r || o.compare(i) === -1) && (r = i, o = new Ea(r, t));
3909
+ n.test(i) && (!r || o.compare(i) === -1) && (r = i, o = new ka(r, t));
3903
3910
  }), r;
3904
3911
  };
3905
- var Pa = ka;
3906
- const $a = M, Oa = Z(), Ia = (s, e, t) => {
3912
+ var Oa = $a;
3913
+ const Ia = M, Aa = Z(), Ta = (s, e, t) => {
3907
3914
  let r = null, o = null, n = null;
3908
3915
  try {
3909
- n = new Oa(e, t);
3916
+ n = new Aa(e, t);
3910
3917
  } catch {
3911
3918
  return null;
3912
3919
  }
3913
3920
  return s.forEach((i) => {
3914
- n.test(i) && (!r || o.compare(i) === 1) && (r = i, o = new $a(r, t));
3921
+ n.test(i) && (!r || o.compare(i) === 1) && (r = i, o = new Ia(r, t));
3915
3922
  }), r;
3916
3923
  };
3917
- var Aa = Ia;
3918
- const Qe = M, Fa = Z(), cr = _e, Ta = (s, e) => {
3919
- s = new Fa(s, e);
3920
- let t = new Qe("0.0.0");
3921
- if (s.test(t) || (t = new Qe("0.0.0-0"), s.test(t)))
3924
+ var Fa = Ta;
3925
+ const et = M, La = Z(), cr = Ke, Na = (s, e) => {
3926
+ s = new La(s, e);
3927
+ let t = new et("0.0.0");
3928
+ if (s.test(t) || (t = new et("0.0.0-0"), s.test(t)))
3922
3929
  return t;
3923
3930
  t = null;
3924
3931
  for (let r = 0; r < s.set.length; ++r) {
3925
3932
  const o = s.set[r];
3926
3933
  let n = null;
3927
3934
  o.forEach((i) => {
3928
- const l = new Qe(i.semver.version);
3935
+ const c = new et(i.semver.version);
3929
3936
  switch (i.operator) {
3930
3937
  case ">":
3931
- l.prerelease.length === 0 ? l.patch++ : l.prerelease.push(0), l.raw = l.format();
3938
+ c.prerelease.length === 0 ? c.patch++ : c.prerelease.push(0), c.raw = c.format();
3932
3939
  case "":
3933
3940
  case ">=":
3934
- (!n || cr(l, n)) && (n = l);
3941
+ (!n || cr(c, n)) && (n = c);
3935
3942
  break;
3936
3943
  case "<":
3937
3944
  case "<=":
@@ -3943,71 +3950,71 @@ const Qe = M, Fa = Z(), cr = _e, Ta = (s, e) => {
3943
3950
  }
3944
3951
  return t && s.test(t) ? t : null;
3945
3952
  };
3946
- var La = Ta;
3947
- const Na = Z(), Da = (s, e) => {
3953
+ var Da = Na;
3954
+ const Ba = Z(), xa = (s, e) => {
3948
3955
  try {
3949
- return new Na(s, e).range || "*";
3956
+ return new Ba(s, e).range || "*";
3950
3957
  } catch {
3951
3958
  return null;
3952
3959
  }
3953
3960
  };
3954
- var Ba = Da;
3955
- const xa = M, ns = Ke(), { ANY: ja } = ns, Va = Z(), Ua = He, lr = _e, ur = $t, Ga = It, Ja = Ot, Ma = (s, e, t, r) => {
3956
- s = new xa(s, r), e = new Va(e, r);
3957
- let o, n, i, l, a;
3961
+ var ja = xa;
3962
+ const Va = M, ns = He(), { ANY: Ua } = ns, Ga = Z(), Ja = We, lr = Ke, ur = Pt, Ma = Ot, _a = $t, Ka = (s, e, t, r) => {
3963
+ s = new Va(s, r), e = new Ga(e, r);
3964
+ let o, n, i, c, a;
3958
3965
  switch (t) {
3959
3966
  case ">":
3960
- o = lr, n = Ga, i = ur, l = ">", a = ">=";
3967
+ o = lr, n = Ma, i = ur, c = ">", a = ">=";
3961
3968
  break;
3962
3969
  case "<":
3963
- o = ur, n = Ja, i = lr, l = "<", a = "<=";
3970
+ o = ur, n = _a, i = lr, c = "<", a = "<=";
3964
3971
  break;
3965
3972
  default:
3966
3973
  throw new TypeError('Must provide a hilo val of "<" or ">"');
3967
3974
  }
3968
- if (Ua(s, e, r))
3975
+ if (Ja(s, e, r))
3969
3976
  return !1;
3970
- for (let c = 0; c < e.set.length; ++c) {
3971
- const u = e.set[c];
3977
+ for (let l = 0; l < e.set.length; ++l) {
3978
+ const u = e.set[l];
3972
3979
  let d = null, m = null;
3973
3980
  if (u.forEach((h) => {
3974
- h.semver === ja && (h = new ns(">=0.0.0")), d = d || h, m = m || h, o(h.semver, d.semver, r) ? d = h : i(h.semver, m.semver, r) && (m = h);
3975
- }), d.operator === l || d.operator === a || (!m.operator || m.operator === l) && n(s, m.semver))
3981
+ h.semver === Ua && (h = new ns(">=0.0.0")), d = d || h, m = m || h, o(h.semver, d.semver, r) ? d = h : i(h.semver, m.semver, r) && (m = h);
3982
+ }), d.operator === c || d.operator === a || (!m.operator || m.operator === c) && n(s, m.semver))
3976
3983
  return !1;
3977
3984
  if (m.operator === a && i(s, m.semver))
3978
3985
  return !1;
3979
3986
  }
3980
3987
  return !0;
3981
3988
  };
3982
- var At = Ma;
3983
- const _a = At, Ka = (s, e, t) => _a(s, e, ">", t);
3984
- var Ha = Ka;
3985
- const Wa = At, za = (s, e, t) => Wa(s, e, "<", t);
3986
- var Xa = za;
3987
- const dr = Z(), qa = (s, e, t) => (s = new dr(s, t), e = new dr(e, t), s.intersects(e, t));
3989
+ var It = Ka;
3990
+ const Ha = It, Wa = (s, e, t) => Ha(s, e, ">", t);
3991
+ var za = Wa;
3992
+ const Xa = It, qa = (s, e, t) => Xa(s, e, "<", t);
3988
3993
  var Ya = qa;
3989
- const Za = He, Qa = Y;
3990
- var ec = (s, e, t) => {
3994
+ const dr = Z(), Za = (s, e, t) => (s = new dr(s, t), e = new dr(e, t), s.intersects(e, t));
3995
+ var Qa = Za;
3996
+ const ec = We, tc = Y;
3997
+ var rc = (s, e, t) => {
3991
3998
  const r = [];
3992
3999
  let o = null, n = null;
3993
- const i = s.sort((u, d) => Qa(u, d, t));
4000
+ const i = s.sort((u, d) => tc(u, d, t));
3994
4001
  for (const u of i)
3995
- Za(u, e, t) ? (n = u, o || (o = u)) : (n && r.push([o, n]), n = null, o = null);
4002
+ ec(u, e, t) ? (n = u, o || (o = u)) : (n && r.push([o, n]), n = null, o = null);
3996
4003
  o && r.push([o, null]);
3997
- const l = [];
4004
+ const c = [];
3998
4005
  for (const [u, d] of r)
3999
- u === d ? l.push(u) : !d && u === i[0] ? l.push("*") : d ? u === i[0] ? l.push(`<=${d}`) : l.push(`${u} - ${d}`) : l.push(`>=${u}`);
4000
- const a = l.join(" || "), c = typeof e.raw == "string" ? e.raw : String(e);
4001
- return a.length < c.length ? a : e;
4006
+ u === d ? c.push(u) : !d && u === i[0] ? c.push("*") : d ? u === i[0] ? c.push(`<=${d}`) : c.push(`${u} - ${d}`) : c.push(`>=${u}`);
4007
+ const a = c.join(" || "), l = typeof e.raw == "string" ? e.raw : String(e);
4008
+ return a.length < l.length ? a : e;
4002
4009
  };
4003
- const pr = Z(), Ft = Ke(), { ANY: et } = Ft, ve = He, Tt = Y, tc = (s, e, t = {}) => {
4010
+ const pr = Z(), At = He(), { ANY: tt } = At, ye = We, Tt = Y, sc = (s, e, t = {}) => {
4004
4011
  if (s === e)
4005
4012
  return !0;
4006
4013
  s = new pr(s, t), e = new pr(e, t);
4007
4014
  let r = !1;
4008
4015
  e: for (const o of s.set) {
4009
4016
  for (const n of e.set) {
4010
- const i = sc(o, n, t);
4017
+ const i = nc(o, n, t);
4011
4018
  if (r = r || i !== null, i)
4012
4019
  continue e;
4013
4020
  }
@@ -4015,15 +4022,15 @@ const pr = Z(), Ft = Ke(), { ANY: et } = Ft, ve = He, Tt = Y, tc = (s, e, t = {}
4015
4022
  return !1;
4016
4023
  }
4017
4024
  return !0;
4018
- }, rc = [new Ft(">=0.0.0-0")], hr = [new Ft(">=0.0.0")], sc = (s, e, t) => {
4025
+ }, oc = [new At(">=0.0.0-0")], hr = [new At(">=0.0.0")], nc = (s, e, t) => {
4019
4026
  if (s === e)
4020
4027
  return !0;
4021
- if (s.length === 1 && s[0].semver === et) {
4022
- if (e.length === 1 && e[0].semver === et)
4028
+ if (s.length === 1 && s[0].semver === tt) {
4029
+ if (e.length === 1 && e[0].semver === tt)
4023
4030
  return !0;
4024
- t.includePrerelease ? s = rc : s = hr;
4031
+ t.includePrerelease ? s = oc : s = hr;
4025
4032
  }
4026
- if (e.length === 1 && e[0].semver === et) {
4033
+ if (e.length === 1 && e[0].semver === tt) {
4027
4034
  if (t.includePrerelease)
4028
4035
  return !0;
4029
4036
  e = hr;
@@ -4042,34 +4049,34 @@ const pr = Z(), Ft = Ke(), { ANY: et } = Ft, ve = He, Tt = Y, tc = (s, e, t = {}
4042
4049
  return null;
4043
4050
  }
4044
4051
  for (const h of r) {
4045
- if (o && !ve(h, String(o), t) || n && !ve(h, String(n), t))
4052
+ if (o && !ye(h, String(o), t) || n && !ye(h, String(n), t))
4046
4053
  return null;
4047
4054
  for (const f of e)
4048
- if (!ve(h, String(f), t))
4055
+ if (!ye(h, String(f), t))
4049
4056
  return !1;
4050
4057
  return !0;
4051
4058
  }
4052
- let l, a, c, u, d = n && !t.includePrerelease && n.semver.prerelease.length ? n.semver : !1, m = o && !t.includePrerelease && o.semver.prerelease.length ? o.semver : !1;
4059
+ let c, a, l, u, d = n && !t.includePrerelease && n.semver.prerelease.length ? n.semver : !1, m = o && !t.includePrerelease && o.semver.prerelease.length ? o.semver : !1;
4053
4060
  d && d.prerelease.length === 1 && n.operator === "<" && d.prerelease[0] === 0 && (d = !1);
4054
4061
  for (const h of e) {
4055
- if (u = u || h.operator === ">" || h.operator === ">=", c = c || h.operator === "<" || h.operator === "<=", o) {
4062
+ if (u = u || h.operator === ">" || h.operator === ">=", l = l || h.operator === "<" || h.operator === "<=", o) {
4056
4063
  if (m && h.semver.prerelease && h.semver.prerelease.length && h.semver.major === m.major && h.semver.minor === m.minor && h.semver.patch === m.patch && (m = !1), h.operator === ">" || h.operator === ">=") {
4057
- if (l = fr(o, h, t), l === h && l !== o)
4064
+ if (c = fr(o, h, t), c === h && c !== o)
4058
4065
  return !1;
4059
- } else if (o.operator === ">=" && !ve(o.semver, String(h), t))
4066
+ } else if (o.operator === ">=" && !ye(o.semver, String(h), t))
4060
4067
  return !1;
4061
4068
  }
4062
4069
  if (n) {
4063
4070
  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 === "<=") {
4064
4071
  if (a = gr(n, h, t), a === h && a !== n)
4065
4072
  return !1;
4066
- } else if (n.operator === "<=" && !ve(n.semver, String(h), t))
4073
+ } else if (n.operator === "<=" && !ye(n.semver, String(h), t))
4067
4074
  return !1;
4068
4075
  }
4069
4076
  if (!h.operator && (n || o) && i !== 0)
4070
4077
  return !1;
4071
4078
  }
4072
- return !(o && c && !n && i !== 0 || n && u && !o && i !== 0 || m || d);
4079
+ return !(o && l && !n && i !== 0 || n && u && !o && i !== 0 || m || d);
4073
4080
  }, fr = (s, e, t) => {
4074
4081
  if (!s)
4075
4082
  return e;
@@ -4081,61 +4088,61 @@ const pr = Z(), Ft = Ke(), { ANY: et } = Ft, ve = He, Tt = Y, tc = (s, e, t = {}
4081
4088
  const r = Tt(s.semver, e.semver, t);
4082
4089
  return r < 0 ? s : r > 0 || e.operator === "<" && s.operator === "<=" ? e : s;
4083
4090
  };
4084
- var oc = tc;
4085
- const tt = $e, mr = Je, nc = M, vr = ts, ic = me, ac = hi, cc = mi, lc = yi, uc = Si, dc = Ei, pc = Pi, hc = Ii, fc = Ti, gc = Y, mc = Bi, vc = Vi, yc = Pt, wc = Mi, Sc = Hi, bc = _e, Cc = $t, Ec = rs, Rc = ss, kc = Ot, Pc = It, $c = os, Oc = ga, Ic = Ke(), Ac = Z(), Fc = He, Tc = Ca, Lc = Pa, Nc = Aa, Dc = La, Bc = Ba, xc = At, jc = Ha, Vc = Xa, Uc = Ya, Gc = ec, Jc = oc;
4086
- var Mc = {
4087
- parse: ic,
4088
- valid: ac,
4089
- clean: cc,
4090
- inc: lc,
4091
- diff: uc,
4092
- major: dc,
4093
- minor: pc,
4094
- patch: hc,
4095
- prerelease: fc,
4096
- compare: gc,
4097
- rcompare: mc,
4098
- compareLoose: vc,
4099
- compareBuild: yc,
4100
- sort: wc,
4101
- rsort: Sc,
4102
- gt: bc,
4103
- lt: Cc,
4104
- eq: Ec,
4105
- neq: Rc,
4106
- gte: kc,
4107
- lte: Pc,
4108
- cmp: $c,
4109
- coerce: Oc,
4110
- Comparator: Ic,
4111
- Range: Ac,
4112
- satisfies: Fc,
4113
- toComparators: Tc,
4114
- maxSatisfying: Lc,
4115
- minSatisfying: Nc,
4116
- minVersion: Dc,
4117
- validRange: Bc,
4118
- outside: xc,
4119
- gtr: jc,
4120
- ltr: Vc,
4121
- intersects: Uc,
4122
- simplifyRange: Gc,
4123
- subset: Jc,
4124
- SemVer: nc,
4125
- re: tt.re,
4126
- src: tt.src,
4127
- tokens: tt.t,
4091
+ var ic = sc;
4092
+ const rt = Oe, mr = Me, ac = M, vr = ts, cc = ve, lc = gi, uc = yi, dc = Si, pc = Ci, hc = ki, fc = Oi, gc = Ti, mc = Ni, vc = Y, yc = ji, wc = Gi, Sc = kt, bc = Ki, Cc = zi, Ec = Ke, Rc = Pt, kc = rs, Pc = ss, $c = $t, Oc = Ot, Ic = os, Ac = va, Tc = He(), Fc = Z(), Lc = We, Nc = Ra, Dc = Oa, Bc = Fa, xc = Da, jc = ja, Vc = It, Uc = za, Gc = Ya, Jc = Qa, Mc = rc, _c = ic;
4093
+ var Kc = {
4094
+ parse: cc,
4095
+ valid: lc,
4096
+ clean: uc,
4097
+ inc: dc,
4098
+ diff: pc,
4099
+ major: hc,
4100
+ minor: fc,
4101
+ patch: gc,
4102
+ prerelease: mc,
4103
+ compare: vc,
4104
+ rcompare: yc,
4105
+ compareLoose: wc,
4106
+ compareBuild: Sc,
4107
+ sort: bc,
4108
+ rsort: Cc,
4109
+ gt: Ec,
4110
+ lt: Rc,
4111
+ eq: kc,
4112
+ neq: Pc,
4113
+ gte: $c,
4114
+ lte: Oc,
4115
+ cmp: Ic,
4116
+ coerce: Ac,
4117
+ Comparator: Tc,
4118
+ Range: Fc,
4119
+ satisfies: Lc,
4120
+ toComparators: Nc,
4121
+ maxSatisfying: Dc,
4122
+ minSatisfying: Bc,
4123
+ minVersion: xc,
4124
+ validRange: jc,
4125
+ outside: Vc,
4126
+ gtr: Uc,
4127
+ ltr: Gc,
4128
+ intersects: Jc,
4129
+ simplifyRange: Mc,
4130
+ subset: _c,
4131
+ SemVer: ac,
4132
+ re: rt.re,
4133
+ src: rt.src,
4134
+ tokens: rt.t,
4128
4135
  SEMVER_SPEC_VERSION: mr.SEMVER_SPEC_VERSION,
4129
4136
  RELEASE_TYPES: mr.RELEASE_TYPES,
4130
4137
  compareIdentifiers: vr.compareIdentifiers,
4131
4138
  rcompareIdentifiers: vr.rcompareIdentifiers
4132
4139
  };
4133
- const _c = /* @__PURE__ */ Yn(Mc), Kc = {
4140
+ const Hc = /* @__PURE__ */ Qn(Kc), Wc = {
4134
4141
  minDelay: 1500
4135
- }, Hc = "__no_updates__";
4136
- class Wc extends Ts {
4142
+ }, zc = "__no_updates__";
4143
+ class Xc extends Fs {
4137
4144
  constructor(t, r, o = {}) {
4138
- super({ ...o, ...Kc }, r);
4145
+ super({ ...o, ...Wc }, r);
4139
4146
  S(this, "http");
4140
4147
  S(this, "preferredUpdateChannel");
4141
4148
  this.registryProvider = t, this.http = o.http, this.preferredUpdateChannel = o.preferredUpdateChannel;
@@ -4149,7 +4156,7 @@ class Wc extends Ts {
4149
4156
  case "from-registry-v2":
4150
4157
  return `from_registry_v2_${t.registryUrl}_${t.id.organization}_${t.id.name}_${t.id.version}`;
4151
4158
  default:
4152
- return Hc;
4159
+ return zc;
4153
4160
  }
4154
4161
  }
4155
4162
  async readValue(t) {
@@ -4157,7 +4164,7 @@ class Wc extends Ts {
4157
4164
  switch (t.type) {
4158
4165
  case "dev-v1":
4159
4166
  try {
4160
- const r = await Tr(t.folder);
4167
+ const r = await Fr(t.folder);
4161
4168
  return r === t.mtime ? void 0 : { ...t, mtime: r };
4162
4169
  } catch (r) {
4163
4170
  this.logger.warn(r);
@@ -4165,9 +4172,9 @@ class Wc extends Ts {
4165
4172
  }
4166
4173
  case "dev-v2":
4167
4174
  try {
4168
- const r = await st(t.folder, this.logger);
4175
+ const r = await ot(t.folder, this.logger);
4169
4176
  if (r === void 0) return;
4170
- const o = await wt(r);
4177
+ const o = await yt(r);
4171
4178
  return o === t.mtime ? void 0 : { ...t, mtime: o };
4172
4179
  } catch (r) {
4173
4180
  this.logger.warn(r);
@@ -4181,9 +4188,9 @@ class Wc extends Ts {
4181
4188
  const n = await r.getLatestOverview(t.id, ne);
4182
4189
  if (n) o = n.spec;
4183
4190
  else {
4184
- const i = await r.getLatestOverview(t.id, we);
4191
+ const i = await r.getLatestOverview(t.id, Se);
4185
4192
  if (i === void 0) {
4186
- this.logger.error(`No "any" channel record for ${Lt(t.id)}`);
4193
+ this.logger.error(`No "any" channel record for ${Ft(t.id)}`);
4187
4194
  return;
4188
4195
  }
4189
4196
  o = { ...i.spec, channel: ne };
@@ -4193,13 +4200,13 @@ class Wc extends Ts {
4193
4200
  if (i) o = i.spec;
4194
4201
  else {
4195
4202
  this.logger.error(
4196
- `Can't find update for ${Lt(t.id)} in channel "${n}"`
4203
+ `Can't find update for ${Ft(t.id)} in channel "${n}"`
4197
4204
  );
4198
4205
  return;
4199
4206
  }
4200
4207
  }
4201
4208
  if (o.type !== "from-registry-v2") throw new Error(`Unexpected spec type ${o}.`);
4202
- return _c.compare(o.id.version, t.id.version) <= 0 ? void 0 : ((async () => {
4209
+ return Hc.compare(o.id.version, t.id.version) <= 0 ? void 0 : ((async () => {
4203
4210
  try {
4204
4211
  await r.getComponents(o.id);
4205
4212
  } catch (n) {
@@ -4223,9 +4230,9 @@ class Wc extends Ts {
4223
4230
  if (t === void 0 || r === void 0 || t.type !== r.type) return !1;
4224
4231
  switch (t.type) {
4225
4232
  case "from-registry-v1":
4226
- return r.type !== "from-registry-v1" ? !1 : t.registryUrl === r.registryUrl && Nt(t.id, r.id);
4233
+ return r.type !== "from-registry-v1" ? !1 : t.registryUrl === r.registryUrl && Lt(t.id, r.id);
4227
4234
  case "from-registry-v2":
4228
- return r.type !== "from-registry-v2" ? !1 : t.registryUrl === r.registryUrl && Nt(t.id, r.id);
4235
+ return r.type !== "from-registry-v2" ? !1 : t.registryUrl === r.registryUrl && Lt(t.id, r.id);
4229
4236
  case "dev-v1":
4230
4237
  return r.type !== "dev-v1" ? !1 : t.folder === r.folder && t.mtime === r.mtime;
4231
4238
  case "dev-v2":
@@ -4273,8 +4280,8 @@ class yr {
4273
4280
  function wr(s) {
4274
4281
  return String(s.id);
4275
4282
  }
4276
- const zc = ["Int", "Long", "Float", "Double", "String", "Bytes"];
4277
- function rt(s) {
4283
+ const qc = ["Int", "Long", "Float", "Double", "String", "Bytes"];
4284
+ function st(s) {
4278
4285
  const e = [], t = [];
4279
4286
  for (const r of s)
4280
4287
  r.type === "bySingleColumn" ? (e.push(r), t.push({
@@ -4287,7 +4294,7 @@ function rt(s) {
4287
4294
  }
4288
4295
  return s;
4289
4296
  }
4290
- class Xc {
4297
+ class Yc {
4291
4298
  constructor(e, t, r) {
4292
4299
  S(this, "pFrame", new Ws());
4293
4300
  S(this, "blobIdToResource", /* @__PURE__ */ new Map());
@@ -4334,7 +4341,7 @@ class Xc {
4334
4341
  this.pFrame.dispose();
4335
4342
  }
4336
4343
  }
4337
- class qc {
4344
+ class Zc {
4338
4345
  constructor(e) {
4339
4346
  S(this, "pFrames");
4340
4347
  S(this, "pTables");
@@ -4353,10 +4360,10 @@ class qc {
4353
4360
  super(), this.blobDriver = o;
4354
4361
  }
4355
4362
  createNewResource(o) {
4356
- return new Xc(this.blobDriver, t, o);
4363
+ return new Yc(this.blobDriver, t, o);
4357
4364
  }
4358
4365
  calculateParamsKey(o) {
4359
- return Zc(o);
4366
+ return el(o);
4360
4367
  }
4361
4368
  }(this.blobDriver), this.pTables = new class extends yr {
4362
4369
  constructor(o) {
@@ -4365,14 +4372,14 @@ class qc {
4365
4372
  async createNewResource(o) {
4366
4373
  const n = this.pFrames.getByKey(o.pFrameHandle), i = await r.run(
4367
4374
  async () => await n.pFrame.createTable({
4368
- src: Ce(o.def.src),
4369
- filters: rt(o.def.filters)
4375
+ src: Ee(o.def.src),
4376
+ filters: st(o.def.filters)
4370
4377
  })
4371
4378
  );
4372
4379
  return o.def.sorting.length !== 0 ? i.sort(o.def.sorting) : i;
4373
4380
  }
4374
4381
  calculateParamsKey(o) {
4375
- return Yc(o);
4382
+ return Qc(o);
4376
4383
  }
4377
4384
  }(this.pFrames);
4378
4385
  }
@@ -4380,9 +4387,9 @@ class qc {
4380
4387
  // Internal / Config API Methods
4381
4388
  //
4382
4389
  createPFrame(e, t) {
4383
- const r = e.filter((n) => zc.find((i) => i === n.spec.valueType)).map((n) => ge(
4390
+ const r = e.filter((n) => qc.find((i) => i === n.spec.valueType)).map((n) => ce(
4384
4391
  n,
4385
- (i) => Fs(i) ? rn(i) : sn(n.spec, i)
4392
+ (i) => Ts(i) ? rn(i) : sn(n.spec, i)
4386
4393
  )), o = this.pFrames.acquire(r);
4387
4394
  return t.addOnDestroy(o.unref), o.key;
4388
4395
  }
@@ -4417,8 +4424,8 @@ class qc {
4417
4424
  async calculateTableData(e, t) {
4418
4425
  let r = await this.concurrencyLimiter.run(
4419
4426
  async () => await this.pFrames.getByKey(e).pFrame.createTable({
4420
- src: Ce(t.src),
4421
- filters: rt(t.filters)
4427
+ src: Ee(t.src),
4428
+ filters: st(t.filters)
4422
4429
  })
4423
4430
  );
4424
4431
  if (t.sorting.length > 0) {
@@ -4430,16 +4437,16 @@ class qc {
4430
4437
  const o = r.getSpec(), n = await this.concurrencyLimiter.run(
4431
4438
  async () => await r.getData([...o.keys()])
4432
4439
  );
4433
- return r.dispose(), o.map((i, l) => ({
4440
+ return r.dispose(), o.map((i, c) => ({
4434
4441
  spec: i,
4435
- data: n[l]
4442
+ data: n[c]
4436
4443
  }));
4437
4444
  }
4438
4445
  async getUniqueValues(e, t) {
4439
4446
  return await this.concurrencyLimiter.run(
4440
4447
  async () => await this.pFrames.getByKey(e).pFrame.getUniqueValues({
4441
4448
  ...t,
4442
- filters: rt(t.filters)
4449
+ filters: st(t.filters)
4443
4450
  })
4444
4451
  );
4445
4452
  }
@@ -4459,7 +4466,7 @@ class qc {
4459
4466
  );
4460
4467
  }
4461
4468
  }
4462
- function Ce(s) {
4469
+ function Ee(s) {
4463
4470
  switch (s.type) {
4464
4471
  case "column":
4465
4472
  return {
@@ -4471,35 +4478,72 @@ function Ce(s) {
4471
4478
  case "full":
4472
4479
  return {
4473
4480
  type: s.type,
4474
- entries: s.entries.map((e) => Ce(e))
4481
+ entries: s.entries.map((e) => Ee(e))
4475
4482
  };
4476
4483
  case "outer":
4477
4484
  return {
4478
4485
  type: "outer",
4479
- primary: Ce(s.primary),
4480
- secondary: s.secondary.map((e) => Ce(e))
4486
+ primary: Ee(s.primary),
4487
+ secondary: s.secondary.map((e) => Ee(e))
4481
4488
  };
4482
4489
  default:
4483
4490
  J(s);
4484
4491
  }
4485
4492
  }
4486
- function Yc(s) {
4487
- const e = Ve("sha256");
4488
- return e.update(s.pFrameHandle), e.update(mt(s.def)), e.digest().toString("hex");
4493
+ function Qc(s) {
4494
+ const e = Ue("sha256");
4495
+ return e.update(me(s.def)), e.digest().toString("hex");
4489
4496
  }
4490
- function Zc(s) {
4491
- const e = s.map((o) => o.id).sort(), t = Ve("sha256");
4492
- let r = "";
4493
- for (const o of e)
4494
- r !== o && (t.update(o), r = o);
4495
- return t.digest().toString("hex");
4497
+ function el(s) {
4498
+ const e = [...s].map((r) => ce(r, (o) => {
4499
+ let n;
4500
+ const i = o.type;
4501
+ switch (i) {
4502
+ case "Json":
4503
+ n = {
4504
+ type: o.type,
4505
+ keyLength: o.keyLength,
4506
+ payload: Object.entries(o.data).map(([c, a]) => ({
4507
+ key: c,
4508
+ value: a
4509
+ }))
4510
+ };
4511
+ break;
4512
+ case "JsonPartitioned":
4513
+ n = {
4514
+ type: o.type,
4515
+ keyLength: o.partitionKeyLength,
4516
+ payload: Object.entries(o.parts).map(([c, a]) => ({
4517
+ key: c,
4518
+ value: a.id.toString()
4519
+ }))
4520
+ };
4521
+ break;
4522
+ case "BinaryPartitioned":
4523
+ n = {
4524
+ type: o.type,
4525
+ keyLength: o.partitionKeyLength,
4526
+ payload: Object.entries(o.parts).map(([c, a]) => ({
4527
+ key: c,
4528
+ value: [a.index.id.toString(), a.values.id.toString()]
4529
+ }))
4530
+ };
4531
+ break;
4532
+ default:
4533
+ throw Error(`unsupported resource type: ${i}`);
4534
+ }
4535
+ return n.payload.sort((c, a) => c.key.localeCompare(a.key)), n;
4536
+ }));
4537
+ e.sort((r, o) => r.id.localeCompare(o.id));
4538
+ const t = Ue("sha256");
4539
+ return t.update(me(e)), t.digest().toString("hex");
4496
4540
  }
4497
- async function Qc(s, e, t) {
4541
+ async function tl(s, e, t) {
4498
4542
  const r = {
4499
4543
  ...Yr,
4500
4544
  ...Zr(e),
4501
4545
  ...t
4502
- }, o = new kr(r.localSecret), n = xs(r.logger, s, r.localProjections), i = js(s, r.logger), l = Vs(s, r.logger), a = Us(s, r.logger), c = new Gs(
4546
+ }, o = new kr(r.localSecret), n = xs(r.logger, s, r.localProjections), i = js(s, r.logger), c = Vs(s, r.logger), a = Us(s, r.logger), l = new Gs(
4503
4547
  r.logger,
4504
4548
  n,
4505
4549
  i,
@@ -4509,19 +4553,19 @@ async function Qc(s, e, t) {
4509
4553
  ), u = new Js(
4510
4554
  r.logger,
4511
4555
  o,
4512
- l,
4556
+ c,
4513
4557
  a,
4514
4558
  r.uploadDriverOps
4515
- ), d = new Ms(r.logger, i, r.logStreamDriverOps), m = new _s(r.logger, d, c), h = await Ks.init(
4559
+ ), d = new Ms(r.logger, i, r.logStreamDriverOps), m = new _s(r.logger, d, l), h = await Ks.init(
4516
4560
  r.logger,
4517
4561
  s,
4518
4562
  o,
4519
4563
  r.localProjections,
4520
4564
  r.openFileDialogCallback,
4521
4565
  r.virtualLocalStoragesOverride
4522
- ), f = new qc(c);
4566
+ ), f = new Zc(l);
4523
4567
  return {
4524
- blobDriver: c,
4568
+ blobDriver: l,
4525
4569
  logDriver: m,
4526
4570
  lsDriver: h,
4527
4571
  signer: o,
@@ -4530,7 +4574,7 @@ async function Qc(s, e, t) {
4530
4574
  };
4531
4575
  }
4532
4576
  class is {
4533
- constructor(e, t, r, o, n, i, l, a) {
4577
+ constructor(e, t, r, o, n, i, c, a) {
4534
4578
  S(this, "pl");
4535
4579
  /** Contains a reactive list of projects along with their meta information. */
4536
4580
  S(this, "projectList");
@@ -4538,7 +4582,7 @@ class is {
4538
4582
  // Projects
4539
4583
  //
4540
4584
  S(this, "openedProjectsByRid", /* @__PURE__ */ new Map());
4541
- this.env = e, this.driverKit = t, this.signer = r, this.projectListResourceId = o, this.openedProjectsList = n, this.projectListTree = i, this.blockRegistryProvider = l, this.projectList = a, this.pl = this.env.pl;
4585
+ this.env = e, this.driverKit = t, this.signer = r, this.projectListResourceId = o, this.openedProjectsList = n, this.projectListTree = i, this.blockRegistryProvider = c, this.projectList = a, this.pl = this.env.pl;
4542
4586
  }
4543
4587
  /** Returns extended API driver kit used internally by middle layer. */
4544
4588
  get internalDriverKit() {
@@ -4548,7 +4592,7 @@ class is {
4548
4592
  // Project List Manipulation
4549
4593
  //
4550
4594
  /** Creates a project with initial state and adds it to project list. */
4551
- async createProject(e, t = Ee()) {
4595
+ async createProject(e, t = Re()) {
4552
4596
  const r = await this.pl.withWriteTx("MLCreateProject", async (o) => {
4553
4597
  const n = await zo(o, e);
4554
4598
  return o.createField(D(this.projectListResourceId, t), "Dynamic", n), await o.commit(), await Os(n);
@@ -4571,7 +4615,7 @@ class is {
4571
4615
  async projectIdToResourceId(e) {
4572
4616
  return await this.pl.withReadTx("Project id to resource id", async (t) => {
4573
4617
  const r = (await t.getField(D(this.projectListResourceId, e))).value;
4574
- if (De(r)) throw new Error("Unexpected project list structure.");
4618
+ if (Be(r)) throw new Error("Unexpected project list structure.");
4575
4619
  return r;
4576
4620
  });
4577
4621
  }
@@ -4582,7 +4626,7 @@ class is {
4582
4626
  async openProject(e) {
4583
4627
  const t = await this.ensureProjectRid(e);
4584
4628
  if (this.openedProjectsByRid.has(t)) throw new Error(`Project ${t} already opened`);
4585
- this.openedProjectsByRid.set(t, await Rt.init(this.env, t)), this.openedProjectsList.setValue([...this.openedProjectsByRid.keys()]);
4629
+ this.openedProjectsByRid.set(t, await Et.init(this.env, t)), this.openedProjectsList.setValue([...this.openedProjectsByRid.keys()]);
4586
4630
  }
4587
4631
  /** Closes the project, and deallocate all corresponding resources. */
4588
4632
  async closeProject(e) {
@@ -4615,8 +4659,8 @@ class is {
4615
4659
  /** Initialize middle layer */
4616
4660
  static async init(e, t, r) {
4617
4661
  const o = {
4618
- ...Xn,
4619
- ...qn(t),
4662
+ ...Yn,
4663
+ ...Zn(t),
4620
4664
  ...r
4621
4665
  };
4622
4666
  process.env.MI_LOG_TREE_STAT && (o.defaultTreeOptions.logStat = process.env.MI_LOG_TREE_STAT === "cumulative" ? "cumulative" : "per-request");
@@ -4624,17 +4668,17 @@ class is {
4624
4668
  const A = D(I.clientRoot, mo);
4625
4669
  I.createField(A, "Dynamic");
4626
4670
  const B = await I.getField(A);
4627
- if (De(B.value)) {
4671
+ if (Be(B.value)) {
4628
4672
  const _ = I.createEphemeral(Dr);
4629
4673
  return I.lock(_), I.setField(A, _), await I.commit(), await _.globalId;
4630
4674
  } else
4631
4675
  return B.value;
4632
- }), i = o.logger, l = await Qc(e, t, o), a = new fs(e.httpDispatcher, {
4676
+ }), i = o.logger, c = await tl(e, t, o), a = new fs(e.httpDispatcher, {
4633
4677
  minTimeout: 250,
4634
4678
  maxRetries: 4
4635
- }), c = new so(a), u = new Go(
4636
- c,
4637
- l.signer,
4679
+ }), l = new so(a), u = new Go(
4680
+ l,
4681
+ c.signer,
4638
4682
  a
4639
4683
  ), d = new Hs(
4640
4684
  i,
@@ -4642,15 +4686,15 @@ class is {
4642
4686
  o.frontendDownloadPath
4643
4687
  ), m = {
4644
4688
  pl: e,
4645
- signer: l.signer,
4689
+ signer: c.signer,
4646
4690
  logger: i,
4647
4691
  httpDispatcher: e.httpDispatcher,
4648
4692
  retryHttpDispatcher: a,
4649
4693
  ops: o,
4650
4694
  bpPreparer: u,
4651
4695
  frontendDownloadDriver: d,
4652
- driverKit: l,
4653
- blockUpdateWatcher: new Wc(c, i, {
4696
+ driverKit: c,
4697
+ blockUpdateWatcher: new Xc(l, i, {
4654
4698
  minDelay: o.devBlockUpdateRecheckInterval,
4655
4699
  http: a,
4656
4700
  preferredUpdateChannel: o.preferredUpdateChannel
@@ -4659,17 +4703,17 @@ class is {
4659
4703
  }, h = new Ls([]), f = await yo(e, n, h, m);
4660
4704
  return new is(
4661
4705
  m,
4662
- l,
4663
- l.signer,
4706
+ c,
4707
+ c.signer,
4664
4708
  n,
4665
4709
  h,
4666
4710
  f.tree,
4667
- c,
4711
+ l,
4668
4712
  f.computable
4669
4713
  );
4670
4714
  }
4671
4715
  }
4672
- const el = [
4716
+ const rl = [
4673
4717
  "undici:request:create",
4674
4718
  // When a new request is created
4675
4719
  "undici:request:bodySent",
@@ -4707,7 +4751,7 @@ const el = [
4707
4751
  "undici:dispatcher:retry"
4708
4752
  // When a dispatcher retries a request
4709
4753
  ];
4710
- async function Fl(s, e = {}) {
4754
+ async function Ll(s, e = {}) {
4711
4755
  const t = {
4712
4756
  pingCheckDurationMs: 1e4,
4713
4757
  pingTimeoutMs: 3e3,
@@ -4725,7 +4769,7 @@ async function Fl(s, e = {}) {
4725
4769
  bodyLimit: 300,
4726
4770
  ...e
4727
4771
  }, r = [];
4728
- el.forEach((a) => {
4772
+ rl.forEach((a) => {
4729
4773
  Xs(a).subscribe((u) => {
4730
4774
  var m;
4731
4775
  const d = (/* @__PURE__ */ new Date()).toISOString();
@@ -4746,54 +4790,54 @@ async function Fl(s, e = {}) {
4746
4790
  blockGARegistryUiChecks: [],
4747
4791
  autoUpdateCdnChecks: []
4748
4792
  }, n = Is(s, { defaultRequestTimeout: t.pingTimeoutMs });
4749
- o.plPings = await he(t.pingCheckDurationMs, t.maxPingsPerSecond, async () => {
4750
- const c = await new xt(n).ping();
4751
- return JSON.stringify(c).slice(0, t.bodyLimit) + "...";
4793
+ o.plPings = await fe(t.pingCheckDurationMs, t.maxPingsPerSecond, async () => {
4794
+ const l = await new Bt(n).ping();
4795
+ return JSON.stringify(l).slice(0, t.bodyLimit) + "...";
4752
4796
  });
4753
- const l = new xt(n).ll.httpDispatcher;
4754
- return o.blockRegistryOverviewChecks = await he(
4797
+ const c = new Bt(n).ll.httpDispatcher;
4798
+ return o.blockRegistryOverviewChecks = await fe(
4755
4799
  t.blockRegistryDurationMs,
4756
4800
  t.maxRegistryChecksPerSecond,
4757
- async () => await ye(new URL(t.blockOverviewPath, t.blockRegistryUrl), t, l)
4758
- ), o.blockGARegistryOverviewChecks = await he(
4801
+ async () => await we(new URL(t.blockOverviewPath, t.blockRegistryUrl), t, c)
4802
+ ), o.blockGARegistryOverviewChecks = await fe(
4759
4803
  t.blockRegistryDurationMs,
4760
4804
  t.maxRegistryChecksPerSecond,
4761
- async () => await ye(new URL(t.blockOverviewPath, t.blockGARegistryUrl), t, l)
4762
- ), o.blockRegistryUiChecks = await he(
4805
+ async () => await we(new URL(t.blockOverviewPath, t.blockGARegistryUrl), t, c)
4806
+ ), o.blockRegistryUiChecks = await fe(
4763
4807
  t.blockRegistryDurationMs,
4764
4808
  t.maxRegistryChecksPerSecond,
4765
- async () => await ye(new URL(t.blockUiPath, t.blockRegistryUrl), t, l)
4766
- ), o.blockGARegistryUiChecks = await he(
4809
+ async () => await we(new URL(t.blockUiPath, t.blockRegistryUrl), t, c)
4810
+ ), o.blockGARegistryUiChecks = await fe(
4767
4811
  t.blockRegistryDurationMs,
4768
4812
  t.maxRegistryChecksPerSecond,
4769
- async () => await ye(new URL(t.blockUiPath, t.blockGARegistryUrl), t, l)
4770
- ), o.autoUpdateCdnChecks = await he(
4813
+ async () => await we(new URL(t.blockUiPath, t.blockGARegistryUrl), t, c)
4814
+ ), o.autoUpdateCdnChecks = await fe(
4771
4815
  t.autoUpdateCdnDurationMs,
4772
4816
  t.maxAutoUpdateCdnChecksPerSecond,
4773
- async () => await ye(t.autoUpdateCdnUrl, t, l)
4774
- ), tl(o, s, t, r);
4817
+ async () => await we(t.autoUpdateCdnUrl, t, c)
4818
+ ), sl(o, s, t, r);
4775
4819
  }
4776
- async function he(s, e, t) {
4820
+ async function fe(s, e, t) {
4777
4821
  const r = gt(), o = [];
4778
4822
  for (; Sr(r) < s; ) {
4779
4823
  const n = gt();
4780
4824
  let i;
4781
4825
  try {
4782
4826
  i = { ok: !0, value: await t() };
4783
- } catch (c) {
4784
- i = { ok: !1, error: c };
4827
+ } catch (l) {
4828
+ i = { ok: !1, error: l };
4785
4829
  }
4786
- const l = Sr(n);
4830
+ const c = Sr(n);
4787
4831
  o.push({
4788
- elapsedMs: l,
4832
+ elapsedMs: c,
4789
4833
  response: i
4790
4834
  });
4791
- const a = 1e3 / e - l;
4835
+ const a = 1e3 / e - c;
4792
4836
  a > 0 && await Ar(a);
4793
4837
  }
4794
4838
  return o;
4795
4839
  }
4796
- async function ye(s, e, t) {
4840
+ async function we(s, e, t) {
4797
4841
  const { body: r, statusCode: o } = await ie(s, {
4798
4842
  dispatcher: t,
4799
4843
  headersTimeout: e.httpTimeoutMs,
@@ -4804,26 +4848,26 @@ async function ye(s, e, t) {
4804
4848
  beginningOfBody: n.slice(0, e.bodyLimit) + "..."
4805
4849
  };
4806
4850
  }
4807
- function tl(s, e, t, r) {
4808
- const o = s.plPings.filter((l) => l.response.ok), n = s.plPings.filter((l) => !l.response.ok), i = [
4809
- ...new Set(o.map((l) => JSON.stringify(l.response.value)))
4851
+ function sl(s, e, t, r) {
4852
+ const o = s.plPings.filter((c) => c.response.ok), n = s.plPings.filter((c) => !c.response.ok), i = [
4853
+ ...new Set(o.map((c) => JSON.stringify(c.response.value)))
4810
4854
  ];
4811
4855
  return `
4812
4856
  Network report:
4813
4857
  pl endpoint: ${e};
4814
4858
  options: ${JSON.stringify(t, null, 2)}.
4815
4859
 
4816
- Platforma pings: ${fe(s.plPings)}
4860
+ Platforma pings: ${ge(s.plPings)}
4817
4861
 
4818
- Block registry overview responses: ${fe(s.blockRegistryOverviewChecks)}
4862
+ Block registry overview responses: ${ge(s.blockRegistryOverviewChecks)}
4819
4863
 
4820
- Block ga registry overview responses: ${fe(s.blockGARegistryOverviewChecks)}
4864
+ Block ga registry overview responses: ${ge(s.blockGARegistryOverviewChecks)}
4821
4865
 
4822
- Block registry ui responses: ${fe(s.blockRegistryUiChecks)}
4866
+ Block registry ui responses: ${ge(s.blockRegistryUiChecks)}
4823
4867
 
4824
- Block ga registry ui responses: ${fe(s.blockGARegistryUiChecks)}
4868
+ Block ga registry ui responses: ${ge(s.blockGARegistryUiChecks)}
4825
4869
 
4826
- Auto-update CDN responses: ${fe(s.autoUpdateCdnChecks)}
4870
+ Auto-update CDN responses: ${ge(s.autoUpdateCdnChecks)}
4827
4871
 
4828
4872
  Block registry overview dumps:
4829
4873
  ${JSON.stringify(s.blockRegistryOverviewChecks, null, 2)}
@@ -4851,8 +4895,8 @@ ${r.join(`
4851
4895
  `)}
4852
4896
  `;
4853
4897
  }
4854
- function fe(s) {
4855
- const e = s.filter((o) => o.response.ok), { mean: t, median: r } = rl(s);
4898
+ function ge(s) {
4899
+ const e = s.filter((o) => o.response.ok), { mean: t, median: r } = ol(s);
4856
4900
  return `
4857
4901
  total: ${s.length};
4858
4902
  successes: ${e.length};
@@ -4861,7 +4905,7 @@ mean in ms: ${t};
4861
4905
  median in ms: ${r};
4862
4906
  `;
4863
4907
  }
4864
- function rl(s) {
4908
+ function ol(s) {
4865
4909
  const e = s.map((o) => o.elapsedMs), t = e.reduce((o, n) => o + n) / e.length;
4866
4910
  let r;
4867
4911
  if (e.length > 0) {
@@ -4877,33 +4921,33 @@ function Sr(s) {
4877
4921
  return gt() - s;
4878
4922
  }
4879
4923
  export {
4880
- $l as BlockPackRegistry,
4881
- Ol as CentralBlockRegistry,
4924
+ Il as BlockPackRegistry,
4925
+ Al as CentralBlockRegistry,
4882
4926
  Zr as DefaultDriverKitOpsPaths,
4883
4927
  Yr as DefaultDriverKitOpsSettings,
4884
- qn as DefaultMiddleLayerOpsPaths,
4885
- Xn as DefaultMiddleLayerOpsSettings,
4928
+ Zn as DefaultMiddleLayerOpsPaths,
4929
+ Yn as DefaultMiddleLayerOpsSettings,
4886
4930
  jr as FrontendFromFolderResourceType,
4887
4931
  xr as FrontendFromUrlResourceType,
4888
4932
  is as MiddleLayer,
4889
- Rt as Project,
4933
+ Et as Project,
4890
4934
  Oo as TengoTemplateGet,
4891
4935
  Io as TengoTemplateGetRegistry,
4892
- Fo as TengoTemplateGetTemplate,
4936
+ To as TengoTemplateGetTemplate,
4893
4937
  Ao as TengoTemplateGetTemplateURI,
4894
- To as TengoTemplatePack,
4938
+ Fo as TengoTemplatePack,
4895
4939
  Lo as TengoTemplatePackConvert,
4896
4940
  Do as TengoTemplatePackConvertTemplate,
4897
4941
  No as TengoTemplatePackConvertTemplatePack,
4898
- Al as V1CentralDevSnapshotRegistry,
4899
- Il as V1CentralRegistry,
4942
+ Fl as V1CentralDevSnapshotRegistry,
4943
+ Tl as V1CentralRegistry,
4900
4944
  so as V2RegistryProvider,
4901
- Fl as checkNetwork,
4945
+ Ll as checkNetwork,
4902
4946
  Br as createRenderTemplate,
4903
- Tr as getDevV1PacketMtime,
4904
- wt as getDevV2PacketMtime,
4905
- Qc as initDriverKit,
4906
- bt as loadTemplate,
4947
+ Fr as getDevV1PacketMtime,
4948
+ yt as getDevV2PacketMtime,
4949
+ tl as initDriverKit,
4950
+ St as loadTemplate,
4907
4951
  Bo as prepareTemplateSpec
4908
4952
  };
4909
4953
  //# sourceMappingURL=index.mjs.map