@platforma-open/milaboratories.repertoire-diversity-2.model 1.1.2 → 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/.turbo/turbo-build.log +15 -15
- package/CHANGELOG.md +12 -0
- package/dist/bundle.js +889 -691
- package/dist/bundle.js.map +1 -1
- package/dist/index.cjs +27 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +28 -7
- package/dist/index.js.map +1 -1
- package/dist/model.json +1 -1
- package/package.json +4 -4
- package/src/index.ts +32 -11
package/dist/bundle.js
CHANGED
|
@@ -2,48 +2,6 @@
|
|
|
2
2
|
typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.model = {}));
|
|
3
3
|
})(this, function(exports2) {
|
|
4
4
|
"use strict";
|
|
5
|
-
function getDefaultExportFromCjs(x2) {
|
|
6
|
-
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
7
|
-
}
|
|
8
|
-
var canonicalize;
|
|
9
|
-
var hasRequiredCanonicalize;
|
|
10
|
-
function requireCanonicalize() {
|
|
11
|
-
if (hasRequiredCanonicalize) return canonicalize;
|
|
12
|
-
hasRequiredCanonicalize = 1;
|
|
13
|
-
canonicalize = function serialize(object) {
|
|
14
|
-
if (typeof object === "number" && isNaN(object)) {
|
|
15
|
-
throw new Error("NaN is not allowed");
|
|
16
|
-
}
|
|
17
|
-
if (typeof object === "number" && !isFinite(object)) {
|
|
18
|
-
throw new Error("Infinity is not allowed");
|
|
19
|
-
}
|
|
20
|
-
if (object === null || typeof object !== "object") {
|
|
21
|
-
return JSON.stringify(object);
|
|
22
|
-
}
|
|
23
|
-
if (object.toJSON instanceof Function) {
|
|
24
|
-
return serialize(object.toJSON());
|
|
25
|
-
}
|
|
26
|
-
if (Array.isArray(object)) {
|
|
27
|
-
const values2 = object.reduce((t, cv, ci) => {
|
|
28
|
-
const comma = ci === 0 ? "" : ",";
|
|
29
|
-
const value = cv === void 0 || typeof cv === "symbol" ? null : cv;
|
|
30
|
-
return `${t}${comma}${serialize(value)}`;
|
|
31
|
-
}, "");
|
|
32
|
-
return `[${values2}]`;
|
|
33
|
-
}
|
|
34
|
-
const values = Object.keys(object).sort().reduce((t, cv) => {
|
|
35
|
-
if (object[cv] === void 0 || typeof object[cv] === "symbol") {
|
|
36
|
-
return t;
|
|
37
|
-
}
|
|
38
|
-
const comma = t.length === 0 ? "" : ",";
|
|
39
|
-
return `${t}${comma}${serialize(cv)}:${serialize(object[cv])}`;
|
|
40
|
-
}, "");
|
|
41
|
-
return `{${values}}`;
|
|
42
|
-
};
|
|
43
|
-
return canonicalize;
|
|
44
|
-
}
|
|
45
|
-
var canonicalizeExports = requireCanonicalize();
|
|
46
|
-
const Pe = /* @__PURE__ */ getDefaultExportFromCjs(canonicalizeExports);
|
|
47
5
|
var util;
|
|
48
6
|
(function(util2) {
|
|
49
7
|
util2.assertEqual = (val) => val;
|
|
@@ -433,7 +391,7 @@
|
|
|
433
391
|
overrideMap,
|
|
434
392
|
overrideMap === errorMap ? void 0 : errorMap
|
|
435
393
|
// then global default map
|
|
436
|
-
].filter((
|
|
394
|
+
].filter((x) => !!x)
|
|
437
395
|
});
|
|
438
396
|
ctx.common.issues.push(issue);
|
|
439
397
|
}
|
|
@@ -496,10 +454,10 @@
|
|
|
496
454
|
});
|
|
497
455
|
const DIRTY = (value) => ({ status: "dirty", value });
|
|
498
456
|
const OK = (value) => ({ status: "valid", value });
|
|
499
|
-
const isAborted = (
|
|
500
|
-
const isDirty = (
|
|
501
|
-
const isValid = (
|
|
502
|
-
const isAsync = (
|
|
457
|
+
const isAborted = (x) => x.status === "aborted";
|
|
458
|
+
const isDirty = (x) => x.status === "dirty";
|
|
459
|
+
const isValid = (x) => x.status === "valid";
|
|
460
|
+
const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
503
461
|
function __classPrivateFieldGet(receiver, state, kind, f2) {
|
|
504
462
|
if (typeof state === "function" ? receiver !== state || true : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
505
463
|
return state.get(receiver);
|
|
@@ -2829,7 +2787,7 @@
|
|
|
2829
2787
|
if (!schema)
|
|
2830
2788
|
return null;
|
|
2831
2789
|
return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
|
|
2832
|
-
}).filter((
|
|
2790
|
+
}).filter((x) => !!x);
|
|
2833
2791
|
if (ctx.common.async) {
|
|
2834
2792
|
return Promise.all(items).then((results) => {
|
|
2835
2793
|
return ParseStatus.mergeArray(status, results);
|
|
@@ -3087,7 +3045,7 @@
|
|
|
3087
3045
|
ctx.schemaErrorMap,
|
|
3088
3046
|
getErrorMap(),
|
|
3089
3047
|
errorMap
|
|
3090
|
-
].filter((
|
|
3048
|
+
].filter((x) => !!x),
|
|
3091
3049
|
issueData: {
|
|
3092
3050
|
code: ZodIssueCode.invalid_arguments,
|
|
3093
3051
|
argumentsError: error
|
|
@@ -3103,7 +3061,7 @@
|
|
|
3103
3061
|
ctx.schemaErrorMap,
|
|
3104
3062
|
getErrorMap(),
|
|
3105
3063
|
errorMap
|
|
3106
|
-
].filter((
|
|
3064
|
+
].filter((x) => !!x),
|
|
3107
3065
|
issueData: {
|
|
3108
3066
|
code: ZodIssueCode.invalid_return_type,
|
|
3109
3067
|
returnTypeError: error
|
|
@@ -3113,29 +3071,29 @@
|
|
|
3113
3071
|
const params = { errorMap: ctx.common.contextualErrorMap };
|
|
3114
3072
|
const fn2 = ctx.data;
|
|
3115
3073
|
if (this._def.returns instanceof ZodPromise) {
|
|
3116
|
-
const
|
|
3074
|
+
const me2 = this;
|
|
3117
3075
|
return OK(async function(...args) {
|
|
3118
3076
|
const error = new ZodError([]);
|
|
3119
|
-
const parsedArgs = await
|
|
3077
|
+
const parsedArgs = await me2._def.args.parseAsync(args, params).catch((e) => {
|
|
3120
3078
|
error.addIssue(makeArgsIssue(args, e));
|
|
3121
3079
|
throw error;
|
|
3122
3080
|
});
|
|
3123
3081
|
const result = await Reflect.apply(fn2, this, parsedArgs);
|
|
3124
|
-
const parsedReturns = await
|
|
3082
|
+
const parsedReturns = await me2._def.returns._def.type.parseAsync(result, params).catch((e) => {
|
|
3125
3083
|
error.addIssue(makeReturnsIssue(result, e));
|
|
3126
3084
|
throw error;
|
|
3127
3085
|
});
|
|
3128
3086
|
return parsedReturns;
|
|
3129
3087
|
});
|
|
3130
3088
|
} else {
|
|
3131
|
-
const
|
|
3089
|
+
const me2 = this;
|
|
3132
3090
|
return OK(function(...args) {
|
|
3133
|
-
const parsedArgs =
|
|
3091
|
+
const parsedArgs = me2._def.args.safeParse(args, params);
|
|
3134
3092
|
if (!parsedArgs.success) {
|
|
3135
3093
|
throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
|
|
3136
3094
|
}
|
|
3137
3095
|
const result = Reflect.apply(fn2, this, parsedArgs.data);
|
|
3138
|
-
const parsedReturns =
|
|
3096
|
+
const parsedReturns = me2._def.returns.safeParse(result, params);
|
|
3139
3097
|
if (!parsedReturns.success) {
|
|
3140
3098
|
throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
|
|
3141
3099
|
}
|
|
@@ -3956,221 +3914,280 @@
|
|
|
3956
3914
|
quotelessJson,
|
|
3957
3915
|
ZodError
|
|
3958
3916
|
});
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3917
|
+
function getDefaultExportFromCjs(x) {
|
|
3918
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
3919
|
+
}
|
|
3920
|
+
var canonicalize;
|
|
3921
|
+
var hasRequiredCanonicalize;
|
|
3922
|
+
function requireCanonicalize() {
|
|
3923
|
+
if (hasRequiredCanonicalize) return canonicalize;
|
|
3924
|
+
hasRequiredCanonicalize = 1;
|
|
3925
|
+
canonicalize = function serialize(object) {
|
|
3926
|
+
if (typeof object === "number" && isNaN(object)) {
|
|
3927
|
+
throw new Error("NaN is not allowed");
|
|
3928
|
+
}
|
|
3929
|
+
if (typeof object === "number" && !isFinite(object)) {
|
|
3930
|
+
throw new Error("Infinity is not allowed");
|
|
3931
|
+
}
|
|
3932
|
+
if (object === null || typeof object !== "object") {
|
|
3933
|
+
return JSON.stringify(object);
|
|
3934
|
+
}
|
|
3935
|
+
if (object.toJSON instanceof Function) {
|
|
3936
|
+
return serialize(object.toJSON());
|
|
3937
|
+
}
|
|
3938
|
+
if (Array.isArray(object)) {
|
|
3939
|
+
const values2 = object.reduce((t, cv, ci) => {
|
|
3940
|
+
const comma = ci === 0 ? "" : ",";
|
|
3941
|
+
const value = cv === void 0 || typeof cv === "symbol" ? null : cv;
|
|
3942
|
+
return `${t}${comma}${serialize(value)}`;
|
|
3943
|
+
}, "");
|
|
3944
|
+
return `[${values2}]`;
|
|
3945
|
+
}
|
|
3946
|
+
const values = Object.keys(object).sort().reduce((t, cv) => {
|
|
3947
|
+
if (object[cv] === void 0 || typeof object[cv] === "symbol") {
|
|
3948
|
+
return t;
|
|
3949
|
+
}
|
|
3950
|
+
const comma = t.length === 0 ? "" : ",";
|
|
3951
|
+
return `${t}${comma}${serialize(cv)}:${serialize(object[cv])}`;
|
|
3952
|
+
}, "");
|
|
3953
|
+
return `{${values}}`;
|
|
3954
|
+
};
|
|
3955
|
+
return canonicalize;
|
|
3956
|
+
}
|
|
3957
|
+
var canonicalizeExports = requireCanonicalize();
|
|
3958
|
+
const ke = /* @__PURE__ */ getDefaultExportFromCjs(canonicalizeExports);
|
|
3959
|
+
var B$1 = Object.defineProperty;
|
|
3960
|
+
var j = (n2, e, t) => e in n2 ? B$1(n2, e, { enumerable: true, configurable: true, writable: true, value: t }) : n2[e] = t;
|
|
3961
|
+
var l$1 = (n2, e, t) => j(n2, typeof e != "symbol" ? e + "" : e, t);
|
|
3962
|
+
z$1.object({
|
|
3963
|
+
/** Included left border. */
|
|
3964
|
+
from: z$1.number(),
|
|
3965
|
+
/** Excluded right border. */
|
|
3966
|
+
to: z$1.number()
|
|
3967
|
+
});
|
|
3962
3968
|
function w(n2) {
|
|
3963
3969
|
throw new Error("Unexpected object: " + n2);
|
|
3964
3970
|
}
|
|
3965
|
-
function
|
|
3971
|
+
function En(n2) {
|
|
3966
3972
|
if (!n2 || typeof n2 != "object")
|
|
3967
3973
|
return false;
|
|
3968
|
-
const
|
|
3969
|
-
if (!("type" in
|
|
3974
|
+
const e = n2;
|
|
3975
|
+
if (!("type" in e))
|
|
3970
3976
|
return false;
|
|
3971
|
-
switch (
|
|
3977
|
+
switch (e.type) {
|
|
3972
3978
|
case "Json":
|
|
3973
|
-
return typeof
|
|
3979
|
+
return typeof e.keyLength == "number" && e.data !== void 0 && typeof e.data == "object";
|
|
3974
3980
|
case "JsonPartitioned":
|
|
3975
|
-
return typeof
|
|
3981
|
+
return typeof e.partitionKeyLength == "number" && e.parts !== void 0 && typeof e.parts == "object";
|
|
3976
3982
|
case "BinaryPartitioned":
|
|
3977
|
-
return typeof
|
|
3983
|
+
return typeof e.partitionKeyLength == "number" && e.parts !== void 0 && typeof e.parts == "object";
|
|
3978
3984
|
default:
|
|
3979
3985
|
return false;
|
|
3980
3986
|
}
|
|
3981
3987
|
}
|
|
3982
|
-
function
|
|
3988
|
+
function Nn(n2, e) {
|
|
3983
3989
|
if (n2 !== void 0)
|
|
3984
3990
|
switch (n2.type) {
|
|
3985
3991
|
case "Json":
|
|
3986
3992
|
return n2;
|
|
3987
3993
|
case "JsonPartitioned": {
|
|
3988
|
-
const
|
|
3994
|
+
const t = {};
|
|
3989
3995
|
for (const [r, o] of Object.entries(n2.parts))
|
|
3990
|
-
|
|
3996
|
+
t[r] = e(o);
|
|
3991
3997
|
return {
|
|
3992
3998
|
...n2,
|
|
3993
|
-
parts:
|
|
3999
|
+
parts: t
|
|
3994
4000
|
};
|
|
3995
4001
|
}
|
|
3996
4002
|
case "BinaryPartitioned": {
|
|
3997
|
-
const
|
|
4003
|
+
const t = {};
|
|
3998
4004
|
for (const [r, o] of Object.entries(n2.parts))
|
|
3999
|
-
|
|
4000
|
-
index:
|
|
4001
|
-
values:
|
|
4005
|
+
t[r] = {
|
|
4006
|
+
index: e(o.index),
|
|
4007
|
+
values: e(o.values)
|
|
4002
4008
|
};
|
|
4003
4009
|
return {
|
|
4004
4010
|
...n2,
|
|
4005
|
-
parts:
|
|
4011
|
+
parts: t
|
|
4006
4012
|
};
|
|
4007
4013
|
}
|
|
4008
4014
|
}
|
|
4009
4015
|
}
|
|
4010
|
-
function
|
|
4016
|
+
function K(n2) {
|
|
4011
4017
|
if (!n2 || typeof n2 != "object")
|
|
4012
4018
|
return false;
|
|
4013
|
-
const
|
|
4014
|
-
if (!("type" in
|
|
4019
|
+
const e = n2;
|
|
4020
|
+
if (!("type" in e))
|
|
4015
4021
|
return false;
|
|
4016
|
-
switch (
|
|
4022
|
+
switch (e.type) {
|
|
4017
4023
|
case "Json":
|
|
4018
|
-
return typeof
|
|
4024
|
+
return typeof e.keyLength == "number" && Array.isArray(e.data);
|
|
4019
4025
|
case "JsonPartitioned":
|
|
4020
|
-
return typeof
|
|
4026
|
+
return typeof e.partitionKeyLength == "number" && Array.isArray(e.parts);
|
|
4021
4027
|
case "BinaryPartitioned":
|
|
4022
|
-
return typeof
|
|
4028
|
+
return typeof e.partitionKeyLength == "number" && Array.isArray(e.parts);
|
|
4023
4029
|
default:
|
|
4024
4030
|
return false;
|
|
4025
4031
|
}
|
|
4026
4032
|
}
|
|
4027
|
-
function
|
|
4028
|
-
return
|
|
4033
|
+
function Sn(n2) {
|
|
4034
|
+
return K(n2) ? n2.type === "JsonPartitioned" || n2.type === "BinaryPartitioned" : false;
|
|
4029
4035
|
}
|
|
4030
|
-
function
|
|
4036
|
+
function Cn(n2) {
|
|
4031
4037
|
switch (n2.type) {
|
|
4032
4038
|
case "Json": {
|
|
4033
|
-
const
|
|
4039
|
+
const e = Object.entries(n2.data).map(([t, r]) => ({ key: JSON.parse(t), value: r }));
|
|
4034
4040
|
return {
|
|
4035
4041
|
type: "Json",
|
|
4036
4042
|
keyLength: n2.keyLength,
|
|
4037
|
-
data:
|
|
4043
|
+
data: e
|
|
4038
4044
|
};
|
|
4039
4045
|
}
|
|
4040
4046
|
case "JsonPartitioned": {
|
|
4041
|
-
const
|
|
4047
|
+
const e = Object.entries(n2.parts).map(([t, r]) => ({ key: JSON.parse(t), value: r }));
|
|
4042
4048
|
return {
|
|
4043
4049
|
type: "JsonPartitioned",
|
|
4044
4050
|
partitionKeyLength: n2.partitionKeyLength,
|
|
4045
|
-
parts:
|
|
4051
|
+
parts: e
|
|
4046
4052
|
};
|
|
4047
4053
|
}
|
|
4048
4054
|
case "BinaryPartitioned": {
|
|
4049
|
-
const
|
|
4055
|
+
const e = Object.entries(n2.parts).map(([t, r]) => ({ key: JSON.parse(t), value: r }));
|
|
4050
4056
|
return {
|
|
4051
4057
|
type: "BinaryPartitioned",
|
|
4052
4058
|
partitionKeyLength: n2.partitionKeyLength,
|
|
4053
|
-
parts:
|
|
4059
|
+
parts: e
|
|
4054
4060
|
};
|
|
4055
4061
|
}
|
|
4056
4062
|
}
|
|
4057
4063
|
}
|
|
4058
|
-
function
|
|
4064
|
+
function Jn(n2) {
|
|
4059
4065
|
switch (n2.type) {
|
|
4060
4066
|
case "Json": {
|
|
4061
|
-
const
|
|
4062
|
-
for (const
|
|
4063
|
-
|
|
4067
|
+
const e = {};
|
|
4068
|
+
for (const t of n2.data)
|
|
4069
|
+
e[JSON.stringify(t.key)] = t.value;
|
|
4064
4070
|
return {
|
|
4065
4071
|
type: "Json",
|
|
4066
4072
|
keyLength: n2.keyLength,
|
|
4067
|
-
data:
|
|
4073
|
+
data: e
|
|
4068
4074
|
};
|
|
4069
4075
|
}
|
|
4070
4076
|
case "JsonPartitioned": {
|
|
4071
|
-
const
|
|
4072
|
-
for (const
|
|
4073
|
-
|
|
4077
|
+
const e = {};
|
|
4078
|
+
for (const t of n2.parts)
|
|
4079
|
+
e[JSON.stringify(t.key)] = t.value;
|
|
4074
4080
|
return {
|
|
4075
4081
|
type: "JsonPartitioned",
|
|
4076
4082
|
partitionKeyLength: n2.partitionKeyLength,
|
|
4077
|
-
parts:
|
|
4083
|
+
parts: e
|
|
4078
4084
|
};
|
|
4079
4085
|
}
|
|
4080
4086
|
case "BinaryPartitioned": {
|
|
4081
|
-
const
|
|
4082
|
-
for (const
|
|
4083
|
-
|
|
4087
|
+
const e = {};
|
|
4088
|
+
for (const t of n2.parts)
|
|
4089
|
+
e[JSON.stringify(t.key)] = t.value;
|
|
4084
4090
|
return {
|
|
4085
4091
|
type: "BinaryPartitioned",
|
|
4086
4092
|
partitionKeyLength: n2.partitionKeyLength,
|
|
4087
|
-
parts:
|
|
4093
|
+
parts: e
|
|
4088
4094
|
};
|
|
4089
4095
|
}
|
|
4090
4096
|
}
|
|
4091
4097
|
}
|
|
4098
|
+
function Fn(n2) {
|
|
4099
|
+
return {
|
|
4100
|
+
columnId: n2.id,
|
|
4101
|
+
spec: n2.spec
|
|
4102
|
+
};
|
|
4103
|
+
}
|
|
4092
4104
|
function p$1(n2) {
|
|
4093
|
-
const { type:
|
|
4094
|
-
return
|
|
4105
|
+
const { type: e, name: t, domain: r } = n2, o = { type: e, name: t };
|
|
4106
|
+
return r && Object.entries(r).length > 0 && Object.assign(o, { domain: r }), o;
|
|
4095
4107
|
}
|
|
4096
|
-
function
|
|
4097
|
-
return
|
|
4108
|
+
function J(n2) {
|
|
4109
|
+
return n2.map(p$1);
|
|
4110
|
+
}
|
|
4111
|
+
function Rn(n2) {
|
|
4112
|
+
return ke(p$1(n2));
|
|
4098
4113
|
}
|
|
4099
|
-
function
|
|
4100
|
-
if (n2 === void 0) return
|
|
4101
|
-
if (
|
|
4102
|
-
for (const
|
|
4103
|
-
if (n2[
|
|
4114
|
+
function Y$1(n2, e) {
|
|
4115
|
+
if (n2 === void 0) return e === void 0;
|
|
4116
|
+
if (e === void 0) return true;
|
|
4117
|
+
for (const t in e)
|
|
4118
|
+
if (n2[t] !== e[t]) return false;
|
|
4104
4119
|
return true;
|
|
4105
4120
|
}
|
|
4106
|
-
function
|
|
4107
|
-
return n2.name ===
|
|
4121
|
+
function Z$1(n2, e) {
|
|
4122
|
+
return n2.name === e.name && Y$1(n2.domain, e.domain);
|
|
4108
4123
|
}
|
|
4109
|
-
function
|
|
4110
|
-
return { ...n2, src:
|
|
4124
|
+
function Un(n2, e) {
|
|
4125
|
+
return { ...n2, src: h(n2.src, e) };
|
|
4111
4126
|
}
|
|
4112
|
-
function
|
|
4127
|
+
function h(n2, e) {
|
|
4113
4128
|
switch (n2.type) {
|
|
4114
4129
|
case "column":
|
|
4115
4130
|
return {
|
|
4116
4131
|
type: "column",
|
|
4117
|
-
column:
|
|
4132
|
+
column: e(n2.column)
|
|
4118
4133
|
};
|
|
4119
4134
|
case "slicedColumn":
|
|
4120
4135
|
return {
|
|
4121
4136
|
type: "slicedColumn",
|
|
4122
|
-
column:
|
|
4137
|
+
column: e(n2.column),
|
|
4123
4138
|
newId: n2.newId,
|
|
4124
4139
|
axisFilters: n2.axisFilters
|
|
4125
4140
|
};
|
|
4141
|
+
case "inlineColumn":
|
|
4142
|
+
return n2;
|
|
4126
4143
|
case "inner":
|
|
4127
4144
|
case "full":
|
|
4128
4145
|
return {
|
|
4129
4146
|
type: n2.type,
|
|
4130
|
-
entries: n2.entries.map((
|
|
4147
|
+
entries: n2.entries.map((t) => h(t, e))
|
|
4131
4148
|
};
|
|
4132
4149
|
case "outer":
|
|
4133
4150
|
return {
|
|
4134
4151
|
type: "outer",
|
|
4135
|
-
primary:
|
|
4136
|
-
secondary: n2.secondary.map((
|
|
4152
|
+
primary: h(n2.primary, e),
|
|
4153
|
+
secondary: n2.secondary.map((t) => h(t, e))
|
|
4137
4154
|
};
|
|
4138
4155
|
default:
|
|
4139
4156
|
w(n2);
|
|
4140
4157
|
}
|
|
4141
4158
|
}
|
|
4142
|
-
function
|
|
4143
|
-
return
|
|
4159
|
+
function nn(n2) {
|
|
4160
|
+
return ke(n2);
|
|
4144
4161
|
}
|
|
4145
|
-
function
|
|
4146
|
-
return
|
|
4162
|
+
function P(n2) {
|
|
4163
|
+
return ke(p$1(n2));
|
|
4147
4164
|
}
|
|
4148
|
-
function
|
|
4149
|
-
return JSON.stringify([n2,
|
|
4165
|
+
function k(n2, e) {
|
|
4166
|
+
return JSON.stringify([n2, e]);
|
|
4150
4167
|
}
|
|
4151
|
-
class
|
|
4168
|
+
class _n {
|
|
4152
4169
|
/**
|
|
4153
4170
|
* Creates a new anchor context from a set of anchor column specifications
|
|
4154
4171
|
* @param anchors Record of anchor column specifications indexed by anchor ID
|
|
4155
4172
|
*/
|
|
4156
|
-
constructor(
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
this.anchors =
|
|
4162
|
-
const
|
|
4163
|
-
|
|
4164
|
-
for (const [r, o] of
|
|
4173
|
+
constructor(e) {
|
|
4174
|
+
l$1(this, "domains", /* @__PURE__ */ new Map());
|
|
4175
|
+
l$1(this, "axes", /* @__PURE__ */ new Map());
|
|
4176
|
+
l$1(this, "domainPacks", []);
|
|
4177
|
+
l$1(this, "domainPackToAnchor", /* @__PURE__ */ new Map());
|
|
4178
|
+
this.anchors = e;
|
|
4179
|
+
const t = Object.entries(e);
|
|
4180
|
+
t.sort((r, o) => r[0].localeCompare(o[0]));
|
|
4181
|
+
for (const [r, o] of t) {
|
|
4165
4182
|
for (let s2 = 0; s2 < o.axesSpec.length; s2++) {
|
|
4166
|
-
const a = o.axesSpec[s2], i =
|
|
4183
|
+
const a = o.axesSpec[s2], i = P(a);
|
|
4167
4184
|
this.axes.set(i, { anchor: r, idx: s2 });
|
|
4168
4185
|
}
|
|
4169
4186
|
if (o.domain !== void 0) {
|
|
4170
4187
|
const s2 = Object.entries(o.domain);
|
|
4171
4188
|
s2.sort((a, i) => a[0].localeCompare(i[0])), this.domainPackToAnchor.set(JSON.stringify(s2), r), this.domainPacks.push(s2.map(([a]) => a));
|
|
4172
4189
|
for (const [a, i] of s2) {
|
|
4173
|
-
const u2 =
|
|
4190
|
+
const u2 = k(a, i);
|
|
4174
4191
|
this.domains.set(u2, r);
|
|
4175
4192
|
}
|
|
4176
4193
|
}
|
|
@@ -4179,20 +4196,20 @@
|
|
|
4179
4196
|
/**
|
|
4180
4197
|
* Implementation of derive method
|
|
4181
4198
|
*/
|
|
4182
|
-
derive(
|
|
4199
|
+
derive(e, t) {
|
|
4183
4200
|
const r = {
|
|
4184
|
-
name:
|
|
4201
|
+
name: e.name,
|
|
4185
4202
|
axes: []
|
|
4186
4203
|
};
|
|
4187
4204
|
let o;
|
|
4188
|
-
if (
|
|
4205
|
+
if (e.domain !== void 0)
|
|
4189
4206
|
n:
|
|
4190
4207
|
for (const a of this.domainPacks) {
|
|
4191
4208
|
const i = [];
|
|
4192
4209
|
for (const c2 of a) {
|
|
4193
|
-
const
|
|
4194
|
-
if (
|
|
4195
|
-
i.push([c2,
|
|
4210
|
+
const m2 = e.domain[c2];
|
|
4211
|
+
if (m2 !== void 0)
|
|
4212
|
+
i.push([c2, m2]);
|
|
4196
4213
|
else
|
|
4197
4214
|
break n;
|
|
4198
4215
|
}
|
|
@@ -4202,26 +4219,26 @@
|
|
|
4202
4219
|
break;
|
|
4203
4220
|
}
|
|
4204
4221
|
}
|
|
4205
|
-
for (const [a, i] of Object.entries(
|
|
4222
|
+
for (const [a, i] of Object.entries(e.domain ?? {})) {
|
|
4206
4223
|
if (o !== void 0 && o.has(a))
|
|
4207
4224
|
continue;
|
|
4208
|
-
const u2 =
|
|
4225
|
+
const u2 = k(a, i), c2 = this.domains.get(u2);
|
|
4209
4226
|
r.domain ?? (r.domain = {}), r.domain[a] = c2 ? { anchor: c2 } : i;
|
|
4210
4227
|
}
|
|
4211
|
-
if (r.axes =
|
|
4212
|
-
const i =
|
|
4228
|
+
if (r.axes = e.axesSpec.map((a) => {
|
|
4229
|
+
const i = P(a), u2 = this.axes.get(i);
|
|
4213
4230
|
return u2 === void 0 ? p$1(a) : u2;
|
|
4214
|
-
}), !
|
|
4231
|
+
}), !t || t.length === 0)
|
|
4215
4232
|
return r;
|
|
4216
4233
|
const s2 = [];
|
|
4217
|
-
for (const a of
|
|
4234
|
+
for (const a of t) {
|
|
4218
4235
|
const [i, u2] = a;
|
|
4219
4236
|
if (typeof i == "number") {
|
|
4220
|
-
if (i < 0 || i >=
|
|
4221
|
-
throw new Error(`Axis index ${i} is out of bounds (0-${
|
|
4237
|
+
if (i < 0 || i >= e.axesSpec.length)
|
|
4238
|
+
throw new Error(`Axis index ${i} is out of bounds (0-${e.axesSpec.length - 1})`);
|
|
4222
4239
|
s2.push([i, u2]);
|
|
4223
4240
|
} else {
|
|
4224
|
-
const c2 =
|
|
4241
|
+
const c2 = e.axesSpec.findIndex((m2) => m2.name === i);
|
|
4225
4242
|
if (c2 === -1)
|
|
4226
4243
|
throw new Error(`Axis with name "${i}" not found in the column specification`);
|
|
4227
4244
|
s2.push([c2, u2]);
|
|
@@ -4238,12 +4255,12 @@
|
|
|
4238
4255
|
* @param axisFilters Optional axis filters to apply to the column
|
|
4239
4256
|
* @returns A canonicalized string representation of the anchored column identifier
|
|
4240
4257
|
*/
|
|
4241
|
-
deriveS(
|
|
4242
|
-
return
|
|
4258
|
+
deriveS(e, t) {
|
|
4259
|
+
return nn(this.derive(e, t));
|
|
4243
4260
|
}
|
|
4244
4261
|
}
|
|
4245
|
-
function
|
|
4246
|
-
const r = { ...
|
|
4262
|
+
function Mn(n2, e, t) {
|
|
4263
|
+
const r = { ...e }, o = (t == null ? void 0 : t.ignoreMissingDomains) ?? false;
|
|
4247
4264
|
if (r.domainAnchor !== void 0) {
|
|
4248
4265
|
const s2 = n2[r.domainAnchor];
|
|
4249
4266
|
if (!s2)
|
|
@@ -4269,159 +4286,186 @@
|
|
|
4269
4286
|
}
|
|
4270
4287
|
r.domain = s2;
|
|
4271
4288
|
}
|
|
4272
|
-
return r.axes && (r.axes = r.axes.map((s2) =>
|
|
4289
|
+
return r.axes && (r.axes = r.axes.map((s2) => en(n2, s2))), r;
|
|
4273
4290
|
}
|
|
4274
|
-
function
|
|
4275
|
-
if (!
|
|
4276
|
-
return
|
|
4277
|
-
const
|
|
4291
|
+
function en(n2, e) {
|
|
4292
|
+
if (!tn(e))
|
|
4293
|
+
return e;
|
|
4294
|
+
const t = e.anchor, r = n2[t];
|
|
4278
4295
|
if (!r)
|
|
4279
|
-
throw new Error(`Anchor "${
|
|
4280
|
-
if ("idx" in
|
|
4281
|
-
if (
|
|
4282
|
-
throw new Error(`Axis index ${
|
|
4283
|
-
return r.axesSpec[
|
|
4284
|
-
} else if ("name" in
|
|
4285
|
-
const o = r.axesSpec.filter((s2) => s2.name ===
|
|
4296
|
+
throw new Error(`Anchor "${t}" not found for axis reference`);
|
|
4297
|
+
if ("idx" in e) {
|
|
4298
|
+
if (e.idx < 0 || e.idx >= r.axesSpec.length)
|
|
4299
|
+
throw new Error(`Axis index ${e.idx} out of bounds for anchor "${t}"`);
|
|
4300
|
+
return r.axesSpec[e.idx];
|
|
4301
|
+
} else if ("name" in e) {
|
|
4302
|
+
const o = r.axesSpec.filter((s2) => s2.name === e.name);
|
|
4286
4303
|
if (o.length > 1)
|
|
4287
|
-
throw new Error(`Multiple axes with name "${
|
|
4304
|
+
throw new Error(`Multiple axes with name "${e.name}" found in anchor "${t}"`);
|
|
4288
4305
|
if (o.length === 0)
|
|
4289
|
-
throw new Error(`Axis with name "${
|
|
4306
|
+
throw new Error(`Axis with name "${e.name}" not found in anchor "${t}"`);
|
|
4290
4307
|
return o[0];
|
|
4291
|
-
} else if ("id" in
|
|
4292
|
-
const o = r.axesSpec.filter((s2) =>
|
|
4308
|
+
} else if ("id" in e) {
|
|
4309
|
+
const o = r.axesSpec.filter((s2) => Z$1(e.id, p$1(s2)));
|
|
4293
4310
|
if (o.length > 1)
|
|
4294
|
-
throw new Error(`Multiple matching axes found for matcher in anchor "${
|
|
4311
|
+
throw new Error(`Multiple matching axes found for matcher in anchor "${t}"`);
|
|
4295
4312
|
if (o.length === 0)
|
|
4296
|
-
throw new Error(`No matching axis found for matcher in anchor "${
|
|
4313
|
+
throw new Error(`No matching axis found for matcher in anchor "${t}"`);
|
|
4297
4314
|
return o[0];
|
|
4298
4315
|
}
|
|
4299
4316
|
throw new Error("Unsupported axis reference type");
|
|
4300
4317
|
}
|
|
4301
|
-
function
|
|
4318
|
+
function tn(n2) {
|
|
4302
4319
|
return typeof n2 == "object" && "anchor" in n2;
|
|
4303
4320
|
}
|
|
4304
4321
|
function f(n2) {
|
|
4305
4322
|
return n2.kind === "PColumn";
|
|
4306
4323
|
}
|
|
4307
|
-
function
|
|
4324
|
+
function rn(n2) {
|
|
4308
4325
|
return f(n2.spec);
|
|
4309
4326
|
}
|
|
4310
|
-
function
|
|
4311
|
-
if (!
|
|
4327
|
+
function qn(n2) {
|
|
4328
|
+
if (!rn(n2)) throw new Error(`not a PColumn (kind = ${n2.spec.kind})`);
|
|
4312
4329
|
return n2;
|
|
4313
4330
|
}
|
|
4314
|
-
function
|
|
4331
|
+
function Wn(n2, e) {
|
|
4315
4332
|
return n2 === void 0 ? void 0 : {
|
|
4316
4333
|
...n2,
|
|
4317
|
-
data:
|
|
4334
|
+
data: e(n2.data)
|
|
4318
4335
|
};
|
|
4319
4336
|
}
|
|
4320
|
-
function
|
|
4321
|
-
const
|
|
4337
|
+
function Xn(n2) {
|
|
4338
|
+
const e = /* @__PURE__ */ new Map(), t = (r) => {
|
|
4322
4339
|
switch (r.type) {
|
|
4323
4340
|
case "column":
|
|
4324
|
-
|
|
4341
|
+
e.set(r.column.id, r.column);
|
|
4325
4342
|
return;
|
|
4326
4343
|
case "slicedColumn":
|
|
4327
|
-
|
|
4344
|
+
e.set(r.column.id, r.column);
|
|
4345
|
+
return;
|
|
4346
|
+
case "inlineColumn":
|
|
4328
4347
|
return;
|
|
4329
4348
|
case "full":
|
|
4330
4349
|
case "inner":
|
|
4331
|
-
for (const o of r.entries)
|
|
4350
|
+
for (const o of r.entries) t(o);
|
|
4332
4351
|
return;
|
|
4333
4352
|
case "outer":
|
|
4334
|
-
|
|
4335
|
-
for (const o of r.secondary)
|
|
4353
|
+
t(r.primary);
|
|
4354
|
+
for (const o of r.secondary) t(o);
|
|
4336
4355
|
return;
|
|
4337
4356
|
default:
|
|
4338
4357
|
w(r);
|
|
4339
4358
|
}
|
|
4340
4359
|
};
|
|
4341
|
-
return
|
|
4360
|
+
return t(n2), [...e.values()];
|
|
4342
4361
|
}
|
|
4343
|
-
function
|
|
4344
|
-
if (n2.name !== void 0 && n2.name !==
|
|
4362
|
+
function E$1(n2, e) {
|
|
4363
|
+
if (n2.name !== void 0 && n2.name !== e.name)
|
|
4345
4364
|
return false;
|
|
4346
4365
|
if (n2.type !== void 0) {
|
|
4347
4366
|
if (Array.isArray(n2.type)) {
|
|
4348
|
-
if (!n2.type.includes(
|
|
4367
|
+
if (!n2.type.includes(e.type))
|
|
4349
4368
|
return false;
|
|
4350
|
-
} else if (n2.type !==
|
|
4369
|
+
} else if (n2.type !== e.type)
|
|
4351
4370
|
return false;
|
|
4352
4371
|
}
|
|
4353
4372
|
if (n2.domain !== void 0) {
|
|
4354
|
-
const
|
|
4373
|
+
const t = e.domain || {};
|
|
4355
4374
|
for (const [r, o] of Object.entries(n2.domain))
|
|
4356
|
-
if (
|
|
4375
|
+
if (t[r] !== o)
|
|
4357
4376
|
return false;
|
|
4358
4377
|
}
|
|
4359
4378
|
return true;
|
|
4360
4379
|
}
|
|
4361
|
-
function N(n2,
|
|
4362
|
-
if (
|
|
4380
|
+
function N(n2, e) {
|
|
4381
|
+
if (e.name !== void 0 && n2.name !== e.name || e.namePattern !== void 0 && !new RegExp(e.namePattern).test(n2.name))
|
|
4363
4382
|
return false;
|
|
4364
|
-
if (
|
|
4365
|
-
if (Array.isArray(
|
|
4366
|
-
if (!
|
|
4383
|
+
if (e.type !== void 0) {
|
|
4384
|
+
if (Array.isArray(e.type)) {
|
|
4385
|
+
if (!e.type.includes(n2.valueType))
|
|
4367
4386
|
return false;
|
|
4368
|
-
} else if (
|
|
4387
|
+
} else if (e.type !== n2.valueType)
|
|
4369
4388
|
return false;
|
|
4370
4389
|
}
|
|
4371
|
-
if (
|
|
4372
|
-
const
|
|
4373
|
-
for (const [r, o] of Object.entries(
|
|
4374
|
-
if (
|
|
4390
|
+
if (e.domain !== void 0) {
|
|
4391
|
+
const t = n2.domain || {};
|
|
4392
|
+
for (const [r, o] of Object.entries(e.domain))
|
|
4393
|
+
if (t[r] !== o)
|
|
4375
4394
|
return false;
|
|
4376
4395
|
}
|
|
4377
|
-
if (
|
|
4378
|
-
const
|
|
4379
|
-
if (
|
|
4380
|
-
for (const r of
|
|
4381
|
-
if (!
|
|
4396
|
+
if (e.axes !== void 0) {
|
|
4397
|
+
const t = n2.axesSpec.map(p$1);
|
|
4398
|
+
if (e.partialAxesMatch) {
|
|
4399
|
+
for (const r of e.axes)
|
|
4400
|
+
if (!t.some((o) => E$1(r, o)))
|
|
4382
4401
|
return false;
|
|
4383
4402
|
} else {
|
|
4384
|
-
if (
|
|
4403
|
+
if (t.length !== e.axes.length)
|
|
4385
4404
|
return false;
|
|
4386
|
-
for (let r = 0; r <
|
|
4387
|
-
if (!
|
|
4405
|
+
for (let r = 0; r < e.axes.length; r++)
|
|
4406
|
+
if (!E$1(e.axes[r], t[r]))
|
|
4388
4407
|
return false;
|
|
4389
4408
|
}
|
|
4390
4409
|
}
|
|
4391
|
-
if (
|
|
4392
|
-
const
|
|
4393
|
-
for (const [r, o] of Object.entries(
|
|
4394
|
-
if (
|
|
4410
|
+
if (e.annotations !== void 0) {
|
|
4411
|
+
const t = n2.annotations || {};
|
|
4412
|
+
for (const [r, o] of Object.entries(e.annotations))
|
|
4413
|
+
if (t[r] !== o)
|
|
4395
4414
|
return false;
|
|
4396
4415
|
}
|
|
4397
|
-
if (
|
|
4398
|
-
const
|
|
4399
|
-
for (const [r, o] of Object.entries(
|
|
4400
|
-
const s2 =
|
|
4416
|
+
if (e.annotationPatterns !== void 0) {
|
|
4417
|
+
const t = n2.annotations || {};
|
|
4418
|
+
for (const [r, o] of Object.entries(e.annotationPatterns)) {
|
|
4419
|
+
const s2 = t[r];
|
|
4401
4420
|
if (s2 === void 0 || !new RegExp(o).test(s2))
|
|
4402
4421
|
return false;
|
|
4403
4422
|
}
|
|
4404
4423
|
}
|
|
4405
4424
|
return true;
|
|
4406
4425
|
}
|
|
4407
|
-
function
|
|
4408
|
-
return Array.isArray(n2) ? (
|
|
4426
|
+
function Gn(n2) {
|
|
4427
|
+
return Array.isArray(n2) ? (e) => n2.some((t) => f(e) && N(e, t)) : (e) => f(e) && N(e, n2);
|
|
4428
|
+
}
|
|
4429
|
+
function Qn(n2) {
|
|
4430
|
+
const e = {
|
|
4431
|
+
kind: n2.kind,
|
|
4432
|
+
name: n2.name
|
|
4433
|
+
};
|
|
4434
|
+
return n2.domain !== void 0 && (e.domain = n2.domain), f(n2) && (e.axesSpec = J(n2.axesSpec)), ke(e);
|
|
4409
4435
|
}
|
|
4410
4436
|
z$1.object({
|
|
4411
4437
|
__isRef: z$1.literal(true).describe("Crucial marker for the block dependency tree reconstruction"),
|
|
4412
4438
|
blockId: z$1.string().describe("Upstream block id"),
|
|
4413
|
-
name: z$1.string().describe("Name of the output provided to the upstream block's output context")
|
|
4439
|
+
name: z$1.string().describe("Name of the output provided to the upstream block's output context"),
|
|
4440
|
+
requireEnrichments: z$1.literal(true).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")
|
|
4414
4441
|
}).describe(
|
|
4415
4442
|
"Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees."
|
|
4416
|
-
).
|
|
4417
|
-
function
|
|
4443
|
+
).readonly();
|
|
4444
|
+
function ne(n2) {
|
|
4418
4445
|
return typeof n2 == "object" && n2 !== null && "__isRef" in n2 && n2.__isRef === true && "blockId" in n2 && "name" in n2;
|
|
4419
4446
|
}
|
|
4420
|
-
function
|
|
4421
|
-
|
|
4447
|
+
function te$1(n2, e = true) {
|
|
4448
|
+
if (e)
|
|
4449
|
+
return {
|
|
4450
|
+
...n2,
|
|
4451
|
+
requireEnrichments: true
|
|
4452
|
+
};
|
|
4453
|
+
{
|
|
4454
|
+
const { requireEnrichments: t, ...r } = n2;
|
|
4455
|
+
return r;
|
|
4456
|
+
}
|
|
4457
|
+
}
|
|
4458
|
+
function oe$1(n2, e) {
|
|
4459
|
+
return n2.ok ? { ok: true, value: e(n2.value) } : n2;
|
|
4460
|
+
}
|
|
4461
|
+
const fn = 24;
|
|
4462
|
+
z$1.string().length(fn).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
|
|
4463
|
+
function ue(n2) {
|
|
4464
|
+
return ke(n2);
|
|
4465
|
+
}
|
|
4466
|
+
function ce$1(n2) {
|
|
4467
|
+
return JSON.parse(n2);
|
|
4422
4468
|
}
|
|
4423
|
-
const on = 24;
|
|
4424
|
-
z$1.string().length(on).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
|
|
4425
4469
|
var stringify = { exports: {} };
|
|
4426
4470
|
var hasRequiredStringify;
|
|
4427
4471
|
function requireStringify() {
|
|
@@ -4481,54 +4525,54 @@
|
|
|
4481
4525
|
cause: z$1.lazy(() => n).optional(),
|
|
4482
4526
|
errors: z$1.lazy(() => n.array()).optional()
|
|
4483
4527
|
});
|
|
4484
|
-
var
|
|
4485
|
-
var
|
|
4486
|
-
var
|
|
4487
|
-
function
|
|
4528
|
+
var qe = Object.defineProperty;
|
|
4529
|
+
var ze = (t, e, n2) => e in t ? qe(t, e, { enumerable: true, configurable: true, writable: true, value: n2 }) : t[e] = n2;
|
|
4530
|
+
var O = (t, e, n2) => ze(t, typeof e != "symbol" ? e + "" : e, n2);
|
|
4531
|
+
function re(t) {
|
|
4488
4532
|
return { type: "Immediate", value: t };
|
|
4489
4533
|
}
|
|
4490
|
-
function
|
|
4534
|
+
function pt() {
|
|
4491
4535
|
return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
|
|
4492
4536
|
}
|
|
4493
|
-
function
|
|
4537
|
+
function De(t) {
|
|
4494
4538
|
if (t && typeof globalThis.getPlatforma == "function")
|
|
4495
4539
|
return globalThis.getPlatforma(t);
|
|
4496
4540
|
if (typeof globalThis.platforma < "u") return globalThis.platforma;
|
|
4497
4541
|
throw new Error("Can't get platforma instance.");
|
|
4498
4542
|
}
|
|
4499
|
-
function
|
|
4543
|
+
function ft() {
|
|
4500
4544
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
4501
4545
|
}
|
|
4502
4546
|
function m() {
|
|
4503
4547
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
4504
4548
|
throw new Error("Not in config rendering context");
|
|
4505
4549
|
}
|
|
4506
|
-
function
|
|
4507
|
-
const n2 =
|
|
4550
|
+
function H(t, e) {
|
|
4551
|
+
const n2 = ft();
|
|
4508
4552
|
if (n2 === void 0) return false;
|
|
4509
4553
|
if (t in n2.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
|
|
4510
4554
|
return n2.callbackRegistry[t] = e, true;
|
|
4511
4555
|
}
|
|
4512
|
-
const
|
|
4513
|
-
function
|
|
4556
|
+
const ce = /* @__PURE__ */ new Map();
|
|
4557
|
+
function ht(t, e) {
|
|
4514
4558
|
t in m().callbackRegistry || (m().callbackRegistry[t] = (n2) => {
|
|
4515
|
-
for (const r of
|
|
4559
|
+
for (const r of ce.get(t))
|
|
4516
4560
|
r(n2);
|
|
4517
|
-
},
|
|
4561
|
+
}, ce.set(t, [])), ce.get(t).push(e);
|
|
4518
4562
|
}
|
|
4519
|
-
class
|
|
4563
|
+
class _ {
|
|
4520
4564
|
constructor(e, n2 = (r) => r) {
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
this.handle = e, this.postProcess = n2,
|
|
4565
|
+
O(this, "isResolved", false);
|
|
4566
|
+
O(this, "resolvedValue");
|
|
4567
|
+
this.handle = e, this.postProcess = n2, ht(e, (r) => {
|
|
4524
4568
|
this.resolvedValue = n2(r), this.isResolved = true;
|
|
4525
4569
|
});
|
|
4526
4570
|
}
|
|
4527
4571
|
map(e) {
|
|
4528
|
-
return new
|
|
4572
|
+
return new _(this.handle, (n2) => e(this.postProcess(n2)));
|
|
4529
4573
|
}
|
|
4530
4574
|
mapDefined(e) {
|
|
4531
|
-
return new
|
|
4575
|
+
return new _(this.handle, (n2) => {
|
|
4532
4576
|
const r = this.postProcess(n2);
|
|
4533
4577
|
return r ? e(r) : void 0;
|
|
4534
4578
|
});
|
|
@@ -4537,10 +4581,10 @@
|
|
|
4537
4581
|
return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
|
|
4538
4582
|
}
|
|
4539
4583
|
}
|
|
4540
|
-
function
|
|
4584
|
+
function he(t, e) {
|
|
4541
4585
|
return t === void 0 ? void 0 : e(t);
|
|
4542
4586
|
}
|
|
4543
|
-
class
|
|
4587
|
+
class E {
|
|
4544
4588
|
constructor(e, n2) {
|
|
4545
4589
|
this.handle = e, this.resolvePath = n2;
|
|
4546
4590
|
}
|
|
@@ -4579,9 +4623,9 @@
|
|
|
4579
4623
|
...this.resolvePath,
|
|
4580
4624
|
...n2.map((i) => typeof i == "string" ? i : i.field)
|
|
4581
4625
|
];
|
|
4582
|
-
return
|
|
4626
|
+
return he(
|
|
4583
4627
|
m().resolveWithCommon(this.handle, e, ...n2),
|
|
4584
|
-
(i) => new
|
|
4628
|
+
(i) => new E(i, r)
|
|
4585
4629
|
);
|
|
4586
4630
|
}
|
|
4587
4631
|
get resourceType() {
|
|
@@ -4601,9 +4645,9 @@
|
|
|
4601
4645
|
}
|
|
4602
4646
|
getError() {
|
|
4603
4647
|
const e = [...this.resolvePath, "error"];
|
|
4604
|
-
return
|
|
4648
|
+
return he(
|
|
4605
4649
|
m().getError(this.handle),
|
|
4606
|
-
(n2) => new
|
|
4650
|
+
(n2) => new E(n2, e)
|
|
4607
4651
|
);
|
|
4608
4652
|
}
|
|
4609
4653
|
listInputFields() {
|
|
@@ -4643,7 +4687,7 @@
|
|
|
4643
4687
|
getPColumns(e = false, n2 = "") {
|
|
4644
4688
|
const r = this.parsePObjectCollection(e, n2);
|
|
4645
4689
|
return r === void 0 ? void 0 : Object.entries(r).map(([, s2]) => {
|
|
4646
|
-
if (!
|
|
4690
|
+
if (!rn(s2)) throw new Error(`not a PColumn (kind = ${s2.spec.kind})`);
|
|
4647
4691
|
return s2;
|
|
4648
4692
|
});
|
|
4649
4693
|
}
|
|
@@ -4661,20 +4705,20 @@
|
|
|
4661
4705
|
const i = {};
|
|
4662
4706
|
for (const [s2, o] of Object.entries(r)) {
|
|
4663
4707
|
const a = [...this.resolvePath, s2];
|
|
4664
|
-
i[s2] =
|
|
4708
|
+
i[s2] = Wn(o, (l2) => new E(l2, a));
|
|
4665
4709
|
}
|
|
4666
4710
|
return i;
|
|
4667
4711
|
}
|
|
4668
|
-
getFileContentAsBase64() {
|
|
4669
|
-
return new
|
|
4712
|
+
getFileContentAsBase64(e) {
|
|
4713
|
+
return new _(m().getBlobContentAsBase64(this.handle, e));
|
|
4670
4714
|
}
|
|
4671
|
-
getFileContentAsString() {
|
|
4672
|
-
return new
|
|
4715
|
+
getFileContentAsString(e) {
|
|
4716
|
+
return new _(m().getBlobContentAsString(this.handle, e));
|
|
4673
4717
|
}
|
|
4674
|
-
getFileContentAsJson() {
|
|
4675
|
-
return new
|
|
4676
|
-
m().getBlobContentAsString(this.handle)
|
|
4677
|
-
).mapDefined((
|
|
4718
|
+
getFileContentAsJson(e) {
|
|
4719
|
+
return new _(
|
|
4720
|
+
m().getBlobContentAsString(this.handle, e)
|
|
4721
|
+
).mapDefined((n2) => JSON.parse(n2));
|
|
4678
4722
|
}
|
|
4679
4723
|
/**
|
|
4680
4724
|
* @deprecated use getFileContentAsBase64
|
|
@@ -4692,7 +4736,7 @@
|
|
|
4692
4736
|
* @returns downloaded file handle
|
|
4693
4737
|
*/
|
|
4694
4738
|
getFileHandle() {
|
|
4695
|
-
return new
|
|
4739
|
+
return new _(m().getDownloadedBlobContentHandle(this.handle));
|
|
4696
4740
|
}
|
|
4697
4741
|
/**
|
|
4698
4742
|
* @deprecated use getFileHandle
|
|
@@ -4704,7 +4748,7 @@
|
|
|
4704
4748
|
* @returns downloaded file handle
|
|
4705
4749
|
*/
|
|
4706
4750
|
getRemoteFileHandle() {
|
|
4707
|
-
return new
|
|
4751
|
+
return new _(m().getOnDemandBlobContentHandle(this.handle));
|
|
4708
4752
|
}
|
|
4709
4753
|
/**
|
|
4710
4754
|
* @deprecated use getRemoteFileHandle
|
|
@@ -4716,22 +4760,22 @@
|
|
|
4716
4760
|
* @returns the url to the extracted folder
|
|
4717
4761
|
*/
|
|
4718
4762
|
extractArchiveAndGetURL(e) {
|
|
4719
|
-
return new
|
|
4763
|
+
return new _(m().extractArchiveAndGetURL(this.handle, e));
|
|
4720
4764
|
}
|
|
4721
4765
|
getImportProgress() {
|
|
4722
|
-
return new
|
|
4766
|
+
return new _(m().getImportProgress(this.handle));
|
|
4723
4767
|
}
|
|
4724
4768
|
getLastLogs(e) {
|
|
4725
|
-
return new
|
|
4769
|
+
return new _(m().getLastLogs(this.handle, e));
|
|
4726
4770
|
}
|
|
4727
4771
|
getProgressLog(e) {
|
|
4728
|
-
return new
|
|
4772
|
+
return new _(m().getProgressLog(this.handle, e));
|
|
4729
4773
|
}
|
|
4730
4774
|
getProgressLogWithInfo(e) {
|
|
4731
|
-
return new
|
|
4775
|
+
return new _(m().getProgressLogWithInfo(this.handle, e));
|
|
4732
4776
|
}
|
|
4733
4777
|
getLogHandle() {
|
|
4734
|
-
return new
|
|
4778
|
+
return new _(m().getLogHandle(this.handle));
|
|
4735
4779
|
}
|
|
4736
4780
|
allFieldsResolved(e = "Input") {
|
|
4737
4781
|
switch (e) {
|
|
@@ -4757,134 +4801,135 @@
|
|
|
4757
4801
|
let l2 = (r === "Input" ? this.listInputFields() : r === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
|
|
4758
4802
|
(u2) => [u2, this.resolve({ field: u2, assertFieldType: r })]
|
|
4759
4803
|
);
|
|
4760
|
-
return s2 && (l2 = l2.filter((u2) => u2[1] !== void 0)), l2.map(([u2,
|
|
4804
|
+
return s2 && (l2 = l2.filter((u2) => u2[1] !== void 0)), l2.map(([u2, c2]) => o(u2, c2));
|
|
4761
4805
|
}
|
|
4762
4806
|
}
|
|
4763
|
-
const
|
|
4764
|
-
const
|
|
4807
|
+
const Re = "staging", Fe = "main";
|
|
4808
|
+
const yt = "pl7.app/label", vt = "pl7.app/trace", bt = z$1.object({
|
|
4765
4809
|
type: z$1.string(),
|
|
4766
4810
|
importance: z$1.number().optional(),
|
|
4767
4811
|
id: z$1.string().optional(),
|
|
4768
4812
|
label: z$1.string()
|
|
4769
|
-
}),
|
|
4770
|
-
function
|
|
4771
|
-
const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(),
|
|
4772
|
-
var
|
|
4773
|
-
const
|
|
4774
|
-
let
|
|
4775
|
-
"spec" in
|
|
4776
|
-
const
|
|
4777
|
-
...
|
|
4778
|
-
...
|
|
4779
|
-
...
|
|
4813
|
+
}), wt = z$1.array(bt), At = 1e-3, xt = "__LABEL__", Pe = "__LABEL__@1";
|
|
4814
|
+
function je(t, e, n2 = {}) {
|
|
4815
|
+
const r = /* @__PURE__ */ new Map(), i = n2.forceTraceElements !== void 0 && n2.forceTraceElements.length > 0 ? new Set(n2.forceTraceElements) : void 0, s2 = /* @__PURE__ */ new Map(), o = t.map((f2) => {
|
|
4816
|
+
var P2, R;
|
|
4817
|
+
const w2 = e(f2);
|
|
4818
|
+
let p2, g, b;
|
|
4819
|
+
"spec" in w2 && typeof w2.spec == "object" ? (p2 = w2.spec, g = w2.prefixTrace, b = w2.suffixTrace) : p2 = w2;
|
|
4820
|
+
const h2 = (P2 = p2.annotations) == null ? void 0 : P2[yt], I = (R = p2.annotations) == null ? void 0 : R[vt], x = (I ? wt.safeParse(JSON.parse(I)).data : void 0) ?? [], v = [
|
|
4821
|
+
...g ?? [],
|
|
4822
|
+
...x,
|
|
4823
|
+
...b ?? []
|
|
4780
4824
|
];
|
|
4781
|
-
if (
|
|
4782
|
-
const
|
|
4783
|
-
n2.addLabelAsSuffix ?
|
|
4784
|
-
}
|
|
4785
|
-
const
|
|
4786
|
-
for (let
|
|
4787
|
-
const { type:
|
|
4788
|
-
|
|
4789
|
-
const
|
|
4790
|
-
|
|
4791
|
-
|
|
4825
|
+
if (h2 !== void 0) {
|
|
4826
|
+
const k2 = { label: h2, type: xt, importance: -2 };
|
|
4827
|
+
n2.addLabelAsSuffix ? v.push(k2) : v.splice(0, 0, k2);
|
|
4828
|
+
}
|
|
4829
|
+
const A = [], L = /* @__PURE__ */ new Map();
|
|
4830
|
+
for (let k2 = v.length - 1; k2 >= 0; --k2) {
|
|
4831
|
+
const { type: W } = v[k2], j2 = v[k2].importance ?? 0, $ = (L.get(W) ?? 0) + 1;
|
|
4832
|
+
L.set(W, $);
|
|
4833
|
+
const F = `${W}@${$}`;
|
|
4834
|
+
s2.set(F, (s2.get(F) ?? 0) + 1), r.set(
|
|
4835
|
+
F,
|
|
4792
4836
|
Math.max(
|
|
4793
|
-
r.get(
|
|
4794
|
-
|
|
4837
|
+
r.get(F) ?? Number.NEGATIVE_INFINITY,
|
|
4838
|
+
j2 - (v.length - k2) * At
|
|
4795
4839
|
)
|
|
4796
|
-
),
|
|
4840
|
+
), A.push({ ...v[k2], fullType: F, occurrenceIndex: $ });
|
|
4797
4841
|
}
|
|
4798
|
-
return
|
|
4799
|
-
value:
|
|
4800
|
-
spec:
|
|
4801
|
-
label:
|
|
4802
|
-
fullTrace:
|
|
4842
|
+
return A.reverse(), {
|
|
4843
|
+
value: f2,
|
|
4844
|
+
spec: p2,
|
|
4845
|
+
label: h2,
|
|
4846
|
+
fullTrace: A
|
|
4803
4847
|
};
|
|
4804
|
-
}),
|
|
4805
|
-
|
|
4806
|
-
for (const [
|
|
4807
|
-
|
|
4808
|
-
const
|
|
4809
|
-
const
|
|
4810
|
-
for (let
|
|
4811
|
-
const
|
|
4812
|
-
if (
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4848
|
+
}), a = [], l2 = [], u2 = [...r];
|
|
4849
|
+
u2.sort(([, f2], [, w2]) => w2 - f2);
|
|
4850
|
+
for (const [f2] of u2)
|
|
4851
|
+
f2.endsWith("@1") || s2.get(f2) === t.length ? a.push(f2) : l2.push(f2);
|
|
4852
|
+
const c2 = (f2, w2 = false) => {
|
|
4853
|
+
const p2 = [];
|
|
4854
|
+
for (let g = 0; g < o.length; g++) {
|
|
4855
|
+
const b = o[g], h2 = b.fullTrace.filter((v) => f2.has(v.fullType) || i && i.has(v.type));
|
|
4856
|
+
if (h2.length === 0)
|
|
4857
|
+
if (w2)
|
|
4858
|
+
p2.push({
|
|
4859
|
+
label: "Unlabeled",
|
|
4860
|
+
value: b.value
|
|
4861
|
+
});
|
|
4862
|
+
else return;
|
|
4863
|
+
const I = h2.map((v) => v.label), x = n2.separator ?? " / ";
|
|
4864
|
+
p2.push({
|
|
4865
|
+
label: I.join(x),
|
|
4866
|
+
value: b.value
|
|
4818
4867
|
});
|
|
4819
4868
|
}
|
|
4820
|
-
return c2;
|
|
4821
|
-
};
|
|
4822
|
-
if (o.length === 0) {
|
|
4823
|
-
if (a.length !== 0) throw new Error("Assertion error.");
|
|
4824
|
-
const p2 = u2(new Set(ve));
|
|
4825
|
-
if (p2 === void 0) throw new Error("Assertion error.");
|
|
4826
4869
|
return p2;
|
|
4870
|
+
};
|
|
4871
|
+
if (a.length === 0) {
|
|
4872
|
+
if (l2.length !== 0) throw new Error("Non-empty secondary types list while main types list is empty.");
|
|
4873
|
+
return c2(new Set(Pe), true);
|
|
4874
|
+
}
|
|
4875
|
+
let d = 0, y = -1;
|
|
4876
|
+
for (; d < a.length; ) {
|
|
4877
|
+
const f2 = /* @__PURE__ */ new Set();
|
|
4878
|
+
n2.includeNativeLabel && f2.add(Pe);
|
|
4879
|
+
for (let p2 = 0; p2 < d; ++p2) f2.add(a[p2]);
|
|
4880
|
+
y >= 0 && f2.add(a[y]);
|
|
4881
|
+
const w2 = c2(f2);
|
|
4882
|
+
if (w2 !== void 0 && new Set(w2.map((p2) => p2.label)).size === t.length) return w2;
|
|
4883
|
+
y++, y >= a.length && (d++, y = d);
|
|
4827
4884
|
}
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
for (let h = 0; h < S; ++h) p2.add(o[h]);
|
|
4833
|
-
p2.add(o[d]);
|
|
4834
|
-
const c2 = u2(p2);
|
|
4835
|
-
if (c2 !== void 0 && new Set(c2.map((h) => h.label)).size === t.length) return c2;
|
|
4836
|
-
d++, d >= o.length && (S++, d = S);
|
|
4837
|
-
}
|
|
4838
|
-
const f2 = u2(/* @__PURE__ */ new Set([...o, ...a]));
|
|
4839
|
-
if (f2 === void 0) throw new Error("Assertion error.");
|
|
4840
|
-
return f2;
|
|
4841
|
-
}
|
|
4842
|
-
const H = "PColumnData/", te = H + "ResourceMap", ne = H + "Partitioned/ResourceMap", U = H + "JsonPartitioned", V = H + "BinaryPartitioned", Fe = H + "Partitioned/", re = Fe + "JsonPartitioned", B = Fe + "BinaryPartitioned";
|
|
4843
|
-
const fe = (t) => {
|
|
4885
|
+
return c2(/* @__PURE__ */ new Set([...a, ...l2]), true);
|
|
4886
|
+
}
|
|
4887
|
+
const Z = "PColumnData/", se = Z + "ResourceMap", oe = Z + "Partitioned/ResourceMap", q = Z + "JsonPartitioned", B = Z + "BinaryPartitioned", Ve = Z + "Partitioned/", ae = Ve + "JsonPartitioned", z = Ve + "BinaryPartitioned";
|
|
4888
|
+
const me = (t) => {
|
|
4844
4889
|
if (t.endsWith(".index"))
|
|
4845
4890
|
return { baseKey: t.substring(0, t.length - 6), type: "index" };
|
|
4846
4891
|
if (t.endsWith(".values"))
|
|
4847
4892
|
return { baseKey: t.substring(0, t.length - 7), type: "values" };
|
|
4848
4893
|
throw new Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
|
|
4849
4894
|
};
|
|
4850
|
-
function
|
|
4895
|
+
function Ct(t) {
|
|
4851
4896
|
if (!t) return;
|
|
4852
4897
|
const e = t.resourceType.name, n2 = t.getDataAsJson(), r = [];
|
|
4853
4898
|
let i = 0;
|
|
4854
4899
|
switch (e) {
|
|
4855
|
-
case
|
|
4900
|
+
case se:
|
|
4856
4901
|
i = n2.keyLength;
|
|
4857
4902
|
break;
|
|
4858
|
-
case
|
|
4903
|
+
case oe:
|
|
4859
4904
|
i = n2.partitionKeyLength + n2.keyLength;
|
|
4860
4905
|
break;
|
|
4861
|
-
case
|
|
4862
|
-
case
|
|
4906
|
+
case q:
|
|
4907
|
+
case B:
|
|
4863
4908
|
i = n2.partitionKeyLength;
|
|
4864
4909
|
break;
|
|
4865
|
-
case
|
|
4866
|
-
case
|
|
4910
|
+
case z:
|
|
4911
|
+
case ae:
|
|
4867
4912
|
i = n2.superPartitionKeyLength + n2.partitionKeyLength;
|
|
4868
4913
|
break;
|
|
4869
4914
|
}
|
|
4870
4915
|
switch (e) {
|
|
4871
|
-
case
|
|
4872
|
-
case
|
|
4873
|
-
case
|
|
4916
|
+
case se:
|
|
4917
|
+
case q:
|
|
4918
|
+
case B:
|
|
4874
4919
|
for (let s2 of t.listInputFields()) {
|
|
4875
|
-
e ===
|
|
4920
|
+
e === B && (s2 = me(s2).baseKey);
|
|
4876
4921
|
const o = [...JSON.parse(s2)];
|
|
4877
4922
|
r.push(o);
|
|
4878
4923
|
}
|
|
4879
4924
|
break;
|
|
4880
|
-
case
|
|
4881
|
-
case
|
|
4882
|
-
case
|
|
4925
|
+
case oe:
|
|
4926
|
+
case z:
|
|
4927
|
+
case ae:
|
|
4883
4928
|
for (const s2 of t.listInputFields()) {
|
|
4884
4929
|
const o = [...JSON.parse(s2)], a = t.resolve({ field: s2, assertFieldType: "Input" });
|
|
4885
4930
|
if (a !== void 0)
|
|
4886
4931
|
for (let l2 of a.listInputFields()) {
|
|
4887
|
-
e ===
|
|
4932
|
+
e === z && (l2 = me(l2).baseKey);
|
|
4888
4933
|
const u2 = [...o, ...JSON.parse(l2)];
|
|
4889
4934
|
r.push(u2);
|
|
4890
4935
|
}
|
|
@@ -4893,7 +4938,7 @@
|
|
|
4893
4938
|
}
|
|
4894
4939
|
return { data: r, keyLength: i };
|
|
4895
4940
|
}
|
|
4896
|
-
function
|
|
4941
|
+
function Pt(t) {
|
|
4897
4942
|
if (t.type !== "JsonPartitioned" && t.type !== "BinaryPartitioned")
|
|
4898
4943
|
throw new Error(`Splitting requires Partitioned DataInfoEntries, got ${t.type}`);
|
|
4899
4944
|
const { parts: e, partitionKeyLength: n2 } = t, r = [];
|
|
@@ -4912,11 +4957,11 @@
|
|
|
4912
4957
|
}
|
|
4913
4958
|
return r.map((i) => Array.from(i.values()));
|
|
4914
4959
|
}
|
|
4915
|
-
function
|
|
4960
|
+
function St(t) {
|
|
4916
4961
|
if (t === void 0) return;
|
|
4917
|
-
if (
|
|
4918
|
-
return
|
|
4919
|
-
const e =
|
|
4962
|
+
if (K(t))
|
|
4963
|
+
return Pt(t);
|
|
4964
|
+
const e = Ct(t);
|
|
4920
4965
|
if (!e) return;
|
|
4921
4966
|
const { data: n2, keyLength: r } = e, i = [];
|
|
4922
4967
|
for (let s2 = 0; s2 < r; ++s2)
|
|
@@ -4929,16 +4974,16 @@
|
|
|
4929
4974
|
}
|
|
4930
4975
|
return i.map((s2) => Array.from(s2.values()));
|
|
4931
4976
|
}
|
|
4932
|
-
function
|
|
4977
|
+
function ye(t, e = []) {
|
|
4933
4978
|
if (t === void 0 || !t.getIsReadyOrError()) return;
|
|
4934
4979
|
const n2 = t.resourceType.name, r = t.getDataAsJson();
|
|
4935
|
-
if (e.length > 0 && (n2 ===
|
|
4980
|
+
if (e.length > 0 && (n2 === ae || n2 === z))
|
|
4936
4981
|
throw new Error(`Unexpected nested super-partitioned resource: ${n2}`);
|
|
4937
4982
|
switch (n2) {
|
|
4938
|
-
case
|
|
4939
|
-
case
|
|
4983
|
+
case se:
|
|
4984
|
+
case oe:
|
|
4940
4985
|
throw new Error(`Only data columns are supported, got: ${n2}`);
|
|
4941
|
-
case
|
|
4986
|
+
case q: {
|
|
4942
4987
|
if (typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
|
|
4943
4988
|
throw new Error(`Missing partitionKeyLength in metadata for ${n2}`);
|
|
4944
4989
|
const i = [];
|
|
@@ -4954,12 +4999,12 @@
|
|
|
4954
4999
|
parts: i
|
|
4955
5000
|
};
|
|
4956
5001
|
}
|
|
4957
|
-
case
|
|
5002
|
+
case B: {
|
|
4958
5003
|
if (typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
|
|
4959
5004
|
throw new Error(`Missing partitionKeyLength in metadata for ${n2}`);
|
|
4960
5005
|
const i = [], s2 = /* @__PURE__ */ new Map();
|
|
4961
5006
|
for (const o of t.listInputFields()) {
|
|
4962
|
-
const a =
|
|
5007
|
+
const a = me(o), l2 = t.resolve({ field: o, assertFieldType: "Input" });
|
|
4963
5008
|
if (l2 === void 0) return;
|
|
4964
5009
|
let u2 = s2.get(a.baseKey);
|
|
4965
5010
|
u2 || (u2 = {}, s2.set(a.baseKey, u2)), a.type === "index" ? u2.index = l2 : u2.values = l2;
|
|
@@ -4981,16 +5026,16 @@
|
|
|
4981
5026
|
parts: i
|
|
4982
5027
|
};
|
|
4983
5028
|
}
|
|
4984
|
-
case
|
|
5029
|
+
case ae: {
|
|
4985
5030
|
if (typeof (r == null ? void 0 : r.superPartitionKeyLength) != "number" || typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
|
|
4986
5031
|
throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n2}`);
|
|
4987
5032
|
const i = r.superPartitionKeyLength + r.partitionKeyLength, s2 = [];
|
|
4988
5033
|
for (const o of t.listInputFields()) {
|
|
4989
5034
|
const a = t.resolve({ field: o, assertFieldType: "Input" });
|
|
4990
5035
|
if (a === void 0) return;
|
|
4991
|
-
if (a.resourceType.name !==
|
|
4992
|
-
throw new Error(`Expected ${
|
|
4993
|
-
const l2 =
|
|
5036
|
+
if (a.resourceType.name !== q)
|
|
5037
|
+
throw new Error(`Expected ${q} inside ${n2}, but got ${a.resourceType.name}`);
|
|
5038
|
+
const l2 = ye(a, JSON.parse(o));
|
|
4994
5039
|
if (l2 === void 0) return;
|
|
4995
5040
|
if (l2.type !== "JsonPartitioned")
|
|
4996
5041
|
throw new Error(`Unexpected inner result type for ${n2}: ${l2.type}`);
|
|
@@ -5002,16 +5047,16 @@
|
|
|
5002
5047
|
parts: s2
|
|
5003
5048
|
};
|
|
5004
5049
|
}
|
|
5005
|
-
case
|
|
5050
|
+
case z: {
|
|
5006
5051
|
if (typeof (r == null ? void 0 : r.superPartitionKeyLength) != "number" || typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
|
|
5007
5052
|
throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n2}`);
|
|
5008
5053
|
const i = r.superPartitionKeyLength + r.partitionKeyLength, s2 = [];
|
|
5009
5054
|
for (const o of t.listInputFields()) {
|
|
5010
5055
|
const a = t.resolve({ field: o, assertFieldType: "Input" });
|
|
5011
5056
|
if (a === void 0) return;
|
|
5012
|
-
if (a.resourceType.name !==
|
|
5013
|
-
throw new Error(`Expected ${
|
|
5014
|
-
const l2 =
|
|
5057
|
+
if (a.resourceType.name !== B)
|
|
5058
|
+
throw new Error(`Expected ${B} inside ${n2}, but got ${a.resourceType.name}`);
|
|
5059
|
+
const l2 = ye(a, JSON.parse(o));
|
|
5015
5060
|
if (l2 === void 0) return;
|
|
5016
5061
|
if (l2.type !== "BinaryPartitioned")
|
|
5017
5062
|
throw new Error(`Unexpected inner result type for ${n2}: ${l2.type}`);
|
|
@@ -5027,15 +5072,15 @@
|
|
|
5027
5072
|
throw new Error(`Unknown resource type: ${n2}`);
|
|
5028
5073
|
}
|
|
5029
5074
|
}
|
|
5030
|
-
function
|
|
5075
|
+
function _t(t) {
|
|
5031
5076
|
if (t !== void 0) {
|
|
5032
|
-
if (
|
|
5033
|
-
if (
|
|
5034
|
-
if (t instanceof
|
|
5077
|
+
if (K(t)) return t;
|
|
5078
|
+
if (En(t)) return Cn(t);
|
|
5079
|
+
if (t instanceof E) return ye(t);
|
|
5035
5080
|
throw new Error(`Unexpected input type: ${typeof t}`);
|
|
5036
5081
|
}
|
|
5037
5082
|
}
|
|
5038
|
-
function
|
|
5083
|
+
function It(t, e) {
|
|
5039
5084
|
const n2 = [...e].sort((s2, o) => o[0] - s2[0]);
|
|
5040
5085
|
if (t.type === "JsonPartitioned" || t.type === "BinaryPartitioned") {
|
|
5041
5086
|
const { partitionKeyLength: s2 } = t;
|
|
@@ -5095,39 +5140,45 @@
|
|
|
5095
5140
|
}
|
|
5096
5141
|
}
|
|
5097
5142
|
}
|
|
5098
|
-
|
|
5143
|
+
function Lt(t) {
|
|
5144
|
+
if (!Array.isArray(t)) return false;
|
|
5145
|
+
if (t.length === 0) return true;
|
|
5146
|
+
const e = t[0];
|
|
5147
|
+
return typeof e == "object" && e !== null && "key" in e && "val" in e;
|
|
5148
|
+
}
|
|
5149
|
+
class Tt {
|
|
5099
5150
|
constructor(e) {
|
|
5100
5151
|
this.columns = e;
|
|
5101
5152
|
}
|
|
5102
5153
|
selectColumns(e) {
|
|
5103
|
-
const n2 = typeof e == "function" ? e :
|
|
5154
|
+
const n2 = typeof e == "function" ? e : Gn(e);
|
|
5104
5155
|
return this.columns.filter((r) => n2(r.spec));
|
|
5105
5156
|
}
|
|
5106
5157
|
}
|
|
5107
|
-
function
|
|
5158
|
+
function Et(t) {
|
|
5108
5159
|
if (t)
|
|
5109
5160
|
return t.map((e) => ({
|
|
5110
|
-
type: `split:${
|
|
5161
|
+
type: `split:${Rn(e.axisId)}`,
|
|
5111
5162
|
label: e.label,
|
|
5112
5163
|
importance: 1e6
|
|
5113
5164
|
// High importance for split filters in labels
|
|
5114
5165
|
}));
|
|
5115
5166
|
}
|
|
5116
|
-
function
|
|
5167
|
+
function kt(t) {
|
|
5117
5168
|
if (t)
|
|
5118
5169
|
return t.map((e) => [e.axisIdx, e.value]);
|
|
5119
5170
|
}
|
|
5120
|
-
function
|
|
5171
|
+
function Ot(t, e) {
|
|
5121
5172
|
if (!e || e.length === 0) return t;
|
|
5122
5173
|
const n2 = [...e].sort((r, i) => r[0] - i[0]);
|
|
5123
|
-
return
|
|
5174
|
+
return ke({ id: t, axisFilters: n2 });
|
|
5124
5175
|
}
|
|
5125
|
-
function
|
|
5176
|
+
function Se(t) {
|
|
5126
5177
|
if (!t || typeof t != "object") return false;
|
|
5127
5178
|
const e = t, n2 = e.domain && typeof e.domain == "object" && Object.values(e.domain).some((i) => typeof i == "object" && i !== null && "anchor" in i), r = e.axes && Array.isArray(e.axes) && e.axes.some((i) => typeof i == "object" && i !== null && "anchor" in i);
|
|
5128
5179
|
return !!e.domainAnchor || n2 || r;
|
|
5129
5180
|
}
|
|
5130
|
-
function
|
|
5181
|
+
function Dt(t) {
|
|
5131
5182
|
if (typeof t != "object" || !("axes" in t) || t.axes === void 0)
|
|
5132
5183
|
return [];
|
|
5133
5184
|
const e = t.axes.map((n2, r) => typeof n2 == "object" && "split" in n2 && n2.split === true ? r : -1).filter((n2) => n2 !== -1);
|
|
@@ -5135,11 +5186,11 @@
|
|
|
5135
5186
|
throw new Error("Axis splitting is not supported when `partialAxesMatch` is defined.");
|
|
5136
5187
|
return e.sort((n2, r) => n2 - r), e;
|
|
5137
5188
|
}
|
|
5138
|
-
class
|
|
5189
|
+
class le {
|
|
5139
5190
|
constructor() {
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5191
|
+
O(this, "defaultProviderStore", []);
|
|
5192
|
+
O(this, "providers", [new Tt(this.defaultProviderStore)]);
|
|
5193
|
+
O(this, "axisLabelProviders", []);
|
|
5143
5194
|
}
|
|
5144
5195
|
addColumnProvider(e) {
|
|
5145
5196
|
return this.providers.push(e), this;
|
|
@@ -5161,117 +5212,135 @@
|
|
|
5161
5212
|
}
|
|
5162
5213
|
}
|
|
5163
5214
|
getUniversalEntries(e, n2) {
|
|
5164
|
-
const { anchorCtx: r, labelOps: i, dontWaitAllData: s2 = false, overrideLabelAnnotation: o = false } = n2 ?? {},
|
|
5215
|
+
const { anchorCtx: r, labelOps: i, dontWaitAllData: s2 = false, overrideLabelAnnotation: o = false, exclude: a } = n2 ?? {}, l2 = {
|
|
5165
5216
|
...o && (i == null ? void 0 : i.includeNativeLabel) !== false ? { includeNativeLabel: true } : {},
|
|
5166
5217
|
...i ?? {}
|
|
5167
|
-
}
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5218
|
+
};
|
|
5219
|
+
let u2 = () => false;
|
|
5220
|
+
if (a) {
|
|
5221
|
+
const p2 = (Array.isArray(a) ? a : [a]).map((g) => {
|
|
5222
|
+
if (Se(g)) {
|
|
5223
|
+
if (!r)
|
|
5224
|
+
throw new Error("Anchored selectors in exclude require an AnchoredIdDeriver to be provided in options.");
|
|
5225
|
+
return Gn(Mn(r.anchors, g, n2));
|
|
5226
|
+
} else
|
|
5227
|
+
return Gn(g);
|
|
5228
|
+
});
|
|
5229
|
+
u2 = (g) => p2.some((b) => b(g));
|
|
5230
|
+
}
|
|
5231
|
+
const c2 = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], d = [], y = /* @__PURE__ */ new Set();
|
|
5232
|
+
for (const p2 of c2) {
|
|
5233
|
+
const g = Se(p2);
|
|
5234
|
+
let b;
|
|
5235
|
+
if (g) {
|
|
5172
5236
|
if (!r)
|
|
5173
5237
|
throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");
|
|
5174
|
-
|
|
5238
|
+
b = Mn(r.anchors, p2, n2);
|
|
5175
5239
|
} else
|
|
5176
|
-
|
|
5177
|
-
const
|
|
5178
|
-
for (const
|
|
5179
|
-
const
|
|
5180
|
-
for (const
|
|
5181
|
-
if (
|
|
5182
|
-
|
|
5240
|
+
b = p2;
|
|
5241
|
+
const h2 = /* @__PURE__ */ new Set(), I = [];
|
|
5242
|
+
for (const A of this.providers) {
|
|
5243
|
+
const L = A.selectColumns(b);
|
|
5244
|
+
for (const P2 of L) {
|
|
5245
|
+
if (u2(P2.spec)) continue;
|
|
5246
|
+
if (h2.has(P2.id))
|
|
5247
|
+
throw new Error(`Duplicate column id ${P2.id} in provider ${A.constructor.name}`);
|
|
5248
|
+
const R = Qn(P2.spec);
|
|
5249
|
+
y.has(R) || (h2.add(P2.id), y.add(R), I.push(P2));
|
|
5183
5250
|
}
|
|
5184
5251
|
}
|
|
5185
|
-
if (
|
|
5186
|
-
const
|
|
5187
|
-
for (const
|
|
5188
|
-
if (!f(
|
|
5189
|
-
const
|
|
5252
|
+
if (I.length === 0) continue;
|
|
5253
|
+
const x = Dt(p2), v = x.length > 0;
|
|
5254
|
+
for (const A of I) {
|
|
5255
|
+
if (!f(A.spec)) continue;
|
|
5256
|
+
const L = A.spec;
|
|
5190
5257
|
if (v) {
|
|
5191
|
-
|
|
5192
|
-
|
|
5258
|
+
if (Lt(A.data))
|
|
5259
|
+
throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${A.id}`);
|
|
5260
|
+
const P2 = _t(A.data);
|
|
5261
|
+
if (!P2) {
|
|
5193
5262
|
if (s2) continue;
|
|
5194
5263
|
return;
|
|
5195
5264
|
}
|
|
5196
|
-
if (!
|
|
5197
|
-
throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${
|
|
5198
|
-
const
|
|
5199
|
-
if (
|
|
5200
|
-
throw new Error(`Not enough partition keys (${
|
|
5201
|
-
const
|
|
5202
|
-
if (
|
|
5203
|
-
if (
|
|
5265
|
+
if (!Sn(P2))
|
|
5266
|
+
throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${P2.type} for column ${A.id}`);
|
|
5267
|
+
const R = St(P2), k2 = x[x.length - 1];
|
|
5268
|
+
if (k2 >= P2.partitionKeyLength)
|
|
5269
|
+
throw new Error(`Not enough partition keys (${P2.partitionKeyLength}) for requested split axes (max index ${k2}) in column ${L.name}`);
|
|
5270
|
+
const W = x.map((S) => this.findLabels(p$1(L.axesSpec[S]))), j2 = [], $ = (S, G) => {
|
|
5271
|
+
if (G >= x.length) {
|
|
5272
|
+
if (j2.push([...S]), j2.length > 1e4)
|
|
5204
5273
|
throw new Error("Too many key combinations, aborting.");
|
|
5205
5274
|
return;
|
|
5206
5275
|
}
|
|
5207
|
-
const
|
|
5208
|
-
if (
|
|
5209
|
-
throw new Error(`Axis index ${
|
|
5210
|
-
const
|
|
5211
|
-
if (!
|
|
5212
|
-
|
|
5276
|
+
const V = x[G];
|
|
5277
|
+
if (V >= R.length)
|
|
5278
|
+
throw new Error(`Axis index ${V} out of bounds for unique keys array (length ${R.length}) during split key generation for column ${A.id}`);
|
|
5279
|
+
const N2 = R[V];
|
|
5280
|
+
if (!N2 || N2.length === 0) {
|
|
5281
|
+
j2.length = 0;
|
|
5213
5282
|
return;
|
|
5214
5283
|
}
|
|
5215
|
-
for (const
|
|
5216
|
-
|
|
5284
|
+
for (const ee of N2)
|
|
5285
|
+
S.push(ee), $(S, G + 1), S.pop();
|
|
5217
5286
|
};
|
|
5218
|
-
if (
|
|
5287
|
+
if ($([], 0), j2.length === 0)
|
|
5219
5288
|
continue;
|
|
5220
|
-
const
|
|
5221
|
-
for (let
|
|
5222
|
-
|
|
5223
|
-
const
|
|
5224
|
-
for (const
|
|
5225
|
-
const
|
|
5226
|
-
const
|
|
5227
|
-
return { axisIdx:
|
|
5289
|
+
const F = [...L.axesSpec], Be = x.map((S) => S);
|
|
5290
|
+
for (let S = x.length - 1; S >= 0; S--)
|
|
5291
|
+
F.splice(x[S], 1);
|
|
5292
|
+
const We = { ...L, axesSpec: F };
|
|
5293
|
+
for (const S of j2) {
|
|
5294
|
+
const G = S.map((V, N2) => {
|
|
5295
|
+
const ee = Be[N2], Ge = p$1(L.axesSpec[ee]), ue2 = W[N2], He = (ue2 == null ? void 0 : ue2[V]) ?? String(V);
|
|
5296
|
+
return { axisIdx: ee, axisId: Ge, value: V, label: He };
|
|
5228
5297
|
});
|
|
5229
|
-
|
|
5298
|
+
d.push({
|
|
5230
5299
|
type: "split",
|
|
5231
|
-
originalColumn:
|
|
5232
|
-
spec:
|
|
5233
|
-
adjustedSpec:
|
|
5234
|
-
dataEntries:
|
|
5235
|
-
axisFilters:
|
|
5300
|
+
originalColumn: A,
|
|
5301
|
+
spec: L,
|
|
5302
|
+
adjustedSpec: We,
|
|
5303
|
+
dataEntries: P2,
|
|
5304
|
+
axisFilters: G
|
|
5236
5305
|
});
|
|
5237
5306
|
}
|
|
5238
5307
|
} else
|
|
5239
|
-
|
|
5308
|
+
d.push({
|
|
5240
5309
|
type: "direct",
|
|
5241
|
-
originalColumn:
|
|
5242
|
-
spec:
|
|
5243
|
-
adjustedSpec:
|
|
5310
|
+
originalColumn: A,
|
|
5311
|
+
spec: L,
|
|
5312
|
+
adjustedSpec: L
|
|
5244
5313
|
});
|
|
5245
5314
|
}
|
|
5246
5315
|
}
|
|
5247
|
-
if (
|
|
5248
|
-
const
|
|
5249
|
-
|
|
5250
|
-
(
|
|
5251
|
-
spec:
|
|
5252
|
-
suffixTrace:
|
|
5316
|
+
if (d.length === 0) return [];
|
|
5317
|
+
const f$1 = je(
|
|
5318
|
+
d,
|
|
5319
|
+
(p2) => ({
|
|
5320
|
+
spec: p2.spec,
|
|
5321
|
+
suffixTrace: p2.type === "split" ? Et(p2.axisFilters) : void 0
|
|
5253
5322
|
}),
|
|
5254
|
-
|
|
5255
|
-
),
|
|
5256
|
-
for (const { value:
|
|
5257
|
-
const { originalColumn:
|
|
5323
|
+
l2
|
|
5324
|
+
), w2 = [];
|
|
5325
|
+
for (const { value: p2, label: g } of f$1) {
|
|
5326
|
+
const { originalColumn: b, spec: h2 } = p2, I = p2.type === "split" ? p2.axisFilters : void 0, x = kt(I);
|
|
5258
5327
|
let v;
|
|
5259
|
-
r ? v = r.deriveS(
|
|
5260
|
-
let
|
|
5261
|
-
o && (
|
|
5262
|
-
...
|
|
5328
|
+
r ? v = r.deriveS(h2, x) : v = Ot(b.id, x);
|
|
5329
|
+
let A = { ...p2.adjustedSpec };
|
|
5330
|
+
o && (A = {
|
|
5331
|
+
...A,
|
|
5263
5332
|
annotations: {
|
|
5264
|
-
...
|
|
5265
|
-
"pl7.app/label":
|
|
5333
|
+
...A.annotations ?? {},
|
|
5334
|
+
"pl7.app/label": g
|
|
5266
5335
|
}
|
|
5267
|
-
}),
|
|
5336
|
+
}), w2.push({
|
|
5268
5337
|
id: v,
|
|
5269
|
-
spec:
|
|
5270
|
-
data: () =>
|
|
5271
|
-
label:
|
|
5338
|
+
spec: A,
|
|
5339
|
+
data: () => p2.type === "split" ? Jn(It(p2.dataEntries, x)) : p2.originalColumn.data,
|
|
5340
|
+
label: g
|
|
5272
5341
|
});
|
|
5273
5342
|
}
|
|
5274
|
-
return
|
|
5343
|
+
return w2;
|
|
5275
5344
|
}
|
|
5276
5345
|
getColumns(e, n2) {
|
|
5277
5346
|
const r = this.getUniversalEntries(e, {
|
|
@@ -5296,19 +5365,19 @@
|
|
|
5296
5365
|
return i;
|
|
5297
5366
|
}
|
|
5298
5367
|
}
|
|
5299
|
-
function
|
|
5368
|
+
function de(t, e) {
|
|
5300
5369
|
if (t === void 0) return e === void 0;
|
|
5301
5370
|
if (e === void 0) return true;
|
|
5302
5371
|
for (const n2 in e)
|
|
5303
5372
|
if (t[n2] !== e[n2]) return false;
|
|
5304
5373
|
return true;
|
|
5305
5374
|
}
|
|
5306
|
-
function
|
|
5307
|
-
return
|
|
5375
|
+
function _e(t) {
|
|
5376
|
+
return Wn(t, (e) => e instanceof E ? e.handle : En(e) ? Nn(e, (n2) => n2.handle) : e);
|
|
5308
5377
|
}
|
|
5309
|
-
class
|
|
5378
|
+
class Rt {
|
|
5310
5379
|
constructor() {
|
|
5311
|
-
|
|
5380
|
+
O(this, "ctx", m());
|
|
5312
5381
|
}
|
|
5313
5382
|
/**
|
|
5314
5383
|
* @deprecated use getOptions()
|
|
@@ -5317,27 +5386,28 @@
|
|
|
5317
5386
|
return this.ctx.calculateOptions(e);
|
|
5318
5387
|
}
|
|
5319
5388
|
getOptions(e, n2) {
|
|
5320
|
-
const r = typeof e == "function" ? e :
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5389
|
+
const r = typeof e == "function" ? e : Gn(e), i = this.getSpecs().entries.filter((a) => r(a.obj));
|
|
5390
|
+
let s2 = {}, o = false;
|
|
5391
|
+
return typeof n2 < "u" && (typeof n2 == "function" ? s2 = n2 : typeof n2 == "object" && ("includeNativeLabel" in n2 || "separator" in n2 || "addLabelAsSuffix" in n2 ? s2 = n2 : (n2 = n2, s2 = n2.label ?? {}, o = n2.refsWithEnrichments ?? false))), typeof s2 == "object" ? je(i, (a) => a.obj, s2 ?? {}).map(({ value: { ref: a }, label: l2 }) => ({
|
|
5392
|
+
ref: te$1(a, o),
|
|
5393
|
+
label: l2
|
|
5394
|
+
})) : i.map(({ ref: a, obj: l2 }) => ({
|
|
5395
|
+
ref: te$1(a, o),
|
|
5396
|
+
label: s2(l2, a)
|
|
5327
5397
|
}));
|
|
5328
5398
|
}
|
|
5329
5399
|
resolveAnchorCtx(e) {
|
|
5330
|
-
if (e instanceof
|
|
5400
|
+
if (e instanceof _n) return e;
|
|
5331
5401
|
const n2 = {};
|
|
5332
5402
|
for (const [r, i] of Object.entries(e))
|
|
5333
|
-
if (
|
|
5403
|
+
if (ne(i)) {
|
|
5334
5404
|
const s2 = this.getPColumnSpecByRef(i);
|
|
5335
5405
|
if (!s2)
|
|
5336
5406
|
return;
|
|
5337
5407
|
n2[r] = s2;
|
|
5338
5408
|
} else
|
|
5339
5409
|
n2[r] = i;
|
|
5340
|
-
return new
|
|
5410
|
+
return new _n(n2);
|
|
5341
5411
|
}
|
|
5342
5412
|
/**
|
|
5343
5413
|
* Returns columns that match the provided anchors and selectors. It applies axis filters and label derivation.
|
|
@@ -5350,7 +5420,7 @@
|
|
|
5350
5420
|
getAnchoredPColumns(e, n2, r) {
|
|
5351
5421
|
const i = this.resolveAnchorCtx(e);
|
|
5352
5422
|
if (i)
|
|
5353
|
-
return new
|
|
5423
|
+
return new le().addColumnProvider(this).addAxisLabelProvider(this).getColumns(n2, {
|
|
5354
5424
|
...r,
|
|
5355
5425
|
anchorCtx: i
|
|
5356
5426
|
});
|
|
@@ -5387,7 +5457,7 @@
|
|
|
5387
5457
|
getCanonicalOptions(e, n2, r) {
|
|
5388
5458
|
const i = this.resolveAnchorCtx(e);
|
|
5389
5459
|
if (!i) return;
|
|
5390
|
-
const s2 = new
|
|
5460
|
+
const s2 = new le().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(n2, {
|
|
5391
5461
|
...r,
|
|
5392
5462
|
anchorCtx: i
|
|
5393
5463
|
});
|
|
@@ -5411,7 +5481,7 @@
|
|
|
5411
5481
|
ref: n2.ref,
|
|
5412
5482
|
obj: {
|
|
5413
5483
|
...n2.obj,
|
|
5414
|
-
data: new
|
|
5484
|
+
data: new E(n2.obj.data, [n2.ref.blockId, n2.ref.name])
|
|
5415
5485
|
}
|
|
5416
5486
|
}))
|
|
5417
5487
|
};
|
|
@@ -5430,9 +5500,9 @@
|
|
|
5430
5500
|
ref: n2.ref,
|
|
5431
5501
|
obj: {
|
|
5432
5502
|
...n2.obj,
|
|
5433
|
-
data:
|
|
5503
|
+
data: oe$1(
|
|
5434
5504
|
n2.obj.data,
|
|
5435
|
-
(r) => new
|
|
5505
|
+
(r) => new E(r, [n2.ref.blockId, n2.ref.name])
|
|
5436
5506
|
)
|
|
5437
5507
|
}
|
|
5438
5508
|
}))
|
|
@@ -5459,9 +5529,9 @@
|
|
|
5459
5529
|
)) == null ? void 0 : r.obj;
|
|
5460
5530
|
const n2 = this.ctx.getDataFromResultPoolByRef(e.blockId, e.name);
|
|
5461
5531
|
if (n2)
|
|
5462
|
-
return
|
|
5532
|
+
return Wn(
|
|
5463
5533
|
n2,
|
|
5464
|
-
(i) => new
|
|
5534
|
+
(i) => new E(i, [e.blockId, e.name])
|
|
5465
5535
|
);
|
|
5466
5536
|
}
|
|
5467
5537
|
/**
|
|
@@ -5472,7 +5542,7 @@
|
|
|
5472
5542
|
getPColumnByRef(e) {
|
|
5473
5543
|
const n2 = this.getDataByRef(e);
|
|
5474
5544
|
if (n2)
|
|
5475
|
-
return
|
|
5545
|
+
return qn(n2);
|
|
5476
5546
|
}
|
|
5477
5547
|
/**
|
|
5478
5548
|
* Returns spec associated with the ref ensuring that it is a p-column spec.
|
|
@@ -5504,10 +5574,10 @@
|
|
|
5504
5574
|
if (!f(r.obj.spec))
|
|
5505
5575
|
continue;
|
|
5506
5576
|
const i = r.obj.spec;
|
|
5507
|
-
if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length &&
|
|
5577
|
+
if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && de(e.domain, i.domain)) {
|
|
5508
5578
|
for (let s2 = 0; s2 < e.axesSpec.length; ++s2) {
|
|
5509
5579
|
const o = e.axesSpec[s2], a = i.axesSpec[s2];
|
|
5510
|
-
if (o.name !== a.name || o.type !== a.type || !
|
|
5580
|
+
if (o.name !== a.name || o.type !== a.type || !de(o.domain, a.domain))
|
|
5511
5581
|
continue e;
|
|
5512
5582
|
}
|
|
5513
5583
|
n2.push(r.obj);
|
|
@@ -5522,9 +5592,9 @@
|
|
|
5522
5592
|
findLabels(e) {
|
|
5523
5593
|
const n2 = this.getData();
|
|
5524
5594
|
for (const r of n2.entries) {
|
|
5525
|
-
if (!
|
|
5595
|
+
if (!rn(r.obj)) continue;
|
|
5526
5596
|
const i = r.obj.spec;
|
|
5527
|
-
if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type &&
|
|
5597
|
+
if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type && de(e.domain, i.axesSpec[0].domain)) {
|
|
5528
5598
|
if (r.obj.data.resourceType.name !== "PColumnData/Json")
|
|
5529
5599
|
throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
|
|
5530
5600
|
return Object.fromEntries(
|
|
@@ -5543,13 +5613,13 @@
|
|
|
5543
5613
|
* @returns An array of PColumn objects matching the selectors. Data is loaded on first access.
|
|
5544
5614
|
*/
|
|
5545
5615
|
selectColumns(e) {
|
|
5546
|
-
const n2 = typeof e == "function" ? e :
|
|
5616
|
+
const n2 = typeof e == "function" ? e : Gn(e);
|
|
5547
5617
|
return this.getSpecs().entries.filter(({ obj: i }) => f(i) ? n2(i) : false).map(({ ref: i, obj: s2 }) => {
|
|
5548
5618
|
const o = s2;
|
|
5549
5619
|
let a = null;
|
|
5550
5620
|
const l2 = this;
|
|
5551
5621
|
return {
|
|
5552
|
-
id:
|
|
5622
|
+
id: ke(i),
|
|
5553
5623
|
spec: o,
|
|
5554
5624
|
get data() {
|
|
5555
5625
|
var u2;
|
|
@@ -5574,13 +5644,13 @@
|
|
|
5574
5644
|
return r;
|
|
5575
5645
|
}
|
|
5576
5646
|
}
|
|
5577
|
-
class
|
|
5647
|
+
class te {
|
|
5578
5648
|
constructor() {
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5649
|
+
O(this, "ctx");
|
|
5650
|
+
O(this, "args");
|
|
5651
|
+
O(this, "uiState");
|
|
5652
|
+
O(this, "_activeArgsCache");
|
|
5653
|
+
O(this, "resultPool", new Rt());
|
|
5584
5654
|
this.ctx = m(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
|
|
5585
5655
|
}
|
|
5586
5656
|
/**
|
|
@@ -5597,16 +5667,16 @@
|
|
|
5597
5667
|
// return this.ctx.featureFlags;
|
|
5598
5668
|
// }
|
|
5599
5669
|
getNamedAccessor(e) {
|
|
5600
|
-
return
|
|
5670
|
+
return he(
|
|
5601
5671
|
this.ctx.getAccessorHandleByName(e),
|
|
5602
|
-
(n2) => new
|
|
5672
|
+
(n2) => new E(n2, [e])
|
|
5603
5673
|
);
|
|
5604
5674
|
}
|
|
5605
5675
|
get prerun() {
|
|
5606
|
-
return this.getNamedAccessor(
|
|
5676
|
+
return this.getNamedAccessor(Re);
|
|
5607
5677
|
}
|
|
5608
5678
|
get outputs() {
|
|
5609
|
-
return this.getNamedAccessor(
|
|
5679
|
+
return this.getNamedAccessor(Fe);
|
|
5610
5680
|
}
|
|
5611
5681
|
/**
|
|
5612
5682
|
* Find labels data for a given axis id. It will search for a label column and return its data as a map.
|
|
@@ -5618,13 +5688,13 @@
|
|
|
5618
5688
|
}
|
|
5619
5689
|
verifyInlineAndExplicitColumnsSupport(e) {
|
|
5620
5690
|
var i;
|
|
5621
|
-
const n2 = e.some((s2) => !(s2.data instanceof
|
|
5691
|
+
const n2 = e.some((s2) => !(s2.data instanceof E) || En(s2.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === true;
|
|
5622
5692
|
if (n2 && !r) throw Error("Inline or explicit columns not supported");
|
|
5623
5693
|
}
|
|
5624
5694
|
// TODO remove all non-PColumn fields
|
|
5625
5695
|
createPFrame(e) {
|
|
5626
5696
|
return this.verifyInlineAndExplicitColumnsSupport(e), this.ctx.createPFrame(
|
|
5627
|
-
e.map((n2) =>
|
|
5697
|
+
e.map((n2) => _e(n2))
|
|
5628
5698
|
);
|
|
5629
5699
|
}
|
|
5630
5700
|
createPTable(e) {
|
|
@@ -5636,8 +5706,8 @@
|
|
|
5636
5706
|
},
|
|
5637
5707
|
filters: e.filters ?? [],
|
|
5638
5708
|
sorting: e.sorting ?? []
|
|
5639
|
-
} : n2 = e, this.verifyInlineAndExplicitColumnsSupport(
|
|
5640
|
-
|
|
5709
|
+
} : n2 = e, this.verifyInlineAndExplicitColumnsSupport(Xn(n2.src)), this.ctx.createPTable(
|
|
5710
|
+
Un(n2, (r) => _e(r))
|
|
5641
5711
|
);
|
|
5642
5712
|
}
|
|
5643
5713
|
/** @deprecated scheduled for removal from SDK */
|
|
@@ -5645,21 +5715,29 @@
|
|
|
5645
5715
|
return this.ctx.getBlockLabel(e);
|
|
5646
5716
|
}
|
|
5647
5717
|
getCurrentUnstableMarker() {
|
|
5648
|
-
|
|
5649
|
-
|
|
5718
|
+
return this.ctx.getCurrentUnstableMarker();
|
|
5719
|
+
}
|
|
5720
|
+
logInfo(e) {
|
|
5721
|
+
this.ctx.logInfo(e);
|
|
5722
|
+
}
|
|
5723
|
+
logWarn(e) {
|
|
5724
|
+
this.ctx.logWarn(e);
|
|
5725
|
+
}
|
|
5726
|
+
logError(e) {
|
|
5727
|
+
this.ctx.logError(e);
|
|
5650
5728
|
}
|
|
5651
5729
|
}
|
|
5652
|
-
const
|
|
5653
|
-
function
|
|
5730
|
+
const Y = "1.34.8";
|
|
5731
|
+
function Ft(t) {
|
|
5654
5732
|
return t.__renderLambda === true;
|
|
5655
5733
|
}
|
|
5656
|
-
function
|
|
5734
|
+
function pe(t) {
|
|
5657
5735
|
if (t !== void 0)
|
|
5658
|
-
return
|
|
5736
|
+
return Ft(t) ? t.handle : t;
|
|
5659
5737
|
}
|
|
5660
5738
|
class T {
|
|
5661
|
-
constructor(e, n2, r, i, s2, o, a) {
|
|
5662
|
-
this._renderingMode = e, this._initialArgs = n2, this._initialUiState = r, this._outputs = i, this._inputsValid = s2, this._sections = o, this._title = a;
|
|
5739
|
+
constructor(e, n2, r, i, s2, o, a, l2) {
|
|
5740
|
+
this._renderingMode = e, this._initialArgs = n2, this._initialUiState = r, this._outputs = i, this._inputsValid = s2, this._sections = o, this._title = a, this._enrichmentTargets = l2;
|
|
5663
5741
|
}
|
|
5664
5742
|
static create(e = "Heavy") {
|
|
5665
5743
|
return new T(
|
|
@@ -5667,15 +5745,16 @@
|
|
|
5667
5745
|
void 0,
|
|
5668
5746
|
{},
|
|
5669
5747
|
{},
|
|
5670
|
-
|
|
5671
|
-
|
|
5748
|
+
re(true),
|
|
5749
|
+
re([]),
|
|
5750
|
+
void 0,
|
|
5672
5751
|
void 0
|
|
5673
5752
|
);
|
|
5674
5753
|
}
|
|
5675
5754
|
output(e, n2, r = {}) {
|
|
5676
5755
|
if (typeof n2 == "function") {
|
|
5677
5756
|
const i = `output#${e}`;
|
|
5678
|
-
return
|
|
5757
|
+
return H(i, () => n2(new te())), new T(
|
|
5679
5758
|
this._renderingMode,
|
|
5680
5759
|
this._initialArgs,
|
|
5681
5760
|
this._initialUiState,
|
|
@@ -5689,7 +5768,8 @@
|
|
|
5689
5768
|
},
|
|
5690
5769
|
this._inputsValid,
|
|
5691
5770
|
this._sections,
|
|
5692
|
-
this._title
|
|
5771
|
+
this._title,
|
|
5772
|
+
this._enrichmentTargets
|
|
5693
5773
|
);
|
|
5694
5774
|
} else
|
|
5695
5775
|
return new T(
|
|
@@ -5702,7 +5782,8 @@
|
|
|
5702
5782
|
},
|
|
5703
5783
|
this._inputsValid,
|
|
5704
5784
|
this._sections,
|
|
5705
|
-
this._title
|
|
5785
|
+
this._title,
|
|
5786
|
+
this._enrichmentTargets
|
|
5706
5787
|
);
|
|
5707
5788
|
}
|
|
5708
5789
|
/** Shortcut for {@link output} with retentive flag set to true. */
|
|
@@ -5710,7 +5791,7 @@
|
|
|
5710
5791
|
return this.output(e, n2, { retentive: true });
|
|
5711
5792
|
}
|
|
5712
5793
|
argsValid(e) {
|
|
5713
|
-
return typeof e == "function" ? (
|
|
5794
|
+
return typeof e == "function" ? (H("inputsValid", () => e(new te())), new T(
|
|
5714
5795
|
this._renderingMode,
|
|
5715
5796
|
this._initialArgs,
|
|
5716
5797
|
this._initialUiState,
|
|
@@ -5720,7 +5801,8 @@
|
|
|
5720
5801
|
handle: "inputsValid"
|
|
5721
5802
|
},
|
|
5722
5803
|
this._sections,
|
|
5723
|
-
this._title
|
|
5804
|
+
this._title,
|
|
5805
|
+
this._enrichmentTargets
|
|
5724
5806
|
)) : new T(
|
|
5725
5807
|
this._renderingMode,
|
|
5726
5808
|
this._initialArgs,
|
|
@@ -5728,18 +5810,20 @@
|
|
|
5728
5810
|
this._outputs,
|
|
5729
5811
|
e,
|
|
5730
5812
|
this._sections,
|
|
5731
|
-
this._title
|
|
5813
|
+
this._title,
|
|
5814
|
+
this._enrichmentTargets
|
|
5732
5815
|
);
|
|
5733
5816
|
}
|
|
5734
5817
|
sections(e) {
|
|
5735
|
-
return Array.isArray(e) ? this.sections(
|
|
5818
|
+
return Array.isArray(e) ? this.sections(re(e)) : typeof e == "function" ? (H("sections", () => e(new te())), new T(
|
|
5736
5819
|
this._renderingMode,
|
|
5737
5820
|
this._initialArgs,
|
|
5738
5821
|
this._initialUiState,
|
|
5739
5822
|
this._outputs,
|
|
5740
5823
|
this._inputsValid,
|
|
5741
5824
|
{ __renderLambda: true, handle: "sections" },
|
|
5742
|
-
this._title
|
|
5825
|
+
this._title,
|
|
5826
|
+
this._enrichmentTargets
|
|
5743
5827
|
)) : new T(
|
|
5744
5828
|
this._renderingMode,
|
|
5745
5829
|
this._initialArgs,
|
|
@@ -5747,19 +5831,21 @@
|
|
|
5747
5831
|
this._outputs,
|
|
5748
5832
|
this._inputsValid,
|
|
5749
5833
|
e,
|
|
5750
|
-
this._title
|
|
5834
|
+
this._title,
|
|
5835
|
+
this._enrichmentTargets
|
|
5751
5836
|
);
|
|
5752
5837
|
}
|
|
5753
5838
|
/** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
|
|
5754
5839
|
title(e) {
|
|
5755
|
-
return
|
|
5840
|
+
return H("title", () => e(new te())), new T(
|
|
5756
5841
|
this._renderingMode,
|
|
5757
5842
|
this._initialArgs,
|
|
5758
5843
|
this._initialUiState,
|
|
5759
5844
|
this._outputs,
|
|
5760
5845
|
this._inputsValid,
|
|
5761
5846
|
this._sections,
|
|
5762
|
-
{ __renderLambda: true, handle: "title" }
|
|
5847
|
+
{ __renderLambda: true, handle: "title" },
|
|
5848
|
+
this._enrichmentTargets
|
|
5763
5849
|
);
|
|
5764
5850
|
}
|
|
5765
5851
|
/**
|
|
@@ -5774,7 +5860,8 @@
|
|
|
5774
5860
|
this._outputs,
|
|
5775
5861
|
this._inputsValid,
|
|
5776
5862
|
this._sections,
|
|
5777
|
-
this._title
|
|
5863
|
+
this._title,
|
|
5864
|
+
this._enrichmentTargets
|
|
5778
5865
|
);
|
|
5779
5866
|
}
|
|
5780
5867
|
/** Sets initial args for the block, this value must be specified. */
|
|
@@ -5786,7 +5873,8 @@
|
|
|
5786
5873
|
this._outputs,
|
|
5787
5874
|
this._inputsValid,
|
|
5788
5875
|
this._sections,
|
|
5789
|
-
this._title
|
|
5876
|
+
this._title,
|
|
5877
|
+
this._enrichmentTargets
|
|
5790
5878
|
);
|
|
5791
5879
|
}
|
|
5792
5880
|
/** Defines type and sets initial value for block UiState. */
|
|
@@ -5798,7 +5886,24 @@
|
|
|
5798
5886
|
this._outputs,
|
|
5799
5887
|
this._inputsValid,
|
|
5800
5888
|
this._sections,
|
|
5801
|
-
this._title
|
|
5889
|
+
this._title,
|
|
5890
|
+
this._enrichmentTargets
|
|
5891
|
+
);
|
|
5892
|
+
}
|
|
5893
|
+
/**
|
|
5894
|
+
* Defines how to derive list of upstream references this block is meant to enrich with its exports from block args.
|
|
5895
|
+
* Influences dependency graph construction.
|
|
5896
|
+
*/
|
|
5897
|
+
enriches(e) {
|
|
5898
|
+
return H("enrichmentTargets", e), new T(
|
|
5899
|
+
this._renderingMode,
|
|
5900
|
+
this._initialArgs,
|
|
5901
|
+
this._initialUiState,
|
|
5902
|
+
this._outputs,
|
|
5903
|
+
this._inputsValid,
|
|
5904
|
+
this._sections,
|
|
5905
|
+
this._title,
|
|
5906
|
+
{ __renderLambda: true, handle: "enrichmentTargets" }
|
|
5802
5907
|
);
|
|
5803
5908
|
}
|
|
5804
5909
|
/** Renders all provided block settings into a pre-configured platforma API
|
|
@@ -5808,85 +5913,129 @@
|
|
|
5808
5913
|
if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
|
|
5809
5914
|
const e = {
|
|
5810
5915
|
v3: {
|
|
5811
|
-
sdkVersion:
|
|
5916
|
+
sdkVersion: Y,
|
|
5812
5917
|
renderingMode: this._renderingMode,
|
|
5813
5918
|
initialArgs: this._initialArgs,
|
|
5814
5919
|
initialUiState: this._initialUiState,
|
|
5815
5920
|
inputsValid: this._inputsValid,
|
|
5816
5921
|
sections: this._sections,
|
|
5817
5922
|
title: this._title,
|
|
5818
|
-
outputs: this._outputs
|
|
5923
|
+
outputs: this._outputs,
|
|
5924
|
+
enrichmentTargets: this._enrichmentTargets
|
|
5819
5925
|
},
|
|
5820
5926
|
// fields below are added to allow previous desktop versions read generated configs
|
|
5821
|
-
sdkVersion:
|
|
5927
|
+
sdkVersion: Y,
|
|
5822
5928
|
renderingMode: this._renderingMode,
|
|
5823
5929
|
initialArgs: this._initialArgs,
|
|
5824
|
-
inputsValid:
|
|
5825
|
-
sections:
|
|
5930
|
+
inputsValid: pe(this._inputsValid),
|
|
5931
|
+
sections: pe(this._sections),
|
|
5826
5932
|
outputs: Object.fromEntries(
|
|
5827
|
-
Object.entries(this._outputs).map(([n2, r]) => [n2,
|
|
5933
|
+
Object.entries(this._outputs).map(([n2, r]) => [n2, pe(r)])
|
|
5828
5934
|
)
|
|
5829
5935
|
};
|
|
5830
|
-
return
|
|
5831
|
-
}
|
|
5832
|
-
}
|
|
5833
|
-
function
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5936
|
+
return pt() ? De({ sdkVersion: Y }) : { config: e };
|
|
5937
|
+
}
|
|
5938
|
+
}
|
|
5939
|
+
function ve(t) {
|
|
5940
|
+
return t.axesSpec.length === 1 && t.name === "pl7.app/label";
|
|
5941
|
+
}
|
|
5942
|
+
function Ne(t) {
|
|
5943
|
+
return new le().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
|
|
5944
|
+
name: "pl7.app/label",
|
|
5945
|
+
axes: [{}]
|
|
5946
|
+
// exactly one axis
|
|
5947
|
+
}, { dontWaitAllData: true });
|
|
5948
|
+
}
|
|
5949
|
+
function Je(t, e) {
|
|
5950
|
+
const n2 = [], r = [];
|
|
5951
|
+
for (const a of t)
|
|
5952
|
+
ve(a.spec) ? n2.push(a) : r.push(a);
|
|
5953
|
+
const i = [];
|
|
5954
|
+
for (const a of r)
|
|
5955
|
+
for (const l2 of a.spec.axesSpec) {
|
|
5956
|
+
const u2 = p$1(l2);
|
|
5957
|
+
i.some((c2) => Z$1(c2, u2)) || i.push(u2);
|
|
5958
|
+
}
|
|
5959
|
+
for (const a of n2) {
|
|
5960
|
+
const l2 = p$1(a.spec.axesSpec[0]), u2 = i.findIndex((c2) => Z$1(c2, l2));
|
|
5961
|
+
u2 !== -1 && i.splice(u2, 1);
|
|
5962
|
+
}
|
|
5963
|
+
const s2 = (a, l2) => {
|
|
5964
|
+
let u2 = a.toString();
|
|
5965
|
+
if (l2)
|
|
5966
|
+
for (const c2 in l2)
|
|
5967
|
+
u2 += c2, u2 += l2[c2];
|
|
5968
|
+
return u2;
|
|
5969
|
+
}, o = [];
|
|
5970
|
+
for (const a of e) {
|
|
5971
|
+
const l2 = a.spec.axesSpec[0], u2 = p$1(l2), c2 = i.findIndex((d) => Z$1(d, u2));
|
|
5972
|
+
if (c2 !== -1) {
|
|
5973
|
+
const d = i[c2], y = Object.keys(d.domain ?? {}).length, f2 = Object.keys(l2.domain ?? {}).length;
|
|
5974
|
+
y > f2 ? o.push({
|
|
5975
|
+
id: s2(a.id, d.domain),
|
|
5976
|
+
spec: {
|
|
5977
|
+
...a.spec,
|
|
5978
|
+
axesSpec: [{ ...d, annotations: l2.annotations }]
|
|
5979
|
+
},
|
|
5980
|
+
data: a.data
|
|
5981
|
+
}) : o.push(a), i.splice(c2, 1);
|
|
5982
|
+
}
|
|
5983
|
+
}
|
|
5984
|
+
return o;
|
|
5985
|
+
}
|
|
5986
|
+
function Me(t) {
|
|
5987
|
+
const e = (i) => Array.isArray(i), n2 = (i) => i instanceof E, r = (i) => typeof i == "object" && "type" in i;
|
|
5988
|
+
return t.map((i) => i.data).every((i) => {
|
|
5989
|
+
if (e(i))
|
|
5990
|
+
return true;
|
|
5991
|
+
if (n2(i))
|
|
5992
|
+
return i.getIsReadyOrError();
|
|
5993
|
+
if (r(i))
|
|
5994
|
+
switch (i.type) {
|
|
5995
|
+
case "Json":
|
|
5996
|
+
return true;
|
|
5997
|
+
case "JsonPartitioned":
|
|
5998
|
+
return Object.values(i.parts).every((o) => o.getIsReadyOrError());
|
|
5999
|
+
case "BinaryPartitioned":
|
|
6000
|
+
return Object.values(i.parts).every((o) => o.index.getIsReadyOrError() && o.values.getIsReadyOrError());
|
|
5863
6001
|
}
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
let
|
|
5870
|
-
const
|
|
5871
|
-
if (
|
|
5872
|
-
|
|
5873
|
-
for (const
|
|
5874
|
-
|
|
5875
|
-
}
|
|
5876
|
-
return
|
|
6002
|
+
else
|
|
6003
|
+
throw Error(`unsupported column data type: ${i}`);
|
|
6004
|
+
});
|
|
6005
|
+
}
|
|
6006
|
+
function Ue(t, e, n2, r, i, s2) {
|
|
6007
|
+
let o = t;
|
|
6008
|
+
const a = [];
|
|
6009
|
+
if (s2) {
|
|
6010
|
+
o = [];
|
|
6011
|
+
for (const l2 of t)
|
|
6012
|
+
s2(l2.spec) ? o.push(l2) : a.push(l2);
|
|
6013
|
+
}
|
|
6014
|
+
return a.push(...e), {
|
|
5877
6015
|
src: {
|
|
5878
6016
|
type: "outer",
|
|
5879
6017
|
primary: {
|
|
5880
|
-
type:
|
|
5881
|
-
entries:
|
|
6018
|
+
type: n2,
|
|
6019
|
+
entries: o.map((l2) => ({ type: "column", column: l2 }))
|
|
5882
6020
|
},
|
|
5883
|
-
secondary:
|
|
6021
|
+
secondary: a.map((l2) => ({ type: "column", column: l2 }))
|
|
5884
6022
|
},
|
|
5885
|
-
filters:
|
|
5886
|
-
sorting:
|
|
5887
|
-
}
|
|
6023
|
+
filters: r,
|
|
6024
|
+
sorting: i
|
|
6025
|
+
};
|
|
5888
6026
|
}
|
|
5889
|
-
|
|
6027
|
+
function Dn(t, e, n2, r) {
|
|
6028
|
+
var u2, c2;
|
|
6029
|
+
Array.isArray(r) && (r = { filters: r });
|
|
6030
|
+
const i = (r == null ? void 0 : r.coreJoinType) ?? "full", s2 = [...(r == null ? void 0 : r.filters) ?? [], ...((u2 = n2 == null ? void 0 : n2.pTableParams) == null ? void 0 : u2.filters) ?? []], o = ((c2 = n2 == null ? void 0 : n2.pTableParams) == null ? void 0 : c2.sorting) ?? [], a = Ne(t.resultPool);
|
|
6031
|
+
if (!a) return;
|
|
6032
|
+
const l2 = Je(e.map(Fn), a);
|
|
6033
|
+
if (Me([...e, ...l2]))
|
|
6034
|
+
return t.createPTable(
|
|
6035
|
+
Ue(e, l2, i, s2, o, r == null ? void 0 : r.coreColumnPredicate)
|
|
6036
|
+
);
|
|
6037
|
+
}
|
|
6038
|
+
const Vt = (t, e) => {
|
|
5890
6039
|
let n2 = t.toString();
|
|
5891
6040
|
return e == null || e.forEach((r) => {
|
|
5892
6041
|
if (r)
|
|
@@ -5894,7 +6043,7 @@
|
|
|
5894
6043
|
n2 += i, n2 += s2;
|
|
5895
6044
|
}), n2;
|
|
5896
6045
|
};
|
|
5897
|
-
function
|
|
6046
|
+
function $t(t) {
|
|
5898
6047
|
if (!t.length)
|
|
5899
6048
|
return [];
|
|
5900
6049
|
let e = [[]];
|
|
@@ -5905,104 +6054,131 @@
|
|
|
5905
6054
|
}), e = r;
|
|
5906
6055
|
}), e;
|
|
5907
6056
|
}
|
|
5908
|
-
function
|
|
5909
|
-
|
|
5910
|
-
return
|
|
6057
|
+
function Nt(t) {
|
|
6058
|
+
var e;
|
|
6059
|
+
return t.axesSpec.length === 2 && ((e = t.annotations) == null ? void 0 : e[Mt]) === "true";
|
|
6060
|
+
}
|
|
6061
|
+
const Jt = "pl7.app/graph/isVirtual", Ie = "pl7.app/label", Mt = "pl7.app/isLinkerColumn";
|
|
6062
|
+
function Ut(t) {
|
|
6063
|
+
var n2, r;
|
|
6064
|
+
const e = /* @__PURE__ */ new Map();
|
|
6065
|
+
for (const { spec: i } of t) {
|
|
6066
|
+
const s2 = i.axesSpec.map(p$1).map(ue);
|
|
6067
|
+
s2.forEach((o) => {
|
|
6068
|
+
e.has(o) || e.set(o, /* @__PURE__ */ new Set());
|
|
6069
|
+
});
|
|
6070
|
+
for (let o = 0; o < s2.length - 1; o++)
|
|
6071
|
+
for (let a = o + 1; a < s2.length; a++) {
|
|
6072
|
+
const l2 = s2[o], u2 = s2[a];
|
|
6073
|
+
(n2 = e.get(l2)) == null || n2.add(u2), (r = e.get(u2)) == null || r.add(l2);
|
|
6074
|
+
}
|
|
6075
|
+
}
|
|
6076
|
+
return e;
|
|
5911
6077
|
}
|
|
5912
|
-
function
|
|
5913
|
-
const n2 = t.
|
|
5914
|
-
|
|
6078
|
+
function Bt(t, e) {
|
|
6079
|
+
const n2 = Ut(t), r = [...n2.keys()].map(ce$1), i = [];
|
|
6080
|
+
for (const l2 of e.values()) {
|
|
6081
|
+
const u2 = r.find((c2) => Z$1(l2, c2));
|
|
6082
|
+
u2 && i.push(ue(u2));
|
|
6083
|
+
}
|
|
6084
|
+
const s2 = new Set(i), o = /* @__PURE__ */ new Map();
|
|
6085
|
+
let a = [...i];
|
|
6086
|
+
for (; a.length; ) {
|
|
6087
|
+
const l2 = [];
|
|
6088
|
+
for (const u2 of a)
|
|
6089
|
+
for (const c2 of n2.get(u2) ?? [])
|
|
6090
|
+
s2.has(c2) || (l2.push(c2), s2.add(c2), o.set(c2, ce$1(c2)));
|
|
6091
|
+
a = l2;
|
|
6092
|
+
}
|
|
6093
|
+
return o;
|
|
6094
|
+
}
|
|
6095
|
+
function Wt(t, e) {
|
|
6096
|
+
const n2 = [];
|
|
6097
|
+
return e.forEach((r) => {
|
|
6098
|
+
n2.push(...Gt(t, r));
|
|
6099
|
+
}), n2;
|
|
5915
6100
|
}
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
6101
|
+
function Gt(t, e) {
|
|
6102
|
+
const n2 = e.spec.axesSpec.map(p$1);
|
|
6103
|
+
if (n2.every((u2) => t.has(ue(u2))))
|
|
6104
|
+
return [e];
|
|
6105
|
+
const r = n2.map((u2) => {
|
|
6106
|
+
const c2 = [];
|
|
6107
|
+
for (const [d, y] of t)
|
|
6108
|
+
Z$1(y, u2) && !Z$1(u2, y) && c2.push(y);
|
|
6109
|
+
return c2;
|
|
6110
|
+
}), i = $t(r), s2 = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), a = i.map((u2) => {
|
|
6111
|
+
const c2 = /* @__PURE__ */ new Set();
|
|
6112
|
+
return u2.map((d, y) => {
|
|
6113
|
+
const f2 = e.spec.axesSpec[y].domain, w2 = d.domain;
|
|
6114
|
+
return Object.entries(w2 ?? {}).forEach(([p2, g]) => {
|
|
6115
|
+
if ((f2 == null ? void 0 : f2[p2]) === void 0) {
|
|
6116
|
+
const b = JSON.stringify([p2, g]);
|
|
6117
|
+
c2.add(b), s2.add(b);
|
|
5931
6118
|
}
|
|
5932
6119
|
}), {
|
|
5933
|
-
...
|
|
5934
|
-
annotations: e.spec.axesSpec[
|
|
6120
|
+
...d,
|
|
6121
|
+
annotations: e.spec.axesSpec[y].annotations
|
|
5935
6122
|
};
|
|
5936
|
-
}),
|
|
6123
|
+
}), c2;
|
|
6124
|
+
});
|
|
6125
|
+
[...s2].forEach((u2) => {
|
|
6126
|
+
a.some((c2) => !c2.has(u2)) && o.add(u2);
|
|
5937
6127
|
});
|
|
5938
|
-
|
|
5939
|
-
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
return (g = JSON.parse(v)) == null ? void 0 : g[1];
|
|
5945
|
-
}).join(" / "), A2 = {
|
|
6128
|
+
const l2 = i.map((u2, c2) => {
|
|
6129
|
+
var p2;
|
|
6130
|
+
const d = Vt(e.id, u2.map((g) => g.domain)), y = ((p2 = e.spec.annotations) == null ? void 0 : p2[Ie]) ?? "", f2 = [...a[c2]].filter((g) => o.has(g)).sort().map((g) => {
|
|
6131
|
+
var b;
|
|
6132
|
+
return (b = JSON.parse(g)) == null ? void 0 : b[1];
|
|
6133
|
+
}).join(" / "), w2 = {
|
|
5946
6134
|
...e.spec.annotations,
|
|
5947
|
-
[
|
|
6135
|
+
[Jt]: "true"
|
|
5948
6136
|
};
|
|
5949
|
-
return (
|
|
5950
|
-
id:
|
|
6137
|
+
return (y || f2) && (w2[Ie] = y && f2 ? y + " / " + f2 : y + f2), {
|
|
6138
|
+
id: d,
|
|
5951
6139
|
spec: {
|
|
5952
6140
|
...e.spec,
|
|
5953
|
-
axesSpec:
|
|
5954
|
-
...
|
|
5955
|
-
annotations: e.spec.axesSpec[
|
|
6141
|
+
axesSpec: u2.map((g, b) => ({
|
|
6142
|
+
...g,
|
|
6143
|
+
annotations: e.spec.axesSpec[b].annotations
|
|
5956
6144
|
})),
|
|
5957
|
-
annotations:
|
|
6145
|
+
annotations: w2
|
|
5958
6146
|
},
|
|
5959
6147
|
data: e.data
|
|
5960
6148
|
};
|
|
5961
6149
|
});
|
|
6150
|
+
return [e, ...l2];
|
|
5962
6151
|
}
|
|
5963
|
-
function
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
|
|
5970
|
-
|
|
5971
|
-
);
|
|
5972
|
-
}
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
-
|
|
5976
|
-
const
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
"Float",
|
|
5992
|
-
"Double",
|
|
5993
|
-
"String",
|
|
5994
|
-
"Bytes"
|
|
5995
|
-
];
|
|
5996
|
-
function gn(t, e) {
|
|
5997
|
-
if (e === void 0) return;
|
|
5998
|
-
const n2 = t.resultPool.getData().entries.map((s2) => s2.obj).filter(Z$1).filter((s2) => It.includes(s2.spec.valueType)), r = _t(e, n2), i = [...r, ...Ct(r)];
|
|
5999
|
-
if (!i.some(
|
|
6000
|
-
(s2) => s2.data instanceof _ && !s2.data.getIsReadyOrError()
|
|
6152
|
+
function Kn(t, e) {
|
|
6153
|
+
if (!e) return;
|
|
6154
|
+
const n2 = new le();
|
|
6155
|
+
n2.addColumnProvider(t.resultPool), n2.addColumns(e);
|
|
6156
|
+
const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
6157
|
+
for (const d of e)
|
|
6158
|
+
for (const y of d.spec.axesSpec) {
|
|
6159
|
+
const f2 = p$1(y);
|
|
6160
|
+
r.set(ue(f2), f2), i.set(ue(f2), f2);
|
|
6161
|
+
}
|
|
6162
|
+
const s2 = n2.getColumns((d) => Nt(d)) ?? [], o = Bt(s2, r);
|
|
6163
|
+
for (const d of o)
|
|
6164
|
+
r.set(...d), i.set(...d);
|
|
6165
|
+
const a = (n2.getColumns([...r.values()].map((d) => ({
|
|
6166
|
+
axes: [d],
|
|
6167
|
+
partialAxesMatch: true
|
|
6168
|
+
})), { dontWaitAllData: true, overrideLabelAnnotation: false }) ?? []).filter((d) => !ve(d.spec));
|
|
6169
|
+
for (const d of a)
|
|
6170
|
+
for (const y of d.spec.axesSpec) {
|
|
6171
|
+
const f2 = p$1(y);
|
|
6172
|
+
i.set(ue(f2), f2);
|
|
6173
|
+
}
|
|
6174
|
+
const l2 = (n2.getColumns([...i.values()].map((d) => ({
|
|
6175
|
+
axes: [d],
|
|
6176
|
+
partialAxesMatch: true
|
|
6177
|
+
})), { dontWaitAllData: true, overrideLabelAnnotation: false }) ?? []).filter((d) => ve(d.spec)), u2 = [...a, ...l2], c2 = Wt(r, u2);
|
|
6178
|
+
if (!c2.some(
|
|
6179
|
+
(d) => d.data instanceof E && !d.data.getIsReadyOrError()
|
|
6001
6180
|
))
|
|
6002
|
-
return t.createPFrame(
|
|
6003
|
-
}
|
|
6004
|
-
function isNumericType(c2) {
|
|
6005
|
-
return c2.valueType === "Double" || c2.valueType === "Int" || c2.valueType === "Float" || c2.valueType === "Long";
|
|
6181
|
+
return t.createPFrame(c2);
|
|
6006
6182
|
}
|
|
6007
6183
|
const model = T.create().withArgs({
|
|
6008
6184
|
metrics: [
|
|
@@ -6056,25 +6232,47 @@
|
|
|
6056
6232
|
filters: []
|
|
6057
6233
|
}
|
|
6058
6234
|
}
|
|
6059
|
-
}).argsValid((ctx) => ctx.args.abundanceRef !== void 0).output(
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6235
|
+
}).argsValid((ctx) => ctx.args.abundanceRef !== void 0).output(
|
|
6236
|
+
"abundanceOptions",
|
|
6237
|
+
(ctx) => ctx.resultPool.getOptions([
|
|
6238
|
+
{
|
|
6239
|
+
axes: [
|
|
6240
|
+
{ name: "pl7.app/sampleId" },
|
|
6241
|
+
{}
|
|
6242
|
+
],
|
|
6243
|
+
annotations: {
|
|
6244
|
+
"pl7.app/isAbundance": "true",
|
|
6245
|
+
"pl7.app/abundance/normalized": "false",
|
|
6246
|
+
"pl7.app/abundance/isPrimary": "true"
|
|
6247
|
+
}
|
|
6248
|
+
}
|
|
6249
|
+
])
|
|
6250
|
+
).output("pt", (ctx) => {
|
|
6065
6251
|
var _a, _b, _c;
|
|
6066
6252
|
const pCols = (_b = (_a = ctx.outputs) == null ? void 0 : _a.resolve("pf")) == null ? void 0 : _b.getPColumns();
|
|
6067
6253
|
if (pCols === void 0) {
|
|
6068
6254
|
return void 0;
|
|
6069
6255
|
}
|
|
6070
|
-
return
|
|
6256
|
+
return Dn(ctx, pCols, (_c = ctx.uiState) == null ? void 0 : _c.tableState);
|
|
6071
6257
|
}).output("pf", (ctx) => {
|
|
6072
6258
|
var _a, _b;
|
|
6073
6259
|
const pCols = (_b = (_a = ctx.outputs) == null ? void 0 : _a.resolve("pf")) == null ? void 0 : _b.getPColumns();
|
|
6074
6260
|
if (pCols === void 0) {
|
|
6075
6261
|
return void 0;
|
|
6076
6262
|
}
|
|
6077
|
-
return
|
|
6263
|
+
return Kn(ctx, pCols);
|
|
6264
|
+
}).output("pcols", (ctx) => {
|
|
6265
|
+
var _a, _b;
|
|
6266
|
+
const pCols = (_b = (_a = ctx.outputs) == null ? void 0 : _a.resolve("pf")) == null ? void 0 : _b.getPColumns();
|
|
6267
|
+
if (pCols === void 0 || pCols.length === 0) {
|
|
6268
|
+
return void 0;
|
|
6269
|
+
}
|
|
6270
|
+
return pCols.map(
|
|
6271
|
+
(c2) => ({
|
|
6272
|
+
columnId: c2.id,
|
|
6273
|
+
spec: c2.spec
|
|
6274
|
+
})
|
|
6275
|
+
);
|
|
6078
6276
|
}).output("isRunning", (ctx) => {
|
|
6079
6277
|
var _a;
|
|
6080
6278
|
return ((_a = ctx.outputs) == null ? void 0 : _a.getIsReadyOrError()) === false;
|