@synnaxlabs/x 0.42.3 → 0.43.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 +93 -105
- package/.vscode/settings.json +4 -6
- package/README.md +1 -7
- package/dist/array.cjs +1 -0
- package/dist/array.js +7 -0
- package/dist/base-B5lQIJKc.js +38 -0
- package/dist/base-CTq-lhpU.cjs +1 -0
- package/dist/binary.cjs +1 -1
- package/dist/binary.js +1 -1
- package/dist/bounds.cjs +1 -1
- package/dist/bounds.js +2 -2
- package/dist/box.cjs +1 -1
- package/dist/box.js +1 -1
- package/dist/caseconv.cjs +1 -1
- package/dist/caseconv.js +2 -2
- package/dist/change.cjs +1 -1
- package/dist/change.js +10 -2
- package/dist/compare.cjs +1 -1
- package/dist/compare.js +1 -1
- package/dist/deep.cjs +1 -1
- package/dist/deep.js +92 -79
- package/dist/dimensions.cjs +1 -1
- package/dist/dimensions.js +41 -2
- package/dist/direction.cjs +1 -1
- package/dist/direction.js +1 -1
- package/dist/index-4GlOgZuh.js +99 -0
- package/dist/{direction-C-b6XTeU.cjs → index-B58dnYRu.cjs} +1 -1
- package/dist/index-BMGaoK93.cjs +1 -0
- package/dist/index-BTet04Hd.cjs +6 -0
- package/dist/{scale-DfJe9755.js → index-BUa-NXAX.js} +46 -46
- package/dist/{xy-D_LqxaGt.js → index-C-qYOegc.js} +62 -62
- package/dist/index-C07SBJhr.js +128 -0
- package/dist/{bounds-Bn5_l4Z3.js → index-C9EdKeu1.js} +77 -76
- package/dist/index-CM8ZDZ6s.cjs +1 -0
- package/dist/index-CV2JaHfw.cjs +1 -0
- package/dist/index-CeBvOwG8.cjs +3 -0
- package/dist/index-ClrGyGDp.js +205 -0
- package/dist/index-CqQXXeCI.cjs +1 -0
- package/dist/{location-C3aeu046.js → index-D6V-8SKw.js} +26 -26
- package/dist/index-DBGAIs_7.js +2492 -0
- package/dist/index-DEdq2tza.cjs +1 -0
- package/dist/index-DKMnHBGR.cjs +1 -0
- package/dist/index-Dql5FMcH.js +47 -0
- package/dist/{direction-BL0PhD1k.js → index-DxU1zwsd.js} +1 -1
- package/dist/index-WwMnwoLy.cjs +1 -0
- package/dist/index.cjs +5 -3
- package/dist/index.js +5372 -650
- package/dist/kv.cjs +1 -1
- package/dist/kv.js +45 -2
- package/dist/location.cjs +1 -1
- package/dist/location.js +1 -1
- package/dist/position.cjs +1 -1
- package/dist/position.js +83 -2
- package/dist/record.cjs +1 -1
- package/dist/record.js +8 -10
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.js +27 -2
- package/dist/scale.cjs +1 -1
- package/dist/scale.js +1 -1
- package/dist/schemas-55Usj0Fg.js +3998 -0
- package/dist/schemas-DbXuI2Qr.cjs +27 -0
- package/dist/spatial.cjs +1 -1
- package/dist/spatial.js +25 -18
- package/dist/src/array/index.d.ts +2 -0
- package/dist/src/array/index.d.ts.map +1 -0
- package/dist/src/array/toArray.d.ts +19 -0
- package/dist/src/array/toArray.d.ts.map +1 -0
- package/dist/src/array/toArray.spec.d.ts +2 -0
- package/dist/src/array/toArray.spec.d.ts.map +1 -0
- package/dist/src/binary/codec.d.ts +8 -16
- package/dist/src/binary/codec.d.ts.map +1 -1
- package/dist/src/breaker/breaker.d.ts +6 -6
- package/dist/src/breaker/breaker.d.ts.map +1 -1
- package/dist/src/caseconv/caseconv.d.ts +1 -1
- package/dist/src/caseconv/caseconv.d.ts.map +1 -1
- package/dist/src/change/change.d.ts +3 -3
- package/dist/src/change/change.d.ts.map +1 -1
- package/dist/src/color/color.d.ts +61 -37
- package/dist/src/color/color.d.ts.map +1 -1
- package/dist/src/color/external.d.ts +0 -1
- package/dist/src/color/external.d.ts.map +1 -1
- package/dist/src/color/gradient.d.ts +7 -7
- package/dist/src/color/gradient.d.ts.map +1 -1
- package/dist/src/color/palette.d.ts +10 -10
- package/dist/src/color/palette.d.ts.map +1 -1
- package/dist/src/compare/compare.d.ts +4 -4
- package/dist/src/compare/compare.d.ts.map +1 -1
- package/dist/src/control/control.d.ts +32 -32
- package/dist/src/control/control.d.ts.map +1 -1
- package/dist/src/debounce/debounce.d.ts +1 -1
- package/dist/src/debounce/debounce.d.ts.map +1 -1
- package/dist/src/deep/delete.d.ts +1 -1
- package/dist/src/deep/delete.d.ts.map +1 -1
- package/dist/src/deep/difference.d.ts.map +1 -1
- package/dist/src/deep/equal.d.ts +4 -4
- package/dist/src/deep/equal.d.ts.map +1 -1
- package/dist/src/deep/merge.d.ts +1 -1
- package/dist/src/deep/merge.d.ts.map +1 -1
- package/dist/src/errors/errors.d.ts +62 -36
- package/dist/src/errors/errors.d.ts.map +1 -1
- package/dist/src/index.d.ts +4 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/instance/index.d.ts +2 -0
- package/dist/src/instance/index.d.ts.map +1 -0
- package/dist/src/instance/matcher.d.ts +79 -0
- package/dist/src/instance/matcher.d.ts.map +1 -0
- package/dist/src/instance/matcher.spec.d.ts +2 -0
- package/dist/src/instance/matcher.spec.d.ts.map +1 -0
- package/dist/src/jsonrpc/jsonrpc.d.ts +40 -9
- package/dist/src/jsonrpc/jsonrpc.d.ts.map +1 -1
- package/dist/src/kv/types.d.ts +2 -2
- package/dist/src/kv/types.d.ts.map +1 -1
- package/dist/src/migrate/migrate.d.ts +5 -5
- package/dist/src/migrate/migrate.d.ts.map +1 -1
- package/dist/src/notation/notation.d.ts +1 -1
- package/dist/src/notation/notation.d.ts.map +1 -1
- package/dist/src/primitive/index.d.ts +2 -0
- package/dist/src/primitive/index.d.ts.map +1 -0
- package/dist/src/primitive/primitive.d.ts +39 -0
- package/dist/src/primitive/primitive.d.ts.map +1 -0
- package/dist/src/primitive/primitive.spec.d.ts +2 -0
- package/dist/src/primitive/primitive.spec.d.ts.map +1 -0
- package/dist/src/record.d.ts +2 -2
- package/dist/src/record.d.ts.map +1 -1
- package/dist/src/renderable.d.ts +1 -1
- package/dist/src/renderable.d.ts.map +1 -1
- package/dist/src/replace.d.ts.map +1 -1
- package/dist/src/runtime/detect.d.ts.map +1 -1
- package/dist/src/runtime/os.d.ts +1 -1
- package/dist/src/runtime/os.d.ts.map +1 -1
- package/dist/src/spatial/base.d.ts +10 -10
- package/dist/src/spatial/base.d.ts.map +1 -1
- package/dist/src/spatial/bounds/bounds.d.ts +82 -16
- package/dist/src/spatial/bounds/bounds.d.ts.map +1 -1
- package/dist/src/spatial/box/box.d.ts +7 -7
- package/dist/src/spatial/box/box.d.ts.map +1 -1
- package/dist/src/spatial/dimensions/dimensions.d.ts +5 -5
- package/dist/src/spatial/dimensions/dimensions.d.ts.map +1 -1
- package/dist/src/spatial/direction/direction.d.ts +1 -1
- package/dist/src/spatial/location/location.d.ts +4 -4
- package/dist/src/spatial/location/location.d.ts.map +1 -1
- package/dist/src/spatial/scale/scale.d.ts +11 -11
- package/dist/src/spatial/scale/scale.d.ts.map +1 -1
- package/dist/src/spatial/xy/xy.d.ts +5 -5
- package/dist/src/spatial/xy/xy.d.ts.map +1 -1
- package/dist/src/status/index.d.ts +2 -0
- package/dist/src/status/index.d.ts.map +1 -0
- package/dist/src/status/types.d.ts +11 -0
- package/dist/src/status/types.d.ts.map +1 -0
- package/dist/src/sync/index.d.ts.map +1 -1
- package/dist/src/sync/mutex.d.ts +0 -1
- package/dist/src/sync/mutex.d.ts.map +1 -1
- package/dist/src/telem/gl.d.ts +1 -1
- package/dist/src/telem/gl.d.ts.map +1 -1
- package/dist/src/telem/series.d.ts +468 -62
- package/dist/src/telem/series.d.ts.map +1 -1
- package/dist/src/telem/telem.d.ts +243 -53
- package/dist/src/telem/telem.d.ts.map +1 -1
- package/dist/src/uuid/index.d.ts +2 -0
- package/dist/src/uuid/index.d.ts.map +1 -0
- package/dist/src/uuid/uuid.d.ts +35 -0
- package/dist/src/uuid/uuid.d.ts.map +1 -0
- package/dist/src/uuid/uuid.spec.d.ts +2 -0
- package/dist/src/uuid/uuid.spec.d.ts.map +1 -0
- package/dist/src/zod/external.d.ts +1 -1
- package/dist/src/zod/external.d.ts.map +1 -1
- package/dist/src/zod/nullToUndefined.d.ts +3 -0
- package/dist/src/zod/nullToUndefined.d.ts.map +1 -0
- package/dist/src/zod/nullToUndefined.spec.d.ts +2 -0
- package/dist/src/zod/nullToUndefined.spec.d.ts.map +1 -0
- package/dist/src/zod/util.d.ts +2 -2
- package/dist/src/zod/util.d.ts.map +1 -1
- package/dist/telem.cjs +1 -1
- package/dist/telem.js +1 -1
- package/dist/xy.cjs +1 -1
- package/dist/xy.js +1 -1
- package/dist/zod.cjs +1 -1
- package/dist/zod.js +19 -2
- package/eslint.config.js +1 -1
- package/package.json +17 -15
- package/src/{toArray.ts → array/index.ts} +1 -5
- package/src/array/toArray.spec.ts +56 -0
- package/src/array/toArray.ts +28 -0
- package/src/binary/codec.spec.ts +201 -278
- package/src/binary/codec.ts +20 -76
- package/src/breaker/breaker.ts +3 -3
- package/src/caseconv/caseconv.ts +6 -4
- package/src/change/change.ts +2 -2
- package/src/color/color.spec.ts +113 -2
- package/src/color/color.ts +89 -59
- package/src/color/external.ts +0 -1
- package/src/color/gradient.ts +20 -28
- package/src/color/palette.ts +1 -1
- package/src/compare/compare.ts +5 -5
- package/src/control/control.ts +22 -19
- package/src/debounce/debounce.ts +1 -1
- package/src/deep/delete.ts +5 -4
- package/src/deep/difference.ts +6 -2
- package/src/deep/equal.spec.ts +1 -1
- package/src/deep/equal.ts +5 -5
- package/src/deep/merge.spec.ts +13 -1
- package/src/deep/merge.ts +16 -7
- package/src/deep/path.ts +1 -1
- package/src/errors/errors.ts +65 -44
- package/src/index.ts +4 -1
- package/src/instance/index.ts +10 -0
- package/src/instance/matcher.spec.ts +78 -0
- package/src/instance/matcher.ts +98 -0
- package/src/jsonrpc/jsonrpc.spec.ts +2 -1
- package/src/jsonrpc/jsonrpc.ts +36 -7
- package/src/kv/types.ts +1 -1
- package/src/migrate/migrate.spec.ts +1 -1
- package/src/migrate/migrate.ts +7 -7
- package/src/notation/notation.ts +1 -1
- package/src/primitive/index.ts +10 -0
- package/src/primitive/primitive.spec.ts +126 -0
- package/src/primitive/primitive.ts +82 -0
- package/src/record.ts +3 -5
- package/src/renderable.ts +1 -1
- package/src/replace.ts +9 -0
- package/src/runtime/detect.ts +0 -2
- package/src/runtime/os.ts +1 -1
- package/src/spatial/base.ts +1 -1
- package/src/spatial/bounds/bounds.spec.ts +20 -0
- package/src/spatial/bounds/bounds.ts +101 -18
- package/src/spatial/box/box.ts +1 -1
- package/src/spatial/dimensions/dimensions.ts +3 -3
- package/src/spatial/location/location.ts +1 -1
- package/src/spatial/scale/scale.ts +1 -1
- package/src/spatial/xy/xy.ts +1 -1
- package/src/status/index.ts +10 -0
- package/src/status/types.ts +22 -0
- package/src/sync/index.ts +9 -0
- package/src/sync/mutex.ts +9 -4
- package/src/telem/gl.ts +1 -1
- package/src/telem/series.spec.ts +735 -68
- package/src/telem/series.ts +536 -195
- package/src/telem/telem.spec.ts +60 -7
- package/src/telem/telem.ts +287 -95
- package/src/uuid/index.ts +10 -0
- package/src/uuid/uuid.spec.ts +82 -0
- package/src/uuid/uuid.ts +48 -0
- package/src/zod/external.ts +1 -1
- package/src/zod/nullToUndefined.spec.ts +31 -0
- package/src/zod/nullToUndefined.ts +23 -0
- package/src/zod/util.spec.ts +1 -1
- package/src/zod/util.ts +6 -6
- package/tsconfig.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/vite.config.ts +1 -1
- package/dist/base-BAM2mqCy.cjs +0 -1
- package/dist/base-DFq0vvGn.js +0 -38
- package/dist/bounds-BQo7rvs9.cjs +0 -1
- package/dist/box-0YrQibkB.cjs +0 -1
- package/dist/box-Cc8IzcNo.js +0 -205
- package/dist/change-C-YELKx6.cjs +0 -1
- package/dist/change-DLl6DccR.js +0 -12
- package/dist/dimensions-CRgergMS.js +0 -43
- package/dist/dimensions-D2QGoNXO.cjs +0 -1
- package/dist/external-BPgtxa8d.js +0 -29
- package/dist/external-C-dNgNQw.cjs +0 -1
- package/dist/external-C8TFju8Q.js +0 -29
- package/dist/external-DWQITF5_.cjs +0 -1
- package/dist/external-DqPrWKvU.js +0 -47
- package/dist/external-uXk0Avrg.cjs +0 -1
- package/dist/index-BywOGO8U.js +0 -1074
- package/dist/index-CYYjI7Uf.cjs +0 -1
- package/dist/index-C_6NXBlg.cjs +0 -3
- package/dist/index-Dd8DLyMx.cjs +0 -1
- package/dist/index-DizUWH6z.js +0 -47
- package/dist/index-QGplUHuy.js +0 -98
- package/dist/location-BGl5Ddds.cjs +0 -1
- package/dist/position-Cai5-wi1.cjs +0 -1
- package/dist/position-DIglP1l2.js +0 -85
- package/dist/scale-BtZINJ-A.cjs +0 -1
- package/dist/series-B9JERcqi.js +0 -1977
- package/dist/series-DqJ6f97G.cjs +0 -11
- package/dist/spatial-BSWPzMkK.js +0 -11
- package/dist/spatial-DGpZ2sO3.cjs +0 -1
- package/dist/src/color/transformColorsToHex.d.ts +0 -6
- package/dist/src/color/transformColorsToHex.d.ts.map +0 -1
- package/dist/src/primitive.d.ts +0 -9
- package/dist/src/primitive.d.ts.map +0 -1
- package/dist/src/toArray.d.ts +0 -3
- package/dist/src/toArray.d.ts.map +0 -1
- package/dist/src/zod/integer.d.ts +0 -10
- package/dist/src/zod/integer.d.ts.map +0 -1
- package/dist/src/zod/integer.spec.d.ts +0 -2
- package/dist/src/zod/integer.spec.d.ts.map +0 -1
- package/dist/toArray.cjs +0 -1
- package/dist/toArray.js +0 -5
- package/dist/xy-B7065J2S.cjs +0 -1
- package/src/color/transformColorsToHex.ts +0 -30
- package/src/primitive.ts +0 -46
- package/src/zod/integer.spec.ts +0 -148
- package/src/zod/integer.ts +0 -38
package/dist/deep.js
CHANGED
|
@@ -1,113 +1,126 @@
|
|
|
1
|
-
import { isObject as
|
|
2
|
-
import { e as
|
|
3
|
-
const
|
|
4
|
-
let s =
|
|
5
|
-
const r =
|
|
6
|
-
r.forEach((o,
|
|
7
|
-
|
|
1
|
+
import { isObject as g } from "./identity.js";
|
|
2
|
+
import { e as j, g as V, h as k, p as E, r as $, s as w, t as q } from "./path-DD6ytXzr.js";
|
|
3
|
+
const K = (t) => JSON.parse(JSON.stringify(t)), _ = (t, ...f) => (f.forEach((l) => {
|
|
4
|
+
let s = t;
|
|
5
|
+
const r = l.split(".");
|
|
6
|
+
r.forEach((o, e) => {
|
|
7
|
+
typeof s != "object" || s === null || (e === r.length - 1 ? delete s[o] : o in s && (s = s[o]));
|
|
8
8
|
});
|
|
9
|
-
}),
|
|
10
|
-
const s = {}, r = (o,
|
|
11
|
-
if (typeof o != typeof
|
|
12
|
-
s[
|
|
9
|
+
}), t), I = (t, f, l = "") => {
|
|
10
|
+
const s = {}, r = (o, e, i) => {
|
|
11
|
+
if (typeof o != typeof e || o === null || e === null) {
|
|
12
|
+
s[i] = [o, e];
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
|
-
if (typeof o == "object" && typeof
|
|
16
|
-
if (Array.isArray(o) && Array.isArray(
|
|
17
|
-
if (o.length !==
|
|
18
|
-
s[
|
|
15
|
+
if (typeof o == "object" && typeof e == "object")
|
|
16
|
+
if (Array.isArray(o) && Array.isArray(e)) {
|
|
17
|
+
if (o.length !== e.length) {
|
|
18
|
+
s[i] = [o, e];
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
|
-
for (let
|
|
21
|
+
for (let n = 0; n < o.length; n++) r(o[n], e[n], `${i}[${n}]`);
|
|
22
22
|
} else
|
|
23
|
-
(/* @__PURE__ */ new Set([...Object.keys(o), ...Object.keys(
|
|
24
|
-
r(
|
|
23
|
+
(/* @__PURE__ */ new Set([...Object.keys(o), ...Object.keys(e)])).forEach((p) => {
|
|
24
|
+
r(
|
|
25
|
+
o[p],
|
|
26
|
+
e[p],
|
|
27
|
+
i !== "" ? `${i}.${p}` : p
|
|
28
|
+
);
|
|
25
29
|
});
|
|
26
|
-
else o !==
|
|
30
|
+
else o !== e && (s[i] = [o, e]);
|
|
27
31
|
};
|
|
28
|
-
return r(
|
|
29
|
-
},
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
32
|
-
if (
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
35
|
-
for (let
|
|
32
|
+
return r(t, f, l), s;
|
|
33
|
+
}, a = (t, f) => {
|
|
34
|
+
const l = Array.isArray(t), s = Array.isArray(f);
|
|
35
|
+
if (l !== s) return !1;
|
|
36
|
+
if (l && s) {
|
|
37
|
+
const e = t, i = f;
|
|
38
|
+
if (e.length !== i.length) return !1;
|
|
39
|
+
for (let n = 0; n < e.length; n++) if (!a(e[n], i[n])) return !1;
|
|
36
40
|
return !0;
|
|
37
41
|
}
|
|
38
|
-
if (
|
|
39
|
-
return
|
|
40
|
-
if ("equals" in
|
|
41
|
-
const r = Object.keys(
|
|
42
|
+
if (t == null || f == null || typeof t != "object" || typeof f != "object")
|
|
43
|
+
return t === f;
|
|
44
|
+
if ("equals" in t) return t.equals(f);
|
|
45
|
+
const r = Object.keys(t), o = Object.keys(f);
|
|
42
46
|
if (r.length !== o.length) return !1;
|
|
43
|
-
for (const
|
|
44
|
-
const
|
|
45
|
-
if (typeof
|
|
46
|
-
if (!
|
|
47
|
-
} else if (
|
|
47
|
+
for (const e of r) {
|
|
48
|
+
const i = t[e], n = f[e];
|
|
49
|
+
if (typeof i == "object" && typeof n == "object") {
|
|
50
|
+
if (!a(i, n)) return !1;
|
|
51
|
+
} else if (i !== n) return !1;
|
|
48
52
|
}
|
|
49
53
|
return !0;
|
|
50
|
-
}, A = (
|
|
51
|
-
if (typeof
|
|
52
|
-
const
|
|
53
|
-
if (s.length >
|
|
54
|
+
}, A = (t, f) => {
|
|
55
|
+
if (typeof t != "object" || t == null) return t === f;
|
|
56
|
+
const l = Object.keys(t), s = Object.keys(f);
|
|
57
|
+
if (s.length > l.length) return !1;
|
|
54
58
|
for (const r of s) {
|
|
55
|
-
const o =
|
|
56
|
-
if (typeof o == "object" && typeof
|
|
57
|
-
if (!A(o,
|
|
58
|
-
} else if (o !==
|
|
59
|
+
const o = t[r], e = f[r];
|
|
60
|
+
if (typeof o == "object" && typeof e == "object") {
|
|
61
|
+
if (!A(o, e)) return !1;
|
|
62
|
+
} else if (o !== e) return !1;
|
|
59
63
|
}
|
|
60
64
|
return !0;
|
|
61
|
-
},
|
|
62
|
-
if (f.length === 0) return
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
for (const s in
|
|
65
|
+
}, h = (t, ...f) => {
|
|
66
|
+
if (f.length === 0) return t;
|
|
67
|
+
const l = f.shift();
|
|
68
|
+
if (g(t) && g(l))
|
|
69
|
+
for (const s in l)
|
|
66
70
|
try {
|
|
67
|
-
|
|
71
|
+
g(l[s]) ? (s in t || Object.assign(t, { [s]: {} }), h(t[s], l[s])) : Object.assign(t, { [s]: l[s] });
|
|
68
72
|
} catch (r) {
|
|
69
73
|
throw r instanceof TypeError ? new TypeError(`.${s}: ${r.message}`) : r;
|
|
70
74
|
}
|
|
71
|
-
return
|
|
72
|
-
},
|
|
73
|
-
const s = (r, o,
|
|
74
|
-
var
|
|
75
|
-
if (((
|
|
76
|
-
return
|
|
77
|
-
(
|
|
75
|
+
return h(t, ...f);
|
|
76
|
+
}, M = (t, f, l) => {
|
|
77
|
+
const s = (r, o, e) => {
|
|
78
|
+
var i, n, p;
|
|
79
|
+
if (((i = e.def) == null ? void 0 : i.type) === "union")
|
|
80
|
+
return e.def.options.reduce(
|
|
81
|
+
(y, c) => s(y, o, c),
|
|
78
82
|
r
|
|
79
83
|
);
|
|
80
|
-
if (((
|
|
81
|
-
const
|
|
82
|
-
return s(
|
|
84
|
+
if (((n = e.def) == null ? void 0 : n.type) === "intersection") {
|
|
85
|
+
const y = s(r, o, e.def.left);
|
|
86
|
+
return s(y, o, e.def.right);
|
|
83
87
|
}
|
|
84
|
-
for (const
|
|
85
|
-
const c = o[
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
for (const y in o) {
|
|
89
|
+
const c = o[y];
|
|
90
|
+
let u = e == null ? void 0 : e.shape;
|
|
91
|
+
if (u != null)
|
|
92
|
+
for (; u != null; ) {
|
|
93
|
+
if (u[y] != null) {
|
|
94
|
+
const d = u[y].safeParse(c);
|
|
95
|
+
if (d.success) {
|
|
96
|
+
r[y] = d.data;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
u = (p = u.def) == null ? void 0 : p.shape;
|
|
101
|
+
}
|
|
102
|
+
typeof c == "object" && !Array.isArray(c) && c !== null && e && e.shape && e.shape[y] && (r[y] || (r[y] = {}), s(r[y], c, e.shape[y]));
|
|
90
103
|
}
|
|
91
104
|
return r;
|
|
92
105
|
};
|
|
93
|
-
return s({ ...
|
|
94
|
-
},
|
|
106
|
+
return s({ ...t }, f, l);
|
|
107
|
+
}, J = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
95
108
|
__proto__: null,
|
|
96
|
-
copy:
|
|
97
|
-
deleteD:
|
|
98
|
-
difference:
|
|
99
|
-
element:
|
|
100
|
-
equal:
|
|
101
|
-
get:
|
|
102
|
-
has:
|
|
103
|
-
override:
|
|
104
|
-
overrideValidItems:
|
|
109
|
+
copy: K,
|
|
110
|
+
deleteD: _,
|
|
111
|
+
difference: I,
|
|
112
|
+
element: j,
|
|
113
|
+
equal: a,
|
|
114
|
+
get: V,
|
|
115
|
+
has: k,
|
|
116
|
+
override: h,
|
|
117
|
+
overrideValidItems: M,
|
|
105
118
|
partialEqual: A,
|
|
106
119
|
pathsMatch: E,
|
|
107
120
|
remove: $,
|
|
108
|
-
set:
|
|
121
|
+
set: w,
|
|
109
122
|
transformPath: q
|
|
110
123
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
111
124
|
export {
|
|
112
|
-
|
|
125
|
+
J as deep
|
|
113
126
|
};
|
package/dist/dimensions.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./base-CTq-lhpU.cjs"),s=require("./schemas-DbXuI2Qr.cjs"),r=s.object({signedWidth:s.number(),signedHeight:s.number()}),g=s.union([h.dimensions,r,h.xy,h.numberCouple]),c={width:0,height:0},u={width:1,height:1},n=(t,e)=>typeof t=="number"?{width:t,height:e??t}:Array.isArray(t)?{width:t[0],height:t[1]}:"x"in t?{width:t.x,height:t.y}:"signedWidth"in t?{width:t.signedWidth,height:t.signedHeight}:{...t},a=(t,e)=>{if(e==null)return!1;const i=n(t),o=n(e);return i.width===o.width&&i.height===o.height},d=t=>{const e=n(t);return{width:e.height,height:e.width}},m=t=>{const e=n(t);return`0 0 ${e.width} ${e.height}`},l=t=>{const e=n(t);return[e.width,e.height]},b=t=>({width:Math.max(...t.map(e=>n(e).width)),height:Math.max(...t.map(e=>n(e).height))}),p=t=>({width:Math.min(...t.map(e=>n(e).width)),height:Math.min(...t.map(e=>n(e).height))}),f=(t,e)=>{const i=n(t);return{width:i.width*e,height:i.height*e}},y=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:u,ZERO:c,construct:n,couple:l,crude:g,dimensions:h.dimensions,equals:a,max:b,min:p,scale:f,signed:r,svgViewBox:m,swap:d},Symbol.toStringTag,{value:"Module"}));exports.dimensions=y;
|
package/dist/dimensions.js
CHANGED
|
@@ -1,4 +1,43 @@
|
|
|
1
|
-
import { d } from "./
|
|
1
|
+
import { d as o, x as a, n as g } from "./base-B5lQIJKc.js";
|
|
2
|
+
import { o as c, n as s, u } from "./schemas-55Usj0Fg.js";
|
|
3
|
+
const r = c({ signedWidth: s(), signedHeight: s() }), m = u([o, r, a, g]), d = { width: 0, height: 0 }, p = { width: 1, height: 1 }, n = (t, e) => typeof t == "number" ? { width: t, height: e ?? t } : Array.isArray(t) ? { width: t[0], height: t[1] } : "x" in t ? { width: t.x, height: t.y } : "signedWidth" in t ? { width: t.signedWidth, height: t.signedHeight } : { ...t }, l = (t, e) => {
|
|
4
|
+
if (e == null) return !1;
|
|
5
|
+
const i = n(t), h = n(e);
|
|
6
|
+
return i.width === h.width && i.height === h.height;
|
|
7
|
+
}, f = (t) => {
|
|
8
|
+
const e = n(t);
|
|
9
|
+
return { width: e.height, height: e.width };
|
|
10
|
+
}, x = (t) => {
|
|
11
|
+
const e = n(t);
|
|
12
|
+
return `0 0 ${e.width} ${e.height}`;
|
|
13
|
+
}, b = (t) => {
|
|
14
|
+
const e = n(t);
|
|
15
|
+
return [e.width, e.height];
|
|
16
|
+
}, w = (t) => ({
|
|
17
|
+
width: Math.max(...t.map((e) => n(e).width)),
|
|
18
|
+
height: Math.max(...t.map((e) => n(e).height))
|
|
19
|
+
}), y = (t) => ({
|
|
20
|
+
width: Math.min(...t.map((e) => n(e).width)),
|
|
21
|
+
height: Math.min(...t.map((e) => n(e).height))
|
|
22
|
+
}), M = (t, e) => {
|
|
23
|
+
const i = n(t);
|
|
24
|
+
return { width: i.width * e, height: i.height * e };
|
|
25
|
+
}, A = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
26
|
+
__proto__: null,
|
|
27
|
+
DECIMAL: p,
|
|
28
|
+
ZERO: d,
|
|
29
|
+
construct: n,
|
|
30
|
+
couple: b,
|
|
31
|
+
crude: m,
|
|
32
|
+
dimensions: o,
|
|
33
|
+
equals: l,
|
|
34
|
+
max: w,
|
|
35
|
+
min: y,
|
|
36
|
+
scale: M,
|
|
37
|
+
signed: r,
|
|
38
|
+
svgViewBox: x,
|
|
39
|
+
swap: f
|
|
40
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2
41
|
export {
|
|
3
|
-
|
|
42
|
+
A as dimensions
|
|
4
43
|
};
|
package/dist/direction.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-B58dnYRu.cjs");exports.direction=e.direction;
|
package/dist/direction.js
CHANGED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
var T = Object.defineProperty;
|
|
2
|
+
var m = (o, e, t) => e in o ? T(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var i = (o, e, t) => m(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { s as w, a as C } from "./index-Dql5FMcH.js";
|
|
5
|
+
import { isObject as E } from "./identity.js";
|
|
6
|
+
class l {
|
|
7
|
+
constructor() {
|
|
8
|
+
i(this, "contentType", "application/json");
|
|
9
|
+
i(this, "decoder");
|
|
10
|
+
i(this, "encoder");
|
|
11
|
+
this.decoder = new TextDecoder(), this.encoder = new TextEncoder();
|
|
12
|
+
}
|
|
13
|
+
encode(e) {
|
|
14
|
+
return this.encoder.encode(this.encodeString(e));
|
|
15
|
+
}
|
|
16
|
+
decode(e, t) {
|
|
17
|
+
return this.decodeString(this.decoder.decode(e), t);
|
|
18
|
+
}
|
|
19
|
+
decodeString(e, t) {
|
|
20
|
+
const n = JSON.parse(e), r = w(n);
|
|
21
|
+
return t != null ? t.parse(r) : r;
|
|
22
|
+
}
|
|
23
|
+
encodeString(e) {
|
|
24
|
+
const t = C(e);
|
|
25
|
+
return JSON.stringify(t, (n, r) => ArrayBuffer.isView(r) ? Array.from(r) : typeof r == "bigint" ? r.toString() : r);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
class p {
|
|
29
|
+
constructor() {
|
|
30
|
+
i(this, "contentType", "text/csv");
|
|
31
|
+
}
|
|
32
|
+
encode(e) {
|
|
33
|
+
const t = this.encodeString(e);
|
|
34
|
+
return new TextEncoder().encode(t);
|
|
35
|
+
}
|
|
36
|
+
decode(e, t) {
|
|
37
|
+
const n = new TextDecoder().decode(e);
|
|
38
|
+
return this.decodeString(n, t);
|
|
39
|
+
}
|
|
40
|
+
encodeString(e) {
|
|
41
|
+
if (!Array.isArray(e) || e.length === 0 || !E(e[0]))
|
|
42
|
+
throw new Error("Payload must be an array of objects");
|
|
43
|
+
const t = Object.keys(e[0]), n = [t.join(",")];
|
|
44
|
+
return e.forEach((r) => {
|
|
45
|
+
const d = t.map((s) => JSON.stringify(r[s] ?? ""));
|
|
46
|
+
n.push(d.join(","));
|
|
47
|
+
}), n.join(`
|
|
48
|
+
`);
|
|
49
|
+
}
|
|
50
|
+
decodeString(e, t) {
|
|
51
|
+
const [n, ...r] = e.trim().split(`
|
|
52
|
+
`).map((c) => c.trim());
|
|
53
|
+
if (n.length === 0)
|
|
54
|
+
return t != null ? t.parse({}) : {};
|
|
55
|
+
const d = n.split(",").map((c) => c.trim()), s = {};
|
|
56
|
+
return d.forEach((c) => {
|
|
57
|
+
s[c] = [];
|
|
58
|
+
}), r.forEach((c) => {
|
|
59
|
+
const g = c.split(",").map((u) => u.trim());
|
|
60
|
+
d.forEach((u, h) => {
|
|
61
|
+
const a = this.parseValue(g[h]);
|
|
62
|
+
a != null && s[u].push(a);
|
|
63
|
+
});
|
|
64
|
+
}), t != null ? t.parse(s) : s;
|
|
65
|
+
}
|
|
66
|
+
parseValue(e) {
|
|
67
|
+
if (e == null || e.length === 0) return null;
|
|
68
|
+
const t = Number(e);
|
|
69
|
+
return isNaN(t) ? e.startsWith('"') && e.endsWith('"') ? e.slice(1, -1) : e : t;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
class f {
|
|
73
|
+
constructor() {
|
|
74
|
+
i(this, "contentType", "text/plain");
|
|
75
|
+
}
|
|
76
|
+
encode(e) {
|
|
77
|
+
if (typeof e != "string")
|
|
78
|
+
throw new Error("TextCodec.encode payload must be a string");
|
|
79
|
+
return new TextEncoder().encode(e);
|
|
80
|
+
}
|
|
81
|
+
decode(e, t) {
|
|
82
|
+
const n = new TextDecoder().decode(e);
|
|
83
|
+
return t != null ? t.parse(n) : n;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const S = new l(), y = new p(), O = new f(), x = [S], _ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
87
|
+
__proto__: null,
|
|
88
|
+
CSVCodec: p,
|
|
89
|
+
CSV_CODEC: y,
|
|
90
|
+
ENCODERS: x,
|
|
91
|
+
JSONCodec: l,
|
|
92
|
+
JSON_CODEC: S,
|
|
93
|
+
TEXT_CODEC: O,
|
|
94
|
+
TextCodec: f
|
|
95
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
96
|
+
export {
|
|
97
|
+
S as J,
|
|
98
|
+
_ as c
|
|
99
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("./base-
|
|
1
|
+
"use strict";const i=require("./base-CTq-lhpU.cjs"),n=i.crudeDirection,t=e=>i.DIRECTIONS.includes(e)?e:i.Y_LOCATIONS.includes(e)?"y":"x",o=e=>t(e)==="x"?"y":"x",s=e=>t(e)==="x"?"width":"height",c=e=>t(e)==="x"?"left":"top",r=e=>n.safeParse(e).success,d=e=>t(e)==="x"?"signedWidth":"signedHeight",u=Object.freeze(Object.defineProperty({__proto__:null,construct:t,crude:n,dimension:s,direction:i.direction,isDirection:r,location:c,signedDimension:d,swap:o},Symbol.toStringTag,{value:"Module"}));exports.construct=t;exports.direction=u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const R=require("./index-B58dnYRu.cjs"),x=require("./index-CqQXXeCI.cjs"),i=require("./index-WwMnwoLy.cjs"),u=require("./schemas-DbXuI2Qr.cjs"),m=require("./base-CTq-lhpU.cjs"),p=u.union([u.number(),u.string()]),W=u.object({top:p,left:p,width:p,height:p}),S=u.object({left:u.number(),top:u.number(),right:u.number(),bottom:u.number()}),v=u.object({one:m.xy,two:m.xy,root:x.corner}),C={one:i.ZERO,two:i.ZERO,root:x.TOP_LEFT},z={one:i.ZERO,two:i.ONE,root:x.BOTTOM_LEFT},I=(t,o)=>({one:t.one,two:t.two,root:o??t.root}),c=(t,o,e=0,n=0,s)=>{const r={one:{...i.ZERO},two:{...i.ZERO},root:s??x.TOP_LEFT};if(typeof t=="number"){if(typeof o!="number")throw new Error("Box constructor called with invalid arguments");return r.one={x:t,y:o},r.two={x:r.one.x+e,y:r.one.y+n},r}return"one"in t&&"two"in t&&"root"in t?{...t,root:s??t.root}:("getBoundingClientRect"in t&&(t=t.getBoundingClientRect()),"left"in t?(r.one={x:t.left,y:t.top},r.two={x:t.right,y:t.bottom},r):(r.one=t,o==null?r.two={x:r.one.x+e,y:r.one.y+n}:typeof o=="number"?r.two={x:r.one.x+o,y:r.one.y+e}:"width"in o?r.two={x:r.one.x+o.width,y:r.one.y+o.height}:"signedWidth"in o?r.two={x:r.one.x+o.signedWidth,y:r.one.y+o.signedHeight}:r.two=o,r))},G=(t,o,e)=>{const n=c(t);if(typeof o=="string"){if(e==null)throw new Error("Invalid arguments for resize");const s=R.construct(o);return c(n.one,void 0,s==="x"?e:w(n),s==="y"?e:d(n),n.root)}return c(n.one,o,void 0,void 0,n.root)},D=(t,o,e=!0)=>{const n=c(t);let s=(r,y)=>r<y;return e&&(s=(r,y)=>r<=y),"one"in o?s(a(n),a(o))&&s(h(o),h(n))&&s(f(n),f(o))&&s(_(o),_(n)):s(a(n),o.x)&&s(o.x,h(n))&&s(f(n),o.y)&&s(o.y,_(n))},X=(t,o)=>i.equals(t.one,o.one)&&i.equals(t.two,o.two)&&x.xyEquals(t.root,o.root),q=t=>({width:w(t),height:d(t)}),$=t=>({signedWidth:O(t),signedHeight:E(t)}),U=t=>({top:f(t),left:a(t),width:w(t),height:d(t)}),L=(t,o,e=!1)=>{const n=R.construct(o)==="y"?E(t):O(t);return e?n:Math.abs(n)},l=(t,o)=>{const e=c(t);return{x:o.x==="center"?b(e).x:g(e,o.x),y:o.y==="center"?b(e).y:g(e,o.y)}},g=(t,o)=>{const e=c(t),n=x.xyCouple(e.root).includes(o)?Math.min:Math.max;return m.X_LOCATIONS.includes(o)?n(e.one.x,e.two.x):n(e.one.y,e.two.y)},Y=t=>t.one.x===t.two.x&&t.one.y===t.two.y,w=t=>L(t,"x"),d=t=>L(t,"y"),O=t=>{const o=c(t);return o.two.x-o.one.x},E=t=>{const o=c(t);return o.two.y-o.one.y},N=t=>l(t,x.TOP_LEFT),k=t=>l(t,x.TOP_CENTER),J=t=>l(t,x.TOP_RIGHT),K=t=>l(t,x.BOTTOM_LEFT),Q=t=>l(t,x.BOTTOM_CENTER),V=t=>l(t,x.BOTTOM_RIGHT),tt=t=>l(t,x.CENTER_LEFT),ot=t=>l(t,x.CENTER_RIGHT),h=t=>g(t,"right"),_=t=>g(t,"bottom"),a=t=>g(t,"left"),f=t=>g(t,"top"),b=t=>i.translate(N(t),{x:O(t)/2,y:E(t)/2}),M=t=>{const o=c(t);return o.root.x==="left"?a(o):h(o)},B=t=>{const o=c(t);return o.root.y==="top"?f(o):_(o)},nt=t=>({x:M(t),y:B(t)}),P=t=>{const o=c(t);return{lower:o.one.x,upper:o.two.x}},Z=t=>{const o=c(t);return{lower:o.one.y,upper:o.two.y}},et=(t,o)=>I(t,o),rt=(t,o)=>{const e=c(t),n=m.X_LOCATIONS.includes(o)?"x":m.Y_LOCATIONS.includes(o)?"y":null;if(n===null)throw new Error(`Invalid location: ${o}`);const s=o==="top"||o==="left"?Math.min:Math.max,r={...e.one},y={...e.two};return r[n]=s(e.one[n],e.two[n]),y[n]=s(e.one[n],e.two[n]),[r,y]},st=(t,o)=>{const e=c(t),n=c(o),s=M(n)+(w(n)-w(e))/2,r=B(n)+(d(n)-d(e))/2;return c({x:s,y:r},q(e))},j=t=>typeof t!="object"||t==null?!1:"one"in t&&"two"in t&&"root"in t,ct=t=>w(t)/d(t),it=(t,o,e)=>{if(typeof o=="string"){if(e==null)throw new Error("Undefined amount passed into box.translate");const s=R.construct(o);o=i.construct(s,e)}const n=c(t);return c(i.translate(n.one,o),i.translate(n.two,o),void 0,void 0,n.root)},A=(t,o)=>{const e=Math.max(a(t),a(o)),n=Math.max(f(t),f(o)),s=Math.min(h(t),h(o)),r=Math.min(_(t),_(o));return e>s||n>r?C:c({x:e,y:n},{x:s,y:r},void 0,void 0,t.root)},F=t=>w(t)*d(t),xt=(t,o)=>{const e=c(t);return c(i.truncate(e.one,o),i.truncate(e.two,o),void 0,void 0,e.root)},H=(t,o,e,n,s,r)=>{const y={x:t,y:o},T={x:t+e,y:o+n};return s.x!==r.x&&(s.x==="center"?(y.x-=e/2,T.x-=e/2):(y.x-=e,T.x-=e)),s.y!==r.y&&(s.y==="center"?(y.y-=n/2,T.y-=n/2):(y.y-=n,T.y-=n)),c(y,T,void 0,void 0,r)},yt=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:z,ZERO:C,area:F,areaIsZero:Y,aspect:ct,bottom:_,bottomCenter:Q,bottomLeft:K,bottomRight:V,box:v,center:b,centerLeft:tt,centerRight:ot,construct:c,constructWithAlternateRoot:H,contains:D,copy:I,css:U,cssBox:W,dim:L,dims:q,domRect:S,edgePoints:rt,equals:X,height:d,intersection:A,isBox:j,left:a,loc:g,positionInCenter:st,reRoot:et,resize:G,right:h,root:nt,signedDims:$,signedHeight:E,signedWidth:O,top:f,topCenter:k,topLeft:N,topRight:J,translate:it,truncate:xt,width:w,x:M,xBounds:P,xyLoc:l,y:B,yBounds:Z},Symbol.toStringTag,{value:"Module"}));exports.area=F;exports.box=yt;exports.construct=c;exports.constructWithAlternateRoot=H;exports.height=d;exports.intersection=A;exports.isBox=j;exports.width=w;exports.xBounds=P;exports.xyLoc=l;exports.yBounds=Z;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";var ut=Object.defineProperty;var ot=(s,t,e)=>t in s?ut(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var i=(s,t,e)=>ot(s,typeof t!="symbol"?t+"":t,e);const V=require("./index-CeBvOwG8.cjs"),lt=require("./index-DKMnHBGR.cjs"),D=require("./index-CV2JaHfw.cjs"),b=require("./index-CM8ZDZ6s.cjs");require("./index-BMGaoK93.cjs");require("./dimensions.cjs");require("./base-CTq-lhpU.cjs");require("./index-CqQXXeCI.cjs");require("./index-DEdq2tza.cjs");require("./index-WwMnwoLy.cjs");const l=require("./schemas-DbXuI2Qr.cjs");function ct(s){return l._coercedString(l.ZodString,s)}function ft(s){return l._coercedNumber(l.ZodNumber,s)}function ht(s){return l._coercedBoolean(l.ZodBoolean,s)}function K(s){return l._coercedBigint(l.ZodBigInt,s)}function dt(s){return l._coercedDate(l.ZodDate,s)}const gt=Object.freeze(Object.defineProperty({__proto__:null,bigint:K,boolean:ht,date:dt,number:ft,string:ct},Symbol.toStringTag,{value:"Module"}));let mt=(s,t=21)=>(e=t)=>{let n="",a=e|0;for(;a--;)n+=s[Math.random()*s.length|0];return n};const Ot="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",yt=mt(Ot,11),X=()=>yt(),bt=Object.freeze(Object.defineProperty({__proto__:null,create:X},Symbol.toStringTag,{value:"Module"})),Q=(s,t)=>e=>e instanceof t||typeof e=="object"&&e!==null&&"discriminator"in e&&e.discriminator===s,wt=Object.freeze(Object.defineProperty({__proto__:null,createMatcher:Q},Symbol.toStringTag,{value:"Module"})),It=l._enum(["static","dynamic"]),_=(s,t)=>{const e=new g(t);if(![m.DAY,m.HOUR,m.MINUTE,m.SECOND,m.MILLISECOND,m.MICROSECOND,m.NANOSECOND].some(a=>a.equals(e)))throw new Error("Invalid argument for remainder. Must be an even TimeSpan or Timestamp");const n=s.valueOf()%e.valueOf();return s instanceof g?new g(n):new m(n)},u=class u extends D.ValueExtension{constructor(t,e="UTC"){if(t==null)super(u.now().valueOf());else if(t instanceof Date)super(BigInt(t.getTime())*u.MILLISECOND.valueOf());else if(typeof t=="string")super(u.parseDateTimeString(t,e).valueOf());else if(Array.isArray(t))super(u.parseDate(t));else{let n=BigInt(0);t instanceof Number&&(t=t.valueOf()),e==="local"&&(n=u.utcOffset.valueOf()),typeof t=="number"&&(isFinite(t)?t=Math.trunc(t):(isNaN(t)&&(t=0),t===1/0?t=u.MAX:t=u.MIN)),super(BigInt(t.valueOf())+n)}}static parseDate([t=1970,e=1,n=1]){const a=new Date(t,e-1,n,0,0,0,0);return new u(BigInt(a.getTime())*u.MILLISECOND.valueOf()).truncate(u.DAY).valueOf()}valueOf(){return this.value}static parseTimeString(t,e="UTC"){const[n,a,f]=t.split(":");let d="00",U="00";f!=null&&([d,U]=f.split("."));let y=u.hours(parseInt(n??"00")).add(u.minutes(parseInt(a??"00"))).add(u.seconds(parseInt(d??"00"))).add(u.milliseconds(parseInt(U??"00")));return e==="local"&&(y=y.add(u.utcOffset)),y.valueOf()}static parseDateTimeString(t,e="UTC"){if(!t.includes("/")&&!t.includes("-"))return u.parseTimeString(t,e);const n=new Date(t);return t.includes(":")||n.setUTCHours(0,0,0,0),new u(BigInt(n.getTime())*u.MILLISECOND.valueOf(),e).valueOf()}fString(t="ISO",e="UTC"){switch(t){case"ISODate":return this.toISOString(e).slice(0,10);case"ISOTime":return this.toISOString(e).slice(11,23);case"time":return this.timeString(!1,e);case"preciseTime":return this.timeString(!0,e);case"date":return this.dateString();case"preciseDate":return`${this.dateString()} ${this.timeString(!0,e)}`;case"dateTime":return`${this.dateString()} ${this.timeString(!1,e)}`;default:return this.toISOString(e)}}toISOString(t="UTC"){return t==="UTC"?this.date().toISOString():this.sub(u.utcOffset).date().toISOString()}timeString(t=!1,e="UTC"){const n=this.toISOString(e);return t?n.slice(11,23):n.slice(11,19)}dateString(){const t=this.date(),e=t.toLocaleString("default",{month:"short"}),n=t.toLocaleString("default",{day:"numeric"});return`${e} ${n}`}static get utcOffset(){return new m(BigInt(new Date().getTimezoneOffset())*u.MINUTE.valueOf())}static since(t){return new u().span(t)}date(){return new Date(this.milliseconds)}equals(t){return this.valueOf()===new u(t).valueOf()}span(t){return this.range(t).span}range(t){return new A(this,t).makeValid()}spanRange(t){return this.range(this.add(t)).makeValid()}get isZero(){return this.valueOf()===BigInt(0)}after(t){return this.valueOf()>new u(t).valueOf()}afterEq(t){return this.valueOf()>=new u(t).valueOf()}before(t){return this.valueOf()<new u(t).valueOf()}beforeEq(t){return this.valueOf()<=new u(t).valueOf()}add(t){return new u(this.valueOf()+BigInt(t.valueOf()))}sub(t){return new u(this.valueOf()-BigInt(t.valueOf()))}get hours(){return Number(this.valueOf())/Number(m.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(m.MINUTE.valueOf())}get days(){return Number(this.valueOf())/Number(m.DAY.valueOf())}get seconds(){return Number(this.valueOf())/Number(m.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(u.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(u.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get year(){return this.date().getUTCFullYear()}setYear(t){const e=this.date();return e.setUTCFullYear(t),new u(e)}get month(){return this.date().getUTCMonth()}setMonth(t){const e=this.date();return e.setUTCMonth(t),new u(e)}get day(){return this.date().getUTCDate()}setDay(t){const e=this.date();return e.setUTCDate(t),new u(e)}get hour(){return this.date().getUTCHours()}setHour(t){const e=this.date();return e.setUTCHours(t),new u(e,"UTC")}get minute(){return this.date().getUTCMinutes()}setMinute(t){const e=this.date();return e.setUTCMinutes(t),new u(e)}get second(){return this.date().getUTCSeconds()}setSecond(t){const e=this.date();return e.setUTCSeconds(t),new u(e)}get millisecond(){return this.date().getUTCMilliseconds()}setMillisecond(t){const e=this.date();return e.setUTCMilliseconds(t),new u(e)}toString(){return this.date().toISOString()}remainder(t){return _(this,t)}get isToday(){return this.truncate(m.DAY).equals(u.now().truncate(m.DAY))}truncate(t){return this.sub(this.remainder(t))}static now(){return new u(new Date)}static max(...t){let e=u.MIN;for(const n of t){const a=new u(n);a.after(e)&&(e=a)}return e}static min(...t){let e=u.MAX;for(const n of t){const a=new u(n);a.before(e)&&(e=a)}return e}static nanoseconds(t,e="UTC"){return new u(t,e)}static microseconds(t,e="UTC"){return u.nanoseconds(t*1e3,e)}static milliseconds(t,e="UTC"){return u.microseconds(t*1e3,e)}static seconds(t,e="UTC"){return u.milliseconds(t*1e3,e)}static minutes(t,e="UTC"){return u.seconds(t*60,e)}static hours(t,e="UTC"){return u.minutes(t*60,e)}static days(t,e="UTC"){return u.hours(t*24,e)}};i(u,"NANOSECOND",u.nanoseconds(1)),i(u,"MICROSECOND",u.microseconds(1)),i(u,"MILLISECOND",u.milliseconds(1)),i(u,"SECOND",u.seconds(1)),i(u,"MINUTE",u.minutes(1)),i(u,"HOUR",u.hours(1)),i(u,"DAY",u.days(1)),i(u,"MAX",new u((1n<<63n)-1n)),i(u,"MIN",new u(0)),i(u,"ZERO",new u(0)),i(u,"z",l.union([l.object({value:l.bigint()}).transform(t=>new u(t.value)),l.string().transform(t=>new u(BigInt(t))),l._instanceof(Number).transform(t=>new u(t)),l.number().transform(t=>new u(t)),l._instanceof(u)]));let g=u;const o=class o extends D.ValueExtension{constructor(t){typeof t=="number"&&(t=Math.trunc(t.valueOf())),super(BigInt(t.valueOf()))}static fromSeconds(t){return t instanceof o?t:t instanceof q?t.period:t instanceof g?new o(t):["number","bigint"].includes(typeof t)?o.seconds(t):new o(t)}static fromMilliseconds(t){return t instanceof o?t:t instanceof q?t.period:t instanceof g?new o(t):["number","bigint"].includes(typeof t)?o.milliseconds(t):new o(t)}valueOf(){return this.value}lessThan(t){return this.valueOf()<new o(t).valueOf()}greaterThan(t){return this.valueOf()>new o(t).valueOf()}lessThanOrEqual(t){return this.valueOf()<=new o(t).valueOf()}greaterThanOrEqual(t){return this.valueOf()>=new o(t).valueOf()}remainder(t){return _(this,t)}truncate(t){return new o(BigInt(Math.trunc(Number(this.valueOf()/t.valueOf())))*t.valueOf())}toString(){const t=this.truncate(o.DAY),e=this.truncate(o.HOUR),n=this.truncate(o.MINUTE),a=this.truncate(o.SECOND),f=this.truncate(o.MILLISECOND),d=this.truncate(o.MICROSECOND),U=this.truncate(o.NANOSECOND),y=t,S=e.sub(t),B=n.sub(e),c=a.sub(n),M=f.sub(a),v=d.sub(f),j=U.sub(d);let C="";return y.isZero||(C+=`${y.days}d `),S.isZero||(C+=`${S.hours}h `),B.isZero||(C+=`${B.minutes}m `),c.isZero||(C+=`${c.seconds}s `),M.isZero||(C+=`${M.milliseconds}ms `),v.isZero||(C+=`${v.microseconds}µs `),j.isZero||(C+=`${j.nanoseconds}ns`),C.trim()}mult(t){return new o(this.valueOf()*BigInt(t))}get days(){return Number(this.valueOf())/Number(o.DAY.valueOf())}get hours(){return Number(this.valueOf())/Number(o.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(o.MINUTE.valueOf())}get seconds(){return Number(this.valueOf())/Number(o.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(o.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(o.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get isZero(){return this.valueOf()===BigInt(0)}equals(t){return this.valueOf()===new o(t).valueOf()}add(t){return new o(this.valueOf()+new o(t).valueOf())}sub(t){return new o(this.valueOf()-new o(t).valueOf())}static nanoseconds(t=1){return new o(t)}static microseconds(t=1){return o.nanoseconds(b.mult(t,1e3))}static milliseconds(t=1){return o.microseconds(b.mult(t,1e3))}static seconds(t=1){return o.milliseconds(b.mult(t,1e3))}static minutes(t=1){return o.seconds(b.mult(t,60))}static hours(t){return o.minutes(b.mult(t,60))}static days(t){return o.hours(b.mult(t,24))}};i(o,"NANOSECOND",o.nanoseconds(1)),i(o,"MICROSECOND",o.microseconds(1)),i(o,"MILLISECOND",o.milliseconds(1)),i(o,"SECOND",o.seconds(1)),i(o,"MINUTE",o.minutes(1)),i(o,"HOUR",o.hours(1)),i(o,"DAY",o.days(1)),i(o,"MAX",new o((1n<<63n)-1n)),i(o,"MIN",new o(0)),i(o,"ZERO",new o(0)),i(o,"z",l.union([l.object({value:l.bigint()}).transform(t=>new o(t.value)),l.string().transform(t=>new o(BigInt(t))),l._instanceof(Number).transform(t=>new o(t)),l.number().transform(t=>new o(t)),l._instanceof(o)]));let m=o;const E=class E extends D.ValueExtension{constructor(t){super(t.valueOf())}toString(){return`${this.valueOf()} Hz`}equals(t){return this.valueOf()===new E(t).valueOf()}get period(){return m.seconds(1/this.valueOf())}sampleCount(t){return new m(t).seconds*this.valueOf()}byteCount(t,e){return this.sampleCount(t)*new I(e).valueOf()}span(t){return m.seconds(t/this.valueOf())}byteSpan(t,e){return this.span(t.valueOf()/e.valueOf())}static hz(t){return new E(t)}static khz(t){return E.hz(t*1e3)}};i(E,"z",l.union([l.number().transform(t=>new E(t)),l._instanceof(Number).transform(t=>new E(t)),l._instanceof(E)]));let q=E;const w=class w extends D.ValueExtension{constructor(t){super(t.valueOf())}length(t){return t.valueOf()/this.valueOf()}size(t){return new x(t*this.valueOf())}};i(w,"UNKNOWN",new w(0)),i(w,"BIT128",new w(16)),i(w,"BIT64",new w(8)),i(w,"BIT32",new w(4)),i(w,"BIT16",new w(2)),i(w,"BIT8",new w(1)),i(w,"z",l.union([l.number().transform(t=>new w(t)),l._instanceof(Number).transform(t=>new w(t)),l._instanceof(w)]));let I=w;const N=class N{constructor(t,e){i(this,"start");i(this,"end");typeof t=="object"&&"start"in t?(this.start=new g(t.start),this.end=new g(t.end)):(this.start=new g(t),this.end=new g(e))}get span(){return new m(this.end.valueOf()-this.start.valueOf())}get isValid(){return this.start.valueOf()<=this.end.valueOf()}makeValid(){return this.isValid?this:this.swap()}get isZero(){return this.span.isZero}get numeric(){return{start:Number(this.start.valueOf()),end:Number(this.end.valueOf())}}swap(){return new N(this.end,this.start)}get numericBounds(){return{lower:Number(this.start.valueOf()),upper:Number(this.end.valueOf())}}equals(t,e=m.ZERO){if(e.isZero)return this.start.equals(t.start)&&this.end.equals(t.end);let n=this.start.sub(t.start).valueOf(),a=this.end.sub(t.end).valueOf();return n<0&&(n=-n),a<0&&(a=-a),n<=e.valueOf()&&a<=e.valueOf()}toString(){return`${this.start.toString()} - ${this.end.toString()}`}toPrettyString(){return`${this.start.fString("preciseDate")} - ${this.span.toString()}`}overlapsWith(t,e=m.ZERO){t=t.makeValid();const n=this.makeValid();if(this.equals(t))return!0;if(t.end.equals(n.start)||n.end.equals(t.start))return!1;const a=g.max(n.start,t.start),f=g.min(n.end,t.end);return f.before(a)?!1:new m(f.sub(a)).greaterThanOrEqual(e)}contains(t){return t instanceof N?this.contains(t.start)&&this.contains(t.end):this.start.beforeEq(t)&&this.end.after(t)}boundBy(t){const e=new N(this.start,this.end);return t.start.after(this.start)&&(e.start=t.start),t.start.after(this.end)&&(e.end=t.start),t.end.before(this.end)&&(e.end=t.end),t.end.before(this.start)&&(e.start=t.end),e}static max(...t){return new N(g.min(...t.map(e=>e.start)),g.max(...t.map(e=>e.end)))}};i(N,"MAX",new N(g.MIN,g.MAX)),i(N,"MIN",new N(g.MAX,g.MIN)),i(N,"ZERO",new N(g.ZERO,g.ZERO)),i(N,"z",l.union([l.object({start:g.z,end:g.z}).transform(t=>new N(t.start,t.end)),l._instanceof(N)]));let A=N;const Tt=(s,t)=>s.start.before(t.start)?-1:s.start.after(t.start)?1:s.end.before(t.end)?-1:s.end.after(t.end)?1:0,r=class r extends D.ValueExtension{constructor(t){if(t instanceof r||typeof t=="string"||typeof t.valueOf()=="string")super(t.valueOf());else{const e=r.ARRAY_CONSTRUCTOR_DATA_TYPES.get(t.constructor.name);if(e==null)throw new Error(`unable to find data type for ${t.toString()}`);super(e.valueOf())}}get Array(){const t=r.ARRAY_CONSTRUCTORS.get(this.toString());if(t==null)throw new Error(`unable to find array constructor for ${this.valueOf()}`);return t}equals(t){return this.valueOf()===t.valueOf()}matches(...t){return t.some(e=>this.equals(e))}toString(){return this.valueOf()}get isVariable(){return this.equals(r.JSON)||this.equals(r.STRING)}get isNumeric(){return!this.isVariable&&!this.equals(r.UUID)}get isInteger(){const t=this.toString();return t.startsWith("int")||t.startsWith("uint")}get isFloat(){return this.toString().startsWith("float")}get density(){const t=r.DENSITIES.get(this.toString());if(t==null)throw new Error(`unable to find density for ${this.valueOf()}`);return t}get isUnsignedInteger(){return this.equals(r.UINT8)||this.equals(r.UINT16)||this.equals(r.UINT32)||this.equals(r.UINT64)}get isSignedInteger(){return this.equals(r.INT8)||this.equals(r.INT16)||this.equals(r.INT32)||this.equals(r.INT64)}canSafelyCastTo(t){return this.equals(t)?!0:!this.isNumeric||!t.isNumeric||this.isVariable||t.isVariable||this.isUnsignedInteger&&t.isSignedInteger?!1:this.isFloat?t.isFloat&&this.density.valueOf()<=t.density.valueOf():this.equals(r.INT32)&&t.equals(r.FLOAT64)||this.equals(r.INT8)&&t.equals(r.FLOAT32)?!0:this.isInteger&&t.isInteger?this.density.valueOf()<=t.density.valueOf()&&this.isUnsignedInteger===t.isUnsignedInteger:!1}canCastTo(t){return this.isNumeric&&t.isNumeric?!0:this.equals(t)}checkArray(t){return t.constructor===this.Array}get usesBigInt(){return r.BIG_INT_TYPES.some(t=>t.equals(this))}};i(r,"UNKNOWN",new r("unknown")),i(r,"FLOAT64",new r("float64")),i(r,"FLOAT32",new r("float32")),i(r,"INT64",new r("int64")),i(r,"INT32",new r("int32")),i(r,"INT16",new r("int16")),i(r,"INT8",new r("int8")),i(r,"UINT64",new r("uint64")),i(r,"UINT32",new r("uint32")),i(r,"UINT16",new r("uint16")),i(r,"UINT8",new r("uint8")),i(r,"BOOLEAN",r.UINT8),i(r,"TIMESTAMP",new r("timestamp")),i(r,"UUID",new r("uuid")),i(r,"STRING",new r("string")),i(r,"JSON",new r("json")),i(r,"ARRAY_CONSTRUCTORS",new Map([[r.UINT8.toString(),Uint8Array],[r.UINT16.toString(),Uint16Array],[r.UINT32.toString(),Uint32Array],[r.UINT64.toString(),BigUint64Array],[r.FLOAT32.toString(),Float32Array],[r.FLOAT64.toString(),Float64Array],[r.INT8.toString(),Int8Array],[r.INT16.toString(),Int16Array],[r.INT32.toString(),Int32Array],[r.INT64.toString(),BigInt64Array],[r.TIMESTAMP.toString(),BigInt64Array],[r.STRING.toString(),Uint8Array],[r.JSON.toString(),Uint8Array],[r.UUID.toString(),Uint8Array]])),i(r,"ARRAY_CONSTRUCTOR_DATA_TYPES",new Map([[Uint8Array.name,r.UINT8],[Uint16Array.name,r.UINT16],[Uint32Array.name,r.UINT32],[BigUint64Array.name,r.UINT64],[Float32Array.name,r.FLOAT32],[Float64Array.name,r.FLOAT64],[Int8Array.name,r.INT8],[Int16Array.name,r.INT16],[Int32Array.name,r.INT32],[BigInt64Array.name,r.INT64]])),i(r,"DENSITIES",new Map([[r.UINT8.toString(),I.BIT8],[r.UINT16.toString(),I.BIT16],[r.UINT32.toString(),I.BIT32],[r.UINT64.toString(),I.BIT64],[r.FLOAT32.toString(),I.BIT32],[r.FLOAT64.toString(),I.BIT64],[r.INT8.toString(),I.BIT8],[r.INT16.toString(),I.BIT16],[r.INT32.toString(),I.BIT32],[r.INT64.toString(),I.BIT64],[r.TIMESTAMP.toString(),I.BIT64],[r.STRING.toString(),I.UNKNOWN],[r.JSON.toString(),I.UNKNOWN],[r.UUID.toString(),I.BIT128]])),i(r,"ALL",[r.UNKNOWN,r.FLOAT64,r.FLOAT32,r.INT64,r.INT32,r.INT16,r.INT8,r.UINT64,r.UINT32,r.UINT16,r.UINT8,r.TIMESTAMP,r.UUID,r.STRING,r.JSON]),i(r,"BIG_INT_TYPES",[r.INT64,r.UINT64,r.TIMESTAMP]),i(r,"z",l.union([l.string().transform(t=>new r(t)),l._instanceof(r)]));let O=r;const h=class h extends D.ValueExtension{constructor(t){super(t.valueOf())}largerThan(t){return this.valueOf()>t.valueOf()}smallerThan(t){return this.valueOf()<t.valueOf()}add(t){return h.bytes(this.valueOf()+t.valueOf())}sub(t){return h.bytes(this.valueOf()-t.valueOf())}truncate(t){return new h(Math.trunc(this.valueOf()/t.valueOf())*t.valueOf())}remainder(t){return h.bytes(this.valueOf()%t.valueOf())}get gigabytes(){return this.valueOf()/h.GIGABYTE.valueOf()}get megabytes(){return this.valueOf()/h.MEGABYTE.valueOf()}get kilobytes(){return this.valueOf()/h.KILOBYTE.valueOf()}get terabytes(){return this.valueOf()/h.TERABYTE.valueOf()}toString(){const t=this.truncate(h.TERABYTE),e=this.truncate(h.GIGABYTE),n=this.truncate(h.MEGABYTE),a=this.truncate(h.KILOBYTE),f=this.truncate(h.BYTE),d=t,U=e.sub(t),y=n.sub(e),S=a.sub(n),B=f.sub(a);let c="";return d.isZero||(c+=`${d.terabytes}TB `),U.isZero||(c+=`${U.gigabytes}GB `),y.isZero||(c+=`${y.megabytes}MB `),S.isZero||(c+=`${S.kilobytes}KB `),(!B.isZero||c==="")&&(c+=`${B.valueOf()}B`),c.trim()}static bytes(t=1){return new h(t)}static kilobytes(t=1){return h.bytes(t.valueOf()*1e3)}static megabytes(t=1){return h.kilobytes(t.valueOf()*1e3)}static gigabytes(t=1){return h.megabytes(t.valueOf()*1e3)}static terabytes(t){return h.gigabytes(t.valueOf()*1e3)}get isZero(){return this.valueOf()===0}};i(h,"BYTE",new h(1)),i(h,"KILOBYTE",h.kilobytes(1)),i(h,"MEGABYTE",h.megabytes(1)),i(h,"GIGABYTE",h.gigabytes(1)),i(h,"TERABYTE",h.terabytes(1)),i(h,"ZERO",new h(0)),i(h,"z",l.union([l.number().transform(t=>new h(t)),l._instanceof(h)]));let x=h;const Nt=l.union([l._instanceof(Uint8Array),l._instanceof(Uint16Array),l._instanceof(Uint32Array),l._instanceof(BigUint64Array),l._instanceof(Float32Array),l._instanceof(Float64Array),l._instanceof(Int8Array),l._instanceof(Int16Array),l._instanceof(Int32Array),l._instanceof(BigInt64Array)]),J=s=>{const t=typeof s;return t==="string"||t==="number"||t==="boolean"||t==="bigint"||s instanceof g||s instanceof m||s instanceof Date},tt=(s,t,e,n=0)=>s.usesBigInt&&!t.usesBigInt?Number(e)-Number(n):!s.usesBigInt&&t.usesBigInt?BigInt(e.valueOf())-BigInt(n.valueOf()):L(e,-n).valueOf(),L=(s,t)=>t==0?s:s==0?t:typeof s=="bigint"&&typeof t=="bigint"||typeof s=="number"&&typeof t=="number"?s+t:Number(s)+Number(t),pt="00000000-0000-0000-0000-000000000000",St=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function vt(s){return typeof s=="string"&&St.test(s)}const T=[];for(let s=0;s<256;++s)T.push((s+256).toString(16).slice(1));function et(s,t=0){return(T[s[t+0]]+T[s[t+1]]+T[s[t+2]]+T[s[t+3]]+"-"+T[s[t+4]]+T[s[t+5]]+"-"+T[s[t+6]]+T[s[t+7]]+"-"+T[s[t+8]]+T[s[t+9]]+"-"+T[s[t+10]]+T[s[t+11]]+T[s[t+12]]+T[s[t+13]]+T[s[t+14]]+T[s[t+15]]).toLowerCase()}function At(s,t=0){const e=et(s,t);if(!vt(e))throw TypeError("Stringified UUID is invalid");return e}let Z;const Ut=new Uint8Array(16);function Et(){if(!Z){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Z=crypto.getRandomValues.bind(crypto)}return Z(Ut)}const Bt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),W={randomUUID:Bt};function Mt(s,t,e){var a;if(W.randomUUID&&!s)return W.randomUUID();s=s||{};const n=s.random??((a=s.rng)==null?void 0:a.call(s))??Et();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,et(n)}const Ct=()=>Mt(),nt=(s,t)=>At(s,t),Rt=pt,xt=Object.freeze(Object.defineProperty({__proto__:null,ZERO:Rt,create:Ct,parse:nt},Symbol.toStringTag,{value:"Module"})),R=-1,Y={[Symbol.iterator]:()=>Y,next:()=>({done:!0,value:void 0})},Dt=l.string().transform(s=>new Uint8Array(atob(s).split("").map(t=>t.charCodeAt(0))).buffer),Lt=l.union([l._null$1(),l._undefined$1()]).transform(()=>new Uint8Array().buffer),k=10,rt=(s,t)=>{if(s==="string"&&!t.isVariable)throw new Error(`cannot convert series of type ${t.toString()} to string`);if(s==="number"&&!t.isNumeric)throw new Error(`cannot convert series of type ${t.toString()} to number`);if(s==="bigint"&&!t.usesBigInt)throw new Error(`cannot convert series of type ${t.toString()} to bigint`)},st="sy_x_telem_series",p=class p{constructor(t){i(this,"key");i(this,"discriminator",st);i(this,"dataType");i(this,"sampleOffset");i(this,"gl");i(this,"_data");i(this,"timeRange",A.ZERO);i(this,"alignment",0n);i(this,"cachedMin");i(this,"cachedMax");i(this,"writePos",R);i(this,"_refCount",0);i(this,"cachedLength");i(this,"_cachedIndexes");it(t)&&(t={data:t}),t.data??(t.data=[]);const{dataType:e,timeRange:n,sampleOffset:a=0,glBufferUsage:f="static",alignment:d=0n,key:U=X(),data:y}=t;if(at(y)){const c=y;this.key=c.key,this.dataType=c.dataType,this.sampleOffset=c.sampleOffset,this.gl=c.gl,this._data=c._data,this.timeRange=c.timeRange,this.alignment=c.alignment,this.cachedMin=c.cachedMin,this.cachedMax=c.cachedMax,this.writePos=c.writePos,this._refCount=c._refCount,this.cachedLength=c.cachedLength;return}const S=J(y),B=Array.isArray(y);if(e!=null)this.dataType=new O(e);else{if(y instanceof ArrayBuffer)throw new Error("cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type.");if(B||S){let c=y;if(!S){if(y.length===0)throw new Error("cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type.");c=y[0]}if(typeof c=="string")this.dataType=O.STRING;else if(typeof c=="number")this.dataType=O.FLOAT64;else if(typeof c=="bigint")this.dataType=O.INT64;else if(typeof c=="boolean")this.dataType=O.BOOLEAN;else if(c instanceof g||c instanceof Date||c instanceof g)this.dataType=O.TIMESTAMP;else if(typeof c=="object")this.dataType=O.JSON;else throw new Error(`cannot infer data type of ${typeof c} when constructing a Series from a JS array`)}else this.dataType=new O(y)}if(!B&&!S)this._data=y;else{let c=S?[y]:y;const M=c[0];(M instanceof g||M instanceof Date||M instanceof m)&&(c=c.map(v=>new g(v).valueOf())),this.dataType.equals(O.STRING)?(this.cachedLength=c.length,this._data=new TextEncoder().encode(`${c.join(`
|
|
2
|
+
`)}
|
|
3
|
+
`).buffer):this.dataType.equals(O.JSON)?(this.cachedLength=c.length,this._data=new TextEncoder().encode(`${c.map(v=>V.JSON_CODEC.encodeString(v)).join(`
|
|
4
|
+
`)}
|
|
5
|
+
`).buffer):this.dataType.usesBigInt&&typeof M=="number"?this._data=new this.dataType.Array(c.map(v=>BigInt(Math.round(v)))).buffer:!this.dataType.usesBigInt&&typeof M=="bigint"?this._data=new this.dataType.Array(c.map(v=>Number(v))).buffer:this._data=new this.dataType.Array(c).buffer}this.key=U,this.alignment=d,this.sampleOffset=a??0,this.timeRange=n??A.ZERO,this.gl={control:null,buffer:null,prevBuffer:0,bufferUsage:f}}static alloc({capacity:t,dataType:e,...n}){if(t===0)throw new Error("[Series] - cannot allocate an array of length 0");const a=new new O(e).Array(t),f=new p({data:a.buffer,dataType:e,...n});return f.writePos=0,f}get refCount(){return this._refCount}acquire(t){this._refCount++,t!=null&&this.updateGLBuffer(t)}release(){this._refCount--,this.refCount===0&&this.gl.control!=null?this.maybeGarbageCollectGLBuffer(this.gl.control):this.refCount<0&&console.warn("cannot release a series with a negative reference count")}write(t){if(!t.dataType.equals(this.dataType))throw new Error("buffer must be of the same type as this array");return this.dataType.isVariable?this.writeVariable(t):this.writeFixed(t)}writeVariable(t){if(this.writePos===R)return 0;const e=this.byteCapacity.valueOf()-this.writePos,n=t.subBytes(0,e);return this.writeToUnderlyingData(n),this.writePos+=n.byteLength.valueOf(),this.cachedLength!=null&&(this.cachedLength+=n.length,this.calculateCachedLength()),n.length}writeFixed(t){if(this.writePos===R)return 0;const e=this.capacity-this.writePos,n=t.sub(0,e);return this.writeToUnderlyingData(n),this.cachedLength=void 0,this.maybeRecomputeMinMax(n),this.writePos+=n.length,n.length}writeToUnderlyingData(t){this.underlyingData.set(t.data,this.writePos)}get buffer(){return typeof this._data=="object"&&"buffer"in this._data?this._data.buffer:this._data}get underlyingData(){return new this.dataType.Array(this._data)}get data(){return this.writePos===R?this.underlyingData:new this.dataType.Array(this._data,0,this.writePos)}toStrings(){return this.dataType.isVariable?new TextDecoder().decode(this.underlyingData).split(`
|
|
6
|
+
`).slice(0,-1):Array.from(this).map(t=>t.toString())}toUUIDs(){if(!this.dataType.equals(O.UUID))throw new Error("cannot convert non-uuid series to uuids");const t=O.UUID.density.valueOf(),e=new Uint8Array(this.underlyingData.buffer);return Array.from({length:this.length},(n,a)=>nt(e,a*t))}parseJSON(t){if(!this.dataType.equals(O.JSON))throw new Error("cannot parse non-JSON series as JSON");return this.toStrings().map(e=>t.parse(V.JSON_CODEC.decodeString(e)))}get byteCapacity(){return new x(this.underlyingData.byteLength)}get capacity(){return this.dataType.isVariable?this.byteCapacity.valueOf():this.dataType.density.length(this.byteCapacity)}get byteLength(){return this.writePos===R?this.byteCapacity:this.dataType.isVariable?new x(this.writePos):this.dataType.density.size(this.writePos)}get length(){return this.cachedLength!=null?this.cachedLength:this.dataType.isVariable?this.calculateCachedLength():this.writePos===R?this.byteCapacity.valueOf()/this.dataType.density.valueOf():this.writePos}calculateCachedLength(){if(!this.dataType.isVariable)throw new Error("cannot calculate length of a non-variable length data type");let t=0;const e=[0];return this.data.forEach((n,a)=>{n===k&&(t++,e.push(a+1))}),this._cachedIndexes=e,this.cachedLength=t,t}convert(t,e=0){if(this.dataType.equals(t))return this;const n=new t.Array(this.length);for(let a=0;a<this.length;a++)n[a]=tt(this.dataType,t,this.data[a],e);return new p({data:n.buffer,dataType:t,timeRange:this.timeRange,sampleOffset:e,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment})}calcRawMax(){if(this.length===0)return-1/0;if(this.dataType.equals(O.TIMESTAMP))this.cachedMax=this.data[this.data.length-1];else if(this.dataType.usesBigInt){const t=this.data;this.cachedMax=t.reduce((e,n)=>e>n?e:n)}else{const t=this.data;this.cachedMax=t.reduce((e,n)=>e>n?e:n)}return this.cachedMax}get max(){return this.calcMax()}calcMax(){if(this.dataType.isVariable)throw new Error("cannot calculate maximum on a variable length data type");return this.writePos===0?-1/0:(this.cachedMax??(this.cachedMax=this.calcRawMax()),L(this.cachedMax,this.sampleOffset))}calcRawMin(){if(this.length===0)return 1/0;if(this.dataType.equals(O.TIMESTAMP))this.cachedMin=this.data[0];else if(this.dataType.usesBigInt){const t=this.data;this.cachedMin=t.reduce((e,n)=>e<n?e:n)}else{const t=this.data;this.cachedMin=t.reduce((e,n)=>e<n?e:n)}return this.cachedMin}get min(){return this.calcMin()}calcMin(){if(this.dataType.isVariable)throw new Error("cannot calculate minimum on a variable length data type");return this.writePos===0?1/0:(this.cachedMin??(this.cachedMin=this.calcRawMin()),L(this.cachedMin,this.sampleOffset))}get bounds(){return b.construct(Number(this.min),Number(this.max),{makeValid:!1})}maybeRecomputeMinMax(t){if(this.cachedMin!=null){const e=t.cachedMin??t.calcRawMin();e<this.cachedMin&&(this.cachedMin=e)}if(this.cachedMax!=null){const e=t.cachedMax??t.calcRawMax();e>this.cachedMax&&(this.cachedMax=e)}}atAlignment(t,e){const n=Number(t-this.alignment);if(n<0||n>=this.length){if(e===!0)throw new Error(`[series] - no value at index ${n}`);return}return this.at(n,e)}at(t,e){if(this.dataType.isVariable)return this.atVariable(t,e??!1);t<0&&(t=this.length+t);const n=this.data[t];if(n==null){if(e===!0)throw new Error(`[series] - no value at index ${t}`);return}return L(n,this.sampleOffset)}atVariable(t,e){let n=0,a=0;if(this._cachedIndexes!=null)n=this._cachedIndexes[t],a=this._cachedIndexes[t+1]-1;else{t<0&&(t=this.length+t);for(let d=0;d<this.data.length;d++)if(this.data[d]===k){if(t===0){a=d;break}n=d+1,t--}if(a===0&&(a=this.data.length),n>=a||t>0){if(e)throw new Error(`[series] - no value at index ${t}`);return}}const f=this.data.slice(n,a);return this.dataType.equals(O.STRING)?new TextDecoder().decode(f):lt.snakeToCamel(JSON.parse(new TextDecoder().decode(f)))}binarySearch(t){let e=0,n=this.length-1;const a=D.newF(t);for(;e<=n;){const f=Math.floor((e+n)/2),d=a(this.at(f,!0),t);if(d===0)return f;d<0?e=f+1:n=f-1}return e}updateGLBuffer(t){if(this.gl.control=t,!this.dataType.equals(O.FLOAT32)&&!this.dataType.equals(O.UINT8))throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");const{buffer:e,bufferUsage:n,prevBuffer:a}=this.gl;if(e==null&&(this.gl.buffer=t.createBuffer()),this.writePos!==a)if(t.bindBuffer(t.ARRAY_BUFFER,this.gl.buffer),this.writePos!==R){a===0&&t.bufferData(t.ARRAY_BUFFER,this.byteCapacity.valueOf(),t.STATIC_DRAW);const f=this.dataType.density.size(a).valueOf(),d=this.underlyingData.slice(this.gl.prevBuffer,this.writePos);t.bufferSubData(t.ARRAY_BUFFER,f,d.buffer),this.gl.prevBuffer=this.writePos}else t.bufferData(t.ARRAY_BUFFER,this.buffer,n==="static"?t.STATIC_DRAW:t.DYNAMIC_DRAW),this.gl.prevBuffer=R}as(t){return rt(t,this.dataType),this}get digest(){return{key:this.key,dataType:this.dataType.toString(),sampleOffset:this.sampleOffset,alignment:{lower:z(this.alignmentBounds.lower),upper:z(this.alignmentBounds.upper)},timeRange:this.timeRange.toString(),length:this.length,capacity:this.capacity}}get alignmentBounds(){return b.construct(this.alignment,this.alignment+BigInt(this.length))}maybeGarbageCollectGLBuffer(t){this.gl.buffer!=null&&(t.deleteBuffer(this.gl.buffer),this.gl.buffer=null,this.gl.prevBuffer=0,this.gl.control=null)}get glBuffer(){if(this.gl.buffer==null)throw new Error("gl buffer not initialized");return this.gl.prevBuffer!==this.writePos&&console.warn("buffer not updated"),this.gl.buffer}[Symbol.iterator](){if(this.dataType.isVariable){const t=new qt(this);return this.dataType.equals(O.JSON)?new G(t):t}return new $t(this)}slice(t,e){return this.sliceSub(!1,t,e)}sub(t,e){return this.sliceSub(!0,t,e)}subIterator(t,e){return new H(this,t,e??this.length)}subAlignmentIterator(t,e){return new H(this,Number(t-this.alignment),Number(e-this.alignment))}subBytes(t,e){if(t>=0&&(e==null||e>=this.byteLength.valueOf()))return this;const n=this.data.subarray(t,e);return new p({data:n,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(t)})}sliceSub(t,e,n){if(e<=0&&(n==null||n>=this.length))return this;let a;return t?a=this.data.subarray(e,n):a=this.data.slice(e,n),new p({data:a,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(e)})}reAlign(t){return new p({data:this.buffer,dataType:this.dataType,timeRange:A.ZERO,sampleOffset:this.sampleOffset,glBufferUsage:"static",alignment:t})}toString(){var e,n;let t=`Series(${this.dataType.toString()} ${this.length} [`;if(this.length<=10)t+=Array.from(this).map(a=>a.toString());else{for(let a=0;a<5;a++)t+=`${(e=this.at(a))==null?void 0:e.toString()}`,t+=",";t+="...,";for(let a=-5;a<0;a++)t+=(n=this.at(a))==null?void 0:n.toString(),a<-1&&(t+=",")}return t+="])",t}};i(p,"crudeZ",l.object({timeRange:A.z.optional(),dataType:O.z,alignment:K().optional(),data:l.union([Dt,Lt,l._instanceof(ArrayBuffer),l._instanceof(Uint8Array)]),glBufferUsage:It.optional().default("static").optional()})),i(p,"z",p.crudeZ.transform(t=>new p(t)));let $=p;const it=s=>s==null?!1:Array.isArray(s)||s instanceof ArrayBuffer||ArrayBuffer.isView(s)&&!(s instanceof DataView)||s instanceof $?!0:J(s),at=Q(st,$);class H{constructor(t,e,n){i(this,"series");i(this,"end");i(this,"index");this.series=t;const a=b.construct(0,t.length);this.end=b.clamp(a,n),this.index=b.clamp(a,e)}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}}class qt{constructor(t){i(this,"series");i(this,"index");i(this,"decoder");if(!t.dataType.isVariable)throw new Error("cannot create a variable series iterator for a non-variable series");this.series=t,this.index=0,this.decoder=new TextDecoder}next(){const t=this.index,e=this.series.data;for(;this.index<e.length&&e[this.index]!==k;)this.index++;const n=this.index;return t===n?{done:!0,value:void 0}:(this.index++,{done:!1,value:this.decoder.decode(this.series.buffer.slice(t,n))})}}const P=class P{constructor(t){i(this,"wrapped");this.wrapped=t}next(){const t=this.wrapped.next();return t.done===!0?{done:!0,value:void 0}:{done:!1,value:V.JSON_CODEC.decodeString(t.value,P.schema)}}};i(P,"schema",l.record(l.string(),l.unknown()));let G=P;class $t{constructor(t){i(this,"series");i(this,"index");this.series=t,this.index=0}next(){return this.index>=this.series.length?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}}class Pt{constructor(t=[]){i(this,"series");if(t.length!==0){const e=t[0].dataType;for(let n=1;n<t.length;n++)if(!t[n].dataType.equals(e))throw new Error("[multi-series] - series must have the same data type")}this.series=t}as(t){return rt(t,this.dataType),this}get dataType(){return this.series.length===0?O.UNKNOWN:this.series[0].dataType}get timeRange(){return this.series.length===0?A.ZERO:new A(this.series[0].timeRange.start,this.series[this.series.length-1].timeRange.end)}get alignment(){return this.series.length===0?0n:this.series[0].alignment}get alignmentBounds(){return this.series.length===0?b.construct(0n,0n):b.construct(this.series[0].alignmentBounds.lower,this.series[this.series.length-1].alignmentBounds.upper)}push(t){const e=()=>new Error(`cannot push a ${t.dataType.toString()} series to a ${this.dataType.toString()} multi-series`),n=t.dataType.equals(this.dataType);if(at(t)){if(this.series.length!==0&&!n)throw e();this.series.push(t)}else{if(this.series.length!==0&&t.series.length!==0&&!n)throw e();this.series.push(...t.series)}}get length(){return this.series.reduce((t,e)=>t+e.length,0)}atAlignment(t,e){for(const n of this.series)if(b.contains(n.alignmentBounds,t))return n.atAlignment(t,e);if(e)throw new Error(`[series] - no value at alignment ${t}`)}at(t,e=!1){t<0&&(t=this.length+t);for(const n of this.series){if(t<n.length)return n.at(t,e);t-=n.length}if(e)throw new Error(`[series] - no value at index ${t}`)}subIterator(t,e){return new F(this,t,e??this.length)}subAlignmentIterator(t,e){if(t>=this.alignmentBounds.upper||e<=this.alignmentBounds.lower)return Y;let n=0;for(let f=0;f<this.series.length;f++){const d=this.series[f];if(t<d.alignment)break;if(t>=d.alignmentBounds.upper)n+=d.length;else if(b.contains(d.alignmentBounds,t)){n+=Number(t-d.alignment);break}}let a=0;for(let f=0;f<this.series.length;f++){const d=this.series[f];if(e<d.alignment)break;if(e>=d.alignmentBounds.upper)a+=d.length;else if(b.contains(d.alignmentBounds,e)){a+=Number(e-d.alignment);break}}return new F(this,n,a)}subAlignmentSpanIterator(t,e){if(t>=this.alignmentBounds.upper)return Y;e=Math.min(e,Number(this.distance(t,this.alignmentBounds.upper)));let n=0;for(let a=0;a<this.series.length;a++){const f=this.series[a];if(t<f.alignment)break;if(t>=f.alignmentBounds.upper)n+=f.length;else if(b.contains(f.alignmentBounds,t)){n+=Number(t-f.alignment);break}}return new F(this,n,n+e)}updateGLBuffer(t){this.series.forEach(e=>e.updateGLBuffer(t))}get bounds(){return b.max$1(this.series.map(t=>t.bounds))}get byteLength(){return new x(this.series.reduce((t,e)=>t+e.byteLength.valueOf(),0))}get data(){const t=new this.dataType.Array(this.length);let e=0;for(const n of this.series)t.set(n.data,e),e+=n.length;return new this.dataType.Array(t.buffer)}traverseAlignment(t,e){const n=this.series.map(a=>a.alignmentBounds);return b.traverse(n,t,e)}acquire(t){this.series.forEach(e=>e.acquire(t))}release(){this.series.forEach(t=>t.release())}distance(t,e){const n=this.series.map(a=>a.alignmentBounds);return b.distance(n,t,e)}parseJSON(t){if(!this.dataType.equals(O.JSON))throw new Error("cannot parse non-JSON series as JSON");return this.series.flatMap(e=>e.parseJSON(t))}[Symbol.iterator](){return this.series.length===0?{next(){return{done:!0,value:void 0}}}:new Zt(this.series)}}class Zt{constructor(t){i(this,"series");i(this,"seriesIndex");i(this,"internal");this.series=t,this.seriesIndex=0,this.internal=t[0][Symbol.iterator]()}next(){const t=this.internal.next();return t.done===!1?t:this.seriesIndex===this.series.length-1?{done:!0,value:void 0}:(this.internal=this.series[++this.seriesIndex][Symbol.iterator](),this.next())}[Symbol.iterator](){return this}}class F{constructor(t,e,n){i(this,"series");i(this,"index");i(this,"end");this.series=t,this.end=n,this.index=e}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}[Symbol.iterator](){return this}}const z=s=>{const t=s>>32n,e=s&0xffffffffn;return{domain:t,sample:e}};exports.DataType=O;exports.Density=I;exports.MultiSeries=Pt;exports.Rate=q;exports.Series=$;exports.Size=x;exports.TimeRange=A;exports.TimeSpan=m;exports.TimeStamp=g;exports.addSamples=L;exports.coerce=gt;exports.convertDataType=tt;exports.id=bt;exports.isCrudeSeries=it;exports.isTelemValue=J;exports.matcher=wt;exports.sortTimeRange=Tt;exports.typedArrayZ=Nt;exports.uuid=xt;
|