import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/dashboard'
  },
  {
    path: '/share/:token',
    name: 'SharedSession',
    component: () => import('@/views/share/index.vue'),
    meta: { title: '共享对话', public: true }
  },
  {
    path: '/dashboard',
    name: 'Dashboard',
    component: () => import('@/views/dashboard/index.vue'),
    meta: { title: '控制台' }
  },
  {
    path: '/rag-lab',
    name: 'RagLab',
    component: () => import('@/views/rag-lab/index.vue'),
    meta: { title: 'RAG 实验室' }
  },
  {
    path: '/monitoring',
    name: 'Monitoring',
    component: () => import('@/views/monitoring/index.vue'),
    meta: { title: '会话监控' }
  },
  {
    path: '/admin/embedding',
    name: 'EmbeddingConfig',
    component: () => import('@/views/admin/embedding/index.vue'),
    meta: { title: '嵌入模型配置' }
  },
  {
    path: '/admin/llm',
    name: 'LLMConfig',
    component: () => import('@/views/admin/llm/index.vue'),
    meta: { title: 'LLM 模型配置' }
  },
  {
    path: '/admin/prompt-templates',
    name: 'PromptTemplate',
    component: () => import('@/views/admin/prompt-template/index.vue'),
    meta: { title: 'Prompt 模板管理' }
  },
  {
    path: '/admin/knowledge-bases',
    name: 'KnowledgeBase',
    component: () => import('@/views/admin/knowledge-base/index.vue'),
    meta: { title: '多知识库管理' }
  },
  {
    path: '/admin/metadata-schemas',
    name: 'MetadataSchema',
    component: () => import('@/views/admin/metadata-schema/index.vue'),
    meta: { title: '元数据模式配置' }
  },
  {
    path: '/admin/slot-definitions',
    name: 'SlotDefinition',
    component: () => import('@/views/admin/slot-definition/index.vue'),
    meta: { title: '槽位定义管理' }
  },
  {
    path: '/admin/scene-slot-bundles',
    name: 'SceneSlotBundle',
    component: () => import('@/views/admin/scene-slot-bundle/index.vue'),
    meta: { title: '场景槽位包管理' }
  },
  {
    path: '/admin/intent-rules',
    name: 'IntentRule',
    component: () => import('@/views/admin/intent-rule/index.vue'),
    meta: { title: '意图规则管理' }
  },
  {
    path: '/admin/script-flows',
    name: 'ScriptFlow',
    component: () => import('@/views/admin/script-flow/index.vue'),
    meta: { title: '话术流程管理' }
  },
  {
    path: '/admin/guardrails',
    name: 'Guardrail',
    component: () => import('@/views/admin/guardrail/index.vue'),
    meta: { title: '输出护栏管理' }
  },
  {
    path: '/admin/mid-platform-playground',
    name: 'MidPlatformPlayground',
    component: () => import('@/views/admin/mid-platform-playground/index.vue'),
    meta: { title: '中台联调工作台' }
  },
  {
    path: '/admin/decomposition-templates',
    name: 'DecompositionTemplate',
    component: () => import('@/views/admin/decomposition-template/index.vue'),
    meta: { title: '拆解模板管理' }
  },
  {
    path: '/admin/monitoring/intent-rules',
    name: 'IntentRuleMonitoring',
    component: () => import('@/views/admin/monitoring/IntentRules.vue'),
    meta: { title: '意图规则监控' }
  },
  {
    path: '/admin/monitoring/prompt-templates',
    name: 'PromptTemplateMonitoring',
    component: () => import('@/views/admin/monitoring/PromptTemplates.vue'),
    meta: { title: 'Prompt 模板监控' }
  },
  {
    path: '/admin/monitoring/script-flows',
    name: 'ScriptFlowMonitoring',
    component: () => import('@/views/admin/monitoring/ScriptFlows.vue'),
    meta: { title: '话术流程监控' }
  },
  {
    path: '/admin/monitoring/guardrails',
    name: 'GuardrailMonitoring',
    component: () => import('@/views/admin/monitoring/Guardrails.vue'),
    meta: { title: '输出护栏监控' }
  },
  {
    path: '/admin/monitoring/conversations',
    name: 'ConversationTracking',
    component: () => import('@/views/admin/monitoring/ConversationTracking.vue'),
    meta: { title: '对话追踪' }
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
