// 主项目(产品)类型枚举
export enum ProjectTypeEnum {
  SCRIPT_TO_VIDEO = 1, // "剧本转视频"
  VIDEO_TO_VIDEO = 2,  // "视频复刻视频"
}

// 模式枚举
export enum ModeEnum {
  MANUAL = 'manual',     // "手动"
  AUTOMATIC = 'automatic',  // "自动"
}

// 分辨率枚举
export enum ResolutionEnum {
  HD_720P = '720p',        // "720p"
  FULL_HD_1080P = '1080p',  // "1080p"
  UHD_2K = '2k',         // "2k"
  UHD_4K = '4k',         // "4k"
}

// 视频时长枚举
export enum VideoDurationEnum {
  ONE_MINUTE = '1min',      // "一分钟"
  TWO_MINUTES = '2min',     // "两分钟"
  THREE_MINUTES = '3min',   // "三分钟"
}

// 工作流阶段枚举
export enum FlowStageEnum {
  PREVIEW = 1,          // "预览图列表分镜草图"
  CHARACTERS = 2,       // "角色列表"
  SHOTS = 3,            // "分镜视频列表"
  BGM = 4,              // "背景音乐列表"
  POST_PRODUCTION = 5,  // "后期操作中"
  MERGE_VIDEO = 6,      // "合并视频完成"
  ERROR = 99,           // "出错"
}

// 任务状态枚举
export enum TaskStatusEnum {
  PENDING = "pending",       // "待处理"
  PROCESSING = "processing", // "处理中"
  COMPLETED = "completed",   // "已完成"
  FAILED = "failed",         // "失败"
  RETRYING = "retrying",     // "重试中"
  CANCELLED = "cancelled",   // "已取消"
}

// 项目类型映射
export const ProjectTypeMap = {
  [ProjectTypeEnum.SCRIPT_TO_VIDEO]: {
    value: "script_to_video",
    label: "script",
    tab: "script"
  },
  [ProjectTypeEnum.VIDEO_TO_VIDEO]: {
    value: "video_to_video",
    label: "clone",
    tab: "clone"
  }
} as const;

// 模式映射
export const ModeMap = {
  [ModeEnum.MANUAL]: {
    value: "manual",
    label: "Manual"
  },
  [ModeEnum.AUTOMATIC]: {
    value: "automatic",
    label: "Automatic"
  }
} as const;

// 分辨率映射
export const ResolutionMap = {
  [ResolutionEnum.HD_720P]: {
    value: "720p",
    label: "720P"
  },
  [ResolutionEnum.FULL_HD_1080P]: {
    value: "1080p",
    label: "1080P"
  },
  [ResolutionEnum.UHD_2K]: {
    value: "2k",
    label: "2K"
  },
  [ResolutionEnum.UHD_4K]: {
    value: "4k",
    label: "4K"
  }
} as const;

// 视频时长映射
export const VideoDurationMap = {
  [VideoDurationEnum.ONE_MINUTE]: {
    value: "1min",
    label: "One Minute"
  },
  [VideoDurationEnum.TWO_MINUTES]: {
    value: "2min",
    label: "Two Minutes"
  },
  [VideoDurationEnum.THREE_MINUTES]: {
    value: "3min",
    label: "Three Minutes"
  }
} as const;

// 分镜脚本编辑器类型定义
export interface StoryboardCard {
  id: string;
  shotId: string; // 分镜ID
  scene?: SceneOption; // 场景
  characters: CharacterOption[]; // 出现人物
  description: string; // 分镜描述
  shotType: string;   // 分镜类型
  cameraMove: string; // 相机运动
  dialogues: DialogueItem[];
  notes?: string;
}

export interface CharacterRef {
  id: string;
  name: string;
}

export interface DialogueItem {
  id: string;
  speaker: string;
  text: string; // 对话内容，支持关键词标记，如 #角色# [场景]
}

export interface CharacterInfo {
  avatar: string;
  gender: string;
  age: string;
  description: string;
}

export interface SceneInfo {
  image: string;
  location: string;
  time: string;
}

export interface SceneOption {
  sceneId: string;
  name: string;
  image: string;
  location: string;
  time: string;
}

export interface CharacterOption {
  characterId: string;
  name: string;
  image: string;
  gender: string;
  age: string;
  description: string;
}
