import type React from 'react'; /** * Extract the YouTube video id from any common URL shape OR from a * bare 11-char id (carousels and some admin shapes pass that form * directly). * * Uses strict `URL` parsing + an anchored pathname regex — NOT the * legacy `.*v=` pattern that CodeQL flagged for polynomial-time * backtracking on adversarial input like `youtube.com/watch?` * repeated N times. Bare-id fallback uses an anchored character-class * regex so it can never ReDoS either. * * Exported so admin tooling and carousel thumbnail logic can validate * a URL without rendering the full `