const { useEffect, useRef, useState, useMemo } = React; function mulberry32(a) { return function () { let t = (a += 0x6D2B79F5); t = Math.imul(t ^ (t >>> 15), t | 1); t ^= t + Math.imul(t ^ (t >>> 7), t | 61); return ((t ^ (t >>> 14)) >>> 0) / 4294967296; }; } // Animated spectrum function Spectrum({ stable = true, intensity = 1 }) { const [t, setT] = useState(0); useEffect(() => { let raf, last = performance.now(); const tick = (now) => { setT((p) => p + (now - last) * 0.001); last = now; raf = requestAnimationFrame(tick); }; raf = requestAnimationFrame(tick); return () => cancelAnimationFrame(raf); }, []); const W = 600, H = 150, N = 56; return ( ); } // Topology function TopologyGraph({ nodes = 412, seed = 1 }) { const W = 600, H = 280; const NN = Math.min(28, Math.max(8, Math.round(nodes / 18))); const points = useMemo(() => { const rng = mulberry32(seed * 9301 + 1); return Array.from({ length: NN }).map((_, i) => { const r = (i % 5 === 0) ? 0.18 : 0.32 + rng() * 0.36; const a = rng() * Math.PI * 2; return { x: W*0.5 + Math.cos(a) * W * r * 0.7, y: H*0.5 + Math.sin(a) * H * r, size: i % 6 === 0 ? 5.5 : (i % 3 === 0 ? 3.6 : 2.4), kind: i % 7 === 0 ? "anchor" : "node", }; }); }, [seed, NN]); const edges = useMemo(() => { const rng = mulberry32(seed * 13); const e = []; for (let i = 0; i < points.length; i++) { const k = 1 + Math.floor(rng() * 3); for (let j = 0; j < k; j++) { const tg = (i + 1 + Math.floor(rng() * (points.length - 1))) % points.length; if (tg !== i) e.push([i, tg]); } } return e; }, [points, seed]); const [t, setT] = useState(0); useEffect(() => { let raf; const tick = () => { setT(performance.now() * 0.001); raf = requestAnimationFrame(tick); }; raf = requestAnimationFrame(tick); return () => cancelAnimationFrame(raf); }, []); return ( ); } // Synesthesia waves function SynesStream() { const [t, setT] = useState(0); useEffect(() => { let raf; const tick = () => { setT(performance.now() * 0.001); raf = requestAnimationFrame(tick); }; raf = requestAnimationFrame(tick); return () => cancelAnimationFrame(raf); }, []); const W = 600, H = 140; const lines = [ { y: H*0.25, amp: 12, freq: 1.6, c: "var(--energy)", op: 0.9 }, { y: H*0.50, amp: 18, freq: 0.8, c: "var(--energy)", op: 0.55 }, { y: H*0.75, amp: 8, freq: 2.4, c: "var(--gold)", op: 0.7 }, ]; return ( ); } // Knob function Knob({ value, onChange, label, zh, disabled }) { const ang = 30 + (value / 100) * 240; const drag = (e) => { if (disabled) return; e.preventDefault(); const sy = e.clientY, sv = value; const move = (ev) => onChange(Math.max(0, Math.min(100, Math.round(sv + (sy - ev.clientY) * 0.6)))); const up = () => { window.removeEventListener("mousemove", move); window.removeEventListener("mouseup", up); }; window.addEventListener("mousemove", move); window.addEventListener("mouseup", up); }; return (