// The Plex player's session machine, without React, hls.js or a media pipeline: every race it exists // to win, driven step by step. PlexPlayer's DOM tests hold the same behaviour through the component. import { describe, it, expect, vi } from "vitest"; import type { PlexPlaySession } from "./api"; import { HlsEngine, MAX_SESSION_RECLAIMS, RECLAIM_WINDOW_MS, type EngineDeps, type HlsHandlers, type HlsPort, type SessionParams, } from "./hlsEngine"; import { HLS_SUB_LAG } from "./plexPlayerPrefs"; /** A