@platforma-sdk/model 1.40.0 → 1.40.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,24 +1,24 @@
1
- var Xe = Object.defineProperty;
2
- var Qe = (t, e, n) => e in t ? Xe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var k = (t, e, n) => Qe(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { isPColumn as Oe, mapPObjectData as Se, isDataInfoEntries as Ke, isDataInfo as ue, dataInfoToEntries as Ze, selectorsToPredicate as Y, resolveAnchors as we, deriveNativeId as et, isPColumnSpec as re, isPartitionedDataInfoEntries as tt, getAxisId as D, entriesToDataInfo as nt, canonicalizeAxisId as rt, withEnrichments as Ae, AnchoredIdDeriver as Pe, isPlRef as it, mapValueInVOE as st, ensurePColumn as ot, extractAllColumns as at, mapPTableDef as lt, mapDataInfo as ut, extractConfigGeneric as ct, matchAxisId as N, getColumnIdAndSpec as xe, canonicalizeJson as O, parseJson as _e, visitDataInfo as pt, isPTableAbsent as dt, uniquePlId as ft, PTableNA as ht } from "@milaboratories/pl-model-common";
1
+ var Qe = Object.defineProperty;
2
+ var Ze = (t, e, n) => e in t ? Qe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var k = (t, e, n) => Ze(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { isPColumn as Ke, mapPObjectData as 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";
5
5
  export * from "@milaboratories/pl-model-common";
6
- import Ne from "canonicalize";
6
+ import Ve from "canonicalize";
7
7
  import { z as $ } from "zod";
8
8
  export * from "@milaboratories/pl-error-like";
9
- class gt extends Error {
9
+ class mt 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 mt(t) {
15
- if (!t.ok) throw new gt(t.errors, t.moreErrors);
14
+ function yt(t) {
15
+ if (!t.ok) throw new mt(t.errors, t.moreErrors);
16
16
  return t.value;
17
17
  }
18
18
  function un(t) {
19
19
  return new Proxy(t, {
20
20
  get(e, n) {
21
- return mt(e[n]);
21
+ return yt(e[n]);
22
22
  }
23
23
  });
24
24
  }
@@ -38,7 +38,7 @@ const pn = Q("$args"), dn = Q("$it"), fn = Q("$prod"), hn = Q("$staging"), gn =
38
38
  function ie(t) {
39
39
  return { type: "Immediate", value: t };
40
40
  }
41
- function Ve(t) {
41
+ function Me(t) {
42
42
  const e = {};
43
43
  for (const [n, r] of Object.entries(t)) e[n] = P(r);
44
44
  return {
@@ -207,16 +207,16 @@ function Nn(t) {
207
207
  source: P(t)
208
208
  };
209
209
  }
210
- function yt() {
210
+ function bt() {
211
211
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
212
212
  }
213
- function Me(t) {
213
+ function je(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 bt() {
219
+ function vt() {
220
220
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
221
221
  }
222
222
  function v() {
@@ -224,13 +224,13 @@ function v() {
224
224
  throw new Error("Not in config rendering context");
225
225
  }
226
226
  function G(t, e) {
227
- const n = bt();
227
+ const n = vt();
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
232
  const pe = /* @__PURE__ */ new Map();
233
- function vt(t, e) {
233
+ function Ct(t, e) {
234
234
  t in v().callbackRegistry || (v().callbackRegistry[t] = (n) => {
235
235
  for (const r of pe.get(t))
236
236
  r(n);
@@ -240,7 +240,7 @@ class F {
240
240
  constructor(e, n = (r) => r) {
241
241
  k(this, "isResolved", !1);
242
242
  k(this, "resolvedValue");
243
- this.handle = e, this.postProcess = n, vt(e, (r) => {
243
+ this.handle = e, this.postProcess = n, Ct(e, (r) => {
244
244
  this.resolvedValue = n(r), this.isResolved = !0;
245
245
  });
246
246
  }
@@ -363,7 +363,7 @@ class R {
363
363
  getPColumns(e = !1, n = "") {
364
364
  const r = this.parsePObjectCollection(e, n);
365
365
  return r === void 0 ? void 0 : Object.entries(r).map(([, s]) => {
366
- if (!Oe(s)) throw new Error(`not a PColumn (kind = ${s.spec.kind})`);
366
+ if (!Ke(s)) throw new Error(`not a PColumn (kind = ${s.spec.kind})`);
367
367
  return s;
368
368
  });
369
369
  }
@@ -480,56 +480,56 @@ class R {
480
480
  return s && (l = l.filter((u) => u[1] !== void 0)), l.map(([u, h]) => o(u, h));
481
481
  }
482
482
  }
483
- const je = "staging", Je = "main", Ct = {
483
+ const Je = "staging", $e = "main", St = {
484
484
  explicitColumnsSupport: !0,
485
485
  inlineColumnsSupport: !0,
486
486
  activeArgs: !0,
487
487
  pTablePartitionFiltersSupport: !0,
488
488
  pFrameInSetFilterSupport: !0
489
489
  };
490
- function $e(t) {
490
+ function Be(t) {
491
491
  return typeof t == "object" && t !== null && "__awaited_futures__" in t;
492
492
  }
493
493
  function me(t, e, n) {
494
494
  if (e.has(n)) return;
495
495
  if (e.add(n), typeof n === "object")
496
- if ($e(n)) n.__awaited_futures__.forEach((i) => t.add(i));
496
+ if (Be(n)) n.__awaited_futures__.forEach((i) => t.add(i));
497
497
  else if (Array.isArray(n))
498
498
  for (const i of n) me(t, e, i);
499
499
  else
500
500
  for (const [, i] of Object.entries(n))
501
501
  i !== n && me(t, e, i);
502
502
  }
503
- function St(t) {
503
+ function wt(t) {
504
504
  const e = /* @__PURE__ */ new Set();
505
505
  return me(e, /* @__PURE__ */ new Set(), t), e;
506
506
  }
507
507
  const Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
508
508
  __proto__: null,
509
- GlobalCfgRenderCtxFeatureFlags: Ct,
510
- MainAccessorName: Je,
511
- StagingAccessorName: je,
512
- getAllFutureAwaits: St,
513
- isFutureAwait: $e
514
- }, Symbol.toStringTag, { value: "Module" })), wt = "pl7.app/label", At = "pl7.app/trace", Pt = $.object({
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
515
  type: $.string(),
516
516
  importance: $.number().optional(),
517
517
  id: $.string().optional(),
518
518
  label: $.string()
519
- }), xt = $.array(Pt), _t = 1e-3, It = "__LABEL__", Ie = "__LABEL__@1";
520
- function Be(t, e, n = {}) {
519
+ }), _t = $.array(xt), It = 1e-3, Tt = "__LABEL__", Ie = "__LABEL__@1";
520
+ function Ue(t, e, n = {}) {
521
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
522
  var c, b;
523
523
  const y = e(d);
524
524
  let p, m, C;
525
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[wt], _ = (b = p.annotations) == null ? void 0 : b[At], w = (_ ? xt.safeParse(JSON.parse(_)).data : void 0) ?? [], A = [
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
527
  ...m ?? [],
528
528
  ...w,
529
529
  ...C ?? []
530
530
  ];
531
531
  if (E !== void 0) {
532
- const T = { label: E, type: It, importance: -2 };
532
+ const T = { label: E, type: Tt, importance: -2 };
533
533
  n.addLabelAsSuffix ? A.push(T) : A.splice(0, 0, T);
534
534
  }
535
535
  const S = [], I = /* @__PURE__ */ new Map();
@@ -541,7 +541,7 @@ function Be(t, e, n = {}) {
541
541
  K,
542
542
  Math.max(
543
543
  r.get(K) ?? Number.NEGATIVE_INFINITY,
544
- V - (A.length - T) * _t
544
+ V - (A.length - T) * It
545
545
  )
546
546
  ), S.push({ ...A[T], fullType: K, occurrenceIndex: j });
547
547
  }
@@ -590,8 +590,8 @@ function Be(t, e, n = {}) {
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", Ue = Z + "Partitioned/", le = Ue + "JsonPartitioned", q = Ue + "BinaryPartitioned";
594
- function We(t, e, n, r = [], i) {
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) {
595
595
  if (t === void 0) return !1;
596
596
  switch (t.resourceType.name) {
597
597
  case oe: {
@@ -608,7 +608,7 @@ function We(t, e, n, r = [], i) {
608
608
  const a = t.resolve({ field: o, assertFieldType: "Input" });
609
609
  if (a === void 0) s = !1;
610
610
  else {
611
- const l = [...r, ...JSON.parse(o)], u = We(
611
+ const l = [...r, ...JSON.parse(o)], u = Ge(
612
612
  a,
613
613
  e,
614
614
  n,
@@ -626,7 +626,7 @@ function We(t, e, n, r = [], i) {
626
626
  }
627
627
  function Mn(t, e, n = !1) {
628
628
  const r = [];
629
- return { isComplete: We(t, e, r, [], n), data: r };
629
+ return { isComplete: Ge(t, e, r, [], n), data: r };
630
630
  }
631
631
  const ye = (t) => {
632
632
  if (t.endsWith(".index"))
@@ -635,7 +635,7 @@ const ye = (t) => {
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 Tt(t) {
638
+ function Lt(t) {
639
639
  if (!t) return;
640
640
  const e = t.resourceType.name, n = t.getDataAsJson(), r = [];
641
641
  let i = 0;
@@ -681,7 +681,7 @@ function Tt(t) {
681
681
  }
682
682
  return { data: r, keyLength: i };
683
683
  }
684
- function Lt(t) {
684
+ function Ft(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 = [];
@@ -700,11 +700,11 @@ function Lt(t) {
700
700
  }
701
701
  return r.map((i) => Array.from(i.values()));
702
702
  }
703
- function Ft(t) {
703
+ function Et(t) {
704
704
  if (t === void 0) return;
705
- if (Ke(t))
706
- return Lt(t);
707
- const e = Tt(t);
705
+ if (Ne(t))
706
+ return Ft(t);
707
+ const e = Lt(t);
708
708
  if (!e) return;
709
709
  const { data: n, keyLength: r } = e, i = [];
710
710
  for (let s = 0; s < r; ++s)
@@ -815,15 +815,15 @@ function be(t, e = []) {
815
815
  throw new Error(`Unknown resource type: ${n}`);
816
816
  }
817
817
  }
818
- function Et(t) {
818
+ function kt(t) {
819
819
  if (t !== void 0) {
820
- if (Ke(t)) return t;
821
- if (ue(t)) return Ze(t);
820
+ if (Ne(t)) return t;
821
+ if (ue(t)) return et(t);
822
822
  if (t instanceof R) return be(t);
823
823
  throw new Error(`Unexpected input type: ${typeof t}`);
824
824
  }
825
825
  }
826
- function kt(t, e) {
826
+ function Dt(t, e) {
827
827
  const n = [...e].sort((s, o) => o[0] - s[0]);
828
828
  if (t.type === "JsonPartitioned" || t.type === "BinaryPartitioned") {
829
829
  const { partitionKeyLength: s } = t;
@@ -883,13 +883,13 @@ function kt(t, e) {
883
883
  }
884
884
  }
885
885
  }
886
- function Dt(t) {
886
+ function Rt(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 Rt {
892
+ class Ot {
893
893
  constructor(e) {
894
894
  this.columns = e;
895
895
  }
@@ -898,30 +898,30 @@ class Rt {
898
898
  return this.columns.filter((r) => n(r.spec));
899
899
  }
900
900
  }
901
- function Ot(t) {
901
+ function Kt(t) {
902
902
  if (t)
903
903
  return t.map((e) => ({
904
- type: `split:${rt(e.axisId)}`,
904
+ type: `split:${it(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 Kt(t) {
910
+ function Nt(t) {
911
911
  if (t)
912
912
  return t.map((e) => [e.axisIdx, e.value]);
913
913
  }
914
- function Nt(t, e) {
914
+ function Vt(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 Ne({ id: t, axisFilters: n });
917
+ return Ve({ id: t, axisFilters: n });
918
918
  }
919
919
  function Te(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 Vt(t) {
924
+ function Mt(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);
@@ -932,7 +932,7 @@ function Vt(t) {
932
932
  class X {
933
933
  constructor() {
934
934
  k(this, "defaultProviderStore", []);
935
- k(this, "providers", [new Rt(this.defaultProviderStore)]);
935
+ k(this, "providers", [new Ot(this.defaultProviderStore)]);
936
936
  k(this, "axisLabelProviders", []);
937
937
  }
938
938
  addColumnProvider(e) {
@@ -988,26 +988,26 @@ class X {
988
988
  if (u(c.spec)) continue;
989
989
  if (E.has(c.id))
990
990
  throw new Error(`Duplicate column id ${c.id} in provider ${S.constructor.name}`);
991
- const b = et(c.spec);
991
+ const b = tt(c.spec);
992
992
  g.has(b) || (E.add(c.id), g.add(b), _.push(c));
993
993
  }
994
994
  }
995
995
  if (_.length === 0) continue;
996
- const w = Vt(p), A = w.length > 0;
996
+ const w = Mt(p), A = w.length > 0;
997
997
  for (const S of _) {
998
998
  if (!re(S.spec)) continue;
999
999
  const I = S.spec;
1000
1000
  if (A) {
1001
- if (Dt(S.data))
1001
+ if (Rt(S.data))
1002
1002
  throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${S.id}`);
1003
- const c = Et(S.data);
1003
+ const c = kt(S.data);
1004
1004
  if (!c) {
1005
1005
  if (s) continue;
1006
1006
  return;
1007
1007
  }
1008
- if (!tt(c))
1008
+ if (!nt(c))
1009
1009
  throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${c.type} for column ${S.id}`);
1010
- const b = Ft(c), T = w[w.length - 1];
1010
+ const b = Et(c), T = w[w.length - 1];
1011
1011
  if (T >= c.partitionKeyLength)
1012
1012
  throw new Error(`Not enough partition keys (${c.partitionKeyLength}) for requested split axes (max index ${T}) in column ${I.name}`);
1013
1013
  const U = w.map((L) => this.findLabels(D(I.axesSpec[L]))), V = [], j = (L, W) => {
@@ -1029,20 +1029,20 @@ class X {
1029
1029
  };
1030
1030
  if (j([], 0), V.length === 0)
1031
1031
  continue;
1032
- const K = [...I.axesSpec], He = w.map((L) => L);
1032
+ const K = [...I.axesSpec], qe = w.map((L) => L);
1033
1033
  for (let L = w.length - 1; L >= 0; L--)
1034
1034
  K.splice(w[L], 1);
1035
- const qe = { ...I, axesSpec: K };
1035
+ const ze = { ...I, axesSpec: K };
1036
1036
  for (const L of V) {
1037
1037
  const W = L.map((M, J) => {
1038
- const ee = He[J], ze = D(I.axesSpec[ee]), ce = U[J], Ye = (ce == null ? void 0 : ce[M]) ?? String(M);
1039
- return { axisIdx: ee, axisId: ze, value: M, label: Ye };
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 };
1040
1040
  });
1041
1041
  f.push({
1042
1042
  type: "split",
1043
1043
  originalColumn: S,
1044
1044
  spec: I,
1045
- adjustedSpec: qe,
1045
+ adjustedSpec: ze,
1046
1046
  dataEntries: c,
1047
1047
  axisFilters: W
1048
1048
  });
@@ -1057,18 +1057,18 @@ class X {
1057
1057
  }
1058
1058
  }
1059
1059
  if (f.length === 0) return [];
1060
- const d = Be(
1060
+ const d = Ue(
1061
1061
  f,
1062
1062
  (p) => ({
1063
1063
  spec: p.spec,
1064
- suffixTrace: p.type === "split" ? Ot(p.axisFilters) : void 0
1064
+ suffixTrace: p.type === "split" ? Kt(p.axisFilters) : void 0
1065
1065
  }),
1066
1066
  l
1067
1067
  ), y = [];
1068
1068
  for (const { value: p, label: m } of d) {
1069
- const { originalColumn: C, spec: E } = p, _ = p.type === "split" ? p.axisFilters : void 0, w = Kt(_);
1069
+ const { originalColumn: C, spec: E } = p, _ = p.type === "split" ? p.axisFilters : void 0, w = Nt(_);
1070
1070
  let A;
1071
- r ? A = r.deriveS(E, w) : A = Nt(C.id, w);
1071
+ r ? A = r.deriveS(E, w) : A = Vt(C.id, w);
1072
1072
  let S = { ...p.adjustedSpec };
1073
1073
  o && (S = {
1074
1074
  ...S,
@@ -1079,7 +1079,7 @@ class X {
1079
1079
  }), y.push({
1080
1080
  id: A,
1081
1081
  spec: S,
1082
- data: () => p.type === "split" ? nt(kt(p.dataEntries, w)) : p.originalColumn.data,
1082
+ data: () => p.type === "split" ? rt(Dt(p.dataEntries, w)) : p.originalColumn.data,
1083
1083
  label: m
1084
1084
  });
1085
1085
  }
@@ -1149,9 +1149,9 @@ function de(t, e) {
1149
1149
  return !0;
1150
1150
  }
1151
1151
  function Le(t) {
1152
- return Se(t, (e) => e instanceof R ? e.handle : ue(e) ? ut(e, (n) => n.handle) : e);
1152
+ return Se(t, (e) => e instanceof R ? e.handle : ue(e) ? ct(e, (n) => n.handle) : e);
1153
1153
  }
1154
- class Mt {
1154
+ class jt {
1155
1155
  constructor() {
1156
1156
  k(this, "ctx", v());
1157
1157
  }
@@ -1164,7 +1164,7 @@ class Mt {
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
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" ? Be(i, (a) => a.obj, s ?? {}).map(({ value: { ref: a }, label: l }) => ({
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
1168
  ref: Ae(a, o),
1169
1169
  label: l
1170
1170
  })) : i.map(({ ref: a, obj: l }) => ({
@@ -1176,7 +1176,7 @@ class Mt {
1176
1176
  if (e instanceof Pe) return e;
1177
1177
  const n = {};
1178
1178
  for (const [r, i] of Object.entries(e))
1179
- if (it(i)) {
1179
+ if (st(i)) {
1180
1180
  const s = this.getPColumnSpecByRef(i);
1181
1181
  if (!s)
1182
1182
  return;
@@ -1276,7 +1276,7 @@ class Mt {
1276
1276
  ref: n.ref,
1277
1277
  obj: {
1278
1278
  ...n.obj,
1279
- data: st(
1279
+ data: ot(
1280
1280
  n.obj.data,
1281
1281
  (r) => new R(r, [n.ref.blockId, n.ref.name])
1282
1282
  )
@@ -1318,7 +1318,7 @@ class Mt {
1318
1318
  getPColumnByRef(e) {
1319
1319
  const n = this.getDataByRef(e);
1320
1320
  if (n)
1321
- return ot(n);
1321
+ return at(n);
1322
1322
  }
1323
1323
  /**
1324
1324
  * Returns spec associated with the ref ensuring that it is a p-column spec.
@@ -1368,7 +1368,7 @@ class Mt {
1368
1368
  findLabels(e) {
1369
1369
  const n = this.getData();
1370
1370
  for (const r of n.entries) {
1371
- if (!Oe(r.obj)) continue;
1371
+ if (!Ke(r.obj)) continue;
1372
1372
  const i = r.obj.spec;
1373
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)) {
1374
1374
  if (r.obj.data.resourceType.name !== "PColumnData/Json")
@@ -1395,7 +1395,7 @@ class Mt {
1395
1395
  let a = null;
1396
1396
  const l = this;
1397
1397
  return {
1398
- id: Ne(i),
1398
+ id: Ve(i),
1399
1399
  spec: o,
1400
1400
  get data() {
1401
1401
  var u;
@@ -1427,7 +1427,7 @@ class te {
1427
1427
  k(this, "_uiStateCache");
1428
1428
  // lazy rendering because this feature is rarely used
1429
1429
  k(this, "_activeArgsCache");
1430
- k(this, "resultPool", new Mt());
1430
+ k(this, "resultPool", new jt());
1431
1431
  this.ctx = v();
1432
1432
  }
1433
1433
  get args() {
@@ -1468,10 +1468,10 @@ class te {
1468
1468
  );
1469
1469
  }
1470
1470
  get prerun() {
1471
- return this.getNamedAccessor(je);
1471
+ return this.getNamedAccessor(Je);
1472
1472
  }
1473
1473
  get outputs() {
1474
- return this.getNamedAccessor(Je);
1474
+ return this.getNamedAccessor($e);
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.
@@ -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(at(n.src)), this.ctx.createPTable(
1518
- lt(n, (r) => Le(r))
1517
+ }) : n = this.patchPTableDef(e), this.verifyInlineAndExplicitColumnsSupport(lt(n.src)), this.ctx.createPTable(
1518
+ ut(n, (r) => Le(r))
1519
1519
  );
1520
1520
  }
1521
1521
  /** @deprecated scheduled for removal from SDK */
@@ -1535,16 +1535,16 @@ class te {
1535
1535
  this.ctx.logError(e);
1536
1536
  }
1537
1537
  }
1538
- const z = "1.40.0";
1539
- function jt(t) {
1538
+ const z = "1.40.1";
1539
+ function Jt(t) {
1540
1540
  return t.__renderLambda === !0;
1541
1541
  }
1542
1542
  function fe(t) {
1543
1543
  if (t !== void 0)
1544
- return jt(t) ? t.handle : t;
1544
+ return Jt(t) ? t.handle : t;
1545
1545
  }
1546
1546
  function jn(t) {
1547
- return ct(t);
1547
+ return pt(t);
1548
1548
  }
1549
1549
  const x = class x {
1550
1550
  constructor(e, n, r, i, s, o, a, l, u) {
@@ -1757,7 +1757,7 @@ const x = class x {
1757
1757
  Object.entries(this._outputs).map(([n, r]) => [n, fe(r)])
1758
1758
  )
1759
1759
  };
1760
- return yt() ? Me({ sdkVersion: z }) : { config: e };
1760
+ return bt() ? je({ sdkVersion: z }) : { config: e };
1761
1761
  }
1762
1762
  };
1763
1763
  k(x, "INITIAL_BLOCK_FEATURE_FLAGS", {
@@ -1766,7 +1766,7 @@ k(x, "INITIAL_BLOCK_FEATURE_FLAGS", {
1766
1766
  requiresModelAPIVersion: 1
1767
1767
  });
1768
1768
  let Fe = x;
1769
- function Ge() {
1769
+ function He() {
1770
1770
  return {
1771
1771
  sourceId: null,
1772
1772
  hiddenColIds: null,
@@ -1775,22 +1775,22 @@ function Ge() {
1775
1775
  sorting: []
1776
1776
  };
1777
1777
  }
1778
- function Jt() {
1778
+ function Ee() {
1779
1779
  return {
1780
- version: 3,
1780
+ version: 4,
1781
1781
  stateCache: [],
1782
- pTableParams: Ge()
1782
+ pTableParams: He()
1783
1783
  };
1784
1784
  }
1785
1785
  function $t(t) {
1786
- return "version" in t ? (t.version === 2 && (t = {
1786
+ return "version" in t || (t = Ee()), 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: Ge()
1793
- }), t) : Jt();
1792
+ pTableParams: He()
1793
+ }), t.version === 3 && (t = Ee()), t;
1794
1794
  }
1795
1795
  function Ce(t) {
1796
1796
  return t.axesSpec.length === 1 && t.name === "pl7.app/label";
@@ -1802,7 +1802,7 @@ function Bt(t) {
1802
1802
  // exactly one axis
1803
1803
  }, { dontWaitAllData: !0 });
1804
1804
  }
1805
- function Ee(t, e) {
1805
+ function ke(t, e) {
1806
1806
  const n = [], r = [];
1807
1807
  for (const a of t)
1808
1808
  Ce(a.spec) ? n.push(a) : r.push(a);
@@ -1859,7 +1859,7 @@ function Ut(t) {
1859
1859
  throw Error(`unsupported column data type: ${i}`);
1860
1860
  });
1861
1861
  }
1862
- function ke(t) {
1862
+ function De(t) {
1863
1863
  let e = t.columns;
1864
1864
  const n = [];
1865
1865
  if (t.coreColumnPredicate) {
@@ -1896,7 +1896,7 @@ function Jn(t, e, n, r) {
1896
1896
  if (e.length === 0) return;
1897
1897
  const i = e.filter((c) => !Wt(c.spec)), s = $t(n), o = Bt(t.resultPool);
1898
1898
  if (!o) return;
1899
- const a = Ee(i.map(xe), o), l = [...i, ...a], h = [
1899
+ const a = ke(i.map(xe), o), l = [...i, ...a], h = [
1900
1900
  ...he(
1901
1901
  [...l.flatMap((c) => c.spec.axesSpec.map((b) => D(b)))],
1902
1902
  (c) => O(c)
@@ -1917,7 +1917,7 @@ function Jn(t, e, n, r) {
1917
1917
  ).filter((c) => {
1918
1918
  const b = g(c.column);
1919
1919
  return b || t.logWarn(`Sorting ${JSON.stringify(c)} does not match provided columns, skipping`), b;
1920
- }), C = ke({
1920
+ }), C = De({
1921
1921
  columns: i,
1922
1922
  labelColumns: a,
1923
1923
  coreJoinType: d,
@@ -1937,9 +1937,9 @@ function Jn(t, e, n, r) {
1937
1937
  var T;
1938
1938
  return (T = r == null ? void 0 : r.coreColumnPredicate) != null && T.call(r, b.spec) ? [b.id] : [];
1939
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 = Ee(w.map(xe), o);
1940
+ const w = i.filter((c) => !_.has(c.id)), A = ke(w.map(xe), o);
1941
1941
  if (!Ut([...w, ...A])) return;
1942
- const S = ke({
1942
+ const S = De({
1943
1943
  columns: w,
1944
1944
  labelColumns: A,
1945
1945
  coreJoinType: d,
@@ -1988,7 +1988,7 @@ function zt(t) {
1988
1988
  var e;
1989
1989
  return t.axesSpec.length === 2 && ((e = t.annotations) == null ? void 0 : e[Xt]) === "true";
1990
1990
  }
1991
- const Yt = "pl7.app/graph/isVirtual", De = "pl7.app/label", Xt = "pl7.app/isLinkerColumn";
1991
+ const Yt = "pl7.app/graph/isVirtual", Re = "pl7.app/label", Xt = "pl7.app/isLinkerColumn";
1992
1992
  function Qt(t) {
1993
1993
  var n, r;
1994
1994
  const e = /* @__PURE__ */ new Map();
@@ -2022,7 +2022,7 @@ function Zt(t, e) {
2022
2022
  }
2023
2023
  return o;
2024
2024
  }
2025
- function Re(t, e) {
2025
+ function Oe(t, e) {
2026
2026
  const n = [];
2027
2027
  return e.forEach((r) => {
2028
2028
  n.push(...en(t, r));
@@ -2057,14 +2057,14 @@ function en(t, e) {
2057
2057
  });
2058
2058
  const l = i.map((u, h) => {
2059
2059
  var p;
2060
- const f = Ht(e.id, u.map((m) => m.domain)), g = ((p = e.spec.annotations) == null ? void 0 : p[De]) ?? "", d = [...a[h]].filter((m) => o.has(m)).sort().map((m) => {
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) => {
2061
2061
  var C;
2062
2062
  return (C = JSON.parse(m)) == null ? void 0 : C[1];
2063
2063
  }).join(" / "), y = {
2064
2064
  ...e.spec.annotations,
2065
2065
  [Yt]: "true"
2066
2066
  };
2067
- return (g || d) && (y[De] = g && d ? g + " / " + d : g + d), {
2067
+ return (g || d) && (y[Re] = g && d ? g + " / " + d : g + d), {
2068
2068
  id: f,
2069
2069
  spec: {
2070
2070
  ...e.spec,
@@ -2081,7 +2081,7 @@ function en(t, e) {
2081
2081
  }
2082
2082
  function tn(t) {
2083
2083
  let e = !0;
2084
- return t.data instanceof R ? e = e && t.data.getIsReadyOrError() : ue(t.data) && pt(t.data, (n) => {
2084
+ return t.data instanceof R ? e = e && t.data.getIsReadyOrError() : ue(t.data) && dt(t.data, (n) => {
2085
2085
  e = e && n.getIsReadyOrError();
2086
2086
  }), e;
2087
2087
  }
@@ -2098,7 +2098,7 @@ function Bn(t, e) {
2098
2098
  const d = new Map(g.flatMap((p) => p.spec.axesSpec).map((p) => {
2099
2099
  const m = D(p);
2100
2100
  return [O(m), m];
2101
- })), y = Re(d, g);
2101
+ })), y = Oe(d, g);
2102
2102
  return t.createPFrame(y);
2103
2103
  }
2104
2104
  if (!ne(e))
@@ -2137,18 +2137,18 @@ function Bn(t, e) {
2137
2137
  }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((f) => Ce(f.spec));
2138
2138
  if (!ne(l))
2139
2139
  return;
2140
- const u = [...a, ...l], h = Re(r, u);
2140
+ const u = [...a, ...l], h = Oe(r, u);
2141
2141
  return t.createPFrame(h);
2142
2142
  }
2143
2143
  function Un({
2144
2144
  selection: t,
2145
- columnId: e = ft(),
2145
+ columnId: e = ht(),
2146
2146
  label: n = "Selection marker",
2147
2147
  domain: r
2148
2148
  }) {
2149
2149
  if (!(t != null && t.axesSpec.length))
2150
2150
  return;
2151
- const i = t.selectedKeys.filter((s) => s.every((o) => !dt(o))).map((s) => ({ key: s, val: 1 }));
2151
+ const i = t.selectedKeys.filter((s) => s.every((o) => !ft(o))).map((s) => ({ key: s, val: 1 }));
2152
2152
  if (i.length)
2153
2153
  return {
2154
2154
  id: e,
@@ -2167,7 +2167,7 @@ function Un({
2167
2167
  };
2168
2168
  }
2169
2169
  function Wn(t) {
2170
- return t === ht ? (console.error("Axis value can never be N/A"), "") : t;
2170
+ return t === gt ? (console.error("Axis value can never be N/A"), "") : t;
2171
2171
  }
2172
2172
  class Gn {
2173
2173
  constructor(e) {
@@ -2194,14 +2194,14 @@ class Gn {
2194
2194
  }
2195
2195
  }
2196
2196
  function nn(t) {
2197
- return Ve({
2197
+ return Me({
2198
2198
  __isRef: !0,
2199
2199
  blockId: se(t, "blockId"),
2200
2200
  name: se(t, "name")
2201
2201
  });
2202
2202
  }
2203
2203
  function Hn(t) {
2204
- return Ve({
2204
+ return Me({
2205
2205
  ref: nn(se(t, "ref")),
2206
2206
  label: se(t, "label")
2207
2207
  });
@@ -2210,7 +2210,7 @@ const qn = {
2210
2210
  sdkVersion: z
2211
2211
  };
2212
2212
  function rn() {
2213
- return Me({ sdkVersion: z });
2213
+ return je({ sdkVersion: z });
2214
2214
  }
2215
2215
  function zn(t) {
2216
2216
  try {
@@ -2231,12 +2231,12 @@ export {
2231
2231
  Yt as IS_VIRTUAL_COLUMN,
2232
2232
  dn as It,
2233
2233
  Vn as JsRenderInternal,
2234
- De as LABEL_ANNOTATION,
2234
+ Re as LABEL_ANNOTATION,
2235
2235
  Xt as LINKER_COLUMN_ANNOTATION,
2236
2236
  fn as MainOutputs,
2237
- gt as OutputError,
2238
- wt as PAnnotationLabel,
2239
- At as PAnnotationTrace,
2237
+ mt as OutputError,
2238
+ At as PAnnotationLabel,
2239
+ Pt as PAnnotationTrace,
2240
2240
  X as PColumnCollection,
2241
2241
  Gn as PFrameImpl,
2242
2242
  B as RT_BINARY_PARTITIONED,
@@ -2246,27 +2246,27 @@ export {
2246
2246
  oe as RT_RESOURCE_MAP,
2247
2247
  ae as RT_RESOURCE_MAP_PARTITIONED,
2248
2248
  te as RenderCtx,
2249
- Mt as ResultPool,
2249
+ jt as ResultPool,
2250
2250
  hn as StagingOutputs,
2251
- xt as Trace,
2252
- Pt as TraceEntry,
2251
+ _t as Trace,
2252
+ xt as TraceEntry,
2253
2253
  R as TreeNodeAccessor,
2254
2254
  gn as UiState,
2255
2255
  Ut as allColumnsComputed,
2256
2256
  ne as allColumnsReady,
2257
2257
  wn as and,
2258
- Et as convertOrParsePColumnData,
2258
+ kt as convertOrParsePColumnData,
2259
2259
  Bn as createPFrameForGraphs,
2260
2260
  $n as createPlDataTableSheet,
2261
- Jt as createPlDataTableStateV2,
2261
+ Ee as createPlDataTableStateV2,
2262
2262
  Jn as createPlDataTableV2,
2263
2263
  Un as createRowSelectionColumn,
2264
- Be as deriveLabels,
2264
+ Ue as deriveLabels,
2265
2265
  fe as downgradeCfgOrLambda,
2266
- Re as enrichCompatible,
2266
+ Oe as enrichCompatible,
2267
2267
  kn as extractArchiveAndGetURL,
2268
2268
  jn as extractConfig,
2269
- kt as filterDataInfoEntries,
2269
+ Dt as filterDataInfoEntries,
2270
2270
  vn as flatten,
2271
2271
  Hn as fromPlOption,
2272
2272
  nn as fromPlRef,
@@ -2284,28 +2284,28 @@ export {
2284
2284
  Rn as getLastLogs,
2285
2285
  Qt as getLinkerColumnsMap,
2286
2286
  Nn as getLogHandle,
2287
- Ee as getMatchingLabelColumns,
2287
+ ke as getMatchingLabelColumns,
2288
2288
  En as getOnDemandBlobContent,
2289
- Tt as getPartitionKeysList,
2289
+ Lt as getPartitionKeysList,
2290
2290
  zn as getPlatformaOrDefault,
2291
2291
  On as getProgressLog,
2292
2292
  Kn as getProgressLogWithInfo,
2293
2293
  rn as getRawPlatformaInstance,
2294
2294
  Pn as getResourceField,
2295
2295
  xn as getResourceValueAsJson,
2296
- Ft as getUniquePartitionKeys,
2296
+ Et as getUniquePartitionKeys,
2297
2297
  ge as ifDef,
2298
2298
  Wt as isColumnHidden,
2299
2299
  Gt as isColumnOptional,
2300
2300
  tn as isColumnReady,
2301
- jt as isConfigLambda,
2301
+ Jt as isConfigLambda,
2302
2302
  Cn as isEmpty,
2303
2303
  Ce as isLabelColumn,
2304
2304
  zt as isLinkerColumn,
2305
2305
  cn as isolate,
2306
2306
  mn as makeArray,
2307
- Ge as makeDefaultPTableParams,
2308
- Ve as makeObject,
2307
+ He as makeDefaultPTableParams,
2308
+ Me as makeObject,
2309
2309
  bn as mapArrayValues,
2310
2310
  Wn as mapPTableValueToAxisKey,
2311
2311
  yn as mapRecordValues,
@@ -2314,7 +2314,7 @@ export {
2314
2314
  An as or,
2315
2315
  be as parsePColumnData,
2316
2316
  Mn as parseResourceMap,
2317
- mt as readOutput,
2317
+ yt as readOutput,
2318
2318
  he as uniqueBy,
2319
2319
  $t as upgradePlDataTableStateV2,
2320
2320
  un as wrapOutputs