/* ════════════════════════════════════════════════════════════════ GRUPO CISPE — HERO acordeón cinemático (React + Tailwind) Monta en #hero-root. Edita el array UNITS para texto / color / video. #hero-root[data-chrome="full"] → muestra logo + reloj propios (standalone) #hero-root.hx-embedded en CSS → deja espacio para el nav del sitio ════════════════════════════════════════════════════════════════ */ const { useState, useEffect, useRef, useCallback } = React; const UNITS = [ { id:'seguridad', eyebrow:'CISPE', title:'SEGURIDAD', op:'OPERATIVO U-01', tags:['Protección','Control','Respuesta'], ac:'#D9C229', cta:'ACCEDER AL SITIO', href:'https://cispe-seguridad.com', video:'videos/seguridad.mp4' }, { id:'capacitacion', eyebrow:'CISPE', title:'CAPACITACIÓN', op:'OPERATIVO U-02', tags:['Entrenamiento','Protocolos','Simulacros'], ac:'#4F6F46', cta:'ACCEDER AL SITIO', href:'https://cispe-capacitacion.com', video:'videos/capacitacion.mp4' }, { id:'legal', eyebrow:'CISPE', title:'LEGAL', op:'OPERATIVO U-03', tags:['Respaldo','Cumplimiento','Defensa'], ac:'#B68A3C', cta:'ACCEDER AL SITIO', href:'https://cispe-legal.com', video:'videos/legal.mp4' }, { id:'monitoreo', eyebrow:'CISPE', title:'MONITOREO', op:'OPERATIVO U-04', tags:['Vigilancia','Análisis','Control'], ac:'#35B7F2', cta:'ACCEDER AL SITIO', href:'https://cispe-monitoreo.com', video:'videos/monitoreo.mp4' }, { id:'comercializadora', eyebrow:'CISPE', title:'COMERCIALIZADORA', op:'OPERATIVO U-05', tags:['Equipamiento','Tecnología','Suministro'], ac:'#C96A18', cta:'ACCEDER AL SITIO', href:'https://cispe-comercializadora.com', video:'videos/comercializadora.mp4' }, { id:'investigacion', eyebrow:'CISPE', title:'INVESTIGACIÓN', op:'OPERATIVO U-06', tags:['Inteligencia','Evidencia','Verificación'], ac:'#7C6AA8', cta:'ACCEDER AL SITIO', href:'https://cispeinvestigacion.com', video:'videos/investigacion.mp4' }, { id:'grupo', eyebrow:'GRUPO', title:'CISPE', op:'MATRIZ OPERATIVA', tags:['Seis unidades','Una misión'], ac:'#1D8FE1', cta:'CONOCER MÁS', href:'#', video:'videos/grupo-cispe.mp4', matrix:true }, ]; const FALLBACK_DWELL = 6500; // ms — si un video no carga o no tiene duración const HARD_CAP = 14000; // ms — tope por panel para mantener la rotación viva function Arrow({ s = 13 }) { return ( ); } function Panel({ u, idx, active, vertical, onActivate, setRef, onFail, failed }) { const isActive = active; return (
onActivate(idx)} onKeyDown={(e) => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); onActivate(idx); } }} tabIndex={0} role="button" aria-pressed={isActive} aria-label={u.eyebrow + " " + u.title} > {!failed ? ( ) : (
)}
{/* index chip */}
{String(idx + 1).padStart(2, "0")}
{/* compressed label */}
{u.matrix ? "GRUPO CISPE" : u.title}
{/* active content */}
); } function Hero({ full }) { const [active, setActive] = useState(0); const [progress, setProgress] = useState(0); const [failed, setFailed] = useState({}); const [vertical, setVertical] = useState(false); const [clock, setClock] = useState("--:--:--"); const [muted, setMuted] = useState(false); // música ON por defecto const [needTap, setNeedTap] = useState(false); // navegador bloqueó el autoplay const [inView, setInView] = useState(true); // hero visible en el viewport const audioRef = useRef(null); const sectionRef = useRef(null); const musicStartedRef = useRef(false); const mutedRef = useRef(false); /* ── AUDIO SINGLETON: garantiza que NUNCA exista más de un