@milaboratories/milaboratories.ui-examples.model 1.1.8 → 1.1.9

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
@@ -20,10 +20,10 @@
20
20
  return obj;
21
21
  };
22
22
  util2.getValidEnumValues = (obj) => {
23
- const validKeys = util2.objectKeys(obj).filter((k2) => typeof obj[obj[k2]] !== "number");
23
+ const validKeys = util2.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
24
24
  const filtered = {};
25
- for (const k2 of validKeys) {
26
- filtered[k2] = obj[k2];
25
+ for (const k of validKeys) {
26
+ filtered[k] = obj[k];
27
27
  }
28
28
  return util2.objectValues(filtered);
29
29
  };
@@ -391,7 +391,7 @@
391
391
  overrideMap,
392
392
  overrideMap === errorMap ? void 0 : errorMap
393
393
  // then global default map
394
- ].filter((x) => !!x)
394
+ ].filter((x2) => !!x2)
395
395
  });
396
396
  ctx.common.issues.push(issue);
397
397
  }
@@ -454,10 +454,10 @@
454
454
  });
455
455
  const DIRTY = (value) => ({ status: "dirty", value });
456
456
  const OK = (value) => ({ status: "valid", value });
457
- const isAborted = (x) => x.status === "aborted";
458
- const isDirty = (x) => x.status === "dirty";
459
- const isValid = (x) => x.status === "valid";
460
- const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
457
+ const isAborted = (x2) => x2.status === "aborted";
458
+ const isDirty = (x2) => x2.status === "dirty";
459
+ const isValid = (x2) => x2.status === "valid";
460
+ const isAsync = (x2) => typeof Promise !== "undefined" && x2 instanceof Promise;
461
461
  function __classPrivateFieldGet(receiver, state, kind, f2) {
462
462
  if (typeof state === "function" ? receiver !== state || !f2 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
463
463
  return state.get(receiver);
@@ -2787,7 +2787,7 @@
2787
2787
  if (!schema)
2788
2788
  return null;
2789
2789
  return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
2790
- }).filter((x) => !!x);
2790
+ }).filter((x2) => !!x2);
2791
2791
  if (ctx.common.async) {
2792
2792
  return Promise.all(items).then((results) => {
2793
2793
  return ParseStatus.mergeArray(status, results);
@@ -3045,7 +3045,7 @@
3045
3045
  ctx.schemaErrorMap,
3046
3046
  getErrorMap(),
3047
3047
  errorMap
3048
- ].filter((x) => !!x),
3048
+ ].filter((x2) => !!x2),
3049
3049
  issueData: {
3050
3050
  code: ZodIssueCode.invalid_arguments,
3051
3051
  argumentsError: error
@@ -3061,7 +3061,7 @@
3061
3061
  ctx.schemaErrorMap,
3062
3062
  getErrorMap(),
3063
3063
  errorMap
3064
- ].filter((x) => !!x),
3064
+ ].filter((x2) => !!x2),
3065
3065
  issueData: {
3066
3066
  code: ZodIssueCode.invalid_return_type,
3067
3067
  returnTypeError: error
@@ -3071,29 +3071,29 @@
3071
3071
  const params = { errorMap: ctx.common.contextualErrorMap };
3072
3072
  const fn = 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(fn, 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(fn, 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
  }
@@ -3917,7 +3917,7 @@
3917
3917
  function b$1(t) {
3918
3918
  throw new Error("Unexpected object: " + t);
3919
3919
  }
3920
- function J$1(t) {
3920
+ function J(t) {
3921
3921
  const { type: n, name: e, domain: r } = t;
3922
3922
  return { type: n, name: e, ...r && { domain: r } };
3923
3923
  }
@@ -3928,10 +3928,10 @@
3928
3928
  if (t[e] !== n[e]) return false;
3929
3929
  return true;
3930
3930
  }
3931
- function ot$1(t, n) {
3931
+ function ot(t, n) {
3932
3932
  return t.name === n.name && _$1(t.domain, n.domain);
3933
3933
  }
3934
- function it$1(t, n) {
3934
+ function it(t, n) {
3935
3935
  return { ...t, src: f(t.src, n) };
3936
3936
  }
3937
3937
  function f(t, n) {
@@ -3970,7 +3970,7 @@
3970
3970
  function W(t) {
3971
3971
  return i(t.spec);
3972
3972
  }
3973
- function dt$1(t) {
3973
+ function dt(t) {
3974
3974
  if (!W(t)) throw new Error(`not a PColumn (kind = ${t.spec.kind})`);
3975
3975
  return t;
3976
3976
  }
@@ -3980,7 +3980,7 @@
3980
3980
  data: n(t.data)
3981
3981
  };
3982
3982
  }
3983
- function pt$1(t) {
3983
+ function pt(t) {
3984
3984
  const n = /* @__PURE__ */ new Map(), e = (r) => {
3985
3985
  switch (r.type) {
3986
3986
  case "column":
@@ -4000,205 +4000,205 @@
4000
4000
  };
4001
4001
  return e(t), [...n.values()];
4002
4002
  }
4003
- function mt(t, n) {
4003
+ function mt$1(t, n) {
4004
4004
  return t.ok ? { ok: true, value: n(t.value) } : t;
4005
4005
  }
4006
4006
  const Q = 24;
4007
4007
  z.string().length(Q).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
4008
- var dt = Object.defineProperty;
4009
- var pt = (e, t, n) => t in e ? dt(e, t, { enumerable: true, configurable: true, writable: true, value: n }) : e[t] = n;
4010
- var S = (e, t, n) => pt(e, typeof t != "symbol" ? t + "" : t, n);
4011
- function L(e) {
4012
- return { type: "Immediate", value: e };
4008
+ var de = Object.defineProperty;
4009
+ var pe = (t, e, n) => e in t ? de(t, e, { enumerable: true, configurable: true, writable: true, value: n }) : t[e] = n;
4010
+ var S = (t, e, n) => pe(t, typeof e != "symbol" ? e + "" : e, n);
4011
+ function E(t) {
4012
+ return { type: "Immediate", value: t };
4013
4013
  }
4014
- function _t() {
4014
+ function _e() {
4015
4015
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
4016
4016
  }
4017
- function it(e) {
4018
- if (e && typeof globalThis.getPlatforma == "function")
4019
- return globalThis.getPlatforma(e);
4017
+ function ie(t) {
4018
+ if (t && typeof globalThis.getPlatforma == "function")
4019
+ return globalThis.getPlatforma(t);
4020
4020
  if (typeof globalThis.platforma < "u") return globalThis.platforma;
4021
4021
  throw new Error("Can't get platforma instance.");
4022
4022
  }
4023
- function wt() {
4023
+ function we() {
4024
4024
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
4025
4025
  }
4026
- function u() {
4026
+ function l() {
4027
4027
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
4028
4028
  throw new Error("Not in config rendering context");
4029
4029
  }
4030
- function k(e, t) {
4031
- const n = wt();
4030
+ function L(t, e) {
4031
+ const n = we();
4032
4032
  if (n === void 0) return false;
4033
- if (e in n.callbackRegistry) throw new Error(`Callback with key ${e} already registered.`);
4034
- return n.callbackRegistry[e] = t, true;
4033
+ if (t in n.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
4034
+ return n.callbackRegistry[t] = e, true;
4035
4035
  }
4036
- const B = /* @__PURE__ */ new Map();
4037
- function St(e, t) {
4038
- e in u().callbackRegistry || (u().callbackRegistry[e] = (n) => {
4039
- for (const s of B.get(e))
4040
- s(n);
4041
- }, B.set(e, [])), B.get(e).push(t);
4036
+ const M = /* @__PURE__ */ new Map();
4037
+ function Se(t, e) {
4038
+ t in l().callbackRegistry || (l().callbackRegistry[t] = (n) => {
4039
+ for (const r of M.get(t))
4040
+ r(n);
4041
+ }, M.set(t, [])), M.get(t).push(e);
4042
4042
  }
4043
4043
  class v {
4044
- constructor(t, n = (s) => s) {
4044
+ constructor(e, n = (r) => r) {
4045
4045
  S(this, "isResolved", false);
4046
4046
  S(this, "resolvedValue");
4047
- this.handle = t, this.postProcess = n, St(t, (s) => {
4048
- this.resolvedValue = n(s), this.isResolved = true;
4047
+ this.handle = e, this.postProcess = n, Se(e, (r) => {
4048
+ this.resolvedValue = n(r), this.isResolved = true;
4049
4049
  });
4050
4050
  }
4051
- map(t) {
4052
- return new v(this.handle, (n) => t(this.postProcess(n)));
4051
+ map(e) {
4052
+ return new v(this.handle, (n) => e(this.postProcess(n)));
4053
4053
  }
4054
- mapDefined(t) {
4054
+ mapDefined(e) {
4055
4055
  return new v(this.handle, (n) => {
4056
- const s = this.postProcess(n);
4057
- return s ? t(s) : void 0;
4056
+ const r = this.postProcess(n);
4057
+ return r ? e(r) : void 0;
4058
4058
  });
4059
4059
  }
4060
4060
  toJSON() {
4061
4061
  return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
4062
4062
  }
4063
4063
  }
4064
- function J(e, t) {
4065
- return e === void 0 ? void 0 : t(e);
4064
+ function K(t, e) {
4065
+ return t === void 0 ? void 0 : e(t);
4066
4066
  }
4067
4067
  class _ {
4068
- constructor(t, n) {
4069
- this.handle = t, this.resolvePath = n;
4068
+ constructor(e, n) {
4069
+ this.handle = e, this.resolvePath = n;
4070
4070
  }
4071
- resolve(...t) {
4072
- const n = t.map(
4073
- (s) => ({
4071
+ resolve(...e) {
4072
+ const n = e.map(
4073
+ (r) => ({
4074
4074
  assertFieldType: "Input",
4075
- ...typeof s == "string" ? { field: s } : s
4075
+ ...typeof r == "string" ? { field: r } : r
4076
4076
  })
4077
4077
  );
4078
4078
  return this.resolveWithCommon({}, ...n);
4079
4079
  }
4080
- resolveOutput(...t) {
4081
- const n = t.map(
4082
- (s) => ({
4080
+ resolveOutput(...e) {
4081
+ const n = e.map(
4082
+ (r) => ({
4083
4083
  assertFieldType: "Output",
4084
- ...typeof s == "string" ? { field: s } : s
4084
+ ...typeof r == "string" ? { field: r } : r
4085
4085
  })
4086
4086
  );
4087
4087
  return this.resolveWithCommon({}, ...n);
4088
4088
  }
4089
- resolveInput(...t) {
4090
- const n = t.map(
4091
- (s) => ({
4089
+ resolveInput(...e) {
4090
+ const n = e.map(
4091
+ (r) => ({
4092
4092
  assertFieldType: "Input",
4093
- ...typeof s == "string" ? { field: s } : s
4093
+ ...typeof r == "string" ? { field: r } : r
4094
4094
  })
4095
4095
  );
4096
4096
  return this.resolveWithCommon({}, ...n);
4097
4097
  }
4098
- resolveAny(...t) {
4099
- return this.resolveWithCommon({}, ...t);
4098
+ resolveAny(...e) {
4099
+ return this.resolveWithCommon({}, ...e);
4100
4100
  }
4101
- resolveWithCommon(t, ...n) {
4102
- const s = [
4101
+ resolveWithCommon(e, ...n) {
4102
+ const r = [
4103
4103
  ...this.resolvePath,
4104
4104
  ...n.map((i2) => typeof i2 == "string" ? i2 : i2.field)
4105
4105
  ];
4106
- return J(
4107
- u().resolveWithCommon(this.handle, t, ...n),
4108
- (i2) => new _(i2, s)
4106
+ return K(
4107
+ l().resolveWithCommon(this.handle, e, ...n),
4108
+ (i2) => new _(i2, r)
4109
4109
  );
4110
4110
  }
4111
4111
  get resourceType() {
4112
- return u().getResourceType(this.handle);
4112
+ return l().getResourceType(this.handle);
4113
4113
  }
4114
4114
  getInputsLocked() {
4115
- return u().getInputsLocked(this.handle);
4115
+ return l().getInputsLocked(this.handle);
4116
4116
  }
4117
4117
  getOutputsLocked() {
4118
- return u().getOutputsLocked(this.handle);
4118
+ return l().getOutputsLocked(this.handle);
4119
4119
  }
4120
4120
  getIsReadyOrError() {
4121
- return u().getIsReadyOrError(this.handle);
4121
+ return l().getIsReadyOrError(this.handle);
4122
4122
  }
4123
4123
  getIsFinal() {
4124
- return u().getIsFinal(this.handle);
4124
+ return l().getIsFinal(this.handle);
4125
4125
  }
4126
4126
  getError() {
4127
- const t = [...this.resolvePath, "error"];
4128
- return J(
4129
- u().getError(this.handle),
4130
- (n) => new _(n, t)
4127
+ const e = [...this.resolvePath, "error"];
4128
+ return K(
4129
+ l().getError(this.handle),
4130
+ (n) => new _(n, e)
4131
4131
  );
4132
4132
  }
4133
4133
  listInputFields() {
4134
- return u().listInputFields(this.handle);
4134
+ return l().listInputFields(this.handle);
4135
4135
  }
4136
4136
  listOutputFields() {
4137
- return u().listOutputFields(this.handle);
4137
+ return l().listOutputFields(this.handle);
4138
4138
  }
4139
4139
  listDynamicFields() {
4140
- return u().listDynamicFields(this.handle);
4140
+ return l().listDynamicFields(this.handle);
4141
4141
  }
4142
- getKeyValueBase64(t) {
4143
- return u().getKeyValueBase64(this.handle, t);
4142
+ getKeyValueBase64(e) {
4143
+ return l().getKeyValueBase64(this.handle, e);
4144
4144
  }
4145
- getKeyValueAsString(t) {
4146
- return u().getKeyValueAsString(this.handle, t);
4145
+ getKeyValueAsString(e) {
4146
+ return l().getKeyValueAsString(this.handle, e);
4147
4147
  }
4148
- getKeyValueAsJson(t) {
4149
- const n = this.getKeyValueAsString(t);
4148
+ getKeyValueAsJson(e) {
4149
+ const n = this.getKeyValueAsString(e);
4150
4150
  if (n == null) throw new Error("Resource has no content.");
4151
4151
  return JSON.parse(n);
4152
4152
  }
4153
4153
  getDataBase64() {
4154
- return u().getDataBase64(this.handle);
4154
+ return l().getDataBase64(this.handle);
4155
4155
  }
4156
4156
  getDataAsString() {
4157
- return u().getDataAsString(this.handle);
4157
+ return l().getDataAsString(this.handle);
4158
4158
  }
4159
4159
  getDataAsJson() {
4160
- const t = this.getDataAsString();
4161
- if (t == null) throw new Error("Resource has no content.");
4162
- return JSON.parse(t);
4160
+ const e = this.getDataAsString();
4161
+ if (e == null) throw new Error("Resource has no content.");
4162
+ return JSON.parse(e);
4163
4163
  }
4164
4164
  /**
4165
4165
  *
4166
4166
  */
4167
- getPColumns(t = false, n = "") {
4168
- const s = this.parsePObjectCollection(t, n);
4169
- return s === void 0 ? void 0 : Object.entries(s).map(([, r]) => {
4170
- if (!W(r)) throw new Error(`not a PColumn (kind = ${r.spec.kind})`);
4171
- return r;
4167
+ getPColumns(e = false, n = "") {
4168
+ const r = this.parsePObjectCollection(e, n);
4169
+ return r === void 0 ? void 0 : Object.entries(r).map(([, s]) => {
4170
+ if (!W(s)) throw new Error(`not a PColumn (kind = ${s.spec.kind})`);
4171
+ return s;
4172
4172
  });
4173
4173
  }
4174
4174
  /**
4175
4175
  *
4176
4176
  */
4177
- parsePObjectCollection(t = false, n = "") {
4178
- const s = u().parsePObjectCollection(
4177
+ parsePObjectCollection(e = false, n = "") {
4178
+ const r = l().parsePObjectCollection(
4179
4179
  this.handle,
4180
- t,
4180
+ e,
4181
4181
  n,
4182
4182
  ...this.resolvePath
4183
4183
  );
4184
- if (s === void 0) return;
4184
+ if (r === void 0) return;
4185
4185
  const i2 = {};
4186
- for (const [r, o] of Object.entries(s)) {
4187
- const l = [...this.resolvePath, r];
4188
- i2[r] = lt(o, (d) => new _(d, l));
4186
+ for (const [s, o] of Object.entries(r)) {
4187
+ const a = [...this.resolvePath, s];
4188
+ i2[s] = lt(o, (c) => new _(c, a));
4189
4189
  }
4190
4190
  return i2;
4191
4191
  }
4192
4192
  getFileContentAsBase64() {
4193
- return new v(u().getBlobContentAsBase64(this.handle));
4193
+ return new v(l().getBlobContentAsBase64(this.handle));
4194
4194
  }
4195
4195
  getFileContentAsString() {
4196
- return new v(u().getBlobContentAsString(this.handle));
4196
+ return new v(l().getBlobContentAsString(this.handle));
4197
4197
  }
4198
4198
  getFileContentAsJson() {
4199
4199
  return new v(
4200
- u().getBlobContentAsString(this.handle)
4201
- ).mapDefined((t) => JSON.parse(t));
4200
+ l().getBlobContentAsString(this.handle)
4201
+ ).mapDefined((e) => JSON.parse(e));
4202
4202
  }
4203
4203
  /**
4204
4204
  * @deprecated use getFileContentAsBase64
@@ -4216,7 +4216,7 @@
4216
4216
  * @returns downloaded file handle
4217
4217
  */
4218
4218
  getFileHandle() {
4219
- return new v(u().getDownloadedBlobContentHandle(this.handle));
4219
+ return new v(l().getDownloadedBlobContentHandle(this.handle));
4220
4220
  }
4221
4221
  /**
4222
4222
  * @deprecated use getFileHandle
@@ -4228,7 +4228,7 @@
4228
4228
  * @returns downloaded file handle
4229
4229
  */
4230
4230
  getRemoteFileHandle() {
4231
- return new v(u().getOnDemandBlobContentHandle(this.handle));
4231
+ return new v(l().getOnDemandBlobContentHandle(this.handle));
4232
4232
  }
4233
4233
  /**
4234
4234
  * @deprecated use getRemoteFileHandle
@@ -4237,19 +4237,19 @@
4237
4237
  return this.getRemoteFileHandle();
4238
4238
  }
4239
4239
  getImportProgress() {
4240
- return new v(u().getImportProgress(this.handle));
4240
+ return new v(l().getImportProgress(this.handle));
4241
4241
  }
4242
- getLastLogs(t) {
4243
- return new v(u().getLastLogs(this.handle, t));
4242
+ getLastLogs(e) {
4243
+ return new v(l().getLastLogs(this.handle, e));
4244
4244
  }
4245
- getProgressLog(t) {
4246
- return new v(u().getProgressLog(this.handle, t));
4245
+ getProgressLog(e) {
4246
+ return new v(l().getProgressLog(this.handle, e));
4247
4247
  }
4248
4248
  getLogHandle() {
4249
- return new v(u().getLogHandle(this.handle));
4249
+ return new v(l().getLogHandle(this.handle));
4250
4250
  }
4251
- allFieldsResolved(t = "Input") {
4252
- switch (t) {
4251
+ allFieldsResolved(e = "Input") {
4252
+ switch (e) {
4253
4253
  case "Input":
4254
4254
  return this.getInputsLocked() && this.listInputFields().every(
4255
4255
  (n) => this.resolve({ field: n, assertFieldType: "Input" }) !== void 0
@@ -4260,102 +4260,102 @@
4260
4260
  );
4261
4261
  }
4262
4262
  }
4263
- mapFields(t, n) {
4264
- const { fieldType: s, requireLocked: i2, skipUnresolved: r } = {
4263
+ mapFields(e, n) {
4264
+ const { fieldType: r, requireLocked: i2, skipUnresolved: s } = {
4265
4265
  fieldType: "Input",
4266
4266
  requireLocked: true,
4267
4267
  skipUnresolved: false,
4268
4268
  ...n
4269
- }, o = t;
4270
- if (i2 && (s === "Input" && !this.getInputsLocked() || s === "Output" && !this.getOutputsLocked()))
4269
+ }, o = e;
4270
+ if (i2 && (r === "Input" && !this.getInputsLocked() || r === "Output" && !this.getOutputsLocked()))
4271
4271
  return;
4272
- let d = (s === "Input" ? this.listInputFields() : s === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
4273
- (a) => [a, this.resolve({ field: a, assertFieldType: s })]
4272
+ let c = (r === "Input" ? this.listInputFields() : r === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
4273
+ (u) => [u, this.resolve({ field: u, assertFieldType: r })]
4274
4274
  );
4275
- return r && (d = d.filter((a) => a[1] !== void 0)), d.map(([a, p]) => o(a, p));
4275
+ return s && (c = c.filter((u) => u[1] !== void 0)), c.map(([u, g]) => o(u, g));
4276
4276
  }
4277
4277
  }
4278
- const rt = "staging", ot = "main";
4279
- const At = "pl7.app/label", It = "pl7.app/trace", Rt = z.object({
4278
+ const se = "staging", oe = "main";
4279
+ const Ae = "pl7.app/label", Ie = "pl7.app/trace", Re = z.object({
4280
4280
  type: z.string(),
4281
4281
  importance: z.number().optional(),
4282
4282
  id: z.string().optional(),
4283
4283
  label: z.string()
4284
- }), Ft = z.array(Rt), Tt = 1e-3, Ot = "__LABEL__", Z = "__LABEL__@1";
4285
- function kt(e, t, n = {}) {
4286
- const s = /* @__PURE__ */ new Map(), i2 = /* @__PURE__ */ new Map(), r = e.map((c) => {
4287
- var z2, Y;
4288
- const m = t(c), h = (z2 = m.annotations) == null ? void 0 : z2[At], P = (Y = m.annotations) == null ? void 0 : Y[It], y = (P ? Ft.safeParse(JSON.parse(P)).data : void 0) ?? [];
4289
- if (h) {
4290
- const w = { label: h, type: Ot, importance: -2 };
4284
+ }), Fe = z.array(Re), Te = 1e-3, Oe = "__LABEL__", Z = "__LABEL__@1";
4285
+ function ke(t, e, n = {}) {
4286
+ const r = /* @__PURE__ */ new Map(), i2 = /* @__PURE__ */ new Map(), s = t.map((p) => {
4287
+ var R, Y;
4288
+ const h = e(p), f2 = (R = h.annotations) == null ? void 0 : R[Ae], C = (Y = h.annotations) == null ? void 0 : Y[Ie], y = (C ? Fe.safeParse(JSON.parse(C)).data : void 0) ?? [];
4289
+ if (f2) {
4290
+ const w = { label: f2, type: Oe, importance: -2 };
4291
4291
  n.addLabelAsSuffix ? y.push(w) : y.splice(0, 0, w);
4292
4292
  }
4293
- const C = [], q = /* @__PURE__ */ new Map();
4293
+ const I = [], D = /* @__PURE__ */ new Map();
4294
4294
  for (let w = y.length - 1; w >= 0; --w) {
4295
- const { type: V } = y[w], ct = y[w].importance ?? 0, j = (q.get(V) ?? 0) + 1;
4296
- q.set(V, j);
4297
- const R = `${V}@${j}`;
4298
- i2.set(R, (i2.get(R) ?? 0) + 1), s.set(
4299
- R,
4295
+ const { type: B } = y[w], ce = y[w].importance ?? 0, N = (D.get(B) ?? 0) + 1;
4296
+ D.set(B, N);
4297
+ const F = `${B}@${N}`;
4298
+ i2.set(F, (i2.get(F) ?? 0) + 1), r.set(
4299
+ F,
4300
4300
  Math.max(
4301
- s.get(R) ?? Number.NEGATIVE_INFINITY,
4302
- ct - (y.length - w) * Tt
4301
+ r.get(F) ?? Number.NEGATIVE_INFINITY,
4302
+ ce - (y.length - w) * Te
4303
4303
  )
4304
- ), C.push({ ...y[w], fullType: R, occurenceIndex: j });
4304
+ ), I.push({ ...y[w], fullType: F, occurenceIndex: N });
4305
4305
  }
4306
- return C.reverse(), {
4307
- value: c,
4308
- spec: m,
4309
- label: h,
4310
- fullTrace: C
4306
+ return I.reverse(), {
4307
+ value: p,
4308
+ spec: h,
4309
+ label: f2,
4310
+ fullTrace: I
4311
4311
  };
4312
- }), o = [], l = [], d = [...s];
4313
- d.sort(([, c], [, m]) => m - c);
4314
- for (const [c] of d)
4315
- c.endsWith("@1") || i2.get(c) === e.length ? o.push(c) : l.push(c);
4316
- const a = (c) => r.map((m) => {
4317
- const h = m.fullTrace.filter((y) => c.has(y.fullType)).map((y) => y.label), P = n.separator ?? " / ";
4312
+ }), o = [], a = [], c = [...r];
4313
+ c.sort(([, p], [, h]) => h - p);
4314
+ for (const [p] of c)
4315
+ p.endsWith("@1") || i2.get(p) === t.length ? o.push(p) : a.push(p);
4316
+ const u = (p) => s.map((h) => {
4317
+ const f2 = h.fullTrace.filter((y) => p.has(y.fullType)).map((y) => y.label), C = n.separator ?? " / ";
4318
4318
  return {
4319
- label: h.join(P),
4320
- value: m.value
4319
+ label: f2.join(C),
4320
+ value: h.value
4321
4321
  };
4322
4322
  });
4323
4323
  if (o.length === 0) {
4324
- if (l.length !== 0) throw new Error("Assertion error.");
4325
- return a(new Set(Z));
4326
- }
4327
- let p = 0, g = 0;
4328
- for (; p < o.length; ) {
4329
- const c = /* @__PURE__ */ new Set();
4330
- n.includeNativeLabel && c.add(Z);
4331
- for (let h = 0; h < p; ++h) c.add(o[h]);
4332
- c.add(o[g]);
4333
- const m = a(c);
4334
- if (new Set(m.map((h) => h.label)).size === e.length) return m;
4335
- g++, g == o.length && (p++, g = p);
4336
- }
4337
- return a(/* @__PURE__ */ new Set([...o, ...l]));
4324
+ if (a.length !== 0) throw new Error("Assertion error.");
4325
+ return u(new Set(Z));
4326
+ }
4327
+ let g = 0, d = 0;
4328
+ for (; g < o.length; ) {
4329
+ const p = /* @__PURE__ */ new Set();
4330
+ n.includeNativeLabel && p.add(Z);
4331
+ for (let f2 = 0; f2 < g; ++f2) p.add(o[f2]);
4332
+ p.add(o[d]);
4333
+ const h = u(p);
4334
+ if (new Set(h.map((f2) => f2.label)).size === t.length) return h;
4335
+ d++, d == o.length && (g++, d = g);
4336
+ }
4337
+ return u(/* @__PURE__ */ new Set([...o, ...a]));
4338
4338
  }
4339
- class Dt {
4339
+ class De {
4340
4340
  constructor() {
4341
- S(this, "ctx", u());
4342
- S(this, "defaultLabelFn", (t, n) => {
4343
- var s;
4344
- return ((s = t.annotations) == null ? void 0 : s["pl7.app/label"]) ?? "Unlabelled";
4341
+ S(this, "ctx", l());
4342
+ S(this, "defaultLabelFn", (e, n) => {
4343
+ var r;
4344
+ return ((r = e.annotations) == null ? void 0 : r["pl7.app/label"]) ?? "Unlabelled";
4345
4345
  });
4346
4346
  }
4347
4347
  /**
4348
4348
  * @deprecated use getOptions()
4349
4349
  */
4350
- calculateOptions(t) {
4351
- return this.ctx.calculateOptions(t);
4350
+ calculateOptions(e) {
4351
+ return this.ctx.calculateOptions(e);
4352
4352
  }
4353
- getOptions(t, n) {
4354
- const s = this.getSpecs().entries.filter((i2) => t(i2.obj));
4355
- return typeof n == "object" || typeof n > "u" ? kt(s, (i2) => i2.obj, n ?? {}).map(({ value: { ref: i2 }, label: r }) => ({
4353
+ getOptions(e, n) {
4354
+ const r = this.getSpecs().entries.filter((i2) => e(i2.obj));
4355
+ return typeof n == "object" || typeof n > "u" ? ke(r, (i2) => i2.obj, n ?? {}).map(({ value: { ref: i2 }, label: s }) => ({
4356
4356
  ref: i2,
4357
- label: r
4358
- })) : s.map((i2) => ({
4357
+ label: s
4358
+ })) : r.map((i2) => ({
4359
4359
  ref: i2.ref,
4360
4360
  label: n(i2.obj, i2.ref)
4361
4361
  }));
@@ -4367,10 +4367,10 @@
4367
4367
  return this.getData();
4368
4368
  }
4369
4369
  getData() {
4370
- const t = this.ctx.getDataFromResultPool();
4370
+ const e = this.ctx.getDataFromResultPool();
4371
4371
  return {
4372
- isComplete: t.isComplete,
4373
- entries: t.entries.map((n) => ({
4372
+ isComplete: e.isComplete,
4373
+ entries: e.entries.map((n) => ({
4374
4374
  ref: n.ref,
4375
4375
  obj: {
4376
4376
  ...n.obj,
@@ -4386,16 +4386,16 @@
4386
4386
  return this.getDataWithErrors();
4387
4387
  }
4388
4388
  getDataWithErrors() {
4389
- const t = this.ctx.getDataWithErrorsFromResultPool();
4389
+ const e = this.ctx.getDataWithErrorsFromResultPool();
4390
4390
  return {
4391
- isComplete: t.isComplete,
4392
- entries: t.entries.map((n) => ({
4391
+ isComplete: e.isComplete,
4392
+ entries: e.entries.map((n) => ({
4393
4393
  ref: n.ref,
4394
4394
  obj: {
4395
4395
  ...n.obj,
4396
- data: mt(
4396
+ data: mt$1(
4397
4397
  n.obj.data,
4398
- (s) => new _(s, [n.ref.blockId, n.ref.name])
4398
+ (r) => new _(r, [n.ref.blockId, n.ref.name])
4399
4399
  )
4400
4400
  }
4401
4401
  }))
@@ -4414,13 +4414,13 @@
4414
4414
  * @param ref a Ref
4415
4415
  * @returns data associated with the ref
4416
4416
  */
4417
- getDataByRef(t) {
4417
+ getDataByRef(e) {
4418
4418
  var n;
4419
4419
  return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (n = this.getData().entries.find(
4420
- (s) => s.ref.blockId === t.blockId && s.ref.name === t.name
4420
+ (r) => r.ref.blockId === e.blockId && r.ref.name === e.name
4421
4421
  )) == null ? void 0 : n.obj : lt(
4422
- this.ctx.getDataFromResultPoolByRef(t.blockId, t.name),
4423
- (s) => new _(s, [t.blockId, t.name])
4422
+ this.ctx.getDataFromResultPoolByRef(e.blockId, e.name),
4423
+ (r) => new _(r, [e.blockId, e.name])
4424
4424
  );
4425
4425
  }
4426
4426
  /**
@@ -4428,18 +4428,18 @@
4428
4428
  * @param ref a Ref
4429
4429
  * @returns p-column associated with the ref
4430
4430
  */
4431
- getPColumnByRef(t) {
4432
- const n = this.getDataByRef(t);
4431
+ getPColumnByRef(e) {
4432
+ const n = this.getDataByRef(e);
4433
4433
  if (n)
4434
- return dt$1(n);
4434
+ return dt(n);
4435
4435
  }
4436
4436
  /**
4437
4437
  * Returns spec associated with the ref ensuring that it is a p-column spec.
4438
4438
  * @param ref a Ref
4439
4439
  * @returns p-column spec associated with the ref
4440
4440
  */
4441
- getPColumnSpecByRef(t) {
4442
- const n = this.getSpecByRef(t);
4441
+ getPColumnSpecByRef(e) {
4442
+ const n = this.getSpecByRef(e);
4443
4443
  if (n) {
4444
4444
  if (!i(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
4445
4445
  return n;
@@ -4449,58 +4449,58 @@
4449
4449
  * @param ref a Ref
4450
4450
  * @returns object spec associated with the ref
4451
4451
  */
4452
- getSpecByRef(t) {
4452
+ getSpecByRef(e) {
4453
4453
  var n;
4454
4454
  return typeof this.ctx.getSpecFromResultPoolByRef > "u" ? (n = this.getSpecs().entries.find(
4455
- (s) => s.ref.blockId === t.blockId && s.ref.name === t.name
4456
- )) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(t.blockId, t.name);
4455
+ (r) => r.ref.blockId === e.blockId && r.ref.name === e.name
4456
+ )) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(e.blockId, e.name);
4457
4457
  }
4458
4458
  /**
4459
4459
  * @param spec object specification
4460
4460
  * @returns array of data objects with compatible specs
4461
4461
  * @deprecated delete this method after Jan 1, 2025
4462
4462
  */
4463
- findDataWithCompatibleSpec(t) {
4463
+ findDataWithCompatibleSpec(e) {
4464
4464
  const n = [];
4465
- t: for (const s of this.getData().entries) {
4466
- if (!i(s.obj.spec))
4465
+ e: for (const r of this.getData().entries) {
4466
+ if (!i(r.obj.spec))
4467
4467
  continue;
4468
- const i$1 = s.obj.spec;
4469
- if (t.name === i$1.name && t.valueType === i$1.valueType && t.axesSpec.length === i$1.axesSpec.length && K(t.domain, i$1.domain)) {
4470
- for (let r = 0; r < t.axesSpec.length; ++r) {
4471
- const o = t.axesSpec[r], l = i$1.axesSpec[r];
4472
- if (o.name !== l.name || o.type !== l.type || !K(o.domain, l.domain))
4473
- continue t;
4468
+ const i$1 = r.obj.spec;
4469
+ if (e.name === i$1.name && e.valueType === i$1.valueType && e.axesSpec.length === i$1.axesSpec.length && H(e.domain, i$1.domain)) {
4470
+ for (let s = 0; s < e.axesSpec.length; ++s) {
4471
+ const o = e.axesSpec[s], a = i$1.axesSpec[s];
4472
+ if (o.name !== a.name || o.type !== a.type || !H(o.domain, a.domain))
4473
+ continue e;
4474
4474
  }
4475
- n.push(s.obj);
4475
+ n.push(r.obj);
4476
4476
  }
4477
4477
  }
4478
4478
  return n;
4479
4479
  }
4480
4480
  }
4481
- function K(e, t) {
4482
- if (e === void 0) return t === void 0;
4483
- if (t === void 0) return true;
4484
- for (const n in t)
4485
- if (e[n] !== t[n]) return false;
4481
+ function H(t, e) {
4482
+ if (t === void 0) return e === void 0;
4483
+ if (e === void 0) return true;
4484
+ for (const n in e)
4485
+ if (t[n] !== e[n]) return false;
4486
4486
  return true;
4487
4487
  }
4488
- class D {
4488
+ class x {
4489
4489
  constructor() {
4490
4490
  S(this, "ctx");
4491
4491
  S(this, "args");
4492
4492
  S(this, "uiState");
4493
- S(this, "resultPool", new Dt());
4494
- this.ctx = u(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
4493
+ S(this, "resultPool", new De());
4494
+ this.ctx = l(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
4495
4495
  }
4496
- getNamedAccessor(t) {
4497
- return J(
4498
- this.ctx.getAccessorHandleByName(t),
4499
- (n) => new _(n, [t])
4496
+ getNamedAccessor(e) {
4497
+ return K(
4498
+ this.ctx.getAccessorHandleByName(e),
4499
+ (n) => new _(n, [e])
4500
4500
  );
4501
4501
  }
4502
4502
  get prerun() {
4503
- return this.getNamedAccessor(rt);
4503
+ return this.getNamedAccessor(se);
4504
4504
  }
4505
4505
  /**
4506
4506
  * @deprecated use prerun
@@ -4515,7 +4515,7 @@
4515
4515
  return this.precalc;
4516
4516
  }
4517
4517
  get outputs() {
4518
- return this.getNamedAccessor(ot);
4518
+ return this.getNamedAccessor(oe);
4519
4519
  }
4520
4520
  /**
4521
4521
  * @deprecated use outputs
@@ -4527,93 +4527,93 @@
4527
4527
  * Find labels data for a given axis id. It will search for a label column and return its data as a map.
4528
4528
  * @returns a map of axis value => label
4529
4529
  */
4530
- findLabels(t) {
4530
+ findLabels(e) {
4531
4531
  const n = this.resultPool.getData();
4532
- for (const s of n.entries) {
4533
- if (!W(s.obj)) continue;
4534
- const i2 = s.obj.spec;
4535
- if (i2.name === "pl7.app/label" && i2.axesSpec.length === 1 && i2.axesSpec[0].name === t.name && i2.axesSpec[0].type === t.type && K(t.domain, i2.axesSpec[0].domain)) {
4536
- if (s.obj.data.resourceType.name !== "PColumnData/Json")
4537
- throw Error(`Expected JSON column for labels, got: ${s.obj.data.resourceType.name}`);
4532
+ for (const r of n.entries) {
4533
+ if (!W(r.obj)) continue;
4534
+ const i2 = r.obj.spec;
4535
+ if (i2.name === "pl7.app/label" && i2.axesSpec.length === 1 && i2.axesSpec[0].name === e.name && i2.axesSpec[0].type === e.type && H(e.domain, i2.axesSpec[0].domain)) {
4536
+ if (r.obj.data.resourceType.name !== "PColumnData/Json")
4537
+ throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
4538
4538
  return Object.fromEntries(
4539
4539
  Object.entries(
4540
- s.obj.data.getDataAsJson().data
4540
+ r.obj.data.getDataAsJson().data
4541
4541
  ).map((o) => [JSON.parse(o[0])[0], o[1]])
4542
4542
  );
4543
4543
  }
4544
4544
  }
4545
4545
  }
4546
- verifyInlineColumnsSupport(t) {
4546
+ verifyInlineColumnsSupport(e) {
4547
4547
  var i2;
4548
- const n = t.some((r) => !(r.data instanceof _)), s = ((i2 = this.ctx.featureFlags) == null ? void 0 : i2.inlineColumnsSupport) === true;
4549
- if (n && !s) throw Error("inline columns not supported");
4548
+ const n = e.some((s) => !(s.data instanceof _)), r = ((i2 = this.ctx.featureFlags) == null ? void 0 : i2.inlineColumnsSupport) === true;
4549
+ if (n && !r) throw Error("inline columns not supported");
4550
4550
  }
4551
- createPFrame(t) {
4552
- return this.verifyInlineColumnsSupport(t), this.ctx.createPFrame(
4553
- t.map((n) => lt(n, (s) => s instanceof _ ? s.handle : s))
4551
+ createPFrame(e) {
4552
+ return this.verifyInlineColumnsSupport(e), this.ctx.createPFrame(
4553
+ e.map((n) => lt(n, (r) => r instanceof _ ? r.handle : r))
4554
4554
  );
4555
4555
  }
4556
- createPTable(t) {
4556
+ createPTable(e) {
4557
4557
  var n;
4558
- return "columns" in t ? n = {
4558
+ return "columns" in e ? n = {
4559
4559
  src: {
4560
4560
  type: "full",
4561
- entries: t.columns.map((s) => ({ type: "column", column: s }))
4561
+ entries: e.columns.map((r) => ({ type: "column", column: r }))
4562
4562
  },
4563
- filters: t.filters ?? [],
4564
- sorting: t.sorting ?? []
4565
- } : n = t, this.verifyInlineColumnsSupport(pt$1(n.src)), this.ctx.createPTable(
4566
- it$1(
4563
+ filters: e.filters ?? [],
4564
+ sorting: e.sorting ?? []
4565
+ } : n = e, this.verifyInlineColumnsSupport(pt(n.src)), this.ctx.createPTable(
4566
+ it(
4567
4567
  n,
4568
- (s) => lt(s, (i2) => i2 instanceof _ ? i2.handle : i2)
4568
+ (r) => lt(r, (i2) => i2 instanceof _ ? i2.handle : i2)
4569
4569
  )
4570
4570
  );
4571
4571
  }
4572
4572
  /** @deprecated scheduled for removal from SDK */
4573
- getBlockLabel(t) {
4574
- return this.ctx.getBlockLabel(t);
4573
+ getBlockLabel(e) {
4574
+ return this.ctx.getBlockLabel(e);
4575
4575
  }
4576
4576
  getCurrentUnstableMarker() {
4577
4577
  if (!(typeof this.ctx.getCurrentUnstableMarker > "u"))
4578
4578
  return this.ctx.getCurrentUnstableMarker();
4579
4579
  }
4580
4580
  }
4581
- const F = "1.20.27";
4582
- function xt(e) {
4583
- return e.__renderLambda === true;
4581
+ const T = "1.21.0";
4582
+ function xe(t) {
4583
+ return t.__renderLambda === true;
4584
4584
  }
4585
- function U(e) {
4586
- if (e !== void 0)
4587
- return xt(e) ? e.handle : e;
4585
+ function $(t) {
4586
+ if (t !== void 0)
4587
+ return xe(t) ? t.handle : t;
4588
4588
  }
4589
4589
  class b {
4590
- constructor(t, n, s, i2, r, o, l) {
4591
- this._renderingMode = t, this._initialArgs = n, this._initialUiState = s, this._outputs = i2, this._inputsValid = r, this._sections = o, this._title = l;
4590
+ constructor(e, n, r, i2, s, o, a) {
4591
+ this._renderingMode = e, this._initialArgs = n, this._initialUiState = r, this._outputs = i2, this._inputsValid = s, this._sections = o, this._title = a;
4592
4592
  }
4593
- static create(t = "Heavy") {
4593
+ static create(e = "Heavy") {
4594
4594
  return new b(
4595
- t,
4595
+ e,
4596
4596
  void 0,
4597
4597
  {},
4598
4598
  {},
4599
- L(true),
4600
- L([]),
4599
+ E(true),
4600
+ E([]),
4601
4601
  void 0
4602
4602
  );
4603
4603
  }
4604
- output(t, n, s = {}) {
4604
+ output(e, n, r = {}) {
4605
4605
  if (typeof n == "function") {
4606
- const i2 = `output#${t}`;
4607
- return k(i2, () => n(new D())), new b(
4606
+ const i2 = `output#${e}`;
4607
+ return L(i2, () => n(new x())), new b(
4608
4608
  this._renderingMode,
4609
4609
  this._initialArgs,
4610
4610
  this._initialUiState,
4611
4611
  {
4612
4612
  ...this._outputs,
4613
- [t]: {
4613
+ [e]: {
4614
4614
  __renderLambda: true,
4615
4615
  handle: i2,
4616
- ...s
4616
+ ...r
4617
4617
  }
4618
4618
  },
4619
4619
  this._inputsValid,
@@ -4627,7 +4627,7 @@
4627
4627
  this._initialUiState,
4628
4628
  {
4629
4629
  ...this._outputs,
4630
- [t]: n
4630
+ [e]: n
4631
4631
  },
4632
4632
  this._inputsValid,
4633
4633
  this._sections,
@@ -4635,15 +4635,15 @@
4635
4635
  );
4636
4636
  }
4637
4637
  /** Shortcut for {@link output} with retentive flag set to true. */
4638
- retentiveOutput(t, n) {
4639
- return this.output(t, n, { retentive: true });
4638
+ retentiveOutput(e, n) {
4639
+ return this.output(e, n, { retentive: true });
4640
4640
  }
4641
4641
  /** @deprecated */
4642
- canRun(t) {
4643
- return this.inputsValid(t);
4642
+ canRun(e) {
4643
+ return this.inputsValid(e);
4644
4644
  }
4645
- argsValid(t) {
4646
- return typeof t == "function" ? (k("inputsValid", () => t(new D())), new b(
4645
+ argsValid(e) {
4646
+ return typeof e == "function" ? (L("inputsValid", () => e(new x())), new b(
4647
4647
  this._renderingMode,
4648
4648
  this._initialArgs,
4649
4649
  this._initialUiState,
@@ -4659,16 +4659,16 @@
4659
4659
  this._initialArgs,
4660
4660
  this._initialUiState,
4661
4661
  this._outputs,
4662
- t,
4662
+ e,
4663
4663
  this._sections,
4664
4664
  this._title
4665
4665
  );
4666
4666
  }
4667
- inputsValid(t) {
4668
- return this.argsValid(t);
4667
+ inputsValid(e) {
4668
+ return this.argsValid(e);
4669
4669
  }
4670
- sections(t) {
4671
- return Array.isArray(t) ? this.sections(L(t)) : typeof t == "function" ? (k("sections", () => t(new D())), new b(
4670
+ sections(e) {
4671
+ return Array.isArray(e) ? this.sections(E(e)) : typeof e == "function" ? (L("sections", () => e(new x())), new b(
4672
4672
  this._renderingMode,
4673
4673
  this._initialArgs,
4674
4674
  this._initialUiState,
@@ -4682,12 +4682,12 @@
4682
4682
  this._initialUiState,
4683
4683
  this._outputs,
4684
4684
  this._inputsValid,
4685
- t,
4685
+ e,
4686
4686
  this._title
4687
4687
  );
4688
4688
  }
4689
- title(t) {
4690
- return k("title", () => t(new D())), new b(
4689
+ title(e) {
4690
+ return L("title", () => e(new x())), new b(
4691
4691
  this._renderingMode,
4692
4692
  this._initialArgs,
4693
4693
  this._initialUiState,
@@ -4701,10 +4701,10 @@
4701
4701
  * Sets initial args for the block, this value must be specified.
4702
4702
  * @deprecated use {@link withArgs}
4703
4703
  * */
4704
- initialArgs(t) {
4704
+ initialArgs(e) {
4705
4705
  return new b(
4706
4706
  this._renderingMode,
4707
- t,
4707
+ e,
4708
4708
  this._initialUiState,
4709
4709
  this._outputs,
4710
4710
  this._inputsValid,
@@ -4713,10 +4713,10 @@
4713
4713
  );
4714
4714
  }
4715
4715
  /** Sets initial args for the block, this value must be specified. */
4716
- withArgs(t) {
4716
+ withArgs(e) {
4717
4717
  return new b(
4718
4718
  this._renderingMode,
4719
- t,
4719
+ e,
4720
4720
  this._initialUiState,
4721
4721
  this._outputs,
4722
4722
  this._inputsValid,
@@ -4725,11 +4725,11 @@
4725
4725
  );
4726
4726
  }
4727
4727
  /** Defines type and sets initial value for block UiState. */
4728
- withUiState(t) {
4728
+ withUiState(e) {
4729
4729
  return new b(
4730
4730
  this._renderingMode,
4731
4731
  this._initialArgs,
4732
- t,
4732
+ e,
4733
4733
  this._outputs,
4734
4734
  this._inputsValid,
4735
4735
  this._sections,
@@ -4741,9 +4741,9 @@
4741
4741
  * other features provided by the platforma to the block. */
4742
4742
  done() {
4743
4743
  if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
4744
- const t = {
4744
+ const e = {
4745
4745
  v3: {
4746
- sdkVersion: F,
4746
+ sdkVersion: T,
4747
4747
  renderingMode: this._renderingMode,
4748
4748
  initialArgs: this._initialArgs,
4749
4749
  initialUiState: this._initialUiState,
@@ -4753,64 +4753,73 @@
4753
4753
  outputs: this._outputs
4754
4754
  },
4755
4755
  // fields below are added to allow previous desktop versions read generated configs
4756
- sdkVersion: F,
4756
+ sdkVersion: T,
4757
4757
  renderingMode: this._renderingMode,
4758
4758
  initialArgs: this._initialArgs,
4759
- inputsValid: U(this._inputsValid),
4760
- sections: U(this._sections),
4759
+ inputsValid: $(this._inputsValid),
4760
+ sections: $(this._sections),
4761
4761
  outputs: Object.fromEntries(
4762
- Object.entries(this._outputs).map(([n, s]) => [n, U(s)])
4762
+ Object.entries(this._outputs).map(([n, r]) => [n, $(r)])
4763
4763
  )
4764
4764
  };
4765
- return _t() ? it({ sdkVersion: F }) : { config: t };
4765
+ return _e() ? ie({ sdkVersion: T }) : { config: e };
4766
4766
  }
4767
4767
  }
4768
- function me(e, t, n, s) {
4769
- var l, d;
4770
- const i2 = e.resultPool.getData().entries.map((a) => a.obj).filter(W).filter((a) => a.spec.name === "pl7.app/label" && a.spec.axesSpec.length === 1), r = (a, p) => {
4771
- let g = a.toString();
4768
+ function mt(t, e, n, r) {
4769
+ var u, g;
4770
+ Array.isArray(r) && (r = { filters: r });
4771
+ const i2 = t.resultPool.getData().entries.map((d) => d.obj).filter(W).filter((d) => d.spec.name === "pl7.app/label" && d.spec.axesSpec.length === 1), s = (d, p) => {
4772
+ let h = d.toString();
4772
4773
  if (p)
4773
- for (const c in p)
4774
- g += c, g += p[c];
4775
- return g;
4774
+ for (const f2 in p)
4775
+ h += f2, h += p[f2];
4776
+ return h;
4776
4777
  }, o = /* @__PURE__ */ new Map();
4777
- for (const a of t)
4778
- for (const p of a.spec.axesSpec) {
4779
- const g = J$1(p);
4780
- for (const c of i2) {
4781
- const m = c.spec.axesSpec[0], h = J$1(c.spec.axesSpec[0]);
4782
- if (ot$1(g, h)) {
4783
- const P = Object.keys(g.domain ?? {}).length, y = Object.keys(h.domain ?? {}).length;
4784
- if (P > y) {
4785
- const C = r(c.id, g.domain);
4786
- o.set(C, {
4787
- id: C,
4778
+ for (const d of e)
4779
+ for (const p of d.spec.axesSpec) {
4780
+ const h = J(p);
4781
+ for (const f2 of i2) {
4782
+ const C = f2.spec.axesSpec[0], y = J(f2.spec.axesSpec[0]);
4783
+ if (ot(h, y)) {
4784
+ const I = Object.keys(h.domain ?? {}).length, D = Object.keys(y.domain ?? {}).length;
4785
+ if (I > D) {
4786
+ const R = s(f2.id, h.domain);
4787
+ o.set(R, {
4788
+ id: R,
4788
4789
  spec: {
4789
- ...c.spec,
4790
- axesSpec: [{ ...g, annotations: m.annotations }]
4790
+ ...f2.spec,
4791
+ axesSpec: [{ ...h, annotations: C.annotations }]
4791
4792
  },
4792
- data: c.data
4793
+ data: f2.data
4793
4794
  });
4794
4795
  } else
4795
- o.set(r(c.id), c);
4796
+ o.set(s(f2.id), f2);
4796
4797
  }
4797
4798
  }
4798
4799
  }
4799
- if (![...t, ...o.values()].some(
4800
- (a) => a.data instanceof _ && !a.data.getIsReadyOrError()
4800
+ if ([...e, ...o.values()].some(
4801
+ (d) => d.data instanceof _ && !d.data.getIsReadyOrError()
4801
4802
  ))
4802
- return e.createPTable({
4803
- src: {
4804
- type: "outer",
4805
- primary: {
4806
- type: "full",
4807
- entries: t.map((a) => ({ type: "column", column: a }))
4808
- },
4809
- secondary: [...o.values()].map((a) => ({ type: "column", column: a }))
4803
+ return;
4804
+ let a = e;
4805
+ const c = [];
4806
+ if (r != null && r.coreColumnPredicate) {
4807
+ a = [];
4808
+ for (const d of e)
4809
+ r.coreColumnPredicate(d.spec) ? a.push(d) : c.push(d);
4810
+ }
4811
+ return c.push(...o.values()), t.createPTable({
4812
+ src: {
4813
+ type: "outer",
4814
+ primary: {
4815
+ type: (r == null ? void 0 : r.coreJoinType) ?? "full",
4816
+ entries: a.map((d) => ({ type: "column", column: d }))
4810
4817
  },
4811
- filters: [...((l = n == null ? void 0 : n.pTableParams) == null ? void 0 : l.filters) ?? [], ...s ?? []],
4812
- sorting: ((d = n == null ? void 0 : n.pTableParams) == null ? void 0 : d.sorting) ?? []
4813
- });
4818
+ secondary: c.map((d) => ({ type: "column", column: d }))
4819
+ },
4820
+ filters: [...(r == null ? void 0 : r.filters) ?? [], ...((u = n == null ? void 0 : n.pTableParams) == null ? void 0 : u.filters) ?? []],
4821
+ sorting: ((g = n == null ? void 0 : n.pTableParams) == null ? void 0 : g.sorting) ?? []
4822
+ });
4814
4823
  }
4815
4824
  const $BlockArgs = z.object({
4816
4825
  numbers: z.array(z.coerce.number())
@@ -4819,9 +4828,9 @@
4819
4828
  var _a, _b;
4820
4829
  return (_b = (_a = ctx.outputs) == null ? void 0 : _a.resolve("numbers")) == null ? void 0 : _b.getDataAsJson();
4821
4830
  }).output("pt", (ctx) => {
4822
- var _a, _b, _c, _d, _e;
4831
+ var _a, _b, _c, _d, _e2;
4823
4832
  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;
4824
- return me(ctx, [
4833
+ return mt(ctx, [
4825
4834
  {
4826
4835
  id: "example",
4827
4836
  spec: {
@@ -4848,7 +4857,7 @@
4848
4857
  }
4849
4858
  ], ctx.uiState.dataTableState.tableState, [
4850
4859
  ...(_d = ctx.uiState.dataTableState.tableState.pTableParams) == null ? void 0 : _d.filters,
4851
- ...((_e = ctx.uiState.dataTableState.filterModel) == null ? void 0 : _e.filters) ?? []
4860
+ ...((_e2 = ctx.uiState.dataTableState.filterModel) == null ? void 0 : _e2.filters) ?? []
4852
4861
  ]);
4853
4862
  }).sections((ctx) => {
4854
4863
  return [