@synnaxlabs/pluto 0.34.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Animated-CnvOerW9.js → Animated-C7JTBH0T.js} +6 -6
- package/dist/{Animated-Ck87AGOu.cjs → Animated-D4IT49PS.cjs} +1 -1
- package/dist/{Item--wCat2DH.js → Item-4yG7GmwK.js} +23 -23
- package/dist/{Item-DuNQFmgk.cjs → Item-DuYEON-n.cjs} +1 -1
- package/dist/{Keyboard-DPs95Etp.cjs → Keyboard-BPoxRive.cjs} +1 -1
- package/dist/{Keyboard-Dh_Fhwg4.js → Keyboard-Csje8Cyn.js} +2 -2
- package/dist/LinePlot-DbXPZbQH.cjs +34 -0
- package/dist/{LinePlot-6KHKqa-2.js → LinePlot-DqoSTxNs.js} +2630 -2365
- package/dist/{Link-BHtl4aby.cjs → Link-BRv9hhIc.cjs} +1 -1
- package/dist/{Link-CDG2-g6A.js → Link-Crud0q_J.js} +1 -1
- package/dist/{List-BjimX8fM.js → List-Cuz80sgI.js} +6 -6
- package/dist/{List-C8vXIE2j.cjs → List-Pyj0u9YT.cjs} +1 -1
- package/dist/{Pack-D6eMgf33.js → Pack-BzCJQZ58.js} +1 -1
- package/dist/{Pack-DijAGcm_.cjs → Pack-Dvf8sQVK.cjs} +1 -1
- package/dist/Text-BJ2Pml4B.cjs +1 -0
- package/dist/{Text-CzgVM_22.js → Text-DMMYBs-R.js} +12 -12
- package/dist/{Toggle-Cdu7WaiC.js → Toggle-CLkPIiQK.js} +10438 -10080
- package/dist/Toggle-DnW_7Wr_.cjs +143 -0
- package/dist/{Video-DYSz9XOF.js → Video-BGyV37o3.js} +1 -1
- package/dist/{Video-BgDjKMJx.cjs → Video-CGe5Hscl.cjs} +1 -1
- package/dist/{aggregator-DzdAnRwI.js → aggregator-23mu0FOF.js} +2322 -2177
- package/dist/aggregator-y-jNJhKX.cjs +67 -0
- package/dist/align.cjs +1 -1
- package/dist/align.js +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-BghghSL0.cjs +1 -0
- package/dist/css-DJCM-h5_.js +1178 -0
- package/dist/css.cjs +1 -1
- package/dist/css.js +2 -2
- package/dist/dropdown.cjs +1 -1
- package/dist/dropdown.js +1 -1
- package/dist/ether.cjs +1 -1
- package/dist/ether.js +75 -62
- package/dist/{external-k3Jbrj0m.js → external-0a9KHHwz.js} +13 -13
- package/dist/external-3DAfrFCZ.cjs +1 -0
- package/dist/{external-eI1p10Vf.cjs → external-B7Vpq1ol.cjs} +1 -1
- package/dist/{external-DRHWURjA.cjs → external-BV_9eXZJ.cjs} +1 -1
- package/dist/{external-lgZ2Gmbx.js → external-BZwFy-XX.js} +16 -16
- package/dist/{external-CoQwrjWl.js → external-CIH3tMhP.js} +29 -29
- package/dist/{external-BOIjtEGO.js → external-Cf5a9Ia8.js} +2 -2
- package/dist/{external-FVIwMFDr.js → external-CgpiH-10.js} +102 -102
- package/dist/{external-DcMAC_pY.js → external-Cgq0p0a8.js} +133 -126
- package/dist/{external-D9Q5Xjko.js → external-Ci-UP3Vu.js} +2 -2
- package/dist/external-CqLAQBcO.cjs +1 -0
- package/dist/{external-Cc9o20Al.cjs → external-Ctvxtwfh.cjs} +1 -1
- package/dist/{external-CAIE4G3V.cjs → external-D-PsJ1E5.cjs} +1 -1
- package/dist/external-D7FmaiqY.js +248 -0
- package/dist/{external-DvRQ7lJU.js → external-DAbicix6.js} +2 -2
- package/dist/external-DVF3ZJ4z.js +32 -0
- package/dist/external-De9tKPlO.js +76 -0
- package/dist/{external-CYsmC4uZ.cjs → external-Dk1cXh1i.cjs} +1 -1
- package/dist/{external-mtlL4Z3a.cjs → external-DtnrBHvV.cjs} +1 -1
- package/dist/external-ZxIaRZdb.cjs +1 -0
- package/dist/{external-BbS4QDTb.cjs → external-iiNZw96o.cjs} +1 -1
- package/dist/{external-DsKRFJxV.cjs → external-t43feeRt.cjs} +1 -1
- package/dist/{external-mE-a2ecU.js → external-xhGCeglf.js} +1 -1
- package/dist/{external-CjmMj11F.cjs → external-xtDHiIUX.cjs} +1 -1
- package/dist/header.cjs +1 -1
- package/dist/header.js +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.js +8292 -7208
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/src/breadcrumb/Breadcrumb.d.ts +10 -2
- package/dist/src/breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/src/button/Button.d.ts +2 -0
- package/dist/src/button/Button.d.ts.map +1 -1
- package/dist/src/button/Icon.d.ts +2 -0
- package/dist/src/button/Icon.d.ts.map +1 -1
- package/dist/src/color/GradientPicker.d.ts +10 -0
- package/dist/src/color/GradientPicker.d.ts.map +1 -0
- package/dist/src/color/Picker.d.ts +9 -0
- package/dist/src/color/Picker.d.ts.map +1 -0
- package/dist/src/color/Provider.d.ts +139 -0
- package/dist/src/color/Provider.d.ts.map +1 -0
- package/dist/src/color/Swatch.d.ts +13 -0
- package/dist/src/color/Swatch.d.ts.map +1 -0
- package/dist/src/color/core/external.d.ts +4 -0
- package/dist/src/color/core/external.d.ts.map +1 -0
- package/dist/src/color/core/gradient.d.ts +58 -0
- package/dist/src/color/core/gradient.d.ts.map +1 -0
- package/dist/src/color/core/index.d.ts +1 -2
- package/dist/src/color/core/index.d.ts.map +1 -1
- package/dist/src/color/core/palette.d.ts +74 -0
- package/dist/src/color/core/palette.d.ts.map +1 -0
- package/dist/src/color/external.d.ts +4 -1
- package/dist/src/color/external.d.ts.map +1 -1
- package/dist/src/haul/Haul.d.ts +0 -1
- package/dist/src/haul/Haul.d.ts.map +1 -1
- package/dist/src/hooks/index.d.ts +1 -0
- package/dist/src/hooks/index.d.ts.map +1 -1
- package/dist/src/hooks/useDelayedState.d.ts +11 -0
- package/dist/src/hooks/useDelayedState.d.ts.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/input/Text.d.ts.map +1 -1
- package/dist/src/nav/Drawer.d.ts.map +1 -1
- package/dist/src/notation/Select.d.ts +8 -0
- package/dist/src/notation/Select.d.ts.map +1 -0
- package/dist/src/notation/external.d.ts +3 -0
- package/dist/src/notation/external.d.ts.map +1 -0
- package/dist/src/notation/index.d.ts +2 -0
- package/dist/src/notation/index.d.ts.map +1 -0
- package/dist/src/notation/notation.d.ts.map +1 -1
- package/dist/src/pluto/Pluto.d.ts +3 -1
- package/dist/src/pluto/Pluto.d.ts.map +1 -1
- package/dist/src/pluto/aether/pluto.d.ts.map +1 -1
- package/dist/src/select/Button.d.ts +5 -3
- package/dist/src/select/Button.d.ts.map +1 -1
- package/dist/src/select/Direction.d.ts +2 -1
- package/dist/src/select/Direction.d.ts.map +1 -1
- package/dist/src/select/Single.d.ts +1 -1
- package/dist/src/select/Single.d.ts.map +1 -1
- package/dist/src/status/Circle.d.ts +1 -1
- package/dist/src/status/Circle.d.ts.map +1 -1
- package/dist/src/table/Table.d.ts +30 -0
- package/dist/src/table/Table.d.ts.map +1 -0
- package/dist/src/table/aether/Table.d.ts +493 -0
- package/dist/src/table/aether/Table.d.ts.map +1 -0
- package/dist/src/table/aether/index.d.ts +2 -0
- package/dist/src/table/aether/index.d.ts.map +1 -0
- package/dist/src/table/cells/Cells.d.ts +191 -0
- package/dist/src/table/cells/Cells.d.ts.map +1 -0
- package/dist/src/table/cells/Forms.d.ts +7 -0
- package/dist/src/table/cells/Forms.d.ts.map +1 -0
- package/dist/src/table/cells/index.d.ts +2 -0
- package/dist/src/table/cells/index.d.ts.map +1 -0
- package/dist/src/table/cells/registry.d.ts +17 -0
- package/dist/src/table/cells/registry.d.ts.map +1 -0
- package/dist/src/table/external.d.ts +2 -0
- package/dist/src/table/external.d.ts.map +1 -0
- package/dist/src/table/index.d.ts +2 -0
- package/dist/src/table/index.d.ts.map +1 -0
- package/dist/src/telem/aether/pipeline.d.ts +35 -24
- package/dist/src/telem/aether/pipeline.d.ts.map +1 -1
- package/dist/src/telem/aether/provider.d.ts +7 -6
- package/dist/src/telem/aether/provider.d.ts.map +1 -1
- package/dist/src/telem/aether/static.d.ts +22 -1
- package/dist/src/telem/aether/static.d.ts.map +1 -1
- package/dist/src/telem/aether/transformers.d.ts +217 -2
- package/dist/src/telem/aether/transformers.d.ts.map +1 -1
- package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
- package/dist/src/text/Editable.d.ts +2 -1
- package/dist/src/text/Editable.d.ts.map +1 -1
- package/dist/src/text/Select.d.ts +19 -0
- package/dist/src/text/Select.d.ts.map +1 -0
- package/dist/src/text/core/types.d.ts +2 -1
- package/dist/src/text/core/types.d.ts.map +1 -1
- package/dist/src/text/external.d.ts +1 -1
- package/dist/src/text/external.d.ts.map +1 -1
- package/dist/src/theming/Provider.d.ts.map +1 -1
- package/dist/src/theming/aether/provider.d.ts +375 -0
- package/dist/src/theming/aether/provider.d.ts.map +1 -1
- package/dist/src/theming/core/theme.d.ts +127 -0
- package/dist/src/theming/core/theme.d.ts.map +1 -1
- package/dist/src/tree/core.d.ts +3 -1
- package/dist/src/tree/core.d.ts.map +1 -1
- package/dist/src/vis/axis/canvas.d.ts +11 -0
- package/dist/src/vis/axis/canvas.d.ts.map +1 -1
- package/dist/src/vis/canvas/Canvas.d.ts.map +1 -1
- package/dist/src/vis/diagram/Diagram.d.ts +2 -1
- package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
- package/dist/src/vis/diagram/aether/types.d.ts +17 -0
- package/dist/src/vis/diagram/aether/types.d.ts.map +1 -1
- package/dist/src/vis/diagram/edge/Edge.d.ts +3 -2
- package/dist/src/vis/diagram/edge/Edge.d.ts.map +1 -1
- package/dist/src/vis/diagram/edge/paths.d.ts +20 -0
- package/dist/src/vis/diagram/edge/paths.d.ts.map +1 -0
- package/dist/src/vis/diagram/external.d.ts +1 -0
- package/dist/src/vis/diagram/external.d.ts.map +1 -1
- package/dist/src/vis/draw2d/canvas.d.ts +19 -0
- package/dist/src/vis/draw2d/canvas.d.ts.map +1 -1
- package/dist/src/vis/legend/Container.d.ts.map +1 -1
- package/dist/src/vis/line/aether/line.d.ts.map +1 -1
- package/dist/src/vis/lineplot/aether/YAxis.d.ts.map +1 -1
- package/dist/src/vis/render/context.d.ts.map +1 -1
- package/dist/src/vis/schematic/Forms.d.ts +1 -0
- package/dist/src/vis/schematic/Forms.d.ts.map +1 -1
- package/dist/src/vis/schematic/Grid.d.ts +16 -0
- package/dist/src/vis/schematic/Grid.d.ts.map +1 -0
- package/dist/src/vis/schematic/Symbols.d.ts +248 -371
- package/dist/src/vis/schematic/Symbols.d.ts.map +1 -1
- package/dist/src/vis/schematic/primitives/Primitives.d.ts +39 -0
- package/dist/src/vis/schematic/primitives/Primitives.d.ts.map +1 -1
- package/dist/src/vis/schematic/registry.d.ts +2 -2
- package/dist/src/vis/schematic/registry.d.ts.map +1 -1
- package/dist/src/vis/value/Form.d.ts +9 -0
- package/dist/src/vis/value/Form.d.ts.map +1 -0
- package/dist/src/vis/value/aether/value.d.ts +167 -0
- package/dist/src/vis/value/aether/value.d.ts.map +1 -1
- package/dist/src/vis/value/external.d.ts +1 -0
- package/dist/src/vis/value/external.d.ts.map +1 -1
- package/dist/src/vis/value/use.d.ts +56 -1
- package/dist/src/vis/value/use.d.ts.map +1 -1
- package/dist/src/workMain.d.ts +2 -0
- package/dist/src/workMain.d.ts.map +1 -0
- package/dist/style.css +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-CR-P9eLW.cjs → units-9h1yAbxY.cjs} +1 -1
- package/dist/{units-rb5QAWjs.js → units-D19WggGS.js} +1 -1
- package/dist/video.cjs +1 -1
- package/dist/video.js +1 -1
- package/package.json +6 -5
- package/dist/LinePlot--yLT9nkT.cjs +0 -34
- package/dist/Text-Cg0q7seY.cjs +0 -1
- package/dist/Toggle-CP9KtybX.cjs +0 -143
- package/dist/aggregator-C0Ab25_o.cjs +0 -67
- package/dist/css-B4FcyECk.js +0 -1112
- package/dist/css-Dh7n0EGs.cjs +0 -1
- package/dist/external-B72rRj4o.js +0 -76
- package/dist/external-CsqyDUsJ.js +0 -96
- package/dist/external-CsrLjLOh.cjs +0 -1
- package/dist/external-Dm2-owlq.cjs +0 -1
- package/dist/external-Yf8Lv9AU.js +0 -248
- package/dist/external-gz4sf3pG.cjs +0 -1
- package/dist/src/color/Picker/Picker.d.ts +0 -7
- package/dist/src/color/Picker/Picker.d.ts.map +0 -1
- package/dist/src/color/Picker/index.d.ts +0 -2
- package/dist/src/color/Picker/index.d.ts.map +0 -1
- package/dist/src/color/Swatch/Swatch.d.ts +0 -10
- package/dist/src/color/Swatch/Swatch.d.ts.map +0 -1
- package/dist/src/color/Swatch/index.d.ts +0 -2
- package/dist/src/color/Swatch/index.d.ts.map +0 -1
- package/dist/src/notation/SelectNotation.d.ts +0 -12
- package/dist/src/notation/SelectNotation.d.ts.map +0 -1
- package/dist/src/text/SelectLevel.d.ts +0 -12
- package/dist/src/text/SelectLevel.d.ts.map +0 -1
- package/dist/src/vis/schematic/Labeled.d.ts +0 -17
- package/dist/src/vis/schematic/Labeled.d.ts.map +0 -1
package/dist/css-B4FcyECk.js
DELETED
|
@@ -1,1112 +0,0 @@
|
|
|
1
|
-
var yt = Object.defineProperty;
|
|
2
|
-
var ft = (t, e, r) => e in t ? yt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
-
var z = (t, e, r) => ft(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
-
import { z as i } from "zod";
|
|
5
|
-
const J = i.tuple([i.number(), i.number()]);
|
|
6
|
-
i.tuple([i.bigint(), i.bigint()]);
|
|
7
|
-
const xe = i.object({ width: i.number(), height: i.number() }), dt = i.object({
|
|
8
|
-
signedWidth: i.number(),
|
|
9
|
-
signedHeight: i.number()
|
|
10
|
-
}), gt = ["width", "height"];
|
|
11
|
-
i.enum(gt);
|
|
12
|
-
const bt = ["start", "center", "end"], xt = ["signedWidth", "signedHeight"];
|
|
13
|
-
i.enum(xt);
|
|
14
|
-
const _ = i.object({ x: i.number(), y: i.number() }), _e = i.object({ clientX: i.number(), clientY: i.number() }), me = ["x", "y"], we = i.enum(me), Le = ["top", "right", "bottom", "left"], mt = i.enum(Le), K = ["left", "right"], $e = i.enum(K), Q = ["top", "bottom"], ve = i.enum(Q), Oe = ["center"], Ae = i.enum(Oe), wt = [...Le, ...Oe], Me = i.enum(wt);
|
|
15
|
-
i.enum(bt);
|
|
16
|
-
const $t = ["first", "last"];
|
|
17
|
-
i.enum($t);
|
|
18
|
-
const Pe = i.object({ lower: i.number(), upper: i.number() }), vt = i.object({ lower: i.bigint(), upper: i.bigint() });
|
|
19
|
-
i.union([Pe, J]);
|
|
20
|
-
i.union([vt, J]);
|
|
21
|
-
const Ot = i.union([we, Me]), Mt = i.union([we, Me, i.instanceof(String)]), j = (t) => typeof t == "bigint" || t instanceof BigInt, R = (t, e) => j(t) ? t.valueOf() - BigInt(e.valueOf().valueOf()) : t.valueOf() - Number(e.valueOf()), He = (t, e) => j(t) ? t.valueOf() + BigInt(e.valueOf().valueOf()) : t + Number(e.valueOf()), jt = (t, e, r = 1e-4) => Math.abs(t - e) < r, ie = (t, e) => j(t) ? t === BigInt(e.valueOf().valueOf()) : t === Number(e.valueOf()), Tt = (t) => {
|
|
22
|
-
const e = 10 ** Math.floor(Math.log10(t));
|
|
23
|
-
return Math.round(t / e) * e;
|
|
24
|
-
}, Ze = (t, e) => j(t) ? t.valueOf() < BigInt(e.valueOf()) ? t : BigInt(e.valueOf()) : t.valueOf() < Number(e.valueOf()) ? t : Number(e.valueOf()), It = (t, e) => j(t) ? t.valueOf() > BigInt(e.valueOf()) ? t : BigInt(e.valueOf()) : t.valueOf() > Number(e.valueOf()) ? t : Number(e.valueOf()), We = (t) => j(t) || t instanceof BigInt ? t.valueOf() < 0n ? -t : t : t.valueOf() < 0 ? -t : t, St = (t, e) => j(t) ? t.valueOf() * BigInt(e.valueOf()) : t.valueOf() * Number(e.valueOf()), Et = (t, e) => j(t) ? t.valueOf() / BigInt(e.valueOf()) : t.valueOf() / Number(e.valueOf()), Cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
25
|
-
__proto__: null,
|
|
26
|
-
abs: We,
|
|
27
|
-
add: He,
|
|
28
|
-
closeTo: jt,
|
|
29
|
-
div: Et,
|
|
30
|
-
equal: ie,
|
|
31
|
-
max: It,
|
|
32
|
-
min: Ze,
|
|
33
|
-
mult: St,
|
|
34
|
-
roundToNearestMagnitude: Tt,
|
|
35
|
-
sub: R
|
|
36
|
-
}, Symbol.toStringTag, { value: "Module" })), p = (t, e) => {
|
|
37
|
-
const r = {};
|
|
38
|
-
if (typeof t == "number" || typeof t == "bigint")
|
|
39
|
-
e != null ? (r.lower = t, r.upper = e) : (r.lower = typeof t == "bigint" ? 0n : 0, r.upper = t);
|
|
40
|
-
else if (Array.isArray(t)) {
|
|
41
|
-
if (t.length !== 2) throw new Error("bounds: expected array of length 2");
|
|
42
|
-
[r.lower, r.upper] = t;
|
|
43
|
-
} else return ue(t);
|
|
44
|
-
return ue(r);
|
|
45
|
-
}, Bt = Object.freeze({ lower: 0, upper: 0 }), Nt = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), zt = Object.freeze({ lower: 0, upper: 1 }), At = Object.freeze({ lower: -1, upper: 1 }), Ct = (t, e) => {
|
|
46
|
-
if (t == null && e == null) return !0;
|
|
47
|
-
if (t == null || e == null) return !1;
|
|
48
|
-
const r = p(t), n = p(e);
|
|
49
|
-
return (r == null ? void 0 : r.lower) === (n == null ? void 0 : n.lower) && (r == null ? void 0 : r.upper) === (n == null ? void 0 : n.upper);
|
|
50
|
-
}, ue = (t) => t.lower > t.upper ? { lower: t.upper, upper: t.lower } : t, Rt = (t, e) => {
|
|
51
|
-
const r = p(t);
|
|
52
|
-
return e < r.lower ? r.lower : e >= r.upper ? r.upper - (typeof r.upper == "number" ? 1 : 1n) : e;
|
|
53
|
-
}, I = (t, e) => {
|
|
54
|
-
const r = p(t);
|
|
55
|
-
if (typeof e == "number" || typeof e == "bigint")
|
|
56
|
-
return e >= r.lower && e < r.upper;
|
|
57
|
-
const n = p(e);
|
|
58
|
-
return n.lower >= r.lower && n.upper <= r.upper;
|
|
59
|
-
}, _t = (t, e) => {
|
|
60
|
-
const r = p(t), n = p(e);
|
|
61
|
-
return r.lower === n.lower ? !0 : n.upper === r.lower || n.lower === r.upper ? !1 : I(r, n.upper) || I(r, n.lower) || I(n, r.upper) || I(n, r.lower);
|
|
62
|
-
}, ee = (t) => {
|
|
63
|
-
const e = p(t);
|
|
64
|
-
return e.upper - e.lower;
|
|
65
|
-
}, Lt = (t) => {
|
|
66
|
-
const e = p(t);
|
|
67
|
-
return typeof e.lower == "bigint" ? e.lower === 0n && e.upper === 0n : e.lower === 0 && e.upper === 0;
|
|
68
|
-
}, Pt = (t) => {
|
|
69
|
-
const e = ee(t);
|
|
70
|
-
return typeof e == "number" ? e === 0 : e === 0n;
|
|
71
|
-
}, Ht = (t) => {
|
|
72
|
-
const e = p(t);
|
|
73
|
-
return typeof e.lower == "bigint" ? !0 : Number.isFinite(e.lower) && Number.isFinite(e.upper);
|
|
74
|
-
}, Zt = (t) => ({
|
|
75
|
-
lower: Math.min(...t.map((e) => p(e).lower)),
|
|
76
|
-
upper: Math.max(...t.map((e) => p(e).upper))
|
|
77
|
-
}), Wt = (t) => ({
|
|
78
|
-
lower: Math.max(...t.map((e) => p(e).lower)),
|
|
79
|
-
upper: Math.min(...t.map((e) => p(e).upper))
|
|
80
|
-
}), Yt = (t) => {
|
|
81
|
-
const e = p(t), r = typeof e.lower == "bigint";
|
|
82
|
-
return Array.from({ length: Number(ee(t)) }, (n, o) => r ? e.lower + BigInt(o) : e.lower + o);
|
|
83
|
-
}, ae = (t, e) => {
|
|
84
|
-
const r = t.map((s) => p(s)), n = r.findIndex((s) => I(s, e) || e < s.lower);
|
|
85
|
-
if (n === -1) return { index: t.length, position: 0 };
|
|
86
|
-
const o = r[n];
|
|
87
|
-
return I(o, e) ? { index: n, position: Number(e - o.lower) } : { index: n, position: 0 };
|
|
88
|
-
}, oe = {
|
|
89
|
-
removeBefore: 0,
|
|
90
|
-
removeAfter: 0,
|
|
91
|
-
insertInto: 0,
|
|
92
|
-
deleteInBetween: 0
|
|
93
|
-
}, Ft = (t, e) => {
|
|
94
|
-
const r = t.map((c) => p(c)), n = p(e);
|
|
95
|
-
if (r.length === 0) return oe;
|
|
96
|
-
const o = ae(r, n.lower), s = ae(r, n.upper);
|
|
97
|
-
if (o.index === t.length) return { ...oe, insertInto: t.length };
|
|
98
|
-
if (s.index === 0) return { ...oe, removeAfter: s.position };
|
|
99
|
-
if (o.index === s.index)
|
|
100
|
-
return o.position !== 0 && s.position !== 0 ? null : {
|
|
101
|
-
removeAfter: s.position,
|
|
102
|
-
removeBefore: o.position,
|
|
103
|
-
insertInto: o.index,
|
|
104
|
-
deleteInBetween: 0
|
|
105
|
-
};
|
|
106
|
-
let u = s.index - o.index, a = o.index, l = R(Number(ee(r[o.index])), o.position);
|
|
107
|
-
return o.position !== 0 ? (u -= 1, a += 1) : l = 0, {
|
|
108
|
-
removeBefore: l,
|
|
109
|
-
removeAfter: s.position,
|
|
110
|
-
insertInto: a,
|
|
111
|
-
deleteInBetween: u
|
|
112
|
-
};
|
|
113
|
-
}, kt = (t, e, r) => {
|
|
114
|
-
const n = t.map((a) => p(a)), o = r > 0 ? 1 : r < 0 ? -1 : 0;
|
|
115
|
-
if (o === 0) return e;
|
|
116
|
-
let s = r, u = e;
|
|
117
|
-
for (; ie(s, 0) === !1; ) {
|
|
118
|
-
const a = n.findIndex((l) => o > 0 ? u >= l.lower && u < l.upper : u > l.lower && u <= l.upper);
|
|
119
|
-
if (a !== -1) {
|
|
120
|
-
const l = n[a];
|
|
121
|
-
let c;
|
|
122
|
-
if (o > 0 ? c = R(l.upper, u) : c = R(u, l.lower), c > 0) {
|
|
123
|
-
const f = Ze(We(s), c);
|
|
124
|
-
if (u = He(
|
|
125
|
-
u,
|
|
126
|
-
o > 0 ? f : -f
|
|
127
|
-
), s = R(s, o > 0 ? f : -f), ie(s, 0)) return u;
|
|
128
|
-
continue;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
if (o > 0) {
|
|
132
|
-
const l = n.filter((c) => c.lower > u);
|
|
133
|
-
if (l.length > 0) u = l[0].lower;
|
|
134
|
-
else return u;
|
|
135
|
-
} else {
|
|
136
|
-
const l = n.filter((c) => c.upper < u);
|
|
137
|
-
if (l.length > 0)
|
|
138
|
-
u = l[l.length - 1].upper;
|
|
139
|
-
else return u;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
return u;
|
|
143
|
-
}, Xt = (t, e, r) => {
|
|
144
|
-
const n = t.map((u) => p(u));
|
|
145
|
-
if (e === r) return typeof e == "bigint" ? 0n : 0;
|
|
146
|
-
const o = e < r ? p([e, r]) : p([r, e]);
|
|
147
|
-
let s = typeof e == "bigint" ? 0n : 0;
|
|
148
|
-
for (const u of n) {
|
|
149
|
-
const a = u.lower > o.lower ? u.lower : o.lower, l = u.upper < o.upper ? u.upper : o.upper;
|
|
150
|
-
if (a < l) {
|
|
151
|
-
const c = l - a;
|
|
152
|
-
s = s + c;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
return s;
|
|
156
|
-
}, Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
157
|
-
__proto__: null,
|
|
158
|
-
CLIP: At,
|
|
159
|
-
DECIMAL: zt,
|
|
160
|
-
INFINITE: Nt,
|
|
161
|
-
ZERO: Bt,
|
|
162
|
-
bounds: Pe,
|
|
163
|
-
buildInsertionPlan: Ft,
|
|
164
|
-
clamp: Rt,
|
|
165
|
-
construct: p,
|
|
166
|
-
contains: I,
|
|
167
|
-
distance: Xt,
|
|
168
|
-
equals: Ct,
|
|
169
|
-
findInsertPosition: ae,
|
|
170
|
-
isFinite: Ht,
|
|
171
|
-
isZero: Lt,
|
|
172
|
-
linspace: Yt,
|
|
173
|
-
makeValid: ue,
|
|
174
|
-
max: Zt,
|
|
175
|
-
min: Wt,
|
|
176
|
-
overlapsWith: _t,
|
|
177
|
-
span: ee,
|
|
178
|
-
spanIsZero: Pt,
|
|
179
|
-
traverse: kt
|
|
180
|
-
}, Symbol.toStringTag, { value: "Module" })), Ye = Ot, T = (t) => me.includes(t) ? t : Q.includes(t) ? "y" : "x", Dt = (t) => T(t) === "x" ? "y" : "x", Vt = (t) => T(t) === "x" ? "width" : "height", qt = (t) => T(t) === "x" ? "left" : "top", Ut = (t) => Ye.safeParse(t).success, Gt = (t) => T(t) === "x" ? "signedWidth" : "signedHeight", Jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
181
|
-
__proto__: null,
|
|
182
|
-
construct: T,
|
|
183
|
-
crude: Ye,
|
|
184
|
-
dimension: Vt,
|
|
185
|
-
direction: we,
|
|
186
|
-
isDirection: Ut,
|
|
187
|
-
location: qt,
|
|
188
|
-
signedDimension: Gt,
|
|
189
|
-
swap: Dt
|
|
190
|
-
}, Symbol.toStringTag, { value: "Module" })), Kt = (t) => {
|
|
191
|
-
const e = t.replace(/_[a-z]/g, (r) => r[1].toUpperCase());
|
|
192
|
-
return e.length > 1 && e[0] === e[0].toUpperCase() && e[1] === e[1].toUpperCase() || e.length === 0 ? e : e[0].toLowerCase() + e.slice(1);
|
|
193
|
-
}, Fe = (t) => {
|
|
194
|
-
const e = (r, n = q) => {
|
|
195
|
-
if (typeof r == "string") return t(r);
|
|
196
|
-
if (Array.isArray(r)) return r.map((u) => e(u, n));
|
|
197
|
-
if (!k(r)) return r;
|
|
198
|
-
n = Xe(n);
|
|
199
|
-
const o = {}, s = r;
|
|
200
|
-
return Object.keys(s).forEach((u) => {
|
|
201
|
-
let a = s[u];
|
|
202
|
-
const l = t(u);
|
|
203
|
-
n.recursive && (k(a) ? ce(a, n.keepTypesOnRecursion) || (a = e(a, n)) : n.recursiveInArray && le(a) && (a = [...a].map((c) => {
|
|
204
|
-
let f = c;
|
|
205
|
-
return k(c) ? ce(f, n.keepTypesOnRecursion) || (f = e(c, n)) : le(c) && (f = e({ key: c }, n).key), f;
|
|
206
|
-
}))), o[l] = a;
|
|
207
|
-
}), o;
|
|
208
|
-
};
|
|
209
|
-
return e;
|
|
210
|
-
}, Qt = Fe(Kt), er = (t) => (
|
|
211
|
-
// Don't convert the first character and don't convert a character that is after a
|
|
212
|
-
// non-alphanumeric character
|
|
213
|
-
t.replace(/([a-z0-9])([A-Z])/g, (e, r, n) => `${r}_${n.toLowerCase()}`)
|
|
214
|
-
), tr = Fe(er), ke = (t) => t.length === 0 ? t : t[0].toUpperCase() + t.slice(1), q = {
|
|
215
|
-
recursive: !0,
|
|
216
|
-
recursiveInArray: !0,
|
|
217
|
-
keepTypesOnRecursion: [Number, String, Uint8Array]
|
|
218
|
-
}, Xe = (t = q) => (t.recursive == null ? t = q : t.recursiveInArray ?? (t.recursiveInArray = !1), t), le = (t) => t != null && Array.isArray(t), k = (t) => t != null && typeof t == "object" && !Array.isArray(t), ce = (t, e) => (e || []).some((r) => t instanceof r), _n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
219
|
-
__proto__: null,
|
|
220
|
-
belongToTypes: ce,
|
|
221
|
-
camelToSnake: tr,
|
|
222
|
-
capitalize: ke,
|
|
223
|
-
defaultOptions: q,
|
|
224
|
-
isArrayObject: le,
|
|
225
|
-
isValidObject: k,
|
|
226
|
-
snakeToCamel: Qt,
|
|
227
|
-
validateOptions: Xe
|
|
228
|
-
}, Symbol.toStringTag, { value: "Module" })), rr = $e, nr = ve, or = {
|
|
229
|
-
top: "bottom",
|
|
230
|
-
right: "left",
|
|
231
|
-
bottom: "top",
|
|
232
|
-
left: "right",
|
|
233
|
-
center: "center"
|
|
234
|
-
}, sr = {
|
|
235
|
-
top: "left",
|
|
236
|
-
right: "top",
|
|
237
|
-
bottom: "right",
|
|
238
|
-
left: "bottom",
|
|
239
|
-
center: "center"
|
|
240
|
-
}, ir = Mt, v = (t) => t instanceof String || !me.includes(t) ? t : t === "x" ? "left" : "top", ur = (t) => or[v(t)], ar = (t) => sr[v(t)], L = (t) => {
|
|
241
|
-
const e = v(t);
|
|
242
|
-
return e === "top" || e === "bottom" ? "y" : "x";
|
|
243
|
-
}, lr = i.object({
|
|
244
|
-
x: $e.or(Ae),
|
|
245
|
-
y: ve.or(Ae)
|
|
246
|
-
}), De = i.object({ x: $e, y: ve }), P = Object.freeze({ x: "left", y: "top" }), je = Object.freeze({ x: "right", y: "top" }), te = Object.freeze({ x: "left", y: "bottom" }), Te = Object.freeze({ x: "right", y: "bottom" }), Ie = Object.freeze({ x: "center", y: "center" }), Ve = Object.freeze({ x: "center", y: "top" }), qe = Object.freeze({ x: "center", y: "bottom" }), Ue = Object.freeze({ x: "right", y: "center" }), Ge = Object.freeze({ x: "left", y: "center" }), cr = Object.freeze([
|
|
247
|
-
Ge,
|
|
248
|
-
Ue,
|
|
249
|
-
Ve,
|
|
250
|
-
qe,
|
|
251
|
-
P,
|
|
252
|
-
je,
|
|
253
|
-
te,
|
|
254
|
-
Te,
|
|
255
|
-
Ie
|
|
256
|
-
]), Se = (t, e) => t.x === e.x && t.y === e.y, pr = (t, e) => {
|
|
257
|
-
if (typeof e == "object") {
|
|
258
|
-
let r = !0;
|
|
259
|
-
return "x" in e && (t.x === e.x || (r = !1)), "y" in e && (t.y === e.y || (r = !1)), r;
|
|
260
|
-
}
|
|
261
|
-
return t.x === e || t.y === e;
|
|
262
|
-
}, Je = (t) => [t.x, t.y], X = (t) => L(v(t)) === "x", hr = (t) => L(v(t)) === "y", yr = (t) => `${t.x}${ke(t.y)}`, fr = (t, e) => {
|
|
263
|
-
let r, n;
|
|
264
|
-
if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r = v(t), n = v(e ?? t)), L(r) === L(n) && r !== "center" && n !== "center")
|
|
265
|
-
throw new Error(
|
|
266
|
-
`[XYLocation] - encountered two locations with the same direction: ${r.toString()} - ${n.toString()}`
|
|
267
|
-
);
|
|
268
|
-
const o = { ...Ie };
|
|
269
|
-
return r === "center" ? X(n) ? [o.x, o.y] = [n, r] : [o.x, o.y] = [r, n] : n === "center" ? X(r) ? [o.x, o.y] = [r, n] : [o.x, o.y] = [n, r] : X(r) ? [o.x, o.y] = [r, n] : [o.x, o.y] = [n, r], o;
|
|
270
|
-
}, Ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
271
|
-
__proto__: null,
|
|
272
|
-
BOTTOM_CENTER: qe,
|
|
273
|
-
BOTTOM_LEFT: te,
|
|
274
|
-
BOTTOM_RIGHT: Te,
|
|
275
|
-
CENTER: Ie,
|
|
276
|
-
CENTER_LOCATIONS: Oe,
|
|
277
|
-
LEFT_CENTER: Ge,
|
|
278
|
-
RIGHT_CENTER: Ue,
|
|
279
|
-
TOP_CENTER: Ve,
|
|
280
|
-
TOP_LEFT: P,
|
|
281
|
-
TOP_RIGHT: je,
|
|
282
|
-
XY_LOCATIONS: cr,
|
|
283
|
-
X_LOCATIONS: K,
|
|
284
|
-
Y_LOCATIONS: Q,
|
|
285
|
-
construct: v,
|
|
286
|
-
constructXY: fr,
|
|
287
|
-
corner: De,
|
|
288
|
-
crude: ir,
|
|
289
|
-
direction: L,
|
|
290
|
-
isX: X,
|
|
291
|
-
isY: hr,
|
|
292
|
-
location: Me,
|
|
293
|
-
outer: mt,
|
|
294
|
-
rotate90: ar,
|
|
295
|
-
swap: ur,
|
|
296
|
-
x: rr,
|
|
297
|
-
xy: lr,
|
|
298
|
-
xyCouple: Je,
|
|
299
|
-
xyEquals: Se,
|
|
300
|
-
xyMatches: pr,
|
|
301
|
-
xyToString: yr,
|
|
302
|
-
y: nr
|
|
303
|
-
}, Symbol.toStringTag, { value: "Module" })), pe = i.union([
|
|
304
|
-
i.number(),
|
|
305
|
-
_,
|
|
306
|
-
J,
|
|
307
|
-
xe,
|
|
308
|
-
dt,
|
|
309
|
-
_e
|
|
310
|
-
]), y = (t, e) => {
|
|
311
|
-
if (typeof t == "string") {
|
|
312
|
-
if (e === void 0) throw new Error("The y coordinate must be given.");
|
|
313
|
-
return t === "x" ? { x: e, y: 0 } : { x: 0, y: e };
|
|
314
|
-
}
|
|
315
|
-
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 };
|
|
316
|
-
}, m = Object.freeze({ x: 0, y: 0 }), Qe = Object.freeze({ x: 1, y: 1 }), dr = Object.freeze({ x: 1 / 0, y: 1 / 0 }), gr = Object.freeze({ x: NaN, y: NaN }), U = (t, e, r = 0) => {
|
|
317
|
-
const n = y(t), o = y(e);
|
|
318
|
-
return r === 0 ? n.x === o.x && n.y === o.y : Math.abs(n.x - o.x) <= r && Math.abs(n.y - o.y) <= r;
|
|
319
|
-
}, br = (t) => U(t, m), xr = (t, e, r) => {
|
|
320
|
-
const n = y(t), o = y(e, r);
|
|
321
|
-
return { x: n.x * o.x, y: n.y * o.y };
|
|
322
|
-
}, et = (t, e) => {
|
|
323
|
-
const r = y(t);
|
|
324
|
-
return { x: r.x + e, y: r.y };
|
|
325
|
-
}, tt = (t, e) => {
|
|
326
|
-
const r = y(t);
|
|
327
|
-
return { x: r.x, y: r.y + e };
|
|
328
|
-
}, G = (t, e, r, ...n) => typeof e == "string" && typeof r == "number" ? e === "x" ? et(t, r) : tt(t, r) : [t, e, r ?? m, ...n].reduce((o, s) => {
|
|
329
|
-
const u = y(s);
|
|
330
|
-
return { x: o.x + u.x, y: o.y + u.y };
|
|
331
|
-
}, m), mr = (t, e, r) => {
|
|
332
|
-
const n = y(t);
|
|
333
|
-
return e === "x" ? { x: r, y: n.y } : { x: n.x, y: r };
|
|
334
|
-
}, wr = (t, e) => {
|
|
335
|
-
const r = y(t), n = y(e);
|
|
336
|
-
return Math.sqrt((r.x - n.x) ** 2 + (r.y - n.y) ** 2);
|
|
337
|
-
}, $r = (t, e) => {
|
|
338
|
-
const r = y(t), n = y(e);
|
|
339
|
-
return { x: n.x - r.x, y: n.y - r.y };
|
|
340
|
-
}, vr = (t) => {
|
|
341
|
-
const e = y(t);
|
|
342
|
-
return Number.isNaN(e.x) || Number.isNaN(e.y);
|
|
343
|
-
}, Or = (t) => {
|
|
344
|
-
const e = y(t);
|
|
345
|
-
return Number.isFinite(e.x) && Number.isFinite(e.y);
|
|
346
|
-
}, Mr = (t) => {
|
|
347
|
-
const e = y(t);
|
|
348
|
-
return [e.x, e.y];
|
|
349
|
-
}, jr = (t) => {
|
|
350
|
-
const e = y(t);
|
|
351
|
-
return { left: e.x, top: e.y };
|
|
352
|
-
}, he = (t, e = 0) => {
|
|
353
|
-
const r = y(t);
|
|
354
|
-
return { x: Number(r.x.toFixed(e)), y: Number(r.y.toFixed(e)) };
|
|
355
|
-
}, Ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
356
|
-
__proto__: null,
|
|
357
|
-
INFINITY: dr,
|
|
358
|
-
NAN: gr,
|
|
359
|
-
ONE: Qe,
|
|
360
|
-
ZERO: m,
|
|
361
|
-
clientXY: _e,
|
|
362
|
-
construct: y,
|
|
363
|
-
couple: Mr,
|
|
364
|
-
crudeZ: pe,
|
|
365
|
-
css: jr,
|
|
366
|
-
distance: wr,
|
|
367
|
-
equals: U,
|
|
368
|
-
isFinite: Or,
|
|
369
|
-
isNan: vr,
|
|
370
|
-
isZero: br,
|
|
371
|
-
scale: xr,
|
|
372
|
-
set: mr,
|
|
373
|
-
translate: G,
|
|
374
|
-
translateX: et,
|
|
375
|
-
translateY: tt,
|
|
376
|
-
translation: $r,
|
|
377
|
-
truncate: he,
|
|
378
|
-
xy: _
|
|
379
|
-
}, Symbol.toStringTag, { value: "Module" })), Z = i.union([i.number(), i.string()]), Tr = i.object({
|
|
380
|
-
top: Z,
|
|
381
|
-
left: Z,
|
|
382
|
-
width: Z,
|
|
383
|
-
height: Z
|
|
384
|
-
}), Ir = i.object({
|
|
385
|
-
left: i.number(),
|
|
386
|
-
top: i.number(),
|
|
387
|
-
right: i.number(),
|
|
388
|
-
bottom: i.number()
|
|
389
|
-
}), Sr = i.object({
|
|
390
|
-
one: _,
|
|
391
|
-
two: _,
|
|
392
|
-
root: De
|
|
393
|
-
}), rt = { one: m, two: m, root: P }, Er = { one: m, two: Qe, root: te }, nt = (t, e) => ({
|
|
394
|
-
one: t.one,
|
|
395
|
-
two: t.two,
|
|
396
|
-
root: e ?? t.root
|
|
397
|
-
}), h = (t, e, r = 0, n = 0, o) => {
|
|
398
|
-
const s = {
|
|
399
|
-
one: { ...m },
|
|
400
|
-
two: { ...m },
|
|
401
|
-
root: o ?? P
|
|
402
|
-
};
|
|
403
|
-
if (typeof t == "number") {
|
|
404
|
-
if (typeof e != "number")
|
|
405
|
-
throw new Error("Box constructor called with invalid arguments");
|
|
406
|
-
return s.one = { x: t, y: e }, s.two = { x: s.one.x + r, y: s.one.y + n }, s;
|
|
407
|
-
}
|
|
408
|
-
return "one" in t && "two" in t && "root" in t ? { ...t, root: o ?? t.root } : ("getBoundingClientRect" in t && (t = t.getBoundingClientRect()), "left" in t ? (s.one = { x: t.left, y: t.top }, s.two = { x: t.right, y: t.bottom }, s) : (s.one = t, e == null ? s.two = { x: s.one.x + r, y: s.one.y + n } : typeof e == "number" ? s.two = { x: s.one.x + e, y: s.one.y + r } : "width" in e ? s.two = {
|
|
409
|
-
x: s.one.x + e.width,
|
|
410
|
-
y: s.one.y + e.height
|
|
411
|
-
} : "signedWidth" in e ? s.two = {
|
|
412
|
-
x: s.one.x + e.signedWidth,
|
|
413
|
-
y: s.one.y + e.signedHeight
|
|
414
|
-
} : s.two = e, s));
|
|
415
|
-
}, Br = (t, e, r) => {
|
|
416
|
-
const n = h(t);
|
|
417
|
-
if (typeof e == "string") {
|
|
418
|
-
if (r == null) throw new Error("Invalid arguments for resize");
|
|
419
|
-
const o = T(e);
|
|
420
|
-
return h(
|
|
421
|
-
n.one,
|
|
422
|
-
void 0,
|
|
423
|
-
o === "x" ? r : O(n),
|
|
424
|
-
o === "y" ? r : M(n),
|
|
425
|
-
n.root
|
|
426
|
-
);
|
|
427
|
-
}
|
|
428
|
-
return h(n.one, e, void 0, void 0, n.root);
|
|
429
|
-
}, Nr = (t, e, r = !0) => {
|
|
430
|
-
const n = h(t);
|
|
431
|
-
let o = (s, u) => s < u;
|
|
432
|
-
return r && (o = (s, u) => s <= u), "one" in e ? o(w(n), w(e)) && o(S(e), S(n)) && o($(n), $(e)) && o(E(e), E(n)) : o(w(n), e.x) && o(e.x, S(n)) && o($(n), e.y) && o(e.y, E(n));
|
|
433
|
-
}, zr = (t, e) => U(t.one, e.one) && U(t.two, e.two) && Se(t.root, e.root), ot = (t) => ({
|
|
434
|
-
width: O(t),
|
|
435
|
-
height: M(t)
|
|
436
|
-
}), Ar = (t) => ({
|
|
437
|
-
signedWidth: re(t),
|
|
438
|
-
signedHeight: ne(t)
|
|
439
|
-
}), Cr = (t) => ({
|
|
440
|
-
top: $(t),
|
|
441
|
-
left: w(t),
|
|
442
|
-
width: O(t),
|
|
443
|
-
height: M(t)
|
|
444
|
-
}), Ee = (t, e, r = !1) => {
|
|
445
|
-
const n = T(e) === "y" ? ne(t) : re(t);
|
|
446
|
-
return r ? n : Math.abs(n);
|
|
447
|
-
}, H = (t, e) => {
|
|
448
|
-
const r = h(t);
|
|
449
|
-
return {
|
|
450
|
-
x: e.x === "center" ? ye(r).x : B(r, e.x),
|
|
451
|
-
y: e.y === "center" ? ye(r).y : B(r, e.y)
|
|
452
|
-
};
|
|
453
|
-
}, B = (t, e) => {
|
|
454
|
-
const r = h(t), n = Je(r.root).includes(e) ? Math.min : Math.max;
|
|
455
|
-
return K.includes(e) ? n(r.one.x, r.two.x) : n(r.one.y, r.two.y);
|
|
456
|
-
}, Rr = (t) => t.one.x === t.two.x && t.one.y === t.two.y, O = (t) => Ee(t, "x"), M = (t) => Ee(t, "y"), re = (t) => {
|
|
457
|
-
const e = h(t);
|
|
458
|
-
return e.two.x - e.one.x;
|
|
459
|
-
}, ne = (t) => {
|
|
460
|
-
const e = h(t);
|
|
461
|
-
return e.two.y - e.one.y;
|
|
462
|
-
}, st = (t) => H(t, P), _r = (t) => H(t, je), Lr = (t) => H(t, te), Pr = (t) => H(t, Te), S = (t) => B(t, "right"), E = (t) => B(t, "bottom"), w = (t) => B(t, "left"), $ = (t) => B(t, "top"), ye = (t) => G(st(t), {
|
|
463
|
-
x: re(t) / 2,
|
|
464
|
-
y: ne(t) / 2
|
|
465
|
-
}), Be = (t) => {
|
|
466
|
-
const e = h(t);
|
|
467
|
-
return e.root.x === "left" ? w(e) : S(e);
|
|
468
|
-
}, Ne = (t) => {
|
|
469
|
-
const e = h(t);
|
|
470
|
-
return e.root.y === "top" ? $(e) : E(e);
|
|
471
|
-
}, Hr = (t) => ({ x: Be(t), y: Ne(t) }), D = (t) => {
|
|
472
|
-
const e = h(t);
|
|
473
|
-
return { lower: e.one.x, upper: e.two.x };
|
|
474
|
-
}, V = (t) => {
|
|
475
|
-
const e = h(t);
|
|
476
|
-
return { lower: e.one.y, upper: e.two.y };
|
|
477
|
-
}, Zr = (t, e) => nt(t, e), Wr = (t, e) => {
|
|
478
|
-
const r = h(t), n = K.includes(e) ? "x" : Q.includes(e) ? "y" : null;
|
|
479
|
-
if (n === null) throw new Error(`Invalid location: ${Ke}`);
|
|
480
|
-
const o = e === "top" || e === "left" ? Math.min : Math.max, s = { ...r.one }, u = { ...r.two };
|
|
481
|
-
return s[n] = o(r.one[n], r.two[n]), u[n] = o(r.one[n], r.two[n]), [s, u];
|
|
482
|
-
}, Yr = (t, e) => {
|
|
483
|
-
const r = h(t), n = h(e), o = Be(n) + (O(n) - O(r)) / 2, s = Ne(n) + (M(n) - M(r)) / 2;
|
|
484
|
-
return h({ x: o, y: s }, ot(r));
|
|
485
|
-
}, it = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, Fr = (t) => O(t) / M(t), kr = (t, e, r) => {
|
|
486
|
-
if (typeof e == "string") {
|
|
487
|
-
if (r == null) throw new Error("Undefined amount passed into box.translate");
|
|
488
|
-
const o = T(e);
|
|
489
|
-
e = y(o, r);
|
|
490
|
-
}
|
|
491
|
-
const n = h(t);
|
|
492
|
-
return h(
|
|
493
|
-
G(n.one, e),
|
|
494
|
-
G(n.two, e),
|
|
495
|
-
void 0,
|
|
496
|
-
void 0,
|
|
497
|
-
n.root
|
|
498
|
-
);
|
|
499
|
-
}, Xr = (t, e) => {
|
|
500
|
-
const r = Math.max(w(t), w(e)), n = Math.max($(t), $(e)), o = Math.min(S(t), S(e)), s = Math.min(E(t), E(e));
|
|
501
|
-
return r > o || n > s ? rt : h({ x: r, y: n }, { x: o, y: s }, void 0, void 0, t.root);
|
|
502
|
-
}, Dr = (t) => O(t) * M(t), Vr = (t, e) => {
|
|
503
|
-
const r = h(t);
|
|
504
|
-
return h(
|
|
505
|
-
he(r.one, e),
|
|
506
|
-
he(r.two, e),
|
|
507
|
-
void 0,
|
|
508
|
-
void 0,
|
|
509
|
-
r.root
|
|
510
|
-
);
|
|
511
|
-
}, qr = (t, e, r, n, o, s) => {
|
|
512
|
-
const u = { x: t, y: e }, a = { x: t + r, y: e + n };
|
|
513
|
-
return o.x !== s.x && (o.x === "center" ? (u.x -= r / 2, a.x -= r / 2) : (u.x -= r, a.x -= r)), o.y !== s.y && (o.y === "center" ? (u.y -= n / 2, a.y -= n / 2) : (u.y -= n, a.y -= n)), h(u, a, void 0, void 0, s);
|
|
514
|
-
}, Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
515
|
-
__proto__: null,
|
|
516
|
-
DECIMAL: Er,
|
|
517
|
-
ZERO: rt,
|
|
518
|
-
area: Dr,
|
|
519
|
-
areaIsZero: Rr,
|
|
520
|
-
aspect: Fr,
|
|
521
|
-
bottom: E,
|
|
522
|
-
bottomLeft: Lr,
|
|
523
|
-
bottomRight: Pr,
|
|
524
|
-
box: Sr,
|
|
525
|
-
center: ye,
|
|
526
|
-
construct: h,
|
|
527
|
-
constructWithAlternateRoot: qr,
|
|
528
|
-
contains: Nr,
|
|
529
|
-
copy: nt,
|
|
530
|
-
css: Cr,
|
|
531
|
-
cssBox: Tr,
|
|
532
|
-
dim: Ee,
|
|
533
|
-
dims: ot,
|
|
534
|
-
domRect: Ir,
|
|
535
|
-
edgePoints: Wr,
|
|
536
|
-
equals: zr,
|
|
537
|
-
height: M,
|
|
538
|
-
intersection: Xr,
|
|
539
|
-
isBox: it,
|
|
540
|
-
left: w,
|
|
541
|
-
loc: B,
|
|
542
|
-
positionInCenter: Yr,
|
|
543
|
-
reRoot: Zr,
|
|
544
|
-
resize: Br,
|
|
545
|
-
right: S,
|
|
546
|
-
root: Hr,
|
|
547
|
-
signedDims: Ar,
|
|
548
|
-
signedHeight: ne,
|
|
549
|
-
signedWidth: re,
|
|
550
|
-
top: $,
|
|
551
|
-
topLeft: st,
|
|
552
|
-
topRight: _r,
|
|
553
|
-
translate: kr,
|
|
554
|
-
truncate: Vr,
|
|
555
|
-
width: O,
|
|
556
|
-
x: Be,
|
|
557
|
-
xBounds: D,
|
|
558
|
-
xyLoc: H,
|
|
559
|
-
y: Ne,
|
|
560
|
-
yBounds: V
|
|
561
|
-
}, Symbol.toStringTag, { value: "Module" })), ut = i.object({ signedWidth: i.number(), signedHeight: i.number() }), Ur = i.union([xe, ut, _, J]), Gr = { width: 0, height: 0 }, Jr = { 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 }, Kr = (t, e) => {
|
|
562
|
-
if (e == null) return !1;
|
|
563
|
-
const r = d(t), n = d(e);
|
|
564
|
-
return r.width === n.width && r.height === n.height;
|
|
565
|
-
}, Qr = (t) => {
|
|
566
|
-
const e = d(t);
|
|
567
|
-
return { width: e.height, height: e.width };
|
|
568
|
-
}, en = (t) => {
|
|
569
|
-
const e = d(t);
|
|
570
|
-
return `0 0 ${e.width} ${e.height}`;
|
|
571
|
-
}, tn = (t) => {
|
|
572
|
-
const e = d(t);
|
|
573
|
-
return [e.width, e.height];
|
|
574
|
-
}, rn = (t) => ({
|
|
575
|
-
width: Math.max(...t.map((e) => d(e).width)),
|
|
576
|
-
height: Math.max(...t.map((e) => d(e).height))
|
|
577
|
-
}), nn = (t) => ({
|
|
578
|
-
width: Math.min(...t.map((e) => d(e).width)),
|
|
579
|
-
height: Math.min(...t.map((e) => d(e).height))
|
|
580
|
-
}), on = (t, e) => {
|
|
581
|
-
const r = d(t);
|
|
582
|
-
return { width: r.width * e, height: r.height * e };
|
|
583
|
-
}, Hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
584
|
-
__proto__: null,
|
|
585
|
-
DECIMAL: Jr,
|
|
586
|
-
ZERO: Gr,
|
|
587
|
-
construct: d,
|
|
588
|
-
couple: tn,
|
|
589
|
-
crude: Ur,
|
|
590
|
-
dimensions: xe,
|
|
591
|
-
equals: Kr,
|
|
592
|
-
max: rn,
|
|
593
|
-
min: nn,
|
|
594
|
-
scale: on,
|
|
595
|
-
signed: ut,
|
|
596
|
-
svgViewBox: en,
|
|
597
|
-
swap: Qr
|
|
598
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
599
|
-
var sn = Object.defineProperty, un = (t, e, r) => e in t ? sn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, x = (t, e, r) => un(t, typeof e != "symbol" ? e + "" : e, r);
|
|
600
|
-
const an = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r : t, ln = i.object({ offset: pe, scale: pe }), cn = (t) => (e, r, n, o) => r === "dimension" ? [e, n] : [
|
|
601
|
-
e,
|
|
602
|
-
o ? n - t : n + t
|
|
603
|
-
], pn = (t) => (e, r, n, o) => [
|
|
604
|
-
e,
|
|
605
|
-
o ? n / t : n * t
|
|
606
|
-
], hn = (t) => (e, r, n) => {
|
|
607
|
-
if (e === null) return [t, n];
|
|
608
|
-
const { lower: o, upper: s } = e, { lower: u, upper: a } = t, l = s - o, c = a - u;
|
|
609
|
-
if (r === "dimension") return [t, n * (c / l)];
|
|
610
|
-
const f = (n - o) * (c / l) + u;
|
|
611
|
-
return [t, f];
|
|
612
|
-
}, yn = (t) => (e, r, n) => [t, n], fn = () => (t, e, r) => {
|
|
613
|
-
if (t === null) throw new Error("cannot invert without bounds");
|
|
614
|
-
if (e === "dimension") return [t, r];
|
|
615
|
-
const { lower: n, upper: o } = t;
|
|
616
|
-
return [t, o - (r - n)];
|
|
617
|
-
}, dn = (t) => (e, r, n) => {
|
|
618
|
-
const { lower: o, upper: s } = t;
|
|
619
|
-
return n = an(n, o, s), [e, n];
|
|
620
|
-
}, fe = class C {
|
|
621
|
-
constructor() {
|
|
622
|
-
x(this, "ops", []), x(this, "currBounds", null), x(this, "currType", null), x(this, "reversed", !1), this.ops = [];
|
|
623
|
-
}
|
|
624
|
-
/**
|
|
625
|
-
* @returns a new scale with a translation as its first operation. Any number provided
|
|
626
|
-
* to the {@link pos} operation on the scale will be translated by the specified value.
|
|
627
|
-
* @param value - The amount to translate by.
|
|
628
|
-
*/
|
|
629
|
-
static translate(e) {
|
|
630
|
-
return new C().translate(e);
|
|
631
|
-
}
|
|
632
|
-
/**
|
|
633
|
-
* @returns a new scale with a magnification as its first operation. Any number provided
|
|
634
|
-
* to the {@link pos} or {@link dim} operation will be multiplied by the specified value.
|
|
635
|
-
* @param value - The amount to translate by.
|
|
636
|
-
*/
|
|
637
|
-
static magnify(e) {
|
|
638
|
-
return new C().magnify(e);
|
|
639
|
-
}
|
|
640
|
-
static scale(e, r) {
|
|
641
|
-
return new C().scale(e, r);
|
|
642
|
-
}
|
|
643
|
-
/**
|
|
644
|
-
* @returns a copy of the scale with a translation as its next operation. Any
|
|
645
|
-
* number provided to the {@link pos} method on the scale will be translated by the
|
|
646
|
-
* specified value.
|
|
647
|
-
* @param value - The amount to translate by.
|
|
648
|
-
*/
|
|
649
|
-
translate(e) {
|
|
650
|
-
const r = this.new(), n = cn(e);
|
|
651
|
-
return n.type = "translate", r.ops.push(n), r;
|
|
652
|
-
}
|
|
653
|
-
/**
|
|
654
|
-
* @returns a copy of the scale with a translation as its next operation. Any number
|
|
655
|
-
* provided to the {@link pos} or {@link dim} method on the scale will be multiplied
|
|
656
|
-
* by the specified value.
|
|
657
|
-
* @param value - The amount to magnify by.
|
|
658
|
-
*/
|
|
659
|
-
magnify(e) {
|
|
660
|
-
const r = this.new(), n = pn(e);
|
|
661
|
-
return n.type = "magnify", r.ops.push(n), r;
|
|
662
|
-
}
|
|
663
|
-
scale(e, r) {
|
|
664
|
-
const n = p(e, r), o = this.new(), s = hn(n);
|
|
665
|
-
return s.type = "scale", o.ops.push(s), o;
|
|
666
|
-
}
|
|
667
|
-
clamp(e, r) {
|
|
668
|
-
const n = p(e, r), o = this.new(), s = dn(n);
|
|
669
|
-
return s.type = "clamp", o.ops.push(s), o;
|
|
670
|
-
}
|
|
671
|
-
reBound(e, r) {
|
|
672
|
-
const n = p(e, r), o = this.new(), s = yn(n);
|
|
673
|
-
return s.type = "re-bound", o.ops.push(s), o;
|
|
674
|
-
}
|
|
675
|
-
invert() {
|
|
676
|
-
const e = fn();
|
|
677
|
-
e.type = "invert";
|
|
678
|
-
const r = this.new();
|
|
679
|
-
return r.ops.push(e), r;
|
|
680
|
-
}
|
|
681
|
-
pos(e) {
|
|
682
|
-
return this.exec("position", e);
|
|
683
|
-
}
|
|
684
|
-
dim(e) {
|
|
685
|
-
return this.exec("dimension", e);
|
|
686
|
-
}
|
|
687
|
-
new() {
|
|
688
|
-
const e = new C();
|
|
689
|
-
return e.ops = this.ops.slice(), e.reversed = this.reversed, e;
|
|
690
|
-
}
|
|
691
|
-
exec(e, r) {
|
|
692
|
-
return this.currBounds = null, this.ops.reduce(
|
|
693
|
-
([n, o], s) => s(n, e, o, this.reversed),
|
|
694
|
-
[null, r]
|
|
695
|
-
)[1];
|
|
696
|
-
}
|
|
697
|
-
reverse() {
|
|
698
|
-
const e = this.new();
|
|
699
|
-
e.ops.reverse();
|
|
700
|
-
const r = [];
|
|
701
|
-
return e.ops.forEach((n, o) => {
|
|
702
|
-
if (n.type === "scale" || r.some(([u, a]) => o >= u && o <= a))
|
|
703
|
-
return;
|
|
704
|
-
const s = e.ops.findIndex((u, a) => u.type === "scale" && a > o);
|
|
705
|
-
s !== -1 && r.push([o, s]);
|
|
706
|
-
}), r.forEach(([n, o]) => {
|
|
707
|
-
const s = e.ops.slice(n, o);
|
|
708
|
-
s.unshift(e.ops[o]), e.ops.splice(n, o - n + 1, ...s);
|
|
709
|
-
}), e.reversed = !e.reversed, e;
|
|
710
|
-
}
|
|
711
|
-
};
|
|
712
|
-
x(fe, "IDENTITY", new fe());
|
|
713
|
-
let de = fe;
|
|
714
|
-
const gn = (t) => ({
|
|
715
|
-
scale: {
|
|
716
|
-
x: t.x.dim(1),
|
|
717
|
-
y: t.y.dim(1)
|
|
718
|
-
},
|
|
719
|
-
offset: {
|
|
720
|
-
x: t.x.pos(0),
|
|
721
|
-
y: t.y.pos(0)
|
|
722
|
-
}
|
|
723
|
-
}), ge = class b {
|
|
724
|
-
constructor(e = new de(), r = new de(), n = null) {
|
|
725
|
-
x(this, "x"), x(this, "y"), x(this, "currRoot"), this.x = e, this.y = r, this.currRoot = n;
|
|
726
|
-
}
|
|
727
|
-
static translate(e, r) {
|
|
728
|
-
return new b().translate(e, r);
|
|
729
|
-
}
|
|
730
|
-
static translateX(e) {
|
|
731
|
-
return new b().translateX(e);
|
|
732
|
-
}
|
|
733
|
-
static translateY(e) {
|
|
734
|
-
return new b().translateY(e);
|
|
735
|
-
}
|
|
736
|
-
static clamp(e) {
|
|
737
|
-
return new b().clamp(e);
|
|
738
|
-
}
|
|
739
|
-
static magnify(e) {
|
|
740
|
-
return new b().magnify(e);
|
|
741
|
-
}
|
|
742
|
-
static scale(e) {
|
|
743
|
-
return new b().scale(e);
|
|
744
|
-
}
|
|
745
|
-
static reBound(e) {
|
|
746
|
-
return new b().reBound(e);
|
|
747
|
-
}
|
|
748
|
-
translate(e, r) {
|
|
749
|
-
const n = y(e, r), o = this.copy();
|
|
750
|
-
return o.x = this.x.translate(n.x), o.y = this.y.translate(n.y), o;
|
|
751
|
-
}
|
|
752
|
-
translateX(e) {
|
|
753
|
-
const r = this.copy();
|
|
754
|
-
return r.x = this.x.translate(e), r;
|
|
755
|
-
}
|
|
756
|
-
translateY(e) {
|
|
757
|
-
const r = this.copy();
|
|
758
|
-
return r.y = this.y.translate(e), r;
|
|
759
|
-
}
|
|
760
|
-
magnify(e) {
|
|
761
|
-
const r = this.copy();
|
|
762
|
-
return r.x = this.x.magnify(e.x), r.y = this.y.magnify(e.y), r;
|
|
763
|
-
}
|
|
764
|
-
scale(e) {
|
|
765
|
-
const r = this.copy();
|
|
766
|
-
if (it(e)) {
|
|
767
|
-
const n = this.currRoot;
|
|
768
|
-
return r.currRoot = e.root, n != null && !Se(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(D(e)), r.y = r.y.scale(V(e)), r;
|
|
769
|
-
}
|
|
770
|
-
return r.x = r.x.scale(e.width), r.y = r.y.scale(e.height), r;
|
|
771
|
-
}
|
|
772
|
-
reBound(e) {
|
|
773
|
-
const r = this.copy();
|
|
774
|
-
return r.x = this.x.reBound(D(e)), r.y = this.y.reBound(V(e)), r;
|
|
775
|
-
}
|
|
776
|
-
clamp(e) {
|
|
777
|
-
const r = this.copy();
|
|
778
|
-
return r.x = this.x.clamp(D(e)), r.y = this.y.clamp(V(e)), r;
|
|
779
|
-
}
|
|
780
|
-
copy() {
|
|
781
|
-
const e = new b();
|
|
782
|
-
return e.currRoot = this.currRoot, e.x = this.x, e.y = this.y, e;
|
|
783
|
-
}
|
|
784
|
-
reverse() {
|
|
785
|
-
const e = this.copy();
|
|
786
|
-
return e.x = this.x.reverse(), e.y = this.y.reverse(), e;
|
|
787
|
-
}
|
|
788
|
-
pos(e) {
|
|
789
|
-
return { x: this.x.pos(e.x), y: this.y.pos(e.y) };
|
|
790
|
-
}
|
|
791
|
-
box(e) {
|
|
792
|
-
return h(
|
|
793
|
-
this.pos(e.one),
|
|
794
|
-
this.pos(e.two),
|
|
795
|
-
0,
|
|
796
|
-
0,
|
|
797
|
-
this.currRoot ?? e.root
|
|
798
|
-
);
|
|
799
|
-
}
|
|
800
|
-
};
|
|
801
|
-
x(ge, "IDENTITY", new ge());
|
|
802
|
-
let bn = ge;
|
|
803
|
-
const Zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
804
|
-
__proto__: null,
|
|
805
|
-
Scale: de,
|
|
806
|
-
XY: bn,
|
|
807
|
-
crudeXYTransform: ln,
|
|
808
|
-
xyScaleToTransform: gn
|
|
809
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
810
|
-
function at(t) {
|
|
811
|
-
var e, r, n = "";
|
|
812
|
-
if (typeof t == "string" || typeof t == "number") n += t;
|
|
813
|
-
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
814
|
-
var o = t.length;
|
|
815
|
-
for (e = 0; e < o; e++) t[e] && (r = at(t[e])) && (n && (n += " "), n += r);
|
|
816
|
-
} else for (r in t) t[r] && (n && (n += " "), n += r);
|
|
817
|
-
return n;
|
|
818
|
-
}
|
|
819
|
-
function xn() {
|
|
820
|
-
for (var t, e, r = 0, n = "", o = arguments.length; r < o; r++) (t = arguments[r]) && (e = at(t)) && (n && (n += " "), n += e);
|
|
821
|
-
return n;
|
|
822
|
-
}
|
|
823
|
-
const mn = xn, Ce = "-", Re = "__", W = "--", lt = (t) => {
|
|
824
|
-
const e = (...r) => mn(...r);
|
|
825
|
-
return e.B = (r) => t + Ce + r, e.E = (r) => t + Re + r, e.M = (r) => t + W + r, e.BM = (r, n) => e.B(r) + W + n, e.BE = (r, n) => e.B(r) + Re + n, e.BEM = (r, n, o) => e.BE(r, n) + W + o, e.extend = (r) => lt(e.B(r)), e.var = (r) => W + t + Ce + r, e;
|
|
826
|
-
}, wn = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, be = i.string().regex(wn), A = i.number().min(0).max(255), $n = i.number().min(0).max(1), ze = i.tuple([A, A, A, $n]), ct = i.tuple([A, A, A]), pt = i.object({ rgba255: ze }), vn = (t) => t == null ? void 0 : new N(t).hex, On = (t) => {
|
|
827
|
-
if (t == null) return;
|
|
828
|
-
const e = N.z.safeParse(t);
|
|
829
|
-
if (e.success) return e.data.rgbaCSS;
|
|
830
|
-
if (typeof t == "string") return t;
|
|
831
|
-
throw e.error;
|
|
832
|
-
}, g = class g {
|
|
833
|
-
/**
|
|
834
|
-
* @constructor Creates a new color from the given color value. The color value can be
|
|
835
|
-
* a hex string, an array of RGB or RGBA values, or another color.
|
|
836
|
-
*
|
|
837
|
-
* @param color - The color value to create the color from. If the color value is a
|
|
838
|
-
* string, it must be a valid hex color (with or without the '#') with a hasheless
|
|
839
|
-
* length 6 or 8. If the hex color is 8 characters long, the last twoc haracters are
|
|
840
|
-
* used as the alpha value. If the color value is an array, it must be an array of
|
|
841
|
-
* length 3 or 4, with each value between 0 and 255. If the color value is another
|
|
842
|
-
* color, the color will be copied.
|
|
843
|
-
*
|
|
844
|
-
* @param alpha - An optional alpha value to set. If the color value carries its own
|
|
845
|
-
* alpha value, this value will be ignored. Defaults to 1.
|
|
846
|
-
*/
|
|
847
|
-
constructor(e, r = 1) {
|
|
848
|
-
/**
|
|
849
|
-
* @property the color as an RGBA tuple, with each color value between 0 and 255,
|
|
850
|
-
* and the alpha value between 0 and 1.
|
|
851
|
-
*/
|
|
852
|
-
z(this, "rgba255");
|
|
853
|
-
if (typeof e == "string") this.rgba255 = g.fromHex(e, r);
|
|
854
|
-
else if (Array.isArray(e)) {
|
|
855
|
-
if (e.length < 3 || e.length > 4)
|
|
856
|
-
throw new Error(`Invalid color: [${e.join(", ")}]`);
|
|
857
|
-
this.rgba255 = e.length === 3 ? [...e, r ?? 1] : e;
|
|
858
|
-
} else this.rgba255 = e.rgba255;
|
|
859
|
-
}
|
|
860
|
-
/**
|
|
861
|
-
* @returns true if the given color is semantically equal to this color. Different
|
|
862
|
-
* representations of the same color are considered equal (e.g. hex and rgba).
|
|
863
|
-
*/
|
|
864
|
-
equals(e) {
|
|
865
|
-
if (e == null) return !1;
|
|
866
|
-
const r = new g(e);
|
|
867
|
-
return this.rgba255.every((n, o) => n === r.rgba255[o]);
|
|
868
|
-
}
|
|
869
|
-
/**
|
|
870
|
-
* @returns the hex representation of the color. If the color has an opacity of 1,
|
|
871
|
-
* the returned hex will be 6 characters long. Otherwise, it will be 8 characters
|
|
872
|
-
* long.
|
|
873
|
-
*/
|
|
874
|
-
get hex() {
|
|
875
|
-
const [e, r, n, o] = this.rgba255;
|
|
876
|
-
return `#${Y(e)}${Y(r)}${Y(n)}${o === 1 ? "" : Y(o * 255)}`;
|
|
877
|
-
}
|
|
878
|
-
/**
|
|
879
|
-
* @returns the color as a CSS RGBA string.
|
|
880
|
-
*/
|
|
881
|
-
get rgbaCSS() {
|
|
882
|
-
const [e, r, n, o] = this.rgba255;
|
|
883
|
-
return `rgba(${e}, ${r}, ${n}, ${o})`;
|
|
884
|
-
}
|
|
885
|
-
/**
|
|
886
|
-
* @returns the color as a CSS RGB string with no alpha value.
|
|
887
|
-
*/
|
|
888
|
-
get rgbCSS() {
|
|
889
|
-
return `rgb(${this.rgbString})`;
|
|
890
|
-
}
|
|
891
|
-
/**
|
|
892
|
-
* @returns the color as an RGB string, with each color value between 0 and 255.
|
|
893
|
-
* @example "255, 255, 255"
|
|
894
|
-
*/
|
|
895
|
-
get rgbString() {
|
|
896
|
-
const [e, r, n] = this.rgba255;
|
|
897
|
-
return `${e}, ${r}, ${n}`;
|
|
898
|
-
}
|
|
899
|
-
/**
|
|
900
|
-
* @returns the color as an RGBA tuple, with each color value between 0 and 1,
|
|
901
|
-
* and the alpha value between 0 and 1.
|
|
902
|
-
*/
|
|
903
|
-
get rgba1() {
|
|
904
|
-
return [...this.rgb1, this.rgba255[3]];
|
|
905
|
-
}
|
|
906
|
-
get rgb1() {
|
|
907
|
-
return [this.rgba255[0] / 255, this.rgba255[1] / 255, this.rgba255[2] / 255];
|
|
908
|
-
}
|
|
909
|
-
/** @returns the red value of the color, between 0 and 255. */
|
|
910
|
-
get r() {
|
|
911
|
-
return this.rgba255[0];
|
|
912
|
-
}
|
|
913
|
-
/** @returns the green value of the color, between 0 and 255. */
|
|
914
|
-
get g() {
|
|
915
|
-
return this.rgba255[1];
|
|
916
|
-
}
|
|
917
|
-
/** @returns the blue value of the color, between 0 and 255. */
|
|
918
|
-
get b() {
|
|
919
|
-
return this.rgba255[2];
|
|
920
|
-
}
|
|
921
|
-
/** @returns the alpha value of the color, between 0 and 1. */
|
|
922
|
-
get a() {
|
|
923
|
-
return this.rgba255[3];
|
|
924
|
-
}
|
|
925
|
-
/** @returns true if all RGBA values are 0. */
|
|
926
|
-
get isZero() {
|
|
927
|
-
return this.equals(ht);
|
|
928
|
-
}
|
|
929
|
-
get hsla() {
|
|
930
|
-
return Tn(this.rgba255);
|
|
931
|
-
}
|
|
932
|
-
/**
|
|
933
|
-
* Creates a new color with the given alpha.
|
|
934
|
-
*
|
|
935
|
-
* @param alpha - The alpha value to set. If the value is greater than 1, it will be
|
|
936
|
-
* divided by 100.
|
|
937
|
-
* @returns A new color with the given alpha.
|
|
938
|
-
*/
|
|
939
|
-
setAlpha(e) {
|
|
940
|
-
const [r, n, o] = this.rgba255;
|
|
941
|
-
if (e > 100)
|
|
942
|
-
throw new Error(`Color opacity must be between 0 and 100, got ${e}`);
|
|
943
|
-
return e > 1 && (e /= 100), new g([r, n, o, e]);
|
|
944
|
-
}
|
|
945
|
-
/**
|
|
946
|
-
* @returns the luminance of the color, between 0 and 1.
|
|
947
|
-
*/
|
|
948
|
-
get luminance() {
|
|
949
|
-
const [e, r, n] = this.rgb1.map(
|
|
950
|
-
(o) => o <= 0.03928 ? o / 12.92 : ((o + 0.055) / 1.055) ** 2.4
|
|
951
|
-
);
|
|
952
|
-
return Number((0.2126 * e + 0.7152 * r + 0.0722 * n).toFixed(3));
|
|
953
|
-
}
|
|
954
|
-
/**
|
|
955
|
-
* @returns the contrast ratio between this color and the given color. The contrast
|
|
956
|
-
* ratio is a number between 1 and 21, where 1 is the lowest contrast and 21 is the
|
|
957
|
-
* highest.
|
|
958
|
-
* @param other
|
|
959
|
-
* @returns
|
|
960
|
-
*/
|
|
961
|
-
contrast(e) {
|
|
962
|
-
const r = new g(e), n = this.luminance, o = r.luminance;
|
|
963
|
-
return (Math.max(n, o) + 0.5) / (Math.min(n, o) + 0.5);
|
|
964
|
-
}
|
|
965
|
-
pickByContrast(...e) {
|
|
966
|
-
if (e.length === 0)
|
|
967
|
-
throw new Error("[Color.pickByContrast] - must provide at least one color");
|
|
968
|
-
const [r] = e.map((n) => new g(n)).sort((n, o) => this.contrast(o) - this.contrast(n));
|
|
969
|
-
return r;
|
|
970
|
-
}
|
|
971
|
-
get isDark() {
|
|
972
|
-
return this.luminance < 0.5;
|
|
973
|
-
}
|
|
974
|
-
get isLight() {
|
|
975
|
-
return !this.isDark;
|
|
976
|
-
}
|
|
977
|
-
static fromHex(e, r = 1) {
|
|
978
|
-
if (!be.safeParse(e).success) throw new Error(`Invalid hex color: ${e}`);
|
|
979
|
-
return e = Mn(e), [
|
|
980
|
-
F(e, 0),
|
|
981
|
-
F(e, 2),
|
|
982
|
-
F(e, 4),
|
|
983
|
-
e.length === 8 ? F(e, 6) / 255 : r
|
|
984
|
-
];
|
|
985
|
-
}
|
|
986
|
-
};
|
|
987
|
-
z(g, "z", i.union([be, ze, ct, i.instanceof(g), pt]).transform((e) => new g(e)));
|
|
988
|
-
let N = g;
|
|
989
|
-
const ht = new N([0, 0, 0, 0]), Y = (t) => Math.floor(t).toString(16).padStart(2, "0"), F = (t, e) => parseInt(t.slice(e, e + 2), 16), Mn = (t) => t.startsWith("#") ? t.slice(1) : t, jn = (t) => {
|
|
990
|
-
let [e, r, n] = t;
|
|
991
|
-
const o = t[3];
|
|
992
|
-
e /= 360, r /= 100, n /= 100;
|
|
993
|
-
let s, u, a;
|
|
994
|
-
if (r === 0)
|
|
995
|
-
s = u = a = n;
|
|
996
|
-
else {
|
|
997
|
-
const l = n < 0.5 ? n * (1 + r) : n + r - n * r, c = 2 * n - l;
|
|
998
|
-
s = se(c, l, e + 1 / 3), u = se(c, l, e), a = se(c, l, e - 1 / 3);
|
|
999
|
-
}
|
|
1000
|
-
return [Math.round(s * 255), Math.round(u * 255), Math.round(a * 255), o];
|
|
1001
|
-
}, se = (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), Tn = (t) => {
|
|
1002
|
-
let [e, r, n] = t;
|
|
1003
|
-
const o = t[3];
|
|
1004
|
-
e /= 255, r /= 255, n /= 255, e /= 255, r /= 255, n /= 255;
|
|
1005
|
-
const s = Math.max(e, r, n), u = Math.min(e, r, n);
|
|
1006
|
-
let a, l, c = (s + u) / 2;
|
|
1007
|
-
if (s === u)
|
|
1008
|
-
a = l = 0;
|
|
1009
|
-
else {
|
|
1010
|
-
const f = s - u;
|
|
1011
|
-
l = c > 0.5 ? f / (2 - s - u) : f / (s + u), s === e ? a = (r - n) / f + (r < n ? 6 : 0) : s === r ? a = (n - e) / f + 2 : a = (e - r) / f + 4, a /= 6;
|
|
1012
|
-
}
|
|
1013
|
-
return a *= 360, l *= 100, c *= 100, [Math.round(a), Math.round(l), Math.round(c), o];
|
|
1014
|
-
}, In = i.union([
|
|
1015
|
-
be,
|
|
1016
|
-
ze,
|
|
1017
|
-
i.instanceof(N),
|
|
1018
|
-
i.string(),
|
|
1019
|
-
ct,
|
|
1020
|
-
pt
|
|
1021
|
-
]), Wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1022
|
-
__proto__: null,
|
|
1023
|
-
Color: N,
|
|
1024
|
-
ZERO: ht,
|
|
1025
|
-
crudeZ: In,
|
|
1026
|
-
cssString: On,
|
|
1027
|
-
fromHSLA: jn,
|
|
1028
|
-
toHex: vn
|
|
1029
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
1030
|
-
class Sn {
|
|
1031
|
-
constructor(e = "") {
|
|
1032
|
-
z(this, "rows", []);
|
|
1033
|
-
z(this, "columns", []);
|
|
1034
|
-
z(this, "prefix");
|
|
1035
|
-
this.prefix = e;
|
|
1036
|
-
}
|
|
1037
|
-
row(e, r, n) {
|
|
1038
|
-
const { prefix: o } = this;
|
|
1039
|
-
return this.rows.push({ startLabel: o + e, endLabel: o + r, size: n }), this;
|
|
1040
|
-
}
|
|
1041
|
-
col(e, r, n) {
|
|
1042
|
-
const { prefix: o } = this;
|
|
1043
|
-
return this.columns.push({ startLabel: o + e, endLabel: o + r, size: n }), this;
|
|
1044
|
-
}
|
|
1045
|
-
build() {
|
|
1046
|
-
return {
|
|
1047
|
-
display: "grid",
|
|
1048
|
-
gridTemplateRows: this.rows.map((e, r) => {
|
|
1049
|
-
let n = r === 0 ? "[" : "";
|
|
1050
|
-
return n += `${e.startLabel}] ${e.size}${typeof e.size == "number" ? "px" : ""} [${e.endLabel}`, n += r === this.rows.length - 1 ? "]" : "", n;
|
|
1051
|
-
}).join(" "),
|
|
1052
|
-
gridTemplateColumns: this.columns.map((e, r) => {
|
|
1053
|
-
let n = r === 0 ? "[" : "";
|
|
1054
|
-
return n += `${e.startLabel}] ${e.size}${typeof e.size == "number" ? "px" : ""} [${e.endLabel}`, n += r === this.columns.length - 1 ? "]" : "", n;
|
|
1055
|
-
}).join(" ")
|
|
1056
|
-
};
|
|
1057
|
-
}
|
|
1058
|
-
}
|
|
1059
|
-
const En = (t, e) => Object.entries(e).forEach(
|
|
1060
|
-
([r, n]) => n != null && t.style.setProperty(r, `${n}`)
|
|
1061
|
-
), Bn = (t, e) => Array.from(t.style).forEach((r) => {
|
|
1062
|
-
r.startsWith(e) && t.style.removeProperty(r);
|
|
1063
|
-
}), Nn = (t) => {
|
|
1064
|
-
const e = lt(t);
|
|
1065
|
-
return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M(Ke.construct(r)), e.disabled = (r) => r === !0 && e.M("disabled"), e.align = (r) => e.M(r), e.dir = (r) => r != null && e.M(Jt.construct(r)), e.size = (r) => typeof r == "string" && e.M(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}`) : 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.noWrap = (r) => r && e.M("no-wrap"), e.applyVars = En, e.removeVars = Bn, e.newGridBuilder = (r) => new Sn(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) => e.M(`shade-${r}`), e.shadeVar = (r) => `var(--${t}-gray-l${r})`, e.levelSizeVar = (r) => `var(--${t}-${r}-size)`, e;
|
|
1066
|
-
}, Yn = Nn("pluto");
|
|
1067
|
-
export {
|
|
1068
|
-
Se as $,
|
|
1069
|
-
M as A,
|
|
1070
|
-
pr as B,
|
|
1071
|
-
Yn as C,
|
|
1072
|
-
O as D,
|
|
1073
|
-
Pn as E,
|
|
1074
|
-
Dr as F,
|
|
1075
|
-
Rn as G,
|
|
1076
|
-
Xr as H,
|
|
1077
|
-
ur as I,
|
|
1078
|
-
Ke as J,
|
|
1079
|
-
cr as K,
|
|
1080
|
-
St as M,
|
|
1081
|
-
Rt as T,
|
|
1082
|
-
Xt as U,
|
|
1083
|
-
Cn as W,
|
|
1084
|
-
ht as Z,
|
|
1085
|
-
Hn as _,
|
|
1086
|
-
N as a,
|
|
1087
|
-
In as b,
|
|
1088
|
-
On as c,
|
|
1089
|
-
Wn as d,
|
|
1090
|
-
tr as e,
|
|
1091
|
-
jn as f,
|
|
1092
|
-
Jt as g,
|
|
1093
|
-
I as h,
|
|
1094
|
-
p as i,
|
|
1095
|
-
kt as j,
|
|
1096
|
-
Qt as k,
|
|
1097
|
-
Zn as l,
|
|
1098
|
-
an as m,
|
|
1099
|
-
lt as n,
|
|
1100
|
-
xn as o,
|
|
1101
|
-
_n as p,
|
|
1102
|
-
Ln as q,
|
|
1103
|
-
lr as r,
|
|
1104
|
-
Me as s,
|
|
1105
|
-
vn as t,
|
|
1106
|
-
T as u,
|
|
1107
|
-
h as v,
|
|
1108
|
-
H as w,
|
|
1109
|
-
qr as x,
|
|
1110
|
-
Ie as y,
|
|
1111
|
-
P as z
|
|
1112
|
-
};
|