export interface IComponent {
    label: string;
    value: string;
    restriction: {
        width: number;
        height: number;
        fileSize: number;
        maxNumber: number;
        minNumber: number;
        name: string;
    };
}
/** 二级视频组件类型 */
export const DEFAULT_COMPONENT_SUB_VIDEO_TYPE = [
    {
        label: '16:9 视频',
        value: 'VIDEO_16X9',
        restriction: {
            width: 1280,
            height: 720,
            fileSize: 512000,
            maxNumber: 1,
            minNumber: 1,
            maxDuration: 300000,
            name: 'video'
        }
    },
    {
        label: '9:16 视频',
        value: 'VIDEO_9X16',
        restriction: {
            width: 720,
            height: 1280,
            fileSize: 512000,
            maxNumber: 1,
            minNumber: 1,
            maxDuration: 300000,
            name: 'video'
        }
    },
    {
        label: '4:3 视频',
        value: 'VIDEO_4X3',
        restriction: {
            width: 1280,
            height: 960,
            fileSize: 512000,
            maxNumber: 1,
            minNumber: 1,
            maxDuration: 300000,
            name: 'video'
        }
    },
    // {
    //     label: '橱窗视频',
    //     value: 'VIDEO_SHOWCASE'
    // },
    // {
    //     label: '橱窗视频',
    //     value: 'SHORT_VIDEO_4X3'
    // }
]

/** 二级图片组件类型 */
export const DEFAULT_COMPONENT_SUB_IMAGE_TYPE = [
    {
        label: '16:9单图',
        value: 'IMAGE_16X9',
        restriction: {
            width: 1280,
            height: 720,
            fileSize: 400,
            maxNumber: 1,
            minNumber: 1,
            name: 'image'
        }
    },
    {
        label: '9:16单图',
        value: 'IMAGE_9X16',
        restriction: [
            {
                width: 1080,
                height: 1920,
                fileSize: 400,
                maxNumber: 1,
                minNumber: 1,
                name: 'image'
            },
            {
                width: 720,
                height: 1280,
                fileSize: 400,
                maxNumber: 1,
                minNumber: 1,
                name: 'image'
            }
        ]
    },
    {
        label: '1:1单图',
        value: 'IMAGE_1X1',
        restriction: {
            width: 800,
            height: 800,
            fileSize: 400,
            maxNumber: 1,
            minNumber: 1,
            name: 'image'
        }
    },
    {
        label: '20:7banner图',
        value: 'IMAGE_20X7',
        restriction: {
            width: 960,
            height: 334,
            fileSize: 400,
            maxNumber: 1,
            minNumber: 1,
            name: 'image'
        }
    },
    {
        label: '3:4单图',
        value: 'IMAGE_3X4',
        restriction: {
            width: 960,
            height: 1280,
            fileSize: 400,
            maxNumber: 1,
            minNumber: 1,
            name: 'image'
        }
    },
    {
        label: '4:3单图',
        value: 'IMAGE_4X3',
        restriction: {
            width: 1280,
            height: 960,
            fileSize: 400,
            maxNumber: 1,
            minNumber: 1,
            name: 'image'
        }
    },
    {
        label: '3:2单图',
        value: 'IMAGE_3X2',
        restriction: {
            width: 480,
            height: 320,
            fileSize: 400,
            maxNumber: 1,
            minNumber: 1,
            name: 'image'
        }
    },
    {
        label: '7:2通栏大图',
        value: 'IMAGE_7X2',
        restriction: {
            width: 960,
            height: 274,
            fileSize: 400,
            maxNumber: 1,
            minNumber: 1,
            name: 'image'
        }
    },
    {
        label: '5:4单图',
        value: 'IMAGE_5X4',
        restriction: {
            width: 1280,
            height: 1024,
            fileSize: 400,
            maxNumber: 1,
            minNumber: 1,
            name: 'image'
        }
    },
    {
        label: '4:5单图',
        value: 'IMAGE_4X5',
        restriction: {
            width: 1024,
            height: 1280,
            fileSize: 400,
            maxNumber: 1,
            minNumber: 1,
            name: 'image'
        }
    },
    {
        label: '1:1一图',
        value: 'IMAGE_LIST_1X1_1',
        restriction: {
            width: 800,
            height: 800,
            fileSize: 400,
            maxNumber: 1,
            minNumber: 1,
            name: 'image_list'
        }
    },
    {
        label: '1:1三图',
        value: 'IMAGE_LIST_1X1_3',
        restriction: {
            width: 800,
            height: 800,
            fileSize: 400,
            maxNumber: 3,
            minNumber: 3,
            name: 'image_list'
        }
    },
    {
        label: '1:1四图',
        value: 'IMAGE_LIST_1X1_4',
        restriction: {
            width: 800,
            height: 800,
            fileSize: 400,
            maxNumber: 4,
            minNumber: 4,
            name: 'image_list'
        }
    },
    {
        label: '1:1六图',
        value: 'IMAGE_LIST_1X1_6',
        restriction: {
            width: 800,
            height: 800,
            fileSize: 400,
            maxNumber: 6,
            minNumber: 6,
            name: 'image_list'
        }
    },
    {
        label: '1:1九图',
        value: 'IMAGE_LIST_1X1_9',
        restriction: {
            width: 800,
            height: 800,
            fileSize: 400,
            maxNumber: 9,
            minNumber: 9,
            name: 'image_list'
        }
    },
    {
        label: '3:2三图',
        value: 'IMAGE_LIST_3X2_3',
        restriction: {
            width: 480,
            height: 320,
            fileSize: 400,
            maxNumber: 3,
            minNumber: 3,
            name: 'image_list'
        }
    }
]

/** 默认展示图片组件类型 */
export const DEFAULT_COMPONENT_SUB_SHOW_IMAGE = [
    "SEARCH_IMAGE_1X1",
    "SEARCH_IMAGE_BIG_20X7",
    "SEARCH_IMAGE_16X9",
    "SEARCH_IMAGE_LIST_1X1",
    "SEARCH_IMAGE_LIST_9X16",
    "IMAGE_16X9",
    "IMAGE_9X16",
    "IMAGE_1X1",
    "IMAGE_LIST_1X1_1",
    "IMAGE_20X7",
    "IMAGE_100X9",
    "IMAGE_3X4",
    "IMAGE_4X3",
    "IMAGE_3X2",
    "IMAGE_7X2",
    "IMAGE_5X4",
    "IMAGE_4X5",
    "IMAGE_LIST_1X1_3",
    "IMAGE_LIST_1X1_4",
    "IMAGE_LIST_1X1_6",
    "IMAGE_LIST_1X1_9",
    "IMAGE_LIST_3X2_3",
    "ELEMENT_STORY",
    "IMAGE_LIST_16X9_1",
    "IMAGE_SHOWCASE"
]

/** 默认展示视频组件类型 */
export const DEFAULT_COMPONENT_SUB_SHOW_VIDEO = [
    "SEARCH_VIDEO_16X9_IMAGE_16X9",
    "SEARCH_VIDEO_9X16_IMAGE_9X16",
    "VIDEO_16X9",
    "VIDEO_9X16",
    "VIDEO_4X3",
    "SHORT_VIDEO_4X3",
    "APP_PROMOTION_VIDEO_16X9",
    "VIDEO_SHOWCASE"
]

export const DEFAULT_COMPONENT_SUB_SHOW_TEXT = [
    'DESCRIPTION',
    'TITLE'
]

/** 潜力状态 */
export enum COMMON_POTENTIAL_STATUS_ENUM {
    COMMON_POTENTIAL_STATUS_DEFAULT = '潜力暂无判断',
    COMMON_POTENTIAL_STATUS_LOW = '潜力低',
    COMMON_POTENTIAL_STATUS_HIGH = '潜力高'
}


/** 来源 */
export enum COMPONENT_GENERATION_TYPE_ENUM {
    COMPONENT_GENERATION_TYPE_USER_CREATE = '客户素材',
    COMPONENT_GENERATION_TYPE_SYSTEM_DERIVE = 'AIGC推荐'
}

/** 所有二级组件类型 */
export const COMPONENT_SUB_TYPE = [
    {
        "label": "16:9 视频",
        "value": "VIDEO_16X9"
    },
    {
        "label": "9:16 视频",
        "value": "VIDEO_9X16"
    },
    {
        "label": "4:3 视频",
        "value": "VIDEO_4X3"
    },
    {
        "label": "橱窗视频",
        "value": "VIDEO_SHOWCASE"
    },
    {
        "label": "4:3 视频",
        "value": "SHORT_VIDEO_4X3"
    },
    {
        "label": "16:9 单图",
        "value": "IMAGE_16X9"
    },
    {
        "label": "9:16 单图",
        "value": "IMAGE_9X16"
    },
    {
        "label": "1:1 单图",
        "value": "IMAGE_1X1"
    },
    {
        "label": "3:2 单图",
        "value": "IMAGE_3X2"
    },
    {
        "label": "3:4 单图",
        "value": "IMAGE_3X4"
    },
    {
        "label": "4:3 单图",
        "value": "IMAGE_4X3"
    },
    {
        "label": "5:4 单图",
        "value": "IMAGE_5X4"
    },
    {
        "label": "4:5 单图",
        "value": "IMAGE_4X5"
    },
    {
        "label": "20:7banner 图",
        "value": "IMAGE_20X7"
    },
    {
        "label": "7:2 通栏大图",
        "value": "IMAGE_7X2"
    },
    {
        "label": "橱窗图片",
        "value": "IMAGE_SHOWCASE"
    },
    {
        "label": "100:9 PC 横版通栏",
        "value": "IMAGE_100X9"
    },
    {
        "label": "9:16 四图",
        "value": "IMAGE_LIST_9X16_4"
    },
    {
        "label": "1:1 三图",
        "value": "IMAGE_LIST_1X1_3"
    },
    {
        "label": "1:1 四图",
        "value": "IMAGE_LIST_1X1_4"
    },
    {
        "label": "1:1 六图",
        "value": "IMAGE_LIST_1X1_6"
    },
    {
        "label": "3:2 三图",
        "value": "IMAGE_LIST_3X2_3"
    },
    {
        "label": "1:1 一图",
        "value": "IMAGE_LIST_1X1_1"
    },
    {
        "label": "16:9 一图",
        "value": "IMAGE_LIST_16X9_1"
    },
    {
        "label": "1:1 九图",
        "value": "IMAGE_LIST_1X1_9"
    },
    {
        "label": "集装箱创意组合组件",
        "value": "ELEMENT_STORY"
    },
    {
        "label": "文案",
        "value": "DESCRIPTION"
    },
    {
        "label": "标题",
        "value": "TITLE"
    },
    {
        "label": "行动按钮",
        "value": "ACTION_BUTTON"
    },
    {
        "label": "标签",
        "value": "LABEL"
    },
    {
        "label": "数据展示",
        "value": "SHOW_DATA"
    },
    {
        "label": "浮层卡片-图文复合",
        "value": "FLOATING_ZONE_IMAGE_TEXT"
    },
    {
        "label": "浮层卡片-单图",
        "value": "FLOATING_ZONE_IMAGE"
    },
    {
        "label": "弹幕",
        "value": "BARRAGE"
    },
    {
        "label": "礼包组件",
        "value": "APP_GIFT_PACK_CODE"
    },
    {
        "label": "卖点图",
        "value": "SHOP_IMAGE"
    },
    {
        "label": "挂件",
        "value": "MARKETING_PENDANT"
    },
    {
        "label": "选择按钮",
        "value": "CHOSEN_BUTTON"
    },
    {
        "label": "倒计时",
        "value": "COUNT_DOWN"
    },
    {
        "label": "轮播文案",
        "value": "LIVING_DESC"
    },
    {
        "label": "朋友圈文字链",
        "value": "TEXT_LINK"
    },
    {
        "label": "视频结束页",
        "value": "END_PAGE"
    },
    {
        "label": "试玩页",
        "value": "WXGAME_PLAYABLE_PAGE"
    },
    {
        "label": "首评回复组件",
        "value": "SOCIAL_SKILL"
    },
    {
        "label": "图文链接组件",
        "value": "MINI_CARD_LINK"
    },
    {
        "label": "浮层卡片-图文轮播",
        "value": "FLOATING_ZONE_IMAGE_TEXT_LIST"
    },
    {
        "label": "客服问答组件",
        "value": "CONSULT_LINK"
    },
    {
        "label": "商品卡片组件",
        "value": "SHOP_PRODUCT_CARD"
    },
    {
        "label": "自定义",
        "value": "BRAND"
    },
    {
        "label": "品牌简介页",
        "value": "BRAND_PAGE"
    },
    {
        "label": "搜一搜超级品专",
        "value": "BRAND_SEARCH"
    },
    {
        "label": "视频号",
        "value": "BRAND_WECHAT_CHANNEL"
    },
    {
        "label": "公众号",
        "value": "BRAND_WECHAT"
    },
    {
        "label": "企业微信",
        "value": "BRAND_WECOM"
    },
    {
        "label": "官方落地页",
        "value": "JUMP_INFO_OFFICIAL"
    },
    {
        "label": "自定义",
        "value": "JUMP_INFO_H5"
    },
    {
        "label": "微信小程序",
        "value": "JUMP_INFO_WECHAT_MINI_PROGRAM"
    },
    {
        "label": "微信客服",
        "value": "JUMP_INFO_WECHAT_CONSULT"
    },
    {
        "label": "企业微信",
        "value": "JUMP_INFO_WECOM_CONSULT"
    },
    {
        "label": "视频号观看直播",
        "value": "JUMP_INFO_WECHAT_CHANNELS_WATCH_LIVE"
    },
    {
        "label": "视频号视频详情页",
        "value": "JUMP_INFO_WECHAT_CHANNELS_FEED"
    },
    {
        "label": "微信公众号详情页",
        "value": "JUMP_INFO_WECHAT_OFFICIAL_ACCOUNT_DETAIL"
    },
    {
        "label": "微信小游戏",
        "value": "JUMP_INFO_WECHAT_MINI_GAME"
    },
    {
        "label": "安卓默认下载落地页",
        "value": "JUMP_INFO_ANDROID_APP"
    },
    {
        "label": "IOS 默认下载落地页",
        "value": "JUMP_INFO_IOS_APP"
    },
    {
        "label": "一键下载",
        "value": "JUMP_INFO_ANDROID_DIRECT_DOWNLOAD"
    },
    {
        "label": "厂商直达",
        "value": "JUMP_INFO_APP_MARKET"
    },
    {
        "label": "应用直达",
        "value": "JUMP_INFO_APP_DEEP_LINK"
    },
    {
        "label": "视频号小店商品详情页",
        "value": "JUMP_INFO_WECHAT_CHANNELS_SHOP_PRODUCT"
    },
    {
        "label": "QQ 小游戏",
        "value": "JUMP_INFO_QQ_MINI_GAME"
    }
]

/**
 * 判断组件类型
 * @param componentSubType 
 * @returns 
 */
export const getComponentType = (componentSubType: string) => {
    if (!componentSubType) return 'OTHER'
    if (['IMAGE_16X9', 'IMAGE_1X1', 'IMAGE_9X16', 'IMAGE_20X7', 'IMAGE_3X4', 'IMAGE_4X3', 'IMAGE_3X2', 'IMAGE_7X2', 'IMAGE_5X4', 'IMAGE_4X5'].includes(componentSubType)) {
        return 'IMAGE'
    } else if (componentSubType.includes('VIDEO')) {
        return 'VIDEO'
    } else if (['IMAGE_LIST_1X1_9', 'IMAGE_LIST_1X1_3', 'IMAGE_LIST_1X1_4', 'IMAGE_LIST_1X1_6', 'IMAGE_LIST_3X2_3', 'IMAGE_LIST_1X1_1'].includes(componentSubType)) {
        return 'IMAGE_LIST'
    } else {
        return 'OTHER'
    }
}