@milaboratories/milaboratories.ui-examples.model 1.1.73 → 1.1.75

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
@@ -53,7 +53,7 @@
53
53
  return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
54
54
  }
55
55
  util2.joinValues = joinValues;
56
- util2.jsonStringifyReplacer = (_2, value) => {
56
+ util2.jsonStringifyReplacer = (_, value) => {
57
57
  if (typeof value === "bigint") {
58
58
  return value.toString();
59
59
  }
@@ -3071,29 +3071,29 @@
3071
3071
  const params = { errorMap: ctx.common.contextualErrorMap };
3072
3072
  const fn2 = ctx.data;
3073
3073
  if (this._def.returns instanceof ZodPromise) {
3074
- const me2 = this;
3074
+ const me = this;
3075
3075
  return OK(async function(...args) {
3076
3076
  const error = new ZodError([]);
3077
- const parsedArgs = await me2._def.args.parseAsync(args, params).catch((e) => {
3077
+ const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
3078
3078
  error.addIssue(makeArgsIssue(args, e));
3079
3079
  throw error;
3080
3080
  });
3081
3081
  const result = await Reflect.apply(fn2, this, parsedArgs);
3082
- const parsedReturns = await me2._def.returns._def.type.parseAsync(result, params).catch((e) => {
3082
+ const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => {
3083
3083
  error.addIssue(makeReturnsIssue(result, e));
3084
3084
  throw error;
3085
3085
  });
3086
3086
  return parsedReturns;
3087
3087
  });
3088
3088
  } else {
3089
- const me2 = this;
3089
+ const me = this;
3090
3090
  return OK(function(...args) {
3091
- const parsedArgs = me2._def.args.safeParse(args, params);
3091
+ const parsedArgs = me._def.args.safeParse(args, params);
3092
3092
  if (!parsedArgs.success) {
3093
3093
  throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
3094
3094
  }
3095
3095
  const result = Reflect.apply(fn2, this, parsedArgs.data);
3096
- const parsedReturns = me2._def.returns.safeParse(result, params);
3096
+ const parsedReturns = me._def.returns.safeParse(result, params);
3097
3097
  if (!parsedReturns.success) {
3098
3098
  throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
3099
3099
  }
@@ -3955,7 +3955,7 @@
3955
3955
  return canonicalize;
3956
3956
  }
3957
3957
  var canonicalizeExports = requireCanonicalize();
3958
- const ke = /* @__PURE__ */ getDefaultExportFromCjs(canonicalizeExports);
3958
+ const Re = /* @__PURE__ */ getDefaultExportFromCjs(canonicalizeExports);
3959
3959
  var B$1 = Object.defineProperty;
3960
3960
  var j = (n2, e, t) => e in n2 ? B$1(n2, e, { enumerable: true, configurable: true, writable: true, value: t }) : n2[e] = t;
3961
3961
  var l$1 = (n2, e, t) => j(n2, typeof e != "symbol" ? e + "" : e, t);
@@ -4095,7 +4095,7 @@
4095
4095
  }
4096
4096
  }
4097
4097
  }
4098
- function Fn(n2) {
4098
+ function Fn$1(n2) {
4099
4099
  return {
4100
4100
  columnId: n2.id,
4101
4101
  spec: n2.spec
@@ -4108,8 +4108,8 @@
4108
4108
  function J(n2) {
4109
4109
  return n2.map(p$1);
4110
4110
  }
4111
- function Rn$1(n2) {
4112
- return ke(p$1(n2));
4111
+ function Rn(n2) {
4112
+ return Re(p$1(n2));
4113
4113
  }
4114
4114
  function Y$1(n2, e) {
4115
4115
  if (n2 === void 0) return e === void 0;
@@ -4157,12 +4157,12 @@
4157
4157
  }
4158
4158
  }
4159
4159
  function nn(n2) {
4160
- return ke(n2);
4160
+ return Re(n2);
4161
4161
  }
4162
4162
  function P(n2) {
4163
- return ke(p$1(n2));
4163
+ return Re(p$1(n2));
4164
4164
  }
4165
- function k(n2, e) {
4165
+ function k$1(n2, e) {
4166
4166
  return JSON.stringify([n2, e]);
4167
4167
  }
4168
4168
  class _n {
@@ -4187,7 +4187,7 @@
4187
4187
  const s2 = Object.entries(o.domain);
4188
4188
  s2.sort((a, i) => a[0].localeCompare(i[0])), this.domainPackToAnchor.set(JSON.stringify(s2), r), this.domainPacks.push(s2.map(([a]) => a));
4189
4189
  for (const [a, i] of s2) {
4190
- const u2 = k(a, i);
4190
+ const u2 = k$1(a, i);
4191
4191
  this.domains.set(u2, r);
4192
4192
  }
4193
4193
  }
@@ -4222,7 +4222,7 @@
4222
4222
  for (const [a, i] of Object.entries(e.domain ?? {})) {
4223
4223
  if (o !== void 0 && o.has(a))
4224
4224
  continue;
4225
- const u2 = k(a, i), c2 = this.domains.get(u2);
4225
+ const u2 = k$1(a, i), c2 = this.domains.get(u2);
4226
4226
  r.domain ?? (r.domain = {}), r.domain[a] = c2 ? { anchor: c2 } : i;
4227
4227
  }
4228
4228
  if (r.axes = e.axesSpec.map((a) => {
@@ -4431,7 +4431,7 @@
4431
4431
  kind: n2.kind,
4432
4432
  name: n2.name
4433
4433
  };
4434
- return n2.domain !== void 0 && (e.domain = n2.domain), f(n2) && (e.axesSpec = J(n2.axesSpec)), ke(e);
4434
+ return n2.domain !== void 0 && (e.domain = n2.domain), f(n2) && (e.axesSpec = J(n2.axesSpec)), Re(e);
4435
4435
  }
4436
4436
  z$1.object({
4437
4437
  __isRef: z$1.literal(true).describe("Crucial marker for the block dependency tree reconstruction"),
@@ -4460,8 +4460,8 @@
4460
4460
  }
4461
4461
  const fn = 24;
4462
4462
  z$1.string().length(fn).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
4463
- function ce$1(n2) {
4464
- return JSON.parse(n2);
4463
+ function ue$1(n2) {
4464
+ return Re(n2);
4465
4465
  }
4466
4466
  var stringify = { exports: {} };
4467
4467
  var hasRequiredStringify;
@@ -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 O = (t, e, n2) => ze(t, typeof e != "symbol" ? e + "" : e, n2);
4525
+ var Ye = Object.defineProperty;
4526
+ var Xe = (t, e, n2) => e in t ? Ye(t, e, { enumerable: true, configurable: true, writable: true, value: n2 }) : t[e] = n2;
4527
+ var k = (t, e, n2) => Xe(t, typeof e != "symbol" ? e + "" : e, n2);
4528
4528
  function re(t) {
4529
4529
  return { type: "Immediate", value: t };
4530
4530
  }
4531
- function pt() {
4531
+ function ht() {
4532
4532
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
4533
4533
  }
4534
- function De(t) {
4534
+ function Ke(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 ft() {
4540
+ function gt() {
4541
4541
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
4542
4542
  }
4543
4543
  function y() {
@@ -4545,31 +4545,31 @@
4545
4545
  throw new Error("Not in config rendering context");
4546
4546
  }
4547
4547
  function H(t, e) {
4548
- const n2 = ft();
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
- const ce = /* @__PURE__ */ new Map();
4554
- function ht(t, e) {
4553
+ const de = /* @__PURE__ */ new Map();
4554
+ function mt(t, e) {
4555
4555
  t in y().callbackRegistry || (y().callbackRegistry[t] = (n2) => {
4556
- for (const r of ce.get(t))
4556
+ for (const r of de.get(t))
4557
4557
  r(n2);
4558
- }, ce.set(t, [])), ce.get(t).push(e);
4558
+ }, de.set(t, [])), de.get(t).push(e);
4559
4559
  }
4560
- class _ {
4560
+ class I {
4561
4561
  constructor(e, n2 = (r) => r) {
4562
- O(this, "isResolved", false);
4563
- O(this, "resolvedValue");
4564
- this.handle = e, this.postProcess = n2, ht(e, (r) => {
4562
+ k(this, "isResolved", false);
4563
+ k(this, "resolvedValue");
4564
+ this.handle = e, this.postProcess = n2, mt(e, (r) => {
4565
4565
  this.resolvedValue = n2(r), this.isResolved = true;
4566
4566
  });
4567
4567
  }
4568
4568
  map(e) {
4569
- return new _(this.handle, (n2) => e(this.postProcess(n2)));
4569
+ return new I(this.handle, (n2) => e(this.postProcess(n2)));
4570
4570
  }
4571
4571
  mapDefined(e) {
4572
- return new _(this.handle, (n2) => {
4572
+ return new I(this.handle, (n2) => {
4573
4573
  const r = this.postProcess(n2);
4574
4574
  return r ? e(r) : void 0;
4575
4575
  });
@@ -4578,7 +4578,7 @@
4578
4578
  return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
4579
4579
  }
4580
4580
  }
4581
- function he(t, e) {
4581
+ function ge(t, e) {
4582
4582
  return t === void 0 ? void 0 : e(t);
4583
4583
  }
4584
4584
  class E {
@@ -4620,7 +4620,7 @@
4620
4620
  ...this.resolvePath,
4621
4621
  ...n2.map((i) => typeof i == "string" ? i : i.field)
4622
4622
  ];
4623
- return he(
4623
+ return ge(
4624
4624
  y().resolveWithCommon(this.handle, e, ...n2),
4625
4625
  (i) => new E(i, r)
4626
4626
  );
@@ -4642,7 +4642,7 @@
4642
4642
  }
4643
4643
  getError() {
4644
4644
  const e = [...this.resolvePath, "error"];
4645
- return he(
4645
+ return ge(
4646
4646
  y().getError(this.handle),
4647
4647
  (n2) => new E(n2, e)
4648
4648
  );
@@ -4707,13 +4707,13 @@
4707
4707
  return i;
4708
4708
  }
4709
4709
  getFileContentAsBase64(e) {
4710
- return new _(y().getBlobContentAsBase64(this.handle, e));
4710
+ return new I(y().getBlobContentAsBase64(this.handle, e));
4711
4711
  }
4712
4712
  getFileContentAsString(e) {
4713
- return new _(y().getBlobContentAsString(this.handle, e));
4713
+ return new I(y().getBlobContentAsString(this.handle, e));
4714
4714
  }
4715
4715
  getFileContentAsJson(e) {
4716
- return new _(
4716
+ return new I(
4717
4717
  y().getBlobContentAsString(this.handle, e)
4718
4718
  ).mapDefined((n2) => JSON.parse(n2));
4719
4719
  }
@@ -4733,7 +4733,7 @@
4733
4733
  * @returns downloaded file handle
4734
4734
  */
4735
4735
  getFileHandle() {
4736
- return new _(y().getDownloadedBlobContentHandle(this.handle));
4736
+ return new I(y().getDownloadedBlobContentHandle(this.handle));
4737
4737
  }
4738
4738
  /**
4739
4739
  * @deprecated use getFileHandle
@@ -4745,7 +4745,7 @@
4745
4745
  * @returns downloaded file handle
4746
4746
  */
4747
4747
  getRemoteFileHandle() {
4748
- return new _(y().getOnDemandBlobContentHandle(this.handle));
4748
+ return new I(y().getOnDemandBlobContentHandle(this.handle));
4749
4749
  }
4750
4750
  /**
4751
4751
  * @deprecated use getRemoteFileHandle
@@ -4757,22 +4757,22 @@
4757
4757
  * @returns the url to the extracted folder
4758
4758
  */
4759
4759
  extractArchiveAndGetURL(e) {
4760
- return new _(y().extractArchiveAndGetURL(this.handle, e));
4760
+ return new I(y().extractArchiveAndGetURL(this.handle, e));
4761
4761
  }
4762
4762
  getImportProgress() {
4763
- return new _(y().getImportProgress(this.handle));
4763
+ return new I(y().getImportProgress(this.handle));
4764
4764
  }
4765
4765
  getLastLogs(e) {
4766
- return new _(y().getLastLogs(this.handle, e));
4766
+ return new I(y().getLastLogs(this.handle, e));
4767
4767
  }
4768
4768
  getProgressLog(e) {
4769
- return new _(y().getProgressLog(this.handle, e));
4769
+ return new I(y().getProgressLog(this.handle, e));
4770
4770
  }
4771
4771
  getProgressLogWithInfo(e) {
4772
- return new _(y().getProgressLogWithInfo(this.handle, e));
4772
+ return new I(y().getProgressLogWithInfo(this.handle, e));
4773
4773
  }
4774
4774
  getLogHandle() {
4775
- return new _(y().getLogHandle(this.handle));
4775
+ return new I(y().getLogHandle(this.handle));
4776
4776
  }
4777
4777
  allFieldsResolved(e = "Input") {
4778
4778
  switch (e) {
@@ -4801,95 +4801,95 @@
4801
4801
  return s2 && (l2 = l2.filter((u2) => u2[1] !== void 0)), l2.map(([u2, c2]) => o(u2, c2));
4802
4802
  }
4803
4803
  }
4804
- const Re = "staging", Fe = "main";
4805
- const yt = "pl7.app/label", vt = "pl7.app/trace", bt = z$1.object({
4804
+ const Ve = "staging", je = "main";
4805
+ const bt = "pl7.app/label", wt = "pl7.app/trace", At = 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
- }), wt = z$1.array(bt), At = 1e-3, xt = "__LABEL__", Pe = "__LABEL__@1";
4811
- function je(t, e, n2 = {}) {
4810
+ }), xt = z$1.array(At), Ct = 1e-3, Pt = "__LABEL__", Te = "__LABEL__@1";
4811
+ function $e(t, e, n2 = {}) {
4812
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
- var P2, R;
4814
- const v = e(p2);
4815
- let f2, m2, w2;
4816
- "spec" in v && typeof v.spec == "object" ? (f2 = v.spec, m2 = v.prefixTrace, w2 = v.suffixTrace) : f2 = v;
4817
- const h2 = (P2 = f2.annotations) == null ? void 0 : P2[yt], I = (R = f2.annotations) == null ? void 0 : R[vt], x = (I ? wt.safeParse(JSON.parse(I)).data : void 0) ?? [], b = [
4818
- ...m2 ?? [],
4819
- ...x,
4820
- ...w2 ?? []
4813
+ var S, F;
4814
+ const m2 = e(p2);
4815
+ let f2, v, b;
4816
+ "spec" in m2 && typeof m2.spec == "object" ? (f2 = m2.spec, v = m2.prefixTrace, b = m2.suffixTrace) : f2 = m2;
4817
+ const g = (S = f2.annotations) == null ? void 0 : S[bt], x = (F = f2.annotations) == null ? void 0 : F[wt], A = (x ? xt.safeParse(JSON.parse(x)).data : void 0) ?? [], C = [
4818
+ ...v ?? [],
4819
+ ...A,
4820
+ ...b ?? []
4821
4821
  ];
4822
- if (h2 !== void 0) {
4823
- const k2 = { label: h2, type: xt, importance: -2 };
4824
- n2.addLabelAsSuffix ? b.push(k2) : b.splice(0, 0, k2);
4825
- }
4826
- const A = [], L = /* @__PURE__ */ new Map();
4827
- for (let k2 = b.length - 1; k2 >= 0; --k2) {
4828
- const { type: W } = b[k2], V = b[k2].importance ?? 0, N2 = (L.get(W) ?? 0) + 1;
4829
- L.set(W, N2);
4830
- const F = `${W}@${N2}`;
4831
- s2.set(F, (s2.get(F) ?? 0) + 1), r.set(
4832
- F,
4822
+ if (g !== void 0) {
4823
+ const D = { label: g, type: Pt, importance: -2 };
4824
+ n2.addLabelAsSuffix ? C.push(D) : C.splice(0, 0, D);
4825
+ }
4826
+ const w2 = [], T = /* @__PURE__ */ new Map();
4827
+ for (let D = C.length - 1; D >= 0; --D) {
4828
+ const { type: W } = C[D], j2 = C[D].importance ?? 0, $ = (T.get(W) ?? 0) + 1;
4829
+ T.set(W, $);
4830
+ const K2 = `${W}@${$}`;
4831
+ s2.set(K2, (s2.get(K2) ?? 0) + 1), r.set(
4832
+ K2,
4833
4833
  Math.max(
4834
- r.get(F) ?? Number.NEGATIVE_INFINITY,
4835
- V - (b.length - k2) * At
4834
+ r.get(K2) ?? Number.NEGATIVE_INFINITY,
4835
+ j2 - (C.length - D) * Ct
4836
4836
  )
4837
- ), A.push({ ...b[k2], fullType: F, occurrenceIndex: N2 });
4837
+ ), w2.push({ ...C[D], fullType: K2, occurrenceIndex: $ });
4838
4838
  }
4839
- return A.reverse(), {
4839
+ return w2.reverse(), {
4840
4840
  value: p2,
4841
4841
  spec: f2,
4842
- label: h2,
4843
- fullTrace: A
4842
+ label: g,
4843
+ fullTrace: w2
4844
4844
  };
4845
4845
  }), a = [], l2 = [], u2 = [...r];
4846
- u2.sort(([, p2], [, v]) => v - p2);
4846
+ u2.sort(([, p2], [, m2]) => m2 - p2);
4847
4847
  for (const [p2] of u2)
4848
4848
  p2.endsWith("@1") || s2.get(p2) === t.length ? a.push(p2) : l2.push(p2);
4849
- const c2 = (p2, v = false) => {
4849
+ const c2 = (p2, m2 = false) => {
4850
4850
  const f2 = [];
4851
- for (let m2 = 0; m2 < o.length; m2++) {
4852
- const w2 = o[m2], h2 = w2.fullTrace.filter((b) => p2.has(b.fullType) || i && i.has(b.type));
4853
- if (h2.length === 0)
4854
- if (v)
4851
+ for (let v = 0; v < o.length; v++) {
4852
+ const b = o[v], g = b.fullTrace.filter((C) => p2.has(C.fullType) || i && i.has(C.type));
4853
+ if (g.length === 0)
4854
+ if (m2)
4855
4855
  f2.push({
4856
4856
  label: "Unlabeled",
4857
- value: w2.value
4857
+ value: b.value
4858
4858
  });
4859
4859
  else return;
4860
- const I = h2.map((b) => b.label), x = n2.separator ?? " / ";
4860
+ const x = g.map((C) => C.label), A = n2.separator ?? " / ";
4861
4861
  f2.push({
4862
- label: I.join(x),
4863
- value: w2.value
4862
+ label: x.join(A),
4863
+ value: b.value
4864
4864
  });
4865
4865
  }
4866
4866
  return f2;
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 c2(new Set(Pe), true);
4870
+ return c2(new Set(Te), true);
4871
4871
  }
4872
- let d = 0, g = -1;
4872
+ let d = 0, h2 = -1;
4873
4873
  for (; d < a.length; ) {
4874
4874
  const p2 = /* @__PURE__ */ new Set();
4875
- n2.includeNativeLabel && p2.add(Pe);
4875
+ n2.includeNativeLabel && p2.add(Te);
4876
4876
  for (let f2 = 0; f2 < d; ++f2) p2.add(a[f2]);
4877
- g >= 0 && p2.add(a[g]);
4878
- const v = c2(p2);
4879
- if (v !== void 0 && new Set(v.map((f2) => f2.label)).size === t.length) return v;
4880
- g++, g >= a.length && (d++, g = d);
4877
+ h2 >= 0 && p2.add(a[h2]);
4878
+ const m2 = c2(p2);
4879
+ if (m2 !== void 0 && new Set(m2.map((f2) => f2.label)).size === t.length) return m2;
4880
+ h2++, h2 >= a.length && (d++, h2 = d);
4881
4881
  }
4882
4882
  return c2(/* @__PURE__ */ new Set([...a, ...l2]), true);
4883
4883
  }
4884
- const Z = "PColumnData/", se = Z + "ResourceMap", oe = Z + "Partitioned/ResourceMap", q = Z + "JsonPartitioned", B = Z + "BinaryPartitioned", Ve = Z + "Partitioned/", ae = Ve + "JsonPartitioned", z = Ve + "BinaryPartitioned";
4885
- const me = (t) => {
4884
+ const Z = "PColumnData/", se = Z + "ResourceMap", oe = Z + "Partitioned/ResourceMap", q = Z + "JsonPartitioned", B = Z + "BinaryPartitioned", Je = Z + "Partitioned/", ae = Je + "JsonPartitioned", z = Je + "BinaryPartitioned";
4885
+ const ye = (t) => {
4886
4886
  if (t.endsWith(".index"))
4887
4887
  return { baseKey: t.substring(0, t.length - 6), type: "index" };
4888
4888
  if (t.endsWith(".values"))
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 Ct(t) {
4892
+ function St(t) {
4893
4893
  if (!t) return;
4894
4894
  const e = t.resourceType.name, n2 = t.getDataAsJson(), r = [];
4895
4895
  let i = 0;
@@ -4914,7 +4914,7 @@
4914
4914
  case q:
4915
4915
  case B:
4916
4916
  for (let s2 of t.listInputFields()) {
4917
- e === B && (s2 = me(s2).baseKey);
4917
+ e === B && (s2 = ye(s2).baseKey);
4918
4918
  const o = [...JSON.parse(s2)];
4919
4919
  r.push(o);
4920
4920
  }
@@ -4926,7 +4926,7 @@
4926
4926
  const o = [...JSON.parse(s2)], a = t.resolve({ field: s2, assertFieldType: "Input" });
4927
4927
  if (a !== void 0)
4928
4928
  for (let l2 of a.listInputFields()) {
4929
- e === z && (l2 = me(l2).baseKey);
4929
+ e === z && (l2 = ye(l2).baseKey);
4930
4930
  const u2 = [...o, ...JSON.parse(l2)];
4931
4931
  r.push(u2);
4932
4932
  }
@@ -4935,7 +4935,7 @@
4935
4935
  }
4936
4936
  return { data: r, keyLength: i };
4937
4937
  }
4938
- function Pt(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 St(t) {
4957
+ function It(t) {
4958
4958
  if (t === void 0) return;
4959
4959
  if (K(t))
4960
- return Pt(t);
4961
- const e = Ct(t);
4960
+ return _t(t);
4961
+ const e = St(t);
4962
4962
  if (!e) return;
4963
4963
  const { data: n2, keyLength: r } = e, i = [];
4964
4964
  for (let s2 = 0; s2 < r; ++s2)
@@ -4971,7 +4971,7 @@
4971
4971
  }
4972
4972
  return i.map((s2) => Array.from(s2.values()));
4973
4973
  }
4974
- function ye(t, e = []) {
4974
+ function ve(t, e = []) {
4975
4975
  if (t === void 0 || !t.getIsReadyOrError()) return;
4976
4976
  const n2 = t.resourceType.name, r = t.getDataAsJson();
4977
4977
  if (e.length > 0 && (n2 === ae || n2 === z))
@@ -5001,7 +5001,7 @@
5001
5001
  throw new Error(`Missing partitionKeyLength in metadata for ${n2}`);
5002
5002
  const i = [], s2 = /* @__PURE__ */ new Map();
5003
5003
  for (const o of t.listInputFields()) {
5004
- const a = me(o), l2 = t.resolve({ field: o, assertFieldType: "Input" });
5004
+ const a = ye(o), l2 = t.resolve({ field: o, assertFieldType: "Input" });
5005
5005
  if (l2 === void 0) return;
5006
5006
  let u2 = s2.get(a.baseKey);
5007
5007
  u2 || (u2 = {}, s2.set(a.baseKey, u2)), a.type === "index" ? u2.index = l2 : u2.values = l2;
@@ -5032,7 +5032,7 @@
5032
5032
  if (a === void 0) return;
5033
5033
  if (a.resourceType.name !== q)
5034
5034
  throw new Error(`Expected ${q} inside ${n2}, but got ${a.resourceType.name}`);
5035
- const l2 = ye(a, JSON.parse(o));
5035
+ const l2 = ve(a, JSON.parse(o));
5036
5036
  if (l2 === void 0) return;
5037
5037
  if (l2.type !== "JsonPartitioned")
5038
5038
  throw new Error(`Unexpected inner result type for ${n2}: ${l2.type}`);
@@ -5053,7 +5053,7 @@
5053
5053
  if (a === void 0) return;
5054
5054
  if (a.resourceType.name !== B)
5055
5055
  throw new Error(`Expected ${B} inside ${n2}, but got ${a.resourceType.name}`);
5056
- const l2 = ye(a, JSON.parse(o));
5056
+ const l2 = ve(a, JSON.parse(o));
5057
5057
  if (l2 === void 0) return;
5058
5058
  if (l2.type !== "BinaryPartitioned")
5059
5059
  throw new Error(`Unexpected inner result type for ${n2}: ${l2.type}`);
@@ -5069,15 +5069,15 @@
5069
5069
  throw new Error(`Unknown resource type: ${n2}`);
5070
5070
  }
5071
5071
  }
5072
- function _t(t) {
5072
+ function Tt(t) {
5073
5073
  if (t !== void 0) {
5074
5074
  if (K(t)) return t;
5075
5075
  if (En(t)) return Cn(t);
5076
- if (t instanceof E) return ye(t);
5076
+ if (t instanceof E) return ve(t);
5077
5077
  throw new Error(`Unexpected input type: ${typeof t}`);
5078
5078
  }
5079
5079
  }
5080
- function It(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 Et(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 Tt {
5146
+ class Dt {
5147
5147
  constructor(e) {
5148
5148
  this.columns = e;
5149
5149
  }
@@ -5152,30 +5152,30 @@
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
- type: `split:${Rn$1(e.axisId)}`,
5158
+ type: `split:${Rn(e.axisId)}`,
5159
5159
  label: e.label,
5160
5160
  importance: 1e6
5161
5161
  // High importance for split filters in labels
5162
5162
  }));
5163
5163
  }
5164
- function kt(t) {
5164
+ function Ot(t) {
5165
5165
  if (t)
5166
5166
  return t.map((e) => [e.axisIdx, e.value]);
5167
5167
  }
5168
- function Ot(t, e) {
5168
+ function Rt(t, e) {
5169
5169
  if (!e || e.length === 0) return t;
5170
5170
  const n2 = [...e].sort((r, i) => r[0] - i[0]);
5171
- return ke({ id: t, axisFilters: n2 });
5171
+ return Re({ id: t, axisFilters: n2 });
5172
5172
  }
5173
- function Se(t) {
5173
+ function Le(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;
5177
5177
  }
5178
- function Dt(t) {
5178
+ function Ft(t) {
5179
5179
  if (typeof t != "object" || !("axes" in t) || t.axes === void 0)
5180
5180
  return [];
5181
5181
  const e = t.axes.map((n2, r) => typeof n2 == "object" && "split" in n2 && n2.split === true ? r : -1).filter((n2) => n2 !== -1);
@@ -5185,9 +5185,9 @@
5185
5185
  }
5186
5186
  class le {
5187
5187
  constructor() {
5188
- O(this, "defaultProviderStore", []);
5189
- O(this, "providers", [new Tt(this.defaultProviderStore)]);
5190
- O(this, "axisLabelProviders", []);
5188
+ k(this, "defaultProviderStore", []);
5189
+ k(this, "providers", [new Dt(this.defaultProviderStore)]);
5190
+ k(this, "axisLabelProviders", []);
5191
5191
  }
5192
5192
  addColumnProvider(e) {
5193
5193
  return this.providers.push(e), this;
@@ -5215,129 +5215,129 @@
5215
5215
  };
5216
5216
  let u2 = () => false;
5217
5217
  if (a) {
5218
- const f2 = (Array.isArray(a) ? a : [a]).map((m2) => {
5219
- if (Se(m2)) {
5218
+ const f2 = (Array.isArray(a) ? a : [a]).map((v) => {
5219
+ if (Le(v)) {
5220
5220
  if (!r)
5221
5221
  throw new Error("Anchored selectors in exclude require an AnchoredIdDeriver to be provided in options.");
5222
- return Gn(Mn(r.anchors, m2, n2));
5222
+ return Gn(Mn(r.anchors, v, n2));
5223
5223
  } else
5224
- return Gn(m2);
5224
+ return Gn(v);
5225
5225
  });
5226
- u2 = (m2) => f2.some((w2) => w2(m2));
5226
+ u2 = (v) => f2.some((b) => b(v));
5227
5227
  }
5228
- const c2 = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], d = [], g = /* @__PURE__ */ new Set();
5228
+ const c2 = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], d = [], h2 = /* @__PURE__ */ new Set();
5229
5229
  for (const f$1 of c2) {
5230
- const m2 = Se(f$1);
5231
- let w2;
5232
- if (m2) {
5230
+ const v = Le(f$1);
5231
+ let b;
5232
+ if (v) {
5233
5233
  if (!r)
5234
5234
  throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");
5235
- w2 = Mn(r.anchors, f$1, n2);
5235
+ b = Mn(r.anchors, f$1, n2);
5236
5236
  } else
5237
- w2 = f$1;
5238
- const h2 = /* @__PURE__ */ new Set(), I = [];
5239
- for (const A of this.providers) {
5240
- const L = A.selectColumns(w2);
5241
- for (const P2 of L) {
5242
- if (u2(P2.spec)) continue;
5243
- if (h2.has(P2.id))
5244
- throw new Error(`Duplicate column id ${P2.id} in provider ${A.constructor.name}`);
5245
- const R = Qn(P2.spec);
5246
- g.has(R) || (h2.add(P2.id), g.add(R), I.push(P2));
5237
+ b = f$1;
5238
+ const g = /* @__PURE__ */ new Set(), x = [];
5239
+ for (const w2 of this.providers) {
5240
+ const T = w2.selectColumns(b);
5241
+ for (const S of T) {
5242
+ if (u2(S.spec)) continue;
5243
+ if (g.has(S.id))
5244
+ throw new Error(`Duplicate column id ${S.id} in provider ${w2.constructor.name}`);
5245
+ const F = Qn(S.spec);
5246
+ h2.has(F) || (g.add(S.id), h2.add(F), x.push(S));
5247
5247
  }
5248
5248
  }
5249
- if (I.length === 0) continue;
5250
- const x = Dt(f$1), b = x.length > 0;
5251
- for (const A of I) {
5252
- if (!f(A.spec)) continue;
5253
- const L = A.spec;
5254
- if (b) {
5255
- if (Lt(A.data))
5256
- throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${A.id}`);
5257
- const P2 = _t(A.data);
5258
- if (!P2) {
5249
+ if (x.length === 0) continue;
5250
+ const A = Ft(f$1), C = A.length > 0;
5251
+ for (const w2 of x) {
5252
+ if (!f(w2.spec)) continue;
5253
+ const T = w2.spec;
5254
+ if (C) {
5255
+ if (Et(w2.data))
5256
+ throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${w2.id}`);
5257
+ const S = Tt(w2.data);
5258
+ if (!S) {
5259
5259
  if (s2) continue;
5260
5260
  return;
5261
5261
  }
5262
- if (!Sn(P2))
5263
- throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${P2.type} for column ${A.id}`);
5264
- const R = St(P2), k2 = x[x.length - 1];
5265
- if (k2 >= P2.partitionKeyLength)
5266
- throw new Error(`Not enough partition keys (${P2.partitionKeyLength}) for requested split axes (max index ${k2}) in column ${L.name}`);
5267
- const W = x.map((S) => this.findLabels(p$1(L.axesSpec[S]))), V = [], N2 = (S, G) => {
5268
- if (G >= x.length) {
5269
- if (V.push([...S]), V.length > 1e4)
5262
+ if (!Sn(S))
5263
+ throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${S.type} for column ${w2.id}`);
5264
+ const F = It(S), D = A[A.length - 1];
5265
+ if (D >= S.partitionKeyLength)
5266
+ throw new Error(`Not enough partition keys (${S.partitionKeyLength}) for requested split axes (max index ${D}) in column ${T.name}`);
5267
+ const W = A.map((_) => this.findLabels(p$1(T.axesSpec[_]))), j2 = [], $ = (_, G) => {
5268
+ if (G >= A.length) {
5269
+ if (j2.push([..._]), j2.length > 1e4)
5270
5270
  throw new Error("Too many key combinations, aborting.");
5271
5271
  return;
5272
5272
  }
5273
- const $ = x[G];
5274
- if ($ >= R.length)
5275
- throw new Error(`Axis index ${$} out of bounds for unique keys array (length ${R.length}) during split key generation for column ${A.id}`);
5276
- const J2 = R[$];
5273
+ const N2 = A[G];
5274
+ if (N2 >= F.length)
5275
+ throw new Error(`Axis index ${N2} out of bounds for unique keys array (length ${F.length}) during split key generation for column ${w2.id}`);
5276
+ const J2 = F[N2];
5277
5277
  if (!J2 || J2.length === 0) {
5278
- V.length = 0;
5278
+ j2.length = 0;
5279
5279
  return;
5280
5280
  }
5281
5281
  for (const ee of J2)
5282
- S.push(ee), N2(S, G + 1), S.pop();
5282
+ _.push(ee), $(_, G + 1), _.pop();
5283
5283
  };
5284
- if (N2([], 0), V.length === 0)
5284
+ if ($([], 0), j2.length === 0)
5285
5285
  continue;
5286
- const F = [...L.axesSpec], Be = x.map((S) => S);
5287
- for (let S = x.length - 1; S >= 0; S--)
5288
- F.splice(x[S], 1);
5289
- const We = { ...L, axesSpec: F };
5290
- for (const S of V) {
5291
- const G = S.map(($, J2) => {
5292
- const ee = Be[J2], Ge = p$1(L.axesSpec[ee]), ue = W[J2], He = (ue == null ? void 0 : ue[$]) ?? String($);
5293
- return { axisIdx: ee, axisId: Ge, value: $, label: He };
5286
+ const K2 = [...T.axesSpec], Ge = A.map((_) => _);
5287
+ for (let _ = A.length - 1; _ >= 0; _--)
5288
+ K2.splice(A[_], 1);
5289
+ const He = { ...T, axesSpec: K2 };
5290
+ for (const _ of j2) {
5291
+ const G = _.map((N2, J2) => {
5292
+ const ee = Ge[J2], qe = p$1(T.axesSpec[ee]), ce = W[J2], ze = (ce == null ? void 0 : ce[N2]) ?? String(N2);
5293
+ return { axisIdx: ee, axisId: qe, value: N2, label: ze };
5294
5294
  });
5295
5295
  d.push({
5296
5296
  type: "split",
5297
- originalColumn: A,
5298
- spec: L,
5299
- adjustedSpec: We,
5300
- dataEntries: P2,
5297
+ originalColumn: w2,
5298
+ spec: T,
5299
+ adjustedSpec: He,
5300
+ dataEntries: S,
5301
5301
  axisFilters: G
5302
5302
  });
5303
5303
  }
5304
5304
  } else
5305
5305
  d.push({
5306
5306
  type: "direct",
5307
- originalColumn: A,
5308
- spec: L,
5309
- adjustedSpec: L
5307
+ originalColumn: w2,
5308
+ spec: T,
5309
+ adjustedSpec: T
5310
5310
  });
5311
5311
  }
5312
5312
  }
5313
5313
  if (d.length === 0) return [];
5314
- const p2 = je(
5314
+ const p2 = $e(
5315
5315
  d,
5316
5316
  (f2) => ({
5317
5317
  spec: f2.spec,
5318
- suffixTrace: f2.type === "split" ? Et(f2.axisFilters) : void 0
5318
+ suffixTrace: f2.type === "split" ? kt(f2.axisFilters) : void 0
5319
5319
  }),
5320
5320
  l2
5321
- ), v = [];
5322
- for (const { value: f2, label: m2 } of p2) {
5323
- const { originalColumn: w2, spec: h2 } = f2, I = f2.type === "split" ? f2.axisFilters : void 0, x = kt(I);
5324
- let b;
5325
- r ? b = r.deriveS(h2, x) : b = Ot(w2.id, x);
5326
- let A = { ...f2.adjustedSpec };
5327
- o && (A = {
5328
- ...A,
5321
+ ), m2 = [];
5322
+ for (const { value: f2, label: v } of p2) {
5323
+ const { originalColumn: b, spec: g } = f2, x = f2.type === "split" ? f2.axisFilters : void 0, A = Ot(x);
5324
+ let C;
5325
+ r ? C = r.deriveS(g, A) : C = Rt(b.id, A);
5326
+ let w2 = { ...f2.adjustedSpec };
5327
+ o && (w2 = {
5328
+ ...w2,
5329
5329
  annotations: {
5330
- ...A.annotations ?? {},
5331
- "pl7.app/label": m2
5330
+ ...w2.annotations ?? {},
5331
+ "pl7.app/label": v
5332
5332
  }
5333
- }), v.push({
5334
- id: b,
5335
- spec: A,
5336
- data: () => f2.type === "split" ? Jn(It(f2.dataEntries, x)) : f2.originalColumn.data,
5337
- label: m2
5333
+ }), m2.push({
5334
+ id: C,
5335
+ spec: w2,
5336
+ data: () => f2.type === "split" ? Jn(Lt(f2.dataEntries, A)) : f2.originalColumn.data,
5337
+ label: v
5338
5338
  });
5339
5339
  }
5340
- return v;
5340
+ return m2;
5341
5341
  }
5342
5342
  getColumns(e, n2) {
5343
5343
  const r = this.getUniversalEntries(e, {
@@ -5362,19 +5362,19 @@
5362
5362
  return i;
5363
5363
  }
5364
5364
  }
5365
- function de(t, e) {
5365
+ function pe(t, e) {
5366
5366
  if (t === void 0) return e === void 0;
5367
5367
  if (e === void 0) return true;
5368
5368
  for (const n2 in e)
5369
5369
  if (t[n2] !== e[n2]) return false;
5370
5370
  return true;
5371
5371
  }
5372
- function _e(t) {
5372
+ function Ee(t) {
5373
5373
  return Wn(t, (e) => e instanceof E ? e.handle : En(e) ? Nn(e, (n2) => n2.handle) : e);
5374
5374
  }
5375
- class Rt {
5375
+ class Kt {
5376
5376
  constructor() {
5377
- O(this, "ctx", y());
5377
+ k(this, "ctx", y());
5378
5378
  }
5379
5379
  /**
5380
5380
  * @deprecated use getOptions()
@@ -5385,7 +5385,7 @@
5385
5385
  getOptions(e, n2) {
5386
5386
  const r = typeof e == "function" ? e : Gn(e), i = this.getSpecs().entries.filter((a) => r(a.obj));
5387
5387
  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 }) => ({
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" ? $e(i, (a) => a.obj, s2 ?? {}).map(({ value: { ref: a }, label: l2 }) => ({
5389
5389
  ref: te$1(a, o),
5390
5390
  label: l2
5391
5391
  })) : i.map(({ ref: a, obj: l2 }) => ({
@@ -5571,10 +5571,10 @@
5571
5571
  if (!f(r.obj.spec))
5572
5572
  continue;
5573
5573
  const i = r.obj.spec;
5574
- if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && de(e.domain, i.domain)) {
5574
+ if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && pe(e.domain, i.domain)) {
5575
5575
  for (let s2 = 0; s2 < e.axesSpec.length; ++s2) {
5576
5576
  const o = e.axesSpec[s2], a = i.axesSpec[s2];
5577
- if (o.name !== a.name || o.type !== a.type || !de(o.domain, a.domain))
5577
+ if (o.name !== a.name || o.type !== a.type || !pe(o.domain, a.domain))
5578
5578
  continue e;
5579
5579
  }
5580
5580
  n2.push(r.obj);
@@ -5591,7 +5591,7 @@
5591
5591
  for (const r of n2.entries) {
5592
5592
  if (!rn(r.obj)) continue;
5593
5593
  const i = r.obj.spec;
5594
- 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)) {
5594
+ if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type && pe(e.domain, i.axesSpec[0].domain)) {
5595
5595
  if (r.obj.data.resourceType.name !== "PColumnData/Json")
5596
5596
  throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
5597
5597
  return Object.fromEntries(
@@ -5616,7 +5616,7 @@
5616
5616
  let a = null;
5617
5617
  const l2 = this;
5618
5618
  return {
5619
- id: ke(i),
5619
+ id: Re(i),
5620
5620
  spec: o,
5621
5621
  get data() {
5622
5622
  var u2;
@@ -5643,11 +5643,11 @@
5643
5643
  }
5644
5644
  class te {
5645
5645
  constructor() {
5646
- O(this, "ctx");
5647
- O(this, "args");
5648
- O(this, "uiState");
5649
- O(this, "_activeArgsCache");
5650
- O(this, "resultPool", new Rt());
5646
+ k(this, "ctx");
5647
+ k(this, "args");
5648
+ k(this, "uiState");
5649
+ k(this, "_activeArgsCache");
5650
+ k(this, "resultPool", new Kt());
5651
5651
  this.ctx = y(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
5652
5652
  }
5653
5653
  /**
@@ -5664,16 +5664,16 @@
5664
5664
  // return this.ctx.featureFlags;
5665
5665
  // }
5666
5666
  getNamedAccessor(e) {
5667
- return he(
5667
+ return ge(
5668
5668
  this.ctx.getAccessorHandleByName(e),
5669
5669
  (n2) => new E(n2, [e])
5670
5670
  );
5671
5671
  }
5672
5672
  get prerun() {
5673
- return this.getNamedAccessor(Re);
5673
+ return this.getNamedAccessor(Ve);
5674
5674
  }
5675
5675
  get outputs() {
5676
- return this.getNamedAccessor(Fe);
5676
+ return this.getNamedAccessor(je);
5677
5677
  }
5678
5678
  /**
5679
5679
  * Find labels data for a given axis id. It will search for a label column and return its data as a map.
@@ -5691,7 +5691,7 @@
5691
5691
  // TODO remove all non-PColumn fields
5692
5692
  createPFrame(e) {
5693
5693
  return this.verifyInlineAndExplicitColumnsSupport(e), this.ctx.createPFrame(
5694
- e.map((n2) => _e(n2))
5694
+ e.map((n2) => Ee(n2))
5695
5695
  );
5696
5696
  }
5697
5697
  createPTable(e) {
@@ -5704,7 +5704,7 @@
5704
5704
  filters: e.filters ?? [],
5705
5705
  sorting: e.sorting ?? []
5706
5706
  } : n2 = e, this.verifyInlineAndExplicitColumnsSupport(Xn(n2.src)), this.ctx.createPTable(
5707
- Un(n2, (r) => _e(r))
5707
+ Un(n2, (r) => Ee(r))
5708
5708
  );
5709
5709
  }
5710
5710
  /** @deprecated scheduled for removal from SDK */
@@ -5724,20 +5724,20 @@
5724
5724
  this.ctx.logError(e);
5725
5725
  }
5726
5726
  }
5727
- const Y = "1.34.10";
5728
- function Ft(t) {
5727
+ const Y = "1.37.0";
5728
+ function Vt(t) {
5729
5729
  return t.__renderLambda === true;
5730
5730
  }
5731
- function pe(t) {
5731
+ function fe(t) {
5732
5732
  if (t !== void 0)
5733
- return Ft(t) ? t.handle : t;
5733
+ return Vt(t) ? t.handle : t;
5734
5734
  }
5735
- class T {
5735
+ class L {
5736
5736
  constructor(e, n2, r, i, s2, o, a, l2) {
5737
5737
  this._renderingMode = e, this._initialArgs = n2, this._initialUiState = r, this._outputs = i, this._inputsValid = s2, this._sections = o, this._title = a, this._enrichmentTargets = l2;
5738
5738
  }
5739
5739
  static create(e = "Heavy") {
5740
- return new T(
5740
+ return new L(
5741
5741
  e,
5742
5742
  void 0,
5743
5743
  {},
@@ -5751,7 +5751,7 @@
5751
5751
  output(e, n2, r = {}) {
5752
5752
  if (typeof n2 == "function") {
5753
5753
  const i = `output#${e}`;
5754
- return H(i, () => n2(new te())), new T(
5754
+ return H(i, () => n2(new te())), new L(
5755
5755
  this._renderingMode,
5756
5756
  this._initialArgs,
5757
5757
  this._initialUiState,
@@ -5769,7 +5769,7 @@
5769
5769
  this._enrichmentTargets
5770
5770
  );
5771
5771
  } else
5772
- return new T(
5772
+ return new L(
5773
5773
  this._renderingMode,
5774
5774
  this._initialArgs,
5775
5775
  this._initialUiState,
@@ -5788,7 +5788,7 @@
5788
5788
  return this.output(e, n2, { retentive: true });
5789
5789
  }
5790
5790
  argsValid(e) {
5791
- return typeof e == "function" ? (H("inputsValid", () => e(new te())), new T(
5791
+ return typeof e == "function" ? (H("inputsValid", () => e(new te())), new L(
5792
5792
  this._renderingMode,
5793
5793
  this._initialArgs,
5794
5794
  this._initialUiState,
@@ -5800,7 +5800,7 @@
5800
5800
  this._sections,
5801
5801
  this._title,
5802
5802
  this._enrichmentTargets
5803
- )) : new T(
5803
+ )) : new L(
5804
5804
  this._renderingMode,
5805
5805
  this._initialArgs,
5806
5806
  this._initialUiState,
@@ -5812,7 +5812,7 @@
5812
5812
  );
5813
5813
  }
5814
5814
  sections(e) {
5815
- return Array.isArray(e) ? this.sections(re(e)) : typeof e == "function" ? (H("sections", () => e(new te())), new T(
5815
+ return Array.isArray(e) ? this.sections(re(e)) : typeof e == "function" ? (H("sections", () => e(new te())), new L(
5816
5816
  this._renderingMode,
5817
5817
  this._initialArgs,
5818
5818
  this._initialUiState,
@@ -5821,7 +5821,7 @@
5821
5821
  { __renderLambda: true, handle: "sections" },
5822
5822
  this._title,
5823
5823
  this._enrichmentTargets
5824
- )) : new T(
5824
+ )) : new L(
5825
5825
  this._renderingMode,
5826
5826
  this._initialArgs,
5827
5827
  this._initialUiState,
@@ -5834,7 +5834,7 @@
5834
5834
  }
5835
5835
  /** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
5836
5836
  title(e) {
5837
- return H("title", () => e(new te())), new T(
5837
+ return H("title", () => e(new te())), new L(
5838
5838
  this._renderingMode,
5839
5839
  this._initialArgs,
5840
5840
  this._initialUiState,
@@ -5850,7 +5850,7 @@
5850
5850
  * @deprecated use {@link withArgs}
5851
5851
  * */
5852
5852
  initialArgs(e) {
5853
- return new T(
5853
+ return new L(
5854
5854
  this._renderingMode,
5855
5855
  e,
5856
5856
  this._initialUiState,
@@ -5863,7 +5863,7 @@
5863
5863
  }
5864
5864
  /** Sets initial args for the block, this value must be specified. */
5865
5865
  withArgs(e) {
5866
- return new T(
5866
+ return new L(
5867
5867
  this._renderingMode,
5868
5868
  e,
5869
5869
  this._initialUiState,
@@ -5876,7 +5876,7 @@
5876
5876
  }
5877
5877
  /** Defines type and sets initial value for block UiState. */
5878
5878
  withUiState(e) {
5879
- return new T(
5879
+ return new L(
5880
5880
  this._renderingMode,
5881
5881
  this._initialArgs,
5882
5882
  e,
@@ -5892,7 +5892,7 @@
5892
5892
  * Influences dependency graph construction.
5893
5893
  */
5894
5894
  enriches(e) {
5895
- return H("enrichmentTargets", e), new T(
5895
+ return H("enrichmentTargets", e), new L(
5896
5896
  this._renderingMode,
5897
5897
  this._initialArgs,
5898
5898
  this._initialUiState,
@@ -5924,29 +5924,43 @@
5924
5924
  sdkVersion: Y,
5925
5925
  renderingMode: this._renderingMode,
5926
5926
  initialArgs: this._initialArgs,
5927
- inputsValid: pe(this._inputsValid),
5928
- sections: pe(this._sections),
5927
+ inputsValid: fe(this._inputsValid),
5928
+ sections: fe(this._sections),
5929
5929
  outputs: Object.fromEntries(
5930
- Object.entries(this._outputs).map(([n2, r]) => [n2, pe(r)])
5930
+ Object.entries(this._outputs).map(([n2, r]) => [n2, fe(r)])
5931
5931
  )
5932
5932
  };
5933
- return pt() ? De({ sdkVersion: Y }) : { config: e };
5933
+ return ht() ? Ke({ sdkVersion: Y }) : { config: e };
5934
5934
  }
5935
5935
  }
5936
- function ve(t) {
5936
+ function Ue() {
5937
+ return {
5938
+ version: 2,
5939
+ stateCache: [],
5940
+ pTableParams: {
5941
+ sorting: [],
5942
+ filters: [],
5943
+ hiddenColIds: null
5944
+ }
5945
+ };
5946
+ }
5947
+ function jt(t) {
5948
+ return "version" in t ? t : Ue();
5949
+ }
5950
+ function be(t) {
5937
5951
  return t.axesSpec.length === 1 && t.name === "pl7.app/label";
5938
5952
  }
5939
- function Ne(t) {
5953
+ function Be(t) {
5940
5954
  return new le().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
5941
5955
  name: "pl7.app/label",
5942
5956
  axes: [{}]
5943
5957
  // exactly one axis
5944
5958
  }, { dontWaitAllData: true });
5945
5959
  }
5946
- function Je(t, e) {
5960
+ function we(t, e) {
5947
5961
  const n2 = [], r = [];
5948
5962
  for (const a of t)
5949
- ve(a.spec) ? n2.push(a) : r.push(a);
5963
+ be(a.spec) ? n2.push(a) : r.push(a);
5950
5964
  const i = [];
5951
5965
  for (const a of r)
5952
5966
  for (const l2 of a.spec.axesSpec) {
@@ -5967,8 +5981,8 @@
5967
5981
  for (const a of e) {
5968
5982
  const l2 = a.spec.axesSpec[0], u2 = p$1(l2), c2 = i.findIndex((d) => Z$1(d, u2));
5969
5983
  if (c2 !== -1) {
5970
- const d = i[c2], g = Object.keys(d.domain ?? {}).length, p2 = Object.keys(l2.domain ?? {}).length;
5971
- g > p2 ? o.push({
5984
+ const d = i[c2], h2 = Object.keys(d.domain ?? {}).length, p2 = Object.keys(l2.domain ?? {}).length;
5985
+ h2 > p2 ? o.push({
5972
5986
  id: s2(a.id, d.domain),
5973
5987
  spec: {
5974
5988
  ...a.spec,
@@ -5980,7 +5994,7 @@
5980
5994
  }
5981
5995
  return o;
5982
5996
  }
5983
- function Me(t) {
5997
+ function We(t) {
5984
5998
  const e = (i) => Array.isArray(i), n2 = (i) => i instanceof E, r = (i) => typeof i == "object" && "type" in i;
5985
5999
  return t.map((i) => i.data).every((i) => {
5986
6000
  if (e(i))
@@ -6000,7 +6014,7 @@
6000
6014
  throw Error(`unsupported column data type: ${i}`);
6001
6015
  });
6002
6016
  }
6003
- function Ue(t, e, n2, r, i, s2) {
6017
+ function Ae(t, e, n2, r, i, s2) {
6004
6018
  let o = t;
6005
6019
  const a = [];
6006
6020
  if (s2) {
@@ -6021,57 +6035,58 @@
6021
6035
  sorting: i
6022
6036
  };
6023
6037
  }
6024
- function Dn(t, e, n2, r) {
6038
+ function Fn(t, e, n2, r) {
6025
6039
  var u2, c2;
6026
6040
  Array.isArray(r) && (r = { filters: r });
6027
- const i = (r == null ? void 0 : r.coreJoinType) ?? "full", s2 = [...(r == null ? void 0 : r.filters) ?? [], ...((u2 = n2 == null ? void 0 : n2.pTableParams) == null ? void 0 : u2.filters) ?? []], o = ((c2 = n2 == null ? void 0 : n2.pTableParams) == null ? void 0 : c2.sorting) ?? [], a = Ne(t.resultPool);
6041
+ const i = (r == null ? void 0 : r.coreJoinType) ?? "full", s2 = ue(
6042
+ [...(r == null ? void 0 : r.filters) ?? [], ...((u2 = n2 == null ? void 0 : n2.pTableParams) == null ? void 0 : u2.filters) ?? []],
6043
+ (d) => ue$1(d.column)
6044
+ ), o = ue(
6045
+ [...(r == null ? void 0 : r.sorting) ?? [], ...((c2 = n2 == null ? void 0 : n2.pTableParams) == null ? void 0 : c2.sorting) ?? []],
6046
+ (d) => ue$1(d.column)
6047
+ ), a = Be(t.resultPool);
6028
6048
  if (!a) return;
6029
- const l2 = Je(e.map(Fn), a);
6030
- if (Me([...e, ...l2]))
6049
+ const l2 = we(e.map(Fn$1), a);
6050
+ if (We([...e, ...l2]))
6031
6051
  return t.createPTable(
6032
- Ue(e, l2, i, s2, o, r == null ? void 0 : r.coreColumnPredicate)
6052
+ Ae(e, l2, i, s2, o, r == null ? void 0 : r.coreColumnPredicate)
6033
6053
  );
6034
6054
  }
6035
- function Kt(t) {
6055
+ function Nt(t) {
6036
6056
  var e;
6037
6057
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "hidden";
6038
6058
  }
6039
- function jt(t) {
6059
+ function $t(t) {
6040
6060
  var e;
6041
6061
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "optional";
6042
6062
  }
6043
- function Rn(t, e, n2, r, i) {
6044
- var m2, w2;
6045
- const s2 = (i == null ? void 0 : i.coreJoinType) ?? "full", o = [...(i == null ? void 0 : i.filters) ?? [], ...((m2 = r == null ? void 0 : r.pTableParams) == null ? void 0 : m2.filters) ?? []], a = ((w2 = r == null ? void 0 : r.pTableParams) == null ? void 0 : w2.sorting) ?? [], l2 = e.filter((h2) => !Kt(h2.spec)), u2 = l2.find((h2) => n2(h2.spec));
6063
+ function ue(t, e) {
6064
+ return [...new Map(t.map((n2) => [e(n2), n2])).values()];
6065
+ }
6066
+ function Kn(t, e, n2, r) {
6067
+ const i = jt(n2 ?? Ue()), s2 = (r == null ? void 0 : r.coreJoinType) ?? "full", o = ue(
6068
+ [...(r == null ? void 0 : r.filters) ?? [], ...i.pTableParams.filters],
6069
+ (g) => ue$1(g.column)
6070
+ ), a = ue(
6071
+ [...(r == null ? void 0 : r.sorting) ?? [], ...i.pTableParams.sorting],
6072
+ (g) => ue$1(g.column)
6073
+ ), l2 = e.filter((g) => !Nt(g.spec)), u2 = Be(t.resultPool);
6046
6074
  if (!u2) return;
6047
- const c2 = Ne(t.resultPool);
6048
- if (!c2) return;
6049
- const d = new Set((() => {
6050
- var I, x;
6075
+ const c2 = we(l2.map(Fn$1), u2), d = Ae(l2, c2, s2, o, a, r == null ? void 0 : r.coreColumnPredicate), h2 = t.createPTable(d), p2 = new Set((() => {
6051
6076
  if (s2 === "inner") return [];
6052
- const h2 = (x = (I = r == null ? void 0 : r.gridState.columnVisibility) == null ? void 0 : I.hiddenColIds) == null ? void 0 : x.map(ce$1).filter((b) => b.type === "column").map((b) => b.id);
6053
- return h2 || l2.filter((b) => jt(b.spec)).map((b) => b.id);
6077
+ const g = i.pTableParams.hiddenColIds;
6078
+ return g || l2.filter((x) => $t(x.spec)).map((x) => x.id);
6054
6079
  })());
6055
- d.delete(u2.id), [...o.map((h2) => h2.column), ...a.map((h2) => h2.column)].filter((h2) => h2.type === "column").map((h2) => d.delete(h2.id));
6056
- const g = l2.filter((h2) => !d.has(h2.id)), p2 = Je(g.map(Fn), c2), v = [
6057
- ...u2.spec.axesSpec.map((h2) => ({
6058
- type: "axis",
6059
- id: p$1(h2),
6060
- spec: h2
6061
- })),
6062
- ...[...l2, ...p2].map((h2) => ({
6063
- type: "column",
6064
- id: h2.id,
6065
- spec: h2.spec
6066
- }))
6067
- ];
6068
- if (!Me([...g, ...p2])) return;
6069
- const f2 = t.createPTable(
6070
- Ue(l2, p2, s2, o, a, i == null ? void 0 : i.coreColumnPredicate)
6071
- );
6080
+ r != null && r.coreColumnPredicate && l2.flatMap((x) => {
6081
+ var A;
6082
+ return (A = r == null ? void 0 : r.coreColumnPredicate) != null && A.call(r, x.spec) ? [x.id] : [];
6083
+ }).forEach((x) => p2.delete(x)), [...o.map((g) => g.column), ...a.map((g) => g.column)].filter((g) => g.type === "column").map((g) => p2.delete(g.id));
6084
+ const m2 = l2.filter((g) => !p2.has(g.id)), f2 = we(m2.map(Fn$1), u2);
6085
+ if (!We([...m2, ...f2])) return;
6086
+ const v = Ae(m2, f2, s2, o, a, r == null ? void 0 : r.coreColumnPredicate), b = t.createPTable(v);
6072
6087
  return {
6073
- tableSpec: v,
6074
- tableHandle: f2
6088
+ fullTableHandle: h2,
6089
+ visibleTableHandle: b
6075
6090
  };
6076
6091
  }
6077
6092
  const ImportFileHandleSchema = z$1.string().optional().refine(
@@ -6097,7 +6112,14 @@
6097
6112
  numbers: z$1.array(z$1.coerce.number()),
6098
6113
  handles: z$1.array(ImportFileHandleSchema)
6099
6114
  });
6100
- const platforma = T.create("Heavy").withArgs({ numbers: [1, 2, 3, 4], tableNumRows: 100, handles: [] }).withUiState({ dataTableState: void 0, dynamicSections: [] }).argsValid((ctx) => {
6115
+ const platforma = L.create("Heavy").withArgs({ numbers: [1, 2, 3, 4], tableNumRows: 100, handles: [] }).withUiState({
6116
+ dataTableState: void 0,
6117
+ dataTableStateV2: {
6118
+ tableState: Ue(),
6119
+ filterModel: {}
6120
+ },
6121
+ dynamicSections: []
6122
+ }).argsValid((ctx) => {
6101
6123
  if (ctx.args.numbers.length === 5) {
6102
6124
  throw new Error("argsValid: test error");
6103
6125
  }
@@ -6111,7 +6133,7 @@
6111
6133
  const progresses = m2 == null ? void 0 : m2.mapFields((name, val) => [name, val == null ? void 0 : val.getImportProgress()]);
6112
6134
  return Object.fromEntries(progresses ?? []);
6113
6135
  }).output("pt", (ctx) => {
6114
- var _a, _b, _c, _d, _e2;
6136
+ var _a, _b, _c, _d, _e;
6115
6137
  if (!((_c = (_b = (_a = ctx.uiState) == null ? void 0 : _a.dataTableState) == null ? void 0 : _b.tableState.pTableParams) == null ? void 0 : _c.filters)) return void 0;
6116
6138
  const data = times(ctx.args.tableNumRows ?? 0, (i) => {
6117
6139
  const v = i + 1;
@@ -6120,7 +6142,7 @@
6120
6142
  val: v.toString()
6121
6143
  };
6122
6144
  });
6123
- return Dn(
6145
+ return Fn(
6124
6146
  ctx,
6125
6147
  [
6126
6148
  {
@@ -6159,65 +6181,112 @@
6159
6181
  {
6160
6182
  filters: [
6161
6183
  ...((_d = ctx.uiState.dataTableState.tableState.pTableParams) == null ? void 0 : _d.filters) ?? [],
6162
- ...((_e2 = ctx.uiState.dataTableState.filterModel) == null ? void 0 : _e2.filters) ?? []
6184
+ ...((_e = ctx.uiState.dataTableState.filterModel) == null ? void 0 : _e.filters) ?? []
6163
6185
  ]
6164
6186
  }
6165
6187
  );
6188
+ }).output("ptV2Sheets", (ctx) => {
6189
+ const rowCount = ctx.args.tableNumRows ?? 0;
6190
+ const sheets = [
6191
+ {
6192
+ axis: {
6193
+ type: "Int",
6194
+ name: "part",
6195
+ annotations: {
6196
+ "pl7.app/label": "Partitioned axis",
6197
+ "pl7.app/discreteValues": "[0,1]"
6198
+ }
6199
+ },
6200
+ options: [
6201
+ { value: 0, label: "Partition 1" },
6202
+ { value: 1, label: "Partition 2" }
6203
+ ]
6204
+ }
6205
+ ];
6206
+ return rowCount > 0 ? sheets : [];
6166
6207
  }).output("ptV2", (ctx) => {
6167
- var _a, _b, _c, _d, _e2;
6168
- if (!((_c = (_b = (_a = ctx.uiState) == null ? void 0 : _a.dataTableState) == null ? void 0 : _b.tableState.pTableParams) == null ? void 0 : _c.filters)) return void 0;
6169
- const data = times(ctx.args.tableNumRows ?? 0, (i) => {
6170
- const v = i + 1;
6171
- return {
6172
- key: [v, v + 0.1],
6173
- val: v.toString()
6174
- };
6175
- });
6176
- return Rn(
6177
- ctx,
6178
- [
6179
- {
6180
- id: "example",
6181
- spec: {
6182
- kind: "PColumn",
6183
- valueType: "String",
6184
- name: "example",
6185
- annotations: {
6186
- "pl7.app/label": "String column",
6187
- "pl7.app/discreteValues": '["up","down"]'
6208
+ var _a;
6209
+ const rowCount = ctx.args.tableNumRows ?? 0;
6210
+ const makePartitionId = (rowCount2, i) => Math.floor(2 * i / (rowCount2 + 1));
6211
+ const columns = [
6212
+ {
6213
+ id: "column1",
6214
+ spec: {
6215
+ kind: "PColumn",
6216
+ valueType: "String",
6217
+ name: "example",
6218
+ annotations: {
6219
+ "pl7.app/label": "String column",
6220
+ "pl7.app/discreteValues": '["up","down"]'
6221
+ },
6222
+ axesSpec: [
6223
+ {
6224
+ type: "Int",
6225
+ name: "part",
6226
+ annotations: {
6227
+ "pl7.app/label": "Partitioned axis",
6228
+ "pl7.app/discreteValues": "[0,1]"
6229
+ }
6188
6230
  },
6189
- axesSpec: [
6190
- {
6191
- type: "Int",
6192
- name: "index",
6193
- annotations: {
6194
- "pl7.app/label": "Int axis",
6195
- "pl7.app/discreteValues": "[1,2]"
6196
- }
6197
- },
6198
- {
6199
- type: "Float",
6200
- name: "value",
6201
- annotations: {
6202
- "pl7.app/label": "Float axis",
6203
- "pl7.app/table/visibility": "optional"
6204
- }
6231
+ {
6232
+ type: "Int",
6233
+ name: "index",
6234
+ annotations: {
6235
+ "pl7.app/label": "Int axis"
6205
6236
  }
6206
- ]
6207
- },
6208
- data
6209
- }
6210
- ],
6211
- Gn({
6212
- name: "example"
6213
- }),
6214
- ctx.uiState.dataTableState.tableState,
6237
+ }
6238
+ ]
6239
+ },
6240
+ data: times(rowCount, (i) => {
6241
+ const v = i + 1;
6242
+ return {
6243
+ key: [makePartitionId(rowCount, v), v],
6244
+ val: v.toString()
6245
+ };
6246
+ })
6247
+ },
6215
6248
  {
6216
- filters: [
6217
- ...((_d = ctx.uiState.dataTableState.tableState.pTableParams) == null ? void 0 : _d.filters) ?? [],
6218
- ...((_e2 = ctx.uiState.dataTableState.filterModel) == null ? void 0 : _e2.filters) ?? []
6219
- ]
6249
+ id: "column2",
6250
+ spec: {
6251
+ kind: "PColumn",
6252
+ valueType: "Float",
6253
+ name: "value",
6254
+ annotations: {
6255
+ "pl7.app/label": "Float column",
6256
+ "pl7.app/table/visibility": "optional"
6257
+ },
6258
+ axesSpec: [
6259
+ {
6260
+ type: "Int",
6261
+ name: "part",
6262
+ annotations: {
6263
+ "pl7.app/label": "Partitioned axis",
6264
+ "pl7.app/discreteValues": "[0,1]"
6265
+ }
6266
+ },
6267
+ {
6268
+ type: "Int",
6269
+ name: "index",
6270
+ annotations: {
6271
+ "pl7.app/label": "Int axis"
6272
+ }
6273
+ }
6274
+ ]
6275
+ },
6276
+ data: times(rowCount, (i) => {
6277
+ const v = i + 1;
6278
+ return {
6279
+ key: [makePartitionId(rowCount, v), v],
6280
+ val: v + 0.1
6281
+ };
6282
+ })
6220
6283
  }
6284
+ ];
6285
+ return Kn(
6286
+ ctx,
6287
+ columns,
6288
+ ctx.uiState.dataTableStateV2.tableState,
6289
+ { filters: ((_a = ctx.uiState.dataTableStateV2.filterModel) == null ? void 0 : _a.filters) ?? [] }
6221
6290
  );
6222
6291
  }).title((ctx) => {
6223
6292
  if (ctx.args.numbers.length === 5) {
@@ -6251,6 +6320,7 @@
6251
6320
  { type: "link", href: "/pl-splash-page", label: "PlSplashPage" },
6252
6321
  { type: "link", href: "/pl-file-input-page", label: "PlFileInputPage" },
6253
6322
  { type: "link", href: "/pl-error-boundary-page", label: "PlErrorBoundaryPage" },
6323
+ { type: "link", href: "/pl-element-list-page", label: "PlElementList" },
6254
6324
  { type: "link", href: "/errors", label: "Errors" },
6255
6325
  { type: "link", href: "/text-fields", label: "PlTextField" },
6256
6326
  { type: "link", href: "/tabs", label: "PlTabs" },