/**
 * Aspect Ratio Utilities
 *
 * Maps aspect ratio strings from VideoScript.meta to pixel dimensions.
 */

type Dimensions = { width: number; height: number };

const ASPECT_RATIO_MAP: Record<string, Dimensions> = {
  '9:16': { width: 1080, height: 1920 },
  '16:9': { width: 1920, height: 1080 },
  '1:1': { width: 1080, height: 1080 },
};

/**
 * Parse an aspect ratio string into pixel dimensions.
 * Defaults to 9:16 (1080x1920) for unknown ratios.
 */
export function parseAspectRatio(aspectRatio: string): Dimensions {
  return ASPECT_RATIO_MAP[aspectRatio] ?? ASPECT_RATIO_MAP['9:16'];
}
