/**
 * 桑基图 Mock（图2风格）：左多源 → 中枢 UV → 右多去向。
 * 默认总量 1000，便于按百分比读数。
 *
 * @returns {{
 *   nodes: Array<{ id: string, label: string, labelPercent?: number, colorToken?: string }>,
 *   links: Array<{ source: string, target: string, value: number }>
 * }}
 */
export function buildSankeyMockData() {
  const nodes = [
    { id: 'src-ai-entry', label: 'AI入口', labelPercent: 38, colorToken: 'data-4' },
    { id: 'src-cs-session', label: '客服会话', labelPercent: 22, colorToken: 'data-0' },
    { id: 'src-ticket-list', label: '工单列表', labelPercent: 9, colorToken: 'data-7' },
    { id: 'src-kb', label: '知识库', labelPercent: 11, colorToken: 'data-6' },
    { id: 'src-notice', label: '消息提醒', labelPercent: 6, colorToken: 'data-8' },
    { id: 'src-other', label: '其他渠道', labelPercent: 14, colorToken: 'data-5' },
    { id: 'hub-service-uv', label: '服务首页 UV', labelPercent: 100, colorToken: 'data-0' },
    { id: 'dst-ai-answer', label: 'AI解答', labelPercent: 24, colorToken: 'data-1' },
    { id: 'dst-human-seat', label: '人工客服', labelPercent: 22, colorToken: 'data-0' },
    { id: 'dst-ticket-create', label: '创建工单', labelPercent: 16, colorToken: 'data-9' },
    { id: 'dst-queue', label: '排队等待', labelPercent: 11, colorToken: 'data-4' },
    { id: 'dst-kb-search', label: '知识检索', labelPercent: 10, colorToken: 'data-6' },
    { id: 'dst-followup', label: '二次跟进', labelPercent: 9, colorToken: 'data-7' },
    { id: 'dst-satisfied', label: '满意度反馈', labelPercent: 8, colorToken: 'data-11' },
  ];

  const links = [
    { source: 'src-ai-entry', target: 'hub-service-uv', value: 380 },
    { source: 'src-cs-session', target: 'hub-service-uv', value: 220 },
    { source: 'src-ticket-list', target: 'hub-service-uv', value: 90 },
    { source: 'src-kb', target: 'hub-service-uv', value: 110 },
    { source: 'src-notice', target: 'hub-service-uv', value: 60 },
    { source: 'src-other', target: 'hub-service-uv', value: 140 },

    { source: 'hub-service-uv', target: 'dst-ai-answer', value: 240 },
    { source: 'hub-service-uv', target: 'dst-human-seat', value: 220 },
    { source: 'hub-service-uv', target: 'dst-ticket-create', value: 160 },
    { source: 'hub-service-uv', target: 'dst-queue', value: 110 },
    { source: 'hub-service-uv', target: 'dst-kb-search', value: 100 },
    { source: 'hub-service-uv', target: 'dst-followup', value: 90 },
    { source: 'hub-service-uv', target: 'dst-satisfied', value: 80 },
  ];

  return { nodes, links };
}
