@milaboratories/milaboratories.ui-examples.model 1.1.4 → 1.1.6

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
@@ -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 me = this;
3074
+ const me2 = this;
3075
3075
  return OK(async function(...args) {
3076
3076
  const error = new ZodError([]);
3077
- const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
3077
+ const parsedArgs = await me2._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 me._def.returns._def.type.parseAsync(result, params).catch((e) => {
3082
+ const parsedReturns = await me2._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 me = this;
3089
+ const me2 = this;
3090
3090
  return OK(function(...args) {
3091
- const parsedArgs = me._def.args.safeParse(args, params);
3091
+ const parsedArgs = me2._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 = me._def.returns.safeParse(result, params);
3096
+ const parsedReturns = me2._def.returns.safeParse(result, params);
3097
3097
  if (!parsedReturns.success) {
3098
3098
  throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
3099
3099
  }
@@ -3921,7 +3921,7 @@
3921
3921
  const { type: n, name: e, domain: r } = t;
3922
3922
  return { type: n, name: e, ...r && { domain: r } };
3923
3923
  }
3924
- function B(t, n) {
3924
+ function B$1(t, n) {
3925
3925
  if (t === void 0) return n === void 0;
3926
3926
  if (n === void 0) return true;
3927
3927
  for (const e in n)
@@ -3929,7 +3929,7 @@
3929
3929
  return true;
3930
3930
  }
3931
3931
  function M(t, n) {
3932
- return t.name === n.name && B(t.domain, n.domain);
3932
+ return t.name === n.name && B$1(t.domain, n.domain);
3933
3933
  }
3934
3934
  function q(t, n) {
3935
3935
  return { ...t, src: u$1(t.src, n) };
@@ -4003,71 +4003,71 @@
4003
4003
  function tt(t, n) {
4004
4004
  return t.ok ? { ok: true, value: n(t.value) } : t;
4005
4005
  }
4006
- var de = Object.defineProperty;
4007
- var pe = (t, e, n) => e in t ? de(t, e, { enumerable: true, configurable: true, writable: true, value: n }) : t[e] = n;
4008
- var S = (t, e, n) => pe(t, typeof e != "symbol" ? e + "" : e, n);
4009
- function L(t) {
4010
- return { type: "Immediate", value: t };
4006
+ var dt = Object.defineProperty;
4007
+ var pt = (e, t, n) => t in e ? dt(e, t, { enumerable: true, configurable: true, writable: true, value: n }) : e[t] = n;
4008
+ var S = (e, t, n) => pt(e, typeof t != "symbol" ? t + "" : t, n);
4009
+ function L(e) {
4010
+ return { type: "Immediate", value: e };
4011
4011
  }
4012
- function ve() {
4012
+ function _t() {
4013
4013
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
4014
4014
  }
4015
- function ie(t) {
4016
- if (t && typeof globalThis.getPlatforma == "function")
4017
- return globalThis.getPlatforma(t);
4015
+ function it(e) {
4016
+ if (e && typeof globalThis.getPlatforma == "function")
4017
+ return globalThis.getPlatforma(e);
4018
4018
  if (typeof globalThis.platforma < "u") return globalThis.platforma;
4019
4019
  throw new Error("Can't get platforma instance.");
4020
4020
  }
4021
- function we() {
4021
+ function wt() {
4022
4022
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
4023
4023
  }
4024
4024
  function u() {
4025
4025
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
4026
4026
  throw new Error("Not in config rendering context");
4027
4027
  }
4028
- function k(t, e) {
4029
- const n = we();
4028
+ function k(e, t) {
4029
+ const n = wt();
4030
4030
  if (n === void 0) return false;
4031
- if (t in n.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
4032
- return n.callbackRegistry[t] = e, true;
4031
+ if (e in n.callbackRegistry) throw new Error(`Callback with key ${e} already registered.`);
4032
+ return n.callbackRegistry[e] = t, true;
4033
4033
  }
4034
- const N = /* @__PURE__ */ new Map();
4035
- function Se(t, e) {
4036
- t in u().callbackRegistry || (u().callbackRegistry[t] = (n) => {
4037
- for (const s of N.get(t))
4034
+ const B = /* @__PURE__ */ new Map();
4035
+ function St(e, t) {
4036
+ e in u().callbackRegistry || (u().callbackRegistry[e] = (n) => {
4037
+ for (const s of B.get(e))
4038
4038
  s(n);
4039
- }, N.set(t, [])), N.get(t).push(e);
4039
+ }, B.set(e, [])), B.get(e).push(t);
4040
4040
  }
4041
- class _ {
4042
- constructor(e, n = (s) => s) {
4041
+ class v {
4042
+ constructor(t, n = (s) => s) {
4043
4043
  S(this, "isResolved", false);
4044
4044
  S(this, "resolvedValue");
4045
- this.handle = e, this.postProcess = n, Se(e, (s) => {
4045
+ this.handle = t, this.postProcess = n, St(t, (s) => {
4046
4046
  this.resolvedValue = n(s), this.isResolved = true;
4047
4047
  });
4048
4048
  }
4049
- map(e) {
4050
- return new _(this.handle, (n) => e(this.postProcess(n)));
4049
+ map(t) {
4050
+ return new v(this.handle, (n) => t(this.postProcess(n)));
4051
4051
  }
4052
- mapDefined(e) {
4053
- return new _(this.handle, (n) => {
4052
+ mapDefined(t) {
4053
+ return new v(this.handle, (n) => {
4054
4054
  const s = this.postProcess(n);
4055
- return s ? e(s) : void 0;
4055
+ return s ? t(s) : void 0;
4056
4056
  });
4057
4057
  }
4058
4058
  toJSON() {
4059
4059
  return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
4060
4060
  }
4061
4061
  }
4062
- function Q(t) {
4063
- return t === void 0 ? void 0 : new v(t);
4062
+ function J(e, t) {
4063
+ return e === void 0 ? void 0 : t(e);
4064
4064
  }
4065
- class v {
4066
- constructor(e) {
4067
- this.handle = e;
4065
+ class _ {
4066
+ constructor(t, n) {
4067
+ this.handle = t, this.resolvePath = n;
4068
4068
  }
4069
- resolve(...e) {
4070
- const n = e.map(
4069
+ resolve(...t) {
4070
+ const n = t.map(
4071
4071
  (s) => ({
4072
4072
  assertFieldType: "Input",
4073
4073
  ...typeof s == "string" ? { field: s } : s
@@ -4075,8 +4075,8 @@
4075
4075
  );
4076
4076
  return this.resolveWithCommon({}, ...n);
4077
4077
  }
4078
- resolveOutput(...e) {
4079
- const n = e.map(
4078
+ resolveOutput(...t) {
4079
+ const n = t.map(
4080
4080
  (s) => ({
4081
4081
  assertFieldType: "Output",
4082
4082
  ...typeof s == "string" ? { field: s } : s
@@ -4084,8 +4084,8 @@
4084
4084
  );
4085
4085
  return this.resolveWithCommon({}, ...n);
4086
4086
  }
4087
- resolveInput(...e) {
4088
- const n = e.map(
4087
+ resolveInput(...t) {
4088
+ const n = t.map(
4089
4089
  (s) => ({
4090
4090
  assertFieldType: "Input",
4091
4091
  ...typeof s == "string" ? { field: s } : s
@@ -4093,11 +4093,18 @@
4093
4093
  );
4094
4094
  return this.resolveWithCommon({}, ...n);
4095
4095
  }
4096
- resolveAny(...e) {
4097
- return this.resolveWithCommon({}, ...e);
4098
- }
4099
- resolveWithCommon(e, ...n) {
4100
- return Q(u().resolveWithCommon(this.handle, e, ...n));
4096
+ resolveAny(...t) {
4097
+ return this.resolveWithCommon({}, ...t);
4098
+ }
4099
+ resolveWithCommon(t, ...n) {
4100
+ const s = [
4101
+ ...this.resolvePath,
4102
+ ...n.map((i2) => typeof i2 == "string" ? i2 : i2.field)
4103
+ ];
4104
+ return J(
4105
+ u().resolveWithCommon(this.handle, t, ...n),
4106
+ (i2) => new _(i2, s)
4107
+ );
4101
4108
  }
4102
4109
  get resourceType() {
4103
4110
  return u().getResourceType(this.handle);
@@ -4115,7 +4122,11 @@
4115
4122
  return u().getIsFinal(this.handle);
4116
4123
  }
4117
4124
  getError() {
4118
- return Q(u().getError(this.handle));
4125
+ const t = [...this.resolvePath, "error"];
4126
+ return J(
4127
+ u().getError(this.handle),
4128
+ (n) => new _(n, t)
4129
+ );
4119
4130
  }
4120
4131
  listInputFields() {
4121
4132
  return u().listInputFields(this.handle);
@@ -4126,14 +4137,14 @@
4126
4137
  listDynamicFields() {
4127
4138
  return u().listDynamicFields(this.handle);
4128
4139
  }
4129
- getKeyValueBase64(e) {
4130
- return u().getKeyValueBase64(this.handle, e);
4140
+ getKeyValueBase64(t) {
4141
+ return u().getKeyValueBase64(this.handle, t);
4131
4142
  }
4132
- getKeyValueAsString(e) {
4133
- return u().getKeyValueAsString(this.handle, e);
4143
+ getKeyValueAsString(t) {
4144
+ return u().getKeyValueAsString(this.handle, t);
4134
4145
  }
4135
- getKeyValueAsJson(e) {
4136
- const n = this.getKeyValueAsString(e);
4146
+ getKeyValueAsJson(t) {
4147
+ const n = this.getKeyValueAsString(t);
4137
4148
  if (n == null) throw new Error("Resource has no content.");
4138
4149
  return JSON.parse(n);
4139
4150
  }
@@ -4144,15 +4155,15 @@
4144
4155
  return u().getDataAsString(this.handle);
4145
4156
  }
4146
4157
  getDataAsJson() {
4147
- const e = this.getDataAsString();
4148
- if (e == null) throw new Error("Resource has no content.");
4149
- return JSON.parse(e);
4158
+ const t = this.getDataAsString();
4159
+ if (t == null) throw new Error("Resource has no content.");
4160
+ return JSON.parse(t);
4150
4161
  }
4151
4162
  /**
4152
4163
  *
4153
4164
  */
4154
- getPColumns(e = false, n = "") {
4155
- const s = this.parsePObjectCollection(e, n);
4165
+ getPColumns(t = false, n = "") {
4166
+ const s = this.parsePObjectCollection(t, n);
4156
4167
  return s === void 0 ? void 0 : Object.entries(s).map(([, r]) => {
4157
4168
  if (!U$1(r)) throw new Error(`not a PColumn (kind = ${r.spec.kind})`);
4158
4169
  return r;
@@ -4161,28 +4172,31 @@
4161
4172
  /**
4162
4173
  *
4163
4174
  */
4164
- parsePObjectCollection(e = false, n = "") {
4175
+ parsePObjectCollection(t = false, n = "") {
4165
4176
  const s = u().parsePObjectCollection(
4166
4177
  this.handle,
4167
- e,
4168
- n
4178
+ t,
4179
+ n,
4180
+ ...this.resolvePath
4169
4181
  );
4170
4182
  if (s === void 0) return;
4171
4183
  const i2 = {};
4172
- for (const [r, o] of Object.entries(s))
4173
- i2[r] = T(o, (l) => new v(l));
4184
+ for (const [r, o] of Object.entries(s)) {
4185
+ const l = [...this.resolvePath, r];
4186
+ i2[r] = T(o, (d) => new _(d, l));
4187
+ }
4174
4188
  return i2;
4175
4189
  }
4176
4190
  getFileContentAsBase64() {
4177
- return new _(u().getBlobContentAsBase64(this.handle));
4191
+ return new v(u().getBlobContentAsBase64(this.handle));
4178
4192
  }
4179
4193
  getFileContentAsString() {
4180
- return new _(u().getBlobContentAsString(this.handle));
4194
+ return new v(u().getBlobContentAsString(this.handle));
4181
4195
  }
4182
4196
  getFileContentAsJson() {
4183
- return new _(
4197
+ return new v(
4184
4198
  u().getBlobContentAsString(this.handle)
4185
- ).mapDefined((e) => JSON.parse(e));
4199
+ ).mapDefined((t) => JSON.parse(t));
4186
4200
  }
4187
4201
  /**
4188
4202
  * @deprecated use getFileContentAsBase64
@@ -4200,7 +4214,7 @@
4200
4214
  * @returns downloaded file handle
4201
4215
  */
4202
4216
  getFileHandle() {
4203
- return new _(u().getDownloadedBlobContentHandle(this.handle));
4217
+ return new v(u().getDownloadedBlobContentHandle(this.handle));
4204
4218
  }
4205
4219
  /**
4206
4220
  * @deprecated use getFileHandle
@@ -4212,7 +4226,7 @@
4212
4226
  * @returns downloaded file handle
4213
4227
  */
4214
4228
  getRemoteFileHandle() {
4215
- return new _(u().getOnDemandBlobContentHandle(this.handle));
4229
+ return new v(u().getOnDemandBlobContentHandle(this.handle));
4216
4230
  }
4217
4231
  /**
4218
4232
  * @deprecated use getRemoteFileHandle
@@ -4221,19 +4235,19 @@
4221
4235
  return this.getRemoteFileHandle();
4222
4236
  }
4223
4237
  getImportProgress() {
4224
- return new _(u().getImportProgress(this.handle));
4238
+ return new v(u().getImportProgress(this.handle));
4225
4239
  }
4226
- getLastLogs(e) {
4227
- return new _(u().getLastLogs(this.handle, e));
4240
+ getLastLogs(t) {
4241
+ return new v(u().getLastLogs(this.handle, t));
4228
4242
  }
4229
- getProgressLog(e) {
4230
- return new _(u().getProgressLog(this.handle, e));
4243
+ getProgressLog(t) {
4244
+ return new v(u().getProgressLog(this.handle, t));
4231
4245
  }
4232
4246
  getLogHandle() {
4233
- return new _(u().getLogHandle(this.handle));
4247
+ return new v(u().getLogHandle(this.handle));
4234
4248
  }
4235
- allFieldsResolved(e = "Input") {
4236
- switch (e) {
4249
+ allFieldsResolved(t = "Input") {
4250
+ switch (t) {
4237
4251
  case "Input":
4238
4252
  return this.getInputsLocked() && this.listInputFields().every(
4239
4253
  (n) => this.resolve({ field: n, assertFieldType: "Input" }) !== void 0
@@ -4244,13 +4258,13 @@
4244
4258
  );
4245
4259
  }
4246
4260
  }
4247
- mapFields(e, n) {
4261
+ mapFields(t, n) {
4248
4262
  const { fieldType: s, requireLocked: i2, skipUnresolved: r } = {
4249
4263
  fieldType: "Input",
4250
4264
  requireLocked: true,
4251
4265
  skipUnresolved: false,
4252
4266
  ...n
4253
- }, o = e;
4267
+ }, o = t;
4254
4268
  if (i2 && (s === "Input" && !this.getInputsLocked() || s === "Output" && !this.getOutputsLocked()))
4255
4269
  return;
4256
4270
  let d = (s === "Input" ? this.listInputFields() : s === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
@@ -4259,31 +4273,31 @@
4259
4273
  return r && (d = d.filter((a) => a[1] !== void 0)), d.map(([a, p]) => o(a, p));
4260
4274
  }
4261
4275
  }
4262
- const re = "staging", oe = "main";
4263
- const Ie = "pl7.app/label", Pe = "pl7.app/trace", Re = z.object({
4276
+ const rt = "staging", ot = "main";
4277
+ const At = "pl7.app/label", It = "pl7.app/trace", Rt = z.object({
4264
4278
  type: z.string(),
4265
4279
  importance: z.number().optional(),
4266
4280
  id: z.string().optional(),
4267
4281
  label: z.string()
4268
- }), Fe = z.array(Re), Te = 1e-3, Oe = "__LABEL__", Z = "__LABEL__@1";
4269
- function ke(t, e, n = {}) {
4270
- const s = /* @__PURE__ */ new Map(), i2 = /* @__PURE__ */ new Map(), r = t.map((c) => {
4271
- var q2, z2;
4272
- const m = e(c), h = (q2 = m.annotations) == null ? void 0 : q2[Ie], A = (z2 = m.annotations) == null ? void 0 : z2[Pe], y = (A ? Fe.safeParse(JSON.parse(A)).data : void 0) ?? [];
4282
+ }), Ft = z.array(Rt), Tt = 1e-3, Ot = "__LABEL__", Z = "__LABEL__@1";
4283
+ function kt(e, t, n = {}) {
4284
+ const s = /* @__PURE__ */ new Map(), i2 = /* @__PURE__ */ new Map(), r = e.map((c) => {
4285
+ var z2, Y;
4286
+ 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) ?? [];
4273
4287
  if (h) {
4274
- const w = { label: h, type: Oe, importance: -2 };
4288
+ const w = { label: h, type: Ot, importance: -2 };
4275
4289
  n.addLabelAsSuffix ? y.push(w) : y.splice(0, 0, w);
4276
4290
  }
4277
- const C = [], W = /* @__PURE__ */ new Map();
4291
+ const C = [], q2 = /* @__PURE__ */ new Map();
4278
4292
  for (let w = y.length - 1; w >= 0; --w) {
4279
- const { type: V } = y[w], ce = y[w].importance ?? 0, j = (W.get(V) ?? 0) + 1;
4280
- W.set(V, j);
4293
+ const { type: V } = y[w], ct = y[w].importance ?? 0, j = (q2.get(V) ?? 0) + 1;
4294
+ q2.set(V, j);
4281
4295
  const R = `${V}@${j}`;
4282
4296
  i2.set(R, (i2.get(R) ?? 0) + 1), s.set(
4283
4297
  R,
4284
4298
  Math.max(
4285
4299
  s.get(R) ?? Number.NEGATIVE_INFINITY,
4286
- ce - (y.length - w) * Te
4300
+ ct - (y.length - w) * Tt
4287
4301
  )
4288
4302
  ), C.push({ ...y[w], fullType: R, occurenceIndex: j });
4289
4303
  }
@@ -4296,11 +4310,11 @@
4296
4310
  }), o = [], l = [], d = [...s];
4297
4311
  d.sort(([, c], [, m]) => m - c);
4298
4312
  for (const [c] of d)
4299
- c.endsWith("@1") || i2.get(c) === t.length ? o.push(c) : l.push(c);
4313
+ c.endsWith("@1") || i2.get(c) === e.length ? o.push(c) : l.push(c);
4300
4314
  const a = (c) => r.map((m) => {
4301
- const h = m.fullTrace.filter((y) => c.has(y.fullType)).map((y) => y.label), A = n.separator ?? " / ";
4315
+ const h = m.fullTrace.filter((y) => c.has(y.fullType)).map((y) => y.label), P = n.separator ?? " / ";
4302
4316
  return {
4303
- label: h.join(A),
4317
+ label: h.join(P),
4304
4318
  value: m.value
4305
4319
  };
4306
4320
  });
@@ -4315,28 +4329,28 @@
4315
4329
  for (let h = 0; h < p; ++h) c.add(o[h]);
4316
4330
  c.add(o[g]);
4317
4331
  const m = a(c);
4318
- if (new Set(m.map((h) => h.label)).size === t.length) return m;
4332
+ if (new Set(m.map((h) => h.label)).size === e.length) return m;
4319
4333
  g++, g == o.length && (p++, g = p);
4320
4334
  }
4321
4335
  return a(/* @__PURE__ */ new Set([...o, ...l]));
4322
4336
  }
4323
- class De {
4337
+ class Dt {
4324
4338
  constructor() {
4325
4339
  S(this, "ctx", u());
4326
- S(this, "defaultLabelFn", (e, n) => {
4340
+ S(this, "defaultLabelFn", (t, n) => {
4327
4341
  var s;
4328
- return ((s = e.annotations) == null ? void 0 : s["pl7.app/label"]) ?? "Unlabelled";
4342
+ return ((s = t.annotations) == null ? void 0 : s["pl7.app/label"]) ?? "Unlabelled";
4329
4343
  });
4330
4344
  }
4331
4345
  /**
4332
4346
  * @deprecated use getOptions()
4333
4347
  */
4334
- calculateOptions(e) {
4335
- return this.ctx.calculateOptions(e);
4348
+ calculateOptions(t) {
4349
+ return this.ctx.calculateOptions(t);
4336
4350
  }
4337
- getOptions(e, n) {
4338
- const s = this.getSpecs().entries.filter((i2) => e(i2.obj));
4339
- return typeof n == "object" || typeof n > "u" ? ke(s, (i2) => i2.obj, n ?? {}).map(({ value: { ref: i2 }, label: r }) => ({
4351
+ getOptions(t, n) {
4352
+ const s = this.getSpecs().entries.filter((i2) => t(i2.obj));
4353
+ return typeof n == "object" || typeof n > "u" ? kt(s, (i2) => i2.obj, n ?? {}).map(({ value: { ref: i2 }, label: r }) => ({
4340
4354
  ref: i2,
4341
4355
  label: r
4342
4356
  })) : s.map((i2) => ({
@@ -4351,14 +4365,14 @@
4351
4365
  return this.getData();
4352
4366
  }
4353
4367
  getData() {
4354
- const e = this.ctx.getDataFromResultPool();
4368
+ const t = this.ctx.getDataFromResultPool();
4355
4369
  return {
4356
- isComplete: e.isComplete,
4357
- entries: e.entries.map((n) => ({
4370
+ isComplete: t.isComplete,
4371
+ entries: t.entries.map((n) => ({
4358
4372
  ref: n.ref,
4359
4373
  obj: {
4360
4374
  ...n.obj,
4361
- data: new v(n.obj.data)
4375
+ data: new _(n.obj.data, [n.ref.blockId, n.ref.name])
4362
4376
  }
4363
4377
  }))
4364
4378
  };
@@ -4370,14 +4384,17 @@
4370
4384
  return this.getDataWithErrors();
4371
4385
  }
4372
4386
  getDataWithErrors() {
4373
- const e = this.ctx.getDataWithErrorsFromResultPool();
4387
+ const t = this.ctx.getDataWithErrorsFromResultPool();
4374
4388
  return {
4375
- isComplete: e.isComplete,
4376
- entries: e.entries.map((n) => ({
4389
+ isComplete: t.isComplete,
4390
+ entries: t.entries.map((n) => ({
4377
4391
  ref: n.ref,
4378
4392
  obj: {
4379
4393
  ...n.obj,
4380
- data: tt(n.obj.data, (s) => new v(s))
4394
+ data: tt(
4395
+ n.obj.data,
4396
+ (s) => new _(s, [n.ref.blockId, n.ref.name])
4397
+ )
4381
4398
  }
4382
4399
  }))
4383
4400
  };
@@ -4395,13 +4412,13 @@
4395
4412
  * @param ref a Ref
4396
4413
  * @returns data associated with the ref
4397
4414
  */
4398
- getDataByRef(e) {
4415
+ getDataByRef(t) {
4399
4416
  var n;
4400
4417
  return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (n = this.getData().entries.find(
4401
- (s) => s.ref.blockId === e.blockId && s.ref.name === e.name
4418
+ (s) => s.ref.blockId === t.blockId && s.ref.name === t.name
4402
4419
  )) == null ? void 0 : n.obj : T(
4403
- this.ctx.getDataFromResultPoolByRef(e.blockId, e.name),
4404
- (s) => new v(s)
4420
+ this.ctx.getDataFromResultPoolByRef(t.blockId, t.name),
4421
+ (s) => new _(s, [t.blockId, t.name])
4405
4422
  );
4406
4423
  }
4407
4424
  /**
@@ -4409,8 +4426,8 @@
4409
4426
  * @param ref a Ref
4410
4427
  * @returns p-column associated with the ref
4411
4428
  */
4412
- getPColumnByRef(e) {
4413
- const n = this.getDataByRef(e);
4429
+ getPColumnByRef(t) {
4430
+ const n = this.getDataByRef(t);
4414
4431
  if (n)
4415
4432
  return Z$1(n);
4416
4433
  }
@@ -4419,8 +4436,8 @@
4419
4436
  * @param ref a Ref
4420
4437
  * @returns p-column spec associated with the ref
4421
4438
  */
4422
- getPColumnSpecByRef(e) {
4423
- const n = this.getSpecByRef(e);
4439
+ getPColumnSpecByRef(t) {
4440
+ const n = this.getSpecByRef(t);
4424
4441
  if (n) {
4425
4442
  if (!i(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
4426
4443
  return n;
@@ -4430,28 +4447,28 @@
4430
4447
  * @param ref a Ref
4431
4448
  * @returns object spec associated with the ref
4432
4449
  */
4433
- getSpecByRef(e) {
4450
+ getSpecByRef(t) {
4434
4451
  var n;
4435
4452
  return typeof this.ctx.getSpecFromResultPoolByRef > "u" ? (n = this.getSpecs().entries.find(
4436
- (s) => s.ref.blockId === e.blockId && s.ref.name === e.name
4437
- )) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(e.blockId, e.name);
4453
+ (s) => s.ref.blockId === t.blockId && s.ref.name === t.name
4454
+ )) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(t.blockId, t.name);
4438
4455
  }
4439
4456
  /**
4440
4457
  * @param spec object specification
4441
4458
  * @returns array of data objects with compatible specs
4442
4459
  * @deprecated delete this method after Jan 1, 2025
4443
4460
  */
4444
- findDataWithCompatibleSpec(e) {
4461
+ findDataWithCompatibleSpec(t) {
4445
4462
  const n = [];
4446
- e: for (const s of this.getData().entries) {
4463
+ t: for (const s of this.getData().entries) {
4447
4464
  if (!i(s.obj.spec))
4448
4465
  continue;
4449
4466
  const i$1 = s.obj.spec;
4450
- if (e.name === i$1.name && e.valueType === i$1.valueType && e.axesSpec.length === i$1.axesSpec.length && $(e.domain, i$1.domain)) {
4451
- for (let r = 0; r < e.axesSpec.length; ++r) {
4452
- const o = e.axesSpec[r], l = i$1.axesSpec[r];
4453
- if (o.name !== l.name || o.type !== l.type || !$(o.domain, l.domain))
4454
- continue e;
4467
+ if (t.name === i$1.name && t.valueType === i$1.valueType && t.axesSpec.length === i$1.axesSpec.length && K(t.domain, i$1.domain)) {
4468
+ for (let r = 0; r < t.axesSpec.length; ++r) {
4469
+ const o = t.axesSpec[r], l = i$1.axesSpec[r];
4470
+ if (o.name !== l.name || o.type !== l.type || !K(o.domain, l.domain))
4471
+ continue t;
4455
4472
  }
4456
4473
  n.push(s.obj);
4457
4474
  }
@@ -4459,11 +4476,11 @@
4459
4476
  return n;
4460
4477
  }
4461
4478
  }
4462
- function $(t, e) {
4463
- if (t === void 0) return e === void 0;
4464
- if (e === void 0) return true;
4465
- for (const n in e)
4466
- if (t[n] !== e[n]) return false;
4479
+ function K(e, t) {
4480
+ if (e === void 0) return t === void 0;
4481
+ if (t === void 0) return true;
4482
+ for (const n in t)
4483
+ if (e[n] !== t[n]) return false;
4467
4484
  return true;
4468
4485
  }
4469
4486
  class D {
@@ -4471,15 +4488,17 @@
4471
4488
  S(this, "ctx");
4472
4489
  S(this, "args");
4473
4490
  S(this, "uiState");
4474
- S(this, "resultPool", new De());
4491
+ S(this, "resultPool", new Dt());
4475
4492
  this.ctx = u(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : void 0;
4476
4493
  }
4477
- getNamedAccessor(e) {
4478
- const n = this.ctx.getAccessorHandleByName(e);
4479
- return n ? new v(n) : void 0;
4494
+ getNamedAccessor(t) {
4495
+ return J(
4496
+ this.ctx.getAccessorHandleByName(t),
4497
+ (n) => new _(n, [t])
4498
+ );
4480
4499
  }
4481
4500
  get prerun() {
4482
- return this.getNamedAccessor(re);
4501
+ return this.getNamedAccessor(rt);
4483
4502
  }
4484
4503
  /**
4485
4504
  * @deprecated use prerun
@@ -4494,7 +4513,7 @@
4494
4513
  return this.precalc;
4495
4514
  }
4496
4515
  get outputs() {
4497
- return this.getNamedAccessor(oe);
4516
+ return this.getNamedAccessor(ot);
4498
4517
  }
4499
4518
  /**
4500
4519
  * @deprecated use outputs
@@ -4506,12 +4525,12 @@
4506
4525
  * Find labels data for a given axis id. It will search for a label column and return its data as a map.
4507
4526
  * @returns a map of axis value => label
4508
4527
  */
4509
- findLabels(e) {
4528
+ findLabels(t) {
4510
4529
  const n = this.resultPool.getData();
4511
4530
  for (const s of n.entries) {
4512
4531
  if (!U$1(s.obj)) continue;
4513
4532
  const i2 = s.obj.spec;
4514
- if (i2.name === "pl7.app/label" && i2.axesSpec.length === 1 && i2.axesSpec[0].name === e.name && i2.axesSpec[0].type === e.type && $(e.domain, i2.axesSpec[0].domain)) {
4533
+ 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)) {
4515
4534
  if (s.obj.data.resourceType.name !== "PColumnData/Json")
4516
4535
  throw Error(`Expected JSON column for labels, got: ${s.obj.data.resourceType.name}`);
4517
4536
  return Object.fromEntries(
@@ -4522,55 +4541,55 @@
4522
4541
  }
4523
4542
  }
4524
4543
  }
4525
- verifyInlineColumnsSupport(e) {
4544
+ verifyInlineColumnsSupport(t) {
4526
4545
  var i2;
4527
- const n = e.some((r) => !(r.data instanceof v)), s = ((i2 = this.ctx.featureFlags) == null ? void 0 : i2.inlineColumnsSupport) === true;
4546
+ const n = t.some((r) => !(r.data instanceof _)), s = ((i2 = this.ctx.featureFlags) == null ? void 0 : i2.inlineColumnsSupport) === true;
4528
4547
  if (n && !s) throw Error("inline columns not supported");
4529
4548
  }
4530
- createPFrame(e) {
4531
- return this.verifyInlineColumnsSupport(e), this.ctx.createPFrame(e.map((n) => T(
4549
+ createPFrame(t) {
4550
+ return this.verifyInlineColumnsSupport(t), this.ctx.createPFrame(t.map((n) => T(
4532
4551
  n,
4533
- (s) => s instanceof v ? s.handle : s
4552
+ (s) => s instanceof _ ? s.handle : s
4534
4553
  )));
4535
4554
  }
4536
- createPTable(e) {
4555
+ createPTable(t) {
4537
4556
  var n;
4538
- return "columns" in e ? n = {
4557
+ return "columns" in t ? n = {
4539
4558
  src: {
4540
4559
  type: "full",
4541
- entries: e.columns.map((s) => ({ type: "column", column: s }))
4560
+ entries: t.columns.map((s) => ({ type: "column", column: s }))
4542
4561
  },
4543
- filters: e.filters ?? [],
4544
- sorting: e.sorting ?? []
4545
- } : n = e, this.verifyInlineColumnsSupport(v$1(n.src)), this.ctx.createPTable(q(n, (s) => T(
4562
+ filters: t.filters ?? [],
4563
+ sorting: t.sorting ?? []
4564
+ } : n = t, this.verifyInlineColumnsSupport(v$1(n.src)), this.ctx.createPTable(q(n, (s) => T(
4546
4565
  s,
4547
- (i2) => i2 instanceof v ? i2.handle : i2
4566
+ (i2) => i2 instanceof _ ? i2.handle : i2
4548
4567
  )));
4549
4568
  }
4550
4569
  /** @deprecated scheduled for removal from SDK */
4551
- getBlockLabel(e) {
4552
- return this.ctx.getBlockLabel(e);
4570
+ getBlockLabel(t) {
4571
+ return this.ctx.getBlockLabel(t);
4553
4572
  }
4554
4573
  getCurrentUnstableMarker() {
4555
4574
  if (!(typeof this.ctx.getCurrentUnstableMarker > "u"))
4556
4575
  return this.ctx.getCurrentUnstableMarker();
4557
4576
  }
4558
4577
  }
4559
- const F = "1.20.11";
4560
- function xe(t) {
4561
- return t.__renderLambda === true;
4578
+ const F = "1.20.24";
4579
+ function xt(e) {
4580
+ return e.__renderLambda === true;
4562
4581
  }
4563
- function U(t) {
4564
- if (t !== void 0)
4565
- return xe(t) ? t.handle : t;
4582
+ function U(e) {
4583
+ if (e !== void 0)
4584
+ return xt(e) ? e.handle : e;
4566
4585
  }
4567
4586
  class b {
4568
- constructor(e, n, s, i2, r, o, l) {
4569
- this._renderingMode = e, this._initialArgs = n, this._initialUiState = s, this._outputs = i2, this._inputsValid = r, this._sections = o, this._title = l;
4587
+ constructor(t, n, s, i2, r, o, l) {
4588
+ this._renderingMode = t, this._initialArgs = n, this._initialUiState = s, this._outputs = i2, this._inputsValid = r, this._sections = o, this._title = l;
4570
4589
  }
4571
- static create(e = "Heavy") {
4590
+ static create(t = "Heavy") {
4572
4591
  return new b(
4573
- e,
4592
+ t,
4574
4593
  void 0,
4575
4594
  {},
4576
4595
  {},
@@ -4579,16 +4598,16 @@
4579
4598
  void 0
4580
4599
  );
4581
4600
  }
4582
- output(e, n, s = {}) {
4601
+ output(t, n, s = {}) {
4583
4602
  if (typeof n == "function") {
4584
- const i2 = `output#${e}`;
4603
+ const i2 = `output#${t}`;
4585
4604
  return k(i2, () => n(new D())), new b(
4586
4605
  this._renderingMode,
4587
4606
  this._initialArgs,
4588
4607
  this._initialUiState,
4589
4608
  {
4590
4609
  ...this._outputs,
4591
- [e]: {
4610
+ [t]: {
4592
4611
  __renderLambda: true,
4593
4612
  handle: i2,
4594
4613
  ...s
@@ -4605,7 +4624,7 @@
4605
4624
  this._initialUiState,
4606
4625
  {
4607
4626
  ...this._outputs,
4608
- [e]: n
4627
+ [t]: n
4609
4628
  },
4610
4629
  this._inputsValid,
4611
4630
  this._sections,
@@ -4613,15 +4632,15 @@
4613
4632
  );
4614
4633
  }
4615
4634
  /** Shortcut for {@link output} with retentive flag set to true. */
4616
- retentiveOutput(e, n) {
4617
- return this.output(e, n, { retentive: true });
4635
+ retentiveOutput(t, n) {
4636
+ return this.output(t, n, { retentive: true });
4618
4637
  }
4619
4638
  /** @deprecated */
4620
- canRun(e) {
4621
- return this.inputsValid(e);
4639
+ canRun(t) {
4640
+ return this.inputsValid(t);
4622
4641
  }
4623
- argsValid(e) {
4624
- return typeof e == "function" ? (k("inputsValid", () => e(new D())), new b(
4642
+ argsValid(t) {
4643
+ return typeof t == "function" ? (k("inputsValid", () => t(new D())), new b(
4625
4644
  this._renderingMode,
4626
4645
  this._initialArgs,
4627
4646
  this._initialUiState,
@@ -4637,16 +4656,16 @@
4637
4656
  this._initialArgs,
4638
4657
  this._initialUiState,
4639
4658
  this._outputs,
4640
- e,
4659
+ t,
4641
4660
  this._sections,
4642
4661
  this._title
4643
4662
  );
4644
4663
  }
4645
- inputsValid(e) {
4646
- return this.argsValid(e);
4664
+ inputsValid(t) {
4665
+ return this.argsValid(t);
4647
4666
  }
4648
- sections(e) {
4649
- return Array.isArray(e) ? this.sections(L(e)) : typeof e == "function" ? (k("sections", () => e(new D())), new b(
4667
+ sections(t) {
4668
+ return Array.isArray(t) ? this.sections(L(t)) : typeof t == "function" ? (k("sections", () => t(new D())), new b(
4650
4669
  this._renderingMode,
4651
4670
  this._initialArgs,
4652
4671
  this._initialUiState,
@@ -4660,12 +4679,12 @@
4660
4679
  this._initialUiState,
4661
4680
  this._outputs,
4662
4681
  this._inputsValid,
4663
- e,
4682
+ t,
4664
4683
  this._title
4665
4684
  );
4666
4685
  }
4667
- title(e) {
4668
- return k("title", () => e(new D())), new b(
4686
+ title(t) {
4687
+ return k("title", () => t(new D())), new b(
4669
4688
  this._renderingMode,
4670
4689
  this._initialArgs,
4671
4690
  this._initialUiState,
@@ -4679,10 +4698,10 @@
4679
4698
  * Sets initial args for the block, this value must be specified.
4680
4699
  * @deprecated use {@link withArgs}
4681
4700
  * */
4682
- initialArgs(e) {
4701
+ initialArgs(t) {
4683
4702
  return new b(
4684
4703
  this._renderingMode,
4685
- e,
4704
+ t,
4686
4705
  this._initialUiState,
4687
4706
  this._outputs,
4688
4707
  this._inputsValid,
@@ -4691,10 +4710,10 @@
4691
4710
  );
4692
4711
  }
4693
4712
  /** Sets initial args for the block, this value must be specified. */
4694
- withArgs(e) {
4713
+ withArgs(t) {
4695
4714
  return new b(
4696
4715
  this._renderingMode,
4697
- e,
4716
+ t,
4698
4717
  this._initialUiState,
4699
4718
  this._outputs,
4700
4719
  this._inputsValid,
@@ -4703,11 +4722,11 @@
4703
4722
  );
4704
4723
  }
4705
4724
  /** Defines type and sets initial value for block UiState. */
4706
- withUiState(e) {
4725
+ withUiState(t) {
4707
4726
  return new b(
4708
4727
  this._renderingMode,
4709
4728
  this._initialArgs,
4710
- e,
4729
+ t,
4711
4730
  this._outputs,
4712
4731
  this._inputsValid,
4713
4732
  this._sections,
@@ -4719,7 +4738,7 @@
4719
4738
  * other features provided by the platforma to the block. */
4720
4739
  done() {
4721
4740
  if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
4722
- const e = {
4741
+ const t = {
4723
4742
  v3: {
4724
4743
  sdkVersion: F,
4725
4744
  renderingMode: this._renderingMode,
@@ -4740,26 +4759,26 @@
4740
4759
  Object.entries(this._outputs).map(([n, s]) => [n, U(s)])
4741
4760
  )
4742
4761
  };
4743
- return ve() ? ie({ sdkVersion: F }) : { config: e };
4762
+ return _t() ? it({ sdkVersion: F }) : { config: t };
4744
4763
  }
4745
4764
  }
4746
- function mt(t, e, n, s) {
4765
+ function me(e, t, n, s) {
4747
4766
  var l, d;
4748
- const i2 = t.resultPool.getData().entries.map((a) => a.obj).filter(U$1).filter((a) => a.spec.name === "pl7.app/label" && a.spec.axesSpec.length === 1), r = (a, p) => {
4767
+ const i2 = e.resultPool.getData().entries.map((a) => a.obj).filter(U$1).filter((a) => a.spec.name === "pl7.app/label" && a.spec.axesSpec.length === 1), r = (a, p) => {
4749
4768
  let g = a.toString();
4750
4769
  if (p)
4751
4770
  for (const c in p)
4752
4771
  g += c, g += p[c];
4753
4772
  return g;
4754
4773
  }, o = /* @__PURE__ */ new Map();
4755
- for (const a of e)
4774
+ for (const a of t)
4756
4775
  for (const p of a.spec.axesSpec) {
4757
4776
  const g = S$1(p);
4758
4777
  for (const c of i2) {
4759
4778
  const m = c.spec.axesSpec[0], h = S$1(c.spec.axesSpec[0]);
4760
4779
  if (M(g, h)) {
4761
- const A = Object.keys(g.domain ?? {}).length, y = Object.keys(h.domain ?? {}).length;
4762
- if (A > y) {
4780
+ const P = Object.keys(g.domain ?? {}).length, y = Object.keys(h.domain ?? {}).length;
4781
+ if (P > y) {
4763
4782
  const C = r(c.id, g.domain);
4764
4783
  o.set(C, {
4765
4784
  id: C,
@@ -4774,15 +4793,15 @@
4774
4793
  }
4775
4794
  }
4776
4795
  }
4777
- if (![...e, ...o.values()].some(
4778
- (a) => a.data instanceof v && !a.data.getIsReadyOrError()
4796
+ if (![...t, ...o.values()].some(
4797
+ (a) => a.data instanceof _ && !a.data.getIsReadyOrError()
4779
4798
  ))
4780
- return t.createPTable({
4799
+ return e.createPTable({
4781
4800
  src: {
4782
4801
  type: "outer",
4783
4802
  primary: {
4784
4803
  type: "full",
4785
- entries: e.map((a) => ({ type: "column", column: a }))
4804
+ entries: t.map((a) => ({ type: "column", column: a }))
4786
4805
  },
4787
4806
  secondary: [...o.values()].map((a) => ({ type: "column", column: a }))
4788
4807
  },
@@ -4799,7 +4818,7 @@
4799
4818
  }).output("pt", (ctx) => {
4800
4819
  var _a, _b, _c, _d, _e;
4801
4820
  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;
4802
- return mt(ctx, [
4821
+ return me(ctx, [
4803
4822
  {
4804
4823
  id: "example",
4805
4824
  spec: {
@@ -4846,6 +4865,7 @@
4846
4865
  { type: "link", href: "/text-fields", label: "PlTextField" },
4847
4866
  { type: "link", href: "/tabs", label: "PlTabs" },
4848
4867
  { type: "link", href: "/drafts", label: "Drafts" },
4868
+ { type: "link", href: "/stacked-bar", label: "PlChartStackedBar" },
4849
4869
  { type: "link", href: "/buttons", label: "ButtonsPage" },
4850
4870
  { type: "link", href: "/notifications", label: "Notifications" }
4851
4871
  ];