@platforma-sdk/model 1.20.11 → 1.20.24

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