@synnaxlabs/x 0.41.0 → 0.42.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +23 -23
- package/dist/binary.cjs +1 -1
- package/dist/binary.js +2 -2
- package/dist/{bounds-M-SZ3X1Z.cjs → bounds-BQo7rvs9.cjs} +1 -1
- package/dist/{bounds-DQrjn60Q.js → bounds-Bn5_l4Z3.js} +10 -9
- package/dist/bounds.cjs +1 -1
- package/dist/bounds.js +1 -1
- package/dist/compare.cjs +1 -1
- package/dist/compare.js +1 -1
- package/dist/deep.cjs +1 -1
- package/dist/deep.js +84 -77
- package/dist/{dimensions-PWy5QZoM.cjs → dimensions-D2QGoNXO.cjs} +1 -1
- package/dist/dimensions.cjs +1 -1
- package/dist/{external-CvWr1nhS.cjs → external-DWQITF5_.cjs} +1 -1
- package/dist/index-BywOGO8U.js +1074 -0
- package/dist/index-CYYjI7Uf.cjs +1 -0
- package/dist/index-C_6NXBlg.cjs +3 -0
- package/dist/{index-BVC_8Cg9.js → index-QGplUHuy.js} +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +702 -243
- package/dist/record.js +3 -1
- package/dist/{scale-DL9VFGhL.cjs → scale-BtZINJ-A.cjs} +1 -1
- package/dist/{scale-DQwBWnwc.js → scale-DfJe9755.js} +1 -1
- package/dist/scale.cjs +1 -1
- package/dist/scale.js +1 -1
- package/dist/{series-D0zxMWxP.js → series-B9JERcqi.js} +571 -492
- package/dist/series-DqJ6f97G.cjs +11 -0
- package/dist/spatial.cjs +1 -1
- package/dist/spatial.js +2 -2
- package/dist/src/binary/{encoder.d.ts → codec.d.ts} +14 -8
- package/dist/src/binary/codec.d.ts.map +1 -0
- package/dist/src/binary/codec.spec.d.ts +2 -0
- package/dist/src/binary/codec.spec.d.ts.map +1 -0
- package/dist/src/binary/index.d.ts +1 -1
- package/dist/src/binary/index.d.ts.map +1 -1
- package/dist/src/breaker/breaker.d.ts +14 -21
- package/dist/src/breaker/breaker.d.ts.map +1 -1
- package/dist/src/change/change.d.ts +5 -18
- package/dist/src/change/change.d.ts.map +1 -1
- package/dist/src/color/color.d.ts +126 -0
- package/dist/src/color/color.d.ts.map +1 -0
- package/dist/src/color/color.spec.d.ts +2 -0
- package/dist/src/color/color.spec.d.ts.map +1 -0
- package/dist/src/color/external.d.ts +5 -0
- package/dist/src/color/external.d.ts.map +1 -0
- package/dist/src/color/gradient.d.ts +18 -0
- package/dist/src/color/gradient.d.ts.map +1 -0
- package/dist/src/color/index.d.ts +2 -0
- package/dist/src/color/index.d.ts.map +1 -0
- package/dist/src/color/palette.d.ts +19 -0
- package/dist/src/color/palette.d.ts.map +1 -0
- package/dist/src/color/transformColorsToHex.d.ts +6 -0
- package/dist/src/color/transformColorsToHex.d.ts.map +1 -0
- package/dist/src/control/control.d.ts +69 -74
- package/dist/src/control/control.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 +127 -7
- package/dist/src/errors/errors.d.ts.map +1 -1
- package/dist/src/errors/errors.spec.d.ts +2 -0
- package/dist/src/errors/errors.spec.d.ts.map +1 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/jsonrpc/jsonrpc.d.ts +10 -7
- package/dist/src/jsonrpc/jsonrpc.d.ts.map +1 -1
- package/dist/src/kv/types.d.ts +1 -7
- package/dist/src/kv/types.d.ts.map +1 -1
- package/dist/src/migrate/migrate.d.ts +1 -1
- package/dist/src/notation/notation.d.ts +5 -1
- package/dist/src/notation/notation.d.ts.map +1 -1
- package/dist/src/record.d.ts +2 -1
- package/dist/src/record.d.ts.map +1 -1
- package/dist/src/replace.d.ts +2 -0
- package/dist/src/replace.d.ts.map +1 -0
- package/dist/src/runtime/os.d.ts +9 -1
- package/dist/src/runtime/os.d.ts.map +1 -1
- package/dist/src/singleton/define.d.ts +9 -0
- package/dist/src/singleton/define.d.ts.map +1 -0
- package/dist/src/singleton/define.spec.d.ts +2 -0
- package/dist/src/singleton/define.spec.d.ts.map +1 -0
- package/dist/src/singleton/index.d.ts +2 -0
- package/dist/src/singleton/index.d.ts.map +1 -0
- package/dist/src/spatial/base.d.ts +74 -70
- package/dist/src/spatial/base.d.ts.map +1 -1
- package/dist/src/spatial/box/box.d.ts +18 -76
- package/dist/src/spatial/box/box.d.ts.map +1 -1
- package/dist/src/spatial/dimensions/dimensions.d.ts +5 -29
- package/dist/src/spatial/dimensions/dimensions.d.ts.map +1 -1
- package/dist/src/spatial/direction/direction.d.ts +9 -1
- package/dist/src/spatial/direction/direction.d.ts.map +1 -1
- package/dist/src/spatial/location/location.d.ts +43 -22
- package/dist/src/spatial/location/location.d.ts.map +1 -1
- package/dist/src/spatial/scale/scale.d.ts +12 -120
- package/dist/src/spatial/scale/scale.d.ts.map +1 -1
- package/dist/src/spatial/xy/xy.d.ts +5 -29
- package/dist/src/spatial/xy/xy.d.ts.map +1 -1
- package/dist/src/sync/index.d.ts +2 -0
- package/dist/src/sync/index.d.ts.map +1 -0
- package/dist/src/sync/mutex.d.ts +8 -0
- package/dist/src/sync/mutex.d.ts.map +1 -0
- package/dist/src/telem/gl.d.ts +4 -1
- package/dist/src/telem/gl.d.ts.map +1 -1
- package/dist/src/telem/series.d.ts +46 -125
- package/dist/src/telem/series.d.ts.map +1 -1
- package/dist/src/telem/telem.d.ts +101 -86
- package/dist/src/telem/telem.d.ts.map +1 -1
- package/dist/src/toArray.d.ts +1 -1
- package/dist/src/toArray.d.ts.map +1 -1
- package/dist/src/zod/util.d.ts.map +1 -1
- package/dist/telem.cjs +1 -1
- package/dist/telem.js +1 -1
- package/dist/toArray.cjs +1 -1
- package/dist/toArray.js +1 -1
- package/dist/zod.cjs +1 -1
- package/package.json +5 -2
- package/src/binary/codec.spec.ts +370 -0
- package/src/binary/{encoder.ts → codec.ts} +55 -11
- package/src/binary/index.ts +1 -1
- package/src/breaker/breaker.spec.ts +16 -25
- package/src/breaker/breaker.ts +36 -19
- package/src/color/color.spec.ts +673 -0
- package/src/color/color.ts +317 -0
- package/src/color/external.ts +13 -0
- package/src/color/gradient.ts +78 -0
- package/src/color/index.ts +10 -0
- package/src/color/palette.ts +28 -0
- package/src/color/transformColorsToHex.ts +30 -0
- package/src/control/control.ts +30 -22
- package/src/deep/merge.spec.ts +60 -0
- package/src/deep/merge.ts +13 -8
- package/src/errors/errors.spec.ts +152 -0
- package/src/errors/errors.ts +225 -10
- package/src/index.ts +4 -0
- package/src/jsonrpc/jsonrpc.ts +12 -8
- package/src/migrate/migrate.ts +2 -2
- package/src/primitive.ts +1 -1
- package/src/record.ts +5 -1
- package/src/replace.ts +1 -0
- package/src/singleton/define.spec.ts +93 -0
- package/src/singleton/define.ts +27 -0
- package/src/singleton/index.ts +10 -0
- package/src/sync/index.ts +1 -0
- package/src/sync/mutex.ts +16 -0
- package/src/telem/series.spec.ts +32 -0
- package/src/telem/series.ts +54 -19
- package/src/telem/telem.spec.ts +151 -10
- package/src/telem/telem.ts +126 -73
- package/src/toArray.ts +2 -2
- package/src/zod/util.spec.ts +17 -1
- package/src/zod/util.ts +4 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/index-BG3Scw3G.cjs +0 -1
- package/dist/index-C3QzbIwt.js +0 -101
- package/dist/index-CnclyYpG.cjs +0 -3
- package/dist/series-BMma2b5q.cjs +0 -11
- package/dist/src/binary/encoder.d.ts.map +0 -1
- package/dist/src/binary/encoder.spec.d.ts +0 -2
- package/dist/src/binary/encoder.spec.d.ts.map +0 -1
- package/src/binary/encoder.spec.ts +0 -174
package/dist/index.js
CHANGED
|
@@ -1,165 +1,437 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { J as
|
|
5
|
-
import {
|
|
6
|
-
import { z as
|
|
7
|
-
import { a as
|
|
8
|
-
import { c as
|
|
9
|
-
import { a as
|
|
10
|
-
import { c as
|
|
11
|
-
import { c as
|
|
12
|
-
import { i as
|
|
13
|
-
import { c as
|
|
14
|
-
import { debounce as
|
|
15
|
-
import { deep as
|
|
16
|
-
import { isObject as
|
|
17
|
-
import { e as
|
|
18
|
-
import { link as
|
|
19
|
-
import { s as
|
|
20
|
-
import { b as
|
|
21
|
-
import { observe as
|
|
22
|
-
import { getEntries as
|
|
23
|
-
import { e as
|
|
24
|
-
import { Search as
|
|
25
|
-
import { b as
|
|
26
|
-
import { d as
|
|
27
|
-
import { d as
|
|
28
|
-
import { l as
|
|
29
|
-
import { p as
|
|
30
|
-
import { s as
|
|
31
|
-
import { x as
|
|
32
|
-
import { nullToArr as
|
|
33
|
-
import { u as
|
|
34
|
-
import { URL as
|
|
35
|
-
import { RoutedWorker as
|
|
36
|
-
import { e as
|
|
37
|
-
const
|
|
1
|
+
var ue = Object.defineProperty;
|
|
2
|
+
var fe = (e, t, r) => t in e ? ue(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var m = (e, t, r) => fe(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { J as de } from "./index-BywOGO8U.js";
|
|
5
|
+
import { c as tr } from "./index-BywOGO8U.js";
|
|
6
|
+
import p, { z as c } from "zod";
|
|
7
|
+
import { a as y } from "./series-B9JERcqi.js";
|
|
8
|
+
import { c as nr, D as sr, M as or, R as ir, S as ar, d as cr, b as lr, T as ur, g as fr, f as dr, h as hr, i as mr, e as pr, s as gr, t as br } from "./series-B9JERcqi.js";
|
|
9
|
+
import { a as _r } from "./index-DizUWH6z.js";
|
|
10
|
+
import { c as vr } from "./change-DLl6DccR.js";
|
|
11
|
+
import { c as Sr, s as $r } from "./scale-DfJe9755.js";
|
|
12
|
+
import { i as he, a as me, b as pe, L as C, G as I, E as ge } from "./index-QGplUHuy.js";
|
|
13
|
+
import { c as Mr, d as Tr, p as jr } from "./index-QGplUHuy.js";
|
|
14
|
+
import { debounce as Or, throttle as Ar } from "./debounce.js";
|
|
15
|
+
import { deep as Ir } from "./deep.js";
|
|
16
|
+
import { isObject as Nr } from "./identity.js";
|
|
17
|
+
import { e as Rr } from "./external-DqPrWKvU.js";
|
|
18
|
+
import { link as qr } from "./link.js";
|
|
19
|
+
import { s as be, g as ye, h as _e, i as we, j as ve, k as xe, l as Se, n as $e, m as Ee, r as Me, o as Te } from "./bounds-Bn5_l4Z3.js";
|
|
20
|
+
import { b as Ur } from "./bounds-Bn5_l4Z3.js";
|
|
21
|
+
import { observe as Dr } from "./observe.js";
|
|
22
|
+
import { getEntries as Br, mapValues as Vr, unknownRecordZ as Hr } from "./record.js";
|
|
23
|
+
import { e as Yr } from "./external-BPgtxa8d.js";
|
|
24
|
+
import { Search as Qr } from "./search.js";
|
|
25
|
+
import { b as Xr } from "./box-Cc8IzcNo.js";
|
|
26
|
+
import { d as tn } from "./dimensions-CRgergMS.js";
|
|
27
|
+
import { d as nn } from "./direction-BL0PhD1k.js";
|
|
28
|
+
import { l as on } from "./location-C3aeu046.js";
|
|
29
|
+
import { p as cn } from "./position-DIglP1l2.js";
|
|
30
|
+
import { s as un } from "./spatial-BSWPzMkK.js";
|
|
31
|
+
import { x as dn } from "./xy-D_LqxaGt.js";
|
|
32
|
+
import { nullToArr as mn, toArray as pn } from "./toArray.js";
|
|
33
|
+
import { u as bn } from "./index-D4NCYiQB.js";
|
|
34
|
+
import { URL as _n, buildQueryString as wn } from "./url.js";
|
|
35
|
+
import { RoutedWorker as xn, TypedWorker as Sn, createMockWorkers as $n } from "./worker.js";
|
|
36
|
+
import { e as Mn } from "./external-C8TFju8Q.js";
|
|
37
|
+
const je = 2, ke = 3, Oe = 2, Ae = (e, t) => {
|
|
38
38
|
if (Number.isNaN(e) || !Number.isFinite(e)) return e;
|
|
39
|
-
const r =
|
|
39
|
+
const r = be(t);
|
|
40
40
|
if (r == 0) return e;
|
|
41
41
|
let n;
|
|
42
|
-
r >= 1e3 ? n =
|
|
42
|
+
r >= 1e3 ? n = je : r >= 1 ? n = ke : n = Math.ceil(-Math.log10(r)) + Oe;
|
|
43
43
|
const s = 10 ** n;
|
|
44
44
|
return Math.round(e * s) / s;
|
|
45
|
-
},
|
|
45
|
+
}, qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
46
46
|
__proto__: null,
|
|
47
|
-
abs:
|
|
48
|
-
add:
|
|
49
|
-
closeTo:
|
|
50
|
-
div:
|
|
51
|
-
equal:
|
|
52
|
-
max:
|
|
53
|
-
min:
|
|
54
|
-
mult:
|
|
55
|
-
roundBySpan:
|
|
56
|
-
roundToNearestMagnitude:
|
|
57
|
-
sub:
|
|
58
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
59
|
-
(t) => setTimeout(t,
|
|
60
|
-
),
|
|
61
|
-
interval: b.z.optional(),
|
|
62
|
-
maxRetries: l.number().optional(),
|
|
63
|
-
scale: l.number().optional()
|
|
64
|
-
}), K = (e = {}) => {
|
|
65
|
-
const t = e.sleepFn || H, r = e.maxRetries ?? 5, n = e.scale ?? 1;
|
|
66
|
-
let s = 0, i = new b(e.interval ?? b.milliseconds(1));
|
|
67
|
-
return async () => s >= r ? !1 : (await t(i), i = i.mult(n), s++, !0);
|
|
68
|
-
}, Se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
47
|
+
abs: ye,
|
|
48
|
+
add: _e,
|
|
49
|
+
closeTo: we,
|
|
50
|
+
div: ve,
|
|
51
|
+
equal: xe,
|
|
52
|
+
max: Se,
|
|
53
|
+
min: $e,
|
|
54
|
+
mult: Ee,
|
|
55
|
+
roundBySpan: Ae,
|
|
56
|
+
roundToNearestMagnitude: Me,
|
|
57
|
+
sub: Te
|
|
58
|
+
}, Symbol.toStringTag, { value: "Module" })), F = async (e) => await new Promise(
|
|
59
|
+
(t) => setTimeout(t, y.fromMilliseconds(e).milliseconds)
|
|
60
|
+
), Wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
69
61
|
__proto__: null,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
62
|
+
sleep: F
|
|
63
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
64
|
+
class Ce {
|
|
65
|
+
constructor(t) {
|
|
66
|
+
m(this, "config");
|
|
67
|
+
m(this, "retries");
|
|
68
|
+
m(this, "interval");
|
|
69
|
+
this.config = {
|
|
70
|
+
baseInterval: new y((t == null ? void 0 : t.baseInterval) ?? y.seconds(1)),
|
|
71
|
+
maxRetries: (t == null ? void 0 : t.maxRetries) ?? 5,
|
|
72
|
+
scale: (t == null ? void 0 : t.scale) ?? 1,
|
|
73
|
+
sleepFn: (t == null ? void 0 : t.sleepFn) ?? F
|
|
74
|
+
}, this.retries = 0, this.interval = new y(this.config.baseInterval);
|
|
75
|
+
}
|
|
76
|
+
async wait() {
|
|
77
|
+
const { maxRetries: t, scale: r, sleepFn: n } = this.config;
|
|
78
|
+
return this.retries >= t ? !1 : (await n(this.interval), this.interval = this.interval.mult(r), this.retries++, !0);
|
|
79
|
+
}
|
|
80
|
+
reset() {
|
|
81
|
+
this.retries = 0, this.interval = this.config.baseInterval;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const Ie = c.object({
|
|
85
|
+
baseInterval: y.z.optional(),
|
|
86
|
+
maxRetries: c.number().optional(),
|
|
87
|
+
scale: c.number().optional()
|
|
88
|
+
}), Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
89
|
+
__proto__: null,
|
|
90
|
+
Breaker: Ce,
|
|
91
|
+
breakerConfig: Ie
|
|
92
|
+
}, Symbol.toStringTag, { value: "Module" })), Le = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, q = c.string().regex(Le), b = c.number().min(0).max(255), Ne = c.number().min(0).max(1), W = c.tuple([b, b, b, Ne]), B = c.tuple([b, b, b]), Pe = (e) => $.safeParse(e).success, Re = (e) => W.safeParse(e).success, Ze = (e) => {
|
|
93
|
+
if (e == null) return;
|
|
94
|
+
const t = $.safeParse(e);
|
|
95
|
+
if (t.success) return J(t.data);
|
|
96
|
+
if (typeof e == "string") return e;
|
|
97
|
+
throw t.error;
|
|
98
|
+
}, d = (e, t = 1) => {
|
|
99
|
+
if (typeof e == "string") return He(e, t);
|
|
100
|
+
if (Array.isArray(e)) {
|
|
101
|
+
if (e.length < 3 || e.length > 4)
|
|
102
|
+
throw new Error(`Invalid color: [${e.join(", ")}]`);
|
|
103
|
+
return e.length === 3 ? [...e, t] : e;
|
|
104
|
+
}
|
|
105
|
+
throw new Error(`Invalid color: ${JSON.stringify(e)}`);
|
|
106
|
+
}, V = (e, t) => {
|
|
107
|
+
if (e == null || t == null) return !1;
|
|
108
|
+
const r = d(e), n = d(t);
|
|
109
|
+
return r.every((s, o) => s === n[o]);
|
|
110
|
+
}, H = (e) => {
|
|
111
|
+
if (e == null) return;
|
|
112
|
+
const [t, r, n, s] = d(e);
|
|
113
|
+
return `#${M(t)}${M(r)}${M(n)}${s === 1 ? "" : M(s * 255)}`;
|
|
114
|
+
}, J = (e) => {
|
|
115
|
+
const [t, r, n, s] = d(e);
|
|
116
|
+
return `rgba(${t}, ${r}, ${n}, ${s})`;
|
|
117
|
+
}, qe = (e) => `rgb(${Y(e)})`, Y = (e) => {
|
|
118
|
+
const [t, r, n] = d(e);
|
|
119
|
+
return `${t}, ${r}, ${n}`;
|
|
120
|
+
}, We = (e) => [...U(e), x(e)], U = (e) => [
|
|
121
|
+
_(e) / 255,
|
|
122
|
+
w(e) / 255,
|
|
123
|
+
v(e) / 255
|
|
124
|
+
], _ = (e) => d(e)[0], w = (e) => d(e)[1], v = (e) => d(e)[2], x = (e) => d(e)[3], Ue = (e) => V(z, e), ze = (e) => Ge(d(e)), De = (e, t) => {
|
|
125
|
+
const [r, n, s] = d(e);
|
|
126
|
+
if (t > 100)
|
|
127
|
+
throw new Error(`Color opacity must be between 0 and 100, got ${t}`);
|
|
128
|
+
return t > 1 && (t /= 100), [r, n, s, t];
|
|
129
|
+
}, j = (e) => {
|
|
130
|
+
const [t, r, n] = U(e).map(
|
|
131
|
+
(s) => s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4
|
|
132
|
+
);
|
|
133
|
+
return Number((0.2126 * t + 0.7152 * r + 0.0722 * n).toFixed(3));
|
|
134
|
+
}, Fe = (e) => {
|
|
135
|
+
const [t, r, n] = U(e);
|
|
136
|
+
return 1 - (Math.max(t, r, n) - Math.min(t, r, n));
|
|
137
|
+
}, N = (e, t) => {
|
|
138
|
+
const r = d(e), n = d(t), s = j(r), o = j(n);
|
|
139
|
+
return (Math.max(s, o) + 0.5) / (Math.min(s, o) + 0.5);
|
|
140
|
+
}, Be = (e, ...t) => {
|
|
141
|
+
if (t.length === 0)
|
|
142
|
+
throw new Error("[Color.pickByContrast] - must provide at least one color");
|
|
143
|
+
const r = d(e), [n] = t.map((s) => d(s)).sort((s, o) => N(r, o) - N(r, s));
|
|
144
|
+
return n;
|
|
145
|
+
}, G = (e) => j(e) < 0.5, Ve = (e) => !G(e), $ = c.union([q, W, B]).transform((e) => d(e)), He = (e, t = 1) => {
|
|
146
|
+
if (!q.safeParse(e).success) throw new Error(`Invalid hex color: ${e}`);
|
|
147
|
+
return e = Je(e), [
|
|
148
|
+
T(e, 0),
|
|
149
|
+
T(e, 2),
|
|
150
|
+
T(e, 4),
|
|
151
|
+
e.length === 8 ? T(e, 6) / 255 : t
|
|
152
|
+
];
|
|
153
|
+
}, z = [0, 0, 0, 0], M = (e) => Math.floor(e).toString(16).padStart(2, "0"), T = (e, t) => parseInt(e.slice(t, t + 2), 16), Je = (e) => e.startsWith("#") ? e.slice(1) : e, Ye = (e) => {
|
|
154
|
+
let [t, r, n] = e;
|
|
155
|
+
const s = e[3];
|
|
156
|
+
t /= 360, r /= 100, n /= 100;
|
|
157
|
+
let o, a, f;
|
|
158
|
+
if (r === 0)
|
|
159
|
+
o = a = f = n;
|
|
160
|
+
else {
|
|
161
|
+
const l = n < 0.5 ? n * (1 + r) : n + r - n * r, i = 2 * n - l;
|
|
162
|
+
o = L(i, l, t + 1 / 3), a = L(i, l, t), f = L(i, l, t - 1 / 3);
|
|
163
|
+
}
|
|
164
|
+
return [Math.round(o * 255), Math.round(a * 255), Math.round(f * 255), s];
|
|
165
|
+
}, L = (e, t, r) => (r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? e + (t - e) * 6 * r : r < 1 / 2 ? t : r < 2 / 3 ? e + (t - e) * (2 / 3 - r) * 6 : e), Ge = (e) => {
|
|
166
|
+
let [t, r, n] = e;
|
|
167
|
+
const s = e[3];
|
|
168
|
+
t /= 255, r /= 255, n /= 255;
|
|
169
|
+
const o = Math.max(t, r, n), a = Math.min(t, r, n);
|
|
170
|
+
let f, l, i = (o + a) / 2;
|
|
171
|
+
if (o === a)
|
|
172
|
+
f = l = 0;
|
|
173
|
+
else {
|
|
174
|
+
const u = o - a;
|
|
175
|
+
l = i > 0.5 ? u / (2 - o - a) : u / (o + a), o === t ? f = (r - n) / u + (r < n ? 6 : 0) : o === r ? f = (n - t) / u + 2 : f = (t - r) / u + 4, f /= 6;
|
|
176
|
+
}
|
|
177
|
+
return f *= 360, l *= 100, i *= 100, [Math.round(f), Math.round(l), Math.round(i), s];
|
|
178
|
+
}, Q = c.union([q, W, c.string(), B]), Qe = d("#000000"), Ke = d("#ffffff"), K = c.object({
|
|
179
|
+
key: c.string(),
|
|
180
|
+
color: Q,
|
|
181
|
+
position: c.number(),
|
|
182
|
+
switched: c.boolean().optional()
|
|
183
|
+
}), Xe = c.array(K), et = (e, t) => {
|
|
184
|
+
if (e.length === 0) return z;
|
|
185
|
+
if (e = e.slice().sort((r, n) => r.position - n.position), t <= e[0].position) return d(e[0].color);
|
|
186
|
+
if (t >= e[e.length - 1].position)
|
|
187
|
+
return d(e[e.length - 1].color);
|
|
188
|
+
for (let r = 0; r < e.length - 1; r++) {
|
|
189
|
+
const n = e[r], s = e[r + 1];
|
|
190
|
+
if (t >= n.position && t <= s.position) {
|
|
191
|
+
if (t === n.position) return d(n.color);
|
|
192
|
+
if (t === s.position) return d(s.color);
|
|
193
|
+
const o = (t - n.position) / (s.position - n.position), a = d(n.color), f = d(s.color), l = Math.round(
|
|
194
|
+
_(a) + o * (_(f) - _(a))
|
|
195
|
+
), i = Math.round(
|
|
196
|
+
w(a) + o * (w(f) - w(a))
|
|
197
|
+
), u = Math.round(
|
|
198
|
+
v(a) + o * (v(f) - v(a))
|
|
199
|
+
), h = x(a) + o * (x(f) - x(a));
|
|
200
|
+
return d([l, i, u, h]);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return d(e[e.length - 1].color);
|
|
204
|
+
}, tt = c.object({
|
|
205
|
+
key: c.string(),
|
|
206
|
+
name: c.string(),
|
|
207
|
+
color: $
|
|
208
|
+
}), rt = c.object({
|
|
209
|
+
key: c.string(),
|
|
210
|
+
name: c.string(),
|
|
211
|
+
swatches: c.array(tt)
|
|
212
|
+
}), X = (e) => {
|
|
213
|
+
const t = $.safeParse(e);
|
|
214
|
+
if (t.success) return H(t.data);
|
|
215
|
+
if (typeof e == "object" && e != null) {
|
|
216
|
+
const r = Array.isArray(e) ? [] : {};
|
|
217
|
+
for (const n of Object.keys(e))
|
|
218
|
+
r[n] = X(e[n]);
|
|
219
|
+
return r;
|
|
220
|
+
}
|
|
221
|
+
return e;
|
|
222
|
+
}, zt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
223
|
+
__proto__: null,
|
|
224
|
+
BLACK: Qe,
|
|
225
|
+
WHITE: Ke,
|
|
226
|
+
ZERO: z,
|
|
227
|
+
aValue: x,
|
|
228
|
+
bValue: v,
|
|
229
|
+
colorZ: $,
|
|
230
|
+
construct: d,
|
|
231
|
+
contrast: N,
|
|
232
|
+
crudeZ: Q,
|
|
233
|
+
cssString: Ze,
|
|
234
|
+
equals: V,
|
|
235
|
+
fromGradient: et,
|
|
236
|
+
fromHSLA: Ye,
|
|
237
|
+
gValue: w,
|
|
238
|
+
gradientZ: Xe,
|
|
239
|
+
grayness: Fe,
|
|
240
|
+
hex: H,
|
|
241
|
+
hsla: ze,
|
|
242
|
+
isColor: Re,
|
|
243
|
+
isCrude: Pe,
|
|
244
|
+
isDark: G,
|
|
245
|
+
isLight: Ve,
|
|
246
|
+
isZero: Ue,
|
|
247
|
+
luminance: j,
|
|
248
|
+
paletteZ: rt,
|
|
249
|
+
pickByContrast: Be,
|
|
250
|
+
rValue: _,
|
|
251
|
+
rgbCSS: qe,
|
|
252
|
+
rgbString: Y,
|
|
253
|
+
rgba1: We,
|
|
254
|
+
rgbaCSS: J,
|
|
255
|
+
setAlpha: De,
|
|
256
|
+
stopZ: K,
|
|
257
|
+
transformColorsToHex: X
|
|
258
|
+
}, Symbol.toStringTag, { value: "Module" })), ee = c.number().int().min(0).max(255), te = 255, re = 0, nt = {
|
|
259
|
+
lower: re,
|
|
260
|
+
upper: te + 1
|
|
261
|
+
}, ne = c.object({
|
|
262
|
+
name: c.string(),
|
|
263
|
+
key: c.string()
|
|
264
|
+
}), S = (e) => c.object({
|
|
265
|
+
subject: ne,
|
|
89
266
|
resource: e,
|
|
90
|
-
authority:
|
|
91
|
-
}),
|
|
267
|
+
authority: ee
|
|
268
|
+
}), st = (...e) => (t) => t.filter((r) => {
|
|
92
269
|
let n = !1;
|
|
93
270
|
return r.to != null && (n = e.includes(r.to.resource)), r.from != null && !n && (n = e.includes(r.from.resource)), n;
|
|
94
|
-
}),
|
|
271
|
+
}), se = c.object({
|
|
272
|
+
from: S(c.any()),
|
|
273
|
+
to: c.null()
|
|
274
|
+
}), oe = c.object({
|
|
275
|
+
from: c.null(),
|
|
276
|
+
to: S(c.any())
|
|
277
|
+
}), ot = c.union([
|
|
278
|
+
se,
|
|
279
|
+
oe,
|
|
280
|
+
c.object({
|
|
281
|
+
from: S(c.any()),
|
|
282
|
+
to: S(c.any())
|
|
283
|
+
})
|
|
284
|
+
]), Dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
95
285
|
__proto__: null,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
286
|
+
ABSOLUTE_AUTHORITY: te,
|
|
287
|
+
AUTHORITY_BOUNDS: nt,
|
|
288
|
+
ZERO_AUTHORITY: re,
|
|
289
|
+
acquireZ: oe,
|
|
290
|
+
authorityZ: ee,
|
|
291
|
+
filterTransfersByChannelKey: st,
|
|
292
|
+
releaseZ: se,
|
|
293
|
+
stateZ: S,
|
|
294
|
+
subjectZ: ne,
|
|
295
|
+
transferZ: ot
|
|
296
|
+
}, Symbol.toStringTag, { value: "Module" })), it = (e) => Object.getOwnPropertySymbols(globalThis).includes(e), at = (e, t) => {
|
|
297
|
+
const r = Symbol.for(e);
|
|
298
|
+
if (!it(r)) {
|
|
299
|
+
const n = t();
|
|
300
|
+
Object.defineProperty(globalThis, r, { value: n });
|
|
301
|
+
}
|
|
302
|
+
return () => globalThis[r];
|
|
303
|
+
}, ct = (e) => (t) => t != null && typeof t == "object" && "type" in t && typeof t.type == "string" ? t.type.startsWith(e) : t instanceof Error ? t.message.startsWith(e) : typeof t != "string" ? !1 : t.startsWith(e), k = (e) => {
|
|
304
|
+
var t;
|
|
305
|
+
return t = class extends Error {
|
|
306
|
+
constructor(s, o) {
|
|
307
|
+
super(s, o);
|
|
308
|
+
m(this, "discriminator", t.discriminator);
|
|
309
|
+
m(this, "type", t.TYPE);
|
|
310
|
+
m(this, "matches", t.matches);
|
|
311
|
+
this.name = t.TYPE;
|
|
312
|
+
}
|
|
313
|
+
static sub(s) {
|
|
314
|
+
return k(`${e}.${s}`);
|
|
315
|
+
}
|
|
316
|
+
}, m(t, "discriminator", "FreighterError"), m(t, "TYPE", e), m(t, "matches", ct(e)), t;
|
|
317
|
+
}, ie = (e) => {
|
|
318
|
+
if (e == null || typeof e != "object") return !1;
|
|
319
|
+
const t = e;
|
|
320
|
+
if (t.discriminator !== "FreighterError") return !1;
|
|
321
|
+
if (!("type" in t))
|
|
322
|
+
throw new Error(
|
|
323
|
+
`Freighter error is missing its type property: ${JSON.stringify(t)}`
|
|
324
|
+
);
|
|
325
|
+
return !0;
|
|
326
|
+
}, g = "unknown", P = "nil";
|
|
327
|
+
class lt {
|
|
101
328
|
constructor() {
|
|
102
|
-
|
|
329
|
+
m(this, "providers", []);
|
|
103
330
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
return typeof t == "string" ? t.includes(d.MESSAGE) : t instanceof d || t.message.includes(d.MESSAGE);
|
|
331
|
+
register(t) {
|
|
332
|
+
this.providers.push(t);
|
|
107
333
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
334
|
+
encode(t) {
|
|
335
|
+
if (t == null) return { type: P, data: "" };
|
|
336
|
+
if (ie(t))
|
|
337
|
+
for (const r of this.providers) {
|
|
338
|
+
const n = r.encode(t);
|
|
339
|
+
if (n != null) return n;
|
|
340
|
+
}
|
|
341
|
+
if (t instanceof Error) return { type: g, data: t.message };
|
|
342
|
+
if (typeof t == "string") return { type: g, data: t };
|
|
343
|
+
try {
|
|
344
|
+
return { type: g, data: JSON.stringify(t) };
|
|
345
|
+
} catch {
|
|
346
|
+
return { type: g, data: "unable to encode error information" };
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
decode(t) {
|
|
350
|
+
if (t == null || t.type === P) return null;
|
|
351
|
+
if (t.type === g) return new R(t.data);
|
|
352
|
+
for (const r of this.providers) {
|
|
353
|
+
const n = r.decode(t);
|
|
354
|
+
if (n != null) return n;
|
|
355
|
+
}
|
|
356
|
+
return new R(t.data);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
const D = at("synnax-error-registry", () => new lt()), ut = ({
|
|
360
|
+
encode: e,
|
|
361
|
+
decode: t
|
|
362
|
+
}) => D().register({ encode: e, decode: t }), ft = (e) => D().encode(e), dt = (e) => e == null ? null : D().decode(e);
|
|
363
|
+
class R extends k("unknown") {
|
|
364
|
+
}
|
|
365
|
+
const ht = c.object({ type: c.string(), data: c.string() });
|
|
366
|
+
class mt extends k("canceled") {
|
|
367
|
+
}
|
|
368
|
+
const Ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
112
369
|
__proto__: null,
|
|
113
|
-
|
|
114
|
-
|
|
370
|
+
Canceled: mt,
|
|
371
|
+
NONE: P,
|
|
372
|
+
UNKNOWN: g,
|
|
373
|
+
Unknown: R,
|
|
374
|
+
createTyped: k,
|
|
375
|
+
decode: dt,
|
|
376
|
+
encode: ft,
|
|
377
|
+
isTyped: ie,
|
|
378
|
+
payloadZ: ht,
|
|
379
|
+
register: ut
|
|
380
|
+
}, Symbol.toStringTag, { value: "Module" })), Bt = (e) => e ? -1 : 1, pt = p.object({
|
|
381
|
+
jsonrpc: p.string(),
|
|
382
|
+
id: p.number().optional(),
|
|
383
|
+
method: p.string().optional(),
|
|
384
|
+
params: p.unknown().optional(),
|
|
385
|
+
result: p.unknown().optional()
|
|
386
|
+
}), gt = (e) => {
|
|
115
387
|
const t = new TextDecoder();
|
|
116
388
|
let r = new Uint8Array(0), n = null;
|
|
117
389
|
return (s) => {
|
|
118
|
-
let
|
|
119
|
-
typeof s == "string" ?
|
|
120
|
-
const
|
|
121
|
-
for (
|
|
390
|
+
let o;
|
|
391
|
+
typeof s == "string" ? o = new TextEncoder().encode(s) : s instanceof ArrayBuffer ? o = new Uint8Array(s) : o = s;
|
|
392
|
+
const a = new Uint8Array(r.length + o.length);
|
|
393
|
+
for (a.set(r), a.set(o, r.length), r = a; r.length > 0; ) {
|
|
122
394
|
if (n === null) {
|
|
123
|
-
const
|
|
124
|
-
if (!
|
|
125
|
-
n = parseInt(
|
|
126
|
-
const
|
|
127
|
-
r = r.slice(
|
|
395
|
+
const l = t.decode(r).match(/^Content-Length: (\d+)\r?\n\r?\n/);
|
|
396
|
+
if (!l) break;
|
|
397
|
+
n = parseInt(l[1]);
|
|
398
|
+
const i = new TextEncoder().encode(l[0]).length;
|
|
399
|
+
r = r.slice(i);
|
|
128
400
|
}
|
|
129
401
|
if (n !== null && r.length >= n) {
|
|
130
|
-
const
|
|
402
|
+
const f = r.slice(0, n);
|
|
131
403
|
r = r.slice(n), n = null;
|
|
132
|
-
const
|
|
133
|
-
e(
|
|
404
|
+
const l = t.decode(f), i = de.decodeString(l, pt);
|
|
405
|
+
e(i);
|
|
134
406
|
} else break;
|
|
135
407
|
}
|
|
136
408
|
};
|
|
137
|
-
},
|
|
409
|
+
}, bt = (e) => {
|
|
138
410
|
const t = JSON.stringify(e);
|
|
139
411
|
return `Content-Length: ${new TextEncoder().encode(t).length}\r
|
|
140
412
|
\r
|
|
141
413
|
` + t;
|
|
142
|
-
},
|
|
414
|
+
}, Vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
143
415
|
__proto__: null,
|
|
144
|
-
encodeMessage:
|
|
145
|
-
streamDecodeChunks:
|
|
146
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
416
|
+
encodeMessage: bt,
|
|
417
|
+
streamDecodeChunks: gt
|
|
418
|
+
}, Symbol.toStringTag, { value: "Module" })), Z = c.string().regex(/^\d+\.\d+\.\d+$/), E = (e, t, r = {}) => {
|
|
147
419
|
r.checkMajor ?? (r.checkMajor = !0), r.checkMinor ?? (r.checkMinor = !0), r.checkPatch ?? (r.checkPatch = !0);
|
|
148
|
-
const n =
|
|
420
|
+
const n = Z.parse(e), s = Z.parse(t), [o, a, f] = n.split(".").map(Number), [l, i, u] = s.split(".").map(Number);
|
|
149
421
|
if (r.checkMajor) {
|
|
150
|
-
if (
|
|
151
|
-
if (
|
|
422
|
+
if (o < l) return C;
|
|
423
|
+
if (o > l) return I;
|
|
152
424
|
}
|
|
153
425
|
if (r.checkMinor) {
|
|
154
|
-
if (
|
|
155
|
-
if (
|
|
426
|
+
if (a < i) return C;
|
|
427
|
+
if (a > i) return I;
|
|
156
428
|
}
|
|
157
429
|
if (r.checkPatch) {
|
|
158
|
-
if (
|
|
159
|
-
if (
|
|
430
|
+
if (f < u) return C;
|
|
431
|
+
if (f > u) return I;
|
|
160
432
|
}
|
|
161
|
-
return
|
|
162
|
-
},
|
|
433
|
+
return ge;
|
|
434
|
+
}, yt = (e, t, r = {}) => he(E(e, t, r)), ae = (e, t, r = {}) => me(E(e, t, r)), _t = (e, t, r = {}) => pe(E(e, t, r)), wt = ({
|
|
163
435
|
name: e,
|
|
164
436
|
migrate: t
|
|
165
437
|
}) => (r) => {
|
|
@@ -169,68 +441,68 @@ const ee = new E(), ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
169
441
|
} catch (n) {
|
|
170
442
|
throw console.log(`${e} failed to migrate from ${r.version}`), console.error(n), n;
|
|
171
443
|
}
|
|
172
|
-
},
|
|
444
|
+
}, vt = ({
|
|
173
445
|
name: e,
|
|
174
446
|
migrations: t,
|
|
175
447
|
targetSchema: r,
|
|
176
448
|
defaultVersion: n,
|
|
177
449
|
def: s
|
|
178
450
|
}) => {
|
|
179
|
-
const
|
|
180
|
-
if (
|
|
181
|
-
return (
|
|
182
|
-
if (
|
|
451
|
+
const o = Object.keys(t).sort(E).pop();
|
|
452
|
+
if (o == null)
|
|
453
|
+
return (i) => {
|
|
454
|
+
if (i.version ?? (i.version = n), i.version !== s.version)
|
|
183
455
|
return console.log(
|
|
184
|
-
`${e} version ${
|
|
456
|
+
`${e} version ${i.version} is newer than latest version of ${s.version}.
|
|
185
457
|
Returning default instead.
|
|
186
458
|
`
|
|
187
459
|
), s;
|
|
188
460
|
try {
|
|
189
|
-
return r != null ? r.parse(
|
|
190
|
-
} catch (
|
|
191
|
-
return console.log(`${e} failed to parse default. Exiting with default`), console.error(
|
|
461
|
+
return r != null ? r.parse(i) : i;
|
|
462
|
+
} catch (u) {
|
|
463
|
+
return console.log(`${e} failed to parse default. Exiting with default`), console.error(u), s;
|
|
192
464
|
}
|
|
193
465
|
};
|
|
194
|
-
const
|
|
195
|
-
let
|
|
196
|
-
const
|
|
466
|
+
const a = Object.keys(t).length;
|
|
467
|
+
let f = !1;
|
|
468
|
+
const l = (i) => {
|
|
197
469
|
try {
|
|
198
|
-
if (
|
|
199
|
-
return console.log(
|
|
200
|
-
const
|
|
201
|
-
return
|
|
202
|
-
} catch (
|
|
470
|
+
if (a === 0 || ae(i.version, o))
|
|
471
|
+
return console.log(f ? `${e} ${i.version} now up to date` : `${e} version ${i.version} is up to date with target version ${s.version}`), i;
|
|
472
|
+
const u = i.version, h = t[u], A = h(i);
|
|
473
|
+
return f = !0, l(A);
|
|
474
|
+
} catch (u) {
|
|
203
475
|
return console.log(
|
|
204
|
-
`${e} failed to migrate from ${
|
|
205
|
-
), console.error(
|
|
476
|
+
`${e} failed to migrate from ${i.version} to ${o}`
|
|
477
|
+
), console.error(u), s;
|
|
206
478
|
}
|
|
207
479
|
};
|
|
208
|
-
return (
|
|
480
|
+
return (i) => {
|
|
209
481
|
try {
|
|
210
|
-
if (
|
|
482
|
+
if (i.version == null)
|
|
211
483
|
if (n != null)
|
|
212
484
|
console.log(
|
|
213
485
|
`${e} version is null. Setting version to default of ${n}`
|
|
214
|
-
),
|
|
486
|
+
), i.version = n;
|
|
215
487
|
else
|
|
216
488
|
return console.log(
|
|
217
489
|
`${e} version is null and no default version set. Exiting with default`
|
|
218
490
|
), s;
|
|
219
|
-
return
|
|
220
|
-
} catch (
|
|
221
|
-
return console.log(`${e} failed to parse final result. Exiting with default`), console.error(
|
|
491
|
+
return l(i);
|
|
492
|
+
} catch (u) {
|
|
493
|
+
return console.log(`${e} failed to parse final result. Exiting with default`), console.error(u), s;
|
|
222
494
|
}
|
|
223
495
|
};
|
|
224
|
-
},
|
|
496
|
+
}, Ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
225
497
|
__proto__: null,
|
|
226
|
-
compareSemVer:
|
|
227
|
-
createMigration:
|
|
228
|
-
migrator:
|
|
229
|
-
semVerNewer:
|
|
230
|
-
semVerOlder:
|
|
231
|
-
semVerZ:
|
|
232
|
-
versionsEqual:
|
|
233
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
498
|
+
compareSemVer: E,
|
|
499
|
+
createMigration: wt,
|
|
500
|
+
migrator: vt,
|
|
501
|
+
semVerNewer: ae,
|
|
502
|
+
semVerOlder: _t,
|
|
503
|
+
semVerZ: Z,
|
|
504
|
+
versionsEqual: yt
|
|
505
|
+
}, Symbol.toStringTag, { value: "Module" })), ce = ["standard", "scientific", "engineering"], xt = c.enum(ce), St = (e, t, r) => {
|
|
234
506
|
if (Number.isNaN(e)) return "NaN";
|
|
235
507
|
if (e === 1 / 0) return "∞";
|
|
236
508
|
if (e === -1 / 0) return "-∞";
|
|
@@ -239,105 +511,292 @@ const ee = new E(), ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
239
511
|
return t === 0 ? "0ᴇ0" : `0.${"0".repeat(t)}ᴇ0`;
|
|
240
512
|
let n;
|
|
241
513
|
return r === "scientific" ? n = Math.floor(Math.log10(Math.abs(e))) : n = Math.floor(Math.log10(Math.abs(e)) / 3) * 3, `${(e / 10 ** n).toFixed(t)}ᴇ${n}`;
|
|
242
|
-
},
|
|
514
|
+
}, Jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
243
515
|
__proto__: null,
|
|
244
|
-
NOTATIONS:
|
|
245
|
-
notationZ:
|
|
246
|
-
stringifyNumber:
|
|
247
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
516
|
+
NOTATIONS: ce,
|
|
517
|
+
notationZ: xt,
|
|
518
|
+
stringifyNumber: St
|
|
519
|
+
}, Symbol.toStringTag, { value: "Module" })), Yt = (e) => {
|
|
248
520
|
if (e === void 0 || typeof e == "string" || typeof e == "number")
|
|
249
521
|
return e;
|
|
250
522
|
if (e.toString === void 0) throw new Error("invalid renderer");
|
|
251
523
|
return e.toString();
|
|
252
|
-
},
|
|
524
|
+
}, Gt = (e) => Array.isArray(e) ? [...e] : typeof e == "object" && e !== null ? { ...e } : e, $t = (e, t = "") => {
|
|
253
525
|
const r = e.length;
|
|
254
526
|
return r === 0 ? t : r === 1 ? e[0] : r === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")}, and ${e[r - 1]}`;
|
|
255
|
-
},
|
|
256
|
-
const t = e.split(" "), r = /* @__PURE__ */ new Set(), n = t.map((
|
|
527
|
+
}, Et = (e) => {
|
|
528
|
+
const t = e.split(" "), r = /* @__PURE__ */ new Set(), n = t.map((l) => l.charAt(0).toLowerCase()).join("");
|
|
257
529
|
r.add(n.replace(/-/g, "_")), r.add(n.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_"));
|
|
258
530
|
const s = /\d+/g;
|
|
259
|
-
e.match(s) && t.forEach((
|
|
260
|
-
if (s.test(
|
|
261
|
-
const
|
|
262
|
-
r.add(
|
|
263
|
-
|
|
531
|
+
e.match(s) && t.forEach((l, i) => {
|
|
532
|
+
if (s.test(l)) {
|
|
533
|
+
const u = t.map((h, A) => A !== i ? h.charAt(0).toLowerCase() : h).join("");
|
|
534
|
+
r.add(u.replace(/-/g, "_")), r.add(
|
|
535
|
+
u.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_")
|
|
264
536
|
);
|
|
265
537
|
}
|
|
266
538
|
});
|
|
267
|
-
const
|
|
268
|
-
(
|
|
539
|
+
const a = t.map(
|
|
540
|
+
(l) => (l.length > 3 ? l.substring(0, 3) : l).toLowerCase()
|
|
269
541
|
);
|
|
270
|
-
return r.add(
|
|
271
|
-
(
|
|
542
|
+
return r.add(a.join("").replace(/-/g, "_")), r.add(a.join("_").replace(/-/g, "_")), Array.from(r).filter(
|
|
543
|
+
(l) => l.length >= 2 && l.length <= 12 && !/^\d/.test(l)
|
|
272
544
|
);
|
|
273
|
-
},
|
|
545
|
+
}, Qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
546
|
+
__proto__: null,
|
|
547
|
+
createShortIdentifiers: Et,
|
|
548
|
+
naturalLanguageJoin: $t
|
|
549
|
+
}, Symbol.toStringTag, { value: "Module" })), Mt = new Error("request for lock canceled");
|
|
550
|
+
var Tt = function(e, t, r, n) {
|
|
551
|
+
function s(o) {
|
|
552
|
+
return o instanceof r ? o : new r(function(a) {
|
|
553
|
+
a(o);
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
return new (r || (r = Promise))(function(o, a) {
|
|
557
|
+
function f(u) {
|
|
558
|
+
try {
|
|
559
|
+
i(n.next(u));
|
|
560
|
+
} catch (h) {
|
|
561
|
+
a(h);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
function l(u) {
|
|
565
|
+
try {
|
|
566
|
+
i(n.throw(u));
|
|
567
|
+
} catch (h) {
|
|
568
|
+
a(h);
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
function i(u) {
|
|
572
|
+
u.done ? o(u.value) : s(u.value).then(f, l);
|
|
573
|
+
}
|
|
574
|
+
i((n = n.apply(e, t || [])).next());
|
|
575
|
+
});
|
|
576
|
+
};
|
|
577
|
+
class jt {
|
|
578
|
+
constructor(t, r = Mt) {
|
|
579
|
+
this._value = t, this._cancelError = r, this._queue = [], this._weightedWaiters = [];
|
|
580
|
+
}
|
|
581
|
+
acquire(t = 1, r = 0) {
|
|
582
|
+
if (t <= 0)
|
|
583
|
+
throw new Error(`invalid weight ${t}: must be positive`);
|
|
584
|
+
return new Promise((n, s) => {
|
|
585
|
+
const o = { resolve: n, reject: s, weight: t, priority: r }, a = le(this._queue, (f) => r <= f.priority);
|
|
586
|
+
a === -1 && t <= this._value ? this._dispatchItem(o) : this._queue.splice(a + 1, 0, o);
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
runExclusive(t) {
|
|
590
|
+
return Tt(this, arguments, void 0, function* (r, n = 1, s = 0) {
|
|
591
|
+
const [o, a] = yield this.acquire(n, s);
|
|
592
|
+
try {
|
|
593
|
+
return yield r(o);
|
|
594
|
+
} finally {
|
|
595
|
+
a();
|
|
596
|
+
}
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
waitForUnlock(t = 1, r = 0) {
|
|
600
|
+
if (t <= 0)
|
|
601
|
+
throw new Error(`invalid weight ${t}: must be positive`);
|
|
602
|
+
return this._couldLockImmediately(t, r) ? Promise.resolve() : new Promise((n) => {
|
|
603
|
+
this._weightedWaiters[t - 1] || (this._weightedWaiters[t - 1] = []), kt(this._weightedWaiters[t - 1], { resolve: n, priority: r });
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
isLocked() {
|
|
607
|
+
return this._value <= 0;
|
|
608
|
+
}
|
|
609
|
+
getValue() {
|
|
610
|
+
return this._value;
|
|
611
|
+
}
|
|
612
|
+
setValue(t) {
|
|
613
|
+
this._value = t, this._dispatchQueue();
|
|
614
|
+
}
|
|
615
|
+
release(t = 1) {
|
|
616
|
+
if (t <= 0)
|
|
617
|
+
throw new Error(`invalid weight ${t}: must be positive`);
|
|
618
|
+
this._value += t, this._dispatchQueue();
|
|
619
|
+
}
|
|
620
|
+
cancel() {
|
|
621
|
+
this._queue.forEach((t) => t.reject(this._cancelError)), this._queue = [];
|
|
622
|
+
}
|
|
623
|
+
_dispatchQueue() {
|
|
624
|
+
for (this._drainUnlockWaiters(); this._queue.length > 0 && this._queue[0].weight <= this._value; )
|
|
625
|
+
this._dispatchItem(this._queue.shift()), this._drainUnlockWaiters();
|
|
626
|
+
}
|
|
627
|
+
_dispatchItem(t) {
|
|
628
|
+
const r = this._value;
|
|
629
|
+
this._value -= t.weight, t.resolve([r, this._newReleaser(t.weight)]);
|
|
630
|
+
}
|
|
631
|
+
_newReleaser(t) {
|
|
632
|
+
let r = !1;
|
|
633
|
+
return () => {
|
|
634
|
+
r || (r = !0, this.release(t));
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
_drainUnlockWaiters() {
|
|
638
|
+
if (this._queue.length === 0)
|
|
639
|
+
for (let t = this._value; t > 0; t--) {
|
|
640
|
+
const r = this._weightedWaiters[t - 1];
|
|
641
|
+
r && (r.forEach((n) => n.resolve()), this._weightedWaiters[t - 1] = []);
|
|
642
|
+
}
|
|
643
|
+
else {
|
|
644
|
+
const t = this._queue[0].priority;
|
|
645
|
+
for (let r = this._value; r > 0; r--) {
|
|
646
|
+
const n = this._weightedWaiters[r - 1];
|
|
647
|
+
if (!n)
|
|
648
|
+
continue;
|
|
649
|
+
const s = n.findIndex((o) => o.priority <= t);
|
|
650
|
+
(s === -1 ? n : n.splice(0, s)).forEach((o) => o.resolve());
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
_couldLockImmediately(t, r) {
|
|
655
|
+
return (this._queue.length === 0 || this._queue[0].priority < r) && t <= this._value;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
function kt(e, t) {
|
|
659
|
+
const r = le(e, (n) => t.priority <= n.priority);
|
|
660
|
+
e.splice(r + 1, 0, t);
|
|
661
|
+
}
|
|
662
|
+
function le(e, t) {
|
|
663
|
+
for (let r = e.length - 1; r >= 0; r--)
|
|
664
|
+
if (t(e[r]))
|
|
665
|
+
return r;
|
|
666
|
+
return -1;
|
|
667
|
+
}
|
|
668
|
+
var Ot = function(e, t, r, n) {
|
|
669
|
+
function s(o) {
|
|
670
|
+
return o instanceof r ? o : new r(function(a) {
|
|
671
|
+
a(o);
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
return new (r || (r = Promise))(function(o, a) {
|
|
675
|
+
function f(u) {
|
|
676
|
+
try {
|
|
677
|
+
i(n.next(u));
|
|
678
|
+
} catch (h) {
|
|
679
|
+
a(h);
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
function l(u) {
|
|
683
|
+
try {
|
|
684
|
+
i(n.throw(u));
|
|
685
|
+
} catch (h) {
|
|
686
|
+
a(h);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
function i(u) {
|
|
690
|
+
u.done ? o(u.value) : s(u.value).then(f, l);
|
|
691
|
+
}
|
|
692
|
+
i((n = n.apply(e, t || [])).next());
|
|
693
|
+
});
|
|
694
|
+
};
|
|
695
|
+
class At {
|
|
696
|
+
constructor(t) {
|
|
697
|
+
this._semaphore = new jt(1, t);
|
|
698
|
+
}
|
|
699
|
+
acquire() {
|
|
700
|
+
return Ot(this, arguments, void 0, function* (t = 0) {
|
|
701
|
+
const [, r] = yield this._semaphore.acquire(1, t);
|
|
702
|
+
return r;
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
runExclusive(t, r = 0) {
|
|
706
|
+
return this._semaphore.runExclusive(() => t(), 1, r);
|
|
707
|
+
}
|
|
708
|
+
isLocked() {
|
|
709
|
+
return this._semaphore.isLocked();
|
|
710
|
+
}
|
|
711
|
+
waitForUnlock(t = 0) {
|
|
712
|
+
return this._semaphore.waitForUnlock(1, t);
|
|
713
|
+
}
|
|
714
|
+
release() {
|
|
715
|
+
this._semaphore.isLocked() && this._semaphore.release();
|
|
716
|
+
}
|
|
717
|
+
cancel() {
|
|
718
|
+
return this._semaphore.cancel();
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
class O extends At {
|
|
722
|
+
static new(t) {
|
|
723
|
+
return new O(t);
|
|
724
|
+
}
|
|
725
|
+
constructor(t) {
|
|
726
|
+
super(), Object.assign(this, t);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
const Ct = (e) => new O(e), Kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
274
730
|
__proto__: null,
|
|
275
|
-
|
|
276
|
-
|
|
731
|
+
mutex: O,
|
|
732
|
+
newMutex: Ct
|
|
277
733
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
278
734
|
export {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
735
|
+
nr as DataType,
|
|
736
|
+
sr as Density,
|
|
737
|
+
or as MultiSeries,
|
|
738
|
+
ir as Rate,
|
|
739
|
+
xn as RoutedWorker,
|
|
740
|
+
Qr as Search,
|
|
741
|
+
ar as Series,
|
|
742
|
+
cr as Size,
|
|
743
|
+
lr as TimeRange,
|
|
744
|
+
y as TimeSpan,
|
|
745
|
+
ur as TimeStamp,
|
|
746
|
+
Sn as TypedWorker,
|
|
747
|
+
_n as URL,
|
|
748
|
+
fr as addSamples,
|
|
749
|
+
tr as binary,
|
|
750
|
+
Ur as bounds,
|
|
751
|
+
Xr as box,
|
|
752
|
+
Ut as breaker,
|
|
753
|
+
wn as buildQueryString,
|
|
754
|
+
_r as caseconv,
|
|
755
|
+
vr as change,
|
|
756
|
+
Sr as clamp,
|
|
757
|
+
zt as color,
|
|
758
|
+
Mr as compare,
|
|
759
|
+
Dt as control,
|
|
760
|
+
dr as convertDataType,
|
|
761
|
+
Yt as convertRenderV,
|
|
762
|
+
$n as createMockWorkers,
|
|
763
|
+
Or as debounce,
|
|
764
|
+
Ir as deep,
|
|
765
|
+
tn as dimensions,
|
|
766
|
+
nn as direction,
|
|
767
|
+
Ft as errors,
|
|
768
|
+
Br as getEntries,
|
|
769
|
+
hr as id,
|
|
770
|
+
Bt as invert,
|
|
771
|
+
mr as isCrudeSeries,
|
|
772
|
+
Nr as isObject,
|
|
773
|
+
Tr as isStringer,
|
|
774
|
+
pr as isTelemValue,
|
|
775
|
+
Vt as jsonRPC,
|
|
776
|
+
Rr as kv,
|
|
777
|
+
qr as link,
|
|
778
|
+
on as location,
|
|
779
|
+
Vr as mapValues,
|
|
780
|
+
qt as math,
|
|
781
|
+
Ht as migrate,
|
|
782
|
+
Jt as notation,
|
|
783
|
+
mn as nullToArr,
|
|
784
|
+
Dr as observe,
|
|
785
|
+
cn as position,
|
|
786
|
+
jr as primitiveIsZero,
|
|
787
|
+
Yr as runtime,
|
|
788
|
+
$r as scale,
|
|
789
|
+
Gt as shallowCopy,
|
|
790
|
+
Wt as sleep,
|
|
791
|
+
gr as sortTimeRange,
|
|
792
|
+
un as spatial,
|
|
793
|
+
Qt as strings,
|
|
794
|
+
Kt as sync,
|
|
795
|
+
Ar as throttle,
|
|
796
|
+
pn as toArray,
|
|
797
|
+
br as typedArrayZ,
|
|
798
|
+
bn as unique,
|
|
799
|
+
Hr as unknownRecordZ,
|
|
800
|
+
dn as xy,
|
|
801
|
+
Mn as zod
|
|
343
802
|
};
|