@platforma-sdk/model 1.37.18 → 1.39.0

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.
Files changed (38) hide show
  1. package/dist/bconfig/index.d.ts +2 -3
  2. package/dist/bconfig/index.d.ts.map +1 -1
  3. package/dist/bconfig/normalization.d.ts +1 -7
  4. package/dist/bconfig/normalization.d.ts.map +1 -1
  5. package/dist/bconfig/types.d.ts +0 -4
  6. package/dist/bconfig/types.d.ts.map +1 -1
  7. package/dist/bconfig/{utils.d.ts → util.d.ts} +1 -1
  8. package/dist/bconfig/util.d.ts.map +1 -0
  9. package/dist/bconfig/v3.d.ts +3 -32
  10. package/dist/bconfig/v3.d.ts.map +1 -1
  11. package/dist/builder.d.ts +3 -1
  12. package/dist/builder.d.ts.map +1 -1
  13. package/dist/components/PlDataTable.d.ts +50 -69
  14. package/dist/components/PlDataTable.d.ts.map +1 -1
  15. package/dist/index.js +1 -1
  16. package/dist/index.js.map +1 -1
  17. package/dist/index.mjs +728 -722
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/render/api.d.ts +5 -2
  20. package/dist/render/api.d.ts.map +1 -1
  21. package/dist/render/internal.d.ts +4 -3
  22. package/dist/render/internal.d.ts.map +1 -1
  23. package/dist/version.d.ts +1 -1
  24. package/dist/version.d.ts.map +1 -1
  25. package/package.json +5 -4
  26. package/src/bconfig/index.ts +2 -3
  27. package/src/bconfig/normalization.ts +2 -105
  28. package/src/bconfig/types.ts +0 -5
  29. package/src/bconfig/v3.ts +3 -41
  30. package/src/builder.ts +21 -2
  31. package/src/components/PlDataTable.ts +158 -171
  32. package/src/render/api.ts +44 -11
  33. package/src/render/internal.ts +15 -3
  34. package/dist/bconfig/container.d.ts +0 -46
  35. package/dist/bconfig/container.d.ts.map +0 -1
  36. package/dist/bconfig/utils.d.ts.map +0 -1
  37. package/src/bconfig/container.ts +0 -58
  38. /package/src/bconfig/{utils.ts → util.ts} +0 -0
package/dist/index.mjs CHANGED
@@ -1,44 +1,44 @@
1
- var Ye = Object.defineProperty;
2
- var Xe = (t, e, n) => e in t ? Ye(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var D = (t, e, n) => Xe(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { isPColumn as De, mapPObjectData as xe, isDataInfoEntries as Oe, isDataInfo as Ce, dataInfoToEntries as Qe, selectorsToPredicate as X, resolveAnchors as Pe, deriveNativeId as Ze, isPColumnSpec as ne, isPartitionedDataInfoEntries as et, getAxisId as O, entriesToDataInfo as tt, canonicalizeAxisId as nt, withEnrichments as Se, AnchoredIdDeriver as _e, isPlRef as rt, mapValueInVOE as it, ensurePColumn as st, extractAllColumns as ot, mapPTableDef as at, mapDataInfo as lt, matchAxisId as V, getColumnIdAndSpec as he, canonicalizeJson as R, parseJson as Ie, isPTableAbsent as ut, uniquePlId as ct, PTableNA as dt } from "@milaboratories/pl-model-common";
1
+ var qe = Object.defineProperty;
2
+ var ze = (t, e, n) => e in t ? qe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var k = (t, e, n) => ze(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { isPColumn as ke, mapPObjectData as be, isDataInfoEntries as De, isDataInfo as ve, dataInfoToEntries as Ye, selectorsToPredicate as Y, resolveAnchors as Ce, deriveNativeId as Xe, isPColumnSpec as te, isPartitionedDataInfoEntries as Qe, getAxisId as R, entriesToDataInfo as Ze, canonicalizeAxisId as et, withEnrichments as Se, AnchoredIdDeriver as we, isPlRef as tt, mapValueInVOE as nt, ensurePColumn as rt, extractAllColumns as it, mapPTableDef as st, mapDataInfo as ot, extractConfigGeneric as at, matchAxisId as N, getColumnIdAndSpec as Ae, canonicalizeJson as O, parseJson as Pe, isPTableAbsent as lt, uniquePlId as ut, PTableNA as ct } from "@milaboratories/pl-model-common";
5
5
  export * from "@milaboratories/pl-model-common";
6
6
  import Re from "canonicalize";
7
- import { z as U } from "zod";
7
+ import { z as $ } from "zod";
8
8
  export * from "@milaboratories/pl-error-like";
9
- class pt extends Error {
9
+ class dt extends Error {
10
10
  constructor(e, n) {
11
11
  super(`${e.length}${n ? "+" : ""} errors, first error: ` + e[0].message), this.errors = e, this.moreErrors = n;
12
12
  }
13
13
  }
14
- function ft(t) {
15
- if (!t.ok) throw new pt(t.errors, t.moreErrors);
14
+ function pt(t) {
15
+ if (!t.ok) throw new dt(t.errors, t.moreErrors);
16
16
  return t.value;
17
17
  }
18
- function nn(t) {
18
+ function sn(t) {
19
19
  return new Proxy(t, {
20
20
  get(e, n) {
21
- return ft(e[n]);
21
+ return pt(e[n]);
22
22
  }
23
23
  });
24
24
  }
25
25
  function P(t) {
26
- return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ? re(t) : t;
26
+ return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ? ne(t) : t;
27
27
  }
28
- function Q(t) {
28
+ function X(t) {
29
29
  return { type: "GetFromCtx", variable: t };
30
30
  }
31
- function rn(t) {
31
+ function on(t) {
32
32
  return {
33
33
  type: "Isolate",
34
34
  cfg: t
35
35
  };
36
36
  }
37
- const sn = Q("$args"), on = Q("$it"), an = Q("$prod"), ln = Q("$staging"), un = Q("$ui");
38
- function re(t) {
37
+ const an = X("$args"), ln = X("$it"), un = X("$prod"), cn = X("$staging"), dn = X("$ui");
38
+ function ne(t) {
39
39
  return { type: "Immediate", value: t };
40
40
  }
41
- function Fe(t) {
41
+ function Oe(t) {
42
42
  const e = {};
43
43
  for (const [n, r] of Object.entries(t)) e[n] = P(r);
44
44
  return {
@@ -46,7 +46,7 @@ function Fe(t) {
46
46
  template: e
47
47
  };
48
48
  }
49
- function cn(...t) {
49
+ function pn(...t) {
50
50
  const e = [];
51
51
  for (const n of t) e.push(P(n));
52
52
  return {
@@ -54,14 +54,14 @@ function cn(...t) {
54
54
  template: e
55
55
  };
56
56
  }
57
- function ie(t, e) {
57
+ function re(t, e) {
58
58
  return {
59
59
  type: "GetJsonField",
60
60
  source: P(t),
61
61
  field: P(e)
62
62
  };
63
63
  }
64
- function dn(t, e, n = "$it") {
64
+ function fn(t, e, n = "$it") {
65
65
  return {
66
66
  type: "MapRecordValues",
67
67
  source: t,
@@ -69,7 +69,7 @@ function dn(t, e, n = "$it") {
69
69
  itVar: n
70
70
  };
71
71
  }
72
- function pn(t, e, n = "$it") {
72
+ function hn(t, e, n = "$it") {
73
73
  return {
74
74
  type: "MapArrayValues",
75
75
  source: t,
@@ -77,46 +77,46 @@ function pn(t, e, n = "$it") {
77
77
  itVar: n
78
78
  };
79
79
  }
80
- function fn(t) {
80
+ function gn(t) {
81
81
  return {
82
82
  type: "Flatten",
83
83
  source: t
84
84
  };
85
85
  }
86
- function hn(t) {
86
+ function mn(t) {
87
87
  return {
88
88
  type: "IsEmpty",
89
89
  arg: t
90
90
  };
91
91
  }
92
- function gn(t) {
92
+ function yn(t) {
93
93
  return {
94
94
  type: "Not",
95
95
  operand: t
96
96
  };
97
97
  }
98
- function mn(t, e) {
98
+ function bn(t, e) {
99
99
  return {
100
100
  type: "And",
101
101
  operand1: t,
102
102
  operand2: e
103
103
  };
104
104
  }
105
- function yn(t, e) {
105
+ function vn(t, e) {
106
106
  return {
107
107
  type: "Or",
108
108
  operand1: t,
109
109
  operand2: e
110
110
  };
111
111
  }
112
- function vn(t, e) {
112
+ function Cn(t, e) {
113
113
  return {
114
114
  type: "GetResourceField",
115
115
  source: P(t),
116
116
  field: P(e)
117
117
  };
118
118
  }
119
- function bn() {
119
+ function Sn() {
120
120
  return function(t) {
121
121
  return {
122
122
  type: "GetResourceValueAsJson",
@@ -139,14 +139,14 @@ function An(t, e) {
139
139
  source: P(t)
140
140
  };
141
141
  }
142
- function xn(t, e) {
142
+ function Pn(t, e) {
143
143
  return {
144
144
  type: "GetBlobContentAsString",
145
145
  range: e,
146
146
  source: P(t)
147
147
  };
148
148
  }
149
- function Cn() {
149
+ function xn() {
150
150
  return function(t, e) {
151
151
  return {
152
152
  type: "GetBlobContentAsJson",
@@ -155,59 +155,59 @@ function Cn() {
155
155
  };
156
156
  };
157
157
  }
158
- function Pn(t) {
158
+ function _n(t) {
159
159
  return {
160
160
  type: "GetDownloadedBlobContent",
161
161
  source: P(t)
162
162
  };
163
163
  }
164
- function Sn(t) {
164
+ function In(t) {
165
165
  return {
166
166
  type: "GetOnDemandBlobContent",
167
167
  source: P(t)
168
168
  };
169
169
  }
170
- function _n(t, e) {
170
+ function Tn(t, e) {
171
171
  return {
172
172
  type: "ExtractArchiveAndGetURL",
173
173
  format: e,
174
174
  source: P(t)
175
175
  };
176
176
  }
177
- function In(t) {
177
+ function Ln(t) {
178
178
  return {
179
179
  type: "GetImportProgress",
180
180
  source: P(t)
181
181
  };
182
182
  }
183
- function Tn(t, e) {
183
+ function Fn(t, e) {
184
184
  return {
185
185
  type: "GetLastLogs",
186
186
  source: P(t),
187
187
  lines: e
188
188
  };
189
189
  }
190
- function Ln(t, e) {
190
+ function En(t, e) {
191
191
  return {
192
192
  type: "GetProgressLog",
193
193
  source: P(t),
194
194
  patternToSearch: e
195
195
  };
196
196
  }
197
- function En(t, e) {
197
+ function kn(t, e) {
198
198
  return {
199
199
  type: "GetProgressLogWithInfo",
200
200
  source: P(t),
201
201
  patternToSearch: e
202
202
  };
203
203
  }
204
- function kn(t) {
204
+ function Dn(t) {
205
205
  return {
206
206
  type: "GetLogHandle",
207
207
  source: P(t)
208
208
  };
209
209
  }
210
- function ht() {
210
+ function ft() {
211
211
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
212
212
  }
213
213
  function Ke(t) {
@@ -216,39 +216,39 @@ function Ke(t) {
216
216
  if (typeof globalThis.platforma < "u") return globalThis.platforma;
217
217
  throw new Error("Can't get platforma instance.");
218
218
  }
219
- function gt() {
219
+ function ht() {
220
220
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
221
221
  }
222
- function y() {
222
+ function v() {
223
223
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
224
224
  throw new Error("Not in config rendering context");
225
225
  }
226
- function H(t, e) {
227
- const n = gt();
226
+ function G(t, e) {
227
+ const n = ht();
228
228
  if (n === void 0) return !1;
229
229
  if (t in n.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
230
230
  return n.callbackRegistry[t] = e, !0;
231
231
  }
232
- const de = /* @__PURE__ */ new Map();
233
- function mt(t, e) {
234
- t in y().callbackRegistry || (y().callbackRegistry[t] = (n) => {
235
- for (const r of de.get(t))
232
+ const ue = /* @__PURE__ */ new Map();
233
+ function gt(t, e) {
234
+ t in v().callbackRegistry || (v().callbackRegistry[t] = (n) => {
235
+ for (const r of ue.get(t))
236
236
  r(n);
237
- }, de.set(t, [])), de.get(t).push(e);
237
+ }, ue.set(t, [])), ue.get(t).push(e);
238
238
  }
239
- class I {
239
+ class F {
240
240
  constructor(e, n = (r) => r) {
241
- D(this, "isResolved", !1);
242
- D(this, "resolvedValue");
243
- this.handle = e, this.postProcess = n, mt(e, (r) => {
241
+ k(this, "isResolved", !1);
242
+ k(this, "resolvedValue");
243
+ this.handle = e, this.postProcess = n, gt(e, (r) => {
244
244
  this.resolvedValue = n(r), this.isResolved = !0;
245
245
  });
246
246
  }
247
247
  map(e) {
248
- return new I(this.handle, (n) => e(this.postProcess(n)));
248
+ return new F(this.handle, (n) => e(this.postProcess(n)));
249
249
  }
250
250
  mapDefined(e) {
251
- return new I(this.handle, (n) => {
251
+ return new F(this.handle, (n) => {
252
252
  const r = this.postProcess(n);
253
253
  return r ? e(r) : void 0;
254
254
  });
@@ -257,10 +257,10 @@ class I {
257
257
  return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
258
258
  }
259
259
  }
260
- function ge(t, e) {
260
+ function fe(t, e) {
261
261
  return t === void 0 ? void 0 : e(t);
262
262
  }
263
- class E {
263
+ class D {
264
264
  constructor(e, n) {
265
265
  this.handle = e, this.resolvePath = n;
266
266
  }
@@ -299,47 +299,47 @@ class E {
299
299
  ...this.resolvePath,
300
300
  ...n.map((i) => typeof i == "string" ? i : i.field)
301
301
  ];
302
- return ge(
303
- y().resolveWithCommon(this.handle, e, ...n),
304
- (i) => new E(i, r)
302
+ return fe(
303
+ v().resolveWithCommon(this.handle, e, ...n),
304
+ (i) => new D(i, r)
305
305
  );
306
306
  }
307
307
  get resourceType() {
308
- return y().getResourceType(this.handle);
308
+ return v().getResourceType(this.handle);
309
309
  }
310
310
  getInputsLocked() {
311
- return y().getInputsLocked(this.handle);
311
+ return v().getInputsLocked(this.handle);
312
312
  }
313
313
  getOutputsLocked() {
314
- return y().getOutputsLocked(this.handle);
314
+ return v().getOutputsLocked(this.handle);
315
315
  }
316
316
  getIsReadyOrError() {
317
- return y().getIsReadyOrError(this.handle);
317
+ return v().getIsReadyOrError(this.handle);
318
318
  }
319
319
  getIsFinal() {
320
- return y().getIsFinal(this.handle);
320
+ return v().getIsFinal(this.handle);
321
321
  }
322
322
  getError() {
323
323
  const e = [...this.resolvePath, "error"];
324
- return ge(
325
- y().getError(this.handle),
326
- (n) => new E(n, e)
324
+ return fe(
325
+ v().getError(this.handle),
326
+ (n) => new D(n, e)
327
327
  );
328
328
  }
329
329
  listInputFields() {
330
- return y().listInputFields(this.handle);
330
+ return v().listInputFields(this.handle);
331
331
  }
332
332
  listOutputFields() {
333
- return y().listOutputFields(this.handle);
333
+ return v().listOutputFields(this.handle);
334
334
  }
335
335
  listDynamicFields() {
336
- return y().listDynamicFields(this.handle);
336
+ return v().listDynamicFields(this.handle);
337
337
  }
338
338
  getKeyValueBase64(e) {
339
- return y().getKeyValueBase64(this.handle, e);
339
+ return v().getKeyValueBase64(this.handle, e);
340
340
  }
341
341
  getKeyValueAsString(e) {
342
- return y().getKeyValueAsString(this.handle, e);
342
+ return v().getKeyValueAsString(this.handle, e);
343
343
  }
344
344
  getKeyValueAsJson(e) {
345
345
  const n = this.getKeyValueAsString(e);
@@ -347,10 +347,10 @@ class E {
347
347
  return JSON.parse(n);
348
348
  }
349
349
  getDataBase64() {
350
- return y().getDataBase64(this.handle);
350
+ return v().getDataBase64(this.handle);
351
351
  }
352
352
  getDataAsString() {
353
- return y().getDataAsString(this.handle);
353
+ return v().getDataAsString(this.handle);
354
354
  }
355
355
  getDataAsJson() {
356
356
  const e = this.getDataAsString();
@@ -363,7 +363,7 @@ class E {
363
363
  getPColumns(e = !1, n = "") {
364
364
  const r = this.parsePObjectCollection(e, n);
365
365
  return r === void 0 ? void 0 : Object.entries(r).map(([, s]) => {
366
- if (!De(s)) throw new Error(`not a PColumn (kind = ${s.spec.kind})`);
366
+ if (!ke(s)) throw new Error(`not a PColumn (kind = ${s.spec.kind})`);
367
367
  return s;
368
368
  });
369
369
  }
@@ -371,7 +371,7 @@ class E {
371
371
  *
372
372
  */
373
373
  parsePObjectCollection(e = !1, n = "") {
374
- const r = y().parsePObjectCollection(
374
+ const r = v().parsePObjectCollection(
375
375
  this.handle,
376
376
  e,
377
377
  n,
@@ -381,19 +381,19 @@ class E {
381
381
  const i = {};
382
382
  for (const [s, o] of Object.entries(r)) {
383
383
  const a = [...this.resolvePath, s];
384
- i[s] = xe(o, (l) => new E(l, a));
384
+ i[s] = be(o, (l) => new D(l, a));
385
385
  }
386
386
  return i;
387
387
  }
388
388
  getFileContentAsBase64(e) {
389
- return new I(y().getBlobContentAsBase64(this.handle, e));
389
+ return new F(v().getBlobContentAsBase64(this.handle, e));
390
390
  }
391
391
  getFileContentAsString(e) {
392
- return new I(y().getBlobContentAsString(this.handle, e));
392
+ return new F(v().getBlobContentAsString(this.handle, e));
393
393
  }
394
394
  getFileContentAsJson(e) {
395
- return new I(
396
- y().getBlobContentAsString(this.handle, e)
395
+ return new F(
396
+ v().getBlobContentAsString(this.handle, e)
397
397
  ).mapDefined((n) => JSON.parse(n));
398
398
  }
399
399
  /**
@@ -412,7 +412,7 @@ class E {
412
412
  * @returns downloaded file handle
413
413
  */
414
414
  getFileHandle() {
415
- return new I(y().getDownloadedBlobContentHandle(this.handle));
415
+ return new F(v().getDownloadedBlobContentHandle(this.handle));
416
416
  }
417
417
  /**
418
418
  * @deprecated use getFileHandle
@@ -424,7 +424,7 @@ class E {
424
424
  * @returns downloaded file handle
425
425
  */
426
426
  getRemoteFileHandle() {
427
- return new I(y().getOnDemandBlobContentHandle(this.handle));
427
+ return new F(v().getOnDemandBlobContentHandle(this.handle));
428
428
  }
429
429
  /**
430
430
  * @deprecated use getRemoteFileHandle
@@ -436,22 +436,22 @@ class E {
436
436
  * @returns the url to the extracted folder
437
437
  */
438
438
  extractArchiveAndGetURL(e) {
439
- return new I(y().extractArchiveAndGetURL(this.handle, e));
439
+ return new F(v().extractArchiveAndGetURL(this.handle, e));
440
440
  }
441
441
  getImportProgress() {
442
- return new I(y().getImportProgress(this.handle));
442
+ return new F(v().getImportProgress(this.handle));
443
443
  }
444
444
  getLastLogs(e) {
445
- return new I(y().getLastLogs(this.handle, e));
445
+ return new F(v().getLastLogs(this.handle, e));
446
446
  }
447
447
  getProgressLog(e) {
448
- return new I(y().getProgressLog(this.handle, e));
448
+ return new F(v().getProgressLog(this.handle, e));
449
449
  }
450
450
  getProgressLogWithInfo(e) {
451
- return new I(y().getProgressLogWithInfo(this.handle, e));
451
+ return new F(v().getProgressLogWithInfo(this.handle, e));
452
452
  }
453
453
  getLogHandle() {
454
- return new I(y().getLogHandle(this.handle));
454
+ return new F(v().getLogHandle(this.handle));
455
455
  }
456
456
  allFieldsResolved(e = "Input") {
457
457
  switch (e) {
@@ -477,122 +477,123 @@ class E {
477
477
  let l = (r === "Input" ? this.listInputFields() : r === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
478
478
  (u) => [u, this.resolve({ field: u, assertFieldType: r })]
479
479
  );
480
- return s && (l = l.filter((u) => u[1] !== void 0)), l.map(([u, c]) => o(u, c));
480
+ return s && (l = l.filter((u) => u[1] !== void 0)), l.map(([u, h]) => o(u, h));
481
481
  }
482
482
  }
483
- const Ve = "staging", je = "main", yt = {
483
+ const Ne = "staging", Ve = "main", mt = {
484
484
  explicitColumnsSupport: !0,
485
485
  inlineColumnsSupport: !0,
486
- activeArgs: !0
486
+ activeArgs: !0,
487
+ pTablePartitionFiltersSupport: !0
487
488
  };
488
- function Ne(t) {
489
+ function je(t) {
489
490
  return typeof t == "object" && t !== null && "__awaited_futures__" in t;
490
491
  }
491
- function me(t, e, n) {
492
+ function he(t, e, n) {
492
493
  if (e.has(n)) return;
493
494
  if (e.add(n), typeof n === "object")
494
- if (Ne(n)) n.__awaited_futures__.forEach((i) => t.add(i));
495
+ if (je(n)) n.__awaited_futures__.forEach((i) => t.add(i));
495
496
  else if (Array.isArray(n))
496
- for (const i of n) me(t, e, i);
497
+ for (const i of n) he(t, e, i);
497
498
  else
498
499
  for (const [, i] of Object.entries(n))
499
- i !== n && me(t, e, i);
500
+ i !== n && he(t, e, i);
500
501
  }
501
- function vt(t) {
502
+ function yt(t) {
502
503
  const e = /* @__PURE__ */ new Set();
503
- return me(e, /* @__PURE__ */ new Set(), t), e;
504
+ return he(e, /* @__PURE__ */ new Set(), t), e;
504
505
  }
505
- const Dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
506
+ const Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
506
507
  __proto__: null,
507
- GlobalCfgRenderCtxFeatureFlags: yt,
508
- MainAccessorName: je,
509
- StagingAccessorName: Ve,
510
- getAllFutureAwaits: vt,
511
- isFutureAwait: Ne
512
- }, Symbol.toStringTag, { value: "Module" })), bt = "pl7.app/label", wt = "pl7.app/trace", At = U.object({
513
- type: U.string(),
514
- importance: U.number().optional(),
515
- id: U.string().optional(),
516
- label: U.string()
517
- }), xt = U.array(At), Ct = 1e-3, Pt = "__LABEL__", Te = "__LABEL__@1";
518
- function $e(t, e, n = {}) {
519
- const r = /* @__PURE__ */ new Map(), i = n.forceTraceElements !== void 0 && n.forceTraceElements.length > 0 ? new Set(n.forceTraceElements) : void 0, s = /* @__PURE__ */ new Map(), o = t.map((p) => {
520
- var S, F;
521
- const m = e(p);
522
- let f, v, b;
523
- "spec" in m && typeof m.spec == "object" ? (f = m.spec, v = m.prefixTrace, b = m.suffixTrace) : f = m;
524
- const h = (S = f.annotations) == null ? void 0 : S[bt], w = (F = f.annotations) == null ? void 0 : F[wt], x = (w ? xt.safeParse(JSON.parse(w)).data : void 0) ?? [], C = [
525
- ...v ?? [],
526
- ...x,
527
- ...b ?? []
508
+ GlobalCfgRenderCtxFeatureFlags: mt,
509
+ MainAccessorName: Ve,
510
+ StagingAccessorName: Ne,
511
+ getAllFutureAwaits: yt,
512
+ isFutureAwait: je
513
+ }, Symbol.toStringTag, { value: "Module" })), bt = "pl7.app/label", vt = "pl7.app/trace", Ct = $.object({
514
+ type: $.string(),
515
+ importance: $.number().optional(),
516
+ id: $.string().optional(),
517
+ label: $.string()
518
+ }), St = $.array(Ct), wt = 1e-3, At = "__LABEL__", xe = "__LABEL__@1";
519
+ function Je(t, e, n = {}) {
520
+ const r = /* @__PURE__ */ new Map(), i = n.forceTraceElements !== void 0 && n.forceTraceElements.length > 0 ? new Set(n.forceTraceElements) : void 0, s = /* @__PURE__ */ new Map(), o = t.map((d) => {
521
+ var c, m;
522
+ const b = e(d);
523
+ let p, y, C;
524
+ "spec" in b && typeof b.spec == "object" ? (p = b.spec, y = b.prefixTrace, C = b.suffixTrace) : p = b;
525
+ const E = (c = p.annotations) == null ? void 0 : c[bt], _ = (m = p.annotations) == null ? void 0 : m[vt], w = (_ ? St.safeParse(JSON.parse(_)).data : void 0) ?? [], A = [
526
+ ...y ?? [],
527
+ ...w,
528
+ ...C ?? []
528
529
  ];
529
- if (h !== void 0) {
530
- const k = { label: h, type: Pt, importance: -2 };
531
- n.addLabelAsSuffix ? C.push(k) : C.splice(0, 0, k);
530
+ if (E !== void 0) {
531
+ const T = { label: E, type: At, importance: -2 };
532
+ n.addLabelAsSuffix ? A.push(T) : A.splice(0, 0, T);
532
533
  }
533
- const A = [], T = /* @__PURE__ */ new Map();
534
- for (let k = C.length - 1; k >= 0; --k) {
535
- const { type: W } = C[k], j = C[k].importance ?? 0, $ = (T.get(W) ?? 0) + 1;
536
- T.set(W, $);
537
- const K = `${W}@${$}`;
534
+ const S = [], I = /* @__PURE__ */ new Map();
535
+ for (let T = A.length - 1; T >= 0; --T) {
536
+ const { type: U } = A[T], V = A[T].importance ?? 0, J = (I.get(U) ?? 0) + 1;
537
+ I.set(U, J);
538
+ const K = `${U}@${J}`;
538
539
  s.set(K, (s.get(K) ?? 0) + 1), r.set(
539
540
  K,
540
541
  Math.max(
541
542
  r.get(K) ?? Number.NEGATIVE_INFINITY,
542
- j - (C.length - k) * Ct
543
+ V - (A.length - T) * wt
543
544
  )
544
- ), A.push({ ...C[k], fullType: K, occurrenceIndex: $ });
545
+ ), S.push({ ...A[T], fullType: K, occurrenceIndex: J });
545
546
  }
546
- return A.reverse(), {
547
- value: p,
548
- spec: f,
549
- label: h,
550
- fullTrace: A
547
+ return S.reverse(), {
548
+ value: d,
549
+ spec: p,
550
+ label: E,
551
+ fullTrace: S
551
552
  };
552
553
  }), a = [], l = [], u = [...r];
553
- u.sort(([, p], [, m]) => m - p);
554
- for (const [p] of u)
555
- p.endsWith("@1") || s.get(p) === t.length ? a.push(p) : l.push(p);
556
- const c = (p, m = !1) => {
557
- const f = [];
558
- for (let v = 0; v < o.length; v++) {
559
- const b = o[v], h = b.fullTrace.filter((C) => p.has(C.fullType) || i && i.has(C.type));
560
- if (h.length === 0)
561
- if (m)
562
- f.push({
554
+ u.sort(([, d], [, b]) => b - d);
555
+ for (const [d] of u)
556
+ d.endsWith("@1") || s.get(d) === t.length ? a.push(d) : l.push(d);
557
+ const h = (d, b = !1) => {
558
+ const p = [];
559
+ for (let y = 0; y < o.length; y++) {
560
+ const C = o[y], E = C.fullTrace.filter((A) => d.has(A.fullType) || i && i.has(A.type));
561
+ if (E.length === 0)
562
+ if (b)
563
+ p.push({
563
564
  label: "Unlabeled",
564
- value: b.value
565
+ value: C.value
565
566
  });
566
567
  else return;
567
- const w = h.map((C) => C.label), x = n.separator ?? " / ";
568
- f.push({
569
- label: w.join(x),
570
- value: b.value
568
+ const _ = E.map((A) => A.label), w = n.separator ?? " / ";
569
+ p.push({
570
+ label: _.join(w),
571
+ value: C.value
571
572
  });
572
573
  }
573
- return f;
574
+ return p;
574
575
  };
575
576
  if (a.length === 0) {
576
577
  if (l.length !== 0) throw new Error("Non-empty secondary types list while main types list is empty.");
577
- return c(new Set(Te), !0);
578
- }
579
- let d = 0, g = -1;
580
- for (; d < a.length; ) {
581
- const p = /* @__PURE__ */ new Set();
582
- n.includeNativeLabel && p.add(Te);
583
- for (let f = 0; f < d; ++f) p.add(a[f]);
584
- g >= 0 && p.add(a[g]);
585
- const m = c(p);
586
- if (m !== void 0 && new Set(m.map((f) => f.label)).size === t.length) return m;
587
- g++, g >= a.length && (d++, g = d);
588
- }
589
- return c(/* @__PURE__ */ new Set([...a, ...l]), !0);
590
- }
591
- const Z = "PColumnData/", se = Z + "ResourceMap", oe = Z + "Partitioned/ResourceMap", q = Z + "JsonPartitioned", B = Z + "BinaryPartitioned", Je = Z + "Partitioned/", ae = Je + "JsonPartitioned", z = Je + "BinaryPartitioned";
592
- function Me(t, e, n, r = [], i) {
578
+ return h(new Set(xe), !0);
579
+ }
580
+ let f = 0, g = -1;
581
+ for (; f < a.length; ) {
582
+ const d = /* @__PURE__ */ new Set();
583
+ n.includeNativeLabel && d.add(xe);
584
+ for (let p = 0; p < f; ++p) d.add(a[p]);
585
+ g >= 0 && d.add(a[g]);
586
+ const b = h(d);
587
+ if (b !== void 0 && new Set(b.map((p) => p.label)).size === t.length) return b;
588
+ g++, g >= a.length && (f++, g = f);
589
+ }
590
+ return h(/* @__PURE__ */ new Set([...a, ...l]), !0);
591
+ }
592
+ const Q = "PColumnData/", ie = Q + "ResourceMap", se = Q + "Partitioned/ResourceMap", H = Q + "JsonPartitioned", B = Q + "BinaryPartitioned", Me = Q + "Partitioned/", oe = Me + "JsonPartitioned", q = Me + "BinaryPartitioned";
593
+ function $e(t, e, n, r = [], i) {
593
594
  if (t === void 0) return !1;
594
595
  switch (t.resourceType.name) {
595
- case se: {
596
+ case ie: {
596
597
  let s = t.getInputsLocked();
597
598
  for (const o of t.listInputFields()) {
598
599
  const a = t.resolve({ field: o, assertFieldType: "Input" }), l = [...r, ...JSON.parse(o)], u = a === void 0 ? void 0 : e(a);
@@ -600,13 +601,13 @@ function Me(t, e, n, r = [], i) {
600
601
  }
601
602
  return s;
602
603
  }
603
- case oe: {
604
+ case se: {
604
605
  let s = t.getInputsLocked();
605
606
  for (const o of t.listInputFields()) {
606
607
  const a = t.resolve({ field: o, assertFieldType: "Input" });
607
608
  if (a === void 0) s = !1;
608
609
  else {
609
- const l = [...r, ...JSON.parse(o)], u = Me(
610
+ const l = [...r, ...JSON.parse(o)], u = $e(
610
611
  a,
611
612
  e,
612
613
  n,
@@ -624,53 +625,53 @@ function Me(t, e, n, r = [], i) {
624
625
  }
625
626
  function On(t, e, n = !1) {
626
627
  const r = [];
627
- return { isComplete: Me(t, e, r, [], n), data: r };
628
+ return { isComplete: $e(t, e, r, [], n), data: r };
628
629
  }
629
- const ye = (t) => {
630
+ const ge = (t) => {
630
631
  if (t.endsWith(".index"))
631
632
  return { baseKey: t.substring(0, t.length - 6), type: "index" };
632
633
  if (t.endsWith(".values"))
633
634
  return { baseKey: t.substring(0, t.length - 7), type: "values" };
634
635
  throw new Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
635
636
  };
636
- function St(t) {
637
+ function Pt(t) {
637
638
  if (!t) return;
638
639
  const e = t.resourceType.name, n = t.getDataAsJson(), r = [];
639
640
  let i = 0;
640
641
  switch (e) {
641
- case se:
642
+ case ie:
642
643
  i = n.keyLength;
643
644
  break;
644
- case oe:
645
+ case se:
645
646
  i = n.partitionKeyLength + n.keyLength;
646
647
  break;
647
- case q:
648
+ case H:
648
649
  case B:
649
650
  i = n.partitionKeyLength;
650
651
  break;
651
- case z:
652
- case ae:
652
+ case q:
653
+ case oe:
653
654
  i = n.superPartitionKeyLength + n.partitionKeyLength;
654
655
  break;
655
656
  }
656
657
  switch (e) {
657
- case se:
658
- case q:
658
+ case ie:
659
+ case H:
659
660
  case B:
660
661
  for (let s of t.listInputFields()) {
661
- e === B && (s = ye(s).baseKey);
662
+ e === B && (s = ge(s).baseKey);
662
663
  const o = [...JSON.parse(s)];
663
664
  r.push(o);
664
665
  }
665
666
  break;
667
+ case se:
668
+ case q:
666
669
  case oe:
667
- case z:
668
- case ae:
669
670
  for (const s of t.listInputFields()) {
670
671
  const o = [...JSON.parse(s)], a = t.resolve({ field: s, assertFieldType: "Input" });
671
672
  if (a !== void 0)
672
673
  for (let l of a.listInputFields()) {
673
- e === z && (l = ye(l).baseKey);
674
+ e === q && (l = ge(l).baseKey);
674
675
  const u = [...o, ...JSON.parse(l)];
675
676
  r.push(u);
676
677
  }
@@ -679,7 +680,7 @@ function St(t) {
679
680
  }
680
681
  return { data: r, keyLength: i };
681
682
  }
682
- function _t(t) {
683
+ function xt(t) {
683
684
  if (t.type !== "JsonPartitioned" && t.type !== "BinaryPartitioned")
684
685
  throw new Error(`Splitting requires Partitioned DataInfoEntries, got ${t.type}`);
685
686
  const { parts: e, partitionKeyLength: n } = t, r = [];
@@ -698,11 +699,11 @@ function _t(t) {
698
699
  }
699
700
  return r.map((i) => Array.from(i.values()));
700
701
  }
701
- function It(t) {
702
+ function _t(t) {
702
703
  if (t === void 0) return;
703
- if (Oe(t))
704
- return _t(t);
705
- const e = St(t);
704
+ if (De(t))
705
+ return xt(t);
706
+ const e = Pt(t);
706
707
  if (!e) return;
707
708
  const { data: n, keyLength: r } = e, i = [];
708
709
  for (let s = 0; s < r; ++s)
@@ -715,16 +716,16 @@ function It(t) {
715
716
  }
716
717
  return i.map((s) => Array.from(s.values()));
717
718
  }
718
- function ve(t, e = []) {
719
+ function me(t, e = []) {
719
720
  if (t === void 0 || !t.getIsReadyOrError()) return;
720
721
  const n = t.resourceType.name, r = t.getDataAsJson();
721
- if (e.length > 0 && (n === ae || n === z))
722
+ if (e.length > 0 && (n === oe || n === q))
722
723
  throw new Error(`Unexpected nested super-partitioned resource: ${n}`);
723
724
  switch (n) {
725
+ case ie:
724
726
  case se:
725
- case oe:
726
727
  throw new Error(`Only data columns are supported, got: ${n}`);
727
- case q: {
728
+ case H: {
728
729
  if (typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
729
730
  throw new Error(`Missing partitionKeyLength in metadata for ${n}`);
730
731
  const i = [];
@@ -745,7 +746,7 @@ function ve(t, e = []) {
745
746
  throw new Error(`Missing partitionKeyLength in metadata for ${n}`);
746
747
  const i = [], s = /* @__PURE__ */ new Map();
747
748
  for (const o of t.listInputFields()) {
748
- const a = ye(o), l = t.resolve({ field: o, assertFieldType: "Input" });
749
+ const a = ge(o), l = t.resolve({ field: o, assertFieldType: "Input" });
749
750
  if (l === void 0) return;
750
751
  let u = s.get(a.baseKey);
751
752
  u || (u = {}, s.set(a.baseKey, u)), a.type === "index" ? u.index = l : u.values = l;
@@ -767,16 +768,16 @@ function ve(t, e = []) {
767
768
  parts: i
768
769
  };
769
770
  }
770
- case ae: {
771
+ case oe: {
771
772
  if (typeof (r == null ? void 0 : r.superPartitionKeyLength) != "number" || typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
772
773
  throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n}`);
773
774
  const i = r.superPartitionKeyLength + r.partitionKeyLength, s = [];
774
775
  for (const o of t.listInputFields()) {
775
776
  const a = t.resolve({ field: o, assertFieldType: "Input" });
776
777
  if (a === void 0) return;
777
- if (a.resourceType.name !== q)
778
- throw new Error(`Expected ${q} inside ${n}, but got ${a.resourceType.name}`);
779
- const l = ve(a, JSON.parse(o));
778
+ if (a.resourceType.name !== H)
779
+ throw new Error(`Expected ${H} inside ${n}, but got ${a.resourceType.name}`);
780
+ const l = me(a, JSON.parse(o));
780
781
  if (l === void 0) return;
781
782
  if (l.type !== "JsonPartitioned")
782
783
  throw new Error(`Unexpected inner result type for ${n}: ${l.type}`);
@@ -788,7 +789,7 @@ function ve(t, e = []) {
788
789
  parts: s
789
790
  };
790
791
  }
791
- case z: {
792
+ case q: {
792
793
  if (typeof (r == null ? void 0 : r.superPartitionKeyLength) != "number" || typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
793
794
  throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n}`);
794
795
  const i = r.superPartitionKeyLength + r.partitionKeyLength, s = [];
@@ -797,7 +798,7 @@ function ve(t, e = []) {
797
798
  if (a === void 0) return;
798
799
  if (a.resourceType.name !== B)
799
800
  throw new Error(`Expected ${B} inside ${n}, but got ${a.resourceType.name}`);
800
- const l = ve(a, JSON.parse(o));
801
+ const l = me(a, JSON.parse(o));
801
802
  if (l === void 0) return;
802
803
  if (l.type !== "BinaryPartitioned")
803
804
  throw new Error(`Unexpected inner result type for ${n}: ${l.type}`);
@@ -813,15 +814,15 @@ function ve(t, e = []) {
813
814
  throw new Error(`Unknown resource type: ${n}`);
814
815
  }
815
816
  }
816
- function Tt(t) {
817
+ function It(t) {
817
818
  if (t !== void 0) {
818
- if (Oe(t)) return t;
819
- if (Ce(t)) return Qe(t);
820
- if (t instanceof E) return ve(t);
819
+ if (De(t)) return t;
820
+ if (ve(t)) return Ye(t);
821
+ if (t instanceof D) return me(t);
821
822
  throw new Error(`Unexpected input type: ${typeof t}`);
822
823
  }
823
824
  }
824
- function Lt(t, e) {
825
+ function Tt(t, e) {
825
826
  const n = [...e].sort((s, o) => o[0] - s[0]);
826
827
  if (t.type === "JsonPartitioned" || t.type === "BinaryPartitioned") {
827
828
  const { partitionKeyLength: s } = t;
@@ -881,45 +882,45 @@ function Lt(t, e) {
881
882
  }
882
883
  }
883
884
  }
884
- function Et(t) {
885
+ function Lt(t) {
885
886
  if (!Array.isArray(t)) return !1;
886
887
  if (t.length === 0) return !0;
887
888
  const e = t[0];
888
889
  return typeof e == "object" && e !== null && "key" in e && "val" in e;
889
890
  }
890
- class kt {
891
+ class Ft {
891
892
  constructor(e) {
892
893
  this.columns = e;
893
894
  }
894
895
  selectColumns(e) {
895
- const n = typeof e == "function" ? e : X(e);
896
+ const n = typeof e == "function" ? e : Y(e);
896
897
  return this.columns.filter((r) => n(r.spec));
897
898
  }
898
899
  }
899
- function Dt(t) {
900
+ function Et(t) {
900
901
  if (t)
901
902
  return t.map((e) => ({
902
- type: `split:${nt(e.axisId)}`,
903
+ type: `split:${et(e.axisId)}`,
903
904
  label: e.label,
904
905
  importance: 1e6
905
906
  // High importance for split filters in labels
906
907
  }));
907
908
  }
908
- function Ot(t) {
909
+ function kt(t) {
909
910
  if (t)
910
911
  return t.map((e) => [e.axisIdx, e.value]);
911
912
  }
912
- function Rt(t, e) {
913
+ function Dt(t, e) {
913
914
  if (!e || e.length === 0) return t;
914
915
  const n = [...e].sort((r, i) => r[0] - i[0]);
915
916
  return Re({ id: t, axisFilters: n });
916
917
  }
917
- function Le(t) {
918
+ function _e(t) {
918
919
  if (!t || typeof t != "object") return !1;
919
920
  const e = t, n = e.domain && typeof e.domain == "object" && Object.values(e.domain).some((i) => typeof i == "object" && i !== null && "anchor" in i), r = e.axes && Array.isArray(e.axes) && e.axes.some((i) => typeof i == "object" && i !== null && "anchor" in i);
920
921
  return !!e.domainAnchor || n || r;
921
922
  }
922
- function Ft(t) {
923
+ function Rt(t) {
923
924
  if (typeof t != "object" || !("axes" in t) || t.axes === void 0)
924
925
  return [];
925
926
  const e = t.axes.map((n, r) => typeof n == "object" && "split" in n && n.split === !0 ? r : -1).filter((n) => n !== -1);
@@ -927,11 +928,11 @@ function Ft(t) {
927
928
  throw new Error("Axis splitting is not supported when `partialAxesMatch` is defined.");
928
929
  return e.sort((n, r) => n - r), e;
929
930
  }
930
- class le {
931
+ class ae {
931
932
  constructor() {
932
- D(this, "defaultProviderStore", []);
933
- D(this, "providers", [new kt(this.defaultProviderStore)]);
934
- D(this, "axisLabelProviders", []);
933
+ k(this, "defaultProviderStore", []);
934
+ k(this, "providers", [new Ft(this.defaultProviderStore)]);
935
+ k(this, "axisLabelProviders", []);
935
936
  }
936
937
  addColumnProvider(e) {
937
938
  return this.providers.push(e), this;
@@ -959,129 +960,129 @@ class le {
959
960
  };
960
961
  let u = () => !1;
961
962
  if (a) {
962
- const f = (Array.isArray(a) ? a : [a]).map((v) => {
963
- if (Le(v)) {
963
+ const p = (Array.isArray(a) ? a : [a]).map((y) => {
964
+ if (_e(y)) {
964
965
  if (!r)
965
966
  throw new Error("Anchored selectors in exclude require an AnchoredIdDeriver to be provided in options.");
966
- return X(Pe(r.anchors, v, n));
967
+ return Y(Ce(r.anchors, y, n));
967
968
  } else
968
- return X(v);
969
+ return Y(y);
969
970
  });
970
- u = (v) => f.some((b) => b(v));
971
+ u = (y) => p.some((C) => C(y));
971
972
  }
972
- const c = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], d = [], g = /* @__PURE__ */ new Set();
973
- for (const f of c) {
974
- const v = Le(f);
975
- let b;
976
- if (v) {
973
+ const h = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], f = [], g = /* @__PURE__ */ new Set();
974
+ for (const p of h) {
975
+ const y = _e(p);
976
+ let C;
977
+ if (y) {
977
978
  if (!r)
978
979
  throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");
979
- b = Pe(r.anchors, f, n);
980
+ C = Ce(r.anchors, p, n);
980
981
  } else
981
- b = f;
982
- const h = /* @__PURE__ */ new Set(), w = [];
983
- for (const A of this.providers) {
984
- const T = A.selectColumns(b);
985
- for (const S of T) {
986
- if (u(S.spec)) continue;
987
- if (h.has(S.id))
988
- throw new Error(`Duplicate column id ${S.id} in provider ${A.constructor.name}`);
989
- const F = Ze(S.spec);
990
- g.has(F) || (h.add(S.id), g.add(F), w.push(S));
982
+ C = p;
983
+ const E = /* @__PURE__ */ new Set(), _ = [];
984
+ for (const S of this.providers) {
985
+ const I = S.selectColumns(C);
986
+ for (const c of I) {
987
+ if (u(c.spec)) continue;
988
+ if (E.has(c.id))
989
+ throw new Error(`Duplicate column id ${c.id} in provider ${S.constructor.name}`);
990
+ const m = Xe(c.spec);
991
+ g.has(m) || (E.add(c.id), g.add(m), _.push(c));
991
992
  }
992
993
  }
993
- if (w.length === 0) continue;
994
- const x = Ft(f), C = x.length > 0;
995
- for (const A of w) {
996
- if (!ne(A.spec)) continue;
997
- const T = A.spec;
998
- if (C) {
999
- if (Et(A.data))
1000
- throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${A.id}`);
1001
- const S = Tt(A.data);
1002
- if (!S) {
994
+ if (_.length === 0) continue;
995
+ const w = Rt(p), A = w.length > 0;
996
+ for (const S of _) {
997
+ if (!te(S.spec)) continue;
998
+ const I = S.spec;
999
+ if (A) {
1000
+ if (Lt(S.data))
1001
+ throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${S.id}`);
1002
+ const c = It(S.data);
1003
+ if (!c) {
1003
1004
  if (s) continue;
1004
1005
  return;
1005
1006
  }
1006
- if (!et(S))
1007
- throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${S.type} for column ${A.id}`);
1008
- const F = It(S), k = x[x.length - 1];
1009
- if (k >= S.partitionKeyLength)
1010
- throw new Error(`Not enough partition keys (${S.partitionKeyLength}) for requested split axes (max index ${k}) in column ${T.name}`);
1011
- const W = x.map((_) => this.findLabels(O(T.axesSpec[_]))), j = [], $ = (_, G) => {
1012
- if (G >= x.length) {
1013
- if (j.push([..._]), j.length > 1e4)
1007
+ if (!Qe(c))
1008
+ throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${c.type} for column ${S.id}`);
1009
+ const m = _t(c), T = w[w.length - 1];
1010
+ if (T >= c.partitionKeyLength)
1011
+ throw new Error(`Not enough partition keys (${c.partitionKeyLength}) for requested split axes (max index ${T}) in column ${I.name}`);
1012
+ const U = w.map((L) => this.findLabels(R(I.axesSpec[L]))), V = [], J = (L, W) => {
1013
+ if (W >= w.length) {
1014
+ if (V.push([...L]), V.length > 1e4)
1014
1015
  throw new Error("Too many key combinations, aborting.");
1015
1016
  return;
1016
1017
  }
1017
- const N = x[G];
1018
- if (N >= F.length)
1019
- throw new Error(`Axis index ${N} out of bounds for unique keys array (length ${F.length}) during split key generation for column ${A.id}`);
1020
- const J = F[N];
1021
- if (!J || J.length === 0) {
1022
- j.length = 0;
1018
+ const j = w[W];
1019
+ if (j >= m.length)
1020
+ throw new Error(`Axis index ${j} out of bounds for unique keys array (length ${m.length}) during split key generation for column ${S.id}`);
1021
+ const M = m[j];
1022
+ if (!M || M.length === 0) {
1023
+ V.length = 0;
1023
1024
  return;
1024
1025
  }
1025
- for (const ee of J)
1026
- _.push(ee), $(_, G + 1), _.pop();
1026
+ for (const Z of M)
1027
+ L.push(Z), J(L, W + 1), L.pop();
1027
1028
  };
1028
- if ($([], 0), j.length === 0)
1029
+ if (J([], 0), V.length === 0)
1029
1030
  continue;
1030
- const K = [...T.axesSpec], Ge = x.map((_) => _);
1031
- for (let _ = x.length - 1; _ >= 0; _--)
1032
- K.splice(x[_], 1);
1033
- const He = { ...T, axesSpec: K };
1034
- for (const _ of j) {
1035
- const G = _.map((N, J) => {
1036
- const ee = Ge[J], qe = O(T.axesSpec[ee]), ce = W[J], ze = (ce == null ? void 0 : ce[N]) ?? String(N);
1037
- return { axisIdx: ee, axisId: qe, value: N, label: ze };
1031
+ const K = [...I.axesSpec], Ue = w.map((L) => L);
1032
+ for (let L = w.length - 1; L >= 0; L--)
1033
+ K.splice(w[L], 1);
1034
+ const We = { ...I, axesSpec: K };
1035
+ for (const L of V) {
1036
+ const W = L.map((j, M) => {
1037
+ const Z = Ue[M], Ge = R(I.axesSpec[Z]), le = U[M], He = (le == null ? void 0 : le[j]) ?? String(j);
1038
+ return { axisIdx: Z, axisId: Ge, value: j, label: He };
1038
1039
  });
1039
- d.push({
1040
+ f.push({
1040
1041
  type: "split",
1041
- originalColumn: A,
1042
- spec: T,
1043
- adjustedSpec: He,
1044
- dataEntries: S,
1045
- axisFilters: G
1042
+ originalColumn: S,
1043
+ spec: I,
1044
+ adjustedSpec: We,
1045
+ dataEntries: c,
1046
+ axisFilters: W
1046
1047
  });
1047
1048
  }
1048
1049
  } else
1049
- d.push({
1050
+ f.push({
1050
1051
  type: "direct",
1051
- originalColumn: A,
1052
- spec: T,
1053
- adjustedSpec: T
1052
+ originalColumn: S,
1053
+ spec: I,
1054
+ adjustedSpec: I
1054
1055
  });
1055
1056
  }
1056
1057
  }
1057
- if (d.length === 0) return [];
1058
- const p = $e(
1059
- d,
1060
- (f) => ({
1061
- spec: f.spec,
1062
- suffixTrace: f.type === "split" ? Dt(f.axisFilters) : void 0
1058
+ if (f.length === 0) return [];
1059
+ const d = Je(
1060
+ f,
1061
+ (p) => ({
1062
+ spec: p.spec,
1063
+ suffixTrace: p.type === "split" ? Et(p.axisFilters) : void 0
1063
1064
  }),
1064
1065
  l
1065
- ), m = [];
1066
- for (const { value: f, label: v } of p) {
1067
- const { originalColumn: b, spec: h } = f, w = f.type === "split" ? f.axisFilters : void 0, x = Ot(w);
1068
- let C;
1069
- r ? C = r.deriveS(h, x) : C = Rt(b.id, x);
1070
- let A = { ...f.adjustedSpec };
1071
- o && (A = {
1072
- ...A,
1066
+ ), b = [];
1067
+ for (const { value: p, label: y } of d) {
1068
+ const { originalColumn: C, spec: E } = p, _ = p.type === "split" ? p.axisFilters : void 0, w = kt(_);
1069
+ let A;
1070
+ r ? A = r.deriveS(E, w) : A = Dt(C.id, w);
1071
+ let S = { ...p.adjustedSpec };
1072
+ o && (S = {
1073
+ ...S,
1073
1074
  annotations: {
1074
- ...A.annotations ?? {},
1075
- "pl7.app/label": v
1075
+ ...S.annotations ?? {},
1076
+ "pl7.app/label": y
1076
1077
  }
1077
- }), m.push({
1078
- id: C,
1079
- spec: A,
1080
- data: () => f.type === "split" ? tt(Lt(f.dataEntries, x)) : f.originalColumn.data,
1081
- label: v
1078
+ }), b.push({
1079
+ id: A,
1080
+ spec: S,
1081
+ data: () => p.type === "split" ? Ze(Tt(p.dataEntries, w)) : p.originalColumn.data,
1082
+ label: y
1082
1083
  });
1083
1084
  }
1084
- return m;
1085
+ return b;
1085
1086
  }
1086
1087
  getColumns(e, n) {
1087
1088
  const r = this.getUniversalEntries(e, {
@@ -1106,19 +1107,19 @@ class le {
1106
1107
  return i;
1107
1108
  }
1108
1109
  }
1109
- function pe(t, e) {
1110
+ function ce(t, e) {
1110
1111
  if (t === void 0) return e === void 0;
1111
1112
  if (e === void 0) return !0;
1112
1113
  for (const n in e)
1113
1114
  if (t[n] !== e[n]) return !1;
1114
1115
  return !0;
1115
1116
  }
1116
- function Ee(t) {
1117
- return xe(t, (e) => e instanceof E ? e.handle : Ce(e) ? lt(e, (n) => n.handle) : e);
1117
+ function Ie(t) {
1118
+ return be(t, (e) => e instanceof D ? e.handle : ve(e) ? ot(e, (n) => n.handle) : e);
1118
1119
  }
1119
- class Kt {
1120
+ class Ot {
1120
1121
  constructor() {
1121
- D(this, "ctx", y());
1122
+ k(this, "ctx", v());
1122
1123
  }
1123
1124
  /**
1124
1125
  * @deprecated use getOptions()
@@ -1127,9 +1128,9 @@ class Kt {
1127
1128
  return this.ctx.calculateOptions(e);
1128
1129
  }
1129
1130
  getOptions(e, n) {
1130
- const r = typeof e == "function" ? e : X(e), i = this.getSpecs().entries.filter((a) => r(a.obj));
1131
+ const r = typeof e == "function" ? e : Y(e), i = this.getSpecs().entries.filter((a) => r(a.obj));
1131
1132
  let s = {}, o = !1;
1132
- return typeof n < "u" && (typeof n == "function" ? s = n : typeof n == "object" && ("includeNativeLabel" in n || "separator" in n || "addLabelAsSuffix" in n ? s = n : (n = n, s = n.label ?? {}, o = n.refsWithEnrichments ?? !1))), typeof s == "object" ? $e(i, (a) => a.obj, s ?? {}).map(({ value: { ref: a }, label: l }) => ({
1133
+ return typeof n < "u" && (typeof n == "function" ? s = n : typeof n == "object" && ("includeNativeLabel" in n || "separator" in n || "addLabelAsSuffix" in n ? s = n : (n = n, s = n.label ?? {}, o = n.refsWithEnrichments ?? !1))), typeof s == "object" ? Je(i, (a) => a.obj, s ?? {}).map(({ value: { ref: a }, label: l }) => ({
1133
1134
  ref: Se(a, o),
1134
1135
  label: l
1135
1136
  })) : i.map(({ ref: a, obj: l }) => ({
@@ -1138,17 +1139,17 @@ class Kt {
1138
1139
  }));
1139
1140
  }
1140
1141
  resolveAnchorCtx(e) {
1141
- if (e instanceof _e) return e;
1142
+ if (e instanceof we) return e;
1142
1143
  const n = {};
1143
1144
  for (const [r, i] of Object.entries(e))
1144
- if (rt(i)) {
1145
+ if (tt(i)) {
1145
1146
  const s = this.getPColumnSpecByRef(i);
1146
1147
  if (!s)
1147
1148
  return;
1148
1149
  n[r] = s;
1149
1150
  } else
1150
1151
  n[r] = i;
1151
- return new _e(n);
1152
+ return new we(n);
1152
1153
  }
1153
1154
  /**
1154
1155
  * Returns columns that match the provided anchors and selectors. It applies axis filters and label derivation.
@@ -1161,7 +1162,7 @@ class Kt {
1161
1162
  getAnchoredPColumns(e, n, r) {
1162
1163
  const i = this.resolveAnchorCtx(e);
1163
1164
  if (i)
1164
- return new le().addColumnProvider(this).addAxisLabelProvider(this).getColumns(n, {
1165
+ return new ae().addColumnProvider(this).addAxisLabelProvider(this).getColumns(n, {
1165
1166
  ...r,
1166
1167
  anchorCtx: i
1167
1168
  });
@@ -1198,7 +1199,7 @@ class Kt {
1198
1199
  getCanonicalOptions(e, n, r) {
1199
1200
  const i = this.resolveAnchorCtx(e);
1200
1201
  if (!i) return;
1201
- const s = new le().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(n, {
1202
+ const s = new ae().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(n, {
1202
1203
  ...r,
1203
1204
  anchorCtx: i
1204
1205
  });
@@ -1222,7 +1223,7 @@ class Kt {
1222
1223
  ref: n.ref,
1223
1224
  obj: {
1224
1225
  ...n.obj,
1225
- data: new E(n.obj.data, [n.ref.blockId, n.ref.name])
1226
+ data: new D(n.obj.data, [n.ref.blockId, n.ref.name])
1226
1227
  }
1227
1228
  }))
1228
1229
  };
@@ -1241,9 +1242,9 @@ class Kt {
1241
1242
  ref: n.ref,
1242
1243
  obj: {
1243
1244
  ...n.obj,
1244
- data: it(
1245
+ data: nt(
1245
1246
  n.obj.data,
1246
- (r) => new E(r, [n.ref.blockId, n.ref.name])
1247
+ (r) => new D(r, [n.ref.blockId, n.ref.name])
1247
1248
  )
1248
1249
  }
1249
1250
  }))
@@ -1270,9 +1271,9 @@ class Kt {
1270
1271
  )) == null ? void 0 : r.obj;
1271
1272
  const n = this.ctx.getDataFromResultPoolByRef(e.blockId, e.name);
1272
1273
  if (n)
1273
- return xe(
1274
+ return be(
1274
1275
  n,
1275
- (i) => new E(i, [e.blockId, e.name])
1276
+ (i) => new D(i, [e.blockId, e.name])
1276
1277
  );
1277
1278
  }
1278
1279
  /**
@@ -1283,7 +1284,7 @@ class Kt {
1283
1284
  getPColumnByRef(e) {
1284
1285
  const n = this.getDataByRef(e);
1285
1286
  if (n)
1286
- return st(n);
1287
+ return rt(n);
1287
1288
  }
1288
1289
  /**
1289
1290
  * Returns spec associated with the ref ensuring that it is a p-column spec.
@@ -1293,7 +1294,7 @@ class Kt {
1293
1294
  getPColumnSpecByRef(e) {
1294
1295
  const n = this.getSpecByRef(e);
1295
1296
  if (n) {
1296
- if (!ne(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
1297
+ if (!te(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
1297
1298
  return n;
1298
1299
  }
1299
1300
  }
@@ -1312,13 +1313,13 @@ class Kt {
1312
1313
  findDataWithCompatibleSpec(e) {
1313
1314
  const n = [];
1314
1315
  e: for (const r of this.getData().entries) {
1315
- if (!ne(r.obj.spec))
1316
+ if (!te(r.obj.spec))
1316
1317
  continue;
1317
1318
  const i = r.obj.spec;
1318
- if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && pe(e.domain, i.domain)) {
1319
+ if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && ce(e.domain, i.domain)) {
1319
1320
  for (let s = 0; s < e.axesSpec.length; ++s) {
1320
1321
  const o = e.axesSpec[s], a = i.axesSpec[s];
1321
- if (o.name !== a.name || o.type !== a.type || !pe(o.domain, a.domain))
1322
+ if (o.name !== a.name || o.type !== a.type || !ce(o.domain, a.domain))
1322
1323
  continue e;
1323
1324
  }
1324
1325
  n.push(r.obj);
@@ -1333,9 +1334,9 @@ class Kt {
1333
1334
  findLabels(e) {
1334
1335
  const n = this.getData();
1335
1336
  for (const r of n.entries) {
1336
- if (!De(r.obj)) continue;
1337
+ if (!ke(r.obj)) continue;
1337
1338
  const i = r.obj.spec;
1338
- if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type && pe(e.domain, i.axesSpec[0].domain)) {
1339
+ if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type && ce(e.domain, i.axesSpec[0].domain)) {
1339
1340
  if (r.obj.data.resourceType.name !== "PColumnData/Json")
1340
1341
  throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
1341
1342
  return Object.fromEntries(
@@ -1354,8 +1355,8 @@ class Kt {
1354
1355
  * @returns An array of PColumn objects matching the selectors. Data is loaded on first access.
1355
1356
  */
1356
1357
  selectColumns(e) {
1357
- const n = typeof e == "function" ? e : X(e);
1358
- return this.getSpecs().entries.filter(({ obj: i }) => ne(i) ? n(i) : !1).map(({ ref: i, obj: s }) => {
1358
+ const n = typeof e == "function" ? e : Y(e);
1359
+ return this.getSpecs().entries.filter(({ obj: i }) => te(i) ? n(i) : !1).map(({ ref: i, obj: s }) => {
1359
1360
  const o = s;
1360
1361
  let a = null;
1361
1362
  const l = this;
@@ -1385,40 +1386,58 @@ class Kt {
1385
1386
  return r;
1386
1387
  }
1387
1388
  }
1388
- class te {
1389
+ class ee {
1389
1390
  constructor() {
1390
- D(this, "ctx");
1391
- D(this, "args");
1392
- D(this, "uiState");
1391
+ k(this, "ctx");
1392
+ k(this, "_argsCache");
1393
+ k(this, "_uiStateCache");
1393
1394
  // lazy rendering because this feature is rarely used
1394
- D(this, "_activeArgsCache");
1395
- D(this, "resultPool", new Kt());
1396
- this.ctx = y(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
1395
+ k(this, "_activeArgsCache");
1396
+ k(this, "resultPool", new Ot());
1397
+ this.ctx = v();
1398
+ }
1399
+ get args() {
1400
+ if (this._argsCache === void 0) {
1401
+ const e = this.ctx.args, n = typeof e == "function" ? e() : e;
1402
+ this._argsCache = { v: JSON.parse(n) };
1403
+ }
1404
+ return this._argsCache.v;
1405
+ }
1406
+ get uiState() {
1407
+ if (this._uiStateCache === void 0) {
1408
+ const e = this.ctx.uiState, n = typeof e == "function" ? e() : e;
1409
+ this._uiStateCache = { v: n ? JSON.parse(n) : {} };
1410
+ }
1411
+ return this._uiStateCache.v;
1397
1412
  }
1398
1413
  /**
1399
1414
  * Returns args snapshot the block was executed for (i.e. when "Run" button was pressed).
1400
1415
  * Returns undefined, if block was never executed or stopped mid-way execution, so that the result was cleared.
1401
1416
  * */
1402
1417
  get activeArgs() {
1403
- return this._activeArgsCache === void 0 && (this._activeArgsCache = {
1404
- v: this.ctx.activeArgs ? JSON.parse(this.ctx.activeArgs) : void 0
1405
- }), this._activeArgsCache.v;
1418
+ if (this._activeArgsCache === void 0) {
1419
+ const e = this.ctx.activeArgs, n = typeof e == "function" ? e() : e;
1420
+ this._activeArgsCache = {
1421
+ v: n ? JSON.parse(n) : void 0
1422
+ };
1423
+ }
1424
+ return this._activeArgsCache.v;
1406
1425
  }
1407
1426
  // /** Can be used to determine features provided by the desktop instance. */
1408
1427
  // public get featureFlags() {
1409
1428
  // return this.ctx.featureFlags;
1410
1429
  // }
1411
1430
  getNamedAccessor(e) {
1412
- return ge(
1431
+ return fe(
1413
1432
  this.ctx.getAccessorHandleByName(e),
1414
- (n) => new E(n, [e])
1433
+ (n) => new D(n, [e])
1415
1434
  );
1416
1435
  }
1417
1436
  get prerun() {
1418
- return this.getNamedAccessor(Ve);
1437
+ return this.getNamedAccessor(Ne);
1419
1438
  }
1420
1439
  get outputs() {
1421
- return this.getNamedAccessor(je);
1440
+ return this.getNamedAccessor(Ve);
1422
1441
  }
1423
1442
  /**
1424
1443
  * Find labels data for a given axis id. It will search for a label column and return its data as a map.
@@ -1430,26 +1449,35 @@ class te {
1430
1449
  }
1431
1450
  verifyInlineAndExplicitColumnsSupport(e) {
1432
1451
  var i;
1433
- const n = e.some((s) => !(s.data instanceof E) || Ce(s.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
1452
+ const n = e.some((s) => !(s.data instanceof D) || ve(s.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
1434
1453
  if (n && !r) throw Error("Inline or explicit columns not supported");
1435
1454
  }
1455
+ patchPTableDef(e) {
1456
+ var n;
1457
+ return (n = this.ctx.featureFlags) != null && n.pTablePartitionFiltersSupport ? e : {
1458
+ ...e,
1459
+ partitionFilters: [],
1460
+ filters: [...e.partitionFilters, ...e.filters]
1461
+ };
1462
+ }
1436
1463
  // TODO remove all non-PColumn fields
1437
1464
  createPFrame(e) {
1438
1465
  return this.verifyInlineAndExplicitColumnsSupport(e), this.ctx.createPFrame(
1439
- e.map((n) => Ee(n))
1466
+ e.map((n) => Ie(n))
1440
1467
  );
1441
1468
  }
1442
1469
  createPTable(e) {
1443
1470
  let n;
1444
- return "columns" in e ? n = {
1471
+ return "columns" in e ? n = this.patchPTableDef({
1445
1472
  src: {
1446
1473
  type: "full",
1447
1474
  entries: e.columns.map((r) => ({ type: "column", column: r }))
1448
1475
  },
1449
- filters: e.filters ?? [],
1476
+ partitionFilters: e.filters ?? [],
1477
+ filters: [],
1450
1478
  sorting: e.sorting ?? []
1451
- } : n = e, this.verifyInlineAndExplicitColumnsSupport(ot(n.src)), this.ctx.createPTable(
1452
- at(n, (r) => Ee(r))
1479
+ }) : n = this.patchPTableDef(e), this.verifyInlineAndExplicitColumnsSupport(it(n.src)), this.ctx.createPTable(
1480
+ st(n, (r) => Ie(r))
1453
1481
  );
1454
1482
  }
1455
1483
  /** @deprecated scheduled for removal from SDK */
@@ -1469,106 +1497,38 @@ class te {
1469
1497
  this.ctx.logError(e);
1470
1498
  }
1471
1499
  }
1472
- const Y = "1.37.18";
1473
- function Vt(t) {
1500
+ const z = "1.39.0";
1501
+ function Kt(t) {
1474
1502
  return t.__renderLambda === !0;
1475
1503
  }
1476
- function fe(t) {
1504
+ function de(t) {
1477
1505
  if (t !== void 0)
1478
- return Vt(t) ? t.handle : t;
1506
+ return Kt(t) ? t.handle : t;
1479
1507
  }
1480
- function M(t) {
1481
- if (t !== void 0)
1482
- return typeof t == "string" ? { __renderLambda: !0, handle: t, retentive: !1 } : t;
1483
- }
1484
- function Rn(t) {
1485
- if (t.v3 !== void 0) {
1486
- const {
1487
- initialArgs: e,
1488
- initialUiState: n,
1489
- inputsValid: r,
1490
- outputs: i,
1491
- renderingMode: s,
1492
- sdkVersion: o,
1493
- sections: a,
1494
- title: l,
1495
- enrichmentTargets: u
1496
- } = t.v3, { code: c } = t;
1497
- return {
1498
- initialArgs: e,
1499
- initialUiState: n,
1500
- inputsValid: r,
1501
- outputs: i,
1502
- renderingMode: s,
1503
- sdkVersion: o,
1504
- sections: a,
1505
- title: l,
1506
- code: c,
1507
- enrichmentTargets: u
1508
- };
1509
- } else if (t.inputsValid !== void 0) {
1510
- const { sdkVersion: e, renderingMode: n, outputs: r, inputsValid: i, sections: s, initialArgs: o, code: a } = t, l = Object.keys(t);
1511
- if (e === void 0 || n === void 0 || r === void 0 || i === void 0 || s === void 0 || o === void 0)
1512
- throw new Error(
1513
- `Malformed config v2. SDK version ${e}; Fields = ${l.join(", ")}`
1514
- );
1515
- return {
1516
- sdkVersion: e,
1517
- renderingMode: n,
1518
- initialArgs: o,
1519
- outputs: Object.fromEntries(
1520
- Object.entries(r).map(([u, c]) => [u, M(c)])
1521
- ),
1522
- inputsValid: M(i),
1523
- sections: M(s),
1524
- initialUiState: void 0,
1525
- code: a
1526
- };
1527
- } else if (t.renderingMode !== void 0) {
1528
- const { sdkVersion: e, canRun: n, renderingMode: r, outputs: i, sections: s, initialArgs: o, code: a } = t, l = Object.keys(t);
1529
- if (r === void 0 || i === void 0 || n === void 0 || s === void 0 || o === void 0)
1530
- throw new Error(
1531
- `Malformed config v1. SDK version ${e}; Fields = ${l.join(", ")}`
1532
- );
1533
- return {
1534
- sdkVersion: e ?? "unknown",
1535
- renderingMode: r,
1536
- initialArgs: o,
1537
- outputs: Object.fromEntries(
1538
- Object.entries(i).map(([u, c]) => [u, M(c)])
1539
- ),
1540
- inputsValid: M(n),
1541
- sections: M(s),
1542
- initialUiState: void 0,
1543
- code: a
1544
- };
1545
- } else {
1546
- const { sdkVersion: e } = t, n = Object.keys(t);
1547
- throw new Error(
1548
- `Config format not supported: SDK = ${e}; Fields = ${n.join(", ")}`
1549
- );
1550
- }
1508
+ function Kn(t) {
1509
+ return at(t);
1551
1510
  }
1552
- class L {
1553
- constructor(e, n, r, i, s, o, a, l) {
1554
- this._renderingMode = e, this._initialArgs = n, this._initialUiState = r, this._outputs = i, this._inputsValid = s, this._sections = o, this._title = a, this._enrichmentTargets = l;
1511
+ const x = class x {
1512
+ constructor(e, n, r, i, s, o, a, l, u) {
1513
+ this._renderingMode = e, this._initialArgs = n, this._initialUiState = r, this._outputs = i, this._inputsValid = s, this._sections = o, this._title = a, this._enrichmentTargets = l, this._featureFlags = u;
1555
1514
  }
1556
1515
  static create(e = "Heavy") {
1557
- return new L(
1516
+ return new x(
1558
1517
  e,
1559
1518
  void 0,
1560
1519
  {},
1561
1520
  {},
1562
- re(!0),
1563
- re([]),
1521
+ ne(!0),
1522
+ ne([]),
1523
+ void 0,
1564
1524
  void 0,
1565
- void 0
1525
+ { ...x.INITIAL_BLOCK_FEATURE_FLAGS }
1566
1526
  );
1567
1527
  }
1568
1528
  output(e, n, r = {}) {
1569
1529
  if (typeof n == "function") {
1570
1530
  const i = `output#${e}`;
1571
- return H(i, () => n(new te())), new L(
1531
+ return G(i, () => n(new ee())), new x(
1572
1532
  this._renderingMode,
1573
1533
  this._initialArgs,
1574
1534
  this._initialUiState,
@@ -1583,10 +1543,11 @@ class L {
1583
1543
  this._inputsValid,
1584
1544
  this._sections,
1585
1545
  this._title,
1586
- this._enrichmentTargets
1546
+ this._enrichmentTargets,
1547
+ this._featureFlags
1587
1548
  );
1588
1549
  } else
1589
- return new L(
1550
+ return new x(
1590
1551
  this._renderingMode,
1591
1552
  this._initialArgs,
1592
1553
  this._initialUiState,
@@ -1597,7 +1558,8 @@ class L {
1597
1558
  this._inputsValid,
1598
1559
  this._sections,
1599
1560
  this._title,
1600
- this._enrichmentTargets
1561
+ this._enrichmentTargets,
1562
+ this._featureFlags
1601
1563
  );
1602
1564
  }
1603
1565
  /** Shortcut for {@link output} with retentive flag set to true. */
@@ -1605,7 +1567,7 @@ class L {
1605
1567
  return this.output(e, n, { retentive: !0 });
1606
1568
  }
1607
1569
  argsValid(e) {
1608
- return typeof e == "function" ? (H("inputsValid", () => e(new te())), new L(
1570
+ return typeof e == "function" ? (G("inputsValid", () => e(new ee())), new x(
1609
1571
  this._renderingMode,
1610
1572
  this._initialArgs,
1611
1573
  this._initialUiState,
@@ -1616,8 +1578,9 @@ class L {
1616
1578
  },
1617
1579
  this._sections,
1618
1580
  this._title,
1619
- this._enrichmentTargets
1620
- )) : new L(
1581
+ this._enrichmentTargets,
1582
+ this._featureFlags
1583
+ )) : new x(
1621
1584
  this._renderingMode,
1622
1585
  this._initialArgs,
1623
1586
  this._initialUiState,
@@ -1625,11 +1588,12 @@ class L {
1625
1588
  e,
1626
1589
  this._sections,
1627
1590
  this._title,
1628
- this._enrichmentTargets
1591
+ this._enrichmentTargets,
1592
+ this._featureFlags
1629
1593
  );
1630
1594
  }
1631
1595
  sections(e) {
1632
- return Array.isArray(e) ? this.sections(re(e)) : typeof e == "function" ? (H("sections", () => e(new te())), new L(
1596
+ return Array.isArray(e) ? this.sections(ne(e)) : typeof e == "function" ? (G("sections", () => e(new ee())), new x(
1633
1597
  this._renderingMode,
1634
1598
  this._initialArgs,
1635
1599
  this._initialUiState,
@@ -1637,8 +1601,9 @@ class L {
1637
1601
  this._inputsValid,
1638
1602
  { __renderLambda: !0, handle: "sections" },
1639
1603
  this._title,
1640
- this._enrichmentTargets
1641
- )) : new L(
1604
+ this._enrichmentTargets,
1605
+ this._featureFlags
1606
+ )) : new x(
1642
1607
  this._renderingMode,
1643
1608
  this._initialArgs,
1644
1609
  this._initialUiState,
@@ -1646,12 +1611,13 @@ class L {
1646
1611
  this._inputsValid,
1647
1612
  e,
1648
1613
  this._title,
1649
- this._enrichmentTargets
1614
+ this._enrichmentTargets,
1615
+ this._featureFlags
1650
1616
  );
1651
1617
  }
1652
1618
  /** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
1653
1619
  title(e) {
1654
- return H("title", () => e(new te())), new L(
1620
+ return G("title", () => e(new ee())), new x(
1655
1621
  this._renderingMode,
1656
1622
  this._initialArgs,
1657
1623
  this._initialUiState,
@@ -1659,7 +1625,8 @@ class L {
1659
1625
  this._inputsValid,
1660
1626
  this._sections,
1661
1627
  { __renderLambda: !0, handle: "title" },
1662
- this._enrichmentTargets
1628
+ this._enrichmentTargets,
1629
+ this._featureFlags
1663
1630
  );
1664
1631
  }
1665
1632
  /**
@@ -1667,7 +1634,7 @@ class L {
1667
1634
  * @deprecated use {@link withArgs}
1668
1635
  * */
1669
1636
  initialArgs(e) {
1670
- return new L(
1637
+ return new x(
1671
1638
  this._renderingMode,
1672
1639
  e,
1673
1640
  this._initialUiState,
@@ -1675,12 +1642,13 @@ class L {
1675
1642
  this._inputsValid,
1676
1643
  this._sections,
1677
1644
  this._title,
1678
- this._enrichmentTargets
1645
+ this._enrichmentTargets,
1646
+ this._featureFlags
1679
1647
  );
1680
1648
  }
1681
1649
  /** Sets initial args for the block, this value must be specified. */
1682
1650
  withArgs(e) {
1683
- return new L(
1651
+ return new x(
1684
1652
  this._renderingMode,
1685
1653
  e,
1686
1654
  this._initialUiState,
@@ -1688,12 +1656,13 @@ class L {
1688
1656
  this._inputsValid,
1689
1657
  this._sections,
1690
1658
  this._title,
1691
- this._enrichmentTargets
1659
+ this._enrichmentTargets,
1660
+ this._featureFlags
1692
1661
  );
1693
1662
  }
1694
1663
  /** Defines type and sets initial value for block UiState. */
1695
1664
  withUiState(e) {
1696
- return new L(
1665
+ return new x(
1697
1666
  this._renderingMode,
1698
1667
  this._initialArgs,
1699
1668
  e,
@@ -1701,7 +1670,8 @@ class L {
1701
1670
  this._inputsValid,
1702
1671
  this._sections,
1703
1672
  this._title,
1704
- this._enrichmentTargets
1673
+ this._enrichmentTargets,
1674
+ this._featureFlags
1705
1675
  );
1706
1676
  }
1707
1677
  /**
@@ -1709,7 +1679,7 @@ class L {
1709
1679
  * Influences dependency graph construction.
1710
1680
  */
1711
1681
  enriches(e) {
1712
- return H("enrichmentTargets", e), new L(
1682
+ return G("enrichmentTargets", e), new x(
1713
1683
  this._renderingMode,
1714
1684
  this._initialArgs,
1715
1685
  this._initialUiState,
@@ -1717,7 +1687,8 @@ class L {
1717
1687
  this._inputsValid,
1718
1688
  this._sections,
1719
1689
  this._title,
1720
- { __renderLambda: !0, handle: "enrichmentTargets" }
1690
+ { __renderLambda: !0, handle: "enrichmentTargets" },
1691
+ this._featureFlags
1721
1692
  );
1722
1693
  }
1723
1694
  /** Renders all provided block settings into a pre-configured platforma API
@@ -1727,7 +1698,7 @@ class L {
1727
1698
  if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
1728
1699
  const e = {
1729
1700
  v3: {
1730
- sdkVersion: Y,
1701
+ sdkVersion: z,
1731
1702
  renderingMode: this._renderingMode,
1732
1703
  initialArgs: this._initialArgs,
1733
1704
  initialUiState: this._initialUiState,
@@ -1735,84 +1706,103 @@ class L {
1735
1706
  sections: this._sections,
1736
1707
  title: this._title,
1737
1708
  outputs: this._outputs,
1738
- enrichmentTargets: this._enrichmentTargets
1709
+ enrichmentTargets: this._enrichmentTargets,
1710
+ featureFlags: this._featureFlags
1739
1711
  },
1740
1712
  // fields below are added to allow previous desktop versions read generated configs
1741
- sdkVersion: Y,
1713
+ sdkVersion: z,
1742
1714
  renderingMode: this._renderingMode,
1743
1715
  initialArgs: this._initialArgs,
1744
- inputsValid: fe(this._inputsValid),
1745
- sections: fe(this._sections),
1716
+ inputsValid: de(this._inputsValid),
1717
+ sections: de(this._sections),
1746
1718
  outputs: Object.fromEntries(
1747
- Object.entries(this._outputs).map(([n, r]) => [n, fe(r)])
1719
+ Object.entries(this._outputs).map(([n, r]) => [n, de(r)])
1748
1720
  )
1749
1721
  };
1750
- return ht() ? Ke({ sdkVersion: Y }) : { config: e };
1722
+ return ft() ? Ke({ sdkVersion: z }) : { config: e };
1751
1723
  }
1724
+ };
1725
+ k(x, "INITIAL_BLOCK_FEATURE_FLAGS", {
1726
+ supportsLazyState: !0,
1727
+ requiresUIAPIVersion: 1,
1728
+ requiresModelAPIVersion: 1
1729
+ });
1730
+ let Te = x;
1731
+ function Be() {
1732
+ return {
1733
+ sourceId: null,
1734
+ hiddenColIds: null,
1735
+ partitionFilters: [],
1736
+ filters: [],
1737
+ sorting: []
1738
+ };
1752
1739
  }
1753
- function Ue() {
1740
+ function Nt() {
1754
1741
  return {
1755
- version: 2,
1742
+ version: 3,
1756
1743
  stateCache: [],
1757
- pTableParams: {
1758
- sorting: [],
1759
- filters: [],
1760
- hiddenColIds: null
1761
- }
1744
+ pTableParams: Be()
1762
1745
  };
1763
1746
  }
1764
- function jt(t) {
1765
- return "version" in t ? t : Ue();
1747
+ function Vt(t) {
1748
+ return "version" in t ? (t.version === 2 && (t = {
1749
+ version: 3,
1750
+ stateCache: t.stateCache.map((e) => ({
1751
+ ...e,
1752
+ filtersState: []
1753
+ })),
1754
+ pTableParams: Be()
1755
+ }), t) : Nt();
1766
1756
  }
1767
- function be(t) {
1757
+ function ye(t) {
1768
1758
  return t.axesSpec.length === 1 && t.name === "pl7.app/label";
1769
1759
  }
1770
- function Be(t) {
1771
- return new le().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
1760
+ function jt(t) {
1761
+ return new ae().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
1772
1762
  name: "pl7.app/label",
1773
1763
  axes: [{}]
1774
1764
  // exactly one axis
1775
1765
  }, { dontWaitAllData: !0 });
1776
1766
  }
1777
- function we(t, e) {
1767
+ function Le(t, e) {
1778
1768
  const n = [], r = [];
1779
1769
  for (const a of t)
1780
- be(a.spec) ? n.push(a) : r.push(a);
1770
+ ye(a.spec) ? n.push(a) : r.push(a);
1781
1771
  const i = [];
1782
1772
  for (const a of r)
1783
1773
  for (const l of a.spec.axesSpec) {
1784
- const u = O(l);
1785
- i.some((c) => V(c, u)) || i.push(u);
1774
+ const u = R(l);
1775
+ i.some((h) => N(h, u)) || i.push(u);
1786
1776
  }
1787
1777
  for (const a of n) {
1788
- const l = O(a.spec.axesSpec[0]), u = i.findIndex((c) => V(c, l));
1778
+ const l = R(a.spec.axesSpec[0]), u = i.findIndex((h) => N(h, l));
1789
1779
  u !== -1 && i.splice(u, 1);
1790
1780
  }
1791
1781
  const s = (a, l) => {
1792
1782
  let u = a.toString();
1793
1783
  if (l)
1794
- for (const c in l)
1795
- u += c, u += l[c];
1784
+ for (const h in l)
1785
+ u += h, u += l[h];
1796
1786
  return u;
1797
1787
  }, o = [];
1798
1788
  for (const a of e) {
1799
- const l = a.spec.axesSpec[0], u = O(l), c = i.findIndex((d) => V(d, u));
1800
- if (c !== -1) {
1801
- const d = i[c], g = Object.keys(d.domain ?? {}).length, p = Object.keys(l.domain ?? {}).length;
1802
- g > p ? o.push({
1803
- id: s(a.id, d.domain),
1789
+ const l = a.spec.axesSpec[0], u = R(l), h = i.findIndex((f) => N(f, u));
1790
+ if (h !== -1) {
1791
+ const f = i[h], g = Object.keys(f.domain ?? {}).length, d = Object.keys(l.domain ?? {}).length;
1792
+ g > d ? o.push({
1793
+ id: s(a.id, f.domain),
1804
1794
  spec: {
1805
1795
  ...a.spec,
1806
- axesSpec: [{ ...d, annotations: l.annotations }]
1796
+ axesSpec: [{ ...f, annotations: l.annotations }]
1807
1797
  },
1808
1798
  data: a.data
1809
- }) : o.push(a), i.splice(c, 1);
1799
+ }) : o.push(a), i.splice(h, 1);
1810
1800
  }
1811
1801
  }
1812
1802
  return o;
1813
1803
  }
1814
- function We(t) {
1815
- const e = (i) => Array.isArray(i), n = (i) => i instanceof E, r = (i) => typeof i == "object" && "type" in i;
1804
+ function Jt(t) {
1805
+ const e = (i) => Array.isArray(i), n = (i) => i instanceof D, r = (i) => typeof i == "object" && "type" in i;
1816
1806
  return t.map((i) => i.data).every((i) => {
1817
1807
  if (e(i))
1818
1808
  return !0;
@@ -1831,45 +1821,29 @@ function We(t) {
1831
1821
  throw Error(`unsupported column data type: ${i}`);
1832
1822
  });
1833
1823
  }
1834
- function Ae(t, e, n, r, i, s) {
1835
- let o = t;
1836
- const a = [];
1837
- if (s) {
1838
- o = [];
1839
- for (const l of t)
1840
- s(l.spec) ? o.push(l) : a.push(l);
1824
+ function Fe(t) {
1825
+ let e = t.columns;
1826
+ const n = [];
1827
+ if (t.coreColumnPredicate) {
1828
+ e = [];
1829
+ for (const r of t.columns)
1830
+ t.coreColumnPredicate(r.spec) ? e.push(r) : n.push(r);
1841
1831
  }
1842
- return a.push(...e), {
1832
+ return n.push(...t.labelColumns), {
1843
1833
  src: {
1844
1834
  type: "outer",
1845
1835
  primary: {
1846
- type: n,
1847
- entries: o.map((l) => ({ type: "column", column: l }))
1836
+ type: t.coreJoinType,
1837
+ entries: e.map((r) => ({ type: "column", column: r }))
1848
1838
  },
1849
- secondary: a.map((l) => ({ type: "column", column: l }))
1839
+ secondary: n.map((r) => ({ type: "column", column: r }))
1850
1840
  },
1851
- filters: r,
1852
- sorting: i
1841
+ partitionFilters: t.partitionFilters,
1842
+ filters: t.filters,
1843
+ sorting: t.sorting
1853
1844
  };
1854
1845
  }
1855
- function Fn(t, e, n, r) {
1856
- var u, c;
1857
- Array.isArray(r) && (r = { filters: r });
1858
- const i = (r == null ? void 0 : r.coreJoinType) ?? "full", s = ue(
1859
- [...(r == null ? void 0 : r.filters) ?? [], ...((u = n == null ? void 0 : n.pTableParams) == null ? void 0 : u.filters) ?? []],
1860
- (d) => R(d.column)
1861
- ), o = ue(
1862
- [...(r == null ? void 0 : r.sorting) ?? [], ...((c = n == null ? void 0 : n.pTableParams) == null ? void 0 : c.sorting) ?? []],
1863
- (d) => R(d.column)
1864
- ), a = Be(t.resultPool);
1865
- if (!a) return;
1866
- const l = we(e.map(he), a);
1867
- if (We([...e, ...l]))
1868
- return t.createPTable(
1869
- Ae(e, l, i, s, o, r == null ? void 0 : r.coreColumnPredicate)
1870
- );
1871
- }
1872
- function Nt(t) {
1846
+ function Mt(t) {
1873
1847
  var e;
1874
1848
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "hidden";
1875
1849
  }
@@ -1877,37 +1851,69 @@ function $t(t) {
1877
1851
  var e;
1878
1852
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "optional";
1879
1853
  }
1880
- function ue(t, e) {
1854
+ function pe(t, e) {
1881
1855
  return [...new Map(t.map((n) => [e(n), n])).values()];
1882
1856
  }
1883
- function Kn(t, e, n, r) {
1857
+ function Nn(t, e, n, r) {
1884
1858
  if (e.length === 0) return;
1885
- const i = jt(n ?? Ue()), s = (r == null ? void 0 : r.coreJoinType) ?? "full", o = ue(
1886
- [...(r == null ? void 0 : r.filters) ?? [], ...i.pTableParams.filters],
1887
- (h) => R(h.column)
1888
- ), a = ue(
1889
- [...(r == null ? void 0 : r.sorting) ?? [], ...i.pTableParams.sorting],
1890
- (h) => R(h.column)
1891
- ), l = e.filter((h) => !Nt(h.spec)), u = Be(t.resultPool);
1892
- if (!u) return;
1893
- const c = we(l.map(he), u), d = Ae(l, c, s, o, a, r == null ? void 0 : r.coreColumnPredicate), g = t.createPTable(d), p = new Set((() => {
1894
- if (s === "inner") return [];
1895
- const h = i.pTableParams.hiddenColIds;
1896
- return h || l.filter((w) => $t(w.spec)).map((w) => w.id);
1859
+ const i = e.filter((c) => !Mt(c.spec)), s = Vt(n), o = jt(t.resultPool);
1860
+ if (!o) return;
1861
+ const a = Le(i.map(Ae), o), l = [...i, ...a], h = [
1862
+ ...pe(
1863
+ [...l.flatMap((c) => c.spec.axesSpec.map((m) => R(m)))],
1864
+ (c) => O(c)
1865
+ ).map((c) => ({ type: "axis", id: c })),
1866
+ ...l.map((c) => ({ type: "column", id: c.id }))
1867
+ ], f = new Set(h.map((c) => O(c))), g = (c) => f.has(O(c)), d = (r == null ? void 0 : r.coreJoinType) ?? "full", b = s.pTableParams.partitionFilters.filter((c) => {
1868
+ const m = g(c.column);
1869
+ return m || t.logWarn(`Partition filter ${JSON.stringify(c)} does not match provided columns, skipping`), m;
1870
+ }), p = pe(
1871
+ [...(r == null ? void 0 : r.filters) ?? [], ...s.pTableParams.filters],
1872
+ (c) => O(c.column)
1873
+ ).filter((c) => {
1874
+ const m = g(c.column);
1875
+ return m || t.logWarn(`Filter ${JSON.stringify(c)} does not match provided columns, skipping`), m;
1876
+ }), y = pe(
1877
+ [...(r == null ? void 0 : r.sorting) ?? [], ...s.pTableParams.sorting],
1878
+ (c) => O(c.column)
1879
+ ).filter((c) => {
1880
+ const m = g(c.column);
1881
+ return m || t.logWarn(`Sorting ${JSON.stringify(c)} does not match provided columns, skipping`), m;
1882
+ }), C = Fe({
1883
+ columns: i,
1884
+ labelColumns: a,
1885
+ coreJoinType: d,
1886
+ partitionFilters: b,
1887
+ filters: p,
1888
+ sorting: y,
1889
+ coreColumnPredicate: r == null ? void 0 : r.coreColumnPredicate
1890
+ }), E = t.createPTable(C), _ = new Set((() => {
1891
+ if (d === "inner") return [];
1892
+ const c = s.pTableParams.hiddenColIds;
1893
+ return c || i.filter((m) => $t(m.spec)).map((m) => m.id);
1897
1894
  })());
1898
- l.filter((h) => {
1899
- var w;
1900
- return ((w = h.spec.annotations) == null ? void 0 : w["pl7.app/isLinkerColumn"]) === "true";
1901
- }).forEach((h) => p.delete(h.id)), r != null && r.coreColumnPredicate && l.flatMap((w) => {
1902
- var x;
1903
- return (x = r == null ? void 0 : r.coreColumnPredicate) != null && x.call(r, w.spec) ? [w.id] : [];
1904
- }).forEach((w) => p.delete(w)), [...o.map((h) => h.column), ...a.map((h) => h.column)].filter((h) => h.type === "column").forEach((h) => p.delete(h.id));
1905
- const m = l.filter((h) => !p.has(h.id)), f = we(m.map(he), u);
1906
- if (!We([...m, ...f])) return;
1907
- const v = Ae(m, f, s, o, a, r == null ? void 0 : r.coreColumnPredicate), b = t.createPTable(v);
1895
+ i.filter((c) => {
1896
+ var m;
1897
+ return ((m = c.spec.annotations) == null ? void 0 : m["pl7.app/isLinkerColumn"]) === "true";
1898
+ }).forEach((c) => _.delete(c.id)), r != null && r.coreColumnPredicate && i.flatMap((m) => {
1899
+ var T;
1900
+ return (T = r == null ? void 0 : r.coreColumnPredicate) != null && T.call(r, m.spec) ? [m.id] : [];
1901
+ }).forEach((m) => _.delete(m)), [...b.map((c) => c.column), ...p.map((c) => c.column), ...y.map((c) => c.column)].filter((c) => c.type === "column").forEach((c) => _.delete(c.id));
1902
+ const w = i.filter((c) => !_.has(c.id)), A = Le(w.map(Ae), o);
1903
+ if (!Jt([...w, ...A])) return;
1904
+ const S = Fe({
1905
+ columns: w,
1906
+ labelColumns: A,
1907
+ coreJoinType: d,
1908
+ partitionFilters: b,
1909
+ filters: p,
1910
+ sorting: y,
1911
+ coreColumnPredicate: r == null ? void 0 : r.coreColumnPredicate
1912
+ }), I = t.createPTable(S);
1908
1913
  return {
1909
- fullTableHandle: g,
1910
- visibleTableHandle: b
1914
+ sourceId: s.pTableParams.sourceId,
1915
+ fullTableHandle: E,
1916
+ visibleTableHandle: I
1911
1917
  };
1912
1918
  }
1913
1919
  function Vn(t, e, n) {
@@ -1921,7 +1927,7 @@ function Vn(t, e, n) {
1921
1927
  defaultValue: n[0]
1922
1928
  };
1923
1929
  }
1924
- const Jt = (t, e) => {
1930
+ const Bt = (t, e) => {
1925
1931
  let n = t.toString();
1926
1932
  return e == null || e.forEach((r) => {
1927
1933
  if (r)
@@ -1929,7 +1935,7 @@ const Jt = (t, e) => {
1929
1935
  n += i, n += s;
1930
1936
  }), n;
1931
1937
  };
1932
- function Mt(t) {
1938
+ function Ut(t) {
1933
1939
  if (!t.length)
1934
1940
  return [];
1935
1941
  let e = [[]];
@@ -1940,16 +1946,16 @@ function Mt(t) {
1940
1946
  }), e = r;
1941
1947
  }), e;
1942
1948
  }
1943
- function Ut(t) {
1949
+ function Wt(t) {
1944
1950
  var e;
1945
- return t.axesSpec.length === 2 && ((e = t.annotations) == null ? void 0 : e[Wt]) === "true";
1951
+ return t.axesSpec.length === 2 && ((e = t.annotations) == null ? void 0 : e[Ht]) === "true";
1946
1952
  }
1947
- const Bt = "pl7.app/graph/isVirtual", ke = "pl7.app/label", Wt = "pl7.app/isLinkerColumn";
1948
- function Gt(t) {
1953
+ const Gt = "pl7.app/graph/isVirtual", Ee = "pl7.app/label", Ht = "pl7.app/isLinkerColumn";
1954
+ function qt(t) {
1949
1955
  var n, r;
1950
1956
  const e = /* @__PURE__ */ new Map();
1951
1957
  for (const { spec: i } of t) {
1952
- const s = i.axesSpec.map(O).map(R);
1958
+ const s = i.axesSpec.map(R).map(O);
1953
1959
  s.forEach((o) => {
1954
1960
  e.has(o) || e.set(o, /* @__PURE__ */ new Set());
1955
1961
  });
@@ -1961,74 +1967,74 @@ function Gt(t) {
1961
1967
  }
1962
1968
  return e;
1963
1969
  }
1964
- function Ht(t, e) {
1965
- const n = Gt(t), r = [...n.keys()].map(Ie), i = [];
1970
+ function zt(t, e) {
1971
+ const n = qt(t), r = [...n.keys()].map(Pe), i = [];
1966
1972
  for (const l of e.values()) {
1967
- const u = r.find((c) => V(l, c));
1968
- u && i.push(R(u));
1973
+ const u = r.find((h) => N(l, h));
1974
+ u && i.push(O(u));
1969
1975
  }
1970
1976
  const s = new Set(i), o = /* @__PURE__ */ new Map();
1971
1977
  let a = [...i];
1972
1978
  for (; a.length; ) {
1973
1979
  const l = [];
1974
1980
  for (const u of a)
1975
- for (const c of n.get(u) ?? [])
1976
- s.has(c) || (l.push(c), s.add(c), o.set(c, Ie(c)));
1981
+ for (const h of n.get(u) ?? [])
1982
+ s.has(h) || (l.push(h), s.add(h), o.set(h, Pe(h)));
1977
1983
  a = l;
1978
1984
  }
1979
1985
  return o;
1980
1986
  }
1981
- function qt(t, e) {
1987
+ function Yt(t, e) {
1982
1988
  const n = [];
1983
1989
  return e.forEach((r) => {
1984
- n.push(...zt(t, r));
1990
+ n.push(...Xt(t, r));
1985
1991
  }), n;
1986
1992
  }
1987
- function zt(t, e) {
1988
- const n = e.spec.axesSpec.map(O);
1989
- if (n.every((u) => t.has(R(u))))
1993
+ function Xt(t, e) {
1994
+ const n = e.spec.axesSpec.map(R);
1995
+ if (n.every((u) => t.has(O(u))))
1990
1996
  return [e];
1991
1997
  const r = n.map((u) => {
1992
- const c = [];
1993
- for (const [d, g] of t)
1994
- V(g, u) && !V(u, g) && c.push(g);
1995
- return c;
1996
- }), i = Mt(r), s = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), a = i.map((u) => {
1997
- const c = /* @__PURE__ */ new Set();
1998
- return u.map((d, g) => {
1999
- const p = e.spec.axesSpec[g].domain, m = d.domain;
2000
- return Object.entries(m ?? {}).forEach(([f, v]) => {
2001
- if ((p == null ? void 0 : p[f]) === void 0) {
2002
- const b = JSON.stringify([f, v]);
2003
- c.add(b), s.add(b);
1998
+ const h = [];
1999
+ for (const [f, g] of t)
2000
+ N(g, u) && !N(u, g) && h.push(g);
2001
+ return h;
2002
+ }), i = Ut(r), s = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), a = i.map((u) => {
2003
+ const h = /* @__PURE__ */ new Set();
2004
+ return u.map((f, g) => {
2005
+ const d = e.spec.axesSpec[g].domain, b = f.domain;
2006
+ return Object.entries(b ?? {}).forEach(([p, y]) => {
2007
+ if ((d == null ? void 0 : d[p]) === void 0) {
2008
+ const C = JSON.stringify([p, y]);
2009
+ h.add(C), s.add(C);
2004
2010
  }
2005
2011
  }), {
2006
- ...d,
2012
+ ...f,
2007
2013
  annotations: e.spec.axesSpec[g].annotations
2008
2014
  };
2009
- }), c;
2015
+ }), h;
2010
2016
  });
2011
2017
  [...s].forEach((u) => {
2012
- a.some((c) => !c.has(u)) && o.add(u);
2018
+ a.some((h) => !h.has(u)) && o.add(u);
2013
2019
  });
2014
- const l = i.map((u, c) => {
2015
- var f;
2016
- const d = Jt(e.id, u.map((v) => v.domain)), g = ((f = e.spec.annotations) == null ? void 0 : f[ke]) ?? "", p = [...a[c]].filter((v) => o.has(v)).sort().map((v) => {
2017
- var b;
2018
- return (b = JSON.parse(v)) == null ? void 0 : b[1];
2019
- }).join(" / "), m = {
2020
+ const l = i.map((u, h) => {
2021
+ var p;
2022
+ const f = Bt(e.id, u.map((y) => y.domain)), g = ((p = e.spec.annotations) == null ? void 0 : p[Ee]) ?? "", d = [...a[h]].filter((y) => o.has(y)).sort().map((y) => {
2023
+ var C;
2024
+ return (C = JSON.parse(y)) == null ? void 0 : C[1];
2025
+ }).join(" / "), b = {
2020
2026
  ...e.spec.annotations,
2021
- [Bt]: "true"
2027
+ [Gt]: "true"
2022
2028
  };
2023
- return (g || p) && (m[ke] = g && p ? g + " / " + p : g + p), {
2024
- id: d,
2029
+ return (g || d) && (b[Ee] = g && d ? g + " / " + d : g + d), {
2030
+ id: f,
2025
2031
  spec: {
2026
2032
  ...e.spec,
2027
- axesSpec: u.map((v, b) => ({
2028
- ...v,
2029
- annotations: e.spec.axesSpec[b].annotations
2033
+ axesSpec: u.map((y, C) => ({
2034
+ ...y,
2035
+ annotations: e.spec.axesSpec[C].annotations
2030
2036
  })),
2031
- annotations: m
2037
+ annotations: b
2032
2038
  },
2033
2039
  data: e.data
2034
2040
  };
@@ -2037,50 +2043,50 @@ function zt(t, e) {
2037
2043
  }
2038
2044
  function jn(t, e) {
2039
2045
  if (!e) return;
2040
- const n = new le();
2046
+ const n = new ae();
2041
2047
  n.addColumnProvider(t.resultPool), n.addColumns(e);
2042
2048
  const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
2043
- for (const d of e)
2044
- for (const g of d.spec.axesSpec) {
2045
- const p = O(g);
2046
- r.set(R(p), p), i.set(R(p), p);
2049
+ for (const f of e)
2050
+ for (const g of f.spec.axesSpec) {
2051
+ const d = R(g);
2052
+ r.set(O(d), d), i.set(O(d), d);
2047
2053
  }
2048
- const s = n.getColumns((d) => Ut(d)) ?? [], o = Ht(s, r);
2049
- for (const d of o)
2050
- r.set(...d), i.set(...d);
2051
- const a = (n.getColumns((d) => d.axesSpec.some((g) => {
2052
- const p = O(g);
2053
- for (const m of r.values())
2054
- if (V(m, p))
2054
+ const s = n.getColumns((f) => Wt(f)) ?? [], o = zt(s, r);
2055
+ for (const f of o)
2056
+ r.set(...f), i.set(...f);
2057
+ const a = (n.getColumns((f) => f.axesSpec.some((g) => {
2058
+ const d = R(g);
2059
+ for (const b of r.values())
2060
+ if (N(b, d))
2055
2061
  return !0;
2056
2062
  return !1;
2057
- }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((d) => !be(d.spec));
2058
- for (const d of a)
2059
- for (const g of d.spec.axesSpec) {
2060
- const p = O(g);
2061
- i.set(R(p), p);
2063
+ }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((f) => !ye(f.spec));
2064
+ for (const f of a)
2065
+ for (const g of f.spec.axesSpec) {
2066
+ const d = R(g);
2067
+ i.set(O(d), d);
2062
2068
  }
2063
- const l = (n.getColumns((d) => d.axesSpec.some((g) => {
2064
- const p = O(g);
2065
- for (const m of i.values())
2066
- if (V(m, p))
2069
+ const l = (n.getColumns((f) => f.axesSpec.some((g) => {
2070
+ const d = R(g);
2071
+ for (const b of i.values())
2072
+ if (N(b, d))
2067
2073
  return !0;
2068
2074
  return !1;
2069
- }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((d) => be(d.spec)), u = [...a, ...l], c = qt(r, u);
2070
- if (!c.some(
2071
- (d) => d.data instanceof E && !d.data.getIsReadyOrError()
2075
+ }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((f) => ye(f.spec)), u = [...a, ...l], h = Yt(r, u);
2076
+ if (!h.some(
2077
+ (f) => f.data instanceof D && !f.data.getIsReadyOrError()
2072
2078
  ))
2073
- return t.createPFrame(c);
2079
+ return t.createPFrame(h);
2074
2080
  }
2075
- function Nn({
2081
+ function Jn({
2076
2082
  selection: t,
2077
- columnId: e = ct(),
2083
+ columnId: e = ut(),
2078
2084
  label: n = "Selection marker",
2079
2085
  domain: r
2080
2086
  }) {
2081
2087
  if (!(t != null && t.axesSpec.length))
2082
2088
  return;
2083
- const i = t.selectedKeys.filter((s) => s.every((o) => !ut(o))).map((s) => ({ key: s, val: 1 }));
2089
+ const i = t.selectedKeys.filter((s) => s.every((o) => !lt(o))).map((s) => ({ key: s, val: 1 }));
2084
2090
  if (i.length)
2085
2091
  return {
2086
2092
  id: e,
@@ -2098,10 +2104,10 @@ function Nn({
2098
2104
  data: i
2099
2105
  };
2100
2106
  }
2101
- function $n(t) {
2102
- return t === dt ? (console.error("Axis value can never be N/A"), "") : t;
2107
+ function Mn(t) {
2108
+ return t === ct ? (console.error("Axis value can never be N/A"), "") : t;
2103
2109
  }
2104
- class Jn {
2110
+ class $n {
2105
2111
  constructor(e) {
2106
2112
  this.handle = e;
2107
2113
  }
@@ -2121,128 +2127,128 @@ class Jn {
2121
2127
  return await platforma.pFrameDriver.getUniqueValues(this.handle, e);
2122
2128
  }
2123
2129
  }
2124
- function Yt(t) {
2125
- return Fe({
2130
+ function Qt(t) {
2131
+ return Oe({
2126
2132
  __isRef: !0,
2127
- blockId: ie(t, "blockId"),
2128
- name: ie(t, "name")
2133
+ blockId: re(t, "blockId"),
2134
+ name: re(t, "name")
2129
2135
  });
2130
2136
  }
2131
- function Mn(t) {
2132
- return Fe({
2133
- ref: Yt(ie(t, "ref")),
2134
- label: ie(t, "label")
2137
+ function Bn(t) {
2138
+ return Oe({
2139
+ ref: Qt(re(t, "ref")),
2140
+ label: re(t, "label")
2135
2141
  });
2136
2142
  }
2137
2143
  const Un = {
2138
- sdkVersion: Y
2144
+ sdkVersion: z
2139
2145
  };
2140
- function Xt() {
2141
- return Ke({ sdkVersion: Y });
2146
+ function Zt() {
2147
+ return Ke({ sdkVersion: z });
2142
2148
  }
2143
- function Bn(t) {
2149
+ function Wn(t) {
2144
2150
  try {
2145
- return Xt();
2151
+ return Zt();
2146
2152
  } catch {
2147
2153
  return t;
2148
2154
  }
2149
2155
  }
2150
- function Wn(t) {
2156
+ function Gn(t) {
2151
2157
  if (typeof globalThis.getEnvironmentValue == "function")
2152
2158
  return globalThis.getEnvironmentValue(t);
2153
2159
  }
2154
2160
  export {
2155
- sn as Args,
2156
- L as BlockModel,
2161
+ an as Args,
2162
+ Te as BlockModel,
2157
2163
  Un as CurrentSdkInfo,
2158
- I as FutureRef,
2159
- Bt as IS_VIRTUAL_COLUMN,
2160
- on as It,
2161
- Dn as JsRenderInternal,
2162
- ke as LABEL_ANNOTATION,
2163
- Wt as LINKER_COLUMN_ANNOTATION,
2164
- an as MainOutputs,
2165
- pt as OutputError,
2164
+ F as FutureRef,
2165
+ Gt as IS_VIRTUAL_COLUMN,
2166
+ ln as It,
2167
+ Rn as JsRenderInternal,
2168
+ Ee as LABEL_ANNOTATION,
2169
+ Ht as LINKER_COLUMN_ANNOTATION,
2170
+ un as MainOutputs,
2171
+ dt as OutputError,
2166
2172
  bt as PAnnotationLabel,
2167
- wt as PAnnotationTrace,
2168
- le as PColumnCollection,
2169
- Jn as PFrameImpl,
2173
+ vt as PAnnotationTrace,
2174
+ ae as PColumnCollection,
2175
+ $n as PFrameImpl,
2170
2176
  B as RT_BINARY_PARTITIONED,
2171
- z as RT_BINARY_SUPER_PARTITIONED,
2172
- q as RT_JSON_PARTITIONED,
2173
- ae as RT_JSON_SUPER_PARTITIONED,
2174
- se as RT_RESOURCE_MAP,
2175
- oe as RT_RESOURCE_MAP_PARTITIONED,
2176
- te as RenderCtx,
2177
- Kt as ResultPool,
2178
- ln as StagingOutputs,
2179
- xt as Trace,
2180
- At as TraceEntry,
2181
- E as TreeNodeAccessor,
2182
- un as UiState,
2183
- We as allColumnsComputed,
2184
- mn as and,
2185
- Tt as convertOrParsePColumnData,
2177
+ q as RT_BINARY_SUPER_PARTITIONED,
2178
+ H as RT_JSON_PARTITIONED,
2179
+ oe as RT_JSON_SUPER_PARTITIONED,
2180
+ ie as RT_RESOURCE_MAP,
2181
+ se as RT_RESOURCE_MAP_PARTITIONED,
2182
+ ee as RenderCtx,
2183
+ Ot as ResultPool,
2184
+ cn as StagingOutputs,
2185
+ St as Trace,
2186
+ Ct as TraceEntry,
2187
+ D as TreeNodeAccessor,
2188
+ dn as UiState,
2189
+ Jt as allColumnsComputed,
2190
+ bn as and,
2191
+ It as convertOrParsePColumnData,
2186
2192
  jn as createPFrameForGraphs,
2187
- Fn as createPlDataTable,
2188
2193
  Vn as createPlDataTableSheet,
2189
- Ue as createPlDataTableStateV2,
2190
- Kn as createPlDataTableV2,
2191
- Nn as createRowSelectionColumn,
2192
- $e as deriveLabels,
2193
- fe as downgradeCfgOrLambda,
2194
- qt as enrichCompatible,
2195
- _n as extractArchiveAndGetURL,
2196
- Rn as extractConfig,
2197
- Lt as filterDataInfoEntries,
2198
- fn as flatten,
2199
- Mn as fromPlOption,
2200
- Yt as fromPlRef,
2201
- Be as getAllLabelColumns,
2202
- Ht as getAvailableWithLinkersAxes,
2194
+ Nt as createPlDataTableStateV2,
2195
+ Nn as createPlDataTableV2,
2196
+ Jn as createRowSelectionColumn,
2197
+ Je as deriveLabels,
2198
+ de as downgradeCfgOrLambda,
2199
+ Yt as enrichCompatible,
2200
+ Tn as extractArchiveAndGetURL,
2201
+ Kn as extractConfig,
2202
+ Tt as filterDataInfoEntries,
2203
+ gn as flatten,
2204
+ Bn as fromPlOption,
2205
+ Qt as fromPlRef,
2206
+ jt as getAllLabelColumns,
2207
+ zt as getAvailableWithLinkersAxes,
2203
2208
  An as getBlobContent,
2204
- Cn as getBlobContentAsJson,
2205
- xn as getBlobContentAsString,
2206
- Pn as getDownloadedBlobContent,
2207
- Wn as getEnvironmentValue,
2208
- Q as getFromCfg,
2209
- re as getImmediate,
2210
- In as getImportProgress,
2211
- ie as getJsonField,
2212
- Tn as getLastLogs,
2213
- Gt as getLinkerColumnsMap,
2214
- kn as getLogHandle,
2215
- we as getMatchingLabelColumns,
2216
- Sn as getOnDemandBlobContent,
2217
- St as getPartitionKeysList,
2218
- Bn as getPlatformaOrDefault,
2219
- Ln as getProgressLog,
2220
- En as getProgressLogWithInfo,
2221
- Xt as getRawPlatformaInstance,
2222
- vn as getResourceField,
2223
- bn as getResourceValueAsJson,
2224
- It as getUniquePartitionKeys,
2225
- ge as ifDef,
2226
- Nt as isColumnHidden,
2209
+ xn as getBlobContentAsJson,
2210
+ Pn as getBlobContentAsString,
2211
+ _n as getDownloadedBlobContent,
2212
+ Gn as getEnvironmentValue,
2213
+ X as getFromCfg,
2214
+ ne as getImmediate,
2215
+ Ln as getImportProgress,
2216
+ re as getJsonField,
2217
+ Fn as getLastLogs,
2218
+ qt as getLinkerColumnsMap,
2219
+ Dn as getLogHandle,
2220
+ Le as getMatchingLabelColumns,
2221
+ In as getOnDemandBlobContent,
2222
+ Pt as getPartitionKeysList,
2223
+ Wn as getPlatformaOrDefault,
2224
+ En as getProgressLog,
2225
+ kn as getProgressLogWithInfo,
2226
+ Zt as getRawPlatformaInstance,
2227
+ Cn as getResourceField,
2228
+ Sn as getResourceValueAsJson,
2229
+ _t as getUniquePartitionKeys,
2230
+ fe as ifDef,
2231
+ Mt as isColumnHidden,
2227
2232
  $t as isColumnOptional,
2228
- Vt as isConfigLambda,
2229
- hn as isEmpty,
2230
- be as isLabelColumn,
2231
- Ut as isLinkerColumn,
2232
- rn as isolate,
2233
- cn as makeArray,
2234
- Fe as makeObject,
2235
- pn as mapArrayValues,
2236
- $n as mapPTableValueToAxisKey,
2237
- dn as mapRecordValues,
2233
+ Kt as isConfigLambda,
2234
+ mn as isEmpty,
2235
+ ye as isLabelColumn,
2236
+ Wt as isLinkerColumn,
2237
+ on as isolate,
2238
+ pn as makeArray,
2239
+ Be as makeDefaultPTableParams,
2240
+ Oe as makeObject,
2241
+ hn as mapArrayValues,
2242
+ Mn as mapPTableValueToAxisKey,
2243
+ fn as mapRecordValues,
2238
2244
  wn as mapResourceFields,
2239
- gn as not,
2240
- yn as or,
2241
- ve as parsePColumnData,
2245
+ yn as not,
2246
+ vn as or,
2247
+ me as parsePColumnData,
2242
2248
  On as parseResourceMap,
2243
- ft as readOutput,
2244
- ue as uniqueBy,
2245
- jt as upgradePlDataTableStateV2,
2246
- nn as wrapOutputs
2249
+ pt as readOutput,
2250
+ pe as uniqueBy,
2251
+ Vt as upgradePlDataTableStateV2,
2252
+ sn as wrapOutputs
2247
2253
  };
2248
2254
  //# sourceMappingURL=index.mjs.map