@synnaxlabs/pluto 0.46.1 → 0.46.3
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/{Toggle-Djy3iEFS.js → Toggle-BvHOvpZl.js} +1 -1
- package/dist/{Toggle-D7uuc8BY.cjs → Toggle-YrCaaWoP.cjs} +1 -1
- package/dist/{Video-Com7iIjJ.js → Video-B3mUCF7w.js} +1 -1
- package/dist/{Video-BgaQjOlJ.cjs → Video-PX9PWa1_.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-BJh3xDSW.cjs +8 -0
- package/dist/{css-qKD7ZG81.js → css-C24hS2UX.js} +903 -875
- 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/ether.cjs +1 -1
- package/dist/ether.js +6 -6
- package/dist/{external-CfY-kR5_.js → external-1ucYXJx8.js} +2 -2
- package/dist/{external-CwtqVaYf.js → external-BN2wbDrK.js} +3 -3
- package/dist/{external-Bfddv9ir.cjs → external-BwkIuXvQ.cjs} +1 -1
- package/dist/{external-CG-WeHt1.js → external-C-ExavVe.js} +3 -3
- package/dist/{external-C0szVQZ4.js → external-CC9QgzfY.js} +3 -3
- package/dist/{external-BwAIT4Et.js → external-Cg3K8ETl.js} +4 -4
- package/dist/{external-Bp0LGk7L.cjs → external-ChJFeBx4.cjs} +1 -1
- package/dist/{external-BwzXukg6.js → external-ChfziUeG.js} +2 -2
- package/dist/{external-fThC1Pt0.js → external-Ck9vwLNn.js} +3 -3
- package/dist/{external-iLU86byd.cjs → external-Clg5_LVL.cjs} +1 -1
- package/dist/{external-BatQDwpn.cjs → external-CtPQhs2L.cjs} +1 -1
- package/dist/{external-R1DnhHJ8.cjs → external-D-7LQcc1.cjs} +1 -1
- package/dist/{external-ok-onqCX.cjs → external-D7ez6YFA.cjs} +1 -1
- package/dist/{external-CtIn5ns5.js → external-DSC98ftR.js} +3 -3
- package/dist/{external-JI_JLXE9.cjs → external-DcJjrD1A.cjs} +2 -2
- package/dist/{external-qAqWNZPd.cjs → external-DfxokOST.cjs} +1 -1
- package/dist/{external-DPsERPGZ.js → external-Dia3MCeO.js} +3 -3
- package/dist/external-Dxu0KYI_.cjs +1 -0
- package/dist/{external-BH7AW9vg.cjs → external-NOoRXXaT.cjs} +1 -1
- package/dist/{external-B_BNwXoG.js → external-RDyCOmKR.js} +21 -21
- package/dist/{external-BXAiwKcS.js → external-S4v-IR_C.js} +3 -3
- package/dist/{external-CaehDJtX.cjs → external-VIR_Vvod.cjs} +1 -1
- package/dist/{external-BqSq3_g3.js → external-mtaOrZVh.js} +2 -2
- package/dist/{external-DZ9ZLLOd.cjs → external-orHcg1KY.cjs} +1 -1
- package/dist/{external-CM-K5NTq.js → external-ree9J7kb.js} +1 -1
- package/dist/{external-DLIuO7_6.cjs → external-s4B9EjQm.cjs} +1 -1
- package/dist/flex.cjs +1 -1
- package/dist/flex.js +1 -1
- package/dist/{fontString-BpD7ezh8.cjs → fontString-BMITZjR-.cjs} +1 -1
- package/dist/{fontString-CpT1noV1.js → fontString-CNdpxtJg.js} +2 -2
- package/dist/header.cjs +1 -1
- package/dist/header.js +1 -1
- package/dist/index.cjs +12 -12
- package/dist/index.js +4689 -4692
- 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/{main-DCwBsS0F.js → main-9Dw_ngUE.js} +3 -3
- package/dist/{main-20msMsI6.cjs → main-rewFivKu.cjs} +30 -30
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/{provider-B-VPfAGa.js → provider-BMcIM58p.js} +3 -3
- package/dist/{provider-D295Uocj.cjs → provider-CedWF-id.cjs} +3 -3
- package/dist/{provider-qIzR8Puy.js → provider-DXuSQEu0.js} +2816 -2791
- package/dist/provider-DshN-WBB.cjs +83 -0
- package/dist/src/ontology/queries.d.ts +3 -10
- package/dist/src/ontology/queries.d.ts.map +1 -1
- package/dist/src/schematic/symbol/queries.d.ts +1 -3
- package/dist/src/schematic/symbol/queries.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-WtYBE1br.js → units-BfWwpiDe.js} +1 -1
- package/dist/units-DOj-2MGY.cjs +1 -0
- package/dist/video.cjs +1 -1
- package/dist/video.js +1 -1
- package/package.json +6 -6
- package/dist/css-DA2F4zE4.cjs +0 -8
- package/dist/external-BaO1j7U1.cjs +0 -1
- package/dist/provider-DVqod4rl.cjs +0 -83
- package/dist/units-CLbZ5ejs.cjs +0 -1
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import O, { z as a } from "zod";
|
|
2
|
-
const
|
|
2
|
+
const lr = (t) => O.union([
|
|
3
3
|
O.union([O.null(), O.undefined()]).transform(() => []),
|
|
4
4
|
t.array()
|
|
5
|
-
]),
|
|
5
|
+
]), Mn = (t) => Array.isArray(t) ? t : t == null ? [] : [t], cr = (t, e) => {
|
|
6
6
|
if (Array.isArray(e))
|
|
7
|
-
return e.reduce((s, i) =>
|
|
7
|
+
return e.reduce((s, i) => cr(s, i), t ?? []);
|
|
8
8
|
if (t == null) return [e];
|
|
9
9
|
const r = t.findIndex((s) => s == e), n = [...t];
|
|
10
10
|
return r === -1 ? n.push(e) : n[r] = e, n;
|
|
11
|
-
},
|
|
11
|
+
}, An = ((t, e) => {
|
|
12
12
|
if (t != null)
|
|
13
13
|
return Array.isArray(e) ? t.filter((r) => !e.includes(r)) : t.filter((r) => r != e);
|
|
14
|
-
}),
|
|
14
|
+
}), hr = (t, e) => {
|
|
15
15
|
if (Array.isArray(e))
|
|
16
|
-
return e.reduce((s, i) =>
|
|
16
|
+
return e.reduce((s, i) => hr(s, i), t ?? []);
|
|
17
17
|
if (t == null) return [e];
|
|
18
18
|
const r = t.findIndex((s) => s.key === e.key), n = [...t];
|
|
19
19
|
return r === -1 ? n.push(e) : n[r] = e, n;
|
|
20
|
-
},
|
|
20
|
+
}, En = ((t, e) => {
|
|
21
21
|
if (t != null)
|
|
22
22
|
return Array.isArray(e) ? t.filter((r) => !e.includes(r.key)) : t.filter((r) => r.key !== e);
|
|
23
|
-
}),
|
|
23
|
+
}), bu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
24
24
|
__proto__: null,
|
|
25
|
-
nullableZ:
|
|
26
|
-
remove:
|
|
27
|
-
removeKeyed:
|
|
28
|
-
toArray:
|
|
29
|
-
upsert:
|
|
30
|
-
upsertKeyed:
|
|
31
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
25
|
+
nullableZ: lr,
|
|
26
|
+
remove: An,
|
|
27
|
+
removeKeyed: En,
|
|
28
|
+
toArray: Mn,
|
|
29
|
+
upsert: cr,
|
|
30
|
+
upsertKeyed: hr
|
|
31
|
+
}, Symbol.toStringTag, { value: "Module" })), Un = (t) => {
|
|
32
32
|
const e = t.replace(/_[a-z]/g, (r) => r[1].toUpperCase());
|
|
33
33
|
return e.length > 1 && e[0] === e[0].toUpperCase() && e[1] === e[1].toUpperCase() || e.length === 0 ? e : e[0].toLowerCase() + e.slice(1);
|
|
34
34
|
}, Ye = (t) => {
|
|
@@ -36,32 +36,32 @@ const or = (t) => O.union([
|
|
|
36
36
|
if (typeof r == "string") return t(r);
|
|
37
37
|
if (Array.isArray(r)) return r.map((o) => e(o, n));
|
|
38
38
|
if (!rt(r)) return r;
|
|
39
|
-
n =
|
|
39
|
+
n = Cn(n);
|
|
40
40
|
const s = {}, i = r;
|
|
41
41
|
return "toJSON" in i && typeof i.toJSON == "function" ? e(i.toJSON(), n) : (Object.keys(i).forEach((o) => {
|
|
42
|
-
let
|
|
42
|
+
let l = i[o];
|
|
43
43
|
const f = t(o);
|
|
44
|
-
n.recursive && (rt(
|
|
45
|
-
let d =
|
|
46
|
-
return rt(
|
|
47
|
-
}))), s[f] =
|
|
44
|
+
n.recursive && (rt(l) ? er(l) || (l = e(l, n)) : n.recursiveInArray && _t(l) && (l = [...l].map((c) => {
|
|
45
|
+
let d = c;
|
|
46
|
+
return rt(c) ? er(d) || (d = e(c, n)) : _t(c) && (d = e({ key: c }, n).key), d;
|
|
47
|
+
}))), s[f] = l;
|
|
48
48
|
}), s);
|
|
49
49
|
};
|
|
50
50
|
return e;
|
|
51
|
-
},
|
|
51
|
+
}, It = Ye(Un), Bn = (t) => (
|
|
52
52
|
// Don't convert the first character and don't convert a character that is after a
|
|
53
53
|
// non-alphanumeric character
|
|
54
54
|
t.replace(
|
|
55
55
|
/([a-z0-9])([A-Z])/g,
|
|
56
56
|
(e, r, n) => `${r}_${n.toLowerCase()}`
|
|
57
57
|
)
|
|
58
|
-
),
|
|
58
|
+
), fr = Ye(Bn), dr = (t) => t.length === 0 ? t : t[0].toUpperCase() + t.slice(1), jn = [Number, String, Uint8Array], lt = {
|
|
59
59
|
recursive: !0,
|
|
60
60
|
recursiveInArray: !0
|
|
61
|
-
},
|
|
61
|
+
}, Cn = (t = lt) => (t.recursive == null ? t = lt : t.recursiveInArray ??= !1, t), _t = (t) => t != null && Array.isArray(t), rt = (t) => t != null && typeof t == "object" && !Array.isArray(t), er = (t) => jn.some((e) => t instanceof e), Rn = (t) => t.replace(/[\s_]+/g, "-").replace(
|
|
62
62
|
/([a-z0-9])([A-Z])/g,
|
|
63
63
|
(e, r, n) => `${r}-${n.toLowerCase()}`
|
|
64
|
-
).toLowerCase(),
|
|
64
|
+
).toLowerCase(), Ln = Ye(Rn), Dn = (t) => {
|
|
65
65
|
if (t.length === 0) return t;
|
|
66
66
|
let e = t.replace(/[_-]/g, " ");
|
|
67
67
|
return e = e.replace(
|
|
@@ -71,15 +71,15 @@ const or = (t) => O.union([
|
|
|
71
71
|
/([A-Z]+)([A-Z][a-z])/g,
|
|
72
72
|
(r, n, s) => `${n} ${s}`
|
|
73
73
|
), e = e.replace(/\s+/g, " ").trim(), e = e.replace(/\b\w/g, (r) => r.toUpperCase()), e;
|
|
74
|
-
},
|
|
74
|
+
}, Pn = Ye(Dn), wu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
75
75
|
__proto__: null,
|
|
76
|
-
camelToSnake:
|
|
77
|
-
capitalize:
|
|
78
|
-
snakeToCamel:
|
|
79
|
-
toKebab:
|
|
80
|
-
toProperNoun:
|
|
76
|
+
camelToSnake: fr,
|
|
77
|
+
capitalize: dr,
|
|
78
|
+
snakeToCamel: It,
|
|
79
|
+
toKebab: Ln,
|
|
80
|
+
toProperNoun: Pn
|
|
81
81
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
82
|
-
let
|
|
82
|
+
let kn = class {
|
|
83
83
|
contentType = "application/json";
|
|
84
84
|
decoder;
|
|
85
85
|
encoder;
|
|
@@ -93,15 +93,15 @@ let Ln = class {
|
|
|
93
93
|
return this.decodeString(this.decoder.decode(e), r);
|
|
94
94
|
}
|
|
95
95
|
decodeString(e, r) {
|
|
96
|
-
const n = JSON.parse(e), s =
|
|
96
|
+
const n = JSON.parse(e), s = It(n);
|
|
97
97
|
return r != null ? r.parse(s) : s;
|
|
98
98
|
}
|
|
99
99
|
encodeString(e) {
|
|
100
|
-
const r =
|
|
100
|
+
const r = fr(e);
|
|
101
101
|
return JSON.stringify(r, (n, s) => ArrayBuffer.isView(s) ? Array.from(s) : typeof s == "bigint" ? s.toString() : s);
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
|
-
const ct = new
|
|
104
|
+
const ct = new kn(), ht = (t) => [...new Set(t)], qn = (t, e, r = !0) => {
|
|
105
105
|
const n = /* @__PURE__ */ new Map();
|
|
106
106
|
return t.forEach((s) => {
|
|
107
107
|
const i = e(s);
|
|
@@ -111,9 +111,9 @@ const ct = new Ln(), ht = (t) => [...new Set(t)], Dn = (t, e, r = !0) => {
|
|
|
111
111
|
}
|
|
112
112
|
n.set(i, s);
|
|
113
113
|
}), Array.from(n.values());
|
|
114
|
-
},
|
|
114
|
+
}, Ou = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
115
115
|
__proto__: null,
|
|
116
|
-
by:
|
|
116
|
+
by: qn,
|
|
117
117
|
unique: ht
|
|
118
118
|
}, Symbol.toStringTag, { value: "Module" })), B = (t) => t != null && typeof t == "object" && "value" in t;
|
|
119
119
|
let re = class {
|
|
@@ -136,8 +136,8 @@ let re = class {
|
|
|
136
136
|
return this.value.toString();
|
|
137
137
|
}
|
|
138
138
|
};
|
|
139
|
-
const
|
|
140
|
-
if (
|
|
139
|
+
const Mt = (t) => t != null && typeof t == "object" && "toString" in t, gr = (t) => {
|
|
140
|
+
if (Mt(t)) return t?.toString().length === 0;
|
|
141
141
|
switch (typeof t) {
|
|
142
142
|
case "string":
|
|
143
143
|
return t.length === 0;
|
|
@@ -154,15 +154,15 @@ const Nt = (t) => t != null && typeof t == "object" && "toString" in t, fr = (t)
|
|
|
154
154
|
default:
|
|
155
155
|
return !1;
|
|
156
156
|
}
|
|
157
|
-
},
|
|
157
|
+
}, zn = (t) => !gr(t), Tu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
158
158
|
__proto__: null,
|
|
159
159
|
ValueExtension: re,
|
|
160
160
|
isCrudeValueExtension: B,
|
|
161
|
-
isNonZero:
|
|
162
|
-
isStringer:
|
|
163
|
-
isZero:
|
|
161
|
+
isNonZero: zn,
|
|
162
|
+
isStringer: Mt,
|
|
163
|
+
isZero: gr
|
|
164
164
|
}, Symbol.toStringTag, { value: "Module" })), We = (t, e = !1) => {
|
|
165
|
-
const r =
|
|
165
|
+
const r = Mt(t) ? "stringer" : typeof t;
|
|
166
166
|
let n;
|
|
167
167
|
switch (r) {
|
|
168
168
|
case "string":
|
|
@@ -186,69 +186,69 @@ const Nt = (t) => t != null && typeof t == "object" && "toString" in t, fr = (t)
|
|
|
186
186
|
default:
|
|
187
187
|
return console.warn(`sortFunc: unknown type ${r}`), () => -1;
|
|
188
188
|
}
|
|
189
|
-
return e ?
|
|
190
|
-
},
|
|
189
|
+
return e ? mr(n) : n;
|
|
190
|
+
}, Zn = (t, e, r) => {
|
|
191
191
|
const n = We(e[t], r);
|
|
192
192
|
return (s, i) => n(s[t], i[t]);
|
|
193
|
-
},
|
|
193
|
+
}, Fn = (t, e) => t.length !== e.length ? t.length - e.length : t.every((r, n) => r === e[n]) ? 0 : -1, pr = (t, e) => {
|
|
194
194
|
if (t.length !== e.length) return t.length - e.length;
|
|
195
195
|
if (t.length === 0) return 0;
|
|
196
196
|
const r = We(t[0]), n = [...t].sort(r), s = [...e].sort(r);
|
|
197
197
|
return n.every((i, o) => i === s[o]) ? 0 : -1;
|
|
198
|
-
},
|
|
198
|
+
}, Yn = (t, e) => {
|
|
199
199
|
const r = ht(t), n = ht(e);
|
|
200
|
-
return
|
|
201
|
-
},
|
|
200
|
+
return pr(r, n);
|
|
201
|
+
}, Wn = (t, e) => t === e ? 0 : t === "first" && e === "last" ? 1 : -1, mr = (t) => (e, r) => t(r, e), ae = 0, Ue = -1, Be = 1, yr = (t) => t < ae, br = (t) => t > ae, Vn = (t) => t >= ae, wr = (t) => t === ae, Gn = (t, e) => {
|
|
202
202
|
const r = /([a-zA-Z]+)|(\d+)/g, n = t.replace(/[\s_.-]+/g, "").match(r), s = e.replace(/[\s_.-]+/g, "").match(r);
|
|
203
203
|
if (!n || !s) return 0;
|
|
204
204
|
for (let i = 0; i < Math.min(n.length, s.length); i++) {
|
|
205
|
-
const o = n[i],
|
|
206
|
-
if (isNaN(Number(o)) && isNaN(Number(
|
|
207
|
-
const f = o.localeCompare(
|
|
205
|
+
const o = n[i], l = s[i];
|
|
206
|
+
if (isNaN(Number(o)) && isNaN(Number(l))) {
|
|
207
|
+
const f = o.localeCompare(l);
|
|
208
208
|
if (f !== 0) return f;
|
|
209
|
-
} else if (!isNaN(Number(o)) && !isNaN(Number(
|
|
210
|
-
const f = Number(o) - Number(
|
|
209
|
+
} else if (!isNaN(Number(o)) && !isNaN(Number(l))) {
|
|
210
|
+
const f = Number(o) - Number(l);
|
|
211
211
|
if (f !== 0) return f;
|
|
212
212
|
} else return isNaN(Number(o)) ? -1 : 1;
|
|
213
213
|
}
|
|
214
214
|
return n.length - s.length;
|
|
215
|
-
},
|
|
215
|
+
}, xu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
216
216
|
__proto__: null,
|
|
217
217
|
EQUAL: ae,
|
|
218
218
|
GREATER_THAN: Be,
|
|
219
219
|
LESS_THAN: Ue,
|
|
220
|
-
isEqualTo:
|
|
221
|
-
isGreaterThan:
|
|
222
|
-
isGreaterThanEqual:
|
|
223
|
-
isLessThan:
|
|
220
|
+
isEqualTo: wr,
|
|
221
|
+
isGreaterThan: br,
|
|
222
|
+
isGreaterThanEqual: Vn,
|
|
223
|
+
isLessThan: yr,
|
|
224
224
|
newF: We,
|
|
225
|
-
newFieldF:
|
|
226
|
-
order:
|
|
227
|
-
primitiveArrays:
|
|
228
|
-
reverseF:
|
|
229
|
-
stringsWithNumbers:
|
|
230
|
-
uniqueUnorderedPrimitiveArrays:
|
|
231
|
-
unorderedPrimitiveArrays:
|
|
225
|
+
newFieldF: Zn,
|
|
226
|
+
order: Wn,
|
|
227
|
+
primitiveArrays: Fn,
|
|
228
|
+
reverseF: mr,
|
|
229
|
+
stringsWithNumbers: Gn,
|
|
230
|
+
uniqueUnorderedPrimitiveArrays: Yn,
|
|
231
|
+
unorderedPrimitiveArrays: pr
|
|
232
232
|
}, Symbol.toStringTag, { value: "Module" })), Ve = a.tuple([a.number(), a.number()]);
|
|
233
233
|
a.tuple([a.bigint(), a.bigint()]);
|
|
234
|
-
const
|
|
234
|
+
const At = a.object({ width: a.number(), height: a.number() }), Hn = a.object({
|
|
235
235
|
signedWidth: a.number(),
|
|
236
236
|
signedHeight: a.number()
|
|
237
|
-
}),
|
|
238
|
-
a.enum(
|
|
239
|
-
const
|
|
240
|
-
a.enum(Hn);
|
|
241
|
-
const ye = a.object({ x: a.number(), y: a.number() }), br = a.object({ clientX: a.number(), clientY: a.number() }), Ge = ["x", "y"], Mt = a.enum(Ge), At = ["top", "right", "bottom", "left"], Xn = a.enum(At), He = ["left", "right"], Et = a.enum(He), Xe = ["top", "bottom"], Ut = a.enum(Xe), Bt = ["center"], ft = a.enum(Bt), Jn = [...At, ...Bt], jt = a.enum(Jn);
|
|
242
|
-
a.enum(Gn);
|
|
243
|
-
const Kn = ["first", "last"];
|
|
237
|
+
}), Xn = ["width", "height"];
|
|
238
|
+
a.enum(Xn);
|
|
239
|
+
const Jn = ["start", "center", "end"], Kn = ["signedWidth", "signedHeight"];
|
|
244
240
|
a.enum(Kn);
|
|
245
|
-
const
|
|
246
|
-
a.
|
|
247
|
-
|
|
248
|
-
|
|
241
|
+
const be = a.object({ x: a.number(), y: a.number() }), $r = a.object({ clientX: a.number(), clientY: a.number() }), Ge = ["x", "y"], Et = a.enum(Ge), Ut = ["top", "right", "bottom", "left"], Qn = a.enum(Ut), He = ["left", "right"], Bt = a.enum(He), Xe = ["top", "bottom"], jt = a.enum(Xe), Ct = ["center"], ft = a.enum(Ct), _n = [...Ut, ...Ct], Rt = a.enum(_n);
|
|
242
|
+
a.enum(Jn);
|
|
243
|
+
const es = ["first", "last"];
|
|
244
|
+
a.enum(es);
|
|
245
|
+
const Or = a.object({ lower: a.number(), upper: a.number() }), ts = a.object({ lower: a.bigint(), upper: a.bigint() });
|
|
246
|
+
a.union([Or, Ve]);
|
|
247
|
+
a.union([ts, Ve]);
|
|
248
|
+
const rs = a.enum([...Et.options, ...Rt.options]);
|
|
249
249
|
a.enum(["x", "left", "right"]);
|
|
250
250
|
a.enum(["y", "top", "bottom"]);
|
|
251
|
-
const
|
|
251
|
+
const ns = a.union([Et, Rt, a.instanceof(String)]), oe = (t) => (e, r) => {
|
|
252
252
|
if (typeof e == "bigint") {
|
|
253
253
|
if (ke(r))
|
|
254
254
|
return t(e, BigInt(r));
|
|
@@ -256,13 +256,13 @@ const es = a.union([Mt, jt, a.instanceof(String)]), oe = (t) => (e, r) => {
|
|
|
256
256
|
return typeof n == "number" ? BigInt(Math.round(n)) : n;
|
|
257
257
|
}
|
|
258
258
|
return t(Number(e), Number(r));
|
|
259
|
-
}, Z = oe((t, e) => t - e), ue = oe((t, e) => t + e),
|
|
259
|
+
}, Z = oe((t, e) => t - e), ue = oe((t, e) => t + e), ss = (t, e, r = 1e-4) => Math.abs(t - e) < r, dt = (t, e) => {
|
|
260
260
|
const r = typeof t == "bigint", n = typeof e == "bigint";
|
|
261
261
|
return r && n ? t === e : r && ke(e) ? t === BigInt(e) : n && ke(t) ? e === BigInt(t) : t === e;
|
|
262
|
-
},
|
|
262
|
+
}, is = (t) => {
|
|
263
263
|
const e = 10 ** Math.floor(Math.log10(t));
|
|
264
264
|
return Math.round(t / e) * e;
|
|
265
|
-
},
|
|
265
|
+
}, vr = oe((t, e) => t <= e ? t : e), ke = (t) => typeof t == "bigint" ? !0 : Number.isInteger(t), as = oe((t, e) => t >= e ? t : e), Tr = (t) => typeof t == "bigint" ? t < 0n ? -t : t : t < 0 ? -t : t, R = oe((t, e) => t * e), Te = oe((t, e) => t / e), b = (t, e, r) => {
|
|
266
266
|
const n = {};
|
|
267
267
|
if (typeof e == "object" && (r = e, e = void 0), r = { makeValid: !0, ...r }, typeof t == "number" || typeof t == "bigint")
|
|
268
268
|
e != null ? (n.lower = t, n.upper = e) : (n.lower = typeof t == "bigint" ? 0n : 0, n.upper = t);
|
|
@@ -271,13 +271,13 @@ const es = a.union([Mt, jt, a.instanceof(String)]), oe = (t) => (e, r) => {
|
|
|
271
271
|
[n.lower, n.upper] = t;
|
|
272
272
|
} else
|
|
273
273
|
n.lower = t.lower, n.upper = t.upper;
|
|
274
|
-
return r?.makeValid ?
|
|
275
|
-
},
|
|
274
|
+
return r?.makeValid ? xr(n) : n;
|
|
275
|
+
}, os = Object.freeze({ lower: 0, upper: 0 }), us = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), ls = Object.freeze({ lower: 0, upper: 1 }), cs = Object.freeze({ lower: -1, upper: 1 }), hs = (t, e) => {
|
|
276
276
|
if (t == null && e == null) return !0;
|
|
277
277
|
if (t == null || e == null) return !1;
|
|
278
278
|
const r = b(t), n = b(e);
|
|
279
279
|
return r?.lower === n?.lower && r?.upper === n?.upper;
|
|
280
|
-
},
|
|
280
|
+
}, xr = (t) => t.lower > t.upper ? { lower: t.upper, upper: t.lower } : t, gt = (t, e) => {
|
|
281
281
|
const r = b(t);
|
|
282
282
|
return e < r.lower ? r.lower : e >= r.upper ? r.upper - (typeof r.upper == "number" ? 1 : 1n) : e;
|
|
283
283
|
}, L = (t, e) => {
|
|
@@ -286,33 +286,33 @@ const es = a.union([Mt, jt, a.instanceof(String)]), oe = (t) => (e, r) => {
|
|
|
286
286
|
return e >= r.lower && e < r.upper;
|
|
287
287
|
const n = b(e);
|
|
288
288
|
return n.lower >= r.lower && n.upper <= r.upper;
|
|
289
|
-
},
|
|
289
|
+
}, fs = (t, e) => {
|
|
290
290
|
const r = b(t), n = b(e);
|
|
291
291
|
return r.lower === n.lower ? !0 : n.upper === r.lower || n.lower === r.upper ? !1 : L(r, n.upper) || L(r, n.lower) || L(n, r.upper) || L(n, r.lower);
|
|
292
|
-
},
|
|
292
|
+
}, le = (t) => {
|
|
293
293
|
const e = b(t);
|
|
294
294
|
return e.upper - e.lower;
|
|
295
|
-
},
|
|
295
|
+
}, ds = (t) => {
|
|
296
296
|
const e = b(t);
|
|
297
297
|
return typeof e.lower == "bigint" ? e.lower === 0n && e.upper === 0n : e.lower === 0 && e.upper === 0;
|
|
298
|
-
},
|
|
299
|
-
const e =
|
|
298
|
+
}, gs = (t) => {
|
|
299
|
+
const e = le(t);
|
|
300
300
|
return typeof e == "number" ? e === 0 : e === 0n;
|
|
301
|
-
},
|
|
301
|
+
}, ps = (t) => {
|
|
302
302
|
const e = b(t);
|
|
303
303
|
return typeof e.lower == "bigint" ? !0 : Number.isFinite(e.lower) && Number.isFinite(e.upper);
|
|
304
|
-
},
|
|
304
|
+
}, ms = (t) => {
|
|
305
305
|
const e = b(t);
|
|
306
306
|
return (e.upper + e.lower) / 2;
|
|
307
|
-
},
|
|
307
|
+
}, Sr = (t) => ({
|
|
308
308
|
lower: Math.min(...t.map((e) => b(e).lower)),
|
|
309
309
|
upper: Math.max(...t.map((e) => b(e).upper))
|
|
310
|
-
}),
|
|
310
|
+
}), ys = (t) => ({
|
|
311
311
|
lower: Math.max(...t.map((e) => b(e).lower)),
|
|
312
312
|
upper: Math.min(...t.map((e) => b(e).upper))
|
|
313
|
-
}),
|
|
313
|
+
}), bs = (t) => {
|
|
314
314
|
const e = b(t), r = typeof e.lower == "bigint";
|
|
315
|
-
return Array.from({ length: Number(
|
|
315
|
+
return Array.from({ length: Number(le(t)) }, (n, s) => r ? e.lower + BigInt(s) : e.lower + s);
|
|
316
316
|
}, pt = (t, e) => {
|
|
317
317
|
const r = t.map((i) => b(i)), n = r.findIndex((i) => L(i, e) || e < i.lower);
|
|
318
318
|
if (n === -1) return { index: t.length, position: 0 };
|
|
@@ -323,8 +323,8 @@ const es = a.union([Mt, jt, a.instanceof(String)]), oe = (t) => (e, r) => {
|
|
|
323
323
|
removeAfter: 0,
|
|
324
324
|
insertInto: 0,
|
|
325
325
|
deleteInBetween: 0
|
|
326
|
-
},
|
|
327
|
-
const r = t.map((
|
|
326
|
+
}, ws = (t, e) => {
|
|
327
|
+
const r = t.map((c) => b(c)), n = b(e);
|
|
328
328
|
if (r.length === 0) return nt;
|
|
329
329
|
const s = pt(r, n.lower), i = pt(r, n.upper);
|
|
330
330
|
if (s.index === t.length) return { ...nt, insertInto: t.length };
|
|
@@ -336,24 +336,24 @@ const es = a.union([Mt, jt, a.instanceof(String)]), oe = (t) => (e, r) => {
|
|
|
336
336
|
insertInto: s.index,
|
|
337
337
|
deleteInBetween: 0
|
|
338
338
|
};
|
|
339
|
-
let o = i.index - s.index,
|
|
340
|
-
return s.position !== 0 ? (o -= 1,
|
|
339
|
+
let o = i.index - s.index, l = s.index, f = Z(Number(le(r[s.index])), s.position);
|
|
340
|
+
return s.position !== 0 ? (o -= 1, l += 1) : f = 0, {
|
|
341
341
|
removeBefore: f,
|
|
342
342
|
removeAfter: i.position,
|
|
343
|
-
insertInto:
|
|
343
|
+
insertInto: l,
|
|
344
344
|
deleteInBetween: o
|
|
345
345
|
};
|
|
346
|
-
},
|
|
347
|
-
const n = t.map((
|
|
346
|
+
}, Nr = (t, e, r) => {
|
|
347
|
+
const n = t.map((l) => b(l)), s = r > 0 ? 1 : r < 0 ? -1 : 0;
|
|
348
348
|
if (s === 0) return e;
|
|
349
349
|
let i = r, o = e;
|
|
350
350
|
for (; dt(i, 0) === !1; ) {
|
|
351
|
-
const
|
|
352
|
-
if (
|
|
353
|
-
const f = n[
|
|
354
|
-
let
|
|
355
|
-
if (s > 0 ?
|
|
356
|
-
const d =
|
|
351
|
+
const l = n.findIndex((f) => s > 0 ? o >= f.lower && o < f.upper : o > f.lower && o <= f.upper);
|
|
352
|
+
if (l !== -1) {
|
|
353
|
+
const f = n[l];
|
|
354
|
+
let c;
|
|
355
|
+
if (s > 0 ? c = Z(f.upper, o) : c = Z(o, f.lower), c > 0) {
|
|
356
|
+
const d = vr(Tr(i), c);
|
|
357
357
|
if (o = ue(
|
|
358
358
|
o,
|
|
359
359
|
s > 0 ? d : -d
|
|
@@ -362,174 +362,174 @@ const es = a.union([Mt, jt, a.instanceof(String)]), oe = (t) => (e, r) => {
|
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
if (s > 0) {
|
|
365
|
-
const f = n.filter((
|
|
365
|
+
const f = n.filter((c) => c.lower > o);
|
|
366
366
|
if (f.length > 0) o = f[0].lower;
|
|
367
367
|
else return o;
|
|
368
368
|
} else {
|
|
369
|
-
const f = n.filter((
|
|
369
|
+
const f = n.filter((c) => c.upper < o);
|
|
370
370
|
if (f.length > 0)
|
|
371
371
|
o = f[f.length - 1].upper;
|
|
372
372
|
else return o;
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
375
|
return o;
|
|
376
|
-
},
|
|
376
|
+
}, Ir = (t, e, r) => {
|
|
377
377
|
const n = t.map((o) => b(o));
|
|
378
378
|
if (e === r) return typeof e == "bigint" ? 0n : 0;
|
|
379
379
|
const s = e < r ? b([e, r]) : b([r, e]);
|
|
380
380
|
let i = typeof e == "bigint" ? 0n : 0;
|
|
381
381
|
for (const o of n) {
|
|
382
|
-
const
|
|
383
|
-
if (
|
|
384
|
-
const
|
|
385
|
-
i = i +
|
|
382
|
+
const l = o.lower > s.lower ? o.lower : s.lower, f = o.upper < s.upper ? o.upper : s.upper;
|
|
383
|
+
if (l < f) {
|
|
384
|
+
const c = f - l;
|
|
385
|
+
i = i + c;
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
388
|
return i;
|
|
389
|
-
},
|
|
389
|
+
}, Su = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
390
390
|
__proto__: null,
|
|
391
|
-
CLIP:
|
|
392
|
-
DECIMAL:
|
|
393
|
-
INFINITE:
|
|
394
|
-
ZERO:
|
|
395
|
-
bounds:
|
|
396
|
-
buildInsertionPlan:
|
|
391
|
+
CLIP: cs,
|
|
392
|
+
DECIMAL: ls,
|
|
393
|
+
INFINITE: us,
|
|
394
|
+
ZERO: os,
|
|
395
|
+
bounds: Or,
|
|
396
|
+
buildInsertionPlan: ws,
|
|
397
397
|
clamp: gt,
|
|
398
398
|
construct: b,
|
|
399
399
|
contains: L,
|
|
400
|
-
distance:
|
|
401
|
-
equals:
|
|
400
|
+
distance: Ir,
|
|
401
|
+
equals: hs,
|
|
402
402
|
findInsertPosition: pt,
|
|
403
|
-
isFinite:
|
|
404
|
-
isZero:
|
|
405
|
-
linspace:
|
|
406
|
-
makeValid:
|
|
407
|
-
max:
|
|
408
|
-
mean:
|
|
409
|
-
min:
|
|
410
|
-
overlapsWith:
|
|
411
|
-
span:
|
|
412
|
-
spanIsZero:
|
|
413
|
-
traverse:
|
|
414
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
403
|
+
isFinite: ps,
|
|
404
|
+
isZero: ds,
|
|
405
|
+
linspace: bs,
|
|
406
|
+
makeValid: xr,
|
|
407
|
+
max: Sr,
|
|
408
|
+
mean: ms,
|
|
409
|
+
min: ys,
|
|
410
|
+
overlapsWith: fs,
|
|
411
|
+
span: le,
|
|
412
|
+
spanIsZero: gs,
|
|
413
|
+
traverse: Nr
|
|
414
|
+
}, Symbol.toStringTag, { value: "Module" })), Mr = rs, z = (t) => Ge.includes(t) ? t : Xe.includes(t) ? "y" : "x", $s = (t) => z(t) === "x" ? "y" : "x", Os = (t) => z(t) === "x" ? "width" : "height", vs = (t) => z(t) === "x" ? "left" : "top", Ts = (t) => Mr.safeParse(t).success, xs = (t) => z(t) === "x" ? "signedWidth" : "signedHeight", Ss = (t) => t === "center" ? !1 : z(t) === "x", Ns = (t) => z(t) === "y", Is = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
415
415
|
__proto__: null,
|
|
416
416
|
DIRECTIONS: Ge,
|
|
417
417
|
construct: z,
|
|
418
|
-
crude:
|
|
419
|
-
dimension:
|
|
420
|
-
direction:
|
|
421
|
-
isDirection:
|
|
422
|
-
isX:
|
|
423
|
-
isY:
|
|
424
|
-
location:
|
|
425
|
-
signedDimension:
|
|
426
|
-
swap:
|
|
427
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
418
|
+
crude: Mr,
|
|
419
|
+
dimension: Os,
|
|
420
|
+
direction: Et,
|
|
421
|
+
isDirection: Ts,
|
|
422
|
+
isX: Ss,
|
|
423
|
+
isY: Ns,
|
|
424
|
+
location: vs,
|
|
425
|
+
signedDimension: xs,
|
|
426
|
+
swap: $s
|
|
427
|
+
}, Symbol.toStringTag, { value: "Module" })), Ms = Bt, As = jt, Es = ft, Us = {
|
|
428
428
|
top: "bottom",
|
|
429
429
|
right: "left",
|
|
430
430
|
bottom: "top",
|
|
431
431
|
left: "right",
|
|
432
432
|
center: "center"
|
|
433
|
-
},
|
|
433
|
+
}, Bs = {
|
|
434
434
|
top: "left",
|
|
435
435
|
right: "top",
|
|
436
436
|
bottom: "right",
|
|
437
437
|
left: "bottom",
|
|
438
438
|
center: "center"
|
|
439
|
-
},
|
|
439
|
+
}, js = ns, H = (t) => t instanceof String || !Ge.includes(t) ? t : t === "x" ? "left" : "top", Cs = (t) => Us[H(t)], Rs = (t) => Bs[H(t)], we = (t) => {
|
|
440
440
|
const e = H(t);
|
|
441
441
|
return e === "top" || e === "bottom" ? "y" : "x";
|
|
442
|
-
},
|
|
443
|
-
x:
|
|
444
|
-
y:
|
|
445
|
-
}),
|
|
446
|
-
|
|
442
|
+
}, Ls = a.object({
|
|
443
|
+
x: Bt.or(ft),
|
|
444
|
+
y: jt.or(ft)
|
|
445
|
+
}), Ar = a.object({ x: Bt, y: jt }), xe = Object.freeze({ x: "left", y: "top" }), Lt = Object.freeze({ x: "right", y: "top" }), Je = Object.freeze({ x: "left", y: "bottom" }), Dt = Object.freeze({ x: "right", y: "bottom" }), Pt = Object.freeze({ x: "center", y: "center" }), kt = Object.freeze({ x: "center", y: "top" }), qt = Object.freeze({ x: "center", y: "bottom" }), zt = Object.freeze({ x: "right", y: "center" }), Zt = Object.freeze({ x: "left", y: "center" }), Ds = Object.freeze([
|
|
446
|
+
Zt,
|
|
447
|
+
zt,
|
|
447
448
|
kt,
|
|
448
|
-
|
|
449
|
-
Pt,
|
|
449
|
+
qt,
|
|
450
450
|
xe,
|
|
451
|
-
|
|
451
|
+
Lt,
|
|
452
452
|
Je,
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
]),
|
|
453
|
+
Dt,
|
|
454
|
+
Pt
|
|
455
|
+
]), Ft = (t, e) => t.x === e.x && t.y === e.y, Ps = (t, e) => {
|
|
456
456
|
if (typeof e == "object") {
|
|
457
457
|
let r = !0;
|
|
458
458
|
return "x" in e && (t.x === e.x || (r = !1)), "y" in e && (t.y === e.y || (r = !1)), r;
|
|
459
459
|
}
|
|
460
460
|
return t.x === e || t.y === e;
|
|
461
|
-
},
|
|
461
|
+
}, Er = (t) => [t.x, t.y], je = (t) => we(H(t)) === "x", ks = (t) => we(H(t)) === "y", qs = (t) => `${t.x}${dr(t.y)}`, zs = (t, e) => {
|
|
462
462
|
let r, n;
|
|
463
|
-
if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r = H(t), n = H(e ?? t)),
|
|
463
|
+
if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r = H(t), n = H(e ?? t)), we(r) === we(n) && r !== "center" && n !== "center")
|
|
464
464
|
throw new Error(
|
|
465
465
|
`[XYLocation] - encountered two locations with the same direction: ${r.toString()} - ${n.toString()}`
|
|
466
466
|
);
|
|
467
|
-
const s = { ...
|
|
467
|
+
const s = { ...Pt };
|
|
468
468
|
return r === "center" ? je(n) ? [s.x, s.y] = [n, r] : [s.x, s.y] = [r, n] : n === "center" ? je(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r] : je(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r], s;
|
|
469
|
-
},
|
|
469
|
+
}, Zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
470
470
|
__proto__: null,
|
|
471
|
-
BOTTOM_CENTER:
|
|
471
|
+
BOTTOM_CENTER: qt,
|
|
472
472
|
BOTTOM_LEFT: Je,
|
|
473
|
-
BOTTOM_RIGHT:
|
|
474
|
-
CENTER:
|
|
475
|
-
CENTER_LEFT:
|
|
476
|
-
CENTER_LOCATIONS:
|
|
477
|
-
CENTER_RIGHT:
|
|
478
|
-
OUTER_LOCATIONS:
|
|
479
|
-
TOP_CENTER:
|
|
473
|
+
BOTTOM_RIGHT: Dt,
|
|
474
|
+
CENTER: Pt,
|
|
475
|
+
CENTER_LEFT: Zt,
|
|
476
|
+
CENTER_LOCATIONS: Ct,
|
|
477
|
+
CENTER_RIGHT: zt,
|
|
478
|
+
OUTER_LOCATIONS: Ut,
|
|
479
|
+
TOP_CENTER: kt,
|
|
480
480
|
TOP_LEFT: xe,
|
|
481
|
-
TOP_RIGHT:
|
|
482
|
-
XY_LOCATIONS:
|
|
481
|
+
TOP_RIGHT: Lt,
|
|
482
|
+
XY_LOCATIONS: Ds,
|
|
483
483
|
X_LOCATIONS: He,
|
|
484
484
|
Y_LOCATIONS: Xe,
|
|
485
|
-
center:
|
|
485
|
+
center: Es,
|
|
486
486
|
construct: H,
|
|
487
|
-
constructXY:
|
|
488
|
-
corner:
|
|
489
|
-
crude:
|
|
490
|
-
direction:
|
|
487
|
+
constructXY: zs,
|
|
488
|
+
corner: Ar,
|
|
489
|
+
crude: js,
|
|
490
|
+
direction: we,
|
|
491
491
|
isX: je,
|
|
492
|
-
isY:
|
|
493
|
-
location:
|
|
494
|
-
outer:
|
|
495
|
-
rotate90:
|
|
496
|
-
swap:
|
|
497
|
-
x:
|
|
498
|
-
xy:
|
|
499
|
-
xyCouple:
|
|
500
|
-
xyEquals:
|
|
501
|
-
xyMatches:
|
|
502
|
-
xyToString:
|
|
503
|
-
y:
|
|
492
|
+
isY: ks,
|
|
493
|
+
location: Rt,
|
|
494
|
+
outer: Qn,
|
|
495
|
+
rotate90: Rs,
|
|
496
|
+
swap: Cs,
|
|
497
|
+
x: Ms,
|
|
498
|
+
xy: Ls,
|
|
499
|
+
xyCouple: Er,
|
|
500
|
+
xyEquals: Ft,
|
|
501
|
+
xyMatches: Ps,
|
|
502
|
+
xyToString: qs,
|
|
503
|
+
y: As
|
|
504
504
|
}, Symbol.toStringTag, { value: "Module" })), mt = a.union([
|
|
505
505
|
a.number(),
|
|
506
|
-
|
|
506
|
+
be,
|
|
507
507
|
Ve,
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
508
|
+
At,
|
|
509
|
+
Hn,
|
|
510
|
+
$r
|
|
511
511
|
]), v = (t, e) => {
|
|
512
512
|
if (typeof t == "string") {
|
|
513
513
|
if (e === void 0) throw new Error("The y coordinate must be given.");
|
|
514
514
|
return t === "x" ? { x: e, y: 0 } : { x: 0, y: e };
|
|
515
515
|
}
|
|
516
516
|
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 };
|
|
517
|
-
}, q = Object.freeze({ x: 0, y: 0 }),
|
|
517
|
+
}, q = Object.freeze({ x: 0, y: 0 }), Ur = Object.freeze({ x: 1, y: 1 }), Fs = Object.freeze({ x: 1 / 0, y: 1 / 0 }), Ys = Object.freeze({ x: NaN, y: NaN }), qe = (t, e, r = 0) => {
|
|
518
518
|
const n = v(t), s = v(e);
|
|
519
519
|
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;
|
|
520
|
-
},
|
|
520
|
+
}, Ws = (t) => qe(t, q), Yt = (t, e, r) => {
|
|
521
521
|
const n = v(t), s = v(e, r);
|
|
522
522
|
return { x: n.x * s.x, y: n.y * s.y };
|
|
523
|
-
},
|
|
523
|
+
}, Br = (t, e) => {
|
|
524
524
|
const r = v(t);
|
|
525
525
|
return { x: r.x + e, y: r.y };
|
|
526
|
-
},
|
|
526
|
+
}, jr = (t, e) => {
|
|
527
527
|
const r = v(t);
|
|
528
528
|
return { x: r.x, y: r.y + e };
|
|
529
|
-
},
|
|
529
|
+
}, $e = (t, e, r, ...n) => {
|
|
530
530
|
if (typeof e == "string") {
|
|
531
531
|
if (typeof r != "number") throw new Error("The value must be a number.");
|
|
532
|
-
return e === "x" ?
|
|
532
|
+
return e === "x" ? Br(t, r) : jr(t, r);
|
|
533
533
|
}
|
|
534
534
|
if (typeof e == "object" && "x" in e && typeof e.x == "string") {
|
|
535
535
|
const s = v(r), i = v(t);
|
|
@@ -539,25 +539,25 @@ const es = a.union([Mt, jt, a.instanceof(String)]), oe = (t) => (e, r) => {
|
|
|
539
539
|
const o = v(i);
|
|
540
540
|
return { x: s.x + o.x, y: s.y + o.y };
|
|
541
541
|
}, q);
|
|
542
|
-
},
|
|
542
|
+
}, Vs = (t, e, r) => {
|
|
543
543
|
const n = v(t);
|
|
544
544
|
return e === "x" ? { x: r, y: n.y } : { x: n.x, y: r };
|
|
545
|
-
},
|
|
545
|
+
}, Gs = (t, e) => {
|
|
546
546
|
const r = v(t), n = v(e);
|
|
547
547
|
return Math.sqrt((r.x - n.x) ** 2 + (r.y - n.y) ** 2);
|
|
548
|
-
},
|
|
548
|
+
}, Hs = (t, e) => {
|
|
549
549
|
const r = v(t), n = v(e);
|
|
550
550
|
return { x: n.x - r.x, y: n.y - r.y };
|
|
551
|
-
},
|
|
551
|
+
}, Xs = (t) => {
|
|
552
552
|
const e = v(t);
|
|
553
553
|
return Number.isNaN(e.x) || Number.isNaN(e.y);
|
|
554
|
-
},
|
|
554
|
+
}, Js = (t) => {
|
|
555
555
|
const e = v(t);
|
|
556
556
|
return Number.isFinite(e.x) && Number.isFinite(e.y);
|
|
557
|
-
},
|
|
557
|
+
}, Ks = (t) => {
|
|
558
558
|
const e = v(t);
|
|
559
559
|
return [e.x, e.y];
|
|
560
|
-
},
|
|
560
|
+
}, Qs = (t) => {
|
|
561
561
|
const e = v(t);
|
|
562
562
|
return { left: e.x, top: e.y };
|
|
563
563
|
}, yt = (t, e = 0) => {
|
|
@@ -566,96 +566,96 @@ const es = a.union([Mt, jt, a.instanceof(String)]), oe = (t) => (e, r) => {
|
|
|
566
566
|
x: Number(r.x.toFixed(e)),
|
|
567
567
|
y: Number(r.y.toFixed(e))
|
|
568
568
|
};
|
|
569
|
-
},
|
|
569
|
+
}, he = (t, e) => {
|
|
570
570
|
const r = v(t), n = v(e);
|
|
571
571
|
return { x: r.x - n.x, y: r.y - n.y };
|
|
572
|
-
},
|
|
572
|
+
}, fe = (t) => {
|
|
573
573
|
const e = v(t), r = Math.hypot(e.x, e.y);
|
|
574
574
|
return r === 0 ? { x: 0, y: 0 } : { x: -e.y / r, y: e.x / r };
|
|
575
|
-
},
|
|
575
|
+
}, Cr = (t) => {
|
|
576
576
|
const e = v(t), r = Math.hypot(e.x, e.y);
|
|
577
577
|
return r === 0 ? { x: 0, y: 0 } : { x: e.x / r, y: e.y / r };
|
|
578
|
-
},
|
|
579
|
-
const e = t.reduce((r, n) =>
|
|
580
|
-
return
|
|
581
|
-
},
|
|
578
|
+
}, Rr = (...t) => {
|
|
579
|
+
const e = t.reduce((r, n) => $e(r, n), q);
|
|
580
|
+
return Yt(e, 1 / t.length);
|
|
581
|
+
}, _s = (t, e) => {
|
|
582
582
|
const r = [];
|
|
583
583
|
for (let n = 0; n < t.length; n++) {
|
|
584
584
|
const s = t[n];
|
|
585
|
-
let i, o,
|
|
585
|
+
let i, o, l, f;
|
|
586
586
|
if (n === 0) {
|
|
587
|
-
const
|
|
588
|
-
o =
|
|
587
|
+
const c = t[n + 1], d = he(c, s);
|
|
588
|
+
o = fe(d), l = o, f = e;
|
|
589
589
|
} else if (n === t.length - 1) {
|
|
590
|
-
const
|
|
591
|
-
i =
|
|
590
|
+
const c = t[n - 1], d = he(s, c);
|
|
591
|
+
i = fe(d), l = i, f = e;
|
|
592
592
|
} else {
|
|
593
|
-
const
|
|
594
|
-
i =
|
|
593
|
+
const c = t[n - 1], d = t[n + 1], m = he(s, c), p = he(d, s);
|
|
594
|
+
i = fe(m), o = fe(p);
|
|
595
595
|
const A = Math.acos(
|
|
596
596
|
(m.x * p.x + m.y * p.y) / (Math.hypot(m.x, m.y) * Math.hypot(p.x, p.y))
|
|
597
597
|
), U = Math.sin(A / 2);
|
|
598
|
-
U === 0 ? f = e : f = e / U,
|
|
598
|
+
U === 0 ? f = e : f = e / U, l = Cr(Rr(i, o));
|
|
599
599
|
}
|
|
600
|
-
r.push(
|
|
600
|
+
r.push(Yt(l, f));
|
|
601
601
|
}
|
|
602
602
|
return r;
|
|
603
|
-
},
|
|
603
|
+
}, ei = (t) => {
|
|
604
604
|
const e = v(t);
|
|
605
605
|
return { x: e.y, y: e.x };
|
|
606
606
|
}, bt = (t) => {
|
|
607
607
|
const e = v(t);
|
|
608
608
|
return { x: Math.round(e.x), y: Math.round(e.y) };
|
|
609
|
-
},
|
|
609
|
+
}, ti = (t) => {
|
|
610
610
|
const e = v(t);
|
|
611
611
|
return { x: 1 / e.x, y: 1 / e.y };
|
|
612
|
-
},
|
|
612
|
+
}, Nu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
613
613
|
__proto__: null,
|
|
614
|
-
INFINITY:
|
|
615
|
-
NAN:
|
|
616
|
-
ONE:
|
|
614
|
+
INFINITY: Fs,
|
|
615
|
+
NAN: Ys,
|
|
616
|
+
ONE: Ur,
|
|
617
617
|
ZERO: q,
|
|
618
|
-
average:
|
|
619
|
-
calculateMiters:
|
|
620
|
-
clientXY:
|
|
618
|
+
average: Rr,
|
|
619
|
+
calculateMiters: _s,
|
|
620
|
+
clientXY: $r,
|
|
621
621
|
construct: v,
|
|
622
|
-
couple:
|
|
622
|
+
couple: Ks,
|
|
623
623
|
crudeZ: mt,
|
|
624
|
-
css:
|
|
625
|
-
distance:
|
|
624
|
+
css: Qs,
|
|
625
|
+
distance: Gs,
|
|
626
626
|
equals: qe,
|
|
627
|
-
isFinite:
|
|
628
|
-
isNan:
|
|
629
|
-
isZero:
|
|
630
|
-
normal:
|
|
631
|
-
normalize:
|
|
632
|
-
reciprocal:
|
|
627
|
+
isFinite: Js,
|
|
628
|
+
isNan: Xs,
|
|
629
|
+
isZero: Ws,
|
|
630
|
+
normal: fe,
|
|
631
|
+
normalize: Cr,
|
|
632
|
+
reciprocal: ti,
|
|
633
633
|
round: bt,
|
|
634
|
-
scale:
|
|
635
|
-
set:
|
|
636
|
-
sub:
|
|
637
|
-
swap:
|
|
638
|
-
translate:
|
|
639
|
-
translateX:
|
|
640
|
-
translateY:
|
|
641
|
-
translation:
|
|
634
|
+
scale: Yt,
|
|
635
|
+
set: Vs,
|
|
636
|
+
sub: he,
|
|
637
|
+
swap: ei,
|
|
638
|
+
translate: $e,
|
|
639
|
+
translateX: Br,
|
|
640
|
+
translateY: jr,
|
|
641
|
+
translation: Hs,
|
|
642
642
|
truncate: yt,
|
|
643
|
-
xy:
|
|
644
|
-
}, Symbol.toStringTag, { value: "Module" })), Ne = a.union([a.number(), a.string()]),
|
|
643
|
+
xy: be
|
|
644
|
+
}, Symbol.toStringTag, { value: "Module" })), Ne = a.union([a.number(), a.string()]), ri = a.object({
|
|
645
645
|
top: Ne,
|
|
646
646
|
left: Ne,
|
|
647
647
|
width: Ne,
|
|
648
648
|
height: Ne
|
|
649
|
-
}),
|
|
649
|
+
}), ni = a.object({
|
|
650
650
|
left: a.number(),
|
|
651
651
|
top: a.number(),
|
|
652
652
|
right: a.number(),
|
|
653
653
|
bottom: a.number()
|
|
654
|
-
}),
|
|
655
|
-
one:
|
|
656
|
-
two:
|
|
657
|
-
root:
|
|
658
|
-
}),
|
|
654
|
+
}), si = a.object({
|
|
655
|
+
one: be,
|
|
656
|
+
two: be,
|
|
657
|
+
root: Ar
|
|
658
|
+
}), Lr = { one: q, two: q, root: xe }, ii = { one: q, two: Ur, root: Je }, Dr = (t, e) => ({
|
|
659
659
|
one: t.one,
|
|
660
660
|
two: t.two,
|
|
661
661
|
root: e ?? t.root
|
|
@@ -677,7 +677,7 @@ const es = a.union([Mt, jt, a.instanceof(String)]), oe = (t) => (e, r) => {
|
|
|
677
677
|
x: i.one.x + e.signedWidth,
|
|
678
678
|
y: i.one.y + e.signedHeight
|
|
679
679
|
} : i.two = e, i));
|
|
680
|
-
},
|
|
680
|
+
}, ai = (t, e, r) => {
|
|
681
681
|
const n = x(t);
|
|
682
682
|
if (typeof e == "string") {
|
|
683
683
|
if (r == null) throw new Error("Invalid arguments for resize");
|
|
@@ -691,22 +691,22 @@ const es = a.union([Mt, jt, a.instanceof(String)]), oe = (t) => (e, r) => {
|
|
|
691
691
|
);
|
|
692
692
|
}
|
|
693
693
|
return x(n.one, e, void 0, void 0, n.root);
|
|
694
|
-
},
|
|
694
|
+
}, oi = (t, e, r = !0) => {
|
|
695
695
|
const n = x(t);
|
|
696
696
|
let s = (i, o) => i < o;
|
|
697
697
|
return r && (s = (i, o) => i <= o), "one" in e ? s(V(n), V(e)) && s(_(e), _(n)) && s(G(n), G(e)) && s(ee(e), ee(n)) : s(V(n), e.x) && s(e.x, _(n)) && s(G(n), e.y) && s(e.y, ee(n));
|
|
698
|
-
},
|
|
698
|
+
}, ui = (t, e) => qe(t.one, e.one) && qe(t.two, e.two) && Ft(t.root, e.root), Pr = (t) => ({
|
|
699
699
|
width: X(t),
|
|
700
700
|
height: J(t)
|
|
701
|
-
}),
|
|
701
|
+
}), li = (t) => ({
|
|
702
702
|
signedWidth: Ke(t),
|
|
703
703
|
signedHeight: Qe(t)
|
|
704
|
-
}),
|
|
704
|
+
}), ci = (t) => ({
|
|
705
705
|
top: G(t),
|
|
706
706
|
left: V(t),
|
|
707
707
|
width: X(t),
|
|
708
708
|
height: J(t)
|
|
709
|
-
}),
|
|
709
|
+
}), Wt = (t, e, r = !1) => {
|
|
710
710
|
const n = z(e) === "y" ? Qe(t) : Ke(t);
|
|
711
711
|
return r ? n : Math.abs(n);
|
|
712
712
|
}, F = (t, e) => {
|
|
@@ -716,38 +716,38 @@ const es = a.union([Mt, jt, a.instanceof(String)]), oe = (t) => (e, r) => {
|
|
|
716
716
|
y: e.y === "center" ? wt(r).y : te(r, e.y)
|
|
717
717
|
};
|
|
718
718
|
}, te = (t, e) => {
|
|
719
|
-
const r = x(t), n =
|
|
719
|
+
const r = x(t), n = Er(r.root).includes(e) ? Math.min : Math.max;
|
|
720
720
|
return He.includes(e) ? n(r.one.x, r.two.x) : n(r.one.y, r.two.y);
|
|
721
|
-
},
|
|
721
|
+
}, hi = (t) => zr(t) === 0, X = (t) => Wt(t, "x"), J = (t) => Wt(t, "y"), Ke = (t) => {
|
|
722
722
|
const e = x(t);
|
|
723
723
|
return e.two.x - e.one.x;
|
|
724
724
|
}, Qe = (t) => {
|
|
725
725
|
const e = x(t);
|
|
726
726
|
return e.two.y - e.one.y;
|
|
727
|
-
},
|
|
727
|
+
}, kr = (t) => F(t, xe), fi = (t) => F(t, kt), di = (t) => F(t, Lt), gi = (t) => F(t, Je), pi = (t) => F(t, qt), mi = (t) => F(t, Dt), yi = (t) => F(t, Zt), bi = (t) => F(t, zt), _ = (t) => te(t, "right"), ee = (t) => te(t, "bottom"), V = (t) => te(t, "left"), G = (t) => te(t, "top"), wt = (t) => $e(kr(t), {
|
|
728
728
|
x: Ke(t) / 2,
|
|
729
729
|
y: Qe(t) / 2
|
|
730
|
-
}),
|
|
730
|
+
}), Vt = (t) => {
|
|
731
731
|
const e = x(t);
|
|
732
732
|
return e.root.x === "left" ? V(e) : _(e);
|
|
733
|
-
},
|
|
733
|
+
}, Gt = (t) => {
|
|
734
734
|
const e = x(t);
|
|
735
735
|
return e.root.y === "top" ? G(e) : ee(e);
|
|
736
|
-
},
|
|
736
|
+
}, wi = (t) => ({ x: Vt(t), y: Gt(t) }), Ce = (t) => {
|
|
737
737
|
const e = x(t);
|
|
738
738
|
return { lower: e.one.x, upper: e.two.x };
|
|
739
739
|
}, Re = (t) => {
|
|
740
740
|
const e = x(t);
|
|
741
741
|
return { lower: e.one.y, upper: e.two.y };
|
|
742
|
-
},
|
|
742
|
+
}, $i = (t, e) => Dr(t, e), Oi = (t, e) => {
|
|
743
743
|
const r = x(t), n = He.includes(e) ? "x" : Xe.includes(e) ? "y" : null;
|
|
744
744
|
if (n === null) throw new Error(`Invalid location: ${e}`);
|
|
745
745
|
const s = e === "top" || e === "left" ? Math.min : Math.max, i = { ...r.one }, o = { ...r.two };
|
|
746
746
|
return i[n] = s(r.one[n], r.two[n]), o[n] = s(r.one[n], r.two[n]), [i, o];
|
|
747
|
-
},
|
|
748
|
-
const r = x(t), n = x(e), s =
|
|
749
|
-
return x({ x: s, y: i },
|
|
750
|
-
},
|
|
747
|
+
}, vi = (t, e) => {
|
|
748
|
+
const r = x(t), n = x(e), s = Vt(n) + (X(n) - X(r)) / 2, i = Gt(n) + (J(n) - J(r)) / 2;
|
|
749
|
+
return x({ x: s, y: i }, Pr(r));
|
|
750
|
+
}, qr = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, Ti = (t) => X(t) / J(t), xi = (t, e, r) => {
|
|
751
751
|
if (typeof e == "string") {
|
|
752
752
|
if (r == null) throw new Error("Undefined amount passed into box.translate");
|
|
753
753
|
const s = z(e);
|
|
@@ -755,16 +755,16 @@ const es = a.union([Mt, jt, a.instanceof(String)]), oe = (t) => (e, r) => {
|
|
|
755
755
|
}
|
|
756
756
|
const n = x(t);
|
|
757
757
|
return x(
|
|
758
|
-
|
|
759
|
-
|
|
758
|
+
$e(n.one, e),
|
|
759
|
+
$e(n.two, e),
|
|
760
760
|
void 0,
|
|
761
761
|
void 0,
|
|
762
762
|
n.root
|
|
763
763
|
);
|
|
764
|
-
},
|
|
764
|
+
}, Si = (t, e) => {
|
|
765
765
|
const r = Math.max(V(t), V(e)), n = Math.max(G(t), G(e)), s = Math.min(_(t), _(e)), i = Math.min(ee(t), ee(e));
|
|
766
|
-
return r > s || n > i ?
|
|
767
|
-
},
|
|
766
|
+
return r > s || n > i ? Lr : x({ x: r, y: n }, { x: s, y: i }, void 0, void 0, t.root);
|
|
767
|
+
}, zr = (t) => X(t) * J(t), Ni = (t, e) => {
|
|
768
768
|
const r = x(t);
|
|
769
769
|
return x(
|
|
770
770
|
yt(r.one, e),
|
|
@@ -773,121 +773,121 @@ const es = a.union([Mt, jt, a.instanceof(String)]), oe = (t) => (e, r) => {
|
|
|
773
773
|
void 0,
|
|
774
774
|
r.root
|
|
775
775
|
);
|
|
776
|
-
},
|
|
777
|
-
const o = { x: t, y: e },
|
|
778
|
-
return s.x !== i.x && (s.x === "center" ? (o.x -= r / 2,
|
|
779
|
-
},
|
|
776
|
+
}, Ii = (t, e, r, n, s, i) => {
|
|
777
|
+
const o = { x: t, y: e }, l = { x: t + r, y: e + n };
|
|
778
|
+
return s.x !== i.x && (s.x === "center" ? (o.x -= r / 2, l.x -= r / 2) : (o.x -= r, l.x -= r)), s.y !== i.y && (s.y === "center" ? (o.y -= n / 2, l.y -= n / 2) : (o.y -= n, l.y -= n)), x(o, l, void 0, void 0, i);
|
|
779
|
+
}, Mi = (t) => {
|
|
780
780
|
const e = x(t);
|
|
781
781
|
return x(bt(e.one), bt(e.two), void 0, void 0, e.root);
|
|
782
|
-
},
|
|
782
|
+
}, Iu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
783
783
|
__proto__: null,
|
|
784
|
-
DECIMAL:
|
|
785
|
-
ZERO:
|
|
786
|
-
area:
|
|
787
|
-
areaIsZero:
|
|
788
|
-
aspect:
|
|
784
|
+
DECIMAL: ii,
|
|
785
|
+
ZERO: Lr,
|
|
786
|
+
area: zr,
|
|
787
|
+
areaIsZero: hi,
|
|
788
|
+
aspect: Ti,
|
|
789
789
|
bottom: ee,
|
|
790
|
-
bottomCenter:
|
|
791
|
-
bottomLeft:
|
|
792
|
-
bottomRight:
|
|
793
|
-
box:
|
|
790
|
+
bottomCenter: pi,
|
|
791
|
+
bottomLeft: gi,
|
|
792
|
+
bottomRight: mi,
|
|
793
|
+
box: si,
|
|
794
794
|
center: wt,
|
|
795
|
-
centerLeft:
|
|
796
|
-
centerRight:
|
|
795
|
+
centerLeft: yi,
|
|
796
|
+
centerRight: bi,
|
|
797
797
|
construct: x,
|
|
798
|
-
constructWithAlternateRoot:
|
|
799
|
-
contains:
|
|
800
|
-
copy:
|
|
801
|
-
css:
|
|
802
|
-
cssBox:
|
|
803
|
-
dim:
|
|
804
|
-
dims:
|
|
805
|
-
domRect:
|
|
806
|
-
edgePoints:
|
|
807
|
-
equals:
|
|
798
|
+
constructWithAlternateRoot: Ii,
|
|
799
|
+
contains: oi,
|
|
800
|
+
copy: Dr,
|
|
801
|
+
css: ci,
|
|
802
|
+
cssBox: ri,
|
|
803
|
+
dim: Wt,
|
|
804
|
+
dims: Pr,
|
|
805
|
+
domRect: ni,
|
|
806
|
+
edgePoints: Oi,
|
|
807
|
+
equals: ui,
|
|
808
808
|
height: J,
|
|
809
|
-
intersection:
|
|
810
|
-
isBox:
|
|
809
|
+
intersection: Si,
|
|
810
|
+
isBox: qr,
|
|
811
811
|
left: V,
|
|
812
812
|
loc: te,
|
|
813
|
-
positionInCenter:
|
|
814
|
-
reRoot:
|
|
815
|
-
resize:
|
|
813
|
+
positionInCenter: vi,
|
|
814
|
+
reRoot: $i,
|
|
815
|
+
resize: ai,
|
|
816
816
|
right: _,
|
|
817
|
-
root:
|
|
818
|
-
round:
|
|
819
|
-
signedDims:
|
|
817
|
+
root: wi,
|
|
818
|
+
round: Mi,
|
|
819
|
+
signedDims: li,
|
|
820
820
|
signedHeight: Qe,
|
|
821
821
|
signedWidth: Ke,
|
|
822
822
|
top: G,
|
|
823
|
-
topCenter:
|
|
824
|
-
topLeft:
|
|
825
|
-
topRight:
|
|
826
|
-
translate:
|
|
827
|
-
truncate:
|
|
823
|
+
topCenter: fi,
|
|
824
|
+
topLeft: kr,
|
|
825
|
+
topRight: di,
|
|
826
|
+
translate: xi,
|
|
827
|
+
truncate: Ni,
|
|
828
828
|
width: X,
|
|
829
|
-
x:
|
|
829
|
+
x: Vt,
|
|
830
830
|
xBounds: Ce,
|
|
831
831
|
xyLoc: F,
|
|
832
|
-
y:
|
|
832
|
+
y: Gt,
|
|
833
833
|
yBounds: Re
|
|
834
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
834
|
+
}, Symbol.toStringTag, { value: "Module" })), Zr = a.object({ signedWidth: a.number(), signedHeight: a.number() }), Ai = a.union([At, Zr, be, Ve]), Ei = { width: 0, height: 0 }, Ui = { width: 1, height: 1 }, D = (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 }, Bi = (t, e) => {
|
|
835
835
|
if (e == null) return !1;
|
|
836
836
|
const r = D(t), n = D(e);
|
|
837
837
|
return r.width === n.width && r.height === n.height;
|
|
838
|
-
},
|
|
838
|
+
}, ji = (t) => {
|
|
839
839
|
const e = D(t);
|
|
840
840
|
return { width: e.height, height: e.width };
|
|
841
|
-
},
|
|
841
|
+
}, Ci = (t) => {
|
|
842
842
|
const e = D(t);
|
|
843
843
|
return `0 0 ${e.width} ${e.height}`;
|
|
844
|
-
},
|
|
844
|
+
}, Ri = (t) => {
|
|
845
845
|
const e = D(t);
|
|
846
846
|
return [e.width, e.height];
|
|
847
|
-
},
|
|
847
|
+
}, Li = (t) => ({
|
|
848
848
|
width: Math.max(...t.map((e) => D(e).width)),
|
|
849
849
|
height: Math.max(...t.map((e) => D(e).height))
|
|
850
|
-
}),
|
|
850
|
+
}), Di = (t) => ({
|
|
851
851
|
width: Math.min(...t.map((e) => D(e).width)),
|
|
852
852
|
height: Math.min(...t.map((e) => D(e).height))
|
|
853
|
-
}),
|
|
853
|
+
}), Pi = (t, e) => {
|
|
854
854
|
const r = D(t);
|
|
855
855
|
return { width: r.width * e, height: r.height * e };
|
|
856
|
-
},
|
|
856
|
+
}, Mu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
857
857
|
__proto__: null,
|
|
858
|
-
DECIMAL:
|
|
859
|
-
ZERO:
|
|
858
|
+
DECIMAL: Ui,
|
|
859
|
+
ZERO: Ei,
|
|
860
860
|
construct: D,
|
|
861
|
-
couple:
|
|
862
|
-
crude:
|
|
863
|
-
dimensions:
|
|
864
|
-
equals:
|
|
865
|
-
max:
|
|
866
|
-
min:
|
|
867
|
-
scale:
|
|
868
|
-
signed:
|
|
869
|
-
svgViewBox:
|
|
870
|
-
swap:
|
|
871
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
861
|
+
couple: Ri,
|
|
862
|
+
crude: Ai,
|
|
863
|
+
dimensions: At,
|
|
864
|
+
equals: Bi,
|
|
865
|
+
max: Li,
|
|
866
|
+
min: Di,
|
|
867
|
+
scale: Pi,
|
|
868
|
+
signed: Zr,
|
|
869
|
+
svgViewBox: Ci,
|
|
870
|
+
swap: ji
|
|
871
|
+
}, Symbol.toStringTag, { value: "Module" })), ki = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r : t, qi = a.object({ offset: mt, scale: mt }), zi = a.object({ offset: a.number(), scale: a.number() }), Zi = (t) => (e, r, n, s) => r === "dimension" ? [e, n] : [
|
|
872
872
|
e,
|
|
873
873
|
s ? n - t : n + t
|
|
874
|
-
],
|
|
874
|
+
], Fi = (t) => (e, r, n, s) => [
|
|
875
875
|
e,
|
|
876
876
|
s ? n / t : n * t
|
|
877
|
-
],
|
|
877
|
+
], Yi = (t) => (e, r, n) => {
|
|
878
878
|
if (e === null) return [t, n];
|
|
879
|
-
const { lower: s, upper: i } = e, { lower: o, upper:
|
|
880
|
-
if (r === "dimension") return [t, n * (
|
|
881
|
-
const d = (n - s) * (
|
|
879
|
+
const { lower: s, upper: i } = e, { lower: o, upper: l } = t, f = i - s, c = l - o;
|
|
880
|
+
if (r === "dimension") return [t, n * (c / f)];
|
|
881
|
+
const d = (n - s) * (c / f) + o;
|
|
882
882
|
return [t, d];
|
|
883
|
-
},
|
|
883
|
+
}, Wi = (t) => (e, r, n) => [t, n], Vi = () => (t, e, r) => {
|
|
884
884
|
if (t === null) throw new Error("cannot invert without bounds");
|
|
885
885
|
if (e === "dimension") return [t, r];
|
|
886
886
|
const { lower: n, upper: s } = t;
|
|
887
887
|
return [t, s - (r - n)];
|
|
888
|
-
},
|
|
888
|
+
}, Gi = (t) => (e, r, n) => {
|
|
889
889
|
const { lower: s, upper: i } = t;
|
|
890
|
-
return n =
|
|
890
|
+
return n = ki(n, s, i), [e, n];
|
|
891
891
|
};
|
|
892
892
|
let $t = class se {
|
|
893
893
|
ops = [];
|
|
@@ -923,7 +923,7 @@ let $t = class se {
|
|
|
923
923
|
* @param value - The amount to translate by.
|
|
924
924
|
*/
|
|
925
925
|
translate(e) {
|
|
926
|
-
const r = this.new(), n =
|
|
926
|
+
const r = this.new(), n = Zi(e);
|
|
927
927
|
return n.type = "translate", r.ops.push(n), r;
|
|
928
928
|
}
|
|
929
929
|
/**
|
|
@@ -933,23 +933,23 @@ let $t = class se {
|
|
|
933
933
|
* @param value - The amount to magnify by.
|
|
934
934
|
*/
|
|
935
935
|
magnify(e) {
|
|
936
|
-
const r = this.new(), n =
|
|
936
|
+
const r = this.new(), n = Fi(e);
|
|
937
937
|
return n.type = "magnify", r.ops.push(n), r;
|
|
938
938
|
}
|
|
939
939
|
scale(e, r) {
|
|
940
|
-
const n = b(e, r), s = this.new(), i =
|
|
940
|
+
const n = b(e, r), s = this.new(), i = Yi(n);
|
|
941
941
|
return i.type = "scale", s.ops.push(i), s;
|
|
942
942
|
}
|
|
943
943
|
clamp(e, r) {
|
|
944
|
-
const n = b(e, r), s = this.new(), i =
|
|
944
|
+
const n = b(e, r), s = this.new(), i = Gi(n);
|
|
945
945
|
return i.type = "clamp", s.ops.push(i), s;
|
|
946
946
|
}
|
|
947
947
|
reBound(e, r) {
|
|
948
|
-
const n = b(e, r), s = this.new(), i =
|
|
948
|
+
const n = b(e, r), s = this.new(), i = Wi(n);
|
|
949
949
|
return i.type = "re-bound", s.ops.push(i), s;
|
|
950
950
|
}
|
|
951
951
|
invert() {
|
|
952
|
-
const e =
|
|
952
|
+
const e = Vi();
|
|
953
953
|
e.type = "invert";
|
|
954
954
|
const r = this.new();
|
|
955
955
|
return r.ops.push(e), r;
|
|
@@ -975,9 +975,9 @@ let $t = class se {
|
|
|
975
975
|
e.ops.reverse();
|
|
976
976
|
const r = [];
|
|
977
977
|
return e.ops.forEach((n, s) => {
|
|
978
|
-
if (n.type === "scale" || r.some(([o,
|
|
978
|
+
if (n.type === "scale" || r.some(([o, l]) => s >= o && s <= l))
|
|
979
979
|
return;
|
|
980
|
-
const i = e.ops.findIndex((o,
|
|
980
|
+
const i = e.ops.findIndex((o, l) => o.type === "scale" && l > s);
|
|
981
981
|
i !== -1 && r.push([s, i]);
|
|
982
982
|
}), r.forEach(([n, s]) => {
|
|
983
983
|
const i = e.ops.slice(n, s);
|
|
@@ -988,7 +988,7 @@ let $t = class se {
|
|
|
988
988
|
return { scale: this.dim(1), offset: this.pos(0) };
|
|
989
989
|
}
|
|
990
990
|
static IDENTITY = new se();
|
|
991
|
-
},
|
|
991
|
+
}, Hi = class P {
|
|
992
992
|
x;
|
|
993
993
|
y;
|
|
994
994
|
currRoot;
|
|
@@ -1034,9 +1034,9 @@ let $t = class se {
|
|
|
1034
1034
|
}
|
|
1035
1035
|
scale(e) {
|
|
1036
1036
|
const r = this.copy();
|
|
1037
|
-
if (
|
|
1037
|
+
if (qr(e)) {
|
|
1038
1038
|
const n = this.currRoot;
|
|
1039
|
-
return r.currRoot = e.root, n != null && !
|
|
1039
|
+
return r.currRoot = e.root, n != null && !Ft(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(Ce(e)), r.y = r.y.scale(Re(e)), r;
|
|
1040
1040
|
}
|
|
1041
1041
|
return r.x = r.x.scale(e.width), r.y = r.y.scale(e.height), r;
|
|
1042
1042
|
}
|
|
@@ -1079,43 +1079,43 @@ let $t = class se {
|
|
|
1079
1079
|
}
|
|
1080
1080
|
static IDENTITY = new P();
|
|
1081
1081
|
};
|
|
1082
|
-
const
|
|
1082
|
+
const Au = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1083
1083
|
__proto__: null,
|
|
1084
1084
|
Scale: $t,
|
|
1085
|
-
XY:
|
|
1086
|
-
crudeXYTransform:
|
|
1087
|
-
transform:
|
|
1085
|
+
XY: Hi,
|
|
1086
|
+
crudeXYTransform: qi,
|
|
1087
|
+
transform: zi
|
|
1088
1088
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1089
|
-
let
|
|
1089
|
+
let Fr = (t, e = 21) => (r = e) => {
|
|
1090
1090
|
let n = "", s = r | 0;
|
|
1091
1091
|
for (; s--; )
|
|
1092
1092
|
n += t[Math.random() * t.length | 0];
|
|
1093
1093
|
return n;
|
|
1094
1094
|
};
|
|
1095
|
-
const
|
|
1095
|
+
const Yr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", Xi = `0123456789${Yr}`, Wr = 11, Ji = Fr(Yr, 1), Ki = Fr(Xi, Wr - 1), Ht = () => `${Ji()}${Ki()}`, Eu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1096
1096
|
__proto__: null,
|
|
1097
|
-
LENGTH:
|
|
1098
|
-
create:
|
|
1099
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1097
|
+
LENGTH: Wr,
|
|
1098
|
+
create: Ht
|
|
1099
|
+
}, Symbol.toStringTag, { value: "Module" })), Qi = (t, e) => (r) => r instanceof e || typeof r == "object" && r !== null && "discriminator" in r && r.discriminator === t, _i = 2 ** 8 - 1, ea = 2 ** 16 - 1, ta = 2 ** 32 - 1, ra = 2n ** 64n - 1n, na = 2 ** 64 - 1, sa = -128, ia = 2 ** 7 - 1, aa = -32768, oa = 2 ** 15 - 1, ua = -2147483648, la = 2 ** 31 - 1, ca = -(2n ** 63n), ze = 2n ** 63n - 1n, ha = -9223372036854776e3, Vr = 2 ** 63 - 1, fa = a.enum(["static", "dynamic"]), tr = 365, Ie = 30, da = a.union([
|
|
1100
1100
|
a.tuple([a.int()]),
|
|
1101
1101
|
a.tuple([a.int(), a.int().min(1).max(12)]),
|
|
1102
1102
|
a.tuple([a.int(), a.int().min(1).max(12), a.int().min(1).max(31)])
|
|
1103
|
-
]),
|
|
1103
|
+
]), Gr = (t, e) => {
|
|
1104
1104
|
const r = new $(e);
|
|
1105
1105
|
if (![
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1106
|
+
h.DAY,
|
|
1107
|
+
h.HOUR,
|
|
1108
|
+
h.MINUTE,
|
|
1109
|
+
h.SECOND,
|
|
1110
|
+
h.MILLISECOND,
|
|
1111
|
+
h.MICROSECOND,
|
|
1112
|
+
h.NANOSECOND
|
|
1113
1113
|
].some((s) => s.equals(r)))
|
|
1114
1114
|
throw new Error(
|
|
1115
1115
|
"Invalid argument for remainder. Must be an even TimeSpan or Timestamp"
|
|
1116
1116
|
);
|
|
1117
1117
|
const n = t.valueOf() % r.valueOf();
|
|
1118
|
-
return t instanceof $ ? new $(n) : new
|
|
1118
|
+
return t instanceof $ ? new $(n) : new h(n);
|
|
1119
1119
|
};
|
|
1120
1120
|
let $ = class g extends re {
|
|
1121
1121
|
constructor(e, r = "UTC") {
|
|
@@ -1127,7 +1127,7 @@ let $ = class g extends re {
|
|
|
1127
1127
|
else if (Array.isArray(e)) super(g.parseDate(e));
|
|
1128
1128
|
else {
|
|
1129
1129
|
let n = 0n;
|
|
1130
|
-
e instanceof Number && (e = e.valueOf()), r === "local" && (n = g.utcOffset.valueOf()), typeof e == "number" && (isFinite(e) ? e ===
|
|
1130
|
+
e instanceof Number && (e = e.valueOf()), r === "local" && (n = g.utcOffset.valueOf()), typeof e == "number" && (isFinite(e) ? e === Vr ? e = ze : e = Math.trunc(e) : (isNaN(e) && (e = 0), e === 1 / 0 ? e = g.MAX : e = g.MIN)), B(e) && (e = e.value), super(BigInt(e.valueOf()) + n);
|
|
1131
1131
|
}
|
|
1132
1132
|
}
|
|
1133
1133
|
static parseDate([e = 1970, r = 1, n = 1]) {
|
|
@@ -1143,9 +1143,9 @@ let $ = class g extends re {
|
|
|
1143
1143
|
}
|
|
1144
1144
|
static parseTimeString(e, r = "UTC") {
|
|
1145
1145
|
const [n, s, i] = e.split(":");
|
|
1146
|
-
let o = "00",
|
|
1147
|
-
i != null && ([o,
|
|
1148
|
-
let f = g.hours(parseInt(n ?? "00")).add(g.minutes(parseInt(s ?? "00"))).add(g.seconds(parseInt(o ?? "00"))).add(g.milliseconds(parseInt(
|
|
1146
|
+
let o = "00", l = "00";
|
|
1147
|
+
i != null && ([o, l] = i.split("."));
|
|
1148
|
+
let f = g.hours(parseInt(n ?? "00")).add(g.minutes(parseInt(s ?? "00"))).add(g.seconds(parseInt(o ?? "00"))).add(g.milliseconds(parseInt(l ?? "00")));
|
|
1149
1149
|
return r === "local" && (f = f.add(g.utcOffset)), f.valueOf();
|
|
1150
1150
|
}
|
|
1151
1151
|
static parseDateTimeString(e, r = "UTC") {
|
|
@@ -1170,7 +1170,7 @@ let $ = class g extends re {
|
|
|
1170
1170
|
}
|
|
1171
1171
|
/** @returns The UTC offset for the time zone of the machine. */
|
|
1172
1172
|
static get utcOffset() {
|
|
1173
|
-
return new
|
|
1173
|
+
return new h(
|
|
1174
1174
|
BigInt((/* @__PURE__ */ new Date()).getTimezoneOffset()) * g.MINUTE.valueOf()
|
|
1175
1175
|
);
|
|
1176
1176
|
}
|
|
@@ -1282,7 +1282,7 @@ let $ = class g extends re {
|
|
|
1282
1282
|
* TimeSpan.
|
|
1283
1283
|
*/
|
|
1284
1284
|
add(e) {
|
|
1285
|
-
return new g(ue(this.valueOf(), new
|
|
1285
|
+
return new g(ue(this.valueOf(), new h(e).valueOf()));
|
|
1286
1286
|
}
|
|
1287
1287
|
/**
|
|
1288
1288
|
* Subtracts a TimeSpan from the TimeStamp.
|
|
@@ -1292,35 +1292,35 @@ let $ = class g extends re {
|
|
|
1292
1292
|
* TimeSpan.
|
|
1293
1293
|
*/
|
|
1294
1294
|
sub(e) {
|
|
1295
|
-
return new g(Z(this.valueOf(), new
|
|
1295
|
+
return new g(Z(this.valueOf(), new h(e).valueOf()));
|
|
1296
1296
|
}
|
|
1297
1297
|
/**
|
|
1298
1298
|
* @returns the floating point number of hours since the unix epoch to the timestamp
|
|
1299
1299
|
* value.
|
|
1300
1300
|
*/
|
|
1301
1301
|
get hours() {
|
|
1302
|
-
return Number(this.valueOf()) / Number(
|
|
1302
|
+
return Number(this.valueOf()) / Number(h.HOUR.valueOf());
|
|
1303
1303
|
}
|
|
1304
1304
|
/**
|
|
1305
1305
|
* @returns the floating point number of minutes since the unix epoch to the timestamp
|
|
1306
1306
|
* value.
|
|
1307
1307
|
*/
|
|
1308
1308
|
get minutes() {
|
|
1309
|
-
return Number(this.valueOf()) / Number(
|
|
1309
|
+
return Number(this.valueOf()) / Number(h.MINUTE.valueOf());
|
|
1310
1310
|
}
|
|
1311
1311
|
/**
|
|
1312
1312
|
* @returns the floating point number of days since the unix epoch to the timestamp
|
|
1313
1313
|
* value.
|
|
1314
1314
|
*/
|
|
1315
1315
|
get days() {
|
|
1316
|
-
return Number(this.valueOf()) / Number(
|
|
1316
|
+
return Number(this.valueOf()) / Number(h.DAY.valueOf());
|
|
1317
1317
|
}
|
|
1318
1318
|
/**
|
|
1319
1319
|
* @returns the floating point number of seconds since the unix epoch to the timestamp
|
|
1320
1320
|
* value.
|
|
1321
1321
|
*/
|
|
1322
1322
|
get seconds() {
|
|
1323
|
-
return Number(this.valueOf()) / Number(
|
|
1323
|
+
return Number(this.valueOf()) / Number(h.SECOND.valueOf());
|
|
1324
1324
|
}
|
|
1325
1325
|
/** @returns the floating point number of milliseconds since the unix epoch. */
|
|
1326
1326
|
get milliseconds() {
|
|
@@ -1483,11 +1483,11 @@ let $ = class g extends re {
|
|
|
1483
1483
|
* @example TimeStamp.now().remainder(TimeStamp.DAY) // => TimeStamp representing the current day
|
|
1484
1484
|
*/
|
|
1485
1485
|
remainder(e) {
|
|
1486
|
-
return
|
|
1486
|
+
return Gr(this, e);
|
|
1487
1487
|
}
|
|
1488
1488
|
/** @returns true if the day portion TimeStamp is today, false otherwise. */
|
|
1489
1489
|
get isToday() {
|
|
1490
|
-
return this.truncate(
|
|
1490
|
+
return this.truncate(h.DAY).equals(g.now().truncate(h.DAY));
|
|
1491
1491
|
}
|
|
1492
1492
|
/**
|
|
1493
1493
|
* Truncates the TimeStamp to the nearest multiple of the given span.
|
|
@@ -1595,8 +1595,8 @@ let $ = class g extends re {
|
|
|
1595
1595
|
a.number().transform((e) => new g(e)),
|
|
1596
1596
|
a.bigint().transform((e) => new g(e)),
|
|
1597
1597
|
a.date().transform((e) => new g(e)),
|
|
1598
|
-
a.custom((e) => e instanceof
|
|
1599
|
-
|
|
1598
|
+
a.custom((e) => e instanceof h).transform((e) => new g(e)),
|
|
1599
|
+
da.transform((e) => new g(e))
|
|
1600
1600
|
]);
|
|
1601
1601
|
/**
|
|
1602
1602
|
* Sorts two timestamps.
|
|
@@ -1610,7 +1610,7 @@ let $ = class g extends re {
|
|
|
1610
1610
|
return Number(e.valueOf() - r.valueOf());
|
|
1611
1611
|
}
|
|
1612
1612
|
};
|
|
1613
|
-
class
|
|
1613
|
+
class h extends re {
|
|
1614
1614
|
constructor(e) {
|
|
1615
1615
|
typeof e == "number" && (e = Math.trunc(e.valueOf())), B(e) && (e = e.value), super(BigInt(e.valueOf()));
|
|
1616
1616
|
}
|
|
@@ -1621,7 +1621,7 @@ class c extends re {
|
|
|
1621
1621
|
* @returns A TimeSpan representing the given number of seconds.
|
|
1622
1622
|
*/
|
|
1623
1623
|
static fromSeconds(e) {
|
|
1624
|
-
return e instanceof
|
|
1624
|
+
return e instanceof h ? e : e instanceof st ? e.period : e instanceof $ ? new h(e) : (B(e) && (e = e.value), ["number", "bigint"].includes(typeof e) ? h.seconds(e) : new h(e));
|
|
1625
1625
|
}
|
|
1626
1626
|
/**
|
|
1627
1627
|
* Creates a TimeSpan representing the given number of milliseconds.
|
|
@@ -1630,7 +1630,7 @@ class c extends re {
|
|
|
1630
1630
|
* @returns A TimeSpan representing the given number of milliseconds.
|
|
1631
1631
|
*/
|
|
1632
1632
|
static fromMilliseconds(e) {
|
|
1633
|
-
return e instanceof
|
|
1633
|
+
return e instanceof h ? e : e instanceof st ? e.period : e instanceof $ ? new h(e) : (B(e) && (e = e.value), ["number", "bigint"].includes(typeof e) ? h.milliseconds(e) : new h(e));
|
|
1634
1634
|
}
|
|
1635
1635
|
/**
|
|
1636
1636
|
* @returns the primitive value of the TimeSpan. Overrides standard JS valueOf()
|
|
@@ -1646,7 +1646,7 @@ class c extends re {
|
|
|
1646
1646
|
* @returns True if the TimeSpan is less than the other TimeSpan, false otherwise.
|
|
1647
1647
|
*/
|
|
1648
1648
|
lessThan(e) {
|
|
1649
|
-
return this.valueOf() < new
|
|
1649
|
+
return this.valueOf() < new h(e).valueOf();
|
|
1650
1650
|
}
|
|
1651
1651
|
/**
|
|
1652
1652
|
* Checks if the TimeSpan is greater than another TimeSpan.
|
|
@@ -1655,7 +1655,7 @@ class c extends re {
|
|
|
1655
1655
|
* @returns True if the TimeSpan is greater than the other TimeSpan, false otherwise.
|
|
1656
1656
|
*/
|
|
1657
1657
|
greaterThan(e) {
|
|
1658
|
-
return this.valueOf() > new
|
|
1658
|
+
return this.valueOf() > new h(e).valueOf();
|
|
1659
1659
|
}
|
|
1660
1660
|
/**
|
|
1661
1661
|
* Checks if the TimeSpan is less than or equal to another TimeSpan.
|
|
@@ -1664,7 +1664,7 @@ class c extends re {
|
|
|
1664
1664
|
* @returns True if the TimeSpan is less than or equal to the other TimeSpan, false otherwise.
|
|
1665
1665
|
*/
|
|
1666
1666
|
lessThanOrEqual(e) {
|
|
1667
|
-
return this.valueOf() <= new
|
|
1667
|
+
return this.valueOf() <= new h(e).valueOf();
|
|
1668
1668
|
}
|
|
1669
1669
|
/**
|
|
1670
1670
|
* Checks if the TimeSpan is greater than or equal to another TimeSpan.
|
|
@@ -1673,7 +1673,7 @@ class c extends re {
|
|
|
1673
1673
|
* @returns True if the TimeSpan is greater than or equal to the other TimeSpan, false otherwise.
|
|
1674
1674
|
*/
|
|
1675
1675
|
greaterThanOrEqual(e) {
|
|
1676
|
-
return this.valueOf() >= new
|
|
1676
|
+
return this.valueOf() >= new h(e).valueOf();
|
|
1677
1677
|
}
|
|
1678
1678
|
/**
|
|
1679
1679
|
* Calculates the remainder of the TimeSpan when divided by another TimeSpan.
|
|
@@ -1682,7 +1682,7 @@ class c extends re {
|
|
|
1682
1682
|
* @returns A new TimeSpan representing the remainder.
|
|
1683
1683
|
*/
|
|
1684
1684
|
remainder(e) {
|
|
1685
|
-
return
|
|
1685
|
+
return Gr(this, e);
|
|
1686
1686
|
}
|
|
1687
1687
|
/**
|
|
1688
1688
|
* Truncates the TimeSpan to the nearest multiple of the given span.
|
|
@@ -1691,7 +1691,7 @@ class c extends re {
|
|
|
1691
1691
|
* @returns A new TimeSpan that is truncated to the nearest multiple of the given span.
|
|
1692
1692
|
*/
|
|
1693
1693
|
truncate(e) {
|
|
1694
|
-
return new
|
|
1694
|
+
return new h(
|
|
1695
1695
|
BigInt(Math.trunc(Number(this.valueOf() / e.valueOf()))) * e.valueOf()
|
|
1696
1696
|
);
|
|
1697
1697
|
}
|
|
@@ -1705,20 +1705,20 @@ class c extends re {
|
|
|
1705
1705
|
*/
|
|
1706
1706
|
toString(e = "full") {
|
|
1707
1707
|
if (e === "semantic") return this.toSemanticString();
|
|
1708
|
-
const r = this.truncate(
|
|
1708
|
+
const r = this.truncate(h.DAY), n = this.truncate(h.HOUR), s = this.truncate(h.MINUTE), i = this.truncate(h.SECOND), o = this.truncate(h.MILLISECOND), l = this.truncate(h.MICROSECOND), f = this.truncate(h.NANOSECOND), c = r, d = n.sub(r), m = s.sub(n), p = i.sub(s), A = o.sub(i), U = l.sub(o), C = f.sub(l);
|
|
1709
1709
|
let w = "";
|
|
1710
|
-
return
|
|
1710
|
+
return c.isZero || (w += `${c.days}d `), d.isZero || (w += `${d.hours}h `), m.isZero || (w += `${m.minutes}m `), p.isZero || (w += `${p.seconds}s `), A.isZero || (w += `${A.milliseconds}ms `), U.isZero || (w += `${U.microseconds}µs `), C.isZero || (w += `${C.nanoseconds}ns`), w.trim();
|
|
1711
1711
|
}
|
|
1712
1712
|
toSemanticString() {
|
|
1713
|
-
const e = this.valueOf() < 0n ? -this.valueOf() : this.valueOf(), r = new
|
|
1713
|
+
const e = this.valueOf() < 0n ? -this.valueOf() : this.valueOf(), r = new h(e), n = this.valueOf() < 0n;
|
|
1714
1714
|
if (r.valueOf() === 0n) return "0s";
|
|
1715
|
-
if (r.lessThan(
|
|
1716
|
-
const s = r.days, i = r.hours, o = r.minutes,
|
|
1715
|
+
if (r.lessThan(h.SECOND)) return "< 1s";
|
|
1716
|
+
const s = r.days, i = r.hours, o = r.minutes, l = r.seconds, f = Math.floor(s / tr), c = Math.floor(s / Ie), d = Math.floor(s / 7), m = Math.floor(s), p = Math.floor(i), A = Math.floor(o), U = Math.floor(l), C = n ? "-" : "";
|
|
1717
1717
|
if (f >= 1) {
|
|
1718
1718
|
let w = `${f}y`;
|
|
1719
1719
|
if (f < 2) {
|
|
1720
1720
|
const N = Math.floor(
|
|
1721
|
-
s %
|
|
1721
|
+
s % tr / Ie
|
|
1722
1722
|
);
|
|
1723
1723
|
N > 0 && (w += ` ${N}mo`);
|
|
1724
1724
|
}
|
|
@@ -1729,9 +1729,9 @@ class c extends re {
|
|
|
1729
1729
|
const N = Math.floor(s % 7), K = Math.floor(i - d * 7 * 24);
|
|
1730
1730
|
return d < 2 && (N > 0 ? w += ` ${N}d` : K > 0 && K < 24 && (w += ` ${K}h`)), C + w;
|
|
1731
1731
|
}
|
|
1732
|
-
if (
|
|
1733
|
-
let w = `${
|
|
1734
|
-
if (
|
|
1732
|
+
if (c >= 1) {
|
|
1733
|
+
let w = `${c}mo`;
|
|
1734
|
+
if (c < 3) {
|
|
1735
1735
|
const N = Math.floor(s % Ie);
|
|
1736
1736
|
N > 0 && (w += ` ${N}d`);
|
|
1737
1737
|
}
|
|
@@ -1758,7 +1758,7 @@ class c extends re {
|
|
|
1758
1758
|
if (A >= 1) {
|
|
1759
1759
|
let w = `${A}m`;
|
|
1760
1760
|
if (A < 5) {
|
|
1761
|
-
const N = Math.floor(
|
|
1761
|
+
const N = Math.floor(l - A * 60);
|
|
1762
1762
|
N > 0 && (w += ` ${N}s`);
|
|
1763
1763
|
}
|
|
1764
1764
|
return C + w;
|
|
@@ -1772,7 +1772,7 @@ class c extends re {
|
|
|
1772
1772
|
* @returns A new TimeSpan that is this TimeSpan multiplied by the provided value.
|
|
1773
1773
|
*/
|
|
1774
1774
|
mult(e) {
|
|
1775
|
-
return new
|
|
1775
|
+
return new h(R(this.valueOf(), e));
|
|
1776
1776
|
}
|
|
1777
1777
|
/**
|
|
1778
1778
|
* Divides the TimeSpan by a scalar value.
|
|
@@ -1781,31 +1781,31 @@ class c extends re {
|
|
|
1781
1781
|
* @returns A new TimeSpan that is this TimeSpan divided by the provided value.
|
|
1782
1782
|
*/
|
|
1783
1783
|
div(e) {
|
|
1784
|
-
return new
|
|
1784
|
+
return new h(Te(this.valueOf(), e));
|
|
1785
1785
|
}
|
|
1786
1786
|
/** @returns the decimal number of days in the TimeSpan. */
|
|
1787
1787
|
get days() {
|
|
1788
|
-
return Number(this.valueOf()) / Number(
|
|
1788
|
+
return Number(this.valueOf()) / Number(h.DAY.valueOf());
|
|
1789
1789
|
}
|
|
1790
1790
|
/** @returns the decimal number of hours in the TimeSpan. */
|
|
1791
1791
|
get hours() {
|
|
1792
|
-
return Number(this.valueOf()) / Number(
|
|
1792
|
+
return Number(this.valueOf()) / Number(h.HOUR.valueOf());
|
|
1793
1793
|
}
|
|
1794
1794
|
/** @returns the decimal number of minutes in the TimeSpan. */
|
|
1795
1795
|
get minutes() {
|
|
1796
|
-
return Number(this.valueOf()) / Number(
|
|
1796
|
+
return Number(this.valueOf()) / Number(h.MINUTE.valueOf());
|
|
1797
1797
|
}
|
|
1798
1798
|
/** @returns The number of seconds in the TimeSpan. */
|
|
1799
1799
|
get seconds() {
|
|
1800
|
-
return Number(this.valueOf()) / Number(
|
|
1800
|
+
return Number(this.valueOf()) / Number(h.SECOND.valueOf());
|
|
1801
1801
|
}
|
|
1802
1802
|
/** @returns The number of milliseconds in the TimeSpan. */
|
|
1803
1803
|
get milliseconds() {
|
|
1804
|
-
return Number(this.valueOf()) / Number(
|
|
1804
|
+
return Number(this.valueOf()) / Number(h.MILLISECOND.valueOf());
|
|
1805
1805
|
}
|
|
1806
1806
|
/** @returns The number of microseconds in the TimeSpan. */
|
|
1807
1807
|
get microseconds() {
|
|
1808
|
-
return Number(this.valueOf()) / Number(
|
|
1808
|
+
return Number(this.valueOf()) / Number(h.MICROSECOND.valueOf());
|
|
1809
1809
|
}
|
|
1810
1810
|
/** @returns The number of nanoseconds in the TimeSpan. */
|
|
1811
1811
|
get nanoseconds() {
|
|
@@ -1825,7 +1825,7 @@ class c extends re {
|
|
|
1825
1825
|
* @returns True if the TimeSpans are equal, false otherwise.
|
|
1826
1826
|
*/
|
|
1827
1827
|
equals(e) {
|
|
1828
|
-
return this.valueOf() === new
|
|
1828
|
+
return this.valueOf() === new h(e).valueOf();
|
|
1829
1829
|
}
|
|
1830
1830
|
/**
|
|
1831
1831
|
* Adds a TimeSpan to the TimeSpan.
|
|
@@ -1833,7 +1833,7 @@ class c extends re {
|
|
|
1833
1833
|
* @returns A new TimeSpan representing the sum of the two TimeSpans.
|
|
1834
1834
|
*/
|
|
1835
1835
|
add(e) {
|
|
1836
|
-
return new
|
|
1836
|
+
return new h(this.valueOf() + new h(e).valueOf());
|
|
1837
1837
|
}
|
|
1838
1838
|
/**
|
|
1839
1839
|
* Creates a TimeSpan representing the duration between the two timestamps.
|
|
@@ -1841,7 +1841,7 @@ class c extends re {
|
|
|
1841
1841
|
* @param other
|
|
1842
1842
|
*/
|
|
1843
1843
|
sub(e) {
|
|
1844
|
-
return new
|
|
1844
|
+
return new h(this.valueOf() - new h(e).valueOf());
|
|
1845
1845
|
}
|
|
1846
1846
|
/**
|
|
1847
1847
|
* Creates a TimeSpan representing the given number of nanoseconds.
|
|
@@ -1850,10 +1850,10 @@ class c extends re {
|
|
|
1850
1850
|
* @returns A TimeSpan representing the given number of nanoseconds.
|
|
1851
1851
|
*/
|
|
1852
1852
|
static nanoseconds(e = 1) {
|
|
1853
|
-
return new
|
|
1853
|
+
return new h(e);
|
|
1854
1854
|
}
|
|
1855
1855
|
/** A nanosecond. */
|
|
1856
|
-
static NANOSECOND =
|
|
1856
|
+
static NANOSECOND = h.nanoseconds(1);
|
|
1857
1857
|
/**
|
|
1858
1858
|
* Creates a TimeSpan representing the given number of microseconds.
|
|
1859
1859
|
*
|
|
@@ -1861,10 +1861,10 @@ class c extends re {
|
|
|
1861
1861
|
* @returns A TimeSpan representing the given number of microseconds.
|
|
1862
1862
|
*/
|
|
1863
1863
|
static microseconds(e = 1) {
|
|
1864
|
-
return
|
|
1864
|
+
return h.nanoseconds(R(e, 1e3));
|
|
1865
1865
|
}
|
|
1866
1866
|
/** A microsecond. */
|
|
1867
|
-
static MICROSECOND =
|
|
1867
|
+
static MICROSECOND = h.microseconds(1);
|
|
1868
1868
|
/**
|
|
1869
1869
|
* Creates a TimeSpan representing the given number of milliseconds.
|
|
1870
1870
|
*
|
|
@@ -1872,10 +1872,10 @@ class c extends re {
|
|
|
1872
1872
|
* @returns A TimeSpan representing the given number of milliseconds.
|
|
1873
1873
|
*/
|
|
1874
1874
|
static milliseconds(e = 1) {
|
|
1875
|
-
return
|
|
1875
|
+
return h.microseconds(R(e, 1e3));
|
|
1876
1876
|
}
|
|
1877
1877
|
/** A millisecond. */
|
|
1878
|
-
static MILLISECOND =
|
|
1878
|
+
static MILLISECOND = h.milliseconds(1);
|
|
1879
1879
|
/**
|
|
1880
1880
|
* Creates a TimeSpan representing the given number of seconds.
|
|
1881
1881
|
*
|
|
@@ -1883,10 +1883,10 @@ class c extends re {
|
|
|
1883
1883
|
* @returns A TimeSpan representing the given number of seconds.
|
|
1884
1884
|
*/
|
|
1885
1885
|
static seconds(e = 1) {
|
|
1886
|
-
return
|
|
1886
|
+
return h.milliseconds(R(e, 1e3));
|
|
1887
1887
|
}
|
|
1888
1888
|
/** A second. */
|
|
1889
|
-
static SECOND =
|
|
1889
|
+
static SECOND = h.seconds(1);
|
|
1890
1890
|
/**
|
|
1891
1891
|
* Creates a TimeSpan representing the given number of minutes.
|
|
1892
1892
|
*
|
|
@@ -1894,10 +1894,10 @@ class c extends re {
|
|
|
1894
1894
|
* @returns A TimeSpan representing the given number of minutes.
|
|
1895
1895
|
*/
|
|
1896
1896
|
static minutes(e = 1) {
|
|
1897
|
-
return
|
|
1897
|
+
return h.seconds(R(e, 60));
|
|
1898
1898
|
}
|
|
1899
1899
|
/** A minute. */
|
|
1900
|
-
static MINUTE =
|
|
1900
|
+
static MINUTE = h.minutes(1);
|
|
1901
1901
|
/**
|
|
1902
1902
|
* Creates a TimeSpan representing the given number of hours.
|
|
1903
1903
|
*
|
|
@@ -1905,10 +1905,10 @@ class c extends re {
|
|
|
1905
1905
|
* @returns A TimeSpan representing the given number of hours.
|
|
1906
1906
|
*/
|
|
1907
1907
|
static hours(e) {
|
|
1908
|
-
return
|
|
1908
|
+
return h.minutes(R(e, 60));
|
|
1909
1909
|
}
|
|
1910
1910
|
/** Represents an hour. */
|
|
1911
|
-
static HOUR =
|
|
1911
|
+
static HOUR = h.hours(1);
|
|
1912
1912
|
/**
|
|
1913
1913
|
* Creates a TimeSpan representing the given number of days.
|
|
1914
1914
|
*
|
|
@@ -1916,25 +1916,25 @@ class c extends re {
|
|
|
1916
1916
|
* @returns A TimeSpan representing the given number of days.
|
|
1917
1917
|
*/
|
|
1918
1918
|
static days(e) {
|
|
1919
|
-
return
|
|
1919
|
+
return h.hours(R(e, 24));
|
|
1920
1920
|
}
|
|
1921
1921
|
/** Represents a day. */
|
|
1922
|
-
static DAY =
|
|
1922
|
+
static DAY = h.days(1);
|
|
1923
1923
|
/** The maximum possible value for a TimeSpan. */
|
|
1924
|
-
static MAX = new
|
|
1924
|
+
static MAX = new h(ze);
|
|
1925
1925
|
/** The minimum possible value for a TimeSpan. */
|
|
1926
|
-
static MIN = new
|
|
1926
|
+
static MIN = new h(0);
|
|
1927
1927
|
/** The zero value for a TimeSpan. */
|
|
1928
|
-
static ZERO = new
|
|
1928
|
+
static ZERO = new h(0);
|
|
1929
1929
|
/** A zod schema for validating and transforming time spans */
|
|
1930
1930
|
static z = a.union([
|
|
1931
|
-
a.object({ value: a.bigint() }).transform((e) => new
|
|
1932
|
-
a.string().transform((e) => new
|
|
1933
|
-
a.number().transform((e) => new
|
|
1934
|
-
a.bigint().transform((e) => new
|
|
1935
|
-
a.instanceof(
|
|
1936
|
-
a.instanceof($).transform((e) => new
|
|
1937
|
-
a.custom((e) => e instanceof st).transform((e) => new
|
|
1931
|
+
a.object({ value: a.bigint() }).transform((e) => new h(e.value)),
|
|
1932
|
+
a.string().transform((e) => new h(BigInt(e))),
|
|
1933
|
+
a.number().transform((e) => new h(e)),
|
|
1934
|
+
a.bigint().transform((e) => new h(e)),
|
|
1935
|
+
a.instanceof(h),
|
|
1936
|
+
a.instanceof($).transform((e) => new h(e)),
|
|
1937
|
+
a.custom((e) => e instanceof st).transform((e) => new h(e))
|
|
1938
1938
|
]);
|
|
1939
1939
|
}
|
|
1940
1940
|
let st = class j extends re {
|
|
@@ -1955,7 +1955,7 @@ let st = class j extends re {
|
|
|
1955
1955
|
* @returns A TimeSpan representing the period of the Rate.
|
|
1956
1956
|
*/
|
|
1957
1957
|
get period() {
|
|
1958
|
-
return
|
|
1958
|
+
return h.seconds(1 / this.valueOf());
|
|
1959
1959
|
}
|
|
1960
1960
|
/**
|
|
1961
1961
|
* Calculates the number of samples in the given TimeSpan at this rate.
|
|
@@ -1964,7 +1964,7 @@ let st = class j extends re {
|
|
|
1964
1964
|
* @returns The number of samples in the given TimeSpan at this rate.
|
|
1965
1965
|
*/
|
|
1966
1966
|
sampleCount(e) {
|
|
1967
|
-
return new
|
|
1967
|
+
return new h(e).seconds * this.valueOf();
|
|
1968
1968
|
}
|
|
1969
1969
|
/**
|
|
1970
1970
|
* Calculates the number of bytes in the given TimeSpan at this rate.
|
|
@@ -1983,7 +1983,7 @@ let st = class j extends re {
|
|
|
1983
1983
|
* @returns A TimeSpan that corresponds to the given number of samples.
|
|
1984
1984
|
*/
|
|
1985
1985
|
span(e) {
|
|
1986
|
-
return
|
|
1986
|
+
return h.seconds(e / this.valueOf());
|
|
1987
1987
|
}
|
|
1988
1988
|
/**
|
|
1989
1989
|
* Calculates a TimeSpan given the number of bytes at this rate.
|
|
@@ -2029,7 +2029,7 @@ let st = class j extends re {
|
|
|
2029
2029
|
* @returns A new Rate representing this Rate divided by the value.
|
|
2030
2030
|
*/
|
|
2031
2031
|
div(e) {
|
|
2032
|
-
return new j(
|
|
2032
|
+
return new j(Te(this.valueOf(), e));
|
|
2033
2033
|
}
|
|
2034
2034
|
/**
|
|
2035
2035
|
* Creates a Rate representing the given number of Hz.
|
|
@@ -2117,7 +2117,7 @@ let st = class j extends re {
|
|
|
2117
2117
|
* @returns A new Density representing this Density divided by the value.
|
|
2118
2118
|
*/
|
|
2119
2119
|
div(e) {
|
|
2120
|
-
return new E(
|
|
2120
|
+
return new E(Te(this.valueOf(), e));
|
|
2121
2121
|
}
|
|
2122
2122
|
/** Unknown/Invalid Density. */
|
|
2123
2123
|
static UNKNOWN = new E(0);
|
|
@@ -2166,7 +2166,7 @@ let st = class j extends re {
|
|
|
2166
2166
|
}
|
|
2167
2167
|
/** @returns The TimeSpan occupied by the TimeRange. */
|
|
2168
2168
|
get span() {
|
|
2169
|
-
return new
|
|
2169
|
+
return new h(this.end.valueOf() - this.start.valueOf());
|
|
2170
2170
|
}
|
|
2171
2171
|
/**
|
|
2172
2172
|
* Checks if the timestamp is valid i.e. the start is before the end.
|
|
@@ -2218,7 +2218,7 @@ let st = class j extends re {
|
|
|
2218
2218
|
* @param other - The TimeRange to compare to.
|
|
2219
2219
|
* @returns True if the TimeRange is equal to the given TimeRange.
|
|
2220
2220
|
*/
|
|
2221
|
-
equals(e, r =
|
|
2221
|
+
equals(e, r = h.ZERO) {
|
|
2222
2222
|
if (r.isZero)
|
|
2223
2223
|
return this.start.equals(e.start) && this.end.equals(e.end);
|
|
2224
2224
|
let n = this.start.sub(e.start).valueOf(), s = this.end.sub(e.end).valueOf();
|
|
@@ -2251,13 +2251,13 @@ let st = class j extends re {
|
|
|
2251
2251
|
* checking for overlap.
|
|
2252
2252
|
* @returns True if the two TimeRanges overlap, false otherwise.
|
|
2253
2253
|
*/
|
|
2254
|
-
overlapsWith(e, r =
|
|
2254
|
+
overlapsWith(e, r = h.ZERO) {
|
|
2255
2255
|
e = e.makeValid();
|
|
2256
2256
|
const n = this.makeValid();
|
|
2257
2257
|
if (this.equals(e)) return !0;
|
|
2258
2258
|
if (e.end.equals(n.start) || n.end.equals(e.start)) return !1;
|
|
2259
2259
|
const s = $.max(n.start, e.start), i = $.min(n.end, e.end);
|
|
2260
|
-
return i.before(s) ? !1 : new
|
|
2260
|
+
return i.before(s) ? !1 : new h(i.sub(s)).greaterThanOrEqual(r);
|
|
2261
2261
|
}
|
|
2262
2262
|
contains(e) {
|
|
2263
2263
|
return e instanceof k ? this.contains(e.start) && this.contains(e.end) : this.start.beforeEq(e) && this.end.after(e);
|
|
@@ -2594,7 +2594,7 @@ let st = class j extends re {
|
|
|
2594
2594
|
* @returns A new Size representing this Size divided by the value.
|
|
2595
2595
|
*/
|
|
2596
2596
|
div(e) {
|
|
2597
|
-
return new y(
|
|
2597
|
+
return new y(Te(this.valueOf(), e));
|
|
2598
2598
|
}
|
|
2599
2599
|
/** @returns a new Size representing the truncated value of the Size. */
|
|
2600
2600
|
truncate(e) {
|
|
@@ -2624,9 +2624,9 @@ let st = class j extends re {
|
|
|
2624
2624
|
}
|
|
2625
2625
|
/** @returns a nicely formatted string representation of the Size. */
|
|
2626
2626
|
toString() {
|
|
2627
|
-
const e = this.truncate(y.TERABYTE), r = this.truncate(y.GIGABYTE), n = this.truncate(y.MEGABYTE), s = this.truncate(y.KILOBYTE), i = this.truncate(y.BYTE), o = e,
|
|
2627
|
+
const e = this.truncate(y.TERABYTE), r = this.truncate(y.GIGABYTE), n = this.truncate(y.MEGABYTE), s = this.truncate(y.KILOBYTE), i = this.truncate(y.BYTE), o = e, l = r.sub(e), f = n.sub(r), c = s.sub(n), d = i.sub(s);
|
|
2628
2628
|
let m = "";
|
|
2629
|
-
return o.isZero || (m += `${o.terabytes}TB `),
|
|
2629
|
+
return o.isZero || (m += `${o.terabytes}TB `), l.isZero || (m += `${l.gigabytes}GB `), f.isZero || (m += `${f.megabytes}MB `), c.isZero || (m += `${c.kilobytes}KB `), (!d.isZero || m === "") && (m += `${d.valueOf()}B`), m.trim();
|
|
2630
2630
|
}
|
|
2631
2631
|
/**
|
|
2632
2632
|
* Creates a Size from the given number of bytes.
|
|
@@ -2699,7 +2699,7 @@ a.object({
|
|
|
2699
2699
|
start: a.number(),
|
|
2700
2700
|
end: a.number()
|
|
2701
2701
|
});
|
|
2702
|
-
const
|
|
2702
|
+
const Uu = a.union([
|
|
2703
2703
|
a.instanceof(Uint8Array),
|
|
2704
2704
|
a.instanceof(Uint16Array),
|
|
2705
2705
|
a.instanceof(Uint32Array),
|
|
@@ -2710,65 +2710,65 @@ const Mu = a.union([
|
|
|
2710
2710
|
a.instanceof(Int16Array),
|
|
2711
2711
|
a.instanceof(Int32Array),
|
|
2712
2712
|
a.instanceof(BigInt64Array)
|
|
2713
|
-
]),
|
|
2713
|
+
]), Hr = (t) => {
|
|
2714
2714
|
const e = typeof t;
|
|
2715
|
-
return e === "string" || e === "number" || e === "boolean" || e === "bigint" || t instanceof $ || t instanceof
|
|
2716
|
-
},
|
|
2717
|
-
function
|
|
2718
|
-
return typeof t == "string" &&
|
|
2715
|
+
return e === "string" || e === "number" || e === "boolean" || e === "bigint" || t instanceof $ || t instanceof h || t instanceof Date;
|
|
2716
|
+
}, ga = (t, e, r, n = 0) => t.usesBigInt && !e.usesBigInt ? Number(r) - Number(n) : !t.usesBigInt && e.usesBigInt ? BigInt(r.valueOf()) - BigInt(n.valueOf()) : Le(r, -n), Le = (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), pa = "00000000-0000-0000-0000-000000000000", ma = /^(?:[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;
|
|
2717
|
+
function ya(t) {
|
|
2718
|
+
return typeof t == "string" && ma.test(t);
|
|
2719
2719
|
}
|
|
2720
2720
|
const I = [];
|
|
2721
2721
|
for (let t = 0; t < 256; ++t)
|
|
2722
2722
|
I.push((t + 256).toString(16).slice(1));
|
|
2723
|
-
function
|
|
2723
|
+
function Xr(t, e = 0) {
|
|
2724
2724
|
return (I[t[e + 0]] + I[t[e + 1]] + I[t[e + 2]] + I[t[e + 3]] + "-" + I[t[e + 4]] + I[t[e + 5]] + "-" + I[t[e + 6]] + I[t[e + 7]] + "-" + I[t[e + 8]] + I[t[e + 9]] + "-" + I[t[e + 10]] + I[t[e + 11]] + I[t[e + 12]] + I[t[e + 13]] + I[t[e + 14]] + I[t[e + 15]]).toLowerCase();
|
|
2725
2725
|
}
|
|
2726
|
-
function
|
|
2727
|
-
const r =
|
|
2728
|
-
if (!
|
|
2726
|
+
function ba(t, e = 0) {
|
|
2727
|
+
const r = Xr(t, e);
|
|
2728
|
+
if (!ya(r))
|
|
2729
2729
|
throw TypeError("Stringified UUID is invalid");
|
|
2730
2730
|
return r;
|
|
2731
2731
|
}
|
|
2732
2732
|
let it;
|
|
2733
|
-
const
|
|
2734
|
-
function
|
|
2733
|
+
const wa = new Uint8Array(16);
|
|
2734
|
+
function $a() {
|
|
2735
2735
|
if (!it) {
|
|
2736
2736
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
2737
2737
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
2738
2738
|
it = crypto.getRandomValues.bind(crypto);
|
|
2739
2739
|
}
|
|
2740
|
-
return it(
|
|
2740
|
+
return it(wa);
|
|
2741
2741
|
}
|
|
2742
|
-
const
|
|
2743
|
-
function
|
|
2742
|
+
const Oa = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), rr = { randomUUID: Oa };
|
|
2743
|
+
function va(t, e, r) {
|
|
2744
2744
|
t = t || {};
|
|
2745
|
-
const n = t.random ?? t.rng?.() ??
|
|
2745
|
+
const n = t.random ?? t.rng?.() ?? $a();
|
|
2746
2746
|
if (n.length < 16)
|
|
2747
2747
|
throw new Error("Random bytes length must be >= 16");
|
|
2748
|
-
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128,
|
|
2748
|
+
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, Xr(n);
|
|
2749
2749
|
}
|
|
2750
|
-
function
|
|
2751
|
-
return
|
|
2750
|
+
function Ta(t, e, r) {
|
|
2751
|
+
return rr.randomUUID && !t ? rr.randomUUID() : va(t);
|
|
2752
2752
|
}
|
|
2753
|
-
const
|
|
2753
|
+
const xa = () => Ta(), Xt = (t, e) => ba(t, e), Sa = pa, Bu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2754
2754
|
__proto__: null,
|
|
2755
|
-
ZERO:
|
|
2756
|
-
create:
|
|
2757
|
-
parse:
|
|
2755
|
+
ZERO: Sa,
|
|
2756
|
+
create: xa,
|
|
2757
|
+
parse: Xt
|
|
2758
2758
|
}, Symbol.toStringTag, { value: "Module" })), Y = -1, Ot = {
|
|
2759
2759
|
[Symbol.iterator]: () => Ot,
|
|
2760
2760
|
next: () => ({ done: !0, value: void 0 })
|
|
2761
|
-
},
|
|
2761
|
+
}, Na = a.string().transform(
|
|
2762
2762
|
(t) => new Uint8Array(
|
|
2763
2763
|
atob(t).split("").map((e) => e.charCodeAt(0))
|
|
2764
2764
|
).buffer
|
|
2765
|
-
),
|
|
2765
|
+
), Ia = a.union([a.null(), a.undefined()]).transform(() => new Uint8Array().buffer), vt = 10, Jr = (t, e) => {
|
|
2766
2766
|
if (t === "number" && !e.isNumeric)
|
|
2767
2767
|
throw new Error(`cannot convert series of type ${e.toString()} to number`);
|
|
2768
2768
|
if (t === "bigint" && !e.usesBigInt)
|
|
2769
2769
|
throw new Error(`cannot convert series of type ${e.toString()} to bigint`);
|
|
2770
|
-
},
|
|
2771
|
-
let
|
|
2770
|
+
}, Kr = "sy_x_telem_series";
|
|
2771
|
+
let Qr = class W {
|
|
2772
2772
|
/**
|
|
2773
2773
|
* A unique identifier for the series. If specified by the user, it is their
|
|
2774
2774
|
* responsibility to ensure that it is unique. If not specified, a new ID will be
|
|
@@ -2779,7 +2779,7 @@ let Jr = class W {
|
|
|
2779
2779
|
* A discriminator used for identifying instances of the series class even
|
|
2780
2780
|
* when bundlers mangle the class name.
|
|
2781
2781
|
*/
|
|
2782
|
-
discriminator =
|
|
2782
|
+
discriminator = Kr;
|
|
2783
2783
|
/** The data type of the series. */
|
|
2784
2784
|
dataType;
|
|
2785
2785
|
/**
|
|
@@ -2828,12 +2828,12 @@ let Jr = class W {
|
|
|
2828
2828
|
dataType: S.z,
|
|
2829
2829
|
alignment: a.coerce.bigint().optional(),
|
|
2830
2830
|
data: a.union([
|
|
2831
|
-
|
|
2832
|
-
|
|
2831
|
+
Na,
|
|
2832
|
+
Ia,
|
|
2833
2833
|
a.instanceof(ArrayBuffer),
|
|
2834
2834
|
a.instanceof(Uint8Array)
|
|
2835
2835
|
]),
|
|
2836
|
-
glBufferUsage:
|
|
2836
|
+
glBufferUsage: fa.optional().default("static").optional()
|
|
2837
2837
|
});
|
|
2838
2838
|
/**
|
|
2839
2839
|
* A zod schema that validates and constructs a series from it's crude
|
|
@@ -2914,37 +2914,37 @@ let Jr = class W {
|
|
|
2914
2914
|
* @throws Error if data type cannot be inferred from input
|
|
2915
2915
|
*/
|
|
2916
2916
|
constructor(e) {
|
|
2917
|
-
|
|
2917
|
+
Ma(e) && (e = { data: e }), e.data ??= [];
|
|
2918
2918
|
const {
|
|
2919
2919
|
dataType: r,
|
|
2920
2920
|
timeRange: n,
|
|
2921
2921
|
sampleOffset: s = 0,
|
|
2922
2922
|
glBufferUsage: i = "static",
|
|
2923
2923
|
alignment: o = 0n,
|
|
2924
|
-
alignmentMultiple:
|
|
2925
|
-
key: f =
|
|
2926
|
-
data:
|
|
2924
|
+
alignmentMultiple: l = 1n,
|
|
2925
|
+
key: f = Ht(),
|
|
2926
|
+
data: c
|
|
2927
2927
|
} = e;
|
|
2928
|
-
if (
|
|
2929
|
-
const p =
|
|
2928
|
+
if (_r(c)) {
|
|
2929
|
+
const p = c;
|
|
2930
2930
|
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;
|
|
2931
2931
|
return;
|
|
2932
2932
|
}
|
|
2933
|
-
const d =
|
|
2933
|
+
const d = Hr(c), m = Array.isArray(c);
|
|
2934
2934
|
if (r != null) this.dataType = new S(r);
|
|
2935
2935
|
else {
|
|
2936
|
-
if (
|
|
2936
|
+
if (c instanceof ArrayBuffer)
|
|
2937
2937
|
throw new Error(
|
|
2938
2938
|
"cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type."
|
|
2939
2939
|
);
|
|
2940
2940
|
if (m || d) {
|
|
2941
|
-
let p =
|
|
2941
|
+
let p = c;
|
|
2942
2942
|
if (!d) {
|
|
2943
|
-
if (
|
|
2943
|
+
if (c.length === 0)
|
|
2944
2944
|
throw new Error(
|
|
2945
2945
|
"cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type."
|
|
2946
2946
|
);
|
|
2947
|
-
p =
|
|
2947
|
+
p = c[0];
|
|
2948
2948
|
}
|
|
2949
2949
|
if (typeof p == "string") this.dataType = S.STRING;
|
|
2950
2950
|
else if (typeof p == "number") this.dataType = S.FLOAT64;
|
|
@@ -2957,15 +2957,15 @@ let Jr = class W {
|
|
|
2957
2957
|
throw new Error(
|
|
2958
2958
|
`cannot infer data type of ${typeof p} when constructing a Series from a JS array`
|
|
2959
2959
|
);
|
|
2960
|
-
} else this.dataType = new S(
|
|
2960
|
+
} else this.dataType = new S(c);
|
|
2961
2961
|
}
|
|
2962
|
-
if (!m && !d) this._data =
|
|
2963
|
-
else if (m &&
|
|
2962
|
+
if (!m && !d) this._data = c;
|
|
2963
|
+
else if (m && c.length === 0)
|
|
2964
2964
|
this._data = new this.dataType.Array([]).buffer;
|
|
2965
2965
|
else {
|
|
2966
|
-
let p = d ? [
|
|
2966
|
+
let p = d ? [c] : c;
|
|
2967
2967
|
const A = p[0];
|
|
2968
|
-
(A instanceof $ || A instanceof Date || A instanceof
|
|
2968
|
+
(A instanceof $ || A instanceof Date || A instanceof h) && (p = p.map((U) => new $(U).valueOf())), this.dataType.equals(S.STRING) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(`${p.join(`
|
|
2969
2969
|
`)}
|
|
2970
2970
|
`).buffer) : this.dataType.equals(S.JSON) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(
|
|
2971
2971
|
`${p.map((U) => ct.encodeString(U)).join(`
|
|
@@ -2977,7 +2977,7 @@ let Jr = class W {
|
|
|
2977
2977
|
p.map(Number)
|
|
2978
2978
|
).buffer : this._data = new this.dataType.Array(p).buffer;
|
|
2979
2979
|
}
|
|
2980
|
-
this.key = f, this.alignment = o, this.alignmentMultiple =
|
|
2980
|
+
this.key = f, this.alignment = o, this.alignmentMultiple = l, this.sampleOffset = s ?? 0, this.timeRange = n ?? Q.ZERO, this.gl = {
|
|
2981
2981
|
control: null,
|
|
2982
2982
|
buffer: null,
|
|
2983
2983
|
prevBuffer: 0,
|
|
@@ -3141,7 +3141,7 @@ let Jr = class W {
|
|
|
3141
3141
|
if (this.dataType.equals(e)) return this;
|
|
3142
3142
|
const n = new e.Array(this.length);
|
|
3143
3143
|
for (let s = 0; s < this.length; s++)
|
|
3144
|
-
n[s] =
|
|
3144
|
+
n[s] = ga(this.dataType, e, this.data[s], r);
|
|
3145
3145
|
return new W({
|
|
3146
3146
|
data: n.buffer,
|
|
3147
3147
|
dataType: e,
|
|
@@ -3229,7 +3229,7 @@ let Jr = class W {
|
|
|
3229
3229
|
}
|
|
3230
3230
|
atUUID(e, r) {
|
|
3231
3231
|
e < 0 && (e = this.length + e);
|
|
3232
|
-
const n =
|
|
3232
|
+
const n = Xt(
|
|
3233
3233
|
new Uint8Array(this.buffer, e * this.dataType.density.valueOf())
|
|
3234
3234
|
);
|
|
3235
3235
|
if (n == null) {
|
|
@@ -3258,7 +3258,7 @@ let Jr = class W {
|
|
|
3258
3258
|
}
|
|
3259
3259
|
}
|
|
3260
3260
|
const i = this.data.slice(n, s);
|
|
3261
|
-
return this.dataType.equals(S.STRING) ? new TextDecoder().decode(i) :
|
|
3261
|
+
return this.dataType.equals(S.STRING) ? new TextDecoder().decode(i) : It(JSON.parse(new TextDecoder().decode(i)));
|
|
3262
3262
|
}
|
|
3263
3263
|
/**
|
|
3264
3264
|
* @returns the index of the first sample that is greater than or equal to the given value.
|
|
@@ -3299,7 +3299,7 @@ let Jr = class W {
|
|
|
3299
3299
|
), this.gl.prevBuffer = Y;
|
|
3300
3300
|
}
|
|
3301
3301
|
as(e) {
|
|
3302
|
-
return
|
|
3302
|
+
return Jr(e, this.dataType), this;
|
|
3303
3303
|
}
|
|
3304
3304
|
/** @returns a digest containing information about the series. */
|
|
3305
3305
|
get digest() {
|
|
@@ -3308,8 +3308,8 @@ let Jr = class W {
|
|
|
3308
3308
|
dataType: this.dataType.toString(),
|
|
3309
3309
|
sampleOffset: this.sampleOffset,
|
|
3310
3310
|
alignment: {
|
|
3311
|
-
lower:
|
|
3312
|
-
upper:
|
|
3311
|
+
lower: sr(this.alignmentBounds.lower),
|
|
3312
|
+
upper: sr(this.alignmentBounds.upper),
|
|
3313
3313
|
multiple: this.alignmentMultiple
|
|
3314
3314
|
},
|
|
3315
3315
|
timeRange: this.timeRange.toString(),
|
|
@@ -3347,10 +3347,10 @@ let Jr = class W {
|
|
|
3347
3347
|
}
|
|
3348
3348
|
[Symbol.iterator]() {
|
|
3349
3349
|
if (this.dataType.isVariable) {
|
|
3350
|
-
const e = new
|
|
3351
|
-
return this.dataType.equals(S.JSON) ? new
|
|
3350
|
+
const e = new Aa(this);
|
|
3351
|
+
return this.dataType.equals(S.JSON) ? new Ea(e) : e;
|
|
3352
3352
|
}
|
|
3353
|
-
return this.dataType.equals(S.UUID) ? new
|
|
3353
|
+
return this.dataType.equals(S.UUID) ? new Ua(this) : new Ba(this);
|
|
3354
3354
|
}
|
|
3355
3355
|
/**
|
|
3356
3356
|
* Returns a slice of the series from start to end.
|
|
@@ -3377,7 +3377,7 @@ let Jr = class W {
|
|
|
3377
3377
|
* @returns An iterator over the specified range.
|
|
3378
3378
|
*/
|
|
3379
3379
|
subIterator(e, r) {
|
|
3380
|
-
return new
|
|
3380
|
+
return new nr(this, e, r ?? this.length);
|
|
3381
3381
|
}
|
|
3382
3382
|
/**
|
|
3383
3383
|
* Returns an iterator over a portion of the series based on alignment.
|
|
@@ -3391,7 +3391,7 @@ let Jr = class W {
|
|
|
3391
3391
|
), s = Math.ceil(
|
|
3392
3392
|
Number(r - this.alignment) / Number(this.alignmentMultiple)
|
|
3393
3393
|
);
|
|
3394
|
-
return new
|
|
3394
|
+
return new nr(this, n, s);
|
|
3395
3395
|
}
|
|
3396
3396
|
subBytes(e, r) {
|
|
3397
3397
|
if (e >= 0 && (r == null || r >= this.byteLength.valueOf())) return this;
|
|
@@ -3450,8 +3450,8 @@ let Jr = class W {
|
|
|
3450
3450
|
return e += "])", e;
|
|
3451
3451
|
}
|
|
3452
3452
|
};
|
|
3453
|
-
const
|
|
3454
|
-
let
|
|
3453
|
+
const Ma = (t) => t == null ? !1 : Array.isArray(t) || t instanceof ArrayBuffer || ArrayBuffer.isView(t) && !(t instanceof DataView) || t instanceof Qr ? !0 : Hr(t), _r = Qi(Kr, Qr);
|
|
3454
|
+
let nr = class {
|
|
3455
3455
|
series;
|
|
3456
3456
|
end;
|
|
3457
3457
|
index;
|
|
@@ -3463,7 +3463,7 @@ let tr = class {
|
|
|
3463
3463
|
next() {
|
|
3464
3464
|
return this.index >= this.end ? { done: !0, value: void 0 } : { done: !1, value: this.series.at(this.index++, !0) };
|
|
3465
3465
|
}
|
|
3466
|
-
},
|
|
3466
|
+
}, Aa = class {
|
|
3467
3467
|
series;
|
|
3468
3468
|
index;
|
|
3469
3469
|
decoder;
|
|
@@ -3480,7 +3480,7 @@ let tr = class {
|
|
|
3480
3480
|
const n = this.index;
|
|
3481
3481
|
return e === n ? { done: !0, value: void 0 } : (this.index++, { done: !1, value: this.decoder.decode(this.series.buffer.slice(e, n)) });
|
|
3482
3482
|
}
|
|
3483
|
-
},
|
|
3483
|
+
}, Ea = class en {
|
|
3484
3484
|
wrapped;
|
|
3485
3485
|
static schema = a.record(a.string(), a.unknown());
|
|
3486
3486
|
constructor(e) {
|
|
@@ -3490,10 +3490,10 @@ let tr = class {
|
|
|
3490
3490
|
const e = this.wrapped.next();
|
|
3491
3491
|
return e.done === !0 ? { done: !0, value: void 0 } : {
|
|
3492
3492
|
done: !1,
|
|
3493
|
-
value: ct.decodeString(e.value,
|
|
3493
|
+
value: ct.decodeString(e.value, en.schema)
|
|
3494
3494
|
};
|
|
3495
3495
|
}
|
|
3496
|
-
},
|
|
3496
|
+
}, Ua = class {
|
|
3497
3497
|
series;
|
|
3498
3498
|
index;
|
|
3499
3499
|
data;
|
|
@@ -3505,11 +3505,11 @@ let tr = class {
|
|
|
3505
3505
|
}
|
|
3506
3506
|
next() {
|
|
3507
3507
|
if (this.index >= this.series.length) return { done: !0, value: void 0 };
|
|
3508
|
-
const e =
|
|
3508
|
+
const e = Xt(this.data, this.index * this.density);
|
|
3509
3509
|
return this.index++, { done: !1, value: e };
|
|
3510
3510
|
}
|
|
3511
3511
|
};
|
|
3512
|
-
class
|
|
3512
|
+
class Ba {
|
|
3513
3513
|
series;
|
|
3514
3514
|
index;
|
|
3515
3515
|
constructor(e) {
|
|
@@ -3522,7 +3522,7 @@ class Aa {
|
|
|
3522
3522
|
};
|
|
3523
3523
|
}
|
|
3524
3524
|
}
|
|
3525
|
-
class
|
|
3525
|
+
class Lu {
|
|
3526
3526
|
/** The array of series in this collection */
|
|
3527
3527
|
series;
|
|
3528
3528
|
/**
|
|
@@ -3575,7 +3575,7 @@ class ju {
|
|
|
3575
3575
|
this.series = e;
|
|
3576
3576
|
}
|
|
3577
3577
|
as(e) {
|
|
3578
|
-
return
|
|
3578
|
+
return Jr(e, this.dataType), this;
|
|
3579
3579
|
}
|
|
3580
3580
|
/**
|
|
3581
3581
|
* Returns the data type of the series in this collection. If the collection is empty,
|
|
@@ -3617,7 +3617,7 @@ class ju {
|
|
|
3617
3617
|
const r = () => new Error(
|
|
3618
3618
|
`cannot push a ${e.dataType.toString()} series to a ${this.dataType.toString()} multi-series`
|
|
3619
3619
|
), n = e.dataType.equals(this.dataType);
|
|
3620
|
-
if (
|
|
3620
|
+
if (_r(e)) {
|
|
3621
3621
|
if (this.series.length !== 0 && !n) throw r();
|
|
3622
3622
|
this.series.push(e);
|
|
3623
3623
|
} else {
|
|
@@ -3723,7 +3723,7 @@ class ju {
|
|
|
3723
3723
|
* Returns the bounds containing the minimum and maximum values across all series.
|
|
3724
3724
|
*/
|
|
3725
3725
|
get bounds() {
|
|
3726
|
-
return
|
|
3726
|
+
return Sr(this.series.map((e) => e.bounds));
|
|
3727
3727
|
}
|
|
3728
3728
|
/**
|
|
3729
3729
|
* Returns the sum of the byte lengths of all series.
|
|
@@ -3750,7 +3750,7 @@ class ju {
|
|
|
3750
3750
|
*/
|
|
3751
3751
|
traverseAlignment(e, r) {
|
|
3752
3752
|
const n = this.series.map((s) => s.alignmentBounds);
|
|
3753
|
-
return
|
|
3753
|
+
return Nr(n, e, r);
|
|
3754
3754
|
}
|
|
3755
3755
|
/**
|
|
3756
3756
|
* Acquires a reference to the WebGL buffer for all series.
|
|
@@ -3773,7 +3773,7 @@ class ju {
|
|
|
3773
3773
|
*/
|
|
3774
3774
|
distance(e, r) {
|
|
3775
3775
|
const n = this.series.map((s) => s.alignmentBounds);
|
|
3776
|
-
return
|
|
3776
|
+
return Ir(n, e, r);
|
|
3777
3777
|
}
|
|
3778
3778
|
/**
|
|
3779
3779
|
* Parses a JSON multi-series into an array of values using the provided zod schema.
|
|
@@ -3796,7 +3796,7 @@ class ju {
|
|
|
3796
3796
|
next() {
|
|
3797
3797
|
return { done: !0, value: void 0 };
|
|
3798
3798
|
}
|
|
3799
|
-
} : new
|
|
3799
|
+
} : new ja(this.series);
|
|
3800
3800
|
}
|
|
3801
3801
|
/**
|
|
3802
3802
|
* Returns an array of the values in the multi-series as strings.
|
|
@@ -3807,7 +3807,7 @@ class ju {
|
|
|
3807
3807
|
return this.series.flatMap((e) => e.toStrings());
|
|
3808
3808
|
}
|
|
3809
3809
|
}
|
|
3810
|
-
let
|
|
3810
|
+
let ja = class {
|
|
3811
3811
|
series;
|
|
3812
3812
|
seriesIndex;
|
|
3813
3813
|
internal;
|
|
@@ -3821,7 +3821,8 @@ let Ea = class {
|
|
|
3821
3821
|
[Symbol.iterator]() {
|
|
3822
3822
|
return this;
|
|
3823
3823
|
}
|
|
3824
|
-
}
|
|
3824
|
+
};
|
|
3825
|
+
class at {
|
|
3825
3826
|
series;
|
|
3826
3827
|
index;
|
|
3827
3828
|
end;
|
|
@@ -3834,33 +3835,33 @@ let Ea = class {
|
|
|
3834
3835
|
[Symbol.iterator]() {
|
|
3835
3836
|
return this;
|
|
3836
3837
|
}
|
|
3837
|
-
}
|
|
3838
|
-
const
|
|
3838
|
+
}
|
|
3839
|
+
const sr = (t) => {
|
|
3839
3840
|
const e = t >> 32n, r = t & 0xffffffffn;
|
|
3840
3841
|
return { domain: e, sample: r };
|
|
3841
3842
|
};
|
|
3842
3843
|
a.object({ key: a.string(), value: a.string() });
|
|
3843
|
-
const
|
|
3844
|
+
const Ca = a.record(
|
|
3844
3845
|
a.union([a.number(), a.string(), a.symbol()]),
|
|
3845
3846
|
a.unknown()
|
|
3846
|
-
),
|
|
3847
|
+
), Jt = (t) => Object.entries(t), Ra = (t, e) => Object.fromEntries(Jt(t).map(([r, n]) => [r, e(n, r)])), La = (t) => Object.fromEntries(Jt(t).filter(([e, r]) => r !== void 0)), Da = (t, ...e) => {
|
|
3847
3848
|
const r = { ...t };
|
|
3848
3849
|
for (const n of e) delete r[n];
|
|
3849
3850
|
return r;
|
|
3850
|
-
},
|
|
3851
|
+
}, Pu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3851
3852
|
__proto__: null,
|
|
3852
|
-
entries:
|
|
3853
|
-
map:
|
|
3854
|
-
omit:
|
|
3855
|
-
purgeUndefined:
|
|
3856
|
-
unknownZ:
|
|
3857
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3853
|
+
entries: Jt,
|
|
3854
|
+
map: Ra,
|
|
3855
|
+
omit: Da,
|
|
3856
|
+
purgeUndefined: La,
|
|
3857
|
+
unknownZ: Ca
|
|
3858
|
+
}, Symbol.toStringTag, { value: "Module" })), tn = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", Pa = tn(), rn = ["macOS", "Windows", "Linux"], ka = ["macos", "windows", "linux"], qa = {
|
|
3858
3859
|
macos: "macOS",
|
|
3859
3860
|
windows: "Windows",
|
|
3860
3861
|
linux: "Linux"
|
|
3861
|
-
},
|
|
3862
|
-
a.enum(
|
|
3863
|
-
),
|
|
3862
|
+
}, za = a.enum(rn).or(
|
|
3863
|
+
a.enum(ka).transform((t) => qa[t])
|
|
3864
|
+
), Za = () => {
|
|
3864
3865
|
if (typeof window > "u") return;
|
|
3865
3866
|
const t = window.navigator.userAgent.toLowerCase();
|
|
3866
3867
|
if (t.includes("mac")) return "macOS";
|
|
@@ -3868,17 +3869,17 @@ const Ua = a.record(
|
|
|
3868
3869
|
if (t.includes("linux")) return "Linux";
|
|
3869
3870
|
};
|
|
3870
3871
|
let ot;
|
|
3871
|
-
const
|
|
3872
|
+
const Fa = ((t = {}) => {
|
|
3872
3873
|
const { force: e, default: r } = t;
|
|
3873
|
-
return e ?? ot ?? (ot =
|
|
3874
|
-
}),
|
|
3874
|
+
return e ?? ot ?? (ot = Za(), ot ?? r);
|
|
3875
|
+
}), ku = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3875
3876
|
__proto__: null,
|
|
3876
|
-
OPERATING_SYSTEMS:
|
|
3877
|
-
RUNTIME:
|
|
3878
|
-
detect:
|
|
3879
|
-
getOS:
|
|
3880
|
-
osZ:
|
|
3881
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3877
|
+
OPERATING_SYSTEMS: rn,
|
|
3878
|
+
RUNTIME: Pa,
|
|
3879
|
+
detect: tn,
|
|
3880
|
+
getOS: Fa,
|
|
3881
|
+
osZ: za
|
|
3882
|
+
}, Symbol.toStringTag, { value: "Module" })), Ya = (...t) => t.map(nn).join(""), nn = (t) => (t.endsWith("/") || (t += "/"), t.startsWith("/") && (t = t.slice(1)), t), Wa = (t) => t.endsWith("/") ? t.slice(0, -1) : t;
|
|
3882
3883
|
class De {
|
|
3883
3884
|
protocol;
|
|
3884
3885
|
host;
|
|
@@ -3891,7 +3892,7 @@ class De {
|
|
|
3891
3892
|
* @param pathPrefix - A path prefix to use for all requests. Defaults to "".
|
|
3892
3893
|
*/
|
|
3893
3894
|
constructor({ host: e, port: r, protocol: n = "", pathPrefix: s = "" }) {
|
|
3894
|
-
this.protocol = n, this.host = e, this.port = r, this.path =
|
|
3895
|
+
this.protocol = n, this.host = e, this.port = r, this.path = nn(s);
|
|
3895
3896
|
}
|
|
3896
3897
|
/**
|
|
3897
3898
|
* Replaces creates a new URL with the specified properties replaced.
|
|
@@ -3914,64 +3915,91 @@ class De {
|
|
|
3914
3915
|
child(e) {
|
|
3915
3916
|
return new De({
|
|
3916
3917
|
...this,
|
|
3917
|
-
pathPrefix:
|
|
3918
|
+
pathPrefix: Ya(this.path, e)
|
|
3918
3919
|
});
|
|
3919
3920
|
}
|
|
3920
3921
|
/** @returns a string representation of the url */
|
|
3921
3922
|
toString() {
|
|
3922
|
-
return
|
|
3923
|
+
return Wa(
|
|
3923
3924
|
`${this.protocol}://${this.host}:${this.port}/${this.path}`
|
|
3924
3925
|
);
|
|
3925
3926
|
}
|
|
3926
3927
|
static UNKNOWN = new De({ host: "unknown", port: 0 });
|
|
3927
3928
|
}
|
|
3928
|
-
const
|
|
3929
|
+
const Tt = 2, xt = 3, sn = 2, Va = (t, e) => {
|
|
3929
3930
|
if (Number.isNaN(t) || !Number.isFinite(t)) return t;
|
|
3930
|
-
const r =
|
|
3931
|
+
const r = le(e);
|
|
3931
3932
|
if (r == 0) return t;
|
|
3932
3933
|
let n;
|
|
3933
|
-
r >= 1e3 ? n =
|
|
3934
|
+
r >= 1e3 ? n = Tt : r >= 1 ? n = xt : n = Math.ceil(-Math.log10(r)) + sn;
|
|
3934
3935
|
const s = 10 ** n;
|
|
3935
3936
|
return Math.round(t * s) / s;
|
|
3936
|
-
},
|
|
3937
|
+
}, Ga = 5, Ha = 1e-10, Xa = (t, e) => {
|
|
3938
|
+
if (Number.isNaN(t) || !Number.isFinite(t)) return t;
|
|
3939
|
+
const r = Math.abs(t);
|
|
3940
|
+
if (r === 0) return 0;
|
|
3941
|
+
let n = !1, s = 0;
|
|
3942
|
+
if (e != null) {
|
|
3943
|
+
s = le(e);
|
|
3944
|
+
const l = s / r;
|
|
3945
|
+
n = s > 0 && l > Ha;
|
|
3946
|
+
}
|
|
3947
|
+
if (n) {
|
|
3948
|
+
let l;
|
|
3949
|
+
s >= 1e3 ? l = Tt : s >= 1 ? l = xt : l = Math.ceil(-Math.log10(s)) + sn;
|
|
3950
|
+
const f = 10 ** l;
|
|
3951
|
+
return Math.round(t * f) / f;
|
|
3952
|
+
}
|
|
3953
|
+
if (r >= 1e3) {
|
|
3954
|
+
const l = 10 ** Tt;
|
|
3955
|
+
return Math.round(t * l) / l;
|
|
3956
|
+
}
|
|
3957
|
+
if (r >= 1) {
|
|
3958
|
+
const l = 10 ** xt;
|
|
3959
|
+
return Math.round(t * l) / l;
|
|
3960
|
+
}
|
|
3961
|
+
const i = Math.floor(Math.log10(r)), o = 10 ** (Ga - i - 1);
|
|
3962
|
+
return Math.round(t * o) / o;
|
|
3963
|
+
}, qu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3937
3964
|
__proto__: null,
|
|
3938
|
-
MAX_INT16:
|
|
3939
|
-
MAX_INT32:
|
|
3965
|
+
MAX_INT16: oa,
|
|
3966
|
+
MAX_INT32: la,
|
|
3940
3967
|
MAX_INT64: ze,
|
|
3941
|
-
MAX_INT64_NUMBER:
|
|
3942
|
-
MAX_INT8:
|
|
3943
|
-
MAX_UINT16:
|
|
3944
|
-
MAX_UINT32:
|
|
3945
|
-
MAX_UINT64:
|
|
3946
|
-
MAX_UINT64_NUMBER:
|
|
3947
|
-
MAX_UINT8:
|
|
3948
|
-
MIN_INT16:
|
|
3949
|
-
MIN_INT32:
|
|
3950
|
-
MIN_INT64:
|
|
3951
|
-
MIN_INT64_NUMBER:
|
|
3952
|
-
MIN_INT8:
|
|
3953
|
-
abs:
|
|
3968
|
+
MAX_INT64_NUMBER: Vr,
|
|
3969
|
+
MAX_INT8: ia,
|
|
3970
|
+
MAX_UINT16: ea,
|
|
3971
|
+
MAX_UINT32: ta,
|
|
3972
|
+
MAX_UINT64: ra,
|
|
3973
|
+
MAX_UINT64_NUMBER: na,
|
|
3974
|
+
MAX_UINT8: _i,
|
|
3975
|
+
MIN_INT16: aa,
|
|
3976
|
+
MIN_INT32: ua,
|
|
3977
|
+
MIN_INT64: ca,
|
|
3978
|
+
MIN_INT64_NUMBER: ha,
|
|
3979
|
+
MIN_INT8: sa,
|
|
3980
|
+
abs: Tr,
|
|
3954
3981
|
add: ue,
|
|
3955
|
-
closeTo:
|
|
3956
|
-
div:
|
|
3982
|
+
closeTo: ss,
|
|
3983
|
+
div: Te,
|
|
3957
3984
|
equal: dt,
|
|
3958
3985
|
isInteger: ke,
|
|
3959
|
-
max:
|
|
3960
|
-
min:
|
|
3986
|
+
max: as,
|
|
3987
|
+
min: vr,
|
|
3961
3988
|
mult: R,
|
|
3962
3989
|
roundBySpan: Va,
|
|
3963
|
-
roundToNearestMagnitude:
|
|
3990
|
+
roundToNearestMagnitude: is,
|
|
3991
|
+
smartRound: Xa,
|
|
3964
3992
|
sub: Z
|
|
3965
3993
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3966
3994
|
a.object({
|
|
3967
|
-
baseInterval:
|
|
3995
|
+
baseInterval: h.z.optional(),
|
|
3968
3996
|
maxRetries: a.number().optional(),
|
|
3969
3997
|
scale: a.number().optional()
|
|
3970
3998
|
});
|
|
3971
|
-
const
|
|
3999
|
+
const Ja = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Fe = a.string().regex(Ja), ie = a.number().min(0).max(255), an = a.number().min(0).max(1), _e = a.tuple([ie, ie, ie, an]), Ka = a.tuple([ie, ie, ie]), Qa = a.object({ rgba255: _e }), _a = a.number().min(0).max(360), eo = a.number().min(0).max(100), to = a.number().min(0).max(100), on = a.tuple([_a, eo, to, an]), et = a.union([Fe, Ka, _e, on, Qa]), tt = et.transform((t) => T(t)), ro = (t) => tt.safeParse(t).success, no = (t) => _e.safeParse(t).success, so = ((t) => {
|
|
3972
4000
|
if (t == null) return;
|
|
3973
4001
|
const e = tt.safeParse(t);
|
|
3974
|
-
if (e.success) return
|
|
4002
|
+
if (e.success) return ln(e.data);
|
|
3975
4003
|
if (typeof t == "string") return t;
|
|
3976
4004
|
throw e.error;
|
|
3977
4005
|
}), T = (t, e = 1) => {
|
|
@@ -3982,51 +4010,51 @@ const Ga = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Fe = a.string().regex(Ga), ie = a.n
|
|
|
3982
4010
|
return t.length === 3 ? [...t, e] : t;
|
|
3983
4011
|
}
|
|
3984
4012
|
return t.rgba255;
|
|
3985
|
-
},
|
|
4013
|
+
}, un = (t, e) => {
|
|
3986
4014
|
if (t == null || e == null) return t == e;
|
|
3987
4015
|
const r = T(t), n = T(e);
|
|
3988
4016
|
return r.every((s, i) => s === n[i]);
|
|
3989
|
-
},
|
|
4017
|
+
}, io = ((t) => {
|
|
3990
4018
|
if (t == null) return;
|
|
3991
4019
|
const [e, r, n, s] = T(t);
|
|
3992
4020
|
return `#${Me(e)}${Me(r)}${Me(n)}${s === 1 ? "" : Me(s * 255)}`;
|
|
3993
|
-
}),
|
|
4021
|
+
}), ln = (t) => {
|
|
3994
4022
|
const [e, r, n, s] = T(t);
|
|
3995
4023
|
return `rgba(${e}, ${r}, ${n}, ${s})`;
|
|
3996
|
-
},
|
|
4024
|
+
}, ao = (t) => `rgb(${cn(t)})`, cn = (t) => {
|
|
3997
4025
|
const [e, r, n] = T(t);
|
|
3998
4026
|
return `${e}, ${r}, ${n}`;
|
|
3999
|
-
},
|
|
4000
|
-
de(t) / 255,
|
|
4027
|
+
}, oo = (t) => [...Kt(t), ye(t)], Kt = (t) => [
|
|
4001
4028
|
ge(t) / 255,
|
|
4002
|
-
pe(t) / 255
|
|
4003
|
-
|
|
4029
|
+
pe(t) / 255,
|
|
4030
|
+
me(t) / 255
|
|
4031
|
+
], ge = (t) => T(t)[0], pe = (t) => T(t)[1], me = (t) => T(t)[2], ye = (t) => T(t)[3], uo = (t) => un(Qt, t), lo = (t) => wo(T(t)), co = (t, e) => {
|
|
4004
4032
|
const [r, n, s] = T(t);
|
|
4005
4033
|
if (e > 100)
|
|
4006
4034
|
throw new Error(`Color opacity must be between 0 and 100, got ${e}`);
|
|
4007
4035
|
return e > 1 && (e /= 100), [r, n, s, e];
|
|
4008
|
-
},
|
|
4009
|
-
const [e, r, n] =
|
|
4036
|
+
}, Oe = (t) => {
|
|
4037
|
+
const [e, r, n] = Kt(t).map(
|
|
4010
4038
|
(s) => s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4
|
|
4011
4039
|
);
|
|
4012
4040
|
return Number((0.2126 * e + 0.7152 * r + 0.0722 * n).toFixed(3));
|
|
4013
|
-
},
|
|
4014
|
-
const [e, r, n] =
|
|
4041
|
+
}, ho = (t) => {
|
|
4042
|
+
const [e, r, n] = Kt(t);
|
|
4015
4043
|
return 1 - (Math.max(e, r, n) - Math.min(e, r, n));
|
|
4016
|
-
},
|
|
4017
|
-
const r = T(t), n = T(e), s =
|
|
4044
|
+
}, St = (t, e) => {
|
|
4045
|
+
const r = T(t), n = T(e), s = Oe(r), i = Oe(n);
|
|
4018
4046
|
return (Math.max(s, i) + 0.5) / (Math.min(s, i) + 0.5);
|
|
4019
|
-
},
|
|
4047
|
+
}, fo = (t, ...e) => {
|
|
4020
4048
|
if (e.length === 0)
|
|
4021
4049
|
throw new Error("[Color.pickByContrast] - must provide at least one color");
|
|
4022
|
-
const r = T(t), [n] = e.sort((s, i) =>
|
|
4050
|
+
const r = T(t), [n] = e.sort((s, i) => St(r, i) - St(r, s));
|
|
4023
4051
|
return T(n);
|
|
4024
|
-
},
|
|
4052
|
+
}, go = (t) => Oe(t) < 0.5, po = (t) => Oe(t) > 0.5, Pe = (t, e = 1) => (t = Fe.parse(t), t = mo(t), [
|
|
4025
4053
|
Ae(t, 0),
|
|
4026
4054
|
Ae(t, 2),
|
|
4027
4055
|
Ae(t, 4),
|
|
4028
4056
|
t.length === 8 ? Ae(t, 6) / 255 : e
|
|
4029
|
-
]),
|
|
4057
|
+
]), Qt = [0, 0, 0, 0], Me = (t) => Math.floor(t).toString(16).padStart(2, "0"), Ae = (t, e) => parseInt(t.slice(e, e + 2), 16), mo = (t) => t.startsWith("#") ? t.slice(1) : t, ir = {
|
|
4030
4058
|
black: "#000000",
|
|
4031
4059
|
white: "#ffffff",
|
|
4032
4060
|
red: "#ff0000",
|
|
@@ -4058,7 +4086,7 @@ const Ga = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Fe = a.string().regex(Ga), ie = a.n
|
|
|
4058
4086
|
khaki: "#f0e68c",
|
|
4059
4087
|
crimson: "#dc143c",
|
|
4060
4088
|
transparent: "transparent"
|
|
4061
|
-
},
|
|
4089
|
+
}, yo = (t) => {
|
|
4062
4090
|
if (!t) return;
|
|
4063
4091
|
const e = t.trim().toLowerCase();
|
|
4064
4092
|
if (!(e === "transparent" || e === "none")) {
|
|
@@ -4078,42 +4106,42 @@ const Ga = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Fe = a.string().regex(Ga), ie = a.n
|
|
|
4078
4106
|
return [parseInt(n), parseInt(s), parseInt(i), o ? parseFloat(o) : 1];
|
|
4079
4107
|
}
|
|
4080
4108
|
}
|
|
4081
|
-
if (
|
|
4109
|
+
if (ir[e]) return Pe(ir[e]);
|
|
4082
4110
|
}
|
|
4083
|
-
},
|
|
4084
|
-
t =
|
|
4111
|
+
}, bo = (t) => {
|
|
4112
|
+
t = on.parse(t);
|
|
4085
4113
|
let [e, r, n] = t;
|
|
4086
4114
|
const s = t[3];
|
|
4087
4115
|
e /= 360, r /= 100, n /= 100;
|
|
4088
|
-
let i, o,
|
|
4116
|
+
let i, o, l;
|
|
4089
4117
|
if (r === 0)
|
|
4090
|
-
i = o =
|
|
4118
|
+
i = o = l = n;
|
|
4091
4119
|
else {
|
|
4092
|
-
const f = n < 0.5 ? n * (1 + r) : n + r - n * r,
|
|
4093
|
-
i = ut(
|
|
4120
|
+
const f = n < 0.5 ? n * (1 + r) : n + r - n * r, c = 2 * n - f;
|
|
4121
|
+
i = ut(c, f, e + 1 / 3), o = ut(c, f, e), l = ut(c, f, e - 1 / 3);
|
|
4094
4122
|
}
|
|
4095
|
-
return [Math.round(i * 255), Math.round(o * 255), Math.round(
|
|
4096
|
-
}, ut = (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),
|
|
4123
|
+
return [Math.round(i * 255), Math.round(o * 255), Math.round(l * 255), s];
|
|
4124
|
+
}, ut = (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), wo = (t) => {
|
|
4097
4125
|
t = _e.parse(t);
|
|
4098
4126
|
let [e, r, n] = t;
|
|
4099
4127
|
const s = t[3];
|
|
4100
4128
|
e /= 255, r /= 255, n /= 255;
|
|
4101
4129
|
const i = Math.max(e, r, n), o = Math.min(e, r, n);
|
|
4102
|
-
let
|
|
4130
|
+
let l, f, c = (i + o) / 2;
|
|
4103
4131
|
if (i === o)
|
|
4104
|
-
|
|
4132
|
+
l = f = 0;
|
|
4105
4133
|
else {
|
|
4106
4134
|
const d = i - o;
|
|
4107
|
-
f =
|
|
4135
|
+
f = c > 0.5 ? d / (2 - i - o) : d / (i + o), i === e ? l = (r - n) / d + (r < n ? 6 : 0) : i === r ? l = (n - e) / d + 2 : l = (e - r) / d + 4, l /= 6;
|
|
4108
4136
|
}
|
|
4109
|
-
return
|
|
4110
|
-
},
|
|
4137
|
+
return l *= 360, f *= 100, c *= 100, [Math.round(l), Math.round(f), Math.round(c), s];
|
|
4138
|
+
}, $o = T("#000000"), Oo = T("#ffffff"), hn = a.object({
|
|
4111
4139
|
key: a.string(),
|
|
4112
4140
|
color: et,
|
|
4113
4141
|
position: a.number(),
|
|
4114
4142
|
switched: a.boolean().optional()
|
|
4115
|
-
}),
|
|
4116
|
-
if (t.length === 0) return
|
|
4143
|
+
}), vo = a.array(hn), To = (t, e) => {
|
|
4144
|
+
if (t.length === 0) return Qt;
|
|
4117
4145
|
if (t = t.slice().sort((r, n) => r.position - n.position), e <= t[0].position) return T(t[0].color);
|
|
4118
4146
|
if (e >= t[t.length - 1].position)
|
|
4119
4147
|
return T(t[t.length - 1].color);
|
|
@@ -4122,163 +4150,163 @@ const Ga = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Fe = a.string().regex(Ga), ie = a.n
|
|
|
4122
4150
|
if (e < n.position || e > s.position) continue;
|
|
4123
4151
|
if (e === n.position) return T(n.color);
|
|
4124
4152
|
if (e === s.position) return T(s.color);
|
|
4125
|
-
const i = (e - n.position) / (s.position - n.position), o = T(n.color),
|
|
4126
|
-
|
|
4127
|
-
),
|
|
4128
|
-
|
|
4153
|
+
const i = (e - n.position) / (s.position - n.position), o = T(n.color), l = T(s.color), f = Math.round(
|
|
4154
|
+
ge(o) + i * (ge(l) - ge(o))
|
|
4155
|
+
), c = Math.round(
|
|
4156
|
+
pe(o) + i * (pe(l) - pe(o))
|
|
4129
4157
|
), d = Math.round(
|
|
4130
|
-
|
|
4131
|
-
), m =
|
|
4132
|
-
return T([f,
|
|
4158
|
+
me(o) + i * (me(l) - me(o))
|
|
4159
|
+
), m = ye(o) + i * (ye(l) - ye(o));
|
|
4160
|
+
return T([f, c, d, m]);
|
|
4133
4161
|
}
|
|
4134
4162
|
return T(t[t.length - 1].color);
|
|
4135
|
-
},
|
|
4163
|
+
}, xo = a.object({
|
|
4136
4164
|
key: a.string(),
|
|
4137
4165
|
name: a.string(),
|
|
4138
4166
|
color: tt
|
|
4139
|
-
}),
|
|
4167
|
+
}), So = a.object({
|
|
4140
4168
|
key: a.string(),
|
|
4141
4169
|
name: a.string(),
|
|
4142
|
-
swatches: a.array(
|
|
4143
|
-
}),
|
|
4170
|
+
swatches: a.array(xo)
|
|
4171
|
+
}), No = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4144
4172
|
__proto__: null,
|
|
4145
|
-
BLACK:
|
|
4146
|
-
WHITE:
|
|
4147
|
-
ZERO:
|
|
4148
|
-
aValue:
|
|
4149
|
-
bValue:
|
|
4173
|
+
BLACK: $o,
|
|
4174
|
+
WHITE: Oo,
|
|
4175
|
+
ZERO: Qt,
|
|
4176
|
+
aValue: ye,
|
|
4177
|
+
bValue: me,
|
|
4150
4178
|
colorZ: tt,
|
|
4151
4179
|
construct: T,
|
|
4152
|
-
contrast:
|
|
4180
|
+
contrast: St,
|
|
4153
4181
|
crudeZ: et,
|
|
4154
|
-
cssString:
|
|
4155
|
-
equals:
|
|
4156
|
-
fromCSS:
|
|
4157
|
-
fromGradient:
|
|
4158
|
-
fromHSLA:
|
|
4159
|
-
gValue:
|
|
4160
|
-
gradientZ:
|
|
4161
|
-
grayness:
|
|
4162
|
-
hex:
|
|
4163
|
-
hsla:
|
|
4164
|
-
isColor:
|
|
4165
|
-
isCrude:
|
|
4166
|
-
isDark:
|
|
4167
|
-
isLight:
|
|
4168
|
-
isZero:
|
|
4169
|
-
luminance:
|
|
4170
|
-
paletteZ:
|
|
4171
|
-
pickByContrast:
|
|
4172
|
-
rValue:
|
|
4173
|
-
rgbCSS:
|
|
4174
|
-
rgbString:
|
|
4175
|
-
rgba1:
|
|
4176
|
-
rgbaCSS:
|
|
4177
|
-
setAlpha:
|
|
4178
|
-
stopZ:
|
|
4179
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4180
|
-
lower:
|
|
4181
|
-
upper:
|
|
4182
|
-
},
|
|
4182
|
+
cssString: so,
|
|
4183
|
+
equals: un,
|
|
4184
|
+
fromCSS: yo,
|
|
4185
|
+
fromGradient: To,
|
|
4186
|
+
fromHSLA: bo,
|
|
4187
|
+
gValue: pe,
|
|
4188
|
+
gradientZ: vo,
|
|
4189
|
+
grayness: ho,
|
|
4190
|
+
hex: io,
|
|
4191
|
+
hsla: lo,
|
|
4192
|
+
isColor: no,
|
|
4193
|
+
isCrude: ro,
|
|
4194
|
+
isDark: go,
|
|
4195
|
+
isLight: po,
|
|
4196
|
+
isZero: uo,
|
|
4197
|
+
luminance: Oe,
|
|
4198
|
+
paletteZ: So,
|
|
4199
|
+
pickByContrast: fo,
|
|
4200
|
+
rValue: ge,
|
|
4201
|
+
rgbCSS: ao,
|
|
4202
|
+
rgbString: cn,
|
|
4203
|
+
rgba1: oo,
|
|
4204
|
+
rgbaCSS: ln,
|
|
4205
|
+
setAlpha: co,
|
|
4206
|
+
stopZ: hn
|
|
4207
|
+
}, Symbol.toStringTag, { value: "Module" })), fn = a.int().min(0).max(255), dn = 255, gn = 0, Io = {
|
|
4208
|
+
lower: gn,
|
|
4209
|
+
upper: dn + 1
|
|
4210
|
+
}, pn = a.object({
|
|
4183
4211
|
name: a.string(),
|
|
4184
4212
|
key: a.string()
|
|
4185
|
-
}),
|
|
4186
|
-
subject:
|
|
4213
|
+
}), ve = (t) => a.object({
|
|
4214
|
+
subject: pn,
|
|
4187
4215
|
resource: t,
|
|
4188
|
-
authority:
|
|
4189
|
-
}),
|
|
4216
|
+
authority: fn
|
|
4217
|
+
}), Mo = (...t) => (e) => e.filter((r) => {
|
|
4190
4218
|
let n = !1;
|
|
4191
4219
|
return r.to != null && (n = t.includes(r.to.resource)), r.from != null && !n && (n = t.includes(r.from.resource)), n;
|
|
4192
|
-
}),
|
|
4193
|
-
from:
|
|
4220
|
+
}), mn = (t) => a.object({
|
|
4221
|
+
from: ve(t),
|
|
4194
4222
|
to: a.null()
|
|
4195
|
-
}),
|
|
4223
|
+
}), yn = (t) => a.object({
|
|
4196
4224
|
from: a.null(),
|
|
4197
|
-
to:
|
|
4198
|
-
}),
|
|
4199
|
-
|
|
4200
|
-
|
|
4225
|
+
to: ve(t)
|
|
4226
|
+
}), Ao = (t) => a.union([
|
|
4227
|
+
mn(t),
|
|
4228
|
+
yn(t),
|
|
4201
4229
|
a.object({
|
|
4202
|
-
from:
|
|
4203
|
-
to:
|
|
4230
|
+
from: ve(t),
|
|
4231
|
+
to: ve(t)
|
|
4204
4232
|
})
|
|
4205
|
-
]),
|
|
4233
|
+
]), zu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4206
4234
|
__proto__: null,
|
|
4207
|
-
ABSOLUTE_AUTHORITY:
|
|
4208
|
-
AUTHORITY_BOUNDS:
|
|
4209
|
-
ZERO_AUTHORITY:
|
|
4210
|
-
acquireZ:
|
|
4211
|
-
authorityZ:
|
|
4212
|
-
filterTransfersByChannelKey:
|
|
4213
|
-
releaseZ:
|
|
4214
|
-
stateZ:
|
|
4215
|
-
subjectZ:
|
|
4216
|
-
transferZ:
|
|
4217
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4235
|
+
ABSOLUTE_AUTHORITY: dn,
|
|
4236
|
+
AUTHORITY_BOUNDS: Io,
|
|
4237
|
+
ZERO_AUTHORITY: gn,
|
|
4238
|
+
acquireZ: yn,
|
|
4239
|
+
authorityZ: fn,
|
|
4240
|
+
filterTransfersByChannelKey: Mo,
|
|
4241
|
+
releaseZ: mn,
|
|
4242
|
+
stateZ: ve,
|
|
4243
|
+
subjectZ: pn,
|
|
4244
|
+
transferZ: Ao
|
|
4245
|
+
}, Symbol.toStringTag, { value: "Module" })), Eo = (t) => Object.getOwnPropertySymbols(globalThis).includes(t), Uo = (t, e) => {
|
|
4218
4246
|
const r = Symbol.for(t);
|
|
4219
|
-
if (!
|
|
4247
|
+
if (!Eo(r)) {
|
|
4220
4248
|
const n = e();
|
|
4221
4249
|
Object.defineProperty(globalThis, r, { value: n });
|
|
4222
4250
|
}
|
|
4223
4251
|
return () => globalThis[r];
|
|
4224
|
-
},
|
|
4225
|
-
static discriminator =
|
|
4226
|
-
discriminator =
|
|
4252
|
+
}, bn = "sy_x_error", Bo = (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), wn = (t) => class de extends Error {
|
|
4253
|
+
static discriminator = bn;
|
|
4254
|
+
discriminator = de.discriminator;
|
|
4227
4255
|
static TYPE = t;
|
|
4228
|
-
type =
|
|
4229
|
-
static matches =
|
|
4230
|
-
matches =
|
|
4256
|
+
type = de.TYPE;
|
|
4257
|
+
static matches = Bo(t);
|
|
4258
|
+
matches = de.matches;
|
|
4231
4259
|
constructor(r, n) {
|
|
4232
|
-
super(r, n), this.name =
|
|
4260
|
+
super(r, n), this.name = de.TYPE;
|
|
4233
4261
|
}
|
|
4234
4262
|
static sub(r) {
|
|
4235
|
-
return
|
|
4263
|
+
return wn(`${t}.${r}`);
|
|
4236
4264
|
}
|
|
4237
|
-
},
|
|
4265
|
+
}, jo = (t) => {
|
|
4238
4266
|
if (t == null || typeof t != "object") return !1;
|
|
4239
4267
|
const e = t;
|
|
4240
|
-
if (e.discriminator !==
|
|
4268
|
+
if (e.discriminator !== bn) return !1;
|
|
4241
4269
|
if (!("type" in e))
|
|
4242
4270
|
throw new Error(
|
|
4243
4271
|
`X Error is missing its type property: ${JSON.stringify(e)}`
|
|
4244
4272
|
);
|
|
4245
4273
|
return !0;
|
|
4246
|
-
},
|
|
4247
|
-
class
|
|
4274
|
+
}, ce = "unknown", ar = "nil";
|
|
4275
|
+
class Co {
|
|
4248
4276
|
providers = [];
|
|
4249
4277
|
register(e) {
|
|
4250
4278
|
this.providers.push(e);
|
|
4251
4279
|
}
|
|
4252
4280
|
encode(e) {
|
|
4253
|
-
if (e == null) return { type:
|
|
4254
|
-
if (
|
|
4281
|
+
if (e == null) return { type: ar, data: "" };
|
|
4282
|
+
if (jo(e))
|
|
4255
4283
|
for (const r of this.providers) {
|
|
4256
4284
|
const n = r.encode(e);
|
|
4257
4285
|
if (n != null) return n;
|
|
4258
4286
|
}
|
|
4259
|
-
if (e instanceof Error) return { type:
|
|
4260
|
-
if (typeof e == "string") return { type:
|
|
4287
|
+
if (e instanceof Error) return { type: ce, data: e.message };
|
|
4288
|
+
if (typeof e == "string") return { type: ce, data: e };
|
|
4261
4289
|
try {
|
|
4262
|
-
return { type:
|
|
4290
|
+
return { type: ce, data: JSON.stringify(e) };
|
|
4263
4291
|
} catch {
|
|
4264
|
-
return { type:
|
|
4292
|
+
return { type: ce, data: "unable to encode error information" };
|
|
4265
4293
|
}
|
|
4266
4294
|
}
|
|
4267
4295
|
decode(e) {
|
|
4268
|
-
if (e == null || e.type ===
|
|
4269
|
-
if (e.type ===
|
|
4296
|
+
if (e == null || e.type === ar) return null;
|
|
4297
|
+
if (e.type === ce) return new or(e.data);
|
|
4270
4298
|
for (const r of this.providers) {
|
|
4271
4299
|
const n = r.decode(e);
|
|
4272
4300
|
if (n != null) return n;
|
|
4273
4301
|
}
|
|
4274
|
-
return new
|
|
4302
|
+
return new or(e.data);
|
|
4275
4303
|
}
|
|
4276
4304
|
}
|
|
4277
|
-
|
|
4278
|
-
class
|
|
4305
|
+
Uo("synnax-error-registry", () => new Co());
|
|
4306
|
+
class or extends wn("unknown") {
|
|
4279
4307
|
}
|
|
4280
4308
|
a.object({ type: a.string(), data: a.string() });
|
|
4281
|
-
const
|
|
4309
|
+
const Zu = () => new Promise((t) => setTimeout(t, 0)), Ro = O.object({
|
|
4282
4310
|
jsonrpc: O.literal("2.0"),
|
|
4283
4311
|
method: O.string(),
|
|
4284
4312
|
// params should be z.union([z.record(z.string(), z.json()),
|
|
@@ -4286,12 +4314,12 @@ const qu = () => new Promise((t) => setTimeout(t, 0)), Bo = O.object({
|
|
|
4286
4314
|
// definition of params then in the JSON-RPC spec.
|
|
4287
4315
|
params: O.any().optional(),
|
|
4288
4316
|
id: O.union([O.string(), O.number(), O.null()]).optional()
|
|
4289
|
-
}),
|
|
4317
|
+
}), $n = O.object({
|
|
4290
4318
|
jsonrpc: O.literal("2.0"),
|
|
4291
4319
|
id: O.union([O.string(), O.number(), O.null()])
|
|
4292
|
-
}),
|
|
4320
|
+
}), Lo = $n.extend({
|
|
4293
4321
|
result: O.json()
|
|
4294
|
-
}),
|
|
4322
|
+
}), Do = $n.extend({
|
|
4295
4323
|
error: O.object({
|
|
4296
4324
|
code: O.number().int(),
|
|
4297
4325
|
// This should be z.string(), but the VSCode JSON RPC implementation uses a looser
|
|
@@ -4299,35 +4327,35 @@ const qu = () => new Promise((t) => setTimeout(t, 0)), Bo = O.object({
|
|
|
4299
4327
|
message: O.string().optional(),
|
|
4300
4328
|
data: O.json().optional()
|
|
4301
4329
|
})
|
|
4302
|
-
}),
|
|
4303
|
-
O.union([
|
|
4304
|
-
const
|
|
4305
|
-
key:
|
|
4330
|
+
}), Po = O.union([Lo, Do]);
|
|
4331
|
+
O.union([Ro, Po]);
|
|
4332
|
+
const ko = O.uuid(), qo = O.object({
|
|
4333
|
+
key: ko,
|
|
4306
4334
|
name: O.string().min(1),
|
|
4307
4335
|
color: O.string()
|
|
4308
|
-
}),
|
|
4336
|
+
}), zo = (t, e, r) => {
|
|
4309
4337
|
const n = t.get(e);
|
|
4310
4338
|
return n === void 0 ? (t.set(e, r), r) : n;
|
|
4311
|
-
},
|
|
4339
|
+
}, Fu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4312
4340
|
__proto__: null,
|
|
4313
|
-
getOrSetDefault:
|
|
4314
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4341
|
+
getOrSetDefault: zo
|
|
4342
|
+
}, Symbol.toStringTag, { value: "Module" })), Nt = a.string().regex(/^\d+\.\d+\.\d+$/), Se = ((t, e, r = {}) => {
|
|
4315
4343
|
r.checkMajor ??= !0, r.checkMinor ??= !0, r.checkPatch ??= !0;
|
|
4316
|
-
const n =
|
|
4344
|
+
const n = Nt.parse(t), s = Nt.parse(e), [i, o, l] = n.split(".").map(Number), [f, c, d] = s.split(".").map(Number);
|
|
4317
4345
|
if (r.checkMajor) {
|
|
4318
4346
|
if (i < f) return Ue;
|
|
4319
4347
|
if (i > f) return Be;
|
|
4320
4348
|
}
|
|
4321
4349
|
if (r.checkMinor) {
|
|
4322
|
-
if (o <
|
|
4323
|
-
if (o >
|
|
4350
|
+
if (o < c) return Ue;
|
|
4351
|
+
if (o > c) return Be;
|
|
4324
4352
|
}
|
|
4325
4353
|
if (r.checkPatch) {
|
|
4326
|
-
if (
|
|
4327
|
-
if (
|
|
4354
|
+
if (l < d) return Ue;
|
|
4355
|
+
if (l > d) return Be;
|
|
4328
4356
|
}
|
|
4329
4357
|
return ae;
|
|
4330
|
-
}),
|
|
4358
|
+
}), Zo = (t, e, r = {}) => wr(Se(t, e, r)), On = (t, e, r = {}) => br(Se(t, e, r)), Fo = (t, e, r = {}) => yr(Se(t, e, r)), Yo = ({
|
|
4331
4359
|
name: t,
|
|
4332
4360
|
migrate: e
|
|
4333
4361
|
}) => (r) => {
|
|
@@ -4337,7 +4365,7 @@ const Lo = O.uuid(), Do = O.object({
|
|
|
4337
4365
|
} catch (n) {
|
|
4338
4366
|
throw console.log(`${t} failed to migrate from ${r.version}`), console.error(n), n;
|
|
4339
4367
|
}
|
|
4340
|
-
},
|
|
4368
|
+
}, Wo = ({
|
|
4341
4369
|
name: t,
|
|
4342
4370
|
migrations: e,
|
|
4343
4371
|
targetSchema: r,
|
|
@@ -4346,59 +4374,59 @@ const Lo = O.uuid(), Do = O.object({
|
|
|
4346
4374
|
}) => {
|
|
4347
4375
|
const i = Object.keys(e).sort(Se).pop();
|
|
4348
4376
|
if (i == null)
|
|
4349
|
-
return (
|
|
4350
|
-
if (
|
|
4377
|
+
return (c) => {
|
|
4378
|
+
if (c.version ??= n, c.version !== s.version)
|
|
4351
4379
|
return console.log(
|
|
4352
|
-
`${t} version ${
|
|
4380
|
+
`${t} version ${c.version} is newer than latest version of ${s.version}.
|
|
4353
4381
|
Returning default instead.
|
|
4354
4382
|
`
|
|
4355
4383
|
), s;
|
|
4356
4384
|
try {
|
|
4357
|
-
return r != null ? r.parse(
|
|
4385
|
+
return r != null ? r.parse(c) : c;
|
|
4358
4386
|
} catch (d) {
|
|
4359
4387
|
return console.log(`${t} failed to parse default. Exiting with default`), console.error(d), s;
|
|
4360
4388
|
}
|
|
4361
4389
|
};
|
|
4362
4390
|
const o = Object.keys(e).length;
|
|
4363
|
-
let
|
|
4364
|
-
const f = (
|
|
4391
|
+
let l = !1;
|
|
4392
|
+
const f = (c) => {
|
|
4365
4393
|
try {
|
|
4366
|
-
if (o === 0 ||
|
|
4367
|
-
return console.log(
|
|
4368
|
-
const d =
|
|
4369
|
-
return
|
|
4394
|
+
if (o === 0 || On(c.version, i))
|
|
4395
|
+
return console.log(l ? `${t} ${c.version} now up to date` : `${t} version ${c.version} is up to date with target version ${s.version}`), c;
|
|
4396
|
+
const d = c.version, m = e[d], p = m(c);
|
|
4397
|
+
return l = !0, f(p);
|
|
4370
4398
|
} catch (d) {
|
|
4371
4399
|
return console.log(
|
|
4372
|
-
`${t} failed to migrate from ${
|
|
4400
|
+
`${t} failed to migrate from ${c.version} to ${i}`
|
|
4373
4401
|
), console.error(d), s;
|
|
4374
4402
|
}
|
|
4375
4403
|
};
|
|
4376
|
-
return (
|
|
4404
|
+
return (c) => {
|
|
4377
4405
|
try {
|
|
4378
|
-
if (
|
|
4406
|
+
if (c.version == null)
|
|
4379
4407
|
if (n != null)
|
|
4380
4408
|
console.log(
|
|
4381
4409
|
`${t} version is null. Setting version to default of ${n}`
|
|
4382
|
-
),
|
|
4410
|
+
), c.version = n;
|
|
4383
4411
|
else
|
|
4384
4412
|
return console.log(
|
|
4385
4413
|
`${t} version is null and no default version set. Exiting with default`
|
|
4386
4414
|
), s;
|
|
4387
|
-
return f(
|
|
4415
|
+
return f(c);
|
|
4388
4416
|
} catch (d) {
|
|
4389
4417
|
return console.log(`${t} failed to parse final result. Exiting with default`), console.error(d), s;
|
|
4390
4418
|
}
|
|
4391
4419
|
};
|
|
4392
|
-
},
|
|
4420
|
+
}, Yu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4393
4421
|
__proto__: null,
|
|
4394
4422
|
compareSemVer: Se,
|
|
4395
|
-
createMigration:
|
|
4396
|
-
migrator:
|
|
4397
|
-
semVerNewer:
|
|
4398
|
-
semVerOlder:
|
|
4399
|
-
semVerZ:
|
|
4400
|
-
versionsEqual:
|
|
4401
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4423
|
+
createMigration: Yo,
|
|
4424
|
+
migrator: Wo,
|
|
4425
|
+
semVerNewer: On,
|
|
4426
|
+
semVerOlder: Fo,
|
|
4427
|
+
semVerZ: Nt,
|
|
4428
|
+
versionsEqual: Zo
|
|
4429
|
+
}, Symbol.toStringTag, { value: "Module" })), vn = ["standard", "scientific", "engineering"], Vo = a.enum(vn), Go = (t, e, r) => {
|
|
4402
4430
|
if (Number.isNaN(t)) return "NaN";
|
|
4403
4431
|
if (t === 1 / 0) return "∞";
|
|
4404
4432
|
if (t === -1 / 0) return "-∞";
|
|
@@ -4407,32 +4435,32 @@ const Lo = O.uuid(), Do = O.object({
|
|
|
4407
4435
|
return e === 0 ? "0ᴇ0" : `0.${"0".repeat(e)}ᴇ0`;
|
|
4408
4436
|
let n;
|
|
4409
4437
|
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}`;
|
|
4410
|
-
},
|
|
4438
|
+
}, Wu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4411
4439
|
__proto__: null,
|
|
4412
|
-
NOTATIONS:
|
|
4413
|
-
notationZ:
|
|
4414
|
-
stringifyNumber:
|
|
4415
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4440
|
+
NOTATIONS: vn,
|
|
4441
|
+
notationZ: Vo,
|
|
4442
|
+
stringifyNumber: Go
|
|
4443
|
+
}, Symbol.toStringTag, { value: "Module" })), Vu = (t) => Array.isArray(t) ? [...t] : typeof t == "object" && t !== null ? { ...t } : t, Tn = a.enum([
|
|
4416
4444
|
"success",
|
|
4417
4445
|
"info",
|
|
4418
4446
|
"warning",
|
|
4419
4447
|
"error",
|
|
4420
4448
|
"loading",
|
|
4421
4449
|
"disabled"
|
|
4422
|
-
]),
|
|
4450
|
+
]), Ho = (t) => a.object({
|
|
4423
4451
|
key: a.string(),
|
|
4424
4452
|
name: a.string().default(""),
|
|
4425
|
-
variant:
|
|
4453
|
+
variant: Tn,
|
|
4426
4454
|
message: a.string(),
|
|
4427
4455
|
description: a.string().optional(),
|
|
4428
4456
|
time: $.z,
|
|
4429
|
-
labels:
|
|
4457
|
+
labels: lr(qo).optional(),
|
|
4430
4458
|
details: t ?? a.unknown().optional()
|
|
4431
|
-
}),
|
|
4459
|
+
}), Xo = a.object({
|
|
4432
4460
|
stack: a.string()
|
|
4433
|
-
}),
|
|
4461
|
+
}), Jo = (t, e) => {
|
|
4434
4462
|
if (!(t instanceof Error)) throw t;
|
|
4435
|
-
return
|
|
4463
|
+
return xn({
|
|
4436
4464
|
variant: "error",
|
|
4437
4465
|
message: e ?? t.message,
|
|
4438
4466
|
description: e != null ? t.message : void 0,
|
|
@@ -4440,37 +4468,37 @@ const Lo = O.uuid(), Do = O.object({
|
|
|
4440
4468
|
stack: t.stack ?? ""
|
|
4441
4469
|
}
|
|
4442
4470
|
});
|
|
4443
|
-
},
|
|
4444
|
-
key:
|
|
4471
|
+
}, xn = (t) => ({
|
|
4472
|
+
key: Ht(),
|
|
4445
4473
|
time: $.now(),
|
|
4446
4474
|
name: "",
|
|
4447
4475
|
...t
|
|
4448
|
-
}),
|
|
4476
|
+
}), Ko = (t, e = []) => {
|
|
4449
4477
|
if (t != null)
|
|
4450
4478
|
return Array.isArray(e) ? e.includes(t) ? t : void 0 : e === t ? t : void 0;
|
|
4451
|
-
},
|
|
4479
|
+
}, Qo = (t, e = []) => {
|
|
4452
4480
|
if (t != null)
|
|
4453
4481
|
return Array.isArray(e) ? e.includes(t) ? void 0 : t : e === t ? void 0 : t;
|
|
4454
|
-
},
|
|
4482
|
+
}, Gu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4455
4483
|
__proto__: null,
|
|
4456
|
-
create:
|
|
4457
|
-
exceptionDetailsSchema:
|
|
4458
|
-
fromException:
|
|
4459
|
-
keepVariants:
|
|
4460
|
-
removeVariants:
|
|
4461
|
-
statusZ:
|
|
4462
|
-
variantZ:
|
|
4463
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4484
|
+
create: xn,
|
|
4485
|
+
exceptionDetailsSchema: Xo,
|
|
4486
|
+
fromException: Jo,
|
|
4487
|
+
keepVariants: Ko,
|
|
4488
|
+
removeVariants: Qo,
|
|
4489
|
+
statusZ: Ho,
|
|
4490
|
+
variantZ: Tn
|
|
4491
|
+
}, Symbol.toStringTag, { value: "Module" })), _o = (t, e = "") => {
|
|
4464
4492
|
if (typeof t == "string") return t;
|
|
4465
4493
|
const r = t.length;
|
|
4466
4494
|
return r === 0 ? e : r === 1 ? t[0] : r === 2 ? `${t[0]} and ${t[1]}` : `${t.slice(0, -1).join(", ")}, and ${t[r - 1]}`;
|
|
4467
|
-
},
|
|
4495
|
+
}, eu = (t) => {
|
|
4468
4496
|
const e = t.split(" "), r = /* @__PURE__ */ new Set(), n = e.map((o) => o.charAt(0).toLowerCase()).join("");
|
|
4469
4497
|
r.add(n.replace(/-/g, "_")), r.add(n.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_"));
|
|
4470
4498
|
const s = /\d+/g;
|
|
4471
|
-
t.match(s) && e.forEach((o,
|
|
4499
|
+
t.match(s) && e.forEach((o, l) => {
|
|
4472
4500
|
if (s.test(o)) {
|
|
4473
|
-
const f = e.map((
|
|
4501
|
+
const f = e.map((c, d) => d !== l ? c.charAt(0).toLowerCase() : c).join("");
|
|
4474
4502
|
r.add(f.replace(/-/g, "_")), r.add(
|
|
4475
4503
|
f.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_")
|
|
4476
4504
|
);
|
|
@@ -4482,54 +4510,54 @@ const Lo = O.uuid(), Do = O.object({
|
|
|
4482
4510
|
return r.add(i.join("").replace(/-/g, "_")), r.add(i.join("_").replace(/-/g, "_")), Array.from(r).filter(
|
|
4483
4511
|
(o) => o.length >= 2 && o.length <= 12 && !/^\d/.test(o)
|
|
4484
4512
|
);
|
|
4485
|
-
},
|
|
4513
|
+
}, tu = (t, e) => t.startsWith(e) ? t.slice(e.length) : t, ru = (t) => t.length === 0 ? t : t[t.length - 1] === "y" ? `${t.slice(0, -1)}ies` : t[t.length - 1] === "s" || t[t.length - 1] === "x" || t[t.length - 1] === "z" || t.endsWith("ch") || t.endsWith("sh") ? `${t}es` : `${t}s`, Hu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4486
4514
|
__proto__: null,
|
|
4487
|
-
createShortIdentifiers:
|
|
4488
|
-
naturalLanguageJoin:
|
|
4489
|
-
pluralName:
|
|
4490
|
-
trimPrefix:
|
|
4491
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4492
|
-
var
|
|
4515
|
+
createShortIdentifiers: eu,
|
|
4516
|
+
naturalLanguageJoin: _o,
|
|
4517
|
+
pluralName: ru,
|
|
4518
|
+
trimPrefix: tu
|
|
4519
|
+
}, Symbol.toStringTag, { value: "Module" })), nu = new Error("request for lock canceled");
|
|
4520
|
+
var su = function(t, e, r, n) {
|
|
4493
4521
|
function s(i) {
|
|
4494
4522
|
return i instanceof r ? i : new r(function(o) {
|
|
4495
4523
|
o(i);
|
|
4496
4524
|
});
|
|
4497
4525
|
}
|
|
4498
4526
|
return new (r || (r = Promise))(function(i, o) {
|
|
4499
|
-
function
|
|
4527
|
+
function l(d) {
|
|
4500
4528
|
try {
|
|
4501
|
-
|
|
4529
|
+
c(n.next(d));
|
|
4502
4530
|
} catch (m) {
|
|
4503
4531
|
o(m);
|
|
4504
4532
|
}
|
|
4505
4533
|
}
|
|
4506
4534
|
function f(d) {
|
|
4507
4535
|
try {
|
|
4508
|
-
|
|
4536
|
+
c(n.throw(d));
|
|
4509
4537
|
} catch (m) {
|
|
4510
4538
|
o(m);
|
|
4511
4539
|
}
|
|
4512
4540
|
}
|
|
4513
|
-
function
|
|
4514
|
-
d.done ? i(d.value) : s(d.value).then(
|
|
4541
|
+
function c(d) {
|
|
4542
|
+
d.done ? i(d.value) : s(d.value).then(l, f);
|
|
4515
4543
|
}
|
|
4516
|
-
|
|
4544
|
+
c((n = n.apply(t, e || [])).next());
|
|
4517
4545
|
});
|
|
4518
4546
|
};
|
|
4519
|
-
class
|
|
4520
|
-
constructor(e, r =
|
|
4547
|
+
class iu {
|
|
4548
|
+
constructor(e, r = nu) {
|
|
4521
4549
|
this._value = e, this._cancelError = r, this._queue = [], this._weightedWaiters = [];
|
|
4522
4550
|
}
|
|
4523
4551
|
acquire(e = 1, r = 0) {
|
|
4524
4552
|
if (e <= 0)
|
|
4525
4553
|
throw new Error(`invalid weight ${e}: must be positive`);
|
|
4526
4554
|
return new Promise((n, s) => {
|
|
4527
|
-
const i = { resolve: n, reject: s, weight: e, priority: r }, o =
|
|
4555
|
+
const i = { resolve: n, reject: s, weight: e, priority: r }, o = Sn(this._queue, (l) => r <= l.priority);
|
|
4528
4556
|
o === -1 && e <= this._value ? this._dispatchItem(i) : this._queue.splice(o + 1, 0, i);
|
|
4529
4557
|
});
|
|
4530
4558
|
}
|
|
4531
4559
|
runExclusive(e) {
|
|
4532
|
-
return
|
|
4560
|
+
return su(this, arguments, void 0, function* (r, n = 1, s = 0) {
|
|
4533
4561
|
const [i, o] = yield this.acquire(n, s);
|
|
4534
4562
|
try {
|
|
4535
4563
|
return yield r(i);
|
|
@@ -4542,7 +4570,7 @@ class ru {
|
|
|
4542
4570
|
if (e <= 0)
|
|
4543
4571
|
throw new Error(`invalid weight ${e}: must be positive`);
|
|
4544
4572
|
return this._couldLockImmediately(e, r) ? Promise.resolve() : new Promise((n) => {
|
|
4545
|
-
this._weightedWaiters[e - 1] || (this._weightedWaiters[e - 1] = []),
|
|
4573
|
+
this._weightedWaiters[e - 1] || (this._weightedWaiters[e - 1] = []), au(this._weightedWaiters[e - 1], { resolve: n, priority: r });
|
|
4546
4574
|
});
|
|
4547
4575
|
}
|
|
4548
4576
|
isLocked() {
|
|
@@ -4597,49 +4625,49 @@ class ru {
|
|
|
4597
4625
|
return (this._queue.length === 0 || this._queue[0].priority < r) && e <= this._value;
|
|
4598
4626
|
}
|
|
4599
4627
|
}
|
|
4600
|
-
function
|
|
4601
|
-
const r =
|
|
4628
|
+
function au(t, e) {
|
|
4629
|
+
const r = Sn(t, (n) => e.priority <= n.priority);
|
|
4602
4630
|
t.splice(r + 1, 0, e);
|
|
4603
4631
|
}
|
|
4604
|
-
function
|
|
4632
|
+
function Sn(t, e) {
|
|
4605
4633
|
for (let r = t.length - 1; r >= 0; r--)
|
|
4606
4634
|
if (e(t[r]))
|
|
4607
4635
|
return r;
|
|
4608
4636
|
return -1;
|
|
4609
4637
|
}
|
|
4610
|
-
var
|
|
4638
|
+
var ou = function(t, e, r, n) {
|
|
4611
4639
|
function s(i) {
|
|
4612
4640
|
return i instanceof r ? i : new r(function(o) {
|
|
4613
4641
|
o(i);
|
|
4614
4642
|
});
|
|
4615
4643
|
}
|
|
4616
4644
|
return new (r || (r = Promise))(function(i, o) {
|
|
4617
|
-
function
|
|
4645
|
+
function l(d) {
|
|
4618
4646
|
try {
|
|
4619
|
-
|
|
4647
|
+
c(n.next(d));
|
|
4620
4648
|
} catch (m) {
|
|
4621
4649
|
o(m);
|
|
4622
4650
|
}
|
|
4623
4651
|
}
|
|
4624
4652
|
function f(d) {
|
|
4625
4653
|
try {
|
|
4626
|
-
|
|
4654
|
+
c(n.throw(d));
|
|
4627
4655
|
} catch (m) {
|
|
4628
4656
|
o(m);
|
|
4629
4657
|
}
|
|
4630
4658
|
}
|
|
4631
|
-
function
|
|
4632
|
-
d.done ? i(d.value) : s(d.value).then(
|
|
4659
|
+
function c(d) {
|
|
4660
|
+
d.done ? i(d.value) : s(d.value).then(l, f);
|
|
4633
4661
|
}
|
|
4634
|
-
|
|
4662
|
+
c((n = n.apply(t, e || [])).next());
|
|
4635
4663
|
});
|
|
4636
4664
|
};
|
|
4637
|
-
class
|
|
4665
|
+
class uu {
|
|
4638
4666
|
constructor(e) {
|
|
4639
|
-
this._semaphore = new
|
|
4667
|
+
this._semaphore = new iu(1, e);
|
|
4640
4668
|
}
|
|
4641
4669
|
acquire() {
|
|
4642
|
-
return
|
|
4670
|
+
return ou(this, arguments, void 0, function* (e = 0) {
|
|
4643
4671
|
const [, r] = yield this._semaphore.acquire(1, e);
|
|
4644
4672
|
return r;
|
|
4645
4673
|
});
|
|
@@ -4660,34 +4688,34 @@ class iu {
|
|
|
4660
4688
|
return this._semaphore.cancel();
|
|
4661
4689
|
}
|
|
4662
4690
|
}
|
|
4663
|
-
class
|
|
4691
|
+
class Nn extends uu {
|
|
4664
4692
|
constructor(e) {
|
|
4665
4693
|
super(), Object.assign(this, e);
|
|
4666
4694
|
}
|
|
4667
4695
|
}
|
|
4668
|
-
const
|
|
4696
|
+
const lu = (t) => new Nn(t), Xu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4669
4697
|
__proto__: null,
|
|
4670
|
-
mutex:
|
|
4671
|
-
newMutex:
|
|
4698
|
+
mutex: Nn,
|
|
4699
|
+
newMutex: lu
|
|
4672
4700
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4673
|
-
function
|
|
4701
|
+
function In(t) {
|
|
4674
4702
|
var e, r, n = "";
|
|
4675
4703
|
if (typeof t == "string" || typeof t == "number") n += t;
|
|
4676
4704
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
4677
4705
|
var s = t.length;
|
|
4678
|
-
for (e = 0; e < s; e++) t[e] && (r =
|
|
4706
|
+
for (e = 0; e < s; e++) t[e] && (r = In(t[e])) && (n && (n += " "), n += r);
|
|
4679
4707
|
} else for (r in t) t[r] && (n && (n += " "), n += r);
|
|
4680
4708
|
return n;
|
|
4681
4709
|
}
|
|
4682
|
-
function
|
|
4683
|
-
for (var t, e, r = 0, n = "", s = arguments.length; r < s; r++) (t = arguments[r]) && (e =
|
|
4710
|
+
function cu() {
|
|
4711
|
+
for (var t, e, r = 0, n = "", s = arguments.length; r < s; r++) (t = arguments[r]) && (e = In(t)) && (n && (n += " "), n += e);
|
|
4684
4712
|
return n;
|
|
4685
4713
|
}
|
|
4686
|
-
const
|
|
4687
|
-
const e = (...r) =>
|
|
4688
|
-
return e.B = (...r) => t + ne + r.join(ne), e.E = (r) => t +
|
|
4714
|
+
const hu = cu, ne = "-", ur = "__", Ee = "--", fu = (t) => {
|
|
4715
|
+
const e = (...r) => hu(...r);
|
|
4716
|
+
return e.B = (...r) => t + ne + r.join(ne), e.E = (r) => t + ur + r, e.M = (...r) => t + Ee + r.join("-"), e.BM = (r, ...n) => e.B(r) + Ee + n.join("-"), e.BE = (r, ...n) => e.B(r) + ur + n.join(ne), e.BEM = (r, n, ...s) => e.BE(r, n) + Ee + s.join(ne), e.var = (...r) => Ee + t + ne + r.join(ne), e;
|
|
4689
4717
|
};
|
|
4690
|
-
class
|
|
4718
|
+
class du {
|
|
4691
4719
|
rows = [];
|
|
4692
4720
|
columns = [];
|
|
4693
4721
|
prefix;
|
|
@@ -4716,57 +4744,57 @@ class cu {
|
|
|
4716
4744
|
};
|
|
4717
4745
|
}
|
|
4718
4746
|
}
|
|
4719
|
-
const
|
|
4747
|
+
const gu = (t, e) => Object.entries(e).forEach(
|
|
4720
4748
|
([r, n]) => n != null && t.style.setProperty(r, `${n}`)
|
|
4721
|
-
),
|
|
4749
|
+
), pu = (t, e) => Array.from(t.style).forEach((r) => {
|
|
4722
4750
|
r.startsWith(e) && t.style.removeProperty(r);
|
|
4723
|
-
}),
|
|
4724
|
-
const e =
|
|
4725
|
-
return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M("location",
|
|
4751
|
+
}), mu = (t) => {
|
|
4752
|
+
const e = fu(t);
|
|
4753
|
+
return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M("location", Zs.construct(r)), e.disabled = (r) => r === !0 && e.M("disabled"), e.align = (r) => e.M(r), e.dir = (r) => r != null && e.M("direction", Is.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 = gu, e.removeVars = pu, e.newGridBuilder = (r) => new du(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) => {
|
|
4726
4754
|
if (!(r == null || r === !1))
|
|
4727
|
-
return typeof r == "number" ? `var(--${t}-gray-l${r})` :
|
|
4755
|
+
return typeof r == "number" ? `var(--${t}-gray-l${r})` : No.cssString(r);
|
|
4728
4756
|
}, e.levelSizeVar = (r) => `var(--${t}-${r}-size)`, e.level = (r) => e.M(`level-${r}`), e;
|
|
4729
|
-
},
|
|
4757
|
+
}, Ju = mu("pluto");
|
|
4730
4758
|
export {
|
|
4731
|
-
|
|
4759
|
+
qu as A,
|
|
4732
4760
|
Yu as B,
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
Zu as W,
|
|
4761
|
+
Ju as C,
|
|
4762
|
+
Eu as D,
|
|
4763
|
+
Wu as F,
|
|
4764
|
+
Hu as G,
|
|
4765
|
+
Vu as H,
|
|
4766
|
+
Xu as J,
|
|
4767
|
+
Zs as K,
|
|
4768
|
+
Lu as O,
|
|
4769
|
+
Nu as Q,
|
|
4770
|
+
No as R,
|
|
4771
|
+
ku as S,
|
|
4772
|
+
Zu as U,
|
|
4746
4773
|
Gu as X,
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4774
|
+
zu as Z,
|
|
4775
|
+
Mu as _,
|
|
4776
|
+
bu as a,
|
|
4777
|
+
Au as b,
|
|
4778
|
+
Ou as c,
|
|
4779
|
+
Su as d,
|
|
4780
|
+
h as e,
|
|
4781
|
+
Tu as f,
|
|
4782
|
+
S as g,
|
|
4783
|
+
Uu as h,
|
|
4784
|
+
Ze as i,
|
|
4785
|
+
Iu as j,
|
|
4786
|
+
xu as k,
|
|
4787
|
+
ki as l,
|
|
4760
4788
|
Q as m,
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4789
|
+
fu as n,
|
|
4790
|
+
cu as o,
|
|
4791
|
+
Is as p,
|
|
4792
|
+
Pu as q,
|
|
4765
4793
|
$ as r,
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4794
|
+
wu as s,
|
|
4795
|
+
Fu as t,
|
|
4796
|
+
Bu as u,
|
|
4769
4797
|
st as v,
|
|
4770
|
-
|
|
4771
|
-
|
|
4798
|
+
M as w,
|
|
4799
|
+
Qr as x
|
|
4772
4800
|
};
|