from __future__ import annotations

FIXED_KNOWLEDGE_FOLDERS = [
    "财务知识库",
    "制度政策",
    "报销制度",
    "差旅规范",
    "发票管理",
    "税务合规",
    "预算管理",
    "财务共享",
    "培训资料",
    "常见问答",
]

ICON_BY_TYPE = {
    "pdf": "mdi mdi-file-document-outline-pdf pdf",
    "word": "mdi mdi-file-document-outline-word word",
    "excel": "mdi mdi-file-document-outline-excel excel",
    "ppt": "mdi mdi-file-powerpoint-box ppt",
    "image": "mdi mdi-file-image-outline image",
    "text": "mdi mdi-file-document-outline text",
    "archive": "mdi mdi-folder-zip-outline archive",
    "binary": "mdi mdi-file-outline",
}

TEXT_EXTENSIONS = {"txt", "md", "csv", "json", "xml", "yml", "yaml", "log"}
WORD_EXTENSIONS = {"doc", "docx"}
EXCEL_EXTENSIONS = {"xls", "xlsx", "csv"}
PPT_EXTENSIONS = {"ppt", "pptx"}
IMAGE_EXTENSIONS = {"png", "jpg", "jpeg", "gif", "bmp", "webp", "svg"}
ARCHIVE_EXTENSIONS = {"zip", "rar", "7z"}
STRUCTURED_PREVIEW_EXTENSIONS = {"docx", "xlsx", "pptx"} | TEXT_EXTENSIONS
INLINE_PREVIEW_EXTENSIONS = {"pdf"} | IMAGE_EXTENSIONS
ONLYOFFICE_EDITABLE_EXTENSIONS = {"docx", "xlsx", "pptx"}
KNOWLEDGE_INGEST_SYNC_STALE_SECONDS = 90
KNOWLEDGE_SEARCH_RESULT_LIMIT = 3
KNOWLEDGE_SEARCH_STOP_TERMS = {
    "什么",
    "怎么",
    "如何",
    "多少",
    "是否",
    "可以",
    "一下",
    "请问",
    "帮我",
    "一下子",
    "这个",
    "那个",
    "哪些",
    "一下吧",
}

KNOWLEDGE_INGEST_STATUS_PUBLISHED = 1
KNOWLEDGE_INGEST_STATUS_SYNCING = 2
KNOWLEDGE_INGEST_STATUS_INGESTED = 3
KNOWLEDGE_INGEST_STATUS_FAILED = 4

KNOWLEDGE_INGEST_STATUS_META = {
    KNOWLEDGE_INGEST_STATUS_PUBLISHED: ("待归纳", "muted"),
    KNOWLEDGE_INGEST_STATUS_SYNCING: ("正归纳", "warning"),
    KNOWLEDGE_INGEST_STATUS_INGESTED: ("已归纳", "success"),
    KNOWLEDGE_INGEST_STATUS_FAILED: ("归纳失败", "danger"),
}

