import React, { useState } from 'react'; import { X, Globe, Sliders, AlertTriangle, CheckCircle2, RefreshCw } from 'lucide-react'; import { calculateAnycastSpeedOfLight } from '../../services/forensicApi'; interface AnycastSandboxModalProps { isOpen: boolean; onClose: () => void; } const GLOBAL_POPS = [ { name: 'Frankfurt (FRA)', coords: '50.1109° N, 8.6821° E', distanceKm: 6500 }, { name: 'Ashburn, VA (IAD)', coords: '39.0438° N, 77.4874° W', distanceKm: 500 }, { name: 'London (LHR)', coords: '51.5074° N, 0.1278° W', distanceKm: 5900 }, { name: 'Tokyo (NRT)', coords: '35.6762° N, 139.6503° E', distanceKm: 10800 }, { name: 'Singapore (SIN)', coords: '1.3521° N, 103.8198° E', distanceKm: 15300 }, { name: 'Sydney (SYD)', coords: '33.8688° S, 151.2093° E', distanceKm: 16000 }, ]; export const AnycastSandboxModal: React.FC = ({ isOpen, onClose, }) => { const [distanceKm, setDistanceKm] = useState(6500); const [measuredRttMs, setMeasuredRttMs] = useState(14); if (!isOpen) return null; const result = calculateAnycastSpeedOfLight(distanceKm, measuredRttMs); return (
{/* Header */}

ANYCAST BGP SPEED-OF-LIGHT PROPAGATION SANDBOX

{/* Content */}
PHYSICAL PRINCIPLE:

Light in optical fiber propagates at approximately ⅔ c ≈ 200,000 km/s. A signal traveling a round-trip distance of 2 · d cannot physically return in less than t ≥ (2d) / (200,000) s = d / 100 ms.

{/* Preset Buttons */}
Select Reference Target PoP:
{GLOBAL_POPS.map((pop, i) => ( ))}
{/* Sliders */}
Fiber Distance (d): {distanceKm.toLocaleString()} km
setDistanceKm(Number(e.target.value))} className="w-full accent-cyan-500 cursor-pointer" />
Measured TCP Round-Trip Time (RTT): {measuredRttMs} ms
setMeasuredRttMs(Number(e.target.value))} className="w-full accent-amber-500 cursor-pointer" />
{/* Output Verdict */}
THEORETICAL FIBER MINIMUM {result.fiberRealisticMinMs} ms
PROPAGATION DELTA (ANOMALY) {result.deltaMs} ms
{result.isPhysicalViolation ? ( <> SPEED-OF-LIGHT VIOLATION: Target is spoofing location via Proxy / Anycast overlay. ) : ( <> PHYSICALLY PLAUSIBLE: Round-trip time satisfies optical fiber limits. )}
{/* Footer */}
); };