@synnaxlabs/pluto 0.44.3 → 0.44.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Animated-BDoJWl9g.cjs +1 -0
- package/dist/{Animated-BHxq6Pmm.js → Animated-fI-NFaha.js} +2 -2
- package/dist/{symbols-aLnytgtc.js → Editable-C1g_CFYk.js} +5898 -5888
- package/dist/{symbols-DWZqHjhU.cjs → Editable-DUtJOqJ5.cjs} +41 -41
- package/dist/{LinePlot-BJ10hKs7.cjs → LinePlot-6cl8_hmn.cjs} +5 -5
- package/dist/{LinePlot-VIcFjuPQ.js → LinePlot-Ck0rhtFk.js} +712 -728
- package/dist/{Toggle-C--I90ch.js → Toggle-DEJ8Uvun.js} +1 -1
- package/dist/Toggle-DUKDeqpe.cjs +1 -0
- package/dist/{Video-DdsVXhnt.js → Video-B6tujjr8.js} +1 -1
- package/dist/{Video-BbRLzkdH.cjs → Video-BjRd9sFv.cjs} +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/color.cjs +1 -1
- package/dist/color.js +1 -1
- package/dist/css-DI0uCCGq.cjs +8 -0
- package/dist/{css-BKrX40Df.js → css-DvIPI3Qm.js} +1383 -1252
- package/dist/css.cjs +1 -1
- package/dist/css.js +2 -2
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +1 -1
- package/dist/eraser-B03ej59l.cjs +63 -0
- package/dist/{eraser-DtXU7kOS.js → eraser-CnRJY__h.js} +4999 -4687
- package/dist/ether.cjs +1 -1
- package/dist/ether.js +6 -6
- package/dist/{external-BT0nByPv.js → external-B3dPSZUg.js} +7 -8
- package/dist/external-BEd3F7zY.cjs +1 -0
- package/dist/external-BS9S-b49.cjs +1 -0
- package/dist/external-BVDQNHbo.cjs +1 -0
- package/dist/external-BenP6Hcm.cjs +1 -0
- package/dist/external-Blrrgnzw.cjs +1 -0
- package/dist/{external-tHxdTvxn.js → external-BzV_PGNe.js} +2 -2
- package/dist/{external-ONwuyKzG.js → external-C2iqWGd2.js} +22 -22
- package/dist/external-CAAPXpVr.cjs +1 -0
- package/dist/{external-n4gJTJfw.js → external-CKhbbig_.js} +15 -15
- package/dist/external-CNF5TNBY.cjs +1 -0
- package/dist/{external-Bt-WjDvD.js → external-D16M7vHB.js} +9 -9
- package/dist/{external-dkXc0y5z.js → external-D6hAP7eJ.js} +7 -7
- package/dist/external-D98a3YQJ.cjs +1 -0
- package/dist/external-DKh0JhWO.cjs +1 -0
- package/dist/external-DNO3FJLl.cjs +1 -0
- package/dist/{external-yddEc8os.cjs → external-DOEaBrpz.cjs} +2 -2
- package/dist/external-DRuZ24L7.js +78 -0
- package/dist/{external-CEMgElRx.js → external-Daage1AI.js} +10 -10
- package/dist/{external-BApQK7XP.js → external-Db9iKa8k.js} +3 -3
- package/dist/{external-BmfZaFKB.js → external-Dfr7xymv.js} +3 -3
- package/dist/external-DwRvB5ZT.cjs +1 -0
- package/dist/{external-NUi5IwGn.js → external-GR-20z_c.js} +14 -14
- package/dist/external-I_-aclFy.cjs +1 -0
- package/dist/{external-Dgui980d.js → external-R9a28aP6.js} +24 -24
- package/dist/{external-Dwfn2jsF.js → external-dew29Q0v.js} +9 -9
- package/dist/flex.cjs +1 -1
- package/dist/flex.js +1 -1
- package/dist/{fontString-D2-HUuI_.js → fontString-CW0wLG5g.js} +2 -2
- package/dist/{fontString-BWGnZU-8.cjs → fontString-aK--tYMM.cjs} +1 -1
- package/dist/header.cjs +1 -1
- package/dist/header.js +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.js +6084 -5944
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/pluto.css +1 -1
- package/dist/src/channel/queries.d.ts.map +1 -1
- package/dist/src/flux/form.d.ts +39 -10
- package/dist/src/flux/form.d.ts.map +1 -1
- package/dist/src/flux/retrieve.d.ts +4 -2
- package/dist/src/flux/retrieve.d.ts.map +1 -1
- package/dist/src/flux/update.d.ts +13 -0
- package/dist/src/flux/update.d.ts.map +1 -1
- package/dist/src/form/Context.d.ts +6 -2
- package/dist/src/form/Context.d.ts.map +1 -1
- package/dist/src/form/state.d.ts +1 -0
- package/dist/src/form/state.d.ts.map +1 -1
- package/dist/src/form/use.d.ts.map +1 -1
- package/dist/src/hardware/device/queries.d.ts.map +1 -1
- package/dist/src/hardware/rack/queries.d.ts.map +1 -1
- package/dist/src/hardware/task/queries.d.ts +22 -1
- package/dist/src/hardware/task/queries.d.ts.map +1 -1
- package/dist/src/icon/registry.d.ts +1 -0
- package/dist/src/icon/registry.d.ts.map +1 -1
- package/dist/src/label/queries.d.ts.map +1 -1
- package/dist/src/mosaic/Mosaic.d.ts +1 -1
- package/dist/src/mosaic/Mosaic.d.ts.map +1 -1
- package/dist/src/ontology/queries.d.ts.map +1 -1
- package/dist/src/ranger/queries.d.ts +3 -3
- package/dist/src/ranger/queries.d.ts.map +1 -1
- package/dist/src/select/Button.d.ts +3 -2
- package/dist/src/select/Button.d.ts.map +1 -1
- package/dist/src/select/use.d.ts +7 -4
- package/dist/src/select/use.d.ts.map +1 -1
- package/dist/src/showcase/TextShowcase.d.ts.map +1 -1
- package/dist/src/status/Summary.d.ts.map +1 -1
- package/dist/src/synnax/Provider.d.ts.map +1 -1
- package/dist/src/synnax/aether/provider.d.ts +6 -6
- package/dist/src/telem/aether/remote.d.ts +4 -4
- package/dist/src/telem/aether/transformers.d.ts +0 -2
- package/dist/src/telem/aether/transformers.d.ts.map +1 -1
- package/dist/src/telem/aether/transformers.spec.d.ts +2 -0
- package/dist/src/telem/aether/transformers.spec.d.ts.map +1 -0
- package/dist/src/text/external.d.ts +0 -1
- package/dist/src/text/external.d.ts.map +1 -1
- package/dist/src/triggers/Text.d.ts.map +1 -1
- package/dist/src/triggers/triggers.d.ts +3 -0
- package/dist/src/triggers/triggers.d.ts.map +1 -1
- package/dist/src/viewport/SelectMode.d.ts +10 -2
- package/dist/src/viewport/SelectMode.d.ts.map +1 -1
- package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
- package/dist/src/vis/legend/Simple.d.ts.map +1 -1
- package/dist/src/vis/line/aether/line.d.ts +0 -1
- package/dist/src/vis/line/aether/line.d.ts.map +1 -1
- package/dist/src/vis/lineplot/Legend.d.ts.map +1 -1
- package/dist/src/vis/lineplot/aether/XAxis.d.ts +2 -2
- package/dist/src/vis/lineplot/aether/YAxis.d.ts +2 -2
- package/dist/src/vis/lineplot/aether/axis.d.ts +2 -2
- package/dist/src/vis/lineplot/aether/axis.d.ts.map +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text.cjs +1 -1
- package/dist/text.js +2 -2
- package/dist/theming.cjs +1 -1
- package/dist/theming.js +2 -2
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/triggers.cjs +1 -1
- package/dist/triggers.js +1 -1
- package/dist/{units-ny6lkoIv.js → units-Dh7MflIZ.js} +3 -3
- package/dist/units-WWUmv-rf.cjs +1 -0
- package/dist/video.cjs +1 -1
- package/dist/video.js +1 -1
- package/package.json +6 -6
- package/dist/Animated-DEXELMDa.cjs +0 -1
- package/dist/Toggle-CCsw0kkq.cjs +0 -1
- package/dist/css-TyQvZIXQ.cjs +0 -8
- package/dist/eraser-Bxknv-HS.cjs +0 -63
- package/dist/external-BBXhtVjD.cjs +0 -1
- package/dist/external-BOmNpcyI.js +0 -75
- package/dist/external-BPF50O_x.cjs +0 -1
- package/dist/external-BUAnicLg.cjs +0 -1
- package/dist/external-BaRBYE0N.cjs +0 -1
- package/dist/external-BsyCwXWB.cjs +0 -1
- package/dist/external-COBt6FnN.cjs +0 -1
- package/dist/external-CZSk2V5E.cjs +0 -1
- package/dist/external-Cw5iYImi.cjs +0 -1
- package/dist/external-EMhi5ISu.cjs +0 -1
- package/dist/external-Jee63xkv.cjs +0 -1
- package/dist/external-TAYJZFme.cjs +0 -1
- package/dist/external-bvOijYCw.cjs +0 -1
- package/dist/src/text/symbols.d.ts +0 -3
- package/dist/src/text/symbols.d.ts.map +0 -1
- package/dist/units-XE06scfL.cjs +0 -1
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
1
|
+
import S, { z as a } from "zod";
|
|
2
|
+
const ln = (t) => {
|
|
3
3
|
const e = t.replace(/_[a-z]/g, (r) => r[1].toUpperCase());
|
|
4
4
|
return e.length > 1 && e[0] === e[0].toUpperCase() && e[1] === e[1].toUpperCase() || e.length === 0 ? e : e[0].toLowerCase() + e.slice(1);
|
|
5
|
-
},
|
|
6
|
-
const e = (r, n =
|
|
5
|
+
}, pt = (t) => {
|
|
6
|
+
const e = (r, n = _e) => {
|
|
7
7
|
if (typeof r == "string") return t(r);
|
|
8
8
|
if (Array.isArray(r)) return r.map((o) => e(o, n));
|
|
9
|
-
if (!
|
|
10
|
-
n =
|
|
9
|
+
if (!He(r)) return r;
|
|
10
|
+
n = fn(n);
|
|
11
11
|
const s = {}, i = r;
|
|
12
12
|
return "toJSON" in i && typeof i.toJSON == "function" ? e(i.toJSON(), n) : (Object.keys(i).forEach((o) => {
|
|
13
13
|
let c = i[o];
|
|
14
|
-
const
|
|
15
|
-
n.recursive && (
|
|
16
|
-
let
|
|
17
|
-
return
|
|
18
|
-
}))), s[
|
|
14
|
+
const h = t(o);
|
|
15
|
+
n.recursive && (He(c) ? zt(c) || (c = e(c, n)) : n.recursiveInArray && kt(c) && (c = [...c].map((l) => {
|
|
16
|
+
let d = l;
|
|
17
|
+
return He(l) ? zt(d) || (d = e(l, n)) : kt(l) && (d = e({ key: l }, n).key), d;
|
|
18
|
+
}))), s[h] = c;
|
|
19
19
|
}), s);
|
|
20
20
|
};
|
|
21
21
|
return e;
|
|
22
|
-
},
|
|
22
|
+
}, mt = pt(ln), cn = (t) => (
|
|
23
23
|
// Don't convert the first character and don't convert a character that is after a
|
|
24
24
|
// non-alphanumeric character
|
|
25
25
|
t.replace(
|
|
26
26
|
/([a-z0-9])([A-Z])/g,
|
|
27
27
|
(e, r, n) => `${r}_${n.toLowerCase()}`
|
|
28
28
|
)
|
|
29
|
-
),
|
|
29
|
+
), Gt = pt(cn), Ht = (t) => t.length === 0 ? t : t[0].toUpperCase() + t.slice(1), hn = [Number, String, Uint8Array], _e = {
|
|
30
30
|
recursive: !0,
|
|
31
31
|
recursiveInArray: !0
|
|
32
|
-
},
|
|
32
|
+
}, fn = (t = _e) => (t.recursive == null ? t = _e : t.recursiveInArray ??= !1, t), kt = (t) => t != null && Array.isArray(t), He = (t) => t != null && typeof t == "object" && !Array.isArray(t), zt = (t) => hn.some((e) => t instanceof e), dn = (t) => t.replace(/\s+/g, "-").replace(
|
|
33
33
|
/([a-z0-9])([A-Z])/g,
|
|
34
34
|
(e, r, n) => `${r}-${n.toLowerCase()}`
|
|
35
|
-
).toLowerCase(),
|
|
35
|
+
).toLowerCase(), gn = pt(dn), wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
36
36
|
__proto__: null,
|
|
37
|
-
camelToSnake:
|
|
38
|
-
capitalize:
|
|
39
|
-
snakeToCamel:
|
|
40
|
-
toKebab:
|
|
37
|
+
camelToSnake: Gt,
|
|
38
|
+
capitalize: Ht,
|
|
39
|
+
snakeToCamel: mt,
|
|
40
|
+
toKebab: gn
|
|
41
41
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
42
|
-
let
|
|
42
|
+
let pn = class {
|
|
43
43
|
contentType = "application/json";
|
|
44
44
|
decoder;
|
|
45
45
|
encoder;
|
|
@@ -53,15 +53,15 @@ let ln = class {
|
|
|
53
53
|
return this.decodeString(this.decoder.decode(e), r);
|
|
54
54
|
}
|
|
55
55
|
decodeString(e, r) {
|
|
56
|
-
const n = JSON.parse(e), s =
|
|
56
|
+
const n = JSON.parse(e), s = mt(n);
|
|
57
57
|
return r != null ? r.parse(s) : s;
|
|
58
58
|
}
|
|
59
59
|
encodeString(e) {
|
|
60
|
-
const r =
|
|
60
|
+
const r = Gt(e);
|
|
61
61
|
return JSON.stringify(r, (n, s) => ArrayBuffer.isView(s) ? Array.from(s) : typeof s == "bigint" ? s.toString() : s);
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
|
-
const
|
|
64
|
+
const et = new pn(), tt = (t) => [...new Set(t)], mn = (t, e, r = !0) => {
|
|
65
65
|
const n = /* @__PURE__ */ new Map();
|
|
66
66
|
return t.forEach((s) => {
|
|
67
67
|
const i = e(s);
|
|
@@ -71,12 +71,12 @@ const He = new ln(), Je = (t) => [...new Set(t)], cn = (t, e, r = !0) => {
|
|
|
71
71
|
}
|
|
72
72
|
n.set(i, s);
|
|
73
73
|
}), Array.from(n.values());
|
|
74
|
-
},
|
|
74
|
+
}, vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
75
75
|
__proto__: null,
|
|
76
|
-
by:
|
|
77
|
-
unique:
|
|
76
|
+
by: mn,
|
|
77
|
+
unique: tt
|
|
78
78
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
79
|
-
let
|
|
79
|
+
let _ = class {
|
|
80
80
|
/** The underlying primitive value */
|
|
81
81
|
value;
|
|
82
82
|
constructor(e) {
|
|
@@ -96,8 +96,8 @@ let J = class {
|
|
|
96
96
|
return this.value.toString();
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
|
-
const
|
|
100
|
-
if (
|
|
99
|
+
const yt = (t) => t != null && typeof t == "object" && "toString" in t, Jt = (t) => {
|
|
100
|
+
if (yt(t)) return t?.toString().length === 0;
|
|
101
101
|
switch (typeof t) {
|
|
102
102
|
case "string":
|
|
103
103
|
return t.length === 0;
|
|
@@ -114,14 +114,14 @@ const ht = (t) => t != null && typeof t == "object" && "toString" in t, Yt = (t)
|
|
|
114
114
|
default:
|
|
115
115
|
return !1;
|
|
116
116
|
}
|
|
117
|
-
},
|
|
117
|
+
}, yn = (t) => !Jt(t), xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
118
118
|
__proto__: null,
|
|
119
|
-
ValueExtension:
|
|
120
|
-
isNonZero:
|
|
121
|
-
isStringer:
|
|
122
|
-
isZero:
|
|
123
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
124
|
-
const r =
|
|
119
|
+
ValueExtension: _,
|
|
120
|
+
isNonZero: yn,
|
|
121
|
+
isStringer: yt,
|
|
122
|
+
isZero: Jt
|
|
123
|
+
}, Symbol.toStringTag, { value: "Module" })), De = (t, e = !1) => {
|
|
124
|
+
const r = yt(t) ? "stringer" : typeof t;
|
|
125
125
|
let n;
|
|
126
126
|
switch (r) {
|
|
127
127
|
case "string":
|
|
@@ -145,69 +145,80 @@ const ht = (t) => t != null && typeof t == "object" && "toString" in t, Yt = (t)
|
|
|
145
145
|
default:
|
|
146
146
|
return console.warn(`sortFunc: unknown type ${r}`), () => -1;
|
|
147
147
|
}
|
|
148
|
-
return e ?
|
|
149
|
-
},
|
|
150
|
-
const n =
|
|
148
|
+
return e ? Kt(n) : n;
|
|
149
|
+
}, bn = (t, e, r) => {
|
|
150
|
+
const n = De(e[t], r);
|
|
151
151
|
return (s, i) => n(s[t], i[t]);
|
|
152
|
-
},
|
|
152
|
+
}, wn = (t, e) => t.length !== e.length ? t.length - e.length : t.every((r, n) => r === e[n]) ? 0 : -1, Xt = (t, e) => {
|
|
153
153
|
if (t.length !== e.length) return t.length - e.length;
|
|
154
154
|
if (t.length === 0) return 0;
|
|
155
|
-
const r =
|
|
155
|
+
const r = De(t[0]), n = [...t].sort(r), s = [...e].sort(r);
|
|
156
156
|
return n.every((i, o) => i === s[o]) ? 0 : -1;
|
|
157
|
-
},
|
|
158
|
-
const r =
|
|
159
|
-
return
|
|
160
|
-
},
|
|
157
|
+
}, On = (t, e) => {
|
|
158
|
+
const r = tt(t), n = tt(e);
|
|
159
|
+
return Xt(r, n);
|
|
160
|
+
}, vn = (t, e) => t === e ? 0 : t === "first" && e === "last" ? 1 : -1, Kt = (t) => (e, r) => t(r, e), ne = 0, Ie = -1, Me = 1, Qt = (t) => t < ne, _t = (t) => t > ne, Tn = (t) => t >= ne, er = (t) => t === ne, xn = (t, e) => {
|
|
161
161
|
const r = /([a-zA-Z]+)|(\d+)/g, n = t.replace(/[\s_.-]+/g, "").match(r), s = e.replace(/[\s_.-]+/g, "").match(r);
|
|
162
162
|
if (!n || !s) return 0;
|
|
163
163
|
for (let i = 0; i < Math.min(n.length, s.length); i++) {
|
|
164
164
|
const o = n[i], c = s[i];
|
|
165
165
|
if (isNaN(Number(o)) && isNaN(Number(c))) {
|
|
166
|
-
const
|
|
167
|
-
if (
|
|
166
|
+
const h = o.localeCompare(c);
|
|
167
|
+
if (h !== 0) return h;
|
|
168
168
|
} else if (!isNaN(Number(o)) && !isNaN(Number(c))) {
|
|
169
|
-
const
|
|
170
|
-
if (
|
|
169
|
+
const h = Number(o) - Number(c);
|
|
170
|
+
if (h !== 0) return h;
|
|
171
171
|
} else return isNaN(Number(o)) ? -1 : 1;
|
|
172
172
|
}
|
|
173
173
|
return n.length - s.length;
|
|
174
|
-
},
|
|
174
|
+
}, $o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
175
175
|
__proto__: null,
|
|
176
|
-
EQUAL:
|
|
177
|
-
GREATER_THAN:
|
|
178
|
-
LESS_THAN:
|
|
179
|
-
isEqualTo:
|
|
180
|
-
isGreaterThan:
|
|
181
|
-
isGreaterThanEqual:
|
|
182
|
-
isLessThan:
|
|
183
|
-
newF:
|
|
184
|
-
newFieldF:
|
|
185
|
-
order:
|
|
186
|
-
primitiveArrays:
|
|
187
|
-
reverseF:
|
|
188
|
-
stringsWithNumbers:
|
|
189
|
-
uniqueUnorderedPrimitiveArrays:
|
|
190
|
-
unorderedPrimitiveArrays:
|
|
191
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
176
|
+
EQUAL: ne,
|
|
177
|
+
GREATER_THAN: Me,
|
|
178
|
+
LESS_THAN: Ie,
|
|
179
|
+
isEqualTo: er,
|
|
180
|
+
isGreaterThan: _t,
|
|
181
|
+
isGreaterThanEqual: Tn,
|
|
182
|
+
isLessThan: Qt,
|
|
183
|
+
newF: De,
|
|
184
|
+
newFieldF: bn,
|
|
185
|
+
order: vn,
|
|
186
|
+
primitiveArrays: wn,
|
|
187
|
+
reverseF: Kt,
|
|
188
|
+
stringsWithNumbers: xn,
|
|
189
|
+
uniqueUnorderedPrimitiveArrays: On,
|
|
190
|
+
unorderedPrimitiveArrays: Xt
|
|
191
|
+
}, Symbol.toStringTag, { value: "Module" })), Pe = a.tuple([a.number(), a.number()]);
|
|
192
192
|
a.tuple([a.bigint(), a.bigint()]);
|
|
193
|
-
const
|
|
193
|
+
const bt = a.object({ width: a.number(), height: a.number() }), $n = a.object({
|
|
194
194
|
signedWidth: a.number(),
|
|
195
195
|
signedHeight: a.number()
|
|
196
|
-
}),
|
|
197
|
-
a.enum(
|
|
198
|
-
const
|
|
199
|
-
a.enum(
|
|
200
|
-
const
|
|
201
|
-
a.enum(
|
|
202
|
-
const
|
|
203
|
-
a.enum(
|
|
204
|
-
const
|
|
205
|
-
a.union([
|
|
206
|
-
a.union([
|
|
207
|
-
const
|
|
196
|
+
}), Sn = ["width", "height"];
|
|
197
|
+
a.enum(Sn);
|
|
198
|
+
const Nn = ["start", "center", "end"], In = ["signedWidth", "signedHeight"];
|
|
199
|
+
a.enum(In);
|
|
200
|
+
const ge = a.object({ x: a.number(), y: a.number() }), tr = a.object({ clientX: a.number(), clientY: a.number() }), qe = ["x", "y"], wt = a.enum(qe), rr = ["top", "right", "bottom", "left"], Mn = a.enum(rr), ke = ["left", "right"], Ot = a.enum(ke), ze = ["top", "bottom"], vt = a.enum(ze), Tt = ["center"], rt = a.enum(Tt), En = [...rr, ...Tt], xt = a.enum(En);
|
|
201
|
+
a.enum(Nn);
|
|
202
|
+
const An = ["first", "last"];
|
|
203
|
+
a.enum(An);
|
|
204
|
+
const nr = a.object({ lower: a.number(), upper: a.number() }), Bn = a.object({ lower: a.bigint(), upper: a.bigint() });
|
|
205
|
+
a.union([nr, Pe]);
|
|
206
|
+
a.union([Bn, Pe]);
|
|
207
|
+
const Un = a.enum([...wt.options, ...xt.options]), Cn = a.union([wt, xt, a.instanceof(String)]), se = (t) => (e, r) => {
|
|
208
|
+
if (typeof e == "bigint") {
|
|
209
|
+
if (je(r))
|
|
210
|
+
return t(e, BigInt(r));
|
|
211
|
+
const n = t(Number(e), Number(r));
|
|
212
|
+
return typeof n == "number" ? BigInt(Math.round(n)) : n;
|
|
213
|
+
}
|
|
214
|
+
return t(Number(e), Number(r));
|
|
215
|
+
}, P = se((t, e) => t - e), ie = se((t, e) => t + e), jn = (t, e, r = 1e-4) => Math.abs(t - e) < r, nt = (t, e) => {
|
|
216
|
+
const r = typeof t == "bigint", n = typeof e == "bigint";
|
|
217
|
+
return r && n ? t === e : r && je(e) ? t === BigInt(e) : n && je(t) ? e === BigInt(t) : t === e;
|
|
218
|
+
}, Rn = (t) => {
|
|
208
219
|
const e = 10 ** Math.floor(Math.log10(t));
|
|
209
220
|
return Math.round(t / e) * e;
|
|
210
|
-
},
|
|
221
|
+
}, sr = se((t, e) => t <= e ? t : e), je = (t) => typeof t == "bigint" ? !0 : Number.isInteger(t), Ln = se((t, e) => t >= e ? t : e), ir = (t) => typeof t == "bigint" ? t < 0n ? -t : t : t < 0 ? -t : t, B = se((t, e) => t * e), we = se((t, e) => t / e), y = (t, e, r) => {
|
|
211
222
|
const n = {};
|
|
212
223
|
if (typeof e == "object" && (r = e, e = void 0), r = { makeValid: !0, ...r }, typeof t == "number" || typeof t == "bigint")
|
|
213
224
|
e != null ? (n.lower = t, n.upper = e) : (n.lower = typeof t == "bigint" ? 0n : 0, n.upper = t);
|
|
@@ -216,64 +227,64 @@ const Nn = a.enum([...dt.options, ...mt.options]), In = a.union([dt, mt, a.insta
|
|
|
216
227
|
[n.lower, n.upper] = t;
|
|
217
228
|
} else
|
|
218
229
|
n.lower = t.lower, n.upper = t.upper;
|
|
219
|
-
return r?.makeValid ?
|
|
220
|
-
},
|
|
230
|
+
return r?.makeValid ? ar(n) : n;
|
|
231
|
+
}, Dn = Object.freeze({ lower: 0, upper: 0 }), Pn = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), qn = Object.freeze({ lower: 0, upper: 1 }), kn = Object.freeze({ lower: -1, upper: 1 }), zn = (t, e) => {
|
|
221
232
|
if (t == null && e == null) return !0;
|
|
222
233
|
if (t == null || e == null) return !1;
|
|
223
234
|
const r = y(t), n = y(e);
|
|
224
235
|
return r?.lower === n?.lower && r?.upper === n?.upper;
|
|
225
|
-
},
|
|
236
|
+
}, ar = (t) => t.lower > t.upper ? { lower: t.upper, upper: t.lower } : t, st = (t, e) => {
|
|
226
237
|
const r = y(t);
|
|
227
238
|
return e < r.lower ? r.lower : e >= r.upper ? r.upper - (typeof r.upper == "number" ? 1 : 1n) : e;
|
|
228
|
-
},
|
|
239
|
+
}, U = (t, e) => {
|
|
229
240
|
const r = y(t);
|
|
230
241
|
if (typeof e == "number" || typeof e == "bigint")
|
|
231
242
|
return e >= r.lower && e < r.upper;
|
|
232
243
|
const n = y(e);
|
|
233
244
|
return n.lower >= r.lower && n.upper <= r.upper;
|
|
234
|
-
},
|
|
245
|
+
}, Fn = (t, e) => {
|
|
235
246
|
const r = y(t), n = y(e);
|
|
236
|
-
return r.lower === n.lower ? !0 : n.upper === r.lower || n.lower === r.upper ? !1 :
|
|
237
|
-
},
|
|
247
|
+
return r.lower === n.lower ? !0 : n.upper === r.lower || n.lower === r.upper ? !1 : U(r, n.upper) || U(r, n.lower) || U(n, r.upper) || U(n, r.lower);
|
|
248
|
+
}, Oe = (t) => {
|
|
238
249
|
const e = y(t);
|
|
239
250
|
return e.upper - e.lower;
|
|
240
|
-
},
|
|
251
|
+
}, Zn = (t) => {
|
|
241
252
|
const e = y(t);
|
|
242
253
|
return typeof e.lower == "bigint" ? e.lower === 0n && e.upper === 0n : e.lower === 0 && e.upper === 0;
|
|
243
|
-
},
|
|
244
|
-
const e =
|
|
254
|
+
}, Yn = (t) => {
|
|
255
|
+
const e = Oe(t);
|
|
245
256
|
return typeof e == "number" ? e === 0 : e === 0n;
|
|
246
|
-
},
|
|
257
|
+
}, Wn = (t) => {
|
|
247
258
|
const e = y(t);
|
|
248
259
|
return typeof e.lower == "bigint" ? !0 : Number.isFinite(e.lower) && Number.isFinite(e.upper);
|
|
249
|
-
},
|
|
260
|
+
}, Vn = (t) => {
|
|
250
261
|
const e = y(t);
|
|
251
262
|
return (e.upper + e.lower) / 2;
|
|
252
|
-
},
|
|
263
|
+
}, or = (t) => ({
|
|
253
264
|
lower: Math.min(...t.map((e) => y(e).lower)),
|
|
254
265
|
upper: Math.max(...t.map((e) => y(e).upper))
|
|
255
|
-
}),
|
|
266
|
+
}), Gn = (t) => ({
|
|
256
267
|
lower: Math.max(...t.map((e) => y(e).lower)),
|
|
257
268
|
upper: Math.min(...t.map((e) => y(e).upper))
|
|
258
|
-
}),
|
|
269
|
+
}), Hn = (t) => {
|
|
259
270
|
const e = y(t), r = typeof e.lower == "bigint";
|
|
260
|
-
return Array.from({ length: Number(
|
|
261
|
-
},
|
|
262
|
-
const r = t.map((i) => y(i)), n = r.findIndex((i) =>
|
|
271
|
+
return Array.from({ length: Number(Oe(t)) }, (n, s) => r ? e.lower + BigInt(s) : e.lower + s);
|
|
272
|
+
}, it = (t, e) => {
|
|
273
|
+
const r = t.map((i) => y(i)), n = r.findIndex((i) => U(i, e) || e < i.lower);
|
|
263
274
|
if (n === -1) return { index: t.length, position: 0 };
|
|
264
275
|
const s = r[n];
|
|
265
|
-
return
|
|
266
|
-
},
|
|
276
|
+
return U(s, e) ? { index: n, position: Number(e - s.lower) } : { index: n, position: 0 };
|
|
277
|
+
}, Je = {
|
|
267
278
|
removeBefore: 0,
|
|
268
279
|
removeAfter: 0,
|
|
269
280
|
insertInto: 0,
|
|
270
281
|
deleteInBetween: 0
|
|
271
|
-
},
|
|
272
|
-
const r = t.map((
|
|
273
|
-
if (r.length === 0) return
|
|
274
|
-
const s =
|
|
275
|
-
if (s.index === t.length) return { ...
|
|
276
|
-
if (i.index === 0) return { ...
|
|
282
|
+
}, Jn = (t, e) => {
|
|
283
|
+
const r = t.map((l) => y(l)), n = y(e);
|
|
284
|
+
if (r.length === 0) return Je;
|
|
285
|
+
const s = it(r, n.lower), i = it(r, n.upper);
|
|
286
|
+
if (s.index === t.length) return { ...Je, insertInto: t.length };
|
|
287
|
+
if (i.index === 0) return { ...Je, removeAfter: i.position };
|
|
277
288
|
if (s.index === i.index)
|
|
278
289
|
return s.position !== 0 && i.position !== 0 ? null : {
|
|
279
290
|
removeAfter: i.position,
|
|
@@ -281,314 +292,314 @@ const Nn = a.enum([...dt.options, ...mt.options]), In = a.union([dt, mt, a.insta
|
|
|
281
292
|
insertInto: s.index,
|
|
282
293
|
deleteInBetween: 0
|
|
283
294
|
};
|
|
284
|
-
let o = i.index - s.index, c = s.index,
|
|
285
|
-
return s.position !== 0 ? (o -= 1, c += 1) :
|
|
286
|
-
removeBefore:
|
|
295
|
+
let o = i.index - s.index, c = s.index, h = P(Number(Oe(r[s.index])), s.position);
|
|
296
|
+
return s.position !== 0 ? (o -= 1, c += 1) : h = 0, {
|
|
297
|
+
removeBefore: h,
|
|
287
298
|
removeAfter: i.position,
|
|
288
299
|
insertInto: c,
|
|
289
300
|
deleteInBetween: o
|
|
290
301
|
};
|
|
291
|
-
},
|
|
302
|
+
}, ur = (t, e, r) => {
|
|
292
303
|
const n = t.map((c) => y(c)), s = r > 0 ? 1 : r < 0 ? -1 : 0;
|
|
293
304
|
if (s === 0) return e;
|
|
294
305
|
let i = r, o = e;
|
|
295
|
-
for (;
|
|
296
|
-
const c = n.findIndex((
|
|
306
|
+
for (; nt(i, 0) === !1; ) {
|
|
307
|
+
const c = n.findIndex((h) => s > 0 ? o >= h.lower && o < h.upper : o > h.lower && o <= h.upper);
|
|
297
308
|
if (c !== -1) {
|
|
298
|
-
const
|
|
299
|
-
let
|
|
300
|
-
if (s > 0 ?
|
|
301
|
-
const
|
|
302
|
-
if (o =
|
|
309
|
+
const h = n[c];
|
|
310
|
+
let l;
|
|
311
|
+
if (s > 0 ? l = P(h.upper, o) : l = P(o, h.lower), l > 0) {
|
|
312
|
+
const d = sr(ir(i), l);
|
|
313
|
+
if (o = ie(
|
|
303
314
|
o,
|
|
304
|
-
s > 0 ?
|
|
305
|
-
), i =
|
|
315
|
+
s > 0 ? d : -d
|
|
316
|
+
), i = P(i, s > 0 ? d : -d), nt(i, 0)) return o;
|
|
306
317
|
continue;
|
|
307
318
|
}
|
|
308
319
|
}
|
|
309
320
|
if (s > 0) {
|
|
310
|
-
const
|
|
311
|
-
if (
|
|
321
|
+
const h = n.filter((l) => l.lower > o);
|
|
322
|
+
if (h.length > 0) o = h[0].lower;
|
|
312
323
|
else return o;
|
|
313
324
|
} else {
|
|
314
|
-
const
|
|
315
|
-
if (
|
|
316
|
-
o =
|
|
325
|
+
const h = n.filter((l) => l.upper < o);
|
|
326
|
+
if (h.length > 0)
|
|
327
|
+
o = h[h.length - 1].upper;
|
|
317
328
|
else return o;
|
|
318
329
|
}
|
|
319
330
|
}
|
|
320
331
|
return o;
|
|
321
|
-
},
|
|
332
|
+
}, lr = (t, e, r) => {
|
|
322
333
|
const n = t.map((o) => y(o));
|
|
323
334
|
if (e === r) return typeof e == "bigint" ? 0n : 0;
|
|
324
335
|
const s = e < r ? y([e, r]) : y([r, e]);
|
|
325
336
|
let i = typeof e == "bigint" ? 0n : 0;
|
|
326
337
|
for (const o of n) {
|
|
327
|
-
const c = o.lower > s.lower ? o.lower : s.lower,
|
|
328
|
-
if (c <
|
|
329
|
-
const
|
|
330
|
-
i = i +
|
|
338
|
+
const c = o.lower > s.lower ? o.lower : s.lower, h = o.upper < s.upper ? o.upper : s.upper;
|
|
339
|
+
if (c < h) {
|
|
340
|
+
const l = h - c;
|
|
341
|
+
i = i + l;
|
|
331
342
|
}
|
|
332
343
|
}
|
|
333
344
|
return i;
|
|
334
|
-
},
|
|
345
|
+
}, So = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
335
346
|
__proto__: null,
|
|
336
|
-
CLIP:
|
|
337
|
-
DECIMAL:
|
|
338
|
-
INFINITE:
|
|
339
|
-
ZERO:
|
|
340
|
-
bounds:
|
|
341
|
-
buildInsertionPlan:
|
|
342
|
-
clamp:
|
|
347
|
+
CLIP: kn,
|
|
348
|
+
DECIMAL: qn,
|
|
349
|
+
INFINITE: Pn,
|
|
350
|
+
ZERO: Dn,
|
|
351
|
+
bounds: nr,
|
|
352
|
+
buildInsertionPlan: Jn,
|
|
353
|
+
clamp: st,
|
|
343
354
|
construct: y,
|
|
344
|
-
contains:
|
|
345
|
-
distance:
|
|
346
|
-
equals:
|
|
347
|
-
findInsertPosition:
|
|
348
|
-
isFinite:
|
|
349
|
-
isZero:
|
|
350
|
-
linspace:
|
|
351
|
-
makeValid:
|
|
352
|
-
max:
|
|
353
|
-
mean:
|
|
354
|
-
min:
|
|
355
|
-
overlapsWith:
|
|
356
|
-
span:
|
|
357
|
-
spanIsZero:
|
|
358
|
-
traverse:
|
|
359
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
355
|
+
contains: U,
|
|
356
|
+
distance: lr,
|
|
357
|
+
equals: zn,
|
|
358
|
+
findInsertPosition: it,
|
|
359
|
+
isFinite: Wn,
|
|
360
|
+
isZero: Zn,
|
|
361
|
+
linspace: Hn,
|
|
362
|
+
makeValid: ar,
|
|
363
|
+
max: or,
|
|
364
|
+
mean: Vn,
|
|
365
|
+
min: Gn,
|
|
366
|
+
overlapsWith: Fn,
|
|
367
|
+
span: Oe,
|
|
368
|
+
spanIsZero: Yn,
|
|
369
|
+
traverse: ur
|
|
370
|
+
}, Symbol.toStringTag, { value: "Module" })), cr = Un, H = (t) => qe.includes(t) ? t : ze.includes(t) ? "y" : "x", Xn = (t) => H(t) === "x" ? "y" : "x", Kn = (t) => H(t) === "x" ? "width" : "height", Qn = (t) => H(t) === "x" ? "left" : "top", _n = (t) => cr.safeParse(t).success, es = (t) => H(t) === "x" ? "signedWidth" : "signedHeight", ts = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
360
371
|
__proto__: null,
|
|
361
|
-
DIRECTIONS:
|
|
362
|
-
construct:
|
|
363
|
-
crude:
|
|
364
|
-
dimension:
|
|
365
|
-
direction:
|
|
366
|
-
isDirection:
|
|
367
|
-
location:
|
|
368
|
-
signedDimension:
|
|
369
|
-
swap:
|
|
370
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
372
|
+
DIRECTIONS: qe,
|
|
373
|
+
construct: H,
|
|
374
|
+
crude: cr,
|
|
375
|
+
dimension: Kn,
|
|
376
|
+
direction: wt,
|
|
377
|
+
isDirection: _n,
|
|
378
|
+
location: Qn,
|
|
379
|
+
signedDimension: es,
|
|
380
|
+
swap: Xn
|
|
381
|
+
}, Symbol.toStringTag, { value: "Module" })), rs = Ot, ns = vt, ss = rt, is = {
|
|
371
382
|
top: "bottom",
|
|
372
383
|
right: "left",
|
|
373
384
|
bottom: "top",
|
|
374
385
|
left: "right",
|
|
375
386
|
center: "center"
|
|
376
|
-
},
|
|
387
|
+
}, as = {
|
|
377
388
|
top: "left",
|
|
378
389
|
right: "top",
|
|
379
390
|
bottom: "right",
|
|
380
391
|
left: "bottom",
|
|
381
392
|
center: "center"
|
|
382
|
-
},
|
|
383
|
-
const e =
|
|
393
|
+
}, os = Cn, W = (t) => t instanceof String || !qe.includes(t) ? t : t === "x" ? "left" : "top", us = (t) => is[W(t)], ls = (t) => as[W(t)], pe = (t) => {
|
|
394
|
+
const e = W(t);
|
|
384
395
|
return e === "top" || e === "bottom" ? "y" : "x";
|
|
385
|
-
},
|
|
386
|
-
x:
|
|
387
|
-
y:
|
|
388
|
-
}),
|
|
396
|
+
}, cs = a.object({
|
|
397
|
+
x: Ot.or(rt),
|
|
398
|
+
y: vt.or(rt)
|
|
399
|
+
}), hr = a.object({ x: Ot, y: vt }), ve = Object.freeze({ x: "left", y: "top" }), $t = Object.freeze({ x: "right", y: "top" }), Fe = Object.freeze({ x: "left", y: "bottom" }), St = Object.freeze({ x: "right", y: "bottom" }), Nt = Object.freeze({ x: "center", y: "center" }), It = Object.freeze({ x: "center", y: "top" }), Mt = Object.freeze({ x: "center", y: "bottom" }), Et = Object.freeze({ x: "right", y: "center" }), At = Object.freeze({ x: "left", y: "center" }), hs = Object.freeze([
|
|
400
|
+
At,
|
|
401
|
+
Et,
|
|
402
|
+
It,
|
|
403
|
+
Mt,
|
|
404
|
+
ve,
|
|
389
405
|
$t,
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
bt,
|
|
395
|
-
Le,
|
|
396
|
-
wt,
|
|
397
|
-
Ot
|
|
398
|
-
]), St = (t, e) => t.x === e.x && t.y === e.y, os = (t, e) => {
|
|
406
|
+
Fe,
|
|
407
|
+
St,
|
|
408
|
+
Nt
|
|
409
|
+
]), Bt = (t, e) => t.x === e.x && t.y === e.y, fs = (t, e) => {
|
|
399
410
|
if (typeof e == "object") {
|
|
400
411
|
let r = !0;
|
|
401
412
|
return "x" in e && (t.x === e.x || (r = !1)), "y" in e && (t.y === e.y || (r = !1)), r;
|
|
402
413
|
}
|
|
403
414
|
return t.x === e || t.y === e;
|
|
404
|
-
},
|
|
415
|
+
}, fr = (t) => [t.x, t.y], Ee = (t) => pe(W(t)) === "x", ds = (t) => pe(W(t)) === "y", gs = (t) => `${t.x}${Ht(t.y)}`, ps = (t, e) => {
|
|
405
416
|
let r, n;
|
|
406
|
-
if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r =
|
|
417
|
+
if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r = W(t), n = W(e ?? t)), pe(r) === pe(n) && r !== "center" && n !== "center")
|
|
407
418
|
throw new Error(
|
|
408
419
|
`[XYLocation] - encountered two locations with the same direction: ${r.toString()} - ${n.toString()}`
|
|
409
420
|
);
|
|
410
|
-
const s = { ...
|
|
411
|
-
return r === "center" ?
|
|
412
|
-
},
|
|
421
|
+
const s = { ...Nt };
|
|
422
|
+
return r === "center" ? Ee(n) ? [s.x, s.y] = [n, r] : [s.x, s.y] = [r, n] : n === "center" ? Ee(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r] : Ee(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r], s;
|
|
423
|
+
}, ms = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
413
424
|
__proto__: null,
|
|
414
|
-
BOTTOM_CENTER:
|
|
415
|
-
BOTTOM_LEFT:
|
|
416
|
-
BOTTOM_RIGHT:
|
|
417
|
-
CENTER:
|
|
418
|
-
CENTER_LEFT:
|
|
419
|
-
CENTER_LOCATIONS:
|
|
420
|
-
CENTER_RIGHT:
|
|
421
|
-
TOP_CENTER:
|
|
422
|
-
TOP_LEFT:
|
|
423
|
-
TOP_RIGHT:
|
|
424
|
-
XY_LOCATIONS:
|
|
425
|
-
X_LOCATIONS:
|
|
426
|
-
Y_LOCATIONS:
|
|
427
|
-
center:
|
|
428
|
-
construct:
|
|
429
|
-
constructXY:
|
|
430
|
-
corner:
|
|
431
|
-
crude:
|
|
432
|
-
direction:
|
|
433
|
-
isX:
|
|
434
|
-
isY:
|
|
435
|
-
location:
|
|
436
|
-
outer:
|
|
437
|
-
rotate90:
|
|
438
|
-
swap:
|
|
439
|
-
x:
|
|
440
|
-
xy:
|
|
441
|
-
xyCouple:
|
|
442
|
-
xyEquals:
|
|
443
|
-
xyMatches:
|
|
444
|
-
xyToString:
|
|
445
|
-
y:
|
|
446
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
425
|
+
BOTTOM_CENTER: Mt,
|
|
426
|
+
BOTTOM_LEFT: Fe,
|
|
427
|
+
BOTTOM_RIGHT: St,
|
|
428
|
+
CENTER: Nt,
|
|
429
|
+
CENTER_LEFT: At,
|
|
430
|
+
CENTER_LOCATIONS: Tt,
|
|
431
|
+
CENTER_RIGHT: Et,
|
|
432
|
+
TOP_CENTER: It,
|
|
433
|
+
TOP_LEFT: ve,
|
|
434
|
+
TOP_RIGHT: $t,
|
|
435
|
+
XY_LOCATIONS: hs,
|
|
436
|
+
X_LOCATIONS: ke,
|
|
437
|
+
Y_LOCATIONS: ze,
|
|
438
|
+
center: ss,
|
|
439
|
+
construct: W,
|
|
440
|
+
constructXY: ps,
|
|
441
|
+
corner: hr,
|
|
442
|
+
crude: os,
|
|
443
|
+
direction: pe,
|
|
444
|
+
isX: Ee,
|
|
445
|
+
isY: ds,
|
|
446
|
+
location: xt,
|
|
447
|
+
outer: Mn,
|
|
448
|
+
rotate90: ls,
|
|
449
|
+
swap: us,
|
|
450
|
+
x: rs,
|
|
451
|
+
xy: cs,
|
|
452
|
+
xyCouple: fr,
|
|
453
|
+
xyEquals: Bt,
|
|
454
|
+
xyMatches: fs,
|
|
455
|
+
xyToString: gs,
|
|
456
|
+
y: ns
|
|
457
|
+
}, Symbol.toStringTag, { value: "Module" })), at = a.union([
|
|
447
458
|
a.number(),
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
]),
|
|
459
|
+
ge,
|
|
460
|
+
Pe,
|
|
461
|
+
bt,
|
|
462
|
+
$n,
|
|
463
|
+
tr
|
|
464
|
+
]), x = (t, e) => {
|
|
454
465
|
if (typeof t == "string") {
|
|
455
466
|
if (e === void 0) throw new Error("The y coordinate must be given.");
|
|
456
467
|
return t === "x" ? { x: e, y: 0 } : { x: 0, y: e };
|
|
457
468
|
}
|
|
458
469
|
return typeof t == "number" ? { x: t, y: e ?? t } : Array.isArray(t) ? { x: t[0], y: t[1] } : "signedWidth" in t ? { x: t.signedWidth, y: t.signedHeight } : "clientX" in t ? { x: t.clientX, y: t.clientY } : "width" in t ? { x: t.width, y: t.height } : { x: t.x, y: t.y };
|
|
459
|
-
},
|
|
460
|
-
const n =
|
|
470
|
+
}, D = Object.freeze({ x: 0, y: 0 }), dr = Object.freeze({ x: 1, y: 1 }), ys = Object.freeze({ x: 1 / 0, y: 1 / 0 }), bs = Object.freeze({ x: NaN, y: NaN }), Re = (t, e, r = 0) => {
|
|
471
|
+
const n = x(t), s = x(e);
|
|
461
472
|
return r === 0 ? n.x === s.x && n.y === s.y : Math.abs(n.x - s.x) <= r && Math.abs(n.y - s.y) <= r;
|
|
462
|
-
},
|
|
463
|
-
const n =
|
|
473
|
+
}, ws = (t) => Re(t, D), Ut = (t, e, r) => {
|
|
474
|
+
const n = x(t), s = x(e, r);
|
|
464
475
|
return { x: n.x * s.x, y: n.y * s.y };
|
|
465
|
-
},
|
|
466
|
-
const r =
|
|
476
|
+
}, gr = (t, e) => {
|
|
477
|
+
const r = x(t);
|
|
467
478
|
return { x: r.x + e, y: r.y };
|
|
468
|
-
},
|
|
469
|
-
const r =
|
|
479
|
+
}, pr = (t, e) => {
|
|
480
|
+
const r = x(t);
|
|
470
481
|
return { x: r.x, y: r.y + e };
|
|
471
|
-
},
|
|
472
|
-
const o =
|
|
482
|
+
}, me = (t, e, r, ...n) => typeof e == "string" && typeof r == "number" ? e === "x" ? gr(t, r) : pr(t, r) : [t, e, r ?? D, ...n].reduce((s, i) => {
|
|
483
|
+
const o = x(i);
|
|
473
484
|
return { x: s.x + o.x, y: s.y + o.y };
|
|
474
|
-
},
|
|
475
|
-
const n =
|
|
485
|
+
}, D), Os = (t, e, r) => {
|
|
486
|
+
const n = x(t);
|
|
476
487
|
return e === "x" ? { x: r, y: n.y } : { x: n.x, y: r };
|
|
477
|
-
},
|
|
478
|
-
const r =
|
|
488
|
+
}, vs = (t, e) => {
|
|
489
|
+
const r = x(t), n = x(e);
|
|
479
490
|
return Math.sqrt((r.x - n.x) ** 2 + (r.y - n.y) ** 2);
|
|
480
|
-
},
|
|
481
|
-
const r =
|
|
491
|
+
}, Ts = (t, e) => {
|
|
492
|
+
const r = x(t), n = x(e);
|
|
482
493
|
return { x: n.x - r.x, y: n.y - r.y };
|
|
483
|
-
},
|
|
484
|
-
const e =
|
|
494
|
+
}, xs = (t) => {
|
|
495
|
+
const e = x(t);
|
|
485
496
|
return Number.isNaN(e.x) || Number.isNaN(e.y);
|
|
486
|
-
},
|
|
487
|
-
const e =
|
|
497
|
+
}, $s = (t) => {
|
|
498
|
+
const e = x(t);
|
|
488
499
|
return Number.isFinite(e.x) && Number.isFinite(e.y);
|
|
489
|
-
},
|
|
490
|
-
const e =
|
|
500
|
+
}, Ss = (t) => {
|
|
501
|
+
const e = x(t);
|
|
491
502
|
return [e.x, e.y];
|
|
492
|
-
},
|
|
493
|
-
const e =
|
|
503
|
+
}, Ns = (t) => {
|
|
504
|
+
const e = x(t);
|
|
494
505
|
return { left: e.x, top: e.y };
|
|
495
|
-
},
|
|
496
|
-
const r =
|
|
506
|
+
}, ot = (t, e = 0) => {
|
|
507
|
+
const r = x(t);
|
|
497
508
|
return { x: Number(r.x.toFixed(e)), y: Number(r.y.toFixed(e)) };
|
|
498
|
-
},
|
|
499
|
-
const r =
|
|
509
|
+
}, oe = (t, e) => {
|
|
510
|
+
const r = x(t), n = x(e);
|
|
500
511
|
return { x: r.x - n.x, y: r.y - n.y };
|
|
501
|
-
},
|
|
502
|
-
const e =
|
|
512
|
+
}, ue = (t) => {
|
|
513
|
+
const e = x(t), r = Math.hypot(e.x, e.y);
|
|
503
514
|
return r === 0 ? { x: 0, y: 0 } : { x: -e.y / r, y: e.x / r };
|
|
504
|
-
},
|
|
505
|
-
const e =
|
|
515
|
+
}, mr = (t) => {
|
|
516
|
+
const e = x(t), r = Math.hypot(e.x, e.y);
|
|
506
517
|
return r === 0 ? { x: 0, y: 0 } : { x: e.x / r, y: e.y / r };
|
|
507
|
-
},
|
|
508
|
-
const e = t.reduce((r, n) =>
|
|
509
|
-
return
|
|
510
|
-
},
|
|
518
|
+
}, yr = (...t) => {
|
|
519
|
+
const e = t.reduce((r, n) => me(r, n), D);
|
|
520
|
+
return Ut(e, 1 / t.length);
|
|
521
|
+
}, Is = (t, e) => {
|
|
511
522
|
const r = [];
|
|
512
523
|
for (let n = 0; n < t.length; n++) {
|
|
513
524
|
const s = t[n];
|
|
514
|
-
let i, o, c,
|
|
525
|
+
let i, o, c, h;
|
|
515
526
|
if (n === 0) {
|
|
516
|
-
const
|
|
517
|
-
o =
|
|
527
|
+
const l = t[n + 1], d = oe(l, s);
|
|
528
|
+
o = ue(d), c = o, h = e;
|
|
518
529
|
} else if (n === t.length - 1) {
|
|
519
|
-
const
|
|
520
|
-
i =
|
|
530
|
+
const l = t[n - 1], d = oe(s, l);
|
|
531
|
+
i = ue(d), c = i, h = e;
|
|
521
532
|
} else {
|
|
522
|
-
const
|
|
523
|
-
i =
|
|
524
|
-
const
|
|
525
|
-
(
|
|
526
|
-
),
|
|
527
|
-
|
|
533
|
+
const l = t[n - 1], d = t[n + 1], m = oe(s, l), p = oe(d, s);
|
|
534
|
+
i = ue(m), o = ue(p);
|
|
535
|
+
const j = Math.acos(
|
|
536
|
+
(m.x * p.x + m.y * p.y) / (Math.hypot(m.x, m.y) * Math.hypot(p.x, p.y))
|
|
537
|
+
), A = Math.sin(j / 2);
|
|
538
|
+
A === 0 ? h = e : h = e / A, c = mr(yr(i, o));
|
|
528
539
|
}
|
|
529
|
-
r.push(
|
|
540
|
+
r.push(Ut(c, h));
|
|
530
541
|
}
|
|
531
542
|
return r;
|
|
532
|
-
},
|
|
533
|
-
const e =
|
|
543
|
+
}, Ms = (t) => {
|
|
544
|
+
const e = x(t);
|
|
534
545
|
return { x: e.y, y: e.x };
|
|
535
|
-
},
|
|
536
|
-
const e =
|
|
546
|
+
}, ut = (t) => {
|
|
547
|
+
const e = x(t);
|
|
537
548
|
return { x: Math.round(e.x), y: Math.round(e.y) };
|
|
538
|
-
},
|
|
549
|
+
}, No = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
539
550
|
__proto__: null,
|
|
540
|
-
INFINITY:
|
|
541
|
-
NAN:
|
|
542
|
-
ONE:
|
|
543
|
-
ZERO:
|
|
544
|
-
average:
|
|
545
|
-
calculateMiters:
|
|
546
|
-
clientXY:
|
|
547
|
-
construct:
|
|
548
|
-
couple:
|
|
549
|
-
crudeZ:
|
|
550
|
-
css:
|
|
551
|
-
distance:
|
|
552
|
-
equals:
|
|
553
|
-
isFinite:
|
|
554
|
-
isNan:
|
|
555
|
-
isZero:
|
|
556
|
-
normal:
|
|
557
|
-
normalize:
|
|
558
|
-
round:
|
|
559
|
-
scale:
|
|
560
|
-
set:
|
|
561
|
-
sub:
|
|
562
|
-
swap:
|
|
563
|
-
translate:
|
|
564
|
-
translateX:
|
|
565
|
-
translateY:
|
|
566
|
-
translation:
|
|
567
|
-
truncate:
|
|
568
|
-
xy:
|
|
569
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
570
|
-
top:
|
|
571
|
-
left:
|
|
572
|
-
width:
|
|
573
|
-
height:
|
|
574
|
-
}),
|
|
551
|
+
INFINITY: ys,
|
|
552
|
+
NAN: bs,
|
|
553
|
+
ONE: dr,
|
|
554
|
+
ZERO: D,
|
|
555
|
+
average: yr,
|
|
556
|
+
calculateMiters: Is,
|
|
557
|
+
clientXY: tr,
|
|
558
|
+
construct: x,
|
|
559
|
+
couple: Ss,
|
|
560
|
+
crudeZ: at,
|
|
561
|
+
css: Ns,
|
|
562
|
+
distance: vs,
|
|
563
|
+
equals: Re,
|
|
564
|
+
isFinite: $s,
|
|
565
|
+
isNan: xs,
|
|
566
|
+
isZero: ws,
|
|
567
|
+
normal: ue,
|
|
568
|
+
normalize: mr,
|
|
569
|
+
round: ut,
|
|
570
|
+
scale: Ut,
|
|
571
|
+
set: Os,
|
|
572
|
+
sub: oe,
|
|
573
|
+
swap: Ms,
|
|
574
|
+
translate: me,
|
|
575
|
+
translateX: gr,
|
|
576
|
+
translateY: pr,
|
|
577
|
+
translation: Ts,
|
|
578
|
+
truncate: ot,
|
|
579
|
+
xy: ge
|
|
580
|
+
}, Symbol.toStringTag, { value: "Module" })), xe = a.union([a.number(), a.string()]), Es = a.object({
|
|
581
|
+
top: xe,
|
|
582
|
+
left: xe,
|
|
583
|
+
width: xe,
|
|
584
|
+
height: xe
|
|
585
|
+
}), As = a.object({
|
|
575
586
|
left: a.number(),
|
|
576
587
|
top: a.number(),
|
|
577
588
|
right: a.number(),
|
|
578
589
|
bottom: a.number()
|
|
579
|
-
}),
|
|
580
|
-
one:
|
|
581
|
-
two:
|
|
582
|
-
root:
|
|
583
|
-
}),
|
|
590
|
+
}), Bs = a.object({
|
|
591
|
+
one: ge,
|
|
592
|
+
two: ge,
|
|
593
|
+
root: hr
|
|
594
|
+
}), br = { one: D, two: D, root: ve }, Us = { one: D, two: dr, root: Fe }, wr = (t, e) => ({
|
|
584
595
|
one: t.one,
|
|
585
596
|
two: t.two,
|
|
586
597
|
root: e ?? t.root
|
|
587
|
-
}),
|
|
598
|
+
}), T = (t, e, r = 0, n = 0, s) => {
|
|
588
599
|
const i = {
|
|
589
|
-
one: { ...
|
|
590
|
-
two: { ...
|
|
591
|
-
root: s ??
|
|
600
|
+
one: { ...D },
|
|
601
|
+
two: { ...D },
|
|
602
|
+
root: s ?? ve
|
|
592
603
|
};
|
|
593
604
|
if (typeof t == "number") {
|
|
594
605
|
if (typeof e != "number")
|
|
@@ -602,219 +613,219 @@ const Nn = a.enum([...dt.options, ...mt.options]), In = a.union([dt, mt, a.insta
|
|
|
602
613
|
x: i.one.x + e.signedWidth,
|
|
603
614
|
y: i.one.y + e.signedHeight
|
|
604
615
|
} : i.two = e, i));
|
|
605
|
-
},
|
|
606
|
-
const n =
|
|
616
|
+
}, Cs = (t, e, r) => {
|
|
617
|
+
const n = T(t);
|
|
607
618
|
if (typeof e == "string") {
|
|
608
619
|
if (r == null) throw new Error("Invalid arguments for resize");
|
|
609
|
-
const s =
|
|
610
|
-
return
|
|
620
|
+
const s = H(e);
|
|
621
|
+
return T(
|
|
611
622
|
n.one,
|
|
612
623
|
void 0,
|
|
613
|
-
s === "x" ? r :
|
|
614
|
-
s === "y" ? r :
|
|
624
|
+
s === "x" ? r : V(n),
|
|
625
|
+
s === "y" ? r : G(n),
|
|
615
626
|
n.root
|
|
616
627
|
);
|
|
617
628
|
}
|
|
618
|
-
return
|
|
619
|
-
},
|
|
620
|
-
const n =
|
|
629
|
+
return T(n.one, e, void 0, void 0, n.root);
|
|
630
|
+
}, js = (t, e, r = !0) => {
|
|
631
|
+
const n = T(t);
|
|
621
632
|
let s = (i, o) => i < o;
|
|
622
|
-
return r && (s = (i, o) => i <= o), "one" in e ? s(
|
|
623
|
-
},
|
|
624
|
-
width:
|
|
625
|
-
height:
|
|
626
|
-
}),
|
|
627
|
-
signedWidth:
|
|
628
|
-
signedHeight:
|
|
629
|
-
}),
|
|
630
|
-
top:
|
|
631
|
-
left:
|
|
632
|
-
width:
|
|
633
|
-
height:
|
|
634
|
-
}),
|
|
635
|
-
const n =
|
|
633
|
+
return r && (s = (i, o) => i <= o), "one" in e ? s(Z(n), Z(e)) && s(X(e), X(n)) && s(Y(n), Y(e)) && s(K(e), K(n)) : s(Z(n), e.x) && s(e.x, X(n)) && s(Y(n), e.y) && s(e.y, K(n));
|
|
634
|
+
}, Rs = (t, e) => Re(t.one, e.one) && Re(t.two, e.two) && Bt(t.root, e.root), Or = (t) => ({
|
|
635
|
+
width: V(t),
|
|
636
|
+
height: G(t)
|
|
637
|
+
}), Ls = (t) => ({
|
|
638
|
+
signedWidth: Ze(t),
|
|
639
|
+
signedHeight: Ye(t)
|
|
640
|
+
}), Ds = (t) => ({
|
|
641
|
+
top: Y(t),
|
|
642
|
+
left: Z(t),
|
|
643
|
+
width: V(t),
|
|
644
|
+
height: G(t)
|
|
645
|
+
}), Ct = (t, e, r = !1) => {
|
|
646
|
+
const n = H(e) === "y" ? Ye(t) : Ze(t);
|
|
636
647
|
return r ? n : Math.abs(n);
|
|
637
|
-
},
|
|
638
|
-
const r =
|
|
648
|
+
}, q = (t, e) => {
|
|
649
|
+
const r = T(t);
|
|
639
650
|
return {
|
|
640
|
-
x: e.x === "center" ?
|
|
641
|
-
y: e.y === "center" ?
|
|
651
|
+
x: e.x === "center" ? lt(r).x : Q(r, e.x),
|
|
652
|
+
y: e.y === "center" ? lt(r).y : Q(r, e.y)
|
|
642
653
|
};
|
|
643
|
-
},
|
|
644
|
-
const r =
|
|
645
|
-
return
|
|
646
|
-
},
|
|
647
|
-
const e =
|
|
654
|
+
}, Q = (t, e) => {
|
|
655
|
+
const r = T(t), n = fr(r.root).includes(e) ? Math.min : Math.max;
|
|
656
|
+
return ke.includes(e) ? n(r.one.x, r.two.x) : n(r.one.y, r.two.y);
|
|
657
|
+
}, Ps = (t) => t.one.x === t.two.x && t.one.y === t.two.y, V = (t) => Ct(t, "x"), G = (t) => Ct(t, "y"), Ze = (t) => {
|
|
658
|
+
const e = T(t);
|
|
648
659
|
return e.two.x - e.one.x;
|
|
649
|
-
},
|
|
650
|
-
const e =
|
|
660
|
+
}, Ye = (t) => {
|
|
661
|
+
const e = T(t);
|
|
651
662
|
return e.two.y - e.one.y;
|
|
652
|
-
},
|
|
653
|
-
x:
|
|
654
|
-
y:
|
|
655
|
-
}),
|
|
656
|
-
const e =
|
|
657
|
-
return e.root.x === "left" ?
|
|
658
|
-
},
|
|
659
|
-
const e =
|
|
660
|
-
return e.root.y === "top" ?
|
|
661
|
-
},
|
|
662
|
-
const e =
|
|
663
|
+
}, vr = (t) => q(t, ve), qs = (t) => q(t, It), ks = (t) => q(t, $t), zs = (t) => q(t, Fe), Fs = (t) => q(t, Mt), Zs = (t) => q(t, St), Ys = (t) => q(t, At), Ws = (t) => q(t, Et), X = (t) => Q(t, "right"), K = (t) => Q(t, "bottom"), Z = (t) => Q(t, "left"), Y = (t) => Q(t, "top"), lt = (t) => me(vr(t), {
|
|
664
|
+
x: Ze(t) / 2,
|
|
665
|
+
y: Ye(t) / 2
|
|
666
|
+
}), jt = (t) => {
|
|
667
|
+
const e = T(t);
|
|
668
|
+
return e.root.x === "left" ? Z(e) : X(e);
|
|
669
|
+
}, Rt = (t) => {
|
|
670
|
+
const e = T(t);
|
|
671
|
+
return e.root.y === "top" ? Y(e) : K(e);
|
|
672
|
+
}, Vs = (t) => ({ x: jt(t), y: Rt(t) }), Ae = (t) => {
|
|
673
|
+
const e = T(t);
|
|
663
674
|
return { lower: e.one.x, upper: e.two.x };
|
|
664
|
-
},
|
|
665
|
-
const e =
|
|
675
|
+
}, Be = (t) => {
|
|
676
|
+
const e = T(t);
|
|
666
677
|
return { lower: e.one.y, upper: e.two.y };
|
|
667
|
-
},
|
|
668
|
-
const r =
|
|
678
|
+
}, Gs = (t, e) => wr(t, e), Hs = (t, e) => {
|
|
679
|
+
const r = T(t), n = ke.includes(e) ? "x" : ze.includes(e) ? "y" : null;
|
|
669
680
|
if (n === null) throw new Error(`Invalid location: ${e}`);
|
|
670
681
|
const s = e === "top" || e === "left" ? Math.min : Math.max, i = { ...r.one }, o = { ...r.two };
|
|
671
682
|
return i[n] = s(r.one[n], r.two[n]), o[n] = s(r.one[n], r.two[n]), [i, o];
|
|
672
|
-
},
|
|
673
|
-
const r =
|
|
674
|
-
return
|
|
675
|
-
},
|
|
683
|
+
}, Js = (t, e) => {
|
|
684
|
+
const r = T(t), n = T(e), s = jt(n) + (V(n) - V(r)) / 2, i = Rt(n) + (G(n) - G(r)) / 2;
|
|
685
|
+
return T({ x: s, y: i }, Or(r));
|
|
686
|
+
}, Tr = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, Xs = (t) => V(t) / G(t), Ks = (t, e, r) => {
|
|
676
687
|
if (typeof e == "string") {
|
|
677
688
|
if (r == null) throw new Error("Undefined amount passed into box.translate");
|
|
678
|
-
const s =
|
|
679
|
-
e =
|
|
689
|
+
const s = H(e);
|
|
690
|
+
e = x(s, r);
|
|
680
691
|
}
|
|
681
|
-
const n =
|
|
682
|
-
return
|
|
683
|
-
|
|
684
|
-
|
|
692
|
+
const n = T(t);
|
|
693
|
+
return T(
|
|
694
|
+
me(n.one, e),
|
|
695
|
+
me(n.two, e),
|
|
685
696
|
void 0,
|
|
686
697
|
void 0,
|
|
687
698
|
n.root
|
|
688
699
|
);
|
|
689
|
-
},
|
|
690
|
-
const r = Math.max(
|
|
691
|
-
return r > s || n > i ?
|
|
692
|
-
},
|
|
693
|
-
const r =
|
|
694
|
-
return
|
|
695
|
-
|
|
696
|
-
|
|
700
|
+
}, Qs = (t, e) => {
|
|
701
|
+
const r = Math.max(Z(t), Z(e)), n = Math.max(Y(t), Y(e)), s = Math.min(X(t), X(e)), i = Math.min(K(t), K(e));
|
|
702
|
+
return r > s || n > i ? br : T({ x: r, y: n }, { x: s, y: i }, void 0, void 0, t.root);
|
|
703
|
+
}, _s = (t) => V(t) * G(t), ei = (t, e) => {
|
|
704
|
+
const r = T(t);
|
|
705
|
+
return T(
|
|
706
|
+
ot(r.one, e),
|
|
707
|
+
ot(r.two, e),
|
|
697
708
|
void 0,
|
|
698
709
|
void 0,
|
|
699
710
|
r.root
|
|
700
711
|
);
|
|
701
|
-
},
|
|
712
|
+
}, ti = (t, e, r, n, s, i) => {
|
|
702
713
|
const o = { x: t, y: e }, c = { x: t + r, y: e + n };
|
|
703
|
-
return s.x !== i.x && (s.x === "center" ? (o.x -= r / 2, c.x -= r / 2) : (o.x -= r, c.x -= r)), s.y !== i.y && (s.y === "center" ? (o.y -= n / 2, c.y -= n / 2) : (o.y -= n, c.y -= n)),
|
|
704
|
-
},
|
|
705
|
-
const e =
|
|
706
|
-
return
|
|
707
|
-
},
|
|
714
|
+
return s.x !== i.x && (s.x === "center" ? (o.x -= r / 2, c.x -= r / 2) : (o.x -= r, c.x -= r)), s.y !== i.y && (s.y === "center" ? (o.y -= n / 2, c.y -= n / 2) : (o.y -= n, c.y -= n)), T(o, c, void 0, void 0, i);
|
|
715
|
+
}, ri = (t) => {
|
|
716
|
+
const e = T(t);
|
|
717
|
+
return T(ut(e.one), ut(e.two), void 0, void 0, e.root);
|
|
718
|
+
}, Io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
708
719
|
__proto__: null,
|
|
709
|
-
DECIMAL:
|
|
710
|
-
ZERO:
|
|
711
|
-
area:
|
|
712
|
-
areaIsZero:
|
|
713
|
-
aspect:
|
|
714
|
-
bottom:
|
|
715
|
-
bottomCenter:
|
|
716
|
-
bottomLeft:
|
|
717
|
-
bottomRight:
|
|
718
|
-
box:
|
|
719
|
-
center:
|
|
720
|
-
centerLeft:
|
|
721
|
-
centerRight:
|
|
722
|
-
construct:
|
|
723
|
-
constructWithAlternateRoot:
|
|
724
|
-
contains:
|
|
725
|
-
copy:
|
|
726
|
-
css:
|
|
727
|
-
cssBox:
|
|
728
|
-
dim:
|
|
729
|
-
dims:
|
|
730
|
-
domRect:
|
|
731
|
-
edgePoints:
|
|
732
|
-
equals:
|
|
733
|
-
height:
|
|
734
|
-
intersection:
|
|
735
|
-
isBox:
|
|
736
|
-
left:
|
|
737
|
-
loc:
|
|
738
|
-
positionInCenter:
|
|
739
|
-
reRoot:
|
|
740
|
-
resize:
|
|
741
|
-
right:
|
|
742
|
-
root:
|
|
743
|
-
round:
|
|
744
|
-
signedDims:
|
|
745
|
-
signedHeight:
|
|
746
|
-
signedWidth:
|
|
747
|
-
top:
|
|
748
|
-
topCenter:
|
|
749
|
-
topLeft:
|
|
750
|
-
topRight:
|
|
751
|
-
translate:
|
|
752
|
-
truncate:
|
|
753
|
-
width:
|
|
754
|
-
x:
|
|
755
|
-
xBounds:
|
|
756
|
-
xyLoc:
|
|
757
|
-
y:
|
|
758
|
-
yBounds:
|
|
759
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
720
|
+
DECIMAL: Us,
|
|
721
|
+
ZERO: br,
|
|
722
|
+
area: _s,
|
|
723
|
+
areaIsZero: Ps,
|
|
724
|
+
aspect: Xs,
|
|
725
|
+
bottom: K,
|
|
726
|
+
bottomCenter: Fs,
|
|
727
|
+
bottomLeft: zs,
|
|
728
|
+
bottomRight: Zs,
|
|
729
|
+
box: Bs,
|
|
730
|
+
center: lt,
|
|
731
|
+
centerLeft: Ys,
|
|
732
|
+
centerRight: Ws,
|
|
733
|
+
construct: T,
|
|
734
|
+
constructWithAlternateRoot: ti,
|
|
735
|
+
contains: js,
|
|
736
|
+
copy: wr,
|
|
737
|
+
css: Ds,
|
|
738
|
+
cssBox: Es,
|
|
739
|
+
dim: Ct,
|
|
740
|
+
dims: Or,
|
|
741
|
+
domRect: As,
|
|
742
|
+
edgePoints: Hs,
|
|
743
|
+
equals: Rs,
|
|
744
|
+
height: G,
|
|
745
|
+
intersection: Qs,
|
|
746
|
+
isBox: Tr,
|
|
747
|
+
left: Z,
|
|
748
|
+
loc: Q,
|
|
749
|
+
positionInCenter: Js,
|
|
750
|
+
reRoot: Gs,
|
|
751
|
+
resize: Cs,
|
|
752
|
+
right: X,
|
|
753
|
+
root: Vs,
|
|
754
|
+
round: ri,
|
|
755
|
+
signedDims: Ls,
|
|
756
|
+
signedHeight: Ye,
|
|
757
|
+
signedWidth: Ze,
|
|
758
|
+
top: Y,
|
|
759
|
+
topCenter: qs,
|
|
760
|
+
topLeft: vr,
|
|
761
|
+
topRight: ks,
|
|
762
|
+
translate: Ks,
|
|
763
|
+
truncate: ei,
|
|
764
|
+
width: V,
|
|
765
|
+
x: jt,
|
|
766
|
+
xBounds: Ae,
|
|
767
|
+
xyLoc: q,
|
|
768
|
+
y: Rt,
|
|
769
|
+
yBounds: Be
|
|
770
|
+
}, Symbol.toStringTag, { value: "Module" })), xr = a.object({ signedWidth: a.number(), signedHeight: a.number() }), ni = a.union([bt, xr, ge, Pe]), si = { width: 0, height: 0 }, ii = { width: 1, height: 1 }, C = (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 }, ai = (t, e) => {
|
|
760
771
|
if (e == null) return !1;
|
|
761
|
-
const r =
|
|
772
|
+
const r = C(t), n = C(e);
|
|
762
773
|
return r.width === n.width && r.height === n.height;
|
|
763
|
-
},
|
|
764
|
-
const e =
|
|
774
|
+
}, oi = (t) => {
|
|
775
|
+
const e = C(t);
|
|
765
776
|
return { width: e.height, height: e.width };
|
|
766
|
-
},
|
|
767
|
-
const e =
|
|
777
|
+
}, ui = (t) => {
|
|
778
|
+
const e = C(t);
|
|
768
779
|
return `0 0 ${e.width} ${e.height}`;
|
|
769
|
-
},
|
|
770
|
-
const e =
|
|
780
|
+
}, li = (t) => {
|
|
781
|
+
const e = C(t);
|
|
771
782
|
return [e.width, e.height];
|
|
772
|
-
},
|
|
773
|
-
width: Math.max(...t.map((e) =>
|
|
774
|
-
height: Math.max(...t.map((e) =>
|
|
775
|
-
}),
|
|
776
|
-
width: Math.min(...t.map((e) =>
|
|
777
|
-
height: Math.min(...t.map((e) =>
|
|
778
|
-
}),
|
|
779
|
-
const r =
|
|
783
|
+
}, ci = (t) => ({
|
|
784
|
+
width: Math.max(...t.map((e) => C(e).width)),
|
|
785
|
+
height: Math.max(...t.map((e) => C(e).height))
|
|
786
|
+
}), hi = (t) => ({
|
|
787
|
+
width: Math.min(...t.map((e) => C(e).width)),
|
|
788
|
+
height: Math.min(...t.map((e) => C(e).height))
|
|
789
|
+
}), fi = (t, e) => {
|
|
790
|
+
const r = C(t);
|
|
780
791
|
return { width: r.width * e, height: r.height * e };
|
|
781
|
-
},
|
|
792
|
+
}, Mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
782
793
|
__proto__: null,
|
|
783
|
-
DECIMAL:
|
|
784
|
-
ZERO:
|
|
785
|
-
construct:
|
|
786
|
-
couple:
|
|
787
|
-
crude:
|
|
788
|
-
dimensions:
|
|
789
|
-
equals:
|
|
790
|
-
max:
|
|
791
|
-
min:
|
|
792
|
-
scale:
|
|
793
|
-
signed:
|
|
794
|
-
svgViewBox:
|
|
795
|
-
swap:
|
|
796
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
794
|
+
DECIMAL: ii,
|
|
795
|
+
ZERO: si,
|
|
796
|
+
construct: C,
|
|
797
|
+
couple: li,
|
|
798
|
+
crude: ni,
|
|
799
|
+
dimensions: bt,
|
|
800
|
+
equals: ai,
|
|
801
|
+
max: ci,
|
|
802
|
+
min: hi,
|
|
803
|
+
scale: fi,
|
|
804
|
+
signed: xr,
|
|
805
|
+
svgViewBox: ui,
|
|
806
|
+
swap: oi
|
|
807
|
+
}, Symbol.toStringTag, { value: "Module" })), di = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r : t, gi = a.object({ offset: at, scale: at }), pi = a.object({ offset: a.number(), scale: a.number() }), mi = (t) => (e, r, n, s) => r === "dimension" ? [e, n] : [
|
|
797
808
|
e,
|
|
798
809
|
s ? n - t : n + t
|
|
799
|
-
],
|
|
810
|
+
], yi = (t) => (e, r, n, s) => [
|
|
800
811
|
e,
|
|
801
812
|
s ? n / t : n * t
|
|
802
|
-
],
|
|
813
|
+
], bi = (t) => (e, r, n) => {
|
|
803
814
|
if (e === null) return [t, n];
|
|
804
|
-
const { lower: s, upper: i } = e, { lower: o, upper: c } = t,
|
|
805
|
-
if (r === "dimension") return [t, n * (
|
|
806
|
-
const
|
|
807
|
-
return [t,
|
|
808
|
-
},
|
|
815
|
+
const { lower: s, upper: i } = e, { lower: o, upper: c } = t, h = i - s, l = c - o;
|
|
816
|
+
if (r === "dimension") return [t, n * (l / h)];
|
|
817
|
+
const d = (n - s) * (l / h) + o;
|
|
818
|
+
return [t, d];
|
|
819
|
+
}, wi = (t) => (e, r, n) => [t, n], Oi = () => (t, e, r) => {
|
|
809
820
|
if (t === null) throw new Error("cannot invert without bounds");
|
|
810
821
|
if (e === "dimension") return [t, r];
|
|
811
822
|
const { lower: n, upper: s } = t;
|
|
812
823
|
return [t, s - (r - n)];
|
|
813
|
-
},
|
|
824
|
+
}, vi = (t) => (e, r, n) => {
|
|
814
825
|
const { lower: s, upper: i } = t;
|
|
815
|
-
return n =
|
|
826
|
+
return n = di(n, s, i), [e, n];
|
|
816
827
|
};
|
|
817
|
-
let
|
|
828
|
+
let ct = class te {
|
|
818
829
|
ops = [];
|
|
819
830
|
currBounds = null;
|
|
820
831
|
currType = null;
|
|
@@ -828,7 +839,7 @@ let st = class K {
|
|
|
828
839
|
* @param value - The amount to translate by.
|
|
829
840
|
*/
|
|
830
841
|
static translate(e) {
|
|
831
|
-
return new
|
|
842
|
+
return new te().translate(e);
|
|
832
843
|
}
|
|
833
844
|
/**
|
|
834
845
|
* @returns a new scale with a magnification as its first operation. Any number provided
|
|
@@ -836,10 +847,10 @@ let st = class K {
|
|
|
836
847
|
* @param value - The amount to translate by.
|
|
837
848
|
*/
|
|
838
849
|
static magnify(e) {
|
|
839
|
-
return new
|
|
850
|
+
return new te().magnify(e);
|
|
840
851
|
}
|
|
841
852
|
static scale(e, r) {
|
|
842
|
-
return new
|
|
853
|
+
return new te().scale(e, r);
|
|
843
854
|
}
|
|
844
855
|
/**
|
|
845
856
|
* @returns a copy of the scale with a translation as its next operation. Any
|
|
@@ -848,7 +859,7 @@ let st = class K {
|
|
|
848
859
|
* @param value - The amount to translate by.
|
|
849
860
|
*/
|
|
850
861
|
translate(e) {
|
|
851
|
-
const r = this.new(), n =
|
|
862
|
+
const r = this.new(), n = mi(e);
|
|
852
863
|
return n.type = "translate", r.ops.push(n), r;
|
|
853
864
|
}
|
|
854
865
|
/**
|
|
@@ -858,23 +869,23 @@ let st = class K {
|
|
|
858
869
|
* @param value - The amount to magnify by.
|
|
859
870
|
*/
|
|
860
871
|
magnify(e) {
|
|
861
|
-
const r = this.new(), n =
|
|
872
|
+
const r = this.new(), n = yi(e);
|
|
862
873
|
return n.type = "magnify", r.ops.push(n), r;
|
|
863
874
|
}
|
|
864
875
|
scale(e, r) {
|
|
865
|
-
const n = y(e, r), s = this.new(), i =
|
|
876
|
+
const n = y(e, r), s = this.new(), i = bi(n);
|
|
866
877
|
return i.type = "scale", s.ops.push(i), s;
|
|
867
878
|
}
|
|
868
879
|
clamp(e, r) {
|
|
869
|
-
const n = y(e, r), s = this.new(), i =
|
|
880
|
+
const n = y(e, r), s = this.new(), i = vi(n);
|
|
870
881
|
return i.type = "clamp", s.ops.push(i), s;
|
|
871
882
|
}
|
|
872
883
|
reBound(e, r) {
|
|
873
|
-
const n = y(e, r), s = this.new(), i =
|
|
884
|
+
const n = y(e, r), s = this.new(), i = wi(n);
|
|
874
885
|
return i.type = "re-bound", s.ops.push(i), s;
|
|
875
886
|
}
|
|
876
887
|
invert() {
|
|
877
|
-
const e =
|
|
888
|
+
const e = Oi();
|
|
878
889
|
e.type = "invert";
|
|
879
890
|
const r = this.new();
|
|
880
891
|
return r.ops.push(e), r;
|
|
@@ -886,7 +897,7 @@ let st = class K {
|
|
|
886
897
|
return this.exec("dimension", e);
|
|
887
898
|
}
|
|
888
899
|
new() {
|
|
889
|
-
const e = new
|
|
900
|
+
const e = new te();
|
|
890
901
|
return e.ops = this.ops.slice(), e.reversed = this.reversed, e;
|
|
891
902
|
}
|
|
892
903
|
exec(e, r) {
|
|
@@ -912,37 +923,37 @@ let st = class K {
|
|
|
912
923
|
get transform() {
|
|
913
924
|
return { scale: this.dim(1), offset: this.pos(0) };
|
|
914
925
|
}
|
|
915
|
-
static IDENTITY = new
|
|
916
|
-
},
|
|
926
|
+
static IDENTITY = new te();
|
|
927
|
+
}, Ti = class R {
|
|
917
928
|
x;
|
|
918
929
|
y;
|
|
919
930
|
currRoot;
|
|
920
|
-
constructor(e = new
|
|
931
|
+
constructor(e = new ct(), r = new ct(), n = null) {
|
|
921
932
|
this.x = e, this.y = r, this.currRoot = n;
|
|
922
933
|
}
|
|
923
934
|
static translate(e, r) {
|
|
924
|
-
return new
|
|
935
|
+
return new R().translate(e, r);
|
|
925
936
|
}
|
|
926
937
|
static translateX(e) {
|
|
927
|
-
return new
|
|
938
|
+
return new R().translateX(e);
|
|
928
939
|
}
|
|
929
940
|
static translateY(e) {
|
|
930
|
-
return new
|
|
941
|
+
return new R().translateY(e);
|
|
931
942
|
}
|
|
932
943
|
static clamp(e) {
|
|
933
|
-
return new
|
|
944
|
+
return new R().clamp(e);
|
|
934
945
|
}
|
|
935
946
|
static magnify(e) {
|
|
936
|
-
return new
|
|
947
|
+
return new R().magnify(e);
|
|
937
948
|
}
|
|
938
949
|
static scale(e) {
|
|
939
|
-
return new
|
|
950
|
+
return new R().scale(e);
|
|
940
951
|
}
|
|
941
952
|
static reBound(e) {
|
|
942
|
-
return new
|
|
953
|
+
return new R().reBound(e);
|
|
943
954
|
}
|
|
944
955
|
translate(e, r) {
|
|
945
|
-
const n =
|
|
956
|
+
const n = x(e, r), s = this.copy();
|
|
946
957
|
return s.x = this.x.translate(n.x), s.y = this.y.translate(n.y), s;
|
|
947
958
|
}
|
|
948
959
|
translateX(e) {
|
|
@@ -959,22 +970,22 @@ let st = class K {
|
|
|
959
970
|
}
|
|
960
971
|
scale(e) {
|
|
961
972
|
const r = this.copy();
|
|
962
|
-
if (
|
|
973
|
+
if (Tr(e)) {
|
|
963
974
|
const n = this.currRoot;
|
|
964
|
-
return r.currRoot = e.root, n != null && !
|
|
975
|
+
return r.currRoot = e.root, n != null && !Bt(n, e.root) && (n.x !== e.root.x && (r.x = r.x.invert()), n.y !== e.root.y && (r.y = r.y.invert())), r.x = r.x.scale(Ae(e)), r.y = r.y.scale(Be(e)), r;
|
|
965
976
|
}
|
|
966
977
|
return r.x = r.x.scale(e.width), r.y = r.y.scale(e.height), r;
|
|
967
978
|
}
|
|
968
979
|
reBound(e) {
|
|
969
980
|
const r = this.copy();
|
|
970
|
-
return r.x = this.x.reBound(
|
|
981
|
+
return r.x = this.x.reBound(Ae(e)), r.y = this.y.reBound(Be(e)), r;
|
|
971
982
|
}
|
|
972
983
|
clamp(e) {
|
|
973
984
|
const r = this.copy();
|
|
974
|
-
return r.x = this.x.clamp(
|
|
985
|
+
return r.x = this.x.clamp(Ae(e)), r.y = this.y.clamp(Be(e)), r;
|
|
975
986
|
}
|
|
976
987
|
copy() {
|
|
977
|
-
const e = new
|
|
988
|
+
const e = new R();
|
|
978
989
|
return e.currRoot = this.currRoot, e.x = this.x, e.y = this.y, e;
|
|
979
990
|
}
|
|
980
991
|
reverse() {
|
|
@@ -988,7 +999,7 @@ let st = class K {
|
|
|
988
999
|
return { x: this.x.dim(e.x), y: this.y.dim(e.y) };
|
|
989
1000
|
}
|
|
990
1001
|
box(e) {
|
|
991
|
-
return
|
|
1002
|
+
return T(
|
|
992
1003
|
this.pos(e.one),
|
|
993
1004
|
this.pos(e.two),
|
|
994
1005
|
0,
|
|
@@ -1002,62 +1013,62 @@ let st = class K {
|
|
|
1002
1013
|
offset: this.pos({ x: 0, y: 0 })
|
|
1003
1014
|
};
|
|
1004
1015
|
}
|
|
1005
|
-
static IDENTITY = new
|
|
1016
|
+
static IDENTITY = new R();
|
|
1006
1017
|
};
|
|
1007
|
-
const
|
|
1018
|
+
const Eo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1008
1019
|
__proto__: null,
|
|
1009
|
-
Scale:
|
|
1010
|
-
XY:
|
|
1011
|
-
crudeXYTransform:
|
|
1012
|
-
transform:
|
|
1020
|
+
Scale: ct,
|
|
1021
|
+
XY: Ti,
|
|
1022
|
+
crudeXYTransform: gi,
|
|
1023
|
+
transform: pi
|
|
1013
1024
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1014
|
-
let
|
|
1025
|
+
let $r = (t, e = 21) => (r = e) => {
|
|
1015
1026
|
let n = "", s = r | 0;
|
|
1016
1027
|
for (; s--; )
|
|
1017
1028
|
n += t[Math.random() * t.length | 0];
|
|
1018
1029
|
return n;
|
|
1019
1030
|
};
|
|
1020
|
-
const
|
|
1031
|
+
const Sr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", xi = `0123456789${Sr}`, Nr = 11, $i = $r(Sr, 1), Si = $r(xi, Nr - 1), Lt = () => `${$i()}${Si()}`, Ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1021
1032
|
__proto__: null,
|
|
1022
|
-
LENGTH:
|
|
1023
|
-
create:
|
|
1024
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1033
|
+
LENGTH: Nr,
|
|
1034
|
+
create: Lt
|
|
1035
|
+
}, Symbol.toStringTag, { value: "Module" })), Ni = (t, e) => (r) => r instanceof e || typeof r == "object" && r !== null && "discriminator" in r && r.discriminator === t, Ii = a.enum(["static", "dynamic"]), Mi = a.union([
|
|
1025
1036
|
a.tuple([a.int()]),
|
|
1026
1037
|
a.tuple([a.int(), a.int().min(1).max(12)]),
|
|
1027
1038
|
a.tuple([a.int(), a.int().min(1).max(12), a.int().min(1).max(31)])
|
|
1028
|
-
]),
|
|
1039
|
+
]), Ir = (t, e) => {
|
|
1029
1040
|
const r = new b(e);
|
|
1030
1041
|
if (![
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1042
|
+
O.DAY,
|
|
1043
|
+
O.HOUR,
|
|
1044
|
+
O.MINUTE,
|
|
1045
|
+
O.SECOND,
|
|
1046
|
+
O.MILLISECOND,
|
|
1047
|
+
O.MICROSECOND,
|
|
1048
|
+
O.NANOSECOND
|
|
1038
1049
|
].some((s) => s.equals(r)))
|
|
1039
1050
|
throw new Error(
|
|
1040
1051
|
"Invalid argument for remainder. Must be an even TimeSpan or Timestamp"
|
|
1041
1052
|
);
|
|
1042
1053
|
const n = t.valueOf() % r.valueOf();
|
|
1043
|
-
return t instanceof b ? new b(n) : new
|
|
1054
|
+
return t instanceof b ? new b(n) : new O(n);
|
|
1044
1055
|
};
|
|
1045
|
-
let b = class
|
|
1056
|
+
let b = class f extends _ {
|
|
1046
1057
|
constructor(e, r = "UTC") {
|
|
1047
|
-
if (e == null) super(
|
|
1058
|
+
if (e == null) super(f.now().valueOf());
|
|
1048
1059
|
else if (e instanceof Date)
|
|
1049
|
-
super(BigInt(e.getTime()) *
|
|
1060
|
+
super(BigInt(e.getTime()) * f.MILLISECOND.valueOf());
|
|
1050
1061
|
else if (typeof e == "string")
|
|
1051
|
-
super(
|
|
1052
|
-
else if (Array.isArray(e)) super(
|
|
1062
|
+
super(f.parseDateTimeString(e, r).valueOf());
|
|
1063
|
+
else if (Array.isArray(e)) super(f.parseDate(e));
|
|
1053
1064
|
else {
|
|
1054
1065
|
let n = 0n;
|
|
1055
|
-
e instanceof Number && (e = e.valueOf()), r === "local" && (n =
|
|
1066
|
+
e instanceof Number && (e = e.valueOf()), r === "local" && (n = f.utcOffset.valueOf()), typeof e == "number" && (isFinite(e) ? e = Math.trunc(e) : (isNaN(e) && (e = 0), e === 1 / 0 ? e = f.MAX : e = f.MIN)), super(BigInt(e.valueOf()) + n);
|
|
1056
1067
|
}
|
|
1057
1068
|
}
|
|
1058
1069
|
static parseDate([e = 1970, r = 1, n = 1]) {
|
|
1059
1070
|
const s = new Date(e, r - 1, n, 0, 0, 0, 0);
|
|
1060
|
-
return new
|
|
1071
|
+
return new f(BigInt(s.getTime()) * f.MILLISECOND.valueOf()).truncate(f.DAY).valueOf();
|
|
1061
1072
|
}
|
|
1062
1073
|
/**
|
|
1063
1074
|
* @returns the primitive value of the TimeStamp. Overrides standard JS valueOf()
|
|
@@ -1070,15 +1081,15 @@ let b = class d extends J {
|
|
|
1070
1081
|
const [n, s, i] = e.split(":");
|
|
1071
1082
|
let o = "00", c = "00";
|
|
1072
1083
|
i != null && ([o, c] = i.split("."));
|
|
1073
|
-
let
|
|
1074
|
-
return r === "local" && (
|
|
1084
|
+
let h = f.hours(parseInt(n ?? "00")).add(f.minutes(parseInt(s ?? "00"))).add(f.seconds(parseInt(o ?? "00"))).add(f.milliseconds(parseInt(c ?? "00")));
|
|
1085
|
+
return r === "local" && (h = h.add(f.utcOffset)), h.valueOf();
|
|
1075
1086
|
}
|
|
1076
1087
|
static parseDateTimeString(e, r = "UTC") {
|
|
1077
1088
|
if (!e.includes("/") && !e.includes("-"))
|
|
1078
|
-
return
|
|
1089
|
+
return f.parseTimeString(e, r);
|
|
1079
1090
|
const n = new Date(e);
|
|
1080
|
-
return e.includes(":") || n.setUTCHours(0, 0, 0, 0), new
|
|
1081
|
-
BigInt(n.getTime()) *
|
|
1091
|
+
return e.includes(":") || n.setUTCHours(0, 0, 0, 0), new f(
|
|
1092
|
+
BigInt(n.getTime()) * f.MILLISECOND.valueOf(),
|
|
1082
1093
|
r
|
|
1083
1094
|
).valueOf();
|
|
1084
1095
|
}
|
|
@@ -1110,7 +1121,7 @@ let b = class d extends J {
|
|
|
1110
1121
|
}
|
|
1111
1122
|
}
|
|
1112
1123
|
toISOString(e = "UTC") {
|
|
1113
|
-
return e === "UTC" ? this.date().toISOString() : this.sub(
|
|
1124
|
+
return e === "UTC" ? this.date().toISOString() : this.sub(f.utcOffset).date().toISOString();
|
|
1114
1125
|
}
|
|
1115
1126
|
timeString(e = !1, r = "UTC") {
|
|
1116
1127
|
const n = this.toISOString(r);
|
|
@@ -1122,8 +1133,8 @@ let b = class d extends J {
|
|
|
1122
1133
|
}
|
|
1123
1134
|
/** @returns The UTC offset for the time zone of the machine. */
|
|
1124
1135
|
static get utcOffset() {
|
|
1125
|
-
return new
|
|
1126
|
-
BigInt((/* @__PURE__ */ new Date()).getTimezoneOffset()) *
|
|
1136
|
+
return new O(
|
|
1137
|
+
BigInt((/* @__PURE__ */ new Date()).getTimezoneOffset()) * f.MINUTE.valueOf()
|
|
1127
1138
|
);
|
|
1128
1139
|
}
|
|
1129
1140
|
/**
|
|
@@ -1132,7 +1143,7 @@ let b = class d extends J {
|
|
|
1132
1143
|
* @param other - The other timestamp.
|
|
1133
1144
|
*/
|
|
1134
1145
|
static since(e) {
|
|
1135
|
-
return new
|
|
1146
|
+
return new f().span(e);
|
|
1136
1147
|
}
|
|
1137
1148
|
/** @returns A JavaScript Date object representing the TimeStamp. */
|
|
1138
1149
|
date() {
|
|
@@ -1145,7 +1156,7 @@ let b = class d extends J {
|
|
|
1145
1156
|
* @returns True if the TimeStamps are equal, false otherwise.
|
|
1146
1157
|
*/
|
|
1147
1158
|
equals(e) {
|
|
1148
|
-
return this.valueOf() === new
|
|
1159
|
+
return this.valueOf() === new f(e).valueOf();
|
|
1149
1160
|
}
|
|
1150
1161
|
/**
|
|
1151
1162
|
* Creates a TimeSpan representing the duration between the two timestamps.
|
|
@@ -1165,7 +1176,7 @@ let b = class d extends J {
|
|
|
1165
1176
|
* valid, regardless of the TimeStamp order.
|
|
1166
1177
|
*/
|
|
1167
1178
|
range(e) {
|
|
1168
|
-
return new
|
|
1179
|
+
return new J(this, e).makeValid();
|
|
1169
1180
|
}
|
|
1170
1181
|
/**
|
|
1171
1182
|
* Creates a TimeRange starting at the TimeStamp and spanning the given
|
|
@@ -1194,7 +1205,7 @@ let b = class d extends J {
|
|
|
1194
1205
|
* otherwise.
|
|
1195
1206
|
*/
|
|
1196
1207
|
after(e) {
|
|
1197
|
-
return this.valueOf() > new
|
|
1208
|
+
return this.valueOf() > new f(e).valueOf();
|
|
1198
1209
|
}
|
|
1199
1210
|
/**
|
|
1200
1211
|
* Checks if the TimeStamp is after or equal to the given TimeStamp.
|
|
@@ -1204,7 +1215,7 @@ let b = class d extends J {
|
|
|
1204
1215
|
* false otherwise.
|
|
1205
1216
|
*/
|
|
1206
1217
|
afterEq(e) {
|
|
1207
|
-
return this.valueOf() >= new
|
|
1218
|
+
return this.valueOf() >= new f(e).valueOf();
|
|
1208
1219
|
}
|
|
1209
1220
|
/**
|
|
1210
1221
|
* Checks if the TimeStamp is before the given TimeStamp.
|
|
@@ -1214,7 +1225,7 @@ let b = class d extends J {
|
|
|
1214
1225
|
* otherwise.
|
|
1215
1226
|
*/
|
|
1216
1227
|
before(e) {
|
|
1217
|
-
return this.valueOf() < new
|
|
1228
|
+
return this.valueOf() < new f(e).valueOf();
|
|
1218
1229
|
}
|
|
1219
1230
|
/**
|
|
1220
1231
|
* Checks if TimeStamp is before or equal to the current timestamp.
|
|
@@ -1224,7 +1235,7 @@ let b = class d extends J {
|
|
|
1224
1235
|
* false otherwise.
|
|
1225
1236
|
*/
|
|
1226
1237
|
beforeEq(e) {
|
|
1227
|
-
return this.valueOf() <= new
|
|
1238
|
+
return this.valueOf() <= new f(e).valueOf();
|
|
1228
1239
|
}
|
|
1229
1240
|
/**
|
|
1230
1241
|
* Adds a TimeSpan to the TimeStamp.
|
|
@@ -1234,7 +1245,7 @@ let b = class d extends J {
|
|
|
1234
1245
|
* TimeSpan.
|
|
1235
1246
|
*/
|
|
1236
1247
|
add(e) {
|
|
1237
|
-
return new
|
|
1248
|
+
return new f(ie(this.valueOf(), new O(e).valueOf()));
|
|
1238
1249
|
}
|
|
1239
1250
|
/**
|
|
1240
1251
|
* Subtracts a TimeSpan from the TimeStamp.
|
|
@@ -1244,43 +1255,43 @@ let b = class d extends J {
|
|
|
1244
1255
|
* TimeSpan.
|
|
1245
1256
|
*/
|
|
1246
1257
|
sub(e) {
|
|
1247
|
-
return new
|
|
1258
|
+
return new f(P(this.valueOf(), new O(e).valueOf()));
|
|
1248
1259
|
}
|
|
1249
1260
|
/**
|
|
1250
1261
|
* @returns the floating point number of hours since the unix epoch to the timestamp
|
|
1251
1262
|
* value.
|
|
1252
1263
|
*/
|
|
1253
1264
|
get hours() {
|
|
1254
|
-
return Number(this.valueOf()) / Number(
|
|
1265
|
+
return Number(this.valueOf()) / Number(O.HOUR.valueOf());
|
|
1255
1266
|
}
|
|
1256
1267
|
/**
|
|
1257
1268
|
* @returns the floating point number of minutes since the unix epoch to the timestamp
|
|
1258
1269
|
* value.
|
|
1259
1270
|
*/
|
|
1260
1271
|
get minutes() {
|
|
1261
|
-
return Number(this.valueOf()) / Number(
|
|
1272
|
+
return Number(this.valueOf()) / Number(O.MINUTE.valueOf());
|
|
1262
1273
|
}
|
|
1263
1274
|
/**
|
|
1264
1275
|
* @returns the floating point number of days since the unix epoch to the timestamp
|
|
1265
1276
|
* value.
|
|
1266
1277
|
*/
|
|
1267
1278
|
get days() {
|
|
1268
|
-
return Number(this.valueOf()) / Number(
|
|
1279
|
+
return Number(this.valueOf()) / Number(O.DAY.valueOf());
|
|
1269
1280
|
}
|
|
1270
1281
|
/**
|
|
1271
1282
|
* @returns the floating point number of seconds since the unix epoch to the timestamp
|
|
1272
1283
|
* value.
|
|
1273
1284
|
*/
|
|
1274
1285
|
get seconds() {
|
|
1275
|
-
return Number(this.valueOf()) / Number(
|
|
1286
|
+
return Number(this.valueOf()) / Number(O.SECOND.valueOf());
|
|
1276
1287
|
}
|
|
1277
1288
|
/** @returns the floating point number of milliseconds since the unix epoch. */
|
|
1278
1289
|
get milliseconds() {
|
|
1279
|
-
return Number(this.valueOf()) / Number(
|
|
1290
|
+
return Number(this.valueOf()) / Number(f.MILLISECOND.valueOf());
|
|
1280
1291
|
}
|
|
1281
1292
|
/** @returns the floating point number of microseconds since the unix epoch. */
|
|
1282
1293
|
get microseconds() {
|
|
1283
|
-
return Number(this.valueOf()) / Number(
|
|
1294
|
+
return Number(this.valueOf()) / Number(f.MICROSECOND.valueOf());
|
|
1284
1295
|
}
|
|
1285
1296
|
/**
|
|
1286
1297
|
* @returns the floating point number of nanoseconds since the unix epoch.
|
|
@@ -1300,7 +1311,7 @@ let b = class d extends J {
|
|
|
1300
1311
|
*/
|
|
1301
1312
|
setYear(e) {
|
|
1302
1313
|
const r = this.date();
|
|
1303
|
-
return r.setUTCFullYear(e), new
|
|
1314
|
+
return r.setUTCFullYear(e), new f(r);
|
|
1304
1315
|
}
|
|
1305
1316
|
/** @returns the integer month that the timestamp corresponds to with its year. */
|
|
1306
1317
|
get month() {
|
|
@@ -1312,7 +1323,7 @@ let b = class d extends J {
|
|
|
1312
1323
|
*/
|
|
1313
1324
|
setMonth(e) {
|
|
1314
1325
|
const r = this.date();
|
|
1315
|
-
return r.setUTCMonth(e), new
|
|
1326
|
+
return r.setUTCMonth(e), new f(r);
|
|
1316
1327
|
}
|
|
1317
1328
|
/** @returns the integer day that the timestamp corresponds to within its month. */
|
|
1318
1329
|
get day() {
|
|
@@ -1324,7 +1335,7 @@ let b = class d extends J {
|
|
|
1324
1335
|
*/
|
|
1325
1336
|
setDay(e) {
|
|
1326
1337
|
const r = this.date();
|
|
1327
|
-
return r.setUTCDate(e), new
|
|
1338
|
+
return r.setUTCDate(e), new f(r);
|
|
1328
1339
|
}
|
|
1329
1340
|
/**
|
|
1330
1341
|
* @returns the integer hour that the timestamp corresponds to within its day.
|
|
@@ -1338,7 +1349,7 @@ let b = class d extends J {
|
|
|
1338
1349
|
*/
|
|
1339
1350
|
setHour(e) {
|
|
1340
1351
|
const r = this.date();
|
|
1341
|
-
return r.setUTCHours(e), new
|
|
1352
|
+
return r.setUTCHours(e), new f(r, "UTC");
|
|
1342
1353
|
}
|
|
1343
1354
|
/** @returns the integer minute that the timestamp corresponds to within its hour. */
|
|
1344
1355
|
get minute() {
|
|
@@ -1350,7 +1361,7 @@ let b = class d extends J {
|
|
|
1350
1361
|
*/
|
|
1351
1362
|
setMinute(e) {
|
|
1352
1363
|
const r = this.date();
|
|
1353
|
-
return r.setUTCMinutes(e), new
|
|
1364
|
+
return r.setUTCMinutes(e), new f(r);
|
|
1354
1365
|
}
|
|
1355
1366
|
/**
|
|
1356
1367
|
* @returns the integer second that the timestamp corresponds to within its
|
|
@@ -1365,7 +1376,7 @@ let b = class d extends J {
|
|
|
1365
1376
|
*/
|
|
1366
1377
|
setSecond(e) {
|
|
1367
1378
|
const r = this.date();
|
|
1368
|
-
return r.setUTCSeconds(e), new
|
|
1379
|
+
return r.setUTCSeconds(e), new f(r);
|
|
1369
1380
|
}
|
|
1370
1381
|
/**
|
|
1371
1382
|
* @reutrns the integer millisecond that the timestamp corresponds to within
|
|
@@ -1380,7 +1391,7 @@ let b = class d extends J {
|
|
|
1380
1391
|
*/
|
|
1381
1392
|
setMillisecond(e) {
|
|
1382
1393
|
const r = this.date();
|
|
1383
|
-
return r.setUTCMilliseconds(e), new
|
|
1394
|
+
return r.setUTCMilliseconds(e), new f(r);
|
|
1384
1395
|
}
|
|
1385
1396
|
/** @returns the time stamp formatted as an ISO string. */
|
|
1386
1397
|
toString() {
|
|
@@ -1398,11 +1409,11 @@ let b = class d extends J {
|
|
|
1398
1409
|
* @example TimeStamp.now().remainder(TimeStamp.DAY) // => TimeStamp representing the current day
|
|
1399
1410
|
*/
|
|
1400
1411
|
remainder(e) {
|
|
1401
|
-
return
|
|
1412
|
+
return Ir(this, e);
|
|
1402
1413
|
}
|
|
1403
1414
|
/** @returns true if the day portion TimeStamp is today, false otherwise. */
|
|
1404
1415
|
get isToday() {
|
|
1405
|
-
return this.truncate(
|
|
1416
|
+
return this.truncate(O.DAY).equals(f.now().truncate(O.DAY));
|
|
1406
1417
|
}
|
|
1407
1418
|
/**
|
|
1408
1419
|
* Truncates the TimeStamp to the nearest multiple of the given span.
|
|
@@ -1419,7 +1430,7 @@ let b = class d extends J {
|
|
|
1419
1430
|
* JavaScript can do).
|
|
1420
1431
|
*/
|
|
1421
1432
|
static now() {
|
|
1422
|
-
return new
|
|
1433
|
+
return new f(/* @__PURE__ */ new Date());
|
|
1423
1434
|
}
|
|
1424
1435
|
/**
|
|
1425
1436
|
* Finds the maximum timestamp among the provided timestamps.
|
|
@@ -1428,9 +1439,9 @@ let b = class d extends J {
|
|
|
1428
1439
|
* @returns The maximum (latest) timestamp from the input.
|
|
1429
1440
|
*/
|
|
1430
1441
|
static max(...e) {
|
|
1431
|
-
let r =
|
|
1442
|
+
let r = f.MIN;
|
|
1432
1443
|
for (const n of e) {
|
|
1433
|
-
const s = new
|
|
1444
|
+
const s = new f(n);
|
|
1434
1445
|
s.after(r) && (r = s);
|
|
1435
1446
|
}
|
|
1436
1447
|
return r;
|
|
@@ -1442,9 +1453,9 @@ let b = class d extends J {
|
|
|
1442
1453
|
* @returns The minimum (earliest) timestamp from the input.
|
|
1443
1454
|
*/
|
|
1444
1455
|
static min(...e) {
|
|
1445
|
-
let r =
|
|
1456
|
+
let r = f.MAX;
|
|
1446
1457
|
for (const n of e) {
|
|
1447
|
-
const s = new
|
|
1458
|
+
const s = new f(n);
|
|
1448
1459
|
s.before(r) && (r = s);
|
|
1449
1460
|
}
|
|
1450
1461
|
return r;
|
|
@@ -1456,62 +1467,62 @@ let b = class d extends J {
|
|
|
1456
1467
|
* @returns A TimeStamp representing the given number of nanoseconds.
|
|
1457
1468
|
*/
|
|
1458
1469
|
static nanoseconds(e, r = "UTC") {
|
|
1459
|
-
return new
|
|
1470
|
+
return new f(e, r);
|
|
1460
1471
|
}
|
|
1461
1472
|
/** One nanosecond after the unix epoch */
|
|
1462
|
-
static NANOSECOND =
|
|
1473
|
+
static NANOSECOND = f.nanoseconds(1);
|
|
1463
1474
|
/** @returns a new TimeStamp n microseconds after the unix epoch */
|
|
1464
1475
|
static microseconds(e, r = "UTC") {
|
|
1465
|
-
return
|
|
1476
|
+
return f.nanoseconds(e * 1e3, r);
|
|
1466
1477
|
}
|
|
1467
1478
|
/** One microsecond after the unix epoch */
|
|
1468
|
-
static MICROSECOND =
|
|
1479
|
+
static MICROSECOND = f.microseconds(1);
|
|
1469
1480
|
/** @returns a new TimeStamp n milliseconds after the unix epoch */
|
|
1470
1481
|
static milliseconds(e, r = "UTC") {
|
|
1471
|
-
return
|
|
1482
|
+
return f.microseconds(e * 1e3, r);
|
|
1472
1483
|
}
|
|
1473
1484
|
/** One millisecond after the unix epoch */
|
|
1474
|
-
static MILLISECOND =
|
|
1485
|
+
static MILLISECOND = f.milliseconds(1);
|
|
1475
1486
|
/** @returns a new TimeStamp n seconds after the unix epoch */
|
|
1476
1487
|
static seconds(e, r = "UTC") {
|
|
1477
|
-
return
|
|
1488
|
+
return f.milliseconds(e * 1e3, r);
|
|
1478
1489
|
}
|
|
1479
1490
|
/** One second after the unix epoch */
|
|
1480
|
-
static SECOND =
|
|
1491
|
+
static SECOND = f.seconds(1);
|
|
1481
1492
|
/** @returns a new TimeStamp n minutes after the unix epoch */
|
|
1482
1493
|
static minutes(e, r = "UTC") {
|
|
1483
|
-
return
|
|
1494
|
+
return f.seconds(e * 60, r);
|
|
1484
1495
|
}
|
|
1485
1496
|
/** One minute after the unix epoch */
|
|
1486
|
-
static MINUTE =
|
|
1497
|
+
static MINUTE = f.minutes(1);
|
|
1487
1498
|
/** @returns a new TimeStamp n hours after the unix epoch */
|
|
1488
1499
|
static hours(e, r = "UTC") {
|
|
1489
|
-
return
|
|
1500
|
+
return f.minutes(e * 60, r);
|
|
1490
1501
|
}
|
|
1491
1502
|
/** One hour after the unix epoch */
|
|
1492
|
-
static HOUR =
|
|
1503
|
+
static HOUR = f.hours(1);
|
|
1493
1504
|
/** @returns a new TimeStamp n days after the unix epoch */
|
|
1494
1505
|
static days(e, r = "UTC") {
|
|
1495
|
-
return
|
|
1506
|
+
return f.hours(e * 24, r);
|
|
1496
1507
|
}
|
|
1497
1508
|
/** One day after the unix epoch */
|
|
1498
|
-
static DAY =
|
|
1509
|
+
static DAY = f.days(1);
|
|
1499
1510
|
/** The maximum possible value for a timestamp */
|
|
1500
|
-
static MAX = new
|
|
1511
|
+
static MAX = new f((1n << 63n) - 1n);
|
|
1501
1512
|
/** The minimum possible value for a timestamp */
|
|
1502
|
-
static MIN = new
|
|
1513
|
+
static MIN = new f(0);
|
|
1503
1514
|
/** The unix epoch */
|
|
1504
|
-
static ZERO = new
|
|
1515
|
+
static ZERO = new f(0);
|
|
1505
1516
|
/** A zod schema for validating timestamps */
|
|
1506
1517
|
static z = a.union([
|
|
1507
|
-
a.instanceof(
|
|
1508
|
-
a.object({ value: a.bigint() }).transform((e) => new
|
|
1509
|
-
a.string().transform((e) => new
|
|
1510
|
-
a.number().transform((e) => new
|
|
1511
|
-
a.bigint().transform((e) => new
|
|
1512
|
-
a.date().transform((e) => new
|
|
1513
|
-
a.custom((e) => e instanceof
|
|
1514
|
-
|
|
1518
|
+
a.instanceof(f),
|
|
1519
|
+
a.object({ value: a.bigint() }).transform((e) => new f(e.value)),
|
|
1520
|
+
a.string().transform((e) => new f(BigInt(e))),
|
|
1521
|
+
a.number().transform((e) => new f(e)),
|
|
1522
|
+
a.bigint().transform((e) => new f(e)),
|
|
1523
|
+
a.date().transform((e) => new f(e)),
|
|
1524
|
+
a.custom((e) => e instanceof O).transform((e) => new f(e)),
|
|
1525
|
+
Mi.transform((e) => new f(e))
|
|
1515
1526
|
]);
|
|
1516
1527
|
/**
|
|
1517
1528
|
* Sorts two timestamps.
|
|
@@ -1524,8 +1535,7 @@ let b = class d extends J {
|
|
|
1524
1535
|
static sort(e, r) {
|
|
1525
1536
|
return Number(e.valueOf() - r.valueOf());
|
|
1526
1537
|
}
|
|
1527
|
-
}
|
|
1528
|
-
class f extends J {
|
|
1538
|
+
}, O = class g extends _ {
|
|
1529
1539
|
constructor(e) {
|
|
1530
1540
|
typeof e == "number" && (e = Math.trunc(e.valueOf())), super(BigInt(e.valueOf()));
|
|
1531
1541
|
}
|
|
@@ -1536,7 +1546,7 @@ class f extends J {
|
|
|
1536
1546
|
* @returns A TimeSpan representing the given number of seconds.
|
|
1537
1547
|
*/
|
|
1538
1548
|
static fromSeconds(e) {
|
|
1539
|
-
return e instanceof
|
|
1549
|
+
return e instanceof g ? e : e instanceof E ? e.period : e instanceof b ? new g(e) : ["number", "bigint"].includes(typeof e) ? g.seconds(e) : new g(e);
|
|
1540
1550
|
}
|
|
1541
1551
|
/**
|
|
1542
1552
|
* Creates a TimeSpan representing the given number of milliseconds.
|
|
@@ -1545,7 +1555,7 @@ class f extends J {
|
|
|
1545
1555
|
* @returns A TimeSpan representing the given number of milliseconds.
|
|
1546
1556
|
*/
|
|
1547
1557
|
static fromMilliseconds(e) {
|
|
1548
|
-
return e instanceof
|
|
1558
|
+
return e instanceof g ? e : e instanceof E ? e.period : e instanceof b ? new g(e) : ["number", "bigint"].includes(typeof e) ? g.milliseconds(e) : new g(e);
|
|
1549
1559
|
}
|
|
1550
1560
|
/**
|
|
1551
1561
|
* @returns the primitive value of the TimeSpan. Overrides standard JS valueOf()
|
|
@@ -1561,7 +1571,7 @@ class f extends J {
|
|
|
1561
1571
|
* @returns True if the TimeSpan is less than the other TimeSpan, false otherwise.
|
|
1562
1572
|
*/
|
|
1563
1573
|
lessThan(e) {
|
|
1564
|
-
return this.valueOf() < new
|
|
1574
|
+
return this.valueOf() < new g(e).valueOf();
|
|
1565
1575
|
}
|
|
1566
1576
|
/**
|
|
1567
1577
|
* Checks if the TimeSpan is greater than another TimeSpan.
|
|
@@ -1570,7 +1580,7 @@ class f extends J {
|
|
|
1570
1580
|
* @returns True if the TimeSpan is greater than the other TimeSpan, false otherwise.
|
|
1571
1581
|
*/
|
|
1572
1582
|
greaterThan(e) {
|
|
1573
|
-
return this.valueOf() > new
|
|
1583
|
+
return this.valueOf() > new g(e).valueOf();
|
|
1574
1584
|
}
|
|
1575
1585
|
/**
|
|
1576
1586
|
* Checks if the TimeSpan is less than or equal to another TimeSpan.
|
|
@@ -1579,7 +1589,7 @@ class f extends J {
|
|
|
1579
1589
|
* @returns True if the TimeSpan is less than or equal to the other TimeSpan, false otherwise.
|
|
1580
1590
|
*/
|
|
1581
1591
|
lessThanOrEqual(e) {
|
|
1582
|
-
return this.valueOf() <= new
|
|
1592
|
+
return this.valueOf() <= new g(e).valueOf();
|
|
1583
1593
|
}
|
|
1584
1594
|
/**
|
|
1585
1595
|
* Checks if the TimeSpan is greater than or equal to another TimeSpan.
|
|
@@ -1588,7 +1598,7 @@ class f extends J {
|
|
|
1588
1598
|
* @returns True if the TimeSpan is greater than or equal to the other TimeSpan, false otherwise.
|
|
1589
1599
|
*/
|
|
1590
1600
|
greaterThanOrEqual(e) {
|
|
1591
|
-
return this.valueOf() >= new
|
|
1601
|
+
return this.valueOf() >= new g(e).valueOf();
|
|
1592
1602
|
}
|
|
1593
1603
|
/**
|
|
1594
1604
|
* Calculates the remainder of the TimeSpan when divided by another TimeSpan.
|
|
@@ -1597,7 +1607,7 @@ class f extends J {
|
|
|
1597
1607
|
* @returns A new TimeSpan representing the remainder.
|
|
1598
1608
|
*/
|
|
1599
1609
|
remainder(e) {
|
|
1600
|
-
return
|
|
1610
|
+
return Ir(this, e);
|
|
1601
1611
|
}
|
|
1602
1612
|
/**
|
|
1603
1613
|
* Truncates the TimeSpan to the nearest multiple of the given span.
|
|
@@ -1606,7 +1616,7 @@ class f extends J {
|
|
|
1606
1616
|
* @returns A new TimeSpan that is truncated to the nearest multiple of the given span.
|
|
1607
1617
|
*/
|
|
1608
1618
|
truncate(e) {
|
|
1609
|
-
return new
|
|
1619
|
+
return new g(
|
|
1610
1620
|
BigInt(Math.trunc(Number(this.valueOf() / e.valueOf()))) * e.valueOf()
|
|
1611
1621
|
);
|
|
1612
1622
|
}
|
|
@@ -1616,9 +1626,9 @@ class f extends J {
|
|
|
1616
1626
|
* @returns A string representation of the TimeSpan.
|
|
1617
1627
|
*/
|
|
1618
1628
|
toString() {
|
|
1619
|
-
const e = this.truncate(
|
|
1620
|
-
let
|
|
1621
|
-
return
|
|
1629
|
+
const e = this.truncate(g.DAY), r = this.truncate(g.HOUR), n = this.truncate(g.MINUTE), s = this.truncate(g.SECOND), i = this.truncate(g.MILLISECOND), o = this.truncate(g.MICROSECOND), c = this.truncate(g.NANOSECOND), h = e, l = r.sub(e), d = n.sub(r), m = s.sub(n), p = i.sub(s), j = o.sub(i), A = c.sub(o);
|
|
1630
|
+
let k = "";
|
|
1631
|
+
return h.isZero || (k += `${h.days}d `), l.isZero || (k += `${l.hours}h `), d.isZero || (k += `${d.minutes}m `), m.isZero || (k += `${m.seconds}s `), p.isZero || (k += `${p.milliseconds}ms `), j.isZero || (k += `${j.microseconds}µs `), A.isZero || (k += `${A.nanoseconds}ns`), k.trim();
|
|
1622
1632
|
}
|
|
1623
1633
|
/**
|
|
1624
1634
|
* Multiplies the TimeSpan by a scalar value.
|
|
@@ -1627,31 +1637,40 @@ class f extends J {
|
|
|
1627
1637
|
* @returns A new TimeSpan that is this TimeSpan multiplied by the provided value.
|
|
1628
1638
|
*/
|
|
1629
1639
|
mult(e) {
|
|
1630
|
-
return new
|
|
1640
|
+
return new g(B(this.valueOf(), e));
|
|
1641
|
+
}
|
|
1642
|
+
/**
|
|
1643
|
+
* Divides the TimeSpan by a scalar value.
|
|
1644
|
+
*
|
|
1645
|
+
* @param value - The scalar value to divide by.
|
|
1646
|
+
* @returns A new TimeSpan that is this TimeSpan divided by the provided value.
|
|
1647
|
+
*/
|
|
1648
|
+
div(e) {
|
|
1649
|
+
return new g(we(this.valueOf(), e));
|
|
1631
1650
|
}
|
|
1632
1651
|
/** @returns the decimal number of days in the TimeSpan. */
|
|
1633
1652
|
get days() {
|
|
1634
|
-
return Number(this.valueOf()) / Number(
|
|
1653
|
+
return Number(this.valueOf()) / Number(g.DAY.valueOf());
|
|
1635
1654
|
}
|
|
1636
1655
|
/** @returns the decimal number of hours in the TimeSpan. */
|
|
1637
1656
|
get hours() {
|
|
1638
|
-
return Number(this.valueOf()) / Number(
|
|
1657
|
+
return Number(this.valueOf()) / Number(g.HOUR.valueOf());
|
|
1639
1658
|
}
|
|
1640
1659
|
/** @returns the decimal number of minutes in the TimeSpan. */
|
|
1641
1660
|
get minutes() {
|
|
1642
|
-
return Number(this.valueOf()) / Number(
|
|
1661
|
+
return Number(this.valueOf()) / Number(g.MINUTE.valueOf());
|
|
1643
1662
|
}
|
|
1644
1663
|
/** @returns The number of seconds in the TimeSpan. */
|
|
1645
1664
|
get seconds() {
|
|
1646
|
-
return Number(this.valueOf()) / Number(
|
|
1665
|
+
return Number(this.valueOf()) / Number(g.SECOND.valueOf());
|
|
1647
1666
|
}
|
|
1648
1667
|
/** @returns The number of milliseconds in the TimeSpan. */
|
|
1649
1668
|
get milliseconds() {
|
|
1650
|
-
return Number(this.valueOf()) / Number(
|
|
1669
|
+
return Number(this.valueOf()) / Number(g.MILLISECOND.valueOf());
|
|
1651
1670
|
}
|
|
1652
1671
|
/** @returns The number of microseconds in the TimeSpan. */
|
|
1653
1672
|
get microseconds() {
|
|
1654
|
-
return Number(this.valueOf()) / Number(
|
|
1673
|
+
return Number(this.valueOf()) / Number(g.MICROSECOND.valueOf());
|
|
1655
1674
|
}
|
|
1656
1675
|
/** @returns The number of nanoseconds in the TimeSpan. */
|
|
1657
1676
|
get nanoseconds() {
|
|
@@ -1671,7 +1690,7 @@ class f extends J {
|
|
|
1671
1690
|
* @returns True if the TimeSpans are equal, false otherwise.
|
|
1672
1691
|
*/
|
|
1673
1692
|
equals(e) {
|
|
1674
|
-
return this.valueOf() === new
|
|
1693
|
+
return this.valueOf() === new g(e).valueOf();
|
|
1675
1694
|
}
|
|
1676
1695
|
/**
|
|
1677
1696
|
* Adds a TimeSpan to the TimeSpan.
|
|
@@ -1679,7 +1698,7 @@ class f extends J {
|
|
|
1679
1698
|
* @returns A new TimeSpan representing the sum of the two TimeSpans.
|
|
1680
1699
|
*/
|
|
1681
1700
|
add(e) {
|
|
1682
|
-
return new
|
|
1701
|
+
return new g(this.valueOf() + new g(e).valueOf());
|
|
1683
1702
|
}
|
|
1684
1703
|
/**
|
|
1685
1704
|
* Creates a TimeSpan representing the duration between the two timestamps.
|
|
@@ -1687,7 +1706,7 @@ class f extends J {
|
|
|
1687
1706
|
* @param other
|
|
1688
1707
|
*/
|
|
1689
1708
|
sub(e) {
|
|
1690
|
-
return new
|
|
1709
|
+
return new g(this.valueOf() - new g(e).valueOf());
|
|
1691
1710
|
}
|
|
1692
1711
|
/**
|
|
1693
1712
|
* Creates a TimeSpan representing the given number of nanoseconds.
|
|
@@ -1696,10 +1715,10 @@ class f extends J {
|
|
|
1696
1715
|
* @returns A TimeSpan representing the given number of nanoseconds.
|
|
1697
1716
|
*/
|
|
1698
1717
|
static nanoseconds(e = 1) {
|
|
1699
|
-
return new
|
|
1718
|
+
return new g(e);
|
|
1700
1719
|
}
|
|
1701
1720
|
/** A nanosecond. */
|
|
1702
|
-
static NANOSECOND =
|
|
1721
|
+
static NANOSECOND = g.nanoseconds(1);
|
|
1703
1722
|
/**
|
|
1704
1723
|
* Creates a TimeSpan representing the given number of microseconds.
|
|
1705
1724
|
*
|
|
@@ -1707,10 +1726,10 @@ class f extends J {
|
|
|
1707
1726
|
* @returns A TimeSpan representing the given number of microseconds.
|
|
1708
1727
|
*/
|
|
1709
1728
|
static microseconds(e = 1) {
|
|
1710
|
-
return
|
|
1729
|
+
return g.nanoseconds(B(e, 1e3));
|
|
1711
1730
|
}
|
|
1712
1731
|
/** A microsecond. */
|
|
1713
|
-
static MICROSECOND =
|
|
1732
|
+
static MICROSECOND = g.microseconds(1);
|
|
1714
1733
|
/**
|
|
1715
1734
|
* Creates a TimeSpan representing the given number of milliseconds.
|
|
1716
1735
|
*
|
|
@@ -1718,10 +1737,10 @@ class f extends J {
|
|
|
1718
1737
|
* @returns A TimeSpan representing the given number of milliseconds.
|
|
1719
1738
|
*/
|
|
1720
1739
|
static milliseconds(e = 1) {
|
|
1721
|
-
return
|
|
1740
|
+
return g.microseconds(B(e, 1e3));
|
|
1722
1741
|
}
|
|
1723
1742
|
/** A millisecond. */
|
|
1724
|
-
static MILLISECOND =
|
|
1743
|
+
static MILLISECOND = g.milliseconds(1);
|
|
1725
1744
|
/**
|
|
1726
1745
|
* Creates a TimeSpan representing the given number of seconds.
|
|
1727
1746
|
*
|
|
@@ -1729,10 +1748,10 @@ class f extends J {
|
|
|
1729
1748
|
* @returns A TimeSpan representing the given number of seconds.
|
|
1730
1749
|
*/
|
|
1731
1750
|
static seconds(e = 1) {
|
|
1732
|
-
return
|
|
1751
|
+
return g.milliseconds(B(e, 1e3));
|
|
1733
1752
|
}
|
|
1734
1753
|
/** A second. */
|
|
1735
|
-
static SECOND =
|
|
1754
|
+
static SECOND = g.seconds(1);
|
|
1736
1755
|
/**
|
|
1737
1756
|
* Creates a TimeSpan representing the given number of minutes.
|
|
1738
1757
|
*
|
|
@@ -1740,10 +1759,10 @@ class f extends J {
|
|
|
1740
1759
|
* @returns A TimeSpan representing the given number of minutes.
|
|
1741
1760
|
*/
|
|
1742
1761
|
static minutes(e = 1) {
|
|
1743
|
-
return
|
|
1762
|
+
return g.seconds(B(e, 60));
|
|
1744
1763
|
}
|
|
1745
1764
|
/** A minute. */
|
|
1746
|
-
static MINUTE =
|
|
1765
|
+
static MINUTE = g.minutes(1);
|
|
1747
1766
|
/**
|
|
1748
1767
|
* Creates a TimeSpan representing the given number of hours.
|
|
1749
1768
|
*
|
|
@@ -1751,10 +1770,10 @@ class f extends J {
|
|
|
1751
1770
|
* @returns A TimeSpan representing the given number of hours.
|
|
1752
1771
|
*/
|
|
1753
1772
|
static hours(e) {
|
|
1754
|
-
return
|
|
1773
|
+
return g.minutes(B(e, 60));
|
|
1755
1774
|
}
|
|
1756
1775
|
/** Represents an hour. */
|
|
1757
|
-
static HOUR =
|
|
1776
|
+
static HOUR = g.hours(1);
|
|
1758
1777
|
/**
|
|
1759
1778
|
* Creates a TimeSpan representing the given number of days.
|
|
1760
1779
|
*
|
|
@@ -1762,25 +1781,28 @@ class f extends J {
|
|
|
1762
1781
|
* @returns A TimeSpan representing the given number of days.
|
|
1763
1782
|
*/
|
|
1764
1783
|
static days(e) {
|
|
1765
|
-
return
|
|
1784
|
+
return g.hours(B(e, 24));
|
|
1766
1785
|
}
|
|
1767
1786
|
/** Represents a day. */
|
|
1768
|
-
static DAY =
|
|
1787
|
+
static DAY = g.days(1);
|
|
1769
1788
|
/** The maximum possible value for a TimeSpan. */
|
|
1770
|
-
static MAX = new
|
|
1789
|
+
static MAX = new g((1n << 63n) - 1n);
|
|
1771
1790
|
/** The minimum possible value for a TimeSpan. */
|
|
1772
|
-
static MIN = new
|
|
1791
|
+
static MIN = new g(0);
|
|
1773
1792
|
/** The zero value for a TimeSpan. */
|
|
1774
|
-
static ZERO = new
|
|
1793
|
+
static ZERO = new g(0);
|
|
1775
1794
|
/** A zod schema for validating and transforming timespans */
|
|
1776
1795
|
static z = a.union([
|
|
1777
|
-
a.object({ value: a.bigint() }).transform((e) => new
|
|
1778
|
-
a.string().transform((e) => new
|
|
1779
|
-
a.number().transform((e) => new
|
|
1780
|
-
a.
|
|
1796
|
+
a.object({ value: a.bigint() }).transform((e) => new g(e.value)),
|
|
1797
|
+
a.string().transform((e) => new g(BigInt(e))),
|
|
1798
|
+
a.number().transform((e) => new g(e)),
|
|
1799
|
+
a.bigint().transform((e) => new g(e)),
|
|
1800
|
+
a.instanceof(g),
|
|
1801
|
+
a.instanceof(b).transform((e) => new g(e)),
|
|
1802
|
+
a.custom((e) => e instanceof E).transform((e) => new g(e))
|
|
1781
1803
|
]);
|
|
1782
|
-
}
|
|
1783
|
-
|
|
1804
|
+
};
|
|
1805
|
+
class E extends _ {
|
|
1784
1806
|
constructor(e) {
|
|
1785
1807
|
super(e.valueOf());
|
|
1786
1808
|
}
|
|
@@ -1790,7 +1812,7 @@ let Lt = class Q extends J {
|
|
|
1790
1812
|
}
|
|
1791
1813
|
/** @returns The number of seconds in the Rate. */
|
|
1792
1814
|
equals(e) {
|
|
1793
|
-
return this.valueOf() === new
|
|
1815
|
+
return this.valueOf() === new E(e).valueOf();
|
|
1794
1816
|
}
|
|
1795
1817
|
/**
|
|
1796
1818
|
* Calculates the period of the Rate as a TimeSpan.
|
|
@@ -1798,7 +1820,7 @@ let Lt = class Q extends J {
|
|
|
1798
1820
|
* @returns A TimeSpan representing the period of the Rate.
|
|
1799
1821
|
*/
|
|
1800
1822
|
get period() {
|
|
1801
|
-
return
|
|
1823
|
+
return O.seconds(1 / this.valueOf());
|
|
1802
1824
|
}
|
|
1803
1825
|
/**
|
|
1804
1826
|
* Calculates the number of samples in the given TimeSpan at this rate.
|
|
@@ -1807,7 +1829,7 @@ let Lt = class Q extends J {
|
|
|
1807
1829
|
* @returns The number of samples in the given TimeSpan at this rate.
|
|
1808
1830
|
*/
|
|
1809
1831
|
sampleCount(e) {
|
|
1810
|
-
return new
|
|
1832
|
+
return new O(e).seconds * this.valueOf();
|
|
1811
1833
|
}
|
|
1812
1834
|
/**
|
|
1813
1835
|
* Calculates the number of bytes in the given TimeSpan at this rate.
|
|
@@ -1817,7 +1839,7 @@ let Lt = class Q extends J {
|
|
|
1817
1839
|
* @returns The number of bytes in the given TimeSpan at this rate.
|
|
1818
1840
|
*/
|
|
1819
1841
|
byteCount(e, r) {
|
|
1820
|
-
return this.sampleCount(e) * new
|
|
1842
|
+
return this.sampleCount(e) * new I(r).valueOf();
|
|
1821
1843
|
}
|
|
1822
1844
|
/**
|
|
1823
1845
|
* Calculates a TimeSpan given the number of samples at this rate.
|
|
@@ -1826,7 +1848,7 @@ let Lt = class Q extends J {
|
|
|
1826
1848
|
* @returns A TimeSpan that corresponds to the given number of samples.
|
|
1827
1849
|
*/
|
|
1828
1850
|
span(e) {
|
|
1829
|
-
return
|
|
1851
|
+
return O.seconds(e / this.valueOf());
|
|
1830
1852
|
}
|
|
1831
1853
|
/**
|
|
1832
1854
|
* Calculates a TimeSpan given the number of bytes at this rate.
|
|
@@ -1838,6 +1860,42 @@ let Lt = class Q extends J {
|
|
|
1838
1860
|
byteSpan(e, r) {
|
|
1839
1861
|
return this.span(e.valueOf() / r.valueOf());
|
|
1840
1862
|
}
|
|
1863
|
+
/**
|
|
1864
|
+
* Adds another Rate to this Rate.
|
|
1865
|
+
*
|
|
1866
|
+
* @param other - The Rate to add.
|
|
1867
|
+
* @returns A new Rate representing the sum of the two rates.
|
|
1868
|
+
*/
|
|
1869
|
+
add(e) {
|
|
1870
|
+
return new E(ie(this.valueOf(), e.valueOf()));
|
|
1871
|
+
}
|
|
1872
|
+
/**
|
|
1873
|
+
* Subtracts another Rate from this Rate.
|
|
1874
|
+
*
|
|
1875
|
+
* @param other - The Rate to subtract.
|
|
1876
|
+
* @returns A new Rate representing the difference of the two rates.
|
|
1877
|
+
*/
|
|
1878
|
+
sub(e) {
|
|
1879
|
+
return new E(P(this.valueOf(), e.valueOf()));
|
|
1880
|
+
}
|
|
1881
|
+
/**
|
|
1882
|
+
* Multiplies this Rate by a scalar value.
|
|
1883
|
+
*
|
|
1884
|
+
* @param value - The scalar value to multiply by.
|
|
1885
|
+
* @returns A new Rate representing this Rate multiplied by the value.
|
|
1886
|
+
*/
|
|
1887
|
+
mult(e) {
|
|
1888
|
+
return new E(B(this.valueOf(), e));
|
|
1889
|
+
}
|
|
1890
|
+
/**
|
|
1891
|
+
* Divides this Rate by a scalar value.
|
|
1892
|
+
*
|
|
1893
|
+
* @param value - The scalar value to divide by.
|
|
1894
|
+
* @returns A new Rate representing this Rate divided by the value.
|
|
1895
|
+
*/
|
|
1896
|
+
div(e) {
|
|
1897
|
+
return new E(we(this.valueOf(), e));
|
|
1898
|
+
}
|
|
1841
1899
|
/**
|
|
1842
1900
|
* Creates a Rate representing the given number of Hz.
|
|
1843
1901
|
*
|
|
@@ -1845,7 +1903,7 @@ let Lt = class Q extends J {
|
|
|
1845
1903
|
* @returns A Rate representing the given number of Hz.
|
|
1846
1904
|
*/
|
|
1847
1905
|
static hz(e) {
|
|
1848
|
-
return new
|
|
1906
|
+
return new E(e);
|
|
1849
1907
|
}
|
|
1850
1908
|
/**
|
|
1851
1909
|
* Creates a Rate representing the given number of kHz.
|
|
@@ -1854,14 +1912,15 @@ let Lt = class Q extends J {
|
|
|
1854
1912
|
* @returns A Rate representing the given number of kHz.
|
|
1855
1913
|
*/
|
|
1856
1914
|
static khz(e) {
|
|
1857
|
-
return
|
|
1915
|
+
return E.hz(e * 1e3);
|
|
1858
1916
|
}
|
|
1859
1917
|
/** A zod schema for validating and transforming rates */
|
|
1860
1918
|
static z = a.union([
|
|
1861
|
-
a.number().transform((e) => new
|
|
1862
|
-
a.instanceof(
|
|
1919
|
+
a.number().transform((e) => new E(e)),
|
|
1920
|
+
a.instanceof(E)
|
|
1863
1921
|
]);
|
|
1864
|
-
}
|
|
1922
|
+
}
|
|
1923
|
+
let I = class M extends _ {
|
|
1865
1924
|
/**
|
|
1866
1925
|
* Creates a Density representing the given number of bytes per value.
|
|
1867
1926
|
*
|
|
@@ -1888,26 +1947,62 @@ let Lt = class Q extends J {
|
|
|
1888
1947
|
* @returns A Size representing the given number of values.
|
|
1889
1948
|
*/
|
|
1890
1949
|
size(e) {
|
|
1891
|
-
return new
|
|
1950
|
+
return new Le(e * this.valueOf());
|
|
1951
|
+
}
|
|
1952
|
+
/**
|
|
1953
|
+
* Adds another Density to this Density.
|
|
1954
|
+
*
|
|
1955
|
+
* @param other - The Density to add.
|
|
1956
|
+
* @returns A new Density representing the sum of the two densities.
|
|
1957
|
+
*/
|
|
1958
|
+
add(e) {
|
|
1959
|
+
return new M(ie(this.valueOf(), e.valueOf()));
|
|
1960
|
+
}
|
|
1961
|
+
/**
|
|
1962
|
+
* Subtracts another Density from this Density.
|
|
1963
|
+
*
|
|
1964
|
+
* @param other - The Density to subtract.
|
|
1965
|
+
* @returns A new Density representing the difference of the two densities.
|
|
1966
|
+
*/
|
|
1967
|
+
sub(e) {
|
|
1968
|
+
return new M(P(this.valueOf(), e.valueOf()));
|
|
1969
|
+
}
|
|
1970
|
+
/**
|
|
1971
|
+
* Multiplies this Density by a scalar value.
|
|
1972
|
+
*
|
|
1973
|
+
* @param value - The scalar value to multiply by.
|
|
1974
|
+
* @returns A new Density representing this Density multiplied by the value.
|
|
1975
|
+
*/
|
|
1976
|
+
mult(e) {
|
|
1977
|
+
return new M(B(this.valueOf(), e));
|
|
1978
|
+
}
|
|
1979
|
+
/**
|
|
1980
|
+
* Divides this Density by a scalar value.
|
|
1981
|
+
*
|
|
1982
|
+
* @param value - The scalar value to divide by.
|
|
1983
|
+
* @returns A new Density representing this Density divided by the value.
|
|
1984
|
+
*/
|
|
1985
|
+
div(e) {
|
|
1986
|
+
return new M(we(this.valueOf(), e));
|
|
1892
1987
|
}
|
|
1893
1988
|
/** Unknown/Invalid Density. */
|
|
1894
|
-
static UNKNOWN = new
|
|
1989
|
+
static UNKNOWN = new M(0);
|
|
1895
1990
|
/** 128 bits per value. */
|
|
1896
|
-
static BIT128 = new
|
|
1991
|
+
static BIT128 = new M(16);
|
|
1897
1992
|
/** 64 bits per value. */
|
|
1898
|
-
static BIT64 = new
|
|
1993
|
+
static BIT64 = new M(8);
|
|
1899
1994
|
/** 32 bits per value. */
|
|
1900
|
-
static BIT32 = new
|
|
1995
|
+
static BIT32 = new M(4);
|
|
1901
1996
|
/** 16 bits per value. */
|
|
1902
|
-
static BIT16 = new
|
|
1997
|
+
static BIT16 = new M(2);
|
|
1903
1998
|
/** 8 bits per value. */
|
|
1904
|
-
static BIT8 = new
|
|
1999
|
+
static BIT8 = new M(1);
|
|
1905
2000
|
/** A zod schema for validating and transforming densities */
|
|
1906
2001
|
static z = a.union([
|
|
1907
|
-
a.number().transform((e) => new
|
|
1908
|
-
a.instanceof(
|
|
2002
|
+
a.number().transform((e) => new M(e)),
|
|
2003
|
+
a.instanceof(M)
|
|
1909
2004
|
]);
|
|
1910
|
-
},
|
|
2005
|
+
}, J = class L {
|
|
1911
2006
|
/**
|
|
1912
2007
|
* The starting TimeStamp of the TimeRange.
|
|
1913
2008
|
*
|
|
@@ -1937,7 +2032,7 @@ let Lt = class Q extends J {
|
|
|
1937
2032
|
}
|
|
1938
2033
|
/** @returns The TimeSpan occupied by the TimeRange. */
|
|
1939
2034
|
get span() {
|
|
1940
|
-
return new
|
|
2035
|
+
return new O(this.end.valueOf() - this.start.valueOf());
|
|
1941
2036
|
}
|
|
1942
2037
|
/**
|
|
1943
2038
|
* Checks if the timestamp is valid i.e. the start is before the end.
|
|
@@ -1975,7 +2070,7 @@ let Lt = class Q extends J {
|
|
|
1975
2070
|
* @returns A TimeRange with the start and end swapped.
|
|
1976
2071
|
*/
|
|
1977
2072
|
swap() {
|
|
1978
|
-
return new
|
|
2073
|
+
return new L(this.end, this.start);
|
|
1979
2074
|
}
|
|
1980
2075
|
get numericBounds() {
|
|
1981
2076
|
return {
|
|
@@ -1989,7 +2084,7 @@ let Lt = class Q extends J {
|
|
|
1989
2084
|
* @param other - The TimeRange to compare to.
|
|
1990
2085
|
* @returns True if the TimeRange is equal to the given TimeRange.
|
|
1991
2086
|
*/
|
|
1992
|
-
equals(e, r =
|
|
2087
|
+
equals(e, r = O.ZERO) {
|
|
1993
2088
|
if (r.isZero)
|
|
1994
2089
|
return this.start.equals(e.start) && this.end.equals(e.end);
|
|
1995
2090
|
let n = this.start.sub(e.start).valueOf(), s = this.end.sub(e.end).valueOf();
|
|
@@ -2022,16 +2117,16 @@ let Lt = class Q extends J {
|
|
|
2022
2117
|
* checking for overlap.
|
|
2023
2118
|
* @returns True if the two TimeRanges overlap, false otherwise.
|
|
2024
2119
|
*/
|
|
2025
|
-
overlapsWith(e, r =
|
|
2120
|
+
overlapsWith(e, r = O.ZERO) {
|
|
2026
2121
|
e = e.makeValid();
|
|
2027
2122
|
const n = this.makeValid();
|
|
2028
2123
|
if (this.equals(e)) return !0;
|
|
2029
2124
|
if (e.end.equals(n.start) || n.end.equals(e.start)) return !1;
|
|
2030
2125
|
const s = b.max(n.start, e.start), i = b.min(n.end, e.end);
|
|
2031
|
-
return i.before(s) ? !1 : new
|
|
2126
|
+
return i.before(s) ? !1 : new O(i.sub(s)).greaterThanOrEqual(r);
|
|
2032
2127
|
}
|
|
2033
2128
|
contains(e) {
|
|
2034
|
-
return e instanceof
|
|
2129
|
+
return e instanceof L ? this.contains(e.start) && this.contains(e.end) : this.start.beforeEq(e) && this.end.after(e);
|
|
2035
2130
|
}
|
|
2036
2131
|
/**
|
|
2037
2132
|
* Returns a new TimeRange that is bound by the given TimeRange.
|
|
@@ -2045,25 +2140,25 @@ let Lt = class Q extends J {
|
|
|
2045
2140
|
* console.log(bounded); // TimeRange(1500, 2000)
|
|
2046
2141
|
*/
|
|
2047
2142
|
boundBy(e) {
|
|
2048
|
-
const r = new
|
|
2143
|
+
const r = new L(this.start, this.end);
|
|
2049
2144
|
return e.start.after(this.start) && (r.start = e.start), e.start.after(this.end) && (r.end = e.start), e.end.before(this.end) && (r.end = e.end), e.end.before(this.start) && (r.start = e.end), r;
|
|
2050
2145
|
}
|
|
2051
2146
|
static max(...e) {
|
|
2052
|
-
return new
|
|
2147
|
+
return new L(
|
|
2053
2148
|
b.min(...e.map((r) => r.start)),
|
|
2054
2149
|
b.max(...e.map((r) => r.end))
|
|
2055
2150
|
);
|
|
2056
2151
|
}
|
|
2057
2152
|
/** The maximum possible time range. */
|
|
2058
|
-
static MAX = new
|
|
2153
|
+
static MAX = new L(b.MIN, b.MAX);
|
|
2059
2154
|
/** The minimum possible time range. */
|
|
2060
|
-
static MIN = new
|
|
2155
|
+
static MIN = new L(b.MAX, b.MIN);
|
|
2061
2156
|
/** A time range whose start and end are both zero. */
|
|
2062
|
-
static ZERO = new
|
|
2157
|
+
static ZERO = new L(b.ZERO, b.ZERO);
|
|
2063
2158
|
/** A zod schema for validating and transforming time ranges */
|
|
2064
2159
|
static z = a.union([
|
|
2065
|
-
a.object({ start: b.z, end: b.z }).transform((e) => new
|
|
2066
|
-
a.instanceof(
|
|
2160
|
+
a.object({ start: b.z, end: b.z }).transform((e) => new L(e.start, e.end)),
|
|
2161
|
+
a.instanceof(L)
|
|
2067
2162
|
]);
|
|
2068
2163
|
/**
|
|
2069
2164
|
* Sorts two time ranges. The range with the earlier start time is considered less than
|
|
@@ -2079,7 +2174,7 @@ let Lt = class Q extends J {
|
|
|
2079
2174
|
static sort(e, r) {
|
|
2080
2175
|
return b.sort(e.start, r.start) || b.sort(e.end, r.end);
|
|
2081
2176
|
}
|
|
2082
|
-
},
|
|
2177
|
+
}, $ = class u extends _ {
|
|
2083
2178
|
constructor(e) {
|
|
2084
2179
|
if (e instanceof u || typeof e == "string" || typeof e.valueOf() == "string")
|
|
2085
2180
|
super(e.valueOf());
|
|
@@ -2258,20 +2353,20 @@ let Lt = class Q extends J {
|
|
|
2258
2353
|
[BigInt64Array.name, u.INT64]
|
|
2259
2354
|
]);
|
|
2260
2355
|
static DENSITIES = /* @__PURE__ */ new Map([
|
|
2261
|
-
[u.UINT8.toString(),
|
|
2262
|
-
[u.UINT16.toString(),
|
|
2263
|
-
[u.UINT32.toString(),
|
|
2264
|
-
[u.UINT64.toString(),
|
|
2265
|
-
[u.FLOAT32.toString(),
|
|
2266
|
-
[u.FLOAT64.toString(),
|
|
2267
|
-
[u.INT8.toString(),
|
|
2268
|
-
[u.INT16.toString(),
|
|
2269
|
-
[u.INT32.toString(),
|
|
2270
|
-
[u.INT64.toString(),
|
|
2271
|
-
[u.TIMESTAMP.toString(),
|
|
2272
|
-
[u.STRING.toString(),
|
|
2273
|
-
[u.JSON.toString(),
|
|
2274
|
-
[u.UUID.toString(),
|
|
2356
|
+
[u.UINT8.toString(), I.BIT8],
|
|
2357
|
+
[u.UINT16.toString(), I.BIT16],
|
|
2358
|
+
[u.UINT32.toString(), I.BIT32],
|
|
2359
|
+
[u.UINT64.toString(), I.BIT64],
|
|
2360
|
+
[u.FLOAT32.toString(), I.BIT32],
|
|
2361
|
+
[u.FLOAT64.toString(), I.BIT64],
|
|
2362
|
+
[u.INT8.toString(), I.BIT8],
|
|
2363
|
+
[u.INT16.toString(), I.BIT16],
|
|
2364
|
+
[u.INT32.toString(), I.BIT32],
|
|
2365
|
+
[u.INT64.toString(), I.BIT64],
|
|
2366
|
+
[u.TIMESTAMP.toString(), I.BIT64],
|
|
2367
|
+
[u.STRING.toString(), I.UNKNOWN],
|
|
2368
|
+
[u.JSON.toString(), I.UNKNOWN],
|
|
2369
|
+
[u.UUID.toString(), I.BIT128]
|
|
2275
2370
|
]);
|
|
2276
2371
|
/** All the data types. */
|
|
2277
2372
|
static ALL = [
|
|
@@ -2297,8 +2392,7 @@ let Lt = class Q extends J {
|
|
|
2297
2392
|
a.string().transform((e) => new u(e)),
|
|
2298
2393
|
a.instanceof(u)
|
|
2299
2394
|
]);
|
|
2300
|
-
}
|
|
2301
|
-
class m extends J {
|
|
2395
|
+
}, Le = class w extends _ {
|
|
2302
2396
|
constructor(e) {
|
|
2303
2397
|
super(e.valueOf());
|
|
2304
2398
|
}
|
|
@@ -2312,41 +2406,59 @@ class m extends J {
|
|
|
2312
2406
|
}
|
|
2313
2407
|
/** @returns a new Size representing the sum of the two Sizes. */
|
|
2314
2408
|
add(e) {
|
|
2315
|
-
return
|
|
2409
|
+
return new w(ie(this.valueOf(), e.valueOf()));
|
|
2316
2410
|
}
|
|
2317
2411
|
/** @returns a new Size representing the difference of the two Sizes. */
|
|
2318
2412
|
sub(e) {
|
|
2319
|
-
return
|
|
2413
|
+
return new w(P(this.valueOf(), e.valueOf()));
|
|
2414
|
+
}
|
|
2415
|
+
/**
|
|
2416
|
+
* Multiplies this Size by a scalar value.
|
|
2417
|
+
*
|
|
2418
|
+
* @param value - The scalar value to multiply by.
|
|
2419
|
+
* @returns A new Size representing this Size multiplied by the value.
|
|
2420
|
+
*/
|
|
2421
|
+
mult(e) {
|
|
2422
|
+
return new w(B(this.valueOf(), e));
|
|
2423
|
+
}
|
|
2424
|
+
/**
|
|
2425
|
+
* Divides this Size by a scalar value.
|
|
2426
|
+
*
|
|
2427
|
+
* @param value - The scalar value to divide by.
|
|
2428
|
+
* @returns A new Size representing this Size divided by the value.
|
|
2429
|
+
*/
|
|
2430
|
+
div(e) {
|
|
2431
|
+
return new w(we(this.valueOf(), e));
|
|
2320
2432
|
}
|
|
2321
2433
|
/** @returns a new Size representing the truncated value of the Size. */
|
|
2322
2434
|
truncate(e) {
|
|
2323
|
-
return new
|
|
2435
|
+
return new w(Math.trunc(this.valueOf() / e.valueOf()) * e.valueOf());
|
|
2324
2436
|
}
|
|
2325
2437
|
/** @returns a new Size representing the remainder of the Size. */
|
|
2326
2438
|
remainder(e) {
|
|
2327
|
-
return
|
|
2439
|
+
return w.bytes(this.valueOf() % e.valueOf());
|
|
2328
2440
|
}
|
|
2329
2441
|
/** @returns the number of gigabytes in the Size. */
|
|
2330
2442
|
get gigabytes() {
|
|
2331
|
-
return this.valueOf() /
|
|
2443
|
+
return this.valueOf() / w.GIGABYTE.valueOf();
|
|
2332
2444
|
}
|
|
2333
2445
|
/** @returns the number of megabytes in the Size. */
|
|
2334
2446
|
get megabytes() {
|
|
2335
|
-
return this.valueOf() /
|
|
2447
|
+
return this.valueOf() / w.MEGABYTE.valueOf();
|
|
2336
2448
|
}
|
|
2337
2449
|
/** @returns the number of kilobytes in the Size. */
|
|
2338
2450
|
get kilobytes() {
|
|
2339
|
-
return this.valueOf() /
|
|
2451
|
+
return this.valueOf() / w.KILOBYTE.valueOf();
|
|
2340
2452
|
}
|
|
2341
2453
|
/** @returns the number of terabytes in the Size. */
|
|
2342
2454
|
get terabytes() {
|
|
2343
|
-
return this.valueOf() /
|
|
2455
|
+
return this.valueOf() / w.TERABYTE.valueOf();
|
|
2344
2456
|
}
|
|
2345
2457
|
/** @returns a nicely formatted string representation of the Size. */
|
|
2346
2458
|
toString() {
|
|
2347
|
-
const e = this.truncate(
|
|
2348
|
-
let
|
|
2349
|
-
return o.isZero || (
|
|
2459
|
+
const e = this.truncate(w.TERABYTE), r = this.truncate(w.GIGABYTE), n = this.truncate(w.MEGABYTE), s = this.truncate(w.KILOBYTE), i = this.truncate(w.BYTE), o = e, c = r.sub(e), h = n.sub(r), l = s.sub(n), d = i.sub(s);
|
|
2460
|
+
let m = "";
|
|
2461
|
+
return o.isZero || (m += `${o.terabytes}TB `), c.isZero || (m += `${c.gigabytes}GB `), h.isZero || (m += `${h.megabytes}MB `), l.isZero || (m += `${l.kilobytes}KB `), (!d.isZero || m === "") && (m += `${d.valueOf()}B`), m.trim();
|
|
2350
2462
|
}
|
|
2351
2463
|
/**
|
|
2352
2464
|
* Creates a Size from the given number of bytes.
|
|
@@ -2355,10 +2467,10 @@ class m extends J {
|
|
|
2355
2467
|
* @returns A Size representing the given number of bytes.
|
|
2356
2468
|
*/
|
|
2357
2469
|
static bytes(e = 1) {
|
|
2358
|
-
return new
|
|
2470
|
+
return new w(e);
|
|
2359
2471
|
}
|
|
2360
2472
|
/** A single byte */
|
|
2361
|
-
static BYTE = new
|
|
2473
|
+
static BYTE = new w(1);
|
|
2362
2474
|
/**
|
|
2363
2475
|
* Creates a Size from the given number if kilobytes.
|
|
2364
2476
|
*
|
|
@@ -2366,10 +2478,10 @@ class m extends J {
|
|
|
2366
2478
|
* @returns A Size representing the given number of kilobytes.
|
|
2367
2479
|
*/
|
|
2368
2480
|
static kilobytes(e = 1) {
|
|
2369
|
-
return
|
|
2481
|
+
return w.bytes(e.valueOf() * 1e3);
|
|
2370
2482
|
}
|
|
2371
2483
|
/** A kilobyte */
|
|
2372
|
-
static KILOBYTE =
|
|
2484
|
+
static KILOBYTE = w.kilobytes(1);
|
|
2373
2485
|
/**
|
|
2374
2486
|
* Creates a Size from the given number of megabytes.
|
|
2375
2487
|
*
|
|
@@ -2377,10 +2489,10 @@ class m extends J {
|
|
|
2377
2489
|
* @returns A Size representing the given number of megabytes.
|
|
2378
2490
|
*/
|
|
2379
2491
|
static megabytes(e = 1) {
|
|
2380
|
-
return
|
|
2492
|
+
return w.kilobytes(e.valueOf() * 1e3);
|
|
2381
2493
|
}
|
|
2382
2494
|
/** A megabyte */
|
|
2383
|
-
static MEGABYTE =
|
|
2495
|
+
static MEGABYTE = w.megabytes(1);
|
|
2384
2496
|
/**
|
|
2385
2497
|
* Creates a Size from the given number of gigabytes.
|
|
2386
2498
|
*
|
|
@@ -2388,10 +2500,10 @@ class m extends J {
|
|
|
2388
2500
|
* @returns A Size representing the given number of gigabytes.
|
|
2389
2501
|
*/
|
|
2390
2502
|
static gigabytes(e = 1) {
|
|
2391
|
-
return
|
|
2503
|
+
return w.megabytes(e.valueOf() * 1e3);
|
|
2392
2504
|
}
|
|
2393
2505
|
/** A gigabyte */
|
|
2394
|
-
static GIGABYTE =
|
|
2506
|
+
static GIGABYTE = w.gigabytes(1);
|
|
2395
2507
|
/**
|
|
2396
2508
|
* Creates a Size from the given number of terabytes.
|
|
2397
2509
|
*
|
|
@@ -2399,23 +2511,23 @@ class m extends J {
|
|
|
2399
2511
|
* @returns A Size representing the given number of terabytes.
|
|
2400
2512
|
*/
|
|
2401
2513
|
static terabytes(e) {
|
|
2402
|
-
return
|
|
2514
|
+
return w.gigabytes(e.valueOf() * 1e3);
|
|
2403
2515
|
}
|
|
2404
2516
|
/** A terabyte. */
|
|
2405
|
-
static TERABYTE =
|
|
2517
|
+
static TERABYTE = w.terabytes(1);
|
|
2406
2518
|
/** The zero value for Size */
|
|
2407
|
-
static ZERO = new
|
|
2519
|
+
static ZERO = new w(0);
|
|
2408
2520
|
/** A zod schema for a Size. */
|
|
2409
2521
|
static z = a.union([
|
|
2410
|
-
a.number().transform((e) => new
|
|
2411
|
-
a.instanceof(
|
|
2522
|
+
a.number().transform((e) => new w(e)),
|
|
2523
|
+
a.instanceof(w)
|
|
2412
2524
|
]);
|
|
2413
2525
|
/** @returns true if the Size is zero. */
|
|
2414
2526
|
get isZero() {
|
|
2415
2527
|
return this.valueOf() === 0;
|
|
2416
2528
|
}
|
|
2417
|
-
}
|
|
2418
|
-
const
|
|
2529
|
+
};
|
|
2530
|
+
const Bo = a.union([
|
|
2419
2531
|
a.instanceof(Uint8Array),
|
|
2420
2532
|
a.instanceof(Uint16Array),
|
|
2421
2533
|
a.instanceof(Uint32Array),
|
|
@@ -2426,40 +2538,40 @@ const So = a.union([
|
|
|
2426
2538
|
a.instanceof(Int16Array),
|
|
2427
2539
|
a.instanceof(Int32Array),
|
|
2428
2540
|
a.instanceof(BigInt64Array)
|
|
2429
|
-
]),
|
|
2541
|
+
]), Mr = (t) => {
|
|
2430
2542
|
const e = typeof t;
|
|
2431
|
-
return e === "string" || e === "number" || e === "boolean" || e === "bigint" || t instanceof b || t instanceof
|
|
2432
|
-
},
|
|
2433
|
-
function
|
|
2434
|
-
return typeof t == "string" &&
|
|
2543
|
+
return e === "string" || e === "number" || e === "boolean" || e === "bigint" || t instanceof b || t instanceof O || t instanceof Date;
|
|
2544
|
+
}, Ei = (t, e, r, n = 0) => t.usesBigInt && !e.usesBigInt ? Number(r) - Number(n) : !t.usesBigInt && e.usesBigInt ? BigInt(r.valueOf()) - BigInt(n.valueOf()) : Ue(r, -n), Ue = (t, e) => e == 0 ? t : t == 0 ? e : typeof t == "bigint" && typeof e == "bigint" || typeof t == "number" && typeof e == "number" ? t + e : Number(t) + Number(e), Ai = /^(?:[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;
|
|
2545
|
+
function Bi(t) {
|
|
2546
|
+
return typeof t == "string" && Ai.test(t);
|
|
2435
2547
|
}
|
|
2436
|
-
const
|
|
2548
|
+
const N = [];
|
|
2437
2549
|
for (let t = 0; t < 256; ++t)
|
|
2438
|
-
|
|
2439
|
-
function
|
|
2440
|
-
return (
|
|
2550
|
+
N.push((t + 256).toString(16).slice(1));
|
|
2551
|
+
function Ui(t, e = 0) {
|
|
2552
|
+
return (N[t[e + 0]] + N[t[e + 1]] + N[t[e + 2]] + N[t[e + 3]] + "-" + N[t[e + 4]] + N[t[e + 5]] + "-" + N[t[e + 6]] + N[t[e + 7]] + "-" + N[t[e + 8]] + N[t[e + 9]] + "-" + N[t[e + 10]] + N[t[e + 11]] + N[t[e + 12]] + N[t[e + 13]] + N[t[e + 14]] + N[t[e + 15]]).toLowerCase();
|
|
2441
2553
|
}
|
|
2442
|
-
function
|
|
2443
|
-
const r =
|
|
2444
|
-
if (!
|
|
2554
|
+
function Ci(t, e = 0) {
|
|
2555
|
+
const r = Ui(t, e);
|
|
2556
|
+
if (!Bi(r))
|
|
2445
2557
|
throw TypeError("Stringified UUID is invalid");
|
|
2446
2558
|
return r;
|
|
2447
2559
|
}
|
|
2448
2560
|
typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
2449
|
-
const
|
|
2450
|
-
[Symbol.iterator]: () =>
|
|
2561
|
+
const Er = (t, e) => Ci(t, e), z = -1, ht = {
|
|
2562
|
+
[Symbol.iterator]: () => ht,
|
|
2451
2563
|
next: () => ({ done: !0, value: void 0 })
|
|
2452
|
-
},
|
|
2564
|
+
}, ji = a.string().transform(
|
|
2453
2565
|
(t) => new Uint8Array(
|
|
2454
2566
|
atob(t).split("").map((e) => e.charCodeAt(0))
|
|
2455
2567
|
).buffer
|
|
2456
|
-
),
|
|
2568
|
+
), Ri = a.union([a.null(), a.undefined()]).transform(() => new Uint8Array().buffer), ft = 10, Ar = (t, e) => {
|
|
2457
2569
|
if (t === "number" && !e.isNumeric)
|
|
2458
2570
|
throw new Error(`cannot convert series of type ${e.toString()} to number`);
|
|
2459
2571
|
if (t === "bigint" && !e.usesBigInt)
|
|
2460
2572
|
throw new Error(`cannot convert series of type ${e.toString()} to bigint`);
|
|
2461
|
-
},
|
|
2462
|
-
let
|
|
2573
|
+
}, Br = "sy_x_telem_series";
|
|
2574
|
+
let Ur = class F {
|
|
2463
2575
|
/**
|
|
2464
2576
|
* A unique identifier for the series. If specified by the user, it is their
|
|
2465
2577
|
* responsibility to ensure that it is unique. If not specified, a new ID will be
|
|
@@ -2470,7 +2582,7 @@ let Nr = class D {
|
|
|
2470
2582
|
* A discriminator used for identifying instances of the series class even
|
|
2471
2583
|
* when bundlers mangle the class name.
|
|
2472
2584
|
*/
|
|
2473
|
-
discriminator =
|
|
2585
|
+
discriminator = Br;
|
|
2474
2586
|
/** The data type of the series. */
|
|
2475
2587
|
dataType;
|
|
2476
2588
|
/**
|
|
@@ -2486,18 +2598,24 @@ let Nr = class D {
|
|
|
2486
2598
|
/** The underlying data. */
|
|
2487
2599
|
_data;
|
|
2488
2600
|
/** The time range occupied by the series' data. */
|
|
2489
|
-
timeRange =
|
|
2601
|
+
timeRange = J.ZERO;
|
|
2490
2602
|
/**
|
|
2491
2603
|
* Alignment defines the location of the series relative to other series in a logical
|
|
2492
2604
|
* group. Useful for defining the position of the series within a channel's data.
|
|
2493
2605
|
*/
|
|
2494
2606
|
alignment = 0n;
|
|
2607
|
+
/**
|
|
2608
|
+
* Alignment multiple defines the number of alignment steps taken per sample. This is
|
|
2609
|
+
* useful for when the samples in a series represent a partial view of the raw data
|
|
2610
|
+
* i.e. decimation or averaging.
|
|
2611
|
+
*/
|
|
2612
|
+
alignmentMultiple = 1n;
|
|
2495
2613
|
/** A cached minimum value. */
|
|
2496
2614
|
cachedMin;
|
|
2497
2615
|
/** A cached maximum value. */
|
|
2498
2616
|
cachedMax;
|
|
2499
2617
|
/** The write position of the buffer. */
|
|
2500
|
-
writePos =
|
|
2618
|
+
writePos = z;
|
|
2501
2619
|
/** Tracks the number of entities currently using this array. */
|
|
2502
2620
|
_refCount = 0;
|
|
2503
2621
|
/** Caches the length of the array for variable length data types. */
|
|
@@ -2509,22 +2627,22 @@ let Nr = class D {
|
|
|
2509
2627
|
* can be constructed into a series.
|
|
2510
2628
|
*/
|
|
2511
2629
|
static crudeZ = a.object({
|
|
2512
|
-
timeRange:
|
|
2513
|
-
dataType:
|
|
2630
|
+
timeRange: J.z.optional(),
|
|
2631
|
+
dataType: $.z,
|
|
2514
2632
|
alignment: a.coerce.bigint().optional(),
|
|
2515
2633
|
data: a.union([
|
|
2516
|
-
|
|
2517
|
-
|
|
2634
|
+
ji,
|
|
2635
|
+
Ri,
|
|
2518
2636
|
a.instanceof(ArrayBuffer),
|
|
2519
2637
|
a.instanceof(Uint8Array)
|
|
2520
2638
|
]),
|
|
2521
|
-
glBufferUsage:
|
|
2639
|
+
glBufferUsage: Ii.optional().default("static").optional()
|
|
2522
2640
|
});
|
|
2523
2641
|
/**
|
|
2524
2642
|
* A zod schema that validates and constructs a series from it's crude
|
|
2525
2643
|
* representation.
|
|
2526
2644
|
*/
|
|
2527
|
-
static z =
|
|
2645
|
+
static z = F.crudeZ.transform((e) => new F(e));
|
|
2528
2646
|
/**
|
|
2529
2647
|
* The Series constructor accepts either a SeriesArgs object or a CrudeSeries value.
|
|
2530
2648
|
*
|
|
@@ -2599,69 +2717,70 @@ let Nr = class D {
|
|
|
2599
2717
|
* @throws Error if data type cannot be inferred from input
|
|
2600
2718
|
*/
|
|
2601
2719
|
constructor(e) {
|
|
2602
|
-
|
|
2720
|
+
Li(e) && (e = { data: e }), e.data ??= [];
|
|
2603
2721
|
const {
|
|
2604
2722
|
dataType: r,
|
|
2605
2723
|
timeRange: n,
|
|
2606
2724
|
sampleOffset: s = 0,
|
|
2607
2725
|
glBufferUsage: i = "static",
|
|
2608
2726
|
alignment: o = 0n,
|
|
2609
|
-
|
|
2727
|
+
alignmentMultiple: c = 1n,
|
|
2728
|
+
key: h = Lt(),
|
|
2610
2729
|
data: l
|
|
2611
2730
|
} = e;
|
|
2612
|
-
if (
|
|
2731
|
+
if (Cr(l)) {
|
|
2613
2732
|
const p = l;
|
|
2614
|
-
this.key = p.key, this.dataType = p.dataType, this.sampleOffset = p.sampleOffset, this.gl = p.gl, this._data = p._data, this.timeRange = p.timeRange, this.alignment = p.alignment, this.cachedMin = p.cachedMin, this.cachedMax = p.cachedMax, this.writePos = p.writePos, this._refCount = p._refCount, this.cachedLength = p.cachedLength;
|
|
2733
|
+
this.key = p.key, this.dataType = p.dataType, this.sampleOffset = p.sampleOffset, this.gl = p.gl, this._data = p._data, this.timeRange = p.timeRange, this.alignment = p.alignment, this.alignmentMultiple = p.alignmentMultiple, this.cachedMin = p.cachedMin, this.cachedMax = p.cachedMax, this.writePos = p.writePos, this._refCount = p._refCount, this.cachedLength = p.cachedLength;
|
|
2615
2734
|
return;
|
|
2616
2735
|
}
|
|
2617
|
-
const
|
|
2618
|
-
if (r != null) this.dataType = new
|
|
2736
|
+
const d = Mr(l), m = Array.isArray(l);
|
|
2737
|
+
if (r != null) this.dataType = new $(r);
|
|
2619
2738
|
else {
|
|
2620
2739
|
if (l instanceof ArrayBuffer)
|
|
2621
2740
|
throw new Error(
|
|
2622
2741
|
"cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type."
|
|
2623
2742
|
);
|
|
2624
|
-
if (
|
|
2743
|
+
if (m || d) {
|
|
2625
2744
|
let p = l;
|
|
2626
|
-
if (!
|
|
2745
|
+
if (!d) {
|
|
2627
2746
|
if (l.length === 0)
|
|
2628
2747
|
throw new Error(
|
|
2629
2748
|
"cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type."
|
|
2630
2749
|
);
|
|
2631
2750
|
p = l[0];
|
|
2632
2751
|
}
|
|
2633
|
-
if (typeof p == "string") this.dataType =
|
|
2634
|
-
else if (typeof p == "number") this.dataType =
|
|
2635
|
-
else if (typeof p == "bigint") this.dataType =
|
|
2636
|
-
else if (typeof p == "boolean") this.dataType =
|
|
2752
|
+
if (typeof p == "string") this.dataType = $.STRING;
|
|
2753
|
+
else if (typeof p == "number") this.dataType = $.FLOAT64;
|
|
2754
|
+
else if (typeof p == "bigint") this.dataType = $.INT64;
|
|
2755
|
+
else if (typeof p == "boolean") this.dataType = $.BOOLEAN;
|
|
2637
2756
|
else if (p instanceof b || p instanceof Date || p instanceof b)
|
|
2638
|
-
this.dataType =
|
|
2639
|
-
else if (typeof p == "object") this.dataType =
|
|
2757
|
+
this.dataType = $.TIMESTAMP;
|
|
2758
|
+
else if (typeof p == "object") this.dataType = $.JSON;
|
|
2640
2759
|
else
|
|
2641
2760
|
throw new Error(
|
|
2642
2761
|
`cannot infer data type of ${typeof p} when constructing a Series from a JS array`
|
|
2643
2762
|
);
|
|
2644
|
-
} else this.dataType = new
|
|
2763
|
+
} else this.dataType = new $(l);
|
|
2645
2764
|
}
|
|
2646
|
-
if (!
|
|
2647
|
-
else if (
|
|
2765
|
+
if (!m && !d) this._data = l;
|
|
2766
|
+
else if (m && l.length === 0)
|
|
2648
2767
|
this._data = new this.dataType.Array([]).buffer;
|
|
2649
2768
|
else {
|
|
2650
|
-
let p =
|
|
2651
|
-
const
|
|
2652
|
-
(
|
|
2769
|
+
let p = d ? [l] : l;
|
|
2770
|
+
const j = p[0];
|
|
2771
|
+
(j instanceof b || j instanceof Date || j instanceof O) && (p = p.map((A) => new b(A).valueOf())), this.dataType.equals($.STRING) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(`${p.join(`
|
|
2653
2772
|
`)}
|
|
2654
|
-
`).buffer) : this.dataType.equals(
|
|
2655
|
-
`${p.map((
|
|
2773
|
+
`).buffer) : this.dataType.equals($.JSON) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(
|
|
2774
|
+
`${p.map((A) => et.encodeString(A)).join(`
|
|
2656
2775
|
`)}
|
|
2657
2776
|
`
|
|
2658
|
-
).buffer) : this.dataType.usesBigInt && typeof
|
|
2659
|
-
p.map((
|
|
2660
|
-
).buffer : !this.dataType.usesBigInt && typeof
|
|
2777
|
+
).buffer) : this.dataType.usesBigInt && typeof j == "number" ? this._data = new this.dataType.Array(
|
|
2778
|
+
p.map((A) => BigInt(Math.round(A)))
|
|
2779
|
+
).buffer : !this.dataType.usesBigInt && typeof j == "bigint" ? this._data = new this.dataType.Array(
|
|
2661
2780
|
p.map(Number)
|
|
2662
2781
|
).buffer : this._data = new this.dataType.Array(p).buffer;
|
|
2663
2782
|
}
|
|
2664
|
-
this.key =
|
|
2783
|
+
this.key = h, this.alignment = o, this.alignmentMultiple = c, this.sampleOffset = s ?? 0, this.timeRange = n ?? J.ZERO, this.gl = {
|
|
2665
2784
|
control: null,
|
|
2666
2785
|
buffer: null,
|
|
2667
2786
|
prevBuffer: 0,
|
|
@@ -2678,7 +2797,7 @@ let Nr = class D {
|
|
|
2678
2797
|
static alloc({ capacity: e, dataType: r, ...n }) {
|
|
2679
2798
|
if (e === 0)
|
|
2680
2799
|
throw new Error("[Series] - cannot allocate an array of length 0");
|
|
2681
|
-
const s = new new
|
|
2800
|
+
const s = new new $(r).Array(e), i = new F({ data: s.buffer, dataType: r, ...n });
|
|
2682
2801
|
return i.writePos = 0, i;
|
|
2683
2802
|
}
|
|
2684
2803
|
/**
|
|
@@ -2721,12 +2840,12 @@ let Nr = class D {
|
|
|
2721
2840
|
return this.dataType.isVariable ? this.writeVariable(e) : this.writeFixed(e);
|
|
2722
2841
|
}
|
|
2723
2842
|
writeVariable(e) {
|
|
2724
|
-
if (this.writePos ===
|
|
2843
|
+
if (this.writePos === z) return 0;
|
|
2725
2844
|
const r = this.byteCapacity.valueOf() - this.writePos, n = e.subBytes(0, r);
|
|
2726
2845
|
return this.writeToUnderlyingData(n), this.writePos += n.byteLength.valueOf(), this.cachedLength != null && (this.cachedLength += n.length, this.calculateCachedLength()), n.length;
|
|
2727
2846
|
}
|
|
2728
2847
|
writeFixed(e) {
|
|
2729
|
-
if (this.writePos ===
|
|
2848
|
+
if (this.writePos === z) return 0;
|
|
2730
2849
|
const r = this.capacity - this.writePos, n = e.sub(0, r);
|
|
2731
2850
|
return this.writeToUnderlyingData(n), this.cachedLength = void 0, this.maybeRecomputeMinMax(n), this.writePos += n.length, n.length;
|
|
2732
2851
|
}
|
|
@@ -2749,7 +2868,7 @@ let Nr = class D {
|
|
|
2749
2868
|
* @returns A typed array containing the series data.
|
|
2750
2869
|
*/
|
|
2751
2870
|
get data() {
|
|
2752
|
-
return this.writePos ===
|
|
2871
|
+
return this.writePos === z ? this.underlyingData : new this.dataType.Array(this._data, 0, this.writePos);
|
|
2753
2872
|
}
|
|
2754
2873
|
/**
|
|
2755
2874
|
* Returns an array of the values in the series as strings.
|
|
@@ -2768,16 +2887,16 @@ let Nr = class D {
|
|
|
2768
2887
|
* @returns An array of values parsed from the JSON series.
|
|
2769
2888
|
*/
|
|
2770
2889
|
parseJSON(e) {
|
|
2771
|
-
if (!this.dataType.equals(
|
|
2890
|
+
if (!this.dataType.equals($.JSON))
|
|
2772
2891
|
throw new Error("cannot parse non-JSON series as JSON");
|
|
2773
|
-
return this.toStrings().map((r) => e.parse(
|
|
2892
|
+
return this.toStrings().map((r) => e.parse(et.decodeString(r)));
|
|
2774
2893
|
}
|
|
2775
2894
|
/**
|
|
2776
2895
|
* Returns the capacity of the series in bytes.
|
|
2777
2896
|
* @returns The size of the underlying buffer in bytes.
|
|
2778
2897
|
*/
|
|
2779
2898
|
get byteCapacity() {
|
|
2780
|
-
return new
|
|
2899
|
+
return new Le(this.underlyingData.byteLength);
|
|
2781
2900
|
}
|
|
2782
2901
|
/**
|
|
2783
2902
|
* Returns the capacity of the series in samples.
|
|
@@ -2793,7 +2912,7 @@ let Nr = class D {
|
|
|
2793
2912
|
* @returns The size of the data in bytes.
|
|
2794
2913
|
*/
|
|
2795
2914
|
get byteLength() {
|
|
2796
|
-
return this.writePos ===
|
|
2915
|
+
return this.writePos === z ? this.byteCapacity : this.dataType.isVariable ? new Le(this.writePos) : this.dataType.density.size(this.writePos);
|
|
2797
2916
|
}
|
|
2798
2917
|
/**
|
|
2799
2918
|
* Returns the number of samples in this array.
|
|
@@ -2801,7 +2920,7 @@ let Nr = class D {
|
|
|
2801
2920
|
* @returns The number of samples in the series.
|
|
2802
2921
|
*/
|
|
2803
2922
|
get length() {
|
|
2804
|
-
return this.cachedLength != null ? this.cachedLength : this.dataType.isVariable ? this.calculateCachedLength() : this.writePos ===
|
|
2923
|
+
return this.cachedLength != null ? this.cachedLength : this.dataType.isVariable ? this.calculateCachedLength() : this.writePos === z ? this.byteCapacity.valueOf() / this.dataType.density.valueOf() : this.writePos;
|
|
2805
2924
|
}
|
|
2806
2925
|
calculateCachedLength() {
|
|
2807
2926
|
if (!this.dataType.isVariable)
|
|
@@ -2809,7 +2928,7 @@ let Nr = class D {
|
|
|
2809
2928
|
let e = 0;
|
|
2810
2929
|
const r = [0];
|
|
2811
2930
|
return this.data.forEach((n, s) => {
|
|
2812
|
-
n ===
|
|
2931
|
+
n === ft && (e++, r.push(s + 1));
|
|
2813
2932
|
}), this._cachedIndexes = r, this.cachedLength = e, e;
|
|
2814
2933
|
}
|
|
2815
2934
|
/**
|
|
@@ -2825,8 +2944,8 @@ let Nr = class D {
|
|
|
2825
2944
|
if (this.dataType.equals(e)) return this;
|
|
2826
2945
|
const n = new e.Array(this.length);
|
|
2827
2946
|
for (let s = 0; s < this.length; s++)
|
|
2828
|
-
n[s] =
|
|
2829
|
-
return new
|
|
2947
|
+
n[s] = Ei(this.dataType, e, this.data[s], r);
|
|
2948
|
+
return new F({
|
|
2830
2949
|
data: n.buffer,
|
|
2831
2950
|
dataType: e,
|
|
2832
2951
|
timeRange: this.timeRange,
|
|
@@ -2837,7 +2956,7 @@ let Nr = class D {
|
|
|
2837
2956
|
}
|
|
2838
2957
|
calcRawMax() {
|
|
2839
2958
|
if (this.length === 0) return -1 / 0;
|
|
2840
|
-
if (this.dataType.equals(
|
|
2959
|
+
if (this.dataType.equals($.TIMESTAMP))
|
|
2841
2960
|
this.cachedMax = this.data[this.data.length - 1];
|
|
2842
2961
|
else if (this.dataType.usesBigInt) {
|
|
2843
2962
|
const e = this.data;
|
|
@@ -2855,11 +2974,11 @@ let Nr = class D {
|
|
|
2855
2974
|
calcMax() {
|
|
2856
2975
|
if (this.dataType.isVariable)
|
|
2857
2976
|
throw new Error("cannot calculate maximum on a variable length data type");
|
|
2858
|
-
return this.writePos === 0 ? -1 / 0 : (this.cachedMax ??= this.calcRawMax(),
|
|
2977
|
+
return this.writePos === 0 ? -1 / 0 : (this.cachedMax ??= this.calcRawMax(), Ue(this.cachedMax, this.sampleOffset));
|
|
2859
2978
|
}
|
|
2860
2979
|
calcRawMin() {
|
|
2861
2980
|
if (this.length === 0) return 1 / 0;
|
|
2862
|
-
if (this.dataType.equals(
|
|
2981
|
+
if (this.dataType.equals($.TIMESTAMP)) this.cachedMin = this.data[0];
|
|
2863
2982
|
else if (this.dataType.usesBigInt) {
|
|
2864
2983
|
const e = this.data;
|
|
2865
2984
|
this.cachedMin = e.reduce((r, n) => r < n ? r : n);
|
|
@@ -2876,7 +2995,7 @@ let Nr = class D {
|
|
|
2876
2995
|
calcMin() {
|
|
2877
2996
|
if (this.dataType.isVariable)
|
|
2878
2997
|
throw new Error("cannot calculate minimum on a variable length data type");
|
|
2879
|
-
return this.writePos === 0 ? 1 / 0 : (this.cachedMin ??= this.calcRawMin(),
|
|
2998
|
+
return this.writePos === 0 ? 1 / 0 : (this.cachedMin ??= this.calcRawMin(), Ue(this.cachedMin, this.sampleOffset));
|
|
2880
2999
|
}
|
|
2881
3000
|
/** @returns the bounds of the series. */
|
|
2882
3001
|
get bounds() {
|
|
@@ -2893,7 +3012,7 @@ let Nr = class D {
|
|
|
2893
3012
|
}
|
|
2894
3013
|
}
|
|
2895
3014
|
atAlignment(e, r) {
|
|
2896
|
-
const n = Number(e - this.alignment);
|
|
3015
|
+
const n = Number((e - this.alignment) / this.alignmentMultiple);
|
|
2897
3016
|
if (n < 0 || n >= this.length) {
|
|
2898
3017
|
if (r === !0) throw new Error(`[series] - no value at index ${n}`);
|
|
2899
3018
|
return;
|
|
@@ -2902,18 +3021,18 @@ let Nr = class D {
|
|
|
2902
3021
|
}
|
|
2903
3022
|
at(e, r = !1) {
|
|
2904
3023
|
if (this.dataType.isVariable) return this.atVariable(e, r ?? !1);
|
|
2905
|
-
if (this.dataType.equals(
|
|
3024
|
+
if (this.dataType.equals($.UUID)) return this.atUUID(e, r);
|
|
2906
3025
|
e < 0 && (e = this.length + e);
|
|
2907
3026
|
const n = this.data[e];
|
|
2908
3027
|
if (n == null) {
|
|
2909
3028
|
if (r === !0) throw new Error(`[series] - no value at index ${e}`);
|
|
2910
3029
|
return;
|
|
2911
3030
|
}
|
|
2912
|
-
return
|
|
3031
|
+
return Ue(n, this.sampleOffset);
|
|
2913
3032
|
}
|
|
2914
3033
|
atUUID(e, r) {
|
|
2915
3034
|
e < 0 && (e = this.length + e);
|
|
2916
|
-
const n =
|
|
3035
|
+
const n = Er(
|
|
2917
3036
|
new Uint8Array(this.buffer, e * this.dataType.density.valueOf())
|
|
2918
3037
|
);
|
|
2919
3038
|
if (n == null) {
|
|
@@ -2929,7 +3048,7 @@ let Nr = class D {
|
|
|
2929
3048
|
else {
|
|
2930
3049
|
e < 0 && (e = this.length + e);
|
|
2931
3050
|
for (let o = 0; o < this.data.length; o++)
|
|
2932
|
-
if (this.data[o] ===
|
|
3051
|
+
if (this.data[o] === ft) {
|
|
2933
3052
|
if (e === 0) {
|
|
2934
3053
|
s = o;
|
|
2935
3054
|
break;
|
|
@@ -2942,7 +3061,7 @@ let Nr = class D {
|
|
|
2942
3061
|
}
|
|
2943
3062
|
}
|
|
2944
3063
|
const i = this.data.slice(n, s);
|
|
2945
|
-
return this.dataType.equals(
|
|
3064
|
+
return this.dataType.equals($.STRING) ? new TextDecoder().decode(i) : mt(JSON.parse(new TextDecoder().decode(i)));
|
|
2946
3065
|
}
|
|
2947
3066
|
/**
|
|
2948
3067
|
* @returns the index of the first sample that is greater than or equal to the given value.
|
|
@@ -2951,7 +3070,7 @@ let Nr = class D {
|
|
|
2951
3070
|
*/
|
|
2952
3071
|
binarySearch(e) {
|
|
2953
3072
|
let r = 0, n = this.length - 1;
|
|
2954
|
-
const s =
|
|
3073
|
+
const s = De(e);
|
|
2955
3074
|
for (; r <= n; ) {
|
|
2956
3075
|
const i = Math.floor((r + n) / 2), o = s(this.at(i, !0), e);
|
|
2957
3076
|
if (o === 0) return i;
|
|
@@ -2967,11 +3086,11 @@ let Nr = class D {
|
|
|
2967
3086
|
* be the same buffer previously passed to {@method acquire} or {@method updateGLBuffer}.
|
|
2968
3087
|
*/
|
|
2969
3088
|
updateGLBuffer(e) {
|
|
2970
|
-
if (this.gl.control = e, !this.dataType.equals(
|
|
3089
|
+
if (this.gl.control = e, !this.dataType.equals($.FLOAT32) && !this.dataType.equals($.UINT8))
|
|
2971
3090
|
throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");
|
|
2972
3091
|
const { buffer: r, bufferUsage: n, prevBuffer: s } = this.gl;
|
|
2973
3092
|
if (r == null && (this.gl.buffer = e.createBuffer()), this.writePos !== s)
|
|
2974
|
-
if (e.bindBuffer(e.ARRAY_BUFFER, this.gl.buffer), this.writePos !==
|
|
3093
|
+
if (e.bindBuffer(e.ARRAY_BUFFER, this.gl.buffer), this.writePos !== z) {
|
|
2975
3094
|
s === 0 && e.bufferData(e.ARRAY_BUFFER, this.byteCapacity.valueOf(), e.STATIC_DRAW);
|
|
2976
3095
|
const i = this.dataType.density.size(s).valueOf(), o = this.underlyingData.slice(this.gl.prevBuffer, this.writePos);
|
|
2977
3096
|
e.bufferSubData(e.ARRAY_BUFFER, i, o.buffer), this.gl.prevBuffer = this.writePos;
|
|
@@ -2980,10 +3099,10 @@ let Nr = class D {
|
|
|
2980
3099
|
e.ARRAY_BUFFER,
|
|
2981
3100
|
this.buffer,
|
|
2982
3101
|
n === "static" ? e.STATIC_DRAW : e.DYNAMIC_DRAW
|
|
2983
|
-
), this.gl.prevBuffer =
|
|
3102
|
+
), this.gl.prevBuffer = z;
|
|
2984
3103
|
}
|
|
2985
3104
|
as(e) {
|
|
2986
|
-
return
|
|
3105
|
+
return Ar(e, this.dataType), this;
|
|
2987
3106
|
}
|
|
2988
3107
|
/** @returns a digest containing information about the series. */
|
|
2989
3108
|
get digest() {
|
|
@@ -2992,8 +3111,8 @@ let Nr = class D {
|
|
|
2992
3111
|
dataType: this.dataType.toString(),
|
|
2993
3112
|
sampleOffset: this.sampleOffset,
|
|
2994
3113
|
alignment: {
|
|
2995
|
-
lower:
|
|
2996
|
-
upper:
|
|
3114
|
+
lower: Zt(this.alignmentBounds.lower),
|
|
3115
|
+
upper: Zt(this.alignmentBounds.upper)
|
|
2997
3116
|
},
|
|
2998
3117
|
timeRange: this.timeRange.toString(),
|
|
2999
3118
|
length: this.length,
|
|
@@ -3010,7 +3129,10 @@ let Nr = class D {
|
|
|
3010
3129
|
* is exclusive.
|
|
3011
3130
|
*/
|
|
3012
3131
|
get alignmentBounds() {
|
|
3013
|
-
return y(
|
|
3132
|
+
return y(
|
|
3133
|
+
this.alignment,
|
|
3134
|
+
this.alignment + BigInt(this.length) * this.alignmentMultiple
|
|
3135
|
+
);
|
|
3014
3136
|
}
|
|
3015
3137
|
maybeGarbageCollectGLBuffer(e) {
|
|
3016
3138
|
this.gl.buffer != null && (e.deleteBuffer(this.gl.buffer), this.gl.buffer = null, this.gl.prevBuffer = 0, this.gl.control = null);
|
|
@@ -3027,10 +3149,10 @@ let Nr = class D {
|
|
|
3027
3149
|
}
|
|
3028
3150
|
[Symbol.iterator]() {
|
|
3029
3151
|
if (this.dataType.isVariable) {
|
|
3030
|
-
const e = new
|
|
3031
|
-
return this.dataType.equals(
|
|
3152
|
+
const e = new Di(this);
|
|
3153
|
+
return this.dataType.equals($.JSON) ? new Pi(e) : e;
|
|
3032
3154
|
}
|
|
3033
|
-
return this.dataType.equals(
|
|
3155
|
+
return this.dataType.equals($.UUID) ? new qi(this) : new ki(this);
|
|
3034
3156
|
}
|
|
3035
3157
|
/**
|
|
3036
3158
|
* Returns a slice of the series from start to end.
|
|
@@ -3057,7 +3179,7 @@ let Nr = class D {
|
|
|
3057
3179
|
* @returns An iterator over the specified range.
|
|
3058
3180
|
*/
|
|
3059
3181
|
subIterator(e, r) {
|
|
3060
|
-
return new
|
|
3182
|
+
return new Ft(this, e, r ?? this.length);
|
|
3061
3183
|
}
|
|
3062
3184
|
/**
|
|
3063
3185
|
* Returns an iterator over a portion of the series based on alignment.
|
|
@@ -3066,16 +3188,17 @@ let Nr = class D {
|
|
|
3066
3188
|
* @returns An iterator over the specified alignment range.
|
|
3067
3189
|
*/
|
|
3068
3190
|
subAlignmentIterator(e, r) {
|
|
3069
|
-
|
|
3070
|
-
this
|
|
3071
|
-
|
|
3072
|
-
Number(r - this.alignment)
|
|
3191
|
+
const n = Math.ceil(
|
|
3192
|
+
Number(e - this.alignment) / Number(this.alignmentMultiple)
|
|
3193
|
+
), s = Math.ceil(
|
|
3194
|
+
Number(r - this.alignment) / Number(this.alignmentMultiple)
|
|
3073
3195
|
);
|
|
3196
|
+
return new Ft(this, n, s);
|
|
3074
3197
|
}
|
|
3075
3198
|
subBytes(e, r) {
|
|
3076
3199
|
if (e >= 0 && (r == null || r >= this.byteLength.valueOf())) return this;
|
|
3077
3200
|
const n = this.data.subarray(e, r);
|
|
3078
|
-
return new
|
|
3201
|
+
return new F({
|
|
3079
3202
|
data: n,
|
|
3080
3203
|
dataType: this.dataType,
|
|
3081
3204
|
timeRange: this.timeRange,
|
|
@@ -3087,7 +3210,7 @@ let Nr = class D {
|
|
|
3087
3210
|
sliceSub(e, r, n) {
|
|
3088
3211
|
if (r <= 0 && (n == null || n >= this.length)) return this;
|
|
3089
3212
|
let s;
|
|
3090
|
-
return e ? s = this.data.subarray(r, n) : s = this.data.slice(r, n), new
|
|
3213
|
+
return e ? s = this.data.subarray(r, n) : s = this.data.slice(r, n), new F({
|
|
3091
3214
|
data: s,
|
|
3092
3215
|
dataType: this.dataType,
|
|
3093
3216
|
timeRange: this.timeRange,
|
|
@@ -3102,10 +3225,10 @@ let Nr = class D {
|
|
|
3102
3225
|
* @returns A new series with the specified alignment.
|
|
3103
3226
|
*/
|
|
3104
3227
|
reAlign(e) {
|
|
3105
|
-
return new
|
|
3228
|
+
return new F({
|
|
3106
3229
|
data: this.buffer,
|
|
3107
3230
|
dataType: this.dataType,
|
|
3108
|
-
timeRange:
|
|
3231
|
+
timeRange: J.ZERO,
|
|
3109
3232
|
sampleOffset: this.sampleOffset,
|
|
3110
3233
|
glBufferUsage: "static",
|
|
3111
3234
|
alignment: e
|
|
@@ -3129,21 +3252,20 @@ let Nr = class D {
|
|
|
3129
3252
|
return e += "])", e;
|
|
3130
3253
|
}
|
|
3131
3254
|
};
|
|
3132
|
-
const
|
|
3133
|
-
let
|
|
3255
|
+
const Li = (t) => t == null ? !1 : Array.isArray(t) || t instanceof ArrayBuffer || ArrayBuffer.isView(t) && !(t instanceof DataView) || t instanceof Ur ? !0 : Mr(t), Cr = Ni(Br, Ur);
|
|
3256
|
+
let Ft = class {
|
|
3134
3257
|
series;
|
|
3135
3258
|
end;
|
|
3136
3259
|
index;
|
|
3137
3260
|
constructor(e, r, n) {
|
|
3138
3261
|
this.series = e;
|
|
3139
|
-
const s = y(0, e.length);
|
|
3140
|
-
this.end =
|
|
3262
|
+
const s = y(0, e.length + 1);
|
|
3263
|
+
this.end = st(s, n), this.index = st(s, r);
|
|
3141
3264
|
}
|
|
3142
3265
|
next() {
|
|
3143
3266
|
return this.index >= this.end ? { done: !0, value: void 0 } : { done: !1, value: this.series.at(this.index++, !0) };
|
|
3144
3267
|
}
|
|
3145
|
-
}
|
|
3146
|
-
class Ui {
|
|
3268
|
+
}, Di = class {
|
|
3147
3269
|
series;
|
|
3148
3270
|
index;
|
|
3149
3271
|
decoder;
|
|
@@ -3156,12 +3278,11 @@ class Ui {
|
|
|
3156
3278
|
}
|
|
3157
3279
|
next() {
|
|
3158
3280
|
const e = this.index, r = this.series.data;
|
|
3159
|
-
for (; this.index < r.length && r[this.index] !==
|
|
3281
|
+
for (; this.index < r.length && r[this.index] !== ft; ) this.index++;
|
|
3160
3282
|
const n = this.index;
|
|
3161
3283
|
return e === n ? { done: !0, value: void 0 } : (this.index++, { done: !1, value: this.decoder.decode(this.series.buffer.slice(e, n)) });
|
|
3162
3284
|
}
|
|
3163
|
-
}
|
|
3164
|
-
let Ci = class Mr {
|
|
3285
|
+
}, Pi = class jr {
|
|
3165
3286
|
wrapped;
|
|
3166
3287
|
static schema = a.record(a.string(), a.unknown());
|
|
3167
3288
|
constructor(e) {
|
|
@@ -3171,25 +3292,26 @@ let Ci = class Mr {
|
|
|
3171
3292
|
const e = this.wrapped.next();
|
|
3172
3293
|
return e.done === !0 ? { done: !0, value: void 0 } : {
|
|
3173
3294
|
done: !1,
|
|
3174
|
-
value:
|
|
3295
|
+
value: et.decodeString(e.value, jr.schema)
|
|
3175
3296
|
};
|
|
3176
3297
|
}
|
|
3177
|
-
},
|
|
3298
|
+
}, qi = class {
|
|
3178
3299
|
series;
|
|
3179
3300
|
index;
|
|
3180
3301
|
data;
|
|
3181
3302
|
density;
|
|
3182
3303
|
constructor(e) {
|
|
3183
|
-
if (!e.dataType.equals(
|
|
3304
|
+
if (!e.dataType.equals($.UUID))
|
|
3184
3305
|
throw new Error("cannot create a UUID series iterator for a non-UUID series");
|
|
3185
|
-
this.series = e, this.index = 0, this.data = new Uint8Array(e.buffer), this.density =
|
|
3306
|
+
this.series = e, this.index = 0, this.data = new Uint8Array(e.buffer), this.density = $.UUID.density.valueOf();
|
|
3186
3307
|
}
|
|
3187
3308
|
next() {
|
|
3188
3309
|
if (this.index >= this.series.length) return { done: !0, value: void 0 };
|
|
3189
|
-
const e =
|
|
3310
|
+
const e = Er(this.data, this.index * this.density);
|
|
3190
3311
|
return this.index++, { done: !1, value: e };
|
|
3191
3312
|
}
|
|
3192
|
-
}
|
|
3313
|
+
};
|
|
3314
|
+
class ki {
|
|
3193
3315
|
series;
|
|
3194
3316
|
index;
|
|
3195
3317
|
constructor(e) {
|
|
@@ -3201,7 +3323,8 @@ let Ci = class Mr {
|
|
|
3201
3323
|
value: this.series.at(this.index++, !0)
|
|
3202
3324
|
};
|
|
3203
3325
|
}
|
|
3204
|
-
}
|
|
3326
|
+
}
|
|
3327
|
+
let Ro = class {
|
|
3205
3328
|
/** The array of series in this collection */
|
|
3206
3329
|
series;
|
|
3207
3330
|
/**
|
|
@@ -3254,14 +3377,14 @@ let Ci = class Mr {
|
|
|
3254
3377
|
this.series = e;
|
|
3255
3378
|
}
|
|
3256
3379
|
as(e) {
|
|
3257
|
-
return
|
|
3380
|
+
return Ar(e, this.dataType), this;
|
|
3258
3381
|
}
|
|
3259
3382
|
/**
|
|
3260
3383
|
* Returns the data type of the series in this collection. If the collection is empty,
|
|
3261
3384
|
* returns DataType.UNKNOWN.
|
|
3262
3385
|
*/
|
|
3263
3386
|
get dataType() {
|
|
3264
|
-
return this.series.length === 0 ?
|
|
3387
|
+
return this.series.length === 0 ? $.UNKNOWN : this.series[0].dataType;
|
|
3265
3388
|
}
|
|
3266
3389
|
/**
|
|
3267
3390
|
* Returns the combined time range of all series in the collection. If the collection
|
|
@@ -3269,7 +3392,7 @@ let Ci = class Mr {
|
|
|
3269
3392
|
* series to the end of the last series.
|
|
3270
3393
|
*/
|
|
3271
3394
|
get timeRange() {
|
|
3272
|
-
return this.series.length === 0 ?
|
|
3395
|
+
return this.series.length === 0 ? J.ZERO : new J(
|
|
3273
3396
|
this.series[0].timeRange.start,
|
|
3274
3397
|
this.series[this.series.length - 1].timeRange.end
|
|
3275
3398
|
);
|
|
@@ -3296,7 +3419,7 @@ let Ci = class Mr {
|
|
|
3296
3419
|
const r = () => new Error(
|
|
3297
3420
|
`cannot push a ${e.dataType.toString()} series to a ${this.dataType.toString()} multi-series`
|
|
3298
3421
|
), n = e.dataType.equals(this.dataType);
|
|
3299
|
-
if (
|
|
3422
|
+
if (Cr(e)) {
|
|
3300
3423
|
if (this.series.length !== 0 && !n) throw r();
|
|
3301
3424
|
this.series.push(e);
|
|
3302
3425
|
} else {
|
|
@@ -3314,7 +3437,7 @@ let Ci = class Mr {
|
|
|
3314
3437
|
}
|
|
3315
3438
|
atAlignment(e, r) {
|
|
3316
3439
|
for (const n of this.series)
|
|
3317
|
-
if (
|
|
3440
|
+
if (U(n.alignmentBounds, e))
|
|
3318
3441
|
return n.atAlignment(e, r);
|
|
3319
3442
|
if (r) throw new Error(`[series] - no value at alignment ${e}`);
|
|
3320
3443
|
}
|
|
@@ -3333,7 +3456,7 @@ let Ci = class Mr {
|
|
|
3333
3456
|
* @returns An iterator over the specified range.
|
|
3334
3457
|
*/
|
|
3335
3458
|
subIterator(e, r) {
|
|
3336
|
-
return new
|
|
3459
|
+
return new Xe(this, e, r ?? this.length);
|
|
3337
3460
|
}
|
|
3338
3461
|
/**
|
|
3339
3462
|
* Returns an iterator over a portion of the multi-series based on alignment.
|
|
@@ -3343,14 +3466,16 @@ let Ci = class Mr {
|
|
|
3343
3466
|
*/
|
|
3344
3467
|
subAlignmentIterator(e, r) {
|
|
3345
3468
|
if (e >= this.alignmentBounds.upper || r <= this.alignmentBounds.lower)
|
|
3346
|
-
return
|
|
3469
|
+
return ht;
|
|
3347
3470
|
let n = 0;
|
|
3348
3471
|
for (let i = 0; i < this.series.length; i++) {
|
|
3349
3472
|
const o = this.series[i];
|
|
3350
3473
|
if (e < o.alignment) break;
|
|
3351
3474
|
if (e >= o.alignmentBounds.upper) n += o.length;
|
|
3352
|
-
else if (
|
|
3353
|
-
n +=
|
|
3475
|
+
else if (U(o.alignmentBounds, e)) {
|
|
3476
|
+
n += Math.ceil(
|
|
3477
|
+
Number(e - o.alignment) / Number(o.alignmentMultiple)
|
|
3478
|
+
);
|
|
3354
3479
|
break;
|
|
3355
3480
|
}
|
|
3356
3481
|
}
|
|
@@ -3359,12 +3484,14 @@ let Ci = class Mr {
|
|
|
3359
3484
|
const o = this.series[i];
|
|
3360
3485
|
if (r < o.alignment) break;
|
|
3361
3486
|
if (r >= o.alignmentBounds.upper) s += o.length;
|
|
3362
|
-
else if (
|
|
3363
|
-
s +=
|
|
3487
|
+
else if (U(o.alignmentBounds, r)) {
|
|
3488
|
+
s += Math.ceil(
|
|
3489
|
+
Number(r - o.alignment) / Number(o.alignmentMultiple)
|
|
3490
|
+
);
|
|
3364
3491
|
break;
|
|
3365
3492
|
}
|
|
3366
3493
|
}
|
|
3367
|
-
return new
|
|
3494
|
+
return new Xe(this, n, s);
|
|
3368
3495
|
}
|
|
3369
3496
|
/**
|
|
3370
3497
|
* Returns an iterator over the specified alignment range and span.
|
|
@@ -3373,19 +3500,19 @@ let Ci = class Mr {
|
|
|
3373
3500
|
* @returns An iterator over the specified range.
|
|
3374
3501
|
*/
|
|
3375
3502
|
subAlignmentSpanIterator(e, r) {
|
|
3376
|
-
if (e >= this.alignmentBounds.upper) return
|
|
3503
|
+
if (e >= this.alignmentBounds.upper) return ht;
|
|
3377
3504
|
r = Math.min(r, Number(this.distance(e, this.alignmentBounds.upper)));
|
|
3378
3505
|
let n = 0;
|
|
3379
3506
|
for (let s = 0; s < this.series.length; s++) {
|
|
3380
3507
|
const i = this.series[s];
|
|
3381
3508
|
if (e < i.alignment) break;
|
|
3382
3509
|
if (e >= i.alignmentBounds.upper) n += i.length;
|
|
3383
|
-
else if (
|
|
3510
|
+
else if (U(i.alignmentBounds, e)) {
|
|
3384
3511
|
n += Number(e - i.alignment);
|
|
3385
3512
|
break;
|
|
3386
3513
|
}
|
|
3387
3514
|
}
|
|
3388
|
-
return new
|
|
3515
|
+
return new Xe(this, n, n + r);
|
|
3389
3516
|
}
|
|
3390
3517
|
/**
|
|
3391
3518
|
* Updates the WebGL buffer for all series in the collection.
|
|
@@ -3398,13 +3525,13 @@ let Ci = class Mr {
|
|
|
3398
3525
|
* Returns the bounds containing the minimum and maximum values across all series.
|
|
3399
3526
|
*/
|
|
3400
3527
|
get bounds() {
|
|
3401
|
-
return
|
|
3528
|
+
return or(this.series.map((e) => e.bounds));
|
|
3402
3529
|
}
|
|
3403
3530
|
/**
|
|
3404
3531
|
* Returns the sum of the byte lengths of all series.
|
|
3405
3532
|
*/
|
|
3406
3533
|
get byteLength() {
|
|
3407
|
-
return new
|
|
3534
|
+
return new Le(this.series.reduce((e, r) => e + r.byteLength.valueOf(), 0));
|
|
3408
3535
|
}
|
|
3409
3536
|
/**
|
|
3410
3537
|
* Returns a combined typed array containing all data from all series.
|
|
@@ -3425,7 +3552,7 @@ let Ci = class Mr {
|
|
|
3425
3552
|
*/
|
|
3426
3553
|
traverseAlignment(e, r) {
|
|
3427
3554
|
const n = this.series.map((s) => s.alignmentBounds);
|
|
3428
|
-
return
|
|
3555
|
+
return ur(n, e, r);
|
|
3429
3556
|
}
|
|
3430
3557
|
/**
|
|
3431
3558
|
* Acquires a reference to the WebGL buffer for all series.
|
|
@@ -3448,7 +3575,7 @@ let Ci = class Mr {
|
|
|
3448
3575
|
*/
|
|
3449
3576
|
distance(e, r) {
|
|
3450
3577
|
const n = this.series.map((s) => s.alignmentBounds);
|
|
3451
|
-
return
|
|
3578
|
+
return lr(n, e, r);
|
|
3452
3579
|
}
|
|
3453
3580
|
/**
|
|
3454
3581
|
* Parses a JSON multi-series into an array of values using the provided zod schema.
|
|
@@ -3458,7 +3585,7 @@ let Ci = class Mr {
|
|
|
3458
3585
|
* @returns An array of values parsed from the JSON series.
|
|
3459
3586
|
*/
|
|
3460
3587
|
parseJSON(e) {
|
|
3461
|
-
if (!this.dataType.equals(
|
|
3588
|
+
if (!this.dataType.equals($.JSON))
|
|
3462
3589
|
throw new Error("cannot parse non-JSON series as JSON");
|
|
3463
3590
|
return this.series.flatMap((r) => r.parseJSON(e));
|
|
3464
3591
|
}
|
|
@@ -3471,7 +3598,7 @@ let Ci = class Mr {
|
|
|
3471
3598
|
next() {
|
|
3472
3599
|
return { done: !0, value: void 0 };
|
|
3473
3600
|
}
|
|
3474
|
-
} : new
|
|
3601
|
+
} : new zi(this.series);
|
|
3475
3602
|
}
|
|
3476
3603
|
/**
|
|
3477
3604
|
* Returns an array of the values in the multi-series as strings.
|
|
@@ -3481,7 +3608,7 @@ let Ci = class Mr {
|
|
|
3481
3608
|
toStrings() {
|
|
3482
3609
|
return this.series.flatMap((e) => e.toStrings());
|
|
3483
3610
|
}
|
|
3484
|
-
},
|
|
3611
|
+
}, zi = class {
|
|
3485
3612
|
series;
|
|
3486
3613
|
seriesIndex;
|
|
3487
3614
|
internal;
|
|
@@ -3495,7 +3622,8 @@ let Ci = class Mr {
|
|
|
3495
3622
|
[Symbol.iterator]() {
|
|
3496
3623
|
return this;
|
|
3497
3624
|
}
|
|
3498
|
-
}
|
|
3625
|
+
};
|
|
3626
|
+
class Xe {
|
|
3499
3627
|
series;
|
|
3500
3628
|
index;
|
|
3501
3629
|
end;
|
|
@@ -3508,47 +3636,47 @@ let Ci = class Mr {
|
|
|
3508
3636
|
[Symbol.iterator]() {
|
|
3509
3637
|
return this;
|
|
3510
3638
|
}
|
|
3511
|
-
}
|
|
3512
|
-
const
|
|
3639
|
+
}
|
|
3640
|
+
const Zt = (t) => {
|
|
3513
3641
|
const e = t >> 32n, r = t & 0xffffffffn;
|
|
3514
3642
|
return { domain: e, sample: r };
|
|
3515
3643
|
};
|
|
3516
3644
|
a.object({ key: a.string(), value: a.string() });
|
|
3517
|
-
const
|
|
3645
|
+
const Fi = a.record(
|
|
3518
3646
|
a.union([a.number(), a.string(), a.symbol()]),
|
|
3519
3647
|
a.unknown()
|
|
3520
|
-
),
|
|
3648
|
+
), Dt = (t) => Object.entries(t), Zi = (t, e) => Object.fromEntries(Dt(t).map(([r, n]) => [r, e(n, r)])), Yi = (t) => Object.fromEntries(Dt(t).filter(([e, r]) => r !== void 0)), Po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3521
3649
|
__proto__: null,
|
|
3522
|
-
entries:
|
|
3523
|
-
map:
|
|
3524
|
-
purgeUndefined:
|
|
3525
|
-
unknownZ:
|
|
3526
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3650
|
+
entries: Dt,
|
|
3651
|
+
map: Zi,
|
|
3652
|
+
purgeUndefined: Yi,
|
|
3653
|
+
unknownZ: Fi
|
|
3654
|
+
}, Symbol.toStringTag, { value: "Module" })), Rr = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", Wi = Rr(), Lr = ["macOS", "Windows", "Linux"], Vi = ["macos", "windows", "linux"], Gi = {
|
|
3527
3655
|
macos: "macOS",
|
|
3528
3656
|
windows: "Windows",
|
|
3529
3657
|
linux: "Linux"
|
|
3530
|
-
},
|
|
3531
|
-
a.enum(
|
|
3532
|
-
),
|
|
3658
|
+
}, Hi = a.enum(Lr).or(
|
|
3659
|
+
a.enum(Vi).transform((t) => Gi[t])
|
|
3660
|
+
), Ji = () => {
|
|
3533
3661
|
if (typeof window > "u") return;
|
|
3534
3662
|
const t = window.navigator.userAgent.toLowerCase();
|
|
3535
3663
|
if (t.includes("mac")) return "macOS";
|
|
3536
3664
|
if (t.includes("win")) return "Windows";
|
|
3537
3665
|
if (t.includes("linux")) return "Linux";
|
|
3538
3666
|
};
|
|
3539
|
-
let
|
|
3540
|
-
const
|
|
3667
|
+
let Ke;
|
|
3668
|
+
const Xi = (t = {}) => {
|
|
3541
3669
|
const { force: e, default: r } = t;
|
|
3542
|
-
return e ??
|
|
3543
|
-
},
|
|
3670
|
+
return e ?? Ke ?? (Ke = Ji(), Ke ?? r);
|
|
3671
|
+
}, qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3544
3672
|
__proto__: null,
|
|
3545
|
-
OPERATING_SYSTEMS:
|
|
3546
|
-
RUNTIME:
|
|
3547
|
-
detect:
|
|
3548
|
-
getOS:
|
|
3549
|
-
osZ:
|
|
3550
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3551
|
-
class
|
|
3673
|
+
OPERATING_SYSTEMS: Lr,
|
|
3674
|
+
RUNTIME: Wi,
|
|
3675
|
+
detect: Rr,
|
|
3676
|
+
getOS: Xi,
|
|
3677
|
+
osZ: Hi
|
|
3678
|
+
}, Symbol.toStringTag, { value: "Module" })), Ki = (...t) => t.map(Dr).join(""), Dr = (t) => (t.endsWith("/") || (t += "/"), t.startsWith("/") && (t = t.slice(1)), t), Qi = (t) => t.endsWith("/") ? t.slice(0, -1) : t;
|
|
3679
|
+
class Ce {
|
|
3552
3680
|
protocol;
|
|
3553
3681
|
host;
|
|
3554
3682
|
port;
|
|
@@ -3560,7 +3688,7 @@ class Ee {
|
|
|
3560
3688
|
* @param pathPrefix - A path prefix to use for all requests. Defaults to "".
|
|
3561
3689
|
*/
|
|
3562
3690
|
constructor({ host: e, port: r, protocol: n = "", pathPrefix: s = "" }) {
|
|
3563
|
-
this.protocol = n, this.host = e, this.port = r, this.path =
|
|
3691
|
+
this.protocol = n, this.host = e, this.port = r, this.path = Dr(s);
|
|
3564
3692
|
}
|
|
3565
3693
|
/**
|
|
3566
3694
|
* Replaces creates a new URL with the specified properties replaced.
|
|
@@ -3568,7 +3696,7 @@ class Ee {
|
|
|
3568
3696
|
* @returns a new URL.
|
|
3569
3697
|
*/
|
|
3570
3698
|
replace(e) {
|
|
3571
|
-
return new
|
|
3699
|
+
return new Ce({
|
|
3572
3700
|
host: e.host ?? this.host,
|
|
3573
3701
|
port: e.port ?? this.port,
|
|
3574
3702
|
protocol: e.protocol ?? this.protocol,
|
|
@@ -3581,106 +3709,107 @@ class Ee {
|
|
|
3581
3709
|
* @returns a new URL.
|
|
3582
3710
|
*/
|
|
3583
3711
|
child(e) {
|
|
3584
|
-
return new
|
|
3712
|
+
return new Ce({
|
|
3585
3713
|
...this,
|
|
3586
|
-
pathPrefix:
|
|
3714
|
+
pathPrefix: Ki(this.path, e)
|
|
3587
3715
|
});
|
|
3588
3716
|
}
|
|
3589
3717
|
/** @returns a string representation of the url */
|
|
3590
3718
|
toString() {
|
|
3591
|
-
return
|
|
3719
|
+
return Qi(
|
|
3592
3720
|
`${this.protocol}://${this.host}:${this.port}/${this.path}`
|
|
3593
3721
|
);
|
|
3594
3722
|
}
|
|
3595
|
-
static UNKNOWN = new
|
|
3723
|
+
static UNKNOWN = new Ce({ host: "unknown", port: 0 });
|
|
3596
3724
|
}
|
|
3597
|
-
const
|
|
3725
|
+
const _i = 2, ea = 3, ta = 2, ra = (t, e) => {
|
|
3598
3726
|
if (Number.isNaN(t) || !Number.isFinite(t)) return t;
|
|
3599
|
-
const r =
|
|
3727
|
+
const r = Oe(e);
|
|
3600
3728
|
if (r == 0) return t;
|
|
3601
3729
|
let n;
|
|
3602
|
-
r >= 1e3 ? n =
|
|
3730
|
+
r >= 1e3 ? n = _i : r >= 1 ? n = ea : n = Math.ceil(-Math.log10(r)) + ta;
|
|
3603
3731
|
const s = 10 ** n;
|
|
3604
3732
|
return Math.round(t * s) / s;
|
|
3605
|
-
},
|
|
3733
|
+
}, ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3606
3734
|
__proto__: null,
|
|
3607
|
-
abs:
|
|
3608
|
-
add:
|
|
3609
|
-
closeTo:
|
|
3610
|
-
div:
|
|
3611
|
-
equal:
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3735
|
+
abs: ir,
|
|
3736
|
+
add: ie,
|
|
3737
|
+
closeTo: jn,
|
|
3738
|
+
div: we,
|
|
3739
|
+
equal: nt,
|
|
3740
|
+
isInteger: je,
|
|
3741
|
+
max: Ln,
|
|
3742
|
+
min: sr,
|
|
3743
|
+
mult: B,
|
|
3744
|
+
roundBySpan: ra,
|
|
3745
|
+
roundToNearestMagnitude: Rn,
|
|
3746
|
+
sub: P
|
|
3618
3747
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3619
3748
|
a.object({
|
|
3620
|
-
baseInterval:
|
|
3749
|
+
baseInterval: O.z.optional(),
|
|
3621
3750
|
maxRetries: a.number().optional(),
|
|
3622
3751
|
scale: a.number().optional()
|
|
3623
3752
|
});
|
|
3624
|
-
const
|
|
3753
|
+
const na = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Pr = a.string().regex(na), re = a.number().min(0).max(255), qr = a.number().min(0).max(1), We = a.tuple([re, re, re, qr]), sa = a.tuple([re, re, re]), ia = a.object({ rgba255: We }), aa = a.number().min(0).max(360), oa = a.number().min(0).max(100), ua = a.number().min(0).max(100), kr = a.tuple([aa, oa, ua, qr]), Ve = a.union([Pr, sa, We, kr, ia]), Ge = Ve.transform((t) => v(t)), la = (t) => Ge.safeParse(t).success, ca = (t) => We.safeParse(t).success, ha = (t) => {
|
|
3625
3754
|
if (t == null) return;
|
|
3626
|
-
const e =
|
|
3627
|
-
if (e.success) return
|
|
3755
|
+
const e = Ge.safeParse(t);
|
|
3756
|
+
if (e.success) return Fr(e.data);
|
|
3628
3757
|
if (typeof t == "string") return t;
|
|
3629
3758
|
throw e.error;
|
|
3630
|
-
},
|
|
3631
|
-
if (t =
|
|
3759
|
+
}, v = (t, e = 1) => {
|
|
3760
|
+
if (t = Ve.parse(t), typeof t == "string") return Ta(t, e);
|
|
3632
3761
|
if (Array.isArray(t)) {
|
|
3633
3762
|
if (t.length < 3 || t.length > 4)
|
|
3634
3763
|
throw new Error(`Invalid color: [${t.join(", ")}]`);
|
|
3635
3764
|
return t.length === 3 ? [...t, e] : t;
|
|
3636
3765
|
}
|
|
3637
3766
|
return t.rgba255;
|
|
3638
|
-
},
|
|
3767
|
+
}, zr = (t, e) => {
|
|
3639
3768
|
if (t == null || e == null) return t == e;
|
|
3640
|
-
const r =
|
|
3769
|
+
const r = v(t), n = v(e);
|
|
3641
3770
|
return r.every((s, i) => s === n[i]);
|
|
3642
|
-
},
|
|
3771
|
+
}, fa = (t) => {
|
|
3643
3772
|
if (t == null) return;
|
|
3644
|
-
const [e, r, n, s] =
|
|
3645
|
-
return `#${
|
|
3646
|
-
},
|
|
3647
|
-
const [e, r, n, s] =
|
|
3773
|
+
const [e, r, n, s] = v(t);
|
|
3774
|
+
return `#${$e(e)}${$e(r)}${$e(n)}${s === 1 ? "" : $e(s * 255)}`;
|
|
3775
|
+
}, Fr = (t) => {
|
|
3776
|
+
const [e, r, n, s] = v(t);
|
|
3648
3777
|
return `rgba(${e}, ${r}, ${n}, ${s})`;
|
|
3649
|
-
},
|
|
3650
|
-
const [e, r, n] =
|
|
3778
|
+
}, da = (t) => `rgb(${Zr(t)})`, Zr = (t) => {
|
|
3779
|
+
const [e, r, n] = v(t);
|
|
3651
3780
|
return `${e}, ${r}, ${n}`;
|
|
3652
|
-
},
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
],
|
|
3657
|
-
const [r, n, s] =
|
|
3781
|
+
}, ga = (t) => [...Pt(t), de(t)], Pt = (t) => [
|
|
3782
|
+
ce(t) / 255,
|
|
3783
|
+
he(t) / 255,
|
|
3784
|
+
fe(t) / 255
|
|
3785
|
+
], ce = (t) => v(t)[0], he = (t) => v(t)[1], fe = (t) => v(t)[2], de = (t) => v(t)[3], pa = (t) => zr(qt, t), ma = (t) => Sa(v(t)), ya = (t, e) => {
|
|
3786
|
+
const [r, n, s] = v(t);
|
|
3658
3787
|
if (e > 100)
|
|
3659
3788
|
throw new Error(`Color opacity must be between 0 and 100, got ${e}`);
|
|
3660
3789
|
return e > 1 && (e /= 100), [r, n, s, e];
|
|
3661
|
-
},
|
|
3662
|
-
const [e, r, n] =
|
|
3790
|
+
}, ye = (t) => {
|
|
3791
|
+
const [e, r, n] = Pt(t).map(
|
|
3663
3792
|
(s) => s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4
|
|
3664
3793
|
);
|
|
3665
3794
|
return Number((0.2126 * e + 0.7152 * r + 0.0722 * n).toFixed(3));
|
|
3666
|
-
},
|
|
3667
|
-
const [e, r, n] =
|
|
3795
|
+
}, ba = (t) => {
|
|
3796
|
+
const [e, r, n] = Pt(t);
|
|
3668
3797
|
return 1 - (Math.max(e, r, n) - Math.min(e, r, n));
|
|
3669
|
-
},
|
|
3670
|
-
const r =
|
|
3798
|
+
}, dt = (t, e) => {
|
|
3799
|
+
const r = v(t), n = v(e), s = ye(r), i = ye(n);
|
|
3671
3800
|
return (Math.max(s, i) + 0.5) / (Math.min(s, i) + 0.5);
|
|
3672
|
-
},
|
|
3801
|
+
}, wa = (t, ...e) => {
|
|
3673
3802
|
if (e.length === 0)
|
|
3674
3803
|
throw new Error("[Color.pickByContrast] - must provide at least one color");
|
|
3675
|
-
const r =
|
|
3676
|
-
return
|
|
3677
|
-
},
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
t.length === 8 ?
|
|
3682
|
-
]),
|
|
3683
|
-
t =
|
|
3804
|
+
const r = v(t), [n] = e.sort((s, i) => dt(r, i) - dt(r, s));
|
|
3805
|
+
return v(n);
|
|
3806
|
+
}, Oa = (t) => ye(t) < 0.5, va = (t) => ye(t) > 0.5, Ta = (t, e = 1) => (t = Pr.parse(t), t = xa(t), [
|
|
3807
|
+
Se(t, 0),
|
|
3808
|
+
Se(t, 2),
|
|
3809
|
+
Se(t, 4),
|
|
3810
|
+
t.length === 8 ? Se(t, 6) / 255 : e
|
|
3811
|
+
]), qt = [0, 0, 0, 0], $e = (t) => Math.floor(t).toString(16).padStart(2, "0"), Se = (t, e) => parseInt(t.slice(e, e + 2), 16), xa = (t) => t.startsWith("#") ? t.slice(1) : t, $a = (t) => {
|
|
3812
|
+
t = kr.parse(t);
|
|
3684
3813
|
let [e, r, n] = t;
|
|
3685
3814
|
const s = t[3];
|
|
3686
3815
|
e /= 360, r /= 100, n /= 100;
|
|
@@ -3688,240 +3817,240 @@ const Qi = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Ur = a.string().regex(Qi), _ = a.nu
|
|
|
3688
3817
|
if (r === 0)
|
|
3689
3818
|
i = o = c = n;
|
|
3690
3819
|
else {
|
|
3691
|
-
const
|
|
3692
|
-
i =
|
|
3820
|
+
const h = n < 0.5 ? n * (1 + r) : n + r - n * r, l = 2 * n - h;
|
|
3821
|
+
i = Qe(l, h, e + 1 / 3), o = Qe(l, h, e), c = Qe(l, h, e - 1 / 3);
|
|
3693
3822
|
}
|
|
3694
3823
|
return [Math.round(i * 255), Math.round(o * 255), Math.round(c * 255), s];
|
|
3695
|
-
},
|
|
3696
|
-
t =
|
|
3824
|
+
}, Qe = (t, e, r) => (r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t + (e - t) * 6 * r : r < 1 / 2 ? e : r < 2 / 3 ? t + (e - t) * (2 / 3 - r) * 6 : t), Sa = (t) => {
|
|
3825
|
+
t = We.parse(t);
|
|
3697
3826
|
let [e, r, n] = t;
|
|
3698
3827
|
const s = t[3];
|
|
3699
3828
|
e /= 255, r /= 255, n /= 255;
|
|
3700
3829
|
const i = Math.max(e, r, n), o = Math.min(e, r, n);
|
|
3701
|
-
let c,
|
|
3830
|
+
let c, h, l = (i + o) / 2;
|
|
3702
3831
|
if (i === o)
|
|
3703
|
-
c =
|
|
3832
|
+
c = h = 0;
|
|
3704
3833
|
else {
|
|
3705
|
-
const
|
|
3706
|
-
|
|
3834
|
+
const d = i - o;
|
|
3835
|
+
h = l > 0.5 ? d / (2 - i - o) : d / (i + o), i === e ? c = (r - n) / d + (r < n ? 6 : 0) : i === r ? c = (n - e) / d + 2 : c = (e - r) / d + 4, c /= 6;
|
|
3707
3836
|
}
|
|
3708
|
-
return c *= 360,
|
|
3709
|
-
},
|
|
3837
|
+
return c *= 360, h *= 100, l *= 100, [Math.round(c), Math.round(h), Math.round(l), s];
|
|
3838
|
+
}, Na = v("#000000"), Ia = v("#ffffff"), Yr = a.object({
|
|
3710
3839
|
key: a.string(),
|
|
3711
|
-
color:
|
|
3840
|
+
color: Ve,
|
|
3712
3841
|
position: a.number(),
|
|
3713
3842
|
switched: a.boolean().optional()
|
|
3714
|
-
}),
|
|
3715
|
-
if (t.length === 0) return
|
|
3716
|
-
if (t = t.slice().sort((r, n) => r.position - n.position), e <= t[0].position) return
|
|
3843
|
+
}), Ma = a.array(Yr), Ea = (t, e) => {
|
|
3844
|
+
if (t.length === 0) return qt;
|
|
3845
|
+
if (t = t.slice().sort((r, n) => r.position - n.position), e <= t[0].position) return v(t[0].color);
|
|
3717
3846
|
if (e >= t[t.length - 1].position)
|
|
3718
|
-
return
|
|
3847
|
+
return v(t[t.length - 1].color);
|
|
3719
3848
|
for (let r = 0; r < t.length - 1; r++) {
|
|
3720
3849
|
const n = t[r], s = t[r + 1];
|
|
3721
3850
|
if (e < n.position || e > s.position) continue;
|
|
3722
|
-
if (e === n.position) return
|
|
3723
|
-
if (e === s.position) return
|
|
3724
|
-
const i = (e - n.position) / (s.position - n.position), o =
|
|
3725
|
-
|
|
3726
|
-
),
|
|
3727
|
-
|
|
3728
|
-
),
|
|
3729
|
-
|
|
3730
|
-
),
|
|
3731
|
-
return
|
|
3732
|
-
}
|
|
3733
|
-
return
|
|
3734
|
-
},
|
|
3851
|
+
if (e === n.position) return v(n.color);
|
|
3852
|
+
if (e === s.position) return v(s.color);
|
|
3853
|
+
const i = (e - n.position) / (s.position - n.position), o = v(n.color), c = v(s.color), h = Math.round(
|
|
3854
|
+
ce(o) + i * (ce(c) - ce(o))
|
|
3855
|
+
), l = Math.round(
|
|
3856
|
+
he(o) + i * (he(c) - he(o))
|
|
3857
|
+
), d = Math.round(
|
|
3858
|
+
fe(o) + i * (fe(c) - fe(o))
|
|
3859
|
+
), m = de(o) + i * (de(c) - de(o));
|
|
3860
|
+
return v([h, l, d, m]);
|
|
3861
|
+
}
|
|
3862
|
+
return v(t[t.length - 1].color);
|
|
3863
|
+
}, Aa = a.object({
|
|
3735
3864
|
key: a.string(),
|
|
3736
3865
|
name: a.string(),
|
|
3737
|
-
color:
|
|
3738
|
-
}),
|
|
3866
|
+
color: Ge
|
|
3867
|
+
}), Ba = a.object({
|
|
3739
3868
|
key: a.string(),
|
|
3740
3869
|
name: a.string(),
|
|
3741
|
-
swatches: a.array(
|
|
3742
|
-
}),
|
|
3870
|
+
swatches: a.array(Aa)
|
|
3871
|
+
}), Ua = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3743
3872
|
__proto__: null,
|
|
3744
|
-
BLACK:
|
|
3745
|
-
WHITE:
|
|
3746
|
-
ZERO:
|
|
3747
|
-
aValue:
|
|
3748
|
-
bValue:
|
|
3749
|
-
colorZ:
|
|
3750
|
-
construct:
|
|
3751
|
-
contrast:
|
|
3752
|
-
crudeZ:
|
|
3753
|
-
cssString:
|
|
3754
|
-
equals:
|
|
3755
|
-
fromGradient:
|
|
3756
|
-
fromHSLA:
|
|
3757
|
-
gValue:
|
|
3758
|
-
gradientZ:
|
|
3759
|
-
grayness:
|
|
3760
|
-
hex:
|
|
3761
|
-
hsla:
|
|
3762
|
-
isColor:
|
|
3763
|
-
isCrude:
|
|
3764
|
-
isDark:
|
|
3765
|
-
isLight:
|
|
3766
|
-
isZero:
|
|
3767
|
-
luminance:
|
|
3768
|
-
paletteZ:
|
|
3769
|
-
pickByContrast:
|
|
3770
|
-
rValue:
|
|
3771
|
-
rgbCSS:
|
|
3772
|
-
rgbString:
|
|
3773
|
-
rgba1:
|
|
3774
|
-
rgbaCSS:
|
|
3775
|
-
setAlpha:
|
|
3776
|
-
stopZ:
|
|
3777
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3778
|
-
lower:
|
|
3779
|
-
upper:
|
|
3780
|
-
},
|
|
3873
|
+
BLACK: Na,
|
|
3874
|
+
WHITE: Ia,
|
|
3875
|
+
ZERO: qt,
|
|
3876
|
+
aValue: de,
|
|
3877
|
+
bValue: fe,
|
|
3878
|
+
colorZ: Ge,
|
|
3879
|
+
construct: v,
|
|
3880
|
+
contrast: dt,
|
|
3881
|
+
crudeZ: Ve,
|
|
3882
|
+
cssString: ha,
|
|
3883
|
+
equals: zr,
|
|
3884
|
+
fromGradient: Ea,
|
|
3885
|
+
fromHSLA: $a,
|
|
3886
|
+
gValue: he,
|
|
3887
|
+
gradientZ: Ma,
|
|
3888
|
+
grayness: ba,
|
|
3889
|
+
hex: fa,
|
|
3890
|
+
hsla: ma,
|
|
3891
|
+
isColor: ca,
|
|
3892
|
+
isCrude: la,
|
|
3893
|
+
isDark: Oa,
|
|
3894
|
+
isLight: va,
|
|
3895
|
+
isZero: pa,
|
|
3896
|
+
luminance: ye,
|
|
3897
|
+
paletteZ: Ba,
|
|
3898
|
+
pickByContrast: wa,
|
|
3899
|
+
rValue: ce,
|
|
3900
|
+
rgbCSS: da,
|
|
3901
|
+
rgbString: Zr,
|
|
3902
|
+
rgba1: ga,
|
|
3903
|
+
rgbaCSS: Fr,
|
|
3904
|
+
setAlpha: ya,
|
|
3905
|
+
stopZ: Yr
|
|
3906
|
+
}, Symbol.toStringTag, { value: "Module" })), Wr = a.int().min(0).max(255), Vr = 255, Gr = 0, Ca = {
|
|
3907
|
+
lower: Gr,
|
|
3908
|
+
upper: Vr + 1
|
|
3909
|
+
}, Hr = a.object({
|
|
3781
3910
|
name: a.string(),
|
|
3782
3911
|
key: a.string()
|
|
3783
|
-
}),
|
|
3784
|
-
subject:
|
|
3912
|
+
}), be = (t) => a.object({
|
|
3913
|
+
subject: Hr,
|
|
3785
3914
|
resource: t,
|
|
3786
|
-
authority:
|
|
3787
|
-
}),
|
|
3915
|
+
authority: Wr
|
|
3916
|
+
}), ja = (...t) => (e) => e.filter((r) => {
|
|
3788
3917
|
let n = !1;
|
|
3789
3918
|
return r.to != null && (n = t.includes(r.to.resource)), r.from != null && !n && (n = t.includes(r.from.resource)), n;
|
|
3790
|
-
}),
|
|
3791
|
-
from:
|
|
3919
|
+
}), Jr = (t) => a.object({
|
|
3920
|
+
from: be(t),
|
|
3792
3921
|
to: a.null()
|
|
3793
|
-
}),
|
|
3922
|
+
}), Xr = (t) => a.object({
|
|
3794
3923
|
from: a.null(),
|
|
3795
|
-
to:
|
|
3796
|
-
}),
|
|
3797
|
-
|
|
3798
|
-
|
|
3924
|
+
to: be(t)
|
|
3925
|
+
}), Ra = (t) => a.union([
|
|
3926
|
+
Jr(t),
|
|
3927
|
+
Xr(t),
|
|
3799
3928
|
a.object({
|
|
3800
|
-
from:
|
|
3801
|
-
to:
|
|
3929
|
+
from: be(t),
|
|
3930
|
+
to: be(t)
|
|
3802
3931
|
})
|
|
3803
|
-
]),
|
|
3932
|
+
]), zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3804
3933
|
__proto__: null,
|
|
3805
|
-
ABSOLUTE_AUTHORITY:
|
|
3806
|
-
AUTHORITY_BOUNDS:
|
|
3807
|
-
ZERO_AUTHORITY:
|
|
3808
|
-
acquireZ:
|
|
3809
|
-
authorityZ:
|
|
3810
|
-
filterTransfersByChannelKey:
|
|
3811
|
-
releaseZ:
|
|
3812
|
-
stateZ:
|
|
3813
|
-
subjectZ:
|
|
3814
|
-
transferZ:
|
|
3815
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3934
|
+
ABSOLUTE_AUTHORITY: Vr,
|
|
3935
|
+
AUTHORITY_BOUNDS: Ca,
|
|
3936
|
+
ZERO_AUTHORITY: Gr,
|
|
3937
|
+
acquireZ: Xr,
|
|
3938
|
+
authorityZ: Wr,
|
|
3939
|
+
filterTransfersByChannelKey: ja,
|
|
3940
|
+
releaseZ: Jr,
|
|
3941
|
+
stateZ: be,
|
|
3942
|
+
subjectZ: Hr,
|
|
3943
|
+
transferZ: Ra
|
|
3944
|
+
}, Symbol.toStringTag, { value: "Module" })), La = (t) => Object.getOwnPropertySymbols(globalThis).includes(t), Da = (t, e) => {
|
|
3816
3945
|
const r = Symbol.for(t);
|
|
3817
|
-
if (!
|
|
3946
|
+
if (!La(r)) {
|
|
3818
3947
|
const n = e();
|
|
3819
3948
|
Object.defineProperty(globalThis, r, { value: n });
|
|
3820
3949
|
}
|
|
3821
3950
|
return () => globalThis[r];
|
|
3822
|
-
},
|
|
3823
|
-
static discriminator =
|
|
3824
|
-
discriminator =
|
|
3951
|
+
}, Kr = "sy_x_error", Pa = (t) => (e) => e != null && typeof e == "object" && "type" in e && typeof e.type == "string" ? e.type.startsWith(t) : e instanceof Error ? e.message.startsWith(t) : typeof e != "string" ? !1 : e.startsWith(t), Qr = (t) => class le extends Error {
|
|
3952
|
+
static discriminator = Kr;
|
|
3953
|
+
discriminator = le.discriminator;
|
|
3825
3954
|
static TYPE = t;
|
|
3826
|
-
type =
|
|
3827
|
-
static matches =
|
|
3828
|
-
matches =
|
|
3955
|
+
type = le.TYPE;
|
|
3956
|
+
static matches = Pa(t);
|
|
3957
|
+
matches = le.matches;
|
|
3829
3958
|
constructor(r, n) {
|
|
3830
|
-
super(r, n), this.name =
|
|
3959
|
+
super(r, n), this.name = le.TYPE;
|
|
3831
3960
|
}
|
|
3832
3961
|
static sub(r) {
|
|
3833
|
-
return
|
|
3962
|
+
return Qr(`${t}.${r}`);
|
|
3834
3963
|
}
|
|
3835
|
-
},
|
|
3964
|
+
}, qa = (t) => {
|
|
3836
3965
|
if (t == null || typeof t != "object") return !1;
|
|
3837
3966
|
const e = t;
|
|
3838
|
-
if (e.discriminator !==
|
|
3967
|
+
if (e.discriminator !== Kr) return !1;
|
|
3839
3968
|
if (!("type" in e))
|
|
3840
3969
|
throw new Error(
|
|
3841
3970
|
`X Error is missing its type property: ${JSON.stringify(e)}`
|
|
3842
3971
|
);
|
|
3843
3972
|
return !0;
|
|
3844
|
-
},
|
|
3845
|
-
class
|
|
3973
|
+
}, ae = "unknown", Yt = "nil";
|
|
3974
|
+
class ka {
|
|
3846
3975
|
providers = [];
|
|
3847
3976
|
register(e) {
|
|
3848
3977
|
this.providers.push(e);
|
|
3849
3978
|
}
|
|
3850
3979
|
encode(e) {
|
|
3851
|
-
if (e == null) return { type:
|
|
3852
|
-
if (
|
|
3980
|
+
if (e == null) return { type: Yt, data: "" };
|
|
3981
|
+
if (qa(e))
|
|
3853
3982
|
for (const r of this.providers) {
|
|
3854
3983
|
const n = r.encode(e);
|
|
3855
3984
|
if (n != null) return n;
|
|
3856
3985
|
}
|
|
3857
|
-
if (e instanceof Error) return { type:
|
|
3858
|
-
if (typeof e == "string") return { type:
|
|
3986
|
+
if (e instanceof Error) return { type: ae, data: e.message };
|
|
3987
|
+
if (typeof e == "string") return { type: ae, data: e };
|
|
3859
3988
|
try {
|
|
3860
|
-
return { type:
|
|
3989
|
+
return { type: ae, data: JSON.stringify(e) };
|
|
3861
3990
|
} catch {
|
|
3862
|
-
return { type:
|
|
3991
|
+
return { type: ae, data: "unable to encode error information" };
|
|
3863
3992
|
}
|
|
3864
3993
|
}
|
|
3865
3994
|
decode(e) {
|
|
3866
|
-
if (e == null || e.type ===
|
|
3867
|
-
if (e.type ===
|
|
3995
|
+
if (e == null || e.type === Yt) return null;
|
|
3996
|
+
if (e.type === ae) return new Wt(e.data);
|
|
3868
3997
|
for (const r of this.providers) {
|
|
3869
3998
|
const n = r.decode(e);
|
|
3870
3999
|
if (n != null) return n;
|
|
3871
4000
|
}
|
|
3872
|
-
return new
|
|
4001
|
+
return new Wt(e.data);
|
|
3873
4002
|
}
|
|
3874
4003
|
}
|
|
3875
|
-
|
|
3876
|
-
class
|
|
4004
|
+
Da("synnax-error-registry", () => new ka());
|
|
4005
|
+
class Wt extends Qr("unknown") {
|
|
3877
4006
|
}
|
|
3878
4007
|
a.object({ type: a.string(), data: a.string() });
|
|
3879
|
-
const
|
|
3880
|
-
jsonrpc:
|
|
3881
|
-
method:
|
|
4008
|
+
const Fo = () => new Promise((t) => setTimeout(t, 0)), Zo = (t) => t ? -1 : 1, za = S.object({
|
|
4009
|
+
jsonrpc: S.literal("2.0"),
|
|
4010
|
+
method: S.string(),
|
|
3882
4011
|
// params should be z.union([z.record(z.string(), z.json()),
|
|
3883
4012
|
// z.array(z.json())]).optional() but the VSCode JSON RPC implementation uses a looser
|
|
3884
4013
|
// definition of params then in the JSON-RPC spec.
|
|
3885
|
-
params:
|
|
3886
|
-
id:
|
|
3887
|
-
}),
|
|
3888
|
-
jsonrpc:
|
|
3889
|
-
id:
|
|
3890
|
-
}),
|
|
3891
|
-
result:
|
|
3892
|
-
}),
|
|
3893
|
-
error:
|
|
3894
|
-
code:
|
|
4014
|
+
params: S.any().optional(),
|
|
4015
|
+
id: S.union([S.string(), S.number(), S.null()]).optional()
|
|
4016
|
+
}), _r = S.object({
|
|
4017
|
+
jsonrpc: S.literal("2.0"),
|
|
4018
|
+
id: S.union([S.string(), S.number(), S.null()])
|
|
4019
|
+
}), Fa = _r.extend({
|
|
4020
|
+
result: S.json()
|
|
4021
|
+
}), Za = _r.extend({
|
|
4022
|
+
error: S.object({
|
|
4023
|
+
code: S.number().int(),
|
|
3895
4024
|
// This should be z.string(), but the VSCode JSON RPC implementation uses a looser
|
|
3896
4025
|
// definition of error than the JSON-RPC spec.
|
|
3897
|
-
message:
|
|
3898
|
-
data:
|
|
4026
|
+
message: S.string().optional(),
|
|
4027
|
+
data: S.json().optional()
|
|
3899
4028
|
})
|
|
3900
|
-
}),
|
|
3901
|
-
|
|
3902
|
-
const
|
|
4029
|
+
}), Ya = S.union([Fa, Za]);
|
|
4030
|
+
S.union([za, Ya]);
|
|
4031
|
+
const Wa = (t, e, r) => {
|
|
3903
4032
|
const n = t.get(e);
|
|
3904
4033
|
return n === void 0 ? (t.set(e, r), r) : n;
|
|
3905
|
-
},
|
|
4034
|
+
}, Yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3906
4035
|
__proto__: null,
|
|
3907
|
-
getOrSetDefault:
|
|
3908
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4036
|
+
getOrSetDefault: Wa
|
|
4037
|
+
}, Symbol.toStringTag, { value: "Module" })), gt = a.string().regex(/^\d+\.\d+\.\d+$/), Te = (t, e, r = {}) => {
|
|
3909
4038
|
r.checkMajor ??= !0, r.checkMinor ??= !0, r.checkPatch ??= !0;
|
|
3910
|
-
const n =
|
|
4039
|
+
const n = gt.parse(t), s = gt.parse(e), [i, o, c] = n.split(".").map(Number), [h, l, d] = s.split(".").map(Number);
|
|
3911
4040
|
if (r.checkMajor) {
|
|
3912
|
-
if (i <
|
|
3913
|
-
if (i >
|
|
4041
|
+
if (i < h) return Ie;
|
|
4042
|
+
if (i > h) return Me;
|
|
3914
4043
|
}
|
|
3915
4044
|
if (r.checkMinor) {
|
|
3916
|
-
if (o <
|
|
3917
|
-
if (o >
|
|
4045
|
+
if (o < l) return Ie;
|
|
4046
|
+
if (o > l) return Me;
|
|
3918
4047
|
}
|
|
3919
4048
|
if (r.checkPatch) {
|
|
3920
|
-
if (c <
|
|
3921
|
-
if (c >
|
|
4049
|
+
if (c < d) return Ie;
|
|
4050
|
+
if (c > d) return Me;
|
|
3922
4051
|
}
|
|
3923
|
-
return
|
|
3924
|
-
},
|
|
4052
|
+
return ne;
|
|
4053
|
+
}, Va = (t, e, r = {}) => er(Te(t, e, r)), en = (t, e, r = {}) => _t(Te(t, e, r)), Ga = (t, e, r = {}) => Qt(Te(t, e, r)), Ha = ({
|
|
3925
4054
|
name: t,
|
|
3926
4055
|
migrate: e
|
|
3927
4056
|
}) => (r) => {
|
|
@@ -3931,68 +4060,68 @@ const ka = (t, e, r) => {
|
|
|
3931
4060
|
} catch (n) {
|
|
3932
4061
|
throw console.log(`${t} failed to migrate from ${r.version}`), console.error(n), n;
|
|
3933
4062
|
}
|
|
3934
|
-
},
|
|
4063
|
+
}, Ja = ({
|
|
3935
4064
|
name: t,
|
|
3936
4065
|
migrations: e,
|
|
3937
4066
|
targetSchema: r,
|
|
3938
4067
|
defaultVersion: n,
|
|
3939
4068
|
def: s
|
|
3940
4069
|
}) => {
|
|
3941
|
-
const i = Object.keys(e).sort(
|
|
4070
|
+
const i = Object.keys(e).sort(Te).pop();
|
|
3942
4071
|
if (i == null)
|
|
3943
|
-
return (
|
|
3944
|
-
if (
|
|
4072
|
+
return (l) => {
|
|
4073
|
+
if (l.version ??= n, l.version !== s.version)
|
|
3945
4074
|
return console.log(
|
|
3946
|
-
`${t} version ${
|
|
4075
|
+
`${t} version ${l.version} is newer than latest version of ${s.version}.
|
|
3947
4076
|
Returning default instead.
|
|
3948
4077
|
`
|
|
3949
4078
|
), s;
|
|
3950
4079
|
try {
|
|
3951
|
-
return r != null ? r.parse(
|
|
3952
|
-
} catch (
|
|
3953
|
-
return console.log(`${t} failed to parse default. Exiting with default`), console.error(
|
|
4080
|
+
return r != null ? r.parse(l) : l;
|
|
4081
|
+
} catch (d) {
|
|
4082
|
+
return console.log(`${t} failed to parse default. Exiting with default`), console.error(d), s;
|
|
3954
4083
|
}
|
|
3955
4084
|
};
|
|
3956
4085
|
const o = Object.keys(e).length;
|
|
3957
4086
|
let c = !1;
|
|
3958
|
-
const
|
|
4087
|
+
const h = (l) => {
|
|
3959
4088
|
try {
|
|
3960
|
-
if (o === 0 ||
|
|
3961
|
-
return console.log(c ? `${t} ${
|
|
3962
|
-
const
|
|
3963
|
-
return c = !0,
|
|
3964
|
-
} catch (
|
|
4089
|
+
if (o === 0 || en(l.version, i))
|
|
4090
|
+
return console.log(c ? `${t} ${l.version} now up to date` : `${t} version ${l.version} is up to date with target version ${s.version}`), l;
|
|
4091
|
+
const d = l.version, m = e[d], p = m(l);
|
|
4092
|
+
return c = !0, h(p);
|
|
4093
|
+
} catch (d) {
|
|
3965
4094
|
return console.log(
|
|
3966
|
-
`${t} failed to migrate from ${
|
|
3967
|
-
), console.error(
|
|
4095
|
+
`${t} failed to migrate from ${l.version} to ${i}`
|
|
4096
|
+
), console.error(d), s;
|
|
3968
4097
|
}
|
|
3969
4098
|
};
|
|
3970
|
-
return (
|
|
4099
|
+
return (l) => {
|
|
3971
4100
|
try {
|
|
3972
|
-
if (
|
|
4101
|
+
if (l.version == null)
|
|
3973
4102
|
if (n != null)
|
|
3974
4103
|
console.log(
|
|
3975
4104
|
`${t} version is null. Setting version to default of ${n}`
|
|
3976
|
-
),
|
|
4105
|
+
), l.version = n;
|
|
3977
4106
|
else
|
|
3978
4107
|
return console.log(
|
|
3979
4108
|
`${t} version is null and no default version set. Exiting with default`
|
|
3980
4109
|
), s;
|
|
3981
|
-
return l
|
|
3982
|
-
} catch (
|
|
3983
|
-
return console.log(`${t} failed to parse final result. Exiting with default`), console.error(
|
|
4110
|
+
return h(l);
|
|
4111
|
+
} catch (d) {
|
|
4112
|
+
return console.log(`${t} failed to parse final result. Exiting with default`), console.error(d), s;
|
|
3984
4113
|
}
|
|
3985
4114
|
};
|
|
3986
|
-
},
|
|
4115
|
+
}, Wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3987
4116
|
__proto__: null,
|
|
3988
|
-
compareSemVer:
|
|
3989
|
-
createMigration:
|
|
3990
|
-
migrator:
|
|
3991
|
-
semVerNewer:
|
|
3992
|
-
semVerOlder:
|
|
3993
|
-
semVerZ:
|
|
3994
|
-
versionsEqual:
|
|
3995
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4117
|
+
compareSemVer: Te,
|
|
4118
|
+
createMigration: Ha,
|
|
4119
|
+
migrator: Ja,
|
|
4120
|
+
semVerNewer: en,
|
|
4121
|
+
semVerOlder: Ga,
|
|
4122
|
+
semVerZ: gt,
|
|
4123
|
+
versionsEqual: Va
|
|
4124
|
+
}, Symbol.toStringTag, { value: "Module" })), tn = ["standard", "scientific", "engineering"], Xa = a.enum(tn), Ka = (t, e, r) => {
|
|
3996
4125
|
if (Number.isNaN(t)) return "NaN";
|
|
3997
4126
|
if (t === 1 / 0) return "∞";
|
|
3998
4127
|
if (t === -1 / 0) return "-∞";
|
|
@@ -4001,28 +4130,28 @@ const ka = (t, e, r) => {
|
|
|
4001
4130
|
return e === 0 ? "0ᴇ0" : `0.${"0".repeat(e)}ᴇ0`;
|
|
4002
4131
|
let n;
|
|
4003
4132
|
return r === "scientific" ? n = Math.floor(Math.log10(Math.abs(t))) : n = Math.floor(Math.log10(Math.abs(t)) / 3) * 3, `${(t / 10 ** n).toFixed(e)}ᴇ${n}`;
|
|
4004
|
-
},
|
|
4133
|
+
}, Vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4005
4134
|
__proto__: null,
|
|
4006
|
-
NOTATIONS:
|
|
4007
|
-
notationZ:
|
|
4008
|
-
stringifyNumber:
|
|
4009
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4135
|
+
NOTATIONS: tn,
|
|
4136
|
+
notationZ: Xa,
|
|
4137
|
+
stringifyNumber: Ka
|
|
4138
|
+
}, Symbol.toStringTag, { value: "Module" })), Go = (t) => Array.isArray(t) ? [...t] : typeof t == "object" && t !== null ? { ...t } : t, rn = a.enum([
|
|
4010
4139
|
"success",
|
|
4011
4140
|
"info",
|
|
4012
4141
|
"warning",
|
|
4013
4142
|
"error",
|
|
4014
4143
|
"loading",
|
|
4015
4144
|
"disabled"
|
|
4016
|
-
]),
|
|
4145
|
+
]), Qa = (t) => a.object({
|
|
4017
4146
|
key: a.string(),
|
|
4018
|
-
variant:
|
|
4147
|
+
variant: rn,
|
|
4019
4148
|
message: a.string(),
|
|
4020
4149
|
description: a.string().optional(),
|
|
4021
4150
|
time: b.z,
|
|
4022
4151
|
details: t ?? a.unknown().optional()
|
|
4023
|
-
}),
|
|
4152
|
+
}), _a = (t, e) => {
|
|
4024
4153
|
if (!(t instanceof Error)) throw t;
|
|
4025
|
-
return
|
|
4154
|
+
return nn({
|
|
4026
4155
|
variant: "error",
|
|
4027
4156
|
message: e ?? t.message,
|
|
4028
4157
|
description: e != null ? t.message : void 0,
|
|
@@ -4030,28 +4159,30 @@ const ka = (t, e, r) => {
|
|
|
4030
4159
|
stack: t.stack ?? ""
|
|
4031
4160
|
}
|
|
4032
4161
|
});
|
|
4033
|
-
},
|
|
4034
|
-
key:
|
|
4162
|
+
}, nn = (t) => ({
|
|
4163
|
+
key: Lt(),
|
|
4035
4164
|
time: b.now(),
|
|
4036
4165
|
...t
|
|
4037
|
-
}),
|
|
4166
|
+
}), eo = (t, e = []) => Array.isArray(e) ? e.includes(t) ? t : void 0 : e === t ? t : void 0, Ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4038
4167
|
__proto__: null,
|
|
4039
|
-
create:
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4168
|
+
create: nn,
|
|
4169
|
+
filterVariant: eo,
|
|
4170
|
+
fromException: _a,
|
|
4171
|
+
statusZ: Qa,
|
|
4172
|
+
variantZ: rn
|
|
4173
|
+
}, Symbol.toStringTag, { value: "Module" })), to = (t, e = "") => {
|
|
4174
|
+
if (typeof t == "string") return t;
|
|
4044
4175
|
const r = t.length;
|
|
4045
4176
|
return r === 0 ? e : r === 1 ? t[0] : r === 2 ? `${t[0]} and ${t[1]}` : `${t.slice(0, -1).join(", ")}, and ${t[r - 1]}`;
|
|
4046
|
-
},
|
|
4177
|
+
}, ro = (t) => {
|
|
4047
4178
|
const e = t.split(" "), r = /* @__PURE__ */ new Set(), n = e.map((o) => o.charAt(0).toLowerCase()).join("");
|
|
4048
4179
|
r.add(n.replace(/-/g, "_")), r.add(n.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_"));
|
|
4049
4180
|
const s = /\d+/g;
|
|
4050
4181
|
t.match(s) && e.forEach((o, c) => {
|
|
4051
4182
|
if (s.test(o)) {
|
|
4052
|
-
const
|
|
4053
|
-
r.add(
|
|
4054
|
-
|
|
4183
|
+
const h = e.map((l, d) => d !== c ? l.charAt(0).toLowerCase() : l).join("");
|
|
4184
|
+
r.add(h.replace(/-/g, "_")), r.add(
|
|
4185
|
+
h.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_")
|
|
4055
4186
|
);
|
|
4056
4187
|
}
|
|
4057
4188
|
});
|
|
@@ -4061,53 +4192,53 @@ const ka = (t, e, r) => {
|
|
|
4061
4192
|
return r.add(i.join("").replace(/-/g, "_")), r.add(i.join("_").replace(/-/g, "_")), Array.from(r).filter(
|
|
4062
4193
|
(o) => o.length >= 2 && o.length <= 12 && !/^\d/.test(o)
|
|
4063
4194
|
);
|
|
4064
|
-
},
|
|
4195
|
+
}, no = (t, e) => t.startsWith(e) ? t.slice(e.length) : t, Jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4065
4196
|
__proto__: null,
|
|
4066
|
-
createShortIdentifiers:
|
|
4067
|
-
naturalLanguageJoin:
|
|
4068
|
-
trimPrefix:
|
|
4069
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4070
|
-
var
|
|
4197
|
+
createShortIdentifiers: ro,
|
|
4198
|
+
naturalLanguageJoin: to,
|
|
4199
|
+
trimPrefix: no
|
|
4200
|
+
}, Symbol.toStringTag, { value: "Module" })), so = new Error("request for lock canceled");
|
|
4201
|
+
var io = function(t, e, r, n) {
|
|
4071
4202
|
function s(i) {
|
|
4072
4203
|
return i instanceof r ? i : new r(function(o) {
|
|
4073
4204
|
o(i);
|
|
4074
4205
|
});
|
|
4075
4206
|
}
|
|
4076
4207
|
return new (r || (r = Promise))(function(i, o) {
|
|
4077
|
-
function c(
|
|
4208
|
+
function c(d) {
|
|
4078
4209
|
try {
|
|
4079
|
-
|
|
4080
|
-
} catch (
|
|
4081
|
-
o(
|
|
4210
|
+
l(n.next(d));
|
|
4211
|
+
} catch (m) {
|
|
4212
|
+
o(m);
|
|
4082
4213
|
}
|
|
4083
4214
|
}
|
|
4084
|
-
function
|
|
4215
|
+
function h(d) {
|
|
4085
4216
|
try {
|
|
4086
|
-
|
|
4087
|
-
} catch (
|
|
4088
|
-
o(
|
|
4217
|
+
l(n.throw(d));
|
|
4218
|
+
} catch (m) {
|
|
4219
|
+
o(m);
|
|
4089
4220
|
}
|
|
4090
4221
|
}
|
|
4091
|
-
function
|
|
4092
|
-
|
|
4222
|
+
function l(d) {
|
|
4223
|
+
d.done ? i(d.value) : s(d.value).then(c, h);
|
|
4093
4224
|
}
|
|
4094
|
-
|
|
4225
|
+
l((n = n.apply(t, e || [])).next());
|
|
4095
4226
|
});
|
|
4096
4227
|
};
|
|
4097
|
-
class
|
|
4098
|
-
constructor(e, r =
|
|
4228
|
+
class ao {
|
|
4229
|
+
constructor(e, r = so) {
|
|
4099
4230
|
this._value = e, this._cancelError = r, this._queue = [], this._weightedWaiters = [];
|
|
4100
4231
|
}
|
|
4101
4232
|
acquire(e = 1, r = 0) {
|
|
4102
4233
|
if (e <= 0)
|
|
4103
4234
|
throw new Error(`invalid weight ${e}: must be positive`);
|
|
4104
4235
|
return new Promise((n, s) => {
|
|
4105
|
-
const i = { resolve: n, reject: s, weight: e, priority: r }, o =
|
|
4236
|
+
const i = { resolve: n, reject: s, weight: e, priority: r }, o = sn(this._queue, (c) => r <= c.priority);
|
|
4106
4237
|
o === -1 && e <= this._value ? this._dispatchItem(i) : this._queue.splice(o + 1, 0, i);
|
|
4107
4238
|
});
|
|
4108
4239
|
}
|
|
4109
4240
|
runExclusive(e) {
|
|
4110
|
-
return
|
|
4241
|
+
return io(this, arguments, void 0, function* (r, n = 1, s = 0) {
|
|
4111
4242
|
const [i, o] = yield this.acquire(n, s);
|
|
4112
4243
|
try {
|
|
4113
4244
|
return yield r(i);
|
|
@@ -4120,7 +4251,7 @@ class eo {
|
|
|
4120
4251
|
if (e <= 0)
|
|
4121
4252
|
throw new Error(`invalid weight ${e}: must be positive`);
|
|
4122
4253
|
return this._couldLockImmediately(e, r) ? Promise.resolve() : new Promise((n) => {
|
|
4123
|
-
this._weightedWaiters[e - 1] || (this._weightedWaiters[e - 1] = []),
|
|
4254
|
+
this._weightedWaiters[e - 1] || (this._weightedWaiters[e - 1] = []), oo(this._weightedWaiters[e - 1], { resolve: n, priority: r });
|
|
4124
4255
|
});
|
|
4125
4256
|
}
|
|
4126
4257
|
isLocked() {
|
|
@@ -4175,49 +4306,49 @@ class eo {
|
|
|
4175
4306
|
return (this._queue.length === 0 || this._queue[0].priority < r) && e <= this._value;
|
|
4176
4307
|
}
|
|
4177
4308
|
}
|
|
4178
|
-
function
|
|
4179
|
-
const r =
|
|
4309
|
+
function oo(t, e) {
|
|
4310
|
+
const r = sn(t, (n) => e.priority <= n.priority);
|
|
4180
4311
|
t.splice(r + 1, 0, e);
|
|
4181
4312
|
}
|
|
4182
|
-
function
|
|
4313
|
+
function sn(t, e) {
|
|
4183
4314
|
for (let r = t.length - 1; r >= 0; r--)
|
|
4184
4315
|
if (e(t[r]))
|
|
4185
4316
|
return r;
|
|
4186
4317
|
return -1;
|
|
4187
4318
|
}
|
|
4188
|
-
var
|
|
4319
|
+
var uo = function(t, e, r, n) {
|
|
4189
4320
|
function s(i) {
|
|
4190
4321
|
return i instanceof r ? i : new r(function(o) {
|
|
4191
4322
|
o(i);
|
|
4192
4323
|
});
|
|
4193
4324
|
}
|
|
4194
4325
|
return new (r || (r = Promise))(function(i, o) {
|
|
4195
|
-
function c(
|
|
4326
|
+
function c(d) {
|
|
4196
4327
|
try {
|
|
4197
|
-
|
|
4198
|
-
} catch (
|
|
4199
|
-
o(
|
|
4328
|
+
l(n.next(d));
|
|
4329
|
+
} catch (m) {
|
|
4330
|
+
o(m);
|
|
4200
4331
|
}
|
|
4201
4332
|
}
|
|
4202
|
-
function
|
|
4333
|
+
function h(d) {
|
|
4203
4334
|
try {
|
|
4204
|
-
|
|
4205
|
-
} catch (
|
|
4206
|
-
o(
|
|
4335
|
+
l(n.throw(d));
|
|
4336
|
+
} catch (m) {
|
|
4337
|
+
o(m);
|
|
4207
4338
|
}
|
|
4208
4339
|
}
|
|
4209
|
-
function
|
|
4210
|
-
|
|
4340
|
+
function l(d) {
|
|
4341
|
+
d.done ? i(d.value) : s(d.value).then(c, h);
|
|
4211
4342
|
}
|
|
4212
|
-
|
|
4343
|
+
l((n = n.apply(t, e || [])).next());
|
|
4213
4344
|
});
|
|
4214
4345
|
};
|
|
4215
|
-
class
|
|
4346
|
+
class lo {
|
|
4216
4347
|
constructor(e) {
|
|
4217
|
-
this._semaphore = new
|
|
4348
|
+
this._semaphore = new ao(1, e);
|
|
4218
4349
|
}
|
|
4219
4350
|
acquire() {
|
|
4220
|
-
return
|
|
4351
|
+
return uo(this, arguments, void 0, function* (e = 0) {
|
|
4221
4352
|
const [, r] = yield this._semaphore.acquire(1, e);
|
|
4222
4353
|
return r;
|
|
4223
4354
|
});
|
|
@@ -4238,34 +4369,34 @@ class no {
|
|
|
4238
4369
|
return this._semaphore.cancel();
|
|
4239
4370
|
}
|
|
4240
4371
|
}
|
|
4241
|
-
class
|
|
4372
|
+
class an extends lo {
|
|
4242
4373
|
constructor(e) {
|
|
4243
4374
|
super(), Object.assign(this, e);
|
|
4244
4375
|
}
|
|
4245
4376
|
}
|
|
4246
|
-
const
|
|
4377
|
+
const co = (t) => new an(t), Xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4247
4378
|
__proto__: null,
|
|
4248
|
-
mutex:
|
|
4249
|
-
newMutex:
|
|
4379
|
+
mutex: an,
|
|
4380
|
+
newMutex: co
|
|
4250
4381
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4251
|
-
function
|
|
4382
|
+
function on(t) {
|
|
4252
4383
|
var e, r, n = "";
|
|
4253
4384
|
if (typeof t == "string" || typeof t == "number") n += t;
|
|
4254
4385
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
4255
4386
|
var s = t.length;
|
|
4256
|
-
for (e = 0; e < s; e++) t[e] && (r =
|
|
4387
|
+
for (e = 0; e < s; e++) t[e] && (r = on(t[e])) && (n && (n += " "), n += r);
|
|
4257
4388
|
} else for (r in t) t[r] && (n && (n += " "), n += r);
|
|
4258
4389
|
return n;
|
|
4259
4390
|
}
|
|
4260
|
-
function
|
|
4261
|
-
for (var t, e, r = 0, n = "", s = arguments.length; r < s; r++) (t = arguments[r]) && (e =
|
|
4391
|
+
function ho() {
|
|
4392
|
+
for (var t, e, r = 0, n = "", s = arguments.length; r < s; r++) (t = arguments[r]) && (e = on(t)) && (n && (n += " "), n += e);
|
|
4262
4393
|
return n;
|
|
4263
4394
|
}
|
|
4264
|
-
const
|
|
4265
|
-
const e = (...r) =>
|
|
4266
|
-
return e.B = (...r) => t +
|
|
4395
|
+
const fo = ho, ee = "-", Vt = "__", Ne = "--", un = (t) => {
|
|
4396
|
+
const e = (...r) => fo(...r);
|
|
4397
|
+
return e.B = (...r) => t + ee + r.join(ee), e.E = (r) => t + Vt + r, e.M = (...r) => t + Ne + r.join("-"), e.BM = (r, ...n) => e.B(r) + Ne + n.join("-"), e.BE = (r, ...n) => e.B(r) + Vt + n.join(ee), e.BEM = (r, n, ...s) => e.BE(r, n) + Ne + s.join(ee), e.extend = (r) => un(e.B(r)), e.var = (...r) => Ne + t + ee + r.join(ee), e;
|
|
4267
4398
|
};
|
|
4268
|
-
class
|
|
4399
|
+
class go {
|
|
4269
4400
|
rows = [];
|
|
4270
4401
|
columns = [];
|
|
4271
4402
|
prefix;
|
|
@@ -4294,72 +4425,72 @@ class oo {
|
|
|
4294
4425
|
};
|
|
4295
4426
|
}
|
|
4296
4427
|
}
|
|
4297
|
-
const
|
|
4428
|
+
const po = (t, e) => Object.entries(e).forEach(
|
|
4298
4429
|
([r, n]) => n != null && t.style.setProperty(r, `${n}`)
|
|
4299
|
-
),
|
|
4430
|
+
), mo = (t, e) => Array.from(t.style).forEach((r) => {
|
|
4300
4431
|
r.startsWith(e) && t.style.removeProperty(r);
|
|
4301
|
-
}),
|
|
4302
|
-
const e =
|
|
4303
|
-
return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M("location",
|
|
4432
|
+
}), yo = (t) => {
|
|
4433
|
+
const e = un(t);
|
|
4434
|
+
return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M("location", ms.construct(r)), e.disabled = (r) => r === !0 && e.M("disabled"), e.align = (r) => e.M(r), e.dir = (r) => r != null && e.M("direction", ts.construct(r)), e.sharp = (r) => r !== !1 && e.M("sharp"), e.rounded = (r) => r !== !1 && e.M("rounded"), e.bordered = (r) => typeof r == "boolean" ? r && e.M("bordered") : r != null ? e.M(`bordered-${r.toString()}`) : e.M("bordered"), e.selected = (r) => r && e.M("selected"), e.altColor = (r) => r && e.M("alt-color"), e.editable = (r) => r && e.M("editable"), e.noSelect = e.M("no-select"), e.applyVars = po, e.removeVars = mo, e.newGridBuilder = (r) => new go(r), e.dropRegion = (r) => r && e.B("haul-drop-region"), e.px = (r) => `${r}px`, e.inheritDims = (r = !0) => r && e.M("inherit-dims"), e.shade = (r) => r != null && e.M(`shade-${r}`), e.colorVar = (r) => {
|
|
4304
4435
|
if (!(r == null || r === !1))
|
|
4305
|
-
return typeof r == "number" ? `var(--${t}-gray-l${r})` :
|
|
4436
|
+
return typeof r == "number" ? `var(--${t}-gray-l${r})` : Ua.cssString(r);
|
|
4306
4437
|
}, e.levelSizeVar = (r) => `var(--${t}-${r}-size)`, e.level = (r) => e.M(`level-${r}`), e;
|
|
4307
|
-
},
|
|
4438
|
+
}, Ko = yo("pluto");
|
|
4308
4439
|
export {
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
f,
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4440
|
+
hs as $,
|
|
4441
|
+
Wo as A,
|
|
4442
|
+
Po as B,
|
|
4443
|
+
Ko as C,
|
|
4444
|
+
I as D,
|
|
4445
|
+
cs as E,
|
|
4446
|
+
xt as F,
|
|
4447
|
+
H as G,
|
|
4448
|
+
Io as H,
|
|
4449
|
+
E as I,
|
|
4450
|
+
Bo as J,
|
|
4451
|
+
No as K,
|
|
4452
|
+
fs as L,
|
|
4453
|
+
Bt as M,
|
|
4454
|
+
Nt as N,
|
|
4455
|
+
xo as O,
|
|
4456
|
+
us as P,
|
|
4457
|
+
T as Q,
|
|
4458
|
+
di as R,
|
|
4459
|
+
qo as S,
|
|
4460
|
+
q as T,
|
|
4461
|
+
ti as U,
|
|
4462
|
+
ve as V,
|
|
4463
|
+
Ro as W,
|
|
4464
|
+
G as X,
|
|
4465
|
+
V as Y,
|
|
4466
|
+
_s as Z,
|
|
4467
|
+
Mo as _,
|
|
4468
|
+
vo as a,
|
|
4469
|
+
Qs as a0,
|
|
4470
|
+
Zo as a1,
|
|
4471
|
+
Eo as b,
|
|
4472
|
+
Ua as c,
|
|
4473
|
+
So as d,
|
|
4474
|
+
J as e,
|
|
4475
|
+
$ as f,
|
|
4476
|
+
ts as g,
|
|
4477
|
+
Vo as h,
|
|
4478
|
+
O as i,
|
|
4479
|
+
Le as j,
|
|
4480
|
+
Ao as k,
|
|
4481
|
+
Xo as l,
|
|
4482
|
+
$o as m,
|
|
4483
|
+
un as n,
|
|
4484
|
+
ko as o,
|
|
4485
|
+
ms as p,
|
|
4486
|
+
zo as q,
|
|
4487
|
+
b as r,
|
|
4488
|
+
Jo as s,
|
|
4489
|
+
Fo as t,
|
|
4490
|
+
ho as u,
|
|
4491
|
+
Ur as v,
|
|
4492
|
+
Ho as w,
|
|
4493
|
+
Yo as x,
|
|
4494
|
+
Go as y,
|
|
4495
|
+
wo as z
|
|
4365
4496
|
};
|