@platforma-sdk/model 1.40.1 → 1.40.6

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,67 +1,67 @@
1
- var Qe = Object.defineProperty;
2
- var Ze = (t, e, n) => e in t ? Qe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var k = (t, e, n) => Ze(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { isPColumn as Ke, mapPObjectData as Se, isDataInfoEntries as Ne, isDataInfo as ue, dataInfoToEntries as et, selectorsToPredicate as Y, resolveAnchors as we, deriveNativeId as tt, isPColumnSpec as re, isPartitionedDataInfoEntries as nt, getAxisId as D, entriesToDataInfo as rt, canonicalizeAxisId as it, withEnrichments as Ae, AnchoredIdDeriver as Pe, isPlRef as st, mapValueInVOE as ot, ensurePColumn as at, extractAllColumns as lt, mapPTableDef as ut, mapDataInfo as ct, extractConfigGeneric as pt, matchAxisId as N, getColumnIdAndSpec as xe, canonicalizeJson as O, parseJson as _e, visitDataInfo as dt, isPTableAbsent as ft, uniquePlId as ht, PTableNA as gt } from "@milaboratories/pl-model-common";
1
+ var it = Object.defineProperty;
2
+ var ot = (t, e, n) => e in t ? it(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var V = (t, e, n) => ot(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { isPColumn as je, mapPObjectData as Ae, isDataInfoEntries as qe, isDataInfo as pe, dataInfoToEntries as st, selectorsToPredicate as Y, resolveAnchors as xe, deriveNativeId as at, isPColumnSpec as oe, isPartitionedDataInfoEntries as lt, getAxisId as k, entriesToDataInfo as ut, canonicalizeAxisId as ct, withEnrichments as Fe, AnchoredIdDeriver as Ie, isPlRef as pt, mapValueInVOE as dt, ensurePColumn as ft, extractAllColumns as ht, mapPTableDef as mt, mapDataInfo as yt, extractConfigGeneric as gt, matchAxisId as U, getColumnIdAndSpec as _e, canonicalizeJson as D, parseJson as Le, visitDataInfo as bt, isPTableAbsent as vt, uniquePlId as Ct, PTableNA as Tt } from "@milaboratories/pl-model-common";
5
5
  export * from "@milaboratories/pl-model-common";
6
- import Ve from "canonicalize";
7
- import { z as $ } from "zod";
6
+ import Be from "canonicalize";
7
+ import { z as B } from "zod";
8
8
  export * from "@milaboratories/pl-error-like";
9
- class mt extends Error {
9
+ class St 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 yt(t) {
15
- if (!t.ok) throw new mt(t.errors, t.moreErrors);
14
+ function Pt(t) {
15
+ if (!t.ok) throw new St(t.errors, t.moreErrors);
16
16
  return t.value;
17
17
  }
18
- function un(t) {
18
+ function mn(t) {
19
19
  return new Proxy(t, {
20
20
  get(e, n) {
21
- return yt(e[n]);
21
+ return Pt(e[n]);
22
22
  }
23
23
  });
24
24
  }
25
- function P(t) {
26
- return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ? ie(t) : t;
25
+ function A(t) {
26
+ return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ? se(t) : t;
27
27
  }
28
- function Q(t) {
28
+ function Z(t) {
29
29
  return { type: "GetFromCtx", variable: t };
30
30
  }
31
- function cn(t) {
31
+ function yn(t) {
32
32
  return {
33
33
  type: "Isolate",
34
34
  cfg: t
35
35
  };
36
36
  }
37
- const pn = Q("$args"), dn = Q("$it"), fn = Q("$prod"), hn = Q("$staging"), gn = Q("$ui");
38
- function ie(t) {
37
+ const gn = Z("$args"), bn = Z("$it"), vn = Z("$prod"), Cn = Z("$staging"), Tn = Z("$ui");
38
+ function se(t) {
39
39
  return { type: "Immediate", value: t };
40
40
  }
41
- function Me(t) {
41
+ function Je(t) {
42
42
  const e = {};
43
- for (const [n, r] of Object.entries(t)) e[n] = P(r);
43
+ for (const [n, r] of Object.entries(t)) e[n] = A(r);
44
44
  return {
45
45
  type: "MakeObject",
46
46
  template: e
47
47
  };
48
48
  }
49
- function mn(...t) {
49
+ function Sn(...t) {
50
50
  const e = [];
51
- for (const n of t) e.push(P(n));
51
+ for (const n of t) e.push(A(n));
52
52
  return {
53
53
  type: "MakeArray",
54
54
  template: e
55
55
  };
56
56
  }
57
- function se(t, e) {
57
+ function ae(t, e) {
58
58
  return {
59
59
  type: "GetJsonField",
60
- source: P(t),
61
- field: P(e)
60
+ source: A(t),
61
+ field: A(e)
62
62
  };
63
63
  }
64
- function yn(t, e, n = "$it") {
64
+ function Pn(t, e, n = "$it") {
65
65
  return {
66
66
  type: "MapRecordValues",
67
67
  source: t,
@@ -69,7 +69,7 @@ function yn(t, e, n = "$it") {
69
69
  itVar: n
70
70
  };
71
71
  }
72
- function bn(t, e, n = "$it") {
72
+ function An(t, e, n = "$it") {
73
73
  return {
74
74
  type: "MapArrayValues",
75
75
  source: t,
@@ -77,54 +77,54 @@ function bn(t, e, n = "$it") {
77
77
  itVar: n
78
78
  };
79
79
  }
80
- function vn(t) {
80
+ function wn(t) {
81
81
  return {
82
82
  type: "Flatten",
83
83
  source: t
84
84
  };
85
85
  }
86
- function Cn(t) {
86
+ function xn(t) {
87
87
  return {
88
88
  type: "IsEmpty",
89
89
  arg: t
90
90
  };
91
91
  }
92
- function Sn(t) {
92
+ function Fn(t) {
93
93
  return {
94
94
  type: "Not",
95
95
  operand: t
96
96
  };
97
97
  }
98
- function wn(t, e) {
98
+ function In(t, e) {
99
99
  return {
100
100
  type: "And",
101
101
  operand1: t,
102
102
  operand2: e
103
103
  };
104
104
  }
105
- function An(t, e) {
105
+ function _n(t, e) {
106
106
  return {
107
107
  type: "Or",
108
108
  operand1: t,
109
109
  operand2: e
110
110
  };
111
111
  }
112
- function Pn(t, e) {
112
+ function Ln(t, e) {
113
113
  return {
114
114
  type: "GetResourceField",
115
- source: P(t),
116
- field: P(e)
115
+ source: A(t),
116
+ field: A(e)
117
117
  };
118
118
  }
119
- function xn() {
119
+ function En() {
120
120
  return function(t) {
121
121
  return {
122
122
  type: "GetResourceValueAsJson",
123
- source: P(t)
123
+ source: A(t)
124
124
  };
125
125
  };
126
126
  }
127
- function _n(t, e, n = "$it") {
127
+ function Vn(t, e, n = "$it") {
128
128
  return {
129
129
  type: "MapResourceFields",
130
130
  source: t,
@@ -132,123 +132,123 @@ function _n(t, e, n = "$it") {
132
132
  itVar: n
133
133
  };
134
134
  }
135
- function In(t, e) {
135
+ function kn(t, e) {
136
136
  return {
137
137
  type: "GetBlobContent",
138
138
  range: e,
139
- source: P(t)
139
+ source: A(t)
140
140
  };
141
141
  }
142
- function Tn(t, e) {
142
+ function On(t, e) {
143
143
  return {
144
144
  type: "GetBlobContentAsString",
145
145
  range: e,
146
- source: P(t)
146
+ source: A(t)
147
147
  };
148
148
  }
149
- function Ln() {
149
+ function Dn() {
150
150
  return function(t, e) {
151
151
  return {
152
152
  type: "GetBlobContentAsJson",
153
153
  range: e,
154
- source: P(t)
154
+ source: A(t)
155
155
  };
156
156
  };
157
157
  }
158
- function Fn(t) {
158
+ function Rn(t) {
159
159
  return {
160
160
  type: "GetDownloadedBlobContent",
161
- source: P(t)
161
+ source: A(t)
162
162
  };
163
163
  }
164
- function En(t) {
164
+ function Nn(t) {
165
165
  return {
166
166
  type: "GetOnDemandBlobContent",
167
- source: P(t)
167
+ source: A(t)
168
168
  };
169
169
  }
170
- function kn(t, e) {
170
+ function Un(t, e) {
171
171
  return {
172
172
  type: "ExtractArchiveAndGetURL",
173
173
  format: e,
174
- source: P(t)
174
+ source: A(t)
175
175
  };
176
176
  }
177
- function Dn(t) {
177
+ function Kn(t) {
178
178
  return {
179
179
  type: "GetImportProgress",
180
- source: P(t)
180
+ source: A(t)
181
181
  };
182
182
  }
183
- function Rn(t, e) {
183
+ function Mn(t, e) {
184
184
  return {
185
185
  type: "GetLastLogs",
186
- source: P(t),
186
+ source: A(t),
187
187
  lines: e
188
188
  };
189
189
  }
190
- function On(t, e) {
190
+ function jn(t, e) {
191
191
  return {
192
192
  type: "GetProgressLog",
193
- source: P(t),
193
+ source: A(t),
194
194
  patternToSearch: e
195
195
  };
196
196
  }
197
- function Kn(t, e) {
197
+ function qn(t, e) {
198
198
  return {
199
199
  type: "GetProgressLogWithInfo",
200
- source: P(t),
200
+ source: A(t),
201
201
  patternToSearch: e
202
202
  };
203
203
  }
204
- function Nn(t) {
204
+ function Bn(t) {
205
205
  return {
206
206
  type: "GetLogHandle",
207
- source: P(t)
207
+ source: A(t)
208
208
  };
209
209
  }
210
- function bt() {
210
+ function At() {
211
211
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
212
212
  }
213
- function je(t) {
213
+ function $e(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 vt() {
219
+ function wt() {
220
220
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
221
221
  }
222
- function v() {
222
+ function b() {
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 G(t, e) {
227
- const n = vt();
227
+ const n = wt();
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 pe = /* @__PURE__ */ new Map();
233
- function Ct(t, e) {
234
- t in v().callbackRegistry || (v().callbackRegistry[t] = (n) => {
235
- for (const r of pe.get(t))
232
+ const fe = /* @__PURE__ */ new Map();
233
+ function xt(t, e) {
234
+ t in b().callbackRegistry || (b().callbackRegistry[t] = (n) => {
235
+ for (const r of fe.get(t))
236
236
  r(n);
237
- }, pe.set(t, [])), pe.get(t).push(e);
237
+ }, fe.set(t, [])), fe.get(t).push(e);
238
238
  }
239
- class F {
239
+ class L {
240
240
  constructor(e, n = (r) => r) {
241
- k(this, "isResolved", !1);
242
- k(this, "resolvedValue");
243
- this.handle = e, this.postProcess = n, Ct(e, (r) => {
241
+ V(this, "isResolved", !1);
242
+ V(this, "resolvedValue");
243
+ this.handle = e, this.postProcess = n, xt(e, (r) => {
244
244
  this.resolvedValue = n(r), this.isResolved = !0;
245
245
  });
246
246
  }
247
247
  map(e) {
248
- return new F(this.handle, (n) => e(this.postProcess(n)));
248
+ return new L(this.handle, (n) => e(this.postProcess(n)));
249
249
  }
250
250
  mapDefined(e) {
251
- return new F(this.handle, (n) => {
251
+ return new L(this.handle, (n) => {
252
252
  const r = this.postProcess(n);
253
253
  return r ? e(r) : void 0;
254
254
  });
@@ -260,7 +260,7 @@ class F {
260
260
  function ge(t, e) {
261
261
  return t === void 0 ? void 0 : e(t);
262
262
  }
263
- class R {
263
+ class O {
264
264
  constructor(e, n) {
265
265
  this.handle = e, this.resolvePath = n;
266
266
  }
@@ -300,46 +300,46 @@ class R {
300
300
  ...n.map((i) => typeof i == "string" ? i : i.field)
301
301
  ];
302
302
  return ge(
303
- v().resolveWithCommon(this.handle, e, ...n),
304
- (i) => new R(i, r)
303
+ b().resolveWithCommon(this.handle, e, ...n),
304
+ (i) => new O(i, r)
305
305
  );
306
306
  }
307
307
  get resourceType() {
308
- return v().getResourceType(this.handle);
308
+ return b().getResourceType(this.handle);
309
309
  }
310
310
  getInputsLocked() {
311
- return v().getInputsLocked(this.handle);
311
+ return b().getInputsLocked(this.handle);
312
312
  }
313
313
  getOutputsLocked() {
314
- return v().getOutputsLocked(this.handle);
314
+ return b().getOutputsLocked(this.handle);
315
315
  }
316
316
  getIsReadyOrError() {
317
- return v().getIsReadyOrError(this.handle);
317
+ return b().getIsReadyOrError(this.handle);
318
318
  }
319
319
  getIsFinal() {
320
- return v().getIsFinal(this.handle);
320
+ return b().getIsFinal(this.handle);
321
321
  }
322
322
  getError() {
323
323
  const e = [...this.resolvePath, "error"];
324
324
  return ge(
325
- v().getError(this.handle),
326
- (n) => new R(n, e)
325
+ b().getError(this.handle),
326
+ (n) => new O(n, e)
327
327
  );
328
328
  }
329
329
  listInputFields() {
330
- return v().listInputFields(this.handle);
330
+ return b().listInputFields(this.handle);
331
331
  }
332
332
  listOutputFields() {
333
- return v().listOutputFields(this.handle);
333
+ return b().listOutputFields(this.handle);
334
334
  }
335
335
  listDynamicFields() {
336
- return v().listDynamicFields(this.handle);
336
+ return b().listDynamicFields(this.handle);
337
337
  }
338
338
  getKeyValueBase64(e) {
339
- return v().getKeyValueBase64(this.handle, e);
339
+ return b().getKeyValueBase64(this.handle, e);
340
340
  }
341
341
  getKeyValueAsString(e) {
342
- return v().getKeyValueAsString(this.handle, e);
342
+ return b().getKeyValueAsString(this.handle, e);
343
343
  }
344
344
  getKeyValueAsJson(e) {
345
345
  const n = this.getKeyValueAsString(e);
@@ -347,10 +347,10 @@ class R {
347
347
  return JSON.parse(n);
348
348
  }
349
349
  getDataBase64() {
350
- return v().getDataBase64(this.handle);
350
+ return b().getDataBase64(this.handle);
351
351
  }
352
352
  getDataAsString() {
353
- return v().getDataAsString(this.handle);
353
+ return b().getDataAsString(this.handle);
354
354
  }
355
355
  getDataAsJson() {
356
356
  const e = this.getDataAsString();
@@ -362,16 +362,16 @@ class R {
362
362
  */
363
363
  getPColumns(e = !1, n = "") {
364
364
  const r = this.parsePObjectCollection(e, n);
365
- return r === void 0 ? void 0 : Object.entries(r).map(([, s]) => {
366
- if (!Ke(s)) throw new Error(`not a PColumn (kind = ${s.spec.kind})`);
367
- return s;
365
+ return r === void 0 ? void 0 : Object.entries(r).map(([, o]) => {
366
+ if (!je(o)) throw new Error(`not a PColumn (kind = ${o.spec.kind})`);
367
+ return o;
368
368
  });
369
369
  }
370
370
  /**
371
371
  *
372
372
  */
373
373
  parsePObjectCollection(e = !1, n = "") {
374
- const r = v().parsePObjectCollection(
374
+ const r = b().parsePObjectCollection(
375
375
  this.handle,
376
376
  e,
377
377
  n,
@@ -379,21 +379,21 @@ class R {
379
379
  );
380
380
  if (r === void 0) return;
381
381
  const i = {};
382
- for (const [s, o] of Object.entries(r)) {
383
- const a = [...this.resolvePath, s];
384
- i[s] = Se(o, (l) => new R(l, a));
382
+ for (const [o, s] of Object.entries(r)) {
383
+ const a = [...this.resolvePath, o];
384
+ i[o] = Ae(s, (l) => new O(l, a));
385
385
  }
386
386
  return i;
387
387
  }
388
388
  getFileContentAsBase64(e) {
389
- return new F(v().getBlobContentAsBase64(this.handle, e));
389
+ return new L(b().getBlobContentAsBase64(this.handle, e));
390
390
  }
391
391
  getFileContentAsString(e) {
392
- return new F(v().getBlobContentAsString(this.handle, e));
392
+ return new L(b().getBlobContentAsString(this.handle, e));
393
393
  }
394
394
  getFileContentAsJson(e) {
395
- return new F(
396
- v().getBlobContentAsString(this.handle, e)
395
+ return new L(
396
+ b().getBlobContentAsString(this.handle, e)
397
397
  ).mapDefined((n) => JSON.parse(n));
398
398
  }
399
399
  /**
@@ -412,7 +412,7 @@ class R {
412
412
  * @returns downloaded file handle
413
413
  */
414
414
  getFileHandle() {
415
- return new F(v().getDownloadedBlobContentHandle(this.handle));
415
+ return new L(b().getDownloadedBlobContentHandle(this.handle));
416
416
  }
417
417
  /**
418
418
  * @deprecated use getFileHandle
@@ -424,7 +424,7 @@ class R {
424
424
  * @returns downloaded file handle
425
425
  */
426
426
  getRemoteFileHandle() {
427
- return new F(v().getOnDemandBlobContentHandle(this.handle));
427
+ return new L(b().getOnDemandBlobContentHandle(this.handle));
428
428
  }
429
429
  /**
430
430
  * @deprecated use getRemoteFileHandle
@@ -436,22 +436,22 @@ class R {
436
436
  * @returns the url to the extracted folder
437
437
  */
438
438
  extractArchiveAndGetURL(e) {
439
- return new F(v().extractArchiveAndGetURL(this.handle, e));
439
+ return new L(b().extractArchiveAndGetURL(this.handle, e));
440
440
  }
441
441
  getImportProgress() {
442
- return new F(v().getImportProgress(this.handle));
442
+ return new L(b().getImportProgress(this.handle));
443
443
  }
444
444
  getLastLogs(e) {
445
- return new F(v().getLastLogs(this.handle, e));
445
+ return new L(b().getLastLogs(this.handle, e));
446
446
  }
447
447
  getProgressLog(e) {
448
- return new F(v().getProgressLog(this.handle, e));
448
+ return new L(b().getProgressLog(this.handle, e));
449
449
  }
450
450
  getProgressLogWithInfo(e) {
451
- return new F(v().getProgressLogWithInfo(this.handle, e));
451
+ return new L(b().getProgressLogWithInfo(this.handle, e));
452
452
  }
453
453
  getLogHandle() {
454
- return new F(v().getLogHandle(this.handle));
454
+ return new L(b().getLogHandle(this.handle));
455
455
  }
456
456
  allFieldsResolved(e = "Input") {
457
457
  switch (e) {
@@ -466,109 +466,109 @@ class R {
466
466
  }
467
467
  }
468
468
  mapFields(e, n) {
469
- const { fieldType: r, requireLocked: i, skipUnresolved: s } = {
469
+ const { fieldType: r, requireLocked: i, skipUnresolved: o } = {
470
470
  fieldType: "Input",
471
471
  requireLocked: !0,
472
472
  skipUnresolved: !1,
473
473
  ...n
474
- }, o = e;
474
+ }, s = e;
475
475
  if (i && (r === "Input" && !this.getInputsLocked() || r === "Output" && !this.getOutputsLocked()))
476
476
  return;
477
477
  let l = (r === "Input" ? this.listInputFields() : r === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
478
478
  (u) => [u, this.resolve({ field: u, assertFieldType: r })]
479
479
  );
480
- return s && (l = l.filter((u) => u[1] !== void 0)), l.map(([u, h]) => o(u, h));
480
+ return o && (l = l.filter((u) => u[1] !== void 0)), l.map(([u, h]) => s(u, h));
481
481
  }
482
482
  }
483
- const Je = "staging", $e = "main", St = {
483
+ const We = "staging", Ge = "main", Ft = {
484
484
  explicitColumnsSupport: !0,
485
485
  inlineColumnsSupport: !0,
486
486
  activeArgs: !0,
487
487
  pTablePartitionFiltersSupport: !0,
488
488
  pFrameInSetFilterSupport: !0
489
489
  };
490
- function Be(t) {
490
+ function He(t) {
491
491
  return typeof t == "object" && t !== null && "__awaited_futures__" in t;
492
492
  }
493
- function me(t, e, n) {
493
+ function be(t, e, n) {
494
494
  if (e.has(n)) return;
495
495
  if (e.add(n), typeof n === "object")
496
- if (Be(n)) n.__awaited_futures__.forEach((i) => t.add(i));
496
+ if (He(n)) n.__awaited_futures__.forEach((i) => t.add(i));
497
497
  else if (Array.isArray(n))
498
- for (const i of n) me(t, e, i);
498
+ for (const i of n) be(t, e, i);
499
499
  else
500
500
  for (const [, i] of Object.entries(n))
501
- i !== n && me(t, e, i);
501
+ i !== n && be(t, e, i);
502
502
  }
503
- function wt(t) {
503
+ function It(t) {
504
504
  const e = /* @__PURE__ */ new Set();
505
- return me(e, /* @__PURE__ */ new Set(), t), e;
505
+ return be(e, /* @__PURE__ */ new Set(), t), e;
506
506
  }
507
- const Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
507
+ const Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
508
508
  __proto__: null,
509
- GlobalCfgRenderCtxFeatureFlags: St,
510
- MainAccessorName: $e,
511
- StagingAccessorName: Je,
512
- getAllFutureAwaits: wt,
513
- isFutureAwait: Be
514
- }, Symbol.toStringTag, { value: "Module" })), At = "pl7.app/label", Pt = "pl7.app/trace", xt = $.object({
515
- type: $.string(),
516
- importance: $.number().optional(),
517
- id: $.string().optional(),
518
- label: $.string()
519
- }), _t = $.array(xt), It = 1e-3, Tt = "__LABEL__", Ie = "__LABEL__@1";
520
- function Ue(t, e, n = {}) {
521
- const r = /* @__PURE__ */ new Map(), i = n.forceTraceElements !== void 0 && n.forceTraceElements.length > 0 ? new Set(n.forceTraceElements) : void 0, s = /* @__PURE__ */ new Map(), o = t.map((d) => {
522
- var c, b;
523
- const y = e(d);
524
- let p, m, C;
525
- "spec" in y && typeof y.spec == "object" ? (p = y.spec, m = y.prefixTrace, C = y.suffixTrace) : p = y;
526
- const E = (c = p.annotations) == null ? void 0 : c[At], _ = (b = p.annotations) == null ? void 0 : b[Pt], w = (_ ? _t.safeParse(JSON.parse(_)).data : void 0) ?? [], A = [
527
- ...m ?? [],
528
- ...w,
509
+ GlobalCfgRenderCtxFeatureFlags: Ft,
510
+ MainAccessorName: Ge,
511
+ StagingAccessorName: We,
512
+ getAllFutureAwaits: It,
513
+ isFutureAwait: He
514
+ }, Symbol.toStringTag, { value: "Module" })), _t = "pl7.app/label", Lt = "pl7.app/trace", Et = B.object({
515
+ type: B.string(),
516
+ importance: B.number().optional(),
517
+ id: B.string().optional(),
518
+ label: B.string()
519
+ }), Vt = B.array(Et), kt = 1e-3, Ot = "__LABEL__", Ee = "__LABEL__@1";
520
+ function ze(t, e, n = {}) {
521
+ const r = /* @__PURE__ */ new Map(), i = n.forceTraceElements !== void 0 && n.forceTraceElements.length > 0 ? new Set(n.forceTraceElements) : void 0, o = /* @__PURE__ */ new Map(), s = t.map((d) => {
522
+ var c, v;
523
+ const g = e(d);
524
+ let p, y, C;
525
+ "spec" in g && typeof g.spec == "object" ? (p = g.spec, y = g.prefixTrace, C = g.suffixTrace) : p = g;
526
+ const E = (c = p.annotations) == null ? void 0 : c[_t], x = (v = p.annotations) == null ? void 0 : v[Lt], S = (x ? Vt.safeParse(JSON.parse(x)).data : void 0) ?? [], P = [
527
+ ...y ?? [],
528
+ ...S,
529
529
  ...C ?? []
530
530
  ];
531
531
  if (E !== void 0) {
532
- const T = { label: E, type: Tt, importance: -2 };
533
- n.addLabelAsSuffix ? A.push(T) : A.splice(0, 0, T);
532
+ const I = { label: E, type: Ot, importance: -2 };
533
+ n.addLabelAsSuffix ? P.push(I) : P.splice(0, 0, I);
534
534
  }
535
- const S = [], I = /* @__PURE__ */ new Map();
536
- for (let T = A.length - 1; T >= 0; --T) {
537
- const { type: U } = A[T], V = A[T].importance ?? 0, j = (I.get(U) ?? 0) + 1;
538
- I.set(U, j);
539
- const K = `${U}@${j}`;
540
- s.set(K, (s.get(K) ?? 0) + 1), r.set(
541
- K,
535
+ const T = [], F = /* @__PURE__ */ new Map();
536
+ for (let I = P.length - 1; I >= 0; --I) {
537
+ const { type: $ } = P[I], K = P[I].importance ?? 0, j = (F.get($) ?? 0) + 1;
538
+ F.set($, j);
539
+ const N = `${$}@${j}`;
540
+ o.set(N, (o.get(N) ?? 0) + 1), r.set(
541
+ N,
542
542
  Math.max(
543
- r.get(K) ?? Number.NEGATIVE_INFINITY,
544
- V - (A.length - T) * It
543
+ r.get(N) ?? Number.NEGATIVE_INFINITY,
544
+ K - (P.length - I) * kt
545
545
  )
546
- ), S.push({ ...A[T], fullType: K, occurrenceIndex: j });
546
+ ), T.push({ ...P[I], fullType: N, occurrenceIndex: j });
547
547
  }
548
- return S.reverse(), {
548
+ return T.reverse(), {
549
549
  value: d,
550
550
  spec: p,
551
551
  label: E,
552
- fullTrace: S
552
+ fullTrace: T
553
553
  };
554
554
  }), a = [], l = [], u = [...r];
555
- u.sort(([, d], [, y]) => y - d);
555
+ u.sort(([, d], [, g]) => g - d);
556
556
  for (const [d] of u)
557
- d.endsWith("@1") || s.get(d) === t.length ? a.push(d) : l.push(d);
558
- const h = (d, y = !1) => {
557
+ d.endsWith("@1") || o.get(d) === t.length ? a.push(d) : l.push(d);
558
+ const h = (d, g = !1) => {
559
559
  const p = [];
560
- for (let m = 0; m < o.length; m++) {
561
- const C = o[m], E = C.fullTrace.filter((A) => d.has(A.fullType) || i && i.has(A.type));
560
+ for (let y = 0; y < s.length; y++) {
561
+ const C = s[y], E = C.fullTrace.filter((P) => d.has(P.fullType) || i && i.has(P.type));
562
562
  if (E.length === 0)
563
- if (y)
563
+ if (g)
564
564
  p.push({
565
565
  label: "Unlabeled",
566
566
  value: C.value
567
567
  });
568
568
  else return;
569
- const _ = E.map((A) => A.label), w = n.separator ?? " / ";
569
+ const x = E.map((P) => P.label), S = n.separator ?? " / ";
570
570
  p.push({
571
- label: _.join(w),
571
+ label: x.join(S),
572
572
  value: C.value
573
573
  });
574
574
  }
@@ -576,104 +576,104 @@ function Ue(t, e, n = {}) {
576
576
  };
577
577
  if (a.length === 0) {
578
578
  if (l.length !== 0) throw new Error("Non-empty secondary types list while main types list is empty.");
579
- return h(new Set(Ie), !0);
579
+ return h(new Set(Ee), !0);
580
580
  }
581
- let f = 0, g = -1;
581
+ let f = 0, m = -1;
582
582
  for (; f < a.length; ) {
583
583
  const d = /* @__PURE__ */ new Set();
584
- n.includeNativeLabel && d.add(Ie);
584
+ n.includeNativeLabel && d.add(Ee);
585
585
  for (let p = 0; p < f; ++p) d.add(a[p]);
586
- g >= 0 && d.add(a[g]);
587
- const y = h(d);
588
- if (y !== void 0 && new Set(y.map((p) => p.label)).size === t.length) return y;
589
- g++, g >= a.length && (f++, g = f);
586
+ m >= 0 && d.add(a[m]);
587
+ const g = h(d);
588
+ if (g !== void 0 && new Set(g.map((p) => p.label)).size === t.length) return g;
589
+ m++, m >= a.length && (f++, m = f);
590
590
  }
591
591
  return h(/* @__PURE__ */ new Set([...a, ...l]), !0);
592
592
  }
593
- const Z = "PColumnData/", oe = Z + "ResourceMap", ae = Z + "Partitioned/ResourceMap", H = Z + "JsonPartitioned", B = Z + "BinaryPartitioned", We = Z + "Partitioned/", le = We + "JsonPartitioned", q = We + "BinaryPartitioned";
594
- function Ge(t, e, n, r = [], i) {
593
+ const ee = "PColumnData/", le = ee + "ResourceMap", ue = ee + "Partitioned/ResourceMap", H = ee + "JsonPartitioned", J = ee + "BinaryPartitioned", Xe = ee + "Partitioned/", ce = Xe + "JsonPartitioned", z = Xe + "BinaryPartitioned";
594
+ function Ye(t, e, n, r = [], i) {
595
595
  if (t === void 0) return !1;
596
596
  switch (t.resourceType.name) {
597
- case oe: {
598
- let s = t.getInputsLocked();
599
- for (const o of t.listInputFields()) {
600
- const a = t.resolve({ field: o, assertFieldType: "Input" }), l = [...r, ...JSON.parse(o)], u = a === void 0 ? void 0 : e(a);
601
- u === void 0 && (s = !1), (u !== void 0 || i) && n.push({ key: l, value: u });
597
+ case le: {
598
+ let o = t.getInputsLocked();
599
+ for (const s of t.listInputFields()) {
600
+ const a = t.resolve({ field: s, assertFieldType: "Input" }), l = [...r, ...JSON.parse(s)], u = a === void 0 ? void 0 : e(a);
601
+ u === void 0 && (o = !1), (u !== void 0 || i) && n.push({ key: l, value: u });
602
602
  }
603
- return s;
603
+ return o;
604
604
  }
605
- case ae: {
606
- let s = t.getInputsLocked();
607
- for (const o of t.listInputFields()) {
608
- const a = t.resolve({ field: o, assertFieldType: "Input" });
609
- if (a === void 0) s = !1;
605
+ case ue: {
606
+ let o = t.getInputsLocked();
607
+ for (const s of t.listInputFields()) {
608
+ const a = t.resolve({ field: s, assertFieldType: "Input" });
609
+ if (a === void 0) o = !1;
610
610
  else {
611
- const l = [...r, ...JSON.parse(o)], u = Ge(
611
+ const l = [...r, ...JSON.parse(s)], u = Ye(
612
612
  a,
613
613
  e,
614
614
  n,
615
615
  l,
616
616
  i
617
617
  );
618
- s = s && u;
618
+ o = o && u;
619
619
  }
620
620
  }
621
- return s;
621
+ return o;
622
622
  }
623
623
  default:
624
624
  throw new Error(`Unknown resource type: ${t.resourceType.name}`);
625
625
  }
626
626
  }
627
- function Mn(t, e, n = !1) {
627
+ function $n(t, e, n = !1) {
628
628
  const r = [];
629
- return { isComplete: Ge(t, e, r, [], n), data: r };
629
+ return { isComplete: Ye(t, e, r, [], n), data: r };
630
630
  }
631
- const ye = (t) => {
631
+ const ve = (t) => {
632
632
  if (t.endsWith(".index"))
633
633
  return { baseKey: t.substring(0, t.length - 6), type: "index" };
634
634
  if (t.endsWith(".values"))
635
635
  return { baseKey: t.substring(0, t.length - 7), type: "values" };
636
636
  throw new Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
637
637
  };
638
- function Lt(t) {
638
+ function Dt(t) {
639
639
  if (!t) return;
640
640
  const e = t.resourceType.name, n = t.getDataAsJson(), r = [];
641
641
  let i = 0;
642
642
  switch (e) {
643
- case oe:
643
+ case le:
644
644
  i = n.keyLength;
645
645
  break;
646
- case ae:
646
+ case ue:
647
647
  i = n.partitionKeyLength + n.keyLength;
648
648
  break;
649
649
  case H:
650
- case B:
650
+ case J:
651
651
  i = n.partitionKeyLength;
652
652
  break;
653
- case q:
654
- case le:
653
+ case z:
654
+ case ce:
655
655
  i = n.superPartitionKeyLength + n.partitionKeyLength;
656
656
  break;
657
657
  }
658
658
  switch (e) {
659
- case oe:
659
+ case le:
660
660
  case H:
661
- case B:
662
- for (let s of t.listInputFields()) {
663
- e === B && (s = ye(s).baseKey);
664
- const o = [...JSON.parse(s)];
665
- r.push(o);
661
+ case J:
662
+ for (let o of t.listInputFields()) {
663
+ e === J && (o = ve(o).baseKey);
664
+ const s = [...JSON.parse(o)];
665
+ r.push(s);
666
666
  }
667
667
  break;
668
- case ae:
669
- case q:
670
- case le:
671
- for (const s of t.listInputFields()) {
672
- const o = [...JSON.parse(s)], a = t.resolve({ field: s, assertFieldType: "Input" });
668
+ case ue:
669
+ case z:
670
+ case ce:
671
+ for (const o of t.listInputFields()) {
672
+ const s = [...JSON.parse(o)], a = t.resolve({ field: o, assertFieldType: "Input" });
673
673
  if (a !== void 0)
674
674
  for (let l of a.listInputFields()) {
675
- e === q && (l = ye(l).baseKey);
676
- const u = [...o, ...JSON.parse(l)];
675
+ e === z && (l = ve(l).baseKey);
676
+ const u = [...s, ...JSON.parse(l)];
677
677
  r.push(u);
678
678
  }
679
679
  }
@@ -681,60 +681,60 @@ function Lt(t) {
681
681
  }
682
682
  return { data: r, keyLength: i };
683
683
  }
684
- function Ft(t) {
684
+ function Rt(t) {
685
685
  if (t.type !== "JsonPartitioned" && t.type !== "BinaryPartitioned")
686
686
  throw new Error(`Splitting requires Partitioned DataInfoEntries, got ${t.type}`);
687
687
  const { parts: e, partitionKeyLength: n } = t, r = [];
688
688
  for (let i = 0; i < n; ++i)
689
689
  r.push(/* @__PURE__ */ new Set());
690
690
  for (const i of e) {
691
- const s = i.key;
692
- if (s.length !== n)
691
+ const o = i.key;
692
+ if (o.length !== n)
693
693
  throw new Error(
694
- `Key length (${s.length}) does not match partition length (${n}) for key: ${JSON.stringify(
695
- s
694
+ `Key length (${o.length}) does not match partition length (${n}) for key: ${JSON.stringify(
695
+ o
696
696
  )}`
697
697
  );
698
- for (let o = 0; o < n; ++o)
699
- r[o].add(s[o]);
698
+ for (let s = 0; s < n; ++s)
699
+ r[s].add(o[s]);
700
700
  }
701
701
  return r.map((i) => Array.from(i.values()));
702
702
  }
703
- function Et(t) {
703
+ function Nt(t) {
704
704
  if (t === void 0) return;
705
- if (Ne(t))
706
- return Ft(t);
707
- const e = Lt(t);
705
+ if (qe(t))
706
+ return Rt(t);
707
+ const e = Dt(t);
708
708
  if (!e) return;
709
709
  const { data: n, keyLength: r } = e, i = [];
710
- for (let s = 0; s < r; ++s)
710
+ for (let o = 0; o < r; ++o)
711
711
  i.push(/* @__PURE__ */ new Set());
712
- for (const s of n) {
713
- if (s.length !== r)
712
+ for (const o of n) {
713
+ if (o.length !== r)
714
714
  throw new Error("key length does not match partition length");
715
- for (let o = 0; o < r; ++o)
716
- i[o].add(s[o]);
715
+ for (let s = 0; s < r; ++s)
716
+ i[s].add(o[s]);
717
717
  }
718
- return i.map((s) => Array.from(s.values()));
718
+ return i.map((o) => Array.from(o.values()));
719
719
  }
720
- function be(t, e = []) {
720
+ function Ce(t, e = []) {
721
721
  if (t === void 0 || !t.getIsReadyOrError()) return;
722
722
  const n = t.resourceType.name, r = t.getDataAsJson();
723
- if (e.length > 0 && (n === le || n === q))
723
+ if (e.length > 0 && (n === ce || n === z))
724
724
  throw new Error(`Unexpected nested super-partitioned resource: ${n}`);
725
725
  switch (n) {
726
- case oe:
727
- case ae:
726
+ case le:
727
+ case ue:
728
728
  throw new Error(`Only data columns are supported, got: ${n}`);
729
729
  case H: {
730
730
  if (typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
731
731
  throw new Error(`Missing partitionKeyLength in metadata for ${n}`);
732
732
  const i = [];
733
- for (const s of t.listInputFields()) {
734
- const o = t.resolve({ field: s, assertFieldType: "Input" });
735
- if (o === void 0) return;
736
- const a = [...e, ...JSON.parse(s)];
737
- i.push({ key: a, value: o });
733
+ for (const o of t.listInputFields()) {
734
+ const s = t.resolve({ field: o, assertFieldType: "Input" });
735
+ if (s === void 0) return;
736
+ const a = [...e, ...JSON.parse(o)];
737
+ i.push({ key: a, value: s });
738
738
  }
739
739
  return {
740
740
  type: "JsonPartitioned",
@@ -742,19 +742,19 @@ function be(t, e = []) {
742
742
  parts: i
743
743
  };
744
744
  }
745
- case B: {
745
+ case J: {
746
746
  if (typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
747
747
  throw new Error(`Missing partitionKeyLength in metadata for ${n}`);
748
- const i = [], s = /* @__PURE__ */ new Map();
749
- for (const o of t.listInputFields()) {
750
- const a = ye(o), l = t.resolve({ field: o, assertFieldType: "Input" });
748
+ const i = [], o = /* @__PURE__ */ new Map();
749
+ for (const s of t.listInputFields()) {
750
+ const a = ve(s), l = t.resolve({ field: s, assertFieldType: "Input" });
751
751
  if (l === void 0) return;
752
- let u = s.get(a.baseKey);
753
- u || (u = {}, s.set(a.baseKey, u)), a.type === "index" ? u.index = l : u.values = l;
752
+ let u = o.get(a.baseKey);
753
+ u || (u = {}, o.set(a.baseKey, u)), a.type === "index" ? u.index = l : u.values = l;
754
754
  }
755
- for (const [o, a] of s.entries()) {
755
+ for (const [s, a] of o.entries()) {
756
756
  if (!a.index || !a.values) return;
757
- const l = [...e, ...JSON.parse(o)];
757
+ const l = [...e, ...JSON.parse(s)];
758
758
  i.push({
759
759
  key: l,
760
760
  value: {
@@ -769,127 +769,127 @@ function be(t, e = []) {
769
769
  parts: i
770
770
  };
771
771
  }
772
- case le: {
772
+ case ce: {
773
773
  if (typeof (r == null ? void 0 : r.superPartitionKeyLength) != "number" || typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
774
774
  throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n}`);
775
- const i = r.superPartitionKeyLength + r.partitionKeyLength, s = [];
776
- for (const o of t.listInputFields()) {
777
- const a = t.resolve({ field: o, assertFieldType: "Input" });
775
+ const i = r.superPartitionKeyLength + r.partitionKeyLength, o = [];
776
+ for (const s of t.listInputFields()) {
777
+ const a = t.resolve({ field: s, assertFieldType: "Input" });
778
778
  if (a === void 0) return;
779
779
  if (a.resourceType.name !== H)
780
780
  throw new Error(`Expected ${H} inside ${n}, but got ${a.resourceType.name}`);
781
- const l = be(a, JSON.parse(o));
781
+ const l = Ce(a, JSON.parse(s));
782
782
  if (l === void 0) return;
783
783
  if (l.type !== "JsonPartitioned")
784
784
  throw new Error(`Unexpected inner result type for ${n}: ${l.type}`);
785
- s.push(...l.parts);
785
+ o.push(...l.parts);
786
786
  }
787
787
  return {
788
788
  type: "JsonPartitioned",
789
789
  partitionKeyLength: i,
790
- parts: s
790
+ parts: o
791
791
  };
792
792
  }
793
- case q: {
793
+ case z: {
794
794
  if (typeof (r == null ? void 0 : r.superPartitionKeyLength) != "number" || typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
795
795
  throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n}`);
796
- const i = r.superPartitionKeyLength + r.partitionKeyLength, s = [];
797
- for (const o of t.listInputFields()) {
798
- const a = t.resolve({ field: o, assertFieldType: "Input" });
796
+ const i = r.superPartitionKeyLength + r.partitionKeyLength, o = [];
797
+ for (const s of t.listInputFields()) {
798
+ const a = t.resolve({ field: s, assertFieldType: "Input" });
799
799
  if (a === void 0) return;
800
- if (a.resourceType.name !== B)
801
- throw new Error(`Expected ${B} inside ${n}, but got ${a.resourceType.name}`);
802
- const l = be(a, JSON.parse(o));
800
+ if (a.resourceType.name !== J)
801
+ throw new Error(`Expected ${J} inside ${n}, but got ${a.resourceType.name}`);
802
+ const l = Ce(a, JSON.parse(s));
803
803
  if (l === void 0) return;
804
804
  if (l.type !== "BinaryPartitioned")
805
805
  throw new Error(`Unexpected inner result type for ${n}: ${l.type}`);
806
- s.push(...l.parts);
806
+ o.push(...l.parts);
807
807
  }
808
808
  return {
809
809
  type: "BinaryPartitioned",
810
810
  partitionKeyLength: i,
811
- parts: s
811
+ parts: o
812
812
  };
813
813
  }
814
814
  default:
815
815
  throw new Error(`Unknown resource type: ${n}`);
816
816
  }
817
817
  }
818
- function kt(t) {
818
+ function Ut(t) {
819
819
  if (t !== void 0) {
820
- if (Ne(t)) return t;
821
- if (ue(t)) return et(t);
822
- if (t instanceof R) return be(t);
820
+ if (qe(t)) return t;
821
+ if (pe(t)) return st(t);
822
+ if (t instanceof O) return Ce(t);
823
823
  throw new Error(`Unexpected input type: ${typeof t}`);
824
824
  }
825
825
  }
826
- function Dt(t, e) {
827
- const n = [...e].sort((s, o) => o[0] - s[0]);
826
+ function Kt(t, e) {
827
+ const n = [...e].sort((o, s) => s[0] - o[0]);
828
828
  if (t.type === "JsonPartitioned" || t.type === "BinaryPartitioned") {
829
- const { partitionKeyLength: s } = t;
830
- for (const [o] of e)
831
- if (o >= s)
832
- throw new Error(`Can't filter on non-partitioned axis ${o}. Must be >= ${s}`);
829
+ const { partitionKeyLength: o } = t;
830
+ for (const [s] of e)
831
+ if (s >= o)
832
+ throw new Error(`Can't filter on non-partitioned axis ${s}. Must be >= ${o}`);
833
833
  } else if (t.type === "Json") {
834
- const { keyLength: s } = t;
835
- for (const [o] of e)
836
- if (o >= s)
837
- throw new Error(`Can't filter on non-data axis ${o}. Must be >= ${s}`);
838
- }
839
- const r = (s) => {
840
- for (const [o, a] of n)
841
- if (s[o] !== a)
834
+ const { keyLength: o } = t;
835
+ for (const [s] of e)
836
+ if (s >= o)
837
+ throw new Error(`Can't filter on non-data axis ${s}. Must be >= ${o}`);
838
+ }
839
+ const r = (o) => {
840
+ for (const [s, a] of n)
841
+ if (o[s] !== a)
842
842
  return !1;
843
843
  return !0;
844
- }, i = (s) => {
845
- const o = [...s];
844
+ }, i = (o) => {
845
+ const s = [...o];
846
846
  for (const [a] of n)
847
- o.splice(a, 1);
848
- return o;
847
+ s.splice(a, 1);
848
+ return s;
849
849
  };
850
850
  switch (t.type) {
851
851
  case "Json": {
852
- const s = t.data.filter((o) => r(o.key)).map((o) => ({
853
- key: i(o.key),
854
- value: o.value
852
+ const o = t.data.filter((s) => r(s.key)).map((s) => ({
853
+ key: i(s.key),
854
+ value: s.value
855
855
  }));
856
856
  return {
857
857
  type: "Json",
858
858
  keyLength: t.keyLength - e.length,
859
- data: s
859
+ data: o
860
860
  };
861
861
  }
862
862
  case "JsonPartitioned": {
863
- const s = t.parts.filter((o) => r(o.key)).map((o) => ({
864
- key: i(o.key),
865
- value: o.value
863
+ const o = t.parts.filter((s) => r(s.key)).map((s) => ({
864
+ key: i(s.key),
865
+ value: s.value
866
866
  }));
867
867
  return {
868
868
  type: "JsonPartitioned",
869
869
  partitionKeyLength: t.partitionKeyLength - e.length,
870
- parts: s
870
+ parts: o
871
871
  };
872
872
  }
873
873
  case "BinaryPartitioned": {
874
- const s = t.parts.filter((o) => r(o.key)).map((o) => ({
875
- key: i(o.key),
876
- value: o.value
874
+ const o = t.parts.filter((s) => r(s.key)).map((s) => ({
875
+ key: i(s.key),
876
+ value: s.value
877
877
  }));
878
878
  return {
879
879
  type: "BinaryPartitioned",
880
880
  partitionKeyLength: t.partitionKeyLength - e.length,
881
- parts: s
881
+ parts: o
882
882
  };
883
883
  }
884
884
  }
885
885
  }
886
- function Rt(t) {
886
+ function Mt(t) {
887
887
  if (!Array.isArray(t)) return !1;
888
888
  if (t.length === 0) return !0;
889
889
  const e = t[0];
890
890
  return typeof e == "object" && e !== null && "key" in e && "val" in e;
891
891
  }
892
- class Ot {
892
+ class jt {
893
893
  constructor(e) {
894
894
  this.columns = e;
895
895
  }
@@ -898,30 +898,30 @@ class Ot {
898
898
  return this.columns.filter((r) => n(r.spec));
899
899
  }
900
900
  }
901
- function Kt(t) {
901
+ function qt(t) {
902
902
  if (t)
903
903
  return t.map((e) => ({
904
- type: `split:${it(e.axisId)}`,
904
+ type: `split:${ct(e.axisId)}`,
905
905
  label: e.label,
906
906
  importance: 1e6
907
907
  // High importance for split filters in labels
908
908
  }));
909
909
  }
910
- function Nt(t) {
910
+ function Bt(t) {
911
911
  if (t)
912
912
  return t.map((e) => [e.axisIdx, e.value]);
913
913
  }
914
- function Vt(t, e) {
914
+ function Jt(t, e) {
915
915
  if (!e || e.length === 0) return t;
916
916
  const n = [...e].sort((r, i) => r[0] - i[0]);
917
- return Ve({ id: t, axisFilters: n });
917
+ return Be({ id: t, axisFilters: n });
918
918
  }
919
- function Te(t) {
919
+ function Ve(t) {
920
920
  if (!t || typeof t != "object") return !1;
921
921
  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);
922
922
  return !!e.domainAnchor || n || r;
923
923
  }
924
- function Mt(t) {
924
+ function $t(t) {
925
925
  if (typeof t != "object" || !("axes" in t) || t.axes === void 0)
926
926
  return [];
927
927
  const e = t.axes.map((n, r) => typeof n == "object" && "split" in n && n.split === !0 ? r : -1).filter((n) => n !== -1);
@@ -929,11 +929,11 @@ function Mt(t) {
929
929
  throw new Error("Axis splitting is not supported when `partialAxesMatch` is defined.");
930
930
  return e.sort((n, r) => n - r), e;
931
931
  }
932
- class X {
932
+ class Q {
933
933
  constructor() {
934
- k(this, "defaultProviderStore", []);
935
- k(this, "providers", [new Ot(this.defaultProviderStore)]);
936
- k(this, "axisLabelProviders", []);
934
+ V(this, "defaultProviderStore", []);
935
+ V(this, "providers", [new jt(this.defaultProviderStore)]);
936
+ V(this, "axisLabelProviders", []);
937
937
  }
938
938
  addColumnProvider(e) {
939
939
  return this.providers.push(e), this;
@@ -955,94 +955,94 @@ class X {
955
955
  }
956
956
  }
957
957
  getUniversalEntries(e, n) {
958
- const { anchorCtx: r, labelOps: i, dontWaitAllData: s = !1, overrideLabelAnnotation: o = !1, exclude: a } = n ?? {}, l = {
959
- ...o && (i == null ? void 0 : i.includeNativeLabel) !== !1 ? { includeNativeLabel: !0 } : {},
958
+ const { anchorCtx: r, labelOps: i, dontWaitAllData: o = !1, overrideLabelAnnotation: s = !1, exclude: a } = n ?? {}, l = {
959
+ ...s && (i == null ? void 0 : i.includeNativeLabel) !== !1 ? { includeNativeLabel: !0 } : {},
960
960
  ...i ?? {}
961
961
  };
962
962
  let u = () => !1;
963
963
  if (a) {
964
- const p = (Array.isArray(a) ? a : [a]).map((m) => {
965
- if (Te(m)) {
964
+ const p = (Array.isArray(a) ? a : [a]).map((y) => {
965
+ if (Ve(y)) {
966
966
  if (!r)
967
967
  throw new Error("Anchored selectors in exclude require an AnchoredIdDeriver to be provided in options.");
968
- return Y(we(r.anchors, m, n));
968
+ return Y(xe(r.anchors, y, n));
969
969
  } else
970
- return Y(m);
970
+ return Y(y);
971
971
  });
972
- u = (m) => p.some((C) => C(m));
972
+ u = (y) => p.some((C) => C(y));
973
973
  }
974
- const h = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], f = [], g = /* @__PURE__ */ new Set();
974
+ const h = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], f = [], m = /* @__PURE__ */ new Set();
975
975
  for (const p of h) {
976
- const m = Te(p);
976
+ const y = Ve(p);
977
977
  let C;
978
- if (m) {
978
+ if (y) {
979
979
  if (!r)
980
980
  throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");
981
- C = we(r.anchors, p, n);
981
+ C = xe(r.anchors, p, n);
982
982
  } else
983
983
  C = p;
984
- const E = /* @__PURE__ */ new Set(), _ = [];
985
- for (const S of this.providers) {
986
- const I = S.selectColumns(C);
987
- for (const c of I) {
984
+ const E = /* @__PURE__ */ new Set(), x = [];
985
+ for (const T of this.providers) {
986
+ const F = T.selectColumns(C);
987
+ for (const c of F) {
988
988
  if (u(c.spec)) continue;
989
989
  if (E.has(c.id))
990
- throw new Error(`Duplicate column id ${c.id} in provider ${S.constructor.name}`);
991
- const b = tt(c.spec);
992
- g.has(b) || (E.add(c.id), g.add(b), _.push(c));
990
+ throw new Error(`Duplicate column id ${c.id} in provider ${T.constructor.name}`);
991
+ const v = at(c.spec);
992
+ m.has(v) || (E.add(c.id), m.add(v), x.push(c));
993
993
  }
994
994
  }
995
- if (_.length === 0) continue;
996
- const w = Mt(p), A = w.length > 0;
997
- for (const S of _) {
998
- if (!re(S.spec)) continue;
999
- const I = S.spec;
1000
- if (A) {
1001
- if (Rt(S.data))
1002
- throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${S.id}`);
1003
- const c = kt(S.data);
995
+ if (x.length === 0) continue;
996
+ const S = $t(p), P = S.length > 0;
997
+ for (const T of x) {
998
+ if (!oe(T.spec)) continue;
999
+ const F = T.spec;
1000
+ if (P) {
1001
+ if (Mt(T.data))
1002
+ throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${T.id}`);
1003
+ const c = Ut(T.data);
1004
1004
  if (!c) {
1005
- if (s) continue;
1005
+ if (o) continue;
1006
1006
  return;
1007
1007
  }
1008
- if (!nt(c))
1009
- throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${c.type} for column ${S.id}`);
1010
- const b = Et(c), T = w[w.length - 1];
1011
- if (T >= c.partitionKeyLength)
1012
- throw new Error(`Not enough partition keys (${c.partitionKeyLength}) for requested split axes (max index ${T}) in column ${I.name}`);
1013
- const U = w.map((L) => this.findLabels(D(I.axesSpec[L]))), V = [], j = (L, W) => {
1014
- if (W >= w.length) {
1015
- if (V.push([...L]), V.length > 1e4)
1008
+ if (!lt(c))
1009
+ throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${c.type} for column ${T.id}`);
1010
+ const v = Nt(c), I = S[S.length - 1];
1011
+ if (I >= c.partitionKeyLength)
1012
+ throw new Error(`Not enough partition keys (${c.partitionKeyLength}) for requested split axes (max index ${I}) in column ${F.name}`);
1013
+ const $ = S.map((_) => this.findLabels(k(F.axesSpec[_]))), K = [], j = (_, W) => {
1014
+ if (W >= S.length) {
1015
+ if (K.push([..._]), K.length > 1e4)
1016
1016
  throw new Error("Too many key combinations, aborting.");
1017
1017
  return;
1018
1018
  }
1019
- const M = w[W];
1020
- if (M >= b.length)
1021
- throw new Error(`Axis index ${M} out of bounds for unique keys array (length ${b.length}) during split key generation for column ${S.id}`);
1022
- const J = b[M];
1023
- if (!J || J.length === 0) {
1024
- V.length = 0;
1019
+ const M = S[W];
1020
+ if (M >= v.length)
1021
+ throw new Error(`Axis index ${M} out of bounds for unique keys array (length ${v.length}) during split key generation for column ${T.id}`);
1022
+ const q = v[M];
1023
+ if (!q || q.length === 0) {
1024
+ K.length = 0;
1025
1025
  return;
1026
1026
  }
1027
- for (const ee of J)
1028
- L.push(ee), j(L, W + 1), L.pop();
1027
+ for (const te of q)
1028
+ _.push(te), j(_, W + 1), _.pop();
1029
1029
  };
1030
- if (j([], 0), V.length === 0)
1030
+ if (j([], 0), K.length === 0)
1031
1031
  continue;
1032
- const K = [...I.axesSpec], qe = w.map((L) => L);
1033
- for (let L = w.length - 1; L >= 0; L--)
1034
- K.splice(w[L], 1);
1035
- const ze = { ...I, axesSpec: K };
1036
- for (const L of V) {
1037
- const W = L.map((M, J) => {
1038
- const ee = qe[J], Ye = D(I.axesSpec[ee]), ce = U[J], Xe = (ce == null ? void 0 : ce[M]) ?? String(M);
1039
- return { axisIdx: ee, axisId: Ye, value: M, label: Xe };
1032
+ const N = [...F.axesSpec], et = S.map((_) => _);
1033
+ for (let _ = S.length - 1; _ >= 0; _--)
1034
+ N.splice(S[_], 1);
1035
+ const tt = { ...F, axesSpec: N };
1036
+ for (const _ of K) {
1037
+ const W = _.map((M, q) => {
1038
+ const te = et[q], nt = k(F.axesSpec[te]), de = $[q], rt = (de == null ? void 0 : de[M]) ?? String(M);
1039
+ return { axisIdx: te, axisId: nt, value: M, label: rt };
1040
1040
  });
1041
1041
  f.push({
1042
1042
  type: "split",
1043
- originalColumn: S,
1044
- spec: I,
1045
- adjustedSpec: ze,
1043
+ originalColumn: T,
1044
+ spec: F,
1045
+ adjustedSpec: tt,
1046
1046
  dataEntries: c,
1047
1047
  axisFilters: W
1048
1048
  });
@@ -1050,40 +1050,40 @@ class X {
1050
1050
  } else
1051
1051
  f.push({
1052
1052
  type: "direct",
1053
- originalColumn: S,
1054
- spec: I,
1055
- adjustedSpec: I
1053
+ originalColumn: T,
1054
+ spec: F,
1055
+ adjustedSpec: F
1056
1056
  });
1057
1057
  }
1058
1058
  }
1059
1059
  if (f.length === 0) return [];
1060
- const d = Ue(
1060
+ const d = ze(
1061
1061
  f,
1062
1062
  (p) => ({
1063
1063
  spec: p.spec,
1064
- suffixTrace: p.type === "split" ? Kt(p.axisFilters) : void 0
1064
+ suffixTrace: p.type === "split" ? qt(p.axisFilters) : void 0
1065
1065
  }),
1066
1066
  l
1067
- ), y = [];
1068
- for (const { value: p, label: m } of d) {
1069
- const { originalColumn: C, spec: E } = p, _ = p.type === "split" ? p.axisFilters : void 0, w = Nt(_);
1070
- let A;
1071
- r ? A = r.deriveS(E, w) : A = Vt(C.id, w);
1072
- let S = { ...p.adjustedSpec };
1073
- o && (S = {
1074
- ...S,
1067
+ ), g = [];
1068
+ for (const { value: p, label: y } of d) {
1069
+ const { originalColumn: C, spec: E } = p, x = p.type === "split" ? p.axisFilters : void 0, S = Bt(x);
1070
+ let P;
1071
+ r ? P = r.deriveS(E, S) : P = Jt(C.id, S);
1072
+ let T = { ...p.adjustedSpec };
1073
+ s && (T = {
1074
+ ...T,
1075
1075
  annotations: {
1076
- ...S.annotations ?? {},
1077
- "pl7.app/label": m
1076
+ ...T.annotations ?? {},
1077
+ "pl7.app/label": y
1078
1078
  }
1079
- }), y.push({
1080
- id: A,
1081
- spec: S,
1082
- data: () => p.type === "split" ? rt(Dt(p.dataEntries, w)) : p.originalColumn.data,
1083
- label: m
1079
+ }), g.push({
1080
+ id: P,
1081
+ spec: T,
1082
+ data: () => p.type === "split" ? ut(Kt(p.dataEntries, S)) : p.originalColumn.data,
1083
+ label: y
1084
1084
  });
1085
1085
  }
1086
- return y;
1086
+ return g;
1087
1087
  }
1088
1088
  getColumns(e, n) {
1089
1089
  const r = this.getUniversalEntries(e, {
@@ -1093,67 +1093,67 @@ class X {
1093
1093
  });
1094
1094
  if (!r) return;
1095
1095
  const i = [];
1096
- for (const s of r) {
1097
- const o = s.data();
1098
- if (!o) {
1096
+ for (const o of r) {
1097
+ const s = o.data();
1098
+ if (!s) {
1099
1099
  if (n != null && n.dontWaitAllData) continue;
1100
1100
  return;
1101
1101
  }
1102
1102
  i.push({
1103
- id: s.id,
1104
- spec: s.spec,
1105
- data: o
1103
+ id: o.id,
1104
+ spec: o.spec,
1105
+ data: s
1106
1106
  });
1107
1107
  }
1108
1108
  return i;
1109
1109
  }
1110
1110
  }
1111
- function ve(t) {
1111
+ function Te(t) {
1112
1112
  const e = (i) => i.operator !== "InSet" ? i : {
1113
1113
  operator: "Or",
1114
- operands: i.references.map((s) => ({
1114
+ operands: i.references.map((o) => ({
1115
1115
  operator: "Equal",
1116
- reference: s
1116
+ reference: o
1117
1117
  }))
1118
- }, n = (i, s) => {
1118
+ }, n = (i, o) => {
1119
1119
  switch (i.operator) {
1120
1120
  case "And":
1121
1121
  return {
1122
1122
  ...i,
1123
- operands: i.operands.map((a) => n(a, s))
1123
+ operands: i.operands.map((a) => n(a, o))
1124
1124
  };
1125
1125
  case "Or":
1126
1126
  return {
1127
1127
  ...i,
1128
- operands: i.operands.map((a) => n(a, s))
1128
+ operands: i.operands.map((a) => n(a, o))
1129
1129
  };
1130
1130
  case "Not":
1131
1131
  return {
1132
1132
  ...i,
1133
- operand: n(i.operand, s)
1133
+ operand: n(i.operand, o)
1134
1134
  };
1135
1135
  default:
1136
- return s(i);
1136
+ return o(i);
1137
1137
  }
1138
- }, r = (i, s) => ({
1138
+ }, r = (i, o) => ({
1139
1139
  ...i,
1140
- predicate: n(i.predicate, s)
1140
+ predicate: n(i.predicate, o)
1141
1141
  });
1142
1142
  return t.map((i) => r(i, e));
1143
1143
  }
1144
- function de(t, e) {
1144
+ function he(t, e) {
1145
1145
  if (t === void 0) return e === void 0;
1146
1146
  if (e === void 0) return !0;
1147
1147
  for (const n in e)
1148
1148
  if (t[n] !== e[n]) return !1;
1149
1149
  return !0;
1150
1150
  }
1151
- function Le(t) {
1152
- return Se(t, (e) => e instanceof R ? e.handle : ue(e) ? ct(e, (n) => n.handle) : e);
1151
+ function ke(t) {
1152
+ return Ae(t, (e) => e instanceof O ? e.handle : pe(e) ? yt(e, (n) => n.handle) : e);
1153
1153
  }
1154
- class jt {
1154
+ class Wt {
1155
1155
  constructor() {
1156
- k(this, "ctx", v());
1156
+ V(this, "ctx", b());
1157
1157
  }
1158
1158
  /**
1159
1159
  * @deprecated use getOptions()
@@ -1163,27 +1163,27 @@ class jt {
1163
1163
  }
1164
1164
  getOptions(e, n) {
1165
1165
  const r = typeof e == "function" ? e : Y(e), i = this.getSpecs().entries.filter((a) => r(a.obj));
1166
- let s = {}, o = !1;
1167
- 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" ? Ue(i, (a) => a.obj, s ?? {}).map(({ value: { ref: a }, label: l }) => ({
1168
- ref: Ae(a, o),
1166
+ let o = {}, s = !1;
1167
+ return typeof n < "u" && (typeof n == "function" ? o = n : typeof n == "object" && ("includeNativeLabel" in n || "separator" in n || "addLabelAsSuffix" in n ? o = n : (n = n, o = n.label ?? {}, s = n.refsWithEnrichments ?? !1))), typeof o == "object" ? ze(i, (a) => a.obj, o ?? {}).map(({ value: { ref: a }, label: l }) => ({
1168
+ ref: Fe(a, s),
1169
1169
  label: l
1170
1170
  })) : i.map(({ ref: a, obj: l }) => ({
1171
- ref: Ae(a, o),
1172
- label: s(l, a)
1171
+ ref: Fe(a, s),
1172
+ label: o(l, a)
1173
1173
  }));
1174
1174
  }
1175
1175
  resolveAnchorCtx(e) {
1176
- if (e instanceof Pe) return e;
1176
+ if (e instanceof Ie) return e;
1177
1177
  const n = {};
1178
1178
  for (const [r, i] of Object.entries(e))
1179
- if (st(i)) {
1180
- const s = this.getPColumnSpecByRef(i);
1181
- if (!s)
1179
+ if (pt(i)) {
1180
+ const o = this.getPColumnSpecByRef(i);
1181
+ if (!o)
1182
1182
  return;
1183
- n[r] = s;
1183
+ n[r] = o;
1184
1184
  } else
1185
1185
  n[r] = i;
1186
- return new Pe(n);
1186
+ return new Ie(n);
1187
1187
  }
1188
1188
  /**
1189
1189
  * Returns columns that match the provided anchors and selectors. It applies axis filters and label derivation.
@@ -1196,7 +1196,7 @@ class jt {
1196
1196
  getAnchoredPColumns(e, n, r) {
1197
1197
  const i = this.resolveAnchorCtx(e);
1198
1198
  if (i)
1199
- return new X().addColumnProvider(this).addAxisLabelProvider(this).getColumns(n, {
1199
+ return new Q().addColumnProvider(this).addAxisLabelProvider(this).getColumns(n, {
1200
1200
  ...r,
1201
1201
  anchorCtx: i
1202
1202
  });
@@ -1233,14 +1233,14 @@ class jt {
1233
1233
  getCanonicalOptions(e, n, r) {
1234
1234
  const i = this.resolveAnchorCtx(e);
1235
1235
  if (!i) return;
1236
- const s = new X().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(n, {
1236
+ const o = new Q().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(n, {
1237
1237
  ...r,
1238
1238
  anchorCtx: i
1239
1239
  });
1240
- if (s)
1241
- return s.map((o) => ({
1242
- value: o.id,
1243
- label: o.label
1240
+ if (o)
1241
+ return o.map((s) => ({
1242
+ value: s.id,
1243
+ label: s.label
1244
1244
  }));
1245
1245
  }
1246
1246
  /**
@@ -1257,7 +1257,7 @@ class jt {
1257
1257
  ref: n.ref,
1258
1258
  obj: {
1259
1259
  ...n.obj,
1260
- data: new R(n.obj.data, [n.ref.blockId, n.ref.name])
1260
+ data: new O(n.obj.data, [n.ref.blockId, n.ref.name])
1261
1261
  }
1262
1262
  }))
1263
1263
  };
@@ -1276,9 +1276,9 @@ class jt {
1276
1276
  ref: n.ref,
1277
1277
  obj: {
1278
1278
  ...n.obj,
1279
- data: ot(
1279
+ data: dt(
1280
1280
  n.obj.data,
1281
- (r) => new R(r, [n.ref.blockId, n.ref.name])
1281
+ (r) => new O(r, [n.ref.blockId, n.ref.name])
1282
1282
  )
1283
1283
  }
1284
1284
  }))
@@ -1305,9 +1305,9 @@ class jt {
1305
1305
  )) == null ? void 0 : r.obj;
1306
1306
  const n = this.ctx.getDataFromResultPoolByRef(e.blockId, e.name);
1307
1307
  if (n)
1308
- return Se(
1308
+ return Ae(
1309
1309
  n,
1310
- (i) => new R(i, [e.blockId, e.name])
1310
+ (i) => new O(i, [e.blockId, e.name])
1311
1311
  );
1312
1312
  }
1313
1313
  /**
@@ -1318,7 +1318,7 @@ class jt {
1318
1318
  getPColumnByRef(e) {
1319
1319
  const n = this.getDataByRef(e);
1320
1320
  if (n)
1321
- return at(n);
1321
+ return ft(n);
1322
1322
  }
1323
1323
  /**
1324
1324
  * Returns spec associated with the ref ensuring that it is a p-column spec.
@@ -1328,7 +1328,7 @@ class jt {
1328
1328
  getPColumnSpecByRef(e) {
1329
1329
  const n = this.getSpecByRef(e);
1330
1330
  if (n) {
1331
- if (!re(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
1331
+ if (!oe(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
1332
1332
  return n;
1333
1333
  }
1334
1334
  }
@@ -1347,13 +1347,13 @@ class jt {
1347
1347
  findDataWithCompatibleSpec(e) {
1348
1348
  const n = [];
1349
1349
  e: for (const r of this.getData().entries) {
1350
- if (!re(r.obj.spec))
1350
+ if (!oe(r.obj.spec))
1351
1351
  continue;
1352
1352
  const i = r.obj.spec;
1353
- if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && de(e.domain, i.domain)) {
1354
- for (let s = 0; s < e.axesSpec.length; ++s) {
1355
- const o = e.axesSpec[s], a = i.axesSpec[s];
1356
- if (o.name !== a.name || o.type !== a.type || !de(o.domain, a.domain))
1353
+ if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && he(e.domain, i.domain)) {
1354
+ for (let o = 0; o < e.axesSpec.length; ++o) {
1355
+ const s = e.axesSpec[o], a = i.axesSpec[o];
1356
+ if (s.name !== a.name || s.type !== a.type || !he(s.domain, a.domain))
1357
1357
  continue e;
1358
1358
  }
1359
1359
  n.push(r.obj);
@@ -1368,15 +1368,15 @@ class jt {
1368
1368
  findLabels(e) {
1369
1369
  const n = this.getData();
1370
1370
  for (const r of n.entries) {
1371
- if (!Ke(r.obj)) continue;
1371
+ if (!je(r.obj)) continue;
1372
1372
  const i = r.obj.spec;
1373
- 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)) {
1373
+ if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type && he(e.domain, i.axesSpec[0].domain)) {
1374
1374
  if (r.obj.data.resourceType.name !== "PColumnData/Json")
1375
1375
  throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
1376
1376
  return Object.fromEntries(
1377
1377
  Object.entries(
1378
1378
  r.obj.data.getDataAsJson().data
1379
- ).map((o) => [JSON.parse(o[0])[0], o[1]])
1379
+ ).map((s) => [JSON.parse(s[0])[0], s[1]])
1380
1380
  );
1381
1381
  }
1382
1382
  }
@@ -1390,13 +1390,13 @@ class jt {
1390
1390
  */
1391
1391
  selectColumns(e) {
1392
1392
  const n = typeof e == "function" ? e : Y(e);
1393
- return this.getSpecs().entries.filter(({ obj: i }) => re(i) ? n(i) : !1).map(({ ref: i, obj: s }) => {
1394
- const o = s;
1393
+ return this.getSpecs().entries.filter(({ obj: i }) => oe(i) ? n(i) : !1).map(({ ref: i, obj: o }) => {
1394
+ const s = o;
1395
1395
  let a = null;
1396
1396
  const l = this;
1397
1397
  return {
1398
- id: Ve(i),
1399
- spec: o,
1398
+ id: Be(i),
1399
+ spec: s,
1400
1400
  get data() {
1401
1401
  var u;
1402
1402
  return a !== null || (a = (u = l.getPColumnByRef(i)) == null ? void 0 : u.data), a;
@@ -1409,26 +1409,26 @@ class jt {
1409
1409
  * @returns a map of axis value => label
1410
1410
  */
1411
1411
  findLabelsForColumnAxis(e, n) {
1412
- var s;
1412
+ var o;
1413
1413
  const r = this.findLabels(e.axesSpec[n]);
1414
1414
  if (!r) return;
1415
- const i = (s = e.annotations) == null ? void 0 : s["pl7.app/axisKeys/" + n];
1415
+ const i = (o = e.annotations) == null ? void 0 : o["pl7.app/axisKeys/" + n];
1416
1416
  if (i !== void 0) {
1417
- const o = JSON.parse(i);
1418
- return Object.fromEntries(o.map((a) => [a, r[a] ?? "Unlabelled"]));
1417
+ const s = JSON.parse(i);
1418
+ return Object.fromEntries(s.map((a) => [a, r[a] ?? "Unlabelled"]));
1419
1419
  } else
1420
1420
  return r;
1421
1421
  }
1422
1422
  }
1423
- class te {
1423
+ class ne {
1424
1424
  constructor() {
1425
- k(this, "ctx");
1426
- k(this, "_argsCache");
1427
- k(this, "_uiStateCache");
1425
+ V(this, "ctx");
1426
+ V(this, "_argsCache");
1427
+ V(this, "_uiStateCache");
1428
1428
  // lazy rendering because this feature is rarely used
1429
- k(this, "_activeArgsCache");
1430
- k(this, "resultPool", new jt());
1431
- this.ctx = v();
1429
+ V(this, "_activeArgsCache");
1430
+ V(this, "resultPool", new Wt());
1431
+ this.ctx = b();
1432
1432
  }
1433
1433
  get args() {
1434
1434
  if (this._argsCache === void 0) {
@@ -1464,14 +1464,14 @@ class te {
1464
1464
  getNamedAccessor(e) {
1465
1465
  return ge(
1466
1466
  this.ctx.getAccessorHandleByName(e),
1467
- (n) => new R(n, [e])
1467
+ (n) => new O(n, [e])
1468
1468
  );
1469
1469
  }
1470
1470
  get prerun() {
1471
- return this.getNamedAccessor(Je);
1471
+ return this.getNamedAccessor(We);
1472
1472
  }
1473
1473
  get outputs() {
1474
- return this.getNamedAccessor($e);
1474
+ return this.getNamedAccessor(Ge);
1475
1475
  }
1476
1476
  /**
1477
1477
  * Find labels data for a given axis id. It will search for a label column and return its data as a map.
@@ -1483,7 +1483,7 @@ class te {
1483
1483
  }
1484
1484
  verifyInlineAndExplicitColumnsSupport(e) {
1485
1485
  var i;
1486
- const n = e.some((s) => !(s.data instanceof R) || ue(s.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
1486
+ const n = e.some((o) => !(o.data instanceof O) || pe(o.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
1487
1487
  if (n && !r) throw Error("Inline or explicit columns not supported");
1488
1488
  }
1489
1489
  patchPTableDef(e) {
@@ -1494,14 +1494,14 @@ class te {
1494
1494
  filters: [...e.partitionFilters, ...e.filters]
1495
1495
  }), (r = this.ctx.featureFlags) != null && r.pFrameInSetFilterSupport || (e = {
1496
1496
  ...e,
1497
- partitionFilters: ve(e.partitionFilters),
1498
- filters: ve(e.filters)
1497
+ partitionFilters: Te(e.partitionFilters),
1498
+ filters: Te(e.filters)
1499
1499
  }), e;
1500
1500
  }
1501
1501
  // TODO remove all non-PColumn fields
1502
1502
  createPFrame(e) {
1503
1503
  return this.verifyInlineAndExplicitColumnsSupport(e), this.ctx.createPFrame(
1504
- e.map((n) => Le(n))
1504
+ e.map((n) => ke(n))
1505
1505
  );
1506
1506
  }
1507
1507
  createPTable(e) {
@@ -1514,8 +1514,8 @@ class te {
1514
1514
  partitionFilters: e.filters ?? [],
1515
1515
  filters: [],
1516
1516
  sorting: e.sorting ?? []
1517
- }) : n = this.patchPTableDef(e), this.verifyInlineAndExplicitColumnsSupport(lt(n.src)), this.ctx.createPTable(
1518
- ut(n, (r) => Le(r))
1517
+ }) : n = this.patchPTableDef(e), this.verifyInlineAndExplicitColumnsSupport(ht(n.src)), this.ctx.createPTable(
1518
+ mt(n, (r) => ke(r))
1519
1519
  );
1520
1520
  }
1521
1521
  /** @deprecated scheduled for removal from SDK */
@@ -1535,38 +1535,38 @@ class te {
1535
1535
  this.ctx.logError(e);
1536
1536
  }
1537
1537
  }
1538
- const z = "1.40.1";
1539
- function Jt(t) {
1538
+ const X = "1.40.6";
1539
+ function Gt(t) {
1540
1540
  return t.__renderLambda === !0;
1541
1541
  }
1542
- function fe(t) {
1542
+ function me(t) {
1543
1543
  if (t !== void 0)
1544
- return Jt(t) ? t.handle : t;
1544
+ return Gt(t) ? t.handle : t;
1545
1545
  }
1546
- function jn(t) {
1547
- return pt(t);
1546
+ function Wn(t) {
1547
+ return gt(t);
1548
1548
  }
1549
- const x = class x {
1550
- constructor(e, n, r, i, s, o, a, l, u) {
1551
- this._renderingMode = e, this._initialArgs = n, this._initialUiState = r, this._outputs = i, this._inputsValid = s, this._sections = o, this._title = a, this._enrichmentTargets = l, this._featureFlags = u;
1549
+ const w = class w {
1550
+ constructor(e, n, r, i, o, s, a, l, u) {
1551
+ this._renderingMode = e, this._initialArgs = n, this._initialUiState = r, this._outputs = i, this._inputsValid = o, this._sections = s, this._title = a, this._enrichmentTargets = l, this._featureFlags = u;
1552
1552
  }
1553
1553
  static create(e = "Heavy") {
1554
- return new x(
1554
+ return new w(
1555
1555
  e,
1556
1556
  void 0,
1557
1557
  {},
1558
1558
  {},
1559
- ie(!0),
1560
- ie([]),
1559
+ se(!0),
1560
+ se([]),
1561
1561
  void 0,
1562
1562
  void 0,
1563
- { ...x.INITIAL_BLOCK_FEATURE_FLAGS }
1563
+ { ...w.INITIAL_BLOCK_FEATURE_FLAGS }
1564
1564
  );
1565
1565
  }
1566
1566
  output(e, n, r = {}) {
1567
1567
  if (typeof n == "function") {
1568
1568
  const i = `output#${e}`;
1569
- return G(i, () => n(new te())), new x(
1569
+ return G(i, () => n(new ne())), new w(
1570
1570
  this._renderingMode,
1571
1571
  this._initialArgs,
1572
1572
  this._initialUiState,
@@ -1585,7 +1585,7 @@ const x = class x {
1585
1585
  this._featureFlags
1586
1586
  );
1587
1587
  } else
1588
- return new x(
1588
+ return new w(
1589
1589
  this._renderingMode,
1590
1590
  this._initialArgs,
1591
1591
  this._initialUiState,
@@ -1605,7 +1605,7 @@ const x = class x {
1605
1605
  return this.output(e, n, { retentive: !0 });
1606
1606
  }
1607
1607
  argsValid(e) {
1608
- return typeof e == "function" ? (G("inputsValid", () => e(new te())), new x(
1608
+ return typeof e == "function" ? (G("inputsValid", () => e(new ne())), new w(
1609
1609
  this._renderingMode,
1610
1610
  this._initialArgs,
1611
1611
  this._initialUiState,
@@ -1618,7 +1618,7 @@ const x = class x {
1618
1618
  this._title,
1619
1619
  this._enrichmentTargets,
1620
1620
  this._featureFlags
1621
- )) : new x(
1621
+ )) : new w(
1622
1622
  this._renderingMode,
1623
1623
  this._initialArgs,
1624
1624
  this._initialUiState,
@@ -1631,7 +1631,7 @@ const x = class x {
1631
1631
  );
1632
1632
  }
1633
1633
  sections(e) {
1634
- return Array.isArray(e) ? this.sections(ie(e)) : typeof e == "function" ? (G("sections", () => e(new te())), new x(
1634
+ return Array.isArray(e) ? this.sections(se(e)) : typeof e == "function" ? (G("sections", () => e(new ne())), new w(
1635
1635
  this._renderingMode,
1636
1636
  this._initialArgs,
1637
1637
  this._initialUiState,
@@ -1641,7 +1641,7 @@ const x = class x {
1641
1641
  this._title,
1642
1642
  this._enrichmentTargets,
1643
1643
  this._featureFlags
1644
- )) : new x(
1644
+ )) : new w(
1645
1645
  this._renderingMode,
1646
1646
  this._initialArgs,
1647
1647
  this._initialUiState,
@@ -1655,7 +1655,7 @@ const x = class x {
1655
1655
  }
1656
1656
  /** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
1657
1657
  title(e) {
1658
- return G("title", () => e(new te())), new x(
1658
+ return G("title", () => e(new ne())), new w(
1659
1659
  this._renderingMode,
1660
1660
  this._initialArgs,
1661
1661
  this._initialUiState,
@@ -1672,7 +1672,7 @@ const x = class x {
1672
1672
  * @deprecated use {@link withArgs}
1673
1673
  * */
1674
1674
  initialArgs(e) {
1675
- return new x(
1675
+ return new w(
1676
1676
  this._renderingMode,
1677
1677
  e,
1678
1678
  this._initialUiState,
@@ -1686,7 +1686,7 @@ const x = class x {
1686
1686
  }
1687
1687
  /** Sets initial args for the block, this value must be specified. */
1688
1688
  withArgs(e) {
1689
- return new x(
1689
+ return new w(
1690
1690
  this._renderingMode,
1691
1691
  e,
1692
1692
  this._initialUiState,
@@ -1700,7 +1700,7 @@ const x = class x {
1700
1700
  }
1701
1701
  /** Defines type and sets initial value for block UiState. */
1702
1702
  withUiState(e) {
1703
- return new x(
1703
+ return new w(
1704
1704
  this._renderingMode,
1705
1705
  this._initialArgs,
1706
1706
  e,
@@ -1717,7 +1717,7 @@ const x = class x {
1717
1717
  * Influences dependency graph construction.
1718
1718
  */
1719
1719
  enriches(e) {
1720
- return G("enrichmentTargets", e), new x(
1720
+ return G("enrichmentTargets", e), new w(
1721
1721
  this._renderingMode,
1722
1722
  this._initialArgs,
1723
1723
  this._initialUiState,
@@ -1736,7 +1736,7 @@ const x = class x {
1736
1736
  if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
1737
1737
  const e = {
1738
1738
  v3: {
1739
- sdkVersion: z,
1739
+ sdkVersion: X,
1740
1740
  renderingMode: this._renderingMode,
1741
1741
  initialArgs: this._initialArgs,
1742
1742
  initialUiState: this._initialUiState,
@@ -1748,25 +1748,25 @@ const x = class x {
1748
1748
  featureFlags: this._featureFlags
1749
1749
  },
1750
1750
  // fields below are added to allow previous desktop versions read generated configs
1751
- sdkVersion: z,
1751
+ sdkVersion: X,
1752
1752
  renderingMode: this._renderingMode,
1753
1753
  initialArgs: this._initialArgs,
1754
- inputsValid: fe(this._inputsValid),
1755
- sections: fe(this._sections),
1754
+ inputsValid: me(this._inputsValid),
1755
+ sections: me(this._sections),
1756
1756
  outputs: Object.fromEntries(
1757
- Object.entries(this._outputs).map(([n, r]) => [n, fe(r)])
1757
+ Object.entries(this._outputs).map(([n, r]) => [n, me(r)])
1758
1758
  )
1759
1759
  };
1760
- return bt() ? je({ sdkVersion: z }) : { config: e };
1760
+ return At() ? $e({ sdkVersion: X }) : { config: e };
1761
1761
  }
1762
1762
  };
1763
- k(x, "INITIAL_BLOCK_FEATURE_FLAGS", {
1763
+ V(w, "INITIAL_BLOCK_FEATURE_FLAGS", {
1764
1764
  supportsLazyState: !0,
1765
1765
  requiresUIAPIVersion: 1,
1766
1766
  requiresModelAPIVersion: 1
1767
1767
  });
1768
- let Fe = x;
1769
- function He() {
1768
+ let Oe = w;
1769
+ function Qe() {
1770
1770
  return {
1771
1771
  sourceId: null,
1772
1772
  hiddenColIds: null,
@@ -1775,72 +1775,72 @@ function He() {
1775
1775
  sorting: []
1776
1776
  };
1777
1777
  }
1778
- function Ee() {
1778
+ function De() {
1779
1779
  return {
1780
1780
  version: 4,
1781
1781
  stateCache: [],
1782
- pTableParams: He()
1782
+ pTableParams: Qe()
1783
1783
  };
1784
1784
  }
1785
- function $t(t) {
1786
- return "version" in t || (t = Ee()), t.version === 2 && (t = {
1785
+ function Ht(t) {
1786
+ return "version" in t || (t = De()), t.version === 2 && (t = {
1787
1787
  version: 3,
1788
1788
  stateCache: t.stateCache.map((e) => ({
1789
1789
  ...e,
1790
1790
  filtersState: []
1791
1791
  })),
1792
- pTableParams: He()
1793
- }), t.version === 3 && (t = Ee()), t;
1792
+ pTableParams: Qe()
1793
+ }), t.version === 3 && (t = De()), t;
1794
1794
  }
1795
- function Ce(t) {
1795
+ function Se(t) {
1796
1796
  return t.axesSpec.length === 1 && t.name === "pl7.app/label";
1797
1797
  }
1798
- function Bt(t) {
1799
- return new X().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
1798
+ function zt(t) {
1799
+ return new Q().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
1800
1800
  name: "pl7.app/label",
1801
1801
  axes: [{}]
1802
1802
  // exactly one axis
1803
1803
  }, { dontWaitAllData: !0 });
1804
1804
  }
1805
- function ke(t, e) {
1805
+ function Re(t, e) {
1806
1806
  const n = [], r = [];
1807
1807
  for (const a of t)
1808
- Ce(a.spec) ? n.push(a) : r.push(a);
1808
+ Se(a.spec) ? n.push(a) : r.push(a);
1809
1809
  const i = [];
1810
1810
  for (const a of r)
1811
1811
  for (const l of a.spec.axesSpec) {
1812
- const u = D(l);
1813
- i.some((h) => N(h, u)) || i.push(u);
1812
+ const u = k(l);
1813
+ i.some((h) => U(h, u)) || i.push(u);
1814
1814
  }
1815
1815
  for (const a of n) {
1816
- const l = D(a.spec.axesSpec[0]), u = i.findIndex((h) => N(h, l));
1816
+ const l = k(a.spec.axesSpec[0]), u = i.findIndex((h) => U(h, l));
1817
1817
  u !== -1 && i.splice(u, 1);
1818
1818
  }
1819
- const s = (a, l) => {
1819
+ const o = (a, l) => {
1820
1820
  let u = a.toString();
1821
1821
  if (l)
1822
1822
  for (const h in l)
1823
1823
  u += h, u += l[h];
1824
1824
  return u;
1825
- }, o = [];
1825
+ }, s = [];
1826
1826
  for (const a of e) {
1827
- const l = a.spec.axesSpec[0], u = D(l), h = i.findIndex((f) => N(f, u));
1827
+ const l = a.spec.axesSpec[0], u = k(l), h = i.findIndex((f) => U(f, u));
1828
1828
  if (h !== -1) {
1829
- const f = i[h], g = Object.keys(f.domain ?? {}).length, d = Object.keys(l.domain ?? {}).length;
1830
- g > d ? o.push({
1831
- id: s(a.id, f.domain),
1829
+ const f = i[h], m = Object.keys(f.domain ?? {}).length, d = Object.keys(l.domain ?? {}).length;
1830
+ m > d ? s.push({
1831
+ id: o(a.id, f.domain),
1832
1832
  spec: {
1833
1833
  ...a.spec,
1834
1834
  axesSpec: [{ ...f, annotations: l.annotations }]
1835
1835
  },
1836
1836
  data: a.data
1837
- }) : o.push(a), i.splice(h, 1);
1837
+ }) : s.push(a), i.splice(h, 1);
1838
1838
  }
1839
1839
  }
1840
- return o;
1840
+ return s;
1841
1841
  }
1842
- function Ut(t) {
1843
- const e = (i) => Array.isArray(i), n = (i) => i instanceof R, r = (i) => typeof i == "object" && "type" in i;
1842
+ function Xt(t) {
1843
+ const e = (i) => Array.isArray(i), n = (i) => i instanceof O, r = (i) => typeof i == "object" && "type" in i;
1844
1844
  return t.map((i) => i.data).every((i) => {
1845
1845
  if (e(i))
1846
1846
  return !0;
@@ -1851,15 +1851,15 @@ function Ut(t) {
1851
1851
  case "Json":
1852
1852
  return !0;
1853
1853
  case "JsonPartitioned":
1854
- return Object.values(i.parts).every((o) => o.getIsReadyOrError());
1854
+ return Object.values(i.parts).every((s) => s.getIsReadyOrError());
1855
1855
  case "BinaryPartitioned":
1856
- return Object.values(i.parts).every((o) => o.index.getIsReadyOrError() && o.values.getIsReadyOrError());
1856
+ return Object.values(i.parts).every((s) => s.index.getIsReadyOrError() && s.values.getIsReadyOrError());
1857
1857
  }
1858
1858
  else
1859
1859
  throw Error(`unsupported column data type: ${i}`);
1860
1860
  });
1861
1861
  }
1862
- function De(t) {
1862
+ function Ne(t) {
1863
1863
  let e = t.columns;
1864
1864
  const n = [];
1865
1865
  if (t.coreColumnPredicate) {
@@ -1881,80 +1881,77 @@ function De(t) {
1881
1881
  sorting: t.sorting
1882
1882
  };
1883
1883
  }
1884
- function Wt(t) {
1884
+ function Yt(t) {
1885
1885
  var e;
1886
1886
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "hidden";
1887
1887
  }
1888
- function Gt(t) {
1888
+ function Qt(t) {
1889
1889
  var e;
1890
1890
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "optional";
1891
1891
  }
1892
- function he(t, e) {
1892
+ function ye(t, e) {
1893
1893
  return [...new Map(t.map((n) => [e(n), n])).values()];
1894
1894
  }
1895
- function Jn(t, e, n, r) {
1895
+ function Gn(t, e, n, r) {
1896
1896
  if (e.length === 0) return;
1897
- const i = e.filter((c) => !Wt(c.spec)), s = $t(n), o = Bt(t.resultPool);
1898
- if (!o) return;
1899
- const a = ke(i.map(xe), o), l = [...i, ...a], h = [
1900
- ...he(
1901
- [...l.flatMap((c) => c.spec.axesSpec.map((b) => D(b)))],
1902
- (c) => O(c)
1897
+ const i = e.filter((c) => Pe(c.spec) || !Yt(c.spec)), o = Ht(n), s = zt(t.resultPool);
1898
+ if (!s) return;
1899
+ const a = Re(i.map(_e), s), l = [...i, ...a], h = [
1900
+ ...ye(
1901
+ [...l.flatMap((c) => c.spec.axesSpec.map((v) => k(v)))],
1902
+ (c) => D(c)
1903
1903
  ).map((c) => ({ type: "axis", id: c })),
1904
1904
  ...l.map((c) => ({ type: "column", id: c.id }))
1905
- ], f = new Set(h.map((c) => O(c))), g = (c) => f.has(O(c)), d = (r == null ? void 0 : r.coreJoinType) ?? "full", y = s.pTableParams.partitionFilters.filter((c) => {
1906
- const b = g(c.column);
1907
- return b || t.logWarn(`Partition filter ${JSON.stringify(c)} does not match provided columns, skipping`), b;
1908
- }), p = he(
1909
- [...(r == null ? void 0 : r.filters) ?? [], ...s.pTableParams.filters],
1910
- (c) => O(c.column)
1905
+ ], f = new Set(h.map((c) => D(c))), m = (c) => f.has(D(c)), d = (r == null ? void 0 : r.coreJoinType) ?? "full", g = o.pTableParams.partitionFilters.filter((c) => {
1906
+ const v = m(c.column);
1907
+ return v || t.logWarn(`Partition filter ${JSON.stringify(c)} does not match provided columns, skipping`), v;
1908
+ }), p = ye(
1909
+ [...(r == null ? void 0 : r.filters) ?? [], ...o.pTableParams.filters],
1910
+ (c) => D(c.column)
1911
1911
  ).filter((c) => {
1912
- const b = g(c.column);
1913
- return b || t.logWarn(`Filter ${JSON.stringify(c)} does not match provided columns, skipping`), b;
1914
- }), m = he(
1915
- [...(r == null ? void 0 : r.sorting) ?? [], ...s.pTableParams.sorting],
1916
- (c) => O(c.column)
1912
+ const v = m(c.column);
1913
+ return v || t.logWarn(`Filter ${JSON.stringify(c)} does not match provided columns, skipping`), v;
1914
+ }), y = ye(
1915
+ [...(r == null ? void 0 : r.sorting) ?? [], ...o.pTableParams.sorting],
1916
+ (c) => D(c.column)
1917
1917
  ).filter((c) => {
1918
- const b = g(c.column);
1919
- return b || t.logWarn(`Sorting ${JSON.stringify(c)} does not match provided columns, skipping`), b;
1920
- }), C = De({
1918
+ const v = m(c.column);
1919
+ return v || t.logWarn(`Sorting ${JSON.stringify(c)} does not match provided columns, skipping`), v;
1920
+ }), C = Ne({
1921
1921
  columns: i,
1922
1922
  labelColumns: a,
1923
1923
  coreJoinType: d,
1924
- partitionFilters: y,
1924
+ partitionFilters: g,
1925
1925
  filters: p,
1926
- sorting: m,
1926
+ sorting: y,
1927
1927
  coreColumnPredicate: r == null ? void 0 : r.coreColumnPredicate
1928
- }), E = t.createPTable(C), _ = new Set((() => {
1928
+ }), E = t.createPTable(C), x = new Set((() => {
1929
1929
  if (d === "inner") return [];
1930
- const c = s.pTableParams.hiddenColIds;
1931
- return c || i.filter((b) => Gt(b.spec)).map((b) => b.id);
1930
+ const c = o.pTableParams.hiddenColIds;
1931
+ return c || i.filter((v) => Qt(v.spec)).map((v) => v.id);
1932
1932
  })());
1933
- i.filter((c) => {
1934
- var b;
1935
- return ((b = c.spec.annotations) == null ? void 0 : b["pl7.app/isLinkerColumn"]) === "true";
1936
- }).forEach((c) => _.delete(c.id)), r != null && r.coreColumnPredicate && i.flatMap((b) => {
1937
- var T;
1938
- return (T = r == null ? void 0 : r.coreColumnPredicate) != null && T.call(r, b.spec) ? [b.id] : [];
1939
- }).forEach((b) => _.delete(b)), [...y.map((c) => c.column), ...p.map((c) => c.column), ...m.map((c) => c.column)].filter((c) => c.type === "column").forEach((c) => _.delete(c.id));
1940
- const w = i.filter((c) => !_.has(c.id)), A = ke(w.map(xe), o);
1941
- if (!Ut([...w, ...A])) return;
1942
- const S = De({
1943
- columns: w,
1944
- labelColumns: A,
1933
+ i.filter((c) => Pe(c.spec)).forEach((c) => x.delete(c.id)), r != null && r.coreColumnPredicate && i.flatMap((v) => {
1934
+ var I;
1935
+ return (I = r == null ? void 0 : r.coreColumnPredicate) != null && I.call(r, v.spec) ? [v.id] : [];
1936
+ }).forEach((v) => x.delete(v)), [...g.map((c) => c.column), ...p.map((c) => c.column), ...y.map((c) => c.column)].filter((c) => c.type === "column").forEach((c) => x.delete(c.id));
1937
+ const S = i.filter((c) => !x.has(c.id)), P = Re(S.map(_e), s);
1938
+ if (!Xt([...S, ...P])) return;
1939
+ const T = Ne({
1940
+ columns: S,
1941
+ labelColumns: P,
1945
1942
  coreJoinType: d,
1946
- partitionFilters: y,
1943
+ partitionFilters: g,
1947
1944
  filters: p,
1948
- sorting: m,
1945
+ sorting: y,
1949
1946
  coreColumnPredicate: r == null ? void 0 : r.coreColumnPredicate
1950
- }), I = t.createPTable(S);
1947
+ }), F = t.createPTable(T);
1951
1948
  return {
1952
- sourceId: s.pTableParams.sourceId,
1949
+ sourceId: o.pTableParams.sourceId,
1953
1950
  fullTableHandle: E,
1954
- visibleTableHandle: I
1951
+ visibleTableHandle: F
1955
1952
  };
1956
1953
  }
1957
- function $n(t, e, n) {
1954
+ function Hn(t, e, n) {
1958
1955
  const r = t.resultPool.findLabels(e);
1959
1956
  return {
1960
1957
  axis: e,
@@ -1965,190 +1962,190 @@ function $n(t, e, n) {
1965
1962
  defaultValue: n[0]
1966
1963
  };
1967
1964
  }
1968
- const Ht = (t, e) => {
1965
+ const Zt = (t, e) => {
1969
1966
  let n = t.toString();
1970
1967
  return e == null || e.forEach((r) => {
1971
1968
  if (r)
1972
- for (const [i, s] of Object.entries(r))
1973
- n += i, n += s;
1969
+ for (const [i, o] of Object.entries(r))
1970
+ n += i, n += o;
1974
1971
  }), n;
1975
1972
  };
1976
- function qt(t) {
1973
+ function en(t) {
1977
1974
  if (!t.length)
1978
1975
  return [];
1979
1976
  let e = [[]];
1980
1977
  return t.forEach((n) => {
1981
1978
  const r = [];
1982
1979
  n.forEach((i) => {
1983
- r.push(...e.map((s) => [...s, i]));
1980
+ r.push(...e.map((o) => [...o, i]));
1984
1981
  }), e = r;
1985
1982
  }), e;
1986
1983
  }
1987
- function zt(t) {
1984
+ function Pe(t) {
1988
1985
  var e;
1989
- return t.axesSpec.length === 2 && ((e = t.annotations) == null ? void 0 : e[Xt]) === "true";
1986
+ return t.axesSpec.length === 2 && ((e = t.annotations) == null ? void 0 : e[nn]) === "true";
1990
1987
  }
1991
- const Yt = "pl7.app/graph/isVirtual", Re = "pl7.app/label", Xt = "pl7.app/isLinkerColumn";
1992
- function Qt(t) {
1988
+ const tn = "pl7.app/graph/isVirtual", Ue = "pl7.app/label", nn = "pl7.app/isLinkerColumn";
1989
+ function rn(t) {
1993
1990
  var n, r;
1994
1991
  const e = /* @__PURE__ */ new Map();
1995
1992
  for (const { spec: i } of t) {
1996
- const s = i.axesSpec.map(D).map(O);
1997
- s.forEach((o) => {
1998
- e.has(o) || e.set(o, /* @__PURE__ */ new Set());
1993
+ const o = i.axesSpec.map(k).map(D);
1994
+ o.forEach((s) => {
1995
+ e.has(s) || e.set(s, /* @__PURE__ */ new Set());
1999
1996
  });
2000
- for (let o = 0; o < s.length - 1; o++)
2001
- for (let a = o + 1; a < s.length; a++) {
2002
- const l = s[o], u = s[a];
1997
+ for (let s = 0; s < o.length - 1; s++)
1998
+ for (let a = s + 1; a < o.length; a++) {
1999
+ const l = o[s], u = o[a];
2003
2000
  (n = e.get(l)) == null || n.add(u), (r = e.get(u)) == null || r.add(l);
2004
2001
  }
2005
2002
  }
2006
2003
  return e;
2007
2004
  }
2008
- function Zt(t, e) {
2009
- const n = Qt(t), r = [...n.keys()].map(_e), i = [];
2005
+ function on(t, e) {
2006
+ const n = rn(t), r = [...n.keys()].map(Le), i = [];
2010
2007
  for (const l of e.values()) {
2011
- const u = r.find((h) => N(l, h));
2012
- u && i.push(O(u));
2008
+ const u = r.find((h) => U(l, h));
2009
+ u && i.push(D(u));
2013
2010
  }
2014
- const s = new Set(i), o = /* @__PURE__ */ new Map();
2011
+ const o = new Set(i), s = /* @__PURE__ */ new Map();
2015
2012
  let a = [...i];
2016
2013
  for (; a.length; ) {
2017
2014
  const l = [];
2018
2015
  for (const u of a)
2019
2016
  for (const h of n.get(u) ?? [])
2020
- s.has(h) || (l.push(h), s.add(h), o.set(h, _e(h)));
2017
+ o.has(h) || (l.push(h), o.add(h), s.set(h, Le(h)));
2021
2018
  a = l;
2022
2019
  }
2023
- return o;
2020
+ return s;
2024
2021
  }
2025
- function Oe(t, e) {
2022
+ function Ke(t, e) {
2026
2023
  const n = [];
2027
2024
  return e.forEach((r) => {
2028
- n.push(...en(t, r));
2025
+ n.push(...sn(t, r));
2029
2026
  }), n;
2030
2027
  }
2031
- function en(t, e) {
2032
- const n = e.spec.axesSpec.map(D);
2033
- if (n.every((u) => t.has(O(u))))
2028
+ function sn(t, e) {
2029
+ const n = e.spec.axesSpec.map(k);
2030
+ if (n.every((u) => t.has(D(u))))
2034
2031
  return [e];
2035
2032
  const r = n.map((u) => {
2036
2033
  const h = [];
2037
- for (const [f, g] of t)
2038
- N(g, u) && !N(u, g) && h.push(g);
2034
+ for (const [f, m] of t)
2035
+ U(m, u) && !U(u, m) && h.push(m);
2039
2036
  return h;
2040
- }), i = qt(r), s = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), a = i.map((u) => {
2037
+ }), i = en(r), o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), a = i.map((u) => {
2041
2038
  const h = /* @__PURE__ */ new Set();
2042
- return u.map((f, g) => {
2043
- const d = e.spec.axesSpec[g].domain, y = f.domain;
2044
- return Object.entries(y ?? {}).forEach(([p, m]) => {
2039
+ return u.map((f, m) => {
2040
+ const d = e.spec.axesSpec[m].domain, g = f.domain;
2041
+ return Object.entries(g ?? {}).forEach(([p, y]) => {
2045
2042
  if ((d == null ? void 0 : d[p]) === void 0) {
2046
- const C = JSON.stringify([p, m]);
2047
- h.add(C), s.add(C);
2043
+ const C = JSON.stringify([p, y]);
2044
+ h.add(C), o.add(C);
2048
2045
  }
2049
2046
  }), {
2050
2047
  ...f,
2051
- annotations: e.spec.axesSpec[g].annotations
2048
+ annotations: e.spec.axesSpec[m].annotations
2052
2049
  };
2053
2050
  }), h;
2054
2051
  });
2055
- [...s].forEach((u) => {
2056
- a.some((h) => !h.has(u)) && o.add(u);
2052
+ [...o].forEach((u) => {
2053
+ a.some((h) => !h.has(u)) && s.add(u);
2057
2054
  });
2058
2055
  const l = i.map((u, h) => {
2059
2056
  var p;
2060
- const f = Ht(e.id, u.map((m) => m.domain)), g = ((p = e.spec.annotations) == null ? void 0 : p[Re]) ?? "", d = [...a[h]].filter((m) => o.has(m)).sort().map((m) => {
2057
+ const f = Zt(e.id, u.map((y) => y.domain)), m = ((p = e.spec.annotations) == null ? void 0 : p[Ue]) ?? "", d = [...a[h]].filter((y) => s.has(y)).sort().map((y) => {
2061
2058
  var C;
2062
- return (C = JSON.parse(m)) == null ? void 0 : C[1];
2063
- }).join(" / "), y = {
2059
+ return (C = JSON.parse(y)) == null ? void 0 : C[1];
2060
+ }).join(" / "), g = {
2064
2061
  ...e.spec.annotations,
2065
- [Yt]: "true"
2062
+ [tn]: "true"
2066
2063
  };
2067
- return (g || d) && (y[Re] = g && d ? g + " / " + d : g + d), {
2064
+ return (m || d) && (g[Ue] = m && d ? m + " / " + d : m + d), {
2068
2065
  id: f,
2069
2066
  spec: {
2070
2067
  ...e.spec,
2071
- axesSpec: u.map((m, C) => ({
2072
- ...m,
2068
+ axesSpec: u.map((y, C) => ({
2069
+ ...y,
2073
2070
  annotations: e.spec.axesSpec[C].annotations
2074
2071
  })),
2075
- annotations: y
2072
+ annotations: g
2076
2073
  },
2077
2074
  data: e.data
2078
2075
  };
2079
2076
  });
2080
2077
  return [e, ...l];
2081
2078
  }
2082
- function tn(t) {
2079
+ function an(t) {
2083
2080
  let e = !0;
2084
- return t.data instanceof R ? e = e && t.data.getIsReadyOrError() : ue(t.data) && dt(t.data, (n) => {
2081
+ return t.data instanceof O ? e = e && t.data.getIsReadyOrError() : pe(t.data) && bt(t.data, (n) => {
2085
2082
  e = e && n.getIsReadyOrError();
2086
2083
  }), e;
2087
2084
  }
2088
- function ne(t) {
2089
- return t.every(tn);
2085
+ function re(t) {
2086
+ return t.every(an);
2090
2087
  }
2091
- function Bn(t, e) {
2088
+ function zn(t, e) {
2092
2089
  if (!e) {
2093
- const f = new X();
2090
+ const f = new Q();
2094
2091
  f.addColumnProvider(t.resultPool);
2095
- const g = f.getColumns(() => !0, { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? [];
2096
- if (!ne(g))
2092
+ const m = f.getColumns(() => !0, { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? [];
2093
+ if (!re(m))
2097
2094
  return;
2098
- const d = new Map(g.flatMap((p) => p.spec.axesSpec).map((p) => {
2099
- const m = D(p);
2100
- return [O(m), m];
2101
- })), y = Oe(d, g);
2102
- return t.createPFrame(y);
2095
+ const d = new Map(m.flatMap((p) => p.spec.axesSpec).map((p) => {
2096
+ const y = k(p);
2097
+ return [D(y), y];
2098
+ })), g = Ke(d, m);
2099
+ return t.createPFrame(g);
2103
2100
  }
2104
- if (!ne(e))
2101
+ if (!re(e))
2105
2102
  return;
2106
- const n = new X();
2103
+ const n = new Q();
2107
2104
  n.addColumnProvider(t.resultPool), n.addColumns(e);
2108
2105
  const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
2109
2106
  for (const f of e)
2110
- for (const g of f.spec.axesSpec) {
2111
- const d = D(g);
2112
- r.set(O(d), d), i.set(O(d), d);
2107
+ for (const m of f.spec.axesSpec) {
2108
+ const d = k(m);
2109
+ r.set(D(d), d), i.set(D(d), d);
2113
2110
  }
2114
- const s = n.getColumns((f) => zt(f)) ?? [], o = Zt(s, r);
2115
- for (const f of o)
2111
+ const o = n.getColumns((f) => Pe(f)) ?? [], s = on(o, r);
2112
+ for (const f of s)
2116
2113
  r.set(...f), i.set(...f);
2117
- const a = (n.getColumns((f) => f.axesSpec.some((g) => {
2118
- const d = D(g);
2119
- for (const y of r.values())
2120
- if (N(y, d))
2114
+ const a = (n.getColumns((f) => f.axesSpec.some((m) => {
2115
+ const d = k(m);
2116
+ for (const g of r.values())
2117
+ if (U(g, d))
2121
2118
  return !0;
2122
2119
  return !1;
2123
- }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((f) => !Ce(f.spec));
2124
- if (!ne(a))
2120
+ }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((f) => !Se(f.spec));
2121
+ if (!re(a))
2125
2122
  return;
2126
2123
  for (const f of a)
2127
- for (const g of f.spec.axesSpec) {
2128
- const d = D(g);
2129
- i.set(O(d), d);
2124
+ for (const m of f.spec.axesSpec) {
2125
+ const d = k(m);
2126
+ i.set(D(d), d);
2130
2127
  }
2131
- const l = (n.getColumns((f) => f.axesSpec.some((g) => {
2132
- const d = D(g);
2133
- for (const y of i.values())
2134
- if (N(y, d))
2128
+ const l = (n.getColumns((f) => f.axesSpec.some((m) => {
2129
+ const d = k(m);
2130
+ for (const g of i.values())
2131
+ if (U(g, d))
2135
2132
  return !0;
2136
2133
  return !1;
2137
- }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((f) => Ce(f.spec));
2138
- if (!ne(l))
2134
+ }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((f) => Se(f.spec));
2135
+ if (!re(l))
2139
2136
  return;
2140
- const u = [...a, ...l], h = Oe(r, u);
2137
+ const u = [...a, ...l], h = Ke(r, u);
2141
2138
  return t.createPFrame(h);
2142
2139
  }
2143
- function Un({
2140
+ function Xn({
2144
2141
  selection: t,
2145
- columnId: e = ht(),
2142
+ columnId: e = Ct(),
2146
2143
  label: n = "Selection marker",
2147
2144
  domain: r
2148
2145
  }) {
2149
2146
  if (!(t != null && t.axesSpec.length))
2150
2147
  return;
2151
- const i = t.selectedKeys.filter((s) => s.every((o) => !ft(o))).map((s) => ({ key: s, val: 1 }));
2148
+ const i = t.selectedKeys.filter((o) => o.every((s) => !vt(s))).map((o) => ({ key: o, val: 1 }));
2152
2149
  if (i.length)
2153
2150
  return {
2154
2151
  id: e,
@@ -2166,10 +2163,525 @@ function Un({
2166
2163
  data: i
2167
2164
  };
2168
2165
  }
2169
- function Wn(t) {
2170
- return t === gt ? (console.error("Axis value can never be N/A"), "") : t;
2166
+ function Yn(t) {
2167
+ return t === Tt ? (console.error("Axis value can never be N/A"), "") : t;
2168
+ }
2169
+ function ln(t) {
2170
+ throw new Error("Unexpected object: " + t);
2171
+ }
2172
+ function R(t) {
2173
+ return t.valueType === "Int" || t.valueType === "Long" || t.valueType === "Float" || t.valueType === "Double";
2171
2174
  }
2172
- class Gn {
2175
+ function ie(t) {
2176
+ return t.valueType === "String";
2177
+ }
2178
+ const Ze = {
2179
+ lessThan: {
2180
+ label: "Col < X (Less Than)",
2181
+ form: {
2182
+ column: {
2183
+ label: "Column",
2184
+ fieldType: "SUniversalPColumnId",
2185
+ defaultValue: () => {
2186
+ }
2187
+ },
2188
+ type: {
2189
+ label: "Predicate",
2190
+ fieldType: "FilterUiType",
2191
+ defaultValue: () => "lessThan"
2192
+ },
2193
+ x: {
2194
+ label: "X",
2195
+ fieldType: "number",
2196
+ defaultValue: () => 0
2197
+ }
2198
+ },
2199
+ supportedFor: R
2200
+ },
2201
+ greaterThan: {
2202
+ label: "Col > X (Greater Than)",
2203
+ form: {
2204
+ column: {
2205
+ label: "Column",
2206
+ fieldType: "SUniversalPColumnId",
2207
+ defaultValue: () => {
2208
+ }
2209
+ },
2210
+ type: {
2211
+ label: "Predicate",
2212
+ fieldType: "FilterUiType",
2213
+ defaultValue: () => "greaterThan"
2214
+ },
2215
+ x: {
2216
+ label: "X",
2217
+ fieldType: "number",
2218
+ defaultValue: () => 0
2219
+ }
2220
+ },
2221
+ supportedFor: R
2222
+ },
2223
+ lessThanOrEqual: {
2224
+ label: "Col ≤ X (Less Than or Equal)",
2225
+ form: {
2226
+ column: {
2227
+ label: "Column",
2228
+ fieldType: "SUniversalPColumnId",
2229
+ defaultValue: () => {
2230
+ }
2231
+ },
2232
+ type: {
2233
+ label: "Predicate",
2234
+ fieldType: "FilterUiType",
2235
+ defaultValue: () => "lessThanOrEqual"
2236
+ },
2237
+ x: {
2238
+ label: "X",
2239
+ fieldType: "number",
2240
+ defaultValue: () => 0
2241
+ }
2242
+ },
2243
+ supportedFor: R
2244
+ },
2245
+ greaterThanOrEqual: {
2246
+ label: "Col ≥ X (Greater Than or Equal)",
2247
+ form: {
2248
+ column: {
2249
+ label: "Column",
2250
+ fieldType: "SUniversalPColumnId",
2251
+ defaultValue: () => {
2252
+ }
2253
+ },
2254
+ type: {
2255
+ label: "Predicate",
2256
+ fieldType: "FilterUiType",
2257
+ defaultValue: () => "greaterThanOrEqual"
2258
+ },
2259
+ x: {
2260
+ label: "X",
2261
+ fieldType: "number",
2262
+ defaultValue: () => 0
2263
+ }
2264
+ },
2265
+ supportedFor: R
2266
+ },
2267
+ lessThanColumn: {
2268
+ label: "Col₁ < Col₂ (Compare Columns)",
2269
+ form: {
2270
+ column: {
2271
+ label: "Col₁",
2272
+ fieldType: "SUniversalPColumnId",
2273
+ defaultValue: () => {
2274
+ }
2275
+ },
2276
+ type: {
2277
+ label: "Predicate",
2278
+ fieldType: "FilterUiType",
2279
+ defaultValue: () => "lessThanColumn"
2280
+ },
2281
+ rhs: {
2282
+ label: "Col₂",
2283
+ fieldType: "SUniversalPColumnId",
2284
+ defaultValue: () => {
2285
+ }
2286
+ },
2287
+ minDiff: {
2288
+ label: "Margin (positive)",
2289
+ fieldType: "number?",
2290
+ defaultValue: () => {
2291
+ }
2292
+ }
2293
+ },
2294
+ supportedFor: (t, e) => R(t) && (e === void 0 || R(e))
2295
+ },
2296
+ lessThanColumnOrEqual: {
2297
+ label: "Col₁ ≤ Col₂ (Compare Columns)",
2298
+ form: {
2299
+ column: {
2300
+ label: "Col₁",
2301
+ fieldType: "SUniversalPColumnId",
2302
+ defaultValue: () => {
2303
+ }
2304
+ },
2305
+ type: {
2306
+ label: "Predicate",
2307
+ fieldType: "FilterUiType",
2308
+ defaultValue: () => "lessThanColumnOrEqual"
2309
+ },
2310
+ rhs: {
2311
+ label: "Col₂",
2312
+ fieldType: "SUniversalPColumnId",
2313
+ defaultValue: () => {
2314
+ }
2315
+ },
2316
+ minDiff: {
2317
+ label: "Margin (positive)",
2318
+ fieldType: "number?",
2319
+ defaultValue: () => {
2320
+ }
2321
+ }
2322
+ },
2323
+ supportedFor: (t, e) => R(t) && (e === void 0 || R(e))
2324
+ },
2325
+ topN: {
2326
+ label: "Top N",
2327
+ form: {
2328
+ column: {
2329
+ label: "Rank By Column",
2330
+ fieldType: "SUniversalPColumnId",
2331
+ defaultValue: () => {
2332
+ }
2333
+ },
2334
+ type: {
2335
+ label: "Predicate",
2336
+ fieldType: "FilterUiType",
2337
+ defaultValue: () => "topN"
2338
+ },
2339
+ n: {
2340
+ label: "N",
2341
+ fieldType: "number",
2342
+ defaultValue: () => 10
2343
+ }
2344
+ },
2345
+ supportedFor: R
2346
+ },
2347
+ bottomN: {
2348
+ label: "Bottom N",
2349
+ form: {
2350
+ column: {
2351
+ label: "Rank By Column",
2352
+ fieldType: "SUniversalPColumnId",
2353
+ defaultValue: () => {
2354
+ }
2355
+ },
2356
+ type: {
2357
+ label: "Predicate",
2358
+ fieldType: "FilterUiType",
2359
+ defaultValue: () => "bottomN"
2360
+ },
2361
+ n: {
2362
+ label: "N",
2363
+ fieldType: "number",
2364
+ defaultValue: () => 10
2365
+ }
2366
+ },
2367
+ supportedFor: R
2368
+ },
2369
+ patternContainSubsequence: {
2370
+ label: "Col ~ Seq (Contain Subsequence)",
2371
+ form: {
2372
+ column: {
2373
+ label: "Column",
2374
+ fieldType: "SUniversalPColumnId",
2375
+ defaultValue: () => {
2376
+ }
2377
+ },
2378
+ type: {
2379
+ label: "Predicate",
2380
+ fieldType: "FilterUiType",
2381
+ defaultValue: () => "patternContainSubsequence"
2382
+ },
2383
+ value: {
2384
+ label: "Seq",
2385
+ fieldType: "string",
2386
+ defaultValue: () => ""
2387
+ }
2388
+ },
2389
+ supportedFor: ie
2390
+ },
2391
+ patternNotContainSubsequence: {
2392
+ label: "Col ≁ Seq (Not Contain Subsequence)",
2393
+ form: {
2394
+ column: {
2395
+ label: "Column",
2396
+ fieldType: "SUniversalPColumnId",
2397
+ defaultValue: () => {
2398
+ }
2399
+ },
2400
+ type: {
2401
+ label: "Predicate",
2402
+ fieldType: "FilterUiType",
2403
+ defaultValue: () => "patternNotContainSubsequence"
2404
+ },
2405
+ value: {
2406
+ label: "Seq",
2407
+ fieldType: "string",
2408
+ defaultValue: () => ""
2409
+ }
2410
+ },
2411
+ supportedFor: ie
2412
+ },
2413
+ patternEquals: {
2414
+ label: "Col = Seq (Equals)",
2415
+ form: {
2416
+ column: {
2417
+ label: "Column",
2418
+ fieldType: "SUniversalPColumnId",
2419
+ defaultValue: () => {
2420
+ }
2421
+ },
2422
+ type: {
2423
+ label: "Predicate",
2424
+ fieldType: "FilterUiType",
2425
+ defaultValue: () => "patternEquals"
2426
+ },
2427
+ value: {
2428
+ label: "Seq",
2429
+ fieldType: "string",
2430
+ defaultValue: () => ""
2431
+ }
2432
+ },
2433
+ supportedFor: ie
2434
+ },
2435
+ patternNotEquals: {
2436
+ label: "Col ≠ Seq (Not Equal)",
2437
+ form: {
2438
+ column: {
2439
+ label: "Column",
2440
+ fieldType: "SUniversalPColumnId",
2441
+ defaultValue: () => {
2442
+ }
2443
+ },
2444
+ type: {
2445
+ label: "Predicate",
2446
+ fieldType: "FilterUiType",
2447
+ defaultValue: () => "patternNotEquals"
2448
+ },
2449
+ value: {
2450
+ label: "Seq",
2451
+ fieldType: "string",
2452
+ defaultValue: () => ""
2453
+ }
2454
+ },
2455
+ supportedFor: ie
2456
+ },
2457
+ isNA: {
2458
+ label: "Is NA",
2459
+ form: {
2460
+ column: {
2461
+ label: "Column",
2462
+ fieldType: "SUniversalPColumnId",
2463
+ defaultValue: () => {
2464
+ }
2465
+ },
2466
+ type: {
2467
+ label: "Predicate",
2468
+ fieldType: "FilterUiType",
2469
+ defaultValue: () => "isNA"
2470
+ }
2471
+ },
2472
+ supportedFor: () => !0
2473
+ },
2474
+ isNotNA: {
2475
+ label: "Is Not NA",
2476
+ form: {
2477
+ column: {
2478
+ label: "Column",
2479
+ fieldType: "SUniversalPColumnId",
2480
+ defaultValue: () => {
2481
+ }
2482
+ },
2483
+ type: {
2484
+ label: "Predicate",
2485
+ fieldType: "FilterUiType",
2486
+ defaultValue: () => "isNotNA"
2487
+ }
2488
+ },
2489
+ supportedFor: () => !0
2490
+ },
2491
+ or: {
2492
+ label: "Or",
2493
+ form: {
2494
+ type: {
2495
+ fieldType: "FilterUiType",
2496
+ label: "Predicate",
2497
+ defaultValue: () => "or"
2498
+ },
2499
+ filters: {
2500
+ fieldType: "unknown[]",
2501
+ label: "Filters",
2502
+ defaultValue: () => []
2503
+ }
2504
+ },
2505
+ supportedFor: () => !1
2506
+ },
2507
+ and: {
2508
+ label: "And",
2509
+ form: {
2510
+ type: {
2511
+ fieldType: "FilterUiType",
2512
+ label: "Predicate",
2513
+ defaultValue: () => "and"
2514
+ },
2515
+ filters: {
2516
+ fieldType: "unknown[]",
2517
+ label: "Filters",
2518
+ defaultValue: () => []
2519
+ }
2520
+ },
2521
+ supportedFor: () => !1
2522
+ },
2523
+ not: {
2524
+ label: "Not",
2525
+ form: {
2526
+ type: {
2527
+ fieldType: "FilterUiType",
2528
+ label: "Predicate",
2529
+ defaultValue: () => "not"
2530
+ },
2531
+ filter: {
2532
+ fieldType: "form",
2533
+ label: "Filter",
2534
+ defaultValue: () => {
2535
+ }
2536
+ // TODO:
2537
+ }
2538
+ },
2539
+ supportedFor: () => !1
2540
+ }
2541
+ };
2542
+ function Qn(t) {
2543
+ return t ? Object.entries(Ze).filter(([e, n]) => n.supportedFor(t)).map(([e, n]) => ({
2544
+ label: n.label,
2545
+ value: e
2546
+ })) : [];
2547
+ }
2548
+ function Zn(t) {
2549
+ return Ze[t];
2550
+ }
2551
+ function we(t) {
2552
+ if (t.type === "or")
2553
+ return {
2554
+ type: "or",
2555
+ filters: Me(t.filters)
2556
+ };
2557
+ if (t.type === "and")
2558
+ return {
2559
+ type: "and",
2560
+ filters: Me(t.filters)
2561
+ };
2562
+ if (t.type === "not")
2563
+ return {
2564
+ type: "not",
2565
+ filter: we(t.filter)
2566
+ };
2567
+ if (t.type === "isNA")
2568
+ return {
2569
+ type: "isNA",
2570
+ column: t.column
2571
+ };
2572
+ if (t.type === "isNotNA")
2573
+ return { type: "not", filter: { type: "isNA", column: t.column } };
2574
+ if (t.type === "patternEquals")
2575
+ return {
2576
+ type: "pattern",
2577
+ column: t.column,
2578
+ predicate: {
2579
+ type: "equals",
2580
+ value: t.value
2581
+ }
2582
+ };
2583
+ if (t.type === "patternNotEquals")
2584
+ return { type: "not", filter: {
2585
+ type: "pattern",
2586
+ column: t.column,
2587
+ predicate: { type: "equals", value: t.value }
2588
+ } };
2589
+ if (t.type === "patternContainSubsequence")
2590
+ return {
2591
+ type: "pattern",
2592
+ column: t.column,
2593
+ predicate: {
2594
+ type: "containSubsequence",
2595
+ value: t.value
2596
+ }
2597
+ };
2598
+ if (t.type === "patternNotContainSubsequence")
2599
+ return { type: "not", filter: {
2600
+ type: "pattern",
2601
+ column: t.column,
2602
+ predicate: { type: "containSubsequence", value: t.value }
2603
+ } };
2604
+ if (t.type === "topN")
2605
+ return {
2606
+ type: "numericalComparison",
2607
+ lhs: {
2608
+ transformer: "rank",
2609
+ column: t.column,
2610
+ descending: !0
2611
+ },
2612
+ rhs: t.n,
2613
+ allowEqual: !0
2614
+ };
2615
+ if (t.type === "bottomN")
2616
+ return {
2617
+ type: "numericalComparison",
2618
+ lhs: {
2619
+ transformer: "rank",
2620
+ column: t.column
2621
+ },
2622
+ rhs: t.n,
2623
+ allowEqual: !0
2624
+ };
2625
+ if (t.type === "lessThan")
2626
+ return {
2627
+ type: "numericalComparison",
2628
+ lhs: t.column,
2629
+ rhs: t.x
2630
+ };
2631
+ if (t.type === "greaterThan")
2632
+ return {
2633
+ type: "numericalComparison",
2634
+ rhs: t.column,
2635
+ lhs: t.x
2636
+ };
2637
+ if (t.type === "greaterThanOrEqual")
2638
+ return {
2639
+ type: "numericalComparison",
2640
+ rhs: t.column,
2641
+ lhs: t.x,
2642
+ allowEqual: !0
2643
+ };
2644
+ if (t.type === "lessThanOrEqual")
2645
+ return {
2646
+ type: "numericalComparison",
2647
+ lhs: t.column,
2648
+ rhs: t.x,
2649
+ allowEqual: !0
2650
+ };
2651
+ if (t.type === "lessThanColumn")
2652
+ return {
2653
+ type: "numericalComparison",
2654
+ lhs: t.column,
2655
+ rhs: t.rhs,
2656
+ minDiff: t.minDiff,
2657
+ allowEqual: void 0
2658
+ };
2659
+ if (t.type === "lessThanColumnOrEqual")
2660
+ return {
2661
+ type: "numericalComparison",
2662
+ lhs: t.column,
2663
+ rhs: t.rhs,
2664
+ minDiff: t.minDiff,
2665
+ allowEqual: !0
2666
+ };
2667
+ if (t.type === void 0)
2668
+ throw new Error("Filter type is undefined, this should not happen");
2669
+ ln(t);
2670
+ }
2671
+ function Me(t) {
2672
+ return t.filter((e) => e.type !== void 0).map(we);
2673
+ }
2674
+ function er(t) {
2675
+ return {
2676
+ title: t.title,
2677
+ mode: t.mode,
2678
+ steps: t.steps.filter((e) => e.filter.type == null ? !1 : e.filter.type === "or" || e.filter.type === "and" ? e.filter.filters.length > 0 : !1).map((e) => ({
2679
+ label: e.label.trim(),
2680
+ filter: we(e.filter)
2681
+ }))
2682
+ };
2683
+ }
2684
+ class tr {
2173
2685
  constructor(e) {
2174
2686
  this.handle = e;
2175
2687
  }
@@ -2186,137 +2698,144 @@ class Gn {
2186
2698
  var r;
2187
2699
  return (r = cfgRenderCtx.featureFlags) != null && r.pFrameInSetFilterSupport || (e = {
2188
2700
  ...e,
2189
- filters: ve(e.filters)
2701
+ filters: Te(e.filters)
2190
2702
  }), await platforma.pFrameDriver.calculateTableData(this.handle, e, n);
2191
2703
  }
2192
2704
  async getUniqueValues(e) {
2193
2705
  return await platforma.pFrameDriver.getUniqueValues(this.handle, e);
2194
2706
  }
2195
2707
  }
2196
- function nn(t) {
2197
- return Me({
2708
+ function un(t) {
2709
+ return Je({
2198
2710
  __isRef: !0,
2199
- blockId: se(t, "blockId"),
2200
- name: se(t, "name")
2711
+ blockId: ae(t, "blockId"),
2712
+ name: ae(t, "name")
2201
2713
  });
2202
2714
  }
2203
- function Hn(t) {
2204
- return Me({
2205
- ref: nn(se(t, "ref")),
2206
- label: se(t, "label")
2715
+ function nr(t) {
2716
+ return Je({
2717
+ ref: un(ae(t, "ref")),
2718
+ label: ae(t, "label")
2207
2719
  });
2208
2720
  }
2209
- const qn = {
2210
- sdkVersion: z
2721
+ const rr = {
2722
+ sdkVersion: X
2211
2723
  };
2212
- function rn() {
2213
- return je({ sdkVersion: z });
2724
+ function cn() {
2725
+ return $e({ sdkVersion: X });
2214
2726
  }
2215
- function zn(t) {
2727
+ function ir(t) {
2216
2728
  try {
2217
- return rn();
2729
+ return cn();
2218
2730
  } catch {
2219
2731
  return t;
2220
2732
  }
2221
2733
  }
2222
- function Yn(t) {
2734
+ function or(t) {
2223
2735
  if (typeof globalThis.getEnvironmentValue == "function")
2224
2736
  return globalThis.getEnvironmentValue(t);
2225
2737
  }
2226
2738
  export {
2227
- pn as Args,
2228
- Fe as BlockModel,
2229
- qn as CurrentSdkInfo,
2230
- F as FutureRef,
2231
- Yt as IS_VIRTUAL_COLUMN,
2232
- dn as It,
2233
- Vn as JsRenderInternal,
2234
- Re as LABEL_ANNOTATION,
2235
- Xt as LINKER_COLUMN_ANNOTATION,
2236
- fn as MainOutputs,
2237
- mt as OutputError,
2238
- At as PAnnotationLabel,
2239
- Pt as PAnnotationTrace,
2240
- X as PColumnCollection,
2241
- Gn as PFrameImpl,
2242
- B as RT_BINARY_PARTITIONED,
2243
- q as RT_BINARY_SUPER_PARTITIONED,
2739
+ gn as Args,
2740
+ Oe as BlockModel,
2741
+ rr as CurrentSdkInfo,
2742
+ L as FutureRef,
2743
+ tn as IS_VIRTUAL_COLUMN,
2744
+ bn as It,
2745
+ Jn as JsRenderInternal,
2746
+ Ue as LABEL_ANNOTATION,
2747
+ nn as LINKER_COLUMN_ANNOTATION,
2748
+ vn as MainOutputs,
2749
+ St as OutputError,
2750
+ _t as PAnnotationLabel,
2751
+ Lt as PAnnotationTrace,
2752
+ Q as PColumnCollection,
2753
+ tr as PFrameImpl,
2754
+ J as RT_BINARY_PARTITIONED,
2755
+ z as RT_BINARY_SUPER_PARTITIONED,
2244
2756
  H as RT_JSON_PARTITIONED,
2245
- le as RT_JSON_SUPER_PARTITIONED,
2246
- oe as RT_RESOURCE_MAP,
2247
- ae as RT_RESOURCE_MAP_PARTITIONED,
2248
- te as RenderCtx,
2249
- jt as ResultPool,
2250
- hn as StagingOutputs,
2251
- _t as Trace,
2252
- xt as TraceEntry,
2253
- R as TreeNodeAccessor,
2254
- gn as UiState,
2255
- Ut as allColumnsComputed,
2256
- ne as allColumnsReady,
2257
- wn as and,
2258
- kt as convertOrParsePColumnData,
2259
- Bn as createPFrameForGraphs,
2260
- $n as createPlDataTableSheet,
2261
- Ee as createPlDataTableStateV2,
2262
- Jn as createPlDataTableV2,
2263
- Un as createRowSelectionColumn,
2264
- Ue as deriveLabels,
2265
- fe as downgradeCfgOrLambda,
2266
- Oe as enrichCompatible,
2267
- kn as extractArchiveAndGetURL,
2268
- jn as extractConfig,
2269
- Dt as filterDataInfoEntries,
2270
- vn as flatten,
2271
- Hn as fromPlOption,
2272
- nn as fromPlRef,
2273
- Bt as getAllLabelColumns,
2274
- Zt as getAvailableWithLinkersAxes,
2275
- In as getBlobContent,
2276
- Ln as getBlobContentAsJson,
2277
- Tn as getBlobContentAsString,
2278
- Fn as getDownloadedBlobContent,
2279
- Yn as getEnvironmentValue,
2280
- Q as getFromCfg,
2281
- ie as getImmediate,
2282
- Dn as getImportProgress,
2283
- se as getJsonField,
2284
- Rn as getLastLogs,
2285
- Qt as getLinkerColumnsMap,
2286
- Nn as getLogHandle,
2287
- ke as getMatchingLabelColumns,
2288
- En as getOnDemandBlobContent,
2289
- Lt as getPartitionKeysList,
2290
- zn as getPlatformaOrDefault,
2291
- On as getProgressLog,
2292
- Kn as getProgressLogWithInfo,
2293
- rn as getRawPlatformaInstance,
2294
- Pn as getResourceField,
2295
- xn as getResourceValueAsJson,
2296
- Et as getUniquePartitionKeys,
2757
+ ce as RT_JSON_SUPER_PARTITIONED,
2758
+ le as RT_RESOURCE_MAP,
2759
+ ue as RT_RESOURCE_MAP_PARTITIONED,
2760
+ ne as RenderCtx,
2761
+ Wt as ResultPool,
2762
+ Cn as StagingOutputs,
2763
+ Vt as Trace,
2764
+ Et as TraceEntry,
2765
+ O as TreeNodeAccessor,
2766
+ Tn as UiState,
2767
+ Xt as allColumnsComputed,
2768
+ re as allColumnsReady,
2769
+ In as and,
2770
+ er as compileAnnotationScript,
2771
+ we as compileFilter,
2772
+ Me as compileFilters,
2773
+ Ut as convertOrParsePColumnData,
2774
+ zn as createPFrameForGraphs,
2775
+ Hn as createPlDataTableSheet,
2776
+ De as createPlDataTableStateV2,
2777
+ Gn as createPlDataTableV2,
2778
+ Xn as createRowSelectionColumn,
2779
+ ze as deriveLabels,
2780
+ me as downgradeCfgOrLambda,
2781
+ Ke as enrichCompatible,
2782
+ Un as extractArchiveAndGetURL,
2783
+ Wn as extractConfig,
2784
+ Kt as filterDataInfoEntries,
2785
+ Ze as filterUiMetadata,
2786
+ wn as flatten,
2787
+ nr as fromPlOption,
2788
+ un as fromPlRef,
2789
+ zt as getAllLabelColumns,
2790
+ on as getAvailableWithLinkersAxes,
2791
+ kn as getBlobContent,
2792
+ Dn as getBlobContentAsJson,
2793
+ On as getBlobContentAsString,
2794
+ Rn as getDownloadedBlobContent,
2795
+ or as getEnvironmentValue,
2796
+ Zn as getFilterUiMetadata,
2797
+ Qn as getFilterUiTypeOptions,
2798
+ Z as getFromCfg,
2799
+ se as getImmediate,
2800
+ Kn as getImportProgress,
2801
+ ae as getJsonField,
2802
+ Mn as getLastLogs,
2803
+ rn as getLinkerColumnsMap,
2804
+ Bn as getLogHandle,
2805
+ Re as getMatchingLabelColumns,
2806
+ Nn as getOnDemandBlobContent,
2807
+ Dt as getPartitionKeysList,
2808
+ ir as getPlatformaOrDefault,
2809
+ jn as getProgressLog,
2810
+ qn as getProgressLogWithInfo,
2811
+ cn as getRawPlatformaInstance,
2812
+ Ln as getResourceField,
2813
+ En as getResourceValueAsJson,
2814
+ Nt as getUniquePartitionKeys,
2297
2815
  ge as ifDef,
2298
- Wt as isColumnHidden,
2299
- Gt as isColumnOptional,
2300
- tn as isColumnReady,
2301
- Jt as isConfigLambda,
2302
- Cn as isEmpty,
2303
- Ce as isLabelColumn,
2304
- zt as isLinkerColumn,
2305
- cn as isolate,
2306
- mn as makeArray,
2307
- He as makeDefaultPTableParams,
2308
- Me as makeObject,
2309
- bn as mapArrayValues,
2310
- Wn as mapPTableValueToAxisKey,
2311
- yn as mapRecordValues,
2312
- _n as mapResourceFields,
2313
- Sn as not,
2314
- An as or,
2315
- be as parsePColumnData,
2316
- Mn as parseResourceMap,
2317
- yt as readOutput,
2318
- he as uniqueBy,
2319
- $t as upgradePlDataTableStateV2,
2320
- un as wrapOutputs
2816
+ Yt as isColumnHidden,
2817
+ Qt as isColumnOptional,
2818
+ an as isColumnReady,
2819
+ Gt as isConfigLambda,
2820
+ xn as isEmpty,
2821
+ Se as isLabelColumn,
2822
+ Pe as isLinkerColumn,
2823
+ yn as isolate,
2824
+ Sn as makeArray,
2825
+ Qe as makeDefaultPTableParams,
2826
+ Je as makeObject,
2827
+ An as mapArrayValues,
2828
+ Yn as mapPTableValueToAxisKey,
2829
+ Pn as mapRecordValues,
2830
+ Vn as mapResourceFields,
2831
+ Fn as not,
2832
+ _n as or,
2833
+ Ce as parsePColumnData,
2834
+ $n as parseResourceMap,
2835
+ Pt as readOutput,
2836
+ ye as uniqueBy,
2837
+ ln as unreachable,
2838
+ Ht as upgradePlDataTableStateV2,
2839
+ mn as wrapOutputs
2321
2840
  };
2322
2841
  //# sourceMappingURL=index.mjs.map