from __future__ import annotations

from dataclasses import dataclass
from typing import Any


@dataclass(frozen=True)
class Word:
    word_id: str
    source_id: str
    text: str
    start_ms: int
    end_ms: int


@dataclass(frozen=True)
class Unit:
    unit_id: str
    source_id: str
    text: str
    start_word_id: str
    end_word_id: str
    start_ms: int
    end_ms: int


@dataclass(frozen=True)
class Source:
    source_id: str
    source_order: int
    selection_index: int
    language: str
    duration_ms: int
    has_video: bool
    has_audio: bool
    words: tuple[Word, ...]
    units: tuple[Unit, ...]


@dataclass(frozen=True)
class PreparedSession:
    contract_version: int
    order_mode: str
    order_warnings: tuple[dict[str, Any], ...]
    editor_context: str
    sources: tuple[Source, ...]
