@milaboratories/milaboratories.ui-examples.model 1.2.1 → 1.2.2

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/bundle.js CHANGED
@@ -4030,7 +4030,7 @@
4030
4030
  return false;
4031
4031
  }
4032
4032
  }
4033
- function $e(e) {
4033
+ function $e$1(e) {
4034
4034
  return _(e) ? e.type === "JsonPartitioned" || e.type === "BinaryPartitioned" : false;
4035
4035
  }
4036
4036
  function Ve$1(e) {
@@ -4121,7 +4121,7 @@
4121
4121
  function ne$1(e, n2) {
4122
4122
  return e.name === n2.name && ee$1(e.domain, n2.domain);
4123
4123
  }
4124
- function qe$1(e, n2) {
4124
+ function qe(e, n2) {
4125
4125
  return { ...e, src: g(e.src, n2) };
4126
4126
  }
4127
4127
  function g(e, n2) {
@@ -4324,7 +4324,7 @@
4324
4324
  function ie$1(e) {
4325
4325
  return d(e.spec);
4326
4326
  }
4327
- function Ye(e) {
4327
+ function Ye$1(e) {
4328
4328
  if (!ie$1(e)) throw new Error(`not a PColumn (kind = ${e.spec.kind})`);
4329
4329
  return e;
4330
4330
  }
@@ -4522,22 +4522,22 @@
4522
4522
  cause: z$1.lazy(() => n).optional(),
4523
4523
  errors: z$1.lazy(() => n.array()).optional()
4524
4524
  });
4525
- var qe = Object.defineProperty;
4526
- var ze = (t, e, n2) => e in t ? qe(t, e, { enumerable: true, configurable: true, writable: true, value: n2 }) : t[e] = n2;
4527
- var k = (t, e, n2) => ze(t, typeof e != "symbol" ? e + "" : e, n2);
4525
+ var ze = Object.defineProperty;
4526
+ var Ye = (t, e, n2) => e in t ? ze(t, e, { enumerable: true, configurable: true, writable: true, value: n2 }) : t[e] = n2;
4527
+ var k = (t, e, n2) => Ye(t, typeof e != "symbol" ? e + "" : e, n2);
4528
4528
  function ne(t) {
4529
4529
  return { type: "Immediate", value: t };
4530
4530
  }
4531
- function ft() {
4531
+ function ht() {
4532
4532
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
4533
4533
  }
4534
- function Ke(t) {
4534
+ function Ne(t) {
4535
4535
  if (t && typeof globalThis.getPlatforma == "function")
4536
4536
  return globalThis.getPlatforma(t);
4537
4537
  if (typeof globalThis.platforma < "u") return globalThis.platforma;
4538
4538
  throw new Error("Can't get platforma instance.");
4539
4539
  }
4540
- function ht() {
4540
+ function gt() {
4541
4541
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
4542
4542
  }
4543
4543
  function v() {
@@ -4545,13 +4545,13 @@
4545
4545
  throw new Error("Not in config rendering context");
4546
4546
  }
4547
4547
  function G(t, e) {
4548
- const n2 = ht();
4548
+ const n2 = gt();
4549
4549
  if (n2 === void 0) return false;
4550
4550
  if (t in n2.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
4551
4551
  return n2.callbackRegistry[t] = e, true;
4552
4552
  }
4553
4553
  const ue = /* @__PURE__ */ new Map();
4554
- function gt(t, e) {
4554
+ function mt(t, e) {
4555
4555
  t in v().callbackRegistry || (v().callbackRegistry[t] = (n2) => {
4556
4556
  for (const r of ue.get(t))
4557
4557
  r(n2);
@@ -4561,7 +4561,7 @@
4561
4561
  constructor(e, n2 = (r) => r) {
4562
4562
  k(this, "isResolved", false);
4563
4563
  k(this, "resolvedValue");
4564
- this.handle = e, this.postProcess = n2, gt(e, (r) => {
4564
+ this.handle = e, this.postProcess = n2, mt(e, (r) => {
4565
4565
  this.resolvedValue = n2(r), this.isResolved = true;
4566
4566
  });
4567
4567
  }
@@ -4801,29 +4801,29 @@
4801
4801
  return s2 && (l2 = l2.filter((u2) => u2[1] !== void 0)), l2.map(([u2, h]) => o(u2, h));
4802
4802
  }
4803
4803
  }
4804
- const Ne = "staging", Ve = "main";
4805
- const bt = "pl7.app/label", vt = "pl7.app/trace", Ct = z$1.object({
4804
+ const Ve = "staging", je = "main";
4805
+ const vt = "pl7.app/label", St = "pl7.app/trace", Ct = z$1.object({
4806
4806
  type: z$1.string(),
4807
4807
  importance: z$1.number().optional(),
4808
4808
  id: z$1.string().optional(),
4809
4809
  label: z$1.string()
4810
- }), St = z$1.array(Ct), wt = 1e-3, At = "__LABEL__", xe = "__LABEL__@1";
4811
- function Je(t, e, n2 = {}) {
4812
- const r = /* @__PURE__ */ new Map(), i = n2.forceTraceElements !== void 0 && n2.forceTraceElements.length > 0 ? new Set(n2.forceTraceElements) : void 0, s2 = /* @__PURE__ */ new Map(), o = t.map((d2) => {
4810
+ }), wt = z$1.array(Ct), At = 1e-3, Pt = "__LABEL__", _e = "__LABEL__@1";
4811
+ function Me(t, e, n2 = {}) {
4812
+ const r = /* @__PURE__ */ new Map(), i = n2.forceTraceElements !== void 0 && n2.forceTraceElements.length > 0 ? new Set(n2.forceTraceElements) : void 0, s2 = /* @__PURE__ */ new Map(), o = t.map((p2) => {
4813
4813
  var c2, m2;
4814
- const b = e(d2);
4815
- let p2, y2, C2;
4816
- "spec" in b && typeof b.spec == "object" ? (p2 = b.spec, y2 = b.prefixTrace, C2 = b.suffixTrace) : p2 = b;
4817
- const E2 = (c2 = p2.annotations) == null ? void 0 : c2[bt], _2 = (m2 = p2.annotations) == null ? void 0 : m2[vt], w = (_2 ? St.safeParse(JSON.parse(_2)).data : void 0) ?? [], A2 = [
4814
+ const b = e(p2);
4815
+ let d2, y2, S2;
4816
+ "spec" in b && typeof b.spec == "object" ? (d2 = b.spec, y2 = b.prefixTrace, S2 = b.suffixTrace) : d2 = b;
4817
+ const E2 = (c2 = d2.annotations) == null ? void 0 : c2[vt], _2 = (m2 = d2.annotations) == null ? void 0 : m2[St], w = (_2 ? wt.safeParse(JSON.parse(_2)).data : void 0) ?? [], A2 = [
4818
4818
  ...y2 ?? [],
4819
4819
  ...w,
4820
- ...C2 ?? []
4820
+ ...S2 ?? []
4821
4821
  ];
4822
4822
  if (E2 !== void 0) {
4823
- const T = { label: E2, type: At, importance: -2 };
4823
+ const T = { label: E2, type: Pt, importance: -2 };
4824
4824
  n2.addLabelAsSuffix ? A2.push(T) : A2.splice(0, 0, T);
4825
4825
  }
4826
- const S2 = [], I = /* @__PURE__ */ new Map();
4826
+ const C2 = [], I = /* @__PURE__ */ new Map();
4827
4827
  for (let T = A2.length - 1; T >= 0; --T) {
4828
4828
  const { type: U } = A2[T], V = A2[T].importance ?? 0, J = (I.get(U) ?? 0) + 1;
4829
4829
  I.set(U, J);
@@ -4832,56 +4832,56 @@
4832
4832
  K,
4833
4833
  Math.max(
4834
4834
  r.get(K) ?? Number.NEGATIVE_INFINITY,
4835
- V - (A2.length - T) * wt
4835
+ V - (A2.length - T) * At
4836
4836
  )
4837
- ), S2.push({ ...A2[T], fullType: K, occurrenceIndex: J });
4837
+ ), C2.push({ ...A2[T], fullType: K, occurrenceIndex: J });
4838
4838
  }
4839
- return S2.reverse(), {
4840
- value: d2,
4841
- spec: p2,
4839
+ return C2.reverse(), {
4840
+ value: p2,
4841
+ spec: d2,
4842
4842
  label: E2,
4843
- fullTrace: S2
4843
+ fullTrace: C2
4844
4844
  };
4845
4845
  }), a = [], l2 = [], u2 = [...r];
4846
- u2.sort(([, d2], [, b]) => b - d2);
4847
- for (const [d2] of u2)
4848
- d2.endsWith("@1") || s2.get(d2) === t.length ? a.push(d2) : l2.push(d2);
4849
- const h = (d2, b = false) => {
4850
- const p2 = [];
4846
+ u2.sort(([, p2], [, b]) => b - p2);
4847
+ for (const [p2] of u2)
4848
+ p2.endsWith("@1") || s2.get(p2) === t.length ? a.push(p2) : l2.push(p2);
4849
+ const h = (p2, b = false) => {
4850
+ const d2 = [];
4851
4851
  for (let y2 = 0; y2 < o.length; y2++) {
4852
- const C2 = o[y2], E2 = C2.fullTrace.filter((A2) => d2.has(A2.fullType) || i && i.has(A2.type));
4852
+ const S2 = o[y2], E2 = S2.fullTrace.filter((A2) => p2.has(A2.fullType) || i && i.has(A2.type));
4853
4853
  if (E2.length === 0)
4854
4854
  if (b)
4855
- p2.push({
4855
+ d2.push({
4856
4856
  label: "Unlabeled",
4857
- value: C2.value
4857
+ value: S2.value
4858
4858
  });
4859
4859
  else return;
4860
4860
  const _2 = E2.map((A2) => A2.label), w = n2.separator ?? " / ";
4861
- p2.push({
4861
+ d2.push({
4862
4862
  label: _2.join(w),
4863
- value: C2.value
4863
+ value: S2.value
4864
4864
  });
4865
4865
  }
4866
- return p2;
4866
+ return d2;
4867
4867
  };
4868
4868
  if (a.length === 0) {
4869
4869
  if (l2.length !== 0) throw new Error("Non-empty secondary types list while main types list is empty.");
4870
- return h(new Set(xe), true);
4870
+ return h(new Set(_e), true);
4871
4871
  }
4872
4872
  let f = 0, g2 = -1;
4873
4873
  for (; f < a.length; ) {
4874
- const d2 = /* @__PURE__ */ new Set();
4875
- n2.includeNativeLabel && d2.add(xe);
4876
- for (let p2 = 0; p2 < f; ++p2) d2.add(a[p2]);
4877
- g2 >= 0 && d2.add(a[g2]);
4878
- const b = h(d2);
4879
- if (b !== void 0 && new Set(b.map((p2) => p2.label)).size === t.length) return b;
4874
+ const p2 = /* @__PURE__ */ new Set();
4875
+ n2.includeNativeLabel && p2.add(_e);
4876
+ for (let d2 = 0; d2 < f; ++d2) p2.add(a[d2]);
4877
+ g2 >= 0 && p2.add(a[g2]);
4878
+ const b = h(p2);
4879
+ if (b !== void 0 && new Set(b.map((d2) => d2.label)).size === t.length) return b;
4880
4880
  g2++, g2 >= a.length && (f++, g2 = f);
4881
4881
  }
4882
4882
  return h(/* @__PURE__ */ new Set([...a, ...l2]), true);
4883
4883
  }
4884
- const Q = "PColumnData/", ie = Q + "ResourceMap", se = Q + "Partitioned/ResourceMap", H = Q + "JsonPartitioned", B = Q + "BinaryPartitioned", Me = Q + "Partitioned/", oe = Me + "JsonPartitioned", q = Me + "BinaryPartitioned";
4884
+ const Q = "PColumnData/", ie = Q + "ResourceMap", se = Q + "Partitioned/ResourceMap", H = Q + "JsonPartitioned", B = Q + "BinaryPartitioned", $e = Q + "Partitioned/", oe = $e + "JsonPartitioned", q = $e + "BinaryPartitioned";
4885
4885
  const ge = (t) => {
4886
4886
  if (t.endsWith(".index"))
4887
4887
  return { baseKey: t.substring(0, t.length - 6), type: "index" };
@@ -4889,7 +4889,7 @@
4889
4889
  return { baseKey: t.substring(0, t.length - 7), type: "values" };
4890
4890
  throw new Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
4891
4891
  };
4892
- function Pt(t) {
4892
+ function xt(t) {
4893
4893
  if (!t) return;
4894
4894
  const e = t.resourceType.name, n2 = t.getDataAsJson(), r = [];
4895
4895
  let i = 0;
@@ -4935,7 +4935,7 @@
4935
4935
  }
4936
4936
  return { data: r, keyLength: i };
4937
4937
  }
4938
- function xt(t) {
4938
+ function _t(t) {
4939
4939
  if (t.type !== "JsonPartitioned" && t.type !== "BinaryPartitioned")
4940
4940
  throw new Error(`Splitting requires Partitioned DataInfoEntries, got ${t.type}`);
4941
4941
  const { parts: e, partitionKeyLength: n2 } = t, r = [];
@@ -4954,11 +4954,11 @@
4954
4954
  }
4955
4955
  return r.map((i) => Array.from(i.values()));
4956
4956
  }
4957
- function _t(t) {
4957
+ function It(t) {
4958
4958
  if (t === void 0) return;
4959
4959
  if (_(t))
4960
- return xt(t);
4961
- const e = Pt(t);
4960
+ return _t(t);
4961
+ const e = xt(t);
4962
4962
  if (!e) return;
4963
4963
  const { data: n2, keyLength: r } = e, i = [];
4964
4964
  for (let s2 = 0; s2 < r; ++s2)
@@ -5069,7 +5069,7 @@
5069
5069
  throw new Error(`Unknown resource type: ${n2}`);
5070
5070
  }
5071
5071
  }
5072
- function It(t) {
5072
+ function Tt(t) {
5073
5073
  if (t !== void 0) {
5074
5074
  if (_(t)) return t;
5075
5075
  if (Oe(t)) return Ve$1(t);
@@ -5077,7 +5077,7 @@
5077
5077
  throw new Error(`Unexpected input type: ${typeof t}`);
5078
5078
  }
5079
5079
  }
5080
- function Tt(t, e) {
5080
+ function Lt(t, e) {
5081
5081
  const n2 = [...e].sort((s2, o) => o[0] - s2[0]);
5082
5082
  if (t.type === "JsonPartitioned" || t.type === "BinaryPartitioned") {
5083
5083
  const { partitionKeyLength: s2 } = t;
@@ -5137,13 +5137,13 @@
5137
5137
  }
5138
5138
  }
5139
5139
  }
5140
- function Lt(t) {
5140
+ function Ft(t) {
5141
5141
  if (!Array.isArray(t)) return false;
5142
5142
  if (t.length === 0) return true;
5143
5143
  const e = t[0];
5144
5144
  return typeof e == "object" && e !== null && "key" in e && "val" in e;
5145
5145
  }
5146
- class Ft {
5146
+ class Et {
5147
5147
  constructor(e) {
5148
5148
  this.columns = e;
5149
5149
  }
@@ -5152,7 +5152,7 @@
5152
5152
  return this.columns.filter((r) => n2(r.spec));
5153
5153
  }
5154
5154
  }
5155
- function Et(t) {
5155
+ function kt(t) {
5156
5156
  if (t)
5157
5157
  return t.map((e) => ({
5158
5158
  type: `split:${_e$1(e.axisId)}`,
@@ -5161,16 +5161,16 @@
5161
5161
  // High importance for split filters in labels
5162
5162
  }));
5163
5163
  }
5164
- function kt(t) {
5164
+ function Dt(t) {
5165
5165
  if (t)
5166
5166
  return t.map((e) => [e.axisIdx, e.value]);
5167
5167
  }
5168
- function Dt(t, e) {
5168
+ function Ot(t, e) {
5169
5169
  if (!e || e.length === 0) return t;
5170
5170
  const n2 = [...e].sort((r, i) => r[0] - i[0]);
5171
5171
  return Re({ id: t, axisFilters: n2 });
5172
5172
  }
5173
- function _e(t) {
5173
+ function Ie(t) {
5174
5174
  if (!t || typeof t != "object") return false;
5175
5175
  const e = t, n2 = 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);
5176
5176
  return !!e.domainAnchor || n2 || r;
@@ -5186,7 +5186,7 @@
5186
5186
  class ae {
5187
5187
  constructor() {
5188
5188
  k(this, "defaultProviderStore", []);
5189
- k(this, "providers", [new Ft(this.defaultProviderStore)]);
5189
+ k(this, "providers", [new Et(this.defaultProviderStore)]);
5190
5190
  k(this, "axisLabelProviders", []);
5191
5191
  }
5192
5192
  addColumnProvider(e) {
@@ -5215,53 +5215,53 @@
5215
5215
  };
5216
5216
  let u2 = () => false;
5217
5217
  if (a) {
5218
- const p2 = (Array.isArray(a) ? a : [a]).map((y2) => {
5219
- if (_e(y2)) {
5218
+ const d2 = (Array.isArray(a) ? a : [a]).map((y2) => {
5219
+ if (Ie(y2)) {
5220
5220
  if (!r)
5221
5221
  throw new Error("Anchored selectors in exclude require an AnchoredIdDeriver to be provided in options.");
5222
5222
  return nn(We(r.anchors, y2, n2));
5223
5223
  } else
5224
5224
  return nn(y2);
5225
5225
  });
5226
- u2 = (y2) => p2.some((C2) => C2(y2));
5226
+ u2 = (y2) => d2.some((S2) => S2(y2));
5227
5227
  }
5228
5228
  const h = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], f = [], g2 = /* @__PURE__ */ new Set();
5229
- for (const p2 of h) {
5230
- const y$1 = _e(p2);
5231
- let C2;
5229
+ for (const d$1 of h) {
5230
+ const y$1 = Ie(d$1);
5231
+ let S2;
5232
5232
  if (y$1) {
5233
5233
  if (!r)
5234
5234
  throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");
5235
- C2 = We(r.anchors, p2, n2);
5235
+ S2 = We(r.anchors, d$1, n2);
5236
5236
  } else
5237
- C2 = p2;
5237
+ S2 = d$1;
5238
5238
  const E2 = /* @__PURE__ */ new Set(), _2 = [];
5239
- for (const S2 of this.providers) {
5240
- const I = S2.selectColumns(C2);
5239
+ for (const C2 of this.providers) {
5240
+ const I = C2.selectColumns(S2);
5241
5241
  for (const c2 of I) {
5242
5242
  if (u2(c2.spec)) continue;
5243
5243
  if (E2.has(c2.id))
5244
- throw new Error(`Duplicate column id ${c2.id} in provider ${S2.constructor.name}`);
5244
+ throw new Error(`Duplicate column id ${c2.id} in provider ${C2.constructor.name}`);
5245
5245
  const m2 = tn(c2.spec);
5246
5246
  g2.has(m2) || (E2.add(c2.id), g2.add(m2), _2.push(c2));
5247
5247
  }
5248
5248
  }
5249
5249
  if (_2.length === 0) continue;
5250
- const w = Rt(p2), A2 = w.length > 0;
5251
- for (const S2 of _2) {
5252
- if (!d(S2.spec)) continue;
5253
- const I = S2.spec;
5250
+ const w = Rt(d$1), A2 = w.length > 0;
5251
+ for (const C2 of _2) {
5252
+ if (!d(C2.spec)) continue;
5253
+ const I = C2.spec;
5254
5254
  if (A2) {
5255
- if (Lt(S2.data))
5256
- throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${S2.id}`);
5257
- const c2 = It(S2.data);
5255
+ if (Ft(C2.data))
5256
+ throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${C2.id}`);
5257
+ const c2 = Tt(C2.data);
5258
5258
  if (!c2) {
5259
5259
  if (s2) continue;
5260
5260
  return;
5261
5261
  }
5262
- if (!$e(c2))
5263
- throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${c2.type} for column ${S2.id}`);
5264
- const m2 = _t(c2), T = w[w.length - 1];
5262
+ if (!$e$1(c2))
5263
+ throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${c2.type} for column ${C2.id}`);
5264
+ const m2 = It(c2), T = w[w.length - 1];
5265
5265
  if (T >= c2.partitionKeyLength)
5266
5266
  throw new Error(`Not enough partition keys (${c2.partitionKeyLength}) for requested split axes (max index ${T}) in column ${I.name}`);
5267
5267
  const U = w.map((L2) => this.findLabels(y(I.axesSpec[L2]))), V = [], J = (L2, W) => {
@@ -5272,7 +5272,7 @@
5272
5272
  }
5273
5273
  const j = w[W];
5274
5274
  if (j >= m2.length)
5275
- throw new Error(`Axis index ${j} out of bounds for unique keys array (length ${m2.length}) during split key generation for column ${S2.id}`);
5275
+ throw new Error(`Axis index ${j} out of bounds for unique keys array (length ${m2.length}) during split key generation for column ${C2.id}`);
5276
5276
  const M = m2[j];
5277
5277
  if (!M || M.length === 0) {
5278
5278
  V.length = 0;
@@ -5283,20 +5283,20 @@
5283
5283
  };
5284
5284
  if (J([], 0), V.length === 0)
5285
5285
  continue;
5286
- const K = [...I.axesSpec], Ue = w.map((L2) => L2);
5286
+ const K = [...I.axesSpec], We2 = w.map((L2) => L2);
5287
5287
  for (let L2 = w.length - 1; L2 >= 0; L2--)
5288
5288
  K.splice(w[L2], 1);
5289
- const We2 = { ...I, axesSpec: K };
5289
+ const Ge = { ...I, axesSpec: K };
5290
5290
  for (const L2 of V) {
5291
5291
  const W = L2.map((j, M) => {
5292
- const Z = Ue[M], Ge = y(I.axesSpec[Z]), le = U[M], He2 = (le == null ? void 0 : le[j]) ?? String(j);
5293
- return { axisIdx: Z, axisId: Ge, value: j, label: He2 };
5292
+ const Z = We2[M], He2 = y(I.axesSpec[Z]), le = U[M], qe2 = (le == null ? void 0 : le[j]) ?? String(j);
5293
+ return { axisIdx: Z, axisId: He2, value: j, label: qe2 };
5294
5294
  });
5295
5295
  f.push({
5296
5296
  type: "split",
5297
- originalColumn: S2,
5297
+ originalColumn: C2,
5298
5298
  spec: I,
5299
- adjustedSpec: We2,
5299
+ adjustedSpec: Ge,
5300
5300
  dataEntries: c2,
5301
5301
  axisFilters: W
5302
5302
  });
@@ -5304,36 +5304,36 @@
5304
5304
  } else
5305
5305
  f.push({
5306
5306
  type: "direct",
5307
- originalColumn: S2,
5307
+ originalColumn: C2,
5308
5308
  spec: I,
5309
5309
  adjustedSpec: I
5310
5310
  });
5311
5311
  }
5312
5312
  }
5313
5313
  if (f.length === 0) return [];
5314
- const d$1 = Je(
5314
+ const p2 = Me(
5315
5315
  f,
5316
- (p2) => ({
5317
- spec: p2.spec,
5318
- suffixTrace: p2.type === "split" ? Et(p2.axisFilters) : void 0
5316
+ (d2) => ({
5317
+ spec: d2.spec,
5318
+ suffixTrace: d2.type === "split" ? kt(d2.axisFilters) : void 0
5319
5319
  }),
5320
5320
  l2
5321
5321
  ), b = [];
5322
- for (const { value: p2, label: y2 } of d$1) {
5323
- const { originalColumn: C2, spec: E2 } = p2, _2 = p2.type === "split" ? p2.axisFilters : void 0, w = kt(_2);
5322
+ for (const { value: d2, label: y2 } of p2) {
5323
+ const { originalColumn: S2, spec: E2 } = d2, _2 = d2.type === "split" ? d2.axisFilters : void 0, w = Dt(_2);
5324
5324
  let A2;
5325
- r ? A2 = r.deriveS(E2, w) : A2 = Dt(C2.id, w);
5326
- let S2 = { ...p2.adjustedSpec };
5327
- o && (S2 = {
5328
- ...S2,
5325
+ r ? A2 = r.deriveS(E2, w) : A2 = Ot(S2.id, w);
5326
+ let C2 = { ...d2.adjustedSpec };
5327
+ o && (C2 = {
5328
+ ...C2,
5329
5329
  annotations: {
5330
- ...S2.annotations ?? {},
5330
+ ...C2.annotations ?? {},
5331
5331
  "pl7.app/label": y2
5332
5332
  }
5333
5333
  }), b.push({
5334
5334
  id: A2,
5335
- spec: S2,
5336
- data: () => p2.type === "split" ? Ie$1(Tt(p2.dataEntries, w)) : p2.originalColumn.data,
5335
+ spec: C2,
5336
+ data: () => d2.type === "split" ? Ie$1(Lt(d2.dataEntries, w)) : d2.originalColumn.data,
5337
5337
  label: y2
5338
5338
  });
5339
5339
  }
@@ -5362,6 +5362,39 @@
5362
5362
  return i;
5363
5363
  }
5364
5364
  }
5365
+ function ye(t) {
5366
+ const e = (i) => i.operator !== "InSet" ? i : {
5367
+ operator: "Or",
5368
+ operands: i.references.map((s2) => ({
5369
+ operator: "Equal",
5370
+ reference: s2
5371
+ }))
5372
+ }, n2 = (i, s2) => {
5373
+ switch (i.operator) {
5374
+ case "And":
5375
+ return {
5376
+ ...i,
5377
+ operands: i.operands.map((a) => n2(a, s2))
5378
+ };
5379
+ case "Or":
5380
+ return {
5381
+ ...i,
5382
+ operands: i.operands.map((a) => n2(a, s2))
5383
+ };
5384
+ case "Not":
5385
+ return {
5386
+ ...i,
5387
+ operand: n2(i.operand, s2)
5388
+ };
5389
+ default:
5390
+ return s2(i);
5391
+ }
5392
+ }, r = (i, s2) => ({
5393
+ ...i,
5394
+ predicate: n2(i.predicate, s2)
5395
+ });
5396
+ return t.map((i) => r(i, e));
5397
+ }
5365
5398
  function ce(t, e) {
5366
5399
  if (t === void 0) return e === void 0;
5367
5400
  if (e === void 0) return true;
@@ -5369,10 +5402,10 @@
5369
5402
  if (t[n2] !== e[n2]) return false;
5370
5403
  return true;
5371
5404
  }
5372
- function Ie(t) {
5405
+ function Te(t) {
5373
5406
  return Ze(t, (e) => e instanceof D ? e.handle : Oe(e) ? Ce(e, (n2) => n2.handle) : e);
5374
5407
  }
5375
- class Ot {
5408
+ class Kt {
5376
5409
  constructor() {
5377
5410
  k(this, "ctx", v());
5378
5411
  }
@@ -5385,7 +5418,7 @@
5385
5418
  getOptions(e, n2) {
5386
5419
  const r = typeof e == "function" ? e : nn(e), i = this.getSpecs().entries.filter((a) => r(a.obj));
5387
5420
  let s2 = {}, o = false;
5388
- return typeof n2 < "u" && (typeof n2 == "function" ? s2 = n2 : typeof n2 == "object" && ("includeNativeLabel" in n2 || "separator" in n2 || "addLabelAsSuffix" in n2 ? s2 = n2 : (n2 = n2, s2 = n2.label ?? {}, o = n2.refsWithEnrichments ?? false))), typeof s2 == "object" ? Je(i, (a) => a.obj, s2 ?? {}).map(({ value: { ref: a }, label: l2 }) => ({
5421
+ return typeof n2 < "u" && (typeof n2 == "function" ? s2 = n2 : typeof n2 == "object" && ("includeNativeLabel" in n2 || "separator" in n2 || "addLabelAsSuffix" in n2 ? s2 = n2 : (n2 = n2, s2 = n2.label ?? {}, o = n2.refsWithEnrichments ?? false))), typeof s2 == "object" ? Me(i, (a) => a.obj, s2 ?? {}).map(({ value: { ref: a }, label: l2 }) => ({
5389
5422
  ref: un(a, o),
5390
5423
  label: l2
5391
5424
  })) : i.map(({ ref: a, obj: l2 }) => ({
@@ -5539,7 +5572,7 @@
5539
5572
  getPColumnByRef(e) {
5540
5573
  const n2 = this.getDataByRef(e);
5541
5574
  if (n2)
5542
- return Ye(n2);
5575
+ return Ye$1(n2);
5543
5576
  }
5544
5577
  /**
5545
5578
  * Returns spec associated with the ref ensuring that it is a p-column spec.
@@ -5647,7 +5680,7 @@
5647
5680
  k(this, "_argsCache");
5648
5681
  k(this, "_uiStateCache");
5649
5682
  k(this, "_activeArgsCache");
5650
- k(this, "resultPool", new Ot());
5683
+ k(this, "resultPool", new Kt());
5651
5684
  this.ctx = v();
5652
5685
  }
5653
5686
  get args() {
@@ -5688,10 +5721,10 @@
5688
5721
  );
5689
5722
  }
5690
5723
  get prerun() {
5691
- return this.getNamedAccessor(Ne);
5724
+ return this.getNamedAccessor(Ve);
5692
5725
  }
5693
5726
  get outputs() {
5694
- return this.getNamedAccessor(Ve);
5727
+ return this.getNamedAccessor(je);
5695
5728
  }
5696
5729
  /**
5697
5730
  * Find labels data for a given axis id. It will search for a label column and return its data as a map.
@@ -5707,17 +5740,21 @@
5707
5740
  if (n2 && !r) throw Error("Inline or explicit columns not supported");
5708
5741
  }
5709
5742
  patchPTableDef(e) {
5710
- var n2;
5711
- return (n2 = this.ctx.featureFlags) != null && n2.pTablePartitionFiltersSupport ? e : {
5743
+ var n2, r;
5744
+ return (n2 = this.ctx.featureFlags) != null && n2.pTablePartitionFiltersSupport || (e = {
5712
5745
  ...e,
5713
5746
  partitionFilters: [],
5714
5747
  filters: [...e.partitionFilters, ...e.filters]
5715
- };
5748
+ }), (r = this.ctx.featureFlags) != null && r.pFrameInSetFilterSupport || (e = {
5749
+ ...e,
5750
+ partitionFilters: ye(e.partitionFilters),
5751
+ filters: ye(e.filters)
5752
+ }), e;
5716
5753
  }
5717
5754
  // TODO remove all non-PColumn fields
5718
5755
  createPFrame(e) {
5719
5756
  return this.verifyInlineAndExplicitColumnsSupport(e), this.ctx.createPFrame(
5720
- e.map((n2) => Ie(n2))
5757
+ e.map((n2) => Te(n2))
5721
5758
  );
5722
5759
  }
5723
5760
  createPTable(e) {
@@ -5731,7 +5768,7 @@
5731
5768
  filters: [],
5732
5769
  sorting: e.sorting ?? []
5733
5770
  }) : n2 = this.patchPTableDef(e), this.verifyInlineAndExplicitColumnsSupport(en(n2.src)), this.ctx.createPTable(
5734
- qe$1(n2, (r) => Ie(r))
5771
+ qe(n2, (r) => Te(r))
5735
5772
  );
5736
5773
  }
5737
5774
  /** @deprecated scheduled for removal from SDK */
@@ -5751,13 +5788,13 @@
5751
5788
  this.ctx.logError(e);
5752
5789
  }
5753
5790
  }
5754
- const z = "1.39.0";
5755
- function Kt(t) {
5791
+ const z = "1.39.6";
5792
+ function Nt(t) {
5756
5793
  return t.__renderLambda === true;
5757
5794
  }
5758
- function de(t) {
5795
+ function pe(t) {
5759
5796
  if (t !== void 0)
5760
- return Kt(t) ? t.handle : t;
5797
+ return Nt(t) ? t.handle : t;
5761
5798
  }
5762
5799
  const x = class x2 {
5763
5800
  constructor(e, n2, r, i, s2, o, a, l2, u2) {
@@ -5964,13 +6001,13 @@
5964
6001
  sdkVersion: z,
5965
6002
  renderingMode: this._renderingMode,
5966
6003
  initialArgs: this._initialArgs,
5967
- inputsValid: de(this._inputsValid),
5968
- sections: de(this._sections),
6004
+ inputsValid: pe(this._inputsValid),
6005
+ sections: pe(this._sections),
5969
6006
  outputs: Object.fromEntries(
5970
- Object.entries(this._outputs).map(([n2, r]) => [n2, de(r)])
6007
+ Object.entries(this._outputs).map(([n2, r]) => [n2, pe(r)])
5971
6008
  )
5972
6009
  };
5973
- return ft() ? Ke({ sdkVersion: z }) : { config: e };
6010
+ return ht() ? Ne({ sdkVersion: z }) : { config: e };
5974
6011
  }
5975
6012
  };
5976
6013
  k(x, "INITIAL_BLOCK_FEATURE_FLAGS", {
@@ -5978,8 +6015,8 @@
5978
6015
  requiresUIAPIVersion: 1,
5979
6016
  requiresModelAPIVersion: 1
5980
6017
  });
5981
- let Te = x;
5982
- function Be() {
6018
+ let Le = x;
6019
+ function Ue() {
5983
6020
  return {
5984
6021
  sourceId: null,
5985
6022
  hiddenColIds: null,
@@ -5988,37 +6025,37 @@
5988
6025
  sorting: []
5989
6026
  };
5990
6027
  }
5991
- function Nt() {
6028
+ function Vt() {
5992
6029
  return {
5993
6030
  version: 3,
5994
6031
  stateCache: [],
5995
- pTableParams: Be()
6032
+ pTableParams: Ue()
5996
6033
  };
5997
6034
  }
5998
- function Vt(t) {
6035
+ function jt(t) {
5999
6036
  return "version" in t ? (t.version === 2 && (t = {
6000
6037
  version: 3,
6001
6038
  stateCache: t.stateCache.map((e) => ({
6002
6039
  ...e,
6003
6040
  filtersState: []
6004
6041
  })),
6005
- pTableParams: Be()
6006
- }), t) : Nt();
6042
+ pTableParams: Ue()
6043
+ }), t) : Vt();
6007
6044
  }
6008
- function ye(t) {
6045
+ function be(t) {
6009
6046
  return t.axesSpec.length === 1 && t.name === "pl7.app/label";
6010
6047
  }
6011
- function jt(t) {
6048
+ function Jt(t) {
6012
6049
  return new ae().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
6013
6050
  name: "pl7.app/label",
6014
6051
  axes: [{}]
6015
6052
  // exactly one axis
6016
6053
  }, { dontWaitAllData: true });
6017
6054
  }
6018
- function Le(t, e) {
6055
+ function Fe(t, e) {
6019
6056
  const n2 = [], r = [];
6020
6057
  for (const a of t)
6021
- ye(a.spec) ? n2.push(a) : r.push(a);
6058
+ be(a.spec) ? n2.push(a) : r.push(a);
6022
6059
  const i = [];
6023
6060
  for (const a of r)
6024
6061
  for (const l2 of a.spec.axesSpec) {
@@ -6039,8 +6076,8 @@
6039
6076
  for (const a of e) {
6040
6077
  const l2 = a.spec.axesSpec[0], u2 = y(l2), h = i.findIndex((f) => ne$1(f, u2));
6041
6078
  if (h !== -1) {
6042
- const f = i[h], g2 = Object.keys(f.domain ?? {}).length, d2 = Object.keys(l2.domain ?? {}).length;
6043
- g2 > d2 ? o.push({
6079
+ const f = i[h], g2 = Object.keys(f.domain ?? {}).length, p2 = Object.keys(l2.domain ?? {}).length;
6080
+ g2 > p2 ? o.push({
6044
6081
  id: s2(a.id, f.domain),
6045
6082
  spec: {
6046
6083
  ...a.spec,
@@ -6052,7 +6089,7 @@
6052
6089
  }
6053
6090
  return o;
6054
6091
  }
6055
- function Jt(t) {
6092
+ function Mt(t) {
6056
6093
  const e = (i) => Array.isArray(i), n2 = (i) => i instanceof D, r = (i) => typeof i == "object" && "type" in i;
6057
6094
  return t.map((i) => i.data).every((i) => {
6058
6095
  if (e(i))
@@ -6072,7 +6109,7 @@
6072
6109
  throw Error(`unsupported column data type: ${i}`);
6073
6110
  });
6074
6111
  }
6075
- function Fe(t) {
6112
+ function Ee(t) {
6076
6113
  let e = t.columns;
6077
6114
  const n2 = [];
6078
6115
  if (t.coreColumnPredicate) {
@@ -6094,69 +6131,69 @@
6094
6131
  sorting: t.sorting
6095
6132
  };
6096
6133
  }
6097
- function Mt(t) {
6134
+ function $t(t) {
6098
6135
  var e;
6099
6136
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "hidden";
6100
6137
  }
6101
- function $t(t) {
6138
+ function Bt(t) {
6102
6139
  var e;
6103
6140
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "optional";
6104
6141
  }
6105
- function pe(t, e) {
6142
+ function de(t, e) {
6106
6143
  return [...new Map(t.map((n2) => [e(n2), n2])).values()];
6107
6144
  }
6108
- function Nn(t, e, n2, r) {
6145
+ function Vn(t, e, n2, r) {
6109
6146
  if (e.length === 0) return;
6110
- const i = e.filter((c2) => !Mt(c2.spec)), s2 = Vt(n2), o = jt(t.resultPool);
6147
+ const i = e.filter((c2) => !$t(c2.spec)), s2 = jt(n2), o = Jt(t.resultPool);
6111
6148
  if (!o) return;
6112
- const a = Le(i.map(Me$1), o), l2 = [...i, ...a], h = [
6113
- ...pe(
6149
+ const a = Fe(i.map(Me$1), o), l2 = [...i, ...a], h = [
6150
+ ...de(
6114
6151
  [...l2.flatMap((c2) => c2.spec.axesSpec.map((m2) => y(m2)))],
6115
6152
  (c2) => mn(c2)
6116
6153
  ).map((c2) => ({ type: "axis", id: c2 })),
6117
6154
  ...l2.map((c2) => ({ type: "column", id: c2.id }))
6118
- ], f = new Set(h.map((c2) => mn(c2))), g2 = (c2) => f.has(mn(c2)), d2 = "full", b = s2.pTableParams.partitionFilters.filter((c2) => {
6155
+ ], f = new Set(h.map((c2) => mn(c2))), g2 = (c2) => f.has(mn(c2)), p2 = "full", b = s2.pTableParams.partitionFilters.filter((c2) => {
6119
6156
  const m2 = g2(c2.column);
6120
6157
  return m2 || t.logWarn(`Partition filter ${JSON.stringify(c2)} does not match provided columns, skipping`), m2;
6121
- }), p2 = pe(
6158
+ }), d2 = de(
6122
6159
  [...[], ...s2.pTableParams.filters],
6123
6160
  (c2) => mn(c2.column)
6124
6161
  ).filter((c2) => {
6125
6162
  const m2 = g2(c2.column);
6126
6163
  return m2 || t.logWarn(`Filter ${JSON.stringify(c2)} does not match provided columns, skipping`), m2;
6127
- }), y$1 = pe(
6164
+ }), y$1 = de(
6128
6165
  [...[], ...s2.pTableParams.sorting],
6129
6166
  (c2) => mn(c2.column)
6130
6167
  ).filter((c2) => {
6131
6168
  const m2 = g2(c2.column);
6132
6169
  return m2 || t.logWarn(`Sorting ${JSON.stringify(c2)} does not match provided columns, skipping`), m2;
6133
- }), C2 = Fe({
6170
+ }), S2 = Ee({
6134
6171
  columns: i,
6135
6172
  labelColumns: a,
6136
- coreJoinType: d2,
6173
+ coreJoinType: p2,
6137
6174
  partitionFilters: b,
6138
- filters: p2,
6175
+ filters: d2,
6139
6176
  sorting: y$1,
6140
6177
  coreColumnPredicate: void 0
6141
- }), E2 = t.createPTable(C2), _2 = new Set((() => {
6178
+ }), E2 = t.createPTable(S2), _2 = new Set((() => {
6142
6179
  const c2 = s2.pTableParams.hiddenColIds;
6143
- return c2 || i.filter((m2) => $t(m2.spec)).map((m2) => m2.id);
6180
+ return c2 || i.filter((m2) => Bt(m2.spec)).map((m2) => m2.id);
6144
6181
  })());
6145
6182
  i.filter((c2) => {
6146
6183
  var m2;
6147
6184
  return ((m2 = c2.spec.annotations) == null ? void 0 : m2["pl7.app/isLinkerColumn"]) === "true";
6148
- }).forEach((c2) => _2.delete(c2.id)), [...b.map((c2) => c2.column), ...p2.map((c2) => c2.column), ...y$1.map((c2) => c2.column)].filter((c2) => c2.type === "column").forEach((c2) => _2.delete(c2.id));
6149
- const w = i.filter((c2) => !_2.has(c2.id)), A2 = Le(w.map(Me$1), o);
6150
- if (!Jt([...w, ...A2])) return;
6151
- const S2 = Fe({
6185
+ }).forEach((c2) => _2.delete(c2.id)), [...b.map((c2) => c2.column), ...d2.map((c2) => c2.column), ...y$1.map((c2) => c2.column)].filter((c2) => c2.type === "column").forEach((c2) => _2.delete(c2.id));
6186
+ const w = i.filter((c2) => !_2.has(c2.id)), A2 = Fe(w.map(Me$1), o);
6187
+ if (!Mt([...w, ...A2])) return;
6188
+ const C2 = Ee({
6152
6189
  columns: w,
6153
6190
  labelColumns: A2,
6154
- coreJoinType: d2,
6191
+ coreJoinType: p2,
6155
6192
  partitionFilters: b,
6156
- filters: p2,
6193
+ filters: d2,
6157
6194
  sorting: y$1,
6158
6195
  coreColumnPredicate: void 0
6159
- }), I = t.createPTable(S2);
6196
+ }), I = t.createPTable(C2);
6160
6197
  return {
6161
6198
  sourceId: s2.pTableParams.sourceId,
6162
6199
  fullTableHandle: E2,
@@ -6186,8 +6223,8 @@
6186
6223
  numbers: z$1.array(z$1.coerce.number()),
6187
6224
  handles: z$1.array(ImportFileHandleSchema)
6188
6225
  });
6189
- const platforma = Te.create("Heavy").withArgs({ numbers: [1, 2, 3, 4], tableNumRows: 100, handles: [] }).withUiState({
6190
- dataTableStateV2: Nt(),
6226
+ const platforma = Le.create("Heavy").withArgs({ numbers: [1, 2, 3, 4], tableNumRows: 100, handles: [] }).withUiState({
6227
+ dataTableStateV2: Vt(),
6191
6228
  dynamicSections: []
6192
6229
  }).argsValid((ctx) => {
6193
6230
  if (ctx.args.numbers.length === 5) {
@@ -6328,7 +6365,7 @@
6328
6365
  })
6329
6366
  });
6330
6367
  }
6331
- return Nn(
6368
+ return Vn(
6332
6369
  ctx,
6333
6370
  columns,
6334
6371
  ctx.uiState.dataTableStateV2