import { getClientURL }   from '@/tools';
import type { Component } from 'vue';


const ShadeTongueUp = defineAsyncComponent(() => import('./ShadeTongueUp.vue'));
const ShadeTongueDown = defineAsyncComponent(() => import('./ShadeTongueDown.vue'));
const ShadeFace = defineAsyncComponent(() => import('./ShadeFace.vue'));


export const DEFAULT_WIDTH = 270;
export const DEFAULT_HEIGHT = 366;
export const DEFAULT_ZOOM = 4;

export interface ConfigProps {
  key: string;
  title: string;
  label?: string;
  description?: string;
  required?: boolean;
  shade: Component;
  example?: string;
  audio?: string;
  video?: { scale?: number; offsetX?: number; offsetY?: number; };
}

export default [
  {
    title: '舌面拍摄', key: 'upImg',
    shade: ShadeTongueUp,
    example: getClientURL('~/camera/step-11.example.png'),
    audio: getClientURL('~/camera/step-11.audio.wav'),
    required: true,
    description: '请确保舌面无食物残渣、没有染色，舌尖向下伸直、 舌体放松、舌面平展、口张大，请避免在有色光线下拍摄。',
    before: { label: '请将舌头放入框内，点击拍照' },
    after: { label: '请确认照片', example: '', audio: '' },
    video: { scale: 1, offsetX: 0, offsetY: 50, },
  },
  {
    title: '舌下拍摄', key: 'downImg',
    shade: ShadeTongueDown,
    example: getClientURL('~/camera/step-21.example.png'),
    audio: getClientURL('~/camera/step-21.audio.wav'),
    required: true,
    description: '舌尖向上抵住上颚、舌体放松、口张大、露出舌下，请避免在有色光线下拍摄。',
    before: { label: '请将舌下放入框内，点击拍照' },
    after: { label: '请确认照片', example: '', audio: '' },
    video: { scale: 1, offsetX: 0, offsetY: 50, },
  },
  {
    title: '面部拍摄', key: 'faceImg',
    shade: ShadeFace,
    example: getClientURL('~/camera/step-31.example.png'),
    audio: getClientURL('~/camera/step-31.audio.wav'),
    required: true,
    description: '请摘下眼镜、平视前方、不要浓妆、不要遮挡面部，请避免在有色光线下拍摄。',
    before: { label: '请将面部放入框内，点击拍照' },
    after: { label: '请确认照片', example: '', audio: '' },
    video: { scale: 2, offsetX: 0, offsetY: 0, },
  },
] as ( ConfigProps & { before: Partial<ConfigProps>; after: Partial<ConfigProps> } )[];
