@platforma-sdk/model 1.29.12 → 1.29.13

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,24 +1,24 @@
1
- var Ne = Object.defineProperty;
2
- var Ue = (t, e, n) => e in t ? Ne(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var L = (t, e, n) => Ue(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { isPColumn as ge, mapPObjectData as me, isDataInfoEntries as Ce, isDataInfo as ye, dataInfoToEntries as Be, resolveAnchors as Me, isPColumnSpec as Q, isPartitionedDataInfoEntries as We, getAxisId as E, entriesToDataInfo as Ge, selectorsToPredicate as ue, canonicalizeAxisId as He, AnchoredIdDeriver as be, isPlRef as qe, mapValueInVOE as ze, ensurePColumn as Ye, extractAllColumns as Xe, mapPTableDef as Qe, mapDataInfo as Ze, matchAxisId as W, getColumnIdAndSpec as Se } from "@milaboratories/pl-model-common";
1
+ var Ue = Object.defineProperty;
2
+ var Me = (t, e, n) => e in t ? Ue(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var L = (t, e, n) => Me(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { isPColumn as me, mapPObjectData as ye, isDataInfoEntries as Se, isDataInfo as ve, dataInfoToEntries as We, resolveAnchors as Ge, isPColumnSpec as Q, isPartitionedDataInfoEntries as He, getAxisId as E, entriesToDataInfo as qe, selectorsToPredicate as ce, canonicalizeAxisId as ze, AnchoredIdDeriver as be, isPlRef as Ye, mapValueInVOE as Xe, ensurePColumn as Qe, extractAllColumns as Ze, mapPTableDef as et, mapDataInfo as tt, canonicalizeJson as ee, matchAxisId as W, getColumnIdAndSpec as Ie, getPColumnSpecId as we } from "@milaboratories/pl-model-common";
5
5
  export * from "@milaboratories/pl-model-common";
6
- import ve from "canonicalize";
6
+ import _e from "canonicalize";
7
7
  import { z as V } from "zod";
8
8
  export * from "@milaboratories/pl-error-like";
9
- class et extends Error {
9
+ class nt 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 tt(t) {
15
- if (!t.ok) throw new et(t.errors, t.moreErrors);
14
+ function rt(t) {
15
+ if (!t.ok) throw new nt(t.errors, t.moreErrors);
16
16
  return t.value;
17
17
  }
18
- function Nt(t) {
18
+ function Ut(t) {
19
19
  return new Proxy(t, {
20
20
  get(e, n) {
21
- return tt(e[n]);
21
+ return rt(e[n]);
22
22
  }
23
23
  });
24
24
  }
@@ -28,17 +28,17 @@ function C(t) {
28
28
  function G(t) {
29
29
  return { type: "GetFromCtx", variable: t };
30
30
  }
31
- function Ut(t) {
31
+ function Mt(t) {
32
32
  return {
33
33
  type: "Isolate",
34
34
  cfg: t
35
35
  };
36
36
  }
37
- const Bt = G("$args"), Mt = G("$it"), Wt = G("$prod"), Gt = G("$staging"), Ht = G("$ui");
37
+ const Wt = G("$args"), Gt = G("$it"), Ht = G("$prod"), qt = G("$staging"), zt = G("$ui");
38
38
  function Z(t) {
39
39
  return { type: "Immediate", value: t };
40
40
  }
41
- function Ie(t) {
41
+ function Le(t) {
42
42
  const e = {};
43
43
  for (const [n, r] of Object.entries(t)) e[n] = C(r);
44
44
  return {
@@ -46,7 +46,7 @@ function Ie(t) {
46
46
  template: e
47
47
  };
48
48
  }
49
- function qt(...t) {
49
+ function Yt(...t) {
50
50
  const e = [];
51
51
  for (const n of t) e.push(C(n));
52
52
  return {
@@ -54,14 +54,14 @@ function qt(...t) {
54
54
  template: e
55
55
  };
56
56
  }
57
- function ee(t, e) {
57
+ function te(t, e) {
58
58
  return {
59
59
  type: "GetJsonField",
60
60
  source: C(t),
61
61
  field: C(e)
62
62
  };
63
63
  }
64
- function zt(t, e, n = "$it") {
64
+ function Xt(t, e, n = "$it") {
65
65
  return {
66
66
  type: "MapRecordValues",
67
67
  source: t,
@@ -69,7 +69,7 @@ function zt(t, e, n = "$it") {
69
69
  itVar: n
70
70
  };
71
71
  }
72
- function Yt(t, e, n = "$it") {
72
+ function Qt(t, e, n = "$it") {
73
73
  return {
74
74
  type: "MapArrayValues",
75
75
  source: t,
@@ -77,46 +77,46 @@ function Yt(t, e, n = "$it") {
77
77
  itVar: n
78
78
  };
79
79
  }
80
- function Xt(t) {
80
+ function Zt(t) {
81
81
  return {
82
82
  type: "Flatten",
83
83
  source: t
84
84
  };
85
85
  }
86
- function Qt(t) {
86
+ function en(t) {
87
87
  return {
88
88
  type: "IsEmpty",
89
89
  arg: t
90
90
  };
91
91
  }
92
- function Zt(t) {
92
+ function tn(t) {
93
93
  return {
94
94
  type: "Not",
95
95
  operand: t
96
96
  };
97
97
  }
98
- function en(t, e) {
98
+ function nn(t, e) {
99
99
  return {
100
100
  type: "And",
101
101
  operand1: t,
102
102
  operand2: e
103
103
  };
104
104
  }
105
- function tn(t, e) {
105
+ function rn(t, e) {
106
106
  return {
107
107
  type: "Or",
108
108
  operand1: t,
109
109
  operand2: e
110
110
  };
111
111
  }
112
- function nn(t, e) {
112
+ function sn(t, e) {
113
113
  return {
114
114
  type: "GetResourceField",
115
115
  source: C(t),
116
116
  field: C(e)
117
117
  };
118
118
  }
119
- function rn() {
119
+ function on() {
120
120
  return function(t) {
121
121
  return {
122
122
  type: "GetResourceValueAsJson",
@@ -124,7 +124,7 @@ function rn() {
124
124
  };
125
125
  };
126
126
  }
127
- function sn(t, e, n = "$it") {
127
+ function an(t, e, n = "$it") {
128
128
  return {
129
129
  type: "MapResourceFields",
130
130
  source: t,
@@ -132,19 +132,19 @@ function sn(t, e, n = "$it") {
132
132
  itVar: n
133
133
  };
134
134
  }
135
- function on(t) {
135
+ function ln(t) {
136
136
  return {
137
137
  type: "GetBlobContent",
138
138
  source: C(t)
139
139
  };
140
140
  }
141
- function an(t) {
141
+ function un(t) {
142
142
  return {
143
143
  type: "GetBlobContentAsString",
144
144
  source: C(t)
145
145
  };
146
146
  }
147
- function ln() {
147
+ function cn() {
148
148
  return function(t) {
149
149
  return {
150
150
  type: "GetBlobContentAsJson",
@@ -152,68 +152,68 @@ function ln() {
152
152
  };
153
153
  };
154
154
  }
155
- function un(t) {
155
+ function pn(t) {
156
156
  return {
157
157
  type: "GetDownloadedBlobContent",
158
158
  source: C(t)
159
159
  };
160
160
  }
161
- function cn(t) {
161
+ function dn(t) {
162
162
  return {
163
163
  type: "GetOnDemandBlobContent",
164
164
  source: C(t)
165
165
  };
166
166
  }
167
- function pn(t, e) {
167
+ function fn(t, e) {
168
168
  return {
169
169
  type: "ExtractArchiveAndGetURL",
170
170
  format: e,
171
171
  source: C(t)
172
172
  };
173
173
  }
174
- function dn(t) {
174
+ function hn(t) {
175
175
  return {
176
176
  type: "GetImportProgress",
177
177
  source: C(t)
178
178
  };
179
179
  }
180
- function fn(t, e) {
180
+ function gn(t, e) {
181
181
  return {
182
182
  type: "GetLastLogs",
183
183
  source: C(t),
184
184
  lines: e
185
185
  };
186
186
  }
187
- function hn(t, e) {
187
+ function mn(t, e) {
188
188
  return {
189
189
  type: "GetProgressLog",
190
190
  source: C(t),
191
191
  patternToSearch: e
192
192
  };
193
193
  }
194
- function gn(t, e) {
194
+ function yn(t, e) {
195
195
  return {
196
196
  type: "GetProgressLogWithInfo",
197
197
  source: C(t),
198
198
  patternToSearch: e
199
199
  };
200
200
  }
201
- function mn(t) {
201
+ function vn(t) {
202
202
  return {
203
203
  type: "GetLogHandle",
204
204
  source: C(t)
205
205
  };
206
206
  }
207
- function nt() {
207
+ function it() {
208
208
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
209
209
  }
210
- function _e(t) {
210
+ function Te(t) {
211
211
  if (t && typeof globalThis.getPlatforma == "function")
212
212
  return globalThis.getPlatforma(t);
213
213
  if (typeof globalThis.platforma < "u") return globalThis.platforma;
214
214
  throw new Error("Can't get platforma instance.");
215
215
  }
216
- function rt() {
216
+ function st() {
217
217
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
218
218
  }
219
219
  function m() {
@@ -221,23 +221,23 @@ function m() {
221
221
  throw new Error("Not in config rendering context");
222
222
  }
223
223
  function Y(t, e) {
224
- const n = rt();
224
+ const n = st();
225
225
  if (n === void 0) return !1;
226
226
  if (t in n.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
227
227
  return n.callbackRegistry[t] = e, !0;
228
228
  }
229
- const oe = /* @__PURE__ */ new Map();
230
- function it(t, e) {
229
+ const ae = /* @__PURE__ */ new Map();
230
+ function ot(t, e) {
231
231
  t in m().callbackRegistry || (m().callbackRegistry[t] = (n) => {
232
- for (const r of oe.get(t))
232
+ for (const r of ae.get(t))
233
233
  r(n);
234
- }, oe.set(t, [])), oe.get(t).push(e);
234
+ }, ae.set(t, [])), ae.get(t).push(e);
235
235
  }
236
236
  class S {
237
237
  constructor(e, n = (r) => r) {
238
238
  L(this, "isResolved", !1);
239
239
  L(this, "resolvedValue");
240
- this.handle = e, this.postProcess = n, it(e, (r) => {
240
+ this.handle = e, this.postProcess = n, ot(e, (r) => {
241
241
  this.resolvedValue = n(r), this.isResolved = !0;
242
242
  });
243
243
  }
@@ -254,7 +254,7 @@ class S {
254
254
  return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
255
255
  }
256
256
  }
257
- function ce(t, e) {
257
+ function pe(t, e) {
258
258
  return t === void 0 ? void 0 : e(t);
259
259
  }
260
260
  class I {
@@ -296,7 +296,7 @@ class I {
296
296
  ...this.resolvePath,
297
297
  ...n.map((i) => typeof i == "string" ? i : i.field)
298
298
  ];
299
- return ce(
299
+ return pe(
300
300
  m().resolveWithCommon(this.handle, e, ...n),
301
301
  (i) => new I(i, r)
302
302
  );
@@ -318,7 +318,7 @@ class I {
318
318
  }
319
319
  getError() {
320
320
  const e = [...this.resolvePath, "error"];
321
- return ce(
321
+ return pe(
322
322
  m().getError(this.handle),
323
323
  (n) => new I(n, e)
324
324
  );
@@ -360,7 +360,7 @@ class I {
360
360
  getPColumns(e = !1, n = "") {
361
361
  const r = this.parsePObjectCollection(e, n);
362
362
  return r === void 0 ? void 0 : Object.entries(r).map(([, s]) => {
363
- if (!ge(s)) throw new Error(`not a PColumn (kind = ${s.spec.kind})`);
363
+ if (!me(s)) throw new Error(`not a PColumn (kind = ${s.spec.kind})`);
364
364
  return s;
365
365
  });
366
366
  }
@@ -378,7 +378,7 @@ class I {
378
378
  const i = {};
379
379
  for (const [s, o] of Object.entries(r)) {
380
380
  const a = [...this.resolvePath, s];
381
- i[s] = me(o, (l) => new I(l, a));
381
+ i[s] = ye(o, (l) => new I(l, a));
382
382
  }
383
383
  return i;
384
384
  }
@@ -477,66 +477,66 @@ class I {
477
477
  return s && (l = l.filter((u) => u[1] !== void 0)), l.map(([u, w]) => o(u, w));
478
478
  }
479
479
  }
480
- const Le = "staging", Te = "main", st = {
480
+ const Ee = "staging", Fe = "main", at = {
481
481
  explicitColumnsSupport: !0,
482
482
  inlineColumnsSupport: !0,
483
483
  activeArgs: !0
484
484
  };
485
- function Ee(t) {
485
+ function De(t) {
486
486
  return typeof t == "object" && t !== null && "__awaited_futures__" in t;
487
487
  }
488
- function pe(t, e, n) {
488
+ function de(t, e, n) {
489
489
  if (e.has(n)) return;
490
490
  if (e.add(n), typeof n === "object")
491
- if (Ee(n)) n.__awaited_futures__.forEach((i) => t.add(i));
491
+ if (De(n)) n.__awaited_futures__.forEach((i) => t.add(i));
492
492
  else if (Array.isArray(n))
493
- for (const i of n) pe(t, e, i);
493
+ for (const i of n) de(t, e, i);
494
494
  else
495
495
  for (const [, i] of Object.entries(n))
496
- i !== n && pe(t, e, i);
496
+ i !== n && de(t, e, i);
497
497
  }
498
- function ot(t) {
498
+ function lt(t) {
499
499
  const e = /* @__PURE__ */ new Set();
500
- return pe(e, /* @__PURE__ */ new Set(), t), e;
500
+ return de(e, /* @__PURE__ */ new Set(), t), e;
501
501
  }
502
- const yn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
502
+ const bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
503
503
  __proto__: null,
504
- GlobalCfgRenderCtxFeatureFlags: st,
505
- MainAccessorName: Te,
506
- StagingAccessorName: Le,
507
- getAllFutureAwaits: ot,
508
- isFutureAwait: Ee
509
- }, Symbol.toStringTag, { value: "Module" })), at = "pl7.app/label", lt = "pl7.app/trace", ut = V.object({
504
+ GlobalCfgRenderCtxFeatureFlags: at,
505
+ MainAccessorName: Fe,
506
+ StagingAccessorName: Ee,
507
+ getAllFutureAwaits: lt,
508
+ isFutureAwait: De
509
+ }, Symbol.toStringTag, { value: "Module" })), ut = "pl7.app/label", ct = "pl7.app/trace", pt = V.object({
510
510
  type: V.string(),
511
511
  importance: V.number().optional(),
512
512
  id: V.string().optional(),
513
513
  label: V.string()
514
- }), ct = V.array(ut), pt = 1e-3, dt = "__LABEL__", we = "__LABEL__@1";
515
- function Fe(t, e, n = {}) {
514
+ }), dt = V.array(pt), ft = 1e-3, ht = "__LABEL__", Ae = "__LABEL__@1";
515
+ function Oe(t, e, n = {}) {
516
516
  const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = t.map((d) => {
517
517
  var q, F;
518
518
  const h = e(d);
519
519
  let f, x, c;
520
520
  "spec" in h && typeof h.spec == "object" ? (f = h.spec, x = h.prefixTrace, c = h.suffixTrace) : f = h;
521
- const y = (q = f.annotations) == null ? void 0 : q[at], g = (F = f.annotations) == null ? void 0 : F[lt], v = (g ? ct.safeParse(JSON.parse(g)).data : void 0) ?? [], A = [
521
+ const y = (q = f.annotations) == null ? void 0 : q[ut], g = (F = f.annotations) == null ? void 0 : F[ct], v = (g ? dt.safeParse(JSON.parse(g)).data : void 0) ?? [], A = [
522
522
  ...x ?? [],
523
523
  ...v,
524
524
  ...c ?? []
525
525
  ];
526
526
  if (y) {
527
- const _ = { label: y, type: dt, importance: -2 };
527
+ const _ = { label: y, type: ht, importance: -2 };
528
528
  n.addLabelAsSuffix ? A.push(_) : A.splice(0, 0, _);
529
529
  }
530
530
  const D = [], $ = /* @__PURE__ */ new Map();
531
531
  for (let _ = A.length - 1; _ >= 0; --_) {
532
- const { type: R } = A[_], ie = A[_].importance ?? 0, J = ($.get(R) ?? 0) + 1;
532
+ const { type: R } = A[_], se = A[_].importance ?? 0, J = ($.get(R) ?? 0) + 1;
533
533
  $.set(R, J);
534
534
  const P = `${R}@${J}`;
535
535
  i.set(P, (i.get(P) ?? 0) + 1), r.set(
536
536
  P,
537
537
  Math.max(
538
538
  r.get(P) ?? Number.NEGATIVE_INFINITY,
539
- ie - (A.length - _) * pt
539
+ se - (A.length - _) * ft
540
540
  )
541
541
  ), D.push({ ...A[_], fullType: P, occurenceIndex: J });
542
542
  }
@@ -566,14 +566,14 @@ function Fe(t, e, n = {}) {
566
566
  };
567
567
  if (o.length === 0) {
568
568
  if (a.length !== 0) throw new Error("Assertion error.");
569
- const d = u(new Set(we));
569
+ const d = u(new Set(Ae));
570
570
  if (d === void 0) throw new Error("Assertion error.");
571
571
  return d;
572
572
  }
573
573
  let w = 0, b = 0;
574
574
  for (; w < o.length; ) {
575
575
  const d = /* @__PURE__ */ new Set();
576
- n.includeNativeLabel && d.add(we);
576
+ n.includeNativeLabel && d.add(Ae);
577
577
  for (let f = 0; f < w; ++f) d.add(o[f]);
578
578
  d.add(o[b]);
579
579
  const h = u(d);
@@ -584,11 +584,11 @@ function Fe(t, e, n = {}) {
584
584
  if (p === void 0) throw new Error("Assertion error.");
585
585
  return p;
586
586
  }
587
- const H = "PColumnData/", te = H + "ResourceMap", ne = H + "Partitioned/ResourceMap", U = H + "JsonPartitioned", K = H + "BinaryPartitioned", De = H + "Partitioned/", re = De + "JsonPartitioned", B = De + "BinaryPartitioned";
588
- function Oe(t, e, n, r = [], i) {
587
+ const H = "PColumnData/", ne = H + "ResourceMap", re = H + "Partitioned/ResourceMap", B = H + "JsonPartitioned", K = H + "BinaryPartitioned", Re = H + "Partitioned/", ie = Re + "JsonPartitioned", U = Re + "BinaryPartitioned";
588
+ function ke(t, e, n, r = [], i) {
589
589
  if (t === void 0) return !1;
590
590
  switch (t.resourceType.name) {
591
- case te: {
591
+ case ne: {
592
592
  let s = t.getInputsLocked();
593
593
  for (const o of t.listInputFields()) {
594
594
  const a = t.resolve({ field: o, assertFieldType: "Input" }), l = [...r, ...JSON.parse(o)], u = a === void 0 ? void 0 : e(a);
@@ -596,13 +596,13 @@ function Oe(t, e, n, r = [], i) {
596
596
  }
597
597
  return s;
598
598
  }
599
- case ne: {
599
+ case re: {
600
600
  let s = t.getInputsLocked();
601
601
  for (const o of t.listInputFields()) {
602
602
  const a = t.resolve({ field: o, assertFieldType: "Input" });
603
603
  if (a === void 0) s = !1;
604
604
  else {
605
- const l = [...r, ...JSON.parse(o)], u = Oe(
605
+ const l = [...r, ...JSON.parse(o)], u = ke(
606
606
  a,
607
607
  e,
608
608
  n,
@@ -618,55 +618,55 @@ function Oe(t, e, n, r = [], i) {
618
618
  throw new Error(`Unknown resource type: ${t.resourceType.name}`);
619
619
  }
620
620
  }
621
- function vn(t, e, n = !1) {
621
+ function wn(t, e, n = !1) {
622
622
  const r = [];
623
- return { isComplete: Oe(t, e, r, [], n), data: r };
623
+ return { isComplete: ke(t, e, r, [], n), data: r };
624
624
  }
625
- const de = (t) => {
625
+ const fe = (t) => {
626
626
  if (t.endsWith(".index"))
627
627
  return { baseKey: t.substring(0, t.length - 6), type: "index" };
628
628
  if (t.endsWith(".values"))
629
629
  return { baseKey: t.substring(0, t.length - 7), type: "values" };
630
630
  throw new Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
631
631
  };
632
- function ft(t) {
632
+ function gt(t) {
633
633
  if (!t) return;
634
634
  const e = t.resourceType.name, n = t.getDataAsJson(), r = [];
635
635
  let i = 0;
636
636
  switch (e) {
637
- case te:
637
+ case ne:
638
638
  i = n.keyLength;
639
639
  break;
640
- case ne:
640
+ case re:
641
641
  i = n.partitionKeyLength + n.keyLength;
642
642
  break;
643
- case U:
643
+ case B:
644
644
  case K:
645
645
  i = n.partitionKeyLength;
646
646
  break;
647
- case B:
648
- case re:
647
+ case U:
648
+ case ie:
649
649
  i = n.superPartitionKeyLength + n.partitionKeyLength;
650
650
  break;
651
651
  }
652
652
  switch (e) {
653
- case te:
654
- case U:
653
+ case ne:
654
+ case B:
655
655
  case K:
656
656
  for (let s of t.listInputFields()) {
657
- e === K && (s = de(s).baseKey);
657
+ e === K && (s = fe(s).baseKey);
658
658
  const o = [...JSON.parse(s)];
659
659
  r.push(o);
660
660
  }
661
661
  break;
662
- case ne:
663
- case B:
664
662
  case re:
663
+ case U:
664
+ case ie:
665
665
  for (const s of t.listInputFields()) {
666
666
  const o = [...JSON.parse(s)], a = t.resolve({ field: s, assertFieldType: "Input" });
667
667
  if (a !== void 0)
668
668
  for (let l of a.listInputFields()) {
669
- e === B && (l = de(l).baseKey);
669
+ e === U && (l = fe(l).baseKey);
670
670
  const u = [...o, ...JSON.parse(l)];
671
671
  r.push(u);
672
672
  }
@@ -675,7 +675,7 @@ function ft(t) {
675
675
  }
676
676
  return { data: r, keyLength: i };
677
677
  }
678
- function ht(t) {
678
+ function mt(t) {
679
679
  if (t.type !== "JsonPartitioned" && t.type !== "BinaryPartitioned")
680
680
  throw new Error(`Splitting requires Partitioned DataInfoEntries, got ${t.type}`);
681
681
  const { parts: e, partitionKeyLength: n } = t, r = [];
@@ -694,11 +694,11 @@ function ht(t) {
694
694
  }
695
695
  return r.map((i) => Array.from(i.values()));
696
696
  }
697
- function gt(t) {
697
+ function yt(t) {
698
698
  if (t === void 0) return;
699
- if (Ce(t))
700
- return ht(t);
701
- const e = ft(t);
699
+ if (Se(t))
700
+ return mt(t);
701
+ const e = gt(t);
702
702
  if (!e) return;
703
703
  const { data: n, keyLength: r } = e, i = [];
704
704
  for (let s = 0; s < r; ++s)
@@ -711,16 +711,16 @@ function gt(t) {
711
711
  }
712
712
  return i.map((s) => Array.from(s.values()));
713
713
  }
714
- function fe(t, e = []) {
714
+ function he(t, e = []) {
715
715
  if (t === void 0 || !t.getIsReadyOrError()) return;
716
716
  const n = t.resourceType.name, r = t.getDataAsJson();
717
- if (e.length > 0 && (n === re || n === B))
717
+ if (e.length > 0 && (n === ie || n === U))
718
718
  throw new Error(`Unexpected nested super-partitioned resource: ${n}`);
719
719
  switch (n) {
720
- case te:
721
720
  case ne:
721
+ case re:
722
722
  throw new Error(`Only data columns are supported, got: ${n}`);
723
- case U: {
723
+ case B: {
724
724
  if (typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
725
725
  throw new Error(`Missing partitionKeyLength in metadata for ${n}`);
726
726
  const i = [];
@@ -741,7 +741,7 @@ function fe(t, e = []) {
741
741
  throw new Error(`Missing partitionKeyLength in metadata for ${n}`);
742
742
  const i = [], s = /* @__PURE__ */ new Map();
743
743
  for (const o of t.listInputFields()) {
744
- const a = de(o), l = t.resolve({ field: o, assertFieldType: "Input" });
744
+ const a = fe(o), l = t.resolve({ field: o, assertFieldType: "Input" });
745
745
  if (l === void 0) return;
746
746
  let u = s.get(a.baseKey);
747
747
  u || (u = {}, s.set(a.baseKey, u)), a.type === "index" ? u.index = l : u.values = l;
@@ -763,16 +763,16 @@ function fe(t, e = []) {
763
763
  parts: i
764
764
  };
765
765
  }
766
- case re: {
766
+ case ie: {
767
767
  if (typeof (r == null ? void 0 : r.superPartitionKeyLength) != "number" || typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
768
768
  throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n}`);
769
769
  const i = r.superPartitionKeyLength + r.partitionKeyLength, s = [];
770
770
  for (const o of t.listInputFields()) {
771
771
  const a = t.resolve({ field: o, assertFieldType: "Input" });
772
772
  if (a === void 0) return;
773
- if (a.resourceType.name !== U)
774
- throw new Error(`Expected ${U} inside ${n}, but got ${a.resourceType.name}`);
775
- const l = fe(a, JSON.parse(o));
773
+ if (a.resourceType.name !== B)
774
+ throw new Error(`Expected ${B} inside ${n}, but got ${a.resourceType.name}`);
775
+ const l = he(a, JSON.parse(o));
776
776
  if (l === void 0) return;
777
777
  if (l.type !== "JsonPartitioned")
778
778
  throw new Error(`Unexpected inner result type for ${n}: ${l.type}`);
@@ -784,7 +784,7 @@ function fe(t, e = []) {
784
784
  parts: s
785
785
  };
786
786
  }
787
- case B: {
787
+ case U: {
788
788
  if (typeof (r == null ? void 0 : r.superPartitionKeyLength) != "number" || typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
789
789
  throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n}`);
790
790
  const i = r.superPartitionKeyLength + r.partitionKeyLength, s = [];
@@ -793,7 +793,7 @@ function fe(t, e = []) {
793
793
  if (a === void 0) return;
794
794
  if (a.resourceType.name !== K)
795
795
  throw new Error(`Expected ${K} inside ${n}, but got ${a.resourceType.name}`);
796
- const l = fe(a, JSON.parse(o));
796
+ const l = he(a, JSON.parse(o));
797
797
  if (l === void 0) return;
798
798
  if (l.type !== "BinaryPartitioned")
799
799
  throw new Error(`Unexpected inner result type for ${n}: ${l.type}`);
@@ -809,15 +809,15 @@ function fe(t, e = []) {
809
809
  throw new Error(`Unknown resource type: ${n}`);
810
810
  }
811
811
  }
812
- function mt(t) {
812
+ function vt(t) {
813
813
  if (t !== void 0) {
814
- if (Ce(t)) return t;
815
- if (ye(t)) return Be(t);
816
- if (t instanceof I) return fe(t);
814
+ if (Se(t)) return t;
815
+ if (ve(t)) return We(t);
816
+ if (t instanceof I) return he(t);
817
817
  throw new Error(`Unexpected input type: ${typeof t}`);
818
818
  }
819
819
  }
820
- function yt(t, e) {
820
+ function bt(t, e) {
821
821
  const n = [...e].sort((s, o) => o[0] - s[0]);
822
822
  if (t.type === "JsonPartitioned" || t.type === "BinaryPartitioned") {
823
823
  const { partitionKeyLength: s } = t;
@@ -877,39 +877,39 @@ function yt(t, e) {
877
877
  }
878
878
  }
879
879
  }
880
- class vt {
880
+ class wt {
881
881
  constructor(e) {
882
882
  this.columns = e;
883
883
  }
884
884
  selectColumns(e) {
885
- const n = typeof e == "function" ? e : ue(e);
885
+ const n = typeof e == "function" ? e : ce(e);
886
886
  return this.columns.filter((r) => n(r.spec));
887
887
  }
888
888
  }
889
- function bt(t) {
889
+ function At(t) {
890
890
  if (t)
891
891
  return t.map((e) => ({
892
- type: `split:${He(e.axisId)}`,
892
+ type: `split:${ze(e.axisId)}`,
893
893
  label: e.label,
894
894
  importance: 1e6
895
895
  // High importance for split filters in labels
896
896
  }));
897
897
  }
898
- function wt(t) {
898
+ function Pt(t) {
899
899
  if (t)
900
900
  return t.map((e) => [e.axisIdx, e.value]);
901
901
  }
902
- function At(t, e) {
902
+ function xt(t, e) {
903
903
  if (!e || e.length === 0) return t;
904
904
  const n = [...e].sort((r, i) => r[0] - i[0]);
905
- return ve({ id: t, axisFilters: n });
905
+ return _e({ id: t, axisFilters: n });
906
906
  }
907
- function Pt(t) {
907
+ function Ct(t) {
908
908
  if (!t || typeof t != "object") return !1;
909
909
  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);
910
910
  return !!e.domainAnchor || n || r;
911
911
  }
912
- function xt(t) {
912
+ function St(t) {
913
913
  if (typeof t != "object" || !("axes" in t) || t.axes === void 0)
914
914
  return [];
915
915
  const e = t.axes.map((n, r) => typeof n == "object" && "split" in n && n.split === !0 ? r : -1).filter((n) => n !== -1);
@@ -917,10 +917,10 @@ function xt(t) {
917
917
  throw new Error("Axis splitting is not supported when `partialAxesMatch` is defined.");
918
918
  return e.sort((n, r) => n - r), e;
919
919
  }
920
- class he {
920
+ class ge {
921
921
  constructor() {
922
922
  L(this, "defaultProviderStore", []);
923
- L(this, "providers", [new vt(this.defaultProviderStore)]);
923
+ L(this, "providers", [new wt(this.defaultProviderStore)]);
924
924
  L(this, "axisLabelProviders", []);
925
925
  }
926
926
  addColumnProvider(e) {
@@ -948,12 +948,12 @@ class he {
948
948
  ...i ?? {}
949
949
  }, l = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], u = [];
950
950
  for (const p of l) {
951
- const d = Pt(p);
951
+ const d = Ct(p);
952
952
  let h;
953
953
  if (d) {
954
954
  if (!r)
955
955
  throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");
956
- h = Me(r.anchors, p, n);
956
+ h = Ge(r.anchors, p, n);
957
957
  } else
958
958
  h = p;
959
959
  const f = /* @__PURE__ */ new Set(), x = [];
@@ -965,19 +965,19 @@ class he {
965
965
  }
966
966
  }
967
967
  if (x.length === 0) continue;
968
- const c = xt(p), y = c.length > 0;
968
+ const c = St(p), y = c.length > 0;
969
969
  for (const g of x) {
970
970
  if (!Q(g.spec)) continue;
971
971
  const v = g.spec;
972
972
  if (y) {
973
- const A = mt(g.data);
973
+ const A = vt(g.data);
974
974
  if (!A) {
975
975
  if (s) continue;
976
976
  return;
977
977
  }
978
- if (!We(A))
978
+ if (!He(A))
979
979
  throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${A.type} for column ${g.id}`);
980
- const D = gt(A), $ = c[c.length - 1];
980
+ const D = yt(A), $ = c[c.length - 1];
981
981
  if ($ >= A.partitionKeyLength)
982
982
  throw new Error(`Not enough partition keys (${A.partitionKeyLength}) for requested split axes (max index ${$}) in column ${v.name}`);
983
983
  const q = c.map((P) => this.findLabels(E(v.axesSpec[P]))), F = [], _ = (P, N) => {
@@ -999,14 +999,14 @@ class he {
999
999
  };
1000
1000
  if (_([], 0), F.length === 0)
1001
1001
  continue;
1002
- const R = [...v.axesSpec], ie = c.map((P) => P);
1002
+ const R = [...v.axesSpec], se = c.map((P) => P);
1003
1003
  for (let P = c.length - 1; P >= 0; P--)
1004
1004
  R.splice(c[P], 1);
1005
1005
  const J = { ...v, axesSpec: R };
1006
1006
  for (const P of F) {
1007
1007
  const N = P.map((O, k) => {
1008
- const z = ie[k], $e = E(v.axesSpec[z]), se = q[k], Je = (se == null ? void 0 : se[O]) ?? String(O);
1009
- return { axisIdx: z, axisId: $e, value: O, label: Je };
1008
+ const z = se[k], Ne = E(v.axesSpec[z]), oe = q[k], Be = (oe == null ? void 0 : oe[O]) ?? String(O);
1009
+ return { axisIdx: z, axisId: Ne, value: O, label: Be };
1010
1010
  });
1011
1011
  u.push({
1012
1012
  type: "split",
@@ -1027,18 +1027,18 @@ class he {
1027
1027
  }
1028
1028
  }
1029
1029
  if (u.length === 0) return [];
1030
- const w = Fe(
1030
+ const w = Oe(
1031
1031
  u,
1032
1032
  (p) => ({
1033
1033
  spec: p.spec,
1034
- suffixTrace: p.type === "split" ? bt(p.axisFilters) : void 0
1034
+ suffixTrace: p.type === "split" ? At(p.axisFilters) : void 0
1035
1035
  }),
1036
1036
  a
1037
1037
  ), b = [];
1038
1038
  for (const { value: p, label: d } of w) {
1039
- const { originalColumn: h, spec: f } = p, x = p.type === "split" ? p.axisFilters : void 0, c = wt(x);
1039
+ const { originalColumn: h, spec: f } = p, x = p.type === "split" ? p.axisFilters : void 0, c = Pt(x);
1040
1040
  let y;
1041
- r ? y = r.deriveS(f, c) : y = At(h.id, c);
1041
+ r ? y = r.deriveS(f, c) : y = xt(h.id, c);
1042
1042
  let g = { ...p.adjustedSpec };
1043
1043
  o && (g = {
1044
1044
  ...g,
@@ -1049,7 +1049,7 @@ class he {
1049
1049
  }), b.push({
1050
1050
  id: y,
1051
1051
  spec: g,
1052
- data: () => p.type === "split" ? Ge(yt(p.dataEntries, c)) : p.originalColumn.data,
1052
+ data: () => p.type === "split" ? qe(bt(p.dataEntries, c)) : p.originalColumn.data,
1053
1053
  label: d
1054
1054
  });
1055
1055
  }
@@ -1078,17 +1078,17 @@ class he {
1078
1078
  return i;
1079
1079
  }
1080
1080
  }
1081
- function ae(t, e) {
1081
+ function le(t, e) {
1082
1082
  if (t === void 0) return e === void 0;
1083
1083
  if (e === void 0) return !0;
1084
1084
  for (const n in e)
1085
1085
  if (t[n] !== e[n]) return !1;
1086
1086
  return !0;
1087
1087
  }
1088
- function Ae(t) {
1089
- return me(t, (e) => e instanceof I ? e.handle : ye(e) ? Ze(e, (n) => n.handle) : e);
1088
+ function Pe(t) {
1089
+ return ye(t, (e) => e instanceof I ? e.handle : ve(e) ? tt(e, (n) => n.handle) : e);
1090
1090
  }
1091
- class Ct {
1091
+ class It {
1092
1092
  constructor() {
1093
1093
  L(this, "ctx", m());
1094
1094
  }
@@ -1099,8 +1099,8 @@ class Ct {
1099
1099
  return this.ctx.calculateOptions(e);
1100
1100
  }
1101
1101
  getOptions(e, n) {
1102
- const r = typeof e == "function" ? e : ue(e), i = this.getSpecs().entries.filter((s) => r(s.obj));
1103
- return typeof n == "object" || typeof n > "u" ? Fe(i, (s) => s.obj, n ?? {}).map(({ value: { ref: s }, label: o }) => ({
1102
+ const r = typeof e == "function" ? e : ce(e), i = this.getSpecs().entries.filter((s) => r(s.obj));
1103
+ return typeof n == "object" || typeof n > "u" ? Oe(i, (s) => s.obj, n ?? {}).map(({ value: { ref: s }, label: o }) => ({
1104
1104
  ref: s,
1105
1105
  label: o
1106
1106
  })) : i.map((s) => ({
@@ -1112,7 +1112,7 @@ class Ct {
1112
1112
  if (e instanceof be) return e;
1113
1113
  const n = {};
1114
1114
  for (const [r, i] of Object.entries(e))
1115
- if (qe(i)) {
1115
+ if (Ye(i)) {
1116
1116
  const s = this.getPColumnSpecByRef(i);
1117
1117
  if (!s)
1118
1118
  return;
@@ -1132,7 +1132,7 @@ class Ct {
1132
1132
  getAnchoredPColumns(e, n, r) {
1133
1133
  const i = this.resolveAnchorCtx(e);
1134
1134
  if (i)
1135
- return new he().addColumnProvider(this).addAxisLabelProvider(this).getColumns(n, {
1135
+ return new ge().addColumnProvider(this).addAxisLabelProvider(this).getColumns(n, {
1136
1136
  ...r,
1137
1137
  anchorCtx: i
1138
1138
  });
@@ -1169,7 +1169,7 @@ class Ct {
1169
1169
  getCanonicalOptions(e, n, r) {
1170
1170
  const i = this.resolveAnchorCtx(e);
1171
1171
  if (!i) return;
1172
- const s = new he().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(n, {
1172
+ const s = new ge().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(n, {
1173
1173
  ...r,
1174
1174
  anchorCtx: i
1175
1175
  });
@@ -1212,7 +1212,7 @@ class Ct {
1212
1212
  ref: n.ref,
1213
1213
  obj: {
1214
1214
  ...n.obj,
1215
- data: ze(
1215
+ data: Xe(
1216
1216
  n.obj.data,
1217
1217
  (r) => new I(r, [n.ref.blockId, n.ref.name])
1218
1218
  )
@@ -1241,7 +1241,7 @@ class Ct {
1241
1241
  )) == null ? void 0 : r.obj;
1242
1242
  const n = this.ctx.getDataFromResultPoolByRef(e.blockId, e.name);
1243
1243
  if (n)
1244
- return me(
1244
+ return ye(
1245
1245
  n,
1246
1246
  (i) => new I(i, [e.blockId, e.name])
1247
1247
  );
@@ -1254,7 +1254,7 @@ class Ct {
1254
1254
  getPColumnByRef(e) {
1255
1255
  const n = this.getDataByRef(e);
1256
1256
  if (n)
1257
- return Ye(n);
1257
+ return Qe(n);
1258
1258
  }
1259
1259
  /**
1260
1260
  * Returns spec associated with the ref ensuring that it is a p-column spec.
@@ -1286,10 +1286,10 @@ class Ct {
1286
1286
  if (!Q(r.obj.spec))
1287
1287
  continue;
1288
1288
  const i = r.obj.spec;
1289
- if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && ae(e.domain, i.domain)) {
1289
+ if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && le(e.domain, i.domain)) {
1290
1290
  for (let s = 0; s < e.axesSpec.length; ++s) {
1291
1291
  const o = e.axesSpec[s], a = i.axesSpec[s];
1292
- if (o.name !== a.name || o.type !== a.type || !ae(o.domain, a.domain))
1292
+ if (o.name !== a.name || o.type !== a.type || !le(o.domain, a.domain))
1293
1293
  continue e;
1294
1294
  }
1295
1295
  n.push(r.obj);
@@ -1304,9 +1304,9 @@ class Ct {
1304
1304
  findLabels(e) {
1305
1305
  const n = this.getData();
1306
1306
  for (const r of n.entries) {
1307
- if (!ge(r.obj)) continue;
1307
+ if (!me(r.obj)) continue;
1308
1308
  const i = r.obj.spec;
1309
- if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type && ae(e.domain, i.axesSpec[0].domain)) {
1309
+ if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type && le(e.domain, i.axesSpec[0].domain)) {
1310
1310
  if (r.obj.data.resourceType.name !== "PColumnData/Json")
1311
1311
  throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
1312
1312
  return Object.fromEntries(
@@ -1325,13 +1325,13 @@ class Ct {
1325
1325
  * @returns An array of PColumn objects matching the selectors. Data is loaded on first access.
1326
1326
  */
1327
1327
  selectColumns(e) {
1328
- const n = typeof e == "function" ? e : ue(e);
1328
+ const n = typeof e == "function" ? e : ce(e);
1329
1329
  return this.getSpecs().entries.filter(({ obj: i }) => Q(i) ? n(i) : !1).map(({ ref: i, obj: s }) => {
1330
1330
  const o = s;
1331
1331
  let a = null;
1332
1332
  const l = this;
1333
1333
  return {
1334
- id: ve(i),
1334
+ id: _e(i),
1335
1335
  spec: o,
1336
1336
  get data() {
1337
1337
  var u;
@@ -1363,7 +1363,7 @@ class X {
1363
1363
  L(this, "uiState");
1364
1364
  // lazy rendering because this feature is rarely used
1365
1365
  L(this, "_activeArgsCache");
1366
- L(this, "resultPool", new Ct());
1366
+ L(this, "resultPool", new It());
1367
1367
  this.ctx = m(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
1368
1368
  }
1369
1369
  /**
@@ -1380,16 +1380,16 @@ class X {
1380
1380
  // return this.ctx.featureFlags;
1381
1381
  // }
1382
1382
  getNamedAccessor(e) {
1383
- return ce(
1383
+ return pe(
1384
1384
  this.ctx.getAccessorHandleByName(e),
1385
1385
  (n) => new I(n, [e])
1386
1386
  );
1387
1387
  }
1388
1388
  get prerun() {
1389
- return this.getNamedAccessor(Le);
1389
+ return this.getNamedAccessor(Ee);
1390
1390
  }
1391
1391
  get outputs() {
1392
- return this.getNamedAccessor(Te);
1392
+ return this.getNamedAccessor(Fe);
1393
1393
  }
1394
1394
  /**
1395
1395
  * Find labels data for a given axis id. It will search for a label column and return its data as a map.
@@ -1401,13 +1401,13 @@ class X {
1401
1401
  }
1402
1402
  verifyInlineAndExplicitColumnsSupport(e) {
1403
1403
  var i;
1404
- const n = e.some((s) => !(s.data instanceof I) || ye(s.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
1404
+ const n = e.some((s) => !(s.data instanceof I) || ve(s.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
1405
1405
  if (n && !r) throw Error("Inline or explicit columns not supported");
1406
1406
  }
1407
1407
  // TODO remove all non-PColumn fields
1408
1408
  createPFrame(e) {
1409
1409
  return this.verifyInlineAndExplicitColumnsSupport(e), this.ctx.createPFrame(
1410
- e.map((n) => Ae(n))
1410
+ e.map((n) => Pe(n))
1411
1411
  );
1412
1412
  }
1413
1413
  createPTable(e) {
@@ -1419,8 +1419,8 @@ class X {
1419
1419
  },
1420
1420
  filters: e.filters ?? [],
1421
1421
  sorting: e.sorting ?? []
1422
- } : n = e, this.verifyInlineAndExplicitColumnsSupport(Xe(n.src)), this.ctx.createPTable(
1423
- Qe(n, (r) => Ae(r))
1422
+ } : n = e, this.verifyInlineAndExplicitColumnsSupport(Ze(n.src)), this.ctx.createPTable(
1423
+ et(n, (r) => Pe(r))
1424
1424
  );
1425
1425
  }
1426
1426
  /** @deprecated scheduled for removal from SDK */
@@ -1432,19 +1432,19 @@ class X {
1432
1432
  return this.ctx.getCurrentUnstableMarker();
1433
1433
  }
1434
1434
  }
1435
- const M = "1.29.12";
1436
- function St(t) {
1435
+ const M = "1.29.13";
1436
+ function _t(t) {
1437
1437
  return t.__renderLambda === !0;
1438
1438
  }
1439
- function le(t) {
1439
+ function ue(t) {
1440
1440
  if (t !== void 0)
1441
- return St(t) ? t.handle : t;
1441
+ return _t(t) ? t.handle : t;
1442
1442
  }
1443
1443
  function j(t) {
1444
1444
  if (t !== void 0)
1445
1445
  return typeof t == "string" ? { __renderLambda: !0, handle: t, retentive: !1 } : t;
1446
1446
  }
1447
- function bn(t) {
1447
+ function An(t) {
1448
1448
  if (t.v3 !== void 0) {
1449
1449
  const {
1450
1450
  initialArgs: e,
@@ -1674,32 +1674,40 @@ class T {
1674
1674
  sdkVersion: M,
1675
1675
  renderingMode: this._renderingMode,
1676
1676
  initialArgs: this._initialArgs,
1677
- inputsValid: le(this._inputsValid),
1678
- sections: le(this._sections),
1677
+ inputsValid: ue(this._inputsValid),
1678
+ sections: ue(this._sections),
1679
1679
  outputs: Object.fromEntries(
1680
- Object.entries(this._outputs).map(([n, r]) => [n, le(r)])
1680
+ Object.entries(this._outputs).map(([n, r]) => [n, ue(r)])
1681
1681
  )
1682
1682
  };
1683
- return nt() ? _e({ sdkVersion: M }) : { config: e };
1683
+ return it() ? Te({ sdkVersion: M }) : { config: e };
1684
1684
  }
1685
1685
  }
1686
- function wn(t) {
1687
- return ve(t);
1686
+ function Pn(t) {
1687
+ const e = t.type;
1688
+ switch (e) {
1689
+ case "axis":
1690
+ return ee(t);
1691
+ case "column":
1692
+ return ee(t);
1693
+ default:
1694
+ throw Error(`unsupported column type: ${e}`);
1695
+ }
1688
1696
  }
1689
- function It(t) {
1697
+ function Lt(t) {
1690
1698
  return JSON.parse(t);
1691
1699
  }
1692
- function An(t) {
1700
+ function xn(t) {
1693
1701
  return t.axesSpec.length === 1 && t.name === "pl7.app/label";
1694
1702
  }
1695
- function Re(t) {
1696
- return new he().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
1703
+ function je(t) {
1704
+ return new ge().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
1697
1705
  name: "pl7.app/label",
1698
1706
  axes: [{}]
1699
1707
  // exactly one axis
1700
1708
  }, { dontWaitAllData: !0 });
1701
1709
  }
1702
- function ke(t, e) {
1710
+ function Ve(t, e) {
1703
1711
  const n = (i, s) => {
1704
1712
  let o = i.toString();
1705
1713
  if (s)
@@ -1731,7 +1739,7 @@ function ke(t, e) {
1731
1739
  }
1732
1740
  return [...r.values()];
1733
1741
  }
1734
- function je(t) {
1742
+ function Ke(t) {
1735
1743
  const e = (i) => Array.isArray(i), n = (i) => i instanceof I, r = (i) => typeof i == "object" && "type" in i;
1736
1744
  return t.map((i) => i.data).every((i) => {
1737
1745
  if (e(i))
@@ -1751,7 +1759,7 @@ function je(t) {
1751
1759
  throw Error(`unsupported column data type: ${i}`);
1752
1760
  });
1753
1761
  }
1754
- function Ve(t, e, n, r, i, s) {
1762
+ function $e(t, e, n, r, i, s) {
1755
1763
  let o = t;
1756
1764
  const a = [];
1757
1765
  if (s) {
@@ -1772,26 +1780,26 @@ function Ve(t, e, n, r, i, s) {
1772
1780
  sorting: i
1773
1781
  };
1774
1782
  }
1775
- function Pn(t, e, n, r) {
1783
+ function Cn(t, e, n, r) {
1776
1784
  var u, w;
1777
1785
  Array.isArray(r) && (r = { filters: r });
1778
- const i = (r == null ? void 0 : r.coreJoinType) ?? "full", s = [...(r == null ? void 0 : r.filters) ?? [], ...((u = n == null ? void 0 : n.pTableParams) == null ? void 0 : u.filters) ?? []], o = ((w = n == null ? void 0 : n.pTableParams) == null ? void 0 : w.sorting) ?? [], a = Re(t.resultPool);
1786
+ const i = (r == null ? void 0 : r.coreJoinType) ?? "full", s = [...(r == null ? void 0 : r.filters) ?? [], ...((u = n == null ? void 0 : n.pTableParams) == null ? void 0 : u.filters) ?? []], o = ((w = n == null ? void 0 : n.pTableParams) == null ? void 0 : w.sorting) ?? [], a = je(t.resultPool);
1779
1787
  if (!a) return;
1780
- const l = ke(e.map(Se), a);
1781
- if (je([...e, ...l]))
1788
+ const l = Ve(e.map(Ie), a);
1789
+ if (Ke([...e, ...l]))
1782
1790
  return t.createPTable(
1783
- Ve(e, l, i, s, o, r == null ? void 0 : r.coreColumnPredicate)
1791
+ $e(e, l, i, s, o, r == null ? void 0 : r.coreColumnPredicate)
1784
1792
  );
1785
1793
  }
1786
- function _t(t) {
1794
+ function Tt(t) {
1787
1795
  var e;
1788
1796
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "optional";
1789
1797
  }
1790
- function xn(t, e, n, r, i) {
1798
+ function Sn(t, e, n, r, i) {
1791
1799
  var f, x;
1792
1800
  const s = (i == null ? void 0 : i.coreJoinType) ?? "full", o = [...(i == null ? void 0 : i.filters) ?? [], ...((f = r == null ? void 0 : r.pTableParams) == null ? void 0 : f.filters) ?? []], a = ((x = r == null ? void 0 : r.pTableParams) == null ? void 0 : x.sorting) ?? [], l = e.find((c) => n(c.spec));
1793
1801
  if (!l) return;
1794
- const u = Re(t.resultPool);
1802
+ const u = je(t.resultPool);
1795
1803
  if (!u) return;
1796
1804
  const w = [
1797
1805
  ...l.spec.axesSpec.map((c) => ({
@@ -1807,21 +1815,21 @@ function xn(t, e, n, r, i) {
1807
1815
  ], b = new Set((() => {
1808
1816
  var y, g;
1809
1817
  if (s === "inner") return [];
1810
- const c = (g = (y = r == null ? void 0 : r.gridState.columnVisibility) == null ? void 0 : y.hiddenColIds) == null ? void 0 : g.map(It).filter((v) => v.type === "column").map((v) => v.id);
1811
- return c || e.filter((v) => _t(v.spec)).map((v) => v.id);
1818
+ const c = (g = (y = r == null ? void 0 : r.gridState.columnVisibility) == null ? void 0 : y.hiddenColIds) == null ? void 0 : g.map(Lt).filter((v) => v.type === "column").map((v) => v.id);
1819
+ return c || e.filter((v) => Tt(v.spec)).map((v) => v.id);
1812
1820
  })());
1813
1821
  b.delete(l.id), [...o.map((c) => c.column), ...a.map((c) => c.column)].filter((c) => c.type === "column").map((c) => b.delete(c.id));
1814
- const p = e.filter((c) => !b.has(c.id)), d = ke(p.map(Se), u);
1815
- if (!je([...p, ...d])) return;
1822
+ const p = e.filter((c) => !b.has(c.id)), d = Ve(p.map(Ie), u);
1823
+ if (!Ke([...p, ...d])) return;
1816
1824
  const h = t.createPTable(
1817
- Ve(e, d, s, o, a, i == null ? void 0 : i.coreColumnPredicate)
1825
+ $e(e, d, s, o, a, i == null ? void 0 : i.coreColumnPredicate)
1818
1826
  );
1819
1827
  return {
1820
1828
  tableSpec: w,
1821
1829
  tableHandle: h
1822
1830
  };
1823
1831
  }
1824
- function Cn(t, e, n) {
1832
+ function In(t, e, n) {
1825
1833
  const r = t.resultPool.findLabels(e);
1826
1834
  return {
1827
1835
  axis: e,
@@ -1832,7 +1840,7 @@ function Cn(t, e, n) {
1832
1840
  defaultValue: n[0]
1833
1841
  };
1834
1842
  }
1835
- const Lt = (t, e) => {
1843
+ const Et = (t, e) => {
1836
1844
  let n = t.toString();
1837
1845
  return e == null || e.forEach((r) => {
1838
1846
  if (r)
@@ -1840,7 +1848,7 @@ const Lt = (t, e) => {
1840
1848
  n += i, n += s;
1841
1849
  }), n;
1842
1850
  };
1843
- function Tt(t) {
1851
+ function Ft(t) {
1844
1852
  if (!t.length)
1845
1853
  return [];
1846
1854
  let e = [[]];
@@ -1851,22 +1859,22 @@ function Tt(t) {
1851
1859
  }), e = r;
1852
1860
  }), e;
1853
1861
  }
1854
- function Et(t, e) {
1862
+ function Dt(t, e) {
1855
1863
  const n = t.spec.axesSpec.map(E);
1856
1864
  return e.spec.axesSpec.map(E).every((i) => n.some((s) => W(s, i) && W(i, s)));
1857
1865
  }
1858
- function Ke(t, e) {
1866
+ function Je(t, e) {
1859
1867
  const n = t.spec.axesSpec.map(E);
1860
1868
  return e.spec.axesSpec.map(E).every((i) => n.some((s) => W(s, i)));
1861
1869
  }
1862
- const Ft = "pl7.app/graph/isVirtual", Pe = "pl7.app/label";
1863
- function xe(t, e) {
1870
+ const Ot = "pl7.app/graph/isVirtual", xe = "pl7.app/label";
1871
+ function Ce(t, e) {
1864
1872
  const n = t.spec.axesSpec.map(E), r = e.spec.axesSpec.map(E);
1865
- if (Et(t, e))
1873
+ if (Dt(t, e))
1866
1874
  return [];
1867
- if (!Ke(t, e))
1875
+ if (!Je(t, e))
1868
1876
  return [];
1869
- const o = r.map((b) => n.filter((p) => W(p, b))), a = Tt(o), l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), w = a.map((b) => {
1877
+ const o = r.map((b) => n.filter((p) => W(p, b))), a = Ft(o), l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), w = a.map((b) => {
1870
1878
  const p = /* @__PURE__ */ new Set();
1871
1879
  return b.map((d, h) => {
1872
1880
  const f = e.spec.axesSpec[h].domain, x = d.domain;
@@ -1885,14 +1893,14 @@ function xe(t, e) {
1885
1893
  w.some((p) => !p.has(b)) && u.add(b);
1886
1894
  }), a.map((b, p) => {
1887
1895
  var c;
1888
- const d = Lt(e.id, b.map((y) => y.domain)), h = ((c = e.spec.annotations) == null ? void 0 : c[Pe]) ?? "", f = [...w[p]].filter((y) => u.has(y)).sort().map((y) => {
1896
+ const d = Et(e.id, b.map((y) => y.domain)), h = ((c = e.spec.annotations) == null ? void 0 : c[xe]) ?? "", f = [...w[p]].filter((y) => u.has(y)).sort().map((y) => {
1889
1897
  var g;
1890
1898
  return (g = JSON.parse(y)) == null ? void 0 : g[1];
1891
1899
  }).join(" / "), x = {
1892
1900
  ...e.spec.annotations,
1893
- [Ft]: "true"
1901
+ [Ot]: "true"
1894
1902
  };
1895
- return (h || f) && (x[Pe] = h && f ? h + " / " + f : h + f), {
1903
+ return (h || f) && (x[xe] = h && f ? h + " / " + f : h + f), {
1896
1904
  id: d,
1897
1905
  spec: {
1898
1906
  ...e.spec,
@@ -1906,32 +1914,38 @@ function xe(t, e) {
1906
1914
  };
1907
1915
  });
1908
1916
  }
1909
- function Dt(t) {
1917
+ function Rt(t) {
1910
1918
  const e = [];
1911
1919
  for (let n = 0; n < t.length; n++)
1912
1920
  for (let r = n + 1; r < t.length; r++) {
1913
1921
  const i = t[n], s = t[r];
1914
1922
  e.push(
1915
- ...xe(i, s),
1916
- ...xe(s, i)
1923
+ ...Ce(i, s),
1924
+ ...Ce(s, i)
1917
1925
  );
1918
1926
  }
1919
1927
  return e;
1920
1928
  }
1921
- function Ot(t, e) {
1922
- const n = [...t];
1923
- for (const r of e)
1924
- for (const i of t) {
1925
- if (i.id === r.id)
1926
- break;
1927
- if (Ke(i, r)) {
1928
- n.push(r);
1929
- break;
1930
- }
1929
+ function kt(t, e) {
1930
+ const n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map();
1931
+ t.forEach((s) => {
1932
+ n.add(s.id), r.set(ee(we(s.spec)), s);
1933
+ });
1934
+ const i = /* @__PURE__ */ new Map();
1935
+ for (const s of e) {
1936
+ if (n.has(s.id)) continue;
1937
+ const o = ee(we(s.spec));
1938
+ if (!r.has(o)) {
1939
+ for (const a of r.values())
1940
+ if (Je(a, s)) {
1941
+ i.set(o, s);
1942
+ break;
1943
+ }
1931
1944
  }
1932
- return n;
1945
+ }
1946
+ return [...r.values(), ...i.values()];
1933
1947
  }
1934
- const Rt = [
1948
+ const jt = [
1935
1949
  "Int",
1936
1950
  "Long",
1937
1951
  "Float",
@@ -1939,15 +1953,15 @@ const Rt = [
1939
1953
  "String",
1940
1954
  "Bytes"
1941
1955
  ];
1942
- function Sn(t, e) {
1956
+ function _n(t, e) {
1943
1957
  if (e === void 0) return;
1944
- const n = t.resultPool.getData().entries.map((s) => s.obj).filter(ge).filter((s) => Rt.includes(s.spec.valueType)), r = Ot(e, n), i = [...r, ...Dt(r)];
1958
+ const n = t.resultPool.getData().entries.map((s) => s.obj).filter(me).filter((s) => jt.includes(s.spec.valueType)), r = kt(e, n), i = [...r, ...Rt(r)];
1945
1959
  if (!i.some(
1946
1960
  (s) => s.data instanceof I && !s.data.getIsReadyOrError()
1947
1961
  ))
1948
1962
  return t.createPFrame(i);
1949
1963
  }
1950
- class In {
1964
+ class Ln {
1951
1965
  constructor(e) {
1952
1966
  this.handle = e;
1953
1967
  }
@@ -1967,121 +1981,121 @@ class In {
1967
1981
  return await platforma.pFrameDriver.getUniqueValues(this.handle, e);
1968
1982
  }
1969
1983
  }
1970
- function kt(t) {
1971
- return Ie({
1984
+ function Vt(t) {
1985
+ return Le({
1972
1986
  __isRef: !0,
1973
- blockId: ee(t, "blockId"),
1974
- name: ee(t, "name")
1987
+ blockId: te(t, "blockId"),
1988
+ name: te(t, "name")
1975
1989
  });
1976
1990
  }
1977
- function _n(t) {
1978
- return Ie({
1979
- ref: kt(ee(t, "ref")),
1980
- label: ee(t, "label")
1991
+ function Tn(t) {
1992
+ return Le({
1993
+ ref: Vt(te(t, "ref")),
1994
+ label: te(t, "label")
1981
1995
  });
1982
1996
  }
1983
- const Ln = {
1997
+ const En = {
1984
1998
  sdkVersion: M
1985
1999
  };
1986
- function jt() {
1987
- return _e({ sdkVersion: M });
2000
+ function Kt() {
2001
+ return Te({ sdkVersion: M });
1988
2002
  }
1989
- function Tn(t) {
2003
+ function Fn(t) {
1990
2004
  try {
1991
- return jt();
2005
+ return Kt();
1992
2006
  } catch {
1993
2007
  return t;
1994
2008
  }
1995
2009
  }
1996
- function En(t) {
2010
+ function Dn(t) {
1997
2011
  if (typeof globalThis.getEnvironmentValue == "function")
1998
2012
  return globalThis.getEnvironmentValue(t);
1999
2013
  }
2000
2014
  export {
2001
- Bt as Args,
2015
+ Wt as Args,
2002
2016
  T as BlockModel,
2003
- Ln as CurrentSdkInfo,
2017
+ En as CurrentSdkInfo,
2004
2018
  S as FutureRef,
2005
- Ft as IS_VIRTUAL_COLUMN,
2006
- Mt as It,
2007
- yn as JsRenderInternal,
2008
- Pe as LABEL_ANNOTATION,
2009
- Wt as MainOutputs,
2010
- et as OutputError,
2011
- at as PAnnotationLabel,
2012
- lt as PAnnotationTrace,
2013
- he as PColumnCollection,
2014
- In as PFrameImpl,
2019
+ Ot as IS_VIRTUAL_COLUMN,
2020
+ Gt as It,
2021
+ bn as JsRenderInternal,
2022
+ xe as LABEL_ANNOTATION,
2023
+ Ht as MainOutputs,
2024
+ nt as OutputError,
2025
+ ut as PAnnotationLabel,
2026
+ ct as PAnnotationTrace,
2027
+ ge as PColumnCollection,
2028
+ Ln as PFrameImpl,
2015
2029
  K as RT_BINARY_PARTITIONED,
2016
- B as RT_BINARY_SUPER_PARTITIONED,
2017
- U as RT_JSON_PARTITIONED,
2018
- re as RT_JSON_SUPER_PARTITIONED,
2019
- te as RT_RESOURCE_MAP,
2020
- ne as RT_RESOURCE_MAP_PARTITIONED,
2030
+ U as RT_BINARY_SUPER_PARTITIONED,
2031
+ B as RT_JSON_PARTITIONED,
2032
+ ie as RT_JSON_SUPER_PARTITIONED,
2033
+ ne as RT_RESOURCE_MAP,
2034
+ re as RT_RESOURCE_MAP_PARTITIONED,
2021
2035
  X as RenderCtx,
2022
- Ct as ResultPool,
2023
- Gt as StagingOutputs,
2024
- ct as Trace,
2025
- ut as TraceEntry,
2036
+ It as ResultPool,
2037
+ qt as StagingOutputs,
2038
+ dt as Trace,
2039
+ pt as TraceEntry,
2026
2040
  I as TreeNodeAccessor,
2027
- Ht as UiState,
2028
- je as allColumnsComputed,
2029
- en as and,
2030
- mt as convertOrParsePColumnData,
2031
- Sn as createPFrameForGraphs,
2032
- Pn as createPlDataTable,
2033
- Cn as createPlDataTableSheet,
2034
- xn as createPlDataTableV2,
2035
- Fe as deriveLabels,
2036
- le as downgradeCfgOrLambda,
2037
- Ot as enrichColumnsWithCompatible,
2038
- pn as extractArchiveAndGetURL,
2039
- bn as extractConfig,
2040
- yt as filterDataInfoEntries,
2041
- Xt as flatten,
2042
- _n as fromPlOption,
2043
- kt as fromPlRef,
2044
- Dt as getAdditionalColumns,
2045
- Re as getAllLabelColumns,
2046
- on as getBlobContent,
2047
- ln as getBlobContentAsJson,
2048
- an as getBlobContentAsString,
2049
- un as getDownloadedBlobContent,
2050
- En as getEnvironmentValue,
2041
+ zt as UiState,
2042
+ Ke as allColumnsComputed,
2043
+ nn as and,
2044
+ vt as convertOrParsePColumnData,
2045
+ _n as createPFrameForGraphs,
2046
+ Cn as createPlDataTable,
2047
+ In as createPlDataTableSheet,
2048
+ Sn as createPlDataTableV2,
2049
+ Oe as deriveLabels,
2050
+ ue as downgradeCfgOrLambda,
2051
+ kt as enrichColumnsWithCompatible,
2052
+ fn as extractArchiveAndGetURL,
2053
+ An as extractConfig,
2054
+ bt as filterDataInfoEntries,
2055
+ Zt as flatten,
2056
+ Tn as fromPlOption,
2057
+ Vt as fromPlRef,
2058
+ Rt as getAdditionalColumns,
2059
+ je as getAllLabelColumns,
2060
+ ln as getBlobContent,
2061
+ cn as getBlobContentAsJson,
2062
+ un as getBlobContentAsString,
2063
+ pn as getDownloadedBlobContent,
2064
+ Dn as getEnvironmentValue,
2051
2065
  G as getFromCfg,
2052
2066
  Z as getImmediate,
2053
- dn as getImportProgress,
2054
- ee as getJsonField,
2055
- fn as getLastLogs,
2056
- mn as getLogHandle,
2057
- ke as getMatchingLabelColumns,
2058
- cn as getOnDemandBlobContent,
2059
- ft as getPartitionKeysList,
2060
- Tn as getPlatformaOrDefault,
2061
- hn as getProgressLog,
2062
- gn as getProgressLogWithInfo,
2063
- jt as getRawPlatformaInstance,
2064
- nn as getResourceField,
2065
- rn as getResourceValueAsJson,
2066
- gt as getUniquePartitionKeys,
2067
- ce as ifDef,
2068
- _t as isColumnOptional,
2069
- St as isConfigLambda,
2070
- Qt as isEmpty,
2071
- An as isLabelColumn,
2072
- Ut as isolate,
2073
- qt as makeArray,
2074
- Ie as makeObject,
2075
- Yt as mapArrayValues,
2076
- zt as mapRecordValues,
2077
- sn as mapResourceFields,
2078
- Zt as not,
2079
- tn as or,
2080
- fe as parsePColumnData,
2081
- It as parsePTableColumnId,
2082
- vn as parseResourceMap,
2083
- tt as readOutput,
2084
- wn as strinfigyPTableColumnId,
2085
- Nt as wrapOutputs
2067
+ hn as getImportProgress,
2068
+ te as getJsonField,
2069
+ gn as getLastLogs,
2070
+ vn as getLogHandle,
2071
+ Ve as getMatchingLabelColumns,
2072
+ dn as getOnDemandBlobContent,
2073
+ gt as getPartitionKeysList,
2074
+ Fn as getPlatformaOrDefault,
2075
+ mn as getProgressLog,
2076
+ yn as getProgressLogWithInfo,
2077
+ Kt as getRawPlatformaInstance,
2078
+ sn as getResourceField,
2079
+ on as getResourceValueAsJson,
2080
+ yt as getUniquePartitionKeys,
2081
+ pe as ifDef,
2082
+ Tt as isColumnOptional,
2083
+ _t as isConfigLambda,
2084
+ en as isEmpty,
2085
+ xn as isLabelColumn,
2086
+ Mt as isolate,
2087
+ Yt as makeArray,
2088
+ Le as makeObject,
2089
+ Qt as mapArrayValues,
2090
+ Xt as mapRecordValues,
2091
+ an as mapResourceFields,
2092
+ tn as not,
2093
+ rn as or,
2094
+ he as parsePColumnData,
2095
+ Lt as parsePTableColumnId,
2096
+ wn as parseResourceMap,
2097
+ rt as readOutput,
2098
+ Pn as strinfigyPTableColumnId,
2099
+ Ut as wrapOutputs
2086
2100
  };
2087
2101
  //# sourceMappingURL=index.mjs.map