Build a video-analytics service that produces a daily view report from playback events.
Requirements
Return [{video_id, views, unique_viewers}], sorted by views descending, then video_id ascending.
Dates are inclusive YYYY-MM-DD UTC dates. Input timestamps are valid ISO timestamps with Z or an explicit offset.
Keep the first occurrence of each event id BEFORE filtering dates. A retried event cannot move into another day.
Count every retained event as a view and distinct user_id values as viewers. Do not mutate input. Reject a reversed date range with ValueError containing date.