@platforma-sdk/model 1.13.0 → 1.13.5

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,252 +1,252 @@
1
- var ct = Object.defineProperty;
2
- var dt = (e, t, n) => t in e ? ct(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var _ = (e, t, n) => dt(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { isPColumn as W, mapPObjectData as L, mapValueInVOE as pt, ensurePColumn as ft, isPColumnSpec as ht, mapPTableDef as gt, getAxisId as J, matchAxisId as mt } from "@milaboratories/pl-model-common";
1
+ var ce = Object.defineProperty;
2
+ var de = (t, e, n) => e in t ? ce(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var v = (t, e, n) => de(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { isPColumn as W, mapPObjectData as L, mapValueInVOE as pe, ensurePColumn as fe, isPColumnSpec as he, mapPTableDef as ge, getAxisId as J, matchAxisId as me } from "@milaboratories/pl-model-common";
5
5
  export * from "@milaboratories/pl-model-common";
6
6
  import { z as P } from "zod";
7
- class yt extends Error {
8
- constructor(t, n) {
9
- super(`${t.length}${n ? "+" : ""} errors, first error: ` + t[0]), this.errors = t, this.moreErrors = n;
7
+ class ye extends Error {
8
+ constructor(e, n) {
9
+ super(`${e.length}${n ? "+" : ""} errors, first error: ` + e[0]), this.errors = e, this.moreErrors = n;
10
10
  }
11
11
  }
12
- function bt(e) {
13
- if (!e.ok) throw new yt(e.errors, e.moreErrors);
14
- return e.value;
12
+ function be(t) {
13
+ if (!t.ok) throw new ye(t.errors, t.moreErrors);
14
+ return t.value;
15
15
  }
16
- function jt(e) {
17
- return new Proxy(e, {
18
- get(t, n) {
19
- return bt(t[n]);
16
+ function je(t) {
17
+ return new Proxy(t, {
18
+ get(e, n) {
19
+ return be(e[n]);
20
20
  }
21
21
  });
22
22
  }
23
- function p(e) {
24
- return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null ? k(e) : e;
23
+ function p(t) {
24
+ return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ? k(t) : t;
25
25
  }
26
- function T(e) {
27
- return { type: "GetFromCtx", variable: e };
26
+ function R(t) {
27
+ return { type: "GetFromCtx", variable: t };
28
28
  }
29
- function Nt(e) {
29
+ function Ne(t) {
30
30
  return {
31
31
  type: "Isolate",
32
- cfg: e
32
+ cfg: t
33
33
  };
34
34
  }
35
- const Mt = T("$args"), Bt = T("$it"), Ut = T("$prod"), Jt = T("$staging"), $t = T("$ui");
36
- function k(e) {
37
- return { type: "Immediate", value: e };
35
+ const Me = R("$args"), Be = R("$it"), Ue = R("$prod"), Je = R("$staging"), $e = R("$ui");
36
+ function k(t) {
37
+ return { type: "Immediate", value: t };
38
38
  }
39
- function nt(e) {
40
- const t = {};
41
- for (const [n, r] of Object.entries(e)) t[n] = p(r);
39
+ function ne(t) {
40
+ const e = {};
41
+ for (const [n, r] of Object.entries(t)) e[n] = p(r);
42
42
  return {
43
43
  type: "MakeObject",
44
- template: t
44
+ template: e
45
45
  };
46
46
  }
47
- function Kt(...e) {
48
- const t = [];
49
- for (const n of e) t.push(p(n));
47
+ function Ke(...t) {
48
+ const e = [];
49
+ for (const n of t) e.push(p(n));
50
50
  return {
51
51
  type: "MakeArray",
52
- template: t
52
+ template: e
53
53
  };
54
54
  }
55
- function x(e, t) {
55
+ function x(t, e) {
56
56
  return {
57
57
  type: "GetJsonField",
58
- source: p(e),
59
- field: p(t)
58
+ source: p(t),
59
+ field: p(e)
60
60
  };
61
61
  }
62
- function Gt(e, t, n = "$it") {
62
+ function Ge(t, e, n = "$it") {
63
63
  return {
64
64
  type: "MapRecordValues",
65
- source: e,
66
- mapping: t,
65
+ source: t,
66
+ mapping: e,
67
67
  itVar: n
68
68
  };
69
69
  }
70
- function Ht(e, t, n = "$it") {
70
+ function He(t, e, n = "$it") {
71
71
  return {
72
72
  type: "MapArrayValues",
73
- source: e,
74
- mapping: t,
73
+ source: t,
74
+ mapping: e,
75
75
  itVar: n
76
76
  };
77
77
  }
78
- function Wt(e) {
78
+ function We(t) {
79
79
  return {
80
80
  type: "Flatten",
81
- source: e
81
+ source: t
82
82
  };
83
83
  }
84
- function qt(e) {
84
+ function qe(t) {
85
85
  return {
86
86
  type: "IsEmpty",
87
- arg: e
87
+ arg: t
88
88
  };
89
89
  }
90
- function zt(e) {
90
+ function ze(t) {
91
91
  return {
92
92
  type: "Not",
93
- operand: e
93
+ operand: t
94
94
  };
95
95
  }
96
- function Yt(e, t) {
96
+ function Ye(t, e) {
97
97
  return {
98
98
  type: "And",
99
- operand1: e,
100
- operand2: t
99
+ operand1: t,
100
+ operand2: e
101
101
  };
102
102
  }
103
- function Xt(e, t) {
103
+ function Xe(t, e) {
104
104
  return {
105
105
  type: "Or",
106
- operand1: e,
107
- operand2: t
106
+ operand1: t,
107
+ operand2: e
108
108
  };
109
109
  }
110
- function Qt(e, t) {
110
+ function Qe(t, e) {
111
111
  return {
112
112
  type: "GetResourceField",
113
- source: p(e),
114
- field: p(t)
113
+ source: p(t),
114
+ field: p(e)
115
115
  };
116
116
  }
117
- function Zt() {
118
- return function(e) {
117
+ function Ze() {
118
+ return function(t) {
119
119
  return {
120
120
  type: "GetResourceValueAsJson",
121
- source: p(e)
121
+ source: p(t)
122
122
  };
123
123
  };
124
124
  }
125
- function te(e, t, n = "$it") {
125
+ function et(t, e, n = "$it") {
126
126
  return {
127
127
  type: "MapResourceFields",
128
- source: e,
129
- mapping: t,
128
+ source: t,
129
+ mapping: e,
130
130
  itVar: n
131
131
  };
132
132
  }
133
- function ee(e) {
133
+ function tt(t) {
134
134
  return {
135
135
  type: "GetBlobContent",
136
- source: p(e)
136
+ source: p(t)
137
137
  };
138
138
  }
139
- function ne(e) {
139
+ function nt(t) {
140
140
  return {
141
141
  type: "GetBlobContentAsString",
142
- source: p(e)
142
+ source: p(t)
143
143
  };
144
144
  }
145
- function re() {
146
- return function(e) {
145
+ function rt() {
146
+ return function(t) {
147
147
  return {
148
148
  type: "GetBlobContentAsJson",
149
- source: p(e)
149
+ source: p(t)
150
150
  };
151
151
  };
152
152
  }
153
- function se(e) {
153
+ function st(t) {
154
154
  return {
155
155
  type: "GetDownloadedBlobContent",
156
- source: p(e)
156
+ source: p(t)
157
157
  };
158
158
  }
159
- function ie(e) {
159
+ function it(t) {
160
160
  return {
161
161
  type: "GetOnDemandBlobContent",
162
- source: p(e)
162
+ source: p(t)
163
163
  };
164
164
  }
165
- function oe(e) {
165
+ function ot(t) {
166
166
  return {
167
167
  type: "GetImportProgress",
168
- source: p(e)
168
+ source: p(t)
169
169
  };
170
170
  }
171
- function ae(e, t) {
171
+ function at(t, e) {
172
172
  return {
173
173
  type: "GetLastLogs",
174
- source: p(e),
175
- lines: t
174
+ source: p(t),
175
+ lines: e
176
176
  };
177
177
  }
178
- function le(e, t) {
178
+ function lt(t, e) {
179
179
  return {
180
180
  type: "GetProgressLog",
181
- source: p(e),
182
- patternToSearch: t
181
+ source: p(t),
182
+ patternToSearch: e
183
183
  };
184
184
  }
185
- function ue(e) {
185
+ function ut(t) {
186
186
  return {
187
187
  type: "GetLogHandle",
188
- source: p(e)
188
+ source: p(t)
189
189
  };
190
190
  }
191
- function _t() {
191
+ function _e() {
192
192
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
193
193
  }
194
- function rt(e) {
195
- if (e && typeof globalThis.getPlatforma == "function")
196
- return globalThis.getPlatforma(e);
194
+ function re(t) {
195
+ if (t && typeof globalThis.getPlatforma == "function")
196
+ return globalThis.getPlatforma(t);
197
197
  if (typeof globalThis.platforma < "u") return globalThis.platforma;
198
198
  throw new Error("Can't get platforma instance.");
199
199
  }
200
- function vt() {
200
+ function ve() {
201
201
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
202
202
  }
203
203
  function u() {
204
204
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
205
205
  throw new Error("Not in config rendering context");
206
206
  }
207
- function O(e, t) {
208
- const n = vt();
207
+ function O(t, e) {
208
+ const n = ve();
209
209
  if (n === void 0) return !1;
210
- if (e in n.callbackRegistry) throw new Error(`Callback with key ${e} already registered.`);
211
- return n.callbackRegistry[e] = t, !0;
210
+ if (t in n.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
211
+ return n.callbackRegistry[t] = e, !0;
212
212
  }
213
213
  const N = /* @__PURE__ */ new Map();
214
- function wt(e, t) {
215
- e in u().callbackRegistry || (u().callbackRegistry[e] = (n) => {
216
- for (const r of N.get(e))
214
+ function we(t, e) {
215
+ t in u().callbackRegistry || (u().callbackRegistry[t] = (n) => {
216
+ for (const r of N.get(t))
217
217
  r(n);
218
- }, N.set(e, [])), N.get(e).push(t);
218
+ }, N.set(t, [])), N.get(t).push(e);
219
219
  }
220
220
  class g {
221
- constructor(t, n = (r) => r) {
222
- _(this, "isResolved", !1);
223
- _(this, "resolvedValue");
224
- this.handle = t, this.postProcess = n, wt(t, (r) => {
221
+ constructor(e, n = (r) => r) {
222
+ v(this, "isResolved", !1);
223
+ v(this, "resolvedValue");
224
+ this.handle = e, this.postProcess = n, we(e, (r) => {
225
225
  this.resolvedValue = n(r), this.isResolved = !0;
226
226
  });
227
227
  }
228
- map(t) {
229
- return new g(this.handle, (n) => t(this.postProcess(n)));
228
+ map(e) {
229
+ return new g(this.handle, (n) => e(this.postProcess(n)));
230
230
  }
231
- mapDefined(t) {
231
+ mapDefined(e) {
232
232
  return new g(this.handle, (n) => {
233
233
  const r = this.postProcess(n);
234
- return r ? t(r) : void 0;
234
+ return r ? e(r) : void 0;
235
235
  });
236
236
  }
237
237
  toJSON() {
238
238
  return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
239
239
  }
240
240
  }
241
- function X(e) {
242
- return e === void 0 ? void 0 : new w(e);
241
+ function X(t) {
242
+ return t === void 0 ? void 0 : new S(t);
243
243
  }
244
- class w {
245
- constructor(t) {
246
- this.handle = t;
244
+ class S {
245
+ constructor(e) {
246
+ this.handle = e;
247
247
  }
248
- resolve(...t) {
249
- const n = t.map(
248
+ resolve(...e) {
249
+ const n = e.map(
250
250
  (r) => ({
251
251
  assertFieldType: "Input",
252
252
  ...typeof r == "string" ? { field: r } : r
@@ -254,8 +254,8 @@ class w {
254
254
  );
255
255
  return this.resolveWithCommon({}, ...n);
256
256
  }
257
- resolveOutput(...t) {
258
- const n = t.map(
257
+ resolveOutput(...e) {
258
+ const n = e.map(
259
259
  (r) => ({
260
260
  assertFieldType: "Output",
261
261
  ...typeof r == "string" ? { field: r } : r
@@ -263,8 +263,8 @@ class w {
263
263
  );
264
264
  return this.resolveWithCommon({}, ...n);
265
265
  }
266
- resolveInput(...t) {
267
- const n = t.map(
266
+ resolveInput(...e) {
267
+ const n = e.map(
268
268
  (r) => ({
269
269
  assertFieldType: "Input",
270
270
  ...typeof r == "string" ? { field: r } : r
@@ -272,11 +272,11 @@ class w {
272
272
  );
273
273
  return this.resolveWithCommon({}, ...n);
274
274
  }
275
- resolveAny(...t) {
276
- return this.resolveWithCommon({}, ...t);
275
+ resolveAny(...e) {
276
+ return this.resolveWithCommon({}, ...e);
277
277
  }
278
- resolveWithCommon(t, ...n) {
279
- return X(u().resolveWithCommon(this.handle, t, ...n));
278
+ resolveWithCommon(e, ...n) {
279
+ return X(u().resolveWithCommon(this.handle, e, ...n));
280
280
  }
281
281
  get resourceType() {
282
282
  return u().getResourceType(this.handle);
@@ -305,14 +305,14 @@ class w {
305
305
  listDynamicFields() {
306
306
  return u().listDynamicFields(this.handle);
307
307
  }
308
- getKeyValueBase64(t) {
309
- return u().getKeyValueBase64(this.handle, t);
308
+ getKeyValueBase64(e) {
309
+ return u().getKeyValueBase64(this.handle, e);
310
310
  }
311
- getKeyValueAsString(t) {
312
- return u().getKeyValueAsString(this.handle, t);
311
+ getKeyValueAsString(e) {
312
+ return u().getKeyValueAsString(this.handle, e);
313
313
  }
314
- getKeyValueAsJson(t) {
315
- const n = this.getKeyValueAsString(t);
314
+ getKeyValueAsJson(e) {
315
+ const n = this.getKeyValueAsString(e);
316
316
  if (n == null) throw new Error("Resource has no content.");
317
317
  return JSON.parse(n);
318
318
  }
@@ -323,15 +323,15 @@ class w {
323
323
  return u().getDataAsString(this.handle);
324
324
  }
325
325
  getDataAsJson() {
326
- const t = this.getDataAsString();
327
- if (t == null) throw new Error("Resource has no content.");
328
- return JSON.parse(t);
326
+ const e = this.getDataAsString();
327
+ if (e == null) throw new Error("Resource has no content.");
328
+ return JSON.parse(e);
329
329
  }
330
330
  /**
331
331
  *
332
332
  */
333
- getPColumns(t = !1, n = "") {
334
- const r = this.parsePObjectCollection(t, n);
333
+ getPColumns(e = !1, n = "") {
334
+ const r = this.parsePObjectCollection(e, n);
335
335
  return r === void 0 ? void 0 : Object.entries(r).map(([, i]) => {
336
336
  if (!W(i)) throw new Error(`not a PColumn (kind = ${i.spec.kind})`);
337
337
  return i;
@@ -340,16 +340,16 @@ class w {
340
340
  /**
341
341
  *
342
342
  */
343
- parsePObjectCollection(t = !1, n = "") {
343
+ parsePObjectCollection(e = !1, n = "") {
344
344
  const r = u().parsePObjectCollection(
345
345
  this.handle,
346
- t,
346
+ e,
347
347
  n
348
348
  );
349
349
  if (r === void 0) return;
350
350
  const s = {};
351
351
  for (const [i, o] of Object.entries(r))
352
- s[i] = L(o, (a) => new w(a));
352
+ s[i] = L(o, (a) => new S(a));
353
353
  return s;
354
354
  }
355
355
  getFileContentAsBase64() {
@@ -361,7 +361,7 @@ class w {
361
361
  getFileContentAsJson() {
362
362
  return new g(
363
363
  u().getBlobContentAsString(this.handle)
364
- ).mapDefined((t) => JSON.parse(t));
364
+ ).mapDefined((e) => JSON.parse(e));
365
365
  }
366
366
  /**
367
367
  * @deprecated use getFileContentAsBase64
@@ -402,17 +402,17 @@ class w {
402
402
  getImportProgress() {
403
403
  return new g(u().getImportProgress(this.handle));
404
404
  }
405
- getLastLogs(t) {
406
- return new g(u().getLastLogs(this.handle, t));
405
+ getLastLogs(e) {
406
+ return new g(u().getLastLogs(this.handle, e));
407
407
  }
408
- getProgressLog(t) {
409
- return new g(u().getProgressLog(this.handle, t));
408
+ getProgressLog(e) {
409
+ return new g(u().getProgressLog(this.handle, e));
410
410
  }
411
411
  getLogHandle() {
412
412
  return new g(u().getLogHandle(this.handle));
413
413
  }
414
- allFieldsResolved(t = "Input") {
415
- switch (t) {
414
+ allFieldsResolved(e = "Input") {
415
+ switch (e) {
416
416
  case "Input":
417
417
  return this.getInputsLocked() && this.listInputFields().every(
418
418
  (n) => this.resolve({ field: n, assertFieldType: "Input" }) !== void 0
@@ -423,13 +423,13 @@ class w {
423
423
  );
424
424
  }
425
425
  }
426
- mapFields(t, n) {
426
+ mapFields(e, n) {
427
427
  const { fieldType: r, requireLocked: s, skipUnresolved: i } = {
428
428
  fieldType: "Input",
429
429
  requireLocked: !0,
430
430
  skipUnresolved: !1,
431
431
  ...n
432
- }, o = t;
432
+ }, o = e;
433
433
  if (s && (r === "Input" && !this.getInputsLocked() || r === "Output" && !this.getOutputsLocked()))
434
434
  return;
435
435
  let l = (r === "Input" ? this.listInputFields() : r === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
@@ -438,64 +438,67 @@ class w {
438
438
  return i && (l = l.filter((c) => c[1] !== void 0)), l.map(([c, f]) => o(c, f));
439
439
  }
440
440
  }
441
- const st = "staging", it = "main";
442
- function ot(e) {
443
- return typeof e == "object" && e !== null && "__awaited_futures__" in e;
441
+ const se = "staging", ie = "main";
442
+ function oe(t) {
443
+ return typeof t == "object" && t !== null && "__awaited_futures__" in t;
444
444
  }
445
- function $(e, t, n) {
446
- if (t.has(n)) return;
447
- if (t.add(n), typeof n === "object")
448
- if (ot(n)) n.__awaited_futures__.forEach((s) => e.add(s));
445
+ function $(t, e, n) {
446
+ if (e.has(n)) return;
447
+ if (e.add(n), typeof n === "object")
448
+ if (oe(n)) n.__awaited_futures__.forEach((s) => t.add(s));
449
449
  else if (Array.isArray(n))
450
- for (const s of n) $(e, t, s);
450
+ for (const s of n) $(t, e, s);
451
451
  else
452
452
  for (const [, s] of Object.entries(n))
453
- s !== n && $(e, t, s);
453
+ s !== n && $(t, e, s);
454
454
  }
455
- function St(e) {
456
- const t = /* @__PURE__ */ new Set();
457
- return $(t, /* @__PURE__ */ new Set(), e), t;
455
+ function Se(t) {
456
+ const e = /* @__PURE__ */ new Set();
457
+ return $(e, /* @__PURE__ */ new Set(), t), e;
458
458
  }
459
- const ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
459
+ const ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
460
460
  __proto__: null,
461
- MainAccessorName: it,
462
- StagingAccessorName: st,
463
- getAllFutureAwaits: St,
464
- isFutureAwait: ot
465
- }, Symbol.toStringTag, { value: "Module" })), At = "pl7.app/label", Pt = "pl7.app/trace", It = P.object({
461
+ MainAccessorName: ie,
462
+ StagingAccessorName: se,
463
+ getAllFutureAwaits: Se,
464
+ isFutureAwait: oe
465
+ }, Symbol.toStringTag, { value: "Module" })), Ae = "pl7.app/label", Pe = "pl7.app/trace", Ie = P.object({
466
466
  type: P.string(),
467
467
  importance: P.number().optional(),
468
468
  id: P.string().optional(),
469
469
  label: P.string()
470
- }), Ct = P.array(It), Tt = 1e-3, Rt = "__LABEL__", Q = "__LABEL__@1";
471
- function Ft(e, t, n = {}) {
472
- const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i = e.map((d) => {
470
+ }), Ce = P.array(Ie), Re = 1e-3, Te = "__LABEL__", Q = "__LABEL__@1";
471
+ function Fe(t, e, n = {}) {
472
+ const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i = t.map((d) => {
473
473
  var z, Y;
474
- const m = t(d), y = (z = m.annotations) == null ? void 0 : z[At], F = (Y = m.annotations) == null ? void 0 : Y[Pt], b = (F ? Ct.safeParse(JSON.parse(F)).data : void 0) ?? [];
475
- y && b.splice(0, 0, { label: y, type: Rt, importance: -2 });
476
- const V = [], q = /* @__PURE__ */ new Map();
477
- for (let S = b.length - 1; S >= 0; --S) {
478
- const { type: E } = b[S], ut = b[S].importance ?? 0, j = (q.get(E) ?? 0) + 1;
479
- q.set(E, j);
480
- const I = `${E}@${j}`;
474
+ const m = e(d), y = (z = m.annotations) == null ? void 0 : z[Ae], F = (Y = m.annotations) == null ? void 0 : Y[Pe], b = (F ? Ce.safeParse(JSON.parse(F)).data : void 0) ?? [];
475
+ if (y) {
476
+ const _ = { label: y, type: Te, importance: -2 };
477
+ n.addLabelAsSuffix ? b.push(_) : b.splice(0, 0, _);
478
+ }
479
+ const E = [], q = /* @__PURE__ */ new Map();
480
+ for (let _ = b.length - 1; _ >= 0; --_) {
481
+ const { type: V } = b[_], ue = b[_].importance ?? 0, j = (q.get(V) ?? 0) + 1;
482
+ q.set(V, j);
483
+ const I = `${V}@${j}`;
481
484
  s.set(I, (s.get(I) ?? 0) + 1), r.set(
482
485
  I,
483
486
  Math.max(
484
487
  r.get(I) ?? Number.NEGATIVE_INFINITY,
485
- ut - (b.length - S) * Tt
488
+ ue - (b.length - _) * Re
486
489
  )
487
- ), V.push({ ...b[S], fullType: I, occurenceIndex: j });
490
+ ), E.push({ ...b[_], fullType: I, occurenceIndex: j });
488
491
  }
489
- return V.reverse(), {
492
+ return E.reverse(), {
490
493
  value: d,
491
494
  spec: m,
492
495
  label: y,
493
- fullTrace: V
496
+ fullTrace: E
494
497
  };
495
498
  }), o = [], a = [], l = [...r];
496
499
  l.sort(([, d], [, m]) => m - d);
497
500
  for (const [d] of l)
498
- d.endsWith("@1") || s.get(d) === e.length ? o.push(d) : a.push(d);
501
+ d.endsWith("@1") || s.get(d) === t.length ? o.push(d) : a.push(d);
499
502
  const c = (d) => i.map((m) => {
500
503
  const y = m.fullTrace.filter((b) => d.has(b.fullType)).map((b) => b.label), F = n.separator ?? " / ";
501
504
  return {
@@ -507,35 +510,35 @@ function Ft(e, t, n = {}) {
507
510
  if (a.length !== 0) throw new Error("Assertion error.");
508
511
  return c(new Set(Q));
509
512
  }
510
- let f = 0, v = 0;
513
+ let f = 0, w = 0;
511
514
  for (; f < o.length; ) {
512
515
  const d = /* @__PURE__ */ new Set();
516
+ n.includeNativeLabel && d.add(Q);
513
517
  for (let y = 0; y < f; ++y) d.add(o[y]);
514
- d.add(o[v]);
518
+ d.add(o[w]);
515
519
  const m = c(d);
516
- if (new Set(m.map((y) => y.label)).size === e.length)
517
- return n.includeNativeLabel ? (d.add(Q), c(d)) : m;
518
- v++, v == o.length && (f++, v = f);
520
+ if (new Set(m.map((y) => y.label)).size === t.length) return m;
521
+ w++, w == o.length && (f++, w = f);
519
522
  }
520
523
  return c(/* @__PURE__ */ new Set([...o, ...a]));
521
524
  }
522
- class Ot {
525
+ class Oe {
523
526
  constructor() {
524
- _(this, "ctx", u());
525
- _(this, "defaultLabelFn", (t, n) => {
527
+ v(this, "ctx", u());
528
+ v(this, "defaultLabelFn", (e, n) => {
526
529
  var r;
527
- return ((r = t.annotations) == null ? void 0 : r["pl7.app/label"]) ?? "Unlabelled";
530
+ return ((r = e.annotations) == null ? void 0 : r["pl7.app/label"]) ?? "Unlabelled";
528
531
  });
529
532
  }
530
533
  /**
531
534
  * @deprecated use getOptions()
532
535
  */
533
- calculateOptions(t) {
534
- return this.ctx.calculateOptions(t);
536
+ calculateOptions(e) {
537
+ return this.ctx.calculateOptions(e);
535
538
  }
536
- getOptions(t, n) {
537
- const r = this.getSpecs().entries.filter((s) => t(s.obj));
538
- return typeof n == "object" || typeof n > "u" ? Ft(r, (s) => s.obj, n ?? {}).map(
539
+ getOptions(e, n) {
540
+ const r = this.getSpecs().entries.filter((s) => e(s.obj));
541
+ return typeof n == "object" || typeof n > "u" ? Fe(r, (s) => s.obj, n ?? {}).map(
539
542
  ({ value: { ref: s }, label: i }) => ({
540
543
  ref: s,
541
544
  label: i
@@ -552,14 +555,14 @@ class Ot {
552
555
  return this.getData();
553
556
  }
554
557
  getData() {
555
- const t = this.ctx.getDataFromResultPool();
558
+ const e = this.ctx.getDataFromResultPool();
556
559
  return {
557
- isComplete: t.isComplete,
558
- entries: t.entries.map((n) => ({
560
+ isComplete: e.isComplete,
561
+ entries: e.entries.map((n) => ({
559
562
  ref: n.ref,
560
563
  obj: {
561
564
  ...n.obj,
562
- data: new w(n.obj.data)
565
+ data: new S(n.obj.data)
563
566
  }
564
567
  }))
565
568
  };
@@ -571,14 +574,14 @@ class Ot {
571
574
  return this.getDataWithErrors();
572
575
  }
573
576
  getDataWithErrors() {
574
- const t = this.ctx.getDataWithErrorsFromResultPool();
577
+ const e = this.ctx.getDataWithErrorsFromResultPool();
575
578
  return {
576
- isComplete: t.isComplete,
577
- entries: t.entries.map((n) => ({
579
+ isComplete: e.isComplete,
580
+ entries: e.entries.map((n) => ({
578
581
  ref: n.ref,
579
582
  obj: {
580
583
  ...n.obj,
581
- data: pt(n.obj.data, (r) => new w(r))
584
+ data: pe(n.obj.data, (r) => new S(r))
582
585
  }
583
586
  }))
584
587
  };
@@ -596,13 +599,13 @@ class Ot {
596
599
  * @param ref a Ref
597
600
  * @returns data associated with the ref
598
601
  */
599
- getDataByRef(t) {
602
+ getDataByRef(e) {
600
603
  var n;
601
604
  return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (n = this.getData().entries.find(
602
- (r) => r.ref.blockId === t.blockId && r.ref.name === t.name
605
+ (r) => r.ref.blockId === e.blockId && r.ref.name === e.name
603
606
  )) == null ? void 0 : n.obj : L(
604
- this.ctx.getDataFromResultPoolByRef(t.blockId, t.name),
605
- (r) => new w(r)
607
+ this.ctx.getDataFromResultPoolByRef(e.blockId, e.name),
608
+ (r) => new S(r)
606
609
  );
607
610
  }
608
611
  /**
@@ -610,37 +613,37 @@ class Ot {
610
613
  * @param ref a Ref
611
614
  * @returns p-column associated with the ref
612
615
  */
613
- getPColumnByRef(t) {
614
- const n = this.getDataByRef(t);
616
+ getPColumnByRef(e) {
617
+ const n = this.getDataByRef(e);
615
618
  if (n)
616
- return ft(n);
619
+ return fe(n);
617
620
  }
618
621
  /**
619
622
  * @param ref a Ref
620
623
  * @returns object spec associated with the ref
621
624
  */
622
- getSpecByRef(t) {
625
+ getSpecByRef(e) {
623
626
  var n;
624
627
  return typeof this.ctx.getSpecFromResultPoolByRef > "u" ? (n = this.getSpecs().entries.find(
625
- (r) => r.ref.blockId === t.blockId && r.ref.name === t.name
626
- )) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(t.blockId, t.name);
628
+ (r) => r.ref.blockId === e.blockId && r.ref.name === e.name
629
+ )) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(e.blockId, e.name);
627
630
  }
628
631
  /**
629
632
  * @param spec object specification
630
633
  * @returns array of data objects with compatible specs
631
634
  * @deprecated delete this method after Jan 1, 2025
632
635
  */
633
- findDataWithCompatibleSpec(t) {
636
+ findDataWithCompatibleSpec(e) {
634
637
  const n = [];
635
- t: for (const r of this.getData().entries) {
636
- if (!ht(r.obj.spec))
638
+ e: for (const r of this.getData().entries) {
639
+ if (!he(r.obj.spec))
637
640
  continue;
638
641
  const s = r.obj.spec;
639
- if (t.name === s.name && t.valueType === s.valueType && t.axesSpec.length === s.axesSpec.length && K(t.domain, s.domain)) {
640
- for (let i = 0; i < t.axesSpec.length; ++i) {
641
- const o = t.axesSpec[i], a = s.axesSpec[i];
642
+ if (e.name === s.name && e.valueType === s.valueType && e.axesSpec.length === s.axesSpec.length && K(e.domain, s.domain)) {
643
+ for (let i = 0; i < e.axesSpec.length; ++i) {
644
+ const o = e.axesSpec[i], a = s.axesSpec[i];
642
645
  if (o.name !== a.name || o.type !== a.type || !K(o.domain, a.domain))
643
- continue t;
646
+ continue e;
644
647
  }
645
648
  n.push(r.obj);
646
649
  }
@@ -648,27 +651,27 @@ class Ot {
648
651
  return n;
649
652
  }
650
653
  }
651
- function K(e, t) {
652
- if (e === void 0) return t === void 0;
653
- if (t === void 0) return !0;
654
- for (const n in t)
655
- if (e[n] !== t[n]) return !1;
654
+ function K(t, e) {
655
+ if (t === void 0) return e === void 0;
656
+ if (e === void 0) return !0;
657
+ for (const n in e)
658
+ if (t[n] !== e[n]) return !1;
656
659
  return !0;
657
660
  }
658
661
  class D {
659
662
  constructor() {
660
- _(this, "ctx");
661
- _(this, "args");
662
- _(this, "uiState");
663
- _(this, "resultPool", new Ot());
663
+ v(this, "ctx");
664
+ v(this, "args");
665
+ v(this, "uiState");
666
+ v(this, "resultPool", new Oe());
664
667
  this.ctx = u(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : void 0;
665
668
  }
666
- getNamedAccessor(t) {
667
- const n = this.ctx.getAccessorHandleByName(t);
668
- return n ? new w(n) : void 0;
669
+ getNamedAccessor(e) {
670
+ const n = this.ctx.getAccessorHandleByName(e);
671
+ return n ? new S(n) : void 0;
669
672
  }
670
673
  get prerun() {
671
- return this.getNamedAccessor(st);
674
+ return this.getNamedAccessor(se);
672
675
  }
673
676
  /**
674
677
  * @deprecated use prerun
@@ -683,7 +686,7 @@ class D {
683
686
  return this.precalc;
684
687
  }
685
688
  get outputs() {
686
- return this.getNamedAccessor(it);
689
+ return this.getNamedAccessor(ie);
687
690
  }
688
691
  /**
689
692
  * @deprecated use outputs
@@ -695,12 +698,12 @@ class D {
695
698
  * Find labels data for a given axis id. It will search for a label column and return its data as a map.
696
699
  * @returns a map of axis value => label
697
700
  */
698
- findLabels(t) {
701
+ findLabels(e) {
699
702
  const n = this.resultPool.getData();
700
703
  for (const r of n.entries) {
701
704
  if (!W(r.obj)) continue;
702
705
  const s = r.obj.spec;
703
- if (s.name === "pl7.app/label" && s.axesSpec.length === 1 && s.axesSpec[0].name === t.name && s.axesSpec[0].type === t.type && K(t.domain, s.axesSpec[0].domain)) {
706
+ if (s.name === "pl7.app/label" && s.axesSpec.length === 1 && s.axesSpec[0].name === e.name && s.axesSpec[0].type === e.type && K(e.domain, s.axesSpec[0].domain)) {
704
707
  if (r.obj.data.resourceType.name !== "PColumnData/Json")
705
708
  throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
706
709
  return new Map(
@@ -711,50 +714,50 @@ class D {
711
714
  }
712
715
  }
713
716
  }
714
- createPFrame(t) {
715
- return this.ctx.createPFrame(t.map((n) => L(n, (r) => r.handle)));
717
+ createPFrame(e) {
718
+ return this.ctx.createPFrame(e.map((n) => L(n, (r) => r.handle)));
716
719
  }
717
- createPTable(t) {
720
+ createPTable(e) {
718
721
  var n;
719
- return "columns" in t ? n = {
722
+ return "columns" in e ? n = {
720
723
  src: {
721
724
  type: "full",
722
- entries: t.columns.map((r) => ({ type: "column", column: r }))
725
+ entries: e.columns.map((r) => ({ type: "column", column: r }))
723
726
  },
724
- filters: t.filters ?? [],
725
- sorting: t.sorting ?? []
726
- } : n = t, this.ctx.createPTable(gt(n, (r) => L(r, (s) => s.handle)));
727
+ filters: e.filters ?? [],
728
+ sorting: e.sorting ?? []
729
+ } : n = e, this.ctx.createPTable(ge(n, (r) => L(r, (s) => s.handle)));
727
730
  }
728
731
  /** @deprecated scheduled for removal from SDK */
729
- getBlockLabel(t) {
730
- return this.ctx.getBlockLabel(t);
732
+ getBlockLabel(e) {
733
+ return this.ctx.getBlockLabel(e);
731
734
  }
732
735
  getCurrentUnstableMarker() {
733
736
  if (!(typeof this.ctx.getCurrentUnstableMarker > "u"))
734
737
  return this.ctx.getCurrentUnstableMarker();
735
738
  }
736
739
  }
737
- const R = "PColumnData/", G = R + "ResourceMap", H = R + "Partitioned/ResourceMap", Z = R + "JsonPartitioned", M = R + "BinaryPartitioned", at = R + "Partitioned/", tt = at + "JsonPartitioned", B = at + "BinaryPartitioned";
738
- function lt(e, t, n, r = [], s) {
739
- if (e === void 0) return !1;
740
- switch (e.resourceType.name) {
740
+ const T = "PColumnData/", G = T + "ResourceMap", H = T + "Partitioned/ResourceMap", Z = T + "JsonPartitioned", M = T + "BinaryPartitioned", ae = T + "Partitioned/", ee = ae + "JsonPartitioned", B = ae + "BinaryPartitioned";
741
+ function le(t, e, n, r = [], s) {
742
+ if (t === void 0) return !1;
743
+ switch (t.resourceType.name) {
741
744
  case G: {
742
- let i = e.getInputsLocked();
743
- for (const o of e.listInputFields()) {
744
- const a = e.resolve({ field: o, assertFieldType: "Input" }), l = [...r, ...JSON.parse(o)], c = a === void 0 ? void 0 : t(a);
745
+ let i = t.getInputsLocked();
746
+ for (const o of t.listInputFields()) {
747
+ const a = t.resolve({ field: o, assertFieldType: "Input" }), l = [...r, ...JSON.parse(o)], c = a === void 0 ? void 0 : e(a);
745
748
  c === void 0 && (i = !1), (c !== void 0 || s) && n.push({ key: l, value: c });
746
749
  }
747
750
  return i;
748
751
  }
749
752
  case H: {
750
- let i = e.getInputsLocked();
751
- for (const o of e.listInputFields()) {
752
- const a = e.resolve({ field: o, assertFieldType: "Input" });
753
+ let i = t.getInputsLocked();
754
+ for (const o of t.listInputFields()) {
755
+ const a = t.resolve({ field: o, assertFieldType: "Input" });
753
756
  if (a === void 0) i = !1;
754
757
  else {
755
- const l = [...r, ...JSON.parse(o)], c = lt(
758
+ const l = [...r, ...JSON.parse(o)], c = le(
756
759
  a,
757
- t,
760
+ e,
758
761
  n,
759
762
  l,
760
763
  s
@@ -765,25 +768,25 @@ function lt(e, t, n, r = [], s) {
765
768
  return i;
766
769
  }
767
770
  default:
768
- throw new Error(`Unknown resource type: ${e.resourceType.name}`);
771
+ throw new Error(`Unknown resource type: ${t.resourceType.name}`);
769
772
  }
770
773
  }
771
- function de(e, t, n = !1) {
774
+ function dt(t, e, n = !1) {
772
775
  const r = [];
773
- return { isComplete: lt(e, t, r, [], n), data: r };
776
+ return { isComplete: le(t, e, r, [], n), data: r };
774
777
  }
775
- const et = (e) => {
776
- if (!e.endsWith(".index")) {
777
- if (e.endsWith(".values"))
778
- return e.substring(0, e.length - 7);
779
- throw Error(`key must ends on .index/.values for binary p-column, got: ${e}`);
778
+ const te = (t) => {
779
+ if (!t.endsWith(".index")) {
780
+ if (t.endsWith(".values"))
781
+ return t.substring(0, t.length - 7);
782
+ throw Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
780
783
  }
781
784
  };
782
- function Dt(e) {
783
- if (!e) return;
784
- const t = e.resourceType.name, n = e.getDataAsJson(), r = [];
785
+ function De(t) {
786
+ if (!t) return;
787
+ const e = t.resourceType.name, n = t.getDataAsJson(), r = [];
785
788
  let s = 0;
786
- switch (t) {
789
+ switch (e) {
787
790
  case G:
788
791
  s = n.keyLength;
789
792
  break;
@@ -795,17 +798,17 @@ function Dt(e) {
795
798
  s = n.partitionKeyLength;
796
799
  break;
797
800
  case B:
798
- case tt:
801
+ case ee:
799
802
  s = n.superPartitionKeyLength + n.partitionKeyLength;
800
803
  break;
801
804
  }
802
- switch (t) {
805
+ switch (e) {
803
806
  case G:
804
807
  case Z:
805
808
  case M:
806
- for (let i of e.listInputFields()) {
807
- if (t === M) {
808
- const a = et(i);
809
+ for (let i of t.listInputFields()) {
810
+ if (e === M) {
811
+ const a = te(i);
809
812
  if (a) i = a;
810
813
  else continue;
811
814
  }
@@ -815,13 +818,13 @@ function Dt(e) {
815
818
  break;
816
819
  case H:
817
820
  case B:
818
- case tt:
819
- for (const i of e.listInputFields()) {
820
- const o = [...JSON.parse(i)], a = e.resolve({ field: i, assertFieldType: "Input" });
821
+ case ee:
822
+ for (const i of t.listInputFields()) {
823
+ const o = [...JSON.parse(i)], a = t.resolve({ field: i, assertFieldType: "Input" });
821
824
  if (a !== void 0)
822
825
  for (let l of a.listInputFields()) {
823
- if (t === B) {
824
- const f = et(l);
826
+ if (e === B) {
827
+ const f = te(l);
825
828
  if (f) l = f;
826
829
  else continue;
827
830
  }
@@ -833,10 +836,10 @@ function Dt(e) {
833
836
  }
834
837
  return { data: r, keyLength: s };
835
838
  }
836
- function pe(e) {
837
- const t = Dt(e);
838
- if (!t) return;
839
- const { data: n, keyLength: r } = t, s = [];
839
+ function pt(t) {
840
+ const e = De(t);
841
+ if (!e) return;
842
+ const { data: n, keyLength: r } = e, s = [];
840
843
  for (let i = 0; i < r; ++i)
841
844
  s.push(/* @__PURE__ */ new Set());
842
845
  for (const i of n) {
@@ -847,22 +850,22 @@ function pe(e) {
847
850
  }
848
851
  return s.map((i) => Array.from(i.values()));
849
852
  }
850
- const C = "1.13.0";
851
- function kt(e) {
852
- return e.__renderLambda === !0;
853
+ const C = "1.13.5";
854
+ function ke(t) {
855
+ return t.__renderLambda === !0;
853
856
  }
854
- function U(e) {
855
- if (e !== void 0)
856
- return kt(e) ? e.handle : e;
857
+ function U(t) {
858
+ if (t !== void 0)
859
+ return ke(t) ? t.handle : t;
857
860
  }
858
- function A(e) {
859
- if (e !== void 0)
860
- return typeof e == "string" ? { __renderLambda: !0, handle: e, retentive: !1 } : e;
861
+ function A(t) {
862
+ if (t !== void 0)
863
+ return typeof t == "string" ? { __renderLambda: !0, handle: t, retentive: !1 } : t;
861
864
  }
862
- function fe(e) {
863
- if (e.v3 !== void 0) {
865
+ function ft(t) {
866
+ if (t.v3 !== void 0) {
864
867
  const {
865
- initialArgs: t,
868
+ initialArgs: e,
866
869
  initialUiState: n,
867
870
  inputsValid: r,
868
871
  outputs: s,
@@ -870,9 +873,9 @@ function fe(e) {
870
873
  sdkVersion: o,
871
874
  sections: a,
872
875
  title: l
873
- } = e.v3, { code: c } = e;
876
+ } = t.v3, { code: c } = t;
874
877
  return {
875
- initialArgs: t,
878
+ initialArgs: e,
876
879
  initialUiState: n,
877
880
  inputsValid: r,
878
881
  outputs: s,
@@ -882,14 +885,14 @@ function fe(e) {
882
885
  title: l,
883
886
  code: c
884
887
  };
885
- } else if (e.inputsValid !== void 0) {
886
- const { sdkVersion: t, renderingMode: n, outputs: r, inputsValid: s, sections: i, initialArgs: o, code: a } = e, l = Object.keys(e);
887
- if (t === void 0 || n === void 0 || r === void 0 || s === void 0 || i === void 0 || o === void 0)
888
+ } else if (t.inputsValid !== void 0) {
889
+ const { sdkVersion: e, renderingMode: n, outputs: r, inputsValid: s, sections: i, initialArgs: o, code: a } = t, l = Object.keys(t);
890
+ if (e === void 0 || n === void 0 || r === void 0 || s === void 0 || i === void 0 || o === void 0)
888
891
  throw new Error(
889
- `Malformed config v2. SDK version ${t}; Fields = ${l.join(", ")}`
892
+ `Malformed config v2. SDK version ${e}; Fields = ${l.join(", ")}`
890
893
  );
891
894
  return {
892
- sdkVersion: t,
895
+ sdkVersion: e,
893
896
  renderingMode: n,
894
897
  initialArgs: o,
895
898
  outputs: Object.fromEntries(
@@ -900,14 +903,14 @@ function fe(e) {
900
903
  initialUiState: void 0,
901
904
  code: a
902
905
  };
903
- } else if (e.renderingMode !== void 0) {
904
- const { sdkVersion: t, canRun: n, renderingMode: r, outputs: s, sections: i, initialArgs: o, code: a } = e, l = Object.keys(e);
906
+ } else if (t.renderingMode !== void 0) {
907
+ const { sdkVersion: e, canRun: n, renderingMode: r, outputs: s, sections: i, initialArgs: o, code: a } = t, l = Object.keys(t);
905
908
  if (r === void 0 || s === void 0 || n === void 0 || i === void 0 || o === void 0)
906
909
  throw new Error(
907
- `Malformed config v1. SDK version ${t}; Fields = ${l.join(", ")}`
910
+ `Malformed config v1. SDK version ${e}; Fields = ${l.join(", ")}`
908
911
  );
909
912
  return {
910
- sdkVersion: t ?? "unknown",
913
+ sdkVersion: e ?? "unknown",
911
914
  renderingMode: r,
912
915
  initialArgs: o,
913
916
  outputs: Object.fromEntries(
@@ -919,19 +922,19 @@ function fe(e) {
919
922
  code: a
920
923
  };
921
924
  } else {
922
- const { sdkVersion: t } = e, n = Object.keys(e);
925
+ const { sdkVersion: e } = t, n = Object.keys(t);
923
926
  throw new Error(
924
- `Config format not supported: SDK = ${t}; Fields = ${n.join(", ")}`
927
+ `Config format not supported: SDK = ${e}; Fields = ${n.join(", ")}`
925
928
  );
926
929
  }
927
930
  }
928
931
  class h {
929
- constructor(t, n, r, s, i, o, a) {
930
- this._renderingMode = t, this._initialArgs = n, this._initialUiState = r, this._outputs = s, this._inputsValid = i, this._sections = o, this._title = a;
932
+ constructor(e, n, r, s, i, o, a) {
933
+ this._renderingMode = e, this._initialArgs = n, this._initialUiState = r, this._outputs = s, this._inputsValid = i, this._sections = o, this._title = a;
931
934
  }
932
- static create(t = "Heavy") {
935
+ static create(e = "Heavy") {
933
936
  return new h(
934
- t,
937
+ e,
935
938
  void 0,
936
939
  {},
937
940
  {},
@@ -940,16 +943,16 @@ class h {
940
943
  void 0
941
944
  );
942
945
  }
943
- output(t, n, r = {}) {
946
+ output(e, n, r = {}) {
944
947
  if (typeof n == "function") {
945
- const s = `output#${t}`;
948
+ const s = `output#${e}`;
946
949
  return O(s, () => n(new D())), new h(
947
950
  this._renderingMode,
948
951
  this._initialArgs,
949
952
  this._initialUiState,
950
953
  {
951
954
  ...this._outputs,
952
- [t]: {
955
+ [e]: {
953
956
  __renderLambda: !0,
954
957
  handle: s,
955
958
  ...r
@@ -966,7 +969,7 @@ class h {
966
969
  this._initialUiState,
967
970
  {
968
971
  ...this._outputs,
969
- [t]: n
972
+ [e]: n
970
973
  },
971
974
  this._inputsValid,
972
975
  this._sections,
@@ -974,15 +977,15 @@ class h {
974
977
  );
975
978
  }
976
979
  /** Shortcut for {@link output} with retentive flag set to true. */
977
- retentiveOutput(t, n) {
978
- return this.output(t, n, { retentive: !0 });
980
+ retentiveOutput(e, n) {
981
+ return this.output(e, n, { retentive: !0 });
979
982
  }
980
983
  /** @deprecated */
981
- canRun(t) {
982
- return this.inputsValid(t);
984
+ canRun(e) {
985
+ return this.inputsValid(e);
983
986
  }
984
- argsValid(t) {
985
- return typeof t == "function" ? (O("inputsValid", () => t(new D())), new h(
987
+ argsValid(e) {
988
+ return typeof e == "function" ? (O("inputsValid", () => e(new D())), new h(
986
989
  this._renderingMode,
987
990
  this._initialArgs,
988
991
  this._initialUiState,
@@ -998,16 +1001,16 @@ class h {
998
1001
  this._initialArgs,
999
1002
  this._initialUiState,
1000
1003
  this._outputs,
1001
- t,
1004
+ e,
1002
1005
  this._sections,
1003
1006
  this._title
1004
1007
  );
1005
1008
  }
1006
- inputsValid(t) {
1007
- return this.argsValid(t);
1009
+ inputsValid(e) {
1010
+ return this.argsValid(e);
1008
1011
  }
1009
- sections(t) {
1010
- return Array.isArray(t) ? this.sections(k(t)) : typeof t == "function" ? (O("sections", () => t(new D())), new h(
1012
+ sections(e) {
1013
+ return Array.isArray(e) ? this.sections(k(e)) : typeof e == "function" ? (O("sections", () => e(new D())), new h(
1011
1014
  this._renderingMode,
1012
1015
  this._initialArgs,
1013
1016
  this._initialUiState,
@@ -1021,12 +1024,12 @@ class h {
1021
1024
  this._initialUiState,
1022
1025
  this._outputs,
1023
1026
  this._inputsValid,
1024
- t,
1027
+ e,
1025
1028
  this._title
1026
1029
  );
1027
1030
  }
1028
- title(t) {
1029
- return O("title", () => t(new D())), new h(
1031
+ title(e) {
1032
+ return O("title", () => e(new D())), new h(
1030
1033
  this._renderingMode,
1031
1034
  this._initialArgs,
1032
1035
  this._initialUiState,
@@ -1040,10 +1043,10 @@ class h {
1040
1043
  * Sets initial args for the block, this value must be specified.
1041
1044
  * @deprecated use {@link withArgs}
1042
1045
  * */
1043
- initialArgs(t) {
1046
+ initialArgs(e) {
1044
1047
  return new h(
1045
1048
  this._renderingMode,
1046
- t,
1049
+ e,
1047
1050
  this._initialUiState,
1048
1051
  this._outputs,
1049
1052
  this._inputsValid,
@@ -1052,10 +1055,10 @@ class h {
1052
1055
  );
1053
1056
  }
1054
1057
  /** Sets initial args for the block, this value must be specified. */
1055
- withArgs(t) {
1058
+ withArgs(e) {
1056
1059
  return new h(
1057
1060
  this._renderingMode,
1058
- t,
1061
+ e,
1059
1062
  this._initialUiState,
1060
1063
  this._outputs,
1061
1064
  this._inputsValid,
@@ -1064,11 +1067,11 @@ class h {
1064
1067
  );
1065
1068
  }
1066
1069
  /** Defines type and sets initial value for block UiState. */
1067
- withUiState(t) {
1070
+ withUiState(e) {
1068
1071
  return new h(
1069
1072
  this._renderingMode,
1070
1073
  this._initialArgs,
1071
- t,
1074
+ e,
1072
1075
  this._outputs,
1073
1076
  this._inputsValid,
1074
1077
  this._sections,
@@ -1080,7 +1083,7 @@ class h {
1080
1083
  * other features provided by the platforma to the block. */
1081
1084
  done() {
1082
1085
  if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
1083
- const t = {
1086
+ const e = {
1084
1087
  v3: {
1085
1088
  sdkVersion: C,
1086
1089
  renderingMode: this._renderingMode,
@@ -1101,35 +1104,36 @@ class h {
1101
1104
  Object.entries(this._outputs).map(([n, r]) => [n, U(r)])
1102
1105
  )
1103
1106
  };
1104
- return _t() ? rt({ sdkVersion: C }) : { config: t };
1107
+ return _e() ? re({ sdkVersion: C }) : { config: e };
1105
1108
  }
1106
1109
  }
1107
- function he(e, t, n, r) {
1110
+ function ht(t, e, n, r) {
1108
1111
  var o, a;
1109
- const s = e.resultPool.getData().entries.map((l) => l.obj).filter(W).filter((l) => l.spec.name === "pl7.app/label" && l.spec.axesSpec.length === 1), i = /* @__PURE__ */ new Map();
1110
- for (const l of t)
1112
+ const s = t.resultPool.getData().entries.map((l) => l.obj).filter(W).filter((l) => l.spec.name === "pl7.app/label" && l.spec.axesSpec.length === 1), i = /* @__PURE__ */ new Map();
1113
+ for (const l of e)
1111
1114
  for (const c of l.spec.axesSpec) {
1112
1115
  const f = J(c);
1113
- for (const v of s)
1114
- mt(f, J(v.spec.axesSpec[0])) && i.set(v.id, v);
1116
+ for (const w of s)
1117
+ me(f, J(w.spec.axesSpec[0])) && i.set(w.id, w);
1115
1118
  }
1116
- return e.createPTable({
1117
- src: {
1118
- type: "outer",
1119
- primary: {
1120
- type: "full",
1121
- entries: t.map((l) => ({ type: "column", column: l }))
1119
+ if (![...e, ...i.values()].find((l) => !l.data.getIsReadyOrError()))
1120
+ return t.createPTable({
1121
+ src: {
1122
+ type: "outer",
1123
+ primary: {
1124
+ type: "full",
1125
+ entries: e.map((l) => ({ type: "column", column: l }))
1126
+ },
1127
+ secondary: Array.from(i.values()).map((l) => ({ type: "column", column: l }))
1122
1128
  },
1123
- secondary: Array.from(i.values()).map((l) => ({ type: "column", column: l }))
1124
- },
1125
- filters: [...((o = n == null ? void 0 : n.pTableParams) == null ? void 0 : o.filters) ?? [], ...r ?? []],
1126
- sorting: ((a = n == null ? void 0 : n.pTableParams) == null ? void 0 : a.sorting) ?? []
1127
- });
1129
+ filters: [...((o = n == null ? void 0 : n.pTableParams) == null ? void 0 : o.filters) ?? [], ...r ?? []],
1130
+ sorting: ((a = n == null ? void 0 : n.pTableParams) == null ? void 0 : a.sorting) ?? []
1131
+ });
1128
1132
  }
1129
- function ge(e, t, n) {
1130
- const r = e.findLabels(t);
1133
+ function gt(t, e, n) {
1134
+ const r = t.findLabels(e);
1131
1135
  return {
1132
- axis: J(t),
1136
+ axis: J(e),
1133
1137
  options: n.map((s) => ({
1134
1138
  value: s,
1135
1139
  label: (r == null ? void 0 : r.get(s)) ?? s.toString()
@@ -1137,108 +1141,113 @@ function ge(e, t, n) {
1137
1141
  defaultValue: n[0]
1138
1142
  };
1139
1143
  }
1140
- class me {
1141
- constructor(t) {
1142
- this.handle = t;
1144
+ class mt {
1145
+ constructor(e) {
1146
+ this.handle = e;
1143
1147
  }
1144
- async findColumns(t) {
1145
- return await platforma.pFrameDriver.findColumns(this.handle, t);
1148
+ async findColumns(e) {
1149
+ return await platforma.pFrameDriver.findColumns(this.handle, e);
1146
1150
  }
1147
- async getColumnSpec(t) {
1148
- return await platforma.pFrameDriver.getColumnSpec(this.handle, t);
1151
+ async getColumnSpec(e) {
1152
+ return await platforma.pFrameDriver.getColumnSpec(this.handle, e);
1149
1153
  }
1150
1154
  async listColumns() {
1151
1155
  return await platforma.pFrameDriver.listColumns(this.handle);
1152
1156
  }
1153
- async calculateTableData(t) {
1154
- return await platforma.pFrameDriver.calculateTableData(this.handle, t);
1157
+ async calculateTableData(e) {
1158
+ return await platforma.pFrameDriver.calculateTableData(this.handle, e);
1155
1159
  }
1156
- async getUniqueValues(t) {
1157
- return await platforma.pFrameDriver.getUniqueValues(this.handle, t);
1160
+ async getUniqueValues(e) {
1161
+ return await platforma.pFrameDriver.getUniqueValues(this.handle, e);
1158
1162
  }
1159
1163
  }
1160
- function Lt(e) {
1161
- return nt({
1164
+ function Le(t) {
1165
+ return ne({
1162
1166
  __isRef: !0,
1163
- blockId: x(e, "blockId"),
1164
- name: x(e, "name")
1167
+ blockId: x(t, "blockId"),
1168
+ name: x(t, "name")
1165
1169
  });
1166
1170
  }
1167
- function ye(e) {
1168
- return nt({
1169
- ref: Lt(x(e, "ref")),
1170
- label: x(e, "label")
1171
+ function yt(t) {
1172
+ return ne({
1173
+ ref: Le(x(t, "ref")),
1174
+ label: x(t, "label")
1171
1175
  });
1172
1176
  }
1173
- const be = {
1177
+ const bt = {
1174
1178
  sdkVersion: C
1175
1179
  };
1176
- function _e() {
1177
- return rt({ sdkVersion: C });
1180
+ function _t() {
1181
+ return re({ sdkVersion: C });
1178
1182
  }
1179
- function ve(e) {
1183
+ function vt(t) {
1180
1184
  if (typeof globalThis.getEnvironmentValue == "function")
1181
- return globalThis.getEnvironmentValue(e);
1185
+ return globalThis.getEnvironmentValue(t);
1182
1186
  }
1183
1187
  export {
1184
- Mt as Args,
1188
+ Me as Args,
1185
1189
  h as BlockModel,
1186
- be as CurrentSdkInfo,
1190
+ bt as CurrentSdkInfo,
1187
1191
  g as FutureRef,
1188
- Bt as It,
1189
- ce as JsRenderInternal,
1190
- Ut as MainOutputs,
1191
- yt as OutputError,
1192
- me as PFrameImpl,
1192
+ Be as It,
1193
+ ct as JsRenderInternal,
1194
+ Ue as MainOutputs,
1195
+ ye as OutputError,
1196
+ Ae as PAnnotationLabel,
1197
+ Pe as PAnnotationTrace,
1198
+ mt as PFrameImpl,
1193
1199
  M as RT_BINARY_PARTITIONED,
1194
1200
  B as RT_BINARY_SUPER_PARTITIONED,
1195
1201
  Z as RT_JSON_PARTITIONED,
1196
- tt as RT_JSON_SUPER_PARTITIONED,
1202
+ ee as RT_JSON_SUPER_PARTITIONED,
1197
1203
  G as RT_RESOURCE_MAP,
1198
1204
  H as RT_RESOURCE_MAP_PARTITIONED,
1199
1205
  D as RenderCtx,
1200
- Ot as ResultPool,
1201
- Jt as StagingOutputs,
1202
- w as TreeNodeAccessor,
1203
- $t as UiState,
1204
- Yt as and,
1205
- he as createPlDataTable,
1206
- ge as createPlDataTableSheet,
1206
+ Oe as ResultPool,
1207
+ Je as StagingOutputs,
1208
+ Ce as Trace,
1209
+ Ie as TraceEntry,
1210
+ S as TreeNodeAccessor,
1211
+ $e as UiState,
1212
+ Ye as and,
1213
+ ht as createPlDataTable,
1214
+ gt as createPlDataTableSheet,
1215
+ Fe as deriveLabels,
1207
1216
  U as downgradeCfgOrLambda,
1208
- fe as extractConfig,
1209
- Wt as flatten,
1210
- ye as fromPlOption,
1211
- Lt as fromPlRef,
1212
- ee as getBlobContent,
1213
- re as getBlobContentAsJson,
1214
- ne as getBlobContentAsString,
1215
- se as getDownloadedBlobContent,
1216
- ve as getEnvironmentValue,
1217
- T as getFromCfg,
1217
+ ft as extractConfig,
1218
+ We as flatten,
1219
+ yt as fromPlOption,
1220
+ Le as fromPlRef,
1221
+ tt as getBlobContent,
1222
+ rt as getBlobContentAsJson,
1223
+ nt as getBlobContentAsString,
1224
+ st as getDownloadedBlobContent,
1225
+ vt as getEnvironmentValue,
1226
+ R as getFromCfg,
1218
1227
  k as getImmediate,
1219
- oe as getImportProgress,
1228
+ ot as getImportProgress,
1220
1229
  x as getJsonField,
1221
- ae as getLastLogs,
1222
- ue as getLogHandle,
1223
- ie as getOnDemandBlobContent,
1224
- Dt as getPartitionKeysList,
1225
- le as getProgressLog,
1226
- _e as getRawPlatformaInstance,
1227
- Qt as getResourceField,
1228
- Zt as getResourceValueAsJson,
1229
- pe as getUniquePartitionKeys,
1230
- kt as isConfigLambda,
1231
- qt as isEmpty,
1232
- Nt as isolate,
1233
- Kt as makeArray,
1234
- nt as makeObject,
1235
- Ht as mapArrayValues,
1236
- Gt as mapRecordValues,
1237
- te as mapResourceFields,
1238
- zt as not,
1239
- Xt as or,
1240
- de as parseResourceMap,
1241
- bt as readOutput,
1242
- jt as wrapOutputs
1230
+ at as getLastLogs,
1231
+ ut as getLogHandle,
1232
+ it as getOnDemandBlobContent,
1233
+ De as getPartitionKeysList,
1234
+ lt as getProgressLog,
1235
+ _t as getRawPlatformaInstance,
1236
+ Qe as getResourceField,
1237
+ Ze as getResourceValueAsJson,
1238
+ pt as getUniquePartitionKeys,
1239
+ ke as isConfigLambda,
1240
+ qe as isEmpty,
1241
+ Ne as isolate,
1242
+ Ke as makeArray,
1243
+ ne as makeObject,
1244
+ He as mapArrayValues,
1245
+ Ge as mapRecordValues,
1246
+ et as mapResourceFields,
1247
+ ze as not,
1248
+ Xe as or,
1249
+ dt as parseResourceMap,
1250
+ be as readOutput,
1251
+ je as wrapOutputs
1243
1252
  };
1244
1253
  //# sourceMappingURL=index.mjs.map