import { useEffect, useInsertionEffect, useLayoutEffect, useState, useSyncExternalStore, } from "react"; // The browser's Fullscreen API, WebKit included. // // Safari and iPadOS still ship only the prefixed spelling: no `fullscreenchange`, no // `fullscreenElement`, no `requestFullscreen` on a plain element. Reading only the unprefixed names // there means the page believes it is NEVER fullscreen — which silently breaks whatever the // fullscreen state drives (an overlay that must yield, a focus reclaim, an Esc branch that would // otherwise close the whole player instead of just leaving fullscreen). // // Both video surfaces (PlayerModal's YouTube embed, PlexPlayer's