@milaboratories/pl-model-common 1.11.3 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/drivers/pframe/data.d.ts.map +1 -1
- package/dist/drivers/pframe/spec/{anchored_id.d.ts → anchored.d.ts} +20 -13
- package/dist/drivers/pframe/spec/anchored.d.ts.map +1 -0
- package/dist/drivers/pframe/spec/filtered_column.d.ts +31 -0
- package/dist/drivers/pframe/spec/filtered_column.d.ts.map +1 -0
- package/dist/drivers/pframe/spec/ids.d.ts +24 -0
- package/dist/drivers/pframe/spec/ids.d.ts.map +1 -0
- package/dist/drivers/pframe/spec/index.d.ts +3 -1
- package/dist/drivers/pframe/spec/index.d.ts.map +1 -1
- package/dist/drivers/pframe/spec/selectors.d.ts +3 -3
- package/dist/drivers/pframe/spec/selectors.d.ts.map +1 -1
- package/dist/drivers/pframe/spec/spec.d.ts +2 -0
- package/dist/drivers/pframe/spec/spec.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +228 -196
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/drivers/pframe/data.ts +1 -0
- package/src/drivers/pframe/spec/{anchored_id.ts → anchored.ts} +63 -21
- package/src/drivers/pframe/spec/filtered_column.ts +39 -0
- package/src/drivers/pframe/spec/ids.ts +31 -0
- package/src/drivers/pframe/spec/index.ts +3 -1
- package/src/drivers/pframe/spec/selectors.ts +4 -3
- package/src/drivers/pframe/spec/spec.ts +6 -0
- package/dist/drivers/pframe/spec/anchored_id.d.ts.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
var
|
|
2
|
-
var F = (n, t, e) => t in n ?
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import { z as
|
|
6
|
-
function
|
|
1
|
+
var V = Object.defineProperty;
|
|
2
|
+
var F = (n, t, e) => t in n ? V(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var m = (n, t, e) => F(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import g from "canonicalize";
|
|
5
|
+
import { z as l } from "zod";
|
|
6
|
+
function dn(n) {
|
|
7
7
|
return n !== void 0 && n.startsWith("log+live://log/");
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function w(n) {
|
|
10
10
|
throw new Error("Unexpected object: " + n);
|
|
11
11
|
}
|
|
12
|
-
const
|
|
12
|
+
const k = "upload://upload/", N = "index://index/";
|
|
13
13
|
function D(n) {
|
|
14
|
-
return n.startsWith(
|
|
14
|
+
return n.startsWith(k);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function O(n) {
|
|
17
17
|
return n.startsWith(N);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
if (
|
|
19
|
+
function U(n) {
|
|
20
|
+
if (O(n)) {
|
|
21
21
|
const t = n.slice(N.length);
|
|
22
22
|
return JSON.parse(decodeURIComponent(t)).path;
|
|
23
23
|
} else if (D(n)) {
|
|
24
|
-
const t = n.slice(
|
|
24
|
+
const t = n.slice(k.length);
|
|
25
25
|
return JSON.parse(decodeURIComponent(t)).localPath;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
w(n);
|
|
28
28
|
}
|
|
29
29
|
function B(n) {
|
|
30
30
|
return n.replace(/^.*[\\/]/, "");
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return B(
|
|
32
|
+
function mn(n) {
|
|
33
|
+
return B(U(n));
|
|
34
34
|
}
|
|
35
|
-
const R = -2147483648,
|
|
36
|
-
function
|
|
35
|
+
const R = -2147483648, A = -9007199254740991n, j = NaN, L = NaN, J = null, M = null;
|
|
36
|
+
function y(n, t) {
|
|
37
37
|
switch (t) {
|
|
38
38
|
case "Int":
|
|
39
39
|
return n === R;
|
|
40
40
|
case "Long":
|
|
41
|
-
return n === Number(
|
|
41
|
+
return n === Number(A) || n === A;
|
|
42
42
|
case "Float":
|
|
43
43
|
return n === j;
|
|
44
44
|
case "Double":
|
|
45
45
|
return n === L;
|
|
46
46
|
case "String":
|
|
47
|
-
return n ===
|
|
47
|
+
return n === J;
|
|
48
48
|
case "Bytes":
|
|
49
|
-
return n ===
|
|
49
|
+
return n === M;
|
|
50
50
|
default:
|
|
51
51
|
throw Error(`unsupported data type: ${t}`);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
if (!
|
|
54
|
+
function ln(n) {
|
|
55
|
+
if (!_(n)) throw new Error(`Expected not-NA PValue, got ${n}`);
|
|
56
56
|
return n;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function _(n, t) {
|
|
59
59
|
if (!t)
|
|
60
60
|
return typeof n == "string" || typeof n == "number" && isFinite(n) || typeof n == "bigint";
|
|
61
|
-
if (
|
|
61
|
+
if (y(n, t)) return !1;
|
|
62
62
|
switch (t) {
|
|
63
63
|
case "Int":
|
|
64
64
|
return typeof n == "number";
|
|
@@ -76,10 +76,10 @@ function H(n, t) {
|
|
|
76
76
|
throw Error(`unsupported data type: ${t}`);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function H(n, t) {
|
|
80
80
|
if (!t)
|
|
81
81
|
return n === null || typeof n == "string" || typeof n == "number" || typeof n == "bigint";
|
|
82
|
-
if (
|
|
82
|
+
if (y(n, t)) return !0;
|
|
83
83
|
switch (t) {
|
|
84
84
|
case "Int":
|
|
85
85
|
return typeof n == "number";
|
|
@@ -97,14 +97,14 @@ function J(n, t) {
|
|
|
97
97
|
throw Error(`unsupported data type: ${t}`);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function pn(n) {
|
|
101
101
|
if (n === null || typeof n == "string" || typeof n == "number") return n;
|
|
102
102
|
if (typeof n == "bigint") return { bigint: n.toString() };
|
|
103
103
|
throw new Error(`Type ${typeof n} (value ${n}) not yet supported.`);
|
|
104
104
|
}
|
|
105
105
|
function K(n, t) {
|
|
106
106
|
if (n === null || typeof n == "string" || typeof n == "number" || typeof n == "bigint") {
|
|
107
|
-
if (t && !
|
|
107
|
+
if (t && !y(n, t) && !H(n, t))
|
|
108
108
|
throw new Error(`Unexpected value type, got ${typeof n}, expected ${t}`);
|
|
109
109
|
return n;
|
|
110
110
|
}
|
|
@@ -115,7 +115,7 @@ function K(n, t) {
|
|
|
115
115
|
}
|
|
116
116
|
throw new Error(`Unsupported type ${typeof n} (value ${n}).`);
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function hn(n) {
|
|
119
119
|
if (n = T(n), n === null) throw new Error("Value is null");
|
|
120
120
|
return n;
|
|
121
121
|
}
|
|
@@ -134,15 +134,15 @@ function W(n, t) {
|
|
|
134
134
|
const e = Math.floor(t / 8), r = 1 << 7 - t % 8;
|
|
135
135
|
return (n[e] & r) > 0;
|
|
136
136
|
}
|
|
137
|
-
const X = { type: "absent" },
|
|
138
|
-
function
|
|
137
|
+
const X = { type: "absent" }, z = null;
|
|
138
|
+
function yn(n) {
|
|
139
139
|
return typeof n == "object" && n !== null && n.type === "absent";
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function bn(n, t, e = {}) {
|
|
142
142
|
if (W(n.absent, t))
|
|
143
143
|
return e.absent === void 0 ? X : e.absent;
|
|
144
144
|
const r = n.data[t], o = n.type;
|
|
145
|
-
if (
|
|
145
|
+
if (y(r, o)) return e.na === void 0 ? z : e.na;
|
|
146
146
|
switch (o) {
|
|
147
147
|
case "Int":
|
|
148
148
|
return r;
|
|
@@ -160,27 +160,30 @@ function yn(n, t, e = {}) {
|
|
|
160
160
|
throw Error(`unsupported data type: ${o}`);
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function p(n) {
|
|
164
164
|
const { type: t, name: e, domain: r } = n;
|
|
165
165
|
return { type: t, name: e, ...r && { domain: r } };
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
return n.map(
|
|
167
|
+
function gn(n) {
|
|
168
|
+
return n.map(p);
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function wn(n) {
|
|
171
|
+
return g(p(n));
|
|
172
|
+
}
|
|
173
|
+
function G(n, t) {
|
|
171
174
|
if (n === void 0) return t === void 0;
|
|
172
175
|
if (t === void 0) return !0;
|
|
173
176
|
for (const e in t)
|
|
174
177
|
if (n[e] !== t[e]) return !1;
|
|
175
178
|
return !0;
|
|
176
179
|
}
|
|
177
|
-
function
|
|
178
|
-
return n.name === t.name &&
|
|
180
|
+
function Q(n, t) {
|
|
181
|
+
return n.name === t.name && G(n.domain, t.domain);
|
|
179
182
|
}
|
|
180
|
-
function
|
|
181
|
-
return { ...n, src:
|
|
183
|
+
function An(n, t) {
|
|
184
|
+
return { ...n, src: h(n.src, t) };
|
|
182
185
|
}
|
|
183
|
-
function
|
|
186
|
+
function h(n, t) {
|
|
184
187
|
switch (n.type) {
|
|
185
188
|
case "column":
|
|
186
189
|
return {
|
|
@@ -191,110 +194,132 @@ function l(n, t) {
|
|
|
191
194
|
case "full":
|
|
192
195
|
return {
|
|
193
196
|
type: n.type,
|
|
194
|
-
entries: n.entries.map((e) =>
|
|
197
|
+
entries: n.entries.map((e) => h(e, t))
|
|
195
198
|
};
|
|
196
199
|
case "outer":
|
|
197
200
|
return {
|
|
198
201
|
type: "outer",
|
|
199
|
-
primary:
|
|
200
|
-
secondary: n.secondary.map((e) =>
|
|
202
|
+
primary: h(n.primary, t),
|
|
203
|
+
secondary: n.secondary.map((e) => h(e, t))
|
|
201
204
|
};
|
|
202
205
|
default:
|
|
203
|
-
|
|
206
|
+
w(n);
|
|
204
207
|
}
|
|
205
208
|
}
|
|
206
|
-
function
|
|
207
|
-
return
|
|
209
|
+
function Y(n) {
|
|
210
|
+
return g(n);
|
|
211
|
+
}
|
|
212
|
+
function xn(n) {
|
|
213
|
+
return JSON.parse(n);
|
|
214
|
+
}
|
|
215
|
+
function x(n) {
|
|
216
|
+
return g(p(n));
|
|
208
217
|
}
|
|
209
|
-
function
|
|
218
|
+
function P(n, t) {
|
|
210
219
|
return JSON.stringify([n, t]);
|
|
211
220
|
}
|
|
212
|
-
class
|
|
221
|
+
class Pn {
|
|
213
222
|
/**
|
|
214
223
|
* Creates a new anchor context from a set of anchor column specifications
|
|
215
224
|
* @param anchors Record of anchor column specifications indexed by anchor ID
|
|
216
225
|
*/
|
|
217
226
|
constructor(t) {
|
|
218
|
-
|
|
219
|
-
|
|
227
|
+
m(this, "domains", /* @__PURE__ */ new Map());
|
|
228
|
+
m(this, "axes", /* @__PURE__ */ new Map());
|
|
220
229
|
/**
|
|
221
230
|
* Domain packs are used to group domain keys that can be anchored to the same anchor
|
|
222
231
|
* This is used to optimize the lookup of domain anchors
|
|
223
232
|
*/
|
|
224
|
-
|
|
233
|
+
m(this, "domainPacks", []);
|
|
225
234
|
/**
|
|
226
235
|
* Maps domain packs to anchors
|
|
227
236
|
*/
|
|
228
|
-
|
|
237
|
+
m(this, "domainPackToAnchor", /* @__PURE__ */ new Map());
|
|
229
238
|
this.anchors = t;
|
|
230
239
|
const e = Object.entries(t);
|
|
231
240
|
e.sort((r, o) => r[0].localeCompare(o[0]));
|
|
232
241
|
for (const [r, o] of e) {
|
|
233
242
|
for (let i = 0; i < o.axesSpec.length; i++) {
|
|
234
|
-
const
|
|
235
|
-
this.axes.set(
|
|
243
|
+
const s = o.axesSpec[i], a = x(s);
|
|
244
|
+
this.axes.set(a, { anchor: r, idx: i });
|
|
236
245
|
}
|
|
237
246
|
if (o.domain !== void 0) {
|
|
238
247
|
const i = Object.entries(o.domain);
|
|
239
|
-
i.sort((
|
|
240
|
-
for (const [
|
|
241
|
-
const
|
|
242
|
-
this.domains.set(
|
|
248
|
+
i.sort((s, a) => s[0].localeCompare(a[0])), this.domainPackToAnchor.set(JSON.stringify(i), r), this.domainPacks.push(i.map(([s]) => s));
|
|
249
|
+
for (const [s, a] of i) {
|
|
250
|
+
const f = P(s, a);
|
|
251
|
+
this.domains.set(f, r);
|
|
243
252
|
}
|
|
244
253
|
}
|
|
245
254
|
}
|
|
246
255
|
}
|
|
247
256
|
/**
|
|
248
|
-
*
|
|
249
|
-
* Replaces domain values and axes with anchored references when possible
|
|
250
|
-
* @param spec Column specification to anchor
|
|
251
|
-
* @returns An anchored column identifier that can be used to identify columns similar to the input specification
|
|
257
|
+
* Implementation of derive method
|
|
252
258
|
*/
|
|
253
|
-
derive(t) {
|
|
254
|
-
const
|
|
259
|
+
derive(t, e) {
|
|
260
|
+
const r = {
|
|
255
261
|
name: t.name,
|
|
256
262
|
axes: []
|
|
257
263
|
};
|
|
258
|
-
let
|
|
264
|
+
let o;
|
|
259
265
|
if (t.domain !== void 0)
|
|
260
266
|
n:
|
|
261
|
-
for (const
|
|
262
|
-
const
|
|
263
|
-
for (const
|
|
264
|
-
const
|
|
265
|
-
if (
|
|
266
|
-
|
|
267
|
+
for (const s of this.domainPacks) {
|
|
268
|
+
const a = [];
|
|
269
|
+
for (const u of s) {
|
|
270
|
+
const d = t.domain[u];
|
|
271
|
+
if (d !== void 0)
|
|
272
|
+
a.push([u, d]);
|
|
267
273
|
else
|
|
268
274
|
break n;
|
|
269
275
|
}
|
|
270
|
-
const
|
|
271
|
-
if (
|
|
272
|
-
|
|
276
|
+
const f = this.domainPackToAnchor.get(JSON.stringify(a));
|
|
277
|
+
if (f !== void 0) {
|
|
278
|
+
r.domainAnchor = f, o = new Set(s);
|
|
273
279
|
break;
|
|
274
280
|
}
|
|
275
281
|
}
|
|
276
|
-
for (const [
|
|
277
|
-
if (
|
|
282
|
+
for (const [s, a] of Object.entries(t.domain ?? {})) {
|
|
283
|
+
if (o !== void 0 && o.has(s))
|
|
278
284
|
continue;
|
|
279
|
-
const
|
|
280
|
-
|
|
285
|
+
const f = P(s, a), u = this.domains.get(f);
|
|
286
|
+
r.domain ?? (r.domain = {}), r.domain[s] = u ? { anchor: u } : a;
|
|
287
|
+
}
|
|
288
|
+
if (r.axes = t.axesSpec.map((s) => {
|
|
289
|
+
const a = x(s);
|
|
290
|
+
return this.axes.get(a) ?? s;
|
|
291
|
+
}), !e || e.length === 0)
|
|
292
|
+
return r;
|
|
293
|
+
const i = [];
|
|
294
|
+
for (const s of e) {
|
|
295
|
+
const [a, f] = s;
|
|
296
|
+
if (typeof a == "number") {
|
|
297
|
+
if (a < 0 || a >= t.axesSpec.length)
|
|
298
|
+
throw new Error(`Axis index ${a} is out of bounds (0-${t.axesSpec.length - 1})`);
|
|
299
|
+
i.push([a, f]);
|
|
300
|
+
} else {
|
|
301
|
+
const u = t.axesSpec.findIndex((d) => d.name === a);
|
|
302
|
+
if (u === -1)
|
|
303
|
+
throw new Error(`Axis with name "${a}" not found in the column specification`);
|
|
304
|
+
i.push([u, f]);
|
|
305
|
+
}
|
|
281
306
|
}
|
|
282
|
-
return
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
307
|
+
return i.sort((s, a) => s[0] - a[0]), {
|
|
308
|
+
source: r,
|
|
309
|
+
axisFilters: i
|
|
310
|
+
};
|
|
286
311
|
}
|
|
287
312
|
/**
|
|
288
313
|
* Derives a canonicalized string representation of an anchored column identifier, can be used as a unique identifier for the column
|
|
289
314
|
* @param spec Column specification to anchor
|
|
315
|
+
* @param axisFilters Optional axis filters to apply to the column
|
|
290
316
|
* @returns A canonicalized string representation of the anchored column identifier
|
|
291
317
|
*/
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
return k(e);
|
|
318
|
+
deriveS(t, e) {
|
|
319
|
+
return Y(this.derive(t, e));
|
|
295
320
|
}
|
|
296
321
|
}
|
|
297
|
-
function
|
|
322
|
+
function En(n, t) {
|
|
298
323
|
const e = { ...t };
|
|
299
324
|
if (e.domainAnchor !== void 0) {
|
|
300
325
|
const r = n[e.domainAnchor];
|
|
@@ -309,19 +334,19 @@ function An(n, t) {
|
|
|
309
334
|
if (typeof i == "string")
|
|
310
335
|
r[o] = i;
|
|
311
336
|
else {
|
|
312
|
-
const
|
|
313
|
-
if (!
|
|
337
|
+
const s = n[i.anchor];
|
|
338
|
+
if (!s)
|
|
314
339
|
throw new Error(`Anchor "${i.anchor}" not found for domain key "${o}"`);
|
|
315
|
-
if (!
|
|
340
|
+
if (!s.domain || s.domain[o] === void 0)
|
|
316
341
|
throw new Error(`Domain key "${o}" not found in anchor "${i.anchor}"`);
|
|
317
|
-
r[o] =
|
|
342
|
+
r[o] = s.domain[o];
|
|
318
343
|
}
|
|
319
344
|
e.domain = r;
|
|
320
345
|
}
|
|
321
|
-
return e.axes && (e.axes = e.axes.map((r) =>
|
|
346
|
+
return e.axes && (e.axes = e.axes.map((r) => Z(n, r))), e;
|
|
322
347
|
}
|
|
323
|
-
function
|
|
324
|
-
if (!
|
|
348
|
+
function Z(n, t) {
|
|
349
|
+
if (!q(t))
|
|
325
350
|
return t;
|
|
326
351
|
const e = t.anchor, r = n[e];
|
|
327
352
|
if (!r)
|
|
@@ -338,7 +363,7 @@ function Y(n, t) {
|
|
|
338
363
|
throw new Error(`Axis with name "${t.name}" not found in anchor "${e}"`);
|
|
339
364
|
return o[0];
|
|
340
365
|
} else if ("id" in t) {
|
|
341
|
-
const o = r.axesSpec.filter((i) =>
|
|
366
|
+
const o = r.axesSpec.filter((i) => Q(t.id, p(i)));
|
|
342
367
|
if (o.length > 1)
|
|
343
368
|
throw new Error(`Multiple matching axes found for matcher in anchor "${e}"`);
|
|
344
369
|
if (o.length === 0)
|
|
@@ -347,32 +372,35 @@ function Y(n, t) {
|
|
|
347
372
|
}
|
|
348
373
|
throw new Error("Unsupported axis reference type");
|
|
349
374
|
}
|
|
350
|
-
function
|
|
375
|
+
function q(n) {
|
|
351
376
|
return typeof n == "object" && "anchor" in n;
|
|
352
377
|
}
|
|
353
|
-
function
|
|
378
|
+
function In(n) {
|
|
379
|
+
return typeof n == "object" && n !== null && "source" in n && "axisFilters" in n;
|
|
380
|
+
}
|
|
381
|
+
function c(n) {
|
|
354
382
|
return n.kind === "PColumn";
|
|
355
383
|
}
|
|
356
|
-
function
|
|
357
|
-
return
|
|
384
|
+
function v(n) {
|
|
385
|
+
return c(n.spec);
|
|
358
386
|
}
|
|
359
|
-
function
|
|
360
|
-
return
|
|
387
|
+
function kn(n) {
|
|
388
|
+
return c(n.obj);
|
|
361
389
|
}
|
|
362
|
-
function
|
|
363
|
-
return
|
|
390
|
+
function Nn(n) {
|
|
391
|
+
return c(n.obj.spec);
|
|
364
392
|
}
|
|
365
|
-
function
|
|
366
|
-
if (!
|
|
393
|
+
function Sn(n) {
|
|
394
|
+
if (!v(n)) throw new Error(`not a PColumn (kind = ${n.spec.kind})`);
|
|
367
395
|
return n;
|
|
368
396
|
}
|
|
369
|
-
function
|
|
397
|
+
function Cn(n, t) {
|
|
370
398
|
return n === void 0 ? void 0 : {
|
|
371
399
|
...n,
|
|
372
400
|
data: t(n.data)
|
|
373
401
|
};
|
|
374
402
|
}
|
|
375
|
-
function
|
|
403
|
+
function $n(n) {
|
|
376
404
|
const t = /* @__PURE__ */ new Map(), e = (r) => {
|
|
377
405
|
switch (r.type) {
|
|
378
406
|
case "column":
|
|
@@ -387,12 +415,12 @@ function In(n) {
|
|
|
387
415
|
for (const o of r.secondary) e(o);
|
|
388
416
|
return;
|
|
389
417
|
default:
|
|
390
|
-
|
|
418
|
+
w(r);
|
|
391
419
|
}
|
|
392
420
|
};
|
|
393
421
|
return e(n), [...t.values()];
|
|
394
422
|
}
|
|
395
|
-
function
|
|
423
|
+
function nn(n) {
|
|
396
424
|
throw new Error("Unexpected object: " + n);
|
|
397
425
|
}
|
|
398
426
|
function b(n, t) {
|
|
@@ -408,15 +436,15 @@ function b(n, t) {
|
|
|
408
436
|
case "not":
|
|
409
437
|
return !b(n.operand, t);
|
|
410
438
|
case "name":
|
|
411
|
-
return
|
|
439
|
+
return c(t) && t.name === n.name;
|
|
412
440
|
case "name_pattern":
|
|
413
|
-
return
|
|
441
|
+
return c(t) && !!t.name.match(n.pattern);
|
|
414
442
|
case "annotation":
|
|
415
|
-
return
|
|
443
|
+
return c(t) && t.annotations !== void 0 && t.annotations[n.annotation] === n.value;
|
|
416
444
|
case "annotation_pattern":
|
|
417
|
-
return
|
|
445
|
+
return c(t) && t.annotations !== void 0 && t.annotations[n.annotation] !== void 0 && !!t.annotations[n.annotation].match(n.pattern);
|
|
418
446
|
case "has_axes":
|
|
419
|
-
return
|
|
447
|
+
return c(t) && n.axes.every(
|
|
420
448
|
(e) => t.axesSpec.some(
|
|
421
449
|
(r) => (e.type === void 0 || e.type === r.type) && (e.name === void 0 || e.name === r.name) && (e.domain === void 0 || Object.keys(e.domain).length === 0 || r.domain !== void 0 && Object.entries(e.domain).every(
|
|
422
450
|
([o, i]) => r.domain[o] === i
|
|
@@ -424,10 +452,10 @@ function b(n, t) {
|
|
|
424
452
|
)
|
|
425
453
|
);
|
|
426
454
|
default:
|
|
427
|
-
|
|
455
|
+
nn(n);
|
|
428
456
|
}
|
|
429
457
|
}
|
|
430
|
-
function
|
|
458
|
+
function E(n, t) {
|
|
431
459
|
if (n.name !== void 0 && n.name !== t.name)
|
|
432
460
|
return !1;
|
|
433
461
|
if (n.type !== void 0) {
|
|
@@ -445,7 +473,7 @@ function P(n, t) {
|
|
|
445
473
|
}
|
|
446
474
|
return !0;
|
|
447
475
|
}
|
|
448
|
-
function
|
|
476
|
+
function I(n, t) {
|
|
449
477
|
if (t.name !== void 0 && n.name !== t.name || t.namePattern !== void 0 && !new RegExp(t.namePattern).test(n.name))
|
|
450
478
|
return !1;
|
|
451
479
|
if (t.type !== void 0) {
|
|
@@ -462,16 +490,16 @@ function E(n, t) {
|
|
|
462
490
|
return !1;
|
|
463
491
|
}
|
|
464
492
|
if (t.axes !== void 0) {
|
|
465
|
-
const e = n.axesSpec.map(
|
|
493
|
+
const e = n.axesSpec.map(p);
|
|
466
494
|
if (t.partialAxesMatch) {
|
|
467
495
|
for (const r of t.axes)
|
|
468
|
-
if (!e.some((o) =>
|
|
496
|
+
if (!e.some((o) => E(r, o)))
|
|
469
497
|
return !1;
|
|
470
498
|
} else {
|
|
471
499
|
if (e.length !== t.axes.length)
|
|
472
500
|
return !1;
|
|
473
501
|
for (let r = 0; r < t.axes.length; r++)
|
|
474
|
-
if (!
|
|
502
|
+
if (!E(t.axes[r], e[r]))
|
|
475
503
|
return !1;
|
|
476
504
|
}
|
|
477
505
|
}
|
|
@@ -491,26 +519,26 @@ function E(n, t) {
|
|
|
491
519
|
}
|
|
492
520
|
return !0;
|
|
493
521
|
}
|
|
494
|
-
function
|
|
495
|
-
return Array.isArray(n) ? (t) => n.some((e) =>
|
|
522
|
+
function Vn(n) {
|
|
523
|
+
return Array.isArray(n) ? (t) => n.some((e) => c(t) && I(t, e)) : (t) => c(t) && I(t, n);
|
|
496
524
|
}
|
|
497
|
-
const
|
|
498
|
-
__isRef:
|
|
499
|
-
blockId:
|
|
500
|
-
name:
|
|
525
|
+
const Fn = { href: "/" }, Dn = l.object({
|
|
526
|
+
__isRef: l.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),
|
|
527
|
+
blockId: l.string().describe("Upstream block id"),
|
|
528
|
+
name: l.string().describe("Name of the output provided to the upstream block's output context")
|
|
501
529
|
}).describe(
|
|
502
530
|
"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."
|
|
503
531
|
).strict().readonly();
|
|
504
|
-
function
|
|
532
|
+
function On(n) {
|
|
505
533
|
return typeof n == "object" && n !== null && "__isRef" in n && n.__isRef === !0 && "blockId" in n && "name" in n;
|
|
506
534
|
}
|
|
507
|
-
function
|
|
535
|
+
function Un(n, t) {
|
|
508
536
|
return n.blockId === t.blockId && n.name === t.name;
|
|
509
537
|
}
|
|
510
|
-
function
|
|
538
|
+
function Bn(n, t) {
|
|
511
539
|
return n.ok ? { ok: !0, value: t(n.value) } : n;
|
|
512
540
|
}
|
|
513
|
-
function
|
|
541
|
+
function tn(n) {
|
|
514
542
|
if (n instanceof Int8Array || n instanceof Uint8Array || n instanceof Uint8ClampedArray)
|
|
515
543
|
return new DataView(n.buffer, n.byteOffset, n.byteLength);
|
|
516
544
|
if (n instanceof ArrayBuffer) return new DataView(n);
|
|
@@ -518,100 +546,104 @@ function nn(n) {
|
|
|
518
546
|
"Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray"
|
|
519
547
|
);
|
|
520
548
|
}
|
|
521
|
-
const
|
|
522
|
-
function
|
|
549
|
+
const en = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", rn = "0123456789ABCDEFGHIJKLMNOPQRSTUV", on = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
550
|
+
function S(n, t, e) {
|
|
523
551
|
e = e || {};
|
|
524
552
|
let r, o;
|
|
525
553
|
switch (t) {
|
|
526
554
|
case "RFC3548":
|
|
527
555
|
case "RFC4648":
|
|
528
|
-
r =
|
|
556
|
+
r = en, o = !0;
|
|
529
557
|
break;
|
|
530
558
|
case "RFC4648-HEX":
|
|
531
|
-
r =
|
|
559
|
+
r = rn, o = !0;
|
|
532
560
|
break;
|
|
533
561
|
case "Crockford":
|
|
534
|
-
r =
|
|
562
|
+
r = on, o = !1;
|
|
535
563
|
break;
|
|
536
564
|
default:
|
|
537
565
|
throw new Error("Unknown base32 variant: " + String(t));
|
|
538
566
|
}
|
|
539
|
-
const i = e.padding !== void 0 ? e.padding : o,
|
|
540
|
-
let
|
|
541
|
-
for (let
|
|
542
|
-
for (
|
|
543
|
-
u += r[
|
|
544
|
-
if (
|
|
567
|
+
const i = e.padding !== void 0 ? e.padding : o, s = tn(n);
|
|
568
|
+
let a = 0, f = 0, u = "";
|
|
569
|
+
for (let d = 0; d < s.byteLength; d++)
|
|
570
|
+
for (f = f << 8 | s.getUint8(d), a += 8; a >= 5; )
|
|
571
|
+
u += r[f >>> a - 5 & 31], a -= 5;
|
|
572
|
+
if (a > 0 && (u += r[f << 5 - a & 31]), i)
|
|
545
573
|
for (; u.length % 8 !== 0; )
|
|
546
574
|
u += "=";
|
|
547
575
|
return u;
|
|
548
576
|
}
|
|
549
|
-
const
|
|
550
|
-
function
|
|
551
|
-
const n = new Uint8Array(
|
|
552
|
-
return crypto.getRandomValues(n),
|
|
577
|
+
const C = 15, an = 24, $ = l.string().length(an).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
|
|
578
|
+
function Rn() {
|
|
579
|
+
const n = new Uint8Array(C);
|
|
580
|
+
return crypto.getRandomValues(n), $.parse(S(n, "RFC4648"));
|
|
553
581
|
}
|
|
554
|
-
function
|
|
555
|
-
if (n.length !==
|
|
556
|
-
return
|
|
582
|
+
function sn(n) {
|
|
583
|
+
if (n.length !== C) throw new Error(`Wrong number of bytes: ${n.length}`);
|
|
584
|
+
return $.parse(S(n, "RFC4648"));
|
|
557
585
|
}
|
|
558
|
-
async function
|
|
586
|
+
async function jn(n) {
|
|
559
587
|
const t = new TextEncoder(), e = await crypto.subtle.digest("SHA-256", t.encode(n));
|
|
560
|
-
return
|
|
588
|
+
return sn(new Uint8Array(e.slice(0, 15)));
|
|
561
589
|
}
|
|
562
590
|
export {
|
|
563
|
-
|
|
564
|
-
|
|
591
|
+
Pn as AnchoredIdDeriver,
|
|
592
|
+
Fn as DefaultNavigationState,
|
|
565
593
|
X as PTableAbsent,
|
|
566
|
-
|
|
567
|
-
|
|
594
|
+
z as PTableNA,
|
|
595
|
+
M as PValueBytesNA,
|
|
568
596
|
L as PValueDoubleNA,
|
|
569
597
|
j as PValueFloatNA,
|
|
570
598
|
R as PValueIntNA,
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
599
|
+
A as PValueLongNA,
|
|
600
|
+
J as PValueStringNA,
|
|
601
|
+
$ as PlId,
|
|
602
|
+
C as PlIdBytes,
|
|
603
|
+
an as PlIdLength,
|
|
604
|
+
Dn as PlRef,
|
|
605
|
+
wn as canonicalizeAxisId,
|
|
606
|
+
jn as digestPlId,
|
|
607
|
+
ln as ensureNotNAPValue,
|
|
608
|
+
Sn as ensurePColumn,
|
|
580
609
|
b as executePSpecPredicate,
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
610
|
+
$n as extractAllColumns,
|
|
611
|
+
gn as getAxesId,
|
|
612
|
+
p as getAxisId,
|
|
613
|
+
mn as getFileNameFromHandle,
|
|
614
|
+
U as getFilePathFromHandle,
|
|
615
|
+
In as isFilteredPColumn,
|
|
616
|
+
O as isImportFileHandleIndex,
|
|
587
617
|
D as isImportFileHandleUpload,
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
618
|
+
dn as isLiveLog,
|
|
619
|
+
_ as isNotNAPValue,
|
|
620
|
+
v as isPColumn,
|
|
621
|
+
Nn as isPColumnResult,
|
|
622
|
+
c as isPColumnSpec,
|
|
623
|
+
kn as isPColumnSpecResult,
|
|
624
|
+
yn as isPTableAbsent,
|
|
625
|
+
H as isPValue,
|
|
626
|
+
On as isPlRef,
|
|
597
627
|
W as isValueAbsent,
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
628
|
+
y as isValueNA,
|
|
629
|
+
h as mapJoinEntry,
|
|
630
|
+
Cn as mapPObjectData,
|
|
631
|
+
An as mapPTableDef,
|
|
632
|
+
Bn as mapValueInVOE,
|
|
633
|
+
E as matchAxis,
|
|
634
|
+
Q as matchAxisId,
|
|
635
|
+
I as matchPColumn,
|
|
636
|
+
bn as pTableValue,
|
|
637
|
+
hn as pValueToStringOrNumber,
|
|
608
638
|
T as pValueToStringOrNumberOrNull,
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
639
|
+
xn as parseColumnId,
|
|
640
|
+
sn as plId,
|
|
641
|
+
Un as plRefsEqual,
|
|
642
|
+
En as resolveAnchors,
|
|
612
643
|
K as safeConvertToPValue,
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
644
|
+
Vn as selectorsToPredicate,
|
|
645
|
+
Y as stringifyColumnId,
|
|
646
|
+
pn as toJsonSafePValue,
|
|
647
|
+
Rn as uniquePlId
|
|
616
648
|
};
|
|
617
649
|
//# sourceMappingURL=index.mjs.map
|