"use client"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { footageAt } from "@/lib/report/footage-move.mjs"; import { finaleUp, stampAt, tallyAt } from "@/lib/report/liveClock.mjs"; import { chromeTime, gapJoins, playPlan, skipEntries } from "@/lib/report/playCut.mjs"; import { gapMarkAt, gapMarkCorner, playGapMarks } from "@/lib/report/gapCueView.mjs"; import GapMarkChip from "./GapMarkChip"; import { tallyCellsFrom, VERDICTS } from "umtool-report-to-video/factcheck"; import { fullFrameItems, layerOffOver } from "umtool-report-to-video/full-frame"; import { DeckFrame, FeedOverlay, ModuleLayers, PostsOverlay, postsWindowAt, type DeckPreviewDoc, type FullFrameTraits, type Rect } from "../OnscreenSection"; import { usePlayEngine } from "./playEngine/usePlayEngine"; import { useRenderCuts } from "./playEngine/useRenderCuts"; import type { ItemGate, MediaRef } from "./playEngine/engine"; import { postPreload } from "./playEngine/postPreload"; import PostItemPlayer, { postItemAssets } from "./PostItemPlayer"; import SidePostOverlay from "./SidePostOverlay"; import VideoEntryPlayer from "./VideoEntryPlayer"; import TeaserCardPlayer, { type TeaserPage } from "./TeaserCardPlayer"; import IntroCardPlayer from "./IntroCardPlayer"; import { useIntroPage } from "./useIntroPage"; import { videoStageAt } from "@/lib/report/playVideo.mjs"; import ComboBadge from "./ComboBadge"; import type { PlayEntry, PlayViewData } from "./PlayCut"; // --------------------------------------------------------------------------- // THE PLAYER CORE, extracted from PlayCut (umtool redesign L7a): what plays the // draft -- or a version -- in the browser in its final look, with no render, // and nothing else. Play (PlayCut.tsx) and the workspace (workspace/Workspace.tsx) // both draw it; neither forks it. // // usePlayCore(view) the composition (the live preview's deck, POST // /api/report/chrome/preview), the plan (the estimate's // segments re-timed by the render's edges), the teasers' // and the intro's pages, the engine (one Web Audio clock, // the picture slaved to it), the post items' gate and // their fetching ahead -- and what is on screen now. // the picture: the two