@platforma-sdk/model 1.28.0 → 1.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +304 -291
- package/dist/index.mjs.map +1 -1
- package/dist/render/util/label.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +3 -3
- package/src/render/util/label.test.ts +22 -0
- package/src/render/util/label.ts +21 -9
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var je = Object.defineProperty;
|
|
2
2
|
var Ke = (t, e, n) => e in t ? je(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
3
|
var L = (t, e, n) => Ke(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
-
import { isPColumn as
|
|
4
|
+
import { isPColumn as ie, mapPObjectData as ge, isDataInfoEntries as xe, isDataInfo as me, dataInfoToEntries as Ve, resolveAnchors as $e, isPColumnSpec as Q, isPartitionedDataInfoEntries as Je, getAxisId as E, entriesToDataInfo as Ne, selectorsToPredicate as ce, canonicalizeAxisId as Ue, AnchoredIdDeriver as ye, isPlRef as Be, mapValueInVOE as Me, ensurePColumn as Ge, extractAllColumns as We, mapPTableDef as He, mapDataInfo as qe, matchAxisId as G } from "@milaboratories/pl-model-common";
|
|
5
5
|
export * from "@milaboratories/pl-model-common";
|
|
6
6
|
import { z as K } from "zod";
|
|
7
7
|
import Pe from "canonicalize";
|
|
@@ -22,8 +22,8 @@ function Rt(t) {
|
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ?
|
|
25
|
+
function x(t) {
|
|
26
|
+
return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ? Z(t) : t;
|
|
27
27
|
}
|
|
28
28
|
function W(t) {
|
|
29
29
|
return { type: "GetFromCtx", variable: t };
|
|
@@ -35,12 +35,12 @@ function Ot(t) {
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
const jt = W("$args"), Kt = W("$it"), Vt = W("$prod"), $t = W("$staging"), Jt = W("$ui");
|
|
38
|
-
function
|
|
38
|
+
function Z(t) {
|
|
39
39
|
return { type: "Immediate", value: t };
|
|
40
40
|
}
|
|
41
41
|
function Ce(t) {
|
|
42
42
|
const e = {};
|
|
43
|
-
for (const [n, r] of Object.entries(t)) e[n] =
|
|
43
|
+
for (const [n, r] of Object.entries(t)) e[n] = x(r);
|
|
44
44
|
return {
|
|
45
45
|
type: "MakeObject",
|
|
46
46
|
template: e
|
|
@@ -48,17 +48,17 @@ function Ce(t) {
|
|
|
48
48
|
}
|
|
49
49
|
function Nt(...t) {
|
|
50
50
|
const e = [];
|
|
51
|
-
for (const n of t) e.push(
|
|
51
|
+
for (const n of t) e.push(x(n));
|
|
52
52
|
return {
|
|
53
53
|
type: "MakeArray",
|
|
54
54
|
template: e
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function ee(t, e) {
|
|
58
58
|
return {
|
|
59
59
|
type: "GetJsonField",
|
|
60
|
-
source:
|
|
61
|
-
field:
|
|
60
|
+
source: x(t),
|
|
61
|
+
field: x(e)
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
function Ut(t, e, n = "$it") {
|
|
@@ -112,15 +112,15 @@ function qt(t, e) {
|
|
|
112
112
|
function zt(t, e) {
|
|
113
113
|
return {
|
|
114
114
|
type: "GetResourceField",
|
|
115
|
-
source:
|
|
116
|
-
field:
|
|
115
|
+
source: x(t),
|
|
116
|
+
field: x(e)
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
119
|
function Yt() {
|
|
120
120
|
return function(t) {
|
|
121
121
|
return {
|
|
122
122
|
type: "GetResourceValueAsJson",
|
|
123
|
-
source:
|
|
123
|
+
source: x(t)
|
|
124
124
|
};
|
|
125
125
|
};
|
|
126
126
|
}
|
|
@@ -135,73 +135,73 @@ function Xt(t, e, n = "$it") {
|
|
|
135
135
|
function Qt(t) {
|
|
136
136
|
return {
|
|
137
137
|
type: "GetBlobContent",
|
|
138
|
-
source:
|
|
138
|
+
source: x(t)
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
141
|
function Zt(t) {
|
|
142
142
|
return {
|
|
143
143
|
type: "GetBlobContentAsString",
|
|
144
|
-
source:
|
|
144
|
+
source: x(t)
|
|
145
145
|
};
|
|
146
146
|
}
|
|
147
147
|
function en() {
|
|
148
148
|
return function(t) {
|
|
149
149
|
return {
|
|
150
150
|
type: "GetBlobContentAsJson",
|
|
151
|
-
source:
|
|
151
|
+
source: x(t)
|
|
152
152
|
};
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
155
|
function tn(t) {
|
|
156
156
|
return {
|
|
157
157
|
type: "GetDownloadedBlobContent",
|
|
158
|
-
source:
|
|
158
|
+
source: x(t)
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
161
|
function nn(t) {
|
|
162
162
|
return {
|
|
163
163
|
type: "GetOnDemandBlobContent",
|
|
164
|
-
source:
|
|
164
|
+
source: x(t)
|
|
165
165
|
};
|
|
166
166
|
}
|
|
167
167
|
function rn(t, e) {
|
|
168
168
|
return {
|
|
169
169
|
type: "ExtractArchiveAndGetURL",
|
|
170
170
|
format: e,
|
|
171
|
-
source:
|
|
171
|
+
source: x(t)
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
174
|
function sn(t) {
|
|
175
175
|
return {
|
|
176
176
|
type: "GetImportProgress",
|
|
177
|
-
source:
|
|
177
|
+
source: x(t)
|
|
178
178
|
};
|
|
179
179
|
}
|
|
180
180
|
function on(t, e) {
|
|
181
181
|
return {
|
|
182
182
|
type: "GetLastLogs",
|
|
183
|
-
source:
|
|
183
|
+
source: x(t),
|
|
184
184
|
lines: e
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
187
|
function an(t, e) {
|
|
188
188
|
return {
|
|
189
189
|
type: "GetProgressLog",
|
|
190
|
-
source:
|
|
190
|
+
source: x(t),
|
|
191
191
|
patternToSearch: e
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
194
|
function ln(t, e) {
|
|
195
195
|
return {
|
|
196
196
|
type: "GetProgressLogWithInfo",
|
|
197
|
-
source:
|
|
197
|
+
source: x(t),
|
|
198
198
|
patternToSearch: e
|
|
199
199
|
};
|
|
200
200
|
}
|
|
201
201
|
function un(t) {
|
|
202
202
|
return {
|
|
203
203
|
type: "GetLogHandle",
|
|
204
|
-
source:
|
|
204
|
+
source: x(t)
|
|
205
205
|
};
|
|
206
206
|
}
|
|
207
207
|
function Xe() {
|
|
@@ -216,11 +216,11 @@ function _e(t) {
|
|
|
216
216
|
function Qe() {
|
|
217
217
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function m() {
|
|
220
220
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
221
221
|
throw new Error("Not in config rendering context");
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function Y(t, e) {
|
|
224
224
|
const n = Qe();
|
|
225
225
|
if (n === void 0) return !1;
|
|
226
226
|
if (t in n.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
|
|
@@ -228,12 +228,12 @@ function X(t, e) {
|
|
|
228
228
|
}
|
|
229
229
|
const ae = /* @__PURE__ */ new Map();
|
|
230
230
|
function Ze(t, e) {
|
|
231
|
-
t in
|
|
231
|
+
t in m().callbackRegistry || (m().callbackRegistry[t] = (n) => {
|
|
232
232
|
for (const r of ae.get(t))
|
|
233
233
|
r(n);
|
|
234
234
|
}, ae.set(t, [])), ae.get(t).push(e);
|
|
235
235
|
}
|
|
236
|
-
class
|
|
236
|
+
class C {
|
|
237
237
|
constructor(e, n = (r) => r) {
|
|
238
238
|
L(this, "isResolved", !1);
|
|
239
239
|
L(this, "resolvedValue");
|
|
@@ -242,10 +242,10 @@ class _ {
|
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
244
|
map(e) {
|
|
245
|
-
return new
|
|
245
|
+
return new C(this.handle, (n) => e(this.postProcess(n)));
|
|
246
246
|
}
|
|
247
247
|
mapDefined(e) {
|
|
248
|
-
return new
|
|
248
|
+
return new C(this.handle, (n) => {
|
|
249
249
|
const r = this.postProcess(n);
|
|
250
250
|
return r ? e(r) : void 0;
|
|
251
251
|
});
|
|
@@ -257,7 +257,7 @@ class _ {
|
|
|
257
257
|
function pe(t, e) {
|
|
258
258
|
return t === void 0 ? void 0 : e(t);
|
|
259
259
|
}
|
|
260
|
-
class
|
|
260
|
+
class _ {
|
|
261
261
|
constructor(e, n) {
|
|
262
262
|
this.handle = e, this.resolvePath = n;
|
|
263
263
|
}
|
|
@@ -297,46 +297,46 @@ class I {
|
|
|
297
297
|
...n.map((i) => typeof i == "string" ? i : i.field)
|
|
298
298
|
];
|
|
299
299
|
return pe(
|
|
300
|
-
|
|
301
|
-
(i) => new
|
|
300
|
+
m().resolveWithCommon(this.handle, e, ...n),
|
|
301
|
+
(i) => new _(i, r)
|
|
302
302
|
);
|
|
303
303
|
}
|
|
304
304
|
get resourceType() {
|
|
305
|
-
return
|
|
305
|
+
return m().getResourceType(this.handle);
|
|
306
306
|
}
|
|
307
307
|
getInputsLocked() {
|
|
308
|
-
return
|
|
308
|
+
return m().getInputsLocked(this.handle);
|
|
309
309
|
}
|
|
310
310
|
getOutputsLocked() {
|
|
311
|
-
return
|
|
311
|
+
return m().getOutputsLocked(this.handle);
|
|
312
312
|
}
|
|
313
313
|
getIsReadyOrError() {
|
|
314
|
-
return
|
|
314
|
+
return m().getIsReadyOrError(this.handle);
|
|
315
315
|
}
|
|
316
316
|
getIsFinal() {
|
|
317
|
-
return
|
|
317
|
+
return m().getIsFinal(this.handle);
|
|
318
318
|
}
|
|
319
319
|
getError() {
|
|
320
320
|
const e = [...this.resolvePath, "error"];
|
|
321
321
|
return pe(
|
|
322
|
-
|
|
323
|
-
(n) => new
|
|
322
|
+
m().getError(this.handle),
|
|
323
|
+
(n) => new _(n, e)
|
|
324
324
|
);
|
|
325
325
|
}
|
|
326
326
|
listInputFields() {
|
|
327
|
-
return
|
|
327
|
+
return m().listInputFields(this.handle);
|
|
328
328
|
}
|
|
329
329
|
listOutputFields() {
|
|
330
|
-
return
|
|
330
|
+
return m().listOutputFields(this.handle);
|
|
331
331
|
}
|
|
332
332
|
listDynamicFields() {
|
|
333
|
-
return
|
|
333
|
+
return m().listDynamicFields(this.handle);
|
|
334
334
|
}
|
|
335
335
|
getKeyValueBase64(e) {
|
|
336
|
-
return
|
|
336
|
+
return m().getKeyValueBase64(this.handle, e);
|
|
337
337
|
}
|
|
338
338
|
getKeyValueAsString(e) {
|
|
339
|
-
return
|
|
339
|
+
return m().getKeyValueAsString(this.handle, e);
|
|
340
340
|
}
|
|
341
341
|
getKeyValueAsJson(e) {
|
|
342
342
|
const n = this.getKeyValueAsString(e);
|
|
@@ -344,10 +344,10 @@ class I {
|
|
|
344
344
|
return JSON.parse(n);
|
|
345
345
|
}
|
|
346
346
|
getDataBase64() {
|
|
347
|
-
return
|
|
347
|
+
return m().getDataBase64(this.handle);
|
|
348
348
|
}
|
|
349
349
|
getDataAsString() {
|
|
350
|
-
return
|
|
350
|
+
return m().getDataAsString(this.handle);
|
|
351
351
|
}
|
|
352
352
|
getDataAsJson() {
|
|
353
353
|
const e = this.getDataAsString();
|
|
@@ -360,7 +360,7 @@ class I {
|
|
|
360
360
|
getPColumns(e = !1, n = "") {
|
|
361
361
|
const r = this.parsePObjectCollection(e, n);
|
|
362
362
|
return r === void 0 ? void 0 : Object.entries(r).map(([, s]) => {
|
|
363
|
-
if (!
|
|
363
|
+
if (!ie(s)) throw new Error(`not a PColumn (kind = ${s.spec.kind})`);
|
|
364
364
|
return s;
|
|
365
365
|
});
|
|
366
366
|
}
|
|
@@ -368,7 +368,7 @@ class I {
|
|
|
368
368
|
*
|
|
369
369
|
*/
|
|
370
370
|
parsePObjectCollection(e = !1, n = "") {
|
|
371
|
-
const r =
|
|
371
|
+
const r = m().parsePObjectCollection(
|
|
372
372
|
this.handle,
|
|
373
373
|
e,
|
|
374
374
|
n,
|
|
@@ -378,19 +378,19 @@ class I {
|
|
|
378
378
|
const i = {};
|
|
379
379
|
for (const [s, o] of Object.entries(r)) {
|
|
380
380
|
const a = [...this.resolvePath, s];
|
|
381
|
-
i[s] = ge(o, (l) => new
|
|
381
|
+
i[s] = ge(o, (l) => new _(l, a));
|
|
382
382
|
}
|
|
383
383
|
return i;
|
|
384
384
|
}
|
|
385
385
|
getFileContentAsBase64() {
|
|
386
|
-
return new
|
|
386
|
+
return new C(m().getBlobContentAsBase64(this.handle));
|
|
387
387
|
}
|
|
388
388
|
getFileContentAsString() {
|
|
389
|
-
return new
|
|
389
|
+
return new C(m().getBlobContentAsString(this.handle));
|
|
390
390
|
}
|
|
391
391
|
getFileContentAsJson() {
|
|
392
|
-
return new
|
|
393
|
-
|
|
392
|
+
return new C(
|
|
393
|
+
m().getBlobContentAsString(this.handle)
|
|
394
394
|
).mapDefined((e) => JSON.parse(e));
|
|
395
395
|
}
|
|
396
396
|
/**
|
|
@@ -409,7 +409,7 @@ class I {
|
|
|
409
409
|
* @returns downloaded file handle
|
|
410
410
|
*/
|
|
411
411
|
getFileHandle() {
|
|
412
|
-
return new
|
|
412
|
+
return new C(m().getDownloadedBlobContentHandle(this.handle));
|
|
413
413
|
}
|
|
414
414
|
/**
|
|
415
415
|
* @deprecated use getFileHandle
|
|
@@ -421,7 +421,7 @@ class I {
|
|
|
421
421
|
* @returns downloaded file handle
|
|
422
422
|
*/
|
|
423
423
|
getRemoteFileHandle() {
|
|
424
|
-
return new
|
|
424
|
+
return new C(m().getOnDemandBlobContentHandle(this.handle));
|
|
425
425
|
}
|
|
426
426
|
/**
|
|
427
427
|
* @deprecated use getRemoteFileHandle
|
|
@@ -433,22 +433,22 @@ class I {
|
|
|
433
433
|
* @returns the url to the extracted folder
|
|
434
434
|
*/
|
|
435
435
|
extractArchiveAndGetURL(e) {
|
|
436
|
-
return new
|
|
436
|
+
return new C(m().extractArchiveAndGetURL(this.handle, e));
|
|
437
437
|
}
|
|
438
438
|
getImportProgress() {
|
|
439
|
-
return new
|
|
439
|
+
return new C(m().getImportProgress(this.handle));
|
|
440
440
|
}
|
|
441
441
|
getLastLogs(e) {
|
|
442
|
-
return new
|
|
442
|
+
return new C(m().getLastLogs(this.handle, e));
|
|
443
443
|
}
|
|
444
444
|
getProgressLog(e) {
|
|
445
|
-
return new
|
|
445
|
+
return new C(m().getProgressLog(this.handle, e));
|
|
446
446
|
}
|
|
447
447
|
getProgressLogWithInfo(e) {
|
|
448
|
-
return new
|
|
448
|
+
return new C(m().getProgressLogWithInfo(this.handle, e));
|
|
449
449
|
}
|
|
450
450
|
getLogHandle() {
|
|
451
|
-
return new
|
|
451
|
+
return new C(m().getLogHandle(this.handle));
|
|
452
452
|
}
|
|
453
453
|
allFieldsResolved(e = "Input") {
|
|
454
454
|
switch (e) {
|
|
@@ -472,9 +472,9 @@ class I {
|
|
|
472
472
|
if (i && (r === "Input" && !this.getInputsLocked() || r === "Output" && !this.getOutputsLocked()))
|
|
473
473
|
return;
|
|
474
474
|
let l = (r === "Input" ? this.listInputFields() : r === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
|
|
475
|
-
(
|
|
475
|
+
(u) => [u, this.resolve({ field: u, assertFieldType: r })]
|
|
476
476
|
);
|
|
477
|
-
return s && (l = l.filter((
|
|
477
|
+
return s && (l = l.filter((u) => u[1] !== void 0)), l.map(([u, S]) => o(u, S));
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
480
|
const Ie = "staging", Le = "main", et = {
|
|
@@ -512,93 +512,106 @@ const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
512
512
|
id: K.string().optional(),
|
|
513
513
|
label: K.string()
|
|
514
514
|
}), st = K.array(it), ot = 1e-3, at = "__LABEL__", ve = "__LABEL__@1";
|
|
515
|
-
function
|
|
516
|
-
const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = t.map((
|
|
517
|
-
var
|
|
518
|
-
const
|
|
519
|
-
let
|
|
520
|
-
"spec" in
|
|
521
|
-
const
|
|
522
|
-
...
|
|
523
|
-
...
|
|
524
|
-
...
|
|
515
|
+
function Ee(t, e, n = {}) {
|
|
516
|
+
const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = t.map((p) => {
|
|
517
|
+
var q, D;
|
|
518
|
+
const c = e(p);
|
|
519
|
+
let h, A, y;
|
|
520
|
+
"spec" in c && typeof c.spec == "object" ? (h = c.spec, A = c.prefixTrace, y = c.suffixTrace) : h = c;
|
|
521
|
+
const v = (q = h.annotations) == null ? void 0 : q[nt], g = (D = h.annotations) == null ? void 0 : D[rt], P = (g ? st.safeParse(JSON.parse(g)).data : void 0) ?? [], b = [
|
|
522
|
+
...A ?? [],
|
|
523
|
+
...P,
|
|
524
|
+
...y ?? []
|
|
525
525
|
];
|
|
526
|
-
if (
|
|
527
|
-
const
|
|
528
|
-
n.addLabelAsSuffix ?
|
|
526
|
+
if (v) {
|
|
527
|
+
const I = { label: v, type: at, importance: -2 };
|
|
528
|
+
n.addLabelAsSuffix ? b.push(I) : b.splice(0, 0, I);
|
|
529
529
|
}
|
|
530
|
-
const
|
|
531
|
-
for (let
|
|
532
|
-
const { type: R } =
|
|
533
|
-
|
|
534
|
-
const
|
|
535
|
-
i.set(
|
|
536
|
-
|
|
530
|
+
const F = [], $ = /* @__PURE__ */ new Map();
|
|
531
|
+
for (let I = b.length - 1; I >= 0; --I) {
|
|
532
|
+
const { type: R } = b[I], se = b[I].importance ?? 0, J = ($.get(R) ?? 0) + 1;
|
|
533
|
+
$.set(R, J);
|
|
534
|
+
const w = `${R}@${J}`;
|
|
535
|
+
i.set(w, (i.get(w) ?? 0) + 1), r.set(
|
|
536
|
+
w,
|
|
537
537
|
Math.max(
|
|
538
|
-
r.get(
|
|
539
|
-
|
|
538
|
+
r.get(w) ?? Number.NEGATIVE_INFINITY,
|
|
539
|
+
se - (b.length - I) * ot
|
|
540
540
|
)
|
|
541
|
-
),
|
|
541
|
+
), F.push({ ...b[I], fullType: w, occurenceIndex: J });
|
|
542
542
|
}
|
|
543
|
-
return
|
|
544
|
-
value:
|
|
545
|
-
spec:
|
|
546
|
-
label:
|
|
547
|
-
fullTrace:
|
|
543
|
+
return F.reverse(), {
|
|
544
|
+
value: p,
|
|
545
|
+
spec: h,
|
|
546
|
+
label: v,
|
|
547
|
+
fullTrace: F
|
|
548
548
|
};
|
|
549
549
|
}), o = [], a = [], l = [...r];
|
|
550
|
-
l.sort(([,
|
|
551
|
-
for (const [
|
|
552
|
-
|
|
553
|
-
const
|
|
554
|
-
const
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
550
|
+
l.sort(([, p], [, c]) => c - p);
|
|
551
|
+
for (const [p] of l)
|
|
552
|
+
p.endsWith("@1") || i.get(p) === t.length ? o.push(p) : a.push(p);
|
|
553
|
+
const u = (p) => {
|
|
554
|
+
const c = [];
|
|
555
|
+
for (let h = 0; h < s.length; h++) {
|
|
556
|
+
const A = s[h], y = A.fullTrace.filter((P) => p.has(P.fullType));
|
|
557
|
+
if (y.length === 0)
|
|
558
|
+
return;
|
|
559
|
+
const v = y.map((P) => P.label), g = n.separator ?? " / ";
|
|
560
|
+
c.push({
|
|
561
|
+
label: v.join(g),
|
|
562
|
+
value: A.value
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
return c;
|
|
566
|
+
};
|
|
560
567
|
if (o.length === 0) {
|
|
561
568
|
if (a.length !== 0) throw new Error("Assertion error.");
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
569
|
+
const p = u(new Set(ve));
|
|
570
|
+
if (p === void 0) throw new Error("Assertion error.");
|
|
571
|
+
return p;
|
|
572
|
+
}
|
|
573
|
+
let S = 0, d = 0;
|
|
574
|
+
for (; S < o.length; ) {
|
|
575
|
+
const p = /* @__PURE__ */ new Set();
|
|
576
|
+
n.includeNativeLabel && p.add(ve);
|
|
577
|
+
for (let h = 0; h < S; ++h) p.add(o[h]);
|
|
578
|
+
p.add(o[d]);
|
|
579
|
+
const c = u(p);
|
|
580
|
+
if (c !== void 0) {
|
|
581
|
+
if (new Set(c.map((h) => h.label)).size === t.length) return c;
|
|
582
|
+
d++, d == o.length && (S++, d = S);
|
|
583
|
+
}
|
|
573
584
|
}
|
|
574
|
-
|
|
585
|
+
const f = u(/* @__PURE__ */ new Set([...o, ...a]));
|
|
586
|
+
if (f === void 0) throw new Error("Assertion error.");
|
|
587
|
+
return f;
|
|
575
588
|
}
|
|
576
|
-
const H = "PColumnData/",
|
|
589
|
+
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";
|
|
577
590
|
function De(t, e, n, r = [], i) {
|
|
578
591
|
if (t === void 0) return !1;
|
|
579
592
|
switch (t.resourceType.name) {
|
|
580
|
-
case
|
|
593
|
+
case te: {
|
|
581
594
|
let s = t.getInputsLocked();
|
|
582
595
|
for (const o of t.listInputFields()) {
|
|
583
|
-
const a = t.resolve({ field: o, assertFieldType: "Input" }), l = [...r, ...JSON.parse(o)],
|
|
584
|
-
|
|
596
|
+
const a = t.resolve({ field: o, assertFieldType: "Input" }), l = [...r, ...JSON.parse(o)], u = a === void 0 ? void 0 : e(a);
|
|
597
|
+
u === void 0 && (s = !1), (u !== void 0 || i) && n.push({ key: l, value: u });
|
|
585
598
|
}
|
|
586
599
|
return s;
|
|
587
600
|
}
|
|
588
|
-
case
|
|
601
|
+
case ne: {
|
|
589
602
|
let s = t.getInputsLocked();
|
|
590
603
|
for (const o of t.listInputFields()) {
|
|
591
604
|
const a = t.resolve({ field: o, assertFieldType: "Input" });
|
|
592
605
|
if (a === void 0) s = !1;
|
|
593
606
|
else {
|
|
594
|
-
const l = [...r, ...JSON.parse(o)],
|
|
607
|
+
const l = [...r, ...JSON.parse(o)], u = De(
|
|
595
608
|
a,
|
|
596
609
|
e,
|
|
597
610
|
n,
|
|
598
611
|
l,
|
|
599
612
|
i
|
|
600
613
|
);
|
|
601
|
-
s = s &&
|
|
614
|
+
s = s && u;
|
|
602
615
|
}
|
|
603
616
|
}
|
|
604
617
|
return s;
|
|
@@ -623,10 +636,10 @@ function lt(t) {
|
|
|
623
636
|
const e = t.resourceType.name, n = t.getDataAsJson(), r = [];
|
|
624
637
|
let i = 0;
|
|
625
638
|
switch (e) {
|
|
626
|
-
case
|
|
639
|
+
case te:
|
|
627
640
|
i = n.keyLength;
|
|
628
641
|
break;
|
|
629
|
-
case
|
|
642
|
+
case ne:
|
|
630
643
|
i = n.partitionKeyLength + n.keyLength;
|
|
631
644
|
break;
|
|
632
645
|
case U:
|
|
@@ -634,12 +647,12 @@ function lt(t) {
|
|
|
634
647
|
i = n.partitionKeyLength;
|
|
635
648
|
break;
|
|
636
649
|
case B:
|
|
637
|
-
case
|
|
650
|
+
case re:
|
|
638
651
|
i = n.superPartitionKeyLength + n.partitionKeyLength;
|
|
639
652
|
break;
|
|
640
653
|
}
|
|
641
654
|
switch (e) {
|
|
642
|
-
case
|
|
655
|
+
case te:
|
|
643
656
|
case U:
|
|
644
657
|
case V:
|
|
645
658
|
for (let s of t.listInputFields()) {
|
|
@@ -648,16 +661,16 @@ function lt(t) {
|
|
|
648
661
|
r.push(o);
|
|
649
662
|
}
|
|
650
663
|
break;
|
|
651
|
-
case
|
|
664
|
+
case ne:
|
|
652
665
|
case B:
|
|
653
|
-
case
|
|
666
|
+
case re:
|
|
654
667
|
for (const s of t.listInputFields()) {
|
|
655
668
|
const o = [...JSON.parse(s)], a = t.resolve({ field: s, assertFieldType: "Input" });
|
|
656
669
|
if (a !== void 0)
|
|
657
670
|
for (let l of a.listInputFields()) {
|
|
658
671
|
e === B && (l = fe(l).baseKey);
|
|
659
|
-
const
|
|
660
|
-
r.push(
|
|
672
|
+
const u = [...o, ...JSON.parse(l)];
|
|
673
|
+
r.push(u);
|
|
661
674
|
}
|
|
662
675
|
}
|
|
663
676
|
break;
|
|
@@ -703,11 +716,11 @@ function ct(t) {
|
|
|
703
716
|
function he(t, e = []) {
|
|
704
717
|
if (t === void 0 || !t.getIsReadyOrError()) return;
|
|
705
718
|
const n = t.resourceType.name, r = t.getDataAsJson();
|
|
706
|
-
if (e.length > 0 && (n ===
|
|
719
|
+
if (e.length > 0 && (n === re || n === B))
|
|
707
720
|
throw new Error(`Unexpected nested super-partitioned resource: ${n}`);
|
|
708
721
|
switch (n) {
|
|
722
|
+
case te:
|
|
709
723
|
case ne:
|
|
710
|
-
case re:
|
|
711
724
|
throw new Error(`Only data columns are supported, got: ${n}`);
|
|
712
725
|
case U: {
|
|
713
726
|
if (typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
|
|
@@ -732,8 +745,8 @@ function he(t, e = []) {
|
|
|
732
745
|
for (const o of t.listInputFields()) {
|
|
733
746
|
const a = fe(o), l = t.resolve({ field: o, assertFieldType: "Input" });
|
|
734
747
|
if (l === void 0) return;
|
|
735
|
-
let
|
|
736
|
-
|
|
748
|
+
let u = s.get(a.baseKey);
|
|
749
|
+
u || (u = {}, s.set(a.baseKey, u)), a.type === "index" ? u.index = l : u.values = l;
|
|
737
750
|
}
|
|
738
751
|
for (const [o, a] of s.entries()) {
|
|
739
752
|
if (!a.index || !a.values) return;
|
|
@@ -752,7 +765,7 @@ function he(t, e = []) {
|
|
|
752
765
|
parts: i
|
|
753
766
|
};
|
|
754
767
|
}
|
|
755
|
-
case
|
|
768
|
+
case re: {
|
|
756
769
|
if (typeof (r == null ? void 0 : r.superPartitionKeyLength) != "number" || typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
|
|
757
770
|
throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n}`);
|
|
758
771
|
const i = r.superPartitionKeyLength + r.partitionKeyLength, s = [];
|
|
@@ -802,7 +815,7 @@ function pt(t) {
|
|
|
802
815
|
if (t !== void 0) {
|
|
803
816
|
if (xe(t)) return t;
|
|
804
817
|
if (me(t)) return Ve(t);
|
|
805
|
-
if (t instanceof
|
|
818
|
+
if (t instanceof _) return he(t);
|
|
806
819
|
throw new Error(`Unexpected input type: ${typeof t}`);
|
|
807
820
|
}
|
|
808
821
|
}
|
|
@@ -935,110 +948,110 @@ class be {
|
|
|
935
948
|
const { anchorCtx: r, labelOps: i, dontWaitAllData: s = !1, overrideLabelAnnotation: o = !1 } = n ?? {}, a = {
|
|
936
949
|
...o && (i == null ? void 0 : i.includeNativeLabel) !== !1 ? { includeNativeLabel: !0 } : {},
|
|
937
950
|
...i ?? {}
|
|
938
|
-
}, l = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e],
|
|
939
|
-
for (const
|
|
940
|
-
const
|
|
941
|
-
let
|
|
942
|
-
if (
|
|
951
|
+
}, l = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], u = [];
|
|
952
|
+
for (const f of l) {
|
|
953
|
+
const p = yt(f);
|
|
954
|
+
let c;
|
|
955
|
+
if (p) {
|
|
943
956
|
if (!r)
|
|
944
957
|
throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");
|
|
945
|
-
|
|
958
|
+
c = $e(r.anchors, f);
|
|
946
959
|
} else
|
|
947
|
-
|
|
948
|
-
const
|
|
960
|
+
c = f;
|
|
961
|
+
const h = /* @__PURE__ */ new Set(), A = [];
|
|
949
962
|
for (const g of this.providers) {
|
|
950
|
-
const
|
|
951
|
-
for (const
|
|
952
|
-
if (
|
|
953
|
-
|
|
963
|
+
const P = g.selectColumns(c);
|
|
964
|
+
for (const b of P) {
|
|
965
|
+
if (h.has(b.id)) throw new Error(`Duplicate column id ${b.id} in provider ${g.constructor.name}`);
|
|
966
|
+
h.add(b.id), A.push(b);
|
|
954
967
|
}
|
|
955
968
|
}
|
|
956
|
-
if (
|
|
957
|
-
const
|
|
958
|
-
for (const g of
|
|
959
|
-
if (!
|
|
960
|
-
const
|
|
961
|
-
if (
|
|
962
|
-
const
|
|
963
|
-
if (!
|
|
969
|
+
if (A.length === 0) continue;
|
|
970
|
+
const y = vt(f), v = y.length > 0;
|
|
971
|
+
for (const g of A) {
|
|
972
|
+
if (!Q(g.spec)) continue;
|
|
973
|
+
const P = g.spec;
|
|
974
|
+
if (v) {
|
|
975
|
+
const b = pt(g.data);
|
|
976
|
+
if (!b) {
|
|
964
977
|
if (s) continue;
|
|
965
978
|
return;
|
|
966
979
|
}
|
|
967
|
-
if (!Je(
|
|
968
|
-
throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${
|
|
969
|
-
const
|
|
970
|
-
if ($ >=
|
|
971
|
-
throw new Error(`Not enough partition keys (${
|
|
972
|
-
const q =
|
|
973
|
-
if (N >=
|
|
974
|
-
|
|
980
|
+
if (!Je(b))
|
|
981
|
+
throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${b.type} for column ${g.id}`);
|
|
982
|
+
const F = ct(b), $ = y[y.length - 1];
|
|
983
|
+
if ($ >= b.partitionKeyLength)
|
|
984
|
+
throw new Error(`Not enough partition keys (${b.partitionKeyLength}) for requested split axes (max index ${$}) in column ${P.name}`);
|
|
985
|
+
const q = y.map((w) => this.findLabels(E(P.axesSpec[w]))), D = [], I = (w, N) => {
|
|
986
|
+
if (N >= y.length) {
|
|
987
|
+
D.push([...w]);
|
|
975
988
|
return;
|
|
976
989
|
}
|
|
977
|
-
const
|
|
978
|
-
if (
|
|
979
|
-
throw new Error(`Axis index ${
|
|
980
|
-
const O = k
|
|
990
|
+
const k = y[N];
|
|
991
|
+
if (k >= F.length)
|
|
992
|
+
throw new Error(`Axis index ${k} out of bounds for unique keys array (length ${F.length}) during split key generation for column ${g.id}`);
|
|
993
|
+
const O = F[k];
|
|
981
994
|
if (!O || O.length === 0) {
|
|
982
|
-
|
|
995
|
+
D.length = 0;
|
|
983
996
|
return;
|
|
984
997
|
}
|
|
985
|
-
for (const
|
|
986
|
-
|
|
998
|
+
for (const z of O)
|
|
999
|
+
w.push(z), I(w, N + 1), w.pop();
|
|
987
1000
|
};
|
|
988
|
-
if (
|
|
1001
|
+
if (I([], 0), D.length === 0)
|
|
989
1002
|
continue;
|
|
990
|
-
const
|
|
991
|
-
for (let
|
|
992
|
-
|
|
993
|
-
const
|
|
994
|
-
for (const
|
|
995
|
-
const N =
|
|
996
|
-
const
|
|
997
|
-
return { axisIdx:
|
|
1003
|
+
const R = [...P.axesSpec], se = y.map((w) => w);
|
|
1004
|
+
for (let w = y.length - 1; w >= 0; w--)
|
|
1005
|
+
R.splice(y[w], 1);
|
|
1006
|
+
const J = { ...P, axesSpec: R };
|
|
1007
|
+
for (const w of D) {
|
|
1008
|
+
const N = w.map((k, O) => {
|
|
1009
|
+
const z = se[O], Re = E(P.axesSpec[z]), oe = q[O], Oe = (oe == null ? void 0 : oe[k]) ?? String(k);
|
|
1010
|
+
return { axisIdx: z, axisId: Re, value: k, label: Oe };
|
|
998
1011
|
});
|
|
999
|
-
|
|
1012
|
+
u.push({
|
|
1000
1013
|
type: "split",
|
|
1001
1014
|
originalColumn: g,
|
|
1002
|
-
spec:
|
|
1003
|
-
adjustedSpec:
|
|
1004
|
-
dataEntries:
|
|
1015
|
+
spec: P,
|
|
1016
|
+
adjustedSpec: J,
|
|
1017
|
+
dataEntries: b,
|
|
1005
1018
|
axisFilters: N
|
|
1006
1019
|
});
|
|
1007
1020
|
}
|
|
1008
1021
|
} else
|
|
1009
|
-
|
|
1022
|
+
u.push({
|
|
1010
1023
|
type: "direct",
|
|
1011
1024
|
originalColumn: g,
|
|
1012
|
-
spec:
|
|
1013
|
-
adjustedSpec:
|
|
1025
|
+
spec: P,
|
|
1026
|
+
adjustedSpec: P
|
|
1014
1027
|
});
|
|
1015
1028
|
}
|
|
1016
1029
|
}
|
|
1017
|
-
if (
|
|
1018
|
-
const
|
|
1019
|
-
|
|
1020
|
-
(
|
|
1021
|
-
spec:
|
|
1022
|
-
suffixTrace:
|
|
1030
|
+
if (u.length === 0) return [];
|
|
1031
|
+
const S = Ee(
|
|
1032
|
+
u,
|
|
1033
|
+
(f) => ({
|
|
1034
|
+
spec: f.spec,
|
|
1035
|
+
suffixTrace: f.type === "split" ? ht(f.axisFilters) : void 0
|
|
1023
1036
|
}),
|
|
1024
1037
|
a
|
|
1025
1038
|
), d = [];
|
|
1026
|
-
for (const { value:
|
|
1027
|
-
const { originalColumn:
|
|
1028
|
-
let
|
|
1029
|
-
r ?
|
|
1030
|
-
let g = { ...
|
|
1039
|
+
for (const { value: f, label: p } of S) {
|
|
1040
|
+
const { originalColumn: c, spec: h } = f, A = f.type === "split" ? f.axisFilters : void 0, y = gt(A);
|
|
1041
|
+
let v;
|
|
1042
|
+
r ? v = r.deriveS(h, y) : v = mt(c.id, y);
|
|
1043
|
+
let g = { ...f.adjustedSpec };
|
|
1031
1044
|
o && (g = {
|
|
1032
1045
|
...g,
|
|
1033
1046
|
annotations: {
|
|
1034
1047
|
...g.annotations ?? {},
|
|
1035
|
-
"pl7.app/label":
|
|
1048
|
+
"pl7.app/label": p
|
|
1036
1049
|
}
|
|
1037
1050
|
}), d.push({
|
|
1038
|
-
id:
|
|
1051
|
+
id: v,
|
|
1039
1052
|
spec: g,
|
|
1040
|
-
data: () =>
|
|
1041
|
-
label:
|
|
1053
|
+
data: () => f.type === "split" ? Ne(dt(f.dataEntries, y)) : f.originalColumn.data,
|
|
1054
|
+
label: p
|
|
1042
1055
|
});
|
|
1043
1056
|
}
|
|
1044
1057
|
return d;
|
|
@@ -1074,11 +1087,11 @@ function le(t, e) {
|
|
|
1074
1087
|
return !0;
|
|
1075
1088
|
}
|
|
1076
1089
|
function we(t) {
|
|
1077
|
-
return ge(t, (e) => e instanceof
|
|
1090
|
+
return ge(t, (e) => e instanceof _ ? e.handle : me(e) ? qe(e, (n) => n.handle) : e);
|
|
1078
1091
|
}
|
|
1079
1092
|
class bt {
|
|
1080
1093
|
constructor() {
|
|
1081
|
-
L(this, "ctx",
|
|
1094
|
+
L(this, "ctx", m());
|
|
1082
1095
|
}
|
|
1083
1096
|
/**
|
|
1084
1097
|
* @deprecated use getOptions()
|
|
@@ -1088,7 +1101,7 @@ class bt {
|
|
|
1088
1101
|
}
|
|
1089
1102
|
getOptions(e, n) {
|
|
1090
1103
|
const r = typeof e == "function" ? e : ce(e), i = this.getSpecs().entries.filter((s) => r(s.obj));
|
|
1091
|
-
return typeof n == "object" || typeof n > "u" ?
|
|
1104
|
+
return typeof n == "object" || typeof n > "u" ? Ee(i, (s) => s.obj, n ?? {}).map(({ value: { ref: s }, label: o }) => ({
|
|
1092
1105
|
ref: s,
|
|
1093
1106
|
label: o
|
|
1094
1107
|
})) : i.map((s) => ({
|
|
@@ -1181,7 +1194,7 @@ class bt {
|
|
|
1181
1194
|
ref: n.ref,
|
|
1182
1195
|
obj: {
|
|
1183
1196
|
...n.obj,
|
|
1184
|
-
data: new
|
|
1197
|
+
data: new _(n.obj.data, [n.ref.blockId, n.ref.name])
|
|
1185
1198
|
}
|
|
1186
1199
|
}))
|
|
1187
1200
|
};
|
|
@@ -1202,7 +1215,7 @@ class bt {
|
|
|
1202
1215
|
...n.obj,
|
|
1203
1216
|
data: Me(
|
|
1204
1217
|
n.obj.data,
|
|
1205
|
-
(r) => new
|
|
1218
|
+
(r) => new _(r, [n.ref.blockId, n.ref.name])
|
|
1206
1219
|
)
|
|
1207
1220
|
}
|
|
1208
1221
|
}))
|
|
@@ -1231,7 +1244,7 @@ class bt {
|
|
|
1231
1244
|
if (n)
|
|
1232
1245
|
return ge(
|
|
1233
1246
|
n,
|
|
1234
|
-
(i) => new
|
|
1247
|
+
(i) => new _(i, [e.blockId, e.name])
|
|
1235
1248
|
);
|
|
1236
1249
|
}
|
|
1237
1250
|
/**
|
|
@@ -1252,7 +1265,7 @@ class bt {
|
|
|
1252
1265
|
getPColumnSpecByRef(e) {
|
|
1253
1266
|
const n = this.getSpecByRef(e);
|
|
1254
1267
|
if (n) {
|
|
1255
|
-
if (!
|
|
1268
|
+
if (!Q(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
|
|
1256
1269
|
return n;
|
|
1257
1270
|
}
|
|
1258
1271
|
}
|
|
@@ -1271,7 +1284,7 @@ class bt {
|
|
|
1271
1284
|
findDataWithCompatibleSpec(e) {
|
|
1272
1285
|
const n = [];
|
|
1273
1286
|
e: for (const r of this.getData().entries) {
|
|
1274
|
-
if (!
|
|
1287
|
+
if (!Q(r.obj.spec))
|
|
1275
1288
|
continue;
|
|
1276
1289
|
const i = r.obj.spec;
|
|
1277
1290
|
if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && le(e.domain, i.domain)) {
|
|
@@ -1292,7 +1305,7 @@ class bt {
|
|
|
1292
1305
|
findLabels(e) {
|
|
1293
1306
|
const n = this.getData();
|
|
1294
1307
|
for (const r of n.entries) {
|
|
1295
|
-
if (!
|
|
1308
|
+
if (!ie(r.obj)) continue;
|
|
1296
1309
|
const i = r.obj.spec;
|
|
1297
1310
|
if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type && le(e.domain, i.axesSpec[0].domain)) {
|
|
1298
1311
|
if (r.obj.data.resourceType.name !== "PColumnData/Json")
|
|
@@ -1314,7 +1327,7 @@ class bt {
|
|
|
1314
1327
|
*/
|
|
1315
1328
|
selectColumns(e) {
|
|
1316
1329
|
const n = typeof e == "function" ? e : ce(e);
|
|
1317
|
-
return this.getSpecs().entries.filter(({ obj: i }) =>
|
|
1330
|
+
return this.getSpecs().entries.filter(({ obj: i }) => Q(i) ? n(i) : !1).map(({ ref: i, obj: s }) => {
|
|
1318
1331
|
const o = s;
|
|
1319
1332
|
let a = null;
|
|
1320
1333
|
const l = this;
|
|
@@ -1322,8 +1335,8 @@ class bt {
|
|
|
1322
1335
|
id: Pe(i),
|
|
1323
1336
|
spec: o,
|
|
1324
1337
|
get data() {
|
|
1325
|
-
var
|
|
1326
|
-
return a !== null || (a = (
|
|
1338
|
+
var u;
|
|
1339
|
+
return a !== null || (a = (u = l.getPColumnByRef(i)) == null ? void 0 : u.data), a;
|
|
1327
1340
|
}
|
|
1328
1341
|
};
|
|
1329
1342
|
});
|
|
@@ -1341,7 +1354,7 @@ class bt {
|
|
|
1341
1354
|
}));
|
|
1342
1355
|
}
|
|
1343
1356
|
}
|
|
1344
|
-
class
|
|
1357
|
+
class X {
|
|
1345
1358
|
constructor() {
|
|
1346
1359
|
L(this, "ctx");
|
|
1347
1360
|
L(this, "args");
|
|
@@ -1349,7 +1362,7 @@ class Q {
|
|
|
1349
1362
|
// lazy rendering because this feature is rarely used
|
|
1350
1363
|
L(this, "_activeArgsCache");
|
|
1351
1364
|
L(this, "resultPool", new bt());
|
|
1352
|
-
this.ctx =
|
|
1365
|
+
this.ctx = m(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
|
|
1353
1366
|
}
|
|
1354
1367
|
/**
|
|
1355
1368
|
* Returns args snapshot the block was executed for (i.e. when "Run" button was pressed).
|
|
@@ -1367,7 +1380,7 @@ class Q {
|
|
|
1367
1380
|
getNamedAccessor(e) {
|
|
1368
1381
|
return pe(
|
|
1369
1382
|
this.ctx.getAccessorHandleByName(e),
|
|
1370
|
-
(n) => new
|
|
1383
|
+
(n) => new _(n, [e])
|
|
1371
1384
|
);
|
|
1372
1385
|
}
|
|
1373
1386
|
get prerun() {
|
|
@@ -1386,7 +1399,7 @@ class Q {
|
|
|
1386
1399
|
}
|
|
1387
1400
|
verifyInlineAndExplicitColumnsSupport(e) {
|
|
1388
1401
|
var i;
|
|
1389
|
-
const n = e.some((s) => !(s.data instanceof
|
|
1402
|
+
const n = e.some((s) => !(s.data instanceof _) || me(s.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
|
|
1390
1403
|
if (n && !r) throw Error("Inline or explicit columns not supported");
|
|
1391
1404
|
}
|
|
1392
1405
|
// TODO remove all non-PColumn fields
|
|
@@ -1417,7 +1430,7 @@ class Q {
|
|
|
1417
1430
|
return this.ctx.getCurrentUnstableMarker();
|
|
1418
1431
|
}
|
|
1419
1432
|
}
|
|
1420
|
-
const M = "1.28.
|
|
1433
|
+
const M = "1.28.1";
|
|
1421
1434
|
function wt(t) {
|
|
1422
1435
|
return t.__renderLambda === !0;
|
|
1423
1436
|
}
|
|
@@ -1440,7 +1453,7 @@ function dn(t) {
|
|
|
1440
1453
|
sdkVersion: o,
|
|
1441
1454
|
sections: a,
|
|
1442
1455
|
title: l
|
|
1443
|
-
} = t.v3, { code:
|
|
1456
|
+
} = t.v3, { code: u } = t;
|
|
1444
1457
|
return {
|
|
1445
1458
|
initialArgs: e,
|
|
1446
1459
|
initialUiState: n,
|
|
@@ -1450,7 +1463,7 @@ function dn(t) {
|
|
|
1450
1463
|
sdkVersion: o,
|
|
1451
1464
|
sections: a,
|
|
1452
1465
|
title: l,
|
|
1453
|
-
code:
|
|
1466
|
+
code: u
|
|
1454
1467
|
};
|
|
1455
1468
|
} else if (t.inputsValid !== void 0) {
|
|
1456
1469
|
const { sdkVersion: e, renderingMode: n, outputs: r, inputsValid: i, sections: s, initialArgs: o, code: a } = t, l = Object.keys(t);
|
|
@@ -1463,7 +1476,7 @@ function dn(t) {
|
|
|
1463
1476
|
renderingMode: n,
|
|
1464
1477
|
initialArgs: o,
|
|
1465
1478
|
outputs: Object.fromEntries(
|
|
1466
|
-
Object.entries(r).map(([
|
|
1479
|
+
Object.entries(r).map(([u, S]) => [u, j(S)])
|
|
1467
1480
|
),
|
|
1468
1481
|
inputsValid: j(i),
|
|
1469
1482
|
sections: j(s),
|
|
@@ -1481,7 +1494,7 @@ function dn(t) {
|
|
|
1481
1494
|
renderingMode: r,
|
|
1482
1495
|
initialArgs: o,
|
|
1483
1496
|
outputs: Object.fromEntries(
|
|
1484
|
-
Object.entries(i).map(([
|
|
1497
|
+
Object.entries(i).map(([u, S]) => [u, j(S)])
|
|
1485
1498
|
),
|
|
1486
1499
|
inputsValid: j(n),
|
|
1487
1500
|
sections: j(s),
|
|
@@ -1505,15 +1518,15 @@ class T {
|
|
|
1505
1518
|
void 0,
|
|
1506
1519
|
{},
|
|
1507
1520
|
{},
|
|
1508
|
-
|
|
1509
|
-
|
|
1521
|
+
Z(!0),
|
|
1522
|
+
Z([]),
|
|
1510
1523
|
void 0
|
|
1511
1524
|
);
|
|
1512
1525
|
}
|
|
1513
1526
|
output(e, n, r = {}) {
|
|
1514
1527
|
if (typeof n == "function") {
|
|
1515
1528
|
const i = `output#${e}`;
|
|
1516
|
-
return
|
|
1529
|
+
return Y(i, () => n(new X())), new T(
|
|
1517
1530
|
this._renderingMode,
|
|
1518
1531
|
this._initialArgs,
|
|
1519
1532
|
this._initialUiState,
|
|
@@ -1548,7 +1561,7 @@ class T {
|
|
|
1548
1561
|
return this.output(e, n, { retentive: !0 });
|
|
1549
1562
|
}
|
|
1550
1563
|
argsValid(e) {
|
|
1551
|
-
return typeof e == "function" ? (
|
|
1564
|
+
return typeof e == "function" ? (Y("inputsValid", () => e(new X())), new T(
|
|
1552
1565
|
this._renderingMode,
|
|
1553
1566
|
this._initialArgs,
|
|
1554
1567
|
this._initialUiState,
|
|
@@ -1570,7 +1583,7 @@ class T {
|
|
|
1570
1583
|
);
|
|
1571
1584
|
}
|
|
1572
1585
|
sections(e) {
|
|
1573
|
-
return Array.isArray(e) ? this.sections(
|
|
1586
|
+
return Array.isArray(e) ? this.sections(Z(e)) : typeof e == "function" ? (Y("sections", () => e(new X())), new T(
|
|
1574
1587
|
this._renderingMode,
|
|
1575
1588
|
this._initialArgs,
|
|
1576
1589
|
this._initialUiState,
|
|
@@ -1590,7 +1603,7 @@ class T {
|
|
|
1590
1603
|
}
|
|
1591
1604
|
/** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
|
|
1592
1605
|
title(e) {
|
|
1593
|
-
return
|
|
1606
|
+
return Y("title", () => e(new X())), new T(
|
|
1594
1607
|
this._renderingMode,
|
|
1595
1608
|
this._initialArgs,
|
|
1596
1609
|
this._initialUiState,
|
|
@@ -1669,39 +1682,39 @@ class T {
|
|
|
1669
1682
|
}
|
|
1670
1683
|
}
|
|
1671
1684
|
function fn(t, e, n, r) {
|
|
1672
|
-
var
|
|
1685
|
+
var u, S;
|
|
1673
1686
|
Array.isArray(r) && (r = { filters: r });
|
|
1674
|
-
const i = t.resultPool.getData().entries.map((d) => d.obj).filter(
|
|
1675
|
-
let
|
|
1676
|
-
if (
|
|
1677
|
-
for (const
|
|
1678
|
-
|
|
1679
|
-
return
|
|
1687
|
+
const i = t.resultPool.getData().entries.map((d) => d.obj).filter(ie).filter((d) => d.spec.name === "pl7.app/label" && d.spec.axesSpec.length === 1), s = (d, f) => {
|
|
1688
|
+
let p = d.toString();
|
|
1689
|
+
if (f)
|
|
1690
|
+
for (const c in f)
|
|
1691
|
+
p += c, p += f[c];
|
|
1692
|
+
return p;
|
|
1680
1693
|
}, o = /* @__PURE__ */ new Map();
|
|
1681
1694
|
for (const d of e)
|
|
1682
|
-
for (const
|
|
1683
|
-
const
|
|
1684
|
-
for (const
|
|
1685
|
-
const
|
|
1686
|
-
if (G(
|
|
1687
|
-
const
|
|
1688
|
-
if (
|
|
1689
|
-
const g = s(
|
|
1695
|
+
for (const f of d.spec.axesSpec) {
|
|
1696
|
+
const p = E(f);
|
|
1697
|
+
for (const c of i) {
|
|
1698
|
+
const h = c.spec.axesSpec[0], A = E(c.spec.axesSpec[0]);
|
|
1699
|
+
if (G(p, A)) {
|
|
1700
|
+
const y = Object.keys(p.domain ?? {}).length, v = Object.keys(A.domain ?? {}).length;
|
|
1701
|
+
if (y > v) {
|
|
1702
|
+
const g = s(c.id, p.domain);
|
|
1690
1703
|
o.set(g, {
|
|
1691
1704
|
id: g,
|
|
1692
1705
|
spec: {
|
|
1693
|
-
...
|
|
1694
|
-
axesSpec: [{ ...
|
|
1706
|
+
...c.spec,
|
|
1707
|
+
axesSpec: [{ ...p, annotations: h.annotations }]
|
|
1695
1708
|
},
|
|
1696
|
-
data:
|
|
1709
|
+
data: c.data
|
|
1697
1710
|
});
|
|
1698
1711
|
} else
|
|
1699
|
-
o.set(s(
|
|
1712
|
+
o.set(s(c.id), c);
|
|
1700
1713
|
}
|
|
1701
1714
|
}
|
|
1702
1715
|
}
|
|
1703
1716
|
if ([...e, ...o.values()].some(
|
|
1704
|
-
(d) => d.data instanceof
|
|
1717
|
+
(d) => d.data instanceof _ && !d.data.getIsReadyOrError()
|
|
1705
1718
|
))
|
|
1706
1719
|
return;
|
|
1707
1720
|
let a = e;
|
|
@@ -1720,8 +1733,8 @@ function fn(t, e, n, r) {
|
|
|
1720
1733
|
},
|
|
1721
1734
|
secondary: l.map((d) => ({ type: "column", column: d }))
|
|
1722
1735
|
},
|
|
1723
|
-
filters: [...(r == null ? void 0 : r.filters) ?? [], ...((
|
|
1724
|
-
sorting: ((
|
|
1736
|
+
filters: [...(r == null ? void 0 : r.filters) ?? [], ...((u = n == null ? void 0 : n.pTableParams) == null ? void 0 : u.filters) ?? []],
|
|
1737
|
+
sorting: ((S = n == null ? void 0 : n.pTableParams) == null ? void 0 : S.sorting) ?? []
|
|
1725
1738
|
});
|
|
1726
1739
|
}
|
|
1727
1740
|
function hn(t, e, n) {
|
|
@@ -1755,55 +1768,55 @@ function St(t) {
|
|
|
1755
1768
|
}), e;
|
|
1756
1769
|
}
|
|
1757
1770
|
function xt(t, e) {
|
|
1758
|
-
const n = t.spec.axesSpec.map(
|
|
1759
|
-
return e.spec.axesSpec.map(
|
|
1771
|
+
const n = t.spec.axesSpec.map(E);
|
|
1772
|
+
return e.spec.axesSpec.map(E).every((i) => n.some((s) => G(s, i) && G(i, s)));
|
|
1760
1773
|
}
|
|
1761
1774
|
function ke(t, e) {
|
|
1762
|
-
const n = t.spec.axesSpec.map(
|
|
1763
|
-
return e.spec.axesSpec.map(
|
|
1775
|
+
const n = t.spec.axesSpec.map(E);
|
|
1776
|
+
return e.spec.axesSpec.map(E).every((i) => n.some((s) => G(s, i)));
|
|
1764
1777
|
}
|
|
1765
1778
|
const Pt = "pl7.app/graph/isVirtual", Ae = "pl7.app/label";
|
|
1766
1779
|
function Se(t, e) {
|
|
1767
|
-
const n = t.spec.axesSpec.map(
|
|
1780
|
+
const n = t.spec.axesSpec.map(E), r = e.spec.axesSpec.map(E);
|
|
1768
1781
|
if (xt(t, e))
|
|
1769
1782
|
return [];
|
|
1770
1783
|
if (!ke(t, e))
|
|
1771
1784
|
return [];
|
|
1772
|
-
const o = r.map((d) => n.filter((
|
|
1773
|
-
const
|
|
1774
|
-
return d.map((
|
|
1775
|
-
const
|
|
1776
|
-
return Object.entries(
|
|
1777
|
-
if ((
|
|
1778
|
-
const g = JSON.stringify([
|
|
1779
|
-
|
|
1785
|
+
const o = r.map((d) => n.filter((f) => G(f, d))), a = St(o), l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), S = a.map((d) => {
|
|
1786
|
+
const f = /* @__PURE__ */ new Set();
|
|
1787
|
+
return d.map((p, c) => {
|
|
1788
|
+
const h = e.spec.axesSpec[c].domain, A = p.domain;
|
|
1789
|
+
return Object.entries(A ?? {}).forEach(([y, v]) => {
|
|
1790
|
+
if ((h == null ? void 0 : h[y]) === void 0) {
|
|
1791
|
+
const g = JSON.stringify([y, v]);
|
|
1792
|
+
f.add(g), l.add(g);
|
|
1780
1793
|
}
|
|
1781
1794
|
}), {
|
|
1782
|
-
...
|
|
1783
|
-
annotations: e.spec.axesSpec[
|
|
1795
|
+
...p,
|
|
1796
|
+
annotations: e.spec.axesSpec[c].annotations
|
|
1784
1797
|
};
|
|
1785
|
-
}),
|
|
1798
|
+
}), f;
|
|
1786
1799
|
});
|
|
1787
1800
|
return [...l].forEach((d) => {
|
|
1788
|
-
|
|
1789
|
-
}), a.map((d,
|
|
1790
|
-
var
|
|
1791
|
-
const
|
|
1801
|
+
S.some((f) => !f.has(d)) && u.add(d);
|
|
1802
|
+
}), a.map((d, f) => {
|
|
1803
|
+
var y;
|
|
1804
|
+
const p = At(e.id, d.map((v) => v.domain)), c = ((y = e.spec.annotations) == null ? void 0 : y[Ae]) ?? "", h = [...S[f]].filter((v) => u.has(v)).sort().map((v) => {
|
|
1792
1805
|
var g;
|
|
1793
|
-
return (g = JSON.parse(
|
|
1794
|
-
}).join(" / "),
|
|
1806
|
+
return (g = JSON.parse(v)) == null ? void 0 : g[1];
|
|
1807
|
+
}).join(" / "), A = {
|
|
1795
1808
|
...e.spec.annotations,
|
|
1796
1809
|
[Pt]: "true"
|
|
1797
1810
|
};
|
|
1798
|
-
return (
|
|
1799
|
-
id:
|
|
1811
|
+
return (c || h) && (A[Ae] = c && h ? c + " / " + h : c + h), {
|
|
1812
|
+
id: p,
|
|
1800
1813
|
spec: {
|
|
1801
1814
|
...e.spec,
|
|
1802
|
-
axesSpec: d.map((
|
|
1803
|
-
...
|
|
1815
|
+
axesSpec: d.map((v, g) => ({
|
|
1816
|
+
...v,
|
|
1804
1817
|
annotations: e.spec.axesSpec[g].annotations
|
|
1805
1818
|
})),
|
|
1806
|
-
annotations:
|
|
1819
|
+
annotations: A
|
|
1807
1820
|
},
|
|
1808
1821
|
data: e.data
|
|
1809
1822
|
};
|
|
@@ -1844,9 +1857,9 @@ const It = [
|
|
|
1844
1857
|
];
|
|
1845
1858
|
function gn(t, e) {
|
|
1846
1859
|
if (e === void 0) return;
|
|
1847
|
-
const n = t.resultPool.getData().entries.map((s) => s.obj).filter(
|
|
1860
|
+
const n = t.resultPool.getData().entries.map((s) => s.obj).filter(ie).filter((s) => It.includes(s.spec.valueType)), r = _t(e, n), i = [...r, ...Ct(r)];
|
|
1848
1861
|
if (!i.some(
|
|
1849
|
-
(s) => s.data instanceof
|
|
1862
|
+
(s) => s.data instanceof _ && !s.data.getIsReadyOrError()
|
|
1850
1863
|
))
|
|
1851
1864
|
return t.createPFrame(i);
|
|
1852
1865
|
}
|
|
@@ -1873,14 +1886,14 @@ class mn {
|
|
|
1873
1886
|
function Lt(t) {
|
|
1874
1887
|
return Ce({
|
|
1875
1888
|
__isRef: !0,
|
|
1876
|
-
blockId:
|
|
1877
|
-
name:
|
|
1889
|
+
blockId: ee(t, "blockId"),
|
|
1890
|
+
name: ee(t, "name")
|
|
1878
1891
|
});
|
|
1879
1892
|
}
|
|
1880
1893
|
function yn(t) {
|
|
1881
1894
|
return Ce({
|
|
1882
|
-
ref: Lt(
|
|
1883
|
-
label:
|
|
1895
|
+
ref: Lt(ee(t, "ref")),
|
|
1896
|
+
label: ee(t, "label")
|
|
1884
1897
|
});
|
|
1885
1898
|
}
|
|
1886
1899
|
const vn = {
|
|
@@ -1904,7 +1917,7 @@ export {
|
|
|
1904
1917
|
jt as Args,
|
|
1905
1918
|
T as BlockModel,
|
|
1906
1919
|
vn as CurrentSdkInfo,
|
|
1907
|
-
|
|
1920
|
+
C as FutureRef,
|
|
1908
1921
|
Pt as IS_VIRTUAL_COLUMN,
|
|
1909
1922
|
Kt as It,
|
|
1910
1923
|
cn as JsRenderInternal,
|
|
@@ -1918,22 +1931,22 @@ export {
|
|
|
1918
1931
|
V as RT_BINARY_PARTITIONED,
|
|
1919
1932
|
B as RT_BINARY_SUPER_PARTITIONED,
|
|
1920
1933
|
U as RT_JSON_PARTITIONED,
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1934
|
+
re as RT_JSON_SUPER_PARTITIONED,
|
|
1935
|
+
te as RT_RESOURCE_MAP,
|
|
1936
|
+
ne as RT_RESOURCE_MAP_PARTITIONED,
|
|
1937
|
+
X as RenderCtx,
|
|
1925
1938
|
bt as ResultPool,
|
|
1926
1939
|
$t as StagingOutputs,
|
|
1927
1940
|
st as Trace,
|
|
1928
1941
|
it as TraceEntry,
|
|
1929
|
-
|
|
1942
|
+
_ as TreeNodeAccessor,
|
|
1930
1943
|
Jt as UiState,
|
|
1931
1944
|
Ht as and,
|
|
1932
1945
|
pt as convertOrParsePColumnData,
|
|
1933
1946
|
gn as createPFrameForGraphs,
|
|
1934
1947
|
fn as createPlDataTable,
|
|
1935
1948
|
hn as createPlDataTableSheet,
|
|
1936
|
-
|
|
1949
|
+
Ee as deriveLabels,
|
|
1937
1950
|
ue as downgradeCfgOrLambda,
|
|
1938
1951
|
_t as enrichColumnsWithCompatible,
|
|
1939
1952
|
rn as extractArchiveAndGetURL,
|
|
@@ -1949,9 +1962,9 @@ export {
|
|
|
1949
1962
|
tn as getDownloadedBlobContent,
|
|
1950
1963
|
wn as getEnvironmentValue,
|
|
1951
1964
|
W as getFromCfg,
|
|
1952
|
-
|
|
1965
|
+
Z as getImmediate,
|
|
1953
1966
|
sn as getImportProgress,
|
|
1954
|
-
|
|
1967
|
+
ee as getJsonField,
|
|
1955
1968
|
on as getLastLogs,
|
|
1956
1969
|
un as getLogHandle,
|
|
1957
1970
|
nn as getOnDemandBlobContent,
|