@platforma-open/milaboratories.generation-probability.block 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { r as __toESM, t as __commonJSMin } from "./rolldown-runtime-B-1-B7_t.js";
2
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/plugin_handle.js
2
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/plugin_handle.js
3
3
  const PLUGIN_OUTPUT_PREFIX = "plugin-output#";
4
4
  /** Construct the output key for a plugin output in the block outputs map. */
5
5
  function pluginOutputKey(handle, outputKey) {
6
6
  return `${PLUGIN_OUTPUT_PREFIX}${handle}#${outputKey}`;
7
7
  }
8
8
  //#endregion
9
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/block_storage.js
9
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/block_storage.js
10
10
  /**
11
11
  * Discriminator key for BlockStorage format detection.
12
12
  * This unique hash-based key identifies data as BlockStorage vs legacy formats.
@@ -3790,12 +3790,34 @@ ZodOptional.create;
3790
3790
  ZodNullable.create;
3791
3791
  ZodEffects.createWithPreprocess;
3792
3792
  ZodPipeline.create;
3793
+ const coerce = {
3794
+ string: ((arg) => ZodString.create({
3795
+ ...arg,
3796
+ coerce: true
3797
+ })),
3798
+ number: ((arg) => ZodNumber.create({
3799
+ ...arg,
3800
+ coerce: true
3801
+ })),
3802
+ boolean: ((arg) => ZodBoolean.create({
3803
+ ...arg,
3804
+ coerce: true
3805
+ })),
3806
+ bigint: ((arg) => ZodBigInt.create({
3807
+ ...arg,
3808
+ coerce: true
3809
+ })),
3810
+ date: ((arg) => ZodDate.create({
3811
+ ...arg,
3812
+ coerce: true
3813
+ }))
3814
+ };
3793
3815
  objectType({
3794
3816
  type: literalType("plain"),
3795
3817
  content: stringType()
3796
3818
  });
3797
3819
  //#endregion
3798
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/bmodel/block_kind_ref.js
3820
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/bmodel/block_kind_ref.js
3799
3821
  /**
3800
3822
  * Compose a {@link BlockKindReference} from a kind's `name`/`version`.
3801
3823
  *
@@ -3811,7 +3833,7 @@ objectType({
3811
3833
  to: numberType().min(1)
3812
3834
  });
3813
3835
  //#endregion
3814
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/util.js
3836
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/util.js
3815
3837
  function assertNever(x) {
3816
3838
  throw new Error("Unexpected object: " + x);
3817
3839
  }
@@ -3823,7 +3845,7 @@ function uniqueBy(array, makeId) {
3823
3845
  return [...new Map(array.map((e) => [makeId(e), e])).values()];
3824
3846
  }
3825
3847
  //#endregion
3826
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/data_info.js
3848
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/data_info.js
3827
3849
  /**
3828
3850
  * Type guard function that checks if the given value is a valid DataInfo.
3829
3851
  *
@@ -4014,7 +4036,7 @@ function entriesToDataInfo(dataInfoEntries) {
4014
4036
  }
4015
4037
  }
4016
4038
  //#endregion
4017
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/errors.js
4039
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/errors.js
4018
4040
  var ServiceError = class extends Error {
4019
4041
  name = "ServiceError";
4020
4042
  };
@@ -4038,7 +4060,7 @@ function ensureError(value) {
4038
4060
  return new Error(stringifyValue(value));
4039
4061
  }
4040
4062
  //#endregion
4041
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/json.js
4063
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/json.js
4042
4064
  var import_canonicalize = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
4043
4065
  module.exports = function serialize(object) {
4044
4066
  if (typeof object === "number" && isNaN(object)) throw new Error("NaN is not allowed");
@@ -4071,7 +4093,7 @@ function parseJsonSafely(value, fallback) {
4071
4093
  }
4072
4094
  }
4073
4095
  //#endregion
4074
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js
4096
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js
4075
4097
  function readMetadata(metadata, key) {
4076
4098
  return metadata?.[key];
4077
4099
  }
@@ -4093,6 +4115,36 @@ function readMetadataJson(metadata, metadataJson, key) {
4093
4115
  return;
4094
4116
  }
4095
4117
  }
4118
+ /**
4119
+ * Domain keys whose value is the id of a block, rather than a qualifier of the data.
4120
+ *
4121
+ * Applying a template repoints these at the blocks of the project being built: an axis a block
4122
+ * produced names that block in its domain, so an axis left naming the exported-from project
4123
+ * resolves to nothing. Listing the keys is what makes that safe — a template's entry ids are
4124
+ * arbitrary non-empty strings, so a hand-written template may name an entry `closest`, and a
4125
+ * qualifier that happens to read `closest` must not be mistaken for a reference to it.
4126
+ *
4127
+ * A key absent from here is simply left alone, which is the behaviour from before relocation
4128
+ * reached domains at all. Adding one is therefore safe; omitting one costs only that a template
4129
+ * carrying it applies still pointing at the project it came from.
4130
+ */
4131
+ const BlockScopedDomain = /* @__PURE__ */ new Set([
4132
+ "pl7.app/blockId",
4133
+ "pl7.app/block",
4134
+ "pl7.app/redefined-by",
4135
+ "pl7.app/annotationRunId",
4136
+ "pl7.app/clonotypeAnnotationRunId",
4137
+ "pl7.app/clustering/blockId",
4138
+ "pl7.app/umap/blockId",
4139
+ "pl7.app/peptide/extractionRunId",
4140
+ "pl7.app/repertoire/extractionRunId",
4141
+ "pl7.app/antibodyVariantDesigner/designRunId",
4142
+ "pl7.app/vdj/clonotypingRunId",
4143
+ "pl7.app/vdj/clustering/blockId",
4144
+ "pl7.app/vdj/integration/blockId",
4145
+ "pl7.app/vdj/spatiotemporalAnalysis/blockId",
4146
+ "pl7.app/vdj/libraryId"
4147
+ ]);
4096
4148
  const Annotation = {
4097
4149
  AxisNature: "pl7.app/axisNature",
4098
4150
  Alphabet: "pl7.app/alphabet",
@@ -4110,6 +4162,7 @@ const Annotation = {
4110
4162
  IsDenseAxis: "pl7.app/graph/isDenseAxis",
4111
4163
  IsVirtual: "pl7.app/graph/isVirtual",
4112
4164
  Palette: "pl7.app/graph/palette",
4165
+ Shape: "pl7.app/graph/shape",
4113
4166
  Thresholds: "pl7.app/graph/thresholds",
4114
4167
  TreatAbsentValuesAs: "pl7.app/graph/treatAbsentValuesAs"
4115
4168
  },
@@ -4165,9 +4218,14 @@ const AnnotationJson = {
4165
4218
  [Annotation.Graph.Axis.SymmetricRange]: booleanType(),
4166
4219
  [Annotation.Graph.IsDenseAxis]: booleanType(),
4167
4220
  [Annotation.Graph.Palette]: objectType({
4168
- mapping: recordType(numberType()),
4169
- name: stringType()
4221
+ name: stringType(),
4222
+ mapping: recordType(coerce.number()).optional(),
4223
+ midPoint: numberType().optional(),
4224
+ min: numberType().optional(),
4225
+ max: numberType().optional(),
4226
+ log: booleanType().optional()
4170
4227
  }),
4228
+ [Annotation.Graph.Shape]: objectType({ mapping: recordType(stringType()) }),
4171
4229
  [Annotation.Graph.Thresholds]: arrayType(objectType({
4172
4230
  columnId: objectType({
4173
4231
  valueType: ValueTypeSchema,
@@ -4363,7 +4421,7 @@ function matchAxisId(query, target) {
4363
4421
  return query.name === target.name && matchDomain$1(query.domain, target.domain) && matchDomain$1(query.contextDomain, target.contextDomain);
4364
4422
  }
4365
4423
  //#endregion
4366
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/query/utils.js
4424
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/query/utils.js
4367
4425
  const BOOLEAN_TYPES = /* @__PURE__ */ new Set([
4368
4426
  "numericComparison",
4369
4427
  "stringEquals",
@@ -4468,7 +4526,7 @@ function collectSpecQueryColumns(query) {
4468
4526
  return result;
4469
4527
  }
4470
4528
  //#endregion
4471
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/table_calculate.js
4529
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/table_calculate.js
4472
4530
  function mapPTableDef(def, cb) {
4473
4531
  return {
4474
4532
  ...def,
@@ -4511,7 +4569,7 @@ function mapJoinEntry(entry, cb) {
4511
4569
  }
4512
4570
  }
4513
4571
  //#endregion
4514
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/table_common.js
4572
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/table_common.js
4515
4573
  function getPTableColumnId(spec) {
4516
4574
  switch (spec.type) {
4517
4575
  case "axis": return {
@@ -4525,7 +4583,7 @@ function getPTableColumnId(spec) {
4525
4583
  }
4526
4584
  }
4527
4585
  //#endregion
4528
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/filtered_column.js
4586
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/filtered_column.js
4529
4587
  function stringifyColumnFilteredId(key) {
4530
4588
  return canonicalizeJson(createColumnFilteredKey(key));
4531
4589
  }
@@ -4558,7 +4616,7 @@ function applyAxisFilters(spec, axisFilters) {
4558
4616
  };
4559
4617
  }
4560
4618
  //#endregion
4561
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/pool/spec.js
4619
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/pool/spec.js
4562
4620
  function isPObjectId(value) {
4563
4621
  if (typeof value !== "string") return false;
4564
4622
  return isPObjectKey(parseJsonSafely(value));
@@ -4593,6 +4651,10 @@ function isGlobalPObjectKey(value) {
4593
4651
  if (typeof value !== "object" || value === null) return false;
4594
4652
  return "__isRef" in value && "blockId" in value && "name" in value;
4595
4653
  }
4654
+ function isGlobalPObjectId(value) {
4655
+ if (typeof value !== "string") return false;
4656
+ return isGlobalPObjectKey(parseJsonSafely(value));
4657
+ }
4596
4658
  function isPObject(obj) {
4597
4659
  return typeof obj === "object" && obj !== null && "id" in obj && "spec" in obj && "data" in obj;
4598
4660
  }
@@ -4668,7 +4730,7 @@ function isObject(value) {
4668
4730
  * isPlainObject([]); // false
4669
4731
  * ```
4670
4732
  */
4671
- function isPlainObject(value) {
4733
+ function isPlainObject$1(value) {
4672
4734
  if (!isObject(value)) return false;
4673
4735
  const prototype = Object.getPrototypeOf(value);
4674
4736
  return prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null;
@@ -4680,7 +4742,7 @@ function throwError(v) {
4680
4742
  else throw v;
4681
4743
  }
4682
4744
  //#endregion
4683
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/discovered_column.js
4745
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/discovered_column.js
4684
4746
  function isColumnDiscoveredKey(obj) {
4685
4747
  return typeof obj === "object" && obj !== null && "__isDiscovered" in obj;
4686
4748
  }
@@ -4820,6 +4882,56 @@ function getTag(value) {
4820
4882
  return Object.prototype.toString.call(value);
4821
4883
  }
4822
4884
  //#endregion
4885
+ //#region ../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
4886
+ /**
4887
+ * Checks if a given value is a plain object.
4888
+ *
4889
+ * @param value - The value to check.
4890
+ * @returns True if the value is a plain object, otherwise false.
4891
+ *
4892
+ * @example
4893
+ * ```typescript
4894
+ * // ✅👇 True
4895
+ *
4896
+ * isPlainObject({ }); // ✅
4897
+ * isPlainObject({ key: 'value' }); // ✅
4898
+ * isPlainObject({ key: new Date() }); // ✅
4899
+ * isPlainObject(new Object()); // ✅
4900
+ * isPlainObject(Object.create(null)); // ✅
4901
+ * isPlainObject({ nested: { key: true} }); // ✅
4902
+ * isPlainObject(new Proxy({}, {})); // ✅
4903
+ * isPlainObject({ [Symbol('tag')]: 'A' }); // ✅
4904
+ *
4905
+ * // ✅👇 (cross-realms, node context, workers, ...)
4906
+ * const runInNewContext = await import('node:vm').then(
4907
+ * (mod) => mod.runInNewContext
4908
+ * );
4909
+ * isPlainObject(runInNewContext('({})')); // ✅
4910
+ *
4911
+ * // ❌👇 False
4912
+ *
4913
+ * class Test { };
4914
+ * isPlainObject(new Test()) // ❌
4915
+ * isPlainObject(10); // ❌
4916
+ * isPlainObject(null); // ❌
4917
+ * isPlainObject('hello'); // ❌
4918
+ * isPlainObject([]); // ❌
4919
+ * isPlainObject(new Date()); // ❌
4920
+ * isPlainObject(new Uint8Array([1])); // ❌
4921
+ * isPlainObject(Buffer.from('ABC')); // ❌
4922
+ * isPlainObject(Promise.resolve({})); // ❌
4923
+ * isPlainObject(Object.create({})); // ❌
4924
+ * isPlainObject(new (class Cls {})); // ❌
4925
+ * isPlainObject(globalThis); // ❌,
4926
+ * ```
4927
+ */
4928
+ function isPlainObject(value) {
4929
+ if (!value || typeof value !== "object") return false;
4930
+ const proto = Object.getPrototypeOf(value);
4931
+ if (!(proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null)) return false;
4932
+ return Object.prototype.toString.call(value) === "[object Object]";
4933
+ }
4934
+ //#endregion
4823
4935
  //#region ../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/predicate/isFunction.mjs
4824
4936
  /**
4825
4937
  * Checks if `value` is a function.
@@ -4910,7 +5022,7 @@ function isString(value) {
4910
5022
  return typeof value === "string";
4911
5023
  }
4912
5024
  //#endregion
4913
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/ids.js
5025
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/ids.js
4914
5026
  /**
4915
5027
  * Canonically serializes a column key to a branded string id. Accepts both
4916
5028
  * the new {@link ColumnUniversalKey} and the deprecated {@link UniversalPColumnId}
@@ -5088,7 +5200,7 @@ function extractPObjectId(id) {
5088
5200
  throw new Error(`extractPObjectId: unrecognized column id structure: ${JSON.stringify(id)}`);
5089
5201
  }
5090
5202
  //#endregion
5091
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/overridden.js
5203
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/overridden.js
5092
5204
  function isColumnOverriddenKey(obj) {
5093
5205
  return typeof obj === "object" && obj !== null && "__isOverridden" in obj;
5094
5206
  }
@@ -5210,7 +5322,7 @@ function mergeRecord(a, b) {
5210
5322
  };
5211
5323
  }
5212
5324
  //#endregion
5213
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/anchored.js
5325
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/anchored.js
5214
5326
  function axisKey(axis) {
5215
5327
  return (0, import_canonicalize.default)(getAxisId(axis));
5216
5328
  }
@@ -5456,7 +5568,7 @@ function isAnchorAxisRef(value) {
5456
5568
  return typeof value === "object" && "anchor" in value;
5457
5569
  }
5458
5570
  //#endregion
5459
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/selectors.js
5571
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/selectors.js
5460
5572
  /**
5461
5573
  * Determines if an axis ID matches an axis selector.
5462
5574
  *
@@ -5536,8 +5648,53 @@ function legacyColumnSelectorsToPredicate(predicateOrSelectors) {
5536
5648
  if (Array.isArray(predicateOrSelectors)) return (spec) => predicateOrSelectors.some((selector) => isPColumnSpec(spec) && matchPColumn(spec, selector));
5537
5649
  else return (spec) => isPColumnSpec(spec) && matchPColumn(spec, predicateOrSelectors);
5538
5650
  }
5651
+ function matchString(matcher, value) {
5652
+ return matcher.type === "exact" ? value === matcher.value : new RegExp(matcher.value).test(value);
5653
+ }
5654
+ function matchMatcherMap(map, target) {
5655
+ const t = target ?? {};
5656
+ for (const [key, matchers] of Object.entries(map)) {
5657
+ const v = t[key];
5658
+ if (v === void 0) return false;
5659
+ if (!matchers.some((m) => matchString(m, v))) return false;
5660
+ }
5661
+ return true;
5662
+ }
5663
+ function matchMultiAxis(selector, axis) {
5664
+ if (selector.type !== void 0 && !selector.type.includes(axis.type)) return false;
5665
+ if (selector.name !== void 0 && !selector.name.some((m) => matchString(m, axis.name))) return false;
5666
+ if (selector.domain !== void 0 && !matchMatcherMap(selector.domain, axis.domain)) return false;
5667
+ if (selector.contextDomain !== void 0 && !matchMatcherMap(selector.contextDomain, axis.contextDomain)) return false;
5668
+ return true;
5669
+ }
5670
+ /** Match a {@link PColumnSpec} against a {@link MultiColumnSelector}. */
5671
+ function matchMultiColumnSelector(spec, selector) {
5672
+ if (selector.type !== void 0 && !selector.type.includes(spec.valueType)) return false;
5673
+ if (selector.name !== void 0 && !selector.name.some((m) => matchString(m, spec.name))) return false;
5674
+ if (selector.domain !== void 0 && !matchMatcherMap(selector.domain, spec.domain)) return false;
5675
+ if (selector.contextDomain !== void 0 && !matchMatcherMap(selector.contextDomain, spec.contextDomain)) return false;
5676
+ if (selector.annotations !== void 0 && !matchMatcherMap(selector.annotations, spec.annotations)) return false;
5677
+ if (selector.axes !== void 0) {
5678
+ const columnAxes = spec.axesSpec.map(getAxisId);
5679
+ if (selector.partialAxesMatch ?? true) {
5680
+ for (const axisSelector of selector.axes) if (!columnAxes.some((axis) => matchMultiAxis(axisSelector, axis))) return false;
5681
+ } else {
5682
+ if (columnAxes.length !== selector.axes.length) return false;
5683
+ for (let i = 0; i < selector.axes.length; i++) if (!matchMultiAxis(selector.axes[i], columnAxes[i])) return false;
5684
+ }
5685
+ }
5686
+ return true;
5687
+ }
5688
+ /**
5689
+ * Convert a {@link MultiColumnSelector} (or array; selectors OR-ed) to a predicate.
5690
+ * Non-PColumn specs always return false.
5691
+ */
5692
+ function multiColumnSelectorsToPredicate(selectors) {
5693
+ const arr = Array.isArray(selectors) ? selectors : [selectors];
5694
+ return (spec) => isPColumnSpec(spec) && arr.some((sel) => matchMultiColumnSelector(spec, sel));
5695
+ }
5539
5696
  //#endregion
5540
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/native_id.js
5697
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/native_id.js
5541
5698
  function deriveNativeId(spec) {
5542
5699
  const result = {
5543
5700
  kind: spec.kind,
@@ -5549,7 +5706,7 @@ function deriveNativeId(spec) {
5549
5706
  return (0, import_canonicalize.default)(result);
5550
5707
  }
5551
5708
  //#endregion
5552
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/linker_columns.js
5709
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/linker_columns.js
5553
5710
  var LinkerMap = class LinkerMap {
5554
5711
  /** Graph of linkers connected by axes (single or grouped by parents) */
5555
5712
  data;
@@ -5727,7 +5884,7 @@ var LinkerMap = class LinkerMap {
5727
5884
  }
5728
5885
  };
5729
5886
  //#endregion
5730
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/flags/block_flags.js
5887
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/flags/block_flags.js
5731
5888
  /**
5732
5889
  * Required PFrames version. Bump this in lockstep with the `@milaboratories/pframes-rs-*`
5733
5890
  * version in `pnpm-workspace.yaml` so blocks built against the new SDK refuse to load on
@@ -5769,8 +5926,21 @@ function withEnrichments(ref, requireEnrichments = true) {
5769
5926
  return rest;
5770
5927
  }
5771
5928
  }
5929
+ function createEnrichmentRef(hit, options = {}) {
5930
+ const { path, qualifications } = options;
5931
+ return {
5932
+ __isEnrichment: "v1",
5933
+ hit,
5934
+ ...path !== void 0 && path.length > 0 ? { path } : {},
5935
+ ...qualifications !== void 0 && qualifications.length > 0 ? { qualifications } : {}
5936
+ };
5937
+ }
5938
+ /** Compare two PlRefs and returns true if they are qual */
5939
+ function plRefsEqual(ref1, ref2, ignoreEnrichments = false) {
5940
+ return ref1.blockId === ref2.blockId && ref1.name === ref2.name && (ignoreEnrichments || ref1.requireEnrichments === ref2.requireEnrichments);
5941
+ }
5772
5942
  //#endregion
5773
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/value_or_error.js
5943
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/value_or_error.js
5774
5944
  function mapValueInVOE(voe, cb) {
5775
5945
  return voe.ok ? {
5776
5946
  ok: true,
@@ -5778,7 +5948,7 @@ function mapValueInVOE(voe, cb) {
5778
5948
  } : voe;
5779
5949
  }
5780
5950
  //#endregion
5781
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/resource_types.js
5951
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/resource_types.js
5782
5952
  /** Well-known resource type names used across the platform. */
5783
5953
  const ResourceTypeName = {
5784
5954
  StreamManager: "StreamManager",
@@ -5822,7 +5992,7 @@ const ResourceTypeName = {
5822
5992
  SharedEnvelope: "SharedEnvelope"
5823
5993
  };
5824
5994
  //#endregion
5825
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/services/service_types.js
5995
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/services/service_types.js
5826
5996
  const SERVICE_ID_PATTERN = /^[a-zA-Z][a-zA-Z0-9]*$/;
5827
5997
  const { service, isNodeService, isWasmService, isMainService, getServiceKind, getServiceModelMethods, getServiceUiMethods } = (() => {
5828
5998
  const typeMap = /* @__PURE__ */ new Map();
@@ -5861,7 +6031,7 @@ const { service, isNodeService, isWasmService, isMainService, getServiceKind, ge
5861
6031
  };
5862
6032
  })();
5863
6033
  //#endregion
5864
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/services/service_declarations.js
6034
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/services/service_declarations.js
5865
6035
  const Services = {
5866
6036
  PFrameSpec: service()({
5867
6037
  type: "wasm",
@@ -5955,7 +6125,7 @@ function resolveRequiredServices(flags) {
5955
6125
  }
5956
6126
  Object.fromEntries(Object.keys(Services).map((key) => [`requires${key}`, true]));
5957
6127
  //#endregion
5958
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/services/service_injectors.js
6128
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/services/service_injectors.js
5959
6129
  function buildMethodMap(pick) {
5960
6130
  const result = {};
5961
6131
  for (const id of Object.values(Services)) result[id] = [...pick(id)];
@@ -5964,7 +6134,7 @@ function buildMethodMap(pick) {
5964
6134
  buildMethodMap(getServiceUiMethods);
5965
6135
  buildMethodMap(getServiceModelMethods);
5966
6136
  //#endregion
5967
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/columns/accessor_traversal.js
6137
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/columns/accessor_traversal.js
5968
6138
  /** Resource types that hold column collections — DFS stops here and collects. */
5969
6139
  const COLLECT_TYPES = [ResourceTypeName.PFrame];
5970
6140
  /** Resource types DFS descends through when looking for PFrames. */
@@ -6072,7 +6242,7 @@ function indexPoolBlock(block) {
6072
6242
  return result;
6073
6243
  }
6074
6244
  //#endregion
6075
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/columns/column_registry.js
6245
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/columns/column_registry.js
6076
6246
  /**
6077
6247
  * Id-index over a set of {@link ColumnEntriesProvider}s. Sole job:
6078
6248
  * {@link PObjectId} → {@link LeafEntry}. Generic over the accessor flavour, so
@@ -6109,7 +6279,7 @@ var ColumnRegistry = class {
6109
6279
  }
6110
6280
  };
6111
6281
  //#endregion
6112
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/columns/dedup.js
6282
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/columns/dedup.js
6113
6283
  /**
6114
6284
  * Two-track dedup over an item stream keyed by `ColumnUniversalId`:
6115
6285
  *
@@ -6150,7 +6320,7 @@ function dedupColumns(items, getId, getSpec) {
6150
6320
  return out;
6151
6321
  }
6152
6322
  //#endregion
6153
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/columns/providers.js
6323
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/columns/providers.js
6154
6324
  /**
6155
6325
  * Generic entries provider over a single accessor root. Walks `<root>` once
6156
6326
  * from the supplied `rootPath`, builds an id → {@link LeafEntry} map and
@@ -6207,7 +6377,7 @@ var ResultPoolEntriesProvider = class {
6207
6377
  }
6208
6378
  };
6209
6379
  //#endregion
6210
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/template/template_ref_form.js
6380
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/template/template_ref_form.js
6211
6381
  /**
6212
6382
  * Whether `value` is a reference in the readable spelling.
6213
6383
  *
@@ -6276,7 +6446,7 @@ function expandTemplatePlRef(ref) {
6276
6446
  };
6277
6447
  }
6278
6448
  //#endregion
6279
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.48.0/node_modules/@milaboratories/pl-model-common/dist/template/template_relocate.js
6449
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.51.0/node_modules/@milaboratories/pl-model-common/dist/template/template_relocate.js
6280
6450
  /**
6281
6451
  * Point every column identifier in a block's params at the blocks of the project being built.
6282
6452
  *
@@ -6292,8 +6462,13 @@ function expandTemplatePlRef(ref) {
6292
6462
  *
6293
6463
  * Rewriting is structural, never textual: an identifier is taken apart, its `blockId` fields
6294
6464
  * are replaced, and it is rebuilt canonically. That is what keeps a value that merely *looks*
6295
- * like an id — a `domain` entry, an axis filter — from being rewritten along with it, and
6296
- * what re-sorts a qualifications map whose keys are identifiers.
6465
+ * like an id — an axis filter, a domain this package can see belongs to an identifier it
6466
+ * knows — from being rewritten along with it, and what re-sorts a qualifications map whose
6467
+ * keys are identifiers.
6468
+ *
6469
+ * A domain reached on its own is the exception, and `relocateDomain` below says why: an axis is
6470
+ * qualified by the block that produced it. Only the domain keys known to name a block are
6471
+ * repointed — matching an entry id is not on its own evidence of a reference.
6297
6472
  *
6298
6473
  * An id the map does not mention is left as it is. That is the ordering rule doing its work:
6299
6474
  * a caller building the map as it creates blocks passes only the entries already created, so
@@ -6311,13 +6486,27 @@ function relocateBlockIds(params, blockIds) {
6311
6486
  if (typeof node === "string") return remapColumnIdBlockIds(node, remapBlockId);
6312
6487
  if (isColumnUniversalKey(node)) return remapColumnIdBlockIds(node, remapBlockId);
6313
6488
  if (Array.isArray(node)) return node.map(walk);
6314
- if (typeof node === "object" && node !== null) return Object.fromEntries(Object.entries(node).map(([key, value]) => [remapColumnIdBlockIds(key, remapBlockId), walk(value)]));
6489
+ if (typeof node === "object" && node !== null) return Object.fromEntries(Object.entries(node).map(([key, value]) => [remapColumnIdBlockIds(key, remapBlockId), key === "domain" && isPlainObject(value) ? relocateDomain(value) : walk(value)]));
6315
6490
  return node;
6316
6491
  };
6492
+ /**
6493
+ * The block-naming entries of a domain, repointed at the project being built: an axis a block
6494
+ * produced names that block in its domain, so those are references like any other.
6495
+ *
6496
+ * Only the keys {@link BlockScopedDomain} lists, because a template's entry ids are arbitrary
6497
+ * non-empty strings — a hand-written template may name an entry `closest`, and a qualifier
6498
+ * reading `closest` is not a reference to it. Matching the map is not on its own enough to
6499
+ * tell one from the other; the key is.
6500
+ *
6501
+ * Reached only from the generic object case — inside an identifier this package recognizes a
6502
+ * domain is spec data and stays as it is, which is what keeps an overridden column's
6503
+ * `specOverrides.domain` untouched.
6504
+ */
6505
+ const relocateDomain = (domain) => Object.fromEntries(Object.entries(domain).map(([key, value]) => [key, typeof value === "string" && BlockScopedDomain.has(key) ? remapBlockId(value) : walk(value)]));
6317
6506
  return walk(params);
6318
6507
  }
6319
6508
  //#endregion
6320
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/block_migrations.js
6509
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/block_migrations.js
6321
6510
  /** Create a DataVersioned wrapper with correct shape */
6322
6511
  function makeVersionedData(version, data) {
6323
6512
  return {
@@ -6895,7 +7084,7 @@ var DataModel = class DataModel {
6895
7084
  }
6896
7085
  };
6897
7086
  //#endregion
6898
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/internal.js
7087
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/internal.js
6899
7088
  /** Utility code helping to identify whether the code is running in actual UI environment */
6900
7089
  function isInUI() {
6901
7090
  return typeof globalThis.getPlatforma !== "undefined" || typeof globalThis.platforma !== "undefined";
@@ -6965,7 +7154,7 @@ function registerFutureAwait(handle, onResolve) {
6965
7154
  futureResolves.get(handle).push(onResolve);
6966
7155
  }
6967
7156
  //#endregion
6968
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/block_storage_facade.js
7157
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/block_storage_facade.js
6969
7158
  /**
6970
7159
  * All facade callback names as constants.
6971
7160
  * These are the source of truth - the interface is derived from these.
@@ -7003,7 +7192,7 @@ function registerFacadeCallbacks(callbacks) {
7003
7192
  for (const key of Object.values(BlockStorageFacadeCallbacks)) tryRegisterCallback(key, callbacks[key]);
7004
7193
  }
7005
7194
  //#endregion
7006
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/services/block_services.js
7195
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/services/block_services.js
7007
7196
  /**
7008
7197
  * Services required by all V3 blocks by default.
7009
7198
  * Edit this when a new service should be available to all blocks.
@@ -7019,7 +7208,7 @@ const BLOCK_SERVICE_FLAGS = {
7019
7208
  };
7020
7209
  resolveRequiredServices(BLOCK_SERVICE_FLAGS);
7021
7210
  //#endregion
7022
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/render/future.js
7211
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/render/future.js
7023
7212
  var FutureRef = class FutureRef {
7024
7213
  handle;
7025
7214
  postProcess;
@@ -7047,7 +7236,7 @@ var FutureRef = class FutureRef {
7047
7236
  }
7048
7237
  };
7049
7238
  //#endregion
7050
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/render/accessor.js
7239
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/render/accessor.js
7051
7240
  function ifDef(value, cb) {
7052
7241
  return value === void 0 ? void 0 : cb(value);
7053
7242
  }
@@ -7297,11 +7486,11 @@ var TreeNodeAccessor = class TreeNodeAccessor {
7297
7486
  }
7298
7487
  };
7299
7488
  //#endregion
7300
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/render/internal.js
7489
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/render/internal.js
7301
7490
  const MainAccessorName = "main";
7302
7491
  const StagingAccessorName = "staging";
7303
7492
  //#endregion
7304
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/render/util/axis_filtering.js
7493
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/render/util/axis_filtering.js
7305
7494
  function filterDataInfoEntries(dataInfoEntries, axisFilters) {
7306
7495
  const sortedFilters = [...axisFilters].sort((a, b) => b[0] - a[0]);
7307
7496
  const { type } = dataInfoEntries;
@@ -7365,7 +7554,7 @@ function filterDataInfoEntries(dataInfoEntries, axisFilters) {
7365
7554
  }
7366
7555
  }
7367
7556
  //#endregion
7368
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/labels/linked_column_postfix.js
7557
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/labels/linked_column_postfix.js
7369
7558
  /**
7370
7559
  * Structural postfix derivation for linked columns (phase 2 of `deriveDistinctLabels`).
7371
7560
  *
@@ -7548,7 +7737,7 @@ function derivePostfixes(entries, format = defaultLinkerFormatter) {
7548
7737
  });
7549
7738
  }
7550
7739
  //#endregion
7551
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/labels/derive_distinct_labels.js
7740
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/labels/derive_distinct_labels.js
7552
7741
  const DISTANCE_PENALTY = .001;
7553
7742
  const LABEL_TYPE = "__LABEL__";
7554
7743
  const LABEL_TYPE_FULL = "__LABEL__@1";
@@ -7836,7 +8025,7 @@ function repairBareByPresence(labels, minimized, records, stats, forcedSet, forc
7836
8025
  return patched;
7837
8026
  }
7838
8027
  //#endregion
7839
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/render/util/label.js
8028
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/render/util/label.js
7840
8029
  /** @deprecated Use deriveDistinctLabels */
7841
8030
  function deriveLabels(values, getSpec, options = {}) {
7842
8031
  return deriveDistinctLabels(values.map(getSpec), options).map((label, i) => ({
@@ -7845,7 +8034,7 @@ function deriveLabels(values, getSpec, options = {}) {
7845
8034
  }));
7846
8035
  }
7847
8036
  //#endregion
7848
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/render/util/pcolumn_data.js
8037
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/render/util/pcolumn_data.js
7849
8038
  const RT_RESOURCE_MAP = "PColumnData/ResourceMap";
7850
8039
  const RT_RESOURCE_MAP_PARTITIONED = "PColumnData/Partitioned/ResourceMap";
7851
8040
  const RT_JSON_PARTITIONED = "PColumnData/JsonPartitioned";
@@ -8143,7 +8332,7 @@ function allPColumnsReady(columns) {
8143
8332
  return columns.every(isPColumnReady);
8144
8333
  }
8145
8334
  //#endregion
8146
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/render/util/column_collection.js
8335
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/render/util/column_collection.js
8147
8336
  function isPColumnValues(value) {
8148
8337
  if (!Array.isArray(value)) return false;
8149
8338
  if (value.length === 0) return true;
@@ -8421,7 +8610,7 @@ var PColumnCollection = class {
8421
8610
  }
8422
8611
  };
8423
8612
  //#endregion
8424
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/services/service_bridge.js
8613
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/services/service_bridge.js
8425
8614
  /**
8426
8615
  * Builds a ServiceProxy from a ServiceDispatch.
8427
8616
  * Each service method call is forwarded to dispatch.callServiceMethod.
@@ -8430,7 +8619,7 @@ function createServiceProxy(dispatch) {
8430
8619
  return ((serviceId) => Object.freeze(Object.fromEntries(dispatch.getServiceMethods(serviceId).map((method) => [method, (...args) => dispatch.callServiceMethod(serviceId, method, ...args)]))));
8431
8620
  }
8432
8621
  //#endregion
8433
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/services/get_services.js
8622
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/services/get_services.js
8434
8623
  const cachedServices = /* @__PURE__ */ new WeakMap();
8435
8624
  function getService(name, deps) {
8436
8625
  const ctx = deps?.ctx ?? getCfgRenderCtx();
@@ -8444,7 +8633,7 @@ function getService(name, deps) {
8444
8633
  })();
8445
8634
  }
8446
8635
  //#endregion
8447
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/render/util/pframe_upgraders.js
8636
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/render/util/pframe_upgraders.js
8448
8637
  function patchInSetFilters(filters) {
8449
8638
  const inSetToOrEqual = (predicate) => {
8450
8639
  if (predicate.operator !== "InSet") return predicate;
@@ -8482,7 +8671,7 @@ function patchInSetFilters(filters) {
8482
8671
  return filters.map((filter) => mapFilter(filter, inSetToOrEqual));
8483
8672
  }
8484
8673
  //#endregion
8485
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/render/api.js
8674
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/render/api.js
8486
8675
  /**
8487
8676
  * Helper function to match domain objects
8488
8677
  * @param query Optional domain to match against
@@ -8931,27 +9120,27 @@ var PluginRenderCtx = class extends RenderCtxBase {
8931
9120
  }
8932
9121
  };
8933
9122
  //#endregion
8934
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/plugin_model.js
9123
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/plugin_model.js
8935
9124
  /** Internal plugin↔block handshake. `Symbol.for` (not `Symbol`) so it stays
8936
9125
  * identical across multiple `@platforma-sdk/model` copies in one process. */
8937
9126
  const CREATE_PLUGIN_MODEL = Symbol.for("@platforma-sdk/model:createPluginModel");
8938
9127
  //#endregion
8939
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/version.js
8940
- const PlatformaSDKVersion = "1.83.0";
9128
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/version.js
9129
+ const PlatformaSDKVersion = "1.84.3";
8941
9130
  //#endregion
8942
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/bconfig/types.js
9131
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/bconfig/types.js
8943
9132
  function isConfigLambda(cfgOrFh) {
8944
9133
  return cfgOrFh.__renderLambda === true;
8945
9134
  }
8946
9135
  //#endregion
8947
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/bconfig/normalization.js
9136
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/bconfig/normalization.js
8948
9137
  function downgradeCfgOrLambda(data) {
8949
9138
  if (data === void 0) return void 0;
8950
9139
  if (isConfigLambda(data)) return data.handle;
8951
9140
  return data;
8952
9141
  }
8953
9142
  //#endregion
8954
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/block_storage_callbacks.js
9143
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/block_storage_callbacks.js
8955
9144
  /**
8956
9145
  * BlockStorage Callback Implementations - wired to facade callbacks in BlockModelV3.done().
8957
9146
  *
@@ -9305,7 +9494,7 @@ function deriveTemplateParamsFromStorage(storageJson, deriveTemplateParams) {
9305
9494
  }
9306
9495
  }
9307
9496
  //#endregion
9308
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/block_model.js
9497
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/block_model.js
9309
9498
  /**
9310
9499
  * Merges two feature flag objects with type-aware logic:
9311
9500
  * - `supports*` (boolean): OR — `true` if either side is `true`
@@ -9671,7 +9860,7 @@ var BlockModelV3 = class BlockModelV3 {
9671
9860
  }
9672
9861
  };
9673
9862
  //#endregion
9674
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/pframe_utils/axes.js
9863
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/pframe_utils/axes.js
9675
9864
  /** Create id for column copy with added keys in axes domains */
9676
9865
  const colId = (id, domains, contextDomains) => {
9677
9866
  let wid = id.toString();
@@ -9777,7 +9966,7 @@ function getAdditionalColumnsForColumn(blockAxes, column) {
9777
9966
  })];
9778
9967
  }
9779
9968
  //#endregion
9780
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/columns/column_recipes/leaf_rebrand.js
9969
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/columns/column_recipes/leaf_rebrand.js
9781
9970
  /**
9782
9971
  * Replace every column leaf whose id equals `fromId` with `toId`, leaving
9783
9972
  * other column refs (linkers, sub-anchors) intact. Wrapper recipes
@@ -10445,7 +10634,7 @@ var U = class d {
10445
10634
  }
10446
10635
  };
10447
10636
  //#endregion
10448
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/columns/column_providers/providers.js
10637
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/columns/column_providers/providers.js
10449
10638
  /**
10450
10639
  * Unified memoised factory dispatching to the right provider flavour by the
10451
10640
  * source shape:
@@ -10534,7 +10723,7 @@ function hashRawPool(rawPool) {
10534
10723
  return rawPool.map((b) => `${b.blockId}\x1f${b.prodCtx ?? ""}\x1f${b.stagingCtx ?? ""}\x1f${b.prodIncomplete ? 1 : 0}\x1f${b.stagingIncomplete ? 1 : 0}`).join("");
10535
10724
  }
10536
10725
  //#endregion
10537
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/columns/column_providers/index.js
10726
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/columns/column_providers/index.js
10538
10727
  /**
10539
10728
  * Build the default set of ColumnsProviders for the ambient render ctx:
10540
10729
  * - `AccessorColumnsProvider` over `outputs` (if present)
@@ -10569,7 +10758,7 @@ function isColumnProvider(source) {
10569
10758
  return typeof p.getColumns === "function" && typeof p.isFinal === "function";
10570
10759
  }
10571
10760
  //#endregion
10572
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/columns/data_column.js
10761
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/columns/data_column.js
10573
10762
  /**
10574
10763
  * Thrown by leaf-recipe factories when the requested column is provably
10575
10764
  * absent in the active render ctx — i.e. every relevant accessor reports
@@ -10809,7 +10998,7 @@ function memoizeByEntry(fn) {
10809
10998
  };
10810
10999
  }
10811
11000
  //#endregion
10812
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/columns/column_recipes/column_overrided_recipe.js
11001
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/columns/column_recipes/column_overrided_recipe.js
10813
11002
  /**
10814
11003
  * Recipe wrapper that overlays {@link SpecOverrides} on top of any other
10815
11004
  * recipe. The id is `ColumnOverriddenKey { source: inner.id, specOverrides }`.
@@ -10947,7 +11136,7 @@ var DataColumnOverriddenRecipe = class extends ColumnOverriddenRecipe {
10947
11136
  }
10948
11137
  };
10949
11138
  //#endregion
10950
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/columns/column_recipes/column_filtered_recipe.js
11139
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/columns/column_recipes/column_filtered_recipe.js
10951
11140
  /**
10952
11141
  * Recipe wrapper that fixes the values of selected axes of an inner recipe
10953
11142
  * (axis slicing). The id is `FilteredPColumnId { source: inner.id,
@@ -11073,7 +11262,7 @@ function toAxisSelector(axis) {
11073
11262
  return selector;
11074
11263
  }
11075
11264
  //#endregion
11076
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/columns/column_recipes/index.js
11265
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/columns/column_recipes/index.js
11077
11266
  /**
11078
11267
  * Build a `ColumnRecipe` from a stringified id. Dispatches to the matching
11079
11268
  * concrete recipe variant based on the id's encoding and recurses on
@@ -11124,7 +11313,7 @@ function ColumnRecipeGetStatus(id, opts = {}) {
11124
11313
  }
11125
11314
  const ColumnRecipe = Object.assign(ColumnRecipeBuild, { getStatus: ColumnRecipeGetStatus });
11126
11315
  //#endregion
11127
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/columns/column_recipes/column_discovered_recipe.js
11316
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/columns/column_recipes/column_discovered_recipe.js
11128
11317
  /**
11129
11318
  * Recipe for columns identified by a {@link ColumnDiscoveredKey}: a base
11130
11319
  * column + a `path` of linkers + qualifications.
@@ -11295,7 +11484,7 @@ function referencedUniIdsOf(key) {
11295
11484
  return /* @__PURE__ */ new Set([key.column, ...(key.path ?? []).map((item) => item.column)]);
11296
11485
  }
11297
11486
  //#endregion
11298
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/columns/column.js
11487
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/columns/column.js
11299
11488
  /**
11300
11489
  * Unified entry point — routes between the two top-level dispatchers:
11301
11490
  * - string id (`PObjectId` / `ColumnUniversalId`) → {@link ColumnRecipe}
@@ -11309,7 +11498,7 @@ function Column(source, opts) {
11309
11498
  return DataColumn(source, opts);
11310
11499
  }
11311
11500
  //#endregion
11312
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/columns/columns_collection.js
11501
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/columns/columns_collection.js
11313
11502
  /**
11314
11503
  * Build a {@link ColumnsCollection} from sandbox-side source descriptors.
11315
11504
  * Resolves the `columnsCollection` driver (either from `deps.driver` or via
@@ -11421,7 +11610,7 @@ function defaultCtxSources(ctx) {
11421
11610
  return [...currentBlockSources(ctx), { kind: "result_pool" }];
11422
11611
  }
11423
11612
  //#endregion
11424
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/columns/utils.js
11613
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/columns/utils.js
11425
11614
  /**
11426
11615
  * PObjectIds of every non-hit column referenced by `recipe.getQuery()`,
11427
11616
  * deduped in traversal order. The hit column is
@@ -11568,7 +11757,7 @@ function deriveColumnOptions(source, labelOptions = {}) {
11568
11757
  }));
11569
11758
  }
11570
11759
  //#endregion
11571
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/pframe_utils/columns.js
11760
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/pframe_utils/columns.js
11572
11761
  function getAllRelatedColumns(ctx, predicate) {
11573
11762
  const columns = new PColumnCollection();
11574
11763
  columns.addColumnProvider(ctx.resultPool);
@@ -11644,7 +11833,7 @@ function discoverIntegrableColumnIds(ctx, rootColumns) {
11644
11833
  }
11645
11834
  }
11646
11835
  //#endregion
11647
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/components/PFrameForGraphs.js
11836
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/components/PFrameForGraphs.js
11648
11837
  function isHiddenFromGraphColumn(column) {
11649
11838
  return !!readAnnotationJson(column, Annotation.HideDataFromGraphs);
11650
11839
  }
@@ -11673,7 +11862,169 @@ function createPFrameForGraphs(ctx, blockColumns) {
11673
11862
  }));
11674
11863
  }
11675
11864
  //#endregion
11676
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/filters/traverse.js
11865
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/components/PlDatasetSelector/filter_discovery.js
11866
+ /**
11867
+ * Matches columns annotated `pl7.app/isSubset: "true"` whose axes ⊆ anchor axes.
11868
+ *
11869
+ * Filter-intent: only the dataset's own direct subset columns, no linker
11870
+ * traversal — so this uses `.filter()` (pins `maxHops: 0`), not `.discover()`
11871
+ * (which would default to 4 hops and surface subset columns from other,
11872
+ * linker-reachable datasets). `.filter()` still applies the default
11873
+ * `enrichment` matching mode (`allowFloatingHitAxes: false`), which enforces
11874
+ * the axes-subset constraint. See `matchingModeToConstraints()`.
11875
+ */
11876
+ function findFilterColumns(options) {
11877
+ return ColumnsCollection([...options.sources], { driver: options.driver }).filter({
11878
+ anchors: { main: options.anchorSpec },
11879
+ include: { annotations: { [Annotation.IsSubset]: "true" } }
11880
+ }).getColumns();
11881
+ }
11882
+ /**
11883
+ * Derive labeled options from filter column variants, for use in DatasetOption.filters.
11884
+ *
11885
+ * Entries whose column id has no PlRef in `refsByObjectId` are silently
11886
+ * skipped — they cannot be exposed as user-selectable options.
11887
+ */
11888
+ function filterMatchesToOptions(variants, options) {
11889
+ if (variants.length === 0) return [];
11890
+ const { refsByObjectId, datasetSpec, labelOptions } = options;
11891
+ const entries = variants.flatMap((variant) => {
11892
+ const ref = refsByObjectId.get(extractPObjectId(variant.id));
11893
+ if (ref === void 0) return [];
11894
+ return [{
11895
+ ref,
11896
+ spec: variant.getSpec(),
11897
+ linkerPath: collectLinkerColumns(variant).map((linker) => ({ spec: linker.getSpec() }))
11898
+ }];
11899
+ });
11900
+ const labels = deriveDistinctLabels([...entries, { spec: datasetSpec }], {
11901
+ ...labelOptions,
11902
+ formatters: {
11903
+ ...labelOptions?.formatters,
11904
+ native: () => void 0
11905
+ }
11906
+ });
11907
+ return entries.map(({ ref }, i) => ({
11908
+ ref,
11909
+ label: labels[i]
11910
+ }));
11911
+ }
11912
+ /** Build the `refsByObjectId` map from `ctx.resultPool.getSpecs().entries`. */
11913
+ function buildRefMap(entries) {
11914
+ return new Map(entries.map((e) => [(0, import_canonicalize.default)(e.ref), e.ref]));
11915
+ }
11916
+ //#endregion
11917
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/components/PlDatasetSelector/enrichment_discovery.js
11918
+ /**
11919
+ * Linker-reached hits attached to the anchor primary. Drops zero-hop variants
11920
+ * (filters / the primary itself) and structural hits (subset, linker, label
11921
+ * columns). Narrow further with `include` selectors or a `predicate`.
11922
+ */
11923
+ function findEnrichmentColumns(options) {
11924
+ const include = options.include === void 0 ? void 0 : Array.isArray(options.include) ? options.include : [options.include];
11925
+ const columns = ColumnsCollection([...options.sources], { driver: options.driver }).discover({
11926
+ anchors: { main: options.anchorSpec },
11927
+ mode: "enrichment",
11928
+ maxHops: options.maxHops ?? 4,
11929
+ include,
11930
+ exclude: [
11931
+ { annotations: { [Annotation.IsSubset]: "true" } },
11932
+ { annotations: { [Annotation.IsLinkerColumn]: "true" } },
11933
+ { name: Annotation.Label }
11934
+ ]
11935
+ }).getColumns();
11936
+ const predicate = options.predicate;
11937
+ return columns.filter((v) => {
11938
+ if (hasSingleDataColumn(v)) return false;
11939
+ if (predicate !== void 0 && !predicate(v.getSpec())) return false;
11940
+ if (!isGlobalPObjectId(extractPObjectId(v.id))) return false;
11941
+ if (collectLinkerIds(v).some((id) => !isGlobalPObjectId(id))) return false;
11942
+ return true;
11943
+ });
11944
+ }
11945
+ /**
11946
+ * Pair each variant with a path-disambiguated label (so export headers stay
11947
+ * unique) and carry hit/linker `PObjectId`s through verbatim. Propagates
11948
+ * `qualifications.forHit`; `forQueries` is re-derived by the table builder.
11949
+ */
11950
+ function enrichmentVariantsToRefs(variants, labelOptions) {
11951
+ if (variants.length === 0) return [];
11952
+ const linkerIdsByVariant = variants.map((v) => collectLinkerIds(v));
11953
+ const hitQualsByVariant = variants.map((v) => [...hitQualifications(v)]);
11954
+ const labels = deriveDistinctLabels(variants.map((variant, i) => ({
11955
+ spec: variant.getSpec(),
11956
+ linkerPath: collectLinkerColumns(variant).map((linker) => ({ spec: linker.getSpec() })),
11957
+ qualifications: {
11958
+ forHit: hitQualsByVariant[i],
11959
+ forQueries: queriesQualifications(variant)
11960
+ }
11961
+ })), labelOptions);
11962
+ return variants.map((variant, i) => {
11963
+ const path = linkerIdsByVariant[i].length === 0 ? void 0 : linkerIdsByVariant[i].map((id) => ({
11964
+ type: "linker",
11965
+ linker: id
11966
+ }));
11967
+ return {
11968
+ ref: createEnrichmentRef(extractPObjectId(variant.id), {
11969
+ path,
11970
+ qualifications: hitQualsByVariant[i]
11971
+ }),
11972
+ label: labels[i]
11973
+ };
11974
+ });
11975
+ }
11976
+ //#endregion
11977
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/components/PlDatasetSelector/build_dataset_options.js
11978
+ function toPredicate(opt) {
11979
+ if (opt === void 0) return () => true;
11980
+ return typeof opt === "function" ? opt : multiColumnSelectorsToPredicate(opt);
11981
+ }
11982
+ /**
11983
+ * Usage:
11984
+ * ```ts
11985
+ * .output("datasetOptions", (ctx) => buildDatasetOptions(ctx))
11986
+ * ```
11987
+ */
11988
+ function buildDatasetOptions(ctx, opts) {
11989
+ const primaryPredicate = toPredicate(opts?.primary);
11990
+ const filterPredicate = toPredicate(opts?.filter);
11991
+ const options = ctx.resultPool.getOptions(primaryPredicate, { refsWithEnrichments: true });
11992
+ if (options.length === 0) return [];
11993
+ const refMap = buildRefMap(ctx.resultPool.getSpecs().entries);
11994
+ const withEnrichments = opts?.withEnrichments ?? false;
11995
+ const filterSource = ColumnsProvider(ctx.ctx.getUpstreamBlockCtx());
11996
+ const enrichmentSources = withEnrichments ? getCtxProviders(ctx) : void 0;
11997
+ return options.map((primary) => {
11998
+ const datasetSpec = ctx.resultPool.getPColumnSpecByRef(primary.ref);
11999
+ if (!datasetSpec) return { primary };
12000
+ const filterMatches = findFilterColumns({
12001
+ sources: [filterSource],
12002
+ anchorSpec: datasetSpec
12003
+ }).filter((m) => filterPredicate(m.getSpec()));
12004
+ const filters = filterMatches.length === 0 ? void 0 : filterMatchesToOptions(filterMatches, {
12005
+ refsByObjectId: refMap,
12006
+ datasetSpec,
12007
+ labelOptions: opts?.labelOptions
12008
+ });
12009
+ let enrichments;
12010
+ if (enrichmentSources && withEnrichments) {
12011
+ const enrichmentVariants = findEnrichmentColumns({
12012
+ sources: enrichmentSources,
12013
+ anchorSpec: datasetSpec,
12014
+ maxHops: opts?.enrichmentMaxHops,
12015
+ ...typeof withEnrichments === "function" ? { predicate: withEnrichments } : { include: withEnrichments }
12016
+ });
12017
+ if (enrichmentVariants.length > 0) enrichments = enrichmentVariantsToRefs(enrichmentVariants, opts?.labelOptions);
12018
+ }
12019
+ return {
12020
+ primary,
12021
+ ...filters !== void 0 && filters.length > 0 ? { filters } : {},
12022
+ ...enrichments !== void 0 && enrichments.length > 0 ? { enrichments } : {}
12023
+ };
12024
+ });
12025
+ }
12026
+ //#endregion
12027
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/filters/traverse.js
11677
12028
  /**
11678
12029
  * Recursively traverses a FilterSpec tree bottom-up, applying visitor callbacks.
11679
12030
  *
@@ -11712,7 +12063,7 @@ function collectFilterSpecColumns(filter) {
11712
12063
  });
11713
12064
  }
11714
12065
  //#endregion
11715
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/filters/converters/filterToQuery.js
12066
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/filters/converters/filterToQuery.js
11716
12067
  /** Converts a QueryColumnId object into a SpecQueryExpression reference. */
11717
12068
  function resolveColumnRef(col) {
11718
12069
  return col.type === "axis" ? {
@@ -12099,7 +12450,7 @@ function isEmpty(value) {
12099
12450
  return true;
12100
12451
  }
12101
12452
  //#endregion
12102
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/filters/distill.js
12453
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/filters/distill.js
12103
12454
  /**
12104
12455
  * Strips non-FilterSpec metadata (whitelist approach) and removes
12105
12456
  * unfilled leaves (type is undefined or any required field is undefined).
@@ -12204,7 +12555,7 @@ const REQUIRED_KEYS_BY_TYPE = {
12204
12555
  greaterThanColumnOrEqual: ["column", "rhs"]
12205
12556
  };
12206
12557
  //#endregion
12207
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/components/PlDataTable/state-migration.js
12558
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/components/PlDataTable/state-migration.js
12208
12559
  /** Upgrade PlDataTableStateV2 to the latest version */
12209
12560
  function upgradePlDataTableStateV2(state) {
12210
12561
  if (!state) return createPlDataTableStateV2();
@@ -12562,7 +12913,7 @@ function parseLegacyLeafColumn(s) {
12562
12913
  return parsed;
12563
12914
  }
12564
12915
  //#endregion
12565
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/utils.js
12916
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/utils.js
12566
12917
  /** Adapt a {@link ColumnRecipe} to the plain {@link RuleColumn} shape. */
12567
12918
  function toRuleColumn(col) {
12568
12919
  return {
@@ -12660,7 +13011,7 @@ function deriveAllLabels(options) {
12660
13011
  })), deriveLabelsOptions).reduce((acc, label, index) => (acc[columns[index].id] = label, acc), {});
12661
13012
  }
12662
13013
  //#endregion
12663
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/createPTableDefV3.js
13014
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/createPTableDefV3.js
12664
13015
  /**
12665
13016
  * Assemble a ptable def directly from recipes. Each secondary recipe is its own
12666
13017
  * outer-joined subtree: `getQuery()` encodes its linker chain, and its
@@ -12724,8 +13075,8 @@ function columnToJoinEntry(col, qualifications) {
12724
13075
  };
12725
13076
  }
12726
13077
  //#endregion
12727
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/components/PlDataTable/columnResolver.js
12728
- function createColumnResolver(columns, deps) {
13078
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/components/PlDataTable/columnResolver.js
13079
+ function createColumnResolver(columns) {
12729
13080
  const axisIds = [];
12730
13081
  for (const c of columns) for (const ax of c.getSpec().axesSpec) axisIds.push(getAxisId(ax));
12731
13082
  const byFullId = /* @__PURE__ */ new Map();
@@ -12733,9 +13084,7 @@ function createColumnResolver(columns, deps) {
12733
13084
  for (const c of columns) {
12734
13085
  byFullId.set(c.id, c);
12735
13086
  const pid = extractPObjectId(c.id);
12736
- const existing = byPObjectId.get(pid);
12737
- if (existing === void 0) byPObjectId.set(pid, c);
12738
- else if (existing.id !== c.id) deps?.warn?.(`Ambiguous PObjectId ${pid}: recipe ids ${existing.id} and ${c.id} both match — keeping first.`);
13087
+ if (!byPObjectId.has(pid)) byPObjectId.set(pid, c);
12739
13088
  }
12740
13089
  return (ref) => {
12741
13090
  if (ref.type === "axis") return axisIds.some((a) => matchAxisId(ref.id, a)) ? ref : void 0;
@@ -12748,7 +13097,7 @@ function createColumnResolver(columns, deps) {
12748
13097
  };
12749
13098
  }
12750
13099
  //#endregion
12751
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/discoverColumns.js
13100
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/discoverColumns.js
12752
13101
  /**
12753
13102
  * Discover columns from sources/anchors and split them into primary
12754
13103
  * (direct anchor hits — zero-hop, query is a bare column) and secondary
@@ -12794,7 +13143,7 @@ function discoverLabelColumns(ctx, primary) {
12794
13143
  }).getColumns();
12795
13144
  }
12796
13145
  //#endregion
12797
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.83.0/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.js
13146
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.84.3/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.js
12798
13147
  function createPlDataTableV3(ctx, options) {
12799
13148
  const state = upgradePlDataTableStateV2(options.tableState);
12800
13149
  const primaryJoinType = options.primaryJoinType ?? "full";
@@ -12822,7 +13171,7 @@ function createPlDataTableV3(ctx, options) {
12822
13171
  ...primary,
12823
13172
  ...direct,
12824
13173
  ...linked.flatMap((lc) => [...collectLinkerColumns(lc), lc])
12825
- ], { warn: ctx.logWarn.bind(ctx) });
13174
+ ]);
12826
13175
  const remapedDefaultFilters = remapFilterColumnIds(options.filters, resolver);
12827
13176
  const filters = filterFilters(concatFilters(state.pTableParams.filters, state.pTableParams.defaultFilters ?? remapedDefaultFilters), resolver);
12828
13177
  const sorting = filterSorting(resolveSorting(state.pTableParams.sorting, remapSortingColumnIds(options.sorting, resolver)), resolver);
@@ -12901,7 +13250,7 @@ function resolveInputColumns(ctx, options) {
12901
13250
  secondary: dedupColumns([...secondary, ...labels].filter((c) => !primaryIds.has(c.id)), (c) => c.id, (c) => c.getSpec())
12902
13251
  };
12903
13252
  }
12904
- if (isPlainObject(options.columns)) return discoverTableColumns(ctx, options.columns);
13253
+ if (isPlainObject$1(options.columns)) return discoverTableColumns(ctx, options.columns);
12905
13254
  }
12906
13255
  /** Split secondary recipes by query topology: leaves (no linker chain) vs joined. */
12907
13256
  function splitByTopology(columns) {
@@ -13159,7 +13508,7 @@ const ErrorShape = objectType({
13159
13508
  //#endregion
13160
13509
  //#region ../kind/dist/package.js
13161
13510
  var name = "@platforma-open/milaboratories.generation-probability.kind";
13162
- var version = "1.0.0";
13511
+ var version = "1.1.0";
13163
13512
  //#endregion
13164
13513
  //#region ../node_modules/.pnpm/@platforma-sdk+block-kind@1.1.0/node_modules/@platforma-sdk/block-kind/dist/params.js
13165
13514
  /**
@@ -13263,11 +13612,20 @@ const SPECIES_VALUES = SPECIES_OPTIONS.map((option) => option.value);
13263
13612
  /** The same contract at runtime, for params arriving from a template file rather than typed code. */
13264
13613
  function parseInitializationParams(value) {
13265
13614
  assertParamsObject(value);
13266
- const { inputAnchor, species } = value;
13267
- if (inputAnchor !== void 0 && !isColumnUniversalId(inputAnchor)) throw new Error("'inputAnchor' must be a column id.");
13615
+ const { datasetRef, filterRef, inputAnchor, species } = value;
13616
+ if (datasetRef !== void 0 && !isPlRef(datasetRef)) throw new Error("'datasetRef' must be a reference to an upstream column.");
13617
+ if (filterRef !== void 0 && !isPlRef(filterRef)) throw new Error("'filterRef' must be a reference to an upstream column.");
13618
+ let legacyDatasetRef;
13619
+ if (inputAnchor !== void 0) {
13620
+ if (!isColumnUniversalId(inputAnchor)) throw new Error("'inputAnchor' must be a column id.");
13621
+ const parsed = JSON.parse(inputAnchor);
13622
+ if (!isPlRef(parsed)) throw new Error("'inputAnchor' must be the id of an upstream column.");
13623
+ legacyDatasetRef = parsed;
13624
+ }
13268
13625
  if (species !== void 0 && !SPECIES_VALUES.includes(species)) throw new Error(`'species' must be one of: ${SPECIES_VALUES.join(", ")}.`);
13269
13626
  return {
13270
- inputAnchor,
13627
+ datasetRef: datasetRef ?? legacyDatasetRef,
13628
+ filterRef,
13271
13629
  species
13272
13630
  };
13273
13631
  }
@@ -13284,6 +13642,13 @@ const exactly = (value) => ({
13284
13642
  type: "exact",
13285
13643
  value
13286
13644
  });
13645
+ const defaultDistributionGraphState = () => ({
13646
+ title: "Generation Probability",
13647
+ template: "bins",
13648
+ currentTab: null,
13649
+ layersSettings: { bins: { fillColor: "#99E099" } },
13650
+ axesSettings: { axisY: { scale: "log" } }
13651
+ });
13287
13652
  const ENTITY_KEY_NAMES = [
13288
13653
  "pl7.app/vdj/clonotypeKey",
13289
13654
  "pl7.app/vdj/scClonotypeKey",
@@ -13293,34 +13658,54 @@ const inputSelectors = ENTITY_KEY_NAMES.map((name) => ({
13293
13658
  axes: [{ name }],
13294
13659
  annotations: { "pl7.app/isAnchor": "true" }
13295
13660
  }));
13661
+ /**
13662
+ * A result-pool column id is the canonical JSON of its PlRef, so the two convert both ways.
13663
+ * The id form is what the workflow reads (`args.inputAnchor`) and what v1 stored, so keeping
13664
+ * it byte-identical keeps existing blocks' args unchanged.
13665
+ */
13666
+ function plRefFromColumnId(id) {
13667
+ if (id === void 0) return void 0;
13668
+ try {
13669
+ const parsed = JSON.parse(id);
13670
+ return isPlRef(parsed) ? parsed : void 0;
13671
+ } catch {
13672
+ return;
13673
+ }
13674
+ }
13675
+ const columnIdFromPlRef = (ref) => JSON.stringify({
13676
+ __isRef: true,
13677
+ blockId: ref.blockId,
13678
+ name: ref.name
13679
+ });
13296
13680
  const keyAxisOf = (spec) => spec.axesSpec.find((axis) => ENTITY_KEY_NAMES.includes(axis.name));
13297
- const dataModel = new DataModelBuilder({ kind }).from("v1").init(({ params }) => ({
13298
- inputAnchor: params?.inputAnchor,
13681
+ const dataModel = new DataModelBuilder({ kind }).from("v1").migrate("v2", ({ inputAnchor, graphStateHistogram, distributionGraphState, ...rest }) => ({
13682
+ ...rest,
13683
+ datasetRef: plRefFromColumnId(inputAnchor),
13684
+ distributionGraphState: distributionGraphState ?? graphStateHistogram ?? defaultDistributionGraphState()
13685
+ })).init(({ params }) => ({
13686
+ datasetRef: params?.datasetRef,
13687
+ filterRef: params?.filterRef,
13299
13688
  species: params?.species,
13300
13689
  datasetLabel: "",
13301
13690
  tableState: createPlDataTableStateV2(),
13302
- distributionGraphState: {
13303
- title: "Generation Probability",
13304
- template: "bins",
13305
- currentTab: null,
13306
- layersSettings: { bins: { fillColor: "#99E099" } },
13307
- axesSettings: { axisY: { scale: "log" } }
13308
- }
13691
+ distributionGraphState: defaultDistributionGraphState()
13309
13692
  }));
13310
13693
  const platforma$1 = BlockModelV3.create({
13311
13694
  dataModel,
13312
13695
  kind
13313
13696
  }).args((data) => {
13314
- if (data.inputAnchor == null) throw new Error("Input dataset is required");
13697
+ if (data.datasetRef == null) throw new Error("Input dataset is required");
13315
13698
  if (data.species == null) throw new Error("Species is required");
13316
13699
  return {
13317
- inputAnchor: data.inputAnchor,
13318
- species: data.species
13700
+ inputAnchor: columnIdFromPlRef(data.datasetRef),
13701
+ species: data.species,
13702
+ ...data.filterRef !== void 0 && { inputFilter: columnIdFromPlRef(data.filterRef) }
13319
13703
  };
13320
13704
  }).templateParams((data) => ({
13321
- inputAnchor: data.inputAnchor,
13705
+ datasetRef: data.datasetRef,
13706
+ filterRef: data.filterRef,
13322
13707
  species: data.species
13323
- })).output("inputOptions", () => {
13708
+ })).output("inputOptions", (ctx) => {
13324
13709
  const collection = ColumnsCollection(["result_pool"]).filter({ include: inputSelectors });
13325
13710
  const scorable = collection.getColumns().filter((anchor) => {
13326
13711
  const spec = anchor.getSpec();
@@ -13334,13 +13719,26 @@ const platforma$1 = BlockModelV3.create({
13334
13719
  }).isEmpty();
13335
13720
  });
13336
13721
  if (scorable.length === 0) return [];
13722
+ const withFilters = buildDatasetOptions(ctx, {
13723
+ primary: (spec) => isPColumnSpec(spec) && spec.annotations?.["pl7.app/isAnchor"] === "true" && keyAxisOf(spec) !== void 0,
13724
+ filter: (spec) => isPColumnSpec(spec) && spec.axesSpec.length === 1 && ENTITY_KEY_NAMES.includes(spec.axesSpec[0]?.name ?? "")
13725
+ }) ?? [];
13337
13726
  return deriveColumnOptions([{
13338
13727
  columns: scorable,
13339
13728
  isFinal: collection.isFinal()
13340
- }]).map(({ id, label }) => ({
13341
- value: id,
13342
- label
13343
- }));
13729
+ }]).flatMap(({ id, label }) => {
13730
+ const ref = plRefFromColumnId(id);
13731
+ if (ref === void 0) return [];
13732
+ const primary = {
13733
+ ref,
13734
+ label
13735
+ };
13736
+ const filters = withFilters.find((o) => plRefsEqual(o.primary.ref, ref, true))?.filters;
13737
+ return [filters === void 0 ? { primary } : {
13738
+ primary,
13739
+ filters
13740
+ }];
13741
+ });
13344
13742
  }).outputWithStatus("pgenTable", (ctx) => {
13345
13743
  const pgenOutput = ctx.outputs?.resolve("pgenPf");
13346
13744
  if (pgenOutput === void 0) return void 0;