@milaboratories/pl-middle-layer 1.10.18 → 1.10.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -24,6 +24,7 @@ import { Scope as Se, getQuickJS as ir } from "quickjs-emscripten";
24
24
  import { setTimeout as ar } from "node:timers/promises";
25
25
  import * as gt from "node:os";
26
26
  import { createDownloadClient as cr, createLogsClient as ur, createUploadBlobClient as lr, createUploadProgressClient as dr, createLsFilesClient as pr, DownloadDriver as hr, UploadDriver as fr, LogsStreamDriver as gr, LogsDriver as mr, LsDriver as vr, DownloadUrlDriver as yr } from "@milaboratories/pl-drivers";
27
+ import { PFrame as br } from "@milaboratories/pframes-node";
27
28
  async function ze(o) {
28
29
  try {
29
30
  return await Wt.stat(o, { bigint: !0 });
@@ -33,17 +34,17 @@ async function ze(o) {
33
34
  throw e;
34
35
  }
35
36
  }
36
- const br = [U.PlPackageYamlConfigFile], wr = [U.PlPackageJsonConfigFile], je = ["backend", "dist", "tengo", "tpl", "main.plj.gz"], Te = ["config", "dist", "config.json"], mt = ["frontend", "dist"], qe = "block-model/dist/config.json", Sr = "block-ui/package.json", kr = [
37
+ const wr = [U.PlPackageYamlConfigFile], Sr = [U.PlPackageJsonConfigFile], je = ["backend", "dist", "tengo", "tpl", "main.plj.gz"], Te = ["config", "dist", "config.json"], mt = ["frontend", "dist"], qe = "block-model/dist/config.json", kr = "block-ui/package.json", Cr = [
37
38
  je,
38
39
  Te,
39
- br,
40
40
  wr,
41
+ Sr,
41
42
  mt
42
43
  ];
43
- async function Cr(o) {
44
+ async function Pr(o) {
44
45
  return await ze(I.join(o, ...Te)) !== void 0 || await ze(I.join(o, ...je)) !== void 0;
45
46
  }
46
- function Pr(o, e) {
47
+ function Fr(o, e) {
47
48
  try {
48
49
  return require.resolve(e, {
49
50
  paths: [o]
@@ -53,23 +54,23 @@ function Pr(o, e) {
53
54
  }
54
55
  }
55
56
  function me(o, e) {
56
- const t = Pr(o, e);
57
+ const t = Fr(o, e);
57
58
  if (t === void 0) throw new Error(`Can't resolve ${e} against ${o}`);
58
59
  return t;
59
60
  }
60
61
  async function Ye(o, e) {
61
- if (I.isAbsolute(o) || (o = I.resolve(o)), await Cr(o))
62
+ if (I.isAbsolute(o) || (o = I.resolve(o)), await Pr(o))
62
63
  return {
63
64
  workflow: I.join(o, ...je),
64
65
  config: I.join(o, ...Te),
65
66
  ui: I.join(o, ...mt)
66
67
  };
67
68
  {
68
- const t = me(o, qe), r = me(o, qe), s = me(o, Sr);
69
+ const t = me(o, qe), r = me(o, qe), s = me(o, kr);
69
70
  return { workflow: t, config: r, ui: I.resolve(s, "..", "dist") };
70
71
  }
71
72
  }
72
- async function Fr(o) {
73
+ async function Br(o) {
73
74
  try {
74
75
  return await T.promises.readFile(o, "utf8");
75
76
  } catch (e) {
@@ -78,7 +79,7 @@ async function Fr(o) {
78
79
  throw e;
79
80
  }
80
81
  }
81
- async function Br(o) {
82
+ async function Rr(o) {
82
83
  try {
83
84
  return await T.promises.stat(o, { bigint: !0 });
84
85
  } catch (e) {
@@ -89,8 +90,8 @@ async function Br(o) {
89
90
  }
90
91
  async function vt(o) {
91
92
  let e = 0n;
92
- for (const t of kr) {
93
- const r = I.join(o, ...t), s = await Br(r);
93
+ for (const t of Cr) {
94
+ const r = I.join(o, ...t), s = await Rr(r);
94
95
  s !== void 0 && e < s.mtimeNs && (e = s.mtimeNs);
95
96
  }
96
97
  return e.toString();
@@ -99,7 +100,7 @@ async function Ae(o) {
99
100
  const e = await T.promises.stat(o.components.workflow.file, { bigint: !0 }), t = await T.promises.stat(o.components.model.file, { bigint: !0 });
100
101
  return (e.mtimeNs > t.mtimeNs ? e.mtimeNs : t.mtimeNs).toString();
101
102
  }
102
- class Hs {
103
+ class _s {
103
104
  constructor(e, t) {
104
105
  this.registrySpecs = e, this.http = t;
105
106
  }
@@ -135,7 +136,7 @@ class Hs {
135
136
  case "folder_with_dev_packages":
136
137
  for (const i of await T.promises.readdir(e.path, { withFileTypes: !0 })) {
137
138
  if (!i.isDirectory()) continue;
138
- const a = I.join(e.path, i.name), u = await Fr(
139
+ const a = I.join(e.path, i.name), u = await Br(
139
140
  I.join(a, U.PlPackageYamlConfigFile)
140
141
  );
141
142
  if (u !== void 0) {
@@ -188,54 +189,54 @@ class Hs {
188
189
  return e;
189
190
  }
190
191
  }
191
- const _s = {
192
+ const Ws = {
192
193
  type: "remote_v1",
193
194
  label: "Central Release Registry",
194
195
  url: "https://block.registry.platforma.bio/releases"
195
- }, Ws = {
196
+ }, zs = {
196
197
  type: "remote_v1",
197
198
  label: "Central Dev Snapshot registry",
198
199
  url: "https://block.registry.platforma.bio/dev"
199
- }, Rr = {
200
- groups: [{ id: "default", label: "Default", blocks: [] }]
201
200
  }, Or = {
201
+ groups: [{ id: "default", label: "Default", blocks: [] }]
202
+ }, Dr = {
202
203
  stagingRefreshTimestamp: 0,
203
204
  blocksInLimbo: []
204
- }, Dr = {
205
+ }, xr = {
205
206
  label: "New Project"
206
- }, xr = { name: "UserProject", version: "2" }, yt = "SchemaVersion", bt = "1", Ie = "ProjectCreated", Q = "ProjectLastModified", Z = "ProjectMeta", G = "ProjectStructure", ue = "BlockRenderingState", Er = "BlockFrontendState/", jr = /^BlockFrontendState\/(?<blockid>.*)$/;
207
+ }, Er = { name: "UserProject", version: "2" }, yt = "SchemaVersion", bt = "1", Ie = "ProjectCreated", Q = "ProjectLastModified", Z = "ProjectMeta", G = "ProjectStructure", ue = "BlockRenderingState", jr = "BlockFrontendState/", Tr = /^BlockFrontendState\/(?<blockid>.*)$/;
207
208
  function ke(o) {
208
- return `${Er}${o}`;
209
+ return `${jr}${o}`;
209
210
  }
210
- const Tr = "BlockArgsAuthor/";
211
+ const Ar = "BlockArgsAuthor/";
211
212
  function Ce(o) {
212
- return `${Tr}${o}`;
213
+ return `${Ar}${o}`;
213
214
  }
214
215
  const Pe = "ProjectStructureAuthor";
215
- function Ar(o) {
216
- const e = o.match(jr);
216
+ function Ir(o) {
217
+ const e = o.match(Tr);
217
218
  if (e !== null)
218
219
  return e.groups.blockid;
219
220
  }
220
- const Ir = "__serviceTemplate_";
221
+ const Vr = "__serviceTemplate_";
221
222
  function Fe(o) {
222
- return `${Ir}${o}`;
223
+ return `${Vr}${o}`;
223
224
  }
224
225
  function C(o, e) {
225
226
  return `${o}-${e}`;
226
227
  }
227
- const Vr = /^(?<blockId>.*)-(?<fieldName>blockPack|prodArgs|currentArgs|prodCtx|prodUiCtx|prodOutput|prodCtxPrevious|prodUiCtxPrevious|prodOutputPrevious|stagingCtx|stagingUiCtx|stagingOutput|stagingCtxPrevious|stagingUiCtxPrevious|stagingOutputPrevious)$/;
228
- function Nr(o) {
229
- const e = o.match(Vr);
228
+ const Nr = /^(?<blockId>.*)-(?<fieldName>blockPack|prodArgs|currentArgs|prodCtx|prodUiCtx|prodOutput|prodCtxPrevious|prodUiCtxPrevious|prodOutputPrevious|stagingCtx|stagingUiCtx|stagingOutput|stagingCtxPrevious|stagingUiCtxPrevious|stagingOutputPrevious)$/;
229
+ function Lr(o) {
230
+ const e = o.match(Nr);
230
231
  if (e === null) return;
231
232
  const { blockId: t, fieldName: r } = e.groups;
232
233
  return { blockId: t, fieldName: r };
233
234
  }
234
- const Lr = "projects", wt = { name: "Projects", version: "1" }, Jr = (o) => K(o.type, wt) ? o.fields : [];
235
- async function Kr(o, e, t, r) {
235
+ const Jr = "projects", wt = { name: "Projects", version: "1" }, Kr = (o) => K(o.type, wt) ? o.fields : [];
236
+ async function Mr(o, e, t, r) {
236
237
  const s = await ht.init(o, e, {
237
238
  ...r.ops.defaultTreeOptions,
238
- pruning: Jr
239
+ pruning: Kr
239
240
  });
240
241
  return { computable: P.make((i) => {
241
242
  const a = i.accessor(s.entry()).node(), u = t.getValue(i);
@@ -257,40 +258,40 @@ async function Kr(o, e, t, r) {
257
258
  return c.sort((l) => -l.lastModified.valueOf()), c;
258
259
  }).withStableType(), tree: s };
259
260
  }
260
- const Mr = {
261
+ const $r = {
261
262
  name: "EphRenderTemplate",
262
263
  version: "1"
263
- }, $r = {
264
+ }, Ur = {
264
265
  name: "RenderTemplate",
265
266
  version: "1"
266
267
  };
267
268
  function St(o, e, t, r, s) {
268
269
  if (s.length === 0) throw new Error("Zero output names provided");
269
- const n = t ? o.createEphemeral(Mr) : o.createStruct($r), i = S(n, "template"), a = S(n, "inputs");
270
+ const n = t ? o.createEphemeral($r) : o.createStruct(Ur), i = S(n, "template"), a = S(n, "inputs");
270
271
  return o.createField(i, "Input", e), o.createField(a, "Input", y.createPlMap(o, r, t)), o.lockInputs(n), y.futureRecord(o, n, s, "Output", "outputs/");
271
272
  }
272
- const Ur = { name: "BContextEnd", version: "1" }, Gr = { name: "BContext", version: "1" }, Hr = "id", _r = "parent/", Wr = ["context", "result"];
273
+ const Gr = { name: "BContextEnd", version: "1" }, Hr = { name: "BContext", version: "1" }, _r = "id", Wr = "parent/", zr = ["context", "result"];
273
274
  function Qe(o, e, t) {
274
- return St(o, e, !0, t, Wr);
275
+ return St(o, e, !0, t, zr);
275
276
  }
276
- function zr(o) {
277
- const e = o.createEphemeral(Ur);
277
+ function qr(o) {
278
+ const e = o.createEphemeral(Gr);
278
279
  return o.lock(e), e;
279
280
  }
280
- function qr(o, e) {
281
- if (e.length === 0) return zr(o);
281
+ function Yr(o, e) {
282
+ if (e.length === 0) return qr(o);
282
283
  if (e.length === 1) return e[0];
283
- const t = o.createEphemeral(Gr);
284
- o.createField(S(t, Hr), "Input", y.createPlString(o, Y()));
284
+ const t = o.createEphemeral(Hr);
285
+ o.createField(S(t, _r), "Input", y.createPlString(o, Y()));
285
286
  for (let r = 0; r < e.length; r++)
286
- o.createField(S(t, `${_r}${r}`), "Input", e[r]);
287
+ o.createField(S(t, `${Wr}${r}`), "Input", e[r]);
287
288
  return o.lock(t), t;
288
289
  }
289
- const Yr = { name: "TengoTemplateGet", version: "1" }, Qr = "registry", Zr = "templateURI", Xr = "template", eo = { name: "TengoTemplatePack", version: "1" }, to = {
290
+ const Qr = { name: "TengoTemplateGet", version: "1" }, Zr = "registry", Xr = "templateURI", eo = "template", to = { name: "TengoTemplatePack", version: "1" }, ro = {
290
291
  name: "TengoTemplatePackConvert",
291
292
  version: "1"
292
- }, ro = "templatePack", oo = "template";
293
- async function so(o) {
293
+ }, oo = "templatePack", so = "template";
294
+ async function no(o) {
294
295
  switch (o.type) {
295
296
  case "from-file":
296
297
  return {
@@ -304,20 +305,20 @@ async function so(o) {
304
305
  return D(o);
305
306
  }
306
307
  }
307
- function no(o, e) {
308
- const t = o.createStruct(Yr), r = S(t, Qr), s = S(t, Zr), n = S(t, Xr);
308
+ function io(o, e) {
309
+ const t = o.createStruct(Qr), r = S(t, Zr), s = S(t, Xr), n = S(t, eo);
309
310
  return o.setField(r, o.createValue(y.JsonString, Buffer.from(JSON.stringify(e.registry)))), o.setField(s, o.createValue(y.JsonString, Buffer.from(JSON.stringify(e.path)))), n;
310
311
  }
311
- function io(o, e) {
312
- const t = o.createValue(eo, e.content), r = o.createStruct(to), s = S(r, ro), n = S(r, oo);
312
+ function ao(o, e) {
313
+ const t = o.createValue(to, e.content), r = o.createStruct(ro), s = S(r, oo), n = S(r, so);
313
314
  return o.setField(s, t), n;
314
315
  }
315
316
  function Ve(o, e) {
316
317
  switch (e.type) {
317
318
  case "from-registry":
318
- return no(o, e);
319
- case "explicit":
320
319
  return io(o, e);
320
+ case "explicit":
321
+ return ao(o, e);
321
322
  default:
322
323
  return D(e);
323
324
  }
@@ -326,7 +327,7 @@ const kt = { name: "Frontend/FromUrl", version: "1" }, Ct = {
326
327
  name: "Frontend/FromFolder",
327
328
  version: "1"
328
329
  };
329
- function ao(o, e) {
330
+ function co(o, e) {
330
331
  switch (e.type) {
331
332
  case "url":
332
333
  return o.createValue(
@@ -345,11 +346,11 @@ function ao(o, e) {
345
346
  return D(e);
346
347
  }
347
348
  }
348
- const co = { name: "BlockPackCustom", version: "1" }, Pt = "template", Ft = "frontend";
349
+ const uo = { name: "BlockPackCustom", version: "1" }, Pt = "template", Ft = "frontend";
349
350
  function Ze(o) {
350
351
  return o.endsWith("/") ? o : `${o}/`;
351
352
  }
352
- class uo {
353
+ class lo {
353
354
  constructor(e, t) {
354
355
  this.signer = e, this.http = t;
355
356
  }
@@ -447,14 +448,14 @@ class uo {
447
448
  }
448
449
  }
449
450
  }
450
- function lo(o, e) {
451
- const t = { config: e.config, source: e.source }, r = o.createStruct(co, JSON.stringify(t));
452
- return o.createField(S(r, Pt), "Input", Ve(o, e.template)), o.createField(S(r, Ft), "Input", ao(o, e.frontend)), o.lock(r), r;
451
+ function po(o, e) {
452
+ const t = { config: e.config, source: e.source }, r = o.createStruct(uo, JSON.stringify(t));
453
+ return o.createField(S(r, Pt), "Input", Ve(o, e.template)), o.createField(S(r, Ft), "Input", co(o, e.frontend)), o.lock(r), r;
453
454
  }
454
455
  function Xe(o, e) {
455
456
  switch (e.type) {
456
457
  case "explicit":
457
- return lo(o, e);
458
+ return po(o, e);
458
459
  default:
459
460
  return D(e.type);
460
461
  }
@@ -462,7 +463,7 @@ function Xe(o, e) {
462
463
  function se(o, e) {
463
464
  return { __isRef: !0, blockId: o, name: e };
464
465
  }
465
- function po(o) {
466
+ function ho(o) {
466
467
  return typeof o == "object" && o !== null && o.__isRef === !0 && "blockId" in o && "name" in o;
467
468
  }
468
469
  function Be(o, e, t) {
@@ -478,7 +479,7 @@ function Be(o, e, t) {
478
479
  return;
479
480
  case "object":
480
481
  if (e === null) return;
481
- if (po(e))
482
+ if (ho(e))
482
483
  t === void 0 || t.has(e.blockId) ? o.upstreams.add(e.blockId) : o.missingReferences = !0;
483
484
  else if (Array.isArray(e))
484
485
  for (const s of e) Be(o, s, t);
@@ -490,7 +491,7 @@ function Be(o, e, t) {
490
491
  D(r);
491
492
  }
492
493
  }
493
- function ho(o, e) {
494
+ function fo(o, e) {
494
495
  const t = { upstreams: /* @__PURE__ */ new Set(), missingReferences: !1 };
495
496
  return Be(t, o, e), t;
496
497
  }
@@ -548,7 +549,7 @@ function ie(o, e) {
548
549
  for (const { id: s } of V(o)) {
549
550
  const n = e(s);
550
551
  if (n === void 0) continue;
551
- const i = ho(n, r), a = {
552
+ const i = fo(n, r), a = {
552
553
  id: s,
553
554
  missingReferences: i.missingReferences,
554
555
  upstream: i.upstreams,
@@ -559,7 +560,7 @@ function ie(o, e) {
559
560
  }
560
561
  return new Bt(t);
561
562
  }
562
- function fo(o, e) {
563
+ function go(o, e) {
563
564
  if (o.size !== e.size) return !1;
564
565
  for (const t of o) if (!e.has(t)) return !1;
565
566
  return !0;
@@ -573,7 +574,7 @@ function et(o, e) {
573
574
  const t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
574
575
  return o.nodes.forEach((n) => {
575
576
  const i = e.nodes.get(n.id);
576
- i === void 0 ? t.add(n.id) : (!fo(n.upstream, i.upstream) || Oe(n.upstream, s)) && s.add(n.id);
577
+ i === void 0 ? t.add(n.id) : (!go(n.upstream, i.upstream) || Oe(n.upstream, s)) && s.add(n.id);
577
578
  }), e.nodes.forEach((n) => {
578
579
  o.nodes.has(n.id) ? Oe(n.upstream, s) && s.add(n.id) : r.add(n.id);
579
580
  }), { onlyInA: t, onlyInB: r, different: s };
@@ -581,14 +582,14 @@ function et(o, e) {
581
582
  let ve;
582
583
  async function Rt() {
583
584
  if (ve === void 0) {
584
- const o = await so(sr["pframes.export-pframe"]);
585
+ const o = await no(sr["pframes.export-pframe"]);
585
586
  if (o.type !== "explicit") throw new Error("Unexpected prepared template type.");
586
587
  const e = he("sha256").update(o.content).digest("hex");
587
588
  ve = { spec: o, hash: e };
588
589
  }
589
590
  return ve;
590
591
  }
591
- function go(o, e, t) {
592
+ function mo(o, e, t) {
592
593
  return St(o, e, !0, { pf: t }, ["result"]).result;
593
594
  }
594
595
  function ye(o, e) {
@@ -665,7 +666,7 @@ class tt {
665
666
  );
666
667
  }
667
668
  }
668
- const mo = (o) => {
669
+ const vo = (o) => {
669
670
  throw new Error(`No new block info for ${o}`);
670
671
  };
671
672
  class le {
@@ -808,10 +809,10 @@ class le {
808
809
  if (n.fields[t] === void 0 || n.fields[t].ref === void 0)
809
810
  throw new Error("One of the upstreams staging is not rendered.");
810
811
  r.push(y.unwrapHolder(this.tx, n.fields[t].ref));
811
- }), qr(this.tx, r);
812
+ }), Yr(this.tx, r);
812
813
  }
813
814
  exportCtx(e) {
814
- return go(this.tx, y.unwrapHolder(this.tx, this.ctxExportTplHolder), e);
815
+ return mo(this.tx, y.unwrapHolder(this.tx, this.ctxExportTplHolder), e);
815
816
  }
816
817
  renderStagingFor(e) {
817
818
  this.resetStaging(e);
@@ -855,7 +856,7 @@ class le {
855
856
  // Structure changes
856
857
  //
857
858
  /** Very generic method, better check for more specialized case-specific methods first. */
858
- updateStructure(e, t = mo) {
859
+ updateStructure(e, t = vo) {
859
860
  const r = this.getStagingGraph(), s = this.getActualProductionGraph(), n = Re(e), i = ie(
860
861
  e,
861
862
  (c) => {
@@ -1074,7 +1075,7 @@ class le {
1074
1075
  );
1075
1076
  const $ = /* @__PURE__ */ new Map();
1076
1077
  for (const v of p.fields) {
1077
- const O = Nr(v.name);
1078
+ const O = Lr(v.name);
1078
1079
  if (O === void 0) continue;
1079
1080
  let F = $.get(O.blockId);
1080
1081
  F === void 0 && (F = {
@@ -1093,7 +1094,7 @@ class le {
1093
1094
  ));
1094
1095
  const _ = { stagingRefreshTimestamp: M }, j = new Set(ee), x = /* @__PURE__ */ new Map();
1095
1096
  for (const v of te) {
1096
- const O = Ar(v.key);
1097
+ const O = Ir(v.key);
1097
1098
  O !== void 0 && x.set(O, v.value);
1098
1099
  }
1099
1100
  const R = [];
@@ -1139,11 +1140,11 @@ class le {
1139
1140
  return oe.fixProblems(), oe;
1140
1141
  }
1141
1142
  }
1142
- async function vo(o, e = Dr) {
1143
- const t = o.createEphemeral(xr);
1143
+ async function yo(o, e = xr) {
1144
+ const t = o.createEphemeral(Er);
1144
1145
  o.lock(t);
1145
1146
  const r = String(Date.now());
1146
- o.setKValue(t, yt, JSON.stringify(bt)), o.setKValue(t, Ie, r), o.setKValue(t, Q, r), o.setKValue(t, Z, JSON.stringify(e)), o.setKValue(t, G, JSON.stringify(Rr)), o.setKValue(t, ue, JSON.stringify(Or));
1147
+ o.setKValue(t, yt, JSON.stringify(bt)), o.setKValue(t, Ie, r), o.setKValue(t, Q, r), o.setKValue(t, Z, JSON.stringify(e)), o.setKValue(t, G, JSON.stringify(Or)), o.setKValue(t, ue, JSON.stringify(Dr));
1147
1148
  const s = await Rt();
1148
1149
  return o.createField(
1149
1150
  S(t, Fe(s.hash)),
@@ -1165,7 +1166,7 @@ async function A(o, e, t, r) {
1165
1166
  return s.save(), n;
1166
1167
  }
1167
1168
  }
1168
- function* yo(o) {
1169
+ function* bo(o) {
1169
1170
  switch (o.type) {
1170
1171
  case "Json":
1171
1172
  return;
@@ -1185,7 +1186,7 @@ function rt(o, e) {
1185
1186
  Object.entries(o).map(([t, r]) => [t, e(r, t)])
1186
1187
  );
1187
1188
  }
1188
- function bo(o, e) {
1189
+ function wo(o, e) {
1189
1190
  switch (o.type) {
1190
1191
  case "Json":
1191
1192
  return { ...o };
@@ -1203,26 +1204,26 @@ function bo(o, e) {
1203
1204
  D(o);
1204
1205
  }
1205
1206
  }
1206
- const wo = X("PColumnData/JsonPartitioned", "1"), So = X(
1207
+ const So = X("PColumnData/JsonPartitioned", "1"), ko = X(
1207
1208
  "PColumnData/Partitioned/JsonPartitioned",
1208
1209
  "1"
1209
- ), ko = X("PColumnData/BinaryPartitioned", "1"), Co = X(
1210
+ ), Co = X("PColumnData/BinaryPartitioned", "1"), Po = X(
1210
1211
  "PColumnData/Partitioned/BinaryPartitioned",
1211
1212
  "1"
1212
- ), Po = X("PColumnData/Json", "1");
1213
- function Fo(o) {
1213
+ ), Fo = X("PColumnData/Json", "1");
1214
+ function Bo(o) {
1214
1215
  if (!o.getIsReadyOrError()) throw new Error("Data not ready.");
1215
1216
  const e = o.getDataAsJson();
1216
1217
  if (e === void 0)
1217
1218
  throw new Error("unexpected data info structure, no resource data");
1218
- if (K(o.resourceType, Po)) {
1219
+ if (K(o.resourceType, Fo)) {
1219
1220
  const t = e;
1220
1221
  return {
1221
1222
  type: "Json",
1222
1223
  keyLength: t.keyLength,
1223
1224
  data: t.data
1224
1225
  };
1225
- } else if (K(o.resourceType, wo)) {
1226
+ } else if (K(o.resourceType, So)) {
1226
1227
  const t = e, r = Object.fromEntries(
1227
1228
  o.listInputFields().map((s) => [s, o.traverse({ field: s, errorIfFieldNotSet: !0 }).resourceInfo])
1228
1229
  );
@@ -1231,7 +1232,7 @@ function Fo(o) {
1231
1232
  partitionKeyLength: t.partitionKeyLength,
1232
1233
  parts: r
1233
1234
  };
1234
- } else if (K(o.resourceType, So)) {
1235
+ } else if (K(o.resourceType, ko)) {
1235
1236
  const t = e, r = {};
1236
1237
  for (const s of o.listInputFields()) {
1237
1238
  const n = o.traverse({ field: s, errorIfFieldNotSet: !0 }), i = n.listInputFields();
@@ -1246,7 +1247,7 @@ function Fo(o) {
1246
1247
  partitionKeyLength: t.superPartitionKeyLength + t.partitionKeyLength,
1247
1248
  parts: r
1248
1249
  };
1249
- } else if (K(o.resourceType, ko)) {
1250
+ } else if (K(o.resourceType, Co)) {
1250
1251
  const t = e, r = {};
1251
1252
  for (const s of o.listInputFields())
1252
1253
  if (s.endsWith(".index")) {
@@ -1267,7 +1268,7 @@ function Fo(o) {
1267
1268
  partitionKeyLength: t.partitionKeyLength,
1268
1269
  parts: r
1269
1270
  };
1270
- } else if (K(o.resourceType, Co)) {
1271
+ } else if (K(o.resourceType, Po)) {
1271
1272
  const t = e, r = {};
1272
1273
  for (const s of o.listInputFields()) {
1273
1274
  const n = o.traverse({ field: s, errorIfFieldNotSet: !0 }), i = n.listInputFields();
@@ -1340,7 +1341,7 @@ function Dt(o, e = !0, t = !1, r = "") {
1340
1341
  for (const [, l] of n) l.data === void 0 && (l.hasData = !1);
1341
1342
  return { locked: i, results: n };
1342
1343
  }
1343
- function Bo(o, e = !0, t = "") {
1344
+ function Ro(o, e = !0, t = "") {
1344
1345
  if (!o.getIsReadyOrError()) throw new Error("resource is not ready");
1345
1346
  const r = Dt(o, e, !1, t);
1346
1347
  nr(r.locked);
@@ -1602,7 +1603,7 @@ function* E(o, e) {
1602
1603
  D(o);
1603
1604
  }
1604
1605
  }
1605
- function Ro(o, e) {
1606
+ function Oo(o, e) {
1606
1607
  const t = {};
1607
1608
  for (const [r, s] of Object.entries(o)) t[r] = e(s);
1608
1609
  return t;
@@ -1610,7 +1611,7 @@ function Ro(o, e) {
1610
1611
  function de(o, e) {
1611
1612
  return o === void 0 ? void 0 : e(o);
1612
1613
  }
1613
- function Oo(o) {
1614
+ function Do(o) {
1614
1615
  switch (o.type) {
1615
1616
  case "GetImportProgress":
1616
1617
  return !0;
@@ -1618,8 +1619,8 @@ function Oo(o) {
1618
1619
  return !1;
1619
1620
  }
1620
1621
  }
1621
- function Do(o) {
1622
- for (const e of E(o)) if (Oo(e)) return !0;
1622
+ function xo(o) {
1623
+ for (const e of E(o)) if (Do(e)) return !0;
1623
1624
  return !1;
1624
1625
  }
1625
1626
  function fe(o) {
@@ -1631,18 +1632,18 @@ function fe(o) {
1631
1632
  function f(o) {
1632
1633
  return () => fe(o);
1633
1634
  }
1634
- const xo = (o) => {
1635
+ const Eo = (o) => {
1635
1636
  const e = {};
1636
1637
  for (const [t, r] of Object.entries(o)) e[t] = r;
1637
1638
  return f(e);
1638
- }, Eo = (o) => {
1639
+ }, jo = (o) => {
1639
1640
  const e = o.source;
1640
1641
  if (e === void 0) return f(void 0);
1641
1642
  const t = [];
1642
1643
  for (const r of e)
1643
1644
  r instanceof Array ? t.push(...r) : t.push(r);
1644
1645
  return f(t);
1645
- }, jo = (o) => {
1646
+ }, To = (o) => {
1646
1647
  const e = o.source, t = o.field;
1647
1648
  return e === void 0 || t === void 0 ? f(void 0) : ({ cCtx: r }) => {
1648
1649
  var s;
@@ -1654,7 +1655,7 @@ function Et(o, e) {
1654
1655
  for (let s = 0; s < r; s++) t[String(s)] = e(o[s]);
1655
1656
  return t;
1656
1657
  }
1657
- function To(o, e) {
1658
+ function Ao(o, e) {
1658
1659
  return (t) => {
1659
1660
  const r = t.source;
1660
1661
  return r === void 0 ? f(void 0) : () => ({
@@ -1671,7 +1672,7 @@ function jt(o) {
1671
1672
  return f(t);
1672
1673
  };
1673
1674
  }
1674
- function Ao(o, e) {
1675
+ function Io(o, e) {
1675
1676
  return (t) => {
1676
1677
  const r = t.source;
1677
1678
  if (r === void 0) return f(void 0);
@@ -1682,34 +1683,34 @@ function Ao(o, e) {
1682
1683
  }
1683
1684
  return () => ({
1684
1685
  type: "ScheduleSubroutine",
1685
- subroutine: Io,
1686
+ subroutine: Vo,
1686
1687
  args: s
1687
1688
  });
1688
1689
  };
1689
1690
  }
1690
- const Io = (o) => f(o), Vo = (o) => {
1691
+ const Vo = (o) => f(o), No = (o) => {
1691
1692
  const e = o.arg;
1692
1693
  return f(e === void 0 ? void 0 : e.length === 0);
1693
- }, No = (o) => {
1694
+ }, Lo = (o) => {
1694
1695
  const e = o.operand;
1695
1696
  return f(e === void 0 ? void 0 : !e);
1696
- }, Lo = (o) => {
1697
+ }, Jo = (o) => {
1697
1698
  const e = o.operand1, t = o.operand2;
1698
1699
  return f(e === void 0 || t === void 0 ? void 0 : e && t);
1699
- }, Jo = (o) => {
1700
+ }, Ko = (o) => {
1700
1701
  const e = o.operand1, t = o.operand2;
1701
1702
  return f(e === void 0 || t === void 0 ? void 0 : e || t);
1702
- }, Ko = (o) => {
1703
+ }, Mo = (o) => {
1703
1704
  const e = o.source;
1704
1705
  return e === void 0 ? f(void 0) : ({ cCtx: t }) => {
1705
1706
  var r;
1706
1707
  return fe((r = t.accessor(e).node()) == null ? void 0 : r.getDataAsJson());
1707
1708
  };
1708
- }, Mo = (o) => {
1709
+ }, $o = (o) => {
1709
1710
  const e = o.source, t = o.field;
1710
1711
  return f(e === void 0 || t === void 0 ? void 0 : e[t]);
1711
1712
  };
1712
- function $o(o, e) {
1713
+ function Uo(o, e) {
1713
1714
  return (t) => {
1714
1715
  const r = t.source;
1715
1716
  return r === void 0 ? f(void 0) : ({ cCtx: s }) => {
@@ -1724,13 +1725,13 @@ function $o(o, e) {
1724
1725
  }
1725
1726
  return {
1726
1727
  type: "ScheduleSubroutine",
1727
- subroutine: Uo,
1728
+ subroutine: Go,
1728
1729
  args: i
1729
1730
  };
1730
1731
  };
1731
1732
  };
1732
1733
  }
1733
- const Uo = (o) => f(o), Go = (o) => {
1734
+ const Go = (o) => f(o), Ho = (o) => {
1734
1735
  const e = o.source;
1735
1736
  return e === void 0 ? f(void 0) : ({ drivers: t }) => ({
1736
1737
  type: "ScheduleComputable",
@@ -1744,7 +1745,7 @@ const Uo = (o) => f(o), Go = (o) => {
1744
1745
  }
1745
1746
  )
1746
1747
  });
1747
- }, Ho = (o) => {
1748
+ }, _o = (o) => {
1748
1749
  const e = o.source;
1749
1750
  return e === void 0 ? f(void 0) : ({ cCtx: t, drivers: r }) => {
1750
1751
  const s = t.accessor(e).node().resourceInfo;
@@ -1755,7 +1756,7 @@ const Uo = (o) => f(o), Go = (o) => {
1755
1756
  })
1756
1757
  };
1757
1758
  };
1758
- }, _o = (o) => {
1759
+ }, Wo = (o) => {
1759
1760
  const e = o.source;
1760
1761
  return e === void 0 ? f(void 0) : ({ drivers: t }) => ({
1761
1762
  type: "ScheduleComputable",
@@ -1771,37 +1772,37 @@ const Uo = (o) => f(o), Go = (o) => {
1771
1772
  }
1772
1773
  )
1773
1774
  });
1774
- }, Wo = (o) => {
1775
+ }, zo = (o) => {
1775
1776
  const e = o.source;
1776
1777
  return e === void 0 ? f(void 0) : ({ drivers: t }) => ({
1777
1778
  type: "ScheduleComputable",
1778
1779
  computable: t.blobDriver.getDownloadedBlob(e)
1779
1780
  });
1780
- }, zo = (o) => {
1781
+ }, qo = (o) => {
1781
1782
  const e = o.source;
1782
1783
  return e === void 0 ? f(void 0) : ({ drivers: t }) => ({
1783
1784
  type: "ScheduleComputable",
1784
1785
  computable: t.blobDriver.getOnDemandBlob(e)
1785
1786
  });
1786
- }, qo = (o) => {
1787
+ }, Yo = (o) => {
1787
1788
  const e = o.source;
1788
1789
  return e === void 0 ? f(void 0) : ({ drivers: t }) => ({
1789
1790
  type: "ScheduleComputable",
1790
1791
  computable: t.uploadDriver.getProgressId(e)
1791
1792
  });
1792
- }, Yo = (o) => (e) => {
1793
+ }, Qo = (o) => (e) => {
1793
1794
  const t = e.source;
1794
1795
  return t === void 0 ? f(void 0) : ({ drivers: r }) => ({
1795
1796
  type: "ScheduleComputable",
1796
1797
  computable: r.logDriver.getLastLogs(t, o)
1797
1798
  });
1798
- }, Qo = (o) => (e) => {
1799
+ }, Zo = (o) => (e) => {
1799
1800
  const t = e.source;
1800
1801
  return t === void 0 ? f(void 0) : ({ drivers: r }) => ({
1801
1802
  type: "ScheduleComputable",
1802
1803
  computable: r.logDriver.getProgressLog(t, o)
1803
1804
  });
1804
- }, Zo = (o) => {
1805
+ }, Xo = (o) => {
1805
1806
  const e = o.source;
1806
1807
  return e === void 0 ? f(void 0) : ({ drivers: t }) => ({
1807
1808
  type: "ScheduleComputable",
@@ -1823,7 +1824,7 @@ function m(o, e) {
1823
1824
  case "GetJsonField":
1824
1825
  return () => ({
1825
1826
  type: "ScheduleSubroutine",
1826
- subroutine: Mo,
1827
+ subroutine: $o,
1827
1828
  args: {
1828
1829
  source: m(o, e.source),
1829
1830
  field: m(o, e.field)
@@ -1832,7 +1833,7 @@ function m(o, e) {
1832
1833
  case "MapArrayValues":
1833
1834
  return () => ({
1834
1835
  type: "ScheduleSubroutine",
1835
- subroutine: To(o, e),
1836
+ subroutine: Ao(o, e),
1836
1837
  args: {
1837
1838
  source: m(o, e.source)
1838
1839
  }
@@ -1840,7 +1841,7 @@ function m(o, e) {
1840
1841
  case "MapRecordValues":
1841
1842
  return () => ({
1842
1843
  type: "ScheduleSubroutine",
1843
- subroutine: Ao(o, e),
1844
+ subroutine: Io(o, e),
1844
1845
  args: {
1845
1846
  source: m(o, e.source)
1846
1847
  }
@@ -1848,8 +1849,8 @@ function m(o, e) {
1848
1849
  case "MakeObject":
1849
1850
  return () => ({
1850
1851
  type: "ScheduleSubroutine",
1851
- subroutine: xo,
1852
- args: Ro(e.template, (r) => m(o, r))
1852
+ subroutine: Eo,
1853
+ args: Oo(e.template, (r) => m(o, r))
1853
1854
  });
1854
1855
  case "MakeArray":
1855
1856
  return () => ({
@@ -1860,7 +1861,7 @@ function m(o, e) {
1860
1861
  case "Flatten":
1861
1862
  return () => ({
1862
1863
  type: "ScheduleSubroutine",
1863
- subroutine: Eo,
1864
+ subroutine: jo,
1864
1865
  args: {
1865
1866
  source: m(o, e.source)
1866
1867
  }
@@ -1868,7 +1869,7 @@ function m(o, e) {
1868
1869
  case "IsEmpty":
1869
1870
  return () => ({
1870
1871
  type: "ScheduleSubroutine",
1871
- subroutine: Vo,
1872
+ subroutine: No,
1872
1873
  args: {
1873
1874
  arg: m(o, e.arg)
1874
1875
  }
@@ -1876,7 +1877,7 @@ function m(o, e) {
1876
1877
  case "Not":
1877
1878
  return () => ({
1878
1879
  type: "ScheduleSubroutine",
1879
- subroutine: No,
1880
+ subroutine: Lo,
1880
1881
  args: {
1881
1882
  operand: m(o, e.operand)
1882
1883
  }
@@ -1884,7 +1885,7 @@ function m(o, e) {
1884
1885
  case "And":
1885
1886
  return () => ({
1886
1887
  type: "ScheduleSubroutine",
1887
- subroutine: Lo,
1888
+ subroutine: Jo,
1888
1889
  args: {
1889
1890
  operand1: m(o, e.operand1),
1890
1891
  operand2: m(o, e.operand2)
@@ -1893,7 +1894,7 @@ function m(o, e) {
1893
1894
  case "Or":
1894
1895
  return () => ({
1895
1896
  type: "ScheduleSubroutine",
1896
- subroutine: Jo,
1897
+ subroutine: Ko,
1897
1898
  args: {
1898
1899
  operand1: m(o, e.operand1),
1899
1900
  operand2: m(o, e.operand2)
@@ -1902,7 +1903,7 @@ function m(o, e) {
1902
1903
  case "MapResourceFields":
1903
1904
  return () => ({
1904
1905
  type: "ScheduleSubroutine",
1905
- subroutine: $o(o, e),
1906
+ subroutine: Uo(o, e),
1906
1907
  args: {
1907
1908
  source: m(o, e.source)
1908
1909
  }
@@ -1910,7 +1911,7 @@ function m(o, e) {
1910
1911
  case "GetResourceField":
1911
1912
  return () => ({
1912
1913
  type: "ScheduleSubroutine",
1913
- subroutine: jo,
1914
+ subroutine: To,
1914
1915
  args: {
1915
1916
  source: m(o, e.source),
1916
1917
  field: m(o, e.field)
@@ -1919,7 +1920,7 @@ function m(o, e) {
1919
1920
  case "GetResourceValueAsJson":
1920
1921
  return () => ({
1921
1922
  type: "ScheduleSubroutine",
1922
- subroutine: Ko,
1923
+ subroutine: Mo,
1923
1924
  args: {
1924
1925
  source: m(o, e.source)
1925
1926
  }
@@ -1927,7 +1928,7 @@ function m(o, e) {
1927
1928
  case "GetBlobContent":
1928
1929
  return () => ({
1929
1930
  type: "ScheduleSubroutine",
1930
- subroutine: Go,
1931
+ subroutine: Ho,
1931
1932
  args: {
1932
1933
  source: m(o, e.source)
1933
1934
  }
@@ -1935,7 +1936,7 @@ function m(o, e) {
1935
1936
  case "GetBlobContentAsString":
1936
1937
  return () => ({
1937
1938
  type: "ScheduleSubroutine",
1938
- subroutine: Ho,
1939
+ subroutine: _o,
1939
1940
  args: {
1940
1941
  source: m(o, e.source)
1941
1942
  }
@@ -1943,7 +1944,7 @@ function m(o, e) {
1943
1944
  case "GetBlobContentAsJson":
1944
1945
  return () => ({
1945
1946
  type: "ScheduleSubroutine",
1946
- subroutine: _o,
1947
+ subroutine: Wo,
1947
1948
  args: {
1948
1949
  source: m(o, e.source)
1949
1950
  }
@@ -1951,7 +1952,7 @@ function m(o, e) {
1951
1952
  case "GetDownloadedBlobContent":
1952
1953
  return () => ({
1953
1954
  type: "ScheduleSubroutine",
1954
- subroutine: Wo,
1955
+ subroutine: zo,
1955
1956
  args: {
1956
1957
  source: m(o, e.source)
1957
1958
  }
@@ -1959,7 +1960,7 @@ function m(o, e) {
1959
1960
  case "GetOnDemandBlobContent":
1960
1961
  return () => ({
1961
1962
  type: "ScheduleSubroutine",
1962
- subroutine: zo,
1963
+ subroutine: qo,
1963
1964
  args: {
1964
1965
  source: m(o, e.source)
1965
1966
  }
@@ -1967,7 +1968,7 @@ function m(o, e) {
1967
1968
  case "GetImportProgress":
1968
1969
  return () => ({
1969
1970
  type: "ScheduleSubroutine",
1970
- subroutine: qo,
1971
+ subroutine: Yo,
1971
1972
  args: {
1972
1973
  source: m(o, e.source)
1973
1974
  }
@@ -1975,7 +1976,7 @@ function m(o, e) {
1975
1976
  case "GetLastLogs":
1976
1977
  return () => ({
1977
1978
  type: "ScheduleSubroutine",
1978
- subroutine: Yo(e.lines),
1979
+ subroutine: Qo(e.lines),
1979
1980
  args: {
1980
1981
  source: m(o, e.source)
1981
1982
  }
@@ -1983,7 +1984,7 @@ function m(o, e) {
1983
1984
  case "GetProgressLog":
1984
1985
  return () => ({
1985
1986
  type: "ScheduleSubroutine",
1986
- subroutine: Qo(e.patternToSearch),
1987
+ subroutine: Zo(e.patternToSearch),
1987
1988
  args: {
1988
1989
  source: m(o, e.source)
1989
1990
  }
@@ -1991,7 +1992,7 @@ function m(o, e) {
1991
1992
  case "GetLogHandle":
1992
1993
  return () => ({
1993
1994
  type: "ScheduleSubroutine",
1994
- subroutine: Zo,
1995
+ subroutine: Xo,
1995
1996
  args: {
1996
1997
  source: m(o, e.source)
1997
1998
  }
@@ -2000,8 +2001,8 @@ function m(o, e) {
2000
2001
  return D(e);
2001
2002
  }
2002
2003
  }
2003
- const Xo = ["$prod", "$staging"];
2004
- function es(o) {
2004
+ const es = ["$prod", "$staging"];
2005
+ function ts(o) {
2005
2006
  return {
2006
2007
  $blockId: o.blockId,
2007
2008
  $args: JSON.parse(o.args),
@@ -2010,16 +2011,16 @@ function es(o) {
2010
2011
  $staging: o.staging
2011
2012
  };
2012
2013
  }
2013
- const Tt = Symbol(), At = "return", ts = { op: Tt, arg: At };
2014
- function rs(o) {
2014
+ const Tt = Symbol(), At = "return", rs = { op: Tt, arg: At };
2015
+ function os(o) {
2015
2016
  return o.op == Tt && o.arg == At;
2016
2017
  }
2017
- function os() {
2018
+ function ss() {
2018
2019
  return { pendingSubroutines: /* @__PURE__ */ new Map() };
2019
2020
  }
2020
2021
  function st(o, e, t, r) {
2021
2022
  const s = new ft(t), n = (a, u) => {
2022
- if (rs(a))
2023
+ if (os(a))
2023
2024
  return e.result = u, !1;
2024
2025
  const c = w(e.pendingSubroutines.get(a.op));
2025
2026
  if (a.arg in c.args) throw new Error("argument already set");
@@ -2070,23 +2071,23 @@ function st(o, e, t, r) {
2070
2071
  return i;
2071
2072
  }
2072
2073
  function It(o, e, t, r = {}) {
2073
- return Vt(o, es(e), t, r);
2074
+ return Vt(o, ts(e), t, r);
2074
2075
  }
2075
2076
  function Vt(o, e, t, r = {}) {
2076
2077
  const s = Ee({
2077
- ctx: Object.fromEntries(Object.entries(e).filter(([n]) => Xo.indexOf(n) === -1)),
2078
+ ctx: Object.fromEntries(Object.entries(e).filter(([n]) => es.indexOf(n) === -1)),
2078
2079
  cfg: t
2079
2080
  });
2080
2081
  return P.makeRaw(
2081
2082
  (n) => {
2082
- const i = { drivers: o, cCtx: n }, a = os();
2083
+ const i = { drivers: o, cCtx: n }, a = ss();
2083
2084
  return {
2084
2085
  ir: st(
2085
2086
  i,
2086
2087
  a,
2087
2088
  [
2088
2089
  {
2089
- destination: ts,
2090
+ destination: rs,
2090
2091
  operation: m(e, t)
2091
2092
  }
2092
2093
  ],
@@ -2117,7 +2118,7 @@ function Vt(o, e, t, r = {}) {
2117
2118
  { ...r, key: s }
2118
2119
  );
2119
2120
  }
2120
- function ss(o) {
2121
+ function ns(o) {
2121
2122
  return o instanceof ArrayBuffer || ArrayBuffer.isView(o);
2122
2123
  }
2123
2124
  function nt(o) {
@@ -2247,7 +2248,7 @@ class pe {
2247
2248
  parsePObjectCollection(e, t, r) {
2248
2249
  const s = this.getAccessor(e);
2249
2250
  if (!s.getIsReadyOrError()) return;
2250
- const n = Bo(s, t, r), i = {};
2251
+ const n = Ro(s, t, r), i = {};
2251
2252
  for (const [a, u] of Object.entries(n))
2252
2253
  i[a] = z(u, (c) => this.wrapAccessor(c));
2253
2254
  return i;
@@ -2452,7 +2453,7 @@ class pe {
2452
2453
  r = this.vm.null;
2453
2454
  break;
2454
2455
  }
2455
- if (ss(e)) {
2456
+ if (ns(e)) {
2456
2457
  r = this.vm.newArrayBuffer(e), s = !0;
2457
2458
  break;
2458
2459
  }
@@ -2554,7 +2555,7 @@ class pe {
2554
2555
  });
2555
2556
  }
2556
2557
  }
2557
- function ns(o, e, t, r, s = {}) {
2558
+ function is(o, e, t, r, s = {}) {
2558
2559
  return P.makeRaw((n) => {
2559
2560
  const i = new Se();
2560
2561
  n.addOnDestroy(() => i.dispose());
@@ -2575,10 +2576,10 @@ function ns(o, e, t, r, s = {}) {
2575
2576
  function De(o, e, t, r, s = {}) {
2576
2577
  if (ut(t)) {
2577
2578
  if (r === void 0) throw new Error("No code bundle.");
2578
- return ns(o, e, t, r, s);
2579
+ return is(o, e, t, r, s);
2579
2580
  } else return It(o.driverKit, e, t, s);
2580
2581
  }
2581
- function is(o, e, t) {
2582
+ function as(o, e, t) {
2582
2583
  return P.make(
2583
2584
  (r) => {
2584
2585
  var b, B, M, ee, te, $, H, re;
@@ -2708,7 +2709,7 @@ function Nt(o, e) {
2708
2709
  (s) => xe(s)
2709
2710
  );
2710
2711
  }
2711
- function as(o, e) {
2712
+ function cs(o, e) {
2712
2713
  const t = o.node();
2713
2714
  if (K(t.resourceType, kt)) {
2714
2715
  const r = t.getDataAsJson();
@@ -2725,10 +2726,10 @@ function as(o, e) {
2725
2726
  } else
2726
2727
  throw new Error(`Unsupported resource type: ${JSON.stringify(t.resourceType)}`);
2727
2728
  }
2728
- function cs(o, e) {
2729
+ function us(o, e) {
2729
2730
  if (o !== void 0)
2730
2731
  return P.make(
2731
- (t) => as(t.accessor(o), e),
2732
+ (t) => cs(t.accessor(o), e),
2732
2733
  {
2733
2734
  postprocessValue: (t) => {
2734
2735
  if (t !== void 0) {
@@ -2740,7 +2741,7 @@ function cs(o, e) {
2740
2741
  }
2741
2742
  ).withStableType();
2742
2743
  }
2743
- function us(o, e, t) {
2744
+ function ls(o, e, t) {
2744
2745
  return P.make(
2745
2746
  (r) => {
2746
2747
  var a;
@@ -2752,12 +2753,12 @@ function us(o, e, t) {
2752
2753
  { field: y.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 },
2753
2754
  { field: Ft, assertFieldType: "Input" }
2754
2755
  )) == null ? void 0 : a.persist();
2755
- return { path: cs(i, t), sdkVersion: n == null ? void 0 : n.sdkVersion };
2756
+ return { path: us(i, t), sdkVersion: n == null ? void 0 : n.sdkVersion };
2756
2757
  },
2757
2758
  { mode: "StableOnlyLive" }
2758
2759
  );
2759
2760
  }
2760
- function ls(o, e, t) {
2761
+ function ds(o, e, t) {
2761
2762
  return P.make(
2762
2763
  (r) => {
2763
2764
  const s = r.accessor(o).node(), n = Le(s, e);
@@ -2770,7 +2771,7 @@ function ls(o, e, t) {
2770
2771
  { key: "inputs#" + pt(o.rid) + e }
2771
2772
  );
2772
2773
  }
2773
- function ds(o, e, t) {
2774
+ function ps(o, e, t) {
2774
2775
  return P.make(
2775
2776
  (r) => {
2776
2777
  const s = r.accessor(o).node(), n = xt(s, e), i = Nt(s, e);
@@ -2786,7 +2787,7 @@ function ds(o, e, t) {
2786
2787
  { key: "outputs#" + pt(o.rid) + e }
2787
2788
  ).withStableType();
2788
2789
  }
2789
- function ps(o, e) {
2790
+ function hs(o, e) {
2790
2791
  return P.make((t) => {
2791
2792
  const r = t.accessor(o).node(), s = w(r.getKeyValueAsJson(G)), n = [];
2792
2793
  for (const { id: i, renderingMode: a } of V(s)) {
@@ -2799,7 +2800,7 @@ function ps(o, e) {
2799
2800
  { field: y.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 }
2800
2801
  ), c = u == null ? void 0 : u.getDataAsJson();
2801
2802
  if ((c == null ? void 0 : c.config) === void 0) continue;
2802
- const l = xe(c.config), p = Object.entries(l.outputs).map(([, g]) => g).filter((g) => !ut(g) && Do(g)).map((g) => g);
2803
+ const l = xe(c.config), p = Object.entries(l.outputs).map(([, g]) => g).filter((g) => !ut(g) && xo(g)).map((g) => g);
2803
2804
  if (p.length === 0) continue;
2804
2805
  const h = xt(r, i);
2805
2806
  for (const g of p)
@@ -2808,7 +2809,7 @@ function ps(o, e) {
2808
2809
  return n;
2809
2810
  });
2810
2811
  }
2811
- class hs {
2812
+ class fs {
2812
2813
  constructor() {
2813
2814
  d(this, "states", /* @__PURE__ */ new Map());
2814
2815
  }
@@ -2841,18 +2842,18 @@ class Je {
2841
2842
  d(this, "rid");
2842
2843
  /** Data for the left panel, contain basic information about block status. */
2843
2844
  d(this, "overview");
2844
- d(this, "navigationStates", new hs());
2845
+ d(this, "navigationStates", new fs());
2845
2846
  d(this, "blockComputables", /* @__PURE__ */ new Map());
2846
2847
  d(this, "blockFrontends", /* @__PURE__ */ new Map());
2847
2848
  d(this, "activeConfigs");
2848
2849
  d(this, "refreshLoopResult");
2849
2850
  d(this, "abortController", new AbortController());
2850
2851
  d(this, "destroyed", !1);
2851
- this.env = e, this.projectTree = r, this.overview = is(
2852
+ this.env = e, this.projectTree = r, this.overview = as(
2852
2853
  r.entry(),
2853
2854
  this.navigationStates,
2854
2855
  e
2855
- ).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs = ps(r.entry(), e);
2856
+ ).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs = hs(r.entry(), e);
2856
2857
  }
2857
2858
  async refreshLoop() {
2858
2859
  for (; !this.destroyed; )
@@ -3038,10 +3039,10 @@ class Je {
3038
3039
  getBlockComputables(e) {
3039
3040
  const t = this.blockComputables.get(e);
3040
3041
  if (t === void 0) {
3041
- const r = ds(this.projectTree.entry(), e, this.env), n = {
3042
+ const r = ps(this.projectTree.entry(), e, this.env), n = {
3042
3043
  fullState: P.make(
3043
3044
  (i) => ({
3044
- argsAndUiState: ls(this.projectTree.entry(), e),
3045
+ argsAndUiState: ds(this.projectTree.entry(), e),
3045
3046
  outputs: r,
3046
3047
  navigationState: this.navigationStates.getState(e)
3047
3048
  }),
@@ -3072,7 +3073,7 @@ class Je {
3072
3073
  getBlockFrontend(e) {
3073
3074
  const t = this.blockFrontends.get(e);
3074
3075
  if (t === void 0) {
3075
- const r = us(
3076
+ const r = ls(
3076
3077
  this.projectTree.entry(),
3077
3078
  e,
3078
3079
  this.env
@@ -3115,7 +3116,7 @@ const Lt = {
3115
3116
  pollingInterval: 1e3,
3116
3117
  stopPollingDelay: 1e3
3117
3118
  }
3118
- }, fs = {
3119
+ }, gs = {
3119
3120
  ...Lt,
3120
3121
  defaultTreeOptions: {
3121
3122
  pollingInterval: 350,
@@ -3124,12 +3125,12 @@ const Lt = {
3124
3125
  devBlockUpdateRecheckInterval: 1e3,
3125
3126
  projectRefreshInterval: 700,
3126
3127
  stagingRenderingRate: 5
3127
- }, gs = {
3128
+ }, ms = {
3128
3129
  minDelay: 1500
3129
- }, ms = "__no_updates__";
3130
- class vs extends rr {
3130
+ }, vs = "__no_updates__";
3131
+ class ys extends rr {
3131
3132
  constructor(t = {}) {
3132
- super({ ...t, ...gs });
3133
+ super({ ...t, ...ms });
3133
3134
  d(this, "http");
3134
3135
  this.http = t.http;
3135
3136
  }
@@ -3141,7 +3142,7 @@ class vs extends rr {
3141
3142
  case "dev-v2":
3142
3143
  return `dev_2_${t.folder}_${t.mtime}`;
3143
3144
  default:
3144
- return ms;
3145
+ return vs;
3145
3146
  }
3146
3147
  }
3147
3148
  async readValue(t) {
@@ -3208,14 +3209,12 @@ class it {
3208
3209
  return (t = this.resources.get(e)) == null ? void 0 : t.resource;
3209
3210
  }
3210
3211
  }
3211
- const ys = require("@milaboratories/pframes-node");
3212
3212
  function at(o) {
3213
3213
  return String(o.id);
3214
3214
  }
3215
3215
  class bs {
3216
3216
  constructor(e, t) {
3217
- // @ts-expect-error Dima Bolotin
3218
- d(this, "pFrame", new ys.PFrame());
3217
+ d(this, "pFrame", new br());
3219
3218
  d(this, "blobIdToResource", /* @__PURE__ */ new Map());
3220
3219
  d(this, "blobHandleComputables", /* @__PURE__ */ new Map());
3221
3220
  d(this, "preloadBlob", async (e) => {
@@ -3228,8 +3227,8 @@ class bs {
3228
3227
  });
3229
3228
  this.blobDriver = e, this.columns = t, this.pFrame.setDataSource(this);
3230
3229
  for (const r of t) {
3231
- for (const n of yo(r.data)) this.blobIdToResource.set(at(n), n);
3232
- const s = bo(r.data, at);
3230
+ for (const n of bo(r.data)) this.blobIdToResource.set(at(n), n);
3231
+ const s = wo(r.data, at);
3233
3232
  try {
3234
3233
  this.pFrame.addColumnSpec(r.id, r.spec), this.pFrame.setColumnData(r.id, s);
3235
3234
  } catch (n) {
@@ -3285,7 +3284,7 @@ class ws {
3285
3284
  // Internal / Config API Methods
3286
3285
  //
3287
3286
  createPFrame(e, t) {
3288
- const r = e.map((n) => z(n, (i) => Fo(i))), s = this.pFrames.acquire(r);
3287
+ const r = e.map((n) => z(n, (i) => Bo(i))), s = this.pFrames.acquire(r);
3289
3288
  return t.addOnDestroy(s.unref), s.key;
3290
3289
  }
3291
3290
  createPTable(e, t) {
@@ -3456,7 +3455,7 @@ class Jt {
3456
3455
  /** Creates a project with initial state and adds it to project list. */
3457
3456
  async createProject(e, t = Y()) {
3458
3457
  const r = await this.pl.withWriteTx("MLCreateProject", async (s) => {
3459
- const n = await vo(s, e);
3458
+ const n = await yo(s, e);
3460
3459
  return s.createField(S(this.projectListResourceId, t), "Dynamic", n), await s.commit(), await er(n);
3461
3460
  });
3462
3461
  return await this.projectListTree.refreshState(), r;
@@ -3520,8 +3519,8 @@ class Jt {
3520
3519
  }
3521
3520
  /** Initialize middle layer */
3522
3521
  static async init(e, t) {
3523
- const r = { ...fs, ...t }, s = await e.withWriteTx("MLInitialization", async (h) => {
3524
- const g = S(h.clientRoot, Lr);
3522
+ const r = { ...gs, ...t }, s = await e.withWriteTx("MLInitialization", async (h) => {
3523
+ const g = S(h.clientRoot, Jr);
3525
3524
  h.createField(g, "Dynamic");
3526
3525
  const b = await h.getField(g);
3527
3526
  if (ce(b.value)) {
@@ -3529,7 +3528,7 @@ class Jt {
3529
3528
  return h.lock(B), h.setField(g, B), await h.commit(), await B.globalId;
3530
3529
  } else
3531
3530
  return b.value;
3532
- }), n = new _t(console), i = await Ps(e, n, r), a = new uo(i.signer), u = new yr(
3531
+ }), n = new _t(console), i = await Ps(e, n, r), a = new lo(i.signer), u = new yr(
3533
3532
  n,
3534
3533
  e.httpDispatcher,
3535
3534
  r.frontendDownloadPath
@@ -3540,12 +3539,12 @@ class Jt {
3540
3539
  bpPreparer: a,
3541
3540
  frontendDownloadDriver: u,
3542
3541
  driverKit: i,
3543
- blockUpdateWatcher: new vs({
3542
+ blockUpdateWatcher: new ys({
3544
3543
  minDelay: r.devBlockUpdateRecheckInterval,
3545
3544
  http: e.httpDispatcher
3546
3545
  }),
3547
3546
  quickJs: await ir()
3548
- }, l = new or([]), p = await Kr(e, s, l, c);
3547
+ }, l = new or([]), p = await Mr(e, s, l, c);
3549
3548
  return new Jt(
3550
3549
  c,
3551
3550
  i,
@@ -3558,28 +3557,28 @@ class Jt {
3558
3557
  }
3559
3558
  }
3560
3559
  export {
3561
- Hs as BlockPackRegistry,
3562
- Ws as CentralDevSnapshotRegistry,
3563
- _s as CentralRegistry,
3560
+ _s as BlockPackRegistry,
3561
+ zs as CentralDevSnapshotRegistry,
3562
+ Ws as CentralRegistry,
3564
3563
  Lt as DefaultDriverKitOps,
3565
- fs as DefaultMiddleLayerOps,
3564
+ gs as DefaultMiddleLayerOps,
3566
3565
  Ct as FrontendFromFolderResourceType,
3567
3566
  kt as FrontendFromUrlResourceType,
3568
3567
  Jt as MiddleLayer,
3569
3568
  Je as Project,
3570
- Yr as TengoTemplateGet,
3571
- Qr as TengoTemplateGetRegistry,
3572
- Xr as TengoTemplateGetTemplate,
3573
- Zr as TengoTemplateGetTemplateURI,
3574
- eo as TengoTemplatePack,
3575
- to as TengoTemplatePackConvert,
3576
- oo as TengoTemplatePackConvertTemplate,
3577
- ro as TengoTemplatePackConvertTemplatePack,
3569
+ Qr as TengoTemplateGet,
3570
+ Zr as TengoTemplateGetRegistry,
3571
+ eo as TengoTemplateGetTemplate,
3572
+ Xr as TengoTemplateGetTemplateURI,
3573
+ to as TengoTemplatePack,
3574
+ ro as TengoTemplatePackConvert,
3575
+ so as TengoTemplatePackConvertTemplate,
3576
+ oo as TengoTemplatePackConvertTemplatePack,
3578
3577
  St as createRenderTemplate,
3579
3578
  vt as getDevV1PacketMtime,
3580
3579
  Ae as getDevV2PacketMtime,
3581
3580
  Ps as initDriverKit,
3582
3581
  Ve as loadTemplate,
3583
- so as prepareTemplateSpec
3582
+ no as prepareTemplateSpec
3584
3583
  };
3585
3584
  //# sourceMappingURL=index.mjs.map