@platforma-sdk/model 1.34.10 → 1.37.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.
package/dist/index.mjs CHANGED
@@ -1,54 +1,54 @@
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 O = (t, e, n) => ze(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { isPColumn as Le, mapPObjectData as be, isDataInfoEntries as Te, isDataInfo as we, dataInfoToEntries as Ye, selectorsToPredicate as X, resolveAnchors as Ae, deriveNativeId as Xe, isPColumnSpec as ne, isPartitionedDataInfoEntries as Qe, getAxisId as D, entriesToDataInfo as Ze, canonicalizeAxisId as et, withEnrichments as xe, AnchoredIdDeriver as Ce, isPlRef as tt, mapValueInVOE as nt, ensurePColumn as rt, extractAllColumns as it, mapPTableDef as st, mapDataInfo as ot, canonicalizeJson as K, matchAxisId as j, getColumnIdAndSpec as Ee, parseJson as fe, isPTableAbsent as at, uniquePlId as lt, PTableNA as ut } from "@milaboratories/pl-model-common";
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 k = (t, e, n) => Xe(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { isPColumn as ke, 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";
5
5
  export * from "@milaboratories/pl-model-common";
6
- import ke from "canonicalize";
6
+ import Re from "canonicalize";
7
7
  import { z as U } from "zod";
8
8
  export * from "@milaboratories/pl-error-like";
9
- class ct extends Error {
9
+ class pt 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 dt(t) {
15
- if (!t.ok) throw new ct(t.errors, t.moreErrors);
14
+ function ft(t) {
15
+ if (!t.ok) throw new pt(t.errors, t.moreErrors);
16
16
  return t.value;
17
17
  }
18
- function Zt(t) {
18
+ function nn(t) {
19
19
  return new Proxy(t, {
20
20
  get(e, n) {
21
- return dt(e[n]);
21
+ return ft(e[n]);
22
22
  }
23
23
  });
24
24
  }
25
- function C(t) {
25
+ function P(t) {
26
26
  return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ? re(t) : t;
27
27
  }
28
28
  function Q(t) {
29
29
  return { type: "GetFromCtx", variable: t };
30
30
  }
31
- function en(t) {
31
+ function rn(t) {
32
32
  return {
33
33
  type: "Isolate",
34
34
  cfg: t
35
35
  };
36
36
  }
37
- const tn = Q("$args"), nn = Q("$it"), rn = Q("$prod"), sn = Q("$staging"), on = Q("$ui");
37
+ const sn = Q("$args"), on = Q("$it"), an = Q("$prod"), ln = Q("$staging"), un = Q("$ui");
38
38
  function re(t) {
39
39
  return { type: "Immediate", value: t };
40
40
  }
41
- function Oe(t) {
41
+ function Fe(t) {
42
42
  const e = {};
43
- for (const [n, r] of Object.entries(t)) e[n] = C(r);
43
+ for (const [n, r] of Object.entries(t)) e[n] = P(r);
44
44
  return {
45
45
  type: "MakeObject",
46
46
  template: e
47
47
  };
48
48
  }
49
- function an(...t) {
49
+ function cn(...t) {
50
50
  const e = [];
51
- for (const n of t) e.push(C(n));
51
+ for (const n of t) e.push(P(n));
52
52
  return {
53
53
  type: "MakeArray",
54
54
  template: e
@@ -57,11 +57,11 @@ function an(...t) {
57
57
  function ie(t, e) {
58
58
  return {
59
59
  type: "GetJsonField",
60
- source: C(t),
61
- field: C(e)
60
+ source: P(t),
61
+ field: P(e)
62
62
  };
63
63
  }
64
- function ln(t, e, n = "$it") {
64
+ function dn(t, e, n = "$it") {
65
65
  return {
66
66
  type: "MapRecordValues",
67
67
  source: t,
@@ -69,7 +69,7 @@ function ln(t, e, n = "$it") {
69
69
  itVar: n
70
70
  };
71
71
  }
72
- function un(t, e, n = "$it") {
72
+ function pn(t, e, n = "$it") {
73
73
  return {
74
74
  type: "MapArrayValues",
75
75
  source: t,
@@ -77,54 +77,54 @@ function un(t, e, n = "$it") {
77
77
  itVar: n
78
78
  };
79
79
  }
80
- function cn(t) {
80
+ function fn(t) {
81
81
  return {
82
82
  type: "Flatten",
83
83
  source: t
84
84
  };
85
85
  }
86
- function dn(t) {
86
+ function hn(t) {
87
87
  return {
88
88
  type: "IsEmpty",
89
89
  arg: t
90
90
  };
91
91
  }
92
- function pn(t) {
92
+ function gn(t) {
93
93
  return {
94
94
  type: "Not",
95
95
  operand: t
96
96
  };
97
97
  }
98
- function fn(t, e) {
98
+ function mn(t, e) {
99
99
  return {
100
100
  type: "And",
101
101
  operand1: t,
102
102
  operand2: e
103
103
  };
104
104
  }
105
- function hn(t, e) {
105
+ function yn(t, e) {
106
106
  return {
107
107
  type: "Or",
108
108
  operand1: t,
109
109
  operand2: e
110
110
  };
111
111
  }
112
- function gn(t, e) {
112
+ function vn(t, e) {
113
113
  return {
114
114
  type: "GetResourceField",
115
- source: C(t),
116
- field: C(e)
115
+ source: P(t),
116
+ field: P(e)
117
117
  };
118
118
  }
119
- function mn() {
119
+ function bn() {
120
120
  return function(t) {
121
121
  return {
122
122
  type: "GetResourceValueAsJson",
123
- source: C(t)
123
+ source: P(t)
124
124
  };
125
125
  };
126
126
  }
127
- function yn(t, e, n = "$it") {
127
+ function wn(t, e, n = "$it") {
128
128
  return {
129
129
  type: "MapResourceFields",
130
130
  source: t,
@@ -132,91 +132,91 @@ function yn(t, e, n = "$it") {
132
132
  itVar: n
133
133
  };
134
134
  }
135
- function vn(t, e) {
135
+ function An(t, e) {
136
136
  return {
137
137
  type: "GetBlobContent",
138
138
  range: e,
139
- source: C(t)
139
+ source: P(t)
140
140
  };
141
141
  }
142
- function bn(t, e) {
142
+ function xn(t, e) {
143
143
  return {
144
144
  type: "GetBlobContentAsString",
145
145
  range: e,
146
- source: C(t)
146
+ source: P(t)
147
147
  };
148
148
  }
149
- function wn() {
149
+ function Cn() {
150
150
  return function(t, e) {
151
151
  return {
152
152
  type: "GetBlobContentAsJson",
153
153
  range: e,
154
- source: C(t)
154
+ source: P(t)
155
155
  };
156
156
  };
157
157
  }
158
- function An(t) {
158
+ function Pn(t) {
159
159
  return {
160
160
  type: "GetDownloadedBlobContent",
161
- source: C(t)
161
+ source: P(t)
162
162
  };
163
163
  }
164
- function xn(t) {
164
+ function Sn(t) {
165
165
  return {
166
166
  type: "GetOnDemandBlobContent",
167
- source: C(t)
167
+ source: P(t)
168
168
  };
169
169
  }
170
- function Cn(t, e) {
170
+ function _n(t, e) {
171
171
  return {
172
172
  type: "ExtractArchiveAndGetURL",
173
173
  format: e,
174
- source: C(t)
174
+ source: P(t)
175
175
  };
176
176
  }
177
- function Pn(t) {
177
+ function In(t) {
178
178
  return {
179
179
  type: "GetImportProgress",
180
- source: C(t)
180
+ source: P(t)
181
181
  };
182
182
  }
183
- function Sn(t, e) {
183
+ function Tn(t, e) {
184
184
  return {
185
185
  type: "GetLastLogs",
186
- source: C(t),
186
+ source: P(t),
187
187
  lines: e
188
188
  };
189
189
  }
190
- function _n(t, e) {
190
+ function Ln(t, e) {
191
191
  return {
192
192
  type: "GetProgressLog",
193
- source: C(t),
193
+ source: P(t),
194
194
  patternToSearch: e
195
195
  };
196
196
  }
197
- function In(t, e) {
197
+ function En(t, e) {
198
198
  return {
199
199
  type: "GetProgressLogWithInfo",
200
- source: C(t),
200
+ source: P(t),
201
201
  patternToSearch: e
202
202
  };
203
203
  }
204
- function Ln(t) {
204
+ function Dn(t) {
205
205
  return {
206
206
  type: "GetLogHandle",
207
- source: C(t)
207
+ source: P(t)
208
208
  };
209
209
  }
210
- function pt() {
210
+ function ht() {
211
211
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
212
212
  }
213
- function De(t) {
213
+ function Ke(t) {
214
214
  if (t && typeof globalThis.getPlatforma == "function")
215
215
  return globalThis.getPlatforma(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 ft() {
219
+ function gt() {
220
220
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
221
221
  }
222
222
  function y() {
@@ -224,31 +224,31 @@ function y() {
224
224
  throw new Error("Not in config rendering context");
225
225
  }
226
226
  function H(t, e) {
227
- const n = ft();
227
+ const n = gt();
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 ce = /* @__PURE__ */ new Map();
233
- function ht(t, e) {
232
+ const de = /* @__PURE__ */ new Map();
233
+ function mt(t, e) {
234
234
  t in y().callbackRegistry || (y().callbackRegistry[t] = (n) => {
235
- for (const r of ce.get(t))
235
+ for (const r of de.get(t))
236
236
  r(n);
237
- }, ce.set(t, [])), ce.get(t).push(e);
237
+ }, de.set(t, [])), de.get(t).push(e);
238
238
  }
239
- class _ {
239
+ class I {
240
240
  constructor(e, n = (r) => r) {
241
- O(this, "isResolved", !1);
242
- O(this, "resolvedValue");
243
- this.handle = e, this.postProcess = n, ht(e, (r) => {
241
+ k(this, "isResolved", !1);
242
+ k(this, "resolvedValue");
243
+ this.handle = e, this.postProcess = n, mt(e, (r) => {
244
244
  this.resolvedValue = n(r), this.isResolved = !0;
245
245
  });
246
246
  }
247
247
  map(e) {
248
- return new _(this.handle, (n) => e(this.postProcess(n)));
248
+ return new I(this.handle, (n) => e(this.postProcess(n)));
249
249
  }
250
250
  mapDefined(e) {
251
- return new _(this.handle, (n) => {
251
+ return new I(this.handle, (n) => {
252
252
  const r = this.postProcess(n);
253
253
  return r ? e(r) : void 0;
254
254
  });
@@ -257,7 +257,7 @@ class _ {
257
257
  return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
258
258
  }
259
259
  }
260
- function he(t, e) {
260
+ function ge(t, e) {
261
261
  return t === void 0 ? void 0 : e(t);
262
262
  }
263
263
  class E {
@@ -299,7 +299,7 @@ class E {
299
299
  ...this.resolvePath,
300
300
  ...n.map((i) => typeof i == "string" ? i : i.field)
301
301
  ];
302
- return he(
302
+ return ge(
303
303
  y().resolveWithCommon(this.handle, e, ...n),
304
304
  (i) => new E(i, r)
305
305
  );
@@ -321,7 +321,7 @@ class E {
321
321
  }
322
322
  getError() {
323
323
  const e = [...this.resolvePath, "error"];
324
- return he(
324
+ return ge(
325
325
  y().getError(this.handle),
326
326
  (n) => new E(n, e)
327
327
  );
@@ -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 (!Le(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
  }
@@ -381,18 +381,18 @@ 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] = be(o, (l) => new E(l, a));
384
+ i[s] = xe(o, (l) => new E(l, a));
385
385
  }
386
386
  return i;
387
387
  }
388
388
  getFileContentAsBase64(e) {
389
- return new _(y().getBlobContentAsBase64(this.handle, e));
389
+ return new I(y().getBlobContentAsBase64(this.handle, e));
390
390
  }
391
391
  getFileContentAsString(e) {
392
- return new _(y().getBlobContentAsString(this.handle, e));
392
+ return new I(y().getBlobContentAsString(this.handle, e));
393
393
  }
394
394
  getFileContentAsJson(e) {
395
- return new _(
395
+ return new I(
396
396
  y().getBlobContentAsString(this.handle, e)
397
397
  ).mapDefined((n) => JSON.parse(n));
398
398
  }
@@ -412,7 +412,7 @@ class E {
412
412
  * @returns downloaded file handle
413
413
  */
414
414
  getFileHandle() {
415
- return new _(y().getDownloadedBlobContentHandle(this.handle));
415
+ return new I(y().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 _(y().getOnDemandBlobContentHandle(this.handle));
427
+ return new I(y().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 _(y().extractArchiveAndGetURL(this.handle, e));
439
+ return new I(y().extractArchiveAndGetURL(this.handle, e));
440
440
  }
441
441
  getImportProgress() {
442
- return new _(y().getImportProgress(this.handle));
442
+ return new I(y().getImportProgress(this.handle));
443
443
  }
444
444
  getLastLogs(e) {
445
- return new _(y().getLastLogs(this.handle, e));
445
+ return new I(y().getLastLogs(this.handle, e));
446
446
  }
447
447
  getProgressLog(e) {
448
- return new _(y().getProgressLog(this.handle, e));
448
+ return new I(y().getProgressLog(this.handle, e));
449
449
  }
450
450
  getProgressLogWithInfo(e) {
451
- return new _(y().getProgressLogWithInfo(this.handle, e));
451
+ return new I(y().getProgressLogWithInfo(this.handle, e));
452
452
  }
453
453
  getLogHandle() {
454
- return new _(y().getLogHandle(this.handle));
454
+ return new I(y().getLogHandle(this.handle));
455
455
  }
456
456
  allFieldsResolved(e = "Input") {
457
457
  switch (e) {
@@ -480,116 +480,116 @@ class E {
480
480
  return s && (l = l.filter((u) => u[1] !== void 0)), l.map(([u, c]) => o(u, c));
481
481
  }
482
482
  }
483
- const Re = "staging", Fe = "main", gt = {
483
+ const Ve = "staging", je = "main", yt = {
484
484
  explicitColumnsSupport: !0,
485
485
  inlineColumnsSupport: !0,
486
486
  activeArgs: !0
487
487
  };
488
- function Ke(t) {
488
+ function Ne(t) {
489
489
  return typeof t == "object" && t !== null && "__awaited_futures__" in t;
490
490
  }
491
- function ge(t, e, n) {
491
+ function me(t, e, n) {
492
492
  if (e.has(n)) return;
493
493
  if (e.add(n), typeof n === "object")
494
- if (Ke(n)) n.__awaited_futures__.forEach((i) => t.add(i));
494
+ if (Ne(n)) n.__awaited_futures__.forEach((i) => t.add(i));
495
495
  else if (Array.isArray(n))
496
- for (const i of n) ge(t, e, i);
496
+ for (const i of n) me(t, e, i);
497
497
  else
498
498
  for (const [, i] of Object.entries(n))
499
- i !== n && ge(t, e, i);
499
+ i !== n && me(t, e, i);
500
500
  }
501
- function mt(t) {
501
+ function vt(t) {
502
502
  const e = /* @__PURE__ */ new Set();
503
- return ge(e, /* @__PURE__ */ new Set(), t), e;
503
+ return me(e, /* @__PURE__ */ new Set(), t), e;
504
504
  }
505
- const Tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
505
+ const kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
506
506
  __proto__: null,
507
- GlobalCfgRenderCtxFeatureFlags: gt,
508
- MainAccessorName: Fe,
509
- StagingAccessorName: Re,
510
- getAllFutureAwaits: mt,
511
- isFutureAwait: Ke
512
- }, Symbol.toStringTag, { value: "Module" })), yt = "pl7.app/label", vt = "pl7.app/trace", bt = U.object({
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
513
  type: U.string(),
514
514
  importance: U.number().optional(),
515
515
  id: U.string().optional(),
516
516
  label: U.string()
517
- }), wt = U.array(bt), At = 1e-3, xt = "__LABEL__", Pe = "__LABEL__@1";
518
- function je(t, e, n = {}) {
517
+ }), xt = U.array(At), Ct = 1e-3, Pt = "__LABEL__", Te = "__LABEL__@1";
518
+ function $e(t, e, n = {}) {
519
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 P, R;
521
- const v = e(p);
522
- let f, m, w;
523
- "spec" in v && typeof v.spec == "object" ? (f = v.spec, m = v.prefixTrace, w = v.suffixTrace) : f = v;
524
- const h = (P = f.annotations) == null ? void 0 : P[yt], I = (R = f.annotations) == null ? void 0 : R[vt], x = (I ? wt.safeParse(JSON.parse(I)).data : void 0) ?? [], b = [
525
- ...m ?? [],
526
- ...x,
527
- ...w ?? []
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 g = (S = f.annotations) == null ? void 0 : S[bt], x = (F = f.annotations) == null ? void 0 : F[wt], A = (x ? xt.safeParse(JSON.parse(x)).data : void 0) ?? [], C = [
525
+ ...v ?? [],
526
+ ...A,
527
+ ...b ?? []
528
528
  ];
529
- if (h !== void 0) {
530
- const k = { label: h, type: xt, importance: -2 };
531
- n.addLabelAsSuffix ? b.push(k) : b.splice(0, 0, k);
529
+ if (g !== void 0) {
530
+ const D = { label: g, type: Pt, importance: -2 };
531
+ n.addLabelAsSuffix ? C.push(D) : C.splice(0, 0, D);
532
532
  }
533
- const A = [], L = /* @__PURE__ */ new Map();
534
- for (let k = b.length - 1; k >= 0; --k) {
535
- const { type: W } = b[k], V = b[k].importance ?? 0, N = (L.get(W) ?? 0) + 1;
536
- L.set(W, N);
537
- const F = `${W}@${N}`;
538
- s.set(F, (s.get(F) ?? 0) + 1), r.set(
539
- F,
533
+ const w = [], T = /* @__PURE__ */ new Map();
534
+ for (let D = C.length - 1; D >= 0; --D) {
535
+ const { type: W } = C[D], j = C[D].importance ?? 0, $ = (T.get(W) ?? 0) + 1;
536
+ T.set(W, $);
537
+ const K = `${W}@${$}`;
538
+ s.set(K, (s.get(K) ?? 0) + 1), r.set(
539
+ K,
540
540
  Math.max(
541
- r.get(F) ?? Number.NEGATIVE_INFINITY,
542
- V - (b.length - k) * At
541
+ r.get(K) ?? Number.NEGATIVE_INFINITY,
542
+ j - (C.length - D) * Ct
543
543
  )
544
- ), A.push({ ...b[k], fullType: F, occurrenceIndex: N });
544
+ ), w.push({ ...C[D], fullType: K, occurrenceIndex: $ });
545
545
  }
546
- return A.reverse(), {
546
+ return w.reverse(), {
547
547
  value: p,
548
548
  spec: f,
549
- label: h,
550
- fullTrace: A
549
+ label: g,
550
+ fullTrace: w
551
551
  };
552
552
  }), a = [], l = [], u = [...r];
553
- u.sort(([, p], [, v]) => v - p);
553
+ u.sort(([, p], [, m]) => m - p);
554
554
  for (const [p] of u)
555
555
  p.endsWith("@1") || s.get(p) === t.length ? a.push(p) : l.push(p);
556
- const c = (p, v = !1) => {
556
+ const c = (p, m = !1) => {
557
557
  const f = [];
558
- for (let m = 0; m < o.length; m++) {
559
- const w = o[m], h = w.fullTrace.filter((b) => p.has(b.fullType) || i && i.has(b.type));
560
- if (h.length === 0)
561
- if (v)
558
+ for (let v = 0; v < o.length; v++) {
559
+ const b = o[v], g = b.fullTrace.filter((C) => p.has(C.fullType) || i && i.has(C.type));
560
+ if (g.length === 0)
561
+ if (m)
562
562
  f.push({
563
563
  label: "Unlabeled",
564
- value: w.value
564
+ value: b.value
565
565
  });
566
566
  else return;
567
- const I = h.map((b) => b.label), x = n.separator ?? " / ";
567
+ const x = g.map((C) => C.label), A = n.separator ?? " / ";
568
568
  f.push({
569
- label: I.join(x),
570
- value: w.value
569
+ label: x.join(A),
570
+ value: b.value
571
571
  });
572
572
  }
573
573
  return f;
574
574
  };
575
575
  if (a.length === 0) {
576
576
  if (l.length !== 0) throw new Error("Non-empty secondary types list while main types list is empty.");
577
- return c(new Set(Pe), !0);
577
+ return c(new Set(Te), !0);
578
578
  }
579
- let d = 0, g = -1;
579
+ let d = 0, h = -1;
580
580
  for (; d < a.length; ) {
581
581
  const p = /* @__PURE__ */ new Set();
582
- n.includeNativeLabel && p.add(Pe);
582
+ n.includeNativeLabel && p.add(Te);
583
583
  for (let f = 0; f < d; ++f) p.add(a[f]);
584
- g >= 0 && p.add(a[g]);
585
- const v = c(p);
586
- if (v !== void 0 && new Set(v.map((f) => f.label)).size === t.length) return v;
587
- g++, g >= a.length && (d++, g = d);
584
+ h >= 0 && p.add(a[h]);
585
+ const m = c(p);
586
+ if (m !== void 0 && new Set(m.map((f) => f.label)).size === t.length) return m;
587
+ h++, h >= a.length && (d++, h = d);
588
588
  }
589
589
  return c(/* @__PURE__ */ new Set([...a, ...l]), !0);
590
590
  }
591
- const Z = "PColumnData/", se = Z + "ResourceMap", oe = Z + "Partitioned/ResourceMap", q = Z + "JsonPartitioned", B = Z + "BinaryPartitioned", Ve = Z + "Partitioned/", ae = Ve + "JsonPartitioned", z = Ve + "BinaryPartitioned";
592
- function $e(t, e, n, r = [], i) {
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) {
593
593
  if (t === void 0) return !1;
594
594
  switch (t.resourceType.name) {
595
595
  case se: {
@@ -606,7 +606,7 @@ function $e(t, e, n, r = [], i) {
606
606
  const a = t.resolve({ field: o, assertFieldType: "Input" });
607
607
  if (a === void 0) s = !1;
608
608
  else {
609
- const l = [...r, ...JSON.parse(o)], u = $e(
609
+ const l = [...r, ...JSON.parse(o)], u = Me(
610
610
  a,
611
611
  e,
612
612
  n,
@@ -622,18 +622,18 @@ function $e(t, e, n, r = [], i) {
622
622
  throw new Error(`Unknown resource type: ${t.resourceType.name}`);
623
623
  }
624
624
  }
625
- function En(t, e, n = !1) {
625
+ function On(t, e, n = !1) {
626
626
  const r = [];
627
- return { isComplete: $e(t, e, r, [], n), data: r };
627
+ return { isComplete: Me(t, e, r, [], n), data: r };
628
628
  }
629
- const me = (t) => {
629
+ const ye = (t) => {
630
630
  if (t.endsWith(".index"))
631
631
  return { baseKey: t.substring(0, t.length - 6), type: "index" };
632
632
  if (t.endsWith(".values"))
633
633
  return { baseKey: t.substring(0, t.length - 7), type: "values" };
634
634
  throw new Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
635
635
  };
636
- function Ct(t) {
636
+ function St(t) {
637
637
  if (!t) return;
638
638
  const e = t.resourceType.name, n = t.getDataAsJson(), r = [];
639
639
  let i = 0;
@@ -658,7 +658,7 @@ function Ct(t) {
658
658
  case q:
659
659
  case B:
660
660
  for (let s of t.listInputFields()) {
661
- e === B && (s = me(s).baseKey);
661
+ e === B && (s = ye(s).baseKey);
662
662
  const o = [...JSON.parse(s)];
663
663
  r.push(o);
664
664
  }
@@ -670,7 +670,7 @@ function Ct(t) {
670
670
  const o = [...JSON.parse(s)], a = t.resolve({ field: s, assertFieldType: "Input" });
671
671
  if (a !== void 0)
672
672
  for (let l of a.listInputFields()) {
673
- e === z && (l = me(l).baseKey);
673
+ e === z && (l = ye(l).baseKey);
674
674
  const u = [...o, ...JSON.parse(l)];
675
675
  r.push(u);
676
676
  }
@@ -679,7 +679,7 @@ function Ct(t) {
679
679
  }
680
680
  return { data: r, keyLength: i };
681
681
  }
682
- function Pt(t) {
682
+ function _t(t) {
683
683
  if (t.type !== "JsonPartitioned" && t.type !== "BinaryPartitioned")
684
684
  throw new Error(`Splitting requires Partitioned DataInfoEntries, got ${t.type}`);
685
685
  const { parts: e, partitionKeyLength: n } = t, r = [];
@@ -698,11 +698,11 @@ function Pt(t) {
698
698
  }
699
699
  return r.map((i) => Array.from(i.values()));
700
700
  }
701
- function St(t) {
701
+ function It(t) {
702
702
  if (t === void 0) return;
703
- if (Te(t))
704
- return Pt(t);
705
- const e = Ct(t);
703
+ if (Oe(t))
704
+ return _t(t);
705
+ const e = St(t);
706
706
  if (!e) return;
707
707
  const { data: n, keyLength: r } = e, i = [];
708
708
  for (let s = 0; s < r; ++s)
@@ -715,7 +715,7 @@ function St(t) {
715
715
  }
716
716
  return i.map((s) => Array.from(s.values()));
717
717
  }
718
- function ye(t, e = []) {
718
+ function ve(t, e = []) {
719
719
  if (t === void 0 || !t.getIsReadyOrError()) return;
720
720
  const n = t.resourceType.name, r = t.getDataAsJson();
721
721
  if (e.length > 0 && (n === ae || n === z))
@@ -745,7 +745,7 @@ function ye(t, e = []) {
745
745
  throw new Error(`Missing partitionKeyLength in metadata for ${n}`);
746
746
  const i = [], s = /* @__PURE__ */ new Map();
747
747
  for (const o of t.listInputFields()) {
748
- const a = me(o), l = t.resolve({ field: o, assertFieldType: "Input" });
748
+ const a = ye(o), l = t.resolve({ field: o, assertFieldType: "Input" });
749
749
  if (l === void 0) return;
750
750
  let u = s.get(a.baseKey);
751
751
  u || (u = {}, s.set(a.baseKey, u)), a.type === "index" ? u.index = l : u.values = l;
@@ -776,7 +776,7 @@ function ye(t, e = []) {
776
776
  if (a === void 0) return;
777
777
  if (a.resourceType.name !== q)
778
778
  throw new Error(`Expected ${q} inside ${n}, but got ${a.resourceType.name}`);
779
- const l = ye(a, JSON.parse(o));
779
+ const l = ve(a, JSON.parse(o));
780
780
  if (l === void 0) return;
781
781
  if (l.type !== "JsonPartitioned")
782
782
  throw new Error(`Unexpected inner result type for ${n}: ${l.type}`);
@@ -797,7 +797,7 @@ function ye(t, e = []) {
797
797
  if (a === void 0) return;
798
798
  if (a.resourceType.name !== B)
799
799
  throw new Error(`Expected ${B} inside ${n}, but got ${a.resourceType.name}`);
800
- const l = ye(a, JSON.parse(o));
800
+ const l = ve(a, JSON.parse(o));
801
801
  if (l === void 0) return;
802
802
  if (l.type !== "BinaryPartitioned")
803
803
  throw new Error(`Unexpected inner result type for ${n}: ${l.type}`);
@@ -813,15 +813,15 @@ function ye(t, e = []) {
813
813
  throw new Error(`Unknown resource type: ${n}`);
814
814
  }
815
815
  }
816
- function _t(t) {
816
+ function Tt(t) {
817
817
  if (t !== void 0) {
818
- if (Te(t)) return t;
819
- if (we(t)) return Ye(t);
820
- if (t instanceof E) return ye(t);
818
+ if (Oe(t)) return t;
819
+ if (Ce(t)) return Qe(t);
820
+ if (t instanceof E) return ve(t);
821
821
  throw new Error(`Unexpected input type: ${typeof t}`);
822
822
  }
823
823
  }
824
- function It(t, e) {
824
+ function Lt(t, e) {
825
825
  const n = [...e].sort((s, o) => o[0] - s[0]);
826
826
  if (t.type === "JsonPartitioned" || t.type === "BinaryPartitioned") {
827
827
  const { partitionKeyLength: s } = t;
@@ -881,13 +881,13 @@ function It(t, e) {
881
881
  }
882
882
  }
883
883
  }
884
- function Lt(t) {
884
+ function Et(t) {
885
885
  if (!Array.isArray(t)) return !1;
886
886
  if (t.length === 0) return !0;
887
887
  const e = t[0];
888
888
  return typeof e == "object" && e !== null && "key" in e && "val" in e;
889
889
  }
890
- class Tt {
890
+ class Dt {
891
891
  constructor(e) {
892
892
  this.columns = e;
893
893
  }
@@ -896,30 +896,30 @@ class Tt {
896
896
  return this.columns.filter((r) => n(r.spec));
897
897
  }
898
898
  }
899
- function Et(t) {
899
+ function kt(t) {
900
900
  if (t)
901
901
  return t.map((e) => ({
902
- type: `split:${et(e.axisId)}`,
902
+ type: `split:${nt(e.axisId)}`,
903
903
  label: e.label,
904
904
  importance: 1e6
905
905
  // High importance for split filters in labels
906
906
  }));
907
907
  }
908
- function kt(t) {
908
+ function Ot(t) {
909
909
  if (t)
910
910
  return t.map((e) => [e.axisIdx, e.value]);
911
911
  }
912
- function Ot(t, e) {
912
+ function Rt(t, e) {
913
913
  if (!e || e.length === 0) return t;
914
914
  const n = [...e].sort((r, i) => r[0] - i[0]);
915
- return ke({ id: t, axisFilters: n });
915
+ return Re({ id: t, axisFilters: n });
916
916
  }
917
- function Se(t) {
917
+ function Le(t) {
918
918
  if (!t || typeof t != "object") return !1;
919
919
  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
920
  return !!e.domainAnchor || n || r;
921
921
  }
922
- function Dt(t) {
922
+ function Ft(t) {
923
923
  if (typeof t != "object" || !("axes" in t) || t.axes === void 0)
924
924
  return [];
925
925
  const e = t.axes.map((n, r) => typeof n == "object" && "split" in n && n.split === !0 ? r : -1).filter((n) => n !== -1);
@@ -929,9 +929,9 @@ function Dt(t) {
929
929
  }
930
930
  class le {
931
931
  constructor() {
932
- O(this, "defaultProviderStore", []);
933
- O(this, "providers", [new Tt(this.defaultProviderStore)]);
934
- O(this, "axisLabelProviders", []);
932
+ k(this, "defaultProviderStore", []);
933
+ k(this, "providers", [new Dt(this.defaultProviderStore)]);
934
+ k(this, "axisLabelProviders", []);
935
935
  }
936
936
  addColumnProvider(e) {
937
937
  return this.providers.push(e), this;
@@ -959,129 +959,129 @@ class le {
959
959
  };
960
960
  let u = () => !1;
961
961
  if (a) {
962
- const f = (Array.isArray(a) ? a : [a]).map((m) => {
963
- if (Se(m)) {
962
+ const f = (Array.isArray(a) ? a : [a]).map((v) => {
963
+ if (Le(v)) {
964
964
  if (!r)
965
965
  throw new Error("Anchored selectors in exclude require an AnchoredIdDeriver to be provided in options.");
966
- return X(Ae(r.anchors, m, n));
966
+ return X(Pe(r.anchors, v, n));
967
967
  } else
968
- return X(m);
968
+ return X(v);
969
969
  });
970
- u = (m) => f.some((w) => w(m));
970
+ u = (v) => f.some((b) => b(v));
971
971
  }
972
- const c = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], d = [], g = /* @__PURE__ */ new Set();
972
+ const c = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], d = [], h = /* @__PURE__ */ new Set();
973
973
  for (const f of c) {
974
- const m = Se(f);
975
- let w;
976
- if (m) {
974
+ const v = Le(f);
975
+ let b;
976
+ if (v) {
977
977
  if (!r)
978
978
  throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");
979
- w = Ae(r.anchors, f, n);
979
+ b = Pe(r.anchors, f, n);
980
980
  } else
981
- w = f;
982
- const h = /* @__PURE__ */ new Set(), I = [];
983
- for (const A of this.providers) {
984
- const L = A.selectColumns(w);
985
- for (const P of L) {
986
- if (u(P.spec)) continue;
987
- if (h.has(P.id))
988
- throw new Error(`Duplicate column id ${P.id} in provider ${A.constructor.name}`);
989
- const R = Xe(P.spec);
990
- g.has(R) || (h.add(P.id), g.add(R), I.push(P));
981
+ b = f;
982
+ const g = /* @__PURE__ */ new Set(), x = [];
983
+ for (const w of this.providers) {
984
+ const T = w.selectColumns(b);
985
+ for (const S of T) {
986
+ if (u(S.spec)) continue;
987
+ if (g.has(S.id))
988
+ throw new Error(`Duplicate column id ${S.id} in provider ${w.constructor.name}`);
989
+ const F = Ze(S.spec);
990
+ h.has(F) || (g.add(S.id), h.add(F), x.push(S));
991
991
  }
992
992
  }
993
- if (I.length === 0) continue;
994
- const x = Dt(f), b = x.length > 0;
995
- for (const A of I) {
996
- if (!ne(A.spec)) continue;
997
- const L = A.spec;
998
- if (b) {
999
- if (Lt(A.data))
1000
- throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${A.id}`);
1001
- const P = _t(A.data);
1002
- if (!P) {
993
+ if (x.length === 0) continue;
994
+ const A = Ft(f), C = A.length > 0;
995
+ for (const w of x) {
996
+ if (!ne(w.spec)) continue;
997
+ const T = w.spec;
998
+ if (C) {
999
+ if (Et(w.data))
1000
+ throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${w.id}`);
1001
+ const S = Tt(w.data);
1002
+ if (!S) {
1003
1003
  if (s) continue;
1004
1004
  return;
1005
1005
  }
1006
- if (!Qe(P))
1007
- throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${P.type} for column ${A.id}`);
1008
- const R = St(P), k = x[x.length - 1];
1009
- if (k >= P.partitionKeyLength)
1010
- throw new Error(`Not enough partition keys (${P.partitionKeyLength}) for requested split axes (max index ${k}) in column ${L.name}`);
1011
- const W = x.map((S) => this.findLabels(D(L.axesSpec[S]))), V = [], N = (S, G) => {
1012
- if (G >= x.length) {
1013
- if (V.push([...S]), V.length > 1e4)
1006
+ if (!et(S))
1007
+ throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${S.type} for column ${w.id}`);
1008
+ const F = It(S), D = A[A.length - 1];
1009
+ if (D >= S.partitionKeyLength)
1010
+ throw new Error(`Not enough partition keys (${S.partitionKeyLength}) for requested split axes (max index ${D}) in column ${T.name}`);
1011
+ const W = A.map((_) => this.findLabels(O(T.axesSpec[_]))), j = [], $ = (_, G) => {
1012
+ if (G >= A.length) {
1013
+ if (j.push([..._]), j.length > 1e4)
1014
1014
  throw new Error("Too many key combinations, aborting.");
1015
1015
  return;
1016
1016
  }
1017
- const $ = x[G];
1018
- if ($ >= R.length)
1019
- throw new Error(`Axis index ${$} out of bounds for unique keys array (length ${R.length}) during split key generation for column ${A.id}`);
1020
- const J = R[$];
1017
+ const N = A[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 ${w.id}`);
1020
+ const J = F[N];
1021
1021
  if (!J || J.length === 0) {
1022
- V.length = 0;
1022
+ j.length = 0;
1023
1023
  return;
1024
1024
  }
1025
1025
  for (const ee of J)
1026
- S.push(ee), N(S, G + 1), S.pop();
1026
+ _.push(ee), $(_, G + 1), _.pop();
1027
1027
  };
1028
- if (N([], 0), V.length === 0)
1028
+ if ($([], 0), j.length === 0)
1029
1029
  continue;
1030
- const F = [...L.axesSpec], Be = x.map((S) => S);
1031
- for (let S = x.length - 1; S >= 0; S--)
1032
- F.splice(x[S], 1);
1033
- const We = { ...L, axesSpec: F };
1034
- for (const S of V) {
1035
- const G = S.map(($, J) => {
1036
- const ee = Be[J], Ge = D(L.axesSpec[ee]), ue = W[J], He = (ue == null ? void 0 : ue[$]) ?? String($);
1037
- return { axisIdx: ee, axisId: Ge, value: $, label: He };
1030
+ const K = [...T.axesSpec], Ge = A.map((_) => _);
1031
+ for (let _ = A.length - 1; _ >= 0; _--)
1032
+ K.splice(A[_], 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 };
1038
1038
  });
1039
1039
  d.push({
1040
1040
  type: "split",
1041
- originalColumn: A,
1042
- spec: L,
1043
- adjustedSpec: We,
1044
- dataEntries: P,
1041
+ originalColumn: w,
1042
+ spec: T,
1043
+ adjustedSpec: He,
1044
+ dataEntries: S,
1045
1045
  axisFilters: G
1046
1046
  });
1047
1047
  }
1048
1048
  } else
1049
1049
  d.push({
1050
1050
  type: "direct",
1051
- originalColumn: A,
1052
- spec: L,
1053
- adjustedSpec: L
1051
+ originalColumn: w,
1052
+ spec: T,
1053
+ adjustedSpec: T
1054
1054
  });
1055
1055
  }
1056
1056
  }
1057
1057
  if (d.length === 0) return [];
1058
- const p = je(
1058
+ const p = $e(
1059
1059
  d,
1060
1060
  (f) => ({
1061
1061
  spec: f.spec,
1062
- suffixTrace: f.type === "split" ? Et(f.axisFilters) : void 0
1062
+ suffixTrace: f.type === "split" ? kt(f.axisFilters) : void 0
1063
1063
  }),
1064
1064
  l
1065
- ), v = [];
1066
- for (const { value: f, label: m } of p) {
1067
- const { originalColumn: w, spec: h } = f, I = f.type === "split" ? f.axisFilters : void 0, x = kt(I);
1068
- let b;
1069
- r ? b = r.deriveS(h, x) : b = Ot(w.id, x);
1070
- let A = { ...f.adjustedSpec };
1071
- o && (A = {
1072
- ...A,
1065
+ ), m = [];
1066
+ for (const { value: f, label: v } of p) {
1067
+ const { originalColumn: b, spec: g } = f, x = f.type === "split" ? f.axisFilters : void 0, A = Ot(x);
1068
+ let C;
1069
+ r ? C = r.deriveS(g, A) : C = Rt(b.id, A);
1070
+ let w = { ...f.adjustedSpec };
1071
+ o && (w = {
1072
+ ...w,
1073
1073
  annotations: {
1074
- ...A.annotations ?? {},
1075
- "pl7.app/label": m
1074
+ ...w.annotations ?? {},
1075
+ "pl7.app/label": v
1076
1076
  }
1077
- }), v.push({
1078
- id: b,
1079
- spec: A,
1080
- data: () => f.type === "split" ? Ze(It(f.dataEntries, x)) : f.originalColumn.data,
1081
- label: m
1077
+ }), m.push({
1078
+ id: C,
1079
+ spec: w,
1080
+ data: () => f.type === "split" ? tt(Lt(f.dataEntries, A)) : f.originalColumn.data,
1081
+ label: v
1082
1082
  });
1083
1083
  }
1084
- return v;
1084
+ return m;
1085
1085
  }
1086
1086
  getColumns(e, n) {
1087
1087
  const r = this.getUniversalEntries(e, {
@@ -1106,19 +1106,19 @@ class le {
1106
1106
  return i;
1107
1107
  }
1108
1108
  }
1109
- function de(t, e) {
1109
+ function pe(t, e) {
1110
1110
  if (t === void 0) return e === void 0;
1111
1111
  if (e === void 0) return !0;
1112
1112
  for (const n in e)
1113
1113
  if (t[n] !== e[n]) return !1;
1114
1114
  return !0;
1115
1115
  }
1116
- function _e(t) {
1117
- return be(t, (e) => e instanceof E ? e.handle : we(e) ? ot(e, (n) => n.handle) : e);
1116
+ function Ee(t) {
1117
+ return xe(t, (e) => e instanceof E ? e.handle : Ce(e) ? lt(e, (n) => n.handle) : e);
1118
1118
  }
1119
- class Rt {
1119
+ class Kt {
1120
1120
  constructor() {
1121
- O(this, "ctx", y());
1121
+ k(this, "ctx", y());
1122
1122
  }
1123
1123
  /**
1124
1124
  * @deprecated use getOptions()
@@ -1129,26 +1129,26 @@ class Rt {
1129
1129
  getOptions(e, n) {
1130
1130
  const r = typeof e == "function" ? e : X(e), i = this.getSpecs().entries.filter((a) => r(a.obj));
1131
1131
  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" ? je(i, (a) => a.obj, s ?? {}).map(({ value: { ref: a }, label: l }) => ({
1133
- ref: xe(a, o),
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
+ ref: Se(a, o),
1134
1134
  label: l
1135
1135
  })) : i.map(({ ref: a, obj: l }) => ({
1136
- ref: xe(a, o),
1136
+ ref: Se(a, o),
1137
1137
  label: s(l, a)
1138
1138
  }));
1139
1139
  }
1140
1140
  resolveAnchorCtx(e) {
1141
- if (e instanceof Ce) return e;
1141
+ if (e instanceof _e) return e;
1142
1142
  const n = {};
1143
1143
  for (const [r, i] of Object.entries(e))
1144
- if (tt(i)) {
1144
+ if (rt(i)) {
1145
1145
  const s = this.getPColumnSpecByRef(i);
1146
1146
  if (!s)
1147
1147
  return;
1148
1148
  n[r] = s;
1149
1149
  } else
1150
1150
  n[r] = i;
1151
- return new Ce(n);
1151
+ return new _e(n);
1152
1152
  }
1153
1153
  /**
1154
1154
  * Returns columns that match the provided anchors and selectors. It applies axis filters and label derivation.
@@ -1241,7 +1241,7 @@ class Rt {
1241
1241
  ref: n.ref,
1242
1242
  obj: {
1243
1243
  ...n.obj,
1244
- data: nt(
1244
+ data: it(
1245
1245
  n.obj.data,
1246
1246
  (r) => new E(r, [n.ref.blockId, n.ref.name])
1247
1247
  )
@@ -1270,7 +1270,7 @@ class Rt {
1270
1270
  )) == null ? void 0 : r.obj;
1271
1271
  const n = this.ctx.getDataFromResultPoolByRef(e.blockId, e.name);
1272
1272
  if (n)
1273
- return be(
1273
+ return xe(
1274
1274
  n,
1275
1275
  (i) => new E(i, [e.blockId, e.name])
1276
1276
  );
@@ -1283,7 +1283,7 @@ class Rt {
1283
1283
  getPColumnByRef(e) {
1284
1284
  const n = this.getDataByRef(e);
1285
1285
  if (n)
1286
- return rt(n);
1286
+ return st(n);
1287
1287
  }
1288
1288
  /**
1289
1289
  * Returns spec associated with the ref ensuring that it is a p-column spec.
@@ -1315,10 +1315,10 @@ class Rt {
1315
1315
  if (!ne(r.obj.spec))
1316
1316
  continue;
1317
1317
  const i = r.obj.spec;
1318
- if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && de(e.domain, i.domain)) {
1318
+ if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && pe(e.domain, i.domain)) {
1319
1319
  for (let s = 0; s < e.axesSpec.length; ++s) {
1320
1320
  const o = e.axesSpec[s], a = i.axesSpec[s];
1321
- if (o.name !== a.name || o.type !== a.type || !de(o.domain, a.domain))
1321
+ if (o.name !== a.name || o.type !== a.type || !pe(o.domain, a.domain))
1322
1322
  continue e;
1323
1323
  }
1324
1324
  n.push(r.obj);
@@ -1333,9 +1333,9 @@ class Rt {
1333
1333
  findLabels(e) {
1334
1334
  const n = this.getData();
1335
1335
  for (const r of n.entries) {
1336
- if (!Le(r.obj)) continue;
1336
+ if (!ke(r.obj)) continue;
1337
1337
  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 && de(e.domain, i.axesSpec[0].domain)) {
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
1339
  if (r.obj.data.resourceType.name !== "PColumnData/Json")
1340
1340
  throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
1341
1341
  return Object.fromEntries(
@@ -1360,7 +1360,7 @@ class Rt {
1360
1360
  let a = null;
1361
1361
  const l = this;
1362
1362
  return {
1363
- id: ke(i),
1363
+ id: Re(i),
1364
1364
  spec: o,
1365
1365
  get data() {
1366
1366
  var u;
@@ -1387,12 +1387,12 @@ class Rt {
1387
1387
  }
1388
1388
  class te {
1389
1389
  constructor() {
1390
- O(this, "ctx");
1391
- O(this, "args");
1392
- O(this, "uiState");
1390
+ k(this, "ctx");
1391
+ k(this, "args");
1392
+ k(this, "uiState");
1393
1393
  // lazy rendering because this feature is rarely used
1394
- O(this, "_activeArgsCache");
1395
- O(this, "resultPool", new Rt());
1394
+ k(this, "_activeArgsCache");
1395
+ k(this, "resultPool", new Kt());
1396
1396
  this.ctx = y(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
1397
1397
  }
1398
1398
  /**
@@ -1409,16 +1409,16 @@ class te {
1409
1409
  // return this.ctx.featureFlags;
1410
1410
  // }
1411
1411
  getNamedAccessor(e) {
1412
- return he(
1412
+ return ge(
1413
1413
  this.ctx.getAccessorHandleByName(e),
1414
1414
  (n) => new E(n, [e])
1415
1415
  );
1416
1416
  }
1417
1417
  get prerun() {
1418
- return this.getNamedAccessor(Re);
1418
+ return this.getNamedAccessor(Ve);
1419
1419
  }
1420
1420
  get outputs() {
1421
- return this.getNamedAccessor(Fe);
1421
+ return this.getNamedAccessor(je);
1422
1422
  }
1423
1423
  /**
1424
1424
  * Find labels data for a given axis id. It will search for a label column and return its data as a map.
@@ -1430,13 +1430,13 @@ class te {
1430
1430
  }
1431
1431
  verifyInlineAndExplicitColumnsSupport(e) {
1432
1432
  var i;
1433
- const n = e.some((s) => !(s.data instanceof E) || we(s.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
1433
+ const n = e.some((s) => !(s.data instanceof E) || Ce(s.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
1434
1434
  if (n && !r) throw Error("Inline or explicit columns not supported");
1435
1435
  }
1436
1436
  // TODO remove all non-PColumn fields
1437
1437
  createPFrame(e) {
1438
1438
  return this.verifyInlineAndExplicitColumnsSupport(e), this.ctx.createPFrame(
1439
- e.map((n) => _e(n))
1439
+ e.map((n) => Ee(n))
1440
1440
  );
1441
1441
  }
1442
1442
  createPTable(e) {
@@ -1448,8 +1448,8 @@ class te {
1448
1448
  },
1449
1449
  filters: e.filters ?? [],
1450
1450
  sorting: e.sorting ?? []
1451
- } : n = e, this.verifyInlineAndExplicitColumnsSupport(it(n.src)), this.ctx.createPTable(
1452
- st(n, (r) => _e(r))
1451
+ } : n = e, this.verifyInlineAndExplicitColumnsSupport(ot(n.src)), this.ctx.createPTable(
1452
+ at(n, (r) => Ee(r))
1453
1453
  );
1454
1454
  }
1455
1455
  /** @deprecated scheduled for removal from SDK */
@@ -1469,19 +1469,19 @@ class te {
1469
1469
  this.ctx.logError(e);
1470
1470
  }
1471
1471
  }
1472
- const Y = "1.34.10";
1473
- function Ft(t) {
1472
+ const Y = "1.37.0";
1473
+ function Vt(t) {
1474
1474
  return t.__renderLambda === !0;
1475
1475
  }
1476
- function pe(t) {
1476
+ function fe(t) {
1477
1477
  if (t !== void 0)
1478
- return Ft(t) ? t.handle : t;
1478
+ return Vt(t) ? t.handle : t;
1479
1479
  }
1480
1480
  function M(t) {
1481
1481
  if (t !== void 0)
1482
1482
  return typeof t == "string" ? { __renderLambda: !0, handle: t, retentive: !1 } : t;
1483
1483
  }
1484
- function kn(t) {
1484
+ function Rn(t) {
1485
1485
  if (t.v3 !== void 0) {
1486
1486
  const {
1487
1487
  initialArgs: e,
@@ -1549,12 +1549,12 @@ function kn(t) {
1549
1549
  );
1550
1550
  }
1551
1551
  }
1552
- class T {
1552
+ class L {
1553
1553
  constructor(e, n, r, i, s, o, a, l) {
1554
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;
1555
1555
  }
1556
1556
  static create(e = "Heavy") {
1557
- return new T(
1557
+ return new L(
1558
1558
  e,
1559
1559
  void 0,
1560
1560
  {},
@@ -1568,7 +1568,7 @@ class T {
1568
1568
  output(e, n, r = {}) {
1569
1569
  if (typeof n == "function") {
1570
1570
  const i = `output#${e}`;
1571
- return H(i, () => n(new te())), new T(
1571
+ return H(i, () => n(new te())), new L(
1572
1572
  this._renderingMode,
1573
1573
  this._initialArgs,
1574
1574
  this._initialUiState,
@@ -1586,7 +1586,7 @@ class T {
1586
1586
  this._enrichmentTargets
1587
1587
  );
1588
1588
  } else
1589
- return new T(
1589
+ return new L(
1590
1590
  this._renderingMode,
1591
1591
  this._initialArgs,
1592
1592
  this._initialUiState,
@@ -1605,7 +1605,7 @@ class T {
1605
1605
  return this.output(e, n, { retentive: !0 });
1606
1606
  }
1607
1607
  argsValid(e) {
1608
- return typeof e == "function" ? (H("inputsValid", () => e(new te())), new T(
1608
+ return typeof e == "function" ? (H("inputsValid", () => e(new te())), new L(
1609
1609
  this._renderingMode,
1610
1610
  this._initialArgs,
1611
1611
  this._initialUiState,
@@ -1617,7 +1617,7 @@ class T {
1617
1617
  this._sections,
1618
1618
  this._title,
1619
1619
  this._enrichmentTargets
1620
- )) : new T(
1620
+ )) : new L(
1621
1621
  this._renderingMode,
1622
1622
  this._initialArgs,
1623
1623
  this._initialUiState,
@@ -1629,7 +1629,7 @@ class T {
1629
1629
  );
1630
1630
  }
1631
1631
  sections(e) {
1632
- return Array.isArray(e) ? this.sections(re(e)) : typeof e == "function" ? (H("sections", () => e(new te())), new T(
1632
+ return Array.isArray(e) ? this.sections(re(e)) : typeof e == "function" ? (H("sections", () => e(new te())), new L(
1633
1633
  this._renderingMode,
1634
1634
  this._initialArgs,
1635
1635
  this._initialUiState,
@@ -1638,7 +1638,7 @@ class T {
1638
1638
  { __renderLambda: !0, handle: "sections" },
1639
1639
  this._title,
1640
1640
  this._enrichmentTargets
1641
- )) : new T(
1641
+ )) : new L(
1642
1642
  this._renderingMode,
1643
1643
  this._initialArgs,
1644
1644
  this._initialUiState,
@@ -1651,7 +1651,7 @@ class T {
1651
1651
  }
1652
1652
  /** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
1653
1653
  title(e) {
1654
- return H("title", () => e(new te())), new T(
1654
+ return H("title", () => e(new te())), new L(
1655
1655
  this._renderingMode,
1656
1656
  this._initialArgs,
1657
1657
  this._initialUiState,
@@ -1667,7 +1667,7 @@ class T {
1667
1667
  * @deprecated use {@link withArgs}
1668
1668
  * */
1669
1669
  initialArgs(e) {
1670
- return new T(
1670
+ return new L(
1671
1671
  this._renderingMode,
1672
1672
  e,
1673
1673
  this._initialUiState,
@@ -1680,7 +1680,7 @@ class T {
1680
1680
  }
1681
1681
  /** Sets initial args for the block, this value must be specified. */
1682
1682
  withArgs(e) {
1683
- return new T(
1683
+ return new L(
1684
1684
  this._renderingMode,
1685
1685
  e,
1686
1686
  this._initialUiState,
@@ -1693,7 +1693,7 @@ class T {
1693
1693
  }
1694
1694
  /** Defines type and sets initial value for block UiState. */
1695
1695
  withUiState(e) {
1696
- return new T(
1696
+ return new L(
1697
1697
  this._renderingMode,
1698
1698
  this._initialArgs,
1699
1699
  e,
@@ -1709,7 +1709,7 @@ class T {
1709
1709
  * Influences dependency graph construction.
1710
1710
  */
1711
1711
  enriches(e) {
1712
- return H("enrichmentTargets", e), new T(
1712
+ return H("enrichmentTargets", e), new L(
1713
1713
  this._renderingMode,
1714
1714
  this._initialArgs,
1715
1715
  this._initialUiState,
@@ -1741,48 +1741,51 @@ class T {
1741
1741
  sdkVersion: Y,
1742
1742
  renderingMode: this._renderingMode,
1743
1743
  initialArgs: this._initialArgs,
1744
- inputsValid: pe(this._inputsValid),
1745
- sections: pe(this._sections),
1744
+ inputsValid: fe(this._inputsValid),
1745
+ sections: fe(this._sections),
1746
1746
  outputs: Object.fromEntries(
1747
- Object.entries(this._outputs).map(([n, r]) => [n, pe(r)])
1747
+ Object.entries(this._outputs).map(([n, r]) => [n, fe(r)])
1748
1748
  )
1749
1749
  };
1750
- return pt() ? De({ sdkVersion: Y }) : { config: e };
1750
+ return ht() ? Ke({ sdkVersion: Y }) : { config: e };
1751
1751
  }
1752
1752
  }
1753
- function On(t) {
1754
- const e = t.type;
1755
- switch (e) {
1756
- case "axis":
1757
- return K(t);
1758
- case "column":
1759
- return K(t);
1760
- default:
1761
- throw Error(`unsupported column type: ${e}`);
1762
- }
1753
+ function Ue() {
1754
+ return {
1755
+ version: 2,
1756
+ stateCache: [],
1757
+ pTableParams: {
1758
+ sorting: [],
1759
+ filters: [],
1760
+ hiddenColIds: null
1761
+ }
1762
+ };
1763
1763
  }
1764
- function ve(t) {
1764
+ function jt(t) {
1765
+ return "version" in t ? t : Ue();
1766
+ }
1767
+ function be(t) {
1765
1768
  return t.axesSpec.length === 1 && t.name === "pl7.app/label";
1766
1769
  }
1767
- function Ne(t) {
1770
+ function Be(t) {
1768
1771
  return new le().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
1769
1772
  name: "pl7.app/label",
1770
1773
  axes: [{}]
1771
1774
  // exactly one axis
1772
1775
  }, { dontWaitAllData: !0 });
1773
1776
  }
1774
- function Je(t, e) {
1777
+ function we(t, e) {
1775
1778
  const n = [], r = [];
1776
1779
  for (const a of t)
1777
- ve(a.spec) ? n.push(a) : r.push(a);
1780
+ be(a.spec) ? n.push(a) : r.push(a);
1778
1781
  const i = [];
1779
1782
  for (const a of r)
1780
1783
  for (const l of a.spec.axesSpec) {
1781
- const u = D(l);
1782
- i.some((c) => j(c, u)) || i.push(u);
1784
+ const u = O(l);
1785
+ i.some((c) => V(c, u)) || i.push(u);
1783
1786
  }
1784
1787
  for (const a of n) {
1785
- const l = D(a.spec.axesSpec[0]), u = i.findIndex((c) => j(c, l));
1788
+ const l = O(a.spec.axesSpec[0]), u = i.findIndex((c) => V(c, l));
1786
1789
  u !== -1 && i.splice(u, 1);
1787
1790
  }
1788
1791
  const s = (a, l) => {
@@ -1793,10 +1796,10 @@ function Je(t, e) {
1793
1796
  return u;
1794
1797
  }, o = [];
1795
1798
  for (const a of e) {
1796
- const l = a.spec.axesSpec[0], u = D(l), c = i.findIndex((d) => j(d, u));
1799
+ const l = a.spec.axesSpec[0], u = O(l), c = i.findIndex((d) => V(d, u));
1797
1800
  if (c !== -1) {
1798
- const d = i[c], g = Object.keys(d.domain ?? {}).length, p = Object.keys(l.domain ?? {}).length;
1799
- g > p ? o.push({
1801
+ const d = i[c], h = Object.keys(d.domain ?? {}).length, p = Object.keys(l.domain ?? {}).length;
1802
+ h > p ? o.push({
1800
1803
  id: s(a.id, d.domain),
1801
1804
  spec: {
1802
1805
  ...a.spec,
@@ -1808,7 +1811,7 @@ function Je(t, e) {
1808
1811
  }
1809
1812
  return o;
1810
1813
  }
1811
- function Me(t) {
1814
+ function We(t) {
1812
1815
  const e = (i) => Array.isArray(i), n = (i) => i instanceof E, r = (i) => typeof i == "object" && "type" in i;
1813
1816
  return t.map((i) => i.data).every((i) => {
1814
1817
  if (e(i))
@@ -1828,7 +1831,7 @@ function Me(t) {
1828
1831
  throw Error(`unsupported column data type: ${i}`);
1829
1832
  });
1830
1833
  }
1831
- function Ue(t, e, n, r, i, s) {
1834
+ function Ae(t, e, n, r, i, s) {
1832
1835
  let o = t;
1833
1836
  const a = [];
1834
1837
  if (s) {
@@ -1849,60 +1852,61 @@ function Ue(t, e, n, r, i, s) {
1849
1852
  sorting: i
1850
1853
  };
1851
1854
  }
1852
- function Dn(t, e, n, r) {
1855
+ function Fn(t, e, n, r) {
1853
1856
  var u, c;
1854
1857
  Array.isArray(r) && (r = { filters: r });
1855
- const i = (r == null ? void 0 : r.coreJoinType) ?? "full", s = [...(r == null ? void 0 : r.filters) ?? [], ...((u = n == null ? void 0 : n.pTableParams) == null ? void 0 : u.filters) ?? []], o = ((c = n == null ? void 0 : n.pTableParams) == null ? void 0 : c.sorting) ?? [], a = Ne(t.resultPool);
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);
1856
1865
  if (!a) return;
1857
- const l = Je(e.map(Ee), a);
1858
- if (Me([...e, ...l]))
1866
+ const l = we(e.map(he), a);
1867
+ if (We([...e, ...l]))
1859
1868
  return t.createPTable(
1860
- Ue(e, l, i, s, o, r == null ? void 0 : r.coreColumnPredicate)
1869
+ Ae(e, l, i, s, o, r == null ? void 0 : r.coreColumnPredicate)
1861
1870
  );
1862
1871
  }
1863
- function Kt(t) {
1872
+ function Nt(t) {
1864
1873
  var e;
1865
1874
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "hidden";
1866
1875
  }
1867
- function jt(t) {
1876
+ function $t(t) {
1868
1877
  var e;
1869
1878
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "optional";
1870
1879
  }
1871
- function Rn(t, e, n, r, i) {
1872
- var m, w;
1873
- const s = (i == null ? void 0 : i.coreJoinType) ?? "full", o = [...(i == null ? void 0 : i.filters) ?? [], ...((m = r == null ? void 0 : r.pTableParams) == null ? void 0 : m.filters) ?? []], a = ((w = r == null ? void 0 : r.pTableParams) == null ? void 0 : w.sorting) ?? [], l = e.filter((h) => !Kt(h.spec)), u = l.find((h) => n(h.spec));
1880
+ function ue(t, e) {
1881
+ return [...new Map(t.map((n) => [e(n), n])).values()];
1882
+ }
1883
+ function Kn(t, e, n, r) {
1884
+ const i = jt(n ?? Ue()), s = (r == null ? void 0 : r.coreJoinType) ?? "full", o = ue(
1885
+ [...(r == null ? void 0 : r.filters) ?? [], ...i.pTableParams.filters],
1886
+ (g) => R(g.column)
1887
+ ), a = ue(
1888
+ [...(r == null ? void 0 : r.sorting) ?? [], ...i.pTableParams.sorting],
1889
+ (g) => R(g.column)
1890
+ ), l = e.filter((g) => !Nt(g.spec)), u = Be(t.resultPool);
1874
1891
  if (!u) return;
1875
- const c = Ne(t.resultPool);
1876
- if (!c) return;
1877
- const d = new Set((() => {
1878
- var I, x;
1892
+ const c = we(l.map(he), u), d = Ae(l, c, s, o, a, r == null ? void 0 : r.coreColumnPredicate), h = t.createPTable(d), p = new Set((() => {
1879
1893
  if (s === "inner") return [];
1880
- const h = (x = (I = r == null ? void 0 : r.gridState.columnVisibility) == null ? void 0 : I.hiddenColIds) == null ? void 0 : x.map(fe).filter((b) => b.type === "column").map((b) => b.id);
1881
- return h || l.filter((b) => jt(b.spec)).map((b) => b.id);
1894
+ const g = i.pTableParams.hiddenColIds;
1895
+ return g || l.filter((x) => $t(x.spec)).map((x) => x.id);
1882
1896
  })());
1883
- d.delete(u.id), [...o.map((h) => h.column), ...a.map((h) => h.column)].filter((h) => h.type === "column").map((h) => d.delete(h.id));
1884
- const g = l.filter((h) => !d.has(h.id)), p = Je(g.map(Ee), c), v = [
1885
- ...u.spec.axesSpec.map((h) => ({
1886
- type: "axis",
1887
- id: D(h),
1888
- spec: h
1889
- })),
1890
- ...[...l, ...p].map((h) => ({
1891
- type: "column",
1892
- id: h.id,
1893
- spec: h.spec
1894
- }))
1895
- ];
1896
- if (!Me([...g, ...p])) return;
1897
- const f = t.createPTable(
1898
- Ue(l, p, s, o, a, i == null ? void 0 : i.coreColumnPredicate)
1899
- );
1897
+ r != null && r.coreColumnPredicate && l.flatMap((x) => {
1898
+ var A;
1899
+ return (A = r == null ? void 0 : r.coreColumnPredicate) != null && A.call(r, x.spec) ? [x.id] : [];
1900
+ }).forEach((x) => p.delete(x)), [...o.map((g) => g.column), ...a.map((g) => g.column)].filter((g) => g.type === "column").map((g) => p.delete(g.id));
1901
+ const m = l.filter((g) => !p.has(g.id)), f = we(m.map(he), u);
1902
+ if (!We([...m, ...f])) return;
1903
+ const v = Ae(m, f, s, o, a, r == null ? void 0 : r.coreColumnPredicate), b = t.createPTable(v);
1900
1904
  return {
1901
- tableSpec: v,
1902
- tableHandle: f
1905
+ fullTableHandle: h,
1906
+ visibleTableHandle: b
1903
1907
  };
1904
1908
  }
1905
- function Fn(t, e, n) {
1909
+ function Vn(t, e, n) {
1906
1910
  const r = t.resultPool.findLabels(e);
1907
1911
  return {
1908
1912
  axis: e,
@@ -1913,7 +1917,7 @@ function Fn(t, e, n) {
1913
1917
  defaultValue: n[0]
1914
1918
  };
1915
1919
  }
1916
- const Vt = (t, e) => {
1920
+ const Jt = (t, e) => {
1917
1921
  let n = t.toString();
1918
1922
  return e == null || e.forEach((r) => {
1919
1923
  if (r)
@@ -1921,7 +1925,7 @@ const Vt = (t, e) => {
1921
1925
  n += i, n += s;
1922
1926
  }), n;
1923
1927
  };
1924
- function $t(t) {
1928
+ function Mt(t) {
1925
1929
  if (!t.length)
1926
1930
  return [];
1927
1931
  let e = [[]];
@@ -1932,16 +1936,16 @@ function $t(t) {
1932
1936
  }), e = r;
1933
1937
  }), e;
1934
1938
  }
1935
- function Nt(t) {
1939
+ function Ut(t) {
1936
1940
  var e;
1937
- return t.axesSpec.length === 2 && ((e = t.annotations) == null ? void 0 : e[Mt]) === "true";
1941
+ return t.axesSpec.length === 2 && ((e = t.annotations) == null ? void 0 : e[Wt]) === "true";
1938
1942
  }
1939
- const Jt = "pl7.app/graph/isVirtual", Ie = "pl7.app/label", Mt = "pl7.app/isLinkerColumn";
1940
- function Ut(t) {
1943
+ const Bt = "pl7.app/graph/isVirtual", De = "pl7.app/label", Wt = "pl7.app/isLinkerColumn";
1944
+ function Gt(t) {
1941
1945
  var n, r;
1942
1946
  const e = /* @__PURE__ */ new Map();
1943
1947
  for (const { spec: i } of t) {
1944
- const s = i.axesSpec.map(D).map(K);
1948
+ const s = i.axesSpec.map(O).map(R);
1945
1949
  s.forEach((o) => {
1946
1950
  e.has(o) || e.set(o, /* @__PURE__ */ new Set());
1947
1951
  });
@@ -1953,11 +1957,11 @@ function Ut(t) {
1953
1957
  }
1954
1958
  return e;
1955
1959
  }
1956
- function Bt(t, e) {
1957
- const n = Ut(t), r = [...n.keys()].map(fe), i = [];
1960
+ function Ht(t, e) {
1961
+ const n = Gt(t), r = [...n.keys()].map(Ie), i = [];
1958
1962
  for (const l of e.values()) {
1959
- const u = r.find((c) => j(l, c));
1960
- u && i.push(K(u));
1963
+ const u = r.find((c) => V(l, c));
1964
+ u && i.push(R(u));
1961
1965
  }
1962
1966
  const s = new Set(i), o = /* @__PURE__ */ new Map();
1963
1967
  let a = [...i];
@@ -1965,38 +1969,38 @@ function Bt(t, e) {
1965
1969
  const l = [];
1966
1970
  for (const u of a)
1967
1971
  for (const c of n.get(u) ?? [])
1968
- s.has(c) || (l.push(c), s.add(c), o.set(c, fe(c)));
1972
+ s.has(c) || (l.push(c), s.add(c), o.set(c, Ie(c)));
1969
1973
  a = l;
1970
1974
  }
1971
1975
  return o;
1972
1976
  }
1973
- function Wt(t, e) {
1977
+ function qt(t, e) {
1974
1978
  const n = [];
1975
1979
  return e.forEach((r) => {
1976
- n.push(...Gt(t, r));
1980
+ n.push(...zt(t, r));
1977
1981
  }), n;
1978
1982
  }
1979
- function Gt(t, e) {
1980
- const n = e.spec.axesSpec.map(D);
1981
- if (n.every((u) => t.has(K(u))))
1983
+ function zt(t, e) {
1984
+ const n = e.spec.axesSpec.map(O);
1985
+ if (n.every((u) => t.has(R(u))))
1982
1986
  return [e];
1983
1987
  const r = n.map((u) => {
1984
1988
  const c = [];
1985
- for (const [d, g] of t)
1986
- j(g, u) && !j(u, g) && c.push(g);
1989
+ for (const [d, h] of t)
1990
+ V(h, u) && !V(u, h) && c.push(h);
1987
1991
  return c;
1988
- }), i = $t(r), s = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), a = i.map((u) => {
1992
+ }), i = Mt(r), s = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), a = i.map((u) => {
1989
1993
  const c = /* @__PURE__ */ new Set();
1990
- return u.map((d, g) => {
1991
- const p = e.spec.axesSpec[g].domain, v = d.domain;
1992
- return Object.entries(v ?? {}).forEach(([f, m]) => {
1994
+ return u.map((d, h) => {
1995
+ const p = e.spec.axesSpec[h].domain, m = d.domain;
1996
+ return Object.entries(m ?? {}).forEach(([f, v]) => {
1993
1997
  if ((p == null ? void 0 : p[f]) === void 0) {
1994
- const w = JSON.stringify([f, m]);
1995
- c.add(w), s.add(w);
1998
+ const b = JSON.stringify([f, v]);
1999
+ c.add(b), s.add(b);
1996
2000
  }
1997
2001
  }), {
1998
2002
  ...d,
1999
- annotations: e.spec.axesSpec[g].annotations
2003
+ annotations: e.spec.axesSpec[h].annotations
2000
2004
  };
2001
2005
  }), c;
2002
2006
  });
@@ -2005,74 +2009,74 @@ function Gt(t, e) {
2005
2009
  });
2006
2010
  const l = i.map((u, c) => {
2007
2011
  var f;
2008
- const d = Vt(e.id, u.map((m) => m.domain)), g = ((f = e.spec.annotations) == null ? void 0 : f[Ie]) ?? "", p = [...a[c]].filter((m) => o.has(m)).sort().map((m) => {
2009
- var w;
2010
- return (w = JSON.parse(m)) == null ? void 0 : w[1];
2011
- }).join(" / "), v = {
2012
+ const d = Jt(e.id, u.map((v) => v.domain)), h = ((f = e.spec.annotations) == null ? void 0 : f[De]) ?? "", p = [...a[c]].filter((v) => o.has(v)).sort().map((v) => {
2013
+ var b;
2014
+ return (b = JSON.parse(v)) == null ? void 0 : b[1];
2015
+ }).join(" / "), m = {
2012
2016
  ...e.spec.annotations,
2013
- [Jt]: "true"
2017
+ [Bt]: "true"
2014
2018
  };
2015
- return (g || p) && (v[Ie] = g && p ? g + " / " + p : g + p), {
2019
+ return (h || p) && (m[De] = h && p ? h + " / " + p : h + p), {
2016
2020
  id: d,
2017
2021
  spec: {
2018
2022
  ...e.spec,
2019
- axesSpec: u.map((m, w) => ({
2020
- ...m,
2021
- annotations: e.spec.axesSpec[w].annotations
2023
+ axesSpec: u.map((v, b) => ({
2024
+ ...v,
2025
+ annotations: e.spec.axesSpec[b].annotations
2022
2026
  })),
2023
- annotations: v
2027
+ annotations: m
2024
2028
  },
2025
2029
  data: e.data
2026
2030
  };
2027
2031
  });
2028
2032
  return [e, ...l];
2029
2033
  }
2030
- function Kn(t, e) {
2034
+ function jn(t, e) {
2031
2035
  if (!e) return;
2032
2036
  const n = new le();
2033
2037
  n.addColumnProvider(t.resultPool), n.addColumns(e);
2034
2038
  const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
2035
2039
  for (const d of e)
2036
- for (const g of d.spec.axesSpec) {
2037
- const p = D(g);
2038
- r.set(K(p), p), i.set(K(p), p);
2040
+ for (const h of d.spec.axesSpec) {
2041
+ const p = O(h);
2042
+ r.set(R(p), p), i.set(R(p), p);
2039
2043
  }
2040
- const s = n.getColumns((d) => Nt(d)) ?? [], o = Bt(s, r);
2044
+ const s = n.getColumns((d) => Ut(d)) ?? [], o = Ht(s, r);
2041
2045
  for (const d of o)
2042
2046
  r.set(...d), i.set(...d);
2043
- const a = (n.getColumns((d) => d.axesSpec.some((g) => {
2044
- const p = D(g);
2045
- for (const v of r.values())
2046
- if (j(v, p))
2047
+ const a = (n.getColumns((d) => d.axesSpec.some((h) => {
2048
+ const p = O(h);
2049
+ for (const m of r.values())
2050
+ if (V(m, p))
2047
2051
  return !0;
2048
2052
  return !1;
2049
- }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((d) => !ve(d.spec));
2053
+ }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((d) => !be(d.spec));
2050
2054
  for (const d of a)
2051
- for (const g of d.spec.axesSpec) {
2052
- const p = D(g);
2053
- i.set(K(p), p);
2055
+ for (const h of d.spec.axesSpec) {
2056
+ const p = O(h);
2057
+ i.set(R(p), p);
2054
2058
  }
2055
- const l = (n.getColumns((d) => d.axesSpec.some((g) => {
2056
- const p = D(g);
2057
- for (const v of i.values())
2058
- if (j(v, p))
2059
+ const l = (n.getColumns((d) => d.axesSpec.some((h) => {
2060
+ const p = O(h);
2061
+ for (const m of i.values())
2062
+ if (V(m, p))
2059
2063
  return !0;
2060
2064
  return !1;
2061
- }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((d) => ve(d.spec)), u = [...a, ...l], c = Wt(r, u);
2065
+ }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((d) => be(d.spec)), u = [...a, ...l], c = qt(r, u);
2062
2066
  if (!c.some(
2063
2067
  (d) => d.data instanceof E && !d.data.getIsReadyOrError()
2064
2068
  ))
2065
2069
  return t.createPFrame(c);
2066
2070
  }
2067
- function jn({
2071
+ function Nn({
2068
2072
  selection: t,
2069
- columnId: e = lt(),
2073
+ columnId: e = ct(),
2070
2074
  label: n = "Selection marker",
2071
2075
  domain: r
2072
2076
  }) {
2073
2077
  if (!(t != null && t.axesSpec.length))
2074
2078
  return;
2075
- const i = t.selectedKeys.filter((s) => s.every((o) => !at(o))).map((s) => ({ key: s, val: 1 }));
2079
+ const i = t.selectedKeys.filter((s) => s.every((o) => !ut(o))).map((s) => ({ key: s, val: 1 }));
2076
2080
  if (i.length)
2077
2081
  return {
2078
2082
  id: e,
@@ -2090,10 +2094,10 @@ function jn({
2090
2094
  data: i
2091
2095
  };
2092
2096
  }
2093
- function Vn(t) {
2094
- return t === ut ? (console.error("Axis value can never be N/A"), "") : t;
2097
+ function $n(t) {
2098
+ return t === dt ? (console.error("Axis value can never be N/A"), "") : t;
2095
2099
  }
2096
- class $n {
2100
+ class Jn {
2097
2101
  constructor(e) {
2098
2102
  this.handle = e;
2099
2103
  }
@@ -2113,52 +2117,52 @@ class $n {
2113
2117
  return await platforma.pFrameDriver.getUniqueValues(this.handle, e);
2114
2118
  }
2115
2119
  }
2116
- function Ht(t) {
2117
- return Oe({
2120
+ function Yt(t) {
2121
+ return Fe({
2118
2122
  __isRef: !0,
2119
2123
  blockId: ie(t, "blockId"),
2120
2124
  name: ie(t, "name")
2121
2125
  });
2122
2126
  }
2123
- function Nn(t) {
2124
- return Oe({
2125
- ref: Ht(ie(t, "ref")),
2127
+ function Mn(t) {
2128
+ return Fe({
2129
+ ref: Yt(ie(t, "ref")),
2126
2130
  label: ie(t, "label")
2127
2131
  });
2128
2132
  }
2129
- const Jn = {
2133
+ const Un = {
2130
2134
  sdkVersion: Y
2131
2135
  };
2132
- function qt() {
2133
- return De({ sdkVersion: Y });
2136
+ function Xt() {
2137
+ return Ke({ sdkVersion: Y });
2134
2138
  }
2135
- function Mn(t) {
2139
+ function Bn(t) {
2136
2140
  try {
2137
- return qt();
2141
+ return Xt();
2138
2142
  } catch {
2139
2143
  return t;
2140
2144
  }
2141
2145
  }
2142
- function Un(t) {
2146
+ function Wn(t) {
2143
2147
  if (typeof globalThis.getEnvironmentValue == "function")
2144
2148
  return globalThis.getEnvironmentValue(t);
2145
2149
  }
2146
2150
  export {
2147
- tn as Args,
2148
- T as BlockModel,
2149
- Jn as CurrentSdkInfo,
2150
- _ as FutureRef,
2151
- Jt as IS_VIRTUAL_COLUMN,
2152
- nn as It,
2153
- Tn as JsRenderInternal,
2154
- Ie as LABEL_ANNOTATION,
2155
- Mt as LINKER_COLUMN_ANNOTATION,
2156
- rn as MainOutputs,
2157
- ct as OutputError,
2158
- yt as PAnnotationLabel,
2159
- vt as PAnnotationTrace,
2151
+ sn as Args,
2152
+ L as BlockModel,
2153
+ Un as CurrentSdkInfo,
2154
+ I as FutureRef,
2155
+ Bt as IS_VIRTUAL_COLUMN,
2156
+ on as It,
2157
+ kn as JsRenderInternal,
2158
+ De as LABEL_ANNOTATION,
2159
+ Wt as LINKER_COLUMN_ANNOTATION,
2160
+ an as MainOutputs,
2161
+ pt as OutputError,
2162
+ bt as PAnnotationLabel,
2163
+ wt as PAnnotationTrace,
2160
2164
  le as PColumnCollection,
2161
- $n as PFrameImpl,
2165
+ Jn as PFrameImpl,
2162
2166
  B as RT_BINARY_PARTITIONED,
2163
2167
  z as RT_BINARY_SUPER_PARTITIONED,
2164
2168
  q as RT_JSON_PARTITIONED,
@@ -2166,73 +2170,75 @@ export {
2166
2170
  se as RT_RESOURCE_MAP,
2167
2171
  oe as RT_RESOURCE_MAP_PARTITIONED,
2168
2172
  te as RenderCtx,
2169
- Rt as ResultPool,
2170
- sn as StagingOutputs,
2171
- wt as Trace,
2172
- bt as TraceEntry,
2173
+ Kt as ResultPool,
2174
+ ln as StagingOutputs,
2175
+ xt as Trace,
2176
+ At as TraceEntry,
2173
2177
  E as TreeNodeAccessor,
2174
- on as UiState,
2175
- Me as allColumnsComputed,
2176
- fn as and,
2177
- _t as convertOrParsePColumnData,
2178
- Kn as createPFrameForGraphs,
2179
- Dn as createPlDataTable,
2180
- Fn as createPlDataTableSheet,
2181
- Rn as createPlDataTableV2,
2182
- jn as createRowSelectionColumn,
2183
- je as deriveLabels,
2184
- pe as downgradeCfgOrLambda,
2185
- Wt as enrichCompatible,
2186
- Cn as extractArchiveAndGetURL,
2187
- kn as extractConfig,
2188
- It as filterDataInfoEntries,
2189
- cn as flatten,
2190
- Nn as fromPlOption,
2191
- Ht as fromPlRef,
2192
- Ne as getAllLabelColumns,
2193
- Bt as getAvailableWithLinkersAxes,
2194
- vn as getBlobContent,
2195
- wn as getBlobContentAsJson,
2196
- bn as getBlobContentAsString,
2197
- An as getDownloadedBlobContent,
2198
- Un as getEnvironmentValue,
2178
+ un as UiState,
2179
+ We as allColumnsComputed,
2180
+ mn as and,
2181
+ Tt as convertOrParsePColumnData,
2182
+ jn as createPFrameForGraphs,
2183
+ Fn as createPlDataTable,
2184
+ Vn as createPlDataTableSheet,
2185
+ Ue as createPlDataTableStateV2,
2186
+ Kn as createPlDataTableV2,
2187
+ Nn as createRowSelectionColumn,
2188
+ $e as deriveLabels,
2189
+ fe as downgradeCfgOrLambda,
2190
+ qt as enrichCompatible,
2191
+ _n as extractArchiveAndGetURL,
2192
+ Rn as extractConfig,
2193
+ Lt as filterDataInfoEntries,
2194
+ fn as flatten,
2195
+ Mn as fromPlOption,
2196
+ Yt as fromPlRef,
2197
+ Be as getAllLabelColumns,
2198
+ Ht as getAvailableWithLinkersAxes,
2199
+ An as getBlobContent,
2200
+ Cn as getBlobContentAsJson,
2201
+ xn as getBlobContentAsString,
2202
+ Pn as getDownloadedBlobContent,
2203
+ Wn as getEnvironmentValue,
2199
2204
  Q as getFromCfg,
2200
2205
  re as getImmediate,
2201
- Pn as getImportProgress,
2206
+ In as getImportProgress,
2202
2207
  ie as getJsonField,
2203
- Sn as getLastLogs,
2204
- Ut as getLinkerColumnsMap,
2205
- Ln as getLogHandle,
2206
- Je as getMatchingLabelColumns,
2207
- xn as getOnDemandBlobContent,
2208
- Ct as getPartitionKeysList,
2209
- Mn as getPlatformaOrDefault,
2210
- _n as getProgressLog,
2211
- In as getProgressLogWithInfo,
2212
- qt as getRawPlatformaInstance,
2213
- gn as getResourceField,
2214
- mn as getResourceValueAsJson,
2215
- St as getUniquePartitionKeys,
2216
- he as ifDef,
2217
- Kt as isColumnHidden,
2218
- jt as isColumnOptional,
2219
- Ft as isConfigLambda,
2220
- dn as isEmpty,
2221
- ve as isLabelColumn,
2222
- Nt as isLinkerColumn,
2223
- en as isolate,
2224
- an as makeArray,
2225
- Oe as makeObject,
2226
- un as mapArrayValues,
2227
- Vn as mapPTableValueToAxisKey,
2228
- ln as mapRecordValues,
2229
- yn as mapResourceFields,
2230
- pn as not,
2231
- hn as or,
2232
- ye as parsePColumnData,
2233
- En as parseResourceMap,
2234
- dt as readOutput,
2235
- On as stringifyPTableColumnSpec,
2236
- Zt as wrapOutputs
2208
+ Tn as getLastLogs,
2209
+ Gt as getLinkerColumnsMap,
2210
+ Dn as getLogHandle,
2211
+ we as getMatchingLabelColumns,
2212
+ Sn as getOnDemandBlobContent,
2213
+ St as getPartitionKeysList,
2214
+ Bn as getPlatformaOrDefault,
2215
+ Ln as getProgressLog,
2216
+ En as getProgressLogWithInfo,
2217
+ Xt as getRawPlatformaInstance,
2218
+ vn as getResourceField,
2219
+ bn as getResourceValueAsJson,
2220
+ It as getUniquePartitionKeys,
2221
+ ge as ifDef,
2222
+ Nt as isColumnHidden,
2223
+ $t as isColumnOptional,
2224
+ Vt as isConfigLambda,
2225
+ hn as isEmpty,
2226
+ be as isLabelColumn,
2227
+ Ut as isLinkerColumn,
2228
+ rn as isolate,
2229
+ cn as makeArray,
2230
+ Fe as makeObject,
2231
+ pn as mapArrayValues,
2232
+ $n as mapPTableValueToAxisKey,
2233
+ dn as mapRecordValues,
2234
+ wn as mapResourceFields,
2235
+ gn as not,
2236
+ yn as or,
2237
+ ve as parsePColumnData,
2238
+ On as parseResourceMap,
2239
+ ft as readOutput,
2240
+ ue as uniqueBy,
2241
+ jt as upgradePlDataTableStateV2,
2242
+ nn as wrapOutputs
2237
2243
  };
2238
2244
  //# sourceMappingURL=index.mjs.map