"use strict";
/**
 * 品牌视觉资产默认注册表
 *
 * 所有组件的视觉资源（Logo、头像、图标、插图）在此统一注册。
 * 业务侧通过 getAssets(overrides?) 获取最终资源 URL，组件不再硬编码 CDN 地址。
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.DEFAULT_ASSETS = void 0;
exports.getAssets = getAssets;
const DEFAULT_ASSETS = {
    agent: {
        avatarUrl: 'https://img.alicdn.com/imgextra/i2/O1CN01fiy8cp1iwWJGz1fyK_!!6000000004477-2-tps-72-72.png',
        avatarBadgeUrl: 'https://img.alicdn.com/imgextra/i2/O1CN01QNq56X25esChSnvRW_!!6000000007552-55-tps-20-16.svg',
        heroUrl: 'https://img.alicdn.com/imgextra/i1/O1CN01KkjpZd1xtyLJuUVRm_!!6000000006502-2-tps-626-272.png',
        followOrderIconUrl: 'https://img.alicdn.com/imgextra/i2/O1CN01HkOqMj1Iz6Wx2P5rj_!!6000000000963-55-tps-16-16.svg',
    },
    filter: {
        sendButtonIconUrl: 'https://img.alicdn.com/imgextra/i3/O1CN01qOipHR1dzCXr91M6h_!!6000000003806-2-tps-24-24.png',
        recordMaskUrl: 'https://img.alicdn.com/imgextra/i4/O1CN01f26w1Z1Wh9YdajZBl_!!6000000002819-55-tps-16-16.svg',
    },
    table: {
        selectedBadgeIconUrl: 'https://img.alicdn.com/imgextra/i3/O1CN01JMYzvU1J8GS4AeHY5_!!6000000000983-55-tps-12-12.svg',
        initPageBgUrl: 'https://img.alicdn.com/imgextra/i4/O1CN01gUrnMc25JLbIMRj9W_!!6000000007505-2-tps-2084-896.png',
        illustrationGeneralUrl: 'https://img.alicdn.com/imgextra/i1/O1CN01ZzBrMW1xiWRdYs0e8_!!6000000006477-2-tps-548-480.png',
        illustrationDigitalUrl: 'https://img.alicdn.com/imgextra/i4/O1CN01oL67rm1iP5OsqgOpO_!!6000000004404-2-tps-548-480.png',
        fieldTypeIcons: {},
        toolbarIcons: {},
    },
};
exports.DEFAULT_ASSETS = DEFAULT_ASSETS;
function deepMerge(base, overrides) {
    if (!overrides)
        return base;
    const result = { ...base };
    for (const key of Object.keys(overrides)) {
        const val = overrides[key];
        if (val !== undefined && val !== null) {
            if (typeof val === 'object' && !Array.isArray(val) && typeof base[key] === 'object') {
                result[key] = { ...base[key], ...val };
            }
            else {
                result[key] = val;
            }
        }
    }
    return result;
}
/**
 * 获取品牌资产（带可选覆盖）
 *
 * @param overrides - 业务侧资产覆盖配置
 * @returns 合并后的完整资产清单
 *
 * @example
 * ```ts
 * const assets = getAssets({
 *   agent: { avatarUrl: 'https://my-cdn.com/avatar.png' },
 * });
 * ```
 */
function getAssets(overrides) {
    if (!overrides)
        return DEFAULT_ASSETS;
    return {
        agent: deepMerge(DEFAULT_ASSETS.agent, overrides.agent),
        filter: deepMerge(DEFAULT_ASSETS.filter, overrides.filter),
        table: deepMerge(DEFAULT_ASSETS.table, overrides.table),
    };
}
