@platforma-sdk/model 1.31.16 → 1.32.1

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 ze = Object.defineProperty;
2
- var Ye = (t, e, n) => e in t ? ze(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var F = (t, e, n) => Ye(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { isPColumn as ye, mapPObjectData as ve, isDataInfoEntries as Le, isDataInfo as be, dataInfoToEntries as Xe, selectorsToPredicate as X, resolveAnchors as we, deriveNativeId as Qe, isPColumnSpec as ne, isPartitionedDataInfoEntries as Ze, getAxisId as R, entriesToDataInfo as et, canonicalizeAxisId as tt, withEnrichments as Ae, AnchoredIdDeriver as xe, isPlRef as nt, mapValueInVOE as rt, ensurePColumn as it, extractAllColumns as st, mapPTableDef as ot, mapDataInfo as at, canonicalizeJson as M, getPColumnSpecId as Pe, matchAxisId as K, getColumnIdAndSpec as Ee, parseJson as lt, isPTableAbsent as ut, PTableNA as ct } from "@milaboratories/pl-model-common";
1
+ var Xe = Object.defineProperty;
2
+ var Qe = (t, e, n) => e in t ? Xe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var R = (t, e, n) => Qe(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { isPColumn as be, mapPObjectData as we, isDataInfoEntries as Ee, isDataInfo as Ae, dataInfoToEntries as Ze, selectorsToPredicate as X, resolveAnchors as xe, deriveNativeId as et, isPColumnSpec as ne, isPartitionedDataInfoEntries as tt, getAxisId as T, entriesToDataInfo as nt, canonicalizeAxisId as rt, withEnrichments as Ce, AnchoredIdDeriver as Pe, isPlRef as it, mapValueInVOE as st, ensurePColumn as ot, extractAllColumns as at, mapPTableDef as lt, mapDataInfo as ut, canonicalizeJson as F, parseJson as fe, matchAxisId as K, getPColumnSpecId as ue, getColumnIdAndSpec as Oe, isPTableAbsent as ct, PTableNA as pt } from "@milaboratories/pl-model-common";
5
5
  export * from "@milaboratories/pl-model-common";
6
- import De from "canonicalize";
6
+ import ke from "canonicalize";
7
7
  import { z as U } 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 dt(t) {
15
- if (!t.ok) throw new pt(t.errors, t.moreErrors);
14
+ function ft(t) {
15
+ if (!t.ok) throw new dt(t.errors, t.moreErrors);
16
16
  return t.value;
17
17
  }
18
- function Xt(t) {
18
+ function tn(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 Qt(t) {
31
+ function nn(t) {
32
32
  return {
33
33
  type: "Isolate",
34
34
  cfg: t
35
35
  };
36
36
  }
37
- const Zt = Q("$args"), en = Q("$it"), tn = Q("$prod"), nn = Q("$staging"), rn = Q("$ui");
37
+ const rn = Q("$args"), sn = Q("$it"), on = Q("$prod"), an = Q("$staging"), ln = Q("$ui");
38
38
  function re(t) {
39
39
  return { type: "Immediate", value: t };
40
40
  }
41
- function Fe(t) {
41
+ function Re(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 sn(...t) {
49
+ function un(...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 sn(...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 on(t, e, n = "$it") {
64
+ function cn(t, e, n = "$it") {
65
65
  return {
66
66
  type: "MapRecordValues",
67
67
  source: t,
@@ -69,7 +69,7 @@ function on(t, e, n = "$it") {
69
69
  itVar: n
70
70
  };
71
71
  }
72
- function an(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 an(t, e, n = "$it") {
77
77
  itVar: n
78
78
  };
79
79
  }
80
- function ln(t) {
80
+ function dn(t) {
81
81
  return {
82
82
  type: "Flatten",
83
83
  source: t
84
84
  };
85
85
  }
86
- function un(t) {
86
+ function fn(t) {
87
87
  return {
88
88
  type: "IsEmpty",
89
89
  arg: t
90
90
  };
91
91
  }
92
- function cn(t) {
92
+ function hn(t) {
93
93
  return {
94
94
  type: "Not",
95
95
  operand: t
96
96
  };
97
97
  }
98
- function pn(t, e) {
98
+ function gn(t, e) {
99
99
  return {
100
100
  type: "And",
101
101
  operand1: t,
102
102
  operand2: e
103
103
  };
104
104
  }
105
- function dn(t, e) {
105
+ function mn(t, e) {
106
106
  return {
107
107
  type: "Or",
108
108
  operand1: t,
109
109
  operand2: e
110
110
  };
111
111
  }
112
- function fn(t, e) {
112
+ function yn(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 hn() {
119
+ function vn() {
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 gn(t, e, n = "$it") {
127
+ function bn(t, e, n = "$it") {
128
128
  return {
129
129
  type: "MapResourceFields",
130
130
  source: t,
@@ -132,115 +132,115 @@ function gn(t, e, n = "$it") {
132
132
  itVar: n
133
133
  };
134
134
  }
135
- function mn(t, e) {
135
+ function wn(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 yn(t, e) {
142
+ function An(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 vn() {
149
+ function xn() {
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 bn(t) {
158
+ function Cn(t) {
159
159
  return {
160
160
  type: "GetDownloadedBlobContent",
161
- source: C(t)
161
+ source: P(t)
162
162
  };
163
163
  }
164
- function wn(t) {
164
+ function Pn(t) {
165
165
  return {
166
166
  type: "GetOnDemandBlobContent",
167
- source: C(t)
167
+ source: P(t)
168
168
  };
169
169
  }
170
- function An(t, e) {
170
+ function Sn(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 xn(t) {
177
+ function _n(t) {
178
178
  return {
179
179
  type: "GetImportProgress",
180
- source: C(t)
180
+ source: P(t)
181
181
  };
182
182
  }
183
- function Pn(t, e) {
183
+ function In(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 Cn(t, e) {
190
+ function Tn(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 Sn(t, e) {
197
+ function Ln(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 _n(t) {
204
+ function En(t) {
205
205
  return {
206
206
  type: "GetLogHandle",
207
- source: C(t)
207
+ source: P(t)
208
208
  };
209
209
  }
210
- function ft() {
210
+ function ht() {
211
211
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
212
212
  }
213
- function Re(t) {
213
+ function De(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 ht() {
219
+ function gt() {
220
220
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
221
221
  }
222
- function f() {
222
+ function h() {
223
223
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
224
224
  throw new Error("Not in config rendering context");
225
225
  }
226
226
  function H(t, e) {
227
- const n = ht();
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 ue = /* @__PURE__ */ new Map();
233
- function gt(t, e) {
234
- t in f().callbackRegistry || (f().callbackRegistry[t] = (n) => {
235
- for (const r of ue.get(t))
232
+ const ce = /* @__PURE__ */ new Map();
233
+ function mt(t, e) {
234
+ t in h().callbackRegistry || (h().callbackRegistry[t] = (n) => {
235
+ for (const r of ce.get(t))
236
236
  r(n);
237
- }, ue.set(t, [])), ue.get(t).push(e);
237
+ }, ce.set(t, [])), ce.get(t).push(e);
238
238
  }
239
239
  class I {
240
240
  constructor(e, n = (r) => r) {
241
- F(this, "isResolved", !1);
242
- F(this, "resolvedValue");
243
- this.handle = e, this.postProcess = n, gt(e, (r) => {
241
+ R(this, "isResolved", !1);
242
+ R(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
  }
@@ -257,10 +257,10 @@ class I {
257
257
  return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
258
258
  }
259
259
  }
260
- function de(t, e) {
260
+ function he(t, e) {
261
261
  return t === void 0 ? void 0 : e(t);
262
262
  }
263
- class E {
263
+ class O {
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 de(
303
- f().resolveWithCommon(this.handle, e, ...n),
304
- (i) => new E(i, r)
302
+ return he(
303
+ h().resolveWithCommon(this.handle, e, ...n),
304
+ (i) => new O(i, r)
305
305
  );
306
306
  }
307
307
  get resourceType() {
308
- return f().getResourceType(this.handle);
308
+ return h().getResourceType(this.handle);
309
309
  }
310
310
  getInputsLocked() {
311
- return f().getInputsLocked(this.handle);
311
+ return h().getInputsLocked(this.handle);
312
312
  }
313
313
  getOutputsLocked() {
314
- return f().getOutputsLocked(this.handle);
314
+ return h().getOutputsLocked(this.handle);
315
315
  }
316
316
  getIsReadyOrError() {
317
- return f().getIsReadyOrError(this.handle);
317
+ return h().getIsReadyOrError(this.handle);
318
318
  }
319
319
  getIsFinal() {
320
- return f().getIsFinal(this.handle);
320
+ return h().getIsFinal(this.handle);
321
321
  }
322
322
  getError() {
323
323
  const e = [...this.resolvePath, "error"];
324
- return de(
325
- f().getError(this.handle),
326
- (n) => new E(n, e)
324
+ return he(
325
+ h().getError(this.handle),
326
+ (n) => new O(n, e)
327
327
  );
328
328
  }
329
329
  listInputFields() {
330
- return f().listInputFields(this.handle);
330
+ return h().listInputFields(this.handle);
331
331
  }
332
332
  listOutputFields() {
333
- return f().listOutputFields(this.handle);
333
+ return h().listOutputFields(this.handle);
334
334
  }
335
335
  listDynamicFields() {
336
- return f().listDynamicFields(this.handle);
336
+ return h().listDynamicFields(this.handle);
337
337
  }
338
338
  getKeyValueBase64(e) {
339
- return f().getKeyValueBase64(this.handle, e);
339
+ return h().getKeyValueBase64(this.handle, e);
340
340
  }
341
341
  getKeyValueAsString(e) {
342
- return f().getKeyValueAsString(this.handle, e);
342
+ return h().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 f().getDataBase64(this.handle);
350
+ return h().getDataBase64(this.handle);
351
351
  }
352
352
  getDataAsString() {
353
- return f().getDataAsString(this.handle);
353
+ return h().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 (!ye(s)) throw new Error(`not a PColumn (kind = ${s.spec.kind})`);
366
+ if (!be(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 = f().parsePObjectCollection(
374
+ const r = h().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] = ve(o, (l) => new E(l, a));
384
+ i[s] = we(o, (l) => new O(l, a));
385
385
  }
386
386
  return i;
387
387
  }
388
388
  getFileContentAsBase64(e) {
389
- return new I(f().getBlobContentAsBase64(this.handle, e));
389
+ return new I(h().getBlobContentAsBase64(this.handle, e));
390
390
  }
391
391
  getFileContentAsString(e) {
392
- return new I(f().getBlobContentAsString(this.handle, e));
392
+ return new I(h().getBlobContentAsString(this.handle, e));
393
393
  }
394
394
  getFileContentAsJson(e) {
395
395
  return new I(
396
- f().getBlobContentAsString(this.handle, e)
396
+ h().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(f().getDownloadedBlobContentHandle(this.handle));
415
+ return new I(h().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(f().getOnDemandBlobContentHandle(this.handle));
427
+ return new I(h().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(f().extractArchiveAndGetURL(this.handle, e));
439
+ return new I(h().extractArchiveAndGetURL(this.handle, e));
440
440
  }
441
441
  getImportProgress() {
442
- return new I(f().getImportProgress(this.handle));
442
+ return new I(h().getImportProgress(this.handle));
443
443
  }
444
444
  getLastLogs(e) {
445
- return new I(f().getLastLogs(this.handle, e));
445
+ return new I(h().getLastLogs(this.handle, e));
446
446
  }
447
447
  getProgressLog(e) {
448
- return new I(f().getProgressLog(this.handle, e));
448
+ return new I(h().getProgressLog(this.handle, e));
449
449
  }
450
450
  getProgressLogWithInfo(e) {
451
- return new I(f().getProgressLogWithInfo(this.handle, e));
451
+ return new I(h().getProgressLogWithInfo(this.handle, e));
452
452
  }
453
453
  getLogHandle() {
454
- return new I(f().getLogHandle(this.handle));
454
+ return new I(h().getLogHandle(this.handle));
455
455
  }
456
456
  allFieldsResolved(e = "Input") {
457
457
  switch (e) {
@@ -480,7 +480,7 @@ class E {
480
480
  return s && (l = l.filter((u) => u[1] !== void 0)), l.map(([u, d]) => o(u, d));
481
481
  }
482
482
  }
483
- const Oe = "staging", ke = "main", mt = {
483
+ const Fe = "staging", Ke = "main", yt = {
484
484
  explicitColumnsSupport: !0,
485
485
  inlineColumnsSupport: !0,
486
486
  activeArgs: !0
@@ -488,108 +488,108 @@ const Oe = "staging", ke = "main", mt = {
488
488
  function je(t) {
489
489
  return typeof t == "object" && t !== null && "__awaited_futures__" in t;
490
490
  }
491
- function fe(t, e, n) {
491
+ function ge(t, e, n) {
492
492
  if (e.has(n)) return;
493
493
  if (e.add(n), typeof n === "object")
494
494
  if (je(n)) n.__awaited_futures__.forEach((i) => t.add(i));
495
495
  else if (Array.isArray(n))
496
- for (const i of n) fe(t, e, i);
496
+ for (const i of n) ge(t, e, i);
497
497
  else
498
498
  for (const [, i] of Object.entries(n))
499
- i !== n && fe(t, e, i);
499
+ i !== n && ge(t, e, i);
500
500
  }
501
- function yt(t) {
501
+ function vt(t) {
502
502
  const e = /* @__PURE__ */ new Set();
503
- return fe(e, /* @__PURE__ */ new Set(), t), e;
503
+ return ge(e, /* @__PURE__ */ new Set(), t), e;
504
504
  }
505
- const In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
505
+ const On = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
506
506
  __proto__: null,
507
- GlobalCfgRenderCtxFeatureFlags: mt,
508
- MainAccessorName: ke,
509
- StagingAccessorName: Oe,
510
- getAllFutureAwaits: yt,
507
+ GlobalCfgRenderCtxFeatureFlags: yt,
508
+ MainAccessorName: Ke,
509
+ StagingAccessorName: Fe,
510
+ getAllFutureAwaits: vt,
511
511
  isFutureAwait: je
512
- }, Symbol.toStringTag, { value: "Module" })), vt = "pl7.app/label", bt = "pl7.app/trace", wt = U.object({
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
- }), At = U.array(wt), xt = 1e-3, Pt = "__LABEL__", Ce = "__LABEL__@1";
517
+ }), xt = U.array(At), Ct = 1e-3, Pt = "__LABEL__", Se = "__LABEL__@1";
518
518
  function Ve(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((g) => {
520
- var S, O;
521
- const m = e(g);
522
- let c, v, b;
523
- "spec" in m && typeof m.spec == "object" ? (c = m.spec, v = m.prefixTrace, b = m.suffixTrace) : c = m;
524
- const p = (S = c.annotations) == null ? void 0 : S[vt], A = (O = c.annotations) == null ? void 0 : O[bt], x = (A ? At.safeParse(JSON.parse(A)).data : void 0) ?? [], y = [
525
- ...v ?? [],
526
- ...x,
527
- ...b ?? []
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((f) => {
520
+ var S, D;
521
+ const w = e(f);
522
+ let c, g, x;
523
+ "spec" in w && typeof w.spec == "object" ? (c = w.spec, g = w.prefixTrace, x = w.suffixTrace) : c = w;
524
+ const p = (S = c.annotations) == null ? void 0 : S[bt], A = (D = c.annotations) == null ? void 0 : D[wt], m = (A ? xt.safeParse(JSON.parse(A)).data : void 0) ?? [], v = [
525
+ ...g ?? [],
526
+ ...m,
527
+ ...x ?? []
528
528
  ];
529
529
  if (p !== void 0) {
530
- const D = { label: p, type: Pt, importance: -2 };
531
- n.addLabelAsSuffix ? y.push(D) : y.splice(0, 0, D);
530
+ const k = { label: p, type: Pt, importance: -2 };
531
+ n.addLabelAsSuffix ? v.push(k) : v.splice(0, 0, k);
532
532
  }
533
- const P = [], T = /* @__PURE__ */ new Map();
534
- for (let D = y.length - 1; D >= 0; --D) {
535
- const { type: W } = y[D], j = y[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,
533
+ const C = [], L = /* @__PURE__ */ new Map();
534
+ for (let k = v.length - 1; k >= 0; --k) {
535
+ const { type: W } = v[k], V = v[k].importance ?? 0, N = (L.get(W) ?? 0) + 1;
536
+ L.set(W, N);
537
+ const j = `${W}@${N}`;
538
+ s.set(j, (s.get(j) ?? 0) + 1), r.set(
539
+ j,
540
540
  Math.max(
541
- r.get(k) ?? Number.NEGATIVE_INFINITY,
542
- j - (y.length - D) * xt
541
+ r.get(j) ?? Number.NEGATIVE_INFINITY,
542
+ V - (v.length - k) * Ct
543
543
  )
544
- ), P.push({ ...y[D], fullType: k, occurrenceIndex: $ });
544
+ ), C.push({ ...v[k], fullType: j, occurrenceIndex: N });
545
545
  }
546
- return P.reverse(), {
547
- value: g,
546
+ return C.reverse(), {
547
+ value: f,
548
548
  spec: c,
549
549
  label: p,
550
- fullTrace: P
550
+ fullTrace: C
551
551
  };
552
552
  }), a = [], l = [], u = [...r];
553
- u.sort(([, g], [, m]) => m - g);
554
- for (const [g] of u)
555
- g.endsWith("@1") || s.get(g) === t.length ? a.push(g) : l.push(g);
556
- const d = (g, m = !1) => {
553
+ u.sort(([, f], [, w]) => w - f);
554
+ for (const [f] of u)
555
+ f.endsWith("@1") || s.get(f) === t.length ? a.push(f) : l.push(f);
556
+ const d = (f, w = !1) => {
557
557
  const c = [];
558
- for (let v = 0; v < o.length; v++) {
559
- const b = o[v], p = b.fullTrace.filter((y) => g.has(y.fullType) || i && i.has(y.type));
558
+ for (let g = 0; g < o.length; g++) {
559
+ const x = o[g], p = x.fullTrace.filter((v) => f.has(v.fullType) || i && i.has(v.type));
560
560
  if (p.length === 0)
561
- if (m)
561
+ if (w)
562
562
  c.push({
563
563
  label: "Unlabeled",
564
- value: b.value
564
+ value: x.value
565
565
  });
566
566
  else return;
567
- const A = p.map((y) => y.label), x = n.separator ?? " / ";
567
+ const A = p.map((v) => v.label), m = n.separator ?? " / ";
568
568
  c.push({
569
- label: A.join(x),
570
- value: b.value
569
+ label: A.join(m),
570
+ value: x.value
571
571
  });
572
572
  }
573
573
  return c;
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 d(new Set(Ce), !0);
578
- }
579
- let h = 0, w = -1;
580
- for (; h < a.length; ) {
581
- const g = /* @__PURE__ */ new Set();
582
- n.includeNativeLabel && g.add(Ce);
583
- for (let c = 0; c < h; ++c) g.add(a[c]);
584
- w >= 0 && g.add(a[w]);
585
- const m = d(g);
586
- if (m !== void 0 && new Set(m.map((c) => c.label)).size === t.length) return m;
587
- w++, w >= a.length && (h++, w = h);
577
+ return d(new Set(Se), !0);
578
+ }
579
+ let y = 0, b = -1;
580
+ for (; y < a.length; ) {
581
+ const f = /* @__PURE__ */ new Set();
582
+ n.includeNativeLabel && f.add(Se);
583
+ for (let c = 0; c < y; ++c) f.add(a[c]);
584
+ b >= 0 && f.add(a[b]);
585
+ const w = d(f);
586
+ if (w !== void 0 && new Set(w.map((c) => c.label)).size === t.length) return w;
587
+ b++, b >= a.length && (y++, b = y);
588
588
  }
589
589
  return d(/* @__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", Ke = Z + "Partitioned/", ae = Ke + "JsonPartitioned", z = Ke + "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", $e = Z + "Partitioned/", ae = $e + "JsonPartitioned", z = $e + "BinaryPartitioned";
592
+ function Ne(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 = Ne(
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 Tn(t, e, n = !1) {
625
+ function kn(t, e, n = !1) {
626
626
  const r = [];
627
- return { isComplete: $e(t, e, r, [], n), data: r };
627
+ return { isComplete: Ne(t, e, r, [], n), data: r };
628
628
  }
629
- const he = (t) => {
629
+ const me = (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 = he(s).baseKey);
661
+ e === B && (s = me(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 = he(l).baseKey);
673
+ e === z && (l = me(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 St(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 St(t) {
698
698
  }
699
699
  return r.map((i) => Array.from(i.values()));
700
700
  }
701
- function _t(t) {
701
+ function It(t) {
702
702
  if (t === void 0) return;
703
- if (Le(t))
704
- return St(t);
705
- const e = Ct(t);
703
+ if (Ee(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 _t(t) {
715
715
  }
716
716
  return i.map((s) => Array.from(s.values()));
717
717
  }
718
- function ge(t, e = []) {
718
+ function ye(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 ge(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 = he(o), l = t.resolve({ field: o, assertFieldType: "Input" });
748
+ const a = me(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 ge(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 = ge(a, JSON.parse(o));
779
+ const l = ye(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 ge(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 = ge(a, JSON.parse(o));
800
+ const l = ye(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 ge(t, e = []) {
813
813
  throw new Error(`Unknown resource type: ${n}`);
814
814
  }
815
815
  }
816
- function It(t) {
816
+ function Tt(t) {
817
817
  if (t !== void 0) {
818
- if (Le(t)) return t;
819
- if (be(t)) return Xe(t);
820
- if (t instanceof E) return ge(t);
818
+ if (Ee(t)) return t;
819
+ if (Ae(t)) return Ze(t);
820
+ if (t instanceof O) return ye(t);
821
821
  throw new Error(`Unexpected input type: ${typeof t}`);
822
822
  }
823
823
  }
824
- function Tt(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,7 +881,7 @@ function Tt(t, e) {
881
881
  }
882
882
  }
883
883
  }
884
- class Lt {
884
+ class Et {
885
885
  constructor(e) {
886
886
  this.columns = e;
887
887
  }
@@ -890,30 +890,30 @@ class Lt {
890
890
  return this.columns.filter((r) => n(r.spec));
891
891
  }
892
892
  }
893
- function Et(t) {
893
+ function Ot(t) {
894
894
  if (t)
895
895
  return t.map((e) => ({
896
- type: `split:${tt(e.axisId)}`,
896
+ type: `split:${rt(e.axisId)}`,
897
897
  label: e.label,
898
898
  importance: 1e6
899
899
  // High importance for split filters in labels
900
900
  }));
901
901
  }
902
- function Dt(t) {
902
+ function kt(t) {
903
903
  if (t)
904
904
  return t.map((e) => [e.axisIdx, e.value]);
905
905
  }
906
- function Ft(t, e) {
906
+ function Rt(t, e) {
907
907
  if (!e || e.length === 0) return t;
908
908
  const n = [...e].sort((r, i) => r[0] - i[0]);
909
- return De({ id: t, axisFilters: n });
909
+ return ke({ id: t, axisFilters: n });
910
910
  }
911
- function Se(t) {
911
+ function _e(t) {
912
912
  if (!t || typeof t != "object") return !1;
913
913
  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);
914
914
  return !!e.domainAnchor || n || r;
915
915
  }
916
- function Rt(t) {
916
+ function Dt(t) {
917
917
  if (typeof t != "object" || !("axes" in t) || t.axes === void 0)
918
918
  return [];
919
919
  const e = t.axes.map((n, r) => typeof n == "object" && "split" in n && n.split === !0 ? r : -1).filter((n) => n !== -1);
@@ -921,11 +921,11 @@ function Rt(t) {
921
921
  throw new Error("Axis splitting is not supported when `partialAxesMatch` is defined.");
922
922
  return e.sort((n, r) => n - r), e;
923
923
  }
924
- class me {
924
+ class ve {
925
925
  constructor() {
926
- F(this, "defaultProviderStore", []);
927
- F(this, "providers", [new Lt(this.defaultProviderStore)]);
928
- F(this, "axisLabelProviders", []);
926
+ R(this, "defaultProviderStore", []);
927
+ R(this, "providers", [new Et(this.defaultProviderStore)]);
928
+ R(this, "axisLabelProviders", []);
929
929
  }
930
930
  addColumnProvider(e) {
931
931
  return this.providers.push(e), this;
@@ -953,127 +953,127 @@ class me {
953
953
  };
954
954
  let u = () => !1;
955
955
  if (a) {
956
- const c = (Array.isArray(a) ? a : [a]).map((v) => {
957
- if (Se(v)) {
956
+ const c = (Array.isArray(a) ? a : [a]).map((g) => {
957
+ if (_e(g)) {
958
958
  if (!r)
959
959
  throw new Error("Anchored selectors in exclude require an AnchoredIdDeriver to be provided in options.");
960
- return X(we(r.anchors, v, n));
960
+ return X(xe(r.anchors, g, n));
961
961
  } else
962
- return X(v);
962
+ return X(g);
963
963
  });
964
- u = (v) => c.some((b) => b(v));
964
+ u = (g) => c.some((x) => x(g));
965
965
  }
966
- const d = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], h = [], w = /* @__PURE__ */ new Set();
966
+ const d = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], y = [], b = /* @__PURE__ */ new Set();
967
967
  for (const c of d) {
968
- const v = Se(c);
969
- let b;
970
- if (v) {
968
+ const g = _e(c);
969
+ let x;
970
+ if (g) {
971
971
  if (!r)
972
972
  throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");
973
- b = we(r.anchors, c, n);
973
+ x = xe(r.anchors, c, n);
974
974
  } else
975
- b = c;
975
+ x = c;
976
976
  const p = /* @__PURE__ */ new Set(), A = [];
977
- for (const P of this.providers) {
978
- const T = P.selectColumns(b);
979
- for (const S of T) {
977
+ for (const C of this.providers) {
978
+ const L = C.selectColumns(x);
979
+ for (const S of L) {
980
980
  if (u(S.spec)) continue;
981
981
  if (p.has(S.id))
982
- throw new Error(`Duplicate column id ${S.id} in provider ${P.constructor.name}`);
983
- const O = Qe(S.spec);
984
- w.has(O) || (p.add(S.id), w.add(O), A.push(S));
982
+ throw new Error(`Duplicate column id ${S.id} in provider ${C.constructor.name}`);
983
+ const D = et(S.spec);
984
+ b.has(D) || (p.add(S.id), b.add(D), A.push(S));
985
985
  }
986
986
  }
987
987
  if (A.length === 0) continue;
988
- const x = Rt(c), y = x.length > 0;
989
- for (const P of A) {
990
- if (!ne(P.spec)) continue;
991
- const T = P.spec;
992
- if (y) {
993
- const S = It(P.data);
988
+ const m = Dt(c), v = m.length > 0;
989
+ for (const C of A) {
990
+ if (!ne(C.spec)) continue;
991
+ const L = C.spec;
992
+ if (v) {
993
+ const S = Tt(C.data);
994
994
  if (!S) {
995
995
  if (s) continue;
996
996
  return;
997
997
  }
998
- if (!Ze(S))
999
- throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${S.type} for column ${P.id}`);
1000
- const O = _t(S), D = x[x.length - 1];
1001
- if (D >= S.partitionKeyLength)
1002
- throw new Error(`Not enough partition keys (${S.partitionKeyLength}) for requested split axes (max index ${D}) in column ${T.name}`);
1003
- const W = x.map((_) => this.findLabels(R(T.axesSpec[_]))), j = [], $ = (_, G) => {
1004
- if (G >= x.length) {
1005
- if (j.push([..._]), j.length > 1e4)
998
+ if (!tt(S))
999
+ throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${S.type} for column ${C.id}`);
1000
+ const D = It(S), k = m[m.length - 1];
1001
+ if (k >= S.partitionKeyLength)
1002
+ throw new Error(`Not enough partition keys (${S.partitionKeyLength}) for requested split axes (max index ${k}) in column ${L.name}`);
1003
+ const W = m.map((_) => this.findLabels(T(L.axesSpec[_]))), V = [], N = (_, G) => {
1004
+ if (G >= m.length) {
1005
+ if (V.push([..._]), V.length > 1e4)
1006
1006
  throw new Error("Too many key combinations, aborting.");
1007
1007
  return;
1008
1008
  }
1009
- const V = x[G];
1010
- if (V >= O.length)
1011
- throw new Error(`Axis index ${V} out of bounds for unique keys array (length ${O.length}) during split key generation for column ${P.id}`);
1012
- const J = O[V];
1009
+ const $ = m[G];
1010
+ if ($ >= D.length)
1011
+ throw new Error(`Axis index ${$} out of bounds for unique keys array (length ${D.length}) during split key generation for column ${C.id}`);
1012
+ const J = D[$];
1013
1013
  if (!J || J.length === 0) {
1014
- j.length = 0;
1014
+ V.length = 0;
1015
1015
  return;
1016
1016
  }
1017
1017
  for (const ee of J)
1018
- _.push(ee), $(_, G + 1), _.pop();
1018
+ _.push(ee), N(_, G + 1), _.pop();
1019
1019
  };
1020
- if ($([], 0), j.length === 0)
1020
+ if (N([], 0), V.length === 0)
1021
1021
  continue;
1022
- const k = [...T.axesSpec], We = x.map((_) => _);
1023
- for (let _ = x.length - 1; _ >= 0; _--)
1024
- k.splice(x[_], 1);
1025
- const Ge = { ...T, axesSpec: k };
1026
- for (const _ of j) {
1027
- const G = _.map((V, J) => {
1028
- const ee = We[J], He = R(T.axesSpec[ee]), le = W[J], qe = (le == null ? void 0 : le[V]) ?? String(V);
1029
- return { axisIdx: ee, axisId: He, value: V, label: qe };
1022
+ const j = [...L.axesSpec], He = m.map((_) => _);
1023
+ for (let _ = m.length - 1; _ >= 0; _--)
1024
+ j.splice(m[_], 1);
1025
+ const qe = { ...L, axesSpec: j };
1026
+ for (const _ of V) {
1027
+ const G = _.map(($, J) => {
1028
+ const ee = He[J], ze = T(L.axesSpec[ee]), le = W[J], Ye = (le == null ? void 0 : le[$]) ?? String($);
1029
+ return { axisIdx: ee, axisId: ze, value: $, label: Ye };
1030
1030
  });
1031
- h.push({
1031
+ y.push({
1032
1032
  type: "split",
1033
- originalColumn: P,
1034
- spec: T,
1035
- adjustedSpec: Ge,
1033
+ originalColumn: C,
1034
+ spec: L,
1035
+ adjustedSpec: qe,
1036
1036
  dataEntries: S,
1037
1037
  axisFilters: G
1038
1038
  });
1039
1039
  }
1040
1040
  } else
1041
- h.push({
1041
+ y.push({
1042
1042
  type: "direct",
1043
- originalColumn: P,
1044
- spec: T,
1045
- adjustedSpec: T
1043
+ originalColumn: C,
1044
+ spec: L,
1045
+ adjustedSpec: L
1046
1046
  });
1047
1047
  }
1048
1048
  }
1049
- if (h.length === 0) return [];
1050
- const g = Ve(
1051
- h,
1049
+ if (y.length === 0) return [];
1050
+ const f = Ve(
1051
+ y,
1052
1052
  (c) => ({
1053
1053
  spec: c.spec,
1054
- suffixTrace: c.type === "split" ? Et(c.axisFilters) : void 0
1054
+ suffixTrace: c.type === "split" ? Ot(c.axisFilters) : void 0
1055
1055
  }),
1056
1056
  l
1057
- ), m = [];
1058
- for (const { value: c, label: v } of g) {
1059
- const { originalColumn: b, spec: p } = c, A = c.type === "split" ? c.axisFilters : void 0, x = Dt(A);
1060
- let y;
1061
- r ? y = r.deriveS(p, x) : y = Ft(b.id, x);
1062
- let P = { ...c.adjustedSpec };
1063
- o && (P = {
1064
- ...P,
1057
+ ), w = [];
1058
+ for (const { value: c, label: g } of f) {
1059
+ const { originalColumn: x, spec: p } = c, A = c.type === "split" ? c.axisFilters : void 0, m = kt(A);
1060
+ let v;
1061
+ r ? v = r.deriveS(p, m) : v = Rt(x.id, m);
1062
+ let C = { ...c.adjustedSpec };
1063
+ o && (C = {
1064
+ ...C,
1065
1065
  annotations: {
1066
- ...P.annotations ?? {},
1067
- "pl7.app/label": v
1066
+ ...C.annotations ?? {},
1067
+ "pl7.app/label": g
1068
1068
  }
1069
- }), m.push({
1070
- id: y,
1071
- spec: P,
1072
- data: () => c.type === "split" ? et(Tt(c.dataEntries, x)) : c.originalColumn.data,
1073
- label: v
1069
+ }), w.push({
1070
+ id: v,
1071
+ spec: C,
1072
+ data: () => c.type === "split" ? nt(Lt(c.dataEntries, m)) : c.originalColumn.data,
1073
+ label: g
1074
1074
  });
1075
1075
  }
1076
- return m;
1076
+ return w;
1077
1077
  }
1078
1078
  getColumns(e, n) {
1079
1079
  const r = this.getUniversalEntries(e, {
@@ -1098,19 +1098,19 @@ class me {
1098
1098
  return i;
1099
1099
  }
1100
1100
  }
1101
- function ce(t, e) {
1101
+ function pe(t, e) {
1102
1102
  if (t === void 0) return e === void 0;
1103
1103
  if (e === void 0) return !0;
1104
1104
  for (const n in e)
1105
1105
  if (t[n] !== e[n]) return !1;
1106
1106
  return !0;
1107
1107
  }
1108
- function _e(t) {
1109
- return ve(t, (e) => e instanceof E ? e.handle : be(e) ? at(e, (n) => n.handle) : e);
1108
+ function Ie(t) {
1109
+ return we(t, (e) => e instanceof O ? e.handle : Ae(e) ? ut(e, (n) => n.handle) : e);
1110
1110
  }
1111
- class Ot {
1111
+ class Ft {
1112
1112
  constructor() {
1113
- F(this, "ctx", f());
1113
+ R(this, "ctx", h());
1114
1114
  }
1115
1115
  /**
1116
1116
  * @deprecated use getOptions()
@@ -1122,25 +1122,25 @@ class Ot {
1122
1122
  const r = typeof e == "function" ? e : X(e), i = this.getSpecs().entries.filter((a) => r(a.obj));
1123
1123
  let s = {}, o = !1;
1124
1124
  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" ? Ve(i, (a) => a.obj, s ?? {}).map(({ value: { ref: a }, label: l }) => ({
1125
- ref: Ae(a, o),
1125
+ ref: Ce(a, o),
1126
1126
  label: l
1127
1127
  })) : i.map(({ ref: a, obj: l }) => ({
1128
- ref: Ae(a, o),
1128
+ ref: Ce(a, o),
1129
1129
  label: s(l, a)
1130
1130
  }));
1131
1131
  }
1132
1132
  resolveAnchorCtx(e) {
1133
- if (e instanceof xe) return e;
1133
+ if (e instanceof Pe) return e;
1134
1134
  const n = {};
1135
1135
  for (const [r, i] of Object.entries(e))
1136
- if (nt(i)) {
1136
+ if (it(i)) {
1137
1137
  const s = this.getPColumnSpecByRef(i);
1138
1138
  if (!s)
1139
1139
  return;
1140
1140
  n[r] = s;
1141
1141
  } else
1142
1142
  n[r] = i;
1143
- return new xe(n);
1143
+ return new Pe(n);
1144
1144
  }
1145
1145
  /**
1146
1146
  * Returns columns that match the provided anchors and selectors. It applies axis filters and label derivation.
@@ -1153,7 +1153,7 @@ class Ot {
1153
1153
  getAnchoredPColumns(e, n, r) {
1154
1154
  const i = this.resolveAnchorCtx(e);
1155
1155
  if (i)
1156
- return new me().addColumnProvider(this).addAxisLabelProvider(this).getColumns(n, {
1156
+ return new ve().addColumnProvider(this).addAxisLabelProvider(this).getColumns(n, {
1157
1157
  ...r,
1158
1158
  anchorCtx: i
1159
1159
  });
@@ -1190,7 +1190,7 @@ class Ot {
1190
1190
  getCanonicalOptions(e, n, r) {
1191
1191
  const i = this.resolveAnchorCtx(e);
1192
1192
  if (!i) return;
1193
- const s = new me().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(n, {
1193
+ const s = new ve().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(n, {
1194
1194
  ...r,
1195
1195
  anchorCtx: i
1196
1196
  });
@@ -1214,7 +1214,7 @@ class Ot {
1214
1214
  ref: n.ref,
1215
1215
  obj: {
1216
1216
  ...n.obj,
1217
- data: new E(n.obj.data, [n.ref.blockId, n.ref.name])
1217
+ data: new O(n.obj.data, [n.ref.blockId, n.ref.name])
1218
1218
  }
1219
1219
  }))
1220
1220
  };
@@ -1233,9 +1233,9 @@ class Ot {
1233
1233
  ref: n.ref,
1234
1234
  obj: {
1235
1235
  ...n.obj,
1236
- data: rt(
1236
+ data: st(
1237
1237
  n.obj.data,
1238
- (r) => new E(r, [n.ref.blockId, n.ref.name])
1238
+ (r) => new O(r, [n.ref.blockId, n.ref.name])
1239
1239
  )
1240
1240
  }
1241
1241
  }))
@@ -1262,9 +1262,9 @@ class Ot {
1262
1262
  )) == null ? void 0 : r.obj;
1263
1263
  const n = this.ctx.getDataFromResultPoolByRef(e.blockId, e.name);
1264
1264
  if (n)
1265
- return ve(
1265
+ return we(
1266
1266
  n,
1267
- (i) => new E(i, [e.blockId, e.name])
1267
+ (i) => new O(i, [e.blockId, e.name])
1268
1268
  );
1269
1269
  }
1270
1270
  /**
@@ -1275,7 +1275,7 @@ class Ot {
1275
1275
  getPColumnByRef(e) {
1276
1276
  const n = this.getDataByRef(e);
1277
1277
  if (n)
1278
- return it(n);
1278
+ return ot(n);
1279
1279
  }
1280
1280
  /**
1281
1281
  * Returns spec associated with the ref ensuring that it is a p-column spec.
@@ -1307,10 +1307,10 @@ class Ot {
1307
1307
  if (!ne(r.obj.spec))
1308
1308
  continue;
1309
1309
  const i = r.obj.spec;
1310
- if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && ce(e.domain, i.domain)) {
1310
+ if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && pe(e.domain, i.domain)) {
1311
1311
  for (let s = 0; s < e.axesSpec.length; ++s) {
1312
1312
  const o = e.axesSpec[s], a = i.axesSpec[s];
1313
- if (o.name !== a.name || o.type !== a.type || !ce(o.domain, a.domain))
1313
+ if (o.name !== a.name || o.type !== a.type || !pe(o.domain, a.domain))
1314
1314
  continue e;
1315
1315
  }
1316
1316
  n.push(r.obj);
@@ -1325,9 +1325,9 @@ class Ot {
1325
1325
  findLabels(e) {
1326
1326
  const n = this.getData();
1327
1327
  for (const r of n.entries) {
1328
- if (!ye(r.obj)) continue;
1328
+ if (!be(r.obj)) continue;
1329
1329
  const i = r.obj.spec;
1330
- 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)) {
1330
+ 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)) {
1331
1331
  if (r.obj.data.resourceType.name !== "PColumnData/Json")
1332
1332
  throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
1333
1333
  return Object.fromEntries(
@@ -1352,7 +1352,7 @@ class Ot {
1352
1352
  let a = null;
1353
1353
  const l = this;
1354
1354
  return {
1355
- id: De(i),
1355
+ id: ke(i),
1356
1356
  spec: o,
1357
1357
  get data() {
1358
1358
  var u;
@@ -1379,13 +1379,13 @@ class Ot {
1379
1379
  }
1380
1380
  class te {
1381
1381
  constructor() {
1382
- F(this, "ctx");
1383
- F(this, "args");
1384
- F(this, "uiState");
1382
+ R(this, "ctx");
1383
+ R(this, "args");
1384
+ R(this, "uiState");
1385
1385
  // lazy rendering because this feature is rarely used
1386
- F(this, "_activeArgsCache");
1387
- F(this, "resultPool", new Ot());
1388
- this.ctx = f(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
1386
+ R(this, "_activeArgsCache");
1387
+ R(this, "resultPool", new Ft());
1388
+ this.ctx = h(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
1389
1389
  }
1390
1390
  /**
1391
1391
  * Returns args snapshot the block was executed for (i.e. when "Run" button was pressed).
@@ -1401,16 +1401,16 @@ class te {
1401
1401
  // return this.ctx.featureFlags;
1402
1402
  // }
1403
1403
  getNamedAccessor(e) {
1404
- return de(
1404
+ return he(
1405
1405
  this.ctx.getAccessorHandleByName(e),
1406
- (n) => new E(n, [e])
1406
+ (n) => new O(n, [e])
1407
1407
  );
1408
1408
  }
1409
1409
  get prerun() {
1410
- return this.getNamedAccessor(Oe);
1410
+ return this.getNamedAccessor(Fe);
1411
1411
  }
1412
1412
  get outputs() {
1413
- return this.getNamedAccessor(ke);
1413
+ return this.getNamedAccessor(Ke);
1414
1414
  }
1415
1415
  /**
1416
1416
  * Find labels data for a given axis id. It will search for a label column and return its data as a map.
@@ -1422,13 +1422,13 @@ class te {
1422
1422
  }
1423
1423
  verifyInlineAndExplicitColumnsSupport(e) {
1424
1424
  var i;
1425
- const n = e.some((s) => !(s.data instanceof E) || be(s.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
1425
+ const n = e.some((s) => !(s.data instanceof O) || Ae(s.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
1426
1426
  if (n && !r) throw Error("Inline or explicit columns not supported");
1427
1427
  }
1428
1428
  // TODO remove all non-PColumn fields
1429
1429
  createPFrame(e) {
1430
1430
  return this.verifyInlineAndExplicitColumnsSupport(e), this.ctx.createPFrame(
1431
- e.map((n) => _e(n))
1431
+ e.map((n) => Ie(n))
1432
1432
  );
1433
1433
  }
1434
1434
  createPTable(e) {
@@ -1440,8 +1440,8 @@ class te {
1440
1440
  },
1441
1441
  filters: e.filters ?? [],
1442
1442
  sorting: e.sorting ?? []
1443
- } : n = e, this.verifyInlineAndExplicitColumnsSupport(st(n.src)), this.ctx.createPTable(
1444
- ot(n, (r) => _e(r))
1443
+ } : n = e, this.verifyInlineAndExplicitColumnsSupport(at(n.src)), this.ctx.createPTable(
1444
+ lt(n, (r) => Ie(r))
1445
1445
  );
1446
1446
  }
1447
1447
  /** @deprecated scheduled for removal from SDK */
@@ -1451,20 +1451,29 @@ class te {
1451
1451
  getCurrentUnstableMarker() {
1452
1452
  return this.ctx.getCurrentUnstableMarker();
1453
1453
  }
1454
+ logInfo(e) {
1455
+ this.ctx.logInfo(e);
1456
+ }
1457
+ logWarn(e) {
1458
+ this.ctx.logWarn(e);
1459
+ }
1460
+ logError(e) {
1461
+ this.ctx.logError(e);
1462
+ }
1454
1463
  }
1455
- const Y = "1.31.16";
1456
- function kt(t) {
1464
+ const Y = "1.32.1";
1465
+ function Kt(t) {
1457
1466
  return t.__renderLambda === !0;
1458
1467
  }
1459
- function pe(t) {
1468
+ function de(t) {
1460
1469
  if (t !== void 0)
1461
- return kt(t) ? t.handle : t;
1470
+ return Kt(t) ? t.handle : t;
1462
1471
  }
1463
- function N(t) {
1472
+ function M(t) {
1464
1473
  if (t !== void 0)
1465
1474
  return typeof t == "string" ? { __renderLambda: !0, handle: t, retentive: !1 } : t;
1466
1475
  }
1467
- function Ln(t) {
1476
+ function Rn(t) {
1468
1477
  if (t.v3 !== void 0) {
1469
1478
  const {
1470
1479
  initialArgs: e,
@@ -1500,10 +1509,10 @@ function Ln(t) {
1500
1509
  renderingMode: n,
1501
1510
  initialArgs: o,
1502
1511
  outputs: Object.fromEntries(
1503
- Object.entries(r).map(([u, d]) => [u, N(d)])
1512
+ Object.entries(r).map(([u, d]) => [u, M(d)])
1504
1513
  ),
1505
- inputsValid: N(i),
1506
- sections: N(s),
1514
+ inputsValid: M(i),
1515
+ sections: M(s),
1507
1516
  initialUiState: void 0,
1508
1517
  code: a
1509
1518
  };
@@ -1518,10 +1527,10 @@ function Ln(t) {
1518
1527
  renderingMode: r,
1519
1528
  initialArgs: o,
1520
1529
  outputs: Object.fromEntries(
1521
- Object.entries(i).map(([u, d]) => [u, N(d)])
1530
+ Object.entries(i).map(([u, d]) => [u, M(d)])
1522
1531
  ),
1523
- inputsValid: N(n),
1524
- sections: N(s),
1532
+ inputsValid: M(n),
1533
+ sections: M(s),
1525
1534
  initialUiState: void 0,
1526
1535
  code: a
1527
1536
  };
@@ -1532,12 +1541,12 @@ function Ln(t) {
1532
1541
  );
1533
1542
  }
1534
1543
  }
1535
- class L {
1544
+ class E {
1536
1545
  constructor(e, n, r, i, s, o, a, l) {
1537
1546
  this._renderingMode = e, this._initialArgs = n, this._initialUiState = r, this._outputs = i, this._inputsValid = s, this._sections = o, this._title = a, this._enrichmentTargets = l;
1538
1547
  }
1539
1548
  static create(e = "Heavy") {
1540
- return new L(
1549
+ return new E(
1541
1550
  e,
1542
1551
  void 0,
1543
1552
  {},
@@ -1551,7 +1560,7 @@ class L {
1551
1560
  output(e, n, r = {}) {
1552
1561
  if (typeof n == "function") {
1553
1562
  const i = `output#${e}`;
1554
- return H(i, () => n(new te())), new L(
1563
+ return H(i, () => n(new te())), new E(
1555
1564
  this._renderingMode,
1556
1565
  this._initialArgs,
1557
1566
  this._initialUiState,
@@ -1569,7 +1578,7 @@ class L {
1569
1578
  this._enrichmentTargets
1570
1579
  );
1571
1580
  } else
1572
- return new L(
1581
+ return new E(
1573
1582
  this._renderingMode,
1574
1583
  this._initialArgs,
1575
1584
  this._initialUiState,
@@ -1588,7 +1597,7 @@ class L {
1588
1597
  return this.output(e, n, { retentive: !0 });
1589
1598
  }
1590
1599
  argsValid(e) {
1591
- return typeof e == "function" ? (H("inputsValid", () => e(new te())), new L(
1600
+ return typeof e == "function" ? (H("inputsValid", () => e(new te())), new E(
1592
1601
  this._renderingMode,
1593
1602
  this._initialArgs,
1594
1603
  this._initialUiState,
@@ -1600,7 +1609,7 @@ class L {
1600
1609
  this._sections,
1601
1610
  this._title,
1602
1611
  this._enrichmentTargets
1603
- )) : new L(
1612
+ )) : new E(
1604
1613
  this._renderingMode,
1605
1614
  this._initialArgs,
1606
1615
  this._initialUiState,
@@ -1612,7 +1621,7 @@ class L {
1612
1621
  );
1613
1622
  }
1614
1623
  sections(e) {
1615
- return Array.isArray(e) ? this.sections(re(e)) : typeof e == "function" ? (H("sections", () => e(new te())), new L(
1624
+ return Array.isArray(e) ? this.sections(re(e)) : typeof e == "function" ? (H("sections", () => e(new te())), new E(
1616
1625
  this._renderingMode,
1617
1626
  this._initialArgs,
1618
1627
  this._initialUiState,
@@ -1621,7 +1630,7 @@ class L {
1621
1630
  { __renderLambda: !0, handle: "sections" },
1622
1631
  this._title,
1623
1632
  this._enrichmentTargets
1624
- )) : new L(
1633
+ )) : new E(
1625
1634
  this._renderingMode,
1626
1635
  this._initialArgs,
1627
1636
  this._initialUiState,
@@ -1634,7 +1643,7 @@ class L {
1634
1643
  }
1635
1644
  /** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
1636
1645
  title(e) {
1637
- return H("title", () => e(new te())), new L(
1646
+ return H("title", () => e(new te())), new E(
1638
1647
  this._renderingMode,
1639
1648
  this._initialArgs,
1640
1649
  this._initialUiState,
@@ -1650,7 +1659,7 @@ class L {
1650
1659
  * @deprecated use {@link withArgs}
1651
1660
  * */
1652
1661
  initialArgs(e) {
1653
- return new L(
1662
+ return new E(
1654
1663
  this._renderingMode,
1655
1664
  e,
1656
1665
  this._initialUiState,
@@ -1663,7 +1672,7 @@ class L {
1663
1672
  }
1664
1673
  /** Sets initial args for the block, this value must be specified. */
1665
1674
  withArgs(e) {
1666
- return new L(
1675
+ return new E(
1667
1676
  this._renderingMode,
1668
1677
  e,
1669
1678
  this._initialUiState,
@@ -1676,7 +1685,7 @@ class L {
1676
1685
  }
1677
1686
  /** Defines type and sets initial value for block UiState. */
1678
1687
  withUiState(e) {
1679
- return new L(
1688
+ return new E(
1680
1689
  this._renderingMode,
1681
1690
  this._initialArgs,
1682
1691
  e,
@@ -1692,7 +1701,7 @@ class L {
1692
1701
  * Influences dependency graph construction.
1693
1702
  */
1694
1703
  enriches(e) {
1695
- return H("enrichmentTargets", e), new L(
1704
+ return H("enrichmentTargets", e), new E(
1696
1705
  this._renderingMode,
1697
1706
  this._initialArgs,
1698
1707
  this._initialUiState,
@@ -1724,13 +1733,13 @@ class L {
1724
1733
  sdkVersion: Y,
1725
1734
  renderingMode: this._renderingMode,
1726
1735
  initialArgs: this._initialArgs,
1727
- inputsValid: pe(this._inputsValid),
1728
- sections: pe(this._sections),
1736
+ inputsValid: de(this._inputsValid),
1737
+ sections: de(this._sections),
1729
1738
  outputs: Object.fromEntries(
1730
- Object.entries(this._outputs).map(([n, r]) => [n, pe(r)])
1739
+ Object.entries(this._outputs).map(([n, r]) => [n, de(r)])
1731
1740
  )
1732
1741
  };
1733
- return ft() ? Re({ sdkVersion: Y }) : { config: e };
1742
+ return ht() ? De({ sdkVersion: Y }) : { config: e };
1734
1743
  }
1735
1744
  }
1736
1745
  const jt = (t, e) => {
@@ -1752,133 +1761,169 @@ function Vt(t) {
1752
1761
  }), e = r;
1753
1762
  }), e;
1754
1763
  }
1755
- function Kt(t, e) {
1756
- const n = t.axesSpec.map(R);
1757
- return e.axesSpec.map(R).every((i) => n.some((s) => K(s, i) && K(i, s)));
1764
+ function $t(t) {
1765
+ var e;
1766
+ return t.axesSpec.length === 2 && ((e = t.annotations) == null ? void 0 : e[Ut]) === "true";
1758
1767
  }
1759
- function Je(t, e) {
1760
- const n = t.axesSpec.map(R);
1761
- return e.axesSpec.map(R).every((i) => n.some((s) => K(s, i)));
1768
+ function Nt(t) {
1769
+ var n, r;
1770
+ const e = /* @__PURE__ */ new Map();
1771
+ for (const { id: i, spec: s } of t) {
1772
+ const [o, a] = s.axesSpec.map(T).map(F);
1773
+ e.has(o) || e.set(o, /* @__PURE__ */ new Map()), e.has(a) || e.set(a, /* @__PURE__ */ new Map()), (n = e.get(o)) == null || n.set(a, { columnId: i, spec: s }), (r = e.get(a)) == null || r.set(o, { columnId: i, spec: s });
1774
+ }
1775
+ return e;
1762
1776
  }
1763
- const $t = "pl7.app/graph/isVirtual", Ie = "pl7.app/label";
1764
- function Te(t, e) {
1765
- const n = t.spec.axesSpec.map(R), r = e.spec.axesSpec.map(R);
1766
- if (Kt(t.spec, e.spec))
1777
+ function Je(t, e, n) {
1778
+ var l;
1779
+ const i = [...t.keys()].map(fe).find((u) => K(e, u));
1780
+ if (!i) return !1;
1781
+ const s = F(T(i)), o = /* @__PURE__ */ new Set([s]);
1782
+ let a = [s];
1783
+ for (; a.length; ) {
1784
+ const u = [];
1785
+ for (const d of a)
1786
+ for (const y of ((l = t.get(d)) == null ? void 0 : l.keys()) ?? []) {
1787
+ const b = fe(y);
1788
+ if (K(n, b)) return !0;
1789
+ o.has(y) || (u.push(y), o.add(y));
1790
+ }
1791
+ a = u;
1792
+ }
1793
+ return !1;
1794
+ }
1795
+ function Jt(t, e, n) {
1796
+ const r = t.axesSpec.map(T), i = e.axesSpec.map(T);
1797
+ return i.some((s) => r.some((o) => K(o, s) && K(s, o))) || !!n && i.some((s) => r.some((o) => Je(n, o, s)));
1798
+ }
1799
+ function Me(t, e, n) {
1800
+ const r = t.axesSpec.map(T), i = e.axesSpec.map(T);
1801
+ return i.some((s) => r.some((o) => K(o, s))) || !!n && i.some((s) => r.some((o) => Je(n, o, s)));
1802
+ }
1803
+ const Mt = "pl7.app/graph/isVirtual", Te = "pl7.app/label", Ut = "pl7.app/isLinkerColumn";
1804
+ function Le(t, e, n) {
1805
+ const r = t.spec.axesSpec.map(T), i = e.spec.axesSpec.map(T);
1806
+ if (Jt(t.spec, e.spec, n))
1767
1807
  return [];
1768
- if (!Je(t.spec, e.spec))
1808
+ if (!Me(t.spec, e.spec, n))
1769
1809
  return [];
1770
- const o = r.map((h) => n.filter((w) => K(w, h))), a = Vt(o), l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), d = a.map((h) => {
1771
- const w = /* @__PURE__ */ new Set();
1772
- return h.map((g, m) => {
1773
- const c = e.spec.axesSpec[m].domain, v = g.domain;
1774
- return Object.entries(v ?? {}).forEach(([b, p]) => {
1775
- if ((c == null ? void 0 : c[b]) === void 0) {
1776
- const A = JSON.stringify([b, p]);
1777
- w.add(A), l.add(A);
1810
+ const a = i.map((b) => r.filter((f) => K(f, b))), l = Vt(a), u = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set(), y = l.map((b) => {
1811
+ const f = /* @__PURE__ */ new Set();
1812
+ return b.map((w, c) => {
1813
+ const g = e.spec.axesSpec[c].domain, x = w.domain;
1814
+ return Object.entries(x ?? {}).forEach(([p, A]) => {
1815
+ if ((g == null ? void 0 : g[p]) === void 0) {
1816
+ const m = JSON.stringify([p, A]);
1817
+ f.add(m), u.add(m);
1778
1818
  }
1779
1819
  }), {
1780
- ...g,
1781
- annotations: e.spec.axesSpec[m].annotations
1820
+ ...w,
1821
+ annotations: e.spec.axesSpec[c].annotations
1782
1822
  };
1783
- }), w;
1823
+ }), f;
1784
1824
  });
1785
- return [...l].forEach((h) => {
1786
- d.some((w) => !w.has(h)) && u.add(h);
1787
- }), a.map((h, w) => {
1788
- var b;
1789
- const g = jt(e.id, h.map((p) => p.domain)), m = ((b = e.spec.annotations) == null ? void 0 : b[Ie]) ?? "", c = [...d[w]].filter((p) => u.has(p)).sort().map((p) => {
1790
- var A;
1791
- return (A = JSON.parse(p)) == null ? void 0 : A[1];
1792
- }).join(" / "), v = {
1825
+ return [...u].forEach((b) => {
1826
+ y.some((f) => !f.has(b)) && d.add(b);
1827
+ }), l.map((b, f) => {
1828
+ var p;
1829
+ const w = jt(e.id, b.map((A) => A.domain)), c = ((p = e.spec.annotations) == null ? void 0 : p[Te]) ?? "", g = [...y[f]].filter((A) => d.has(A)).sort().map((A) => {
1830
+ var m;
1831
+ return (m = JSON.parse(A)) == null ? void 0 : m[1];
1832
+ }).join(" / "), x = {
1793
1833
  ...e.spec.annotations,
1794
- [$t]: "true"
1834
+ [Mt]: "true"
1795
1835
  };
1796
- return (m || c) && (v[Ie] = m && c ? m + " / " + c : m + c), {
1797
- id: g,
1836
+ return (c || g) && (x[Te] = c && g ? c + " / " + g : c + g), {
1837
+ id: w,
1798
1838
  spec: {
1799
1839
  ...e.spec,
1800
- axesSpec: h.map((p, A) => ({
1801
- ...p,
1802
- annotations: e.spec.axesSpec[A].annotations
1840
+ axesSpec: b.map((A, m) => ({
1841
+ ...A,
1842
+ annotations: e.spec.axesSpec[m].annotations
1803
1843
  })),
1804
- annotations: v
1844
+ annotations: x
1805
1845
  },
1806
1846
  data: e.data
1807
1847
  };
1808
1848
  });
1809
1849
  }
1810
- function Jt(t) {
1811
- const e = [];
1812
- for (let n = 0; n < t.length; n++)
1813
- for (let r = n + 1; r < t.length; r++) {
1814
- const i = t[n], s = t[r];
1815
- e.push(
1816
- ...Te(i, s),
1817
- ...Te(s, i)
1850
+ function Bt(t, e = /* @__PURE__ */ new Map()) {
1851
+ const n = [];
1852
+ for (let r = 0; r < t.length; r++)
1853
+ for (let i = r + 1; i < t.length; i++) {
1854
+ const s = t[r], o = t[i];
1855
+ n.push(
1856
+ ...Le(s, o, e),
1857
+ ...Le(o, s, e)
1818
1858
  );
1819
1859
  }
1820
- return e;
1860
+ return n;
1821
1861
  }
1822
- function Nt(t, e) {
1823
- const n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map();
1824
- t.forEach((s) => {
1825
- n.add(s.id), r.set(M(Pe(s.spec)), s);
1862
+ function Wt(t, e, n = [], r = /* @__PURE__ */ new Map()) {
1863
+ const i = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Map();
1864
+ t.forEach((a) => {
1865
+ i.add(a.id), s.set(F(ue(a.spec)), a);
1826
1866
  });
1827
- const i = /* @__PURE__ */ new Map();
1828
- for (const s of e) {
1829
- if (n.has(s.id)) continue;
1830
- const o = M(Pe(s.spec));
1831
- if (!r.has(o)) {
1832
- for (const a of r.values())
1833
- if (Je(a.spec, s.spec)) {
1834
- i.set(o, s);
1867
+ const o = /* @__PURE__ */ new Map();
1868
+ for (const a of e) {
1869
+ if (i.has(a.id)) continue;
1870
+ const l = F(ue(a.spec));
1871
+ if (!s.has(l)) {
1872
+ for (const u of s.values())
1873
+ if (Me(u.spec, a.spec, r)) {
1874
+ o.set(l, a);
1835
1875
  break;
1836
1876
  }
1837
1877
  }
1838
1878
  }
1839
- return [...r.values(), ...i.values()];
1879
+ for (const a of n) {
1880
+ if (i.has(a.id)) continue;
1881
+ const l = F(ue(a.spec));
1882
+ s.has(l) || o.has(l) || (i.add(a.id), s.set(l, a));
1883
+ }
1884
+ return [...s.values(), ...o.values()];
1840
1885
  }
1841
- function En(t, e) {
1886
+ function Dn(t, e) {
1842
1887
  if (!e) return;
1843
- const n = t.resultPool.getData().entries.map((s) => s.obj).filter(ye), r = Nt(e, n), i = [...r, ...Jt(r)];
1844
- if (!i.some(
1845
- (s) => s.data instanceof E && !s.data.getIsReadyOrError()
1888
+ const n = t.resultPool.getData().entries.map((l) => l.obj).filter(be), i = [...e, ...n].filter((l) => $t(l.spec)), s = Nt(i), o = Wt(e, n, i, s), a = [...o, ...Bt(o, s)];
1889
+ if (!a.some(
1890
+ (l) => l.data instanceof O && !l.data.getIsReadyOrError()
1846
1891
  ))
1847
- return t.createPFrame(i);
1892
+ return t.createPFrame(a);
1848
1893
  }
1849
- function Dn(t) {
1894
+ function Fn(t) {
1850
1895
  const e = t.type;
1851
1896
  switch (e) {
1852
1897
  case "axis":
1853
- return M(t);
1898
+ return F(t);
1854
1899
  case "column":
1855
- return M(t);
1900
+ return F(t);
1856
1901
  default:
1857
1902
  throw Error(`unsupported column type: ${e}`);
1858
1903
  }
1859
1904
  }
1860
- function Ut(t) {
1905
+ function Gt(t) {
1861
1906
  return t.axesSpec.length === 1 && t.name === "pl7.app/label";
1862
1907
  }
1863
- function Ne(t) {
1864
- return new me().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
1908
+ function Ue(t) {
1909
+ return new ve().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
1865
1910
  name: "pl7.app/label",
1866
1911
  axes: [{}]
1867
1912
  // exactly one axis
1868
1913
  }, { dontWaitAllData: !0 });
1869
1914
  }
1870
- function Ue(t, e) {
1915
+ function Be(t, e) {
1871
1916
  const n = [], r = [];
1872
1917
  for (const a of t)
1873
- Ut(a.spec) ? n.push(a) : r.push(a);
1918
+ Gt(a.spec) ? n.push(a) : r.push(a);
1874
1919
  const i = [];
1875
1920
  for (const a of r)
1876
1921
  for (const l of a.spec.axesSpec) {
1877
- const u = R(l);
1922
+ const u = T(l);
1878
1923
  i.some((d) => K(d, u)) || i.push(u);
1879
1924
  }
1880
1925
  for (const a of n) {
1881
- const l = R(a.spec.axesSpec[0]), u = i.findIndex((d) => K(d, l));
1926
+ const l = T(a.spec.axesSpec[0]), u = i.findIndex((d) => K(d, l));
1882
1927
  u !== -1 && i.splice(u, 1);
1883
1928
  }
1884
1929
  const s = (a, l) => {
@@ -1889,14 +1934,14 @@ function Ue(t, e) {
1889
1934
  return u;
1890
1935
  }, o = [];
1891
1936
  for (const a of e) {
1892
- const l = a.spec.axesSpec[0], u = R(l), d = i.findIndex((h) => K(h, u));
1937
+ const l = a.spec.axesSpec[0], u = T(l), d = i.findIndex((y) => K(y, u));
1893
1938
  if (d !== -1) {
1894
- const h = i[d], w = Object.keys(h.domain ?? {}).length, g = Object.keys(l.domain ?? {}).length;
1895
- w > g ? o.push({
1896
- id: s(a.id, h.domain),
1939
+ const y = i[d], b = Object.keys(y.domain ?? {}).length, f = Object.keys(l.domain ?? {}).length;
1940
+ b > f ? o.push({
1941
+ id: s(a.id, y.domain),
1897
1942
  spec: {
1898
1943
  ...a.spec,
1899
- axesSpec: [{ ...h, annotations: l.annotations }]
1944
+ axesSpec: [{ ...y, annotations: l.annotations }]
1900
1945
  },
1901
1946
  data: a.data
1902
1947
  }) : o.push(a), i.splice(d, 1);
@@ -1904,8 +1949,8 @@ function Ue(t, e) {
1904
1949
  }
1905
1950
  return o;
1906
1951
  }
1907
- function Be(t) {
1908
- const e = (i) => Array.isArray(i), n = (i) => i instanceof E, r = (i) => typeof i == "object" && "type" in i;
1952
+ function We(t) {
1953
+ const e = (i) => Array.isArray(i), n = (i) => i instanceof O, r = (i) => typeof i == "object" && "type" in i;
1909
1954
  return t.map((i) => i.data).every((i) => {
1910
1955
  if (e(i))
1911
1956
  return !0;
@@ -1924,7 +1969,7 @@ function Be(t) {
1924
1969
  throw Error(`unsupported column data type: ${i}`);
1925
1970
  });
1926
1971
  }
1927
- function Me(t, e, n, r, i, s) {
1972
+ function Ge(t, e, n, r, i, s) {
1928
1973
  let o = t;
1929
1974
  const a = [];
1930
1975
  if (s) {
@@ -1945,60 +1990,60 @@ function Me(t, e, n, r, i, s) {
1945
1990
  sorting: i
1946
1991
  };
1947
1992
  }
1948
- function Fn(t, e, n, r) {
1993
+ function Kn(t, e, n, r) {
1949
1994
  var u, d;
1950
1995
  Array.isArray(r) && (r = { filters: r });
1951
- 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 = ((d = n == null ? void 0 : n.pTableParams) == null ? void 0 : d.sorting) ?? [], a = Ne(t.resultPool);
1996
+ 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 = ((d = n == null ? void 0 : n.pTableParams) == null ? void 0 : d.sorting) ?? [], a = Ue(t.resultPool);
1952
1997
  if (!a) return;
1953
- const l = Ue(e.map(Ee), a);
1954
- if (Be([...e, ...l]))
1998
+ const l = Be(e.map(Oe), a);
1999
+ if (We([...e, ...l]))
1955
2000
  return t.createPTable(
1956
- Me(e, l, i, s, o, r == null ? void 0 : r.coreColumnPredicate)
2001
+ Ge(e, l, i, s, o, r == null ? void 0 : r.coreColumnPredicate)
1957
2002
  );
1958
2003
  }
1959
- function Bt(t) {
2004
+ function Ht(t) {
1960
2005
  var e;
1961
2006
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "hidden";
1962
2007
  }
1963
- function Mt(t) {
2008
+ function qt(t) {
1964
2009
  var e;
1965
2010
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "optional";
1966
2011
  }
1967
- function Rn(t, e, n, r, i) {
1968
- var v, b;
1969
- const s = (i == null ? void 0 : i.coreJoinType) ?? "full", o = [...(i == null ? void 0 : i.filters) ?? [], ...((v = r == null ? void 0 : r.pTableParams) == null ? void 0 : v.filters) ?? []], a = ((b = r == null ? void 0 : r.pTableParams) == null ? void 0 : b.sorting) ?? [], l = e.filter((p) => !Bt(p.spec)), u = l.find((p) => n(p.spec));
2012
+ function jn(t, e, n, r, i) {
2013
+ var g, x;
2014
+ const s = (i == null ? void 0 : i.coreJoinType) ?? "full", o = [...(i == null ? void 0 : i.filters) ?? [], ...((g = r == null ? void 0 : r.pTableParams) == null ? void 0 : g.filters) ?? []], a = ((x = r == null ? void 0 : r.pTableParams) == null ? void 0 : x.sorting) ?? [], l = e.filter((p) => !Ht(p.spec)), u = l.find((p) => n(p.spec));
1970
2015
  if (!u) return;
1971
- const d = Ne(t.resultPool);
2016
+ const d = Ue(t.resultPool);
1972
2017
  if (!d) return;
1973
- const h = new Set((() => {
1974
- var A, x;
2018
+ const y = new Set((() => {
2019
+ var A, m;
1975
2020
  if (s === "inner") return [];
1976
- const p = (x = (A = r == null ? void 0 : r.gridState.columnVisibility) == null ? void 0 : A.hiddenColIds) == null ? void 0 : x.map(lt).filter((y) => y.type === "column").map((y) => y.id);
1977
- return p || l.filter((y) => Mt(y.spec)).map((y) => y.id);
2021
+ const p = (m = (A = r == null ? void 0 : r.gridState.columnVisibility) == null ? void 0 : A.hiddenColIds) == null ? void 0 : m.map(fe).filter((v) => v.type === "column").map((v) => v.id);
2022
+ return p || l.filter((v) => qt(v.spec)).map((v) => v.id);
1978
2023
  })());
1979
- h.delete(u.id), [...o.map((p) => p.column), ...a.map((p) => p.column)].filter((p) => p.type === "column").map((p) => h.delete(p.id));
1980
- const w = l.filter((p) => !h.has(p.id)), g = Ue(w.map(Ee), d), m = [
2024
+ y.delete(u.id), [...o.map((p) => p.column), ...a.map((p) => p.column)].filter((p) => p.type === "column").map((p) => y.delete(p.id));
2025
+ const b = l.filter((p) => !y.has(p.id)), f = Be(b.map(Oe), d), w = [
1981
2026
  ...u.spec.axesSpec.map((p) => ({
1982
2027
  type: "axis",
1983
- id: R(p),
2028
+ id: T(p),
1984
2029
  spec: p
1985
2030
  })),
1986
- ...[...l, ...g].map((p) => ({
2031
+ ...[...l, ...f].map((p) => ({
1987
2032
  type: "column",
1988
2033
  id: p.id,
1989
2034
  spec: p.spec
1990
2035
  }))
1991
2036
  ];
1992
- if (!Be([...w, ...g])) return;
2037
+ if (!We([...b, ...f])) return;
1993
2038
  const c = t.createPTable(
1994
- Me(l, g, s, o, a, i == null ? void 0 : i.coreColumnPredicate)
2039
+ Ge(l, f, s, o, a, i == null ? void 0 : i.coreColumnPredicate)
1995
2040
  );
1996
2041
  return {
1997
- tableSpec: m,
2042
+ tableSpec: w,
1998
2043
  tableHandle: c
1999
2044
  };
2000
2045
  }
2001
- function On(t, e, n) {
2046
+ function Vn(t, e, n) {
2002
2047
  const r = t.resultPool.findLabels(e);
2003
2048
  return {
2004
2049
  axis: e,
@@ -2009,18 +2054,18 @@ function On(t, e, n) {
2009
2054
  defaultValue: n[0]
2010
2055
  };
2011
2056
  }
2012
- function kn(t) {
2057
+ function $n(t) {
2013
2058
  const e = t.type;
2014
2059
  switch (e) {
2015
2060
  case "axis":
2016
- return M(t);
2061
+ return F(t);
2017
2062
  case "column":
2018
- return M(t);
2063
+ return F(t);
2019
2064
  default:
2020
2065
  throw Error(`unsupported column type: ${e}`);
2021
2066
  }
2022
2067
  }
2023
- function jn(t, e, n, r) {
2068
+ function Nn(t, e, n, r) {
2024
2069
  if (!(!e || e.axesSpec.length === 0))
2025
2070
  return {
2026
2071
  id: t,
@@ -2035,13 +2080,13 @@ function jn(t, e, n, r) {
2035
2080
  "pl7.app/discreteValues": "[1]"
2036
2081
  }
2037
2082
  },
2038
- data: e.selectedKeys.filter((i) => !i.some((s) => ut(s))).map((i) => ({ key: i, val: 1 }))
2083
+ data: e.selectedKeys.filter((i) => !i.some((s) => ct(s))).map((i) => ({ key: i, val: 1 }))
2039
2084
  };
2040
2085
  }
2041
- function Vn(t) {
2042
- return t === ct ? (console.error("Axis value can never be N/A"), "") : t;
2086
+ function Jn(t) {
2087
+ return t === pt ? (console.error("Axis value can never be N/A"), "") : t;
2043
2088
  }
2044
- class Kn {
2089
+ class Mn {
2045
2090
  constructor(e) {
2046
2091
  this.handle = e;
2047
2092
  }
@@ -2061,51 +2106,52 @@ class Kn {
2061
2106
  return await platforma.pFrameDriver.getUniqueValues(this.handle, e);
2062
2107
  }
2063
2108
  }
2064
- function Wt(t) {
2065
- return Fe({
2109
+ function zt(t) {
2110
+ return Re({
2066
2111
  __isRef: !0,
2067
2112
  blockId: ie(t, "blockId"),
2068
2113
  name: ie(t, "name")
2069
2114
  });
2070
2115
  }
2071
- function $n(t) {
2072
- return Fe({
2073
- ref: Wt(ie(t, "ref")),
2116
+ function Un(t) {
2117
+ return Re({
2118
+ ref: zt(ie(t, "ref")),
2074
2119
  label: ie(t, "label")
2075
2120
  });
2076
2121
  }
2077
- const Jn = {
2122
+ const Bn = {
2078
2123
  sdkVersion: Y
2079
2124
  };
2080
- function Gt() {
2081
- return Re({ sdkVersion: Y });
2125
+ function Yt() {
2126
+ return De({ sdkVersion: Y });
2082
2127
  }
2083
- function Nn(t) {
2128
+ function Wn(t) {
2084
2129
  try {
2085
- return Gt();
2130
+ return Yt();
2086
2131
  } catch {
2087
2132
  return t;
2088
2133
  }
2089
2134
  }
2090
- function Un(t) {
2135
+ function Gn(t) {
2091
2136
  if (typeof globalThis.getEnvironmentValue == "function")
2092
2137
  return globalThis.getEnvironmentValue(t);
2093
2138
  }
2094
2139
  export {
2095
- Zt as Args,
2096
- L as BlockModel,
2097
- Jn as CurrentSdkInfo,
2140
+ rn as Args,
2141
+ E as BlockModel,
2142
+ Bn as CurrentSdkInfo,
2098
2143
  I as FutureRef,
2099
- $t as IS_VIRTUAL_COLUMN,
2100
- en as It,
2101
- In as JsRenderInternal,
2102
- Ie as LABEL_ANNOTATION,
2103
- tn as MainOutputs,
2104
- pt as OutputError,
2105
- vt as PAnnotationLabel,
2106
- bt as PAnnotationTrace,
2107
- me as PColumnCollection,
2108
- Kn as PFrameImpl,
2144
+ Mt as IS_VIRTUAL_COLUMN,
2145
+ sn as It,
2146
+ On as JsRenderInternal,
2147
+ Te as LABEL_ANNOTATION,
2148
+ Ut as LINKER_COLUMN_ANNOTATION,
2149
+ on as MainOutputs,
2150
+ dt as OutputError,
2151
+ bt as PAnnotationLabel,
2152
+ wt as PAnnotationTrace,
2153
+ ve as PColumnCollection,
2154
+ Mn as PFrameImpl,
2109
2155
  B as RT_BINARY_PARTITIONED,
2110
2156
  z as RT_BINARY_SUPER_PARTITIONED,
2111
2157
  q as RT_JSON_PARTITIONED,
@@ -2113,72 +2159,75 @@ export {
2113
2159
  se as RT_RESOURCE_MAP,
2114
2160
  oe as RT_RESOURCE_MAP_PARTITIONED,
2115
2161
  te as RenderCtx,
2116
- Ot as ResultPool,
2117
- nn as StagingOutputs,
2118
- At as Trace,
2119
- wt as TraceEntry,
2120
- E as TreeNodeAccessor,
2121
- rn as UiState,
2122
- Be as allColumnsComputed,
2123
- pn as and,
2124
- It as convertOrParsePColumnData,
2125
- En as createPFrameForGraphs,
2126
- Fn as createPlDataTable,
2127
- On as createPlDataTableSheet,
2128
- Rn as createPlDataTableV2,
2129
- jn as createRowSelectionColumn,
2162
+ Ft as ResultPool,
2163
+ an as StagingOutputs,
2164
+ xt as Trace,
2165
+ At as TraceEntry,
2166
+ O as TreeNodeAccessor,
2167
+ ln as UiState,
2168
+ We as allColumnsComputed,
2169
+ gn as and,
2170
+ Tt as convertOrParsePColumnData,
2171
+ Dn as createPFrameForGraphs,
2172
+ Kn as createPlDataTable,
2173
+ Vn as createPlDataTableSheet,
2174
+ jn as createPlDataTableV2,
2175
+ Nn as createRowSelectionColumn,
2130
2176
  Ve as deriveLabels,
2131
- pe as downgradeCfgOrLambda,
2132
- Nt as enrichColumnsWithCompatible,
2133
- An as extractArchiveAndGetURL,
2134
- Ln as extractConfig,
2135
- Tt as filterDataInfoEntries,
2136
- ln as flatten,
2137
- $n as fromPlOption,
2138
- Wt as fromPlRef,
2139
- Jt as getAdditionalColumns,
2140
- Ne as getAllLabelColumns,
2141
- mn as getBlobContent,
2142
- vn as getBlobContentAsJson,
2143
- yn as getBlobContentAsString,
2144
- bn as getDownloadedBlobContent,
2145
- Un as getEnvironmentValue,
2177
+ de as downgradeCfgOrLambda,
2178
+ Wt as enrichColumnsWithCompatible,
2179
+ Sn as extractArchiveAndGetURL,
2180
+ Rn as extractConfig,
2181
+ Lt as filterDataInfoEntries,
2182
+ dn as flatten,
2183
+ Un as fromPlOption,
2184
+ zt as fromPlRef,
2185
+ Bt as getAdditionalColumns,
2186
+ Ue as getAllLabelColumns,
2187
+ wn as getBlobContent,
2188
+ xn as getBlobContentAsJson,
2189
+ An as getBlobContentAsString,
2190
+ Cn as getDownloadedBlobContent,
2191
+ Gn as getEnvironmentValue,
2146
2192
  Q as getFromCfg,
2147
2193
  re as getImmediate,
2148
- xn as getImportProgress,
2194
+ _n as getImportProgress,
2149
2195
  ie as getJsonField,
2150
- Pn as getLastLogs,
2151
- _n as getLogHandle,
2152
- Ue as getMatchingLabelColumns,
2153
- wn as getOnDemandBlobContent,
2154
- Ct as getPartitionKeysList,
2155
- Nn as getPlatformaOrDefault,
2156
- Cn as getProgressLog,
2157
- Sn as getProgressLogWithInfo,
2158
- Gt as getRawPlatformaInstance,
2159
- fn as getResourceField,
2160
- hn as getResourceValueAsJson,
2161
- _t as getUniquePartitionKeys,
2162
- de as ifDef,
2163
- Bt as isColumnHidden,
2164
- Mt as isColumnOptional,
2165
- kt as isConfigLambda,
2166
- un as isEmpty,
2167
- Ut as isLabelColumn,
2168
- Qt as isolate,
2169
- sn as makeArray,
2170
- Fe as makeObject,
2171
- an as mapArrayValues,
2172
- Vn as mapPTableValueToAxisKey,
2173
- on as mapRecordValues,
2174
- gn as mapResourceFields,
2175
- cn as not,
2176
- dn as or,
2177
- ge as parsePColumnData,
2178
- Tn as parseResourceMap,
2179
- dt as readOutput,
2180
- kn as stringifyPTableColumnId,
2181
- Dn as stringifyPTableColumnSpec,
2182
- Xt as wrapOutputs
2196
+ In as getLastLogs,
2197
+ Nt as getLinkerColumnsMap,
2198
+ En as getLogHandle,
2199
+ Be as getMatchingLabelColumns,
2200
+ Pn as getOnDemandBlobContent,
2201
+ St as getPartitionKeysList,
2202
+ Wn as getPlatformaOrDefault,
2203
+ Tn as getProgressLog,
2204
+ Ln as getProgressLogWithInfo,
2205
+ Yt as getRawPlatformaInstance,
2206
+ yn as getResourceField,
2207
+ vn as getResourceValueAsJson,
2208
+ It as getUniquePartitionKeys,
2209
+ Je as hasPathWithLinkerColumns,
2210
+ he as ifDef,
2211
+ Ht as isColumnHidden,
2212
+ qt as isColumnOptional,
2213
+ Kt as isConfigLambda,
2214
+ fn as isEmpty,
2215
+ Gt as isLabelColumn,
2216
+ $t as isLinkerColumn,
2217
+ nn as isolate,
2218
+ un as makeArray,
2219
+ Re as makeObject,
2220
+ pn as mapArrayValues,
2221
+ Jn as mapPTableValueToAxisKey,
2222
+ cn as mapRecordValues,
2223
+ bn as mapResourceFields,
2224
+ hn as not,
2225
+ mn as or,
2226
+ ye as parsePColumnData,
2227
+ kn as parseResourceMap,
2228
+ ft as readOutput,
2229
+ $n as stringifyPTableColumnId,
2230
+ Fn as stringifyPTableColumnSpec,
2231
+ tn as wrapOutputs
2183
2232
  };
2184
2233
  //# sourceMappingURL=index.mjs.map