From 34f89df6f159faaf3d194dca8708e8b2e0b823cc Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Wed, 22 Nov 2023 17:51:34 +0800
Subject: [PATCH 01/26] chore:update readme
---
README.md | 6 ++++--
README.zh.md | 37 +++++++++++++++++++------------------
2 files changed, 23 insertions(+), 20 deletions(-)
diff --git a/README.md b/README.md
index 09d67bd13..0b4efffbc 100644
--- a/README.md
+++ b/README.md
@@ -61,9 +61,11 @@ In the era of Data 3.0, enterprises and developers can take the ability to creat
[DB-GPT Youtube Video](https://www.youtube.com/watch?v=f5_g0OObZBQ)
## Demo
-Run on an RTX 4090 GPU.
+##### Chat Data
+![chatdata](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/1f77079e-d018-4eee-982b-9b6a66bf1063)
+
##### Chat Excel
-![excel](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/0474d220-2a9f-449f-a940-92c8a25af390)
+![excel](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/3044e83b-a71e-41fe-a1e2-98e479e0ab59)
## Install
![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white)
diff --git a/README.zh.md b/README.zh.md
index 0ab05ab4a..6bb6c89ff 100644
--- a/README.zh.md
+++ b/README.zh.md
@@ -52,10 +52,11 @@ DB-GPT是一个开源的数据库领域大模型框架。目的是构建大模
## 效果演示
-示例通过 RTX 4090 GPU 演示
+##### Chat Data
+![chatdata](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/1f77079e-d018-4eee-982b-9b6a66bf1063)
##### Chat Excel
-![excel](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/0474d220-2a9f-449f-a940-92c8a25af390)
+![excel](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/3044e83b-a71e-41fe-a1e2-98e479e0ab59)
#### 根据自然语言对话生成分析图表
@@ -73,22 +74,22 @@ DB-GPT是一个开源的数据库领域大模型框架。目的是构建大模
![macOS](https://img.shields.io/badge/mac%20os-000000?style=for-the-badge&logo=macos&logoColor=F0F0F0)
![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white)
-[**教程**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh-cn/latest/getting_started/install/deploy.html)
-- [**安装**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh-cn/latest/getting_started/install/deploy.html)
- - [**Install Step by Step**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh-cn/latest/getting_started/install/deploy.html)
- - [**Docker安装**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/install/docker/docker.html)
- - [**Docker Compose安装**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/install/docker_compose/docker_compose.html)
-- [**产品使用手册**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/application/chatdb/chatdb.html)
- - [**ChatData**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/application/chatdb/chatdb.html)
- - [**ChatKnowledge**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/application/kbqa/kbqa.html)
- - [**ChatExcel**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/application/chatexcel/chatexcel.html)
- - [**Dashboard**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/application/dashboard/dashboard.html)
- - [**LLM 管理**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/application/model/model.html)
- - [**Chat Agent**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/application/chatagent/chatagent.html)
-- [**如何部署LLM**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/install/cluster/cluster.html)
- - [**Standalone**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/install/cluster/vms/standalone.html#)
- - [**Cluster**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/install/cluster/vms/index.html)
- - [**vLLM**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/install/llm/vllm/vllm.html)
+[**教程**](https://www.yuque.com/eosphoros/dbgpt-docs/bex30nsv60ru0fmx)
+- [**快速开始**](https://www.yuque.com/eosphoros/dbgpt-docs/ew0kf1plm0bru2ga)
+ - [**源码安装**](https://www.yuque.com/eosphoros/dbgpt-docs/urh3fcx8tu0s9xmb)
+ - [**Docker安装**](https://www.yuque.com/eosphoros/dbgpt-docs/glf87qg4xxcyrp89)
+ - [**Docker Compose安装**](https://www.yuque.com/eosphoros/dbgpt-docs/wwdu11e0v5nkfzin)
+- [**产品使用手册**](https://www.yuque.com/eosphoros/dbgpt-docs/tkspdd0tcy2vlnu4)
+ - [**数据对话**](https://www.yuque.com/eosphoros/dbgpt-docs/gd9hbhi1dextqgbz)
+ - [**知识库**](https://www.yuque.com/eosphoros/dbgpt-docs/ycyz3d9b62fccqxh)
+ - [**ChatExcel**](https://www.yuque.com/eosphoros/dbgpt-docs/prugoype0xd2g4bb)
+ - [**数据库对话**](https://www.yuque.com/eosphoros/dbgpt-docs/wswpv3zcm2c9snmg)
+ - [**报表分析**](https://www.yuque.com/eosphoros/dbgpt-docs/vsv49p33eg4p5xc1)
+ - [**插件**](https://www.yuque.com/eosphoros/dbgpt-docs/pom41m7oqtdd57hm)
+- [**如何部署模型服务**](https://www.yuque.com/eosphoros/dbgpt-docs/vubxiv9cqed5mc6o)
+ - [**单机部署**](https://www.yuque.com/eosphoros/dbgpt-docs/kwg1ed88lu5fgawb)
+ - [**集群部署**](https://www.yuque.com/eosphoros/dbgpt-docs/gmbp9619ytyn2v1s)
+ - [**vLLM**](https://www.yuque.com/eosphoros/dbgpt-docs/bhy9igdvanx1uluf)
- [**如何Debug**](https://db-gpt.readthedocs.io/en/latest/getting_started/observability.html)
- [**FAQ**](https://db-gpt.readthedocs.io/en/latest/getting_started/faq/deploy/deploy_faq.html)
From a27e3dc716f50df42cf8c4895486500530a9517c Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Mon, 27 Nov 2023 17:00:27 +0800
Subject: [PATCH 02/26] feat:add recall similarity score
---
pilot/configs/config.py | 9 +-
pilot/embedding_engine/embedding_engine.py | 18 +++-
pilot/scene/base.py | 3 +
pilot/scene/chat_factory.py | 1 +
pilot/scene/chat_knowledge/v1/chat.py | 16 ++-
pilot/vector_store/base.py | 12 +++
pilot/vector_store/chroma_store.py | 21 +++-
pilot/vector_store/connector.py | 12 +++
pilot/vector_store/extract_tovec.py | 89 ----------------
pilot/vector_store/file_loader.py | 113 ---------------------
pilot/vector_store/milvus_store.py | 69 ++++++++++++-
11 files changed, 139 insertions(+), 224 deletions(-)
delete mode 100644 pilot/vector_store/extract_tovec.py
delete mode 100644 pilot/vector_store/file_loader.py
diff --git a/pilot/configs/config.py b/pilot/configs/config.py
index f93cd7b83..c5e612709 100644
--- a/pilot/configs/config.py
+++ b/pilot/configs/config.py
@@ -104,13 +104,6 @@ def __init__(self) -> None:
self.use_mac_os_tts = False
self.use_mac_os_tts = os.getenv("USE_MAC_OS_TTS")
- # milvus or zilliz cloud configuration
- self.milvus_addr = os.getenv("MILVUS_ADDR", "localhost:19530")
- self.milvus_username = os.getenv("MILVUS_USERNAME")
- self.milvus_password = os.getenv("MILVUS_PASSWORD")
- self.milvus_collection = os.getenv("MILVUS_COLLECTION", "dbgpt")
- self.milvus_secure = os.getenv("MILVUS_SECURE", "False").lower() == "true"
-
self.authorise_key = os.getenv("AUTHORISE_COMMAND_KEY", "y")
self.exit_key = os.getenv("EXIT_KEY", "n")
self.image_provider = os.getenv("IMAGE_PROVIDER", True)
@@ -190,7 +183,7 @@ def __init__(self) -> None:
self.LOCAL_DB_PASSWORD = os.getenv("LOCAL_DB_PASSWORD", "aa123456")
self.LOCAL_DB_POOL_SIZE = int(os.getenv("LOCAL_DB_POOL_SIZE", 10))
- self.CHAT_HISTORY_STORE_TYPE = os.getenv("CHAT_HISTORY_STORE_TYPE", "duckdb")
+ self.CHAT_HISTORY_STORE_TYPE = os.getenv("CHAT_HISTORY_STORE_TYPE", "db")
### LLM Model Service Configuration
self.LLM_MODEL = os.getenv("LLM_MODEL", "vicuna-13b-v1.5")
diff --git a/pilot/embedding_engine/embedding_engine.py b/pilot/embedding_engine/embedding_engine.py
index ce739c3bb..ec50afe6b 100644
--- a/pilot/embedding_engine/embedding_engine.py
+++ b/pilot/embedding_engine/embedding_engine.py
@@ -84,8 +84,22 @@ def similar_search(self, text, topk):
)
# https://github.com/chroma-core/chroma/issues/657
ans = vector_client.similar_search(text, topk)
- # except NotEnoughElementsException:
- # ans = vector_client.similar_search(text, 1)
+ return ans
+
+ def similar_search_with_scores(self, text, topk, score_threshold: float = 0.3):
+ """
+ similar_search_with_score in vector database..
+ Return docs and relevance scores in the range [0, 1].
+ Args:
+ doc(str): query text
+ topk(int): return docs nums. Defaults to 4.
+ score_threshold(float): score_threshold: Optional, a floating point value between 0 to 1 to
+ filter the resulting set of retrieved docs,0 is dissimilar, 1 is most similar.
+ """
+ vector_client = VectorStoreConnector(
+ self.vector_store_config["vector_store_type"], self.vector_store_config
+ )
+ ans = vector_client.similar_search_with_scores(text, topk, score_threshold)
return ans
def vector_exist(self):
diff --git a/pilot/scene/base.py b/pilot/scene/base.py
index e3478f7c3..432352405 100644
--- a/pilot/scene/base.py
+++ b/pilot/scene/base.py
@@ -106,6 +106,9 @@ class ChatScene(Enum):
ExtractEntity = Scene(
"extract_entity", "Extract Entity", "Extract Entity", ["Extract Select"], True
)
+ QueryRewrite = Scene(
+ "query_rewrite", "query_rewrite", "query_rewrite", ["query_rewrite"], True
+ )
@staticmethod
def of_mode(mode):
diff --git a/pilot/scene/chat_factory.py b/pilot/scene/chat_factory.py
index 10a588c04..256cd3ebe 100644
--- a/pilot/scene/chat_factory.py
+++ b/pilot/scene/chat_factory.py
@@ -18,6 +18,7 @@ def get_implementation(chat_mode, **kwargs):
from pilot.scene.chat_knowledge.extract_entity.chat import ExtractEntity
from pilot.scene.chat_knowledge.summary.chat import ExtractSummary
from pilot.scene.chat_knowledge.refine_summary.chat import ExtractRefineSummary
+ from pilot.scene.chat_knowledge.rewrite.chat import QueryRewrite
from pilot.scene.chat_data.chat_excel.excel_analyze.chat import ChatExcel
from pilot.scene.chat_agent.chat import ChatAgent
diff --git a/pilot/scene/chat_knowledge/v1/chat.py b/pilot/scene/chat_knowledge/v1/chat.py
index a0c15e658..e28a3803c 100644
--- a/pilot/scene/chat_knowledge/v1/chat.py
+++ b/pilot/scene/chat_knowledge/v1/chat.py
@@ -98,21 +98,27 @@ async def generate_input_values(self) -> Dict:
if self.space_context and self.space_context.get("prompt"):
self.prompt_template.template_define = self.space_context["prompt"]["scene"]
self.prompt_template.template = self.space_context["prompt"]["template"]
+ from pilot.rag.retriever.reinforce import QueryReinforce
+
+ # query_reinforce = QueryReinforce(query=self.current_user_input, model_name=self.llm_model)
+ # queries = await query_reinforce.rewrite()
+ # print(queries)
+
docs = await blocking_func_to_async(
self._executor,
- self.knowledge_embedding_client.similar_search,
+ self.knowledge_embedding_client.similar_search_with_scores,
self.current_user_input,
self.top_k,
)
- self.sources = _merge_by_key(
- list(map(lambda doc: doc.metadata, docs)), "source"
- )
-
if not docs or len(docs) == 0:
print("no relevant docs to retrieve")
context = "no relevant docs to retrieve"
else:
context = [d.page_content for d in docs]
+
+ self.sources = _merge_by_key(
+ list(map(lambda doc: doc.metadata, docs)), "source"
+ )
context = context[: self.max_token]
relations = list(
set([os.path.basename(str(d.metadata.get("source", ""))) for d in docs])
diff --git a/pilot/vector_store/base.py b/pilot/vector_store/base.py
index eb746c7a8..799296cbd 100644
--- a/pilot/vector_store/base.py
+++ b/pilot/vector_store/base.py
@@ -1,4 +1,5 @@
from abc import ABC, abstractmethod
+import math
class VectorStoreBase(ABC):
@@ -28,3 +29,14 @@ def delete_by_ids(self, ids):
def delete_vector_name(self, vector_name):
"""delete vector name."""
pass
+
+ def _normalization_vectors(self, vectors):
+ """normalization vectors to scale[0,1]"""
+ import numpy as np
+
+ norm = np.linalg.norm(vectors)
+ return vectors / norm
+
+ def _default_relevance_score_fn(self, distance: float) -> float:
+ """Return a similarity score on a scale [0, 1]."""
+ return 1.0 - distance / math.sqrt(2)
diff --git a/pilot/vector_store/chroma_store.py b/pilot/vector_store/chroma_store.py
index 884b29b05..6dc7c35c4 100644
--- a/pilot/vector_store/chroma_store.py
+++ b/pilot/vector_store/chroma_store.py
@@ -42,7 +42,25 @@ def __init__(self, ctx: {}) -> None:
def similar_search(self, text, topk, **kwargs: Any) -> None:
logger.info("ChromaStore similar search")
- return self.vector_store_client.similarity_search(text, topk)
+ return self.vector_store_client.similarity_search(text, topk, **kwargs)
+
+ def similar_search_with_scores(self, text, topk, score_threshold) -> None:
+ """
+ Chroma similar_search_with_score.
+ Return docs and relevance scores in the range [0, 1].
+ Args:
+ text(str): query text
+ topk(int): return docs nums. Defaults to 4.
+ score_threshold(float): score_threshold: Optional, a floating point value between 0 to 1 to
+ filter the resulting set of retrieved docs,0 is dissimilar, 1 is most similar.
+ """
+ logger.info("ChromaStore similar search")
+ docs_and_scores = (
+ self.vector_store_client.similarity_search_with_relevance_scores(
+ query=text, k=topk, score_threshold=score_threshold
+ )
+ )
+ return [doc for doc, score in docs_and_scores]
def vector_name_exists(self):
logger.info(f"Check persist_dir: {self.persist_dir}")
@@ -58,7 +76,6 @@ def load_document(self, documents):
texts = [doc.page_content for doc in documents]
metadatas = [doc.metadata for doc in documents]
ids = self.vector_store_client.add_texts(texts=texts, metadatas=metadatas)
- self.vector_store_client.persist()
return ids
def delete_vector_name(self, vector_name):
diff --git a/pilot/vector_store/connector.py b/pilot/vector_store/connector.py
index 1bf86082f..ad12b2900 100644
--- a/pilot/vector_store/connector.py
+++ b/pilot/vector_store/connector.py
@@ -42,6 +42,18 @@ def similar_search(self, doc: str, topk: int):
"""
return self.client.similar_search(doc, topk)
+ def similar_search_with_scores(self, doc: str, topk: int, score_threshold: float):
+ """
+ similar_search_with_score in vector database..
+ Return docs and relevance scores in the range [0, 1].
+ Args:
+ doc(str): query text
+ topk(int): return docs nums. Defaults to 4.
+ score_threshold(float): score_threshold: Optional, a floating point value between 0 to 1 to
+ filter the resulting set of retrieved docs,0 is dissimilar, 1 is most similar.
+ """
+ return self.client.similar_search_with_scores(doc, topk, score_threshold)
+
def vector_name_exists(self):
"""is vector store name exist."""
return self.client.vector_name_exists()
diff --git a/pilot/vector_store/extract_tovec.py b/pilot/vector_store/extract_tovec.py
deleted file mode 100644
index b37a48ddd..000000000
--- a/pilot/vector_store/extract_tovec.py
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding:utf-8 -*-
-
-import os
-
-from langchain.embeddings import HuggingFaceEmbeddings
-from langchain.text_splitter import CharacterTextSplitter
-from langchain.vectorstores import Chroma
-
-from pilot.configs.model_config import DATASETS_DIR, VECTORE_PATH
-from pilot.model.llm_out.vicuna_llm import VicunaEmbeddingLLM
-
-embeddings = VicunaEmbeddingLLM()
-
-
-def knownledge_tovec(filename):
- with open(filename, "r") as f:
- knownledge = f.read()
-
- text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
- texts = text_splitter.split_text(knownledge)
- docsearch = Chroma.from_texts(
- texts, embeddings, metadatas=[{"source": str(i)} for i in range(len(texts))]
- )
- return docsearch
-
-
-def knownledge_tovec_st(filename):
- """Use sentence transformers to embedding the document.
- https://github.com/UKPLab/sentence-transformers
- """
- from pilot.configs.model_config import EMBEDDING_MODEL_CONFIG
- from pilot.embedding_engine.embedding_factory import DefaultEmbeddingFactory
-
- embeddings = DefaultEmbeddingFactory().create(
- model_name=EMBEDDING_MODEL_CONFIG["sentence-transforms"]
- )
-
- with open(filename, "r") as f:
- knownledge = f.read()
-
- text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
-
- texts = text_splitter.split_text(knownledge)
- docsearch = Chroma.from_texts(
- texts, embeddings, metadatas=[{"source": str(i)} for i in range(len(texts))]
- )
- return docsearch
-
-
-def load_knownledge_from_doc():
- """Loader Knownledge from current datasets
- # TODO if the vector store is exists, just use it.
- """
-
- if not os.path.exists(DATASETS_DIR):
- print(
- "Not Exists Local DataSets, We will answers the Question use model default."
- )
-
- from pilot.configs.model_config import EMBEDDING_MODEL_CONFIG
- from pilot.embedding_engine.embedding_factory import DefaultEmbeddingFactory
-
- embeddings = DefaultEmbeddingFactory().create(
- model_name=EMBEDDING_MODEL_CONFIG["sentence-transforms"]
- )
-
- files = os.listdir(DATASETS_DIR)
- for file in files:
- if not os.path.isdir(file):
- filename = os.path.join(DATASETS_DIR, file)
- with open(filename, "r") as f:
- knownledge = f.read()
-
- text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_owerlap=0)
- texts = text_splitter.split_text(knownledge)
- docsearch = Chroma.from_texts(
- texts,
- embeddings,
- metadatas=[{"source": str(i)} for i in range(len(texts))],
- persist_directory=os.path.join(VECTORE_PATH, ".vectore"),
- )
- return docsearch
-
-
-def get_vector_storelist():
- if not os.path.exists(VECTORE_PATH):
- return []
- return os.listdir(VECTORE_PATH)
diff --git a/pilot/vector_store/file_loader.py b/pilot/vector_store/file_loader.py
deleted file mode 100644
index f01f96867..000000000
--- a/pilot/vector_store/file_loader.py
+++ /dev/null
@@ -1,113 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-import os
-
-from langchain.chains import VectorDBQA
-from langchain.document_loaders import (
- TextLoader,
- UnstructuredFileLoader,
- UnstructuredPDFLoader,
-)
-from langchain.embeddings import HuggingFaceEmbeddings
-from langchain.prompts import PromptTemplate
-from langchain.text_splitter import CharacterTextSplitter
-from langchain.vectorstores import Chroma
-
-from pilot.configs.model_config import (
- DATASETS_DIR,
- EMBEDDING_MODEL_CONFIG,
- VECTORE_PATH,
-)
-
-
-class KnownLedge2Vector:
-
- """KnownLedge2Vector class is order to load document to vector
- and persist to vector store.
-
- Args:
- - model_name
-
- Usage:
- k2v = KnownLedge2Vector()
- persist_dir = os.path.join(VECTORE_PATH, ".vectordb")
- print(persist_dir)
- for s, dc in k2v.query("what is oceanbase?"):
- print(s, dc.page_content, dc.metadata)
-
- """
-
- embeddings: object = None
- model_name = EMBEDDING_MODEL_CONFIG["sentence-transforms"]
-
- def __init__(self, model_name=None) -> None:
- if not model_name:
- # use default embedding model
- from pilot.embedding_engine.embedding_factory import DefaultEmbeddingFactory
-
- self.embeddings = DefaultEmbeddingFactory().create(
- model_name=self.model_name
- )
-
- def init_vector_store(self):
- persist_dir = os.path.join(VECTORE_PATH, ".vectordb")
- print("Vector store Persist address is: ", persist_dir)
- if os.path.exists(persist_dir):
- # Loader from local file.
- print("Loader data from local persist vector file...")
- vector_store = Chroma(
- persist_directory=persist_dir, embedding_function=self.embeddings
- )
- # vector_store.add_documents(documents=documents)
- else:
- documents = self.load_knownlege()
- # reinit
- vector_store = Chroma.from_documents(
- documents=documents,
- embedding=self.embeddings,
- persist_directory=persist_dir,
- )
- vector_store.persist()
- return vector_store
-
- def load_knownlege(self):
- docments = []
- for root, _, files in os.walk(DATASETS_DIR, topdown=False):
- for file in files:
- filename = os.path.join(root, file)
- docs = self._load_file(filename)
- # update metadata.
- new_docs = []
- for doc in docs:
- doc.metadata = {
- "source": doc.metadata["source"].replace(DATASETS_DIR, "")
- }
- print("Documents to vector running, please wait...", doc.metadata)
- new_docs.append(doc)
- docments += new_docs
- return docments
-
- def _load_file(self, filename):
- # Loader file
- if filename.lower().endswith(".pdf"):
- loader = UnstructuredFileLoader(filename)
- text_splitor = CharacterTextSplitter()
- docs = loader.load_and_split(text_splitor)
- else:
- loader = UnstructuredFileLoader(filename, mode="elements")
- text_splitor = CharacterTextSplitter()
- docs = loader.load_and_split(text_splitor)
- return docs
-
- def _load_from_url(self, url):
- """Load data from url address"""
- pass
-
- def query(self, q):
- """Query similar doc from Vector"""
- vector_store = self.init_vector_store()
- docs = vector_store.similarity_search_with_score(q, k=self.top_k)
- for doc in docs:
- dc, s = doc
- yield s, dc
diff --git a/pilot/vector_store/milvus_store.py b/pilot/vector_store/milvus_store.py
index 1a51f88c0..ce91c12b9 100644
--- a/pilot/vector_store/milvus_store.py
+++ b/pilot/vector_store/milvus_store.py
@@ -15,6 +15,7 @@ class MilvusStore(VectorStoreBase):
"""Milvus database"""
def __init__(self, ctx: {}) -> None:
+ """MilvusStore init."""
from pymilvus import Collection, DataType, connections, utility
"""init a milvus storage connection.
@@ -178,7 +179,10 @@ def _add_documents(
"""add text data into Milvus."""
insert_dict: Any = {self.text_field: list(texts)}
try:
- insert_dict[self.vector_field] = self.embedding.embed_documents(list(texts))
+ import numpy as np
+
+ text_vector = self.embedding.embed_documents(list(texts))
+ insert_dict[self.vector_field] = self._normalization_vectors(text_vector)
except NotImplementedError:
insert_dict[self.vector_field] = [
self.embedding.embed_query(x) for x in texts
@@ -236,7 +240,61 @@ def similar_search(self, text, topk):
)
for doc, _, _ in docs_and_scores
]
- # return [doc for doc, _, _ in docs_and_scores]
+
+ def similar_search_with_scores(self, text, topk, score_threshold):
+ """Perform a search on a query string and return results with score.
+
+ For more information about the search parameters, take a look at the pymilvus
+ documentation found here:
+ https://milvus.io/api-reference/pymilvus/v2.2.6/Collection/search().md
+
+ Args:
+ embedding (List[float]): The embedding vector being searched.
+ k (int, optional): The amount of results to return. Defaults to 4.
+ param (dict): The search params for the specified index.
+ Defaults to None.
+ expr (str, optional): Filtering expression. Defaults to None.
+ timeout (int, optional): How long to wait before timeout error.
+ Defaults to None.
+ kwargs: Collection.search() keyword arguments.
+
+ Returns:
+ List[Tuple[Document, float]]: Result doc and score.
+ """
+ from pymilvus import Collection
+
+ self.col = Collection(self.collection_name)
+ schema = self.col.schema
+ for x in schema.fields:
+ self.fields.append(x.name)
+ if x.auto_id:
+ self.fields.remove(x.name)
+ if x.is_primary:
+ self.primary_field = x.name
+ from pymilvus import DataType
+
+ if x.dtype == DataType.FLOAT_VECTOR or x.dtype == DataType.BINARY_VECTOR:
+ self.vector_field = x.name
+ _, docs_and_scores = self._search(text, topk)
+ if any(score < 0.0 or score > 1.0 for _, score, id in docs_and_scores):
+ import warnings
+
+ warnings.warn(
+ "similarity score need between" f" 0 and 1, got {docs_and_scores}"
+ )
+
+ if score_threshold is not None:
+ docs_and_scores = [
+ (doc, score)
+ for doc, score, id in docs_and_scores
+ if score >= score_threshold
+ ]
+ if len(docs_and_scores) == 0:
+ warnings.warn(
+ "No relevant docs were retrieved using the relevance score"
+ f" threshold {score_threshold}"
+ )
+ return [doc for doc, score in docs_and_scores]
def _search(
self,
@@ -257,7 +315,8 @@ def _search(
index_type = self.col.indexes[0].params["index_type"]
param = self.index_params_map[index_type]
# query text embedding.
- data = [self.embedding.embed_query(query)]
+ query_vector = self.embedding.embed_query(query)
+ data = [self._normalization_vectors(query_vector)]
# Determine result metadata fields.
output_fields = self.fields[:]
output_fields.remove(self.vector_field)
@@ -271,7 +330,7 @@ def _search(
output_fields=output_fields,
partition_names=partition_names,
round_decimal=round_decimal,
- timeout=timeout,
+ timeout=60,
**kwargs,
)
ret = []
@@ -280,7 +339,7 @@ def _search(
ret.append(
(
Document(page_content=meta.pop(self.text_field), metadata=meta),
- result.distance,
+ self._default_relevance_score_fn(result.distance),
result.id,
)
)
From 52f57868c42b7cae6e6c6b8e9bb24e6f6b6364e9 Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Wed, 29 Nov 2023 17:16:46 +0800
Subject: [PATCH 03/26] feat:rag add document rerank
---
pilot/configs/config.py | 4 +
pilot/embedding_engine/embedding_engine.py | 26 +++-
pilot/{graph_engine => rag}/__init__.py | 0
pilot/rag/extracter/SummaryExtractor.py | 128 ++++++++++++++++
pilot/rag/extracter/__init__.py | 0
pilot/rag/extracter/base.py | 19 +++
pilot/rag/graph_engine/__init__.py | 0
pilot/{ => rag}/graph_engine/graph_engine.py | 6 +-
pilot/{ => rag}/graph_engine/graph_factory.py | 2 +-
pilot/{ => rag}/graph_engine/graph_search.py | 6 +-
pilot/{ => rag}/graph_engine/index_struct.py | 4 +-
pilot/{ => rag}/graph_engine/index_type.py | 0
pilot/{ => rag}/graph_engine/kv_index.py | 0
pilot/{ => rag}/graph_engine/node.py | 0
pilot/{ => rag}/graph_engine/search.py | 0
pilot/rag/retriever/__init__.py | 0
pilot/rag/retriever/reinforce.py | 53 +++++++
pilot/rag/retriever/rerank.py | 84 +++++++++++
pilot/scene/chat_knowledge/v1/chat.py | 141 ++++++++++--------
pilot/server/knowledge/chunk_db.py | 18 ++-
pilot/server/knowledge/service.py | 15 +-
pilot/vector_store/chroma_store.py | 2 +-
pilot/vector_store/milvus_store.py | 3 +-
23 files changed, 426 insertions(+), 85 deletions(-)
rename pilot/{graph_engine => rag}/__init__.py (100%)
create mode 100644 pilot/rag/extracter/SummaryExtractor.py
create mode 100644 pilot/rag/extracter/__init__.py
create mode 100644 pilot/rag/extracter/base.py
create mode 100644 pilot/rag/graph_engine/__init__.py
rename pilot/{ => rag}/graph_engine/graph_engine.py (97%)
rename pilot/{ => rag}/graph_engine/graph_factory.py (93%)
rename pilot/{ => rag}/graph_engine/graph_search.py (97%)
rename pilot/{ => rag}/graph_engine/index_struct.py (98%)
rename pilot/{ => rag}/graph_engine/index_type.py (100%)
rename pilot/{ => rag}/graph_engine/kv_index.py (100%)
rename pilot/{ => rag}/graph_engine/node.py (100%)
rename pilot/{ => rag}/graph_engine/search.py (100%)
create mode 100644 pilot/rag/retriever/__init__.py
create mode 100644 pilot/rag/retriever/reinforce.py
create mode 100644 pilot/rag/retriever/rerank.py
diff --git a/pilot/configs/config.py b/pilot/configs/config.py
index c5e612709..7c4c590d9 100644
--- a/pilot/configs/config.py
+++ b/pilot/configs/config.py
@@ -225,6 +225,10 @@ def __init__(self) -> None:
self.KNOWLEDGE_CHUNK_SIZE = int(os.getenv("KNOWLEDGE_CHUNK_SIZE", 100))
self.KNOWLEDGE_CHUNK_OVERLAP = int(os.getenv("KNOWLEDGE_CHUNK_OVERLAP", 50))
self.KNOWLEDGE_SEARCH_TOP_SIZE = int(os.getenv("KNOWLEDGE_SEARCH_TOP_SIZE", 5))
+ # default recall similarity score, between 0 and 1
+ self.KNOWLEDGE_SEARCH_RECALL_SCORE = float(
+ os.getenv("KNOWLEDGE_SEARCH_RECALL_SCORE", 0.3)
+ )
self.KNOWLEDGE_SEARCH_MAX_TOKEN = int(
os.getenv("KNOWLEDGE_SEARCH_MAX_TOKEN", 2000)
)
diff --git a/pilot/embedding_engine/embedding_engine.py b/pilot/embedding_engine/embedding_engine.py
index ec50afe6b..687137f9d 100644
--- a/pilot/embedding_engine/embedding_engine.py
+++ b/pilot/embedding_engine/embedding_engine.py
@@ -16,6 +16,27 @@ class EmbeddingEngine:
2.similar_search: similarity search from vector_store
how to use reference:https://db-gpt.readthedocs.io/en/latest/modules/knowledge.html
how to integrate:https://db-gpt.readthedocs.io/en/latest/modules/knowledge/pdf/pdf_embedding.html
+ Example:
+ .. code-block:: python
+ embedding_model = "your_embedding_model"
+ vector_store_type = "Chroma"
+ chroma_persist_path = "your_persist_path"
+ vector_store_config = {
+ "vector_store_name": "document_test",
+ "vector_store_type": vector_store_type,
+ "chroma_persist_path": chroma_persist_path,
+ }
+
+ # it can be .md,.pdf,.docx, .csv, .html
+ document_path = "your_path/test.md"
+ embedding_engine = EmbeddingEngine(
+ knowledge_source=document_path,
+ knowledge_type=KnowledgeType.DOCUMENT.value,
+ model_name=embedding_model,
+ vector_store_config=vector_store_config,
+ )
+ # embedding document content to vector store
+ embedding_engine.knowledge_embedding()
"""
def __init__(
@@ -74,7 +95,8 @@ def init_knowledge_embedding(self):
)
def similar_search(self, text, topk):
- """vector db similar search
+ """vector db similar search in vector database.
+ Return topk docs.
Args:
- text: query text
- topk: top k
@@ -88,7 +110,7 @@ def similar_search(self, text, topk):
def similar_search_with_scores(self, text, topk, score_threshold: float = 0.3):
"""
- similar_search_with_score in vector database..
+ similar_search_with_score in vector database.
Return docs and relevance scores in the range [0, 1].
Args:
doc(str): query text
diff --git a/pilot/graph_engine/__init__.py b/pilot/rag/__init__.py
similarity index 100%
rename from pilot/graph_engine/__init__.py
rename to pilot/rag/__init__.py
diff --git a/pilot/rag/extracter/SummaryExtractor.py b/pilot/rag/extracter/SummaryExtractor.py
new file mode 100644
index 000000000..ccc385851
--- /dev/null
+++ b/pilot/rag/extracter/SummaryExtractor.py
@@ -0,0 +1,128 @@
+from typing import List, Dict
+
+from langchain.schema import Document
+
+from pilot.common.llm_metadata import LLMMetadata
+from pilot.rag.extracter.base import Extractor
+
+
+class SummaryExtractor(Extractor):
+ """Summary Extractor, it can extract document summary."""
+
+ def __init__(self, model_name: str = None, llm_metadata: LLMMetadata = None):
+ self.model_name = (model_name,)
+ self.llm_metadata = (llm_metadata or LLMMetadata,)
+
+ async def extract(self, chunks: List[Document]) -> str:
+ """async document extract summary
+ Args:
+ - model_name: str
+ - chunk_docs: List[Document]
+ """
+ texts = [doc.page_content for doc in chunks]
+ from pilot.common.prompt_util import PromptHelper
+
+ prompt_helper = PromptHelper()
+ from pilot.scene.chat_knowledge.summary.prompt import prompt
+
+ texts = prompt_helper.repack(prompt_template=prompt.template, text_chunks=texts)
+ return await self._mapreduce_extract_summary(
+ docs=texts, model_name=self.model_name, llm_metadata=self.llm_metadata
+ )
+
+ async def _mapreduce_extract_summary(
+ self,
+ docs,
+ model_name,
+ llm_metadata: LLMMetadata,
+ ):
+ """Extract summary by mapreduce mode
+ map -> multi async call llm to generate summary
+ reduce -> merge the summaries by map process
+ Args:
+ docs:List[str]
+ model_name:model name str
+ llm_metadata:LLMMetadata
+ Returns:
+ Document: refine summary context document.
+ """
+ from pilot.scene.base import ChatScene
+ from pilot.common.chat_util import llm_chat_response_nostream
+ import uuid
+
+ tasks = []
+ if len(docs) == 1:
+ return docs[0]
+ else:
+ max_iteration = (
+ llm_metadata.max_chat_iteration
+ if len(docs) > llm_metadata.max_chat_iteration
+ else len(docs)
+ )
+ for doc in docs[0:max_iteration]:
+ chat_param = {
+ "chat_session_id": uuid.uuid1(),
+ "current_user_input": "",
+ "select_param": doc,
+ "model_name": model_name,
+ "model_cache_enable": True,
+ }
+ tasks.append(
+ llm_chat_response_nostream(
+ ChatScene.ExtractSummary.value(), **{"chat_param": chat_param}
+ )
+ )
+ from pilot.common.chat_util import run_async_tasks
+
+ summary_iters = await run_async_tasks(
+ tasks=tasks, concurrency_limit=llm_metadata.concurrency_limit
+ )
+ summary_iters = list(
+ filter(
+ lambda content: "LLMServer Generate Error" not in content,
+ summary_iters,
+ )
+ )
+ from pilot.common.prompt_util import PromptHelper
+ from pilot.scene.chat_knowledge.summary.prompt import prompt
+
+ prompt_helper = PromptHelper()
+ summary_iters = prompt_helper.repack(
+ prompt_template=prompt.template, text_chunks=summary_iters
+ )
+ return await self._mapreduce_extract_summary(
+ summary_iters, model_name, max_iteration, llm_metadata.concurrency_limit
+ )
+
+ # async def _refine_extract_summary(
+ # self, doc: str, conn_uid: str, model_name: str = None
+ # ):
+ # """Extract triplets from text by llm
+ # Args:
+ # doc: Document
+ # conn_uid: str,chat conversation id
+ # model_name: str, model name
+ # Returns:
+ # chat: BaseChat, refine summary chat.
+ # """
+ # from pilot.scene.base import ChatScene
+ #
+ # chat_param = {
+ # "chat_session_id": conn_uid,
+ # "current_user_input": "",
+ # "select_param": doc,
+ # "model_name": model_name,
+ # "model_cache_enable": False,
+ # }
+ # executor = CFG.SYSTEM_APP.get_component(
+ # ComponentType.EXECUTOR_DEFAULT, ExecutorFactory
+ # ).create()
+ # from pilot.openapi.api_v1.api_v1 import CHAT_FACTORY
+ #
+ # chat = await blocking_func_to_async(
+ # executor,
+ # CHAT_FACTORY.get_implementation,
+ # ChatScene.ExtractRefineSummary.value(),
+ # **{"chat_param": chat_param},
+ # )
+ # return chat
diff --git a/pilot/rag/extracter/__init__.py b/pilot/rag/extracter/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/pilot/rag/extracter/base.py b/pilot/rag/extracter/base.py
new file mode 100644
index 000000000..6ace7872a
--- /dev/null
+++ b/pilot/rag/extracter/base.py
@@ -0,0 +1,19 @@
+from abc import abstractmethod, ABC
+from typing import List, Dict
+
+from langchain.schema import Document
+
+
+class Extractor(ABC):
+ """Extractor Base class, it's apply for Summary Extractor, Keyword Extractor, Triplets Extractor, Question Extractor, etc."""
+
+ def __init__(self):
+ pass
+
+ @abstractmethod
+ def extract(self, chunks: List[Document]) -> List[Dict]:
+ """Extracts chunks.
+
+ Args:
+ nodes (Sequence[Document]): nodes to extract metadata from
+ """
diff --git a/pilot/rag/graph_engine/__init__.py b/pilot/rag/graph_engine/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/pilot/graph_engine/graph_engine.py b/pilot/rag/graph_engine/graph_engine.py
similarity index 97%
rename from pilot/graph_engine/graph_engine.py
rename to pilot/rag/graph_engine/graph_engine.py
index bea5f3123..35d0857ad 100644
--- a/pilot/graph_engine/graph_engine.py
+++ b/pilot/rag/graph_engine/graph_engine.py
@@ -6,8 +6,8 @@
from pilot.embedding_engine import KnowledgeType
from pilot.embedding_engine.knowledge_type import get_knowledge_embedding
-from pilot.graph_engine.index_struct import KG
-from pilot.graph_engine.node import TextNode
+from pilot.rag.graph_engine.index_struct import KG
+from pilot.rag.graph_engine.node import TextNode
from pilot.utils import utils
logger = logging.getLogger(__name__)
@@ -178,7 +178,7 @@ def _build_index_from_docs(self, documents: List[Document]) -> KG:
# return index_struct
def search(self, query):
- from pilot.graph_engine.graph_search import RAGGraphSearch
+ from pilot.rag.graph_engine.graph_search import RAGGraphSearch
graph_search = RAGGraphSearch(graph_engine=self)
return graph_search.search(query)
diff --git a/pilot/graph_engine/graph_factory.py b/pilot/rag/graph_engine/graph_factory.py
similarity index 93%
rename from pilot/graph_engine/graph_factory.py
rename to pilot/rag/graph_engine/graph_factory.py
index 3a8b99c17..e0897e387 100644
--- a/pilot/graph_engine/graph_factory.py
+++ b/pilot/rag/graph_engine/graph_factory.py
@@ -20,7 +20,7 @@ def __init__(
super().__init__(system_app=system_app)
self._default_model_name = default_model_name
self.kwargs = kwargs
- from pilot.graph_engine.graph_engine import RAGGraphEngine
+ from pilot.rag.graph_engine.graph_engine import RAGGraphEngine
self.rag_engine = RAGGraphEngine(model_name="proxyllm")
diff --git a/pilot/graph_engine/graph_search.py b/pilot/rag/graph_engine/graph_search.py
similarity index 97%
rename from pilot/graph_engine/graph_search.py
rename to pilot/rag/graph_engine/graph_search.py
index 9419a4979..4a3f44f68 100644
--- a/pilot/graph_engine/graph_search.py
+++ b/pilot/rag/graph_engine/graph_search.py
@@ -6,8 +6,8 @@
from langchain.schema import Document
-from pilot.graph_engine.node import BaseNode, TextNode, NodeWithScore
-from pilot.graph_engine.search import BaseSearch, SearchMode
+from pilot.rag.graph_engine.node import BaseNode, TextNode, NodeWithScore
+from pilot.rag.graph_engine.search import BaseSearch, SearchMode
logger = logging.getLogger(__name__)
DEFAULT_NODE_SCORE = 1000.0
@@ -45,7 +45,7 @@ def __init__(
**kwargs: Any,
) -> None:
"""Initialize params."""
- from pilot.graph_engine.graph_engine import RAGGraphEngine
+ from pilot.rag.graph_engine.graph_engine import RAGGraphEngine
self.graph_engine: RAGGraphEngine = graph_engine
self.model_name = model_name or self.graph_engine.model_name
diff --git a/pilot/graph_engine/index_struct.py b/pilot/rag/graph_engine/index_struct.py
similarity index 98%
rename from pilot/graph_engine/index_struct.py
rename to pilot/rag/graph_engine/index_struct.py
index edc47a7ac..0bd8d8667 100644
--- a/pilot/graph_engine/index_struct.py
+++ b/pilot/rag/graph_engine/index_struct.py
@@ -12,8 +12,8 @@
from dataclasses_json import DataClassJsonMixin
-from pilot.graph_engine.index_type import IndexStructType
-from pilot.graph_engine.node import TextNode, BaseNode
+from pilot.rag.graph_engine.index_type import IndexStructType
+from pilot.rag.graph_engine.node import TextNode, BaseNode
# TODO: legacy backport of old Node class
Node = TextNode
diff --git a/pilot/graph_engine/index_type.py b/pilot/rag/graph_engine/index_type.py
similarity index 100%
rename from pilot/graph_engine/index_type.py
rename to pilot/rag/graph_engine/index_type.py
diff --git a/pilot/graph_engine/kv_index.py b/pilot/rag/graph_engine/kv_index.py
similarity index 100%
rename from pilot/graph_engine/kv_index.py
rename to pilot/rag/graph_engine/kv_index.py
diff --git a/pilot/graph_engine/node.py b/pilot/rag/graph_engine/node.py
similarity index 100%
rename from pilot/graph_engine/node.py
rename to pilot/rag/graph_engine/node.py
diff --git a/pilot/graph_engine/search.py b/pilot/rag/graph_engine/search.py
similarity index 100%
rename from pilot/graph_engine/search.py
rename to pilot/rag/graph_engine/search.py
diff --git a/pilot/rag/retriever/__init__.py b/pilot/rag/retriever/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/pilot/rag/retriever/reinforce.py b/pilot/rag/retriever/reinforce.py
new file mode 100644
index 000000000..228e40f72
--- /dev/null
+++ b/pilot/rag/retriever/reinforce.py
@@ -0,0 +1,53 @@
+from typing import List
+
+from pilot.scene.base import ChatScene
+from pilot.scene.base_chat import BaseChat
+
+
+class QueryReinforce:
+ """
+ query reinforce, include query rewrite, query correct
+ """
+
+ def __init__(
+ self, query: str = None, model_name: str = None, llm_chat: BaseChat = None
+ ):
+ """query reinforce
+ Args:
+ - query: str, user query
+ - model_name: str, llm model name
+ """
+ self.query = query
+ self.model_name = model_name
+ self.llm_chat = llm_chat
+
+ async def rewrite(self) -> List[str]:
+ """query rewrite"""
+ from pilot.common.chat_util import llm_chat_response_nostream
+ import uuid
+
+ chat_param = {
+ "chat_session_id": uuid.uuid1(),
+ "current_user_input": self.query,
+ "select_param": 3,
+ "model_name": self.model_name,
+ "model_cache_enable": False,
+ }
+ tasks = [
+ llm_chat_response_nostream(
+ ChatScene.QueryRewrite.value(), **{"chat_param": chat_param}
+ )
+ ]
+ from pilot.common.chat_util import run_async_tasks
+
+ queries = await run_async_tasks(tasks=tasks, concurrency_limit=1)
+ queries = list(
+ filter(
+ lambda content: "LLMServer Generate Error" not in content,
+ queries,
+ )
+ )
+ return queries[0]
+
+ def correct(self) -> List[str]:
+ pass
diff --git a/pilot/rag/retriever/rerank.py b/pilot/rag/retriever/rerank.py
new file mode 100644
index 000000000..3526ebe00
--- /dev/null
+++ b/pilot/rag/retriever/rerank.py
@@ -0,0 +1,84 @@
+from abc import abstractmethod, ABC
+from typing import List, Tuple, Optional
+
+
+class Ranker(ABC):
+ """base Ranker"""
+
+ def __init__(self, topk: int, rank_fn: Optional[callable] = None):
+ """
+ abstract base ranker
+ Args:
+ topk: int
+ rank_fn: Optional[callable]
+ """
+ self.topk = topk
+ self.rank_fn = rank_fn
+
+ def rank(self, candidates_with_scores: List, topk: int):
+ """rank algorithm implementation return topk documents by candidates similarity score
+ Args:
+ candidates_with_scores: List[Tuple]
+ topk: int
+ Return:
+ List[Document]
+ """
+
+ pass
+
+ def _filter(self, candidates_with_scores: List):
+ """filter duplicate candidates documents"""
+ visited_docs = set()
+ new_candidates = []
+ for candidate_doc, score in candidates_with_scores:
+ if candidate_doc.page_content not in visited_docs:
+ new_candidates.append((candidate_doc, score))
+ visited_docs.add(candidate_doc.page_content)
+ return new_candidates
+
+
+class DefaultRanker(Ranker):
+ """Default Ranker"""
+
+ def __init__(self, topk: int, rank_fn: Optional[callable] = None):
+ super().__init__(topk, rank_fn)
+
+ def rank(self, candidates_with_scores: List[Tuple]):
+ """Default rank algorithm implementation
+ return topk documents by candidates similarity score
+ Args:
+ candidates_with_scores: List[Tuple]
+ Return:
+ List[Document]
+ """
+ candidates_with_scores = self._filter(candidates_with_scores)
+ if self.rank_fn is not None:
+ candidates_with_scores = self.rank_fn(candidates_with_scores)
+ else:
+ candidates_with_scores = sorted(
+ candidates_with_scores, key=lambda x: x[1], reverse=True
+ )
+ return [candidate_doc for candidate_doc, score in candidates_with_scores][
+ : self.topk
+ ]
+
+
+class RRFRanker(Ranker):
+ """RRF(Reciprocal Rank Fusion) Ranker"""
+
+ def __init__(self, topk: int, rank_fn: Optional[callable] = None):
+ super().__init__(topk, rank_fn)
+
+ def rank(self, candidates_with_scores: List):
+ """RRF rank algorithm implementation
+ This code implements an algorithm called Reciprocal Rank Fusion (RRF), is a method for combining multiple result sets with different relevance indicators into a single result set. RRF requires no tuning, and the different relevance indicators do not have to be related to each other to achieve high-quality results.
+ RRF uses the following formula to determine the score for ranking each document:
+ score = 0.0
+ for q in queries:
+ if d in result(q):
+ score += 1.0 / ( k + rank( result(q), d ) )
+ return score
+ reference:https://www.elastic.co/guide/en/elasticsearch/reference/current/rrf.html
+ """
+ # it will be implemented soon when multi recall is implemented
+ return candidates_with_scores
diff --git a/pilot/scene/chat_knowledge/v1/chat.py b/pilot/scene/chat_knowledge/v1/chat.py
index e28a3803c..2018c1e00 100644
--- a/pilot/scene/chat_knowledge/v1/chat.py
+++ b/pilot/scene/chat_knowledge/v1/chat.py
@@ -1,18 +1,22 @@
import json
import os
+from functools import reduce
from typing import Dict, List
-from pilot.component import ComponentType
from pilot.scene.base_chat import BaseChat
from pilot.scene.base import ChatScene
from pilot.configs.config import Config
from pilot.configs.model_config import (
- KNOWLEDGE_UPLOAD_ROOT_PATH,
EMBEDDING_MODEL_CONFIG,
)
from pilot.scene.chat_knowledge.v1.prompt import prompt
+from pilot.server.knowledge.chunk_db import DocumentChunkDao, DocumentChunkEntity
+from pilot.server.knowledge.document_db import (
+ KnowledgeDocumentDao,
+ KnowledgeDocumentEntity,
+)
from pilot.server.knowledge.service import KnowledgeService
from pilot.utils.executor_utils import blocking_func_to_async
from pilot.utils.tracer import root_tracer, trace
@@ -47,6 +51,11 @@ def __init__(self, chat_param: Dict):
if self.space_context is None
else int(self.space_context["embedding"]["topk"])
)
+ self.recall_score = (
+ CFG.KNOWLEDGE_SEARCH_RECALL_SCORE
+ if self.space_context is None
+ else float(self.space_context["embedding"]["recall_score"])
+ )
self.max_token = (
CFG.KNOWLEDGE_SEARCH_MAX_TOKEN
if self.space_context is None or self.space_context.get("prompt") is None
@@ -65,6 +74,13 @@ def __init__(self, chat_param: Dict):
embedding_factory=embedding_factory,
)
self.prompt_template.template_is_strict = False
+ self.chunk_dao = DocumentChunkDao()
+ document_dao = KnowledgeDocumentDao()
+ documents = document_dao.get_documents(
+ query=KnowledgeDocumentEntity(space=self.knowledge_space)
+ )
+ if len(documents) > 0:
+ self.document_ids = [document.id for document in documents]
async def stream_call(self):
input_values = await self.generate_input_values()
@@ -85,13 +101,13 @@ async def stream_call(self):
last_output.text = (
last_output.text + "\n\nrelations:\n\n" + ",".join(relations)
)
- reference = f"\n\n{self.parse_source_view(self.sources)}"
+ reference = f"\n\n{self.parse_source_view(self.chunks)}"
last_output = last_output + reference
yield last_output
def stream_call_reinforce_fn(self, text):
"""return reference"""
- return text + f"\n\n{self.parse_source_view(self.sources)}"
+ return text + f"\n\n{self.parse_source_view(self.chunks)}"
@trace()
async def generate_input_values(self) -> Dict:
@@ -100,25 +116,37 @@ async def generate_input_values(self) -> Dict:
self.prompt_template.template = self.space_context["prompt"]["template"]
from pilot.rag.retriever.reinforce import QueryReinforce
- # query_reinforce = QueryReinforce(query=self.current_user_input, model_name=self.llm_model)
- # queries = await query_reinforce.rewrite()
- # print(queries)
-
- docs = await blocking_func_to_async(
- self._executor,
- self.knowledge_embedding_client.similar_search_with_scores,
- self.current_user_input,
- self.top_k,
+ # query reinforce, get similar queries
+ query_reinforce = QueryReinforce(
+ query=self.current_user_input, model_name=self.llm_model
)
+ queries = await query_reinforce.rewrite()
+ queries.append(self.current_user_input)
+ from pilot.common.chat_util import run_async_tasks
+
+ # similarity search from vector db
+ tasks = [self.execute_similar_search(query) for query in queries]
+ docs_with_scores = await run_async_tasks(tasks=tasks)
+ candidates_with_scores = reduce(lambda x, y: x + y, docs_with_scores)
+ # candidates document rerank
+ from pilot.rag.retriever.rerank import DefaultRanker
+
+ ranker = DefaultRanker(self.top_k)
+ docs = ranker.rank(candidates_with_scores)
if not docs or len(docs) == 0:
print("no relevant docs to retrieve")
context = "no relevant docs to retrieve"
else:
+ self.chunks = [
+ self.chunk_dao.get_document_chunks(
+ query=DocumentChunkEntity(content=d.page_content),
+ document_ids=self.document_ids,
+ )[0]
+ for d in docs
+ ]
+
context = [d.page_content for d in docs]
- self.sources = _merge_by_key(
- list(map(lambda doc: doc.metadata, docs)), "source"
- )
context = context[: self.max_token]
relations = list(
set([os.path.basename(str(d.metadata.get("source", ""))) for d in docs])
@@ -130,29 +158,36 @@ async def generate_input_values(self) -> Dict:
}
return input_values
- def parse_source_view(self, sources: List):
+ def parse_source_view(self, chunks: List):
"""
- build knowledge reference view message to web
- {
- "title":"References",
- "references":[{
- "name":"aa.pdf",
- "pages":["1","2","3"]
- }]
- }
+ format knowledge reference view message to web
+
"""
- references = {"title": "References", "references": []}
- for item in sources:
- reference = {}
- source = item["source"] if "source" in item else ""
- reference["name"] = source
- pages = item["pages"] if "pages" in item else []
- if len(pages) > 0:
- reference["pages"] = pages
- references["references"].append(reference)
- html = (
- f"""{json.dumps(references, ensure_ascii=False)} """
- )
+ title = "References"
+ references_dict = {}
+ for chunk in chunks:
+ doc_name = chunk.doc_name
+ if doc_name not in references_dict:
+ references_dict[doc_name] = {
+ "name": doc_name,
+ "chunks": [
+ {
+ "id": chunk.id,
+ "content": chunk.content,
+ "metadata": chunk.meta_info,
+ }
+ ],
+ }
+ else:
+ references_dict[doc_name]["chunks"].append(
+ {
+ "id": chunk.id,
+ "content": chunk.content,
+ "metadata": chunk.meta_info,
+ }
+ )
+ references_list = list(references_dict.values())
+ html = f""" """
return html
@property
@@ -163,26 +198,12 @@ def get_space_context(self, space_name):
service = KnowledgeService()
return service.get_space_context(space_name)
-
-def _merge_by_key(data, key):
- result = {}
- for item in data:
- if item.get(key):
- item_key = os.path.basename(item.get(key))
- if item_key in result:
- if "pages" in result[item_key] and "page" in item:
- result[item_key]["pages"].append(str(item["page"]))
- elif "page" in item:
- result[item_key]["pages"] = [
- result[item_key]["pages"],
- str(item["page"]),
- ]
- else:
- if "page" in item:
- result[item_key] = {
- "source": item_key,
- "pages": [str(item["page"])],
- }
- else:
- result[item_key] = {"source": item_key}
- return list(result.values())
+ async def execute_similar_search(self, query):
+ """execute similarity search"""
+ return await blocking_func_to_async(
+ self._executor,
+ self.knowledge_embedding_client.similar_search_with_scores,
+ query,
+ self.top_k,
+ self.recall_score,
+ )
diff --git a/pilot/server/knowledge/chunk_db.py b/pilot/server/knowledge/chunk_db.py
index 1df3cf895..5110f34fc 100644
--- a/pilot/server/knowledge/chunk_db.py
+++ b/pilot/server/knowledge/chunk_db.py
@@ -61,7 +61,9 @@ def create_documents_chunks(self, documents: List):
session.commit()
session.close()
- def get_document_chunks(self, query: DocumentChunkEntity, page=1, page_size=20):
+ def get_document_chunks(
+ self, query: DocumentChunkEntity, page=1, page_size=20, document_ids=None
+ ):
session = self.get_session()
document_chunks = session.query(DocumentChunkEntity)
if query.id is not None:
@@ -74,6 +76,10 @@ def get_document_chunks(self, query: DocumentChunkEntity, page=1, page_size=20):
document_chunks = document_chunks.filter(
DocumentChunkEntity.doc_type == query.doc_type
)
+ if query.content is not None:
+ document_chunks = document_chunks.filter(
+ DocumentChunkEntity.content == query.content
+ )
if query.doc_name is not None:
document_chunks = document_chunks.filter(
DocumentChunkEntity.doc_name == query.doc_name
@@ -82,6 +88,10 @@ def get_document_chunks(self, query: DocumentChunkEntity, page=1, page_size=20):
document_chunks = document_chunks.filter(
DocumentChunkEntity.meta_info == query.meta_info
)
+ if document_ids is not None:
+ document_chunks = document_chunks.filter(
+ DocumentChunkEntity.document_id.in_(document_ids)
+ )
document_chunks = document_chunks.order_by(DocumentChunkEntity.id.asc())
document_chunks = document_chunks.offset((page - 1) * page_size).limit(
@@ -116,12 +126,6 @@ def get_document_chunks_count(self, query: DocumentChunkEntity):
session.close()
return count
- # def update_knowledge_document(self, document:KnowledgeDocumentEntity):
- # session = self.get_session()
- # updated_space = session.merge(document)
- # session.commit()
- # return updated_space.id
-
def delete(self, document_id: int):
session = self.get_session()
if document_id is None:
diff --git a/pilot/server/knowledge/service.py b/pilot/server/knowledge/service.py
index fac027920..a42396582 100644
--- a/pilot/server/knowledge/service.py
+++ b/pilot/server/knowledge/service.py
@@ -56,7 +56,12 @@ class SyncStatus(Enum):
FINISHED = "FINISHED"
-# @singleton
+# default summary max iteration call with llm.
+DEFAULT_SUMMARY_MAX_ITERATION = 5
+# default summary concurrency call with llm.
+DEFAULT_SUMMARY_CONCURRENCY_LIMIT = 3
+
+
class KnowledgeService:
"""KnowledgeService
Knowledge Management Service:
@@ -425,7 +430,7 @@ def async_knowledge_graph(self, chunk_docs, doc):
f"async_knowledge_graph, doc:{doc.doc_name}, chunk_size:{len(chunk_docs)}, begin embedding to graph store"
)
try:
- from pilot.graph_engine.graph_factory import RAGGraphFactory
+ from pilot.rag.graph_engine.graph_factory import RAGGraphFactory
rag_engine = CFG.SYSTEM_APP.get_component(
ComponentType.RAG_GRAPH_DEFAULT.value, RAGGraphFactory
@@ -502,7 +507,7 @@ def _build_default_context(self):
context_template = {
"embedding": {
"topk": CFG.KNOWLEDGE_SEARCH_TOP_SIZE,
- "recall_score": 0.0,
+ "recall_score": CFG.KNOWLEDGE_SEARCH_RECALL_SCORE,
"recall_type": "TopK",
"model": EMBEDDING_MODEL_CONFIG[CFG.EMBEDDING_MODEL].rsplit("/", 1)[-1],
"chunk_size": CFG.KNOWLEDGE_CHUNK_SIZE,
@@ -514,8 +519,8 @@ def _build_default_context(self):
"template": _DEFAULT_TEMPLATE,
},
"summary": {
- "max_iteration": 5,
- "concurrency_limit": 3,
+ "max_iteration": DEFAULT_SUMMARY_MAX_ITERATION,
+ "concurrency_limit": DEFAULT_SUMMARY_CONCURRENCY_LIMIT,
},
}
context_template_string = json.dumps(context_template, indent=4)
diff --git a/pilot/vector_store/chroma_store.py b/pilot/vector_store/chroma_store.py
index 6dc7c35c4..2dee1fc07 100644
--- a/pilot/vector_store/chroma_store.py
+++ b/pilot/vector_store/chroma_store.py
@@ -60,7 +60,7 @@ def similar_search_with_scores(self, text, topk, score_threshold) -> None:
query=text, k=topk, score_threshold=score_threshold
)
)
- return [doc for doc, score in docs_and_scores]
+ return docs_and_scores
def vector_name_exists(self):
logger.info(f"Check persist_dir: {self.persist_dir}")
diff --git a/pilot/vector_store/milvus_store.py b/pilot/vector_store/milvus_store.py
index ce91c12b9..951ff1fba 100644
--- a/pilot/vector_store/milvus_store.py
+++ b/pilot/vector_store/milvus_store.py
@@ -156,6 +156,7 @@ def init_schema_and_load(self, vector_name, documents):
index = self.index_params
# milvus index
collection.create_index(vector_field, index)
+ collection.load()
schema = collection.schema
for x in schema.fields:
self.fields.append(x.name)
@@ -294,7 +295,7 @@ def similar_search_with_scores(self, text, topk, score_threshold):
"No relevant docs were retrieved using the relevance score"
f" threshold {score_threshold}"
)
- return [doc for doc, score in docs_and_scores]
+ return docs_and_scores
def _search(
self,
From 2f70dac429af93077c2a03a5eceb8458ad75d61b Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Thu, 30 Nov 2023 17:11:35 +0800
Subject: [PATCH 04/26] refactor:unified database metadata.
---
.env.template | 3 +-
docker/examples/metadata/duckdb2mysql.py | 55 ++++++
docker/examples/metadata/duckdb2sqlite.py | 48 +++++
pilot/base_modules/meta_data/meta_data.py | 15 +-
.../connections/manages/connect_config_db.py | 182 +++++++++++++++++-
.../connections/manages/connection_manager.py | 152 +++++++--------
pilot/rag/graph_engine/graph_engine.py | 60 ------
pilot/rag/retriever/rerank.py | 4 +-
8 files changed, 359 insertions(+), 160 deletions(-)
create mode 100644 docker/examples/metadata/duckdb2mysql.py
create mode 100644 docker/examples/metadata/duckdb2sqlite.py
diff --git a/.env.template b/.env.template
index ba7f752db..e452f8b53 100644
--- a/.env.template
+++ b/.env.template
@@ -92,10 +92,9 @@ KNOWLEDGE_CHAT_SHOW_RELATIONS=False
#*******************************************************************#
-#** DATABASE SETTINGS **#
+#** DB-GPT METADATA DATABASE SETTINGS **#
#*******************************************************************#
### SQLite database (Current default database)
-LOCAL_DB_PATH=data/default_sqlite.db
LOCAL_DB_TYPE=sqlite
### MYSQL database
diff --git a/docker/examples/metadata/duckdb2mysql.py b/docker/examples/metadata/duckdb2mysql.py
new file mode 100644
index 000000000..fb5cf0ccc
--- /dev/null
+++ b/docker/examples/metadata/duckdb2mysql.py
@@ -0,0 +1,55 @@
+import duckdb
+import pymysql
+
+""" migrate duckdb to mysql"""
+
+mysql_config = {
+ "host": "127.0.0.1",
+ "user": "root",
+ "password": "aa12345678",
+ "db": "dbgpt",
+ "charset": "utf8mb4",
+ "cursorclass": pymysql.cursors.DictCursor,
+}
+
+duckdb_files_to_tables = {
+ "pilot/message/chat_history.db": "chat_history",
+ "pilot/message/connect_config.db": "connect_config",
+}
+
+conn_mysql = pymysql.connect(**mysql_config)
+
+
+def migrate_table(duckdb_file_path, source_table, destination_table, conn_mysql):
+ conn_duckdb = duckdb.connect(duckdb_file_path)
+ try:
+ cursor = conn_duckdb.cursor()
+ cursor.execute(f"SELECT * FROM {source_table}")
+ column_names = [
+ desc[0] for desc in cursor.description if desc[0].lower() != "id"
+ ]
+ select_columns = ", ".join(column_names)
+
+ cursor.execute(f"SELECT {select_columns} FROM {source_table}")
+ results = cursor.fetchall()
+
+ with conn_mysql.cursor() as cursor_mysql:
+ for row in results:
+ placeholders = ", ".join(["%s"] * len(row))
+ insert_query = f"INSERT INTO {destination_table} ({', '.join(column_names)}) VALUES ({placeholders})"
+ cursor_mysql.execute(insert_query, row)
+ conn_mysql.commit()
+ finally:
+ # 关闭 DuckDB 连接
+ conn_duckdb.close()
+
+
+try:
+ for duckdb_file, table in duckdb_files_to_tables.items():
+ print(f"Migrating table {table} from {duckdb_file}...")
+ migrate_table(duckdb_file, table, table, conn_mysql)
+ print(f"Table {table} migrated successfully.")
+finally:
+ conn_mysql.close()
+
+print("Migration completed.")
diff --git a/docker/examples/metadata/duckdb2sqlite.py b/docker/examples/metadata/duckdb2sqlite.py
new file mode 100644
index 000000000..cfc269d28
--- /dev/null
+++ b/docker/examples/metadata/duckdb2sqlite.py
@@ -0,0 +1,48 @@
+import duckdb
+import sqlite3
+
+""" migrate duckdb to sqlite"""
+
+duckdb_files_to_tables = {
+ "pilot/message/chat_history.db": "chat_history",
+ "pilot/message/connect_config.db": "connect_config",
+}
+
+sqlite_db_path = "pilot/meta_data/dbgpt.db"
+
+conn_sqlite = sqlite3.connect(sqlite_db_path)
+
+
+def migrate_table(duckdb_file_path, source_table, destination_table, conn_sqlite):
+ conn_duckdb = duckdb.connect(duckdb_file_path)
+ try:
+ cursor_duckdb = conn_duckdb.cursor()
+ cursor_duckdb.execute(f"SELECT * FROM {source_table}")
+ column_names = [
+ desc[0] for desc in cursor_duckdb.description if desc[0].lower() != "id"
+ ]
+ select_columns = ", ".join(column_names)
+
+ cursor_duckdb.execute(f"SELECT {select_columns} FROM {source_table}")
+ results = cursor_duckdb.fetchall()
+
+ cursor_sqlite = conn_sqlite.cursor()
+ for row in results:
+ placeholders = ", ".join(["?"] * len(row))
+ insert_query = f"INSERT INTO {destination_table} ({', '.join(column_names)}) VALUES ({placeholders})"
+ cursor_sqlite.execute(insert_query, row)
+ conn_sqlite.commit()
+ cursor_sqlite.close()
+ finally:
+ conn_duckdb.close()
+
+
+try:
+ for duckdb_file, table in duckdb_files_to_tables.items():
+ print(f"Migrating table {table} from {duckdb_file} to SQLite...")
+ migrate_table(duckdb_file, table, table, conn_sqlite)
+ print(f"Table {table} migrated to SQLite successfully.")
+finally:
+ conn_sqlite.close()
+
+print("Migration to SQLite completed.")
diff --git a/pilot/base_modules/meta_data/meta_data.py b/pilot/base_modules/meta_data/meta_data.py
index 5b79a38a5..4ec80492a 100644
--- a/pilot/base_modules/meta_data/meta_data.py
+++ b/pilot/base_modules/meta_data/meta_data.py
@@ -14,7 +14,7 @@
logger = logging.getLogger(__name__)
-
+# DB-GPT meta_data database config, now support mysql and sqlite
CFG = Config()
default_db_path = os.path.join(os.getcwd(), "meta_data")
@@ -26,6 +26,7 @@
db_path = default_db_path + f"/{db_name}.db"
connection = sqlite3.connect(db_path)
+
if CFG.LOCAL_DB_TYPE == "mysql":
engine_temp = create_engine(
f"mysql+pymysql://"
@@ -81,18 +82,10 @@
alembic_cfg.set_main_option("script_location", default_db_path + "/alembic")
-# 将模型和会话传递给Alembic配置
alembic_cfg.attributes["target_metadata"] = Base.metadata
alembic_cfg.attributes["session"] = session
-# # 创建表
-# Base.metadata.create_all(engine)
-#
-# # 删除表
-# Base.metadata.drop_all(engine)
-
-
def ddl_init_and_upgrade(disable_alembic_upgrade: bool):
"""Initialize and upgrade database metadata
@@ -105,10 +98,6 @@ def ddl_init_and_upgrade(disable_alembic_upgrade: bool):
)
return
- # Base.metadata.create_all(bind=engine)
- # 生成并应用迁移脚本
- # command.upgrade(alembic_cfg, 'head')
- # subprocess.run(["alembic", "revision", "--autogenerate", "-m", "Added account table"])
with engine.connect() as connection:
alembic_cfg.attributes["connection"] = connection
heads = command.heads(alembic_cfg)
diff --git a/pilot/connections/manages/connect_config_db.py b/pilot/connections/manages/connect_config_db.py
index 602ff719b..b6ab6940e 100644
--- a/pilot/connections/manages/connect_config_db.py
+++ b/pilot/connections/manages/connect_config_db.py
@@ -1,5 +1,4 @@
-from typing import List
-from sqlalchemy import Column, Integer, String, Index, DateTime, func, Boolean, Text
+from sqlalchemy import Column, Integer, String, Index, Text, text
from sqlalchemy import UniqueConstraint
from pilot.base_modules.meta_data.base_dao import BaseDao
@@ -12,15 +11,18 @@
class ConnectConfigEntity(Base):
+ """db connect config entity"""
+
__tablename__ = "connect_config"
id = Column(
Integer, primary_key=True, autoincrement=True, comment="autoincrement id"
)
+
db_type = Column(String(255), nullable=False, comment="db type")
db_name = Column(String(255), nullable=False, comment="db name")
db_path = Column(String(255), nullable=True, comment="file db path")
db_host = Column(String(255), nullable=True, comment="db connect host(not file db)")
- db_port = Column(String(255), nullable=True, comment="db cnnect port(not file db)")
+ db_port = Column(String(255), nullable=True, comment="db connect port(not file db)")
db_user = Column(String(255), nullable=True, comment="db user")
db_pwd = Column(String(255), nullable=True, comment="db password")
comment = Column(Text, nullable=True, comment="db comment")
@@ -29,10 +31,13 @@ class ConnectConfigEntity(Base):
__table_args__ = (
UniqueConstraint("db_name", name="uk_db"),
Index("idx_q_db_type", "db_type"),
+ {"mysql_charset": "utf8mb4", "mysql_collate": "utf8mb4_unicode_ci"},
)
class ConnectConfigDao(BaseDao[ConnectConfigEntity]):
+ """db connect config dao"""
+
def __init__(self):
super().__init__(
database=META_DATA_DATABASE,
@@ -42,6 +47,7 @@ def __init__(self):
)
def update(self, entity: ConnectConfigEntity):
+ """update db connect info"""
session = self.get_session()
try:
updated = session.merge(entity)
@@ -51,6 +57,7 @@ def update(self, entity: ConnectConfigEntity):
session.close()
def delete(self, db_name: int):
+ """ "delete db connect info"""
session = self.get_session()
if db_name is None:
raise Exception("db_name is None")
@@ -61,10 +68,177 @@ def delete(self, db_name: int):
session.commit()
session.close()
- def get_by_name(self, db_name: str) -> ConnectConfigEntity:
+ def get_by_names(self, db_name: str) -> ConnectConfigEntity:
+ """get db connect info by name"""
session = self.get_session()
db_connect = session.query(ConnectConfigEntity)
db_connect = db_connect.filter(ConnectConfigEntity.db_name == db_name)
result = db_connect.first()
session.close()
return result
+
+ def add_url_db(
+ self,
+ db_name,
+ db_type,
+ db_host: str,
+ db_port: int,
+ db_user: str,
+ db_pwd: str,
+ comment: str = "",
+ ):
+ """
+ add db connect info
+ Args:
+ db_name: db name
+ db_type: db type
+ db_host: db host
+ db_port: db port
+ db_user: db user
+ db_pwd: db password
+ comment: comment
+ """
+ try:
+ session = self.get_session()
+
+ from sqlalchemy import text
+
+ insert_statement = text(
+ """
+ INSERT INTO connect_config (
+ db_name, db_type, db_path, db_host, db_port, db_user, db_pwd, comment
+ ) VALUES (
+ :db_name, :db_type, :db_path, :db_host, :db_port, :db_user, :db_pwd, :comment
+ )
+ """
+ )
+
+ params = {
+ "db_name": db_name,
+ "db_type": db_type,
+ "db_path": "",
+ "db_host": db_host,
+ "db_port": db_port,
+ "db_user": db_user,
+ "db_pwd": db_pwd,
+ "comment": comment,
+ }
+ session.execute(insert_statement, params)
+ session.commit()
+ session.close()
+ except Exception as e:
+ print("add db connect info error!" + str(e))
+
+ def update_db_info(
+ self,
+ db_name,
+ db_type,
+ db_path: str = "",
+ db_host: str = "",
+ db_port: int = 0,
+ db_user: str = "",
+ db_pwd: str = "",
+ comment: str = "",
+ ):
+ """update db connect info"""
+ old_db_conf = self.get_db_config(db_name)
+ if old_db_conf:
+ try:
+ session = self.get_session()
+ if not db_path:
+ update_statement = text(
+ f"UPDATE connect_config set db_type='{db_type}', db_host='{db_host}', db_port={db_port}, db_user='{db_user}', db_pwd='{db_pwd}', comment='{comment}' where db_name='{db_name}'"
+ )
+ else:
+ update_statement = text(
+ f"UPDATE connect_config set db_type='{db_type}', db_path='{db_path}', comment='{comment}' where db_name='{db_name}'"
+ )
+ session.execute(update_statement)
+ session.commit()
+ session.close()
+ except Exception as e:
+ print("edit db connect info error!" + str(e))
+ return True
+ raise ValueError(f"{db_name} not have config info!")
+
+ def add_file_db(self, db_name, db_type, db_path: str, comment: str = ""):
+ """add file db connect info"""
+ try:
+ session = self.get_session()
+ insert_statement = text(
+ """
+ INSERT INTO connect_config(
+ db_name, db_type, db_path, db_host, db_port, db_user, db_pwd, comment
+ ) VALUES (
+ :db_name, :db_type, :db_path, :db_host, :db_port, :db_user, :db_pwd, :comment
+ )
+ """
+ )
+ params = {
+ "db_name": db_name,
+ "db_type": db_type,
+ "db_path": db_path,
+ "db_host": "",
+ "db_port": 0,
+ "db_user": "",
+ "db_pwd": "",
+ "comment": comment,
+ }
+
+ session.execute(insert_statement, params)
+
+ session.commit()
+ session.close()
+ except Exception as e:
+ print("add db connect info error!" + str(e))
+
+ def get_db_config(self, db_name):
+ """get db config by name"""
+ session = self.get_session()
+ if db_name:
+ select_statement = text(
+ """
+ SELECT
+ *
+ FROM
+ connect_config
+ WHERE
+ db_name = :db_name
+ """
+ )
+ params = {"db_name": db_name}
+ result = session.execute(select_statement, params)
+
+ else:
+ raise ValueError("Cannot get database by name" + db_name)
+
+ fields = [field[0] for field in result.cursor.description]
+ row_dict = {}
+ row_1 = list(result.cursor.fetchall()[0])
+ for i, field in enumerate(fields):
+ row_dict[field] = row_1[i]
+ return row_dict
+
+ def get_db_list(self):
+ """get db list"""
+ session = self.get_session()
+ result = session.execute(text("SELECT * FROM connect_config"))
+
+ fields = [field[0] for field in result.cursor.description]
+ data = []
+ for row in result.cursor.fetchall():
+ row_dict = {}
+ for i, field in enumerate(fields):
+ row_dict[field] = row[i]
+ data.append(row_dict)
+ return data
+
+ def delete_db(self, db_name):
+ """delete db connect info"""
+ session = self.get_session()
+ delete_statement = text("""DELETE FROM connect_config where db_name=:db_name""")
+ params = {"db_name": db_name}
+ session.execute(delete_statement, params)
+ session.commit()
+ session.close()
+ return True
diff --git a/pilot/connections/manages/connection_manager.py b/pilot/connections/manages/connection_manager.py
index 340c58f0b..343acdc6d 100644
--- a/pilot/connections/manages/connection_manager.py
+++ b/pilot/connections/manages/connection_manager.py
@@ -2,6 +2,7 @@
import asyncio
from pilot.configs.config import Config
+from pilot.connections import ConnectConfigDao
from pilot.connections.manages.connect_storage_duckdb import DuckdbConnectConfig
from pilot.common.schema import DBType
from pilot.component import SystemApp, ComponentType
@@ -27,6 +28,8 @@
class ConnectManager:
+ """db connect manager"""
+
def get_all_subclasses(self, cls):
subclasses = cls.__subclasses__()
for subclass in subclasses:
@@ -48,90 +51,81 @@ def get_cls_by_dbtype(self, db_type):
if cls.db_type == db_type:
result = cls
if not result:
- raise ValueError("Unsupport Db Type!" + db_type)
+ raise ValueError("Unsupported Db Type!" + db_type)
return result
def __init__(self, system_app: SystemApp):
- self.storage = DuckdbConnectConfig()
+ """metadata database management initialization"""
+ # self.storage = DuckdbConnectConfig()
+ self.storage = ConnectConfigDao()
self.db_summary_client = DBSummaryClient(system_app)
# self.__load_config_db()
- def __load_config_db(self):
- if CFG.LOCAL_DB_HOST:
- # default mysql
- if CFG.LOCAL_DB_NAME:
- self.storage.add_url_db(
- CFG.LOCAL_DB_NAME,
- DBType.Mysql.value(),
- CFG.LOCAL_DB_HOST,
- CFG.LOCAL_DB_PORT,
- CFG.LOCAL_DB_USER,
- CFG.LOCAL_DB_PASSWORD,
- "",
- )
- else:
- # get all default mysql database
- default_mysql = Database.from_uri(
- "mysql+pymysql://"
- + CFG.LOCAL_DB_USER
- + ":"
- + CFG.LOCAL_DB_PASSWORD
- + "@"
- + CFG.LOCAL_DB_HOST
- + ":"
- + str(CFG.LOCAL_DB_PORT),
- engine_args={
- "pool_size": CFG.LOCAL_DB_POOL_SIZE,
- "pool_recycle": 3600,
- "echo": True,
- },
- )
- # default_mysql = MySQLConnect.from_uri(
- # "mysql+pymysql://"
- # + CFG.LOCAL_DB_USER
- # + ":"
- # + CFG.LOCAL_DB_PASSWORD
- # + "@"
- # + CFG.LOCAL_DB_HOST
- # + ":"
- # + str(CFG.LOCAL_DB_PORT),
- # engine_args={"pool_size": 10, "pool_recycle": 3600, "echo": True},
- # )
- dbs = default_mysql.get_database_list()
- for name in dbs:
- self.storage.add_url_db(
- name,
- DBType.Mysql.value(),
- CFG.LOCAL_DB_HOST,
- CFG.LOCAL_DB_PORT,
- CFG.LOCAL_DB_USER,
- CFG.LOCAL_DB_PASSWORD,
- "",
- )
- db_type = DBType.of_db_type(CFG.LOCAL_DB_TYPE)
- if db_type.is_file_db():
- db_name = CFG.LOCAL_DB_NAME
- db_type = CFG.LOCAL_DB_TYPE
- db_path = CFG.LOCAL_DB_PATH
- if not db_type:
- # Default file database type
- db_type = DBType.DuckDb.value()
- if not db_name:
- db_type, db_name = self._parse_file_db_info(db_type, db_path)
- if db_name:
- print(
- f"Add file db, db_name: {db_name}, db_type: {db_type}, db_path: {db_path}"
- )
- self.storage.add_file_db(db_name, db_type, db_path)
-
- def _parse_file_db_info(self, db_type: str, db_path: str):
- if db_type is None or db_type == DBType.DuckDb.value():
- # file db is duckdb
- db_name = self.storage.get_file_db_name(db_path)
- db_type = DBType.DuckDb.value()
- else:
- db_name = DBType.parse_file_db_name_from_path(db_type, db_path)
- return db_type, db_name
+ # def __load_config_db(self):
+ # if CFG.LOCAL_DB_HOST:
+ # # default mysql
+ # if CFG.LOCAL_DB_NAME:
+ # self.storage.add_url_db(
+ # CFG.LOCAL_DB_NAME,
+ # DBType.Mysql.value(),
+ # CFG.LOCAL_DB_HOST,
+ # CFG.LOCAL_DB_PORT,
+ # CFG.LOCAL_DB_USER,
+ # CFG.LOCAL_DB_PASSWORD,
+ # "",
+ # )
+ # else:
+ # # get all default mysql database
+ # default_mysql = Database.from_uri(
+ # "mysql+pymysql://"
+ # + CFG.LOCAL_DB_USER
+ # + ":"
+ # + CFG.LOCAL_DB_PASSWORD
+ # + "@"
+ # + CFG.LOCAL_DB_HOST
+ # + ":"
+ # + str(CFG.LOCAL_DB_PORT),
+ # engine_args={
+ # "pool_size": CFG.LOCAL_DB_POOL_SIZE,
+ # "pool_recycle": 3600,
+ # "echo": True,
+ # },
+ # )
+ # dbs = default_mysql.get_database_list()
+ # for name in dbs:
+ # self.storage.add_url_db(
+ # name,
+ # DBType.Mysql.value(),
+ # CFG.LOCAL_DB_HOST,
+ # CFG.LOCAL_DB_PORT,
+ # CFG.LOCAL_DB_USER,
+ # CFG.LOCAL_DB_PASSWORD,
+ # "",
+ # )
+ # db_type = DBType.of_db_type(CFG.LOCAL_DB_TYPE)
+ # if db_type.is_file_db():
+ # db_name = CFG.LOCAL_DB_NAME
+ # db_type = CFG.LOCAL_DB_TYPE
+ # db_path = CFG.LOCAL_DB_PATH
+ # if not db_type:
+ # # Default file database type
+ # db_type = DBType.DuckDb.value()
+ # if not db_name:
+ # db_type, db_name = self._parse_file_db_info(db_type, db_path)
+ # if db_name:
+ # print(
+ # f"Add file db, db_name: {db_name}, db_type: {db_type}, db_path: {db_path}"
+ # )
+ # self.storage.add_file_db(db_name, db_type, db_path)
+
+ # def _parse_file_db_info(self, db_type: str, db_path: str):
+ # if db_type is None or db_type == DBType.DuckDb.value():
+ # # file db is duckdb
+ # db_name = self.storage.get_file_db_name(db_path)
+ # db_type = DBType.DuckDb.value()
+ # else:
+ # db_name = DBType.parse_file_db_name_from_path(db_type, db_path)
+ # return db_type, db_name
def get_connect(self, db_name):
db_config = self.storage.get_db_config(db_name)
@@ -177,7 +171,7 @@ def get_db_list(self):
return self.storage.get_db_list()
def get_db_names(self):
- return self.storage.get_db_names()
+ return self.storage.get_by_name()
def delete_db(self, db_name: str):
return self.storage.delete_db(db_name)
diff --git a/pilot/rag/graph_engine/graph_engine.py b/pilot/rag/graph_engine/graph_engine.py
index 35d0857ad..c7f880da0 100644
--- a/pilot/rag/graph_engine/graph_engine.py
+++ b/pilot/rag/graph_engine/graph_engine.py
@@ -121,61 +121,6 @@ def _build_index_from_docs(self, documents: List[Document]) -> KG:
self.graph_store.upsert_triplet(*triplet)
index_struct.add_node([subj, obj], text_node)
return index_struct
- # num_threads = 5
- # chunk_size = (
- # len(documents)
- # if (len(documents) < num_threads)
- # else len(documents) // num_threads
- # )
- #
- # import concurrent
- # triples = []
- # future_tasks = []
- # with concurrent.futures.ThreadPoolExecutor() as executor:
- # for i in range(num_threads):
- # start = i * chunk_size
- # end = start + chunk_size if i < num_threads - 1 else None
- # # doc = documents[start:end]
- # future_tasks.append(
- # executor.submit(
- # self._extract_triplets_task,
- # documents[start:end],
- # index_struct,
- # )
- # )
- # # for doc in documents[start:end]:
- # # future_tasks.append(
- # # executor.submit(
- # # self._extract_triplets_task,
- # # doc,
- # # index_struct,
- # # )
- # # )
- #
- # # result = [future.result() for future in future_tasks]
- # completed_futures, _ = concurrent.futures.wait(future_tasks, return_when=concurrent.futures.ALL_COMPLETED)
- # for future in completed_futures:
- # # 获取已完成的future的结果并添加到results列表中
- # result = future.result()
- # triplets.extend(result)
- # print(f"total triplets-{triples}")
- # for triplet in triplets:
- # subj, _, obj = triplet
- # self.graph_store.upsert_triplet(*triplet)
- # # index_struct.add_node([subj, obj], text_node)
- # return index_struct
- # for doc in documents:
- # triplets = self._extract_triplets(doc.page_content)
- # if len(triplets) == 0:
- # continue
- # text_node = TextNode(text=doc.page_content, metadata=doc.metadata)
- # logger.info(f"extracted knowledge triplets: {triplets}")
- # for triplet in triplets:
- # subj, _, obj = triplet
- # self.graph_store.upsert_triplet(*triplet)
- # index_struct.add_node([subj, obj], text_node)
- #
- # return index_struct
def search(self, query):
from pilot.rag.graph_engine.graph_search import RAGGraphSearch
@@ -200,8 +145,3 @@ def _extract_triplets_task(self, docs, index_struct):
)
triple_results.extend(triplets)
return triple_results
- # for triplet in triplets:
- # subj, _, obj = triplet
- # self.graph_store.upsert_triplet(*triplet)
- # self.graph_store.upsert_triplet(*triplet)
- # index_struct.add_node([subj, obj], text_node)
diff --git a/pilot/rag/retriever/rerank.py b/pilot/rag/retriever/rerank.py
index 3526ebe00..908d623ca 100644
--- a/pilot/rag/retriever/rerank.py
+++ b/pilot/rag/retriever/rerank.py
@@ -1,9 +1,9 @@
-from abc import abstractmethod, ABC
+from abc import ABC
from typing import List, Tuple, Optional
class Ranker(ABC):
- """base Ranker"""
+ """Base Ranker"""
def __init__(self, topk: int, rank_fn: Optional[callable] = None):
"""
From 27676f25290b22ed34e6f14c43b50c35e63593ef Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Thu, 30 Nov 2023 21:25:33 +0800
Subject: [PATCH 05/26] feat:ChatKnowledge Query Reinforce Close #851
---
pilot/scene/base_chat.py | 6 +--
.../scene/chat_knowledge/rewrite/__init__.py | 0
pilot/scene/chat_knowledge/rewrite/chat.py | 36 ++++++++++++++
.../chat_knowledge/rewrite/out_parser.py | 49 +++++++++++++++++++
pilot/scene/chat_knowledge/rewrite/prompt.py | 44 +++++++++++++++++
pilot/scene/chat_knowledge/v1/chat.py | 38 ++++++++------
6 files changed, 156 insertions(+), 17 deletions(-)
create mode 100644 pilot/scene/chat_knowledge/rewrite/__init__.py
create mode 100644 pilot/scene/chat_knowledge/rewrite/chat.py
create mode 100644 pilot/scene/chat_knowledge/rewrite/out_parser.py
create mode 100644 pilot/scene/chat_knowledge/rewrite/prompt.py
diff --git a/pilot/scene/base_chat.py b/pilot/scene/base_chat.py
index 864eb34b6..070c27b76 100644
--- a/pilot/scene/base_chat.py
+++ b/pilot/scene/base_chat.py
@@ -203,7 +203,7 @@ async def stream_call(self):
payload = await self.__call_base()
self.skip_echo_len = len(payload.get("prompt").replace("", " ")) + 11
- logger.info(f"Requert: \n{payload}")
+ logger.info(f"payload request: \n{payload}")
ai_response_text = ""
span = root_tracer.start_span(
"BaseChat.stream_call", metadata=self._get_span_metadata(payload)
@@ -214,7 +214,7 @@ async def stream_call(self):
async for output in await self._model_stream_operator.call_stream(
call_data={"data": payload}
):
- ### Plug-in research in result generation
+ # Plugin research in result generation
msg = self.prompt_template.output_parser.parse_model_stream_resp_ex(
output, self.skip_echo_len
)
@@ -227,7 +227,7 @@ async def stream_call(self):
span.end()
except Exception as e:
print(traceback.format_exc())
- logger.error("model response parase failed!" + str(e))
+ logger.error("model response parse failed!" + str(e))
self.current_message.add_view_message(
f"""ERROR! {str(e)}\n {ai_response_text} """
)
diff --git a/pilot/scene/chat_knowledge/rewrite/__init__.py b/pilot/scene/chat_knowledge/rewrite/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/pilot/scene/chat_knowledge/rewrite/chat.py b/pilot/scene/chat_knowledge/rewrite/chat.py
new file mode 100644
index 000000000..48d575abc
--- /dev/null
+++ b/pilot/scene/chat_knowledge/rewrite/chat.py
@@ -0,0 +1,36 @@
+from typing import Dict
+
+from pilot.scene.base_chat import BaseChat
+from pilot.scene.base import ChatScene
+from pilot.configs.config import Config
+
+from pilot.scene.chat_knowledge.rewrite.prompt import prompt
+
+CFG = Config()
+
+
+class QueryRewrite(BaseChat):
+ chat_scene: str = ChatScene.QueryRewrite.value()
+
+ """query rewrite by llm"""
+
+ def __init__(self, chat_param: Dict):
+ """ """
+ chat_param["chat_mode"] = ChatScene.QueryRewrite
+ super().__init__(
+ chat_param=chat_param,
+ )
+
+ self.nums = chat_param["select_param"]
+ self.current_user_input = chat_param["current_user_input"]
+
+ async def generate_input_values(self):
+ input_values = {
+ "nums": self.nums,
+ "original_query": self.current_user_input,
+ }
+ return input_values
+
+ @property
+ def chat_type(self) -> str:
+ return ChatScene.QueryRewrite.value
diff --git a/pilot/scene/chat_knowledge/rewrite/out_parser.py b/pilot/scene/chat_knowledge/rewrite/out_parser.py
new file mode 100644
index 000000000..6674adcda
--- /dev/null
+++ b/pilot/scene/chat_knowledge/rewrite/out_parser.py
@@ -0,0 +1,49 @@
+import logging
+from typing import List, Tuple
+
+from pilot.out_parser.base import BaseOutputParser, T
+from pilot.configs.config import Config
+
+CFG = Config()
+
+
+logger = logging.getLogger(__name__)
+
+
+class QueryRewriteParser(BaseOutputParser):
+ def __init__(self, sep: str, is_stream_out: bool):
+ super().__init__(sep=sep, is_stream_out=is_stream_out)
+
+ def parse_prompt_response(
+ self, response, max_length: int = 128
+ ) -> List[Tuple[str, str, str]]:
+ lowercase = True
+ try:
+ results = []
+ response = response.strip() # Strip newlines from responses.
+
+ if response.startswith("queries:"):
+ response = response[len("queries:") :]
+
+ queries = response.split(",")
+ if len(queries) == 1:
+ queries = response.split(",")
+ if len(queries) == 1:
+ queries = response.split("?")
+ if len(queries) == 1:
+ queries = response.split("?")
+ for k in queries:
+ rk = k
+ if lowercase:
+ rk = rk.lower()
+ s = rk.strip()
+ if s == "":
+ continue
+ results.append(s)
+ except Exception as e:
+ logger.error(f"parse query rewrite prompt_response error: {e}")
+ return []
+ return results
+
+ def parse_view_response(self, speak, data) -> str:
+ return data
diff --git a/pilot/scene/chat_knowledge/rewrite/prompt.py b/pilot/scene/chat_knowledge/rewrite/prompt.py
new file mode 100644
index 000000000..e7071ddd2
--- /dev/null
+++ b/pilot/scene/chat_knowledge/rewrite/prompt.py
@@ -0,0 +1,44 @@
+from pilot.prompts.prompt_new import PromptTemplate
+from pilot.configs.config import Config
+from pilot.scene.base import ChatScene
+from pilot.common.schema import SeparatorStyle
+
+from .out_parser import QueryRewriteParser
+
+CFG = Config()
+
+
+PROMPT_SCENE_DEFINE = """You are a helpful assistant that generates multiple search queries based on a single input query."""
+
+
+_DEFAULT_TEMPLATE = """
+Generate {nums} search queries related to: {original_query}, queries should be similar and answerable search queries you might have, Provide following comma-separated format: 'queries: '\n":
+ "---------------------\n"
+ "Example:"
+ "original query: What is RAG."
+ "queries:'1. what is rag and how does it work, 2. what are the applications of rag, 3. can you provide examples of rag usage in real-world scenarios'"
+ "---------------------\n"
+ "original query:: {original_query}\n"
+ "queries:\n"
+"""
+
+PROMPT_RESPONSE = """"""
+
+PROMPT_SEP = SeparatorStyle.SINGLE.value
+
+PROMPT_NEED_NEED_STREAM_OUT = True
+
+prompt = PromptTemplate(
+ template_scene=ChatScene.QueryRewrite.value(),
+ input_variables=["nums", "original_query"],
+ response_format=None,
+ template_define=PROMPT_SCENE_DEFINE,
+ template=_DEFAULT_TEMPLATE + PROMPT_RESPONSE,
+ stream_out=PROMPT_NEED_NEED_STREAM_OUT,
+ output_parser=QueryRewriteParser(
+ sep=PROMPT_SEP, is_stream_out=PROMPT_NEED_NEED_STREAM_OUT
+ ),
+)
+
+CFG.prompt_template_registry.register(prompt, is_default=True)
+from ..v1 import prompt_chatglm
diff --git a/pilot/scene/chat_knowledge/v1/chat.py b/pilot/scene/chat_knowledge/v1/chat.py
index 2018c1e00..3269d0ba6 100644
--- a/pilot/scene/chat_knowledge/v1/chat.py
+++ b/pilot/scene/chat_knowledge/v1/chat.py
@@ -74,6 +74,7 @@ def __init__(self, chat_param: Dict):
embedding_factory=embedding_factory,
)
self.prompt_template.template_is_strict = False
+ self.relations = None
self.chunk_dao = DocumentChunkDao()
document_dao = KnowledgeDocumentDao()
documents = document_dao.get_documents(
@@ -82,10 +83,11 @@ def __init__(self, chat_param: Dict):
if len(documents) > 0:
self.document_ids = [document.id for document in documents]
+ def stream_plugin_call(self, text):
+ """return summary label"""
+ return f"{text} "
+
async def stream_call(self):
- input_values = await self.generate_input_values()
- # Source of knowledge file
- relations = input_values.get("relations")
last_output = None
async for output in super().stream_call():
last_output = output
@@ -94,12 +96,12 @@ async def stream_call(self):
if (
CFG.KNOWLEDGE_CHAT_SHOW_RELATIONS
and last_output
- and type(relations) == list
- and len(relations) > 0
+ and type(self.relations) == list
+ and len(self.relations) > 0
and hasattr(last_output, "text")
):
last_output.text = (
- last_output.text + "\n\nrelations:\n\n" + ",".join(relations)
+ last_output.text + "\n\nrelations:\n\n" + ",".join(self.relations)
)
reference = f"\n\n{self.parse_source_view(self.chunks)}"
last_output = last_output + reference
@@ -107,7 +109,7 @@ async def stream_call(self):
def stream_call_reinforce_fn(self, text):
"""return reference"""
- return text + f"\n\n{self.parse_source_view(self.chunks)}"
+ return f"\n\n{self.parse_source_view(self.chunks)}" + text
@trace()
async def generate_input_values(self) -> Dict:
@@ -120,7 +122,9 @@ async def generate_input_values(self) -> Dict:
query_reinforce = QueryReinforce(
query=self.current_user_input, model_name=self.llm_model
)
- queries = await query_reinforce.rewrite()
+ queries = []
+ if CFG.KNOWLEDGE_SEARCH_REWRITE:
+ queries = await query_reinforce.rewrite()
queries.append(self.current_user_input)
from pilot.common.chat_util import run_async_tasks
@@ -133,6 +137,7 @@ async def generate_input_values(self) -> Dict:
ranker = DefaultRanker(self.top_k)
docs = ranker.rank(candidates_with_scores)
+ self.chunks = []
if not docs or len(docs) == 0:
print("no relevant docs to retrieve")
context = "no relevant docs to retrieve"
@@ -148,13 +153,13 @@ async def generate_input_values(self) -> Dict:
context = [d.page_content for d in docs]
context = context[: self.max_token]
- relations = list(
+ self.relations = list(
set([os.path.basename(str(d.metadata.get("source", ""))) for d in docs])
)
input_values = {
"context": context,
"question": self.current_user_input,
- "relations": relations,
+ "relations": self.relations,
}
return input_values
@@ -163,7 +168,11 @@ def parse_source_view(self, chunks: List):
format knowledge reference view message to web
"""
+ import xml.etree.ElementTree as ET
+
+ references_ele = ET.Element("references")
title = "References"
+ references_ele.set("title", title)
references_dict = {}
for chunk in chunks:
doc_name = chunk.doc_name
@@ -174,7 +183,7 @@ def parse_source_view(self, chunks: List):
{
"id": chunk.id,
"content": chunk.content,
- "metadata": chunk.meta_info,
+ "meta_info": chunk.meta_info,
}
],
}
@@ -183,12 +192,13 @@ def parse_source_view(self, chunks: List):
{
"id": chunk.id,
"content": chunk.content,
- "metadata": chunk.meta_info,
+ "meta_info": chunk.meta_info,
}
)
references_list = list(references_dict.values())
- html = f""" """
- return html
+ references_ele.set("references", json.dumps(references_list))
+ html = ET.tostring(references_ele, encoding="utf-8")
+ return html.decode("utf-8")
@property
def chat_type(self) -> str:
From d653699a91fbf54d86a98d1cb03f4e307a5e6774 Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Thu, 30 Nov 2023 21:27:56 +0800
Subject: [PATCH 06/26] feat:update query reinforce
---
.env.template | 2 ++
pilot/configs/config.py | 6 +++++-
pilot/rag/retriever/reinforce.py | 2 +-
pilot/rag/retriever/rerank.py | 3 +++
4 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/.env.template b/.env.template
index e452f8b53..e223c6560 100644
--- a/.env.template
+++ b/.env.template
@@ -78,6 +78,8 @@ KNOWLEDGE_SEARCH_TOP_SIZE=5
#KNOWLEDGE_CHUNK_OVERLAP=50
# Control whether to display the source document of knowledge on the front end.
KNOWLEDGE_CHAT_SHOW_RELATIONS=False
+# Whether to enable Chat Knowledge Search Rewrite Mode
+KNOWLEDGE_SEARCH_REWRITE=True
## EMBEDDING_TOKENIZER - Tokenizer to use for chunking large inputs
## EMBEDDING_TOKEN_LIMIT - Chunk size limit for large inputs
# EMBEDDING_MODEL=all-MiniLM-L6-v2
diff --git a/pilot/configs/config.py b/pilot/configs/config.py
index 3073e93cb..8fcce75cb 100644
--- a/pilot/configs/config.py
+++ b/pilot/configs/config.py
@@ -232,7 +232,11 @@ def __init__(self) -> None:
self.KNOWLEDGE_SEARCH_MAX_TOKEN = int(
os.getenv("KNOWLEDGE_SEARCH_MAX_TOKEN", 2000)
)
- ### Control whether to display the source document of knowledge on the front end.
+ # Whether to enable Chat Knowledge Search Rewrite Mode
+ self.KNOWLEDGE_SEARCH_REWRITE = (
+ os.getenv("KNOWLEDGE_SEARCH_REWRITE", "False").lower() == "true"
+ )
+ # Control whether to display the source document of knowledge on the front end.
self.KNOWLEDGE_CHAT_SHOW_RELATIONS = (
os.getenv("KNOWLEDGE_CHAT_SHOW_RELATIONS", "False").lower() == "true"
)
diff --git a/pilot/rag/retriever/reinforce.py b/pilot/rag/retriever/reinforce.py
index 228e40f72..f73c7fd86 100644
--- a/pilot/rag/retriever/reinforce.py
+++ b/pilot/rag/retriever/reinforce.py
@@ -29,7 +29,7 @@ async def rewrite(self) -> List[str]:
chat_param = {
"chat_session_id": uuid.uuid1(),
"current_user_input": self.query,
- "select_param": 3,
+ "select_param": 2,
"model_name": self.model_name,
"model_cache_enable": False,
}
diff --git a/pilot/rag/retriever/rerank.py b/pilot/rag/retriever/rerank.py
index 908d623ca..c482d4950 100644
--- a/pilot/rag/retriever/rerank.py
+++ b/pilot/rag/retriever/rerank.py
@@ -28,6 +28,9 @@ def rank(self, candidates_with_scores: List, topk: int):
def _filter(self, candidates_with_scores: List):
"""filter duplicate candidates documents"""
+ candidates_with_scores = sorted(
+ candidates_with_scores, key=lambda x: x[1], reverse=True
+ )
visited_docs = set()
new_candidates = []
for candidate_doc, score in candidates_with_scores:
From 56974173906f1245fcfb94d99829b8976dc408c9 Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Thu, 30 Nov 2023 21:32:08 +0800
Subject: [PATCH 07/26] doc:add faq docs
---
docs/docs/faq.md | 2 --
docs/docs/faq/chatdata.md | 55 ++++++++++++++++++++++++++++++
docs/docs/faq/install.md | 72 +++++++++++++++++++++++++++++++++++++++
docs/docs/faq/kbqa.md | 70 +++++++++++++++++++++++++++++++++++++
docs/docs/faq/llm.md | 52 ++++++++++++++++++++++++++++
docs/sidebars.js | 23 +++++++++++--
6 files changed, 270 insertions(+), 4 deletions(-)
delete mode 100644 docs/docs/faq.md
create mode 100644 docs/docs/faq/chatdata.md
create mode 100644 docs/docs/faq/install.md
create mode 100644 docs/docs/faq/kbqa.md
create mode 100644 docs/docs/faq/llm.md
diff --git a/docs/docs/faq.md b/docs/docs/faq.md
deleted file mode 100644
index 429a49e0d..000000000
--- a/docs/docs/faq.md
+++ /dev/null
@@ -1,2 +0,0 @@
-# FAQ
-If you encounter any problems, you can submit an [issue](https://github.com/eosphoros-ai/DB-GPT/issues) on Github.
\ No newline at end of file
diff --git a/docs/docs/faq/chatdata.md b/docs/docs/faq/chatdata.md
new file mode 100644
index 000000000..a84c44249
--- /dev/null
+++ b/docs/docs/faq/chatdata.md
@@ -0,0 +1,55 @@
+ChatData & ChatDB
+==================================
+ChatData generates SQL from natural language and executes it. ChatDB involves conversing with metadata from the
+Database, including metadata about databases, tables, and
+fields.![db plugins demonstration](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/d8bfeee9-e982-465e-a2b8-1164b673847e)
+
+### 1.Choose Datasource
+
+If you are using DB-GPT for the first time, you need to add a data source and set the relevant connection information
+for the data source.
+
+```{tip}
+there are some example data in DB-GPT-NEW/DB-GPT/docker/examples
+
+you can execute sql script to generate data.
+```
+
+#### 1.1 Datasource management
+
+![db plugins demonstration](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/7678f07e-9eee-40a9-b980-5b3978a0ed52)
+
+#### 1.2 Connection management
+
+![db plugins demonstration](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/25b8f5a9-d322-459e-a8b2-bfe8cb42bdd6)
+
+#### 1.3 Add Datasource
+
+![db plugins demonstration](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/19ce31a7-4061-4da8-a9cb-efca396cc085)
+
+```{note}
+now DB-GPT support Datasource Type
+
+* Mysql
+* Sqlite
+* DuckDB
+* Clickhouse
+* Mssql
+```
+
+### 2.ChatData
+##### Preview Mode
+After successfully setting up the data source, you can start conversing with the database. You can ask it to generate
+SQL for you or inquire about relevant information on the database's metadata.
+![db plugins demonstration](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/8acf6a42-e511-48ff-aabf-3d9037485c1c)
+
+##### Editor Mode
+In Editor Mode, you can edit your sql and execute it.
+![db plugins demonstration](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/1a896dc1-7c0e-4354-8629-30357ffd8d7f)
+
+
+### 3.ChatDB
+
+![db plugins demonstration](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/e04bc1b1-2c58-4b33-af62-97e89098ace7)
+
+
diff --git a/docs/docs/faq/install.md b/docs/docs/faq/install.md
new file mode 100644
index 000000000..a92092abd
--- /dev/null
+++ b/docs/docs/faq/install.md
@@ -0,0 +1,72 @@
+Installation FAQ
+==================================
+
+
+##### Q1: sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file
+
+make sure you pull latest code or create directory with mkdir pilot/data
+
+##### Q2: The model keeps getting killed.
+
+your GPU VRAM size is not enough, try replace your hardware or replace other llms.
+
+##### Q3: How to access website on the public network
+
+You can try to use gradio's [network](https://github.com/gradio-app/gradio/blob/main/gradio/networking.py) to achieve.
+```python
+import secrets
+from gradio import networking
+token=secrets.token_urlsafe(32)
+local_port=5000
+url = networking.setup_tunnel('0.0.0.0', local_port, token)
+print(f'Public url: {url}')
+time.sleep(60 * 60 * 24)
+```
+
+Open `url` with your browser to see the website.
+
+##### Q4: (Windows) execute `pip install -e .` error
+
+The error log like the following:
+```
+× python setup.py bdist_wheel did not run successfully.
+ │ exit code: 1
+ ╰─> [11 lines of output]
+ running bdist_wheel
+ running build
+ running build_py
+ creating build
+ creating build\lib.win-amd64-cpython-310
+ creating build\lib.win-amd64-cpython-310\cchardet
+ copying src\cchardet\version.py -> build\lib.win-amd64-cpython-310\cchardet
+ copying src\cchardet\__init__.py -> build\lib.win-amd64-cpython-310\cchardet
+ running build_ext
+ building 'cchardet._cchardet' extension
+ error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
+ [end of output]
+```
+
+Download and install `Microsoft C++ Build Tools` from [visual-cpp-build-tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/)
+
+
+
+##### Q5: `Torch not compiled with CUDA enabled`
+
+```
+2023-08-19 16:24:30 | ERROR | stderr | raise AssertionError("Torch not compiled with CUDA enabled")
+2023-08-19 16:24:30 | ERROR | stderr | AssertionError: Torch not compiled with CUDA enabled
+```
+
+1. Install [CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit-archive)
+2. Reinstall PyTorch [start-locally](https://pytorch.org/get-started/locally/#start-locally) with CUDA support.
+
+
+##### Q6: `How to migrate meta table chat_history and connect_config from duckdb to sqlite`
+```commandline
+ python docker/examples/metadata/duckdb2sqlite.py
+```
+
+##### Q7: `How to migrate meta table chat_history and connect_config from duckdb to mysql`
+```commandline
+ python docker/examples/metadata/duckdb2mysql.py
+```
diff --git a/docs/docs/faq/kbqa.md b/docs/docs/faq/kbqa.md
new file mode 100644
index 000000000..b1835d7dc
--- /dev/null
+++ b/docs/docs/faq/kbqa.md
@@ -0,0 +1,70 @@
+KBQA FAQ
+==================================
+
+##### Q1: text2vec-large-chinese not found
+
+make sure you have download text2vec-large-chinese embedding model in right way
+
+```tip
+centos:yum install git-lfs
+ubuntu:apt-get install git-lfs -y
+macos:brew install git-lfs
+```
+```bash
+cd models
+git lfs clone https://huggingface.co/GanymedeNil/text2vec-large-chinese
+```
+
+##### Q2:How to change Vector DB Type in DB-GPT.
+
+Update .env file and set VECTOR_STORE_TYPE.
+
+DB-GPT currently support Chroma(Default), Milvus(>2.1), Weaviate vector database.
+If you want to change vector db, Update your .env, set your vector store type, VECTOR_STORE_TYPE=Chroma (now only support Chroma and Milvus(>2.1), if you set Milvus, please set MILVUS_URL and MILVUS_PORT)
+If you want to support more vector db, you can integrate yourself.[how to integrate](https://db-gpt.readthedocs.io/en/latest/modules/vector.html)
+```commandline
+#*******************************************************************#
+#** VECTOR STORE SETTINGS **#
+#*******************************************************************#
+VECTOR_STORE_TYPE=Chroma
+#MILVUS_URL=127.0.0.1
+#MILVUS_PORT=19530
+#MILVUS_USERNAME
+#MILVUS_PASSWORD
+#MILVUS_SECURE=
+
+#WEAVIATE_URL=https://kt-region-m8hcy0wc.weaviate.network
+```
+##### Q3:When I use vicuna-13b, found some illegal character like this.
+
+
+
+
+Set KNOWLEDGE_SEARCH_TOP_SIZE smaller or set KNOWLEDGE_CHUNK_SIZE smaller, and reboot server.
+
+##### Q4:space add error (pymysql.err.OperationalError) (1054, "Unknown column 'knowledge_space.context' in 'field list'")
+
+1.shutdown dbgpt_server(ctrl c)
+
+2.add column context for table knowledge_space
+
+```commandline
+mysql -h127.0.0.1 -uroot -paa12345678
+```
+
+3.execute sql ddl
+
+```commandline
+mysql> use knowledge_management;
+mysql> ALTER TABLE knowledge_space ADD COLUMN context TEXT COMMENT "arguments context";
+```
+
+4.restart dbgpt serve
+
+##### Q5:Use Mysql, how to use DB-GPT KBQA
+
+build Mysql KBQA system database schema.
+
+```bash
+$ mysql -h127.0.0.1 -uroot -paa12345678 < ./assets/schema/knowledge_management.sql
+```
\ No newline at end of file
diff --git a/docs/docs/faq/llm.md b/docs/docs/faq/llm.md
new file mode 100644
index 000000000..a0fcaa83e
--- /dev/null
+++ b/docs/docs/faq/llm.md
@@ -0,0 +1,52 @@
+LLM USE FAQ
+==================================
+##### Q1:how to use openai chatgpt service
+change your LLM_MODEL
+````shell
+LLM_MODEL=proxyllm
+````
+
+set your OPENAPI KEY
+
+````shell
+PROXY_API_KEY={your-openai-sk}
+PROXY_SERVER_URL=https://api.openai.com/v1/chat/completions
+````
+
+make sure your openapi API_KEY is available
+
+##### Q2 What difference between `python dbgpt_server --light` and `python dbgpt_server`
+
+:::tip
+python dbgpt_server --light` dbgpt_server does not start the llm service. Users can deploy the llm service separately by using `python llmserver`, and dbgpt_server accesses the llm service through set the LLM_SERVER environment variable in .env. The purpose is to allow for the separate deployment of dbgpt's backend service and llm service.
+
+python dbgpt_server service and the llm service are deployed on the same instance. when dbgpt_server starts the service, it also starts the llm service at the same time.
+:::
+
+##### Q3 how to use MultiGPUs
+
+DB-GPT will use all available gpu by default. And you can modify the setting `CUDA_VISIBLE_DEVICES=0,1` in `.env` file
+to use the specific gpu IDs.
+
+Optionally, you can also specify the gpu ID to use before the starting command, as shown below:
+
+````shell
+# Specify 1 gpu
+CUDA_VISIBLE_DEVICES=0 python3 pilot/server/dbgpt_server.py
+
+# Specify 4 gpus
+CUDA_VISIBLE_DEVICES=3,4,5,6 python3 pilot/server/dbgpt_server.py
+````
+
+You can modify the setting `MAX_GPU_MEMORY=xxGib` in `.env` file to configure the maximum memory used by each GPU.
+
+##### Q4 Not Enough Memory
+
+DB-GPT supported 8-bit quantization and 4-bit quantization.
+
+You can modify the setting `QUANTIZE_8bit=True` or `QUANTIZE_4bit=True` in `.env` file to use quantization(8-bit quantization is enabled by default).
+
+Llama-2-70b with 8-bit quantization can run with 80 GB of VRAM, and 4-bit quantization can run with 48 GB of VRAM.
+
+Note: you need to install the latest dependencies according to [requirements.txt](https://github.com/eosphoros-ai/DB-GPT/blob/main/requirements.txt).
+Note: you need to install the latest dependencies according to [requirements.txt](https://github.com/eosphoros-ai/DB-GPT/blob/main/requirements.txt).
\ No newline at end of file
diff --git a/docs/sidebars.js b/docs/sidebars.js
index c81d66698..bc054850d 100755
--- a/docs/sidebars.js
+++ b/docs/sidebars.js
@@ -200,8 +200,27 @@ const sidebars = {
},
{
- type: "doc",
- id:"faq"
+ type: "category",
+ label: "FAQ",
+ collapsed: true,
+ items: [
+ {
+ type: 'doc',
+ id: 'faq/install',
+ }
+ ,{
+ type: 'doc',
+ id: 'faq/llm',
+ }
+ ,{
+ type: 'doc',
+ id: 'faq/kbqa',
+ }
+ ,{
+ type: 'doc',
+ id: 'faq/chatdata',
+ },
+ ],
},
{
From f11d005c788a7cf13d0b6c3d43474e21c87d8904 Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Thu, 30 Nov 2023 21:40:19 +0800
Subject: [PATCH 08/26] doc:update install faq
---
docker/examples/metadata/duckdb2mysql.py | 2 +-
docs/docs/faq/install.md | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/docker/examples/metadata/duckdb2mysql.py b/docker/examples/metadata/duckdb2mysql.py
index fb5cf0ccc..76bf9cec7 100644
--- a/docker/examples/metadata/duckdb2mysql.py
+++ b/docker/examples/metadata/duckdb2mysql.py
@@ -6,7 +6,7 @@
mysql_config = {
"host": "127.0.0.1",
"user": "root",
- "password": "aa12345678",
+ "password": "your_password",
"db": "dbgpt",
"charset": "utf8mb4",
"cursorclass": pymysql.cursors.DictCursor,
diff --git a/docs/docs/faq/install.md b/docs/docs/faq/install.md
index a92092abd..8ca0f6ec1 100644
--- a/docs/docs/faq/install.md
+++ b/docs/docs/faq/install.md
@@ -68,5 +68,6 @@ Download and install `Microsoft C++ Build Tools` from [visual-cpp-build-tools](h
##### Q7: `How to migrate meta table chat_history and connect_config from duckdb to mysql`
```commandline
- python docker/examples/metadata/duckdb2mysql.py
+1. update your mysql username and password in docker/examples/metadata/duckdb2mysql.py
+2. python docker/examples/metadata/duckdb2mysql.py
```
From 9c29d9aaf26d9d33bc310df7c5f1bb92baa031c6 Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Thu, 30 Nov 2023 21:42:39 +0800
Subject: [PATCH 09/26] doc:update faq
---
docs/docs/faq/kbqa.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/docs/faq/kbqa.md b/docs/docs/faq/kbqa.md
index b1835d7dc..ce089d55b 100644
--- a/docs/docs/faq/kbqa.md
+++ b/docs/docs/faq/kbqa.md
@@ -66,5 +66,5 @@ mysql> ALTER TABLE knowledge_space ADD COLUMN context TEXT COMMENT "arguments co
build Mysql KBQA system database schema.
```bash
-$ mysql -h127.0.0.1 -uroot -paa12345678 < ./assets/schema/knowledge_management.sql
+$ mysql -h127.0.0.1 -uroot -p{your_password} < ./assets/schema/knowledge_management.sql
```
\ No newline at end of file
From 8a695def33b43684d39ac5ac3f38e75a31f93cb7 Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Thu, 30 Nov 2023 21:46:03 +0800
Subject: [PATCH 10/26] doc:update .env.template
---
.env.template | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.env.template b/.env.template
index e223c6560..452eb9c24 100644
--- a/.env.template
+++ b/.env.template
@@ -102,7 +102,7 @@ LOCAL_DB_TYPE=sqlite
### MYSQL database
# LOCAL_DB_TYPE=mysql
# LOCAL_DB_USER=root
-# LOCAL_DB_PASSWORD=aa12345678
+# LOCAL_DB_PASSWORD={your_password}
# LOCAL_DB_HOST=127.0.0.1
# LOCAL_DB_PORT=3306
# LOCAL_DB_NAME=dbgpt
From 4af348e3c8c81810c1c257dcab7037d8af8694e2 Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Thu, 30 Nov 2023 21:49:39 +0800
Subject: [PATCH 11/26] docs:update faq
---
docs/docs/faq/kbqa.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/docs/faq/kbqa.md b/docs/docs/faq/kbqa.md
index ce089d55b..ef7210b3e 100644
--- a/docs/docs/faq/kbqa.md
+++ b/docs/docs/faq/kbqa.md
@@ -49,7 +49,7 @@ Set KNOWLEDGE_SEARCH_TOP_SIZE smaller or set KNOWLEDGE_CHUNK_SIZE smaller, and r
2.add column context for table knowledge_space
```commandline
-mysql -h127.0.0.1 -uroot -paa12345678
+mysql -h127.0.0.1 -uroot -p{your_password
```
3.execute sql ddl
From 21614154aaeb1e12c8bd164bd5d45ecdc1b0b7d7 Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Fri, 1 Dec 2023 09:48:04 +0800
Subject: [PATCH 12/26] feat:update reference web
---
pilot/scene/chat_knowledge/v1/chat.py | 6 +-----
pilot/server/static/404.html | 2 +-
pilot/server/static/404/index.html | 2 +-
.../_buildManifest.js | 2 +-
.../_ssgManifest.js | 0
.../server/static/_next/static/chunks/0.1410040668957610.js | 1 +
.../server/static/_next/static/chunks/0.37a9882ddd3822ef.js | 1 -
.../{553-a47bd28b47047f83.js => 553-df5701294eedae07.js} | 2 +-
.../{955.53f3a4cf3e0b002f.js => 955.228fa9fef23b31a4.js} | 2 +-
.../{_app-7178aba7b953cb1d.js => _app-a7ec5b45a9ed8418.js} | 0
...{agent-0ee536125426fba0.js => agent-92e9dce47267e88d.js} | 2 +-
...ase-2f26b925c44f1b12.js => database-3140f507fe61ccb8.js} | 2 +-
...{index-b82ae16bc13b2207.js => index-d1740e3bc6dba7f5.js} | 0
...pack-7d5cf9ac69f4db72.js => webpack-b5216c63e109d42c.js} | 2 +-
pilot/server/static/_next/static/css/29e4bfd1756acba7.css | 3 +++
pilot/server/static/_next/static/css/c921bbabe4b71b75.css | 3 ---
pilot/server/static/agent/index.html | 2 +-
pilot/server/static/chat/[scene]/[id]/index.html | 2 +-
pilot/server/static/chat/index.html | 2 +-
pilot/server/static/database/index.html | 2 +-
pilot/server/static/index.html | 2 +-
pilot/server/static/knowledge/chunk/index.html | 2 +-
pilot/server/static/knowledge/index.html | 2 +-
pilot/server/static/models/index.html | 2 +-
pilot/server/static/prompt/index.html | 2 +-
25 files changed, 22 insertions(+), 26 deletions(-)
rename pilot/server/static/_next/static/{MGn9us9v_Z-Z5nCBrtqsb => Z-9u11WMONBSz1K_mIa0L}/_buildManifest.js (57%)
rename pilot/server/static/_next/static/{MGn9us9v_Z-Z5nCBrtqsb => Z-9u11WMONBSz1K_mIa0L}/_ssgManifest.js (100%)
create mode 100644 pilot/server/static/_next/static/chunks/0.1410040668957610.js
delete mode 100644 pilot/server/static/_next/static/chunks/0.37a9882ddd3822ef.js
rename pilot/server/static/_next/static/chunks/{553-a47bd28b47047f83.js => 553-df5701294eedae07.js} (99%)
rename pilot/server/static/_next/static/chunks/{955.53f3a4cf3e0b002f.js => 955.228fa9fef23b31a4.js} (99%)
rename pilot/server/static/_next/static/chunks/pages/{_app-7178aba7b953cb1d.js => _app-a7ec5b45a9ed8418.js} (100%)
rename pilot/server/static/_next/static/chunks/pages/{agent-0ee536125426fba0.js => agent-92e9dce47267e88d.js} (99%)
rename pilot/server/static/_next/static/chunks/pages/{database-2f26b925c44f1b12.js => database-3140f507fe61ccb8.js} (98%)
rename pilot/server/static/_next/static/chunks/pages/{index-b82ae16bc13b2207.js => index-d1740e3bc6dba7f5.js} (100%)
rename pilot/server/static/_next/static/chunks/{webpack-7d5cf9ac69f4db72.js => webpack-b5216c63e109d42c.js} (94%)
create mode 100644 pilot/server/static/_next/static/css/29e4bfd1756acba7.css
delete mode 100644 pilot/server/static/_next/static/css/c921bbabe4b71b75.css
diff --git a/pilot/scene/chat_knowledge/v1/chat.py b/pilot/scene/chat_knowledge/v1/chat.py
index 3269d0ba6..9c16f349c 100644
--- a/pilot/scene/chat_knowledge/v1/chat.py
+++ b/pilot/scene/chat_knowledge/v1/chat.py
@@ -83,10 +83,6 @@ def __init__(self, chat_param: Dict):
if len(documents) > 0:
self.document_ids = [document.id for document in documents]
- def stream_plugin_call(self, text):
- """return summary label"""
- return f"{text} "
-
async def stream_call(self):
last_output = None
async for output in super().stream_call():
@@ -109,7 +105,7 @@ async def stream_call(self):
def stream_call_reinforce_fn(self, text):
"""return reference"""
- return f"\n\n{self.parse_source_view(self.chunks)}" + text
+ return text + f"\n\n{self.parse_source_view(self.chunks)}"
@trace()
async def generate_input_values(self) -> Dict:
diff --git a/pilot/server/static/404.html b/pilot/server/static/404.html
index 49f15e208..c440dced7 100644
--- a/pilot/server/static/404.html
+++ b/pilot/server/static/404.html
@@ -1 +1 @@
-404: This page could not be found 404
This page could not be found.
\ No newline at end of file
+404: This page could not be found 404
This page could not be found.
\ No newline at end of file
diff --git a/pilot/server/static/404/index.html b/pilot/server/static/404/index.html
index 49f15e208..c440dced7 100644
--- a/pilot/server/static/404/index.html
+++ b/pilot/server/static/404/index.html
@@ -1 +1 @@
-404: This page could not be found 404
This page could not be found.
\ No newline at end of file
+404: This page could not be found 404
This page could not be found.
\ No newline at end of file
diff --git a/pilot/server/static/_next/static/MGn9us9v_Z-Z5nCBrtqsb/_buildManifest.js b/pilot/server/static/_next/static/Z-9u11WMONBSz1K_mIa0L/_buildManifest.js
similarity index 57%
rename from pilot/server/static/_next/static/MGn9us9v_Z-Z5nCBrtqsb/_buildManifest.js
rename to pilot/server/static/_next/static/Z-9u11WMONBSz1K_mIa0L/_buildManifest.js
index 99e450671..a39cc2a22 100644
--- a/pilot/server/static/_next/static/MGn9us9v_Z-Z5nCBrtqsb/_buildManifest.js
+++ b/pilot/server/static/_next/static/Z-9u11WMONBSz1K_mIa0L/_buildManifest.js
@@ -1 +1 @@
-self.__BUILD_MANIFEST=function(s,c,a,t,e,n,d,b,f,k,h,i){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":["static/chunks/29107295-90b90cb30c825230.js",s,c,a,n,d,b,f,"static/chunks/412-b911d4a677c64b70.js","static/chunks/981-ff77d5cc3ab95298.js","static/chunks/pages/index-b82ae16bc13b2207.js"],"/_error":["static/chunks/pages/_error-dee72aff9b2e2c12.js"],"/agent":[s,c,t,n,e,d,"static/chunks/pages/agent-0ee536125426fba0.js"],"/chat":["static/chunks/pages/chat-84fbba4764166684.js"],"/chat/[scene]/[id]":["static/chunks/pages/chat/[scene]/[id]-f665336966e79cc9.js"],"/database":[s,c,a,t,e,b,k,"static/chunks/643-d8f53f40dd3c5b40.js","static/chunks/pages/database-2f26b925c44f1b12.js"],"/knowledge":[h,s,c,t,n,e,d,b,"static/chunks/551-266086fbfa0925ec.js","static/chunks/pages/knowledge-8ada4ce8fa909bf5.js"],"/knowledge/chunk":[t,e,"static/chunks/pages/knowledge/chunk-9f117a5ed799edd3.js"],"/models":[h,s,c,a,i,k,"static/chunks/pages/models-80218c46bc1d8cfa.js"],"/prompt":[s,c,a,i,"static/chunks/837-e6d4d1eb9e057050.js",f,"static/chunks/607-b224c640f6907e4b.js","static/chunks/pages/prompt-7f839dfd56bc4c20.js"],sortedPages:["/","/_app","/_error","/agent","/chat","/chat/[scene]/[id]","/database","/knowledge","/knowledge/chunk","/models","/prompt"]}}("static/chunks/64-91b49d45b9846775.js","static/chunks/479-b20198841f9a6a1e.js","static/chunks/9-bb2c54d5c06ba4bf.js","static/chunks/442-197e6cbc1e54109a.js","static/chunks/813-cce9482e33f2430c.js","static/chunks/553-a47bd28b47047f83.js","static/chunks/924-ba8e16df4d61ff5c.js","static/chunks/411-d9eba2657c72f766.js","static/chunks/270-2f094a936d056513.js","static/chunks/928-74244889bd7f2699.js","static/chunks/75fc9c18-a784766a129ec5fb.js","static/chunks/947-5980a3ff49069ddd.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
\ No newline at end of file
+self.__BUILD_MANIFEST=function(s,c,a,e,t,d,n,f,k,h,i,b){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":["static/chunks/29107295-90b90cb30c825230.js",s,c,a,d,n,f,k,"static/chunks/412-b911d4a677c64b70.js","static/chunks/981-ff77d5cc3ab95298.js","static/chunks/pages/index-d1740e3bc6dba7f5.js"],"/_error":["static/chunks/pages/_error-dee72aff9b2e2c12.js"],"/agent":[s,c,e,d,t,n,"static/chunks/pages/agent-92e9dce47267e88d.js"],"/chat":["static/chunks/pages/chat-84fbba4764166684.js"],"/chat/[scene]/[id]":["static/chunks/pages/chat/[scene]/[id]-f665336966e79cc9.js"],"/database":[s,c,a,e,t,f,h,"static/chunks/643-d8f53f40dd3c5b40.js","static/chunks/pages/database-3140f507fe61ccb8.js"],"/knowledge":[i,s,c,e,d,t,n,f,"static/chunks/551-266086fbfa0925ec.js","static/chunks/pages/knowledge-8ada4ce8fa909bf5.js"],"/knowledge/chunk":[e,t,"static/chunks/pages/knowledge/chunk-9f117a5ed799edd3.js"],"/models":[i,s,c,a,b,h,"static/chunks/pages/models-80218c46bc1d8cfa.js"],"/prompt":[s,c,a,b,"static/chunks/837-e6d4d1eb9e057050.js",k,"static/chunks/607-b224c640f6907e4b.js","static/chunks/pages/prompt-7f839dfd56bc4c20.js"],sortedPages:["/","/_app","/_error","/agent","/chat","/chat/[scene]/[id]","/database","/knowledge","/knowledge/chunk","/models","/prompt"]}}("static/chunks/64-91b49d45b9846775.js","static/chunks/479-b20198841f9a6a1e.js","static/chunks/9-bb2c54d5c06ba4bf.js","static/chunks/442-197e6cbc1e54109a.js","static/chunks/813-cce9482e33f2430c.js","static/chunks/553-df5701294eedae07.js","static/chunks/924-ba8e16df4d61ff5c.js","static/chunks/411-d9eba2657c72f766.js","static/chunks/270-2f094a936d056513.js","static/chunks/928-74244889bd7f2699.js","static/chunks/75fc9c18-a784766a129ec5fb.js","static/chunks/947-5980a3ff49069ddd.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
\ No newline at end of file
diff --git a/pilot/server/static/_next/static/MGn9us9v_Z-Z5nCBrtqsb/_ssgManifest.js b/pilot/server/static/_next/static/Z-9u11WMONBSz1K_mIa0L/_ssgManifest.js
similarity index 100%
rename from pilot/server/static/_next/static/MGn9us9v_Z-Z5nCBrtqsb/_ssgManifest.js
rename to pilot/server/static/_next/static/Z-9u11WMONBSz1K_mIa0L/_ssgManifest.js
diff --git a/pilot/server/static/_next/static/chunks/0.1410040668957610.js b/pilot/server/static/_next/static/chunks/0.1410040668957610.js
new file mode 100644
index 000000000..496a0dfd2
--- /dev/null
+++ b/pilot/server/static/_next/static/chunks/0.1410040668957610.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[0],{15506:function(e,l,t){t.r(l),t.d(l,{default:function(){return ew}});var a=t(85893),s=t(67294),n=t(2093),r=t(43446),o=t(39332),i=t(99513),c=t(24019),d=t(50888),u=t(97937),m=t(63606),x=t(50228),h=t(87547),p=t(89035),v=t(33035),f=t(12767),g=t(94184),j=t.n(g),b=t(66309),y=t(81799),w=t(41468),_=t(29158),Z=t(98165),N=t(14079),k=t(38426),C=t(61607),S=t(44442),P=t(74627),R=t(36782),E=t(13135),D=t(71577),I=t(2453),M=t(57132),O=t(79166),z=t(93179),L=t(20640),A=t.n(L);function F(e){let{code:l,language:t}=e;return(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(D.ZP,{className:"absolute right-3 top-2 text-gray-300 hover:!text-gray-200 bg-gray-700",type:"text",icon:(0,a.jsx)(M.Z,{}),onClick:()=>{let e=A()(l);I.ZP[e?"success":"error"](e?"Copy success":"Copy failed")}}),(0,a.jsx)(z.Z,{language:t,style:O.Z,children:l})]})}let H=["custom-view","chart-view","references","summary"],q={code(e){var l;let{inline:t,node:s,className:n,children:r,style:o,...i}=e,{context:c,matchValues:d}=function(e){let l=H.reduce((l,t)=>{let a=RegExp("<".concat(t,"[^>]*/?>"),"gi");return e=e.replace(a,e=>(l.push(e),"")),l},[]);return{context:e,matchValues:l}}(Array.isArray(r)?r.join("\n"):r),u=/language-(\w+)/.exec(n||"");return(0,a.jsxs)(a.Fragment,{children:[!t&&u?(0,a.jsx)(F,{code:c,language:null!==(l=null==u?void 0:u[1])&&void 0!==l?l:"javascript"}):(0,a.jsx)("code",{...i,style:o,className:"px-[6px] py-[2px] rounded bg-gray-700 text-gray-100 dark:bg-gray-100 dark:text-gray-800 text-sm",children:r}),(0,a.jsx)(v.D,{components:q,rehypePlugins:[f.Z],children:d.join("\n")})]})},ul(e){let{children:l}=e;return(0,a.jsx)("ul",{className:"py-1",children:l})},ol(e){let{children:l}=e;return(0,a.jsx)("ol",{className:"py-1",children:l})},li(e){let{children:l,ordered:t}=e;return(0,a.jsx)("li",{className:"text-sm leading-7 ml-5 pl-2 text-gray-600 dark:text-gray-300 ".concat(t?"list-decimal":"list-disc"),children:l})},table(e){let{children:l}=e;return(0,a.jsx)("table",{className:"my-2 rounded-tl-md rounded-tr-md max-w-full bg-white dark:bg-gray-900 text-sm rounded-lg overflow-hidden",children:l})},thead(e){let{children:l}=e;return(0,a.jsx)("thead",{className:"bg-[#fafafa] dark:bg-black font-semibold",children:l})},th(e){let{children:l}=e;return(0,a.jsx)("th",{className:"!text-left p-4",children:l})},td(e){let{children:l}=e;return(0,a.jsx)("td",{className:"p-4 border-t border-[#f0f0f0] dark:border-gray-700",children:l})},h1(e){let{children:l}=e;return(0,a.jsx)("h3",{className:"text-2xl font-bold my-4 border-b border-slate-300 pb-4",children:l})},h2(e){let{children:l}=e;return(0,a.jsx)("h3",{className:"text-xl font-bold my-3",children:l})},h3(e){let{children:l}=e;return(0,a.jsx)("h3",{className:"text-lg font-semibold my-2",children:l})},h4(e){let{children:l}=e;return(0,a.jsx)("h3",{className:"text-base font-semibold my-1",children:l})},a(e){let{children:l,href:t}=e;return(0,a.jsxs)("div",{className:"inline-block text-blue-600 dark:text-blue-400",children:[(0,a.jsx)(_.Z,{className:"mr-1"}),(0,a.jsx)("a",{href:t,target:"_blank",children:l})]})},img(e){let{src:l,alt:t}=e;return(0,a.jsx)("div",{children:(0,a.jsx)(k.Z,{className:"min-h-[1rem] max-w-full max-h-full border rounded",src:l,alt:t,placeholder:(0,a.jsx)(b.Z,{icon:(0,a.jsx)(Z.Z,{spin:!0}),color:"processing",children:"Image Loading..."}),fallback:"/images/fallback.png"})})},blockquote(e){let{children:l}=e;return(0,a.jsx)("blockquote",{className:"py-4 px-6 border-l-4 border-blue-600 rounded bg-white my-2 text-gray-500 dark:bg-slate-800 dark:text-gray-200 dark:border-white shadow-sm",children:l})},"chart-view":function(e){var l,t,s;let n,{content:r,children:o}=e;try{n=JSON.parse(r)}catch(e){console.log(e,r),n={type:"response_table",sql:"",data:[]}}let i=(null==n?void 0:null===(l=n.data)||void 0===l?void 0:l[0])?null===(t=Object.keys(null==n?void 0:null===(s=n.data)||void 0===s?void 0:s[0]))||void 0===t?void 0:t.map(e=>({title:e,dataIndex:e,key:e})):[],c={key:"chart",label:"Chart",children:(0,a.jsx)(E._z,{data:null==n?void 0:n.data,chartType:(0,E.aG)(null==n?void 0:n.type)})},d={key:"sql",label:"SQL",children:(0,a.jsx)(F,{code:(0,R.WU)(null==n?void 0:n.sql,{language:"mysql"}),language:"sql"})},u={key:"data",label:"Data",children:(0,a.jsx)(C.Z,{dataSource:null==n?void 0:n.data,columns:i})},m=(null==n?void 0:n.type)==="response_table"?[u,d]:[c,d,u];return(0,a.jsxs)("div",{children:[(0,a.jsx)(S.Z,{defaultActiveKey:(null==n?void 0:n.type)==="response_table"?"data":"chart",items:m,size:"small"}),o]})},references:function(e){let l,{title:t,references:s,children:n}=e;if(n)try{t=(l=JSON.parse(n)).title,s=l.references}catch(e){}else try{s=JSON.parse(s)}catch(e){}return!s||(null==s?void 0:s.length)<1?null:(0,a.jsxs)("div",{className:"border-t-[1px] border-gray-300 mt-3 py-2",children:[(0,a.jsxs)("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-2",children:[(0,a.jsx)(_.Z,{className:"mr-2"}),(0,a.jsx)("span",{className:"font-semibold",children:t})]}),s.map((e,l)=>{var t;return(0,a.jsxs)("div",{className:"text-sm font-normal block ml-2 h-6 leading-6 overflow-hidden",children:[(0,a.jsxs)("span",{className:"inline-block w-6",children:["[",l+1,"]"]}),(0,a.jsx)("span",{className:"mr-2 lg:mr-4 text-blue-400",children:e.name}),null==e?void 0:null===(t=e.chunks)||void 0===t?void 0:t.map((l,t)=>(0,a.jsxs)("span",{children:["object"==typeof l?(0,a.jsx)(P.Z,{content:(0,a.jsxs)("div",{className:"max-w-4xl py-4 border-t border-gray-500",children:[(0,a.jsx)("p",{children:(null==l?void 0:l.content)||"No Content"}),(0,a.jsx)("p",{className:"mt-2 font-bold mr-2 border-t border-gray-500 pt-2",children:"MetaData"}),(0,a.jsx)("p",{children:(null==l?void 0:l.meta_info)||"No MetaData"})]}),title:"Chunk Content",children:(0,a.jsx)("span",{className:"cursor-pointer text-blue-500 ml-2",children:null==l?void 0:l.id},"chunk_content_".concat(null==l?void 0:l.id))}):(0,a.jsx)("span",{className:"cursor-pointer text-blue-500 ml-2",children:l},"chunk_id_".concat(l)),t<(null==e?void 0:e.chunks.length)-1&&(0,a.jsx)("span",{children:","},"chunk_comma_".concat(t))]},"chunk_".concat(t)))]},"file_".concat(l))})]})},summary:function(e){let{children:l}=e;return(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"mb-2",children:[(0,a.jsx)(N.Z,{className:"mr-2"}),(0,a.jsx)("span",{className:"font-semibold",children:"Document Summary"})]}),(0,a.jsx)("div",{children:l})]})}},V={todo:{bgClass:"bg-gray-500",icon:(0,a.jsx)(c.Z,{className:"ml-2"})},runing:{bgClass:"bg-blue-500",icon:(0,a.jsx)(d.Z,{className:"ml-2"})},failed:{bgClass:"bg-red-500",icon:(0,a.jsx)(u.Z,{className:"ml-2"})},completed:{bgClass:"bg-green-500",icon:(0,a.jsx)(m.Z,{className:"ml-2"})}};function T(e){return e.replaceAll("\\n","\n").replace(/]+)>/gi,"").replace(/]+)>/gi," ")}var G=(0,s.memo)(function(e){let{children:l,content:t,isChartChat:n,onLinkClick:r}=e,{scene:o}=(0,s.useContext)(w.p),{context:i,model_name:c,role:d}=t,u="view"===d,{relations:m,value:g,cachePluginContext:_}=(0,s.useMemo)(()=>{if("string"!=typeof i)return{relations:[],value:"",cachePluginContext:[]};let[e,l]=i.split(" relations:"),t=l?l.split(","):[],a=[],s=0,n=e.replace(/]*>[^<]*<\/dbgpt-view>/gi,e=>{try{var l;let t=e.replaceAll("\n","\\n").replace(/<[^>]*>|<\/[^>]*>/gm,""),n=JSON.parse(t),r="".concat(s," ");return a.push({...n,result:T(null!==(l=n.result)&&void 0!==l?l:"")}),s++,r}catch(l){return console.log(l.message,l),e}});return{relations:t,cachePluginContext:a,value:n}},[i]),Z=(0,s.useMemo)(()=>({"custom-view"(e){var l;let{children:t}=e,s=+t.toString();if(!_[s])return t;let{name:n,status:r,err_msg:o,result:i}=_[s],{bgClass:c,icon:d}=null!==(l=V[r])&&void 0!==l?l:{};return(0,a.jsxs)("div",{className:"bg-white dark:bg-[#212121] rounded-lg overflow-hidden my-2 flex flex-col lg:max-w-[80%]",children:[(0,a.jsxs)("div",{className:j()("flex px-4 md:px-6 py-2 items-center text-white text-sm",c),children:[n,d]}),i?(0,a.jsx)("div",{className:"px-4 md:px-6 py-4 text-sm",children:(0,a.jsx)(v.D,{components:q,rehypePlugins:[f.Z],children:null!=i?i:""})}):(0,a.jsx)("div",{className:"px-4 md:px-6 py-4 text-sm",children:o})]})}}),[i,_]);return u||i?(0,a.jsxs)("div",{className:j()("relative flex flex-wrap w-full px-2 sm:px-4 py-2 sm:py-4 rounded-xl break-words",{"bg-slate-100 dark:bg-[#353539]":u,"lg:w-full xl:w-full pl-0":["chat_with_db_execute","chat_dashboard"].includes(o)}),children:[(0,a.jsx)("div",{className:"mr-2 flex flex-shrink-0 items-center justify-center h-7 w-7 rounded-full text-lg sm:mr-4",children:u?(0,y.A)(c)||(0,a.jsx)(x.Z,{}):(0,a.jsx)(h.Z,{})}),(0,a.jsxs)("div",{className:"flex-1 overflow-hidden items-center text-md leading-8",children:[!u&&"string"==typeof i&&i,u&&n&&"object"==typeof i&&(0,a.jsxs)("div",{children:["[".concat(i.template_name,"]: "),(0,a.jsxs)("span",{className:"text-[#1677ff] cursor-pointer",onClick:r,children:[(0,a.jsx)(p.Z,{className:"mr-1"}),i.template_introduce||"More Details"]})]}),u&&"string"==typeof i&&(0,a.jsx)(v.D,{components:{...q,...Z},rehypePlugins:[f.Z],children:T(g)}),!!(null==m?void 0:m.length)&&(0,a.jsx)("div",{className:"flex flex-wrap mt-2",children:null==m?void 0:m.map((e,l)=>(0,a.jsx)(b.Z,{color:"#108ee9",children:e},e+l))})]}),l]}):(0,a.jsx)("div",{className:"h-12"})}),J=t(59301),U=t(41132),W=t(74312),$=t(3414),B=t(72868),Q=t(59562),K=t(14553),X=t(25359),Y=t(7203),ee=t(48665),el=t(26047),et=t(99056),ea=t(57814),es=t(63955),en=t(33028),er=t(40911),eo=t(66478),ei=t(83062),ec=t(50489),ed=t(67421),eu=e=>{var l;let{conv_index:t,question:n,knowledge_space:r,select_param:o}=e,{t:i}=(0,ed.$G)(),{chatId:c}=(0,s.useContext)(w.p),[d,u]=(0,s.useState)(""),[m,x]=(0,s.useState)(4),[h,p]=(0,s.useState)(""),v=(0,s.useRef)(null),[f,g]=I.ZP.useMessage(),j=(0,s.useCallback)((e,l)=>{l?(0,ec.Vx)((0,ec.Eb)(c,t)).then(e=>{var l,t,a,s;let n=null!==(l=e[1])&&void 0!==l?l:{};u(null!==(t=n.ques_type)&&void 0!==t?t:""),x(parseInt(null!==(a=n.score)&&void 0!==a?a:"4")),p(null!==(s=n.messages)&&void 0!==s?s:"")}).catch(e=>{console.log(e)}):(u(""),x(4),p(""))},[c,t]),b=(0,W.Z)($.Z)(e=>{let{theme:l}=e;return{backgroundColor:"dark"===l.palette.mode?"#FBFCFD":"#0E0E10",...l.typography["body-sm"],padding:l.spacing(1),display:"flex",alignItems:"center",justifyContent:"center",borderRadius:4,width:"100%",height:"100%"}});return(0,a.jsxs)(B.L,{onOpenChange:j,children:[g,(0,a.jsx)(ei.Z,{title:i("Rating"),children:(0,a.jsx)(Q.Z,{slots:{root:K.ZP},slotProps:{root:{variant:"plain",color:"primary"}},sx:{borderRadius:40},children:(0,a.jsx)(J.Z,{})})}),(0,a.jsxs)(X.Z,{children:[(0,a.jsx)(Y.Z,{disabled:!0,sx:{minHeight:0}}),(0,a.jsx)(ee.Z,{sx:{width:"100%",maxWidth:350,display:"grid",gap:3,padding:1},children:(0,a.jsx)("form",{onSubmit:e=>{e.preventDefault();let l={conv_uid:c,conv_index:t,question:n,knowledge_space:r,score:m,ques_type:d,messages:h};console.log(l),(0,ec.Vx)((0,ec.VC)({data:l})).then(e=>{f.open({type:"success",content:"save success"})}).catch(e=>{f.open({type:"error",content:"save error"})})},children:(0,a.jsxs)(el.Z,{container:!0,spacing:.5,columns:13,sx:{flexGrow:1},children:[(0,a.jsx)(el.Z,{xs:3,children:(0,a.jsx)(b,{children:i("Q_A_Category")})}),(0,a.jsx)(el.Z,{xs:10,children:(0,a.jsx)(et.Z,{action:v,value:d,placeholder:"Choose one…",onChange:(e,l)=>u(null!=l?l:""),...d&&{endDecorator:(0,a.jsx)(K.ZP,{size:"sm",variant:"plain",color:"neutral",onMouseDown:e=>{e.stopPropagation()},onClick:()=>{var e;u(""),null===(e=v.current)||void 0===e||e.focusVisible()},children:(0,a.jsx)(U.Z,{})}),indicator:null},sx:{width:"100%"},children:o&&(null===(l=Object.keys(o))||void 0===l?void 0:l.map(e=>(0,a.jsx)(ea.Z,{value:e,children:o[e]},e)))})}),(0,a.jsx)(el.Z,{xs:3,children:(0,a.jsx)(b,{children:(0,a.jsx)(ei.Z,{title:(0,a.jsx)(ee.Z,{children:(0,a.jsx)("div",{children:i("feed_back_desc")})}),variant:"solid",placement:"left",children:i("Q_A_Rating")})})}),(0,a.jsx)(el.Z,{xs:10,sx:{pl:0,ml:0},children:(0,a.jsx)(es.Z,{"aria-label":"Custom",step:1,min:0,max:5,valueLabelFormat:function(e){return({0:i("Lowest"),1:i("Missed"),2:i("Lost"),3:i("Incorrect"),4:i("Verbose"),5:i("Best")})[e]},valueLabelDisplay:"on",marks:[{value:0,label:"0"},{value:1,label:"1"},{value:2,label:"2"},{value:3,label:"3"},{value:4,label:"4"},{value:5,label:"5"}],sx:{width:"90%",pt:3,m:2,ml:1},onChange:e=>{var l;return x(null===(l=e.target)||void 0===l?void 0:l.value)},value:m})}),(0,a.jsx)(el.Z,{xs:13,children:(0,a.jsx)(en.Z,{placeholder:i("Please_input_the_text"),value:h,onChange:e=>p(e.target.value),minRows:2,maxRows:4,endDecorator:(0,a.jsx)(er.ZP,{level:"body-xs",sx:{ml:"auto"},children:i("input_count")+h.length+i("input_unit")}),sx:{width:"100%",fontSize:14}})}),(0,a.jsx)(el.Z,{xs:13,children:(0,a.jsx)(eo.Z,{type:"submit",variant:"outlined",sx:{width:"100%",height:"100%"},children:i("submit")})})]})})})]})]})},em=t(32983),ex=t(12069),eh=t(96486),ep=t(20766),ev=t(98399),ef=t(87740),eg=t(80573),ej=e=>{var l;let{messages:t,onSubmit:r}=e,{dbParam:c,currentDialogue:d,scene:u,model:m,refreshDialogList:x,chatId:h,agentList:p,docId:v}=(0,s.useContext)(w.p),{t:f}=(0,ed.$G)(),g=(0,o.useSearchParams)(),b=null!==(l=g&&g.get("spaceNameOriginal"))&&void 0!==l?l:"",[_,Z]=(0,s.useState)(!1),[N,k]=(0,s.useState)(!1),[C,S]=(0,s.useState)(t),[P,R]=(0,s.useState)(""),[E,D]=(0,s.useState)(),O=(0,s.useRef)(null),z=(0,s.useMemo)(()=>"chat_dashboard"===u,[u]),L=(0,eg.Z)(),F=(0,s.useMemo)(()=>{switch(u){case"chat_agent":return p.join(",");case"chat_excel":return null==d?void 0:d.select_param;default:return b||c}},[u,p,d,c,b]),H=async e=>{if(!_&&e.trim())try{Z(!0),await r(e,{select_param:null!=F?F:""})}finally{Z(!1)}},q=e=>{try{return JSON.parse(e)}catch(l){return e}},[V,T]=I.ZP.useMessage(),J=async e=>{let l=null==e?void 0:e.replace(/\trelations:.*/g,""),t=A()(l);t?l?V.open({type:"success",content:f("Copy_success")}):V.open({type:"warning",content:f("Copy_nothing")}):V.open({type:"error",content:f("Copry_error")})},U=async()=>{!_&&v&&(Z(!0),await L(v),Z(!1))};return(0,n.Z)(async()=>{let e=(0,ev.a_)();e&&e.id===h&&(await H(e.message),x(),localStorage.removeItem(ev.rU))},[h]),(0,s.useEffect)(()=>{let e=t;z&&(e=(0,eh.cloneDeep)(t).map(e=>((null==e?void 0:e.role)==="view"&&"string"==typeof(null==e?void 0:e.context)&&(e.context=q(null==e?void 0:e.context)),e))),S(e.filter(e=>["view","human"].includes(e.role)))},[z,t]),(0,s.useEffect)(()=>{(0,ec.Vx)((0,ec.Lu)()).then(e=>{var l;D(null!==(l=e[1])&&void 0!==l?l:{})}).catch(e=>{console.log(e)})},[]),(0,s.useEffect)(()=>{setTimeout(()=>{var e;null===(e=O.current)||void 0===e||e.scrollTo(0,O.current.scrollHeight)},50)},[t]),(0,a.jsxs)(a.Fragment,{children:[T,(0,a.jsx)("div",{ref:O,className:"flex flex-1 overflow-y-auto pb-8 w-full flex-col",children:(0,a.jsx)("div",{className:"flex items-center flex-1 flex-col text-sm leading-6 text-slate-900 dark:text-slate-300 sm:text-base sm:leading-7",children:C.length?C.map((e,l)=>{var t;return(0,a.jsx)(G,{content:e,isChartChat:z,onLinkClick:()=>{k(!0),R(JSON.stringify(null==e?void 0:e.context,null,2))},children:"view"===e.role&&(0,a.jsxs)("div",{className:"flex w-full pt-2 md:pt-4 border-t border-gray-200 mt-2 md:mt-4 pl-2",children:["chat_knowledge"===u&&e.retry?(0,a.jsxs)(eo.Z,{onClick:U,slots:{root:K.ZP},slotProps:{root:{variant:"plain",color:"primary"}},children:[(0,a.jsx)(ef.Z,{}),"\xa0",(0,a.jsx)("span",{className:"text-sm",children:f("Retry")})]}):null,(0,a.jsxs)("div",{className:"flex w-full flex-row-reverse",children:[(0,a.jsx)(eu,{select_param:E,conv_index:Math.ceil((l+1)/2),question:null===(t=null==C?void 0:C.filter(l=>(null==l?void 0:l.role)==="human"&&(null==l?void 0:l.order)===e.order)[0])||void 0===t?void 0:t.context,knowledge_space:b||c||""}),(0,a.jsx)(ei.Z,{title:f("Copy"),children:(0,a.jsx)(eo.Z,{onClick:()=>J(null==e?void 0:e.context),slots:{root:K.ZP},slotProps:{root:{variant:"plain",color:"primary"}},sx:{borderRadius:40},children:(0,a.jsx)(M.Z,{})})})]})]})},l)}):(0,a.jsx)(em.Z,{image:"/empty.png",imageStyle:{width:320,height:320,margin:"0 auto",maxWidth:"100%",maxHeight:"100%"},className:"flex items-center justify-center flex-col h-full w-full",description:"Start a conversation"})})}),(0,a.jsx)("div",{className:j()("relative after:absolute after:-top-8 after:h-8 after:w-full after:bg-gradient-to-t after:from-white after:to-transparent dark:after:from-[#212121]",{"cursor-not-allowed":"chat_excel"===u&&!(null==d?void 0:d.select_param)}),children:(0,a.jsxs)("div",{className:"flex flex-wrap w-full py-2 sm:pt-6 sm:pb-10 items-center",children:[m&&(0,a.jsx)("div",{className:"mr-2 flex",children:(0,y.A)(m)}),(0,a.jsx)(ep.Z,{loading:_,onSubmit:H,handleFinish:Z})]})}),(0,a.jsx)(ex.default,{title:"JSON Editor",open:N,width:"60%",cancelButtonProps:{hidden:!0},onOk:()=>{k(!1)},onCancel:()=>{k(!1)},children:(0,a.jsx)(i.Z,{className:"w-full h-[500px]",language:"json",value:P})})]})},eb=t(34625),ey=t(45247),ew=()=>{var e;let l=(0,o.useSearchParams)(),{scene:t,chatId:i,model:c,setModel:d,history:u,setHistory:m}=(0,s.useContext)(w.p),x=(0,r.Z)({}),h=null!==(e=l&&l.get("initMessage"))&&void 0!==e?e:"",[p,v]=(0,s.useState)(!1),[f,g]=(0,s.useState)(),b=async()=>{v(!0);let[,e]=await (0,ec.Vx)((0,ec.$i)(i));m(null!=e?e:[]),v(!1)},y=e=>{var l;let t=null===(l=e[e.length-1])||void 0===l?void 0:l.context;if(t)try{let e=JSON.parse(t);g((null==e?void 0:e.template_name)==="report"?null==e?void 0:e.charts:void 0)}catch(e){g(void 0)}};(0,n.Z)(async()=>{let e=(0,ev.a_)();e&&e.id===i||await b()},[h,i]),(0,s.useEffect)(()=>{var e,l;if(!u.length)return;let t=null===(e=null===(l=u.filter(e=>"view"===e.role))||void 0===l?void 0:l.slice(-1))||void 0===e?void 0:e[0];(null==t?void 0:t.model_name)&&d(t.model_name),y(u)},[u.length]),(0,s.useEffect)(()=>()=>{m([])},[]);let _=(0,s.useCallback)((e,l)=>new Promise(a=>{let s=[...u,{role:"human",context:e,model_name:c,order:0,time_stamp:0},{role:"view",context:"",model_name:c,order:0,time_stamp:0}],n=s.length-1;m([...s]),x({data:{...l,chat_mode:t||"chat_normal",model_name:c,user_input:e},chatId:i,onMessage:e=>{s[n].context=e,m([...s])},onDone:()=>{y(s),a()},onClose:()=>{y(s),a()},onError:e=>{s[n].context=e,m([...s]),a()}})}),[u,x,c]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ey.Z,{visible:p}),(0,a.jsx)(eb.Z,{refreshHistory:b,modelChange:e=>{d(e)}}),(0,a.jsxs)("div",{className:"px-4 flex flex-1 flex-wrap overflow-hidden relative",children:[!!(null==f?void 0:f.length)&&(0,a.jsx)("div",{className:"w-full xl:w-3/4 h-3/5 xl:pr-4 xl:h-full overflow-y-auto",children:(0,a.jsx)(E.ZP,{chartsData:f})}),!(null==f?void 0:f.length)&&"chat_dashboard"===t&&(0,a.jsx)(em.Z,{image:"/empty.png",imageStyle:{width:320,height:320,margin:"0 auto",maxWidth:"100%",maxHeight:"100%"},className:"w-full xl:w-3/4 h-3/5 xl:h-full pt-0 md:pt-10"}),(0,a.jsx)("div",{className:j()("flex flex-1 flex-col overflow-hidden",{"px-0 xl:pl-4 h-2/5 xl:h-full border-t xl:border-t-0 xl:border-l":"chat_dashboard"===t,"h-full lg:px-8":"chat_dashboard"!==t}),children:(0,a.jsx)(ej,{messages:u,onSubmit:_})})]})]})}},20766:function(e,l,t){t.d(l,{Z:function(){return D}});var a=t(85893),s=t(27496),n=t(59566),r=t(71577),o=t(67294),i=t(2487),c=t(83062),d=t(2453),u=t(46735),m=t(74627),x=t(39479),h=t(51009),p=t(58299),v=t(577),f=t(30119),g=t(67421);let j=e=>{let{data:l,loading:t,submit:s,close:n}=e,{t:r}=(0,g.$G)(),o=e=>()=>{s(e),n()};return(0,a.jsx)("div",{style:{maxHeight:400,overflow:"auto"},children:(0,a.jsx)(i.Z,{dataSource:null==l?void 0:l.data,loading:t,rowKey:e=>e.prompt_name,renderItem:e=>(0,a.jsx)(i.Z.Item,{onClick:o(e.content),children:(0,a.jsx)(c.Z,{title:e.content,children:(0,a.jsx)(i.Z.Item.Meta,{style:{cursor:"copy"},title:e.prompt_name,description:r("Prompt_Info_Scene")+":".concat(e.chat_scene,",")+r("Prompt_Info_Sub_Scene")+":".concat(e.sub_chat_scene)})})},e.prompt_name)})})};var b=e=>{let{submit:l}=e,{t}=(0,g.$G)(),[s,n]=(0,o.useState)(!1),[r,i]=(0,o.useState)("common"),{data:b,loading:y}=(0,v.Z)(()=>(0,f.PR)("/prompt/list",{prompt_type:r}),{refreshDeps:[r],onError:e=>{d.ZP.error(null==e?void 0:e.message)}});return(0,a.jsx)(u.ZP,{theme:{components:{Popover:{minWidth:250}}},children:(0,a.jsx)(m.Z,{title:(0,a.jsx)(x.Z.Item,{label:"Prompt "+t("Type"),children:(0,a.jsx)(h.default,{style:{width:150},value:r,onChange:e=>{i(e)},options:[{label:t("Public")+" Prompts",value:"common"},{label:t("Private")+" Prompts",value:"private"}]})}),content:(0,a.jsx)(j,{data:b,loading:y,submit:l,close:()=>{n(!1)}}),placement:"topRight",trigger:"click",open:s,onOpenChange:e=>{n(e)},children:(0,a.jsx)(c.Z,{title:t("Click_Select")+" Prompt",children:(0,a.jsx)(p.Z,{className:"bottom-[30%]"})})})})},y=t(41468),w=t(50489),_=t(80573),Z=t(5392),N=t(84553);function k(e){let{dbParam:l,setDocId:t}=(0,o.useContext)(y.p),{onUploadFinish:s,handleFinish:n}=e,i=(0,_.Z)(),[c,d]=(0,o.useState)(!1),u=async(e,l)=>{await (0,w.Vx)((0,w.Hx)(e,{doc_ids:[l]}))},m=async e=>{d(!0);let a=new FormData;a.append("doc_name",e.file.name),a.append("doc_file",e.file),a.append("doc_type","DOCUMENT");let r=await (0,w.Vx)((0,w.iG)(l||"default",a));if(!r[1]){d(!1);return}t(r[1]),s(),await u(l||"default",null==r?void 0:r[1]),d(!1),null==n||n(!0),await i(r[1]),null==n||n(!1)};return(0,a.jsx)(N.default,{customRequest:m,showUploadList:!1,maxCount:1,multiple:!1,className:"absolute z-10 top-2 left-2",accept:".pdf,.ppt,.pptx,.xls,.xlsx,.doc,.docx,.txt,.md",children:(0,a.jsx)(r.ZP,{loading:c,size:"small",shape:"circle",icon:(0,a.jsx)(Z.Z,{})})})}var C=t(11163),S=t(82579);function P(){return(0,a.jsx)("svg",{className:"mr-1",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"6058",width:"1.5em",height:"1.5em",children:(0,a.jsx)("path",{d:"M688 312c0 4.4-3.6 8-8 8H296c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8h384c4.4 0 8 3.6 8 8v48z m-392 88h184c4.4 0 8 3.6 8 8v48c0 4.4-3.6 8-8 8H296c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8z m376 116c119.3 0 216 96.7 216 216s-96.7 216-216 216-216-96.7-216-216 96.7-216 216-216z m107.5 323.5C808.2 810.8 824 772.6 824 732s-15.8-78.8-44.5-107.5S712.6 580 672 580s-78.8 15.8-107.5 44.5S520 691.4 520 732s15.8 78.8 44.5 107.5S631.4 884 672 884s78.8-15.8 107.5-44.5zM440 852c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H168c-17.7 0-32-14.3-32-32V108c0-17.7 14.3-32 32-32h640c17.7 0 32 14.3 32 32v384c0 4.4-3.6 8-8 8h-56c-4.4 0-8-3.6-8-8V148H208v704h232z m232-76.06l-20.56 28.43c-1.5 2.1-3.9 3.3-6.5 3.3h-44.3c-6.5 0-10.3-7.4-6.4-12.7l45.75-63.3-45.75-63.3c-3.9-5.3-0.1-12.7 6.4-12.7h44.3c2.6 0 5 1.2 6.5 3.3L672 687.4l20.56-28.43c1.5-2.1 3.9-3.3 6.5-3.3h44.3c6.5 0 10.3 7.4 6.4 12.7l-45.75 63.3 45.75 63.3c3.9 5.3 0.1 12.7-6.4 12.7h-44.3c-2.6 0-5-1.2-6.5-3.3L672 775.94z",fill:"#d81e06","p-id":"6059"})})}function R(e){let{document:l}=e;switch(l.status){case"RUNNING":return(0,a.jsx)(S.Rp,{});case"FINISHED":default:return(0,a.jsx)(S.s2,{});case"FAILED":return(0,a.jsx)(P,{})}}function E(e){let{documents:l,dbParam:t}=e,s=(0,C.useRouter)(),n=e=>{s.push("/knowledge/chunk/?spaceName=".concat(t,"&id=").concat(e))};return(null==l?void 0:l.length)?(0,a.jsx)("div",{className:"absolute flex overflow-scroll h-12 top-[-35px] w-full z-10",children:l.map(e=>{let l;switch(e.status){case"RUNNING":l="#2db7f5";break;case"FINISHED":default:l="#87d068";break;case"FAILED":l="#f50"}return(0,a.jsx)(c.Z,{title:e.result,children:(0,a.jsxs)(r.ZP,{style:{color:l},onClick:()=>{n(e.id)},className:"shrink flex items-center mr-3",children:[(0,a.jsx)(R,{document:e}),e.doc_name]})},e.id)})}):null}var D=function(e){let{children:l,loading:t,onSubmit:i,handleFinish:c,...d}=e,{dbParam:u,scene:m}=(0,o.useContext)(y.p),[x,h]=(0,o.useState)(""),p=(0,o.useMemo)(()=>"chat_knowledge"===m,[m]),[v,f]=(0,o.useState)([]),g=(0,o.useRef)(0);async function j(){if(!u)return null;let[e,l]=await (0,w.Vx)((0,w._Q)(u,{page:1,page_size:g.current}));f(null==l?void 0:l.data)}return(0,o.useEffect)(()=>{p&&j()},[u]),(0,a.jsxs)("div",{className:"flex-1 relative",children:[(0,a.jsx)(E,{documents:v,dbParam:u}),p&&(0,a.jsx)(k,{handleFinish:c,onUploadFinish:()=>{g.current+=1,j()},className:"absolute z-10 top-2 left-2"}),(0,a.jsx)(n.default.TextArea,{className:"flex-1 ".concat(p?"pl-10":""," pr-10"),size:"large",value:x,autoSize:{minRows:1,maxRows:4},...d,onPressEnter:e=>{if(x.trim()&&13===e.keyCode){if(e.shiftKey){h(e=>e+"\n");return}i(x),setTimeout(()=>{h("")},0)}},onChange:e=>{if("number"==typeof d.maxLength){h(e.target.value.substring(0,d.maxLength));return}h(e.target.value)}}),(0,a.jsx)(r.ZP,{className:"ml-2 flex items-center justify-center absolute right-2 bottom-0",size:"large",type:"text",loading:t,icon:(0,a.jsx)(s.Z,{}),onClick:()=>{i(x)}}),(0,a.jsx)(b,{submit:e=>{h(x+e)}}),l]})}},45247:function(e,l,t){var a=t(85893),s=t(50888);l.Z=function(e){let{visible:l}=e;return l?(0,a.jsx)("div",{className:"absolute w-full h-full top-0 left-0 flex justify-center items-center z-10 bg-white dark:bg-black bg-opacity-50 dark:bg-opacity-50 backdrop-blur-sm text-3xl animate-fade animate-duration-200",children:(0,a.jsx)(s.Z,{})}):null}},43446:function(e,l,t){var a=t(1375),s=t(2453),n=t(67294),r=t(58989),o=t(83454);l.Z=e=>{let{queryAgentURL:l="/api/v1/chat/completions"}=e,t=(0,n.useMemo)(()=>new AbortController,[]),i=(0,n.useCallback)(async e=>{let{data:n,chatId:i,onMessage:c,onClose:d,onDone:u,onError:m}=e;if(!(null==n?void 0:n.user_input)&&!(null==n?void 0:n.doc_id)){s.ZP.warning(r.Z.t("NoContextTip"));return}let x={...n,conv_uid:i};if(!x.conv_uid){s.ZP.error("conv_uid 不存在,请刷新后重试");return}try{var h;await (0,a.L)("".concat(null!==(h=o.env.API_BASE_URL)&&void 0!==h?h:"").concat(l),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(x),signal:t.signal,openWhenHidden:!0,async onopen(e){if(e.ok&&e.headers.get("content-type")===a.a)return},onclose(){t.abort(),null==d||d()},onerror(e){throw Error(e)},onmessage:e=>{var l;let t=null===(l=e.data)||void 0===l?void 0:l.replaceAll("\\n","\n");"[DONE]"===t?null==u||u():(null==t?void 0:t.startsWith("[ERROR]"))?null==m||m(null==t?void 0:t.replace("[ERROR]","")):null==c||c(t)}})}catch(e){t.abort(),null==m||m("Sorry, We meet some error, please try agin later.",e)}},[l]);return(0,n.useEffect)(()=>()=>{t.abort()},[]),i}},80573:function(e,l,t){var a=t(41468),s=t(67294),n=t(43446),r=t(50489);l.Z=()=>{let{history:e,setHistory:l,chatId:t,model:o,docId:i}=(0,s.useContext)(a.p),c=(0,n.Z)({queryAgentURL:"/knowledge/document/summary"}),d=(0,s.useCallback)(async e=>{let[,a]=await (0,r.Vx)((0,r.$i)(t)),s=[...a,{role:"human",context:"",model_name:o,order:0,time_stamp:0},{role:"view",context:"",model_name:o,order:0,time_stamp:0,retry:!0}],n=s.length-1;l([...s]),await c({data:{doc_id:e||i,model_name:o},chatId:t,onMessage:e=>{s[n].context=e,l([...s])}})},[e,o,i,t]);return d}}}]);
\ No newline at end of file
diff --git a/pilot/server/static/_next/static/chunks/0.37a9882ddd3822ef.js b/pilot/server/static/_next/static/chunks/0.37a9882ddd3822ef.js
deleted file mode 100644
index 62e21fa7b..000000000
--- a/pilot/server/static/_next/static/chunks/0.37a9882ddd3822ef.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[0],{15506:function(e,l,t){t.r(l),t.d(l,{default:function(){return ey}});var a=t(85893),s=t(67294),n=t(2093),r=t(43446),o=t(39332),i=t(99513),c=t(24019),d=t(50888),u=t(97937),m=t(63606),x=t(50228),h=t(87547),p=t(89035),v=t(33035),g=t(12767),f=t(94184),j=t.n(f),b=t(66309),y=t(81799),w=t(41468),_=t(29158),N=t(98165),Z=t(14079),k=t(38426),C=t(61607),S=t(44442),P=t(36782),R=t(13135),E=t(71577),D=t(2453),I=t(57132),O=t(79166),z=t(93179),L=t(20640),M=t.n(L);function A(e){let{code:l,language:t}=e;return(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(E.ZP,{className:"absolute right-3 top-2 text-gray-300 hover:!text-gray-200 bg-gray-700",type:"text",icon:(0,a.jsx)(I.Z,{}),onClick:()=>{let e=M()(l);D.ZP[e?"success":"error"](e?"Copy success":"Copy failed")}}),(0,a.jsx)(z.Z,{language:t,style:O.Z,children:l})]})}let F=["custom-view","chart-view","references"],H={code(e){var l;let{inline:t,node:s,className:n,children:r,style:o,...i}=e,{context:c,matchValues:d}=function(e){let l=F.reduce((l,t)=>{let a=RegExp("<".concat(t,"[^>]*/?>"),"gi");return e=e.replace(a,e=>(l.push(e),"")),l},[]);return{context:e,matchValues:l}}(Array.isArray(r)?r.join("\n"):r),u=/language-(\w+)/.exec(n||"");return(0,a.jsxs)(a.Fragment,{children:[!t&&u?(0,a.jsx)(A,{code:c,language:null!==(l=null==u?void 0:u[1])&&void 0!==l?l:"javascript"}):(0,a.jsx)("code",{...i,style:o,className:"px-[6px] py-[2px] rounded bg-gray-700 text-gray-100 dark:bg-gray-100 dark:text-gray-800 text-sm",children:r}),(0,a.jsx)(v.D,{components:H,rehypePlugins:[g.Z],children:d.join("\n")})]})},ul(e){let{children:l}=e;return(0,a.jsx)("ul",{className:"py-1",children:l})},ol(e){let{children:l}=e;return(0,a.jsx)("ol",{className:"py-1",children:l})},li(e){let{children:l,ordered:t}=e;return(0,a.jsx)("li",{className:"text-sm leading-7 ml-5 pl-2 text-gray-600 dark:text-gray-300 ".concat(t?"list-decimal":"list-disc"),children:l})},table(e){let{children:l}=e;return(0,a.jsx)("table",{className:"my-2 rounded-tl-md rounded-tr-md max-w-full bg-white dark:bg-gray-900 text-sm rounded-lg overflow-hidden",children:l})},thead(e){let{children:l}=e;return(0,a.jsx)("thead",{className:"bg-[#fafafa] dark:bg-black font-semibold",children:l})},th(e){let{children:l}=e;return(0,a.jsx)("th",{className:"!text-left p-4",children:l})},td(e){let{children:l}=e;return(0,a.jsx)("td",{className:"p-4 border-t border-[#f0f0f0] dark:border-gray-700",children:l})},h1(e){let{children:l}=e;return(0,a.jsx)("h3",{className:"text-2xl font-bold my-4 border-b border-slate-300 pb-4",children:l})},h2(e){let{children:l}=e;return(0,a.jsx)("h3",{className:"text-xl font-bold my-3",children:l})},h3(e){let{children:l}=e;return(0,a.jsx)("h3",{className:"text-lg font-semibold my-2",children:l})},h4(e){let{children:l}=e;return(0,a.jsx)("h3",{className:"text-base font-semibold my-1",children:l})},a(e){let{children:l,href:t}=e;return(0,a.jsxs)("div",{className:"inline-block text-blue-600 dark:text-blue-400",children:[(0,a.jsx)(_.Z,{className:"mr-1"}),(0,a.jsx)("a",{href:t,target:"_blank",children:l})]})},img(e){let{src:l,alt:t}=e;return(0,a.jsx)("div",{children:(0,a.jsx)(k.Z,{className:"min-h-[1rem] max-w-full max-h-full border rounded",src:l,alt:t,placeholder:(0,a.jsx)(b.Z,{icon:(0,a.jsx)(N.Z,{spin:!0}),color:"processing",children:"Image Loading..."}),fallback:"/images/fallback.png"})})},blockquote(e){let{children:l}=e;return(0,a.jsx)("blockquote",{className:"py-4 px-6 border-l-4 border-blue-600 rounded bg-white my-2 text-gray-500 dark:bg-slate-800 dark:text-gray-200 dark:border-white shadow-sm",children:l})},references(e){let l,{children:t}=e;try{l=JSON.parse(t)}catch(e){return console.log(e),(0,a.jsx)("p",{className:"text-sm",children:"Render Reference Error!"})}let s=null==l?void 0:l.references;return!s||(null==s?void 0:s.length)<1?null:(0,a.jsxs)("div",{className:"border-t-[1px] border-gray-300 mt-3 py-2",children:[(0,a.jsxs)("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-2",children:[(0,a.jsx)(_.Z,{className:"mr-2"}),(0,a.jsx)("span",{className:"font-semibold",children:l.title})]}),s.map((e,l)=>{var t;return(0,a.jsxs)("p",{className:"text-sm font-normal block ml-2 h-6 leading-6 overflow-hidden",children:[(0,a.jsxs)("span",{className:"inline-block w-6",children:["[",l+1,"]"]}),(0,a.jsx)("span",{className:"mr-4 text-blue-400",children:e.name}),null==e?void 0:null===(t=e.pages)||void 0===t?void 0:t.map((l,t)=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{children:l},"file_page_".concat(t)),t<(null==e?void 0:e.pages.length)-1&&(0,a.jsx)("span",{children:","},"file_page__".concat(t))]}))]},"file_".concat(l))})]})},summary(e){let{children:l}=e;return(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"mb-2",children:[(0,a.jsx)(Z.Z,{className:"mr-2"}),(0,a.jsx)("span",{className:"font-semibold",children:"Document Summary"})]}),(0,a.jsx)("div",{children:l})]})},"chart-view":function(e){var l,t,s;let n,{content:r,children:o}=e;try{n=JSON.parse(r)}catch(e){console.log(e,r),n={type:"response_table",sql:"",data:[]}}let i=(null==n?void 0:null===(l=n.data)||void 0===l?void 0:l[0])?null===(t=Object.keys(null==n?void 0:null===(s=n.data)||void 0===s?void 0:s[0]))||void 0===t?void 0:t.map(e=>({title:e,dataIndex:e,key:e})):[],c={key:"chart",label:"Chart",children:(0,a.jsx)(R._z,{data:null==n?void 0:n.data,chartType:(0,R.aG)(null==n?void 0:n.type)})},d={key:"sql",label:"SQL",children:(0,a.jsx)(A,{code:(0,P.WU)(null==n?void 0:n.sql,{language:"mysql"}),language:"sql"})},u={key:"data",label:"Data",children:(0,a.jsx)(C.Z,{dataSource:null==n?void 0:n.data,columns:i})},m=(null==n?void 0:n.type)==="response_table"?[u,d]:[c,d,u];return(0,a.jsxs)("div",{children:[(0,a.jsx)(S.Z,{defaultActiveKey:(null==n?void 0:n.type)==="response_table"?"data":"chart",items:m,size:"small"}),o]})},references(e){let l,{children:t}=e;try{l=JSON.parse(t)}catch(e){return console.log(e),(0,a.jsx)("p",{className:"text-sm",children:"Render Reference Error!"})}let s=null==l?void 0:l.references;return!s||(null==s?void 0:s.length)<1?null:(0,a.jsxs)("div",{className:"border-t-[1px] border-gray-300 mt-3 py-2",children:[(0,a.jsxs)("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-2",children:[(0,a.jsx)(_.Z,{className:"mr-2"}),(0,a.jsx)("span",{className:"font-semibold",children:l.title})]}),s.map((e,l)=>{var t;return(0,a.jsxs)("p",{className:"text-sm font-normal block ml-2 h-6 leading-6 overflow-hidden",children:[(0,a.jsxs)("span",{className:"inline-block w-6",children:["[",l+1,"]"]}),(0,a.jsx)("span",{className:"mr-4 text-blue-400",children:e.name}),null==e?void 0:null===(t=e.pages)||void 0===t?void 0:t.map((l,t)=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{children:l},"file_page_".concat(t)),t<(null==e?void 0:e.pages.length)-1&&(0,a.jsx)("span",{children:","},"file_page__".concat(t))]}))]},"file_".concat(l))})]})}},q={todo:{bgClass:"bg-gray-500",icon:(0,a.jsx)(c.Z,{className:"ml-2"})},runing:{bgClass:"bg-blue-500",icon:(0,a.jsx)(d.Z,{className:"ml-2"})},failed:{bgClass:"bg-red-500",icon:(0,a.jsx)(u.Z,{className:"ml-2"})},completed:{bgClass:"bg-green-500",icon:(0,a.jsx)(m.Z,{className:"ml-2"})}};function V(e){return e.replaceAll("\\n","\n").replace(/]+)>/gi,"").replace(/]+)>/gi," ")}var T=(0,s.memo)(function(e){let{children:l,content:t,isChartChat:n,onLinkClick:r}=e,{scene:o}=(0,s.useContext)(w.p),{context:i,model_name:c,role:d}=t,u="view"===d,{relations:m,value:f,cachePlguinContext:_}=(0,s.useMemo)(()=>{if("string"!=typeof i)return{relations:[],value:"",cachePlguinContext:[]};let[e,l]=i.split(" relations:"),t=l?l.split(","):[],a=[],s=0,n=e.replace(/]*>[^<]*<\/dbgpt-view>/gi,e=>{try{var l;let t=e.replaceAll("\n","\\n").replace(/<[^>]*>|<\/[^>]*>/gm,""),n=JSON.parse(t),r="".concat(s," ");return a.push({...n,result:V(null!==(l=n.result)&&void 0!==l?l:"")}),s++,r}catch(l){return console.log(l.message,l),e}});return{relations:t,cachePlguinContext:a,value:n}},[i]),N=(0,s.useMemo)(()=>({"custom-view"(e){var l;let{children:t}=e,s=+t.toString();if(!_[s])return t;let{name:n,status:r,err_msg:o,result:i}=_[s],{bgClass:c,icon:d}=null!==(l=q[r])&&void 0!==l?l:{};return(0,a.jsxs)("div",{className:"bg-white dark:bg-[#212121] rounded-lg overflow-hidden my-2 flex flex-col lg:max-w-[80%]",children:[(0,a.jsxs)("div",{className:j()("flex px-4 md:px-6 py-2 items-center text-white text-sm",c),children:[n,d]}),i?(0,a.jsx)("div",{className:"px-4 md:px-6 py-4 text-sm",children:(0,a.jsx)(v.D,{components:H,rehypePlugins:[g.Z],children:null!=i?i:""})}):(0,a.jsx)("div",{className:"px-4 md:px-6 py-4 text-sm",children:o})]})}}),[i,_]);return u||i?(0,a.jsxs)("div",{className:j()("relative flex flex-wrap w-full px-2 sm:px-4 py-2 sm:py-4 rounded-xl break-words",{"bg-slate-100 dark:bg-[#353539]":u,"lg:w-full xl:w-full pl-0":["chat_with_db_execute","chat_dashboard"].includes(o)}),children:[(0,a.jsx)("div",{className:"mr-2 flex flex-shrink-0 items-center justify-center h-7 w-7 rounded-full text-lg sm:mr-4",children:u?(0,y.A)(c)||(0,a.jsx)(x.Z,{}):(0,a.jsx)(h.Z,{})}),(0,a.jsxs)("div",{className:"flex-1 overflow-hidden items-center text-md leading-8",children:[!u&&"string"==typeof i&&i,u&&n&&"object"==typeof i&&(0,a.jsxs)("div",{children:["[".concat(i.template_name,"]: "),(0,a.jsxs)("span",{className:"text-[#1677ff] cursor-pointer",onClick:r,children:[(0,a.jsx)(p.Z,{className:"mr-1"}),i.template_introduce||"More Details"]})]}),u&&"string"==typeof i&&(0,a.jsx)(v.D,{components:{...H,...N},rehypePlugins:[g.Z],children:V(f)}),!!(null==m?void 0:m.length)&&(0,a.jsx)("div",{className:"flex flex-wrap mt-2",children:null==m?void 0:m.map((e,l)=>(0,a.jsx)(b.Z,{color:"#108ee9",children:e},e+l))})]}),l]}):(0,a.jsx)("div",{className:"h-12"})}),G=t(59301),J=t(41132),U=t(74312),W=t(3414),$=t(72868),B=t(59562),Q=t(14553),K=t(25359),X=t(7203),Y=t(48665),ee=t(26047),el=t(99056),et=t(57814),ea=t(63955),es=t(33028),en=t(40911),er=t(66478),eo=t(83062),ei=t(50489),ec=t(67421),ed=e=>{var l;let{conv_index:t,question:n,knowledge_space:r,select_param:o}=e,{t:i}=(0,ec.$G)(),{chatId:c}=(0,s.useContext)(w.p),[d,u]=(0,s.useState)(""),[m,x]=(0,s.useState)(4),[h,p]=(0,s.useState)(""),v=(0,s.useRef)(null),[g,f]=D.ZP.useMessage(),j=(0,s.useCallback)((e,l)=>{l?(0,ei.Vx)((0,ei.Eb)(c,t)).then(e=>{var l,t,a,s;let n=null!==(l=e[1])&&void 0!==l?l:{};u(null!==(t=n.ques_type)&&void 0!==t?t:""),x(parseInt(null!==(a=n.score)&&void 0!==a?a:"4")),p(null!==(s=n.messages)&&void 0!==s?s:"")}).catch(e=>{console.log(e)}):(u(""),x(4),p(""))},[c,t]),b=(0,U.Z)(W.Z)(e=>{let{theme:l}=e;return{backgroundColor:"dark"===l.palette.mode?"#FBFCFD":"#0E0E10",...l.typography["body-sm"],padding:l.spacing(1),display:"flex",alignItems:"center",justifyContent:"center",borderRadius:4,width:"100%",height:"100%"}});return(0,a.jsxs)($.L,{onOpenChange:j,children:[f,(0,a.jsx)(eo.Z,{title:i("Rating"),children:(0,a.jsx)(B.Z,{slots:{root:Q.ZP},slotProps:{root:{variant:"plain",color:"primary"}},sx:{borderRadius:40},children:(0,a.jsx)(G.Z,{})})}),(0,a.jsxs)(K.Z,{children:[(0,a.jsx)(X.Z,{disabled:!0,sx:{minHeight:0}}),(0,a.jsx)(Y.Z,{sx:{width:"100%",maxWidth:350,display:"grid",gap:3,padding:1},children:(0,a.jsx)("form",{onSubmit:e=>{e.preventDefault();let l={conv_uid:c,conv_index:t,question:n,knowledge_space:r,score:m,ques_type:d,messages:h};console.log(l),(0,ei.Vx)((0,ei.VC)({data:l})).then(e=>{g.open({type:"success",content:"save success"})}).catch(e=>{g.open({type:"error",content:"save error"})})},children:(0,a.jsxs)(ee.Z,{container:!0,spacing:.5,columns:13,sx:{flexGrow:1},children:[(0,a.jsx)(ee.Z,{xs:3,children:(0,a.jsx)(b,{children:i("Q_A_Category")})}),(0,a.jsx)(ee.Z,{xs:10,children:(0,a.jsx)(el.Z,{action:v,value:d,placeholder:"Choose one…",onChange:(e,l)=>u(null!=l?l:""),...d&&{endDecorator:(0,a.jsx)(Q.ZP,{size:"sm",variant:"plain",color:"neutral",onMouseDown:e=>{e.stopPropagation()},onClick:()=>{var e;u(""),null===(e=v.current)||void 0===e||e.focusVisible()},children:(0,a.jsx)(J.Z,{})}),indicator:null},sx:{width:"100%"},children:o&&(null===(l=Object.keys(o))||void 0===l?void 0:l.map(e=>(0,a.jsx)(et.Z,{value:e,children:o[e]},e)))})}),(0,a.jsx)(ee.Z,{xs:3,children:(0,a.jsx)(b,{children:(0,a.jsx)(eo.Z,{title:(0,a.jsx)(Y.Z,{children:(0,a.jsx)("div",{children:i("feed_back_desc")})}),variant:"solid",placement:"left",children:i("Q_A_Rating")})})}),(0,a.jsx)(ee.Z,{xs:10,sx:{pl:0,ml:0},children:(0,a.jsx)(ea.Z,{"aria-label":"Custom",step:1,min:0,max:5,valueLabelFormat:function(e){return({0:i("Lowest"),1:i("Missed"),2:i("Lost"),3:i("Incorrect"),4:i("Verbose"),5:i("Best")})[e]},valueLabelDisplay:"on",marks:[{value:0,label:"0"},{value:1,label:"1"},{value:2,label:"2"},{value:3,label:"3"},{value:4,label:"4"},{value:5,label:"5"}],sx:{width:"90%",pt:3,m:2,ml:1},onChange:e=>{var l;return x(null===(l=e.target)||void 0===l?void 0:l.value)},value:m})}),(0,a.jsx)(ee.Z,{xs:13,children:(0,a.jsx)(es.Z,{placeholder:i("Please_input_the_text"),value:h,onChange:e=>p(e.target.value),minRows:2,maxRows:4,endDecorator:(0,a.jsx)(en.ZP,{level:"body-xs",sx:{ml:"auto"},children:i("input_count")+h.length+i("input_unit")}),sx:{width:"100%",fontSize:14}})}),(0,a.jsx)(ee.Z,{xs:13,children:(0,a.jsx)(er.Z,{type:"submit",variant:"outlined",sx:{width:"100%",height:"100%"},children:i("submit")})})]})})})]})]})},eu=t(32983),em=t(12069),ex=t(96486),eh=t(20766),ep=t(98399),ev=t(87740),eg=t(80573),ef=e=>{var l;let{messages:t,onSubmit:r}=e,{dbParam:c,currentDialogue:d,scene:u,model:m,refreshDialogList:x,chatId:h,agentList:p,docId:v}=(0,s.useContext)(w.p),{t:g}=(0,ec.$G)(),f=(0,o.useSearchParams)(),b=null!==(l=f&&f.get("spaceNameOriginal"))&&void 0!==l?l:"",[_,N]=(0,s.useState)(!1),[Z,k]=(0,s.useState)(!1),[C,S]=(0,s.useState)(t),[P,R]=(0,s.useState)(""),[E,O]=(0,s.useState)(),z=(0,s.useRef)(null),L=(0,s.useMemo)(()=>"chat_dashboard"===u,[u]),A=(0,eg.Z)(),F=(0,s.useMemo)(()=>{switch(u){case"chat_agent":return p.join(",");case"chat_excel":return null==d?void 0:d.select_param;default:return b||c}},[u,p,d,c,b]),H=async e=>{if(!_&&e.trim())try{N(!0),await r(e,{select_param:null!=F?F:""})}finally{N(!1)}},q=e=>{try{return JSON.parse(e)}catch(l){return e}},[V,G]=D.ZP.useMessage(),J=async e=>{let l=null==e?void 0:e.replace(/\trelations:.*/g,""),t=M()(l);t?l?V.open({type:"success",content:g("Copy_success")}):V.open({type:"warning",content:g("Copy_nothing")}):V.open({type:"error",content:g("Copry_error")})},U=async()=>{!_&&v&&(N(!0),await A(v),N(!1))};return(0,n.Z)(async()=>{let e=(0,ep.a_)();e&&e.id===h&&(await H(e.message),x(),localStorage.removeItem(ep.rU))},[h]),(0,s.useEffect)(()=>{let e=t;L&&(e=(0,ex.cloneDeep)(t).map(e=>((null==e?void 0:e.role)==="view"&&"string"==typeof(null==e?void 0:e.context)&&(e.context=q(null==e?void 0:e.context)),e))),S(e.filter(e=>["view","human"].includes(e.role)))},[L,t]),(0,s.useEffect)(()=>{(0,ei.Vx)((0,ei.Lu)()).then(e=>{var l;O(null!==(l=e[1])&&void 0!==l?l:{})}).catch(e=>{console.log(e)})},[]),(0,s.useEffect)(()=>{setTimeout(()=>{var e;null===(e=z.current)||void 0===e||e.scrollTo(0,z.current.scrollHeight)},50)},[t]),(0,a.jsxs)(a.Fragment,{children:[G,(0,a.jsx)("div",{ref:z,className:"flex flex-1 overflow-y-auto pb-8 w-full flex-col",children:(0,a.jsx)("div",{className:"flex items-center flex-1 flex-col text-sm leading-6 text-slate-900 dark:text-slate-300 sm:text-base sm:leading-7",children:C.length?C.map((e,l)=>{var t;return(0,a.jsx)(T,{content:e,isChartChat:L,onLinkClick:()=>{k(!0),R(JSON.stringify(null==e?void 0:e.context,null,2))},children:"view"===e.role&&(0,a.jsxs)("div",{className:"flex w-full pt-2 md:pt-4 border-t border-gray-200 mt-2 md:mt-4 pl-2",children:["chat_knowledge"===u&&e.retry?(0,a.jsxs)(er.Z,{onClick:U,slots:{root:Q.ZP},slotProps:{root:{variant:"plain",color:"primary"}},children:[(0,a.jsx)(ev.Z,{}),"\xa0",(0,a.jsx)("span",{className:"text-sm",children:g("Retry")})]}):null,(0,a.jsxs)("div",{className:"flex w-full flex-row-reverse",children:[(0,a.jsx)(ed,{select_param:E,conv_index:Math.ceil((l+1)/2),question:null===(t=null==C?void 0:C.filter(l=>(null==l?void 0:l.role)==="human"&&(null==l?void 0:l.order)===e.order)[0])||void 0===t?void 0:t.context,knowledge_space:b||c||""}),(0,a.jsx)(eo.Z,{title:g("Copy"),children:(0,a.jsx)(er.Z,{onClick:()=>J(null==e?void 0:e.context),slots:{root:Q.ZP},slotProps:{root:{variant:"plain",color:"primary"}},sx:{borderRadius:40},children:(0,a.jsx)(I.Z,{})})})]})]})},l)}):(0,a.jsx)(eu.Z,{image:"/empty.png",imageStyle:{width:320,height:320,margin:"0 auto",maxWidth:"100%",maxHeight:"100%"},className:"flex items-center justify-center flex-col h-full w-full",description:"Start a conversation"})})}),(0,a.jsx)("div",{className:j()("relative after:absolute after:-top-8 after:h-8 after:w-full after:bg-gradient-to-t after:from-white after:to-transparent dark:after:from-[#212121]",{"cursor-not-allowed":"chat_excel"===u&&!(null==d?void 0:d.select_param)}),children:(0,a.jsxs)("div",{className:"flex flex-wrap w-full py-2 sm:pt-6 sm:pb-10 items-center",children:[m&&(0,a.jsx)("div",{className:"mr-2 flex",children:(0,y.A)(m)}),(0,a.jsx)(eh.Z,{loading:_,onSubmit:H,handleFinish:N})]})}),(0,a.jsx)(em.default,{title:"JSON Editor",open:Z,width:"60%",cancelButtonProps:{hidden:!0},onOk:()=>{k(!1)},onCancel:()=>{k(!1)},children:(0,a.jsx)(i.Z,{className:"w-full h-[500px]",language:"json",value:P})})]})},ej=t(34625),eb=t(45247),ey=()=>{var e;let l=(0,o.useSearchParams)(),{scene:t,chatId:i,model:c,setModel:d,history:u,setHistory:m}=(0,s.useContext)(w.p),x=(0,r.Z)({}),h=null!==(e=l&&l.get("initMessage"))&&void 0!==e?e:"",[p,v]=(0,s.useState)(!1),[g,f]=(0,s.useState)(),b=async()=>{v(!0);let[,e]=await (0,ei.Vx)((0,ei.$i)(i));m(null!=e?e:[]),v(!1)},y=e=>{var l;let t=null===(l=e[e.length-1])||void 0===l?void 0:l.context;if(t)try{let e=JSON.parse(t);f((null==e?void 0:e.template_name)==="report"?null==e?void 0:e.charts:void 0)}catch(e){f(void 0)}};(0,n.Z)(async()=>{let e=(0,ep.a_)();e&&e.id===i||await b()},[h,i]),(0,s.useEffect)(()=>{var e,l;if(!u.length)return;let t=null===(e=null===(l=u.filter(e=>"view"===e.role))||void 0===l?void 0:l.slice(-1))||void 0===e?void 0:e[0];(null==t?void 0:t.model_name)&&d(t.model_name),y(u)},[u.length]),(0,s.useEffect)(()=>()=>{m([])},[]);let _=(0,s.useCallback)((e,l)=>new Promise(a=>{let s=[...u,{role:"human",context:e,model_name:c,order:0,time_stamp:0},{role:"view",context:"",model_name:c,order:0,time_stamp:0}],n=s.length-1;m([...s]),x({data:{...l,chat_mode:t||"chat_normal",model_name:c,user_input:e},chatId:i,onMessage:e=>{s[n].context=e,m([...s])},onDone:()=>{y(s),a()},onClose:()=>{y(s),a()},onError:e=>{s[n].context=e,m([...s]),a()}})}),[u,x,c]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eb.Z,{visible:p}),(0,a.jsx)(ej.Z,{refreshHistory:b,modelChange:e=>{d(e)}}),(0,a.jsxs)("div",{className:"px-4 flex flex-1 flex-wrap overflow-hidden relative",children:[!!(null==g?void 0:g.length)&&(0,a.jsx)("div",{className:"w-full xl:w-3/4 h-3/5 xl:pr-4 xl:h-full overflow-y-auto",children:(0,a.jsx)(R.ZP,{chartsData:g})}),!(null==g?void 0:g.length)&&"chat_dashboard"===t&&(0,a.jsx)(eu.Z,{image:"/empty.png",imageStyle:{width:320,height:320,margin:"0 auto",maxWidth:"100%",maxHeight:"100%"},className:"w-full xl:w-3/4 h-3/5 xl:h-full pt-0 md:pt-10"}),(0,a.jsx)("div",{className:j()("flex flex-1 flex-col overflow-hidden",{"px-0 xl:pl-4 h-2/5 xl:h-full border-t xl:border-t-0 xl:border-l":"chat_dashboard"===t,"h-full lg:px-8":"chat_dashboard"!==t}),children:(0,a.jsx)(ef,{messages:u,onSubmit:_})})]})]})}},20766:function(e,l,t){t.d(l,{Z:function(){return D}});var a=t(85893),s=t(27496),n=t(59566),r=t(71577),o=t(67294),i=t(2487),c=t(83062),d=t(2453),u=t(46735),m=t(74627),x=t(39479),h=t(51009),p=t(58299),v=t(577),g=t(30119),f=t(67421);let j=e=>{let{data:l,loading:t,submit:s,close:n}=e,{t:r}=(0,f.$G)(),o=e=>()=>{s(e),n()};return(0,a.jsx)("div",{style:{maxHeight:400,overflow:"auto"},children:(0,a.jsx)(i.Z,{dataSource:null==l?void 0:l.data,loading:t,rowKey:e=>e.prompt_name,renderItem:e=>(0,a.jsx)(i.Z.Item,{onClick:o(e.content),children:(0,a.jsx)(c.Z,{title:e.content,children:(0,a.jsx)(i.Z.Item.Meta,{style:{cursor:"copy"},title:e.prompt_name,description:r("Prompt_Info_Scene")+":".concat(e.chat_scene,",")+r("Prompt_Info_Sub_Scene")+":".concat(e.sub_chat_scene)})})},e.prompt_name)})})};var b=e=>{let{submit:l}=e,{t}=(0,f.$G)(),[s,n]=(0,o.useState)(!1),[r,i]=(0,o.useState)("common"),{data:b,loading:y}=(0,v.Z)(()=>(0,g.PR)("/prompt/list",{prompt_type:r}),{refreshDeps:[r],onError:e=>{d.ZP.error(null==e?void 0:e.message)}});return(0,a.jsx)(u.ZP,{theme:{components:{Popover:{minWidth:250}}},children:(0,a.jsx)(m.Z,{title:(0,a.jsx)(x.Z.Item,{label:"Prompt "+t("Type"),children:(0,a.jsx)(h.default,{style:{width:150},value:r,onChange:e=>{i(e)},options:[{label:t("Public")+" Prompts",value:"common"},{label:t("Private")+" Prompts",value:"private"}]})}),content:(0,a.jsx)(j,{data:b,loading:y,submit:l,close:()=>{n(!1)}}),placement:"topRight",trigger:"click",open:s,onOpenChange:e=>{n(e)},children:(0,a.jsx)(c.Z,{title:t("Click_Select")+" Prompt",children:(0,a.jsx)(p.Z,{className:"bottom-[30%]"})})})})},y=t(41468),w=t(50489),_=t(80573),N=t(5392),Z=t(84553);function k(e){let{dbParam:l,setDocId:t}=(0,o.useContext)(y.p),{onUploadFinish:s,handleFinish:n}=e,i=(0,_.Z)(),[c,d]=(0,o.useState)(!1),u=async(e,l)=>{await (0,w.Vx)((0,w.Hx)(e,{doc_ids:[l]}))},m=async e=>{d(!0);let a=new FormData;a.append("doc_name",e.file.name),a.append("doc_file",e.file),a.append("doc_type","DOCUMENT");let r=await (0,w.Vx)((0,w.iG)(l||"default",a));if(!r[1]){d(!1);return}t(r[1]),s(),await u(l||"default",null==r?void 0:r[1]),d(!1),null==n||n(!0),await i(r[1]),null==n||n(!1)};return(0,a.jsx)(Z.default,{customRequest:m,showUploadList:!1,maxCount:1,multiple:!1,className:"absolute z-10 top-2 left-2",accept:".pdf,.ppt,.pptx,.xls,.xlsx,.doc,.docx,.txt,.md",children:(0,a.jsx)(r.ZP,{loading:c,size:"small",shape:"circle",icon:(0,a.jsx)(N.Z,{})})})}var C=t(11163),S=t(82579);function P(){return(0,a.jsx)("svg",{className:"mr-1",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"6058",width:"1.5em",height:"1.5em",children:(0,a.jsx)("path",{d:"M688 312c0 4.4-3.6 8-8 8H296c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8h384c4.4 0 8 3.6 8 8v48z m-392 88h184c4.4 0 8 3.6 8 8v48c0 4.4-3.6 8-8 8H296c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8z m376 116c119.3 0 216 96.7 216 216s-96.7 216-216 216-216-96.7-216-216 96.7-216 216-216z m107.5 323.5C808.2 810.8 824 772.6 824 732s-15.8-78.8-44.5-107.5S712.6 580 672 580s-78.8 15.8-107.5 44.5S520 691.4 520 732s15.8 78.8 44.5 107.5S631.4 884 672 884s78.8-15.8 107.5-44.5zM440 852c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H168c-17.7 0-32-14.3-32-32V108c0-17.7 14.3-32 32-32h640c17.7 0 32 14.3 32 32v384c0 4.4-3.6 8-8 8h-56c-4.4 0-8-3.6-8-8V148H208v704h232z m232-76.06l-20.56 28.43c-1.5 2.1-3.9 3.3-6.5 3.3h-44.3c-6.5 0-10.3-7.4-6.4-12.7l45.75-63.3-45.75-63.3c-3.9-5.3-0.1-12.7 6.4-12.7h44.3c2.6 0 5 1.2 6.5 3.3L672 687.4l20.56-28.43c1.5-2.1 3.9-3.3 6.5-3.3h44.3c6.5 0 10.3 7.4 6.4 12.7l-45.75 63.3 45.75 63.3c3.9 5.3 0.1 12.7-6.4 12.7h-44.3c-2.6 0-5-1.2-6.5-3.3L672 775.94z",fill:"#d81e06","p-id":"6059"})})}function R(e){let{document:l}=e;switch(l.status){case"RUNNING":return(0,a.jsx)(S.Rp,{});case"FINISHED":default:return(0,a.jsx)(S.s2,{});case"FAILED":return(0,a.jsx)(P,{})}}function E(e){let{documents:l,dbParam:t}=e,s=(0,C.useRouter)(),n=e=>{s.push("/knowledge/chunk/?spaceName=".concat(t,"&id=").concat(e))};return(null==l?void 0:l.length)?(0,a.jsx)("div",{className:"absolute flex overflow-scroll h-12 top-[-35px] w-full z-10",children:l.map(e=>{let l;switch(e.status){case"RUNNING":l="#2db7f5";break;case"FINISHED":default:l="#87d068";break;case"FAILED":l="#f50"}return(0,a.jsx)(c.Z,{title:e.result,children:(0,a.jsxs)(r.ZP,{style:{color:l},onClick:()=>{n(e.id)},className:"shrink flex items-center mr-3",children:[(0,a.jsx)(R,{document:e}),e.doc_name]})},e.id)})}):null}var D=function(e){let{children:l,loading:t,onSubmit:i,handleFinish:c,...d}=e,{dbParam:u,scene:m}=(0,o.useContext)(y.p),[x,h]=(0,o.useState)(""),p=(0,o.useMemo)(()=>"chat_knowledge"===m,[m]),[v,g]=(0,o.useState)([]),f=(0,o.useRef)(0);async function j(){if(!u)return null;let[e,l]=await (0,w.Vx)((0,w._Q)(u,{page:1,page_size:f.current}));g(null==l?void 0:l.data)}return(0,o.useEffect)(()=>{p&&j()},[u]),(0,a.jsxs)("div",{className:"flex-1 relative",children:[(0,a.jsx)(E,{documents:v,dbParam:u}),p&&(0,a.jsx)(k,{handleFinish:c,onUploadFinish:()=>{f.current+=1,j()},className:"absolute z-10 top-2 left-2"}),(0,a.jsx)(n.default.TextArea,{className:"flex-1 ".concat(p?"pl-10":""," pr-10"),size:"large",value:x,autoSize:{minRows:1,maxRows:4},...d,onPressEnter:e=>{if(x.trim()&&13===e.keyCode){if(e.shiftKey){h(e=>e+"\n");return}i(x),setTimeout(()=>{h("")},0)}},onChange:e=>{if("number"==typeof d.maxLength){h(e.target.value.substring(0,d.maxLength));return}h(e.target.value)}}),(0,a.jsx)(r.ZP,{className:"ml-2 flex items-center justify-center absolute right-2 bottom-0",size:"large",type:"text",loading:t,icon:(0,a.jsx)(s.Z,{}),onClick:()=>{i(x)}}),(0,a.jsx)(b,{submit:e=>{h(x+e)}}),l]})}},45247:function(e,l,t){var a=t(85893),s=t(50888);l.Z=function(e){let{visible:l}=e;return l?(0,a.jsx)("div",{className:"absolute w-full h-full top-0 left-0 flex justify-center items-center z-10 bg-white dark:bg-black bg-opacity-50 dark:bg-opacity-50 backdrop-blur-sm text-3xl animate-fade animate-duration-200",children:(0,a.jsx)(s.Z,{})}):null}},43446:function(e,l,t){var a=t(1375),s=t(2453),n=t(67294),r=t(58989),o=t(83454);l.Z=e=>{let{queryAgentURL:l="/api/v1/chat/completions"}=e,t=(0,n.useMemo)(()=>new AbortController,[]),i=(0,n.useCallback)(async e=>{let{data:n,chatId:i,onMessage:c,onClose:d,onDone:u,onError:m}=e;if(!(null==n?void 0:n.user_input)&&!(null==n?void 0:n.doc_id)){s.ZP.warning(r.Z.t("NoContextTip"));return}let x={...n,conv_uid:i};if(!x.conv_uid){s.ZP.error("conv_uid 不存在,请刷新后重试");return}try{var h;await (0,a.L)("".concat(null!==(h=o.env.API_BASE_URL)&&void 0!==h?h:"").concat(l),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(x),signal:t.signal,openWhenHidden:!0,async onopen(e){if(e.ok&&e.headers.get("content-type")===a.a)return},onclose(){t.abort(),null==d||d()},onerror(e){throw Error(e)},onmessage:e=>{var l;let t=null===(l=e.data)||void 0===l?void 0:l.replaceAll("\\n","\n");"[DONE]"===t?null==u||u():(null==t?void 0:t.startsWith("[ERROR]"))?null==m||m(null==t?void 0:t.replace("[ERROR]","")):null==c||c(t)}})}catch(e){t.abort(),null==m||m("Sorry, We meet some error, please try agin later.",e)}},[l]);return(0,n.useEffect)(()=>()=>{t.abort()},[]),i}},80573:function(e,l,t){var a=t(41468),s=t(67294),n=t(43446),r=t(50489);l.Z=()=>{let{history:e,setHistory:l,chatId:t,model:o,docId:i}=(0,s.useContext)(a.p),c=(0,n.Z)({queryAgentURL:"/knowledge/document/summary"}),d=(0,s.useCallback)(async e=>{let[,a]=await (0,r.Vx)((0,r.$i)(t)),s=[...a,{role:"human",context:"",model_name:o,order:0,time_stamp:0},{role:"view",context:"",model_name:o,order:0,time_stamp:0,retry:!0}],n=s.length-1;l([...s]),await c({data:{doc_id:e||i,model_name:o},chatId:t,onMessage:e=>{s[n].context=e,l([...s])}})},[e,o,i,t]);return d}}}]);
\ No newline at end of file
diff --git a/pilot/server/static/_next/static/chunks/553-a47bd28b47047f83.js b/pilot/server/static/_next/static/chunks/553-df5701294eedae07.js
similarity index 99%
rename from pilot/server/static/_next/static/chunks/553-a47bd28b47047f83.js
rename to pilot/server/static/_next/static/chunks/553-df5701294eedae07.js
index d518f8609..10e665ee7 100644
--- a/pilot/server/static/_next/static/chunks/553-a47bd28b47047f83.js
+++ b/pilot/server/static/_next/static/chunks/553-df5701294eedae07.js
@@ -1,4 +1,4 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[553],{51046:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(87462),o=r(67294),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},a=r(84089),l=o.forwardRef(function(e,t){return o.createElement(a.Z,(0,n.Z)({},e,{ref:t,icon:i}))})},5392:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(87462),o=r(67294),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},a=r(84089),l=o.forwardRef(function(e,t){return o.createElement(a.Z,(0,n.Z)({},e,{ref:t,icon:i}))})},57838:function(e,t,r){r.d(t,{Z:function(){return o}});var n=r(67294);function o(){let[,e]=n.useReducer(e=>e+1,0);return e}},69814:function(e,t,r){r.d(t,{Z:function(){return et}});var n=r(89739),o=r(63606),i=r(4340),a=r(97937),l=r(94184),s=r.n(l),c=r(98423),u=r(67294),d=r(53124),p=r(87462),f=r(1413),m=r(45987),g={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},h=function(){var e=(0,u.useRef)([]),t=(0,u.useRef)(null);return(0,u.useEffect)(function(){var r=Date.now(),n=!1;e.current.forEach(function(e){if(e){n=!0;var o=e.style;o.transitionDuration=".3s, .3s, .3s, .06s",t.current&&r-t.current<100&&(o.transitionDuration="0s, 0s")}}),n&&(t.current=Date.now())}),e.current},b=r(71002),v=r(97685),$=r(98924),y=0,w=(0,$.Z)(),k=function(e){var t=u.useState(),r=(0,v.Z)(t,2),n=r[0],o=r[1];return u.useEffect(function(){var e;o("rc_progress_".concat((w?(e=y,y+=1):e="TEST_OR_SSR",e)))},[]),e||n},E=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function x(e){return+e.replace("%","")}function C(e){var t=null!=e?e:[];return Array.isArray(t)?t:[t]}var S=function(e,t,r,n,o,i,a,l,s,c){var u=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,d=(100-n)/100*t;return"round"===s&&100!==n&&(d+=c/2)>=t&&(d=t-.01),{stroke:"string"==typeof l?l:void 0,strokeDasharray:"".concat(t,"px ").concat(e),strokeDashoffset:d+u,transform:"rotate(".concat(o+r/100*360*((360-i)/360)+(0===i?0:({bottom:0,top:180,left:90,right:-90})[a]),"deg)"),transformOrigin:"0 0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},O=function(e){var t,r,n,o,i=(0,f.Z)((0,f.Z)({},g),e),a=i.id,l=i.prefixCls,c=i.steps,d=i.strokeWidth,v=i.trailWidth,$=i.gapDegree,y=void 0===$?0:$,w=i.gapPosition,O=i.trailColor,j=i.strokeLinecap,Z=i.style,I=i.className,D=i.strokeColor,R=i.percent,N=(0,m.Z)(i,E),P=k(a),M="".concat(P,"-gradient"),F=50-d/2,A=2*Math.PI*F,L=y>0?90+y/2:-90,z=A*((360-y)/360),T="object"===(0,b.Z)(c)?c:{count:c,space:2},X=T.count,_=T.space,U=S(A,z,0,100,L,y,w,O,j,d),H=C(R),W=C(D),B=W.find(function(e){return e&&"object"===(0,b.Z)(e)}),q=h();return u.createElement("svg",(0,p.Z)({className:s()("".concat(l,"-circle"),I),viewBox:"".concat(-50," ").concat(-50," ").concat(100," ").concat(100),style:Z,id:a,role:"presentation"},N),B&&u.createElement("defs",null,u.createElement("linearGradient",{id:M,x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(B).sort(function(e,t){return x(e)-x(t)}).map(function(e,t){return u.createElement("stop",{key:t,offset:e,stopColor:B[e]})}))),!X&&u.createElement("circle",{className:"".concat(l,"-circle-trail"),r:F,cx:0,cy:0,stroke:O,strokeLinecap:j,strokeWidth:v||d,style:U}),X?(t=Math.round(X*(H[0]/100)),r=100/X,n=0,Array(X).fill(null).map(function(e,o){var i=o<=t-1?W[0]:O,a=i&&"object"===(0,b.Z)(i)?"url(#".concat(M,")"):void 0,s=S(A,z,n,r,L,y,w,i,"butt",d,_);return n+=(z-s.strokeDashoffset+_)*100/z,u.createElement("circle",{key:o,className:"".concat(l,"-circle-path"),r:F,cx:0,cy:0,stroke:a,strokeWidth:d,opacity:1,style:s,ref:function(e){q[o]=e}})})):(o=0,H.map(function(e,t){var r=W[t]||W[W.length-1],n=r&&"object"===(0,b.Z)(r)?"url(#".concat(M,")"):void 0,i=S(A,z,o,e,L,y,w,r,j,d);return o+=e,u.createElement("circle",{key:t,className:"".concat(l,"-circle-path"),r:F,cx:0,cy:0,stroke:n,strokeLinecap:j,strokeWidth:d,opacity:0===e?0:1,style:i,ref:function(e){q[t]=e}})}).reverse()))},j=r(83062),Z=r(16397);function I(e){return!e||e<0?0:e>100?100:e}function D(e){let{success:t,successPercent:r}=e,n=r;return t&&"progress"in t&&(n=t.progress),t&&"percent"in t&&(n=t.percent),n}let R=e=>{let{percent:t,success:r,successPercent:n}=e,o=I(D({success:r,successPercent:n}));return[o,I(I(t)-o)]},N=e=>{let{success:t={},strokeColor:r}=e,{strokeColor:n}=t;return[n||Z.presetPrimaryColors.green,r||null]},P=(e,t,r)=>{var n,o,i,a;let l=-1,s=-1;if("step"===t){let t=r.steps,n=r.strokeWidth;"string"==typeof e||void 0===e?(l="small"===e?2:14,s=null!=n?n:8):"number"==typeof e?[l,s]=[e,e]:[l=14,s=8]=e,l*=t}else if("line"===t){let t=null==r?void 0:r.strokeWidth;"string"==typeof e||void 0===e?s=t||("small"===e?6:8):"number"==typeof e?[l,s]=[e,e]:[l=-1,s=8]=e}else("circle"===t||"dashboard"===t)&&("string"==typeof e||void 0===e?[l,s]="small"===e?[60,60]:[120,120]:"number"==typeof e?[l,s]=[e,e]:(l=null!==(o=null!==(n=e[0])&&void 0!==n?n:e[1])&&void 0!==o?o:120,s=null!==(a=null!==(i=e[0])&&void 0!==i?i:e[1])&&void 0!==a?a:120));return[l,s]},M=e=>3/e*100;var F=e=>{let{prefixCls:t,trailColor:r=null,strokeLinecap:n="round",gapPosition:o,gapDegree:i,width:a=120,type:l,children:c,success:d,size:p=a}=e,[f,m]=P(p,"circle"),{strokeWidth:g}=e;void 0===g&&(g=Math.max(M(f),6));let h=u.useMemo(()=>i||0===i?i:"dashboard"===l?75:void 0,[i,l]),b=o||"dashboard"===l&&"bottom"||void 0,v="[object Object]"===Object.prototype.toString.call(e.strokeColor),$=N({success:d,strokeColor:e.strokeColor}),y=s()(`${t}-inner`,{[`${t}-circle-gradient`]:v}),w=u.createElement(O,{percent:R(e),strokeWidth:g,trailWidth:g,strokeColor:$,strokeLinecap:n,trailColor:r,prefixCls:t,gapDegree:h,gapPosition:b});return u.createElement("div",{className:y,style:{width:f,height:m,fontSize:.15*f+6}},f<=20?u.createElement(j.Z,{title:c},u.createElement("span",null,w)):u.createElement(u.Fragment,null,w,c))},A=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let L=e=>{let t=[];return Object.keys(e).forEach(r=>{let n=parseFloat(r.replace(/%/g,""));isNaN(n)||t.push({key:n,value:e[r]})}),(t=t.sort((e,t)=>e.key-t.key)).map(e=>{let{key:t,value:r}=e;return`${r} ${t}%`}).join(", ")},z=(e,t)=>{let{from:r=Z.presetPrimaryColors.blue,to:n=Z.presetPrimaryColors.blue,direction:o="rtl"===t?"to left":"to right"}=e,i=A(e,["from","to","direction"]);if(0!==Object.keys(i).length){let e=L(i);return{backgroundImage:`linear-gradient(${o}, ${e})`}}return{backgroundImage:`linear-gradient(${o}, ${r}, ${n})`}};var T=e=>{let{prefixCls:t,direction:r,percent:n,size:o,strokeWidth:i,strokeColor:a,strokeLinecap:l="round",children:s,trailColor:c=null,success:d}=e,p=a&&"string"!=typeof a?z(a,r):{backgroundColor:a},f="square"===l||"butt"===l?0:void 0,m=null!=o?o:[-1,i||("small"===o?6:8)],[g,h]=P(m,"line",{strokeWidth:i}),b=Object.assign({width:`${I(n)}%`,height:h,borderRadius:f},p),v=D(e),$={width:`${I(v)}%`,height:h,borderRadius:f,backgroundColor:null==d?void 0:d.strokeColor};return u.createElement(u.Fragment,null,u.createElement("div",{className:`${t}-outer`,style:{width:g<0?"100%":g,height:h}},u.createElement("div",{className:`${t}-inner`,style:{backgroundColor:c||void 0,borderRadius:f}},u.createElement("div",{className:`${t}-bg`,style:b}),void 0!==v?u.createElement("div",{className:`${t}-success-bg`,style:$}):null)),s)},X=e=>{let{size:t,steps:r,percent:n=0,strokeWidth:o=8,strokeColor:i,trailColor:a=null,prefixCls:l,children:c}=e,d=Math.round(r*(n/100)),p=null!=t?t:["small"===t?2:14,o],[f,m]=P(p,"step",{steps:r,strokeWidth:o}),g=f/r,h=Array(r);for(let e=0;e{let t=e?"100%":"-100%";return new _.E4(`antProgress${e?"RTL":"LTR"}Active`,{"0%":{transform:`translateX(${t}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${t}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},q=e=>{let{componentCls:t,iconCls:r}=e;return{[t]:Object.assign(Object.assign({},(0,U.Wf)(e)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:e.fontSize,marginInlineEnd:e.marginXS,marginBottom:e.marginXS},[`${t}-outer`]:{display:"inline-block",width:"100%"},[`&${t}-show-info`]:{[`${t}-outer`]:{marginInlineEnd:`calc(-2em - ${e.marginXS}px)`,paddingInlineEnd:`calc(2em + ${e.paddingXS}px)`}},[`${t}-inner`]:{position:"relative",display:"inline-block",width:"100%",overflow:"hidden",verticalAlign:"middle",backgroundColor:e.progressRemainingColor,borderRadius:e.progressLineRadius},[`${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorInfo}},[`${t}-success-bg, ${t}-bg`]:{position:"relative",backgroundColor:e.colorInfo,borderRadius:e.progressLineRadius,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`},[`${t}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:e.colorSuccess},[`${t}-text`]:{display:"inline-block",width:"2em",marginInlineStart:e.marginXS,color:e.progressInfoTextColor,lineHeight:1,whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[r]:{fontSize:e.fontSize}},[`&${t}-status-active`]:{[`${t}-bg::before`]:{position:"absolute",inset:0,backgroundColor:e.colorBgContainer,borderRadius:e.progressLineRadius,opacity:0,animationName:B(),animationDuration:e.progressActiveMotionDuration,animationTimingFunction:e.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${t}-rtl${t}-status-active`]:{[`${t}-bg::before`]:{animationName:B(!0)}},[`&${t}-status-exception`]:{[`${t}-bg`]:{backgroundColor:e.colorError},[`${t}-text`]:{color:e.colorError}},[`&${t}-status-exception ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorError}},[`&${t}-status-success`]:{[`${t}-bg`]:{backgroundColor:e.colorSuccess},[`${t}-text`]:{color:e.colorSuccess}},[`&${t}-status-success ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorSuccess}}})}},V=e=>{let{componentCls:t,iconCls:r}=e;return{[t]:{[`${t}-circle-trail`]:{stroke:e.progressRemainingColor},[`&${t}-circle ${t}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${t}-circle ${t}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:e.colorText,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[r]:{fontSize:`${e.fontSize/e.fontSizeSM}em`}},[`${t}-circle&-status-exception`]:{[`${t}-text`]:{color:e.colorError}},[`${t}-circle&-status-success`]:{[`${t}-text`]:{color:e.colorSuccess}}},[`${t}-inline-circle`]:{lineHeight:1,[`${t}-inner`]:{verticalAlign:"bottom"}}}},G=e=>{let{componentCls:t}=e;return{[t]:{[`${t}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:e.progressStepMinWidth,marginInlineEnd:e.progressStepMarginInlineEnd,backgroundColor:e.progressRemainingColor,transition:`all ${e.motionDurationSlow}`,"&-active":{backgroundColor:e.colorInfo}}}}}},J=e=>{let{componentCls:t,iconCls:r}=e;return{[t]:{[`${t}-small&-line, ${t}-small&-line ${t}-text ${r}`]:{fontSize:e.fontSizeSM}}}};var K=(0,H.Z)("Progress",e=>{let t=e.marginXXS/2,r=(0,W.TS)(e,{progressLineRadius:100,progressInfoTextColor:e.colorText,progressDefaultColor:e.colorInfo,progressRemainingColor:e.colorFillSecondary,progressStepMarginInlineEnd:t,progressStepMinWidth:t,progressActiveMotionDuration:"2.4s"});return[q(r),V(r),G(r),J(r)]}),Q=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let Y=["normal","exception","active","success"],ee=u.forwardRef((e,t)=>{let r;let{prefixCls:l,className:p,rootClassName:f,steps:m,strokeColor:g,percent:h=0,size:b="default",showInfo:v=!0,type:$="line",status:y,format:w,style:k}=e,E=Q(e,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style"]),x=u.useMemo(()=>{var t,r;let n=D(e);return parseInt(void 0!==n?null===(t=null!=n?n:0)||void 0===t?void 0:t.toString():null===(r=null!=h?h:0)||void 0===r?void 0:r.toString(),10)},[h,e.success,e.successPercent]),C=u.useMemo(()=>!Y.includes(y)&&x>=100?"success":y||"normal",[y,x]),{getPrefixCls:S,direction:O,progress:j}=u.useContext(d.E_),Z=S("progress",l),[R,N]=K(Z),M=u.useMemo(()=>{let t;if(!v)return null;let r=D(e),l=w||(e=>`${e}%`),s="line"===$;return w||"exception"!==C&&"success"!==C?t=l(I(h),I(r)):"exception"===C?t=s?u.createElement(i.Z,null):u.createElement(a.Z,null):"success"===C&&(t=s?u.createElement(n.Z,null):u.createElement(o.Z,null)),u.createElement("span",{className:`${Z}-text`,title:"string"==typeof t?t:void 0},t)},[v,h,x,C,$,Z,w]),A=Array.isArray(g)?g[0]:g,L="string"==typeof g||Array.isArray(g)?g:void 0;"line"===$?r=m?u.createElement(X,Object.assign({},e,{strokeColor:L,prefixCls:Z,steps:m}),M):u.createElement(T,Object.assign({},e,{strokeColor:A,prefixCls:Z,direction:O}),M):("circle"===$||"dashboard"===$)&&(r=u.createElement(F,Object.assign({},e,{strokeColor:A,prefixCls:Z,progressStatus:C}),M));let z=s()(Z,`${Z}-status-${C}`,`${Z}-${"dashboard"===$&&"circle"||m&&"steps"||$}`,{[`${Z}-inline-circle`]:"circle"===$&&P(b,"circle")[0]<=20,[`${Z}-show-info`]:v,[`${Z}-${b}`]:"string"==typeof b,[`${Z}-rtl`]:"rtl"===O},null==j?void 0:j.className,p,f,N);return R(u.createElement("div",Object.assign({ref:t,style:Object.assign(Object.assign({},null==j?void 0:j.style),k),className:z,role:"progressbar","aria-valuenow":x},(0,c.Z)(E,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),r))});var et=ee},84553:function(e,t,r){r.d(t,{default:function(){return eI}});var n=r(67294),o=r(74902),i=r(94184),a=r.n(i),l=r(87462),s=r(15671),c=r(43144),u=r(32531),d=r(73568),p=r(4942),f=r(45987),m=r(74165),g=r(71002),h=r(15861),b=r(64217);function v(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(e){return t}}function $(e){var t=new XMLHttpRequest;e.onProgress&&t.upload&&(t.upload.onprogress=function(t){t.total>0&&(t.percent=t.loaded/t.total*100),e.onProgress(t)});var r=new FormData;e.data&&Object.keys(e.data).forEach(function(t){var n=e.data[t];if(Array.isArray(n)){n.forEach(function(e){r.append("".concat(t,"[]"),e)});return}r.append(t,n)}),e.file instanceof Blob?r.append(e.filename,e.file,e.file.name):r.append(e.filename,e.file),t.onerror=function(t){e.onError(t)},t.onload=function(){if(t.status<200||t.status>=300){var r;return e.onError(((r=Error("cannot ".concat(e.method," ").concat(e.action," ").concat(t.status,"'"))).status=t.status,r.method=e.method,r.url=e.action,r),v(t))}return e.onSuccess(v(t),t)},t.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var n=e.headers||{};return null!==n["X-Requested-With"]&&t.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(n).forEach(function(e){null!==n[e]&&t.setRequestHeader(e,n[e])}),t.send(r),{abort:function(){t.abort()}}}var y=+new Date,w=0;function k(){return"rc-upload-".concat(y,"-").concat(++w)}var E=r(80334),x=function(e,t){if(e&&t){var r=Array.isArray(t)?t:t.split(","),n=e.name||"",o=e.type||"",i=o.replace(/\/.*$/,"");return r.some(function(e){var t=e.trim();if(/^\*(\/\*)?$/.test(e))return!0;if("."===t.charAt(0)){var r=n.toLowerCase(),a=t.toLowerCase(),l=[a];return(".jpg"===a||".jpeg"===a)&&(l=[".jpg",".jpeg"]),l.some(function(e){return r.endsWith(e)})}return/\/\*$/.test(t)?i===t.replace(/\/.*$/,""):o===t||!!/^\w+$/.test(t)&&((0,E.ZP)(!1,"Upload takes an invalidate 'accept' type '".concat(t,"'.Skip for check.")),!0)})}return!0},C=function(e,t,r){var n=function e(n,o){if(n.path=o||"",n.isFile)n.file(function(e){r(e)&&(n.fullPath&&!e.webkitRelativePath&&(Object.defineProperties(e,{webkitRelativePath:{writable:!0}}),e.webkitRelativePath=n.fullPath.replace(/^\//,""),Object.defineProperties(e,{webkitRelativePath:{writable:!1}})),t([e]))});else if(n.isDirectory){var i,a,l;i=function(t){t.forEach(function(t){e(t,"".concat(o).concat(n.name,"/"))})},a=n.createReader(),l=[],function e(){a.readEntries(function(t){var r=Array.prototype.slice.apply(t);l=l.concat(r),r.length?e():i(l)})}()}};e.forEach(function(e){n(e.webkitGetAsEntry())})},S=["component","prefixCls","className","disabled","id","style","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"],O=function(e){(0,u.Z)(r,e);var t=(0,d.Z)(r);function r(){(0,s.Z)(this,r);for(var e,n,i=arguments.length,a=Array(i),l=0;l{let{uid:r}=t;return r===e.uid});return -1===n?r.push(e):r[n]=e,r}function J(e,t){let r=void 0!==e.uid?"uid":"name";return t.filter(t=>t[r]===e[r])[0]}let K=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.split("/"),r=t[t.length-1],n=r.split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(n)||[""])[0]},Q=e=>0===e.indexOf("image/"),Y=e=>{if(e.type&&!e.thumbUrl)return Q(e.type);let t=e.thumbUrl||e.url||"",r=K(t);return!!(/^data:image\//.test(t)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(r))||!/^data:/.test(t)&&!r};function ee(e){return new Promise(t=>{if(!e.type||!Q(e.type)){t("");return}let r=document.createElement("canvas");r.width=200,r.height=200,r.style.cssText="position: fixed; left: 0; top: 0; width: 200px; height: 200px; z-index: 9999; display: none;",document.body.appendChild(r);let n=r.getContext("2d"),o=new Image;if(o.onload=()=>{let{width:e,height:i}=o,a=200,l=200,s=0,c=0;e>i?c=-((l=i*(200/e))-a)/2:s=-((a=e*(200/i))-l)/2,n.drawImage(o,s,c,a,l);let u=r.toDataURL();document.body.removeChild(r),window.URL.revokeObjectURL(o.src),t(u)},o.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){let t=new FileReader;t.onload=()=>{t.result&&(o.src=t.result)},t.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){let r=new FileReader;r.onload=()=>{r.result&&t(r.result)},r.readAsDataURL(e)}else o.src=window.URL.createObjectURL(e)})}var et=r(48689),er=r(51046),en=r(99611),eo=r(69814),ei=r(83062);let ea=n.forwardRef((e,t)=>{var r,o;let{prefixCls:i,className:l,style:s,locale:c,listType:u,file:d,items:p,progress:f,iconRender:m,actionIconRender:g,itemRender:h,isImgUrl:b,showPreviewIcon:v,showRemoveIcon:$,showDownloadIcon:y,previewIcon:w,removeIcon:k,downloadIcon:E,onPreview:x,onDownload:C,onClose:S}=e,{status:O}=d,[j,Z]=n.useState(O);n.useEffect(()=>{"removed"!==O&&Z(O)},[O]);let[I,D]=n.useState(!1);n.useEffect(()=>{let e=setTimeout(()=>{D(!0)},300);return()=>{clearTimeout(e)}},[]);let N=m(d),P=n.createElement("div",{className:`${i}-icon`},N);if("picture"===u||"picture-card"===u||"picture-circle"===u){if("uploading"!==j&&(d.thumbUrl||d.url)){let e=(null==b?void 0:b(d))?n.createElement("img",{src:d.thumbUrl||d.url,alt:d.name,className:`${i}-list-item-image`,crossOrigin:d.crossOrigin}):N,t=a()(`${i}-list-item-thumbnail`,{[`${i}-list-item-file`]:b&&!b(d)});P=n.createElement("a",{className:t,onClick:e=>x(d,e),href:d.url||d.thumbUrl,target:"_blank",rel:"noopener noreferrer"},e)}else{let e=a()(`${i}-list-item-thumbnail`,{[`${i}-list-item-file`]:"uploading"!==j});P=n.createElement("div",{className:e},N)}}let M=a()(`${i}-list-item`,`${i}-list-item-${j}`),F="string"==typeof d.linkProps?JSON.parse(d.linkProps):d.linkProps,A=$?g(("function"==typeof k?k(d):k)||n.createElement(et.Z,null),()=>S(d),i,c.removeFile):null,L=y&&"done"===j?g(("function"==typeof E?E(d):E)||n.createElement(er.Z,null),()=>C(d),i,c.downloadFile):null,z="picture-card"!==u&&"picture-circle"!==u&&n.createElement("span",{key:"download-delete",className:a()(`${i}-list-item-actions`,{picture:"picture"===u})},L,A),T=a()(`${i}-list-item-name`),X=d.url?[n.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:T,title:d.name},F,{href:d.url,onClick:e=>x(d,e)}),d.name),z]:[n.createElement("span",{key:"view",className:T,onClick:e=>x(d,e),title:d.name},d.name),z],_=v?n.createElement("a",{href:d.url||d.thumbUrl,target:"_blank",rel:"noopener noreferrer",style:d.url||d.thumbUrl?void 0:{pointerEvents:"none",opacity:.5},onClick:e=>x(d,e),title:c.previewFile},"function"==typeof w?w(d):w||n.createElement(en.Z,null)):null,H=("picture-card"===u||"picture-circle"===u)&&"uploading"!==j&&n.createElement("span",{className:`${i}-list-item-actions`},_,"done"===j&&L,A),{getPrefixCls:W}=n.useContext(R.E_),B=W(),q=n.createElement("div",{className:M},P,X,H,I&&n.createElement(U.ZP,{motionName:`${B}-fade`,visible:"uploading"===j,motionDeadline:2e3},e=>{let{className:t}=e,r="percent"in d?n.createElement(eo.Z,Object.assign({},f,{type:"line",percent:d.percent,"aria-label":d["aria-label"],"aria-labelledby":d["aria-labelledby"]})):null;return n.createElement("div",{className:a()(`${i}-list-item-progress`,t)},r)})),V=d.response&&"string"==typeof d.response?d.response:(null===(r=d.error)||void 0===r?void 0:r.statusText)||(null===(o=d.error)||void 0===o?void 0:o.message)||c.uploadError,G="error"===j?n.createElement(ei.Z,{title:V,getPopupContainer:e=>e.parentNode},q):q;return n.createElement("div",{className:a()(`${i}-list-item-container`,l),style:s,ref:t},h?h(G,d,p,{download:C.bind(null,d),preview:x.bind(null,d),remove:S.bind(null,d)}):G)}),el=n.forwardRef((e,t)=>{let{listType:r="text",previewFile:i=ee,onPreview:l,onDownload:s,onRemove:c,locale:u,iconRender:d,isImageUrl:p=Y,prefixCls:f,items:m=[],showPreviewIcon:g=!0,showRemoveIcon:h=!0,showDownloadIcon:b=!1,removeIcon:v,previewIcon:$,downloadIcon:y,progress:w={size:[-1,2],showInfo:!1},appendAction:k,appendActionVisible:E=!0,itemRender:x,disabled:C}=e,S=(0,H.Z)(),[O,j]=n.useState(!1);n.useEffect(()=>{("picture"===r||"picture-card"===r||"picture-circle"===r)&&(m||[]).forEach(e=>{"undefined"!=typeof document&&"undefined"!=typeof window&&window.FileReader&&window.File&&(e.originFileObj instanceof File||e.originFileObj instanceof Blob)&&void 0===e.thumbUrl&&(e.thumbUrl="",i&&i(e.originFileObj).then(t=>{e.thumbUrl=t||"",S()}))})},[r,m,i]),n.useEffect(()=>{j(!0)},[]);let Z=(e,t)=>{if(l)return null==t||t.preventDefault(),l(e)},I=e=>{"function"==typeof s?s(e):e.url&&window.open(e.url)},D=e=>{null==c||c(e)},N=e=>{if(d)return d(e,r);let t="uploading"===e.status,o=p&&p(e)?n.createElement(_,null):n.createElement(L,null),i=t?n.createElement(z.Z,null):n.createElement(T.Z,null);return"picture"===r?i=t?n.createElement(z.Z,null):o:("picture-card"===r||"picture-circle"===r)&&(i=t?u.uploading:o),i},P=(e,t,r,o)=>{let i={type:"text",size:"small",title:o,onClick:r=>{t(),(0,B.l$)(e)&&e.props.onClick&&e.props.onClick(r)},className:`${r}-list-item-action`,disabled:C};if((0,B.l$)(e)){let t=(0,B.Tm)(e,Object.assign(Object.assign({},e.props),{onClick:()=>{}}));return n.createElement(q.ZP,Object.assign({},i,{icon:t}))}return n.createElement(q.ZP,Object.assign({},i),n.createElement("span",null,e))};n.useImperativeHandle(t,()=>({handlePreview:Z,handleDownload:I}));let{getPrefixCls:M}=n.useContext(R.E_),F=M("upload",f),A=M(),X=a()(`${F}-list`,`${F}-list-${r}`),V=(0,o.Z)(m.map(e=>({key:e.uid,file:e}))),G="picture-card"===r||"picture-circle"===r?"animate-inline":"animate",J={motionDeadline:2e3,motionName:`${F}-${G}`,keys:V,motionAppear:O},K=n.useMemo(()=>{let e=Object.assign({},(0,W.Z)(A));return delete e.onAppearEnd,delete e.onEnterEnd,delete e.onLeaveEnd,e},[A]);return"picture-card"!==r&&"picture-circle"!==r&&(J=Object.assign(Object.assign({},K),J)),n.createElement("div",{className:X},n.createElement(U.V4,Object.assign({},J,{component:!1}),e=>{let{key:t,file:o,className:i,style:a}=e;return n.createElement(ea,{key:t,locale:u,prefixCls:F,className:i,style:a,file:o,items:m,progress:w,listType:r,isImgUrl:p,showPreviewIcon:g,showRemoveIcon:h,showDownloadIcon:b,removeIcon:v,previewIcon:$,downloadIcon:y,iconRender:N,actionIconRender:P,itemRender:x,onPreview:Z,onDownload:I,onClose:D})}),k&&n.createElement(U.ZP,Object.assign({},J,{visible:E,forceRender:!0}),e=>{let{className:t,style:r}=e;return(0,B.Tm)(k,e=>({className:a()(e.className,t),style:Object.assign(Object.assign(Object.assign({},r),{pointerEvents:t?"none":void 0}),e.style)}))}))});var es=r(14747),ec=r(33507),eu=r(67968),ed=r(45503),ep=e=>{let{componentCls:t,iconCls:r}=e;return{[`${t}-wrapper`]:{[`${t}-drag`]:{position:"relative",width:"100%",height:"100%",textAlign:"center",background:e.colorFillAlter,border:`${e.lineWidth}px dashed ${e.colorBorder}`,borderRadius:e.borderRadiusLG,cursor:"pointer",transition:`border-color ${e.motionDurationSlow}`,[t]:{padding:`${e.padding}px 0`},[`${t}-btn`]:{display:"table",width:"100%",height:"100%",outline:"none"},[`${t}-drag-container`]:{display:"table-cell",verticalAlign:"middle"},[`&:not(${t}-disabled):hover`]:{borderColor:e.colorPrimaryHover},[`p${t}-drag-icon`]:{marginBottom:e.margin,[r]:{color:e.colorPrimary,fontSize:e.uploadThumbnailSize}},[`p${t}-text`]:{margin:`0 0 ${e.marginXXS}px`,color:e.colorTextHeading,fontSize:e.fontSizeLG},[`p${t}-hint`]:{color:e.colorTextDescription,fontSize:e.fontSize},[`&${t}-disabled`]:{cursor:"not-allowed",[`p${t}-drag-icon ${r},
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[553],{23430:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(87462),o=r(67294),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},a=r(84089),l=o.forwardRef(function(e,t){return o.createElement(a.Z,(0,n.Z)({},e,{ref:t,icon:i}))})},5392:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(87462),o=r(67294),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},a=r(84089),l=o.forwardRef(function(e,t){return o.createElement(a.Z,(0,n.Z)({},e,{ref:t,icon:i}))})},57838:function(e,t,r){r.d(t,{Z:function(){return o}});var n=r(67294);function o(){let[,e]=n.useReducer(e=>e+1,0);return e}},69814:function(e,t,r){r.d(t,{Z:function(){return et}});var n=r(89739),o=r(63606),i=r(4340),a=r(97937),l=r(94184),s=r.n(l),c=r(98423),u=r(67294),d=r(53124),p=r(87462),f=r(1413),m=r(45987),g={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},h=function(){var e=(0,u.useRef)([]),t=(0,u.useRef)(null);return(0,u.useEffect)(function(){var r=Date.now(),n=!1;e.current.forEach(function(e){if(e){n=!0;var o=e.style;o.transitionDuration=".3s, .3s, .3s, .06s",t.current&&r-t.current<100&&(o.transitionDuration="0s, 0s")}}),n&&(t.current=Date.now())}),e.current},b=r(71002),v=r(97685),$=r(98924),y=0,w=(0,$.Z)(),k=function(e){var t=u.useState(),r=(0,v.Z)(t,2),n=r[0],o=r[1];return u.useEffect(function(){var e;o("rc_progress_".concat((w?(e=y,y+=1):e="TEST_OR_SSR",e)))},[]),e||n},E=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function x(e){return+e.replace("%","")}function C(e){var t=null!=e?e:[];return Array.isArray(t)?t:[t]}var S=function(e,t,r,n,o,i,a,l,s,c){var u=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,d=(100-n)/100*t;return"round"===s&&100!==n&&(d+=c/2)>=t&&(d=t-.01),{stroke:"string"==typeof l?l:void 0,strokeDasharray:"".concat(t,"px ").concat(e),strokeDashoffset:d+u,transform:"rotate(".concat(o+r/100*360*((360-i)/360)+(0===i?0:({bottom:0,top:180,left:90,right:-90})[a]),"deg)"),transformOrigin:"0 0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},O=function(e){var t,r,n,o,i=(0,f.Z)((0,f.Z)({},g),e),a=i.id,l=i.prefixCls,c=i.steps,d=i.strokeWidth,v=i.trailWidth,$=i.gapDegree,y=void 0===$?0:$,w=i.gapPosition,O=i.trailColor,j=i.strokeLinecap,Z=i.style,I=i.className,D=i.strokeColor,R=i.percent,N=(0,m.Z)(i,E),P=k(a),M="".concat(P,"-gradient"),F=50-d/2,A=2*Math.PI*F,L=y>0?90+y/2:-90,z=A*((360-y)/360),T="object"===(0,b.Z)(c)?c:{count:c,space:2},X=T.count,_=T.space,U=S(A,z,0,100,L,y,w,O,j,d),H=C(R),W=C(D),B=W.find(function(e){return e&&"object"===(0,b.Z)(e)}),q=h();return u.createElement("svg",(0,p.Z)({className:s()("".concat(l,"-circle"),I),viewBox:"".concat(-50," ").concat(-50," ").concat(100," ").concat(100),style:Z,id:a,role:"presentation"},N),B&&u.createElement("defs",null,u.createElement("linearGradient",{id:M,x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(B).sort(function(e,t){return x(e)-x(t)}).map(function(e,t){return u.createElement("stop",{key:t,offset:e,stopColor:B[e]})}))),!X&&u.createElement("circle",{className:"".concat(l,"-circle-trail"),r:F,cx:0,cy:0,stroke:O,strokeLinecap:j,strokeWidth:v||d,style:U}),X?(t=Math.round(X*(H[0]/100)),r=100/X,n=0,Array(X).fill(null).map(function(e,o){var i=o<=t-1?W[0]:O,a=i&&"object"===(0,b.Z)(i)?"url(#".concat(M,")"):void 0,s=S(A,z,n,r,L,y,w,i,"butt",d,_);return n+=(z-s.strokeDashoffset+_)*100/z,u.createElement("circle",{key:o,className:"".concat(l,"-circle-path"),r:F,cx:0,cy:0,stroke:a,strokeWidth:d,opacity:1,style:s,ref:function(e){q[o]=e}})})):(o=0,H.map(function(e,t){var r=W[t]||W[W.length-1],n=r&&"object"===(0,b.Z)(r)?"url(#".concat(M,")"):void 0,i=S(A,z,o,e,L,y,w,r,j,d);return o+=e,u.createElement("circle",{key:t,className:"".concat(l,"-circle-path"),r:F,cx:0,cy:0,stroke:n,strokeLinecap:j,strokeWidth:d,opacity:0===e?0:1,style:i,ref:function(e){q[t]=e}})}).reverse()))},j=r(83062),Z=r(16397);function I(e){return!e||e<0?0:e>100?100:e}function D(e){let{success:t,successPercent:r}=e,n=r;return t&&"progress"in t&&(n=t.progress),t&&"percent"in t&&(n=t.percent),n}let R=e=>{let{percent:t,success:r,successPercent:n}=e,o=I(D({success:r,successPercent:n}));return[o,I(I(t)-o)]},N=e=>{let{success:t={},strokeColor:r}=e,{strokeColor:n}=t;return[n||Z.presetPrimaryColors.green,r||null]},P=(e,t,r)=>{var n,o,i,a;let l=-1,s=-1;if("step"===t){let t=r.steps,n=r.strokeWidth;"string"==typeof e||void 0===e?(l="small"===e?2:14,s=null!=n?n:8):"number"==typeof e?[l,s]=[e,e]:[l=14,s=8]=e,l*=t}else if("line"===t){let t=null==r?void 0:r.strokeWidth;"string"==typeof e||void 0===e?s=t||("small"===e?6:8):"number"==typeof e?[l,s]=[e,e]:[l=-1,s=8]=e}else("circle"===t||"dashboard"===t)&&("string"==typeof e||void 0===e?[l,s]="small"===e?[60,60]:[120,120]:"number"==typeof e?[l,s]=[e,e]:(l=null!==(o=null!==(n=e[0])&&void 0!==n?n:e[1])&&void 0!==o?o:120,s=null!==(a=null!==(i=e[0])&&void 0!==i?i:e[1])&&void 0!==a?a:120));return[l,s]},M=e=>3/e*100;var F=e=>{let{prefixCls:t,trailColor:r=null,strokeLinecap:n="round",gapPosition:o,gapDegree:i,width:a=120,type:l,children:c,success:d,size:p=a}=e,[f,m]=P(p,"circle"),{strokeWidth:g}=e;void 0===g&&(g=Math.max(M(f),6));let h=u.useMemo(()=>i||0===i?i:"dashboard"===l?75:void 0,[i,l]),b=o||"dashboard"===l&&"bottom"||void 0,v="[object Object]"===Object.prototype.toString.call(e.strokeColor),$=N({success:d,strokeColor:e.strokeColor}),y=s()(`${t}-inner`,{[`${t}-circle-gradient`]:v}),w=u.createElement(O,{percent:R(e),strokeWidth:g,trailWidth:g,strokeColor:$,strokeLinecap:n,trailColor:r,prefixCls:t,gapDegree:h,gapPosition:b});return u.createElement("div",{className:y,style:{width:f,height:m,fontSize:.15*f+6}},f<=20?u.createElement(j.Z,{title:c},u.createElement("span",null,w)):u.createElement(u.Fragment,null,w,c))},A=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let L=e=>{let t=[];return Object.keys(e).forEach(r=>{let n=parseFloat(r.replace(/%/g,""));isNaN(n)||t.push({key:n,value:e[r]})}),(t=t.sort((e,t)=>e.key-t.key)).map(e=>{let{key:t,value:r}=e;return`${r} ${t}%`}).join(", ")},z=(e,t)=>{let{from:r=Z.presetPrimaryColors.blue,to:n=Z.presetPrimaryColors.blue,direction:o="rtl"===t?"to left":"to right"}=e,i=A(e,["from","to","direction"]);if(0!==Object.keys(i).length){let e=L(i);return{backgroundImage:`linear-gradient(${o}, ${e})`}}return{backgroundImage:`linear-gradient(${o}, ${r}, ${n})`}};var T=e=>{let{prefixCls:t,direction:r,percent:n,size:o,strokeWidth:i,strokeColor:a,strokeLinecap:l="round",children:s,trailColor:c=null,success:d}=e,p=a&&"string"!=typeof a?z(a,r):{backgroundColor:a},f="square"===l||"butt"===l?0:void 0,m=null!=o?o:[-1,i||("small"===o?6:8)],[g,h]=P(m,"line",{strokeWidth:i}),b=Object.assign({width:`${I(n)}%`,height:h,borderRadius:f},p),v=D(e),$={width:`${I(v)}%`,height:h,borderRadius:f,backgroundColor:null==d?void 0:d.strokeColor};return u.createElement(u.Fragment,null,u.createElement("div",{className:`${t}-outer`,style:{width:g<0?"100%":g,height:h}},u.createElement("div",{className:`${t}-inner`,style:{backgroundColor:c||void 0,borderRadius:f}},u.createElement("div",{className:`${t}-bg`,style:b}),void 0!==v?u.createElement("div",{className:`${t}-success-bg`,style:$}):null)),s)},X=e=>{let{size:t,steps:r,percent:n=0,strokeWidth:o=8,strokeColor:i,trailColor:a=null,prefixCls:l,children:c}=e,d=Math.round(r*(n/100)),p=null!=t?t:["small"===t?2:14,o],[f,m]=P(p,"step",{steps:r,strokeWidth:o}),g=f/r,h=Array(r);for(let e=0;e{let t=e?"100%":"-100%";return new _.E4(`antProgress${e?"RTL":"LTR"}Active`,{"0%":{transform:`translateX(${t}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${t}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},q=e=>{let{componentCls:t,iconCls:r}=e;return{[t]:Object.assign(Object.assign({},(0,U.Wf)(e)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:e.fontSize,marginInlineEnd:e.marginXS,marginBottom:e.marginXS},[`${t}-outer`]:{display:"inline-block",width:"100%"},[`&${t}-show-info`]:{[`${t}-outer`]:{marginInlineEnd:`calc(-2em - ${e.marginXS}px)`,paddingInlineEnd:`calc(2em + ${e.paddingXS}px)`}},[`${t}-inner`]:{position:"relative",display:"inline-block",width:"100%",overflow:"hidden",verticalAlign:"middle",backgroundColor:e.progressRemainingColor,borderRadius:e.progressLineRadius},[`${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorInfo}},[`${t}-success-bg, ${t}-bg`]:{position:"relative",backgroundColor:e.colorInfo,borderRadius:e.progressLineRadius,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`},[`${t}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:e.colorSuccess},[`${t}-text`]:{display:"inline-block",width:"2em",marginInlineStart:e.marginXS,color:e.progressInfoTextColor,lineHeight:1,whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[r]:{fontSize:e.fontSize}},[`&${t}-status-active`]:{[`${t}-bg::before`]:{position:"absolute",inset:0,backgroundColor:e.colorBgContainer,borderRadius:e.progressLineRadius,opacity:0,animationName:B(),animationDuration:e.progressActiveMotionDuration,animationTimingFunction:e.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${t}-rtl${t}-status-active`]:{[`${t}-bg::before`]:{animationName:B(!0)}},[`&${t}-status-exception`]:{[`${t}-bg`]:{backgroundColor:e.colorError},[`${t}-text`]:{color:e.colorError}},[`&${t}-status-exception ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorError}},[`&${t}-status-success`]:{[`${t}-bg`]:{backgroundColor:e.colorSuccess},[`${t}-text`]:{color:e.colorSuccess}},[`&${t}-status-success ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorSuccess}}})}},V=e=>{let{componentCls:t,iconCls:r}=e;return{[t]:{[`${t}-circle-trail`]:{stroke:e.progressRemainingColor},[`&${t}-circle ${t}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${t}-circle ${t}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:e.colorText,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[r]:{fontSize:`${e.fontSize/e.fontSizeSM}em`}},[`${t}-circle&-status-exception`]:{[`${t}-text`]:{color:e.colorError}},[`${t}-circle&-status-success`]:{[`${t}-text`]:{color:e.colorSuccess}}},[`${t}-inline-circle`]:{lineHeight:1,[`${t}-inner`]:{verticalAlign:"bottom"}}}},G=e=>{let{componentCls:t}=e;return{[t]:{[`${t}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:e.progressStepMinWidth,marginInlineEnd:e.progressStepMarginInlineEnd,backgroundColor:e.progressRemainingColor,transition:`all ${e.motionDurationSlow}`,"&-active":{backgroundColor:e.colorInfo}}}}}},J=e=>{let{componentCls:t,iconCls:r}=e;return{[t]:{[`${t}-small&-line, ${t}-small&-line ${t}-text ${r}`]:{fontSize:e.fontSizeSM}}}};var K=(0,H.Z)("Progress",e=>{let t=e.marginXXS/2,r=(0,W.TS)(e,{progressLineRadius:100,progressInfoTextColor:e.colorText,progressDefaultColor:e.colorInfo,progressRemainingColor:e.colorFillSecondary,progressStepMarginInlineEnd:t,progressStepMinWidth:t,progressActiveMotionDuration:"2.4s"});return[q(r),V(r),G(r),J(r)]}),Q=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let Y=["normal","exception","active","success"],ee=u.forwardRef((e,t)=>{let r;let{prefixCls:l,className:p,rootClassName:f,steps:m,strokeColor:g,percent:h=0,size:b="default",showInfo:v=!0,type:$="line",status:y,format:w,style:k}=e,E=Q(e,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style"]),x=u.useMemo(()=>{var t,r;let n=D(e);return parseInt(void 0!==n?null===(t=null!=n?n:0)||void 0===t?void 0:t.toString():null===(r=null!=h?h:0)||void 0===r?void 0:r.toString(),10)},[h,e.success,e.successPercent]),C=u.useMemo(()=>!Y.includes(y)&&x>=100?"success":y||"normal",[y,x]),{getPrefixCls:S,direction:O,progress:j}=u.useContext(d.E_),Z=S("progress",l),[R,N]=K(Z),M=u.useMemo(()=>{let t;if(!v)return null;let r=D(e),l=w||(e=>`${e}%`),s="line"===$;return w||"exception"!==C&&"success"!==C?t=l(I(h),I(r)):"exception"===C?t=s?u.createElement(i.Z,null):u.createElement(a.Z,null):"success"===C&&(t=s?u.createElement(n.Z,null):u.createElement(o.Z,null)),u.createElement("span",{className:`${Z}-text`,title:"string"==typeof t?t:void 0},t)},[v,h,x,C,$,Z,w]),A=Array.isArray(g)?g[0]:g,L="string"==typeof g||Array.isArray(g)?g:void 0;"line"===$?r=m?u.createElement(X,Object.assign({},e,{strokeColor:L,prefixCls:Z,steps:m}),M):u.createElement(T,Object.assign({},e,{strokeColor:A,prefixCls:Z,direction:O}),M):("circle"===$||"dashboard"===$)&&(r=u.createElement(F,Object.assign({},e,{strokeColor:A,prefixCls:Z,progressStatus:C}),M));let z=s()(Z,`${Z}-status-${C}`,`${Z}-${"dashboard"===$&&"circle"||m&&"steps"||$}`,{[`${Z}-inline-circle`]:"circle"===$&&P(b,"circle")[0]<=20,[`${Z}-show-info`]:v,[`${Z}-${b}`]:"string"==typeof b,[`${Z}-rtl`]:"rtl"===O},null==j?void 0:j.className,p,f,N);return R(u.createElement("div",Object.assign({ref:t,style:Object.assign(Object.assign({},null==j?void 0:j.style),k),className:z,role:"progressbar","aria-valuenow":x},(0,c.Z)(E,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),r))});var et=ee},84553:function(e,t,r){r.d(t,{default:function(){return eI}});var n=r(67294),o=r(74902),i=r(94184),a=r.n(i),l=r(87462),s=r(15671),c=r(43144),u=r(32531),d=r(73568),p=r(4942),f=r(45987),m=r(74165),g=r(71002),h=r(15861),b=r(64217);function v(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(e){return t}}function $(e){var t=new XMLHttpRequest;e.onProgress&&t.upload&&(t.upload.onprogress=function(t){t.total>0&&(t.percent=t.loaded/t.total*100),e.onProgress(t)});var r=new FormData;e.data&&Object.keys(e.data).forEach(function(t){var n=e.data[t];if(Array.isArray(n)){n.forEach(function(e){r.append("".concat(t,"[]"),e)});return}r.append(t,n)}),e.file instanceof Blob?r.append(e.filename,e.file,e.file.name):r.append(e.filename,e.file),t.onerror=function(t){e.onError(t)},t.onload=function(){if(t.status<200||t.status>=300){var r;return e.onError(((r=Error("cannot ".concat(e.method," ").concat(e.action," ").concat(t.status,"'"))).status=t.status,r.method=e.method,r.url=e.action,r),v(t))}return e.onSuccess(v(t),t)},t.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var n=e.headers||{};return null!==n["X-Requested-With"]&&t.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(n).forEach(function(e){null!==n[e]&&t.setRequestHeader(e,n[e])}),t.send(r),{abort:function(){t.abort()}}}var y=+new Date,w=0;function k(){return"rc-upload-".concat(y,"-").concat(++w)}var E=r(80334),x=function(e,t){if(e&&t){var r=Array.isArray(t)?t:t.split(","),n=e.name||"",o=e.type||"",i=o.replace(/\/.*$/,"");return r.some(function(e){var t=e.trim();if(/^\*(\/\*)?$/.test(e))return!0;if("."===t.charAt(0)){var r=n.toLowerCase(),a=t.toLowerCase(),l=[a];return(".jpg"===a||".jpeg"===a)&&(l=[".jpg",".jpeg"]),l.some(function(e){return r.endsWith(e)})}return/\/\*$/.test(t)?i===t.replace(/\/.*$/,""):o===t||!!/^\w+$/.test(t)&&((0,E.ZP)(!1,"Upload takes an invalidate 'accept' type '".concat(t,"'.Skip for check.")),!0)})}return!0},C=function(e,t,r){var n=function e(n,o){if(n.path=o||"",n.isFile)n.file(function(e){r(e)&&(n.fullPath&&!e.webkitRelativePath&&(Object.defineProperties(e,{webkitRelativePath:{writable:!0}}),e.webkitRelativePath=n.fullPath.replace(/^\//,""),Object.defineProperties(e,{webkitRelativePath:{writable:!1}})),t([e]))});else if(n.isDirectory){var i,a,l;i=function(t){t.forEach(function(t){e(t,"".concat(o).concat(n.name,"/"))})},a=n.createReader(),l=[],function e(){a.readEntries(function(t){var r=Array.prototype.slice.apply(t);l=l.concat(r),r.length?e():i(l)})}()}};e.forEach(function(e){n(e.webkitGetAsEntry())})},S=["component","prefixCls","className","disabled","id","style","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"],O=function(e){(0,u.Z)(r,e);var t=(0,d.Z)(r);function r(){(0,s.Z)(this,r);for(var e,n,i=arguments.length,a=Array(i),l=0;l{let{uid:r}=t;return r===e.uid});return -1===n?r.push(e):r[n]=e,r}function J(e,t){let r=void 0!==e.uid?"uid":"name";return t.filter(t=>t[r]===e[r])[0]}let K=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.split("/"),r=t[t.length-1],n=r.split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(n)||[""])[0]},Q=e=>0===e.indexOf("image/"),Y=e=>{if(e.type&&!e.thumbUrl)return Q(e.type);let t=e.thumbUrl||e.url||"",r=K(t);return!!(/^data:image\//.test(t)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(r))||!/^data:/.test(t)&&!r};function ee(e){return new Promise(t=>{if(!e.type||!Q(e.type)){t("");return}let r=document.createElement("canvas");r.width=200,r.height=200,r.style.cssText="position: fixed; left: 0; top: 0; width: 200px; height: 200px; z-index: 9999; display: none;",document.body.appendChild(r);let n=r.getContext("2d"),o=new Image;if(o.onload=()=>{let{width:e,height:i}=o,a=200,l=200,s=0,c=0;e>i?c=-((l=i*(200/e))-a)/2:s=-((a=e*(200/i))-l)/2,n.drawImage(o,s,c,a,l);let u=r.toDataURL();document.body.removeChild(r),window.URL.revokeObjectURL(o.src),t(u)},o.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){let t=new FileReader;t.onload=()=>{t.result&&(o.src=t.result)},t.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){let r=new FileReader;r.onload=()=>{r.result&&t(r.result)},r.readAsDataURL(e)}else o.src=window.URL.createObjectURL(e)})}var et=r(48689),er=r(23430),en=r(99611),eo=r(69814),ei=r(83062);let ea=n.forwardRef((e,t)=>{var r,o;let{prefixCls:i,className:l,style:s,locale:c,listType:u,file:d,items:p,progress:f,iconRender:m,actionIconRender:g,itemRender:h,isImgUrl:b,showPreviewIcon:v,showRemoveIcon:$,showDownloadIcon:y,previewIcon:w,removeIcon:k,downloadIcon:E,onPreview:x,onDownload:C,onClose:S}=e,{status:O}=d,[j,Z]=n.useState(O);n.useEffect(()=>{"removed"!==O&&Z(O)},[O]);let[I,D]=n.useState(!1);n.useEffect(()=>{let e=setTimeout(()=>{D(!0)},300);return()=>{clearTimeout(e)}},[]);let N=m(d),P=n.createElement("div",{className:`${i}-icon`},N);if("picture"===u||"picture-card"===u||"picture-circle"===u){if("uploading"!==j&&(d.thumbUrl||d.url)){let e=(null==b?void 0:b(d))?n.createElement("img",{src:d.thumbUrl||d.url,alt:d.name,className:`${i}-list-item-image`,crossOrigin:d.crossOrigin}):N,t=a()(`${i}-list-item-thumbnail`,{[`${i}-list-item-file`]:b&&!b(d)});P=n.createElement("a",{className:t,onClick:e=>x(d,e),href:d.url||d.thumbUrl,target:"_blank",rel:"noopener noreferrer"},e)}else{let e=a()(`${i}-list-item-thumbnail`,{[`${i}-list-item-file`]:"uploading"!==j});P=n.createElement("div",{className:e},N)}}let M=a()(`${i}-list-item`,`${i}-list-item-${j}`),F="string"==typeof d.linkProps?JSON.parse(d.linkProps):d.linkProps,A=$?g(("function"==typeof k?k(d):k)||n.createElement(et.Z,null),()=>S(d),i,c.removeFile):null,L=y&&"done"===j?g(("function"==typeof E?E(d):E)||n.createElement(er.Z,null),()=>C(d),i,c.downloadFile):null,z="picture-card"!==u&&"picture-circle"!==u&&n.createElement("span",{key:"download-delete",className:a()(`${i}-list-item-actions`,{picture:"picture"===u})},L,A),T=a()(`${i}-list-item-name`),X=d.url?[n.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:T,title:d.name},F,{href:d.url,onClick:e=>x(d,e)}),d.name),z]:[n.createElement("span",{key:"view",className:T,onClick:e=>x(d,e),title:d.name},d.name),z],_=v?n.createElement("a",{href:d.url||d.thumbUrl,target:"_blank",rel:"noopener noreferrer",style:d.url||d.thumbUrl?void 0:{pointerEvents:"none",opacity:.5},onClick:e=>x(d,e),title:c.previewFile},"function"==typeof w?w(d):w||n.createElement(en.Z,null)):null,H=("picture-card"===u||"picture-circle"===u)&&"uploading"!==j&&n.createElement("span",{className:`${i}-list-item-actions`},_,"done"===j&&L,A),{getPrefixCls:W}=n.useContext(R.E_),B=W(),q=n.createElement("div",{className:M},P,X,H,I&&n.createElement(U.ZP,{motionName:`${B}-fade`,visible:"uploading"===j,motionDeadline:2e3},e=>{let{className:t}=e,r="percent"in d?n.createElement(eo.Z,Object.assign({},f,{type:"line",percent:d.percent,"aria-label":d["aria-label"],"aria-labelledby":d["aria-labelledby"]})):null;return n.createElement("div",{className:a()(`${i}-list-item-progress`,t)},r)})),V=d.response&&"string"==typeof d.response?d.response:(null===(r=d.error)||void 0===r?void 0:r.statusText)||(null===(o=d.error)||void 0===o?void 0:o.message)||c.uploadError,G="error"===j?n.createElement(ei.Z,{title:V,getPopupContainer:e=>e.parentNode},q):q;return n.createElement("div",{className:a()(`${i}-list-item-container`,l),style:s,ref:t},h?h(G,d,p,{download:C.bind(null,d),preview:x.bind(null,d),remove:S.bind(null,d)}):G)}),el=n.forwardRef((e,t)=>{let{listType:r="text",previewFile:i=ee,onPreview:l,onDownload:s,onRemove:c,locale:u,iconRender:d,isImageUrl:p=Y,prefixCls:f,items:m=[],showPreviewIcon:g=!0,showRemoveIcon:h=!0,showDownloadIcon:b=!1,removeIcon:v,previewIcon:$,downloadIcon:y,progress:w={size:[-1,2],showInfo:!1},appendAction:k,appendActionVisible:E=!0,itemRender:x,disabled:C}=e,S=(0,H.Z)(),[O,j]=n.useState(!1);n.useEffect(()=>{("picture"===r||"picture-card"===r||"picture-circle"===r)&&(m||[]).forEach(e=>{"undefined"!=typeof document&&"undefined"!=typeof window&&window.FileReader&&window.File&&(e.originFileObj instanceof File||e.originFileObj instanceof Blob)&&void 0===e.thumbUrl&&(e.thumbUrl="",i&&i(e.originFileObj).then(t=>{e.thumbUrl=t||"",S()}))})},[r,m,i]),n.useEffect(()=>{j(!0)},[]);let Z=(e,t)=>{if(l)return null==t||t.preventDefault(),l(e)},I=e=>{"function"==typeof s?s(e):e.url&&window.open(e.url)},D=e=>{null==c||c(e)},N=e=>{if(d)return d(e,r);let t="uploading"===e.status,o=p&&p(e)?n.createElement(_,null):n.createElement(L,null),i=t?n.createElement(z.Z,null):n.createElement(T.Z,null);return"picture"===r?i=t?n.createElement(z.Z,null):o:("picture-card"===r||"picture-circle"===r)&&(i=t?u.uploading:o),i},P=(e,t,r,o)=>{let i={type:"text",size:"small",title:o,onClick:r=>{t(),(0,B.l$)(e)&&e.props.onClick&&e.props.onClick(r)},className:`${r}-list-item-action`,disabled:C};if((0,B.l$)(e)){let t=(0,B.Tm)(e,Object.assign(Object.assign({},e.props),{onClick:()=>{}}));return n.createElement(q.ZP,Object.assign({},i,{icon:t}))}return n.createElement(q.ZP,Object.assign({},i),n.createElement("span",null,e))};n.useImperativeHandle(t,()=>({handlePreview:Z,handleDownload:I}));let{getPrefixCls:M}=n.useContext(R.E_),F=M("upload",f),A=M(),X=a()(`${F}-list`,`${F}-list-${r}`),V=(0,o.Z)(m.map(e=>({key:e.uid,file:e}))),G="picture-card"===r||"picture-circle"===r?"animate-inline":"animate",J={motionDeadline:2e3,motionName:`${F}-${G}`,keys:V,motionAppear:O},K=n.useMemo(()=>{let e=Object.assign({},(0,W.Z)(A));return delete e.onAppearEnd,delete e.onEnterEnd,delete e.onLeaveEnd,e},[A]);return"picture-card"!==r&&"picture-circle"!==r&&(J=Object.assign(Object.assign({},K),J)),n.createElement("div",{className:X},n.createElement(U.V4,Object.assign({},J,{component:!1}),e=>{let{key:t,file:o,className:i,style:a}=e;return n.createElement(ea,{key:t,locale:u,prefixCls:F,className:i,style:a,file:o,items:m,progress:w,listType:r,isImgUrl:p,showPreviewIcon:g,showRemoveIcon:h,showDownloadIcon:b,removeIcon:v,previewIcon:$,downloadIcon:y,iconRender:N,actionIconRender:P,itemRender:x,onPreview:Z,onDownload:I,onClose:D})}),k&&n.createElement(U.ZP,Object.assign({},J,{visible:E,forceRender:!0}),e=>{let{className:t,style:r}=e;return(0,B.Tm)(k,e=>({className:a()(e.className,t),style:Object.assign(Object.assign(Object.assign({},r),{pointerEvents:t?"none":void 0}),e.style)}))}))});var es=r(14747),ec=r(33507),eu=r(67968),ed=r(45503),ep=e=>{let{componentCls:t,iconCls:r}=e;return{[`${t}-wrapper`]:{[`${t}-drag`]:{position:"relative",width:"100%",height:"100%",textAlign:"center",background:e.colorFillAlter,border:`${e.lineWidth}px dashed ${e.colorBorder}`,borderRadius:e.borderRadiusLG,cursor:"pointer",transition:`border-color ${e.motionDurationSlow}`,[t]:{padding:`${e.padding}px 0`},[`${t}-btn`]:{display:"table",width:"100%",height:"100%",outline:"none"},[`${t}-drag-container`]:{display:"table-cell",verticalAlign:"middle"},[`&:not(${t}-disabled):hover`]:{borderColor:e.colorPrimaryHover},[`p${t}-drag-icon`]:{marginBottom:e.margin,[r]:{color:e.colorPrimary,fontSize:e.uploadThumbnailSize}},[`p${t}-text`]:{margin:`0 0 ${e.marginXXS}px`,color:e.colorTextHeading,fontSize:e.fontSizeLG},[`p${t}-hint`]:{color:e.colorTextDescription,fontSize:e.fontSize},[`&${t}-disabled`]:{cursor:"not-allowed",[`p${t}-drag-icon ${r},
p${t}-text,
p${t}-hint
`]:{color:e.colorTextDisabled}}}}}},ef=e=>{let{componentCls:t,antCls:r,iconCls:n,fontSize:o,lineHeight:i}=e,a=`${t}-list-item`,l=`${a}-actions`,s=`${a}-action`,c=Math.round(o*i);return{[`${t}-wrapper`]:{[`${t}-list`]:Object.assign(Object.assign({},(0,es.dF)()),{lineHeight:e.lineHeight,[a]:{position:"relative",height:e.lineHeight*o,marginTop:e.marginXS,fontSize:o,display:"flex",alignItems:"center",transition:`background-color ${e.motionDurationSlow}`,"&:hover":{backgroundColor:e.controlItemBgHover},[`${a}-name`]:Object.assign(Object.assign({},es.vS),{padding:`0 ${e.paddingXS}px`,lineHeight:i,flex:"auto",transition:`all ${e.motionDurationSlow}`}),[l]:{[s]:{opacity:0},[`${s}${r}-btn-sm`]:{height:c,border:0,lineHeight:1,"> span":{transform:"scale(1)"}},[`
diff --git a/pilot/server/static/_next/static/chunks/955.53f3a4cf3e0b002f.js b/pilot/server/static/_next/static/chunks/955.228fa9fef23b31a4.js
similarity index 99%
rename from pilot/server/static/_next/static/chunks/955.53f3a4cf3e0b002f.js
rename to pilot/server/static/_next/static/chunks/955.228fa9fef23b31a4.js
index 851352c94..a9111bcc0 100644
--- a/pilot/server/static/_next/static/chunks/955.53f3a4cf3e0b002f.js
+++ b/pilot/server/static/_next/static/chunks/955.228fa9fef23b31a4.js
@@ -1 +1 @@
-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[955],{13135:function(e,t,n){"use strict";n.d(t,{_z:function(){return S},ZP:function(){return O},aG:function(){return P}});var l=n(85893),a=n(41118),r=n(30208),i=n(40911),s=n(48605);function c(e){let{chart:t}=e;return(0,l.jsx)("div",{className:"flex-1 min-w-0",children:(0,l.jsx)(a.Z,{className:"h-full",sx:{background:"transparent"},children:(0,l.jsxs)(r.Z,{className:"h-full",children:[(0,l.jsx)(i.ZP,{gutterBottom:!0,component:"div",children:t.chart_name}),(0,l.jsx)(i.ZP,{gutterBottom:!0,level:"body3",children:t.chart_desc}),(0,l.jsx)("div",{className:"h-[300px]",children:(0,l.jsx)(s.k,{style:{height:"100%"},options:{autoFit:!0,type:"interval",data:t.values,encode:{x:"name",y:"value",color:"type"},axis:{x:{labelAutoRotate:!1}}}})})]})})})}function o(e){let{chart:t}=e;return(0,l.jsx)("div",{className:"flex-1 min-w-0",children:(0,l.jsx)(a.Z,{className:"h-full",sx:{background:"transparent"},children:(0,l.jsxs)(r.Z,{className:"h-full",children:[(0,l.jsx)(i.ZP,{gutterBottom:!0,component:"div",children:t.chart_name}),(0,l.jsx)(i.ZP,{gutterBottom:!0,level:"body3",children:t.chart_desc}),(0,l.jsx)("div",{className:"h-[300px]",children:(0,l.jsx)(s.k,{style:{height:"100%"},options:{autoFit:!0,type:"view",data:t.values,children:[{type:"line",encode:{x:"name",y:"value",color:"type",shape:"smooth"}},{type:"area",encode:{x:"name",y:"value",color:"type",shape:"smooth"},legend:!1,style:{fillOpacity:.15}}],axis:{x:{labelAutoRotate:!1}}}})})]})})})}var d=n(61685),u=n(96486);function h(e){var t,n;let{chart:s}=e,c=(0,u.groupBy)(s.values,"type");return(0,l.jsx)("div",{className:"flex-1 min-w-0",children:(0,l.jsx)(a.Z,{className:"h-full overflow-auto",sx:{background:"transparent"},children:(0,l.jsxs)(r.Z,{className:"h-full",children:[(0,l.jsx)(i.ZP,{gutterBottom:!0,component:"div",children:s.chart_name}),(0,l.jsx)(i.ZP,{gutterBottom:!0,level:"body3",children:s.chart_desc}),(0,l.jsx)("div",{className:"flex-1",children:(0,l.jsxs)(d.Z,{"aria-label":"basic table",stripe:"odd",hoverRow:!0,borderAxis:"bothBetween",children:[(0,l.jsx)("thead",{children:(0,l.jsx)("tr",{children:Object.keys(c).map(e=>(0,l.jsx)("th",{children:e},e))})}),(0,l.jsx)("tbody",{children:null===(t=Object.values(c))||void 0===t?void 0:null===(n=t[0])||void 0===n?void 0:n.map((e,t)=>{var n;return(0,l.jsx)("tr",{children:null===(n=Object.keys(c))||void 0===n?void 0:n.map(e=>{var n;return(0,l.jsx)("td",{children:(null==c?void 0:null===(n=c[e])||void 0===n?void 0:n[t].value)||""},e)})},t)})})]})})]})})})}var m=n(67294),x=n(51009),p=n(71230),f=n(15746),v=n(83062),y=n(32983),j=n(80882),g=n(58989),_=n(5165);let b=e=>{let{charts:t,scopeOfCharts:n,ruleConfig:l}=e,a={};if(null==t||t.forEach(e=>{if(e.chartKnowledge.toSpec){let t=e.chartKnowledge.toSpec;e.chartKnowledge.toSpec=(e,n)=>({...t(e,n),dataProps:n})}else e.chartKnowledge.toSpec=(e,t)=>({dataProps:t});a[e.chartType]=e.chartKnowledge}),(null==n?void 0:n.exclude)&&n.exclude.forEach(e=>{Object.keys(a).includes(e)&&delete a[e]}),null==n?void 0:n.include){let e=n.include;Object.keys(a).forEach(t=>{e.includes(t)||delete a[t]})}let r={...n,custom:a},i={...l},s=new _.w({ckbCfg:r,ruleCfg:i});return s},w=e=>{var t;let{data:n,dataMetaMap:l,myChartAdvisor:a}=e,r=l?Object.keys(l).map(e=>({name:e,...l[e]})):null,i=null==a?void 0:a.adviseWithLog({data:n,dataProps:r});return null!==(t=null==i?void 0:i.advices)&&void 0!==t?t:[]};function Z(e,t){return t.every(t=>e.includes(t))}function N(e,t){let n=t.find(t=>t.name===e);return(null==n?void 0:n.recommendation)==="date"?t=>new Date(t[e]):e}let C=[{chartType:"multi_line_chart",chartKnowledge:{id:"multi_line_chart",name:"multi_line_chart",alias:["multi_line_chart"],family:["LineCharts"],def:"multi_line_chart uses lines with segments to show changes in data in a ordinal dimension",purpose:["Comparison","Trend"],coord:["Cartesian2D"],category:["Statistic"],shape:["Lines"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Time","Ordinal"]},{minQty:1,maxQty:"*",fieldConditions:["Interval"]},{minQty:0,maxQty:1,fieldConditions:["Nominal"]}],channel:["Color","Direction","Position"],recRate:"Recommended",toSpec:(e,t)=>{let n=t.find(e=>{var t;return t=e.levelOfMeasurements,["Time","Ordinal"].some(e=>t.includes(e))}),l=t.filter(e=>Z(e.levelOfMeasurements,["Interval"])),a=t.find(e=>Z(e.levelOfMeasurements,["Nominal"]));if(!n||!l)return null;let r={type:"view",autoFit:!0,data:e,children:[]};return l.forEach(e=>{let l={type:"line",encode:{x:N(n.name,t),y:e.name}};a&&(l.encode.color=a.name),r.children.push(l)}),r}},chineseName:"折线图"},{chartType:"multi_measure_column_chart",chartKnowledge:{id:"multi_measure_column_chart",name:"multi_measure_column_chart",alias:["multi_measure_column_chart"],family:["ColumnCharts"],def:"multi_measure_column_chart uses lines with segments to show changes in data in a ordinal dimension",purpose:["Comparison","Distribution"],coord:["Cartesian2D"],category:["Statistic"],shape:["Lines"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Interval"]},{minQty:1,maxQty:1,fieldConditions:["Nominal"]}],channel:["Color","Direction","Position"],recRate:"Recommended",toSpec:(e,t)=>{try{let n=null==t?void 0:t.filter(e=>Z(e.levelOfMeasurements,["Interval"])),l=null==t?void 0:t.find(e=>Z(e.levelOfMeasurements,["Nominal"]));if(!l||!n)return null;let a={type:"view",data:e,children:[]};return null==n||n.forEach(e=>{let t={type:"interval",encode:{x:l.name,y:e.name,color:()=>e.name,series:()=>e.name}};a.children.push(t)}),a}catch(e){return console.log(e),null}}},chineseName:"折线图"},{chartType:"multi_measure_line_chart",chartKnowledge:{id:"multi_measure_line_chart",name:"multi_measure_line_chart",alias:["multi_measure_line_chart"],family:["LineCharts"],def:"multi_measure_line_chart uses lines with segments to show changes in data in a ordinal dimension",purpose:["Comparison","Distribution"],coord:["Cartesian2D"],category:["Statistic"],shape:["Lines"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Interval"]},{minQty:1,maxQty:1,fieldConditions:["Nominal"]}],channel:["Color","Direction","Position"],recRate:"Recommended",toSpec:(e,t)=>{try{let n=null==t?void 0:t.filter(e=>Z(e.levelOfMeasurements,["Interval"])),l=null==t?void 0:t.find(e=>Z(e.levelOfMeasurements,["Nominal"]));if(!l||!n)return null;let a={type:"view",data:e,children:[]};return null==n||n.forEach(e=>{let n={type:"line",encode:{x:N(l.name,t),y:e.name,color:()=>e.name,series:()=>e.name}};a.children.push(n)}),a}catch(e){return console.log(e),null}}},chineseName:"折线图"}],P=e=>"response_line_chart"===e?["multi_line_chart","multi_measure_line_chart"]:"response_bar_chart"===e?["multi_measure_column_chart"]:"response_pie_chart"===e?["pie_chart"]:"response_scatter_chart"===e?["scatter_plot"]:"response_area_chart"===e?["area_chart"]:"response_heatmap_chart"===e?["heatmap"]:[],{Option:k}=x.default,S=e=>{let{data:t,chartType:n,scopeOfCharts:a,ruleConfig:r}=e,[i,c]=(0,m.useState)(),[o,d]=(0,m.useState)([]),[u,h]=(0,m.useState)();(0,m.useEffect)(()=>{c(b({charts:C,scopeOfCharts:void 0,ruleConfig:r}))},[r,a]),(0,m.useEffect)(()=>{if(t&&i){var e;let l=w({data:t,myChartAdvisor:i}),a=function(e){let{advices:t}=e;return t}({advices:l});a.sort((e,t)=>n.indexOf(t.type)-(null==n?void 0:n.indexOf(e.type))),d(a),h(null===(e=a[0])||void 0===e?void 0:e.type)}},[t,i,n]);let _=(0,m.useMemo)(()=>{if((null==o?void 0:o.length)>0){var e,t;let n=null!=u?u:o[0].type,a=null!==(t=null===(e=null==o?void 0:o.find(e=>e.type===n))||void 0===e?void 0:e.spec)&&void 0!==t?t:void 0;if(a)return(0,l.jsx)(s.k,{options:a},n)}},[o,u]);return u?(0,l.jsxs)("div",{children:[(0,l.jsxs)(p.Z,{justify:"start",children:[(0,l.jsx)(f.Z,{children:g.Z.t("Advices")}),(0,l.jsx)(f.Z,{style:{marginLeft:24},children:(0,l.jsx)(x.default,{value:u,placeholder:"Chart Switcher",style:{width:"180px"},onChange:e=>h(e),size:"small",children:null==o?void 0:o.map(e=>{let t=g.Z.t(e.type);return(0,l.jsx)(k,{value:e.type,children:(0,l.jsx)(v.Z,{title:t,placement:"right",children:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,l.jsx)(j.Z,{}),(0,l.jsx)("div",{style:{marginLeft:"2px"},children:t})]})})},e.type)})})})]}),(0,l.jsx)("div",{className:"auto-chart-content",children:_})]}):(0,l.jsx)(y.Z,{image:y.Z.PRESENTED_IMAGE_SIMPLE,description:"暂无合适的可视化视图"})};var O=function(e){let{chartsData:t}=e,n=(0,m.useMemo)(()=>{if(t){let e=[],n=null==t?void 0:t.filter(e=>"IndicatorValue"===e.chart_type);n.length>0&&e.push({charts:n,type:"IndicatorValue"});let l=null==t?void 0:t.filter(e=>"IndicatorValue"!==e.chart_type),a=l.length,r=0;return[[0],[1],[2],[1,2],[1,3],[2,1,2],[2,1,3],[3,1,3],[3,2,3]][a].forEach(t=>{if(t>0){let n=l.slice(r,r+t);r+=t,e.push({charts:n})}}),e}},[t]);return(0,l.jsx)("div",{className:"flex flex-col gap-3",children:null==n?void 0:n.map((e,t)=>(0,l.jsx)("div",{className:"".concat((null==e?void 0:e.type)!=="IndicatorValue"?"flex gap-3":""),children:e.charts.map(e=>"IndicatorValue"===e.chart_type?(0,l.jsx)("div",{className:"flex flex-row gap-3",children:e.values.map(e=>(0,l.jsx)("div",{className:"flex-1",children:(0,l.jsx)(a.Z,{sx:{background:"transparent"},children:(0,l.jsxs)(r.Z,{className:"justify-around",children:[(0,l.jsx)(i.ZP,{gutterBottom:!0,component:"div",children:e.name}),(0,l.jsx)(i.ZP,{children:e.value})]})})},e.name))},e.chart_uid):"LineChart"===e.chart_type?(0,l.jsx)(o,{chart:e},e.chart_uid):"BarChart"===e.chart_type?(0,l.jsx)(c,{chart:e},e.chart_uid):"Table"===e.chart_type?(0,l.jsx)(h,{chart:e},e.chart_uid):void 0)},"chart_row_".concat(t)))})}},34625:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var l=n(85893),a=n(67294),r=n(2453),i=n(83062),s=n(84553),c=n(71577),o=n(49591),d=n(88484),u=n(29158),h=n(50489),m=n(41468),x=function(e){var t;let{convUid:n,chatMode:x,onComplete:p,...f}=e,[v,y]=(0,a.useState)(!1),[j,g]=r.ZP.useMessage(),[_,b]=(0,a.useState)([]),[w,Z]=(0,a.useState)(),{model:N}=(0,a.useContext)(m.p),C=async e=>{var t;if(!e){r.ZP.error("Please select the *.(csv|xlsx|xls) file");return}if(!/\.(csv|xlsx|xls)$/.test(null!==(t=e.file.name)&&void 0!==t?t:"")){r.ZP.error("File type must be csv, xlsx or xls");return}b([e.file])},P=async()=>{y(!0);try{let e=new FormData;e.append("doc_file",_[0]),j.open({content:"Uploading ".concat(_[0].name),type:"loading",duration:0});let[t]=await (0,h.Vx)((0,h.qn)({convUid:n,chatMode:x,data:e,model:N,config:{timeout:36e5,onUploadProgress:e=>{let t=Math.ceil(e.loaded/(e.total||0)*100);Z(t)}}}));if(t)return;r.ZP.success("success"),null==p||p()}catch(e){r.ZP.error((null==e?void 0:e.message)||"Upload Error")}finally{y(!1),j.destroy()}};return(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:"flex items-start gap-2",children:[g,(0,l.jsx)(i.Z,{placement:"bottom",title:"File cannot be changed after upload",children:(0,l.jsx)(s.default,{disabled:v,className:"mr-1",beforeUpload:()=>!1,fileList:_,name:"file",accept:".csv,.xlsx,.xls",multiple:!1,onChange:C,showUploadList:{showDownloadIcon:!1,showPreviewIcon:!1,showRemoveIcon:!1},itemRender:()=>(0,l.jsx)(l.Fragment,{}),...f,children:(0,l.jsx)(c.ZP,{className:"flex justify-center items-center",type:"primary",disabled:v,icon:(0,l.jsx)(o.Z,{}),children:"Select File"})})}),(0,l.jsx)(c.ZP,{type:"primary",loading:v,className:"flex justify-center items-center",disabled:!_.length,icon:(0,l.jsx)(d.Z,{}),onClick:P,children:v?100===w?"Analysis":"Uploading":"Upload"}),!!_.length&&(0,l.jsxs)("div",{className:"mt-2 text-gray-500 text-sm flex items-center",children:[(0,l.jsx)(u.Z,{className:"mr-2"}),(0,l.jsx)("span",{children:null===(t=_[0])||void 0===t?void 0:t.name})]})]})})},p=function(e){let{onComplete:t}=e,{currentDialogue:n,scene:r,chatId:i}=(0,a.useContext)(m.p);return"chat_excel"!==r?null:(0,l.jsx)("div",{className:"max-w-md h-full relative",children:n?(0,l.jsxs)("div",{className:"flex h-8 overflow-hidden rounded",children:[(0,l.jsx)("div",{className:"flex items-center justify-center px-2 bg-gray-600 text-lg",children:(0,l.jsx)(u.Z,{className:"text-white"})}),(0,l.jsx)("div",{className:"flex items-center justify-center px-3 bg-gray-100 text-xs rounded-tr rounded-br dark:text-gray-800 truncate",children:n.select_param})]}):(0,l.jsx)(x,{convUid:i,chatMode:r,onComplete:t})})};n(23293);var f=n(78045),v=n(16165),y=n(96991),j=n(82579);function g(){let{isContract:e,setIsContract:t,scene:n}=(0,a.useContext)(m.p),r=n&&["chat_with_db_execute","chat_dashboard"].includes(n);return r?(0,l.jsxs)(f.ZP.Group,{value:e,defaultValue:!0,buttonStyle:"solid",onChange:()=>{t(!e)},children:[(0,l.jsxs)(f.ZP.Button,{value:!1,children:[(0,l.jsx)(v.Z,{component:j.ig,className:"mr-1"}),"Preview"]}),(0,l.jsxs)(f.ZP.Button,{value:!0,children:[(0,l.jsx)(y.Z,{className:"mr-1"}),"Editor"]})]}):null}var _=n(81799),b=n(98399),w=n(2093),Z=n(51009),N=n(23430),C=function(){let{scene:e,dbParam:t,setDbParam:n}=(0,a.useContext)(m.p),[r,i]=(0,a.useState)([]);(0,w.Z)(async()=>{let[,t]=await (0,h.Vx)((0,h.vD)(e));i(null!=t?t:[])},[e]);let s=(0,a.useMemo)(()=>{var e;return null===(e=r.map)||void 0===e?void 0:e.call(r,e=>({name:e.param,...b.S$[e.type]}))},[r]);return((0,a.useEffect)(()=>{s.length&&!t&&n(s[0].name)},[s,n,t]),s.length)?(0,l.jsx)(Z.default,{value:t,className:"w-36",onChange:e=>{n(e)},children:s.map(e=>(0,l.jsxs)(Z.default.Option,{children:[(0,l.jsx)(N.Z,{width:24,height:24,src:e.icon,label:e.label,className:"w-[1.5em] h-[1.5em] mr-1 inline-block mt-[-4px]"}),e.name]},e.name))}):null},P=n(577),k=n(11163),S=n(67421),O=function(){let{push:e}=(0,k.useRouter)(),{t}=(0,S.$G)(),{agentList:n,setAgentList:r}=(0,a.useContext)(m.p),{data:i=[]}=(0,P.Z)(async()=>{let[,e]=await (0,h.Vx)((0,h.N6)());return e&&e.length&&(null==r||r([e[0].name])),null!=e?e:[]});return i.length?(0,l.jsx)(Z.default,{className:"w-60",value:n,mode:"multiple",maxTagCount:1,maxTagTextLength:12,placeholder:t("Select_Plugins"),options:i.map(e=>({label:e.name,value:e.name})),allowClear:!0,onChange:e=>{null==r||r(e)}}):(0,l.jsx)(c.ZP,{type:"primary",onClick:()=>{e("/agent")},children:t("To_Plugin_Market")})},E=function(e){let{refreshHistory:t,modelChange:n}=e,{scene:r,refreshDialogList:i}=(0,a.useContext)(m.p);return(0,l.jsxs)("div",{className:"w-full py-2 px-4 md:px-4 flex flex-wrap items-center justify-center border-b border-gray-100 gap-1 md:gap-4",children:[(0,l.jsx)(_.Z,{onChange:n}),(0,l.jsx)(C,{}),"chat_excel"===r&&(0,l.jsx)(p,{onComplete:()=>{null==i||i(),null==t||t()}}),"chat_agent"===r&&(0,l.jsx)(O,{}),(0,l.jsx)(g,{})]})}},81799:function(e,t,n){"use strict";n.d(t,{A:function(){return u}});var l=n(85893),a=n(41468),r=n(51009),i=n(19284),s=n(25675),c=n.n(s),o=n(67294),d=n(67421);function u(e,t){var n;let{width:a,height:r}=t||{};return e?(0,l.jsx)(c(),{className:"rounded-full border border-gray-200 object-contain bg-white inline-block",width:a||24,height:r||24,src:(null===(n=i.Hf[e])||void 0===n?void 0:n.icon)||"/models/huggingface.svg",alt:"llm"}):null}t.Z=function(e){let{onChange:t}=e,{t:n}=(0,d.$G)(),{modelList:s,model:c}=(0,o.useContext)(a.p);return!s||s.length<=0?null:(0,l.jsx)(r.default,{value:c,placeholder:n("choose_model"),className:"w-52",onChange:e=>{null==t||t(e)},children:s.map(e=>{var t;return(0,l.jsx)(r.default.Option,{children:(0,l.jsxs)("div",{className:"flex items-center",children:[u(e),(0,l.jsx)("span",{className:"ml-2",children:(null===(t=i.Hf[e])||void 0===t?void 0:t.label)||e})]})},e)})})}},99513:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var l=n(85893),a=n(77119),r=n(63764),i=n(94184),s=n.n(i),c=n(67294),o=n(36782);function d(e){let{className:t,value:n,language:a="mysql",onChange:i,thoughts:d}=e,u=(0,c.useMemo)(()=>"mysql"!==a?n:d&&d.length>0?(0,o.WU)("-- ".concat(d," \n").concat(n)):(0,o.WU)(n),[n,d]);return(0,l.jsx)(r.ZP,{className:s()(t),value:u,language:a,onChange:i,theme:"vs-dark",options:{minimap:{enabled:!1},wordWrap:"on"}})}r._m.config({monaco:a})},23430:function(e,t,n){"use strict";var l=n(85893),a=n(25675),r=n.n(a);t.Z=function(e){let{src:t,label:n,width:a,height:i,className:s}=e;return(0,l.jsx)(r(),{className:"w-11 h-11 rounded-full mr-4 border border-gray-200 object-contain bg-white ".concat(s),width:a||44,height:i||44,src:t,alt:n||"db-icon"})}},30119:function(e,t,n){"use strict";n.d(t,{Tk:function(){return c},PR:function(){return o}});var l=n(2453),a=n(6154),r=n(83454);let i=a.Z.create({baseURL:r.env.API_BASE_URL});i.defaults.timeout=1e4,i.interceptors.response.use(e=>e.data,e=>Promise.reject(e)),n(96486);let s={"content-type":"application/json"},c=(e,t)=>{if(t){let n=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");n&&(e+="?".concat(n))}return i.get("/api"+e,{headers:s}).then(e=>e).catch(e=>{l.ZP.error(e),Promise.reject(e)})},o=(e,t)=>i.post(e,t,{headers:s}).then(e=>e).catch(e=>{l.ZP.error(e),Promise.reject(e)})},23293:function(){}}]);
\ No newline at end of file
+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[955],{13135:function(e,t,n){"use strict";n.d(t,{_z:function(){return S},ZP:function(){return O},aG:function(){return P}});var l=n(85893),a=n(41118),r=n(30208),i=n(40911),s=n(48605);function c(e){let{chart:t}=e;return(0,l.jsx)("div",{className:"flex-1 min-w-0",children:(0,l.jsx)(a.Z,{className:"h-full",sx:{background:"transparent"},children:(0,l.jsxs)(r.Z,{className:"h-full",children:[(0,l.jsx)(i.ZP,{gutterBottom:!0,component:"div",children:t.chart_name}),(0,l.jsx)(i.ZP,{gutterBottom:!0,level:"body3",children:t.chart_desc}),(0,l.jsx)("div",{className:"h-[300px]",children:(0,l.jsx)(s.k,{style:{height:"100%"},options:{autoFit:!0,type:"interval",data:t.values,encode:{x:"name",y:"value",color:"type"},axis:{x:{labelAutoRotate:!1}}}})})]})})})}function o(e){let{chart:t}=e;return(0,l.jsx)("div",{className:"flex-1 min-w-0",children:(0,l.jsx)(a.Z,{className:"h-full",sx:{background:"transparent"},children:(0,l.jsxs)(r.Z,{className:"h-full",children:[(0,l.jsx)(i.ZP,{gutterBottom:!0,component:"div",children:t.chart_name}),(0,l.jsx)(i.ZP,{gutterBottom:!0,level:"body3",children:t.chart_desc}),(0,l.jsx)("div",{className:"h-[300px]",children:(0,l.jsx)(s.k,{style:{height:"100%"},options:{autoFit:!0,type:"view",data:t.values,children:[{type:"line",encode:{x:"name",y:"value",color:"type",shape:"smooth"}},{type:"area",encode:{x:"name",y:"value",color:"type",shape:"smooth"},legend:!1,style:{fillOpacity:.15}}],axis:{x:{labelAutoRotate:!1}}}})})]})})})}var d=n(61685),u=n(96486);function h(e){var t,n;let{chart:s}=e,c=(0,u.groupBy)(s.values,"type");return(0,l.jsx)("div",{className:"flex-1 min-w-0",children:(0,l.jsx)(a.Z,{className:"h-full overflow-auto",sx:{background:"transparent"},children:(0,l.jsxs)(r.Z,{className:"h-full",children:[(0,l.jsx)(i.ZP,{gutterBottom:!0,component:"div",children:s.chart_name}),(0,l.jsx)(i.ZP,{gutterBottom:!0,level:"body3",children:s.chart_desc}),(0,l.jsx)("div",{className:"flex-1",children:(0,l.jsxs)(d.Z,{"aria-label":"basic table",stripe:"odd",hoverRow:!0,borderAxis:"bothBetween",children:[(0,l.jsx)("thead",{children:(0,l.jsx)("tr",{children:Object.keys(c).map(e=>(0,l.jsx)("th",{children:e},e))})}),(0,l.jsx)("tbody",{children:null===(t=Object.values(c))||void 0===t?void 0:null===(n=t[0])||void 0===n?void 0:n.map((e,t)=>{var n;return(0,l.jsx)("tr",{children:null===(n=Object.keys(c))||void 0===n?void 0:n.map(e=>{var n;return(0,l.jsx)("td",{children:(null==c?void 0:null===(n=c[e])||void 0===n?void 0:n[t].value)||""},e)})},t)})})]})})]})})})}var m=n(67294),x=n(51009),p=n(71230),f=n(15746),v=n(83062),y=n(32983),j=n(80882),g=n(58989),_=n(5165);let b=e=>{let{charts:t,scopeOfCharts:n,ruleConfig:l}=e,a={};if(null==t||t.forEach(e=>{if(e.chartKnowledge.toSpec){let t=e.chartKnowledge.toSpec;e.chartKnowledge.toSpec=(e,n)=>({...t(e,n),dataProps:n})}else e.chartKnowledge.toSpec=(e,t)=>({dataProps:t});a[e.chartType]=e.chartKnowledge}),(null==n?void 0:n.exclude)&&n.exclude.forEach(e=>{Object.keys(a).includes(e)&&delete a[e]}),null==n?void 0:n.include){let e=n.include;Object.keys(a).forEach(t=>{e.includes(t)||delete a[t]})}let r={...n,custom:a},i={...l},s=new _.w({ckbCfg:r,ruleCfg:i});return s},w=e=>{var t;let{data:n,dataMetaMap:l,myChartAdvisor:a}=e,r=l?Object.keys(l).map(e=>({name:e,...l[e]})):null,i=null==a?void 0:a.adviseWithLog({data:n,dataProps:r});return null!==(t=null==i?void 0:i.advices)&&void 0!==t?t:[]};function Z(e,t){return t.every(t=>e.includes(t))}function N(e,t){let n=t.find(t=>t.name===e);return(null==n?void 0:n.recommendation)==="date"?t=>new Date(t[e]):e}let C=[{chartType:"multi_line_chart",chartKnowledge:{id:"multi_line_chart",name:"multi_line_chart",alias:["multi_line_chart"],family:["LineCharts"],def:"multi_line_chart uses lines with segments to show changes in data in a ordinal dimension",purpose:["Comparison","Trend"],coord:["Cartesian2D"],category:["Statistic"],shape:["Lines"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Time","Ordinal"]},{minQty:1,maxQty:"*",fieldConditions:["Interval"]},{minQty:0,maxQty:1,fieldConditions:["Nominal"]}],channel:["Color","Direction","Position"],recRate:"Recommended",toSpec:(e,t)=>{let n=t.find(e=>{var t;return t=e.levelOfMeasurements,["Time","Ordinal"].some(e=>t.includes(e))}),l=t.filter(e=>Z(e.levelOfMeasurements,["Interval"])),a=t.find(e=>Z(e.levelOfMeasurements,["Nominal"]));if(!n||!l)return null;let r={type:"view",autoFit:!0,data:e,children:[]};return l.forEach(e=>{let l={type:"line",encode:{x:N(n.name,t),y:e.name}};a&&(l.encode.color=a.name),r.children.push(l)}),r}},chineseName:"折线图"},{chartType:"multi_measure_column_chart",chartKnowledge:{id:"multi_measure_column_chart",name:"multi_measure_column_chart",alias:["multi_measure_column_chart"],family:["ColumnCharts"],def:"multi_measure_column_chart uses lines with segments to show changes in data in a ordinal dimension",purpose:["Comparison","Distribution"],coord:["Cartesian2D"],category:["Statistic"],shape:["Lines"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Interval"]},{minQty:1,maxQty:1,fieldConditions:["Nominal"]}],channel:["Color","Direction","Position"],recRate:"Recommended",toSpec:(e,t)=>{try{let n=null==t?void 0:t.filter(e=>Z(e.levelOfMeasurements,["Interval"])),l=null==t?void 0:t.find(e=>Z(e.levelOfMeasurements,["Nominal"]));if(!l||!n)return null;let a={type:"view",data:e,children:[]};return null==n||n.forEach(e=>{let t={type:"interval",encode:{x:l.name,y:e.name,color:()=>e.name,series:()=>e.name}};a.children.push(t)}),a}catch(e){return console.log(e),null}}},chineseName:"折线图"},{chartType:"multi_measure_line_chart",chartKnowledge:{id:"multi_measure_line_chart",name:"multi_measure_line_chart",alias:["multi_measure_line_chart"],family:["LineCharts"],def:"multi_measure_line_chart uses lines with segments to show changes in data in a ordinal dimension",purpose:["Comparison","Distribution"],coord:["Cartesian2D"],category:["Statistic"],shape:["Lines"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Interval"]},{minQty:1,maxQty:1,fieldConditions:["Nominal"]}],channel:["Color","Direction","Position"],recRate:"Recommended",toSpec:(e,t)=>{try{let n=null==t?void 0:t.filter(e=>Z(e.levelOfMeasurements,["Interval"])),l=null==t?void 0:t.find(e=>Z(e.levelOfMeasurements,["Nominal"]));if(!l||!n)return null;let a={type:"view",data:e,children:[]};return null==n||n.forEach(e=>{let n={type:"line",encode:{x:N(l.name,t),y:e.name,color:()=>e.name,series:()=>e.name}};a.children.push(n)}),a}catch(e){return console.log(e),null}}},chineseName:"折线图"}],P=e=>"response_line_chart"===e?["multi_line_chart","multi_measure_line_chart"]:"response_bar_chart"===e?["multi_measure_column_chart"]:"response_pie_chart"===e?["pie_chart"]:"response_scatter_chart"===e?["scatter_plot"]:"response_area_chart"===e?["area_chart"]:"response_heatmap_chart"===e?["heatmap"]:[],{Option:k}=x.default,S=e=>{let{data:t,chartType:n,scopeOfCharts:a,ruleConfig:r}=e,[i,c]=(0,m.useState)(),[o,d]=(0,m.useState)([]),[u,h]=(0,m.useState)();(0,m.useEffect)(()=>{c(b({charts:C,scopeOfCharts:void 0,ruleConfig:r}))},[r,a]),(0,m.useEffect)(()=>{if(t&&i){var e;let l=w({data:t,myChartAdvisor:i}),a=function(e){let{advices:t}=e;return t}({advices:l});a.sort((e,t)=>n.indexOf(t.type)-(null==n?void 0:n.indexOf(e.type))),d(a),h(null===(e=a[0])||void 0===e?void 0:e.type)}},[t,i,n]);let _=(0,m.useMemo)(()=>{if((null==o?void 0:o.length)>0){var e,t;let n=null!=u?u:o[0].type,a=null!==(t=null===(e=null==o?void 0:o.find(e=>e.type===n))||void 0===e?void 0:e.spec)&&void 0!==t?t:void 0;if(a)return(0,l.jsx)(s.k,{options:a},n)}},[o,u]);return u?(0,l.jsxs)("div",{children:[(0,l.jsxs)(p.Z,{justify:"start",children:[(0,l.jsx)(f.Z,{children:g.Z.t("Advices")}),(0,l.jsx)(f.Z,{style:{marginLeft:24},children:(0,l.jsx)(x.default,{value:u,placeholder:"Chart Switcher",style:{width:"180px"},onChange:e=>h(e),size:"small",children:null==o?void 0:o.map(e=>{let t=g.Z.t(e.type);return(0,l.jsx)(k,{value:e.type,children:(0,l.jsx)(v.Z,{title:t,placement:"right",children:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,l.jsx)(j.Z,{}),(0,l.jsx)("div",{style:{marginLeft:"2px"},children:t})]})})},e.type)})})})]}),(0,l.jsx)("div",{className:"auto-chart-content",children:_})]}):(0,l.jsx)(y.Z,{image:y.Z.PRESENTED_IMAGE_SIMPLE,description:"暂无合适的可视化视图"})};var O=function(e){let{chartsData:t}=e,n=(0,m.useMemo)(()=>{if(t){let e=[],n=null==t?void 0:t.filter(e=>"IndicatorValue"===e.chart_type);n.length>0&&e.push({charts:n,type:"IndicatorValue"});let l=null==t?void 0:t.filter(e=>"IndicatorValue"!==e.chart_type),a=l.length,r=0;return[[0],[1],[2],[1,2],[1,3],[2,1,2],[2,1,3],[3,1,3],[3,2,3]][a].forEach(t=>{if(t>0){let n=l.slice(r,r+t);r+=t,e.push({charts:n})}}),e}},[t]);return(0,l.jsx)("div",{className:"flex flex-col gap-3",children:null==n?void 0:n.map((e,t)=>(0,l.jsx)("div",{className:"".concat((null==e?void 0:e.type)!=="IndicatorValue"?"flex gap-3":""),children:e.charts.map(e=>"IndicatorValue"===e.chart_type?(0,l.jsx)("div",{className:"flex flex-row gap-3",children:e.values.map(e=>(0,l.jsx)("div",{className:"flex-1",children:(0,l.jsx)(a.Z,{sx:{background:"transparent"},children:(0,l.jsxs)(r.Z,{className:"justify-around",children:[(0,l.jsx)(i.ZP,{gutterBottom:!0,component:"div",children:e.name}),(0,l.jsx)(i.ZP,{children:e.value})]})})},e.name))},e.chart_uid):"LineChart"===e.chart_type?(0,l.jsx)(o,{chart:e},e.chart_uid):"BarChart"===e.chart_type?(0,l.jsx)(c,{chart:e},e.chart_uid):"Table"===e.chart_type?(0,l.jsx)(h,{chart:e},e.chart_uid):void 0)},"chart_row_".concat(t)))})}},34625:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var l=n(85893),a=n(67294),r=n(2453),i=n(83062),s=n(84553),c=n(71577),o=n(49591),d=n(88484),u=n(29158),h=n(50489),m=n(41468),x=function(e){var t;let{convUid:n,chatMode:x,onComplete:p,...f}=e,[v,y]=(0,a.useState)(!1),[j,g]=r.ZP.useMessage(),[_,b]=(0,a.useState)([]),[w,Z]=(0,a.useState)(),{model:N}=(0,a.useContext)(m.p),C=async e=>{var t;if(!e){r.ZP.error("Please select the *.(csv|xlsx|xls) file");return}if(!/\.(csv|xlsx|xls)$/.test(null!==(t=e.file.name)&&void 0!==t?t:"")){r.ZP.error("File type must be csv, xlsx or xls");return}b([e.file])},P=async()=>{y(!0);try{let e=new FormData;e.append("doc_file",_[0]),j.open({content:"Uploading ".concat(_[0].name),type:"loading",duration:0});let[t]=await (0,h.Vx)((0,h.qn)({convUid:n,chatMode:x,data:e,model:N,config:{timeout:36e5,onUploadProgress:e=>{let t=Math.ceil(e.loaded/(e.total||0)*100);Z(t)}}}));if(t)return;r.ZP.success("success"),null==p||p()}catch(e){r.ZP.error((null==e?void 0:e.message)||"Upload Error")}finally{y(!1),j.destroy()}};return(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:"flex items-start gap-2",children:[g,(0,l.jsx)(i.Z,{placement:"bottom",title:"File cannot be changed after upload",children:(0,l.jsx)(s.default,{disabled:v,className:"mr-1",beforeUpload:()=>!1,fileList:_,name:"file",accept:".csv,.xlsx,.xls",multiple:!1,onChange:C,showUploadList:{showDownloadIcon:!1,showPreviewIcon:!1,showRemoveIcon:!1},itemRender:()=>(0,l.jsx)(l.Fragment,{}),...f,children:(0,l.jsx)(c.ZP,{className:"flex justify-center items-center",type:"primary",disabled:v,icon:(0,l.jsx)(o.Z,{}),children:"Select File"})})}),(0,l.jsx)(c.ZP,{type:"primary",loading:v,className:"flex justify-center items-center",disabled:!_.length,icon:(0,l.jsx)(d.Z,{}),onClick:P,children:v?100===w?"Analysis":"Uploading":"Upload"}),!!_.length&&(0,l.jsxs)("div",{className:"mt-2 text-gray-500 text-sm flex items-center",children:[(0,l.jsx)(u.Z,{className:"mr-2"}),(0,l.jsx)("span",{children:null===(t=_[0])||void 0===t?void 0:t.name})]})]})})},p=function(e){let{onComplete:t}=e,{currentDialogue:n,scene:r,chatId:i}=(0,a.useContext)(m.p);return"chat_excel"!==r?null:(0,l.jsx)("div",{className:"max-w-md h-full relative",children:n?(0,l.jsxs)("div",{className:"flex h-8 overflow-hidden rounded",children:[(0,l.jsx)("div",{className:"flex items-center justify-center px-2 bg-gray-600 text-lg",children:(0,l.jsx)(u.Z,{className:"text-white"})}),(0,l.jsx)("div",{className:"flex items-center justify-center px-3 bg-gray-100 text-xs rounded-tr rounded-br dark:text-gray-800 truncate",children:n.select_param})]}):(0,l.jsx)(x,{convUid:i,chatMode:r,onComplete:t})})};n(23293);var f=n(78045),v=n(16165),y=n(96991),j=n(82579);function g(){let{isContract:e,setIsContract:t,scene:n}=(0,a.useContext)(m.p),r=n&&["chat_with_db_execute","chat_dashboard"].includes(n);return r?(0,l.jsxs)(f.ZP.Group,{value:e,defaultValue:!0,buttonStyle:"solid",onChange:()=>{t(!e)},children:[(0,l.jsxs)(f.ZP.Button,{value:!1,children:[(0,l.jsx)(v.Z,{component:j.ig,className:"mr-1"}),"Preview"]}),(0,l.jsxs)(f.ZP.Button,{value:!0,children:[(0,l.jsx)(y.Z,{className:"mr-1"}),"Editor"]})]}):null}var _=n(81799),b=n(98399),w=n(2093),Z=n(51009),N=n(98978),C=function(){let{scene:e,dbParam:t,setDbParam:n}=(0,a.useContext)(m.p),[r,i]=(0,a.useState)([]);(0,w.Z)(async()=>{let[,t]=await (0,h.Vx)((0,h.vD)(e));i(null!=t?t:[])},[e]);let s=(0,a.useMemo)(()=>{var e;return null===(e=r.map)||void 0===e?void 0:e.call(r,e=>({name:e.param,...b.S$[e.type]}))},[r]);return((0,a.useEffect)(()=>{s.length&&!t&&n(s[0].name)},[s,n,t]),s.length)?(0,l.jsx)(Z.default,{value:t,className:"w-36",onChange:e=>{n(e)},children:s.map(e=>(0,l.jsxs)(Z.default.Option,{children:[(0,l.jsx)(N.Z,{width:24,height:24,src:e.icon,label:e.label,className:"w-[1.5em] h-[1.5em] mr-1 inline-block mt-[-4px]"}),e.name]},e.name))}):null},P=n(577),k=n(11163),S=n(67421),O=function(){let{push:e}=(0,k.useRouter)(),{t}=(0,S.$G)(),{agentList:n,setAgentList:r}=(0,a.useContext)(m.p),{data:i=[]}=(0,P.Z)(async()=>{let[,e]=await (0,h.Vx)((0,h.N6)());return e&&e.length&&(null==r||r([e[0].name])),null!=e?e:[]});return i.length?(0,l.jsx)(Z.default,{className:"w-60",value:n,mode:"multiple",maxTagCount:1,maxTagTextLength:12,placeholder:t("Select_Plugins"),options:i.map(e=>({label:e.name,value:e.name})),allowClear:!0,onChange:e=>{null==r||r(e)}}):(0,l.jsx)(c.ZP,{type:"primary",onClick:()=>{e("/agent")},children:t("To_Plugin_Market")})},E=function(e){let{refreshHistory:t,modelChange:n}=e,{scene:r,refreshDialogList:i}=(0,a.useContext)(m.p);return(0,l.jsxs)("div",{className:"w-full py-2 px-4 md:px-4 flex flex-wrap items-center justify-center border-b border-gray-100 gap-1 md:gap-4",children:[(0,l.jsx)(_.Z,{onChange:n}),(0,l.jsx)(C,{}),"chat_excel"===r&&(0,l.jsx)(p,{onComplete:()=>{null==i||i(),null==t||t()}}),"chat_agent"===r&&(0,l.jsx)(O,{}),(0,l.jsx)(g,{})]})}},81799:function(e,t,n){"use strict";n.d(t,{A:function(){return u}});var l=n(85893),a=n(41468),r=n(51009),i=n(19284),s=n(25675),c=n.n(s),o=n(67294),d=n(67421);function u(e,t){var n;let{width:a,height:r}=t||{};return e?(0,l.jsx)(c(),{className:"rounded-full border border-gray-200 object-contain bg-white inline-block",width:a||24,height:r||24,src:(null===(n=i.Hf[e])||void 0===n?void 0:n.icon)||"/models/huggingface.svg",alt:"llm"}):null}t.Z=function(e){let{onChange:t}=e,{t:n}=(0,d.$G)(),{modelList:s,model:c}=(0,o.useContext)(a.p);return!s||s.length<=0?null:(0,l.jsx)(r.default,{value:c,placeholder:n("choose_model"),className:"w-52",onChange:e=>{null==t||t(e)},children:s.map(e=>{var t;return(0,l.jsx)(r.default.Option,{children:(0,l.jsxs)("div",{className:"flex items-center",children:[u(e),(0,l.jsx)("span",{className:"ml-2",children:(null===(t=i.Hf[e])||void 0===t?void 0:t.label)||e})]})},e)})})}},99513:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var l=n(85893),a=n(77119),r=n(63764),i=n(94184),s=n.n(i),c=n(67294),o=n(36782);function d(e){let{className:t,value:n,language:a="mysql",onChange:i,thoughts:d}=e,u=(0,c.useMemo)(()=>"mysql"!==a?n:d&&d.length>0?(0,o.WU)("-- ".concat(d," \n").concat(n)):(0,o.WU)(n),[n,d]);return(0,l.jsx)(r.ZP,{className:s()(t),value:u,language:a,onChange:i,theme:"vs-dark",options:{minimap:{enabled:!1},wordWrap:"on"}})}r._m.config({monaco:a})},98978:function(e,t,n){"use strict";var l=n(85893),a=n(25675),r=n.n(a);t.Z=function(e){let{src:t,label:n,width:a,height:i,className:s}=e;return(0,l.jsx)(r(),{className:"w-11 h-11 rounded-full mr-4 border border-gray-200 object-contain bg-white ".concat(s),width:a||44,height:i||44,src:t,alt:n||"db-icon"})}},30119:function(e,t,n){"use strict";n.d(t,{Tk:function(){return c},PR:function(){return o}});var l=n(2453),a=n(6154),r=n(83454);let i=a.Z.create({baseURL:r.env.API_BASE_URL});i.defaults.timeout=1e4,i.interceptors.response.use(e=>e.data,e=>Promise.reject(e)),n(96486);let s={"content-type":"application/json"},c=(e,t)=>{if(t){let n=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");n&&(e+="?".concat(n))}return i.get("/api"+e,{headers:s}).then(e=>e).catch(e=>{l.ZP.error(e),Promise.reject(e)})},o=(e,t)=>i.post(e,t,{headers:s}).then(e=>e).catch(e=>{l.ZP.error(e),Promise.reject(e)})},23293:function(){}}]);
\ No newline at end of file
diff --git a/pilot/server/static/_next/static/chunks/pages/_app-7178aba7b953cb1d.js b/pilot/server/static/_next/static/chunks/pages/_app-a7ec5b45a9ed8418.js
similarity index 100%
rename from pilot/server/static/_next/static/chunks/pages/_app-7178aba7b953cb1d.js
rename to pilot/server/static/_next/static/chunks/pages/_app-a7ec5b45a9ed8418.js
diff --git a/pilot/server/static/_next/static/chunks/pages/agent-0ee536125426fba0.js b/pilot/server/static/_next/static/chunks/pages/agent-92e9dce47267e88d.js
similarity index 99%
rename from pilot/server/static/_next/static/chunks/pages/agent-0ee536125426fba0.js
rename to pilot/server/static/_next/static/chunks/pages/agent-92e9dce47267e88d.js
index 568a9160c..f85e906d1 100644
--- a/pilot/server/static/_next/static/chunks/pages/agent-0ee536125426fba0.js
+++ b/pilot/server/static/_next/static/chunks/pages/agent-92e9dce47267e88d.js
@@ -1 +1 @@
-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[56],{98165:function(e,l,a){"use strict";a.d(l,{Z:function(){return c}});var t=a(87462),s=a(67294),n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M168 504.2c1-43.7 10-86.1 26.9-126 17.3-41 42.1-77.7 73.7-109.4S337 212.3 378 195c42.4-17.9 87.4-27 133.9-27s91.5 9.1 133.8 27A341.5 341.5 0 01755 268.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.7 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c0-6.7-7.7-10.5-12.9-6.3l-56.4 44.1C765.8 155.1 646.2 92 511.8 92 282.7 92 96.3 275.6 92 503.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8zm756 7.8h-60c-4.4 0-7.9 3.5-8 7.8-1 43.7-10 86.1-26.9 126-17.3 41-42.1 77.8-73.7 109.4A342.45 342.45 0 01512.1 856a342.24 342.24 0 01-243.2-100.8c-9.9-9.9-19.2-20.4-27.8-31.4l60.2-47a8 8 0 00-3-14.1l-175.7-43c-5-1.2-9.9 2.6-9.9 7.7l-.7 181c0 6.7 7.7 10.5 12.9 6.3l56.4-44.1C258.2 868.9 377.8 932 512.2 932c229.2 0 415.5-183.7 419.8-411.8a8 8 0 00-8-8.2z"}}]},name:"sync",theme:"outlined"},i=a(84089),c=s.forwardRef(function(e,l){return s.createElement(i.Z,(0,t.Z)({},e,{ref:l,icon:n}))})},88484:function(e,l,a){"use strict";a.d(l,{Z:function(){return c}});var t=a(87462),s=a(67294),n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},i=a(84089),c=s.forwardRef(function(e,l){return s.createElement(i.Z,(0,t.Z)({},e,{ref:l,icon:n}))})},70355:function(e,l,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/agent",function(){return a(23867)}])},23867:function(e,l,a){"use strict";a.r(l),a.d(l,{default:function(){return S}});var t=a(85893),s=a(50489),n=a(577),i=a(39479),c=a(2453),r=a(83062),o=a(75081),d=a(59566),u=a(71577),h=a(85813),m=a(66309),f=a(67294),x=a(32983),p=a(67421),g=function(e){let{error:l,description:a,refresh:s}=e,{t:n}=(0,p.$G)();return(0,t.jsx)(x.Z,{image:"/empty.png",imageStyle:{width:320,height:320,margin:"0 auto",maxWidth:"100%",maxHeight:"100%"},className:"flex items-center justify-center flex-col h-full w-full",description:l?(0,t.jsx)(u.ZP,{type:"primary",onClick:s,children:n("try_again")}):null!=a?a:n("no_data")})},j=a(50888),Z=a(87462),v={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"}}]},name:"clear",theme:"outlined"},w=a(84089),y=f.forwardRef(function(e,l){return f.createElement(w.Z,(0,Z.Z)({},e,{ref:l,icon:v}))}),b=a(51046),N=a(68795),_=a(98165),k={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0138.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z"}}]},name:"github",theme:"outlined"},C=f.forwardRef(function(e,l){return f.createElement(w.Z,(0,Z.Z)({},e,{ref:l,icon:k}))}),P=function(){let{t:e}=(0,p.$G)(),[l,a]=(0,f.useState)(!1),[x,Z]=(0,f.useState)(!1),[v,w]=(0,f.useState)(),[k]=i.Z.useForm(),P=(0,f.useMemo)(()=>({pageNo:1,pageSize:20}),[]),{data:V=[],loading:z,refresh:H}=(0,n.Z)(async()=>{var e;let l={page_index:P.pageNo,page_size:P.pageSize,filter:k.getFieldsValue()},[a,t]=await (0,s.Vx)((0,s.bC)(l));return Z(!!a),null!==(e=null==t?void 0:t.datas)&&void 0!==e?e:[]}),M=async()=>{try{a(!0);let[e]=await (0,s.Vx)((0,s.DM)());if(e)return;c.ZP.success("success"),H()}finally{a(!1)}},S=(0,f.useCallback)(async(e,l,a)=>{if(v)return;w(l);let[t]=await (0,s.Vx)((a?s.v6:s.YU)(e));t||(c.ZP.success("success"),H()),w(void 0)},[v,H]),E=(0,f.useCallback)((e,l)=>l===v?(0,t.jsx)(j.Z,{}):e.installed?(0,t.jsx)(r.Z,{title:"Uninstall",children:(0,t.jsx)("div",{className:"w-full h-full",onClick:()=>{S(e.name,l,!1)},children:(0,t.jsx)(y,{})})}):(0,t.jsx)(r.Z,{title:"Install",children:(0,t.jsx)("div",{className:"w-full h-full",onClick:()=>{S(e.name,l,!0)},children:(0,t.jsx)(b.Z,{})})}),[v,S]);return(0,t.jsxs)(o.Z,{spinning:z,children:[(0,t.jsxs)(i.Z,{form:k,layout:"inline",onFinish:H,className:"mb-2",children:[(0,t.jsx)(i.Z.Item,{className:"!mb-2",name:"name",label:"Name",children:(0,t.jsx)(d.default,{allowClear:!0,className:"w-48"})}),(0,t.jsxs)(i.Z.Item,{children:[(0,t.jsx)(u.ZP,{className:"mr-2",type:"primary",htmlType:"submit",icon:(0,t.jsx)(N.Z,{}),children:e("Search")}),(0,t.jsx)(u.ZP,{loading:l,type:"primary",icon:(0,t.jsx)(_.Z,{}),onClick:M,children:e("Update_From_Github")})]})]}),!V.length&&!z&&(0,t.jsx)(g,{error:x,refresh:H}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 md:gap-4",children:V.map((e,l)=>(0,t.jsxs)(h.Z,{className:"w-full md:w-1/2 lg:w-1/3 xl:w-1/4",actions:[E(e,l),(0,t.jsx)(r.Z,{title:"Github",children:(0,t.jsx)("div",{className:"w-full h-full",onClick:()=>{window.open(e.storage_url,"_blank")},children:(0,t.jsx)(C,{})})},"github")],children:[(0,t.jsx)(r.Z,{title:e.name,children:(0,t.jsx)("h2",{className:"mb-2 text-base font-semibold line-clamp-1",children:e.name})}),e.author&&(0,t.jsx)(m.Z,{children:e.author}),e.version&&(0,t.jsxs)(m.Z,{children:["v",e.version]}),e.type&&(0,t.jsxs)(m.Z,{children:["Type ",e.type]}),e.storage_channel&&(0,t.jsx)(m.Z,{children:e.storage_channel}),(0,t.jsx)(r.Z,{title:e.description,children:(0,t.jsx)("p",{className:"mt-2 line-clamp-2 text-gray-400 text-sm",children:e.description})})]},e.id))})]})},V=a(84553),z=a(88484),H=function(){let{t:e}=(0,p.$G)(),[l,a]=c.ZP.useMessage(),[i,d]=(0,f.useState)(!1),[x,Z]=(0,f.useState)(!1),[v,w]=(0,f.useState)(),{data:b=[],loading:N,refresh:_}=(0,n.Z)(async()=>{let[e,l]=await (0,s.Vx)((0,s.N6)());return Z(!!e),null!=l?l:[]}),k=async(e,l)=>{if(v)return;w(l);let[a]=await (0,s.Vx)((0,s.YU)(e));c.ZP[a?"error":"success"](a?"failed":"success"),a||_(),w(void 0)},C=(0,f.useCallback)((e,l)=>l===v?(0,t.jsx)(j.Z,{}):(0,t.jsx)(r.Z,{title:"Uninstall",children:(0,t.jsx)("div",{className:"w-full h-full",onClick:()=>{k(e.name,l)},children:(0,t.jsx)(y,{})})}),[v]),P=async e=>{if(!e){c.ZP.error("Please select the *.zip,*.rar file");return}try{let a=e.file;d(!0);let t=new FormData;t.append("doc_file",a),l.open({content:"Uploading ".concat(a.name),type:"loading",duration:0});let[n]=await (0,s.Vx)((0,s.Kn)(void 0,t,{timeout:6e4}));if(n)return;c.ZP.success("success"),_()}catch(e){c.ZP.error((null==e?void 0:e.message)||"Upload Error")}finally{d(!1),l.destroy()}};return(0,t.jsxs)(o.Z,{spinning:N,children:[a,(0,t.jsx)("div",{children:(0,t.jsx)(V.default,{disabled:N,className:"mr-1",beforeUpload:()=>!1,name:"file",accept:".zip,.rar",multiple:!1,onChange:P,showUploadList:{showDownloadIcon:!1,showPreviewIcon:!1,showRemoveIcon:!1},itemRender:()=>(0,t.jsx)(t.Fragment,{}),children:(0,t.jsx)(u.ZP,{loading:i,type:"primary",icon:(0,t.jsx)(z.Z,{}),children:e("Upload")})})}),!b.length&&!N&&(0,t.jsx)(g,{error:x,refresh:_}),(0,t.jsx)("div",{className:"flex gap-2 md:gap-4",children:b.map((e,l)=>(0,t.jsxs)(h.Z,{className:"w-full md:w-1/2 lg:w-1/3 xl:w-1/4",actions:[C(e,l)],children:[(0,t.jsx)(r.Z,{title:e.name,children:(0,t.jsx)("h2",{className:"mb-2 text-base font-semibold line-clamp-1",children:e.name})}),e.version&&(0,t.jsxs)(m.Z,{children:["v",e.version]}),e.type&&(0,t.jsxs)(m.Z,{children:["Type ",e.type]}),(0,t.jsx)(r.Z,{title:e.description,children:(0,t.jsx)("p",{className:"mt-2 line-clamp-2 text-gray-400 text-sm",children:e.description})})]},e.id))})]})},M=a(44442),S=function(){let{t:e}=(0,p.$G)(),[l,a]=(0,f.useState)("market"),s=(0,f.useMemo)(()=>[{key:"market",label:e("Market_Plugins"),children:(0,t.jsx)(P,{})},{key:"my",label:e("My_Plugins"),children:"market"===l?null:(0,t.jsx)(H,{})}],[e,l]);return(0,t.jsx)("div",{className:"h-screen p-4 md:p-6 overflow-y-auto",children:(0,t.jsx)(M.Z,{activeKey:l,items:s,onChange:a})})}}},function(e){e.O(0,[64,479,442,553,813,924,774,888,179],function(){return e(e.s=70355)}),_N_E=e.O()}]);
\ No newline at end of file
+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[56],{98165:function(e,l,a){"use strict";a.d(l,{Z:function(){return c}});var t=a(87462),s=a(67294),n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M168 504.2c1-43.7 10-86.1 26.9-126 17.3-41 42.1-77.7 73.7-109.4S337 212.3 378 195c42.4-17.9 87.4-27 133.9-27s91.5 9.1 133.8 27A341.5 341.5 0 01755 268.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.7 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c0-6.7-7.7-10.5-12.9-6.3l-56.4 44.1C765.8 155.1 646.2 92 511.8 92 282.7 92 96.3 275.6 92 503.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8zm756 7.8h-60c-4.4 0-7.9 3.5-8 7.8-1 43.7-10 86.1-26.9 126-17.3 41-42.1 77.8-73.7 109.4A342.45 342.45 0 01512.1 856a342.24 342.24 0 01-243.2-100.8c-9.9-9.9-19.2-20.4-27.8-31.4l60.2-47a8 8 0 00-3-14.1l-175.7-43c-5-1.2-9.9 2.6-9.9 7.7l-.7 181c0 6.7 7.7 10.5 12.9 6.3l56.4-44.1C258.2 868.9 377.8 932 512.2 932c229.2 0 415.5-183.7 419.8-411.8a8 8 0 00-8-8.2z"}}]},name:"sync",theme:"outlined"},i=a(84089),c=s.forwardRef(function(e,l){return s.createElement(i.Z,(0,t.Z)({},e,{ref:l,icon:n}))})},88484:function(e,l,a){"use strict";a.d(l,{Z:function(){return c}});var t=a(87462),s=a(67294),n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},i=a(84089),c=s.forwardRef(function(e,l){return s.createElement(i.Z,(0,t.Z)({},e,{ref:l,icon:n}))})},70355:function(e,l,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/agent",function(){return a(23867)}])},23867:function(e,l,a){"use strict";a.r(l),a.d(l,{default:function(){return S}});var t=a(85893),s=a(50489),n=a(577),i=a(39479),c=a(2453),r=a(83062),o=a(75081),d=a(59566),u=a(71577),h=a(85813),m=a(66309),f=a(67294),x=a(32983),p=a(67421),g=function(e){let{error:l,description:a,refresh:s}=e,{t:n}=(0,p.$G)();return(0,t.jsx)(x.Z,{image:"/empty.png",imageStyle:{width:320,height:320,margin:"0 auto",maxWidth:"100%",maxHeight:"100%"},className:"flex items-center justify-center flex-col h-full w-full",description:l?(0,t.jsx)(u.ZP,{type:"primary",onClick:s,children:n("try_again")}):null!=a?a:n("no_data")})},j=a(50888),Z=a(87462),v={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"}}]},name:"clear",theme:"outlined"},w=a(84089),y=f.forwardRef(function(e,l){return f.createElement(w.Z,(0,Z.Z)({},e,{ref:l,icon:v}))}),b=a(23430),N=a(68795),_=a(98165),k={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0138.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z"}}]},name:"github",theme:"outlined"},C=f.forwardRef(function(e,l){return f.createElement(w.Z,(0,Z.Z)({},e,{ref:l,icon:k}))}),P=function(){let{t:e}=(0,p.$G)(),[l,a]=(0,f.useState)(!1),[x,Z]=(0,f.useState)(!1),[v,w]=(0,f.useState)(),[k]=i.Z.useForm(),P=(0,f.useMemo)(()=>({pageNo:1,pageSize:20}),[]),{data:V=[],loading:z,refresh:H}=(0,n.Z)(async()=>{var e;let l={page_index:P.pageNo,page_size:P.pageSize,filter:k.getFieldsValue()},[a,t]=await (0,s.Vx)((0,s.bC)(l));return Z(!!a),null!==(e=null==t?void 0:t.datas)&&void 0!==e?e:[]}),M=async()=>{try{a(!0);let[e]=await (0,s.Vx)((0,s.DM)());if(e)return;c.ZP.success("success"),H()}finally{a(!1)}},S=(0,f.useCallback)(async(e,l,a)=>{if(v)return;w(l);let[t]=await (0,s.Vx)((a?s.v6:s.YU)(e));t||(c.ZP.success("success"),H()),w(void 0)},[v,H]),E=(0,f.useCallback)((e,l)=>l===v?(0,t.jsx)(j.Z,{}):e.installed?(0,t.jsx)(r.Z,{title:"Uninstall",children:(0,t.jsx)("div",{className:"w-full h-full",onClick:()=>{S(e.name,l,!1)},children:(0,t.jsx)(y,{})})}):(0,t.jsx)(r.Z,{title:"Install",children:(0,t.jsx)("div",{className:"w-full h-full",onClick:()=>{S(e.name,l,!0)},children:(0,t.jsx)(b.Z,{})})}),[v,S]);return(0,t.jsxs)(o.Z,{spinning:z,children:[(0,t.jsxs)(i.Z,{form:k,layout:"inline",onFinish:H,className:"mb-2",children:[(0,t.jsx)(i.Z.Item,{className:"!mb-2",name:"name",label:"Name",children:(0,t.jsx)(d.default,{allowClear:!0,className:"w-48"})}),(0,t.jsxs)(i.Z.Item,{children:[(0,t.jsx)(u.ZP,{className:"mr-2",type:"primary",htmlType:"submit",icon:(0,t.jsx)(N.Z,{}),children:e("Search")}),(0,t.jsx)(u.ZP,{loading:l,type:"primary",icon:(0,t.jsx)(_.Z,{}),onClick:M,children:e("Update_From_Github")})]})]}),!V.length&&!z&&(0,t.jsx)(g,{error:x,refresh:H}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 md:gap-4",children:V.map((e,l)=>(0,t.jsxs)(h.Z,{className:"w-full md:w-1/2 lg:w-1/3 xl:w-1/4",actions:[E(e,l),(0,t.jsx)(r.Z,{title:"Github",children:(0,t.jsx)("div",{className:"w-full h-full",onClick:()=>{window.open(e.storage_url,"_blank")},children:(0,t.jsx)(C,{})})},"github")],children:[(0,t.jsx)(r.Z,{title:e.name,children:(0,t.jsx)("h2",{className:"mb-2 text-base font-semibold line-clamp-1",children:e.name})}),e.author&&(0,t.jsx)(m.Z,{children:e.author}),e.version&&(0,t.jsxs)(m.Z,{children:["v",e.version]}),e.type&&(0,t.jsxs)(m.Z,{children:["Type ",e.type]}),e.storage_channel&&(0,t.jsx)(m.Z,{children:e.storage_channel}),(0,t.jsx)(r.Z,{title:e.description,children:(0,t.jsx)("p",{className:"mt-2 line-clamp-2 text-gray-400 text-sm",children:e.description})})]},e.id))})]})},V=a(84553),z=a(88484),H=function(){let{t:e}=(0,p.$G)(),[l,a]=c.ZP.useMessage(),[i,d]=(0,f.useState)(!1),[x,Z]=(0,f.useState)(!1),[v,w]=(0,f.useState)(),{data:b=[],loading:N,refresh:_}=(0,n.Z)(async()=>{let[e,l]=await (0,s.Vx)((0,s.N6)());return Z(!!e),null!=l?l:[]}),k=async(e,l)=>{if(v)return;w(l);let[a]=await (0,s.Vx)((0,s.YU)(e));c.ZP[a?"error":"success"](a?"failed":"success"),a||_(),w(void 0)},C=(0,f.useCallback)((e,l)=>l===v?(0,t.jsx)(j.Z,{}):(0,t.jsx)(r.Z,{title:"Uninstall",children:(0,t.jsx)("div",{className:"w-full h-full",onClick:()=>{k(e.name,l)},children:(0,t.jsx)(y,{})})}),[v]),P=async e=>{if(!e){c.ZP.error("Please select the *.zip,*.rar file");return}try{let a=e.file;d(!0);let t=new FormData;t.append("doc_file",a),l.open({content:"Uploading ".concat(a.name),type:"loading",duration:0});let[n]=await (0,s.Vx)((0,s.Kn)(void 0,t,{timeout:6e4}));if(n)return;c.ZP.success("success"),_()}catch(e){c.ZP.error((null==e?void 0:e.message)||"Upload Error")}finally{d(!1),l.destroy()}};return(0,t.jsxs)(o.Z,{spinning:N,children:[a,(0,t.jsx)("div",{children:(0,t.jsx)(V.default,{disabled:N,className:"mr-1",beforeUpload:()=>!1,name:"file",accept:".zip,.rar",multiple:!1,onChange:P,showUploadList:{showDownloadIcon:!1,showPreviewIcon:!1,showRemoveIcon:!1},itemRender:()=>(0,t.jsx)(t.Fragment,{}),children:(0,t.jsx)(u.ZP,{loading:i,type:"primary",icon:(0,t.jsx)(z.Z,{}),children:e("Upload")})})}),!b.length&&!N&&(0,t.jsx)(g,{error:x,refresh:_}),(0,t.jsx)("div",{className:"flex gap-2 md:gap-4",children:b.map((e,l)=>(0,t.jsxs)(h.Z,{className:"w-full md:w-1/2 lg:w-1/3 xl:w-1/4",actions:[C(e,l)],children:[(0,t.jsx)(r.Z,{title:e.name,children:(0,t.jsx)("h2",{className:"mb-2 text-base font-semibold line-clamp-1",children:e.name})}),e.version&&(0,t.jsxs)(m.Z,{children:["v",e.version]}),e.type&&(0,t.jsxs)(m.Z,{children:["Type ",e.type]}),(0,t.jsx)(r.Z,{title:e.description,children:(0,t.jsx)("p",{className:"mt-2 line-clamp-2 text-gray-400 text-sm",children:e.description})})]},e.id))})]})},M=a(44442),S=function(){let{t:e}=(0,p.$G)(),[l,a]=(0,f.useState)("market"),s=(0,f.useMemo)(()=>[{key:"market",label:e("Market_Plugins"),children:(0,t.jsx)(P,{})},{key:"my",label:e("My_Plugins"),children:"market"===l?null:(0,t.jsx)(H,{})}],[e,l]);return(0,t.jsx)("div",{className:"h-screen p-4 md:p-6 overflow-y-auto",children:(0,t.jsx)(M.Z,{activeKey:l,items:s,onChange:a})})}}},function(e){e.O(0,[64,479,442,553,813,924,774,888,179],function(){return e(e.s=70355)}),_N_E=e.O()}]);
\ No newline at end of file
diff --git a/pilot/server/static/_next/static/chunks/pages/database-2f26b925c44f1b12.js b/pilot/server/static/_next/static/chunks/pages/database-3140f507fe61ccb8.js
similarity index 98%
rename from pilot/server/static/_next/static/chunks/pages/database-2f26b925c44f1b12.js
rename to pilot/server/static/_next/static/chunks/pages/database-3140f507fe61ccb8.js
index 1672ad20d..c4473b48e 100644
--- a/pilot/server/static/_next/static/chunks/pages/database-2f26b925c44f1b12.js
+++ b/pilot/server/static/_next/static/chunks/pages/database-3140f507fe61ccb8.js
@@ -1 +1 @@
-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[498],{55286:function(e,s,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/database",function(){return l(78466)}])},23430:function(e,s,l){"use strict";var a=l(85893),t=l(25675),r=l.n(t);s.Z=function(e){let{src:s,label:l,width:t,height:n,className:i}=e;return(0,a.jsx)(r(),{className:"w-11 h-11 rounded-full mr-4 border border-gray-200 object-contain bg-white ".concat(i),width:t||44,height:n||44,src:s,alt:l||"db-icon"})}},45247:function(e,s,l){"use strict";var a=l(85893),t=l(50888);s.Z=function(e){let{visible:s}=e;return s?(0,a.jsx)("div",{className:"absolute w-full h-full top-0 left-0 flex justify-center items-center z-10 bg-white dark:bg-black bg-opacity-50 dark:bg-opacity-50 backdrop-blur-sm text-3xl animate-fade animate-duration-200",children:(0,a.jsx)(t.Z,{})}):null}},78466:function(e,s,l){"use strict";l.r(s),l.d(s,{default:function(){return F},isFileDb:function(){return P}});var a=l(85893),t=l(67294),r=l(2093),n=l(12069),i=l(2453),c=l(71577),d=l(40411),o=l(85265),m=l(85813),u=l(32983),b=l(39479),p=l(51009),x=l(59566),h=l(48928),f=l(50489),j=l(67421),y=function(e){let{open:s,choiceDBType:l,dbTypeList:r,editValue:d,dbNames:o,onClose:m,onSuccess:u}=e,[y,Z]=(0,t.useState)(!1),{t:_}=(0,j.$G)(),[v]=b.Z.useForm(),N=b.Z.useWatch("db_type",v),w=(0,t.useMemo)(()=>P(r,N),[r,N]);(0,t.useEffect)(()=>{l&&v.setFieldValue("db_type",l)},[l]),(0,t.useEffect)(()=>{d&&v.setFieldsValue({...d})},[d]),(0,t.useEffect)(()=>{s||v.resetFields()},[s]);let g=async e=>{let{db_host:s,db_path:l,db_port:a,...t}=e;if(!d&&o.some(e=>e===t.db_name)){i.ZP.error("The database already exists!");return}let r={db_host:w?void 0:s,db_port:w?void 0:a,file_path:w?l:void 0,...t};Z(!0);try{let[e]=await (0,f.Vx)((0,f.KS)(r));if(e)return;let[s]=await (0,f.Vx)((d?f.mR:f.b_)(r));if(s){i.ZP.error(s.message);return}i.ZP.success("success"),null==u||u()}catch(e){i.ZP.error(e.message)}finally{Z(!1)}},k=(0,t.useMemo)(()=>!!d||!!l,[d,l]);return(0,a.jsx)(n.default,{open:s,width:400,title:_(d?"Edit":"create_database"),maskClosable:!1,footer:null,onCancel:m,children:(0,a.jsxs)(b.Z,{form:v,className:"pt-2",labelCol:{span:6},labelAlign:"left",onFinish:g,children:[(0,a.jsx)(b.Z.Item,{name:"db_type",label:"DB Type",className:"mb-3",rules:[{required:!0}],children:(0,a.jsx)(p.default,{"aria-readonly":k,disabled:k,options:r})}),(0,a.jsx)(b.Z.Item,{name:"db_name",label:"DB Name",className:"mb-3",rules:[{required:!0}],children:(0,a.jsx)(x.default,{readOnly:!!d,disabled:!!d})}),!0===w&&(0,a.jsx)(b.Z.Item,{name:"db_path",label:"Path",className:"mb-3",rules:[{required:!0}],children:(0,a.jsx)(x.default,{})}),!1===w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b.Z.Item,{name:"db_user",label:"Username",className:"mb-3",rules:[{required:!0}],children:(0,a.jsx)(x.default,{})}),(0,a.jsx)(b.Z.Item,{name:"db_pwd",label:"Password",className:"mb-3",rules:[{required:!0}],children:(0,a.jsx)(x.default,{type:"password"})}),(0,a.jsx)(b.Z.Item,{name:"db_host",label:"Host",className:"mb-3",rules:[{required:!0}],children:(0,a.jsx)(x.default,{})}),(0,a.jsx)(b.Z.Item,{name:"db_port",label:"Port",className:"mb-3",rules:[{required:!0}],children:(0,a.jsx)(h.Z,{min:1,step:1,max:65535})})]}),(0,a.jsx)(b.Z.Item,{name:"comment",label:"Remark",className:"mb-3",children:(0,a.jsx)(x.default,{})}),(0,a.jsxs)(b.Z.Item,{className:"flex flex-row-reverse pt-1 mb-0",children:[(0,a.jsx)(c.ZP,{htmlType:"submit",type:"primary",size:"middle",className:"mr-1",loading:y,children:"Save"}),(0,a.jsx)(c.ZP,{size:"middle",onClick:m,children:"Cancel"})]})]})})},Z=l(83062),_=l(23430),v=function(e){let{info:s,onClick:l}=e,r=(0,t.useCallback)(()=>{s.disabled||null==l||l()},[s.disabled,l]);return(0,a.jsxs)("div",{className:"relative flex flex-col py-4 px-4 w-72 h-32 cursor-pointer rounded-lg justify-between text-black bg-white border-gray-200 border hover:shadow-md dark:border-gray-600 dark:bg-black dark:text-white dark:hover:border-white transition-all ".concat(s.disabled?"grayscale cursor-no-drop":""),onClick:r,children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(_.Z,{src:s.icon,label:s.label}),(0,a.jsx)("div",{className:"flex flex-col",children:(0,a.jsx)("h2",{className:"text-sm font-semibold",children:s.label})})]}),(0,a.jsx)(Z.Z,{title:s.desc,children:(0,a.jsx)("p",{className:"text-sm text-gray-500 font-normal line-clamp-2",children:s.desc})})]})},N=l(24969),w=l(36531),g=l(27704),k=l(45247),C=l(98399);function P(e,s){var l;return null===(l=e.find(e=>e.value===s))||void 0===l?void 0:l.isFileDb}var F=function(){let[e,s]=(0,t.useState)([]),[l,b]=(0,t.useState)([]),[p,x]=(0,t.useState)(!1),[h,j]=(0,t.useState)({open:!1}),[Z,_]=(0,t.useState)({open:!1}),P=async()=>{let[e,s]=await (0,f.Vx)((0,f.Jm)());b(null!=s?s:[])},F=async()=>{x(!0);let[e,l]=await (0,f.Vx)((0,f.Bw)());s(null!=l?l:[]),x(!1)},E=(0,t.useMemo)(()=>{let e=l.map(e=>{let{db_type:s,is_file_db:l}=e;return{...C.S$[s],value:s,isFileDb:l}}),s=Object.keys(C.S$).filter(s=>!e.some(e=>e.value===s)).map(e=>({...C.S$[e],value:C.S$[e].label,disabled:!0}));return[...e,...s]},[l]),S=e=>{j({open:!0,info:e})},T=e=>{n.default.confirm({title:"Tips",content:"Do you Want to delete the ".concat(e.db_name,"?"),onOk:()=>new Promise(async(s,l)=>{try{let[a]=await (0,f.Vx)((0,f.J5)(e.db_name));if(a){i.ZP.error(a.message),l();return}i.ZP.success("success"),F(),s()}catch(e){l()}})})},I=(0,t.useMemo)(()=>{let s=E.reduce((s,l)=>(s[l.value]=e.filter(e=>e.db_type===l.value),s),{});return s},[e,E]);(0,r.Z)(async()=>{await F(),await P()},[]);let D=s=>{let l=e.filter(e=>e.db_type===s.value);_({open:!0,dbList:l,name:s.label,type:s.value})};return(0,a.jsxs)("div",{className:"relative p-4 md:p-6 bg-[#FAFAFA] dark:bg-transparent min-h-full overflow-y-auto",children:[(0,a.jsx)(k.Z,{visible:p}),(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(c.ZP,{type:"primary",className:"flex items-center",icon:(0,a.jsx)(N.Z,{}),onClick:()=>{j({open:!0})},children:"Create"})}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2 md:gap-4",children:E.map(e=>(0,a.jsx)(d.Z,{count:I[e.value].length,children:(0,a.jsx)(v,{info:e,onClick:()=>{D(e)}})},e.value))}),(0,a.jsx)(y,{open:h.open,dbTypeList:E,choiceDBType:h.dbType,editValue:h.info,dbNames:e.map(e=>e.db_name),onSuccess:()=>{j({open:!1}),F()},onClose:()=>{j({open:!1})}}),(0,a.jsx)(o.Z,{title:Z.name,placement:"right",onClose:()=>{_({open:!1})},open:Z.open,children:Z.type&&I[Z.type]&&I[Z.type].length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.ZP,{type:"primary",className:"mb-4 flex items-center",icon:(0,a.jsx)(N.Z,{}),onClick:()=>{j({open:!0,dbType:Z.type})},children:"Create"}),I[Z.type].map(e=>(0,a.jsxs)(m.Z,{title:e.db_name,extra:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(w.Z,{className:"mr-2",style:{color:"#1b7eff"},onClick:()=>{S(e)}}),(0,a.jsx)(g.Z,{style:{color:"#ff1b2e"},onClick:()=>{T(e)}})]}),className:"mb-4",children:[e.db_path?(0,a.jsxs)("p",{children:["path: ",e.db_path]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("p",{children:["host: ",e.db_host]}),(0,a.jsxs)("p",{children:["username: ",e.db_user]}),(0,a.jsxs)("p",{children:["port: ",e.db_port]})]}),(0,a.jsxs)("p",{children:["remark: ",e.comment]})]},e.db_name))]}):(0,a.jsx)(u.Z,{image:u.Z.PRESENTED_IMAGE_DEFAULT,children:(0,a.jsx)(c.ZP,{type:"primary",className:"flex items-center mx-auto",icon:(0,a.jsx)(N.Z,{}),onClick:()=>{j({open:!0,dbType:Z.type})},children:"Create Now"})})})]})}}},function(e){e.O(0,[64,479,9,442,813,411,928,643,774,888,179],function(){return e(e.s=55286)}),_N_E=e.O()}]);
\ No newline at end of file
+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[498],{55286:function(e,s,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/database",function(){return l(78466)}])},98978:function(e,s,l){"use strict";var a=l(85893),t=l(25675),r=l.n(t);s.Z=function(e){let{src:s,label:l,width:t,height:n,className:i}=e;return(0,a.jsx)(r(),{className:"w-11 h-11 rounded-full mr-4 border border-gray-200 object-contain bg-white ".concat(i),width:t||44,height:n||44,src:s,alt:l||"db-icon"})}},45247:function(e,s,l){"use strict";var a=l(85893),t=l(50888);s.Z=function(e){let{visible:s}=e;return s?(0,a.jsx)("div",{className:"absolute w-full h-full top-0 left-0 flex justify-center items-center z-10 bg-white dark:bg-black bg-opacity-50 dark:bg-opacity-50 backdrop-blur-sm text-3xl animate-fade animate-duration-200",children:(0,a.jsx)(t.Z,{})}):null}},78466:function(e,s,l){"use strict";l.r(s),l.d(s,{default:function(){return F},isFileDb:function(){return P}});var a=l(85893),t=l(67294),r=l(2093),n=l(12069),i=l(2453),c=l(71577),d=l(40411),o=l(85265),m=l(85813),u=l(32983),b=l(39479),p=l(51009),x=l(59566),h=l(48928),f=l(50489),j=l(67421),y=function(e){let{open:s,choiceDBType:l,dbTypeList:r,editValue:d,dbNames:o,onClose:m,onSuccess:u}=e,[y,Z]=(0,t.useState)(!1),{t:_}=(0,j.$G)(),[v]=b.Z.useForm(),N=b.Z.useWatch("db_type",v),w=(0,t.useMemo)(()=>P(r,N),[r,N]);(0,t.useEffect)(()=>{l&&v.setFieldValue("db_type",l)},[l]),(0,t.useEffect)(()=>{d&&v.setFieldsValue({...d})},[d]),(0,t.useEffect)(()=>{s||v.resetFields()},[s]);let g=async e=>{let{db_host:s,db_path:l,db_port:a,...t}=e;if(!d&&o.some(e=>e===t.db_name)){i.ZP.error("The database already exists!");return}let r={db_host:w?void 0:s,db_port:w?void 0:a,file_path:w?l:void 0,...t};Z(!0);try{let[e]=await (0,f.Vx)((0,f.KS)(r));if(e)return;let[s]=await (0,f.Vx)((d?f.mR:f.b_)(r));if(s){i.ZP.error(s.message);return}i.ZP.success("success"),null==u||u()}catch(e){i.ZP.error(e.message)}finally{Z(!1)}},k=(0,t.useMemo)(()=>!!d||!!l,[d,l]);return(0,a.jsx)(n.default,{open:s,width:400,title:_(d?"Edit":"create_database"),maskClosable:!1,footer:null,onCancel:m,children:(0,a.jsxs)(b.Z,{form:v,className:"pt-2",labelCol:{span:6},labelAlign:"left",onFinish:g,children:[(0,a.jsx)(b.Z.Item,{name:"db_type",label:"DB Type",className:"mb-3",rules:[{required:!0}],children:(0,a.jsx)(p.default,{"aria-readonly":k,disabled:k,options:r})}),(0,a.jsx)(b.Z.Item,{name:"db_name",label:"DB Name",className:"mb-3",rules:[{required:!0}],children:(0,a.jsx)(x.default,{readOnly:!!d,disabled:!!d})}),!0===w&&(0,a.jsx)(b.Z.Item,{name:"db_path",label:"Path",className:"mb-3",rules:[{required:!0}],children:(0,a.jsx)(x.default,{})}),!1===w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b.Z.Item,{name:"db_user",label:"Username",className:"mb-3",rules:[{required:!0}],children:(0,a.jsx)(x.default,{})}),(0,a.jsx)(b.Z.Item,{name:"db_pwd",label:"Password",className:"mb-3",rules:[{required:!0}],children:(0,a.jsx)(x.default,{type:"password"})}),(0,a.jsx)(b.Z.Item,{name:"db_host",label:"Host",className:"mb-3",rules:[{required:!0}],children:(0,a.jsx)(x.default,{})}),(0,a.jsx)(b.Z.Item,{name:"db_port",label:"Port",className:"mb-3",rules:[{required:!0}],children:(0,a.jsx)(h.Z,{min:1,step:1,max:65535})})]}),(0,a.jsx)(b.Z.Item,{name:"comment",label:"Remark",className:"mb-3",children:(0,a.jsx)(x.default,{})}),(0,a.jsxs)(b.Z.Item,{className:"flex flex-row-reverse pt-1 mb-0",children:[(0,a.jsx)(c.ZP,{htmlType:"submit",type:"primary",size:"middle",className:"mr-1",loading:y,children:"Save"}),(0,a.jsx)(c.ZP,{size:"middle",onClick:m,children:"Cancel"})]})]})})},Z=l(83062),_=l(98978),v=function(e){let{info:s,onClick:l}=e,r=(0,t.useCallback)(()=>{s.disabled||null==l||l()},[s.disabled,l]);return(0,a.jsxs)("div",{className:"relative flex flex-col py-4 px-4 w-72 h-32 cursor-pointer rounded-lg justify-between text-black bg-white border-gray-200 border hover:shadow-md dark:border-gray-600 dark:bg-black dark:text-white dark:hover:border-white transition-all ".concat(s.disabled?"grayscale cursor-no-drop":""),onClick:r,children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(_.Z,{src:s.icon,label:s.label}),(0,a.jsx)("div",{className:"flex flex-col",children:(0,a.jsx)("h2",{className:"text-sm font-semibold",children:s.label})})]}),(0,a.jsx)(Z.Z,{title:s.desc,children:(0,a.jsx)("p",{className:"text-sm text-gray-500 font-normal line-clamp-2",children:s.desc})})]})},N=l(24969),w=l(36531),g=l(27704),k=l(45247),C=l(98399);function P(e,s){var l;return null===(l=e.find(e=>e.value===s))||void 0===l?void 0:l.isFileDb}var F=function(){let[e,s]=(0,t.useState)([]),[l,b]=(0,t.useState)([]),[p,x]=(0,t.useState)(!1),[h,j]=(0,t.useState)({open:!1}),[Z,_]=(0,t.useState)({open:!1}),P=async()=>{let[e,s]=await (0,f.Vx)((0,f.Jm)());b(null!=s?s:[])},F=async()=>{x(!0);let[e,l]=await (0,f.Vx)((0,f.Bw)());s(null!=l?l:[]),x(!1)},E=(0,t.useMemo)(()=>{let e=l.map(e=>{let{db_type:s,is_file_db:l}=e;return{...C.S$[s],value:s,isFileDb:l}}),s=Object.keys(C.S$).filter(s=>!e.some(e=>e.value===s)).map(e=>({...C.S$[e],value:C.S$[e].label,disabled:!0}));return[...e,...s]},[l]),S=e=>{j({open:!0,info:e})},T=e=>{n.default.confirm({title:"Tips",content:"Do you Want to delete the ".concat(e.db_name,"?"),onOk:()=>new Promise(async(s,l)=>{try{let[a]=await (0,f.Vx)((0,f.J5)(e.db_name));if(a){i.ZP.error(a.message),l();return}i.ZP.success("success"),F(),s()}catch(e){l()}})})},I=(0,t.useMemo)(()=>{let s=E.reduce((s,l)=>(s[l.value]=e.filter(e=>e.db_type===l.value),s),{});return s},[e,E]);(0,r.Z)(async()=>{await F(),await P()},[]);let D=s=>{let l=e.filter(e=>e.db_type===s.value);_({open:!0,dbList:l,name:s.label,type:s.value})};return(0,a.jsxs)("div",{className:"relative p-4 md:p-6 bg-[#FAFAFA] dark:bg-transparent min-h-full overflow-y-auto",children:[(0,a.jsx)(k.Z,{visible:p}),(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(c.ZP,{type:"primary",className:"flex items-center",icon:(0,a.jsx)(N.Z,{}),onClick:()=>{j({open:!0})},children:"Create"})}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2 md:gap-4",children:E.map(e=>(0,a.jsx)(d.Z,{count:I[e.value].length,children:(0,a.jsx)(v,{info:e,onClick:()=>{D(e)}})},e.value))}),(0,a.jsx)(y,{open:h.open,dbTypeList:E,choiceDBType:h.dbType,editValue:h.info,dbNames:e.map(e=>e.db_name),onSuccess:()=>{j({open:!1}),F()},onClose:()=>{j({open:!1})}}),(0,a.jsx)(o.Z,{title:Z.name,placement:"right",onClose:()=>{_({open:!1})},open:Z.open,children:Z.type&&I[Z.type]&&I[Z.type].length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.ZP,{type:"primary",className:"mb-4 flex items-center",icon:(0,a.jsx)(N.Z,{}),onClick:()=>{j({open:!0,dbType:Z.type})},children:"Create"}),I[Z.type].map(e=>(0,a.jsxs)(m.Z,{title:e.db_name,extra:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(w.Z,{className:"mr-2",style:{color:"#1b7eff"},onClick:()=>{S(e)}}),(0,a.jsx)(g.Z,{style:{color:"#ff1b2e"},onClick:()=>{T(e)}})]}),className:"mb-4",children:[e.db_path?(0,a.jsxs)("p",{children:["path: ",e.db_path]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("p",{children:["host: ",e.db_host]}),(0,a.jsxs)("p",{children:["username: ",e.db_user]}),(0,a.jsxs)("p",{children:["port: ",e.db_port]})]}),(0,a.jsxs)("p",{children:["remark: ",e.comment]})]},e.db_name))]}):(0,a.jsx)(u.Z,{image:u.Z.PRESENTED_IMAGE_DEFAULT,children:(0,a.jsx)(c.ZP,{type:"primary",className:"flex items-center mx-auto",icon:(0,a.jsx)(N.Z,{}),onClick:()=>{j({open:!0,dbType:Z.type})},children:"Create Now"})})})]})}}},function(e){e.O(0,[64,479,9,442,813,411,928,643,774,888,179],function(){return e(e.s=55286)}),_N_E=e.O()}]);
\ No newline at end of file
diff --git a/pilot/server/static/_next/static/chunks/pages/index-b82ae16bc13b2207.js b/pilot/server/static/_next/static/chunks/pages/index-d1740e3bc6dba7f5.js
similarity index 100%
rename from pilot/server/static/_next/static/chunks/pages/index-b82ae16bc13b2207.js
rename to pilot/server/static/_next/static/chunks/pages/index-d1740e3bc6dba7f5.js
diff --git a/pilot/server/static/_next/static/chunks/webpack-7d5cf9ac69f4db72.js b/pilot/server/static/_next/static/chunks/webpack-b5216c63e109d42c.js
similarity index 94%
rename from pilot/server/static/_next/static/chunks/webpack-7d5cf9ac69f4db72.js
rename to pilot/server/static/_next/static/chunks/webpack-b5216c63e109d42c.js
index 3c5215435..03fc78871 100644
--- a/pilot/server/static/_next/static/chunks/webpack-7d5cf9ac69f4db72.js
+++ b/pilot/server/static/_next/static/chunks/webpack-b5216c63e109d42c.js
@@ -1 +1 @@
-!function(){"use strict";var e,t,n,r,o,u,i,a,c,f,d,s,l={},b={};function p(e){var t=b[e];if(void 0!==t)return t.exports;var n=b[e]={id:e,loaded:!1,exports:{}},r=!0;try{l[e].call(n.exports,n,n.exports,p),r=!1}finally{r&&delete b[e]}return n.loaded=!0,n.exports}p.m=l,p.amdO={},e=[],p.O=function(t,n,r,o){if(n){o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var i=1/0,u=0;u=o&&Object.keys(p.O).every(function(e){return p.O[e](n[c])})?n.splice(c--,1):(a=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var i=1/0,u=0;u=o&&Object.keys(p.O).every(function(e){return p.O[e](n[c])})?n.splice(c--,1):(a=!1,o:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-scroll{overflow:scroll}.overflow-y-auto{overflow-y:auto}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-\[10px\]{border-radius:10px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.rounded-br{border-bottom-right-radius:.25rem}.rounded-tl-md{border-top-left-radius:.375rem}.rounded-tr{border-top-right-radius:.25rem}.rounded-tr-md{border-top-right-radius:.375rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t,.border-t-\[1px\]{border-top-width:1px}.border-solid{border-style:solid}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-\[\#f0f0f0\]{--tw-border-opacity:1;border-color:rgb(240 240 240/var(--tw-border-opacity))}.border-\[var\(--joy-palette-divider\)\]{border-color:var(--joy-palette-divider)}.border-blue-600{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity))}.border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246/var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity))}.border-gray-500{--tw-border-opacity:1;border-color:rgb(107 114 128/var(--tw-border-opacity))}.border-slate-300{--tw-border-opacity:1;border-color:rgb(203 213 225/var(--tw-border-opacity))}.border-opacity-50{--tw-border-opacity:0.5}.bg-\[\#FAFAFA\]{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity))}.bg-\[\#FFFFFF\]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-\[\#fafafa\]{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity))}.bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.bg-green-500{--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.bg-slate-100{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity))}.bg-slate-400{--tw-bg-opacity:1;background-color:rgb(148 163 184/var(--tw-bg-opacity))}.bg-slate-50{--tw-bg-opacity:1;background-color:rgb(248 250 252/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity:0.5}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-\[\#31afff\]{--tw-gradient-from:#31afff var(--tw-gradient-from-position);--tw-gradient-to:rgba(49,175,255,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.to-\[\#1677ff\]{--tw-gradient-to:#1677ff var(--tw-gradient-to-position)}.object-contain{-o-object-fit:contain;object-fit:contain}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-0{padding-left:0;padding-right:0}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\[6px\]{padding-left:6px;padding-right:6px}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-\[2px\]{padding-top:2px;padding-bottom:2px}.pb-4{padding-bottom:1rem}.pb-6{padding-bottom:1.5rem}.pb-8{padding-bottom:2rem}.pl-0{padding-left:0}.pl-0\.5{padding-left:.125rem}.pl-10{padding-left:2.5rem}.pl-2{padding-left:.5rem}.pr-10{padding-right:2.5rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.\!text-left{text-align:left!important}.font-sans{font-family:Josefin Sans,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.\!text-2xl{font-size:1.5rem!important;line-height:2rem!important}.\!text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.\!text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-normal{font-weight:400}.font-semibold{font-weight:600}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-6{line-height:1.5rem}.leading-7{line-height:1.75rem}.leading-8{line-height:2rem}.\!text-\[\#878c93\]{--tw-text-opacity:1!important;color:rgb(135 140 147/var(--tw-text-opacity))!important}.\!text-green-600{--tw-text-opacity:1!important;color:rgb(22 163 74/var(--tw-text-opacity))!important}.\!text-orange-600{--tw-text-opacity:1!important;color:rgb(234 88 12/var(--tw-text-opacity))!important}.\!text-red-600{--tw-text-opacity:1!important;color:rgb(220 38 38/var(--tw-text-opacity))!important}.text-\[\#1677ff\]{--tw-text-opacity:1;color:rgb(22 119 255/var(--tw-text-opacity))}.text-\[\#2AA3FF\]{--tw-text-opacity:1;color:rgb(42 163 255/var(--tw-text-opacity))}.text-\[\#ff1b2e\]{--tw-text-opacity:1;color:rgb(255 27 46/var(--tw-text-opacity))}.text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.text-blue-400{--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity))}.text-gray-100{--tw-text-opacity:1;color:rgb(243 244 246/var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.text-gray-950{--tw-text-opacity:1;color:rgb(3 7 18/var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.text-slate-900{--tw-text-opacity:1;color:rgb(15 23 42/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.opacity-0{opacity:0}.opacity-60{opacity:.6}.opacity-80{opacity:.8}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.grayscale{--tw-grayscale:grayscale(100%)}.filter,.grayscale{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-\[width\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.animate-duration-200{animation-duration:.2s}.animate-duration-300{animation-duration:.3s}body{margin:0;color:var(--joy-palette-text-primary,var(--joy-palette-neutral-800,#25252d));font-family:var(--joy-fontFamily-body,var(--joy-Josefin Sans,sans-serif));font-size:var(--joy-fontSize-md,1rem);line-height:var(--joy-lineHeight-md,1.5);background-color:var(--joy-palette-background-body)}body .ant-btn-primary{background-color:#1677ff}.ant-pagination .ant-pagination-next *,.ant-pagination .ant-pagination-prev *{color:#279bff!important}.ant-pagination .ant-pagination-item a{color:#b0b0bf}.ant-pagination .ant-pagination-item.ant-pagination-item-active{background-color:#279bff!important}.ant-pagination .ant-pagination-item.ant-pagination-item-active a{color:#fff!important}table tr td{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}::-webkit-scrollbar{display:none}::-webkit-scrollbar-track{background:#f1f1f1}::-webkit-scrollbar-thumb{background:#888}::-webkit-scrollbar-thumb:hover{background:#555}.dark :where(.css-dev-only-do-not-override-18iikkb).ant-tabs .ant-tabs-tab-btn{color:#fff}:where(.css-dev-only-do-not-override-18iikkb).ant-form-item .ant-form-item-label>label{height:36px}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-top-8:after{content:var(--tw-content);top:-2rem}.after\:h-8:after{content:var(--tw-content);height:2rem}.after\:w-full:after{content:var(--tw-content);width:100%}.after\:bg-gradient-to-t:after{content:var(--tw-content);background-image:linear-gradient(to top,var(--tw-gradient-stops))}.after\:from-white:after{content:var(--tw-content);--tw-gradient-from:#fff var(--tw-gradient-from-position);--tw-gradient-to:hsla(0,0%,100%,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.after\:to-transparent:after{content:var(--tw-content);--tw-gradient-to:transparent var(--tw-gradient-to-position)}.hover\:bg-slate-100:hover{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity))}.hover\:\!text-gray-200:hover{--tw-text-opacity:1!important;color:rgb(229 231 235/var(--tw-text-opacity))!important}.hover\:shadow-md:hover{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.group\/item:hover .group-hover\/item\:opacity-100{opacity:1}:is(.dark .dark\:border-gray-600){--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity))}:is(.dark .dark\:border-gray-700){--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity))}:is(.dark .dark\:border-white){--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}:is(.dark .dark\:bg-\[\#1A1E26\]){--tw-bg-opacity:1;background-color:rgb(26 30 38/var(--tw-bg-opacity))}:is(.dark .dark\:bg-\[\#212121\]){--tw-bg-opacity:1;background-color:rgb(33 33 33/var(--tw-bg-opacity))}:is(.dark .dark\:bg-\[\#353539\]){--tw-bg-opacity:1;background-color:rgb(53 53 57/var(--tw-bg-opacity))}:is(.dark .dark\:bg-\[\#484848\]){--tw-bg-opacity:1;background-color:rgb(72 72 72/var(--tw-bg-opacity))}:is(.dark .dark\:bg-black){--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-100){--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-900){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}:is(.dark .dark\:bg-slate-800){--tw-bg-opacity:1;background-color:rgb(30 41 59/var(--tw-bg-opacity))}:is(.dark .dark\:bg-transparent){background-color:transparent}:is(.dark .dark\:bg-opacity-50){--tw-bg-opacity:0.5}:is(.dark .dark\:bg-gradient-to-r){background-image:linear-gradient(to right,var(--tw-gradient-stops))}:is(.dark .dark\:from-\[\#6a6a6a\]){--tw-gradient-from:#6a6a6a var(--tw-gradient-from-position);--tw-gradient-to:hsla(0,0%,42%,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}:is(.dark .dark\:to-\[\#80868f\]){--tw-gradient-to:#80868f var(--tw-gradient-to-position)}:is(.dark .dark\:text-blue-400){--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity))}:is(.dark .dark\:text-gray-200){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}:is(.dark .dark\:text-gray-300){--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}:is(.dark .dark\:text-gray-400){--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark .dark\:text-gray-800){--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}:is(.dark .dark\:text-slate-300){--tw-text-opacity:1;color:rgb(203 213 225/var(--tw-text-opacity))}:is(.dark .dark\:text-white){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark .dark\:after\:from-\[\#212121\]):after{content:var(--tw-content);--tw-gradient-from:#212121 var(--tw-gradient-from-position);--tw-gradient-to:rgba(33,33,33,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}:is(.dark .dark\:hover\:border-white:hover){--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}:is(.dark .dark\:hover\:bg-\[\#353539\]:hover){--tw-bg-opacity:1;background-color:rgb(53 53 57/var(--tw-bg-opacity))}@media not all and (min-width:768px){.max-md\:hidden{display:none}}@media (min-width:640px){.sm\:mr-4{margin-right:1rem}.sm\:inline-block{display:inline-block}.sm\:w-1\/2{width:50%}.sm\:w-60{width:15rem}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:py-4{padding-top:1rem;padding-bottom:1rem}.sm\:pb-10{padding-bottom:2.5rem}.sm\:pt-6{padding-top:1.5rem}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:leading-7{line-height:1.75rem}}@media (min-width:768px){.md\:-m-2{margin:-.5rem}.md\:mt-4{margin-top:1rem}.md\:block{display:block}.md\:w-1\/2{width:50%}.md\:gap-4{gap:1rem}.md\:p-2{padding:.5rem}.md\:p-6{padding:1.5rem}.md\:px-4{padding-left:1rem;padding-right:1rem}.md\:px-6{padding-left:1.5rem;padding-right:1.5rem}.md\:pt-10{padding-top:2.5rem}.md\:pt-4{padding-top:1rem}}@media (min-width:1024px){.lg\:mr-4{margin-right:1rem}.lg\:w-1\/3{width:33.333333%}.lg\:w-72{width:18rem}.lg\:w-full{width:100%}.lg\:max-w-\[80\%\]{max-width:80%}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:px-8{padding-left:2rem;padding-right:2rem}}@media (min-width:1280px){.xl\:h-full{height:100%}.xl\:w-1\/4{width:25%}.xl\:w-3\/4{width:75%}.xl\:w-full{width:100%}.xl\:gap-x-5{-moz-column-gap:1.25rem;column-gap:1.25rem}.xl\:border-l{border-left-width:1px}.xl\:border-t-0{border-top-width:0}.xl\:pl-4{padding-left:1rem}.xl\:pr-4{padding-right:1rem}}#nprogress{pointer-events:none}#nprogress .bar{background:var(--joy-palette-primary-500,#096bde);position:fixed;z-index:10031;top:0;left:0;width:100%;height:3px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px var(--joy-palette-primary-500,#096bde),0 0 5px var(--joy-palette-primary-500,#096bde);opacity:1;transform:rotate(3deg) translateY(-4px)}
\ No newline at end of file
diff --git a/pilot/server/static/_next/static/css/c921bbabe4b71b75.css b/pilot/server/static/_next/static/css/c921bbabe4b71b75.css
deleted file mode 100644
index 3cc769c48..000000000
--- a/pilot/server/static/_next/static/css/c921bbabe4b71b75.css
+++ /dev/null
@@ -1,3 +0,0 @@
-/*
-! tailwindcss v3.3.2 | MIT License | https://tailwindcss.com
-*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Josefin Sans,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal}body{line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.\!visible{visibility:visible!important}.visible{visibility:visible}.invisible{visibility:hidden}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.bottom-\[30\%\]{bottom:30%}.left-0{left:0}.left-2{left:.5rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-2{top:.5rem}.top-4{top:1rem}.top-\[-35px\]{top:-35px}.z-10{z-index:10}.-m-1{margin:-.25rem}.m-10{margin:2.5rem}.m-11{margin:2.75rem}.m-6{margin:1.5rem}.\!my-6{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-3{margin-top:.75rem;margin-bottom:.75rem}.my-4{margin-top:1rem;margin-bottom:1rem}.\!mb-2{margin-bottom:.5rem!important}.mb-0{margin-bottom:0}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.ml-10{margin-left:2.5rem}.ml-2{margin-left:.5rem}.ml-5{margin-left:1.25rem}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-4{margin-right:1rem}.mr-6{margin-right:1.5rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.mt-\[-4px\]{margin-top:-4px}.line-clamp-1{-webkit-line-clamp:1}.line-clamp-1,.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical}.line-clamp-2{-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.\!inline{display:inline!important}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-2\/5{height:40%}.h-3\/5{height:60%}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-96{height:24rem}.h-\[1\.5em\]{height:1.5em}.h-\[300px\]{height:300px}.h-\[46px\]{height:46px}.h-\[500px\]{height:500px}.h-full{height:100%}.h-screen{height:100vh}.max-h-96{max-height:24rem}.max-h-full{max-height:100%}.max-h-screen{max-height:100vh}.min-h-\[1rem\]{min-height:1rem}.min-h-full{min-height:100%}.min-h-min{min-height:-moz-min-content;min-height:min-content}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-20{width:5rem}.w-36{width:9rem}.w-48{width:12rem}.w-52{width:13rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-\[1\.5em\]{width:1.5em}.w-\[63px\]{width:63px}.w-full{width:100%}.w-screen{width:100vw}.min-w-0{min-width:0}.min-w-\[200px\]{min-width:200px}.min-w-\[240px\]{min-width:240px}.min-w-min{min-width:-moz-min-content;min-width:min-content}.max-w-3xl{max-width:48rem}.max-w-full{max-width:100%}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow-0{flex-grow:0}.rotate-90{--tw-rotate:90deg}.rotate-90,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes fade{0%{opacity:0}to{opacity:1}}.animate-fade{animation:fade 1s both}.\!cursor-no-drop{cursor:no-drop!important}.cursor-no-drop{cursor:no-drop}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-around{justify-content:space-around}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-y-5{row-gap:1.25rem}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-scroll{overflow:scroll}.overflow-y-auto{overflow-y:auto}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-\[10px\]{border-radius:10px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.rounded-br{border-bottom-right-radius:.25rem}.rounded-tl-md{border-top-left-radius:.375rem}.rounded-tr{border-top-right-radius:.25rem}.rounded-tr-md{border-top-right-radius:.375rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t,.border-t-\[1px\]{border-top-width:1px}.border-solid{border-style:solid}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-\[\#f0f0f0\]{--tw-border-opacity:1;border-color:rgb(240 240 240/var(--tw-border-opacity))}.border-\[var\(--joy-palette-divider\)\]{border-color:var(--joy-palette-divider)}.border-blue-600{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity))}.border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246/var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity))}.border-slate-300{--tw-border-opacity:1;border-color:rgb(203 213 225/var(--tw-border-opacity))}.border-opacity-50{--tw-border-opacity:0.5}.bg-\[\#FAFAFA\]{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity))}.bg-\[\#FFFFFF\]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-\[\#fafafa\]{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity))}.bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.bg-green-500{--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.bg-slate-100{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity))}.bg-slate-400{--tw-bg-opacity:1;background-color:rgb(148 163 184/var(--tw-bg-opacity))}.bg-slate-50{--tw-bg-opacity:1;background-color:rgb(248 250 252/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity:0.5}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-\[\#31afff\]{--tw-gradient-from:#31afff var(--tw-gradient-from-position);--tw-gradient-to:rgba(49,175,255,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.to-\[\#1677ff\]{--tw-gradient-to:#1677ff var(--tw-gradient-to-position)}.object-contain{-o-object-fit:contain;object-fit:contain}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-0{padding-left:0;padding-right:0}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\[6px\]{padding-left:6px;padding-right:6px}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-\[2px\]{padding-top:2px;padding-bottom:2px}.pb-4{padding-bottom:1rem}.pb-6{padding-bottom:1.5rem}.pb-8{padding-bottom:2rem}.pl-0{padding-left:0}.pl-0\.5{padding-left:.125rem}.pl-10{padding-left:2.5rem}.pl-2{padding-left:.5rem}.pr-10{padding-right:2.5rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.\!text-left{text-align:left!important}.font-sans{font-family:Josefin Sans,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.\!text-2xl{font-size:1.5rem!important;line-height:2rem!important}.\!text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.\!text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-normal{font-weight:400}.font-semibold{font-weight:600}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-6{line-height:1.5rem}.leading-7{line-height:1.75rem}.leading-8{line-height:2rem}.\!text-\[\#878c93\]{--tw-text-opacity:1!important;color:rgb(135 140 147/var(--tw-text-opacity))!important}.\!text-green-600{--tw-text-opacity:1!important;color:rgb(22 163 74/var(--tw-text-opacity))!important}.\!text-orange-600{--tw-text-opacity:1!important;color:rgb(234 88 12/var(--tw-text-opacity))!important}.\!text-red-600{--tw-text-opacity:1!important;color:rgb(220 38 38/var(--tw-text-opacity))!important}.text-\[\#1677ff\]{--tw-text-opacity:1;color:rgb(22 119 255/var(--tw-text-opacity))}.text-\[\#2AA3FF\]{--tw-text-opacity:1;color:rgb(42 163 255/var(--tw-text-opacity))}.text-\[\#ff1b2e\]{--tw-text-opacity:1;color:rgb(255 27 46/var(--tw-text-opacity))}.text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.text-blue-400{--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity))}.text-gray-100{--tw-text-opacity:1;color:rgb(243 244 246/var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.text-gray-950{--tw-text-opacity:1;color:rgb(3 7 18/var(--tw-text-opacity))}.text-slate-900{--tw-text-opacity:1;color:rgb(15 23 42/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.opacity-0{opacity:0}.opacity-60{opacity:.6}.opacity-80{opacity:.8}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.grayscale{--tw-grayscale:grayscale(100%)}.filter,.grayscale{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-\[width\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.animate-duration-200{animation-duration:.2s}.animate-duration-300{animation-duration:.3s}body{margin:0;color:var(--joy-palette-text-primary,var(--joy-palette-neutral-800,#25252d));font-family:var(--joy-fontFamily-body,var(--joy-Josefin Sans,sans-serif));font-size:var(--joy-fontSize-md,1rem);line-height:var(--joy-lineHeight-md,1.5);background-color:var(--joy-palette-background-body)}body .ant-btn-primary{background-color:#1677ff}.ant-pagination .ant-pagination-next *,.ant-pagination .ant-pagination-prev *{color:#279bff!important}.ant-pagination .ant-pagination-item a{color:#b0b0bf}.ant-pagination .ant-pagination-item.ant-pagination-item-active{background-color:#279bff!important}.ant-pagination .ant-pagination-item.ant-pagination-item-active a{color:#fff!important}table tr td{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}::-webkit-scrollbar{display:none}::-webkit-scrollbar-track{background:#f1f1f1}::-webkit-scrollbar-thumb{background:#888}::-webkit-scrollbar-thumb:hover{background:#555}.dark :where(.css-dev-only-do-not-override-18iikkb).ant-tabs .ant-tabs-tab-btn{color:#fff}:where(.css-dev-only-do-not-override-18iikkb).ant-form-item .ant-form-item-label>label{height:36px}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-top-8:after{content:var(--tw-content);top:-2rem}.after\:h-8:after{content:var(--tw-content);height:2rem}.after\:w-full:after{content:var(--tw-content);width:100%}.after\:bg-gradient-to-t:after{content:var(--tw-content);background-image:linear-gradient(to top,var(--tw-gradient-stops))}.after\:from-white:after{content:var(--tw-content);--tw-gradient-from:#fff var(--tw-gradient-from-position);--tw-gradient-to:hsla(0,0%,100%,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.after\:to-transparent:after{content:var(--tw-content);--tw-gradient-to:transparent var(--tw-gradient-to-position)}.hover\:bg-slate-100:hover{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity))}.hover\:\!text-gray-200:hover{--tw-text-opacity:1!important;color:rgb(229 231 235/var(--tw-text-opacity))!important}.hover\:shadow-md:hover{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.group\/item:hover .group-hover\/item\:opacity-100{opacity:1}:is(.dark .dark\:border-gray-600){--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity))}:is(.dark .dark\:border-gray-700){--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity))}:is(.dark .dark\:border-white){--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}:is(.dark .dark\:bg-\[\#1A1E26\]){--tw-bg-opacity:1;background-color:rgb(26 30 38/var(--tw-bg-opacity))}:is(.dark .dark\:bg-\[\#212121\]){--tw-bg-opacity:1;background-color:rgb(33 33 33/var(--tw-bg-opacity))}:is(.dark .dark\:bg-\[\#353539\]){--tw-bg-opacity:1;background-color:rgb(53 53 57/var(--tw-bg-opacity))}:is(.dark .dark\:bg-\[\#484848\]){--tw-bg-opacity:1;background-color:rgb(72 72 72/var(--tw-bg-opacity))}:is(.dark .dark\:bg-black){--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-100){--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-900){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}:is(.dark .dark\:bg-slate-800){--tw-bg-opacity:1;background-color:rgb(30 41 59/var(--tw-bg-opacity))}:is(.dark .dark\:bg-transparent){background-color:transparent}:is(.dark .dark\:bg-opacity-50){--tw-bg-opacity:0.5}:is(.dark .dark\:bg-gradient-to-r){background-image:linear-gradient(to right,var(--tw-gradient-stops))}:is(.dark .dark\:from-\[\#6a6a6a\]){--tw-gradient-from:#6a6a6a var(--tw-gradient-from-position);--tw-gradient-to:hsla(0,0%,42%,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}:is(.dark .dark\:to-\[\#80868f\]){--tw-gradient-to:#80868f var(--tw-gradient-to-position)}:is(.dark .dark\:text-blue-400){--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity))}:is(.dark .dark\:text-gray-200){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}:is(.dark .dark\:text-gray-300){--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}:is(.dark .dark\:text-gray-400){--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark .dark\:text-gray-800){--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}:is(.dark .dark\:text-slate-300){--tw-text-opacity:1;color:rgb(203 213 225/var(--tw-text-opacity))}:is(.dark .dark\:text-white){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark .dark\:after\:from-\[\#212121\]):after{content:var(--tw-content);--tw-gradient-from:#212121 var(--tw-gradient-from-position);--tw-gradient-to:rgba(33,33,33,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}:is(.dark .dark\:hover\:border-white:hover){--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}:is(.dark .dark\:hover\:bg-\[\#353539\]:hover){--tw-bg-opacity:1;background-color:rgb(53 53 57/var(--tw-bg-opacity))}@media not all and (min-width:768px){.max-md\:hidden{display:none}}@media (min-width:640px){.sm\:mr-4{margin-right:1rem}.sm\:inline-block{display:inline-block}.sm\:w-1\/2{width:50%}.sm\:w-60{width:15rem}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:py-4{padding-top:1rem;padding-bottom:1rem}.sm\:pb-10{padding-bottom:2.5rem}.sm\:pt-6{padding-top:1.5rem}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:leading-7{line-height:1.75rem}}@media (min-width:768px){.md\:-m-2{margin:-.5rem}.md\:mt-4{margin-top:1rem}.md\:block{display:block}.md\:w-1\/2{width:50%}.md\:gap-4{gap:1rem}.md\:p-2{padding:.5rem}.md\:p-6{padding:1.5rem}.md\:px-4{padding-left:1rem;padding-right:1rem}.md\:px-6{padding-left:1.5rem;padding-right:1.5rem}.md\:pt-10{padding-top:2.5rem}.md\:pt-4{padding-top:1rem}}@media (min-width:1024px){.lg\:w-1\/3{width:33.333333%}.lg\:w-72{width:18rem}.lg\:w-full{width:100%}.lg\:max-w-\[80\%\]{max-width:80%}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:px-8{padding-left:2rem;padding-right:2rem}}@media (min-width:1280px){.xl\:h-full{height:100%}.xl\:w-1\/4{width:25%}.xl\:w-3\/4{width:75%}.xl\:w-full{width:100%}.xl\:gap-x-5{-moz-column-gap:1.25rem;column-gap:1.25rem}.xl\:border-l{border-left-width:1px}.xl\:border-t-0{border-top-width:0}.xl\:pl-4{padding-left:1rem}.xl\:pr-4{padding-right:1rem}}#nprogress{pointer-events:none}#nprogress .bar{background:var(--joy-palette-primary-500,#096bde);position:fixed;z-index:10031;top:0;left:0;width:100%;height:3px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px var(--joy-palette-primary-500,#096bde),0 0 5px var(--joy-palette-primary-500,#096bde);opacity:1;transform:rotate(3deg) translateY(-4px)}
\ No newline at end of file
diff --git a/pilot/server/static/agent/index.html b/pilot/server/static/agent/index.html
index 9ea6d681d..288deb6d6 100644
--- a/pilot/server/static/agent/index.html
+++ b/pilot/server/static/agent/index.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/pilot/server/static/chat/[scene]/[id]/index.html b/pilot/server/static/chat/[scene]/[id]/index.html
index a94476e87..070c55059 100644
--- a/pilot/server/static/chat/[scene]/[id]/index.html
+++ b/pilot/server/static/chat/[scene]/[id]/index.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/pilot/server/static/chat/index.html b/pilot/server/static/chat/index.html
index b05c6f855..85a1e738a 100644
--- a/pilot/server/static/chat/index.html
+++ b/pilot/server/static/chat/index.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/pilot/server/static/database/index.html b/pilot/server/static/database/index.html
index 296b16484..d76817db9 100644
--- a/pilot/server/static/database/index.html
+++ b/pilot/server/static/database/index.html
@@ -1 +1 @@
-
MySQL Fast, reliable, scalable open-source relational database management system.
MSSQL Powerful, scalable, secure relational database system by Microsoft.
DuckDB In-memory analytical database with efficient query processing.
Sqlite Lightweight embedded relational database with simplicity and portability.
ClickHouse Columnar database for high-performance analytics and real-time queries.
Oracle Robust, scalable, secure relational database widely used in enterprises.
Access Easy-to-use relational database for small-scale applications by Microsoft.
MongoDB Flexible, scalable NoSQL document database for web and mobile apps.
DB2 Scalable, secure relational database system developed by IBM.
HBase Distributed, scalable NoSQL database for large structured/semi-structured data.
Redis Fast, versatile in-memory data structure store as cache, DB, or broker.
Cassandra Scalable, fault-tolerant distributed NoSQL database for large data.
Couchbase High-performance NoSQL document database with distributed architecture.
PostgreSQL Powerful open-source relational database with extensibility and SQL standards.
Spark Unified engine for large-scale data analytics.
Space knowledge analytics.
\ No newline at end of file
+
MySQL Fast, reliable, scalable open-source relational database management system.
MSSQL Powerful, scalable, secure relational database system by Microsoft.
DuckDB In-memory analytical database with efficient query processing.
Sqlite Lightweight embedded relational database with simplicity and portability.
ClickHouse Columnar database for high-performance analytics and real-time queries.
Oracle Robust, scalable, secure relational database widely used in enterprises.
Access Easy-to-use relational database for small-scale applications by Microsoft.
MongoDB Flexible, scalable NoSQL document database for web and mobile apps.
DB2 Scalable, secure relational database system developed by IBM.
HBase Distributed, scalable NoSQL database for large structured/semi-structured data.
Redis Fast, versatile in-memory data structure store as cache, DB, or broker.
Cassandra Scalable, fault-tolerant distributed NoSQL database for large data.
Couchbase High-performance NoSQL document database with distributed architecture.
PostgreSQL Powerful open-source relational database with extensibility and SQL standards.
Spark Unified engine for large-scale data analytics.
Space knowledge analytics.
\ No newline at end of file
diff --git a/pilot/server/static/index.html b/pilot/server/static/index.html
index 36a2e799c..108d537e9 100644
--- a/pilot/server/static/index.html
+++ b/pilot/server/static/index.html
@@ -1 +1 @@
-Quick Start
\ No newline at end of file
+Quick Start
\ No newline at end of file
diff --git a/pilot/server/static/knowledge/chunk/index.html b/pilot/server/static/knowledge/chunk/index.html
index a92646d2a..88603f7e5 100644
--- a/pilot/server/static/knowledge/chunk/index.html
+++ b/pilot/server/static/knowledge/chunk/index.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/pilot/server/static/knowledge/index.html b/pilot/server/static/knowledge/index.html
index a3e590620..2df54f48a 100644
--- a/pilot/server/static/knowledge/index.html
+++ b/pilot/server/static/knowledge/index.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/pilot/server/static/models/index.html b/pilot/server/static/models/index.html
index a2a4dc193..4cef5f8ac 100644
--- a/pilot/server/static/models/index.html
+++ b/pilot/server/static/models/index.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/pilot/server/static/prompt/index.html b/pilot/server/static/prompt/index.html
index 70551f6a7..2508e9527 100644
--- a/pilot/server/static/prompt/index.html
+++ b/pilot/server/static/prompt/index.html
@@ -1 +1 @@
-
Add Prompts Add Prompts template
\ No newline at end of file
+
Add Prompts Add Prompts template
\ No newline at end of file
From 3763569806afc65ddeba7f01ec4257c6ff2086e1 Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Fri, 1 Dec 2023 11:52:35 +0800
Subject: [PATCH 13/26] feat:add reference recall score
---
pilot/rag/retriever/rerank.py | 6 +--
pilot/scene/chat_knowledge/rewrite/prompt.py | 17 +++++++-
pilot/scene/chat_knowledge/v1/chat.py | 41 ++++++++++++--------
3 files changed, 43 insertions(+), 21 deletions(-)
diff --git a/pilot/rag/retriever/rerank.py b/pilot/rag/retriever/rerank.py
index c482d4950..dd48be82b 100644
--- a/pilot/rag/retriever/rerank.py
+++ b/pilot/rag/retriever/rerank.py
@@ -61,9 +61,9 @@ def rank(self, candidates_with_scores: List[Tuple]):
candidates_with_scores = sorted(
candidates_with_scores, key=lambda x: x[1], reverse=True
)
- return [candidate_doc for candidate_doc, score in candidates_with_scores][
- : self.topk
- ]
+ return [
+ (candidate_doc, score) for candidate_doc, score in candidates_with_scores
+ ][: self.topk]
class RRFRanker(Ranker):
diff --git a/pilot/scene/chat_knowledge/rewrite/prompt.py b/pilot/scene/chat_knowledge/rewrite/prompt.py
index e7071ddd2..fe5197d7c 100644
--- a/pilot/scene/chat_knowledge/rewrite/prompt.py
+++ b/pilot/scene/chat_knowledge/rewrite/prompt.py
@@ -10,9 +10,18 @@
PROMPT_SCENE_DEFINE = """You are a helpful assistant that generates multiple search queries based on a single input query."""
+_DEFAULT_TEMPLATE_ZH = """请根据以下主题生成{nums}个相关的搜索查询,这些查询应与原始查询相似并且是人们可能会提出的可回答的搜索问题。请按照以下逗号分隔的格式提供: 'queries:':
+"---------------------\n"
+"示例:"
+"original_query:什么是RAG。"
+"queries:'1. 什么是RAG及其工作原理,2. RAG有哪些应用场景,3. 能否提供RAG在现实世界中的应用实例'"
+"---------------------\n"
+"original_query:{original_query}\n"
+"queries:\n"
+"""
-_DEFAULT_TEMPLATE = """
-Generate {nums} search queries related to: {original_query}, queries should be similar and answerable search queries you might have, Provide following comma-separated format: 'queries: '\n":
+_DEFAULT_TEMPLATE_EN = """
+Generate {nums} search queries related to: {original_query}, Provide following comma-separated format: 'queries: '\n":
"---------------------\n"
"Example:"
"original query: What is RAG."
@@ -22,6 +31,10 @@
"queries:\n"
"""
+_DEFAULT_TEMPLATE = (
+ _DEFAULT_TEMPLATE_EN if CFG.LANGUAGE == "en" else _DEFAULT_TEMPLATE_ZH
+)
+
PROMPT_RESPONSE = """"""
PROMPT_SEP = SeparatorStyle.SINGLE.value
diff --git a/pilot/scene/chat_knowledge/v1/chat.py b/pilot/scene/chat_knowledge/v1/chat.py
index 9c16f349c..e1edb7795 100644
--- a/pilot/scene/chat_knowledge/v1/chat.py
+++ b/pilot/scene/chat_knowledge/v1/chat.py
@@ -99,13 +99,13 @@ async def stream_call(self):
last_output.text = (
last_output.text + "\n\nrelations:\n\n" + ",".join(self.relations)
)
- reference = f"\n\n{self.parse_source_view(self.chunks)}"
+ reference = f"\n\n{self.parse_source_view(self.chunks_with_score)}"
last_output = last_output + reference
yield last_output
def stream_call_reinforce_fn(self, text):
"""return reference"""
- return text + f"\n\n{self.parse_source_view(self.chunks)}"
+ return text + f"\n\n{self.parse_source_view(self.chunks_with_score)}"
@trace()
async def generate_input_values(self) -> Dict:
@@ -132,25 +132,32 @@ async def generate_input_values(self) -> Dict:
from pilot.rag.retriever.rerank import DefaultRanker
ranker = DefaultRanker(self.top_k)
- docs = ranker.rank(candidates_with_scores)
- self.chunks = []
- if not docs or len(docs) == 0:
+ candidates_with_scores = ranker.rank(candidates_with_scores)
+ self.chunks_with_score = []
+ if not candidates_with_scores or len(candidates_with_scores) == 0:
print("no relevant docs to retrieve")
context = "no relevant docs to retrieve"
else:
- self.chunks = [
- self.chunk_dao.get_document_chunks(
- query=DocumentChunkEntity(content=d.page_content),
- document_ids=self.document_ids,
- )[0]
- for d in docs
+ self.chunks_with_score = [
+ (
+ self.chunk_dao.get_document_chunks(
+ query=DocumentChunkEntity(content=d.page_content),
+ document_ids=self.document_ids,
+ )[0],
+ score,
+ )
+ for d, score in candidates_with_scores
]
-
- context = [d.page_content for d in docs]
+ context = [doc.page_content for doc, _ in candidates_with_scores]
context = context[: self.max_token]
self.relations = list(
- set([os.path.basename(str(d.metadata.get("source", ""))) for d in docs])
+ set(
+ [
+ os.path.basename(str(d.metadata.get("source", "")))
+ for d, _ in candidates_with_scores
+ ]
+ )
)
input_values = {
"context": context,
@@ -159,7 +166,7 @@ async def generate_input_values(self) -> Dict:
}
return input_values
- def parse_source_view(self, chunks: List):
+ def parse_source_view(self, chunks_with_score: List):
"""
format knowledge reference view message to web
@@ -170,7 +177,7 @@ def parse_source_view(self, chunks: List):
title = "References"
references_ele.set("title", title)
references_dict = {}
- for chunk in chunks:
+ for chunk, score in chunks_with_score:
doc_name = chunk.doc_name
if doc_name not in references_dict:
references_dict[doc_name] = {
@@ -180,6 +187,7 @@ def parse_source_view(self, chunks: List):
"id": chunk.id,
"content": chunk.content,
"meta_info": chunk.meta_info,
+ "recall_score": score,
}
],
}
@@ -189,6 +197,7 @@ def parse_source_view(self, chunks: List):
"id": chunk.id,
"content": chunk.content,
"meta_info": chunk.meta_info,
+ "recall_score": score,
}
)
references_list = list(references_dict.values())
From c7b315af0876754a4c810d1f9af01aa4a7b0aab4 Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Fri, 1 Dec 2023 13:03:02 +0800
Subject: [PATCH 14/26] fix:add concurrency limit for similar search
---
pilot/scene/chat_knowledge/rewrite/prompt.py | 2 +-
pilot/scene/chat_knowledge/v1/chat.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pilot/scene/chat_knowledge/rewrite/prompt.py b/pilot/scene/chat_knowledge/rewrite/prompt.py
index fe5197d7c..73cd87c96 100644
--- a/pilot/scene/chat_knowledge/rewrite/prompt.py
+++ b/pilot/scene/chat_knowledge/rewrite/prompt.py
@@ -14,7 +14,7 @@
"---------------------\n"
"示例:"
"original_query:什么是RAG。"
-"queries:'1. 什么是RAG及其工作原理,2. RAG有哪些应用场景,3. 能否提供RAG在现实世界中的应用实例'"
+"queries:'1. 什么是RAG及其工作原理,2. RAG有哪些应用场景'"
"---------------------\n"
"original_query:{original_query}\n"
"queries:\n"
diff --git a/pilot/scene/chat_knowledge/v1/chat.py b/pilot/scene/chat_knowledge/v1/chat.py
index e1edb7795..e011f2561 100644
--- a/pilot/scene/chat_knowledge/v1/chat.py
+++ b/pilot/scene/chat_knowledge/v1/chat.py
@@ -126,7 +126,7 @@ async def generate_input_values(self) -> Dict:
# similarity search from vector db
tasks = [self.execute_similar_search(query) for query in queries]
- docs_with_scores = await run_async_tasks(tasks=tasks)
+ docs_with_scores = await run_async_tasks(tasks=tasks, concurrency_limit=2)
candidates_with_scores = reduce(lambda x, y: x + y, docs_with_scores)
# candidates document rerank
from pilot.rag.retriever.rerank import DefaultRanker
From 3b9ce1ad78db75a66cf04033b01e2022dc0ff51d Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Fri, 1 Dec 2023 14:57:41 +0800
Subject: [PATCH 15/26] feat:update query rerwite
---
pilot/scene/chat_knowledge/rewrite/out_parser.py | 6 ++----
pilot/scene/chat_knowledge/rewrite/prompt.py | 12 +-----------
pilot/scene/chat_knowledge/v1/chat.py | 1 +
3 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/pilot/scene/chat_knowledge/rewrite/out_parser.py b/pilot/scene/chat_knowledge/rewrite/out_parser.py
index 6674adcda..9a3ce5092 100644
--- a/pilot/scene/chat_knowledge/rewrite/out_parser.py
+++ b/pilot/scene/chat_knowledge/rewrite/out_parser.py
@@ -14,13 +14,11 @@ class QueryRewriteParser(BaseOutputParser):
def __init__(self, sep: str, is_stream_out: bool):
super().__init__(sep=sep, is_stream_out=is_stream_out)
- def parse_prompt_response(
- self, response, max_length: int = 128
- ) -> List[Tuple[str, str, str]]:
+ def parse_prompt_response(self, response, max_length: int = 128):
lowercase = True
try:
results = []
- response = response.strip() # Strip newlines from responses.
+ response = response.strip()
if response.startswith("queries:"):
response = response[len("queries:") :]
diff --git a/pilot/scene/chat_knowledge/rewrite/prompt.py b/pilot/scene/chat_knowledge/rewrite/prompt.py
index 73cd87c96..4df4f08c8 100644
--- a/pilot/scene/chat_knowledge/rewrite/prompt.py
+++ b/pilot/scene/chat_knowledge/rewrite/prompt.py
@@ -10,23 +10,13 @@
PROMPT_SCENE_DEFINE = """You are a helpful assistant that generates multiple search queries based on a single input query."""
-_DEFAULT_TEMPLATE_ZH = """请根据以下主题生成{nums}个相关的搜索查询,这些查询应与原始查询相似并且是人们可能会提出的可回答的搜索问题。请按照以下逗号分隔的格式提供: 'queries:':
-"---------------------\n"
-"示例:"
-"original_query:什么是RAG。"
-"queries:'1. 什么是RAG及其工作原理,2. RAG有哪些应用场景'"
-"---------------------\n"
+_DEFAULT_TEMPLATE_ZH = """请根据原问题优化生成{nums}个相关的搜索查询,这些查询应与原始查询相似并且是人们可能会提出的可回答的搜索问题。请勿使用任何示例中提到的内容,确保所有生成的查询均独立于示例,仅基于提供的原始查询。请按照以下逗号分隔的格式提供: 'queries:':
"original_query:{original_query}\n"
"queries:\n"
"""
_DEFAULT_TEMPLATE_EN = """
Generate {nums} search queries related to: {original_query}, Provide following comma-separated format: 'queries: '\n":
- "---------------------\n"
- "Example:"
- "original query: What is RAG."
- "queries:'1. what is rag and how does it work, 2. what are the applications of rag, 3. can you provide examples of rag usage in real-world scenarios'"
- "---------------------\n"
"original query:: {original_query}\n"
"queries:\n"
"""
diff --git a/pilot/scene/chat_knowledge/v1/chat.py b/pilot/scene/chat_knowledge/v1/chat.py
index e011f2561..f8ffaf4e3 100644
--- a/pilot/scene/chat_knowledge/v1/chat.py
+++ b/pilot/scene/chat_knowledge/v1/chat.py
@@ -121,6 +121,7 @@ async def generate_input_values(self) -> Dict:
queries = []
if CFG.KNOWLEDGE_SEARCH_REWRITE:
queries = await query_reinforce.rewrite()
+ print("rewrite queries:", queries)
queries.append(self.current_user_input)
from pilot.common.chat_util import run_async_tasks
From 07e19f8eff31af433f90d38c38850f26ae724921 Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Fri, 1 Dec 2023 15:26:34 +0800
Subject: [PATCH 16/26] feat:update reference web
---
.env.template | 2 +-
.../docs/application/advanced_tutorial/rag.md | 64 ++++++++++++++++++-
pilot/server/static/404.html | 2 +-
pilot/server/static/404/index.html | 2 +-
.../_buildManifest.js | 0
.../_ssgManifest.js | 0
.../_next/static/chunks/0.1410040668957610.js | 1 -
.../_next/static/chunks/0.a6282ef0fa8a7551.js | 1 +
...109d42c.js => webpack-551522135db2374e.js} | 2 +-
pilot/server/static/agent/index.html | 2 +-
.../static/chat/[scene]/[id]/index.html | 2 +-
pilot/server/static/chat/index.html | 2 +-
pilot/server/static/database/index.html | 2 +-
pilot/server/static/index.html | 2 +-
.../server/static/knowledge/chunk/index.html | 2 +-
pilot/server/static/knowledge/index.html | 2 +-
pilot/server/static/models/index.html | 2 +-
pilot/server/static/prompt/index.html | 2 +-
18 files changed, 77 insertions(+), 15 deletions(-)
rename pilot/server/static/_next/static/{Z-9u11WMONBSz1K_mIa0L => WeYyZQ_R0PDrCOumJLVgL}/_buildManifest.js (100%)
rename pilot/server/static/_next/static/{Z-9u11WMONBSz1K_mIa0L => WeYyZQ_R0PDrCOumJLVgL}/_ssgManifest.js (100%)
delete mode 100644 pilot/server/static/_next/static/chunks/0.1410040668957610.js
create mode 100644 pilot/server/static/_next/static/chunks/0.a6282ef0fa8a7551.js
rename pilot/server/static/_next/static/chunks/{webpack-b5216c63e109d42c.js => webpack-551522135db2374e.js} (98%)
diff --git a/.env.template b/.env.template
index d893b0dd7..1183505d9 100644
--- a/.env.template
+++ b/.env.template
@@ -79,7 +79,7 @@ KNOWLEDGE_SEARCH_TOP_SIZE=5
# Control whether to display the source document of knowledge on the front end.
KNOWLEDGE_CHAT_SHOW_RELATIONS=False
# Whether to enable Chat Knowledge Search Rewrite Mode
-KNOWLEDGE_SEARCH_REWRITE=True
+KNOWLEDGE_SEARCH_REWRITE=False
## EMBEDDING_TOKENIZER - Tokenizer to use for chunking large inputs
## EMBEDDING_TOKEN_LIMIT - Chunk size limit for large inputs
# EMBEDDING_MODEL=all-MiniLM-L6-v2
diff --git a/docs/docs/application/advanced_tutorial/rag.md b/docs/docs/application/advanced_tutorial/rag.md
index 49fb831f7..322dc564f 100644
--- a/docs/docs/application/advanced_tutorial/rag.md
+++ b/docs/docs/application/advanced_tutorial/rag.md
@@ -1 +1,63 @@
-# RAG Parameter Adjustment
\ No newline at end of file
+# RAG Parameter Adjustment
+Each knowledge space supports argument customization, including the relevant arguments for vector retrieval and the arguments for knowledge question-answering prompts.
+#### Embedding Arguments
+Embedding Argument
+![upload](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/f1221bd5-d049-4ceb-96e6-8709e76e502e)
+
+:::tip Embedding Arguments
+* topk:the top k vectors based on similarity score.
+* recall_score:set a similarity threshold score for the retrieval of similar vectors.
+* recall_type:recall type.
+* model:A model used to create vector representations of text or other data.
+* chunk_size:The size of the data chunks used in processing.
+* chunk_overlap:The amount of overlap between adjacent data chunks.
+:::
+
+#### Prompt Arguments
+Prompt Argument
+![upload](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/9918c9c3-ed64-4804-9e05-fa7d7d177bec)
+
+:::tip Prompt Arguments
+* scene:A contextual parameter used to define the setting or environment in which the prompt is being used.
+* template:A pre-defined structure or format for the prompt, which can help ensure that the AI system generates responses that are consistent with the desired style or tone.
+* max_token:The maximum number of tokens or words allowed in a prompt.
+:::
+
+#### Summary Arguments
+Summary Argument
+![image](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/96782ba2-e9a2-4173-a003-49d44bf874cc)
+
+:::tip summary arguments
+* max_iteration: summary max iteration call with llm, default 5.
+* concurrency_limit: default summary concurrency call with llm, default 3.
+:::
+
+#### Knowledge Query Rewrite
+set ``KNOWLEDGE_SEARCH_REWRITE=True`` in ``.env`` file, and restart the server.
+
+```shell
+# Whether to enable Chat Knowledge Search Rewrite Mode
+KNOWLEDGE_SEARCH_REWRITE=False
+```
+
+#### Change Vector Database
+
+set ``VECTOR_STORE_TYPE`` in ``.env`` file, and restart the server.
+
+```shell
+### Chroma vector db config
+VECTOR_STORE_TYPE=Chroma
+#CHROMA_PERSIST_PATH=/root/DB-GPT/pilot/data
+
+### Milvus vector db config
+#VECTOR_STORE_TYPE=Milvus
+#MILVUS_URL=127.0.0.1
+#MILVUS_PORT=19530
+#MILVUS_USERNAME
+#MILVUS_PASSWORD
+#MILVUS_SECURE=
+
+### Weaviate vector db config
+#VECTOR_STORE_TYPE=Weaviate
+#WEAVIATE_URL=https://kt-region-m8hcy0wc.weaviate.network
+
diff --git a/pilot/server/static/404.html b/pilot/server/static/404.html
index c440dced7..edc7eb0c5 100644
--- a/pilot/server/static/404.html
+++ b/pilot/server/static/404.html
@@ -1 +1 @@
-404: This page could not be found 404
This page could not be found.
\ No newline at end of file
+404: This page could not be found 404
This page could not be found.
\ No newline at end of file
diff --git a/pilot/server/static/404/index.html b/pilot/server/static/404/index.html
index c440dced7..edc7eb0c5 100644
--- a/pilot/server/static/404/index.html
+++ b/pilot/server/static/404/index.html
@@ -1 +1 @@
-404: This page could not be found 404
This page could not be found.
\ No newline at end of file
+404: This page could not be found 404
This page could not be found.
\ No newline at end of file
diff --git a/pilot/server/static/_next/static/Z-9u11WMONBSz1K_mIa0L/_buildManifest.js b/pilot/server/static/_next/static/WeYyZQ_R0PDrCOumJLVgL/_buildManifest.js
similarity index 100%
rename from pilot/server/static/_next/static/Z-9u11WMONBSz1K_mIa0L/_buildManifest.js
rename to pilot/server/static/_next/static/WeYyZQ_R0PDrCOumJLVgL/_buildManifest.js
diff --git a/pilot/server/static/_next/static/Z-9u11WMONBSz1K_mIa0L/_ssgManifest.js b/pilot/server/static/_next/static/WeYyZQ_R0PDrCOumJLVgL/_ssgManifest.js
similarity index 100%
rename from pilot/server/static/_next/static/Z-9u11WMONBSz1K_mIa0L/_ssgManifest.js
rename to pilot/server/static/_next/static/WeYyZQ_R0PDrCOumJLVgL/_ssgManifest.js
diff --git a/pilot/server/static/_next/static/chunks/0.1410040668957610.js b/pilot/server/static/_next/static/chunks/0.1410040668957610.js
deleted file mode 100644
index 496a0dfd2..000000000
--- a/pilot/server/static/_next/static/chunks/0.1410040668957610.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[0],{15506:function(e,l,t){t.r(l),t.d(l,{default:function(){return ew}});var a=t(85893),s=t(67294),n=t(2093),r=t(43446),o=t(39332),i=t(99513),c=t(24019),d=t(50888),u=t(97937),m=t(63606),x=t(50228),h=t(87547),p=t(89035),v=t(33035),f=t(12767),g=t(94184),j=t.n(g),b=t(66309),y=t(81799),w=t(41468),_=t(29158),Z=t(98165),N=t(14079),k=t(38426),C=t(61607),S=t(44442),P=t(74627),R=t(36782),E=t(13135),D=t(71577),I=t(2453),M=t(57132),O=t(79166),z=t(93179),L=t(20640),A=t.n(L);function F(e){let{code:l,language:t}=e;return(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(D.ZP,{className:"absolute right-3 top-2 text-gray-300 hover:!text-gray-200 bg-gray-700",type:"text",icon:(0,a.jsx)(M.Z,{}),onClick:()=>{let e=A()(l);I.ZP[e?"success":"error"](e?"Copy success":"Copy failed")}}),(0,a.jsx)(z.Z,{language:t,style:O.Z,children:l})]})}let H=["custom-view","chart-view","references","summary"],q={code(e){var l;let{inline:t,node:s,className:n,children:r,style:o,...i}=e,{context:c,matchValues:d}=function(e){let l=H.reduce((l,t)=>{let a=RegExp("<".concat(t,"[^>]*/?>"),"gi");return e=e.replace(a,e=>(l.push(e),"")),l},[]);return{context:e,matchValues:l}}(Array.isArray(r)?r.join("\n"):r),u=/language-(\w+)/.exec(n||"");return(0,a.jsxs)(a.Fragment,{children:[!t&&u?(0,a.jsx)(F,{code:c,language:null!==(l=null==u?void 0:u[1])&&void 0!==l?l:"javascript"}):(0,a.jsx)("code",{...i,style:o,className:"px-[6px] py-[2px] rounded bg-gray-700 text-gray-100 dark:bg-gray-100 dark:text-gray-800 text-sm",children:r}),(0,a.jsx)(v.D,{components:q,rehypePlugins:[f.Z],children:d.join("\n")})]})},ul(e){let{children:l}=e;return(0,a.jsx)("ul",{className:"py-1",children:l})},ol(e){let{children:l}=e;return(0,a.jsx)("ol",{className:"py-1",children:l})},li(e){let{children:l,ordered:t}=e;return(0,a.jsx)("li",{className:"text-sm leading-7 ml-5 pl-2 text-gray-600 dark:text-gray-300 ".concat(t?"list-decimal":"list-disc"),children:l})},table(e){let{children:l}=e;return(0,a.jsx)("table",{className:"my-2 rounded-tl-md rounded-tr-md max-w-full bg-white dark:bg-gray-900 text-sm rounded-lg overflow-hidden",children:l})},thead(e){let{children:l}=e;return(0,a.jsx)("thead",{className:"bg-[#fafafa] dark:bg-black font-semibold",children:l})},th(e){let{children:l}=e;return(0,a.jsx)("th",{className:"!text-left p-4",children:l})},td(e){let{children:l}=e;return(0,a.jsx)("td",{className:"p-4 border-t border-[#f0f0f0] dark:border-gray-700",children:l})},h1(e){let{children:l}=e;return(0,a.jsx)("h3",{className:"text-2xl font-bold my-4 border-b border-slate-300 pb-4",children:l})},h2(e){let{children:l}=e;return(0,a.jsx)("h3",{className:"text-xl font-bold my-3",children:l})},h3(e){let{children:l}=e;return(0,a.jsx)("h3",{className:"text-lg font-semibold my-2",children:l})},h4(e){let{children:l}=e;return(0,a.jsx)("h3",{className:"text-base font-semibold my-1",children:l})},a(e){let{children:l,href:t}=e;return(0,a.jsxs)("div",{className:"inline-block text-blue-600 dark:text-blue-400",children:[(0,a.jsx)(_.Z,{className:"mr-1"}),(0,a.jsx)("a",{href:t,target:"_blank",children:l})]})},img(e){let{src:l,alt:t}=e;return(0,a.jsx)("div",{children:(0,a.jsx)(k.Z,{className:"min-h-[1rem] max-w-full max-h-full border rounded",src:l,alt:t,placeholder:(0,a.jsx)(b.Z,{icon:(0,a.jsx)(Z.Z,{spin:!0}),color:"processing",children:"Image Loading..."}),fallback:"/images/fallback.png"})})},blockquote(e){let{children:l}=e;return(0,a.jsx)("blockquote",{className:"py-4 px-6 border-l-4 border-blue-600 rounded bg-white my-2 text-gray-500 dark:bg-slate-800 dark:text-gray-200 dark:border-white shadow-sm",children:l})},"chart-view":function(e){var l,t,s;let n,{content:r,children:o}=e;try{n=JSON.parse(r)}catch(e){console.log(e,r),n={type:"response_table",sql:"",data:[]}}let i=(null==n?void 0:null===(l=n.data)||void 0===l?void 0:l[0])?null===(t=Object.keys(null==n?void 0:null===(s=n.data)||void 0===s?void 0:s[0]))||void 0===t?void 0:t.map(e=>({title:e,dataIndex:e,key:e})):[],c={key:"chart",label:"Chart",children:(0,a.jsx)(E._z,{data:null==n?void 0:n.data,chartType:(0,E.aG)(null==n?void 0:n.type)})},d={key:"sql",label:"SQL",children:(0,a.jsx)(F,{code:(0,R.WU)(null==n?void 0:n.sql,{language:"mysql"}),language:"sql"})},u={key:"data",label:"Data",children:(0,a.jsx)(C.Z,{dataSource:null==n?void 0:n.data,columns:i})},m=(null==n?void 0:n.type)==="response_table"?[u,d]:[c,d,u];return(0,a.jsxs)("div",{children:[(0,a.jsx)(S.Z,{defaultActiveKey:(null==n?void 0:n.type)==="response_table"?"data":"chart",items:m,size:"small"}),o]})},references:function(e){let l,{title:t,references:s,children:n}=e;if(n)try{t=(l=JSON.parse(n)).title,s=l.references}catch(e){}else try{s=JSON.parse(s)}catch(e){}return!s||(null==s?void 0:s.length)<1?null:(0,a.jsxs)("div",{className:"border-t-[1px] border-gray-300 mt-3 py-2",children:[(0,a.jsxs)("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-2",children:[(0,a.jsx)(_.Z,{className:"mr-2"}),(0,a.jsx)("span",{className:"font-semibold",children:t})]}),s.map((e,l)=>{var t;return(0,a.jsxs)("div",{className:"text-sm font-normal block ml-2 h-6 leading-6 overflow-hidden",children:[(0,a.jsxs)("span",{className:"inline-block w-6",children:["[",l+1,"]"]}),(0,a.jsx)("span",{className:"mr-2 lg:mr-4 text-blue-400",children:e.name}),null==e?void 0:null===(t=e.chunks)||void 0===t?void 0:t.map((l,t)=>(0,a.jsxs)("span",{children:["object"==typeof l?(0,a.jsx)(P.Z,{content:(0,a.jsxs)("div",{className:"max-w-4xl py-4 border-t border-gray-500",children:[(0,a.jsx)("p",{children:(null==l?void 0:l.content)||"No Content"}),(0,a.jsx)("p",{className:"mt-2 font-bold mr-2 border-t border-gray-500 pt-2",children:"MetaData"}),(0,a.jsx)("p",{children:(null==l?void 0:l.meta_info)||"No MetaData"})]}),title:"Chunk Content",children:(0,a.jsx)("span",{className:"cursor-pointer text-blue-500 ml-2",children:null==l?void 0:l.id},"chunk_content_".concat(null==l?void 0:l.id))}):(0,a.jsx)("span",{className:"cursor-pointer text-blue-500 ml-2",children:l},"chunk_id_".concat(l)),t<(null==e?void 0:e.chunks.length)-1&&(0,a.jsx)("span",{children:","},"chunk_comma_".concat(t))]},"chunk_".concat(t)))]},"file_".concat(l))})]})},summary:function(e){let{children:l}=e;return(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"mb-2",children:[(0,a.jsx)(N.Z,{className:"mr-2"}),(0,a.jsx)("span",{className:"font-semibold",children:"Document Summary"})]}),(0,a.jsx)("div",{children:l})]})}},V={todo:{bgClass:"bg-gray-500",icon:(0,a.jsx)(c.Z,{className:"ml-2"})},runing:{bgClass:"bg-blue-500",icon:(0,a.jsx)(d.Z,{className:"ml-2"})},failed:{bgClass:"bg-red-500",icon:(0,a.jsx)(u.Z,{className:"ml-2"})},completed:{bgClass:"bg-green-500",icon:(0,a.jsx)(m.Z,{className:"ml-2"})}};function T(e){return e.replaceAll("\\n","\n").replace(/]+)>/gi,"").replace(/]+)>/gi," ")}var G=(0,s.memo)(function(e){let{children:l,content:t,isChartChat:n,onLinkClick:r}=e,{scene:o}=(0,s.useContext)(w.p),{context:i,model_name:c,role:d}=t,u="view"===d,{relations:m,value:g,cachePluginContext:_}=(0,s.useMemo)(()=>{if("string"!=typeof i)return{relations:[],value:"",cachePluginContext:[]};let[e,l]=i.split(" relations:"),t=l?l.split(","):[],a=[],s=0,n=e.replace(/]*>[^<]*<\/dbgpt-view>/gi,e=>{try{var l;let t=e.replaceAll("\n","\\n").replace(/<[^>]*>|<\/[^>]*>/gm,""),n=JSON.parse(t),r="".concat(s," ");return a.push({...n,result:T(null!==(l=n.result)&&void 0!==l?l:"")}),s++,r}catch(l){return console.log(l.message,l),e}});return{relations:t,cachePluginContext:a,value:n}},[i]),Z=(0,s.useMemo)(()=>({"custom-view"(e){var l;let{children:t}=e,s=+t.toString();if(!_[s])return t;let{name:n,status:r,err_msg:o,result:i}=_[s],{bgClass:c,icon:d}=null!==(l=V[r])&&void 0!==l?l:{};return(0,a.jsxs)("div",{className:"bg-white dark:bg-[#212121] rounded-lg overflow-hidden my-2 flex flex-col lg:max-w-[80%]",children:[(0,a.jsxs)("div",{className:j()("flex px-4 md:px-6 py-2 items-center text-white text-sm",c),children:[n,d]}),i?(0,a.jsx)("div",{className:"px-4 md:px-6 py-4 text-sm",children:(0,a.jsx)(v.D,{components:q,rehypePlugins:[f.Z],children:null!=i?i:""})}):(0,a.jsx)("div",{className:"px-4 md:px-6 py-4 text-sm",children:o})]})}}),[i,_]);return u||i?(0,a.jsxs)("div",{className:j()("relative flex flex-wrap w-full px-2 sm:px-4 py-2 sm:py-4 rounded-xl break-words",{"bg-slate-100 dark:bg-[#353539]":u,"lg:w-full xl:w-full pl-0":["chat_with_db_execute","chat_dashboard"].includes(o)}),children:[(0,a.jsx)("div",{className:"mr-2 flex flex-shrink-0 items-center justify-center h-7 w-7 rounded-full text-lg sm:mr-4",children:u?(0,y.A)(c)||(0,a.jsx)(x.Z,{}):(0,a.jsx)(h.Z,{})}),(0,a.jsxs)("div",{className:"flex-1 overflow-hidden items-center text-md leading-8",children:[!u&&"string"==typeof i&&i,u&&n&&"object"==typeof i&&(0,a.jsxs)("div",{children:["[".concat(i.template_name,"]: "),(0,a.jsxs)("span",{className:"text-[#1677ff] cursor-pointer",onClick:r,children:[(0,a.jsx)(p.Z,{className:"mr-1"}),i.template_introduce||"More Details"]})]}),u&&"string"==typeof i&&(0,a.jsx)(v.D,{components:{...q,...Z},rehypePlugins:[f.Z],children:T(g)}),!!(null==m?void 0:m.length)&&(0,a.jsx)("div",{className:"flex flex-wrap mt-2",children:null==m?void 0:m.map((e,l)=>(0,a.jsx)(b.Z,{color:"#108ee9",children:e},e+l))})]}),l]}):(0,a.jsx)("div",{className:"h-12"})}),J=t(59301),U=t(41132),W=t(74312),$=t(3414),B=t(72868),Q=t(59562),K=t(14553),X=t(25359),Y=t(7203),ee=t(48665),el=t(26047),et=t(99056),ea=t(57814),es=t(63955),en=t(33028),er=t(40911),eo=t(66478),ei=t(83062),ec=t(50489),ed=t(67421),eu=e=>{var l;let{conv_index:t,question:n,knowledge_space:r,select_param:o}=e,{t:i}=(0,ed.$G)(),{chatId:c}=(0,s.useContext)(w.p),[d,u]=(0,s.useState)(""),[m,x]=(0,s.useState)(4),[h,p]=(0,s.useState)(""),v=(0,s.useRef)(null),[f,g]=I.ZP.useMessage(),j=(0,s.useCallback)((e,l)=>{l?(0,ec.Vx)((0,ec.Eb)(c,t)).then(e=>{var l,t,a,s;let n=null!==(l=e[1])&&void 0!==l?l:{};u(null!==(t=n.ques_type)&&void 0!==t?t:""),x(parseInt(null!==(a=n.score)&&void 0!==a?a:"4")),p(null!==(s=n.messages)&&void 0!==s?s:"")}).catch(e=>{console.log(e)}):(u(""),x(4),p(""))},[c,t]),b=(0,W.Z)($.Z)(e=>{let{theme:l}=e;return{backgroundColor:"dark"===l.palette.mode?"#FBFCFD":"#0E0E10",...l.typography["body-sm"],padding:l.spacing(1),display:"flex",alignItems:"center",justifyContent:"center",borderRadius:4,width:"100%",height:"100%"}});return(0,a.jsxs)(B.L,{onOpenChange:j,children:[g,(0,a.jsx)(ei.Z,{title:i("Rating"),children:(0,a.jsx)(Q.Z,{slots:{root:K.ZP},slotProps:{root:{variant:"plain",color:"primary"}},sx:{borderRadius:40},children:(0,a.jsx)(J.Z,{})})}),(0,a.jsxs)(X.Z,{children:[(0,a.jsx)(Y.Z,{disabled:!0,sx:{minHeight:0}}),(0,a.jsx)(ee.Z,{sx:{width:"100%",maxWidth:350,display:"grid",gap:3,padding:1},children:(0,a.jsx)("form",{onSubmit:e=>{e.preventDefault();let l={conv_uid:c,conv_index:t,question:n,knowledge_space:r,score:m,ques_type:d,messages:h};console.log(l),(0,ec.Vx)((0,ec.VC)({data:l})).then(e=>{f.open({type:"success",content:"save success"})}).catch(e=>{f.open({type:"error",content:"save error"})})},children:(0,a.jsxs)(el.Z,{container:!0,spacing:.5,columns:13,sx:{flexGrow:1},children:[(0,a.jsx)(el.Z,{xs:3,children:(0,a.jsx)(b,{children:i("Q_A_Category")})}),(0,a.jsx)(el.Z,{xs:10,children:(0,a.jsx)(et.Z,{action:v,value:d,placeholder:"Choose one…",onChange:(e,l)=>u(null!=l?l:""),...d&&{endDecorator:(0,a.jsx)(K.ZP,{size:"sm",variant:"plain",color:"neutral",onMouseDown:e=>{e.stopPropagation()},onClick:()=>{var e;u(""),null===(e=v.current)||void 0===e||e.focusVisible()},children:(0,a.jsx)(U.Z,{})}),indicator:null},sx:{width:"100%"},children:o&&(null===(l=Object.keys(o))||void 0===l?void 0:l.map(e=>(0,a.jsx)(ea.Z,{value:e,children:o[e]},e)))})}),(0,a.jsx)(el.Z,{xs:3,children:(0,a.jsx)(b,{children:(0,a.jsx)(ei.Z,{title:(0,a.jsx)(ee.Z,{children:(0,a.jsx)("div",{children:i("feed_back_desc")})}),variant:"solid",placement:"left",children:i("Q_A_Rating")})})}),(0,a.jsx)(el.Z,{xs:10,sx:{pl:0,ml:0},children:(0,a.jsx)(es.Z,{"aria-label":"Custom",step:1,min:0,max:5,valueLabelFormat:function(e){return({0:i("Lowest"),1:i("Missed"),2:i("Lost"),3:i("Incorrect"),4:i("Verbose"),5:i("Best")})[e]},valueLabelDisplay:"on",marks:[{value:0,label:"0"},{value:1,label:"1"},{value:2,label:"2"},{value:3,label:"3"},{value:4,label:"4"},{value:5,label:"5"}],sx:{width:"90%",pt:3,m:2,ml:1},onChange:e=>{var l;return x(null===(l=e.target)||void 0===l?void 0:l.value)},value:m})}),(0,a.jsx)(el.Z,{xs:13,children:(0,a.jsx)(en.Z,{placeholder:i("Please_input_the_text"),value:h,onChange:e=>p(e.target.value),minRows:2,maxRows:4,endDecorator:(0,a.jsx)(er.ZP,{level:"body-xs",sx:{ml:"auto"},children:i("input_count")+h.length+i("input_unit")}),sx:{width:"100%",fontSize:14}})}),(0,a.jsx)(el.Z,{xs:13,children:(0,a.jsx)(eo.Z,{type:"submit",variant:"outlined",sx:{width:"100%",height:"100%"},children:i("submit")})})]})})})]})]})},em=t(32983),ex=t(12069),eh=t(96486),ep=t(20766),ev=t(98399),ef=t(87740),eg=t(80573),ej=e=>{var l;let{messages:t,onSubmit:r}=e,{dbParam:c,currentDialogue:d,scene:u,model:m,refreshDialogList:x,chatId:h,agentList:p,docId:v}=(0,s.useContext)(w.p),{t:f}=(0,ed.$G)(),g=(0,o.useSearchParams)(),b=null!==(l=g&&g.get("spaceNameOriginal"))&&void 0!==l?l:"",[_,Z]=(0,s.useState)(!1),[N,k]=(0,s.useState)(!1),[C,S]=(0,s.useState)(t),[P,R]=(0,s.useState)(""),[E,D]=(0,s.useState)(),O=(0,s.useRef)(null),z=(0,s.useMemo)(()=>"chat_dashboard"===u,[u]),L=(0,eg.Z)(),F=(0,s.useMemo)(()=>{switch(u){case"chat_agent":return p.join(",");case"chat_excel":return null==d?void 0:d.select_param;default:return b||c}},[u,p,d,c,b]),H=async e=>{if(!_&&e.trim())try{Z(!0),await r(e,{select_param:null!=F?F:""})}finally{Z(!1)}},q=e=>{try{return JSON.parse(e)}catch(l){return e}},[V,T]=I.ZP.useMessage(),J=async e=>{let l=null==e?void 0:e.replace(/\trelations:.*/g,""),t=A()(l);t?l?V.open({type:"success",content:f("Copy_success")}):V.open({type:"warning",content:f("Copy_nothing")}):V.open({type:"error",content:f("Copry_error")})},U=async()=>{!_&&v&&(Z(!0),await L(v),Z(!1))};return(0,n.Z)(async()=>{let e=(0,ev.a_)();e&&e.id===h&&(await H(e.message),x(),localStorage.removeItem(ev.rU))},[h]),(0,s.useEffect)(()=>{let e=t;z&&(e=(0,eh.cloneDeep)(t).map(e=>((null==e?void 0:e.role)==="view"&&"string"==typeof(null==e?void 0:e.context)&&(e.context=q(null==e?void 0:e.context)),e))),S(e.filter(e=>["view","human"].includes(e.role)))},[z,t]),(0,s.useEffect)(()=>{(0,ec.Vx)((0,ec.Lu)()).then(e=>{var l;D(null!==(l=e[1])&&void 0!==l?l:{})}).catch(e=>{console.log(e)})},[]),(0,s.useEffect)(()=>{setTimeout(()=>{var e;null===(e=O.current)||void 0===e||e.scrollTo(0,O.current.scrollHeight)},50)},[t]),(0,a.jsxs)(a.Fragment,{children:[T,(0,a.jsx)("div",{ref:O,className:"flex flex-1 overflow-y-auto pb-8 w-full flex-col",children:(0,a.jsx)("div",{className:"flex items-center flex-1 flex-col text-sm leading-6 text-slate-900 dark:text-slate-300 sm:text-base sm:leading-7",children:C.length?C.map((e,l)=>{var t;return(0,a.jsx)(G,{content:e,isChartChat:z,onLinkClick:()=>{k(!0),R(JSON.stringify(null==e?void 0:e.context,null,2))},children:"view"===e.role&&(0,a.jsxs)("div",{className:"flex w-full pt-2 md:pt-4 border-t border-gray-200 mt-2 md:mt-4 pl-2",children:["chat_knowledge"===u&&e.retry?(0,a.jsxs)(eo.Z,{onClick:U,slots:{root:K.ZP},slotProps:{root:{variant:"plain",color:"primary"}},children:[(0,a.jsx)(ef.Z,{}),"\xa0",(0,a.jsx)("span",{className:"text-sm",children:f("Retry")})]}):null,(0,a.jsxs)("div",{className:"flex w-full flex-row-reverse",children:[(0,a.jsx)(eu,{select_param:E,conv_index:Math.ceil((l+1)/2),question:null===(t=null==C?void 0:C.filter(l=>(null==l?void 0:l.role)==="human"&&(null==l?void 0:l.order)===e.order)[0])||void 0===t?void 0:t.context,knowledge_space:b||c||""}),(0,a.jsx)(ei.Z,{title:f("Copy"),children:(0,a.jsx)(eo.Z,{onClick:()=>J(null==e?void 0:e.context),slots:{root:K.ZP},slotProps:{root:{variant:"plain",color:"primary"}},sx:{borderRadius:40},children:(0,a.jsx)(M.Z,{})})})]})]})},l)}):(0,a.jsx)(em.Z,{image:"/empty.png",imageStyle:{width:320,height:320,margin:"0 auto",maxWidth:"100%",maxHeight:"100%"},className:"flex items-center justify-center flex-col h-full w-full",description:"Start a conversation"})})}),(0,a.jsx)("div",{className:j()("relative after:absolute after:-top-8 after:h-8 after:w-full after:bg-gradient-to-t after:from-white after:to-transparent dark:after:from-[#212121]",{"cursor-not-allowed":"chat_excel"===u&&!(null==d?void 0:d.select_param)}),children:(0,a.jsxs)("div",{className:"flex flex-wrap w-full py-2 sm:pt-6 sm:pb-10 items-center",children:[m&&(0,a.jsx)("div",{className:"mr-2 flex",children:(0,y.A)(m)}),(0,a.jsx)(ep.Z,{loading:_,onSubmit:H,handleFinish:Z})]})}),(0,a.jsx)(ex.default,{title:"JSON Editor",open:N,width:"60%",cancelButtonProps:{hidden:!0},onOk:()=>{k(!1)},onCancel:()=>{k(!1)},children:(0,a.jsx)(i.Z,{className:"w-full h-[500px]",language:"json",value:P})})]})},eb=t(34625),ey=t(45247),ew=()=>{var e;let l=(0,o.useSearchParams)(),{scene:t,chatId:i,model:c,setModel:d,history:u,setHistory:m}=(0,s.useContext)(w.p),x=(0,r.Z)({}),h=null!==(e=l&&l.get("initMessage"))&&void 0!==e?e:"",[p,v]=(0,s.useState)(!1),[f,g]=(0,s.useState)(),b=async()=>{v(!0);let[,e]=await (0,ec.Vx)((0,ec.$i)(i));m(null!=e?e:[]),v(!1)},y=e=>{var l;let t=null===(l=e[e.length-1])||void 0===l?void 0:l.context;if(t)try{let e=JSON.parse(t);g((null==e?void 0:e.template_name)==="report"?null==e?void 0:e.charts:void 0)}catch(e){g(void 0)}};(0,n.Z)(async()=>{let e=(0,ev.a_)();e&&e.id===i||await b()},[h,i]),(0,s.useEffect)(()=>{var e,l;if(!u.length)return;let t=null===(e=null===(l=u.filter(e=>"view"===e.role))||void 0===l?void 0:l.slice(-1))||void 0===e?void 0:e[0];(null==t?void 0:t.model_name)&&d(t.model_name),y(u)},[u.length]),(0,s.useEffect)(()=>()=>{m([])},[]);let _=(0,s.useCallback)((e,l)=>new Promise(a=>{let s=[...u,{role:"human",context:e,model_name:c,order:0,time_stamp:0},{role:"view",context:"",model_name:c,order:0,time_stamp:0}],n=s.length-1;m([...s]),x({data:{...l,chat_mode:t||"chat_normal",model_name:c,user_input:e},chatId:i,onMessage:e=>{s[n].context=e,m([...s])},onDone:()=>{y(s),a()},onClose:()=>{y(s),a()},onError:e=>{s[n].context=e,m([...s]),a()}})}),[u,x,c]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ey.Z,{visible:p}),(0,a.jsx)(eb.Z,{refreshHistory:b,modelChange:e=>{d(e)}}),(0,a.jsxs)("div",{className:"px-4 flex flex-1 flex-wrap overflow-hidden relative",children:[!!(null==f?void 0:f.length)&&(0,a.jsx)("div",{className:"w-full xl:w-3/4 h-3/5 xl:pr-4 xl:h-full overflow-y-auto",children:(0,a.jsx)(E.ZP,{chartsData:f})}),!(null==f?void 0:f.length)&&"chat_dashboard"===t&&(0,a.jsx)(em.Z,{image:"/empty.png",imageStyle:{width:320,height:320,margin:"0 auto",maxWidth:"100%",maxHeight:"100%"},className:"w-full xl:w-3/4 h-3/5 xl:h-full pt-0 md:pt-10"}),(0,a.jsx)("div",{className:j()("flex flex-1 flex-col overflow-hidden",{"px-0 xl:pl-4 h-2/5 xl:h-full border-t xl:border-t-0 xl:border-l":"chat_dashboard"===t,"h-full lg:px-8":"chat_dashboard"!==t}),children:(0,a.jsx)(ej,{messages:u,onSubmit:_})})]})]})}},20766:function(e,l,t){t.d(l,{Z:function(){return D}});var a=t(85893),s=t(27496),n=t(59566),r=t(71577),o=t(67294),i=t(2487),c=t(83062),d=t(2453),u=t(46735),m=t(74627),x=t(39479),h=t(51009),p=t(58299),v=t(577),f=t(30119),g=t(67421);let j=e=>{let{data:l,loading:t,submit:s,close:n}=e,{t:r}=(0,g.$G)(),o=e=>()=>{s(e),n()};return(0,a.jsx)("div",{style:{maxHeight:400,overflow:"auto"},children:(0,a.jsx)(i.Z,{dataSource:null==l?void 0:l.data,loading:t,rowKey:e=>e.prompt_name,renderItem:e=>(0,a.jsx)(i.Z.Item,{onClick:o(e.content),children:(0,a.jsx)(c.Z,{title:e.content,children:(0,a.jsx)(i.Z.Item.Meta,{style:{cursor:"copy"},title:e.prompt_name,description:r("Prompt_Info_Scene")+":".concat(e.chat_scene,",")+r("Prompt_Info_Sub_Scene")+":".concat(e.sub_chat_scene)})})},e.prompt_name)})})};var b=e=>{let{submit:l}=e,{t}=(0,g.$G)(),[s,n]=(0,o.useState)(!1),[r,i]=(0,o.useState)("common"),{data:b,loading:y}=(0,v.Z)(()=>(0,f.PR)("/prompt/list",{prompt_type:r}),{refreshDeps:[r],onError:e=>{d.ZP.error(null==e?void 0:e.message)}});return(0,a.jsx)(u.ZP,{theme:{components:{Popover:{minWidth:250}}},children:(0,a.jsx)(m.Z,{title:(0,a.jsx)(x.Z.Item,{label:"Prompt "+t("Type"),children:(0,a.jsx)(h.default,{style:{width:150},value:r,onChange:e=>{i(e)},options:[{label:t("Public")+" Prompts",value:"common"},{label:t("Private")+" Prompts",value:"private"}]})}),content:(0,a.jsx)(j,{data:b,loading:y,submit:l,close:()=>{n(!1)}}),placement:"topRight",trigger:"click",open:s,onOpenChange:e=>{n(e)},children:(0,a.jsx)(c.Z,{title:t("Click_Select")+" Prompt",children:(0,a.jsx)(p.Z,{className:"bottom-[30%]"})})})})},y=t(41468),w=t(50489),_=t(80573),Z=t(5392),N=t(84553);function k(e){let{dbParam:l,setDocId:t}=(0,o.useContext)(y.p),{onUploadFinish:s,handleFinish:n}=e,i=(0,_.Z)(),[c,d]=(0,o.useState)(!1),u=async(e,l)=>{await (0,w.Vx)((0,w.Hx)(e,{doc_ids:[l]}))},m=async e=>{d(!0);let a=new FormData;a.append("doc_name",e.file.name),a.append("doc_file",e.file),a.append("doc_type","DOCUMENT");let r=await (0,w.Vx)((0,w.iG)(l||"default",a));if(!r[1]){d(!1);return}t(r[1]),s(),await u(l||"default",null==r?void 0:r[1]),d(!1),null==n||n(!0),await i(r[1]),null==n||n(!1)};return(0,a.jsx)(N.default,{customRequest:m,showUploadList:!1,maxCount:1,multiple:!1,className:"absolute z-10 top-2 left-2",accept:".pdf,.ppt,.pptx,.xls,.xlsx,.doc,.docx,.txt,.md",children:(0,a.jsx)(r.ZP,{loading:c,size:"small",shape:"circle",icon:(0,a.jsx)(Z.Z,{})})})}var C=t(11163),S=t(82579);function P(){return(0,a.jsx)("svg",{className:"mr-1",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"6058",width:"1.5em",height:"1.5em",children:(0,a.jsx)("path",{d:"M688 312c0 4.4-3.6 8-8 8H296c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8h384c4.4 0 8 3.6 8 8v48z m-392 88h184c4.4 0 8 3.6 8 8v48c0 4.4-3.6 8-8 8H296c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8z m376 116c119.3 0 216 96.7 216 216s-96.7 216-216 216-216-96.7-216-216 96.7-216 216-216z m107.5 323.5C808.2 810.8 824 772.6 824 732s-15.8-78.8-44.5-107.5S712.6 580 672 580s-78.8 15.8-107.5 44.5S520 691.4 520 732s15.8 78.8 44.5 107.5S631.4 884 672 884s78.8-15.8 107.5-44.5zM440 852c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H168c-17.7 0-32-14.3-32-32V108c0-17.7 14.3-32 32-32h640c17.7 0 32 14.3 32 32v384c0 4.4-3.6 8-8 8h-56c-4.4 0-8-3.6-8-8V148H208v704h232z m232-76.06l-20.56 28.43c-1.5 2.1-3.9 3.3-6.5 3.3h-44.3c-6.5 0-10.3-7.4-6.4-12.7l45.75-63.3-45.75-63.3c-3.9-5.3-0.1-12.7 6.4-12.7h44.3c2.6 0 5 1.2 6.5 3.3L672 687.4l20.56-28.43c1.5-2.1 3.9-3.3 6.5-3.3h44.3c6.5 0 10.3 7.4 6.4 12.7l-45.75 63.3 45.75 63.3c3.9 5.3 0.1 12.7-6.4 12.7h-44.3c-2.6 0-5-1.2-6.5-3.3L672 775.94z",fill:"#d81e06","p-id":"6059"})})}function R(e){let{document:l}=e;switch(l.status){case"RUNNING":return(0,a.jsx)(S.Rp,{});case"FINISHED":default:return(0,a.jsx)(S.s2,{});case"FAILED":return(0,a.jsx)(P,{})}}function E(e){let{documents:l,dbParam:t}=e,s=(0,C.useRouter)(),n=e=>{s.push("/knowledge/chunk/?spaceName=".concat(t,"&id=").concat(e))};return(null==l?void 0:l.length)?(0,a.jsx)("div",{className:"absolute flex overflow-scroll h-12 top-[-35px] w-full z-10",children:l.map(e=>{let l;switch(e.status){case"RUNNING":l="#2db7f5";break;case"FINISHED":default:l="#87d068";break;case"FAILED":l="#f50"}return(0,a.jsx)(c.Z,{title:e.result,children:(0,a.jsxs)(r.ZP,{style:{color:l},onClick:()=>{n(e.id)},className:"shrink flex items-center mr-3",children:[(0,a.jsx)(R,{document:e}),e.doc_name]})},e.id)})}):null}var D=function(e){let{children:l,loading:t,onSubmit:i,handleFinish:c,...d}=e,{dbParam:u,scene:m}=(0,o.useContext)(y.p),[x,h]=(0,o.useState)(""),p=(0,o.useMemo)(()=>"chat_knowledge"===m,[m]),[v,f]=(0,o.useState)([]),g=(0,o.useRef)(0);async function j(){if(!u)return null;let[e,l]=await (0,w.Vx)((0,w._Q)(u,{page:1,page_size:g.current}));f(null==l?void 0:l.data)}return(0,o.useEffect)(()=>{p&&j()},[u]),(0,a.jsxs)("div",{className:"flex-1 relative",children:[(0,a.jsx)(E,{documents:v,dbParam:u}),p&&(0,a.jsx)(k,{handleFinish:c,onUploadFinish:()=>{g.current+=1,j()},className:"absolute z-10 top-2 left-2"}),(0,a.jsx)(n.default.TextArea,{className:"flex-1 ".concat(p?"pl-10":""," pr-10"),size:"large",value:x,autoSize:{minRows:1,maxRows:4},...d,onPressEnter:e=>{if(x.trim()&&13===e.keyCode){if(e.shiftKey){h(e=>e+"\n");return}i(x),setTimeout(()=>{h("")},0)}},onChange:e=>{if("number"==typeof d.maxLength){h(e.target.value.substring(0,d.maxLength));return}h(e.target.value)}}),(0,a.jsx)(r.ZP,{className:"ml-2 flex items-center justify-center absolute right-2 bottom-0",size:"large",type:"text",loading:t,icon:(0,a.jsx)(s.Z,{}),onClick:()=>{i(x)}}),(0,a.jsx)(b,{submit:e=>{h(x+e)}}),l]})}},45247:function(e,l,t){var a=t(85893),s=t(50888);l.Z=function(e){let{visible:l}=e;return l?(0,a.jsx)("div",{className:"absolute w-full h-full top-0 left-0 flex justify-center items-center z-10 bg-white dark:bg-black bg-opacity-50 dark:bg-opacity-50 backdrop-blur-sm text-3xl animate-fade animate-duration-200",children:(0,a.jsx)(s.Z,{})}):null}},43446:function(e,l,t){var a=t(1375),s=t(2453),n=t(67294),r=t(58989),o=t(83454);l.Z=e=>{let{queryAgentURL:l="/api/v1/chat/completions"}=e,t=(0,n.useMemo)(()=>new AbortController,[]),i=(0,n.useCallback)(async e=>{let{data:n,chatId:i,onMessage:c,onClose:d,onDone:u,onError:m}=e;if(!(null==n?void 0:n.user_input)&&!(null==n?void 0:n.doc_id)){s.ZP.warning(r.Z.t("NoContextTip"));return}let x={...n,conv_uid:i};if(!x.conv_uid){s.ZP.error("conv_uid 不存在,请刷新后重试");return}try{var h;await (0,a.L)("".concat(null!==(h=o.env.API_BASE_URL)&&void 0!==h?h:"").concat(l),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(x),signal:t.signal,openWhenHidden:!0,async onopen(e){if(e.ok&&e.headers.get("content-type")===a.a)return},onclose(){t.abort(),null==d||d()},onerror(e){throw Error(e)},onmessage:e=>{var l;let t=null===(l=e.data)||void 0===l?void 0:l.replaceAll("\\n","\n");"[DONE]"===t?null==u||u():(null==t?void 0:t.startsWith("[ERROR]"))?null==m||m(null==t?void 0:t.replace("[ERROR]","")):null==c||c(t)}})}catch(e){t.abort(),null==m||m("Sorry, We meet some error, please try agin later.",e)}},[l]);return(0,n.useEffect)(()=>()=>{t.abort()},[]),i}},80573:function(e,l,t){var a=t(41468),s=t(67294),n=t(43446),r=t(50489);l.Z=()=>{let{history:e,setHistory:l,chatId:t,model:o,docId:i}=(0,s.useContext)(a.p),c=(0,n.Z)({queryAgentURL:"/knowledge/document/summary"}),d=(0,s.useCallback)(async e=>{let[,a]=await (0,r.Vx)((0,r.$i)(t)),s=[...a,{role:"human",context:"",model_name:o,order:0,time_stamp:0},{role:"view",context:"",model_name:o,order:0,time_stamp:0,retry:!0}],n=s.length-1;l([...s]),await c({data:{doc_id:e||i,model_name:o},chatId:t,onMessage:e=>{s[n].context=e,l([...s])}})},[e,o,i,t]);return d}}}]);
\ No newline at end of file
diff --git a/pilot/server/static/_next/static/chunks/0.a6282ef0fa8a7551.js b/pilot/server/static/_next/static/chunks/0.a6282ef0fa8a7551.js
new file mode 100644
index 000000000..009867e10
--- /dev/null
+++ b/pilot/server/static/_next/static/chunks/0.a6282ef0fa8a7551.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[0],{15506:function(e,l,t){t.r(l),t.d(l,{default:function(){return ew}});var a=t(85893),s=t(67294),n=t(2093),r=t(43446),o=t(39332),i=t(99513),c=t(24019),d=t(50888),u=t(97937),m=t(63606),x=t(50228),h=t(87547),p=t(89035),v=t(33035),f=t(12767),g=t(94184),j=t.n(g),b=t(66309),y=t(81799),w=t(41468),_=t(29158),N=t(98165),Z=t(14079),k=t(38426),C=t(61607),S=t(44442),P=t(74627),R=t(36782),E=t(13135),D=t(71577),I=t(2453),M=t(57132),O=t(79166),z=t(93179),L=t(20640),A=t.n(L);function F(e){let{code:l,language:t}=e;return(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(D.ZP,{className:"absolute right-3 top-2 text-gray-300 hover:!text-gray-200 bg-gray-700",type:"text",icon:(0,a.jsx)(M.Z,{}),onClick:()=>{let e=A()(l);I.ZP[e?"success":"error"](e?"Copy success":"Copy failed")}}),(0,a.jsx)(z.Z,{language:t,style:O.Z,children:l})]})}let H=["custom-view","chart-view","references","summary"],q={code(e){var l;let{inline:t,node:s,className:n,children:r,style:o,...i}=e,{context:c,matchValues:d}=function(e){let l=H.reduce((l,t)=>{let a=RegExp("<".concat(t,"[^>]*/?>"),"gi");return e=e.replace(a,e=>(l.push(e),"")),l},[]);return{context:e,matchValues:l}}(Array.isArray(r)?r.join("\n"):r),u=/language-(\w+)/.exec(n||"");return(0,a.jsxs)(a.Fragment,{children:[!t&&u?(0,a.jsx)(F,{code:c,language:null!==(l=null==u?void 0:u[1])&&void 0!==l?l:"javascript"}):(0,a.jsx)("code",{...i,style:o,className:"px-[6px] py-[2px] rounded bg-gray-700 text-gray-100 dark:bg-gray-100 dark:text-gray-800 text-sm",children:r}),(0,a.jsx)(v.D,{components:q,rehypePlugins:[f.Z],children:d.join("\n")})]})},ul(e){let{children:l}=e;return(0,a.jsx)("ul",{className:"py-1",children:l})},ol(e){let{children:l}=e;return(0,a.jsx)("ol",{className:"py-1",children:l})},li(e){let{children:l,ordered:t}=e;return(0,a.jsx)("li",{className:"text-sm leading-7 ml-5 pl-2 text-gray-600 dark:text-gray-300 ".concat(t?"list-decimal":"list-disc"),children:l})},table(e){let{children:l}=e;return(0,a.jsx)("table",{className:"my-2 rounded-tl-md rounded-tr-md max-w-full bg-white dark:bg-gray-900 text-sm rounded-lg overflow-hidden",children:l})},thead(e){let{children:l}=e;return(0,a.jsx)("thead",{className:"bg-[#fafafa] dark:bg-black font-semibold",children:l})},th(e){let{children:l}=e;return(0,a.jsx)("th",{className:"!text-left p-4",children:l})},td(e){let{children:l}=e;return(0,a.jsx)("td",{className:"p-4 border-t border-[#f0f0f0] dark:border-gray-700",children:l})},h1(e){let{children:l}=e;return(0,a.jsx)("h3",{className:"text-2xl font-bold my-4 border-b border-slate-300 pb-4",children:l})},h2(e){let{children:l}=e;return(0,a.jsx)("h3",{className:"text-xl font-bold my-3",children:l})},h3(e){let{children:l}=e;return(0,a.jsx)("h3",{className:"text-lg font-semibold my-2",children:l})},h4(e){let{children:l}=e;return(0,a.jsx)("h3",{className:"text-base font-semibold my-1",children:l})},a(e){let{children:l,href:t}=e;return(0,a.jsxs)("div",{className:"inline-block text-blue-600 dark:text-blue-400",children:[(0,a.jsx)(_.Z,{className:"mr-1"}),(0,a.jsx)("a",{href:t,target:"_blank",children:l})]})},img(e){let{src:l,alt:t}=e;return(0,a.jsx)("div",{children:(0,a.jsx)(k.Z,{className:"min-h-[1rem] max-w-full max-h-full border rounded",src:l,alt:t,placeholder:(0,a.jsx)(b.Z,{icon:(0,a.jsx)(N.Z,{spin:!0}),color:"processing",children:"Image Loading..."}),fallback:"/images/fallback.png"})})},blockquote(e){let{children:l}=e;return(0,a.jsx)("blockquote",{className:"py-4 px-6 border-l-4 border-blue-600 rounded bg-white my-2 text-gray-500 dark:bg-slate-800 dark:text-gray-200 dark:border-white shadow-sm",children:l})},"chart-view":function(e){var l,t,s;let n,{content:r,children:o}=e;try{n=JSON.parse(r)}catch(e){console.log(e,r),n={type:"response_table",sql:"",data:[]}}let i=(null==n?void 0:null===(l=n.data)||void 0===l?void 0:l[0])?null===(t=Object.keys(null==n?void 0:null===(s=n.data)||void 0===s?void 0:s[0]))||void 0===t?void 0:t.map(e=>({title:e,dataIndex:e,key:e})):[],c={key:"chart",label:"Chart",children:(0,a.jsx)(E._z,{data:null==n?void 0:n.data,chartType:(0,E.aG)(null==n?void 0:n.type)})},d={key:"sql",label:"SQL",children:(0,a.jsx)(F,{code:(0,R.WU)(null==n?void 0:n.sql,{language:"mysql"}),language:"sql"})},u={key:"data",label:"Data",children:(0,a.jsx)(C.Z,{dataSource:null==n?void 0:n.data,columns:i})},m=(null==n?void 0:n.type)==="response_table"?[u,d]:[c,d,u];return(0,a.jsxs)("div",{children:[(0,a.jsx)(S.Z,{defaultActiveKey:(null==n?void 0:n.type)==="response_table"?"data":"chart",items:m,size:"small"}),o]})},references:function(e){let l,{title:t,references:s,children:n}=e;if(n)try{t=(l=JSON.parse(n)).title,s=l.references}catch(e){return console.log("parse references failed",e),(0,a.jsx)("p",{className:"text-sm text-red-500",children:"Render Reference Error!"})}else try{s=JSON.parse(s)}catch(e){return console.log("parse references failed",e),(0,a.jsx)("p",{className:"text-sm text-red-500",children:"Render Reference Error!"})}return!s||(null==s?void 0:s.length)<1?null:(0,a.jsxs)("div",{className:"border-t-[1px] border-gray-300 mt-3 py-2",children:[(0,a.jsxs)("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-2",children:[(0,a.jsx)(_.Z,{className:"mr-2"}),(0,a.jsx)("span",{className:"font-semibold",children:t})]}),s.map((e,l)=>{var t;return(0,a.jsxs)("div",{className:"text-sm font-normal block ml-2 h-6 leading-6 overflow-hidden",children:[(0,a.jsxs)("span",{className:"inline-block w-6",children:["[",l+1,"]"]}),(0,a.jsx)("span",{className:"mr-2 lg:mr-4 text-blue-400",children:e.name}),null==e?void 0:null===(t=e.chunks)||void 0===t?void 0:t.map((l,t)=>(0,a.jsxs)("span",{children:["object"==typeof l?(0,a.jsx)(P.Z,{content:(0,a.jsxs)("div",{className:"max-w-4xl",children:[(0,a.jsx)("p",{className:"mt-2 font-bold mr-2 border-t border-gray-500 pt-2",children:"Content:"}),(0,a.jsx)("p",{children:(null==l?void 0:l.content)||"No Content"}),(0,a.jsx)("p",{className:"mt-2 font-bold mr-2 border-t border-gray-500 pt-2",children:"MetaData:"}),(0,a.jsx)("p",{children:(null==l?void 0:l.meta_info)||"No MetaData"}),(0,a.jsx)("p",{className:"mt-2 font-bold mr-2 border-t border-gray-500 pt-2",children:"Score:"}),(0,a.jsx)("p",{children:(null==l?void 0:l.recall_score)||""})]}),title:"Chunk Information",children:(0,a.jsx)("span",{className:"cursor-pointer text-blue-500 ml-2",children:null==l?void 0:l.id},"chunk_content_".concat(null==l?void 0:l.id))}):(0,a.jsx)("span",{className:"cursor-pointer text-blue-500 ml-2",children:l},"chunk_id_".concat(l)),t<(null==e?void 0:e.chunks.length)-1&&(0,a.jsx)("span",{children:","},"chunk_comma_".concat(t))]},"chunk_".concat(t)))]},"file_".concat(l))})]})},summary:function(e){let{children:l}=e;return(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"mb-2",children:[(0,a.jsx)(Z.Z,{className:"mr-2"}),(0,a.jsx)("span",{className:"font-semibold",children:"Document Summary"})]}),(0,a.jsx)("div",{children:l})]})}},V={todo:{bgClass:"bg-gray-500",icon:(0,a.jsx)(c.Z,{className:"ml-2"})},runing:{bgClass:"bg-blue-500",icon:(0,a.jsx)(d.Z,{className:"ml-2"})},failed:{bgClass:"bg-red-500",icon:(0,a.jsx)(u.Z,{className:"ml-2"})},completed:{bgClass:"bg-green-500",icon:(0,a.jsx)(m.Z,{className:"ml-2"})}};function T(e){return e.replaceAll("\\n","\n").replace(/]+)>/gi,"").replace(/]+)>/gi," ")}var G=(0,s.memo)(function(e){let{children:l,content:t,isChartChat:n,onLinkClick:r}=e,{scene:o}=(0,s.useContext)(w.p),{context:i,model_name:c,role:d}=t,u="view"===d,{relations:m,value:g,cachePluginContext:_}=(0,s.useMemo)(()=>{if("string"!=typeof i)return{relations:[],value:"",cachePluginContext:[]};let[e,l]=i.split(" relations:"),t=l?l.split(","):[],a=[],s=0,n=e.replace(/]*>[^<]*<\/dbgpt-view>/gi,e=>{try{var l;let t=e.replaceAll("\n","\\n").replace(/<[^>]*>|<\/[^>]*>/gm,""),n=JSON.parse(t),r="".concat(s," ");return a.push({...n,result:T(null!==(l=n.result)&&void 0!==l?l:"")}),s++,r}catch(l){return console.log(l.message,l),e}});return{relations:t,cachePluginContext:a,value:n}},[i]),N=(0,s.useMemo)(()=>({"custom-view"(e){var l;let{children:t}=e,s=+t.toString();if(!_[s])return t;let{name:n,status:r,err_msg:o,result:i}=_[s],{bgClass:c,icon:d}=null!==(l=V[r])&&void 0!==l?l:{};return(0,a.jsxs)("div",{className:"bg-white dark:bg-[#212121] rounded-lg overflow-hidden my-2 flex flex-col lg:max-w-[80%]",children:[(0,a.jsxs)("div",{className:j()("flex px-4 md:px-6 py-2 items-center text-white text-sm",c),children:[n,d]}),i?(0,a.jsx)("div",{className:"px-4 md:px-6 py-4 text-sm",children:(0,a.jsx)(v.D,{components:q,rehypePlugins:[f.Z],children:null!=i?i:""})}):(0,a.jsx)("div",{className:"px-4 md:px-6 py-4 text-sm",children:o})]})}}),[i,_]);return u||i?(0,a.jsxs)("div",{className:j()("relative flex flex-wrap w-full px-2 sm:px-4 py-2 sm:py-4 rounded-xl break-words",{"bg-slate-100 dark:bg-[#353539]":u,"lg:w-full xl:w-full pl-0":["chat_with_db_execute","chat_dashboard"].includes(o)}),children:[(0,a.jsx)("div",{className:"mr-2 flex flex-shrink-0 items-center justify-center h-7 w-7 rounded-full text-lg sm:mr-4",children:u?(0,y.A)(c)||(0,a.jsx)(x.Z,{}):(0,a.jsx)(h.Z,{})}),(0,a.jsxs)("div",{className:"flex-1 overflow-hidden items-center text-md leading-8",children:[!u&&"string"==typeof i&&i,u&&n&&"object"==typeof i&&(0,a.jsxs)("div",{children:["[".concat(i.template_name,"]: "),(0,a.jsxs)("span",{className:"text-[#1677ff] cursor-pointer",onClick:r,children:[(0,a.jsx)(p.Z,{className:"mr-1"}),i.template_introduce||"More Details"]})]}),u&&"string"==typeof i&&(0,a.jsx)(v.D,{components:{...q,...N},rehypePlugins:[f.Z],children:T(g)}),!!(null==m?void 0:m.length)&&(0,a.jsx)("div",{className:"flex flex-wrap mt-2",children:null==m?void 0:m.map((e,l)=>(0,a.jsx)(b.Z,{color:"#108ee9",children:e},e+l))})]}),l]}):(0,a.jsx)("div",{className:"h-12"})}),J=t(59301),U=t(41132),W=t(74312),$=t(3414),B=t(72868),Q=t(59562),K=t(14553),X=t(25359),Y=t(7203),ee=t(48665),el=t(26047),et=t(99056),ea=t(57814),es=t(63955),en=t(33028),er=t(40911),eo=t(66478),ei=t(83062),ec=t(50489),ed=t(67421),eu=e=>{var l;let{conv_index:t,question:n,knowledge_space:r,select_param:o}=e,{t:i}=(0,ed.$G)(),{chatId:c}=(0,s.useContext)(w.p),[d,u]=(0,s.useState)(""),[m,x]=(0,s.useState)(4),[h,p]=(0,s.useState)(""),v=(0,s.useRef)(null),[f,g]=I.ZP.useMessage(),j=(0,s.useCallback)((e,l)=>{l?(0,ec.Vx)((0,ec.Eb)(c,t)).then(e=>{var l,t,a,s;let n=null!==(l=e[1])&&void 0!==l?l:{};u(null!==(t=n.ques_type)&&void 0!==t?t:""),x(parseInt(null!==(a=n.score)&&void 0!==a?a:"4")),p(null!==(s=n.messages)&&void 0!==s?s:"")}).catch(e=>{console.log(e)}):(u(""),x(4),p(""))},[c,t]),b=(0,W.Z)($.Z)(e=>{let{theme:l}=e;return{backgroundColor:"dark"===l.palette.mode?"#FBFCFD":"#0E0E10",...l.typography["body-sm"],padding:l.spacing(1),display:"flex",alignItems:"center",justifyContent:"center",borderRadius:4,width:"100%",height:"100%"}});return(0,a.jsxs)(B.L,{onOpenChange:j,children:[g,(0,a.jsx)(ei.Z,{title:i("Rating"),children:(0,a.jsx)(Q.Z,{slots:{root:K.ZP},slotProps:{root:{variant:"plain",color:"primary"}},sx:{borderRadius:40},children:(0,a.jsx)(J.Z,{})})}),(0,a.jsxs)(X.Z,{children:[(0,a.jsx)(Y.Z,{disabled:!0,sx:{minHeight:0}}),(0,a.jsx)(ee.Z,{sx:{width:"100%",maxWidth:350,display:"grid",gap:3,padding:1},children:(0,a.jsx)("form",{onSubmit:e=>{e.preventDefault();let l={conv_uid:c,conv_index:t,question:n,knowledge_space:r,score:m,ques_type:d,messages:h};console.log(l),(0,ec.Vx)((0,ec.VC)({data:l})).then(e=>{f.open({type:"success",content:"save success"})}).catch(e=>{f.open({type:"error",content:"save error"})})},children:(0,a.jsxs)(el.Z,{container:!0,spacing:.5,columns:13,sx:{flexGrow:1},children:[(0,a.jsx)(el.Z,{xs:3,children:(0,a.jsx)(b,{children:i("Q_A_Category")})}),(0,a.jsx)(el.Z,{xs:10,children:(0,a.jsx)(et.Z,{action:v,value:d,placeholder:"Choose one…",onChange:(e,l)=>u(null!=l?l:""),...d&&{endDecorator:(0,a.jsx)(K.ZP,{size:"sm",variant:"plain",color:"neutral",onMouseDown:e=>{e.stopPropagation()},onClick:()=>{var e;u(""),null===(e=v.current)||void 0===e||e.focusVisible()},children:(0,a.jsx)(U.Z,{})}),indicator:null},sx:{width:"100%"},children:o&&(null===(l=Object.keys(o))||void 0===l?void 0:l.map(e=>(0,a.jsx)(ea.Z,{value:e,children:o[e]},e)))})}),(0,a.jsx)(el.Z,{xs:3,children:(0,a.jsx)(b,{children:(0,a.jsx)(ei.Z,{title:(0,a.jsx)(ee.Z,{children:(0,a.jsx)("div",{children:i("feed_back_desc")})}),variant:"solid",placement:"left",children:i("Q_A_Rating")})})}),(0,a.jsx)(el.Z,{xs:10,sx:{pl:0,ml:0},children:(0,a.jsx)(es.Z,{"aria-label":"Custom",step:1,min:0,max:5,valueLabelFormat:function(e){return({0:i("Lowest"),1:i("Missed"),2:i("Lost"),3:i("Incorrect"),4:i("Verbose"),5:i("Best")})[e]},valueLabelDisplay:"on",marks:[{value:0,label:"0"},{value:1,label:"1"},{value:2,label:"2"},{value:3,label:"3"},{value:4,label:"4"},{value:5,label:"5"}],sx:{width:"90%",pt:3,m:2,ml:1},onChange:e=>{var l;return x(null===(l=e.target)||void 0===l?void 0:l.value)},value:m})}),(0,a.jsx)(el.Z,{xs:13,children:(0,a.jsx)(en.Z,{placeholder:i("Please_input_the_text"),value:h,onChange:e=>p(e.target.value),minRows:2,maxRows:4,endDecorator:(0,a.jsx)(er.ZP,{level:"body-xs",sx:{ml:"auto"},children:i("input_count")+h.length+i("input_unit")}),sx:{width:"100%",fontSize:14}})}),(0,a.jsx)(el.Z,{xs:13,children:(0,a.jsx)(eo.Z,{type:"submit",variant:"outlined",sx:{width:"100%",height:"100%"},children:i("submit")})})]})})})]})]})},em=t(32983),ex=t(12069),eh=t(96486),ep=t(20766),ev=t(98399),ef=t(87740),eg=t(80573),ej=e=>{var l;let{messages:t,onSubmit:r}=e,{dbParam:c,currentDialogue:d,scene:u,model:m,refreshDialogList:x,chatId:h,agentList:p,docId:v}=(0,s.useContext)(w.p),{t:f}=(0,ed.$G)(),g=(0,o.useSearchParams)(),b=null!==(l=g&&g.get("spaceNameOriginal"))&&void 0!==l?l:"",[_,N]=(0,s.useState)(!1),[Z,k]=(0,s.useState)(!1),[C,S]=(0,s.useState)(t),[P,R]=(0,s.useState)(""),[E,D]=(0,s.useState)(),O=(0,s.useRef)(null),z=(0,s.useMemo)(()=>"chat_dashboard"===u,[u]),L=(0,eg.Z)(),F=(0,s.useMemo)(()=>{switch(u){case"chat_agent":return p.join(",");case"chat_excel":return null==d?void 0:d.select_param;default:return b||c}},[u,p,d,c,b]),H=async e=>{if(!_&&e.trim())try{N(!0),await r(e,{select_param:null!=F?F:""})}finally{N(!1)}},q=e=>{try{return JSON.parse(e)}catch(l){return e}},[V,T]=I.ZP.useMessage(),J=async e=>{let l=null==e?void 0:e.replace(/\trelations:.*/g,""),t=A()(l);t?l?V.open({type:"success",content:f("Copy_success")}):V.open({type:"warning",content:f("Copy_nothing")}):V.open({type:"error",content:f("Copry_error")})},U=async()=>{!_&&v&&(N(!0),await L(v),N(!1))};return(0,n.Z)(async()=>{let e=(0,ev.a_)();e&&e.id===h&&(await H(e.message),x(),localStorage.removeItem(ev.rU))},[h]),(0,s.useEffect)(()=>{let e=t;z&&(e=(0,eh.cloneDeep)(t).map(e=>((null==e?void 0:e.role)==="view"&&"string"==typeof(null==e?void 0:e.context)&&(e.context=q(null==e?void 0:e.context)),e))),S(e.filter(e=>["view","human"].includes(e.role)))},[z,t]),(0,s.useEffect)(()=>{(0,ec.Vx)((0,ec.Lu)()).then(e=>{var l;D(null!==(l=e[1])&&void 0!==l?l:{})}).catch(e=>{console.log(e)})},[]),(0,s.useEffect)(()=>{setTimeout(()=>{var e;null===(e=O.current)||void 0===e||e.scrollTo(0,O.current.scrollHeight)},50)},[t]),(0,a.jsxs)(a.Fragment,{children:[T,(0,a.jsx)("div",{ref:O,className:"flex flex-1 overflow-y-auto pb-8 w-full flex-col",children:(0,a.jsx)("div",{className:"flex items-center flex-1 flex-col text-sm leading-6 text-slate-900 dark:text-slate-300 sm:text-base sm:leading-7",children:C.length?C.map((e,l)=>{var t;return(0,a.jsx)(G,{content:e,isChartChat:z,onLinkClick:()=>{k(!0),R(JSON.stringify(null==e?void 0:e.context,null,2))},children:"view"===e.role&&(0,a.jsxs)("div",{className:"flex w-full pt-2 md:pt-4 border-t border-gray-200 mt-2 md:mt-4 pl-2",children:["chat_knowledge"===u&&e.retry?(0,a.jsxs)(eo.Z,{onClick:U,slots:{root:K.ZP},slotProps:{root:{variant:"plain",color:"primary"}},children:[(0,a.jsx)(ef.Z,{}),"\xa0",(0,a.jsx)("span",{className:"text-sm",children:f("Retry")})]}):null,(0,a.jsxs)("div",{className:"flex w-full flex-row-reverse",children:[(0,a.jsx)(eu,{select_param:E,conv_index:Math.ceil((l+1)/2),question:null===(t=null==C?void 0:C.filter(l=>(null==l?void 0:l.role)==="human"&&(null==l?void 0:l.order)===e.order)[0])||void 0===t?void 0:t.context,knowledge_space:b||c||""}),(0,a.jsx)(ei.Z,{title:f("Copy"),children:(0,a.jsx)(eo.Z,{onClick:()=>J(null==e?void 0:e.context),slots:{root:K.ZP},slotProps:{root:{variant:"plain",color:"primary"}},sx:{borderRadius:40},children:(0,a.jsx)(M.Z,{})})})]})]})},l)}):(0,a.jsx)(em.Z,{image:"/empty.png",imageStyle:{width:320,height:320,margin:"0 auto",maxWidth:"100%",maxHeight:"100%"},className:"flex items-center justify-center flex-col h-full w-full",description:"Start a conversation"})})}),(0,a.jsx)("div",{className:j()("relative after:absolute after:-top-8 after:h-8 after:w-full after:bg-gradient-to-t after:from-white after:to-transparent dark:after:from-[#212121]",{"cursor-not-allowed":"chat_excel"===u&&!(null==d?void 0:d.select_param)}),children:(0,a.jsxs)("div",{className:"flex flex-wrap w-full py-2 sm:pt-6 sm:pb-10 items-center",children:[m&&(0,a.jsx)("div",{className:"mr-2 flex",children:(0,y.A)(m)}),(0,a.jsx)(ep.Z,{loading:_,onSubmit:H,handleFinish:N})]})}),(0,a.jsx)(ex.default,{title:"JSON Editor",open:Z,width:"60%",cancelButtonProps:{hidden:!0},onOk:()=>{k(!1)},onCancel:()=>{k(!1)},children:(0,a.jsx)(i.Z,{className:"w-full h-[500px]",language:"json",value:P})})]})},eb=t(34625),ey=t(45247),ew=()=>{var e;let l=(0,o.useSearchParams)(),{scene:t,chatId:i,model:c,setModel:d,history:u,setHistory:m}=(0,s.useContext)(w.p),x=(0,r.Z)({}),h=null!==(e=l&&l.get("initMessage"))&&void 0!==e?e:"",[p,v]=(0,s.useState)(!1),[f,g]=(0,s.useState)(),b=async()=>{v(!0);let[,e]=await (0,ec.Vx)((0,ec.$i)(i));m(null!=e?e:[]),v(!1)},y=e=>{var l;let t=null===(l=e[e.length-1])||void 0===l?void 0:l.context;if(t)try{let e=JSON.parse(t);g((null==e?void 0:e.template_name)==="report"?null==e?void 0:e.charts:void 0)}catch(e){g(void 0)}};(0,n.Z)(async()=>{let e=(0,ev.a_)();e&&e.id===i||await b()},[h,i]),(0,s.useEffect)(()=>{var e,l;if(!u.length)return;let t=null===(e=null===(l=u.filter(e=>"view"===e.role))||void 0===l?void 0:l.slice(-1))||void 0===e?void 0:e[0];(null==t?void 0:t.model_name)&&d(t.model_name),y(u)},[u.length]),(0,s.useEffect)(()=>()=>{m([])},[]);let _=(0,s.useCallback)((e,l)=>new Promise(a=>{let s=[...u,{role:"human",context:e,model_name:c,order:0,time_stamp:0},{role:"view",context:"",model_name:c,order:0,time_stamp:0}],n=s.length-1;m([...s]),x({data:{...l,chat_mode:t||"chat_normal",model_name:c,user_input:e},chatId:i,onMessage:e=>{s[n].context=e,m([...s])},onDone:()=>{y(s),a()},onClose:()=>{y(s),a()},onError:e=>{s[n].context=e,m([...s]),a()}})}),[u,x,c]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ey.Z,{visible:p}),(0,a.jsx)(eb.Z,{refreshHistory:b,modelChange:e=>{d(e)}}),(0,a.jsxs)("div",{className:"px-4 flex flex-1 flex-wrap overflow-hidden relative",children:[!!(null==f?void 0:f.length)&&(0,a.jsx)("div",{className:"w-full xl:w-3/4 h-3/5 xl:pr-4 xl:h-full overflow-y-auto",children:(0,a.jsx)(E.ZP,{chartsData:f})}),!(null==f?void 0:f.length)&&"chat_dashboard"===t&&(0,a.jsx)(em.Z,{image:"/empty.png",imageStyle:{width:320,height:320,margin:"0 auto",maxWidth:"100%",maxHeight:"100%"},className:"w-full xl:w-3/4 h-3/5 xl:h-full pt-0 md:pt-10"}),(0,a.jsx)("div",{className:j()("flex flex-1 flex-col overflow-hidden",{"px-0 xl:pl-4 h-2/5 xl:h-full border-t xl:border-t-0 xl:border-l":"chat_dashboard"===t,"h-full lg:px-8":"chat_dashboard"!==t}),children:(0,a.jsx)(ej,{messages:u,onSubmit:_})})]})]})}},20766:function(e,l,t){t.d(l,{Z:function(){return D}});var a=t(85893),s=t(27496),n=t(59566),r=t(71577),o=t(67294),i=t(2487),c=t(83062),d=t(2453),u=t(46735),m=t(74627),x=t(39479),h=t(51009),p=t(58299),v=t(577),f=t(30119),g=t(67421);let j=e=>{let{data:l,loading:t,submit:s,close:n}=e,{t:r}=(0,g.$G)(),o=e=>()=>{s(e),n()};return(0,a.jsx)("div",{style:{maxHeight:400,overflow:"auto"},children:(0,a.jsx)(i.Z,{dataSource:null==l?void 0:l.data,loading:t,rowKey:e=>e.prompt_name,renderItem:e=>(0,a.jsx)(i.Z.Item,{onClick:o(e.content),children:(0,a.jsx)(c.Z,{title:e.content,children:(0,a.jsx)(i.Z.Item.Meta,{style:{cursor:"copy"},title:e.prompt_name,description:r("Prompt_Info_Scene")+":".concat(e.chat_scene,",")+r("Prompt_Info_Sub_Scene")+":".concat(e.sub_chat_scene)})})},e.prompt_name)})})};var b=e=>{let{submit:l}=e,{t}=(0,g.$G)(),[s,n]=(0,o.useState)(!1),[r,i]=(0,o.useState)("common"),{data:b,loading:y}=(0,v.Z)(()=>(0,f.PR)("/prompt/list",{prompt_type:r}),{refreshDeps:[r],onError:e=>{d.ZP.error(null==e?void 0:e.message)}});return(0,a.jsx)(u.ZP,{theme:{components:{Popover:{minWidth:250}}},children:(0,a.jsx)(m.Z,{title:(0,a.jsx)(x.Z.Item,{label:"Prompt "+t("Type"),children:(0,a.jsx)(h.default,{style:{width:150},value:r,onChange:e=>{i(e)},options:[{label:t("Public")+" Prompts",value:"common"},{label:t("Private")+" Prompts",value:"private"}]})}),content:(0,a.jsx)(j,{data:b,loading:y,submit:l,close:()=>{n(!1)}}),placement:"topRight",trigger:"click",open:s,onOpenChange:e=>{n(e)},children:(0,a.jsx)(c.Z,{title:t("Click_Select")+" Prompt",children:(0,a.jsx)(p.Z,{className:"bottom-[30%]"})})})})},y=t(41468),w=t(50489),_=t(80573),N=t(5392),Z=t(84553);function k(e){let{dbParam:l,setDocId:t}=(0,o.useContext)(y.p),{onUploadFinish:s,handleFinish:n}=e,i=(0,_.Z)(),[c,d]=(0,o.useState)(!1),u=async(e,l)=>{await (0,w.Vx)((0,w.Hx)(e,{doc_ids:[l]}))},m=async e=>{d(!0);let a=new FormData;a.append("doc_name",e.file.name),a.append("doc_file",e.file),a.append("doc_type","DOCUMENT");let r=await (0,w.Vx)((0,w.iG)(l||"default",a));if(!r[1]){d(!1);return}t(r[1]),s(),await u(l||"default",null==r?void 0:r[1]),d(!1),null==n||n(!0),await i(r[1]),null==n||n(!1)};return(0,a.jsx)(Z.default,{customRequest:m,showUploadList:!1,maxCount:1,multiple:!1,className:"absolute z-10 top-2 left-2",accept:".pdf,.ppt,.pptx,.xls,.xlsx,.doc,.docx,.txt,.md",children:(0,a.jsx)(r.ZP,{loading:c,size:"small",shape:"circle",icon:(0,a.jsx)(N.Z,{})})})}var C=t(11163),S=t(82579);function P(){return(0,a.jsx)("svg",{className:"mr-1",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"6058",width:"1.5em",height:"1.5em",children:(0,a.jsx)("path",{d:"M688 312c0 4.4-3.6 8-8 8H296c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8h384c4.4 0 8 3.6 8 8v48z m-392 88h184c4.4 0 8 3.6 8 8v48c0 4.4-3.6 8-8 8H296c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8z m376 116c119.3 0 216 96.7 216 216s-96.7 216-216 216-216-96.7-216-216 96.7-216 216-216z m107.5 323.5C808.2 810.8 824 772.6 824 732s-15.8-78.8-44.5-107.5S712.6 580 672 580s-78.8 15.8-107.5 44.5S520 691.4 520 732s15.8 78.8 44.5 107.5S631.4 884 672 884s78.8-15.8 107.5-44.5zM440 852c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H168c-17.7 0-32-14.3-32-32V108c0-17.7 14.3-32 32-32h640c17.7 0 32 14.3 32 32v384c0 4.4-3.6 8-8 8h-56c-4.4 0-8-3.6-8-8V148H208v704h232z m232-76.06l-20.56 28.43c-1.5 2.1-3.9 3.3-6.5 3.3h-44.3c-6.5 0-10.3-7.4-6.4-12.7l45.75-63.3-45.75-63.3c-3.9-5.3-0.1-12.7 6.4-12.7h44.3c2.6 0 5 1.2 6.5 3.3L672 687.4l20.56-28.43c1.5-2.1 3.9-3.3 6.5-3.3h44.3c6.5 0 10.3 7.4 6.4 12.7l-45.75 63.3 45.75 63.3c3.9 5.3 0.1 12.7-6.4 12.7h-44.3c-2.6 0-5-1.2-6.5-3.3L672 775.94z",fill:"#d81e06","p-id":"6059"})})}function R(e){let{document:l}=e;switch(l.status){case"RUNNING":return(0,a.jsx)(S.Rp,{});case"FINISHED":default:return(0,a.jsx)(S.s2,{});case"FAILED":return(0,a.jsx)(P,{})}}function E(e){let{documents:l,dbParam:t}=e,s=(0,C.useRouter)(),n=e=>{s.push("/knowledge/chunk/?spaceName=".concat(t,"&id=").concat(e))};return(null==l?void 0:l.length)?(0,a.jsx)("div",{className:"absolute flex overflow-scroll h-12 top-[-35px] w-full z-10",children:l.map(e=>{let l;switch(e.status){case"RUNNING":l="#2db7f5";break;case"FINISHED":default:l="#87d068";break;case"FAILED":l="#f50"}return(0,a.jsx)(c.Z,{title:e.result,children:(0,a.jsxs)(r.ZP,{style:{color:l},onClick:()=>{n(e.id)},className:"shrink flex items-center mr-3",children:[(0,a.jsx)(R,{document:e}),e.doc_name]})},e.id)})}):null}var D=function(e){let{children:l,loading:t,onSubmit:i,handleFinish:c,...d}=e,{dbParam:u,scene:m}=(0,o.useContext)(y.p),[x,h]=(0,o.useState)(""),p=(0,o.useMemo)(()=>"chat_knowledge"===m,[m]),[v,f]=(0,o.useState)([]),g=(0,o.useRef)(0);async function j(){if(!u)return null;let[e,l]=await (0,w.Vx)((0,w._Q)(u,{page:1,page_size:g.current}));f(null==l?void 0:l.data)}return(0,o.useEffect)(()=>{p&&j()},[u]),(0,a.jsxs)("div",{className:"flex-1 relative",children:[(0,a.jsx)(E,{documents:v,dbParam:u}),p&&(0,a.jsx)(k,{handleFinish:c,onUploadFinish:()=>{g.current+=1,j()},className:"absolute z-10 top-2 left-2"}),(0,a.jsx)(n.default.TextArea,{className:"flex-1 ".concat(p?"pl-10":""," pr-10"),size:"large",value:x,autoSize:{minRows:1,maxRows:4},...d,onPressEnter:e=>{if(x.trim()&&13===e.keyCode){if(e.shiftKey){h(e=>e+"\n");return}i(x),setTimeout(()=>{h("")},0)}},onChange:e=>{if("number"==typeof d.maxLength){h(e.target.value.substring(0,d.maxLength));return}h(e.target.value)}}),(0,a.jsx)(r.ZP,{className:"ml-2 flex items-center justify-center absolute right-2 bottom-0",size:"large",type:"text",loading:t,icon:(0,a.jsx)(s.Z,{}),onClick:()=>{i(x)}}),(0,a.jsx)(b,{submit:e=>{h(x+e)}}),l]})}},45247:function(e,l,t){var a=t(85893),s=t(50888);l.Z=function(e){let{visible:l}=e;return l?(0,a.jsx)("div",{className:"absolute w-full h-full top-0 left-0 flex justify-center items-center z-10 bg-white dark:bg-black bg-opacity-50 dark:bg-opacity-50 backdrop-blur-sm text-3xl animate-fade animate-duration-200",children:(0,a.jsx)(s.Z,{})}):null}},43446:function(e,l,t){var a=t(1375),s=t(2453),n=t(67294),r=t(58989),o=t(83454);l.Z=e=>{let{queryAgentURL:l="/api/v1/chat/completions"}=e,t=(0,n.useMemo)(()=>new AbortController,[]),i=(0,n.useCallback)(async e=>{let{data:n,chatId:i,onMessage:c,onClose:d,onDone:u,onError:m}=e;if(!(null==n?void 0:n.user_input)&&!(null==n?void 0:n.doc_id)){s.ZP.warning(r.Z.t("NoContextTip"));return}let x={...n,conv_uid:i};if(!x.conv_uid){s.ZP.error("conv_uid 不存在,请刷新后重试");return}try{var h;await (0,a.L)("".concat(null!==(h=o.env.API_BASE_URL)&&void 0!==h?h:"").concat(l),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(x),signal:t.signal,openWhenHidden:!0,async onopen(e){if(e.ok&&e.headers.get("content-type")===a.a)return},onclose(){t.abort(),null==d||d()},onerror(e){throw Error(e)},onmessage:e=>{var l;let t=null===(l=e.data)||void 0===l?void 0:l.replaceAll("\\n","\n");"[DONE]"===t?null==u||u():(null==t?void 0:t.startsWith("[ERROR]"))?null==m||m(null==t?void 0:t.replace("[ERROR]","")):null==c||c(t)}})}catch(e){t.abort(),null==m||m("Sorry, We meet some error, please try agin later.",e)}},[l]);return(0,n.useEffect)(()=>()=>{t.abort()},[]),i}},80573:function(e,l,t){var a=t(41468),s=t(67294),n=t(43446),r=t(50489);l.Z=()=>{let{history:e,setHistory:l,chatId:t,model:o,docId:i}=(0,s.useContext)(a.p),c=(0,n.Z)({queryAgentURL:"/knowledge/document/summary"}),d=(0,s.useCallback)(async e=>{let[,a]=await (0,r.Vx)((0,r.$i)(t)),s=[...a,{role:"human",context:"",model_name:o,order:0,time_stamp:0},{role:"view",context:"",model_name:o,order:0,time_stamp:0,retry:!0}],n=s.length-1;l([...s]),await c({data:{doc_id:e||i,model_name:o},chatId:t,onMessage:e=>{s[n].context=e,l([...s])}})},[e,o,i,t]);return d}}}]);
\ No newline at end of file
diff --git a/pilot/server/static/_next/static/chunks/webpack-b5216c63e109d42c.js b/pilot/server/static/_next/static/chunks/webpack-551522135db2374e.js
similarity index 98%
rename from pilot/server/static/_next/static/chunks/webpack-b5216c63e109d42c.js
rename to pilot/server/static/_next/static/chunks/webpack-551522135db2374e.js
index 03fc78871..6d0c675d0 100644
--- a/pilot/server/static/_next/static/chunks/webpack-b5216c63e109d42c.js
+++ b/pilot/server/static/_next/static/chunks/webpack-551522135db2374e.js
@@ -1 +1 @@
-!function(){"use strict";var e,t,n,r,o,u,i,a,c,f,d,s,l={},b={};function p(e){var t=b[e];if(void 0!==t)return t.exports;var n=b[e]={id:e,loaded:!1,exports:{}},r=!0;try{l[e].call(n.exports,n,n.exports,p),r=!1}finally{r&&delete b[e]}return n.loaded=!0,n.exports}p.m=l,p.amdO={},e=[],p.O=function(t,n,r,o){if(n){o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var i=1/0,u=0;u=o&&Object.keys(p.O).every(function(e){return p.O[e](n[c])})?n.splice(c--,1):(a=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var i=1/0,u=0;u=o&&Object.keys(p.O).every(function(e){return p.O[e](n[c])})?n.splice(c--,1):(a=!1,o
\ No newline at end of file
+
\ No newline at end of file
diff --git a/pilot/server/static/chat/[scene]/[id]/index.html b/pilot/server/static/chat/[scene]/[id]/index.html
index 070c55059..5b9f827bf 100644
--- a/pilot/server/static/chat/[scene]/[id]/index.html
+++ b/pilot/server/static/chat/[scene]/[id]/index.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/pilot/server/static/chat/index.html b/pilot/server/static/chat/index.html
index 85a1e738a..78763b50b 100644
--- a/pilot/server/static/chat/index.html
+++ b/pilot/server/static/chat/index.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/pilot/server/static/database/index.html b/pilot/server/static/database/index.html
index d76817db9..5d3bfa3e1 100644
--- a/pilot/server/static/database/index.html
+++ b/pilot/server/static/database/index.html
@@ -1 +1 @@
-
MySQL Fast, reliable, scalable open-source relational database management system.
MSSQL Powerful, scalable, secure relational database system by Microsoft.
DuckDB In-memory analytical database with efficient query processing.
Sqlite Lightweight embedded relational database with simplicity and portability.
ClickHouse Columnar database for high-performance analytics and real-time queries.
Oracle Robust, scalable, secure relational database widely used in enterprises.
Access Easy-to-use relational database for small-scale applications by Microsoft.
MongoDB Flexible, scalable NoSQL document database for web and mobile apps.
DB2 Scalable, secure relational database system developed by IBM.
HBase Distributed, scalable NoSQL database for large structured/semi-structured data.
Redis Fast, versatile in-memory data structure store as cache, DB, or broker.
Cassandra Scalable, fault-tolerant distributed NoSQL database for large data.
Couchbase High-performance NoSQL document database with distributed architecture.
PostgreSQL Powerful open-source relational database with extensibility and SQL standards.
Spark Unified engine for large-scale data analytics.
Space knowledge analytics.
\ No newline at end of file
+
MySQL Fast, reliable, scalable open-source relational database management system.
MSSQL Powerful, scalable, secure relational database system by Microsoft.
DuckDB In-memory analytical database with efficient query processing.
Sqlite Lightweight embedded relational database with simplicity and portability.
ClickHouse Columnar database for high-performance analytics and real-time queries.
Oracle Robust, scalable, secure relational database widely used in enterprises.
Access Easy-to-use relational database for small-scale applications by Microsoft.
MongoDB Flexible, scalable NoSQL document database for web and mobile apps.
DB2 Scalable, secure relational database system developed by IBM.
HBase Distributed, scalable NoSQL database for large structured/semi-structured data.
Redis Fast, versatile in-memory data structure store as cache, DB, or broker.
Cassandra Scalable, fault-tolerant distributed NoSQL database for large data.
Couchbase High-performance NoSQL document database with distributed architecture.
PostgreSQL Powerful open-source relational database with extensibility and SQL standards.
Spark Unified engine for large-scale data analytics.
Space knowledge analytics.
\ No newline at end of file
diff --git a/pilot/server/static/index.html b/pilot/server/static/index.html
index 108d537e9..c7f985e24 100644
--- a/pilot/server/static/index.html
+++ b/pilot/server/static/index.html
@@ -1 +1 @@
-Quick Start
\ No newline at end of file
+Quick Start
\ No newline at end of file
diff --git a/pilot/server/static/knowledge/chunk/index.html b/pilot/server/static/knowledge/chunk/index.html
index 88603f7e5..7c01d201d 100644
--- a/pilot/server/static/knowledge/chunk/index.html
+++ b/pilot/server/static/knowledge/chunk/index.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/pilot/server/static/knowledge/index.html b/pilot/server/static/knowledge/index.html
index 2df54f48a..805d08a6c 100644
--- a/pilot/server/static/knowledge/index.html
+++ b/pilot/server/static/knowledge/index.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/pilot/server/static/models/index.html b/pilot/server/static/models/index.html
index 4cef5f8ac..b6cf8a989 100644
--- a/pilot/server/static/models/index.html
+++ b/pilot/server/static/models/index.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/pilot/server/static/prompt/index.html b/pilot/server/static/prompt/index.html
index 2508e9527..83429b9a0 100644
--- a/pilot/server/static/prompt/index.html
+++ b/pilot/server/static/prompt/index.html
@@ -1 +1 @@
-
Add Prompts Add Prompts template
\ No newline at end of file
+
Add Prompts Add Prompts template
\ No newline at end of file
From 4f43522b79f32a17125d8bab4ec290060715a220 Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Fri, 1 Dec 2023 15:52:01 +0800
Subject: [PATCH 17/26] fix:adjust similar search concurrency
---
pilot/scene/chat_knowledge/v1/chat.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pilot/scene/chat_knowledge/v1/chat.py b/pilot/scene/chat_knowledge/v1/chat.py
index f8ffaf4e3..9fa13c55e 100644
--- a/pilot/scene/chat_knowledge/v1/chat.py
+++ b/pilot/scene/chat_knowledge/v1/chat.py
@@ -127,7 +127,7 @@ async def generate_input_values(self) -> Dict:
# similarity search from vector db
tasks = [self.execute_similar_search(query) for query in queries]
- docs_with_scores = await run_async_tasks(tasks=tasks, concurrency_limit=2)
+ docs_with_scores = await run_async_tasks(tasks=tasks, concurrency_limit=1)
candidates_with_scores = reduce(lambda x, y: x + y, docs_with_scores)
# candidates document rerank
from pilot.rag.retriever.rerank import DefaultRanker
From 1bab17e4d2837801c484b2519f75c4212cf8ea41 Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Fri, 1 Dec 2023 16:24:26 +0800
Subject: [PATCH 18/26] doc:update faq
---
docs/docs/faq/kbqa.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/docs/faq/kbqa.md b/docs/docs/faq/kbqa.md
index ef7210b3e..56137c87a 100644
--- a/docs/docs/faq/kbqa.md
+++ b/docs/docs/faq/kbqa.md
@@ -49,7 +49,7 @@ Set KNOWLEDGE_SEARCH_TOP_SIZE smaller or set KNOWLEDGE_CHUNK_SIZE smaller, and r
2.add column context for table knowledge_space
```commandline
-mysql -h127.0.0.1 -uroot -p{your_password
+mysql -h127.0.0.1 -uroot -p {your_password}
```
3.execute sql ddl
From 2c03de9c42611eae6dc85e45b462a924e8dc8626 Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Fri, 1 Dec 2023 17:23:44 +0800
Subject: [PATCH 19/26] doc:update rag argument document.
---
.../docs/application/advanced_tutorial/rag.md | 86 ++++++++++++++-----
1 file changed, 64 insertions(+), 22 deletions(-)
diff --git a/docs/docs/application/advanced_tutorial/rag.md b/docs/docs/application/advanced_tutorial/rag.md
index 322dc564f..12855cfeb 100644
--- a/docs/docs/application/advanced_tutorial/rag.md
+++ b/docs/docs/application/advanced_tutorial/rag.md
@@ -1,8 +1,16 @@
# RAG Parameter Adjustment
Each knowledge space supports argument customization, including the relevant arguments for vector retrieval and the arguments for knowledge question-answering prompts.
-#### Embedding Arguments
-Embedding Argument
-![upload](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/f1221bd5-d049-4ceb-96e6-8709e76e502e)
+
+
+
+
+![image](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/8a69aba0-3b28-449d-8fd8-ce5bf8dbf7fc)
:::tip Embedding Arguments
* topk:the top k vectors based on similarity score.
@@ -12,10 +20,11 @@ Embedding Argument
* chunk_size:The size of the data chunks used in processing.
* chunk_overlap:The amount of overlap between adjacent data chunks.
:::
+
-#### Prompt Arguments
-Prompt Argument
-![upload](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/9918c9c3-ed64-4804-9e05-fa7d7d177bec)
+
+
+![image](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/00f12903-8d70-4bfb-9f58-26f03a6a4773)
:::tip Prompt Arguments
* scene:A contextual parameter used to define the setting or environment in which the prompt is being used.
@@ -23,8 +32,10 @@ Prompt Argument
* max_token:The maximum number of tokens or words allowed in a prompt.
:::
-#### Summary Arguments
-Summary Argument
+
+
+
+
![image](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/96782ba2-e9a2-4173-a003-49d44bf874cc)
:::tip summary arguments
@@ -32,32 +43,63 @@ Summary Argument
* concurrency_limit: default summary concurrency call with llm, default 3.
:::
-#### Knowledge Query Rewrite
+
+
+
+
+# Knowledge Query Rewrite
set ``KNOWLEDGE_SEARCH_REWRITE=True`` in ``.env`` file, and restart the server.
```shell
# Whether to enable Chat Knowledge Search Rewrite Mode
-KNOWLEDGE_SEARCH_REWRITE=False
+KNOWLEDGE_SEARCH_REWRITE=True
```
-#### Change Vector Database
+# Change Vector Database
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
-set ``VECTOR_STORE_TYPE`` in ``.env`` file, and restart the server.
+
+
+set ``VECTOR_STORE_TYPE`` in ``.env`` file.
```shell
### Chroma vector db config
VECTOR_STORE_TYPE=Chroma
#CHROMA_PERSIST_PATH=/root/DB-GPT/pilot/data
+```
+
+
+
+
+set ``VECTOR_STORE_TYPE`` in ``.env`` file
+
+```shell
+ ### Milvus vector db config
+ VECTOR_STORE_TYPE=Milvus
+ MILVUS_URL=127.0.0.1
+ MILVUS_PORT=19530
+ #MILVUS_USERNAME
+ #MILVUS_PASSWORD
+ #MILVUS_SECURE=
+ ```
+
+
+
-### Milvus vector db config
-#VECTOR_STORE_TYPE=Milvus
-#MILVUS_URL=127.0.0.1
-#MILVUS_PORT=19530
-#MILVUS_USERNAME
-#MILVUS_PASSWORD
-#MILVUS_SECURE=
+set ``VECTOR_STORE_TYPE`` in ``.env`` file
-### Weaviate vector db config
-#VECTOR_STORE_TYPE=Weaviate
-#WEAVIATE_URL=https://kt-region-m8hcy0wc.weaviate.network
+```shell
+ ### Weaviate vector db config
+ VECTOR_STORE_TYPE=Weaviate
+ #WEAVIATE_URL=https://kt-region-m8hcy0wc.weaviate.network
+ ```
+
+
From 509f29f7226947241cf2f32aae3386fe7e417c99 Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Fri, 1 Dec 2023 17:33:13 +0800
Subject: [PATCH 20/26] doc:update rag document
---
.../docs/application/advanced_tutorial/rag.md | 22 ++++++++++---------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/docs/docs/application/advanced_tutorial/rag.md b/docs/docs/application/advanced_tutorial/rag.md
index 12855cfeb..5e05db7fe 100644
--- a/docs/docs/application/advanced_tutorial/rag.md
+++ b/docs/docs/application/advanced_tutorial/rag.md
@@ -67,6 +67,7 @@ import TabItem from '@theme/TabItem';
{label: 'Weaviate', value: 'Weaviate'},
]}>
+
set ``VECTOR_STORE_TYPE`` in ``.env`` file.
```shell
@@ -78,16 +79,17 @@ VECTOR_STORE_TYPE=Chroma
+
set ``VECTOR_STORE_TYPE`` in ``.env`` file
```shell
- ### Milvus vector db config
- VECTOR_STORE_TYPE=Milvus
- MILVUS_URL=127.0.0.1
- MILVUS_PORT=19530
- #MILVUS_USERNAME
- #MILVUS_PASSWORD
- #MILVUS_SECURE=
+### Milvus vector db config
+VECTOR_STORE_TYPE=Milvus
+MILVUS_URL=127.0.0.1
+MILVUS_PORT=19530
+#MILVUS_USERNAME
+#MILVUS_PASSWORD
+#MILVUS_SECURE=
```
@@ -96,9 +98,9 @@ set ``VECTOR_STORE_TYPE`` in ``.env`` file
set ``VECTOR_STORE_TYPE`` in ``.env`` file
```shell
- ### Weaviate vector db config
- VECTOR_STORE_TYPE=Weaviate
- #WEAVIATE_URL=https://kt-region-m8hcy0wc.weaviate.network
+### Weaviate vector db config
+VECTOR_STORE_TYPE=Weaviate
+#WEAVIATE_URL=https://kt-region-m8hcy0wc.weaviate.network
```
From f074cb616f7a8e7b21ee77a474d83de43f897698 Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Fri, 1 Dec 2023 18:07:13 +0800
Subject: [PATCH 21/26] doc:update rag document
---
docs/docs/application/advanced_tutorial/rag.md | 14 +++++++++-----
.../static/chunks/pages/_app-a7ec5b45a9ed8418.js | 2 +-
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/docs/docs/application/advanced_tutorial/rag.md b/docs/docs/application/advanced_tutorial/rag.md
index 5e05db7fe..1cfeab5c2 100644
--- a/docs/docs/application/advanced_tutorial/rag.md
+++ b/docs/docs/application/advanced_tutorial/rag.md
@@ -1,6 +1,10 @@
# RAG Parameter Adjustment
Each knowledge space supports argument customization, including the relevant arguments for vector retrieval and the arguments for knowledge question-answering prompts.
+As shown in the figure below, clicking on the "Knowledge" will trigger a pop-up dialog box. Click the "Arguments" button to enter the parameter tuning interface.
+![image](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/f02039ea-01d7-493a-acd9-027020d54267)
+
+
@@ -39,7 +43,7 @@ Each knowledge space supports argument customization, including the relevant arg
![image](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/96782ba2-e9a2-4173-a003-49d44bf874cc)
:::tip summary arguments
-* max_iteration: summary max iteration call with llm, default 5.
+* max_iteration: summary max iteration call with llm, default 5. the bigger and better for document summary but time will cost longer.
* concurrency_limit: default summary concurrency call with llm, default 3.
:::
diff --git a/pilot/server/static/_next/static/chunks/pages/_app-a7ec5b45a9ed8418.js b/pilot/server/static/_next/static/chunks/pages/_app-a7ec5b45a9ed8418.js
index 8d1c17197..94d87ea42 100644
--- a/pilot/server/static/_next/static/chunks/pages/_app-a7ec5b45a9ed8418.js
+++ b/pilot/server/static/_next/static/chunks/pages/_app-a7ec5b45a9ed8418.js
@@ -134,7 +134,7 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
- */var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,x=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case f:case i:case l:case a:case p:return e;default:switch(e=e&&e.$$typeof){case c:case d:case g:case m:case s:return e;default:return t}}case o:return t}}}function C(e){return w(e)===f}t.AsyncMode=u,t.ConcurrentMode=f,t.ContextConsumer=c,t.ContextProvider=s,t.Element=r,t.ForwardRef=d,t.Fragment=i,t.Lazy=g,t.Memo=m,t.Portal=o,t.Profiler=l,t.StrictMode=a,t.Suspense=p,t.isAsyncMode=function(e){return C(e)||w(e)===u},t.isConcurrentMode=C,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===d},t.isFragment=function(e){return w(e)===i},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===l},t.isStrictMode=function(e){return w(e)===a},t.isSuspense=function(e){return w(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===f||e===l||e===a||e===p||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===y||e.$$typeof===b||e.$$typeof===x||e.$$typeof===v)},t.typeOf=w},21296:function(e,t,n){"use strict";e.exports=n(96103)},62705:function(e,t,n){var r=n(55639).Symbol;e.exports=r},44239:function(e,t,n){var r=n(62705),o=n(89607),i=n(2333),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},27561:function(e,t,n){var r=n(67990),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},31957:function(e,t,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},89607:function(e,t,n){var r=n(62705),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,l=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,l),n=e[l];try{e[l]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[l]=n:delete e[l]),o}},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},55639:function(e,t,n){var r=n(31957),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},67990:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},23279:function(e,t,n){var r=n(13218),o=n(7771),i=n(14841),a=Math.max,l=Math.min;e.exports=function(e,t,n){var s,c,u,f,d,p,h=0,m=!1,g=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function y(t){var n=s,r=c;return s=c=void 0,h=t,f=e.apply(r,n)}function b(e){var n=e-p,r=e-h;return void 0===p||n>=t||n<0||g&&r>=u}function x(){var e,n,r,i=o();if(b(i))return w(i);d=setTimeout(x,(e=i-p,n=i-h,r=t-e,g?l(r,u-n):r))}function w(e){return(d=void 0,v&&s)?y(e):(s=c=void 0,f)}function C(){var e,n=o(),r=b(n);if(s=arguments,c=this,p=n,r){if(void 0===d)return h=e=p,d=setTimeout(x,t),m?y(e):f;if(g)return clearTimeout(d),d=setTimeout(x,t),y(p)}return void 0===d&&(d=setTimeout(x,t)),f}return t=i(t)||0,r(n)&&(m=!!n.leading,u=(g="maxWait"in n)?a(i(n.maxWait)||0,t):u,v="trailing"in n?!!n.trailing:v),C.cancel=function(){void 0!==d&&clearTimeout(d),h=0,s=p=c=d=void 0},C.flush=function(){return void 0===d?f:w(o())},C}},13218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},37005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},33448:function(e,t,n){var r=n(44239),o=n(37005);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},7771:function(e,t,n){var r=n(55639);e.exports=function(){return r.Date.now()}},23493:function(e,t,n){var r=n(23279),o=n(13218);e.exports=function(e,t,n){var i=!0,a=!0;if("function"!=typeof e)throw TypeError("Expected a function");return o(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),r(e,t,{leading:i,maxWait:t,trailing:a})}},14841:function(e,t,n){var r=n(27561),o=n(13218),i=n(33448),a=0/0,l=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return a;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||c.test(e)?u(e.slice(2),n?2:8):l.test(e)?a:+e}},83454:function(e,t,n){"use strict";var r,o;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(o=n.g.process)?void 0:o.env)?n.g.process:n(77663)},6840:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return n(48271)}])},41468:function(e,t,n){"use strict";n.d(t,{R:function(){return c},p:function(){return s}});var r=n(85893),o=n(67294),i=n(50489),a=n(577),l=n(39332);let s=(0,o.createContext)({scene:"",chatId:"",modelList:[],model:"",dbParam:void 0,dialogueList:[],agentList:[],setAgentList:()=>{},setModel:()=>{},setIsContract:()=>{},setIsMenuExpand:()=>{},setDbParam:()=>void 0,queryDialogueList:()=>{},refreshDialogList:()=>{},history:[],setHistory:()=>{},docId:void 0,setDocId:()=>{}}),c=e=>{var t,n,c;let{children:u}=e,f=(0,l.useSearchParams)(),d=null!==(t=null==f?void 0:f.get("id"))&&void 0!==t?t:"",p=null!==(n=null==f?void 0:f.get("scene"))&&void 0!==n?n:"",h=null!==(c=null==f?void 0:f.get("db_param"))&&void 0!==c?c:"",[m,g]=(0,o.useState)(!1),[v,y]=(0,o.useState)(""),[b,x]=(0,o.useState)("chat_dashboard"!==p),[w,C]=(0,o.useState)(h),[S,E]=(0,o.useState)([]),[$,O]=(0,o.useState)([]),[k,j]=(0,o.useState)(),{run:P,data:Z=[],refresh:_}=(0,a.Z)(async()=>{let[,e]=await (0,i.Vx)((0,i.iP)());return null!=e?e:[]},{manual:!0}),{data:A=[]}=(0,a.Z)(async()=>{let[,e]=await (0,i.Vx)((0,i.Vw)());return null!=e?e:[]});(0,o.useEffect)(()=>{y(A[0])},[A,null==A?void 0:A.length]);let R=(0,o.useMemo)(()=>Z.find(e=>e.conv_uid===d),[d,Z]);return(0,r.jsx)(s.Provider,{value:{isContract:m,isMenuExpand:b,scene:p,chatId:d,modelList:A,model:v,dbParam:w||h,dialogueList:Z,agentList:S,setAgentList:E,setModel:y,setIsContract:g,setIsMenuExpand:x,setDbParam:C,queryDialogueList:P,refreshDialogList:_,currentDialogue:R,history:$,setHistory:O,docId:k,setDocId:j},children:u})}},58989:function(e,t,n){"use strict";n.d(t,{Z:function(){return z}});let r={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class o{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||r,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=Array(e),n=0;n{this.observers[e]=this.observers[e]||[],this.observers[e].push(t)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e]=this.observers[e].filter(e=>e!==t)}}emit(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r{e(...n)})}if(this.observers["*"]){let t=[].concat(this.observers["*"]);t.forEach(t=>{t.apply(t,[e,...n])})}}}function l(){let e,t;let n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}function s(e){return null==e?"":""+e}function c(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}let i="string"!=typeof t?[].concat(t):t.split(".");for(;i.length>1;){if(o())return{};let t=r(i.shift());!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{}}return o()?{}:{obj:e,k:r(i.shift())}}function u(e,t,n){let{obj:r,k:o}=c(e,t,Object);r[o]=n}function f(e,t){let{obj:n,k:r}=c(e,t);if(n)return n[r]}function d(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var p={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function h(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,e=>p[e]):e}let m=[" ",",","?","!",";"];function g(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];let r=t.split(n),o=e;for(let e=0;ee+i;)i++,l=o[a=r.slice(e,e+i).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(a)){if("string"==typeof l)return l;if(a&&"string"==typeof l[a])return l[a]}let s=r.slice(e+i).join(n);if(s)return g(l,s,n);return}o=o[r[e]]}return o}function v(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class y extends a{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."));let l=f(this.data,a);return l||!i||"string"!=typeof n?l:g(this.data&&this.data[e]&&this.data[e][t],n,o)}addResource(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(a=e.split("."),r=t,t=a[1]),this.addNamespaces(t),u(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(let r in n)("string"==typeof n[r]||"[object Array]"===Object.prototype.toString.apply(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),r=n,n=t,t=a[1]),this.addNamespaces(t);let l=f(this.data,a)||{};r?function e(t,n,r){for(let o in n)"__proto__"!==o&&"constructor"!==o&&(o in t?"string"==typeof t[o]||t[o]instanceof String||"string"==typeof n[o]||n[o]instanceof String?r&&(t[o]=n[o]):e(t[o],n[o],r):t[o]=n[o]);return t}(l,n,o):l={...l,...n},u(this.data,a,l),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return(t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI)?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e),n=t&&Object.keys(t)||[];return!!n.find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var b={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(e=>{this.processors[e]&&(t=this.processors[e].process(t,n,r,o))}),t}};let x={};class w extends a{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),function(e,t,n){e.forEach(e=>{t[e]&&(n[e]=t[e])})}(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=i.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;let n=this.resolve(e,t);return n&&void 0!==n.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");let r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!function(e,t,n){t=t||"",n=n||"";let r=m.filter(e=>0>t.indexOf(e)&&0>n.indexOf(e));if(0===r.length)return!0;let o=RegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`),i=!o.test(e);if(!i){let t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i}(e,n,r);if(i&&!a){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:o};let i=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}translate(e,t,n){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);let r=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:i,namespaces:a}=this.extractFromKey(e[e.length-1],t),l=a[a.length-1],s=t.lng||this.language,c=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(s&&"cimode"===s.toLowerCase()){if(c){let e=t.nsSeparator||this.options.nsSeparator;return r?{res:`${l}${e}${i}`,usedKey:i,exactUsedKey:i,usedLng:s,usedNS:l}:`${l}${e}${i}`}return r?{res:i,usedKey:i,exactUsedKey:i,usedLng:s,usedNS:l}:i}let u=this.resolve(e,t),f=u&&u.res,d=u&&u.usedKey||i,p=u&&u.exactUsedKey||i,h=Object.prototype.toString.apply(f),m=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,g=!this.i18nFormat||this.i18nFormat.handleAsObject,v="string"!=typeof f&&"boolean"!=typeof f&&"number"!=typeof f;if(g&&f&&v&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(h)&&!("string"==typeof m&&"[object Array]"===h)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(d,f,{...t,ns:a}):`key '${i} (${this.language})' returned an object instead of string.`;return r?(u.res=e,u):e}if(o){let e="[object Array]"===h,n=e?[]:{},r=e?p:d;for(let e in f)if(Object.prototype.hasOwnProperty.call(f,e)){let i=`${r}${o}${e}`;n[e]=this.translate(i,{...t,joinArrays:!1,ns:a}),n[e]===i&&(n[e]=f[e])}f=n}}else if(g&&"string"==typeof m&&"[object Array]"===h)(f=f.join(m))&&(f=this.extendTranslation(f,e,t,n));else{let r=!1,a=!1,c=void 0!==t.count&&"string"!=typeof t.count,d=w.hasDefaultValue(t),p=c?this.pluralResolver.getSuffix(s,t.count,t):"",h=t.ordinal&&c?this.pluralResolver.getSuffix(s,t.count,{ordinal:!1}):"",m=t[`defaultValue${p}`]||t[`defaultValue${h}`]||t.defaultValue;!this.isValidLookup(f)&&d&&(r=!0,f=m),this.isValidLookup(f)||(a=!0,f=i);let g=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,v=g&&a?void 0:f,y=d&&m!==f&&this.options.updateMissing;if(a||r||y){if(this.logger.log(y?"updateKey":"missingKey",s,l,i,y?m:f),o){let e=this.resolve(i,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[],n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t{let o=d&&r!==f?r:v;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,n,o,y,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,l,n,o,y,t),this.emit("missingKey",e,l,n,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&c?e.forEach(e=>{this.pluralResolver.getSuffixes(e,t).forEach(n=>{r([e],i+n,t[`defaultValue${n}`]||m)})}):r(e,i,m))}f=this.extendTranslation(f,e,t,u,n),a&&f===i&&this.options.appendNamespaceToMissingKey&&(f=`${l}:${i}`),(a||r)&&this.options.parseMissingKeyHandler&&(f="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${i}`:i,r?f:void 0):this.options.parseMissingKeyHandler(f))}return r?(u.res=f,u):f}extendTranslation(e,t,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){let a;n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let l="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(l){let t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let s=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language,n),l){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;a1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(t))return;let l=this.extractFromKey(e,a),s=l.key;n=s;let c=l.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));let u=void 0!==a.count&&"string"!=typeof a.count,f=u&&!a.ordinal&&0===a.count&&this.pluralResolver.shouldUseIntlApi(),d=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,p=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);c.forEach(e=>{this.isValidLookup(t)||(i=e,!x[`${p[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(i)&&(x[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(n=>{let i;if(this.isValidLookup(t))return;o=n;let l=[s];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(l,s,n,e,a);else{let e;u&&(e=this.pluralResolver.getSuffix(n,a.count,a));let t=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(l.push(s+e),a.ordinal&&0===e.indexOf(r)&&l.push(s+e.replace(r,this.options.pluralSeparator)),f&&l.push(s+t)),d){let n=`${s}${this.options.contextSeparator}${a.context}`;l.push(n),u&&(l.push(n+e),a.ordinal&&0===e.indexOf(r)&&l.push(n+e.replace(r,this.options.pluralSeparator)),f&&l.push(n+t))}}for(;i=l.pop();)this.isValidLookup(t)||(r=i,t=this.getResource(n,e,i,a))}))})}),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}static hasDefaultValue(e){let t="defaultValue";for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}function C(e){return e.charAt(0).toUpperCase()+e.slice(1)}class S{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=i.create("languageUtils")}getScriptPartFromCode(e){if(!(e=v(e))||0>e.indexOf("-"))return null;let t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(!(e=v(e))||0>e.indexOf("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if("string"==typeof e&&e.indexOf("-")>-1){let t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map(e=>e.toLowerCase()):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=C(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=C(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=C(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){let t;return e?(e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>{if(e===n||!(0>e.indexOf("-")&&0>n.indexOf("-"))&&0===e.indexOf(n))return e})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],o=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return"string"==typeof e&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),n.forEach(e=>{0>r.indexOf(e)&&o(this.formatLanguageCode(e))}),r}}let E=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],$={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},O=["v1","v2","v3"],k=["v4"],j={zero:0,one:1,two:2,few:3,many:4,other:5};class P{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=i.create("pluralResolver"),(!this.options.compatibilityJSON||k.includes(this.options.compatibilityJSON))&&("undefined"==typeof Intl||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=function(){let e={};return E.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:$[t.fc]}})}),e}()}addRule(e,t){this.rules[e]=t}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(v(e),{type:t.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((e,t)=>j[e]-j[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):n.numbers.map(n=>this.getSuffix(e,n,t)):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:this.getSuffixRetroCompatible(r,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){let n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),r=e.numbers[n];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===r?r="plural":1===r&&(r=""));let o=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?`_plural_${r.toString()}`:o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!O.includes(this.options.compatibilityJSON)}}function Z(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4)||void 0===arguments[4]||arguments[4],i=function(e,t,n){let r=f(e,n);return void 0!==r?r:f(t,n)}(e,t,n);return!i&&o&&"string"==typeof n&&void 0===(i=g(e,n,r))&&(i=g(t,n,r)),i}class _{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=i.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});let t=e.interpolation;this.escape=void 0!==t.escape?t.escape:h,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?d(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?d(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?d(t.nestingPrefix):t.nestingPrefixEscaped||d("$t("),this.nestingSuffix=t.nestingSuffix?d(t.nestingSuffix):t.nestingSuffixEscaped||d(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=`${this.prefix}(.+?)${this.suffix}`;this.regexp=RegExp(e,"g");let t=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=RegExp(t,"g");let n=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=RegExp(n,"g")}interpolate(e,t,n,r){let o,i,a;let l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}let u=e=>{if(0>e.indexOf(this.formatSeparator)){let o=Z(t,l,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}let o=e.split(this.formatSeparator),i=o.shift().trim(),a=o.join(this.formatSeparator).trim();return this.format(Z(t,l,i,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...r,...t,interpolationkey:i})};this.resetRegExp();let f=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,d=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,p=[{regex:this.regexpUnescape,safeValue:e=>c(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?c(this.escape(e)):c(e)}];return p.forEach(t=>{for(a=0;o=t.regex.exec(e);){let n=o[1].trim();if(void 0===(i=u(n))){if("function"==typeof f){let t=f(e,o,r);i="string"==typeof t?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else if(d){i=o[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else"string"==typeof i||this.useRawValueToEscape||(i=s(i));let l=t.safeValue(i);if(e=e.replace(o[0],l),d?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++a>=this.maxReplaces)break}}),e}nest(e,t){let n,r,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function a(e,t){let n=this.nestingOptionsSeparator;if(0>e.indexOf(n))return e;let r=e.split(RegExp(`${n}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,o);let a=i.match(/'/g),l=i.match(/"/g);(a&&a.length%2==0&&!l||l.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return delete o.defaultValue,e}for(;n=this.nestingRegexp.exec(e);){let l=[];(o=(o={...i}).replace&&"string"!=typeof o.replace?o.replace:o).applyPostProcessor=!1,delete o.defaultValue;let c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){let e=n[1].split(this.formatSeparator).map(e=>e.trim());n[1]=e.shift(),l=e,c=!0}if((r=t(a.call(this,n[1].trim(),o),o))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=s(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),c&&(r=l.reduce((e,t)=>this.format(e,t,i.lng,{...i,interpolationkey:n[1].trim()}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}function A(e){let t={};return function(n,r,o){let i=r+JSON.stringify(o),a=t[i];return a||(a=e(v(r),o),t[i]=a),a(n)}}class R{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=i.create("formatter"),this.options=e,this.formats={number:A((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:A((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:A((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:A((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:A((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})},this.init(e)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=A(t)}format(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.split(this.formatSeparator),i=o.reduce((e,t)=>{let{formatName:o,formatOptions:i}=function(e){let t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){let r=e.split("(");t=r[0].toLowerCase().trim();let o=r[1].substring(0,r[1].length-1);if("currency"===t&&0>o.indexOf(":"))n.currency||(n.currency=o.trim());else if("relativetime"===t&&0>o.indexOf(":"))n.range||(n.range=o.trim());else{let e=o.split(";");e.forEach(e=>{if(!e)return;let[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,"");n[t.trim()]||(n[t.trim()]=o),"false"===o&&(n[t.trim()]=!1),"true"===o&&(n[t.trim()]=!0),isNaN(o)||(n[t.trim()]=parseInt(o,10))})}}return{formatName:t,formatOptions:n}}(t);if(this.formats[o]){let t=e;try{let a=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},l=a.locale||a.lng||r.locale||r.lng||n;t=this.formats[o](e,l,{...i,...r,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e);return i}}class M extends a{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=i.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,r.backend,r)}queueLoad(e,t,n,r){let o={},i={},a={},l={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===i[a]&&(i[a]=!0):(this.state[a]=1,r=!1,void 0===i[a]&&(i[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===l[t]&&(l[t]=!0)))}),r||(a[e]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(e,t,n){let r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),n&&this.store.addResourceBundle(o,i,n),this.state[e]=t?-1:2;let a={};this.queue.forEach(n=>{(function(e,t,n,r){let{obj:o,k:i}=c(e,t,Object);o[i]=o[i]||[],r&&(o[i]=o[i].concat(n)),r||o[i].push(n)})(n.loaded,[o],i),void 0!==n.pending[e]&&(delete n.pending[e],n.pendingCount--),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{a[e]||(a[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:i});return}this.readingCalls++;let a=(a,l)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(a&&l&&r{this.read.call(this,e,t,n,r+1,2*o,i)},o);return}i(a,l)},l=this.backend[n].bind(this.backend);if(2===l.length){try{let n=l(e,t);n&&"function"==typeof n.then?n.then(e=>a(null,e)).catch(a):a(null,n)}catch(e){a(e)}return}return l(e,t,a)}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);let o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(n,i)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,i),this.loaded(e,n,i)})}saveMissing(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(null!=n&&""!==n){if(this.backend&&this.backend.create){let l={...i,isUpdate:o},s=this.backend.create.bind(this.backend);if(s.length<6)try{let o;(o=5===s.length?s(e,t,n,r,l):s(e,t,n,r))&&"function"==typeof o.then?o.then(e=>a(null,e)).catch(a):a(null,o)}catch(e){a(e)}else s(e,t,n,r,a,l)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}function N(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let t={};if("object"==typeof e[1]&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:(e,t,n,r)=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function T(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&0>e.supportedLngs.indexOf("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function F(){}class I extends a{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=T(e),this.services={},this.logger=i,this.modules={external:[]},!function(e){let t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})}(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:0>t.ns.indexOf("translation")&&(t.defaultNS=t.ns[0]));let r=N();function o(e){return e?"function"==typeof e?new e:e:null}if(this.options={...r,...this.options,...T(t)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){let t;this.modules.logger?i.init(o(this.modules.logger),this.options):i.init(null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!=typeof Intl&&(t=R);let n=new S(this.options);this.store=new y(this.options.resources,this.options);let a=this.services;a.logger=i,a.resourceStore=this.store,a.languageUtils=n,a.pluralResolver=new P(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),t&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(a.formatter=o(t),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new _(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new M(o(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o1?n-1:0),o=1;o{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,n||(n=F),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(t=>{this[t]=function(){return e.store[t](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(t=>{this[t]=function(){return e.store[t](...arguments),e}});let a=l(),s=()=>{let e=(e,t)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(t),n(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?s():setTimeout(s,0),a}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F,n=t,r="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();let e=[],t=t=>{if(!t||"cimode"===t)return;let n=this.services.languageUtils.toResolveHierarchy(t);n.forEach(t=>{"cimode"!==t&&0>e.indexOf(t)&&e.push(t)})};if(r)t(r);else{let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.forEach(e=>t(e))}this.options.preload&&this.options.preload.forEach(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=l();return e||(e=this.languages),t||(t=this.options.ns),n||(n=F),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&b.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let e=0;e-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;let r=l();this.emit("languageChanging",e);let o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(e,i)=>{i?(o(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,r.resolve(function(){return n.t(...arguments)}),t&&t(e,function(){return n.t(...arguments)})},a=t=>{e||t||!this.services.languageDetector||(t=[]);let n="string"==typeof t?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||o(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,e=>{i(e,n)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),r}getFixedT(e,t,n){var r=this;let o=function(e,t){let i,a;if("object"!=typeof t){for(var l=arguments.length,s=Array(l>2?l-2:0),c=2;c`${i.keyPrefix}${u}${e}`):i.keyPrefix?`${i.keyPrefix}${u}${e}`:e,r.t(a,i)};return"string"==typeof e?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;let i=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return -1===n||2===n};if(t.precheck){let e=t.precheck(this,i);if(void 0!==e)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(n,e)&&(!r||i(o,e)))}loadNamespaces(e,t){let n=l();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach(e=>{0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=l();"string"==typeof e&&(e=[e]);let r=this.options.preload||[],o=e.filter(e=>0>r.indexOf(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";let t=this.services&&this.services.languageUtils||new S(N());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new I(e,t)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F,n=e.forkResourceStore;n&&delete e.forkResourceStore;let r={...this.options,...e,isClone:!0},o=new I(r);return(void 0!==e.debug||void 0!==e.prefix)&&(o.logger=o.logger.clone(e)),["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new y(this.store.data,r),o.services.resourceStore=o.store),o.translator=new w(o.services,r),o.translator.on("*",function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r{let{componentCls:t,width:n,notificationMarginEdge:r}=e,o=new y.E4("antNotificationTopFadeIn",{"0%":{marginTop:"-100%",opacity:0},"100%":{marginTop:0,opacity:1}}),i=new y.E4("antNotificationBottomFadeIn",{"0%":{marginBottom:"-100%",opacity:0},"100%":{marginBottom:0,opacity:1}}),a=new y.E4("antNotificationLeftFadeIn",{"0%":{right:{_skip_check_:!0,value:n},opacity:0},"100%":{right:{_skip_check_:!0,value:0},opacity:1}});return{[`&${t}-top, &${t}-bottom`]:{marginInline:0},[`&${t}-top`]:{[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:o}},[`&${t}-bottom`]:{[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:i}},[`&${t}-topLeft, &${t}-bottomLeft`]:{marginInlineEnd:0,marginInlineStart:r,[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:a}}}};let S=e=>{let{iconCls:t,componentCls:n,boxShadow:r,fontSizeLG:o,notificationMarginBottom:i,borderRadiusLG:a,colorSuccess:l,colorInfo:s,colorWarning:c,colorError:u,colorTextHeading:f,notificationBg:d,notificationPadding:p,notificationMarginEdge:h,motionDurationMid:m,motionEaseInOut:g,fontSize:v,lineHeight:x,width:w,notificationIconSize:S,colorText:E}=e,$=`${n}-notice`,O=new y.E4("antNotificationFadeIn",{"0%":{left:{_skip_check_:!0,value:w},opacity:0},"100%":{left:{_skip_check_:!0,value:0},opacity:1}}),k=new y.E4("antNotificationFadeOut",{"0%":{maxHeight:e.animationMaxHeight,marginBottom:i,opacity:1},"100%":{maxHeight:0,marginBottom:0,paddingTop:0,paddingBottom:0,opacity:0}}),j={position:"relative",width:w,maxWidth:`calc(100vw - ${2*h}px)`,marginBottom:i,marginInlineStart:"auto",padding:p,overflow:"hidden",lineHeight:x,wordWrap:"break-word",background:d,borderRadius:a,boxShadow:r,[`${n}-close-icon`]:{fontSize:v,cursor:"pointer"},[`${$}-message`]:{marginBottom:e.marginXS,color:f,fontSize:o,lineHeight:e.lineHeightLG},[`${$}-description`]:{fontSize:v,color:E},[`&${$}-closable ${$}-message`]:{paddingInlineEnd:e.paddingLG},[`${$}-with-icon ${$}-message`]:{marginBottom:e.marginXS,marginInlineStart:e.marginSM+S,fontSize:o},[`${$}-with-icon ${$}-description`]:{marginInlineStart:e.marginSM+S,fontSize:v},[`${$}-icon`]:{position:"absolute",fontSize:S,lineHeight:0,[`&-success${t}`]:{color:l},[`&-info${t}`]:{color:s},[`&-warning${t}`]:{color:c},[`&-error${t}`]:{color:u}},[`${$}-close`]:{position:"absolute",top:e.notificationPaddingVertical,insetInlineEnd:e.notificationPaddingHorizontal,color:e.colorIcon,outline:"none",width:e.notificationCloseButtonSize,height:e.notificationCloseButtonSize,borderRadius:e.borderRadiusSM,transition:`background-color ${e.motionDurationMid}, color ${e.motionDurationMid}`,display:"flex",alignItems:"center",justifyContent:"center","&:hover":{color:e.colorIconHover,backgroundColor:e.wireframe?"transparent":e.colorFillContent}},[`${$}-btn`]:{float:"right",marginTop:e.marginSM}};return[{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,b.Wf)(e)),{position:"fixed",zIndex:e.zIndexPopup,marginInlineEnd:h,[`${n}-hook-holder`]:{position:"relative"},[`&${n}-top, &${n}-bottom`]:{[$]:{marginInline:"auto auto"}},[`&${n}-topLeft, &${n}-bottomLeft`]:{[$]:{marginInlineEnd:"auto",marginInlineStart:0}},[`${n}-fade-enter, ${n}-fade-appear`]:{animationDuration:e.motionDurationMid,animationTimingFunction:g,animationFillMode:"both",opacity:0,animationPlayState:"paused"},[`${n}-fade-leave`]:{animationTimingFunction:g,animationFillMode:"both",animationDuration:m,animationPlayState:"paused"},[`${n}-fade-enter${n}-fade-enter-active, ${n}-fade-appear${n}-fade-appear-active`]:{animationName:O,animationPlayState:"running"},[`${n}-fade-leave${n}-fade-leave-active`]:{animationName:k,animationPlayState:"running"}}),C(e)),{"&-rtl":{direction:"rtl",[`${$}-btn`]:{float:"left"}}})},{[n]:{[$]:Object.assign({},j)}},{[`${$}-pure-panel`]:Object.assign(Object.assign({},j),{margin:0})}]};var E=(0,x.Z)("Notification",e=>{let t=e.paddingMD,n=e.paddingLG,r=(0,w.TS)(e,{notificationBg:e.colorBgElevated,notificationPaddingVertical:t,notificationPaddingHorizontal:n,notificationIconSize:e.fontSizeLG*e.lineHeightLG,notificationCloseButtonSize:.55*e.controlHeightLG,notificationMarginBottom:e.margin,notificationPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`,notificationMarginEdge:e.marginLG,animationMaxHeight:150});return[S(r)]},e=>({zIndexPopup:e.zIndexPopupBase+50,width:384})),$=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function O(e,t){return null===t||!1===t?null:t||i.createElement("span",{className:`${e}-close-x`},i.createElement(u.Z,{className:`${e}-close-icon`}))}d.Z,s.Z,c.Z,f.Z,p.Z;let k={success:s.Z,info:d.Z,error:c.Z,warning:f.Z},j=e=>{let{prefixCls:t,icon:n,type:r,message:o,description:a,btn:l,role:s="alert"}=e,c=null;return n?c=i.createElement("span",{className:`${t}-icon`},n):r&&(c=i.createElement(k[r]||null,{className:m()(`${t}-icon`,`${t}-icon-${r}`)})),i.createElement("div",{className:m()({[`${t}-with-icon`]:c}),role:s},c,i.createElement("div",{className:`${t}-message`},o),i.createElement("div",{className:`${t}-description`},a),l&&i.createElement("div",{className:`${t}-btn`},l))};var P=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let Z=e=>{let{children:t,prefixCls:n}=e,[,r]=E(n);return i.createElement(g.JB,{classNames:{list:r,notice:r}},t)},_=(e,t)=>{let{prefixCls:n,key:r}=t;return i.createElement(Z,{prefixCls:n,key:r},e)},A=i.forwardRef((e,t)=>{let{top:n,bottom:r,prefixCls:o,getContainer:a,maxCount:l,rtl:s,onAllRemoved:c}=e,{getPrefixCls:u,getPopupContainer:f,notification:d}=i.useContext(v.E_),p=o||u("notification"),[h,y]=(0,g.lm)({prefixCls:p,style:e=>(function(e,t,n){let r;switch(e){case"top":r={left:"50%",transform:"translateX(-50%)",right:"auto",top:t,bottom:"auto"};break;case"topLeft":r={left:0,top:t,bottom:"auto"};break;case"topRight":r={right:0,top:t,bottom:"auto"};break;case"bottom":r={left:"50%",transform:"translateX(-50%)",right:"auto",top:"auto",bottom:n};break;case"bottomLeft":r={left:0,top:"auto",bottom:n};break;default:r={right:0,top:"auto",bottom:n}}return r})(e,null!=n?n:24,null!=r?r:24),className:()=>m()({[`${p}-rtl`]:s}),motion:()=>({motionName:`${p}-fade`}),closable:!0,closeIcon:O(p),duration:4.5,getContainer:()=>(null==a?void 0:a())||(null==f?void 0:f())||document.body,maxCount:l,onAllRemoved:c,renderNotifications:_});return i.useImperativeHandle(t,()=>Object.assign(Object.assign({},h),{prefixCls:p,notification:d})),y});function R(e){let t=i.useRef(null),n=i.useMemo(()=>{let n=n=>{var r;if(!t.current)return;let{open:o,prefixCls:a,notification:l}=t.current,s=`${a}-notice`,{message:c,description:u,icon:f,type:d,btn:p,className:h,style:g,role:v="alert",closeIcon:y}=n,b=P(n,["message","description","icon","type","btn","className","style","role","closeIcon"]),x=O(s,y);return o(Object.assign(Object.assign({placement:null!==(r=null==e?void 0:e.placement)&&void 0!==r?r:"topRight"},b),{content:i.createElement(j,{prefixCls:s,icon:f,type:d,message:c,description:u,btn:p,role:v}),className:m()(d&&`${s}-${d}`,h,null==l?void 0:l.className),style:Object.assign(Object.assign({},null==l?void 0:l.style),g),closeIcon:x,closable:!!x}))},r={open:n,destroy:e=>{var n,r;void 0!==e?null===(n=t.current)||void 0===n||n.close(e):null===(r=t.current)||void 0===r||r.destroy()}};return["success","info","warning","error"].forEach(e=>{r[e]=t=>n(Object.assign(Object.assign({},t),{type:e}))}),r},[]);return[n,i.createElement(A,Object.assign({key:"notification-holder"},e,{ref:t}))]}let M=null,N=e=>e(),T=[],F={};function I(){let{prefixCls:e,getContainer:t,rtl:n,maxCount:r,top:o,bottom:i}=F,a=null!=e?e:(0,l.w6)().getPrefixCls("notification"),s=(null==t?void 0:t())||document.body;return{prefixCls:a,getContainer:()=>s,rtl:n,maxCount:r,top:o,bottom:i}}let L=i.forwardRef((e,t)=>{let[n,r]=i.useState(I),[o,a]=R(n),s=(0,l.w6)(),c=s.getRootPrefixCls(),u=s.getIconPrefixCls(),f=s.getTheme(),d=()=>{r(I)};return i.useEffect(d,[]),i.useImperativeHandle(t,()=>{let e=Object.assign({},o);return Object.keys(e).forEach(t=>{e[t]=function(){return d(),o[t].apply(o,arguments)}}),{instance:e,sync:d}}),i.createElement(l.ZP,{prefixCls:c,iconPrefixCls:u,theme:f},a)});function B(){if(!M){let e=document.createDocumentFragment(),t={fragment:e};M=t,N(()=>{(0,a.s)(i.createElement(L,{ref:e=>{let{instance:n,sync:r}=e||{};Promise.resolve().then(()=>{!t.instance&&n&&(t.instance=n,t.sync=r,B())})}}),e)});return}M.instance&&(T.forEach(e=>{switch(e.type){case"open":N(()=>{M.instance.open(Object.assign(Object.assign({},F),e.config))});break;case"destroy":N(()=>{null==M||M.instance.destroy(e.key)})}}),T=[])}function z(e){T.push({type:"open",config:e}),B()}let D={open:z,destroy:function(e){T.push({type:"destroy",key:e}),B()},config:function(e){F=Object.assign(Object.assign({},F),e),N(()=>{var e;null===(e=null==M?void 0:M.sync)||void 0===e||e.call(M)})},useNotification:function(e){return R(e)},_InternalPanelDoNotUseOrYouWillBeFired:e=>{let{prefixCls:t,className:n,icon:r,type:o,message:a,description:l,btn:s,closable:c=!0,closeIcon:u}=e,f=$(e,["prefixCls","className","icon","type","message","description","btn","closable","closeIcon"]),{getPrefixCls:d}=i.useContext(v.E_),p=t||d("notification"),h=`${p}-notice`,[,y]=E(p);return i.createElement(g.qX,Object.assign({},f,{prefixCls:p,className:m()(n,y,`${h}-pure-panel`),eventKey:"pure",duration:null,closable:c,closeIcon:O(p,u),content:i.createElement(j,{prefixCls:h,icon:r,type:o,message:a,description:l,btn:s})}))}};["success","info","warning","error"].forEach(e=>{D[e]=t=>z(Object.assign(Object.assign({},t),{type:e}))});let H=(e,t)=>e.then(e=>{let{data:n}=e;if(!n)throw Error("Network Error!");if(!n.success){if("*"===t||n.err_code&&t&&t.includes(n.err_code));else{var r;D.error({message:"Request error",description:null!==(r=null==n?void 0:n.err_msg)&&void 0!==r?r:"The interface is abnormal. Please try again later"})}}return[null,n.data,n,e]}).catch(e=>(D.error({message:"Request error",description:e.message}),[e,null,null,null])),V=()=>eN("/api/v1/chat/dialogue/scenes"),U=e=>eN("/api/v1/chat/dialogue/new",e),W=()=>eM("/api/v1/chat/db/list"),q=()=>eM("/api/v1/chat/db/support/type"),K=e=>eN("/api/v1/chat/db/delete?db_name=".concat(e)),G=e=>eN("/api/v1/chat/db/edit",e),X=e=>eN("/api/v1/chat/db/add",e),Y=e=>eN("/api/v1/chat/db/test/connect",e),J=()=>eM("/api/v1/chat/dialogue/list"),Q=()=>eM("/api/v1/model/types"),ee=e=>eN("/api/v1/chat/mode/params/list?chat_mode=".concat(e)),et=e=>eM("/api/v1/chat/dialogue/messages/history?con_uid=".concat(e)),en=e=>{let{convUid:t,chatMode:n,data:r,config:o,model:i}=e;return eN("/api/v1/chat/mode/params/file/load?conv_uid=".concat(t,"&chat_mode=").concat(n,"&model_name=").concat(i),r,{headers:{"Content-Type":"multipart/form-data"},...o})},er=e=>eN("/api/v1/chat/dialogue/delete?con_uid=".concat(e)),eo=e=>eN("/knowledge/".concat(e,"/arguments"),{}),ei=(e,t)=>eN("/knowledge/".concat(e,"/argument/save"),t),ea=()=>eN("/knowledge/space/list",{}),el=(e,t)=>eN("/knowledge/".concat(e,"/document/list"),t),es=(e,t)=>eN("/knowledge/".concat(e,"/document/add"),t),ec=e=>eN("/knowledge/space/add",e),eu=(e,t)=>eN("/knowledge/".concat(e,"/document/sync"),t),ef=(e,t)=>eN("/knowledge/".concat(e,"/document/upload"),t),ed=(e,t)=>eN("/knowledge/".concat(e,"/chunk/list"),t),ep=(e,t)=>eN("/knowledge/".concat(e,"/document/delete"),t),eh=e=>eN("/knowledge/space/delete",e),em=()=>eM("/api/v1/worker/model/list"),eg=e=>eN("/api/v1/worker/model/stop",e),ev=e=>eN("/api/v1/worker/model/start",e),ey=()=>eM("/api/v1/worker/model/params"),eb=e=>eN("/api/v1/agent/query",e),ex=e=>eN("/api/v1/agent/hub/update",null!=e?e:{channel:"",url:"",branch:"",authorization:""}),ew=e=>eN("/api/v1/agent/my",void 0,{params:{user:e}}),eC=(e,t)=>eN("/api/v1/agent/install",void 0,{params:{plugin_name:e,user:t},timeout:6e4}),eS=(e,t)=>eN("/api/v1/agent/uninstall",void 0,{params:{plugin_name:e,user:t},timeout:6e4}),eE=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;return eN("/api/v1/personal/agent/upload",t,{params:{user:e},headers:{"Content-Type":"multipart/form-data"},...n})},e$=()=>eM("/api/v1/feedback/select",void 0),eO=(e,t)=>eM("/api/v1/feedback/find?conv_uid=".concat(e,"&conv_index=").concat(t),void 0),ek=e=>{let{data:t,config:n}=e;return eN("/api/v1/feedback/commit",t,{headers:{"Content-Type":"application/json"},...n})},ej=e=>eN("/prompt/list",e),eP=e=>eN("/prompt/update",e),eZ=e=>eN("/prompt/add",e);var e_=n(83454);let eA=o.Z.create({baseURL:null!==(r=e_.env.API_BASE_URL)&&void 0!==r?r:""}),eR=["/db/add","/db/test/connect","/db/summary","/params/file/load","/chat/prepare","/model/start","/model/stop","/editor/sql/run","/sql/editor/submit","/editor/chart/run","/chart/editor/submit","/document/upload","/document/sync","/agent/install","/agent/uninstall","/personal/agent/upload"];eA.interceptors.request.use(e=>{let t=eR.some(t=>e.url&&e.url.indexOf(t)>=0);return e.timeout||(e.timeout=t?6e4:1e4),e});let eM=(e,t,n)=>eA.get(e,{params:t,...n}),eN=(e,t,n)=>eA.post(e,t,n)},82579:function(e,t,n){"use strict";n.d(t,{RD:function(){return a},In:function(){return o},zM:function(){return i},je:function(){return l},DL:function(){return s},si:function(){return c},FD:function(){return u},s2:function(){return h},Rp:function(){return m},IN:function(){return f},ig:function(){return d},ol:function(){return p}});var r=n(85893),o=function(){return(0,r.jsxs)("svg",{viewBox:"0 0 1059 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"11020",className:"w-full h-full",children:[(0,r.jsx)("path",{d:"M617.931034 971.034483H335.448276c62.834759 0 70.62069-140.994207 70.62069-211.862069h247.172413c0 70.867862 7.785931 211.862069 70.62069 211.862069h-105.931035z",fill:"#4DB5E3","p-id":"11021"}),(0,r.jsx)("path",{d:"M282.482759 953.37931h512a35.310345 35.310345 0 0 1 0 70.62069H282.482759a35.310345 35.310345 0 0 1 0-70.62069z",fill:"#47C5FC","p-id":"11022"}),(0,r.jsx)("path",{d:"M0 0m73.145379 0l913.019587 0q73.145379 0 73.145379 73.145379l0 683.502345q0 73.145379-73.145379 73.145379l-913.019587 0q-73.145379 0-73.145379-73.145379l0-683.502345q0-73.145379 73.145379-73.145379Z",fill:"#47C5FC","p-id":"11023"}),(0,r.jsx)("path",{d:"M52.965517 52.965517h953.379311v723.862069H52.965517z",fill:"#FFFFFF","p-id":"11024"}),(0,r.jsx)("path",{d:"M600.275862 564.965517h335.448276a17.655172 17.655172 0 0 1 0 35.310345H600.275862a17.655172 17.655172 0 0 1 0-35.310345z m0 88.275862h205.78869a17.655172 17.655172 0 0 1 0 35.310345H600.275862a17.655172 17.655172 0 0 1 0-35.310345z m278.068966 0H935.724138a17.655172 17.655172 0 0 1 0 35.310345h-57.37931a17.655172 17.655172 0 0 1 0-35.310345z",fill:"#C7EAF9","p-id":"11025"}),(0,r.jsx)("path",{d:"M194.206897 211.862069h282.482758a17.655172 17.655172 0 1 1 0 35.310345H194.206897a17.655172 17.655172 0 1 1 0-35.310345z m0 88.275862h171.59062a17.655172 17.655172 0 1 1 0 35.310345H194.206897a17.655172 17.655172 0 1 1 0-35.310345z m238.344827 0H476.689655a17.655172 17.655172 0 1 1 0 35.310345h-44.137931a17.655172 17.655172 0 1 1 0-35.310345z",fill:"#C7EAF9","p-id":"11026"}),(0,r.jsx)("path",{d:"M194.206897 176.551724H141.241379v52.965517a17.655172 17.655172 0 1 1-35.310345 0V158.896552a17.655172 17.655172 0 0 1 17.655173-17.655173h70.62069a17.655172 17.655172 0 0 1 0 35.310345z",fill:"#C7EAF9","p-id":"11027"}),(0,r.jsx)("path",{d:"M317.793103 564.965517h141.24138a141.241379 141.241379 0 1 1-141.24138-141.241379v141.241379z",fill:"#47C5FC","p-id":"11028"}),(0,r.jsx)("path",{d:"M335.448276 406.068966a141.241379 141.241379 0 0 1 141.241379 141.241379h-141.241379v-141.241379z",fill:"#FFDE21","p-id":"11029"}),(0,r.jsx)("path",{d:"M582.62069 176.551724h52.965517v247.172414h-52.965517z",fill:"#FFDE21","p-id":"11030"}),(0,r.jsx)("path",{d:"M688.551724 247.172414h52.965517v176.551724h-52.965517z",fill:"#47C5FC","p-id":"11031"}),(0,r.jsx)("path",{d:"M794.482759 300.137931h52.965517v123.586207h-52.965517z",fill:"#47C5FC","p-id":"11032"}),(0,r.jsx)("path",{d:"M900.413793 353.103448h52.965517v70.62069h-52.965517z",fill:"#FFDE21","p-id":"11033"})]})},i=function(){return(0,r.jsxs)("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"13568",className:"w-full h-full",children:[(0,r.jsx)("path",{d:"M185.66 459H70.5c-5.54 0-10 4.48-10 10v373.26c0 5.52 4.46 10 10 10h115.16c5.52 0 10-4.48 10-10V469c0-5.52-4.48-10-10-10z m-10 373.26H80.5V479h95.16v353.26z",fill:"#23130D","p-id":"13569"}),(0,r.jsx)("path",{d:"M80.5 479h95.16v353.26H80.5z",fill:"#F9C139","p-id":"13570"}),(0,r.jsx)("path",{d:"M80.5 479H100v353.26h-19.5z",fill:"#FFFFFF",opacity:".4","p-id":"13571"}),(0,r.jsx)("path",{d:"M156.16 479h19.5v353.26h-19.5z",fill:"#1C1817",opacity:".2","p-id":"13572"}),(0,r.jsx)("path",{d:"M377.62 556.06h-115.16c-5.54 0-10 4.48-10 10v276.2c0 5.52 4.46 10 10 10h115.16c5.54 0 10-4.48 10-10v-276.2c0-5.52-4.46-10-10-10z m-10 276.2h-95.16v-256.2h95.16v256.2z",fill:"#23130D","p-id":"13573"}),(0,r.jsx)("path",{d:"M272.46 576.06h95.16v256.2h-95.16z",fill:"#EC7063","p-id":"13574"}),(0,r.jsx)("path",{d:"M569.58 358.02h-115.16c-5.54 0-10 4.48-10 10v474.24c0 5.52 4.46 10 10 10h115.16c5.54 0 10-4.48 10-10V368.02c0-5.52-4.46-10-10-10z m-10 474.24h-95.16V378.02h95.16v454.24z",fill:"#23130D","p-id":"13575"}),(0,r.jsx)("path",{d:"M464.42 378.02h95.16v454.24h-95.16z",fill:"#72AF5F","p-id":"13576"}),(0,r.jsx)("path",{d:"M761.54 419.62h-115.16c-5.54 0-10 4.48-10 10v412.64c0 5.52 4.46 10 10 10h115.16c5.54 0 10-4.48 10-10V429.62c0-5.52-4.46-10-10-10z m-10 412.64h-95.16V439.62h95.16v392.64z",fill:"#23130D","p-id":"13577"}),(0,r.jsx)("path",{d:"M656.38 439.62h95.16v392.64h-95.16z",fill:"#EC7063","p-id":"13578"}),(0,r.jsx)("path",{d:"M953.5 281.94h-115.16c-5.52 0-10 4.48-10 10v550.32c0 5.52 4.48 10 10 10h115.16c5.54 0 10-4.48 10-10V291.94c0-5.52-4.46-10-10-10z m-10 550.32h-95.16V301.94h95.16v530.32z",fill:"#23130D","p-id":"13579"}),(0,r.jsx)("path",{d:"M848.34 301.94h95.16v530.32h-95.16z",fill:"#72AF5F","p-id":"13580"}),(0,r.jsx)("path",{d:"M953.51 883.768H70.49a10 10 0 1 0 0 20h883.02c5.524 0 10-4.476 10-10s-4.476-10-10-10zM895.92 120.24c-36.72 0-66.62 29.88-66.62 66.6 0 10.8 2.6 21 7.2 30.04l-84.72 60.34c-12.12-12.5-29.08-20.3-47.82-20.3-26.08 0-48.7 15.08-59.64 36.96l-66.56-21.38c0.56-3.46 0.86-7 0.86-10.62 0-36.72-29.88-66.6-66.62-66.6s-66.62 29.88-66.62 66.6c0 14.88 4.92 28.64 13.18 39.74l-99.32 100.32a66.24 66.24 0 0 0-39.2-12.8c-22.16 0-41.8 10.88-53.92 27.56l-75.9-39.12c2.26-6.7 3.5-13.84 3.5-21.28 0-36.72-29.88-66.6-66.62-66.6-36.72 0-66.6 29.88-66.6 66.6 0 36.74 29.88 66.62 66.6 66.62 22.16 0 41.82-10.88 53.94-27.58l75.9 39.14a66.316 66.316 0 0 0-3.52 21.28c0 36.72 29.88 66.6 66.62 66.6s66.62-29.88 66.62-66.6c0-14.9-4.92-28.64-13.2-39.76l99.32-100.32a66.18 66.18 0 0 0 39.22 12.82c26.08 0 48.7-15.08 59.62-36.96l66.58 21.38c-0.56 3.46-0.86 7-0.86 10.6 0 36.74 29.88 66.62 66.62 66.62s66.62-29.88 66.62-66.62c0-10.8-2.6-21-7.18-30.02l84.7-60.34c12.12 12.5 29.08 20.3 47.82 20.3 36.74 0 66.62-29.88 66.62-66.62 0-36.72-29.88-66.6-66.62-66.6zM127.1 402.92c-25.7 0-46.6-20.92-46.6-46.62 0-25.7 20.9-46.6 46.6-46.6 25.7 0 46.62 20.9 46.62 46.6 0 25.7-20.92 46.62-46.62 46.62z m192.94 99.44c-25.7 0-46.62-20.9-46.62-46.6 0-25.72 20.92-46.62 46.62-46.62 25.7 0 46.62 20.9 46.62 46.62 0 25.7-20.92 46.6-46.62 46.6zM512 308.5c-25.7 0-46.62-20.92-46.62-46.62s20.92-46.6 46.62-46.6 46.62 20.9 46.62 46.6-20.92 46.62-46.62 46.62z m191.96 61.64c-25.7 0-46.62-20.9-46.62-46.62 0-4.94 0.8-9.72 2.22-14.2l0.02-0.02v-0.02c6.04-18.76 23.64-32.36 44.38-32.36 25.7 0 46.62 20.9 46.62 46.6 0 25.72-20.92 46.62-46.62 46.62z m191.96-136.68c-25.7 0-46.62-20.9-46.62-46.62 0-25.7 20.92-46.6 46.62-46.6 25.7 0 46.62 20.9 46.62 46.6 0 25.72-20.92 46.62-46.62 46.62z",fill:"#23130D","p-id":"13581"}),(0,r.jsx)("path",{d:"M942.54 186.84c0 25.72-20.92 46.62-46.62 46.62-25.7 0-46.62-20.9-46.62-46.62 0-25.7 20.92-46.6 46.62-46.6 25.7 0 46.62 20.9 46.62 46.6z",fill:"#72AF5F","p-id":"13582"}),(0,r.jsx)("path",{d:"M750.58 323.52c0 25.72-20.92 46.62-46.62 46.62-25.7 0-46.62-20.9-46.62-46.62 0-4.94 0.8-9.72 2.22-14.2l0.02-0.02v-0.02c6.04-18.76 23.64-32.36 44.38-32.36 25.7 0 46.62 20.9 46.62 46.6z",fill:"#EC7063","p-id":"13583"}),(0,r.jsx)("path",{d:"M558.62 261.88c0 25.7-20.92 46.62-46.62 46.62s-46.62-20.92-46.62-46.62 20.92-46.6 46.62-46.6 46.62 20.9 46.62 46.6z",fill:"#72AF5F","p-id":"13584"}),(0,r.jsx)("path",{d:"M366.66 455.76c0 25.7-20.92 46.6-46.62 46.6-25.7 0-46.62-20.9-46.62-46.6 0-25.72 20.92-46.62 46.62-46.62 25.7 0 46.62 20.9 46.62 46.62z",fill:"#EC7063","p-id":"13585"}),(0,r.jsx)("path",{d:"M173.72 356.3c0 25.7-20.92 46.62-46.62 46.62-25.7 0-46.6-20.92-46.6-46.62 0-25.7 20.9-46.6 46.6-46.6 25.7 0 46.62 20.9 46.62 46.6z",fill:"#F9C139","p-id":"13586"}),(0,r.jsx)("path",{d:"M173.72 356.3c0 25.7-20.92 46.62-46.62 46.62a45.6 45.6 0 0 1-12-1.58c19.9-5.3 34.62-23.48 34.62-45.04s-14.72-39.74-34.62-45.04c3.82-1.02 7.84-1.56 12-1.56 25.7 0 46.62 20.9 46.62 46.6zM366.66 455.74c0 25.7-20.92 46.62-46.62 46.62a45.6 45.6 0 0 1-12-1.58c19.9-5.3 34.62-23.48 34.62-45.04s-14.72-39.74-34.62-45.04c3.82-1.02 7.84-1.56 12-1.56 25.7 0 46.62 20.9 46.62 46.6zM558.62 261.88c0 25.7-20.92 46.62-46.62 46.62a45.6 45.6 0 0 1-12-1.58c19.9-5.3 34.62-23.48 34.62-45.04s-14.72-39.74-34.62-45.04c3.82-1.02 7.84-1.56 12-1.56 25.7 0 46.62 20.9 46.62 46.6zM750.58 323.52c0 25.7-20.92 46.62-46.62 46.62a45.6 45.6 0 0 1-12-1.58c19.9-5.3 34.62-23.48 34.62-45.04s-14.72-39.74-34.62-45.04c3.82-1.02 7.84-1.56 12-1.56 25.7 0 46.62 20.9 46.62 46.6zM943.5 186.84c0 25.7-20.92 46.62-46.62 46.62a45.6 45.6 0 0 1-12-1.58c19.9-5.3 34.62-23.48 34.62-45.04s-14.72-39.74-34.62-45.04c3.82-1.02 7.84-1.56 12-1.56 25.7 0 46.62 20.9 46.62 46.6z",fill:"#1C1817",opacity:".2","p-id":"13587"}),(0,r.jsx)("path",{d:"M272.46 575.06h19.5v257.2h-19.5z",fill:"#FFFFFF",opacity:".4","p-id":"13588"}),(0,r.jsx)("path",{d:"M348.12 575.06h19.5v257.2h-19.5z",fill:"#1C1817",opacity:".2","p-id":"13589"}),(0,r.jsx)("path",{d:"M463.94 378.746h19.5V832.26h-19.5z",fill:"#FFFFFF",opacity:".4","p-id":"13590"}),(0,r.jsx)("path",{d:"M539.6 378.746h19.5V832.26h-19.5z",fill:"#1C1817",opacity:".2","p-id":"13591"}),(0,r.jsx)("path",{d:"M656.38 438.7h19.5v393.56h-19.5z",fill:"#FFFFFF",opacity:".4","p-id":"13592"}),(0,r.jsx)("path",{d:"M732.04 438.7h19.5v393.56h-19.5z",fill:"#1C1817",opacity:".2","p-id":"13593"}),(0,r.jsx)("path",{d:"M848.34 302.306h19.5V832.26h-19.5z",fill:"#FFFFFF",opacity:".4","p-id":"13594"}),(0,r.jsx)("path",{d:"M924 302.306h19.5V832.26H924z",fill:"#1C1817",opacity:".2","p-id":"13595"})]})},a=function(){return(0,r.jsx)("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4946",className:"w-full h-full",children:(0,r.jsx)("path",{d:"M512 128C323.413333 128 170.666667 204.373333 170.666667 298.666667s152.746667 170.666667 341.333333 170.666666 341.333333-76.373333 341.333333-170.666666-152.746667-170.666667-341.333333-170.666667M170.666667 384v128c0 94.293333 152.746667 170.666667 341.333333 170.666667s341.333333-76.373333 341.333333-170.666667V384c0 94.293333-152.746667 170.666667-341.333333 170.666667s-341.333333-76.373333-341.333333-170.666667m0 213.333333v128c0 94.293333 152.746667 170.666667 341.333333 170.666667s341.333333-76.373333 341.333333-170.666667v-128c0 94.293333-152.746667 170.666667-341.333333 170.666667s-341.333333-76.373333-341.333333-170.666667z",fill:"#FFCA28","p-id":"4947"})})},l=function(){return(0,r.jsxs)("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"27999",className:"w-full h-full",children:[(0,r.jsx)("path",{d:"M701.781333 199.68a22.869333 22.869333 0 0 1 22.698667 22.186667v349.696h45.738667l34.133333-392.533334a22.698667 22.698667 0 0 0-20.650667-24.576L315.221333 113.834667A22.869333 22.869333 0 0 0 290.133333 134.656l-5.632 65.024z",fill:"#FFC670","p-id":"28000"}),(0,r.jsx)("path",{d:"M313.002667 674.816A25.6 25.6 0 0 1 338.773333 648.533333h154.965334a51.2 51.2 0 0 0 32.085333-11.264l69.12-54.954666a51.2 51.2 0 0 1 32.085333-11.264h97.450667V221.866667a22.869333 22.869333 0 0 0-22.698667-22.869334H231.253333A22.869333 22.869333 0 0 0 208.554667 221.866667v638.805333a22.698667 22.698667 0 0 0 22.698666 22.698667h81.749334z",fill:"#FFF6E6","p-id":"28001"}),(0,r.jsx)("path",{d:"M724.48 571.562667v-94.890667a472.234667 472.234667 0 0 1-38.570667 94.890667zM313.002667 757.418667a514.56 514.56 0 0 1-104.448-15.36v119.466666a22.698667 22.698667 0 0 0 22.698666 22.698667h81.749334z",fill:"#FFEBCC","p-id":"28002"}),(0,r.jsx)("path",{d:"M594.944 582.826667l-69.12 54.954666a51.2 51.2 0 0 1-32.085333 11.264h-154.965334a25.6 25.6 0 0 0-25.770666 25.770667v209.578667a25.770667 25.770667 0 0 0 25.770666 25.770666h450.901334a25.941333 25.941333 0 0 0 25.770666-25.770666V597.333333a25.941333 25.941333 0 0 0-25.770666-25.770666h-162.645334a51.2 51.2 0 0 0-32.085333 11.264z",fill:"#96DDFF","p-id":"28003"}),(0,r.jsx)("path",{d:"M564.224 840.874667a971.776 971.776 0 0 1-251.221333-31.402667v74.922667a25.770667 25.770667 0 0 0 25.770666 25.770666h450.901334a25.941333 25.941333 0 0 0 25.770666-25.770666v-74.922667a971.776 971.776 0 0 1-251.221333 31.402667z",fill:"#69BAF9","p-id":"28004"}),(0,r.jsx)("path",{d:"M789.674667 554.496h-0.853334l32.768-373.418667A39.936 39.936 0 0 0 785.066667 137.898667l-468.48-40.96A40.106667 40.106667 0 0 0 273.066667 133.12l-4.266667 49.664h-37.546667A39.765333 39.765333 0 0 0 191.488 221.866667v638.805333a39.765333 39.765333 0 0 0 39.765333 39.765333h68.266667a43.178667 43.178667 0 0 0 39.765333 26.794667h450.389334a43.008 43.008 0 0 0 42.837333-42.837333V597.333333a43.008 43.008 0 0 0-42.837333-42.837333zM307.2 136.533333a5.632 5.632 0 0 1 6.144-5.12l468.650667 40.96a5.632 5.632 0 0 1 5.12 6.144l-32.597334 375.978667h-12.970666V221.866667a39.765333 39.765333 0 0 0-39.765334-39.765334H303.445333z m-11.605333 538.794667v190.976h-64.341334a5.632 5.632 0 0 1-5.632-5.632V221.866667a5.632 5.632 0 0 1 5.632-5.632h470.528a5.632 5.632 0 0 1 5.632 5.632v332.629333h-80.384a68.266667 68.266667 0 0 0-42.666666 15.018667l-69.12 54.954666a34.133333 34.133333 0 0 1-21.504 7.509334h-154.965334a42.837333 42.837333 0 0 0-42.837333 42.837333z m502.784 209.066667a8.704 8.704 0 0 1-8.704 8.704H338.773333a8.704 8.704 0 0 1-8.704-8.704V674.816a8.704 8.704 0 0 1 8.704-8.704h154.965334a68.266667 68.266667 0 0 0 42.837333-15.018667l68.266667-54.954666a35.328 35.328 0 0 1 21.504-7.509334h162.645333a8.704 8.704 0 0 1 8.704 8.704z",fill:"#3D3D63","p-id":"28005"}),(0,r.jsx)("path",{d:"M744.789333 823.808h-64.341333a17.066667 17.066667 0 0 0 0 34.133333h64.341333a17.066667 17.066667 0 0 0 0-34.133333zM421.546667 309.248H512a17.066667 17.066667 0 0 0 0-34.133333h-90.453333a17.066667 17.066667 0 0 0 0 34.133333zM324.266667 406.016h283.989333a17.066667 17.066667 0 0 0 0-34.133333H324.266667a17.066667 17.066667 0 0 0 0 34.133333zM625.322667 474.965333a17.066667 17.066667 0 0 0-17.066667-17.066666H324.266667a17.066667 17.066667 0 0 0 0 34.133333h283.989333a17.066667 17.066667 0 0 0 17.066667-17.066667z",fill:"#3D3D63","p-id":"28006"})]})},s=function(){return(0,r.jsxs)("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7028",className:"w-full h-full",children:[(0,r.jsx)("path",{d:"M163.560759 0.702493A152.675051 152.675051 0 0 0 11.822365 153.377544v632.243311a152.675051 152.675051 0 0 0 151.738394 151.738395h476.055797a152.675051 152.675051 0 0 0 152.675052-152.675052V314.950835A57.136062 57.136062 0 0 0 775.197622 274.674594L519.256163 17.093986a58.072719 58.072719 0 0 0-41.212898-17.093986z",fill:"#41CC8B","p-id":"7029"}),(0,r.jsx)("path",{d:"M775.197622 274.674594L519.256163 17.093986a57.604391 57.604391 0 0 0-29.738852-15.689001 5.854105 5.854105 0 0 0-6.790762 5.854105V131.834439a178.433112 178.433112 0 0 0 178.433113 178.433112H784.564189a5.854105 5.854105 0 0 0 5.854105-6.790762A55.965241 55.965241 0 0 0 775.197622 274.674594z",fill:"#05B25F","p-id":"7030"}),(0,r.jsx)("path",{d:"M667.482095 281.69952h114.03796a51.98445 51.98445 0 0 0-6.322433-7.024926L519.256163 17.093986l-7.727418-6.322433v114.506288A156.187514 156.187514 0 0 0 667.482095 281.69952z",fill:"#B0F9D7","p-id":"7031"}),(0,r.jsx)("path",{d:"M92.140681 419.856391h117.082095v28.333867H128.904459v39.807913h67.205123v28.802195H128.904459v46.832838h81.957466v28.802195H92.140681zM274.554585 523.825292L232.639195 462.005946h40.510405l14.284015 23.416419q6.322433 11.239881 12.644867 21.777269l5.151612-10.771553 6.322433-11.005716 11.942374-23.416419H363.068649l-41.91539 66.268465 44.72536 63.69266h-40.978733l-15.923165-23.416419L302.185959 555.671621l-7.024925-11.239881-7.024926 11.239881-6.088269 11.70821-13.347359 23.416419H229.829225zM400.534919 576.980563a65.565973 65.565973 0 0 1-19.903956-50.111137 64.629316 64.629316 0 0 1 21.777269-50.813629 76.57169 76.57169 0 0 1 51.047794-17.796478 66.50263 66.50263 0 0 1 41.681225 14.518179l-17.796478 22.011434a35.124628 35.124628 0 0 0-22.011434-8.664075 33.251315 33.251315 0 0 0-26.226389 11.239881 41.447062 41.447062 0 0 0-10.303224 29.504688 40.978733 40.978733 0 0 0 10.06906 28.802195 32.782987 32.782987 0 0 0 25.523896 11.005717 46.832838 46.832838 0 0 0 27.865539-11.005717l14.752344 23.416419a72.590899 72.590899 0 0 1-46.832838 15.689001 70.249257 70.249257 0 0 1-49.642808-17.796478zM535.88182 576.746398a63.926824 63.926824 0 0 1-20.840613-49.876972 67.439287 67.439287 0 0 1 20.372285-50.345301 65.565973 65.565973 0 0 1 46.832838-18.264806 57.838555 57.838555 0 0 1 44.72536 17.562314 65.331809 65.331809 0 0 1 14.986508 44.72536 51.047793 51.047793 0 0 1-1.873313 15.454836h-88.514064a35.827121 35.827121 0 0 0 13.113195 23.416419 40.276241 40.276241 0 0 0 26.460553 8.429911 62.990167 62.990167 0 0 0 32.080494-9.132403l12.87903 21.074777a93.665676 93.665676 0 0 1-50.111136 14.284015 71.420078 71.420078 0 0 1-50.111137-17.32815z m73.527556-63.224331c0-19.201464-9.132403-28.802195-27.163046-28.802195a29.504688 29.504688 0 0 0-20.138121 7.25909 33.719643 33.719643 0 0 0-11.005716 21.543105zM672.399543 555.671621v-149.396752h37.232106V555.671621a10.771553 10.771553 0 0 0 2.575806 7.961583 6.322433 6.322433 0 0 0 5.151612 2.341642h5.151612l4.44912 25.289732a53.857764 53.857764 0 0 1-19.435628 3.044135c-23.416419 0.468328-35.124628-12.644866-35.124628-38.637092z",fill:"#F5F6FA","p-id":"7032"})]})},c=function(){return(0,r.jsxs)("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"34873",className:"w-full h-full",children:[(0,r.jsx)("path",{d:"M392.32 403.84a48 48 0 0 1-48 48h-96a48 48 0 0 1-48-48V236.16h192z",fill:"#EA5E5A","p-id":"34874"}),(0,r.jsx)("path",{d:"M259.84 176h24.32v24.32h-24.32zM307.84 176h24.32v24.32h-24.32z",fill:"#34303D","p-id":"34875"}),(0,r.jsx)("path",{d:"M380.16 236.16h-24.32V152.32H236.16v83.84h-24.32V128h168.32v108.16z",fill:"#34303D","p-id":"34876"}),(0,r.jsx)("path",{d:"M344.32 464h-96a60.16 60.16 0 0 1-60.16-60.16V224h215.68v179.84a60.16 60.16 0 0 1-60.16 60.16zM211.84 248.32v155.52a35.84 35.84 0 0 0 35.84 35.84h96a35.84 35.84 0 0 0 35.84-35.84V248.32z",fill:"#34303D","p-id":"34877"}),(0,r.jsx)("path",{d:"M236.16 272h120.32v24.32H236.16zM236.16 320h120.32v24.32H236.16zM320 512h-48a24.32 24.32 0 0 1-23.68-23.68v-36.48h24.32v35.84H320v-35.84h24.32v35.84A24.32 24.32 0 0 1 320 512z",fill:"#34303D","p-id":"34878"}),(0,r.jsx)("path",{d:"M632.32 620.16a48 48 0 0 1 48-48h96a48 48 0 0 1 48 48v168.32h-192z",fill:"#EA5E5A","p-id":"34879"}),(0,r.jsx)("path",{d:"M739.84 824.32h24.32v24.32h-24.32zM691.84 824.32h24.32v24.32h-24.32z",fill:"#34303D","p-id":"34880"}),(0,r.jsx)("path",{d:"M812.16 896h-168.32v-108.16h24.32v84.48h119.68v-84.48h24.32V896z",fill:"#34303D","p-id":"34881"}),(0,r.jsx)("path",{d:"M835.84 800H620.16V620.16a60.16 60.16 0 0 1 60.16-60.16h96a60.16 60.16 0 0 1 60.16 60.16z m-192-23.68h168.32V620.16a35.84 35.84 0 0 0-35.84-35.84h-96a35.84 35.84 0 0 0-35.84 35.84z",fill:"#34303D","p-id":"34882"}),(0,r.jsx)("path",{d:"M668.16 680.32h120.32v24.32h-120.32zM668.16 728.32h120.32v24.32h-120.32zM776.32 572.16h-23.68v-35.84H704v35.84h-23.68v-35.84A24.32 24.32 0 0 1 704 512h48a24.32 24.32 0 0 1 24.32 24.32z",fill:"#34303D","p-id":"34883"}),(0,r.jsx)("path",{d:"M403.84 848a120.32 120.32 0 0 1-119.68-119.68V499.84h24.32v227.84a96 96 0 0 0 192 0V296.32a120.32 120.32 0 0 1 240 0v227.84h-23.68V296.32a96 96 0 0 0-192 0v432a120.32 120.32 0 0 1-119.68 120.32z",fill:"#34303D","p-id":"34884"}),(0,r.jsx)("path",{d:"M608 284.16h24.32v24.32H608zM608 332.16h24.32v24.32H608zM608 380.16h24.32v24.32H608zM392.32 620.16h24.32v24.32h-24.32zM392.32 668.16h24.32v24.32h-24.32zM392.32 716.16h24.32v24.32h-24.32z",fill:"#34303D","p-id":"34885"}),(0,r.jsx)("path",{d:"M691.84 296.32h-23.68a48 48 0 0 0-96 0h-24.32a72.32 72.32 0 0 1 144 0zM403.84 800a72.32 72.32 0 0 1-71.68-71.68h24.32a48 48 0 0 0 96 0h24.32a72.32 72.32 0 0 1-72.96 71.68z",fill:"#34303D","p-id":"34886"})]})},u=function(){return(0,r.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",children:(0,r.jsx)("path",{d:"M593.054 120.217C483.656 148.739 402.91 248.212 402.91 366.546c0 140.582 113.962 254.544 254.544 254.544 118.334 0 217.808-80.746 246.328-190.144C909.17 457.12 912 484.23 912 512c0 220.914-179.086 400-400 400S112 732.914 112 512s179.086-400 400-400c27.77 0 54.88 2.83 81.054 8.217z","p-id":"5941"})})},f=function(){return(0,r.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",version:"1.1",children:(0,r.jsx)("path",{d:"M513.89 950.72c-5.5 0-11-1.4-15.99-4.2L143.84 743c-9.85-5.73-15.99-16.17-15.99-27.64V308.58c0-11.33 6.14-21.91 15.99-27.64L497.9 77.43c9.85-5.73 22.14-5.73 31.99 0l354.06 203.52c9.85 5.73 15.99 16.17 15.99 27.64V715.5c0 11.33-6.14 21.91-15.99 27.64L529.89 946.52c-4.99 2.8-10.49 4.2-16 4.2zM191.83 697.15L513.89 882.2l322.07-185.05V326.92L513.89 141.87 191.83 326.92v370.23z m322.06-153.34c-5.37 0-10.88-1.4-15.99-4.33L244.29 393.91c-15.35-8.79-20.6-28.27-11.77-43.56 8.83-15.28 28.41-20.5 43.76-11.72l253.61 145.7c15.35 8.79 20.6 28.27 11.77 43.56-6.01 10.32-16.76 15.92-27.77 15.92z m0 291.52c-17.66 0-31.99-14.26-31.99-31.84V530.44L244.55 393.91s-0.13 0-0.13-0.13l-100.45-57.69c-15.35-8.79-20.6-28.27-11.77-43.56s28.41-20.5 43.76-11.72l354.06 203.52c9.85 5.73 15.99 16.17 15.99 27.64v291.39c-0.13 17.71-14.46 31.97-32.12 31.97z m0 115.39c-17.66 0-31.99-14.26-31.99-31.84V511.97c0-17.58 14.33-31.84 31.99-31.84s31.99 14.26 31.99 31.84v406.91c0 17.7-14.33 31.84-31.99 31.84z m0-406.91c-11 0-21.75-5.73-27.77-15.92-8.83-15.28-3.58-34.64 11.77-43.56l354.06-203.52c15.35-8.79 34.8-3.57 43.76 11.72 8.83 15.28 3.58 34.64-11.77 43.56L529.89 539.61c-4.99 2.93-10.49 4.2-16 4.2z"})})},d=function(){return(0,r.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",version:"1.1",children:(0,r.jsx)("path",{d:"M602.24 246.72a17.28 17.28 0 0 0-11.84-16.32l-42.88-14.4A90.56 90.56 0 0 1 490.24 160l-14.4-42.88a17.28 17.28 0 0 0-32 0L428.8 160a90.56 90.56 0 0 1-57.28 57.28l-42.88 14.4a17.28 17.28 0 0 0 0 32l42.88 14.4a90.56 90.56 0 0 1 57.28 57.28l14.4 42.88a17.28 17.28 0 0 0 32 0l14.4-42.88a90.56 90.56 0 0 1 57.28-57.28l42.88-14.4a17.28 17.28 0 0 0 12.48-16.96z m301.12 221.76l-48.32-16a101.44 101.44 0 0 1-64-64l-16-48.32a19.2 19.2 0 0 0-36.8 0l-16 48.32a101.44 101.44 0 0 1-64 64l-48.32 16a19.2 19.2 0 0 0 0 36.8l48.32 16a101.44 101.44 0 0 1 64 64l16 48.32a19.2 19.2 0 0 0 36.8 0l16-48.32a101.44 101.44 0 0 1 64-64l48.32-16a19.2 19.2 0 0 0 0-36.8z m-376.64 195.52l-64-20.8a131.84 131.84 0 0 1-83.52-83.52l-20.8-64a25.28 25.28 0 0 0-47.68 0l-20.8 64a131.84 131.84 0 0 1-82.24 83.52l-64 20.8a25.28 25.28 0 0 0 0 47.68l64 20.8a131.84 131.84 0 0 1 83.52 83.84l20.8 64a25.28 25.28 0 0 0 47.68 0l20.8-64a131.84 131.84 0 0 1 83.52-83.52l64-20.8a25.28 25.28 0 0 0 0-47.68z","p-id":"3992"})})},p=function(){return(0,r.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",children:(0,r.jsx)("path",{d:"M554.6 64h-85.4v128h85.4V64z m258.2 87.4L736 228.2l59.8 59.8 76.8-76.8-59.8-59.8z m-601.6 0l-59.8 59.8 76.8 76.8 59.8-59.8-76.8-76.8zM512 256c-140.8 0-256 115.2-256 256s115.2 256 256 256 256-115.2 256-256-115.2-256-256-256z m448 213.4h-128v85.4h128v-85.4z m-768 0H64v85.4h128v-85.4zM795.8 736L736 795.8l76.8 76.8 59.8-59.8-76.8-76.8z m-567.6 0l-76.8 76.8 59.8 59.8 76.8-76.8-59.8-59.8z m326.4 96h-85.4v128h85.4v-128z","p-id":"7802"})})};function h(){return(0,r.jsxs)("svg",{className:"mr-1",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4602",width:"1.5em",height:"1.5em",children:[(0,r.jsx)("path",{d:"M688 312v-48c0-4.4-3.6-8-8-8H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8zM296 400c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H296zM672 516c-119.3 0-216 96.7-216 216s96.7 216 216 216 216-96.7 216-216-96.7-216-216-216z m107.5 323.5C750.8 868.2 712.6 884 672 884s-78.8-15.8-107.5-44.5C535.8 810.8 520 772.6 520 732s15.8-78.8 44.5-107.5C593.2 595.8 631.4 580 672 580s78.8 15.8 107.5 44.5C808.2 653.2 824 691.4 824 732s-15.8 78.8-44.5 107.5z","p-id":"4603",fill:"#87d068"}),(0,r.jsx)("path",{d:"M761 656h-44.3c-2.6 0-5 1.2-6.5 3.3l-63.5 87.8-23.1-31.9c-1.5-2.1-3.9-3.3-6.5-3.3H573c-6.5 0-10.3 7.4-6.5 12.7l73.8 102.1c3.2 4.4 9.7 4.4 12.9 0l114.2-158c3.9-5.3 0.1-12.7-6.4-12.7z","p-id":"4604",fill:"#87d068"}),(0,r.jsx)("path",{d:"M440 852H208V148h560v344c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h272c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z","p-id":"4605",fill:"#87d068"})]})}function m(){return(0,r.jsxs)("svg",{className:"mr-1",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4838",width:"1.5em",height:"1.5em",children:[(0,r.jsx)("path",{d:"M296 256c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H296zM488 456v-48c0-4.4-3.6-8-8-8H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8z","p-id":"4839",fill:"#2db7f5"}),(0,r.jsx)("path",{d:"M440 852H208V148h560v344c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h272c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z","p-id":"4840",fill:"#2db7f5"}),(0,r.jsx)("path",{d:"M544.1 736.4c1.8-34.5 16.2-66.8 40.8-91.4 26.2-26.2 62-41 99.1-41 37.4 0 72.6 14.6 99.1 41 3.2 3.2 6.3 6.6 9.2 10.1L769.2 673c-5.3 4.1-3.5 12.5 3 14.1l93.3 22.5c5 1.2 9.8-2.6 9.9-7.7l0.6-95.4c0-6.7-7.6-10.5-12.9-6.4l-20.3 15.8C805.4 569.6 748.1 540 684 540c-109.9 0-199.6 86.9-204 195.7-0.2 4.5 3.5 8.3 8 8.3h48.1c4.3 0 7.8-3.3 8-7.6zM880 744h-48.1c-4.3 0-7.8 3.3-8 7.6-1.8 34.5-16.2 66.8-40.8 91.4-26.2 26.2-62 41-99.1 41-37.4 0-72.6-14.6-99.1-41-3.2-3.2-6.3-6.6-9.2-10.1l23.1-17.9c5.3-4.1 3.5-12.5-3-14.1l-93.3-22.5c-5-1.2-9.8 2.6-9.9 7.7l-0.6 95.4c0 6.7 7.6 10.5 12.9 6.4l20.3-15.8C562.6 918.4 619.9 948 684 948c109.9 0 199.6-86.9 204-195.7 0.2-4.5-3.5-8.3-8-8.3z","p-id":"4841",fill:"#2db7f5"})]})}n(67294)},32665:function(e,t,n){"use strict";function r(e){}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"clientHookInServerComponentError",{enumerable:!0,get:function(){return r}}),n(38754),n(67294),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},41219:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ReadonlyURLSearchParams:function(){return p},useSearchParams:function(){return h},usePathname:function(){return m},ServerInsertedHTMLContext:function(){return s.ServerInsertedHTMLContext},useServerInsertedHTML:function(){return s.useServerInsertedHTML},useRouter:function(){return g},useParams:function(){return v},useSelectedLayoutSegments:function(){return y},useSelectedLayoutSegment:function(){return b},redirect:function(){return c.redirect},notFound:function(){return u.notFound}});let r=n(67294),o=n(27473),i=n(35802),a=n(32665),l=n(43512),s=n(98751),c=n(96885),u=n(86323),f=Symbol("internal for urlsearchparams readonly");function d(){return Error("ReadonlyURLSearchParams cannot be modified")}class p{[Symbol.iterator](){return this[f][Symbol.iterator]()}append(){throw d()}delete(){throw d()}set(){throw d()}sort(){throw d()}constructor(e){this[f]=e,this.entries=e.entries.bind(e),this.forEach=e.forEach.bind(e),this.get=e.get.bind(e),this.getAll=e.getAll.bind(e),this.has=e.has.bind(e),this.keys=e.keys.bind(e),this.values=e.values.bind(e),this.toString=e.toString.bind(e)}}function h(){(0,a.clientHookInServerComponentError)("useSearchParams");let e=(0,r.useContext)(i.SearchParamsContext),t=(0,r.useMemo)(()=>e?new p(e):null,[e]);return t}function m(){return(0,a.clientHookInServerComponentError)("usePathname"),(0,r.useContext)(i.PathnameContext)}function g(){(0,a.clientHookInServerComponentError)("useRouter");let e=(0,r.useContext)(o.AppRouterContext);if(null===e)throw Error("invariant expected app router to be mounted");return e}function v(){(0,a.clientHookInServerComponentError)("useParams");let e=(0,r.useContext)(o.GlobalLayoutRouterContext);return e?function e(t,n){void 0===n&&(n={});let r=t[1];for(let t of Object.values(r)){let r=t[0],o=Array.isArray(r),i=o?r[1]:r;!i||i.startsWith("__PAGE__")||(o&&(n[r[0]]=r[1]),n=e(t,n))}return n}(e.tree):null}function y(e){void 0===e&&(e="children"),(0,a.clientHookInServerComponentError)("useSelectedLayoutSegments");let{tree:t}=(0,r.useContext)(o.LayoutRouterContext);return function e(t,n,r,o){let i;if(void 0===r&&(r=!0),void 0===o&&(o=[]),r)i=t[1][n];else{var a;let e=t[1];i=null!=(a=e.children)?a:Object.values(e)[0]}if(!i)return o;let s=i[0],c=(0,l.getSegmentValue)(s);return!c||c.startsWith("__PAGE__")?o:(o.push(c),e(i,n,!1,o))}(t,e)}function b(e){void 0===e&&(e="children"),(0,a.clientHookInServerComponentError)("useSelectedLayoutSegment");let t=y(e);return 0===t.length?null:t[0]}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},86323:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{notFound:function(){return r},isNotFoundError:function(){return o}});let n="NEXT_NOT_FOUND";function r(){let e=Error(n);throw e.digest=n,e}function o(e){return(null==e?void 0:e.digest)===n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},96885:function(e,t,n){"use strict";var r,o;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{RedirectType:function(){return r},getRedirectError:function(){return l},redirect:function(){return s},isRedirectError:function(){return c},getURLFromRedirectError:function(){return u},getRedirectTypeFromError:function(){return f}});let i=n(68214),a="NEXT_REDIRECT";function l(e,t){let n=Error(a);n.digest=a+";"+t+";"+e;let r=i.requestAsyncStorage.getStore();return r&&(n.mutableCookies=r.mutableCookies),n}function s(e,t){throw void 0===t&&(t="replace"),l(e,t)}function c(e){if("string"!=typeof(null==e?void 0:e.digest))return!1;let[t,n,r]=e.digest.split(";",3);return t===a&&("replace"===n||"push"===n)&&"string"==typeof r}function u(e){return c(e)?e.digest.split(";",3)[2]:null}function f(e){if(!c(e))throw Error("Not a redirect error");return e.digest.split(";",3)[1]}(o=r||(r={})).push="push",o.replace="replace",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},43512:function(e,t){"use strict";function n(e){return Array.isArray(e)?e[1]:e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSegmentValue",{enumerable:!0,get:function(){return n}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},29382:function(e,t){"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{PrefetchKind:function(){return n},ACTION_REFRESH:function(){return o},ACTION_NAVIGATE:function(){return i},ACTION_RESTORE:function(){return a},ACTION_SERVER_PATCH:function(){return l},ACTION_PREFETCH:function(){return s},ACTION_FAST_REFRESH:function(){return c},ACTION_SERVER_ACTION:function(){return u}});let o="refresh",i="navigate",a="restore",l="server-patch",s="prefetch",c="fast-refresh",u="server-action";(r=n||(n={})).AUTO="auto",r.FULL="full",r.TEMPORARY="temporary",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},75476:function(e,t){"use strict";function n(e,t,n,r){return!1}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getDomainLocale",{enumerable:!0,get:function(){return n}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},69873:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return y}});let r=n(38754),o=n(61757),i=o._(n(67294)),a=r._(n(68965)),l=n(38083),s=n(2478),c=n(76226);n(59941);let u=r._(n(31720)),f={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image/",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0};function d(e){return void 0!==e.default}function p(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function h(e,t,n,r,o,i,a){if(!e||e["data-loaded-src"]===t)return;e["data-loaded-src"]=t;let l="decode"in e?e.decode():Promise.resolve();l.catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("blur"===n&&i(!0),null==r?void 0:r.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let n=!1,o=!1;r.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>n,isPropagationStopped:()=>o,persist:()=>{},preventDefault:()=>{n=!0,t.preventDefault()},stopPropagation:()=>{o=!0,t.stopPropagation()}})}(null==o?void 0:o.current)&&o.current(e)}})}function m(e){let[t,n]=i.version.split("."),r=parseInt(t,10),o=parseInt(n,10);return r>18||18===r&&o>=3?{fetchPriority:e}:{fetchpriority:e}}let g=(0,i.forwardRef)((e,t)=>{let{imgAttributes:n,heightInt:r,widthInt:o,qualityInt:a,className:l,imgStyle:s,blurStyle:c,isLazy:u,fetchPriority:f,fill:d,placeholder:p,loading:g,srcString:v,config:y,unoptimized:b,loader:x,onLoadRef:w,onLoadingCompleteRef:C,setBlurComplete:S,setShowAltText:E,onLoad:$,onError:O,...k}=e;return g=u?"lazy":g,i.default.createElement("img",{...k,...m(f),loading:g,width:o,height:r,decoding:"async","data-nimg":d?"fill":"1",className:l,style:{...s,...c},...n,ref:(0,i.useCallback)(e=>{t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e)),e&&(O&&(e.src=e.src),e.complete&&h(e,v,p,w,C,S,b))},[v,p,w,C,S,O,b,t]),onLoad:e=>{let t=e.currentTarget;h(t,v,p,w,C,S,b)},onError:e=>{E(!0),"blur"===p&&S(!0),O&&O(e)}})}),v=(0,i.forwardRef)((e,t)=>{var n;let r,o,{src:h,sizes:v,unoptimized:y=!1,priority:b=!1,loading:x,className:w,quality:C,width:S,height:E,fill:$,style:O,onLoad:k,onLoadingComplete:j,placeholder:P="empty",blurDataURL:Z,fetchPriority:_,layout:A,objectFit:R,objectPosition:M,lazyBoundary:N,lazyRoot:T,...F}=e,I=(0,i.useContext)(c.ImageConfigContext),L=(0,i.useMemo)(()=>{let e=f||I||s.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),n=e.deviceSizes.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:n}},[I]),B=F.loader||u.default;delete F.loader;let z="__next_img_default"in B;if(z){if("custom"===L.loader)throw Error('Image with src "'+h+'" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader')}else{let e=B;B=t=>{let{config:n,...r}=t;return e(r)}}if(A){"fill"===A&&($=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[A];e&&(O={...O,...e});let t={responsive:"100vw",fill:"100vw"}[A];t&&!v&&(v=t)}let D="",H=p(S),V=p(E);if("object"==typeof(n=h)&&(d(n)||void 0!==n.src)){let e=d(h)?h.default:h;if(!e.src)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(e));if(!e.height||!e.width)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(e));if(r=e.blurWidth,o=e.blurHeight,Z=Z||e.blurDataURL,D=e.src,!$){if(H||V){if(H&&!V){let t=H/e.width;V=Math.round(e.height*t)}else if(!H&&V){let t=V/e.height;H=Math.round(e.width*t)}}else H=e.width,V=e.height}}let U=!b&&("lazy"===x||void 0===x);(!(h="string"==typeof h?h:D)||h.startsWith("data:")||h.startsWith("blob:"))&&(y=!0,U=!1),L.unoptimized&&(y=!0),z&&h.endsWith(".svg")&&!L.dangerouslyAllowSVG&&(y=!0),b&&(_="high");let[W,q]=(0,i.useState)(!1),[K,G]=(0,i.useState)(!1),X=p(C),Y=Object.assign($?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:R,objectPosition:M}:{},K?{}:{color:"transparent"},O),J="blur"===P&&Z&&!W?{backgroundSize:Y.objectFit||"cover",backgroundPosition:Y.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:'url("data:image/svg+xml;charset=utf-8,'+(0,l.getImageBlurSvg)({widthInt:H,heightInt:V,blurWidth:r,blurHeight:o,blurDataURL:Z,objectFit:Y.objectFit})+'")'}:{},Q=function(e){let{config:t,src:n,unoptimized:r,width:o,quality:i,sizes:a,loader:l}=e;if(r)return{src:n,srcSet:void 0,sizes:void 0};let{widths:s,kind:c}=function(e,t,n){let{deviceSizes:r,allSizes:o}=e;if(n){let e=/(^|\s)(1?\d?\d)vw/g,t=[];for(let r;r=e.exec(n);r)t.push(parseInt(r[2]));if(t.length){let e=.01*Math.min(...t);return{widths:o.filter(t=>t>=r[0]*e),kind:"w"}}return{widths:o,kind:"w"}}if("number"!=typeof t)return{widths:r,kind:"w"};let i=[...new Set([t,2*t].map(e=>o.find(t=>t>=e)||o[o.length-1]))];return{widths:i,kind:"x"}}(t,o,a),u=s.length-1;return{sizes:a||"w"!==c?a:"100vw",srcSet:s.map((e,r)=>l({config:t,src:n,quality:i,width:e})+" "+("w"===c?e:r+1)+c).join(", "),src:l({config:t,src:n,quality:i,width:s[u]})}}({config:L,src:h,unoptimized:y,width:H,quality:X,sizes:v,loader:B}),ee=h,et=(0,i.useRef)(k);(0,i.useEffect)(()=>{et.current=k},[k]);let en=(0,i.useRef)(j);(0,i.useEffect)(()=>{en.current=j},[j]);let er={isLazy:U,imgAttributes:Q,heightInt:V,widthInt:H,qualityInt:X,className:w,imgStyle:Y,blurStyle:J,loading:x,config:L,fetchPriority:_,fill:$,unoptimized:y,placeholder:P,loader:B,srcString:ee,onLoadRef:et,onLoadingCompleteRef:en,setBlurComplete:q,setShowAltText:G,...F};return i.default.createElement(i.default.Fragment,null,i.default.createElement(g,{...er,ref:t}),b?i.default.createElement(a.default,null,i.default.createElement("link",{key:"__nimg-"+Q.src+Q.srcSet+Q.sizes,rel:"preload",as:"image",href:Q.srcSet?void 0:Q.src,imageSrcSet:Q.srcSet,imageSizes:Q.sizes,crossOrigin:F.crossOrigin,referrerPolicy:F.referrerPolicy,...m(_)})):null)}),y=v;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9940:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return x}});let r=n(38754),o=r._(n(67294)),i=n(65722),a=n(65723),l=n(28904),s=n(95514),c=n(27521),u=n(44293),f=n(27473),d=n(81307),p=n(75476),h=n(66318),m=n(29382),g=new Set;function v(e,t,n,r,o,i){if(!i&&!(0,a.isLocalURL)(t))return;if(!r.bypassPrefetchedCheck){let o=void 0!==r.locale?r.locale:"locale"in e?e.locale:void 0,i=t+"%"+n+"%"+o;if(g.has(i))return;g.add(i)}let l=i?e.prefetch(t,o):e.prefetch(t,n,r);Promise.resolve(l).catch(e=>{})}function y(e){return"string"==typeof e?e:(0,l.formatUrl)(e)}let b=o.default.forwardRef(function(e,t){let n,r;let{href:l,as:g,children:b,prefetch:x=null,passHref:w,replace:C,shallow:S,scroll:E,locale:$,onClick:O,onMouseEnter:k,onTouchStart:j,legacyBehavior:P=!1,...Z}=e;n=b,P&&("string"==typeof n||"number"==typeof n)&&(n=o.default.createElement("a",null,n));let _=!1!==x,A=null===x?m.PrefetchKind.AUTO:m.PrefetchKind.FULL,R=o.default.useContext(u.RouterContext),M=o.default.useContext(f.AppRouterContext),N=null!=R?R:M,T=!R,{href:F,as:I}=o.default.useMemo(()=>{if(!R){let e=y(l);return{href:e,as:g?y(g):e}}let[e,t]=(0,i.resolveHref)(R,l,!0);return{href:e,as:g?(0,i.resolveHref)(R,g):t||e}},[R,l,g]),L=o.default.useRef(F),B=o.default.useRef(I);P&&(r=o.default.Children.only(n));let z=P?r&&"object"==typeof r&&r.ref:t,[D,H,V]=(0,d.useIntersection)({rootMargin:"200px"}),U=o.default.useCallback(e=>{(B.current!==I||L.current!==F)&&(V(),B.current=I,L.current=F),D(e),z&&("function"==typeof z?z(e):"object"==typeof z&&(z.current=e))},[I,z,F,V,D]);o.default.useEffect(()=>{N&&H&&_&&v(N,F,I,{locale:$},{kind:A},T)},[I,F,H,$,_,null==R?void 0:R.locale,N,T,A]);let W={ref:U,onClick(e){P||"function"!=typeof O||O(e),P&&r.props&&"function"==typeof r.props.onClick&&r.props.onClick(e),N&&!e.defaultPrevented&&function(e,t,n,r,i,l,s,c,u,f){let{nodeName:d}=e.currentTarget,p="A"===d.toUpperCase();if(p&&(function(e){let t=e.currentTarget,n=t.getAttribute("target");return n&&"_self"!==n||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||!u&&!(0,a.isLocalURL)(n)))return;e.preventDefault();let h=()=>{"beforePopState"in t?t[i?"replace":"push"](n,r,{shallow:l,locale:c,scroll:s}):t[i?"replace":"push"](r||n,{forceOptimisticNavigation:!f})};u?o.default.startTransition(h):h()}(e,N,F,I,C,S,E,$,T,_)},onMouseEnter(e){P||"function"!=typeof k||k(e),P&&r.props&&"function"==typeof r.props.onMouseEnter&&r.props.onMouseEnter(e),N&&(_||!T)&&v(N,F,I,{locale:$,priority:!0,bypassPrefetchedCheck:!0},{kind:A},T)},onTouchStart(e){P||"function"!=typeof j||j(e),P&&r.props&&"function"==typeof r.props.onTouchStart&&r.props.onTouchStart(e),N&&(_||!T)&&v(N,F,I,{locale:$,priority:!0,bypassPrefetchedCheck:!0},{kind:A},T)}};if((0,s.isAbsoluteUrl)(I))W.href=I;else if(!P||w||"a"===r.type&&!("href"in r.props)){let e=void 0!==$?$:null==R?void 0:R.locale,t=(null==R?void 0:R.isLocaleDomain)&&(0,p.getDomainLocale)(I,e,null==R?void 0:R.locales,null==R?void 0:R.domainLocales);W.href=t||(0,h.addBasePath)((0,c.addLocale)(I,e,null==R?void 0:R.defaultLocale))}return P?o.default.cloneElement(r,W):o.default.createElement("a",{...Z,...W},n)}),x=b;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81307:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useIntersection",{enumerable:!0,get:function(){return s}});let r=n(67294),o=n(82997),i="function"==typeof IntersectionObserver,a=new Map,l=[];function s(e){let{rootRef:t,rootMargin:n,disabled:s}=e,c=s||!i,[u,f]=(0,r.useState)(!1),d=(0,r.useRef)(null),p=(0,r.useCallback)(e=>{d.current=e},[]);(0,r.useEffect)(()=>{if(i){if(c||u)return;let e=d.current;if(e&&e.tagName){let r=function(e,t,n){let{id:r,observer:o,elements:i}=function(e){let t;let n={root:e.root||null,margin:e.rootMargin||""},r=l.find(e=>e.root===n.root&&e.margin===n.margin);if(r&&(t=a.get(r)))return t;let o=new Map,i=new IntersectionObserver(e=>{e.forEach(e=>{let t=o.get(e.target),n=e.isIntersecting||e.intersectionRatio>0;t&&n&&t(n)})},e);return t={id:n,observer:i,elements:o},l.push(n),a.set(n,t),t}(n);return i.set(e,t),o.observe(e),function(){if(i.delete(e),o.unobserve(e),0===i.size){o.disconnect(),a.delete(r);let e=l.findIndex(e=>e.root===r.root&&e.margin===r.margin);e>-1&&l.splice(e,1)}}}(e,e=>e&&f(e),{root:null==t?void 0:t.current,rootMargin:n});return r}}else if(!u){let e=(0,o.requestIdleCallback)(()=>f(!0));return()=>(0,o.cancelIdleCallback)(e)}},[c,n,t,u,d.current]);let h=(0,r.useCallback)(()=>{f(!1)},[]);return[p,u,h]}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},38083:function(e,t){"use strict";function n(e){let{widthInt:t,heightInt:n,blurWidth:r,blurHeight:o,blurDataURL:i,objectFit:a}=e,l=r||t,s=o||n,c=i.startsWith("data:image/jpeg")?"%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='1 1'/%3E%3C/feComponentTransfer%3E%":"";return l&&s?"%3Csvg xmlns='http%3A//www.w3.org/2000/svg' viewBox='0 0 "+l+" "+s+"'%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='"+(r&&o?"1":"20")+"'/%3E"+c+"%3C/filter%3E%3Cimage preserveAspectRatio='none' filter='url(%23b)' x='0' y='0' height='100%25' width='100%25' href='"+i+"'/%3E%3C/svg%3E":"%3Csvg xmlns='http%3A//www.w3.org/2000/svg'%3E%3Cimage style='filter:blur(20px)' preserveAspectRatio='"+("contain"===a?"xMidYMid":"cover"===a?"xMidYMid slice":"none")+"' x='0' y='0' height='100%25' width='100%25' href='"+i+"'/%3E%3C/svg%3E"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return n}})},31720:function(e,t){"use strict";function n(e){let{config:t,src:n,width:r,quality:o}=e;return t.path+"?url="+encodeURIComponent(n)+"&w="+r+"&q="+(o||75)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}}),n.__next_img_default=!0;let r=n},98751:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ServerInsertedHTMLContext:function(){return i},useServerInsertedHTML:function(){return a}});let r=n(61757),o=r._(n(67294)),i=o.default.createContext(null);function a(e){let t=(0,o.useContext)(i);t&&t(e)}},48271:function(e,t,n){"use strict";let r,o;n.r(t),n.d(t,{default:function(){return eT}});var i=n(85893),a=n(67294),l=n(41468),s=n(50489),c=n(98399),u=n(82579),f=n(59766),d=n(87462),p=n(63366),h=n(71387),m=n(70917);function g(e){let{styles:t,defaultTheme:n={}}=e,r="function"==typeof t?e=>t(null==e||0===Object.keys(e).length?n:e):t;return(0,i.jsx)(m.xB,{styles:r})}var v=n(56760),y=n(71927);let b="mode",x="color-scheme",w="data-color-scheme";function C(e){if("undefined"!=typeof window&&"system"===e){let e=window.matchMedia("(prefers-color-scheme: dark)");return e.matches?"dark":"light"}}function S(e,t){return"light"===e.mode||"system"===e.mode&&"light"===e.systemMode?t("light"):"dark"===e.mode||"system"===e.mode&&"dark"===e.systemMode?t("dark"):void 0}function E(e,t){let n;if("undefined"!=typeof window){try{(n=localStorage.getItem(e)||void 0)||localStorage.setItem(e,t)}catch(e){}return n||t}}let $=["colorSchemes","components","generateCssVars","cssVarPrefix"];var O=n(1812),k=n(13951),j=n(2548);let{CssVarsProvider:P,useColorScheme:Z,getInitColorSchemeScript:_}=function(e){let{themeId:t,theme:n={},attribute:r=w,modeStorageKey:o=b,colorSchemeStorageKey:l=x,defaultMode:s="light",defaultColorScheme:c,disableTransitionOnChange:u=!1,resolveTheme:m,excludeVariablesFromRoot:O}=e;n.colorSchemes&&("string"!=typeof c||n.colorSchemes[c])&&("object"!=typeof c||n.colorSchemes[null==c?void 0:c.light])&&("object"!=typeof c||n.colorSchemes[null==c?void 0:c.dark])||console.error(`MUI: \`${c}\` does not exist in \`theme.colorSchemes\`.`);let k=a.createContext(void 0),j="string"==typeof c?c:c.light,P="string"==typeof c?c:c.dark;return{CssVarsProvider:function({children:e,theme:h=n,modeStorageKey:w=o,colorSchemeStorageKey:j=l,attribute:P=r,defaultMode:Z=s,defaultColorScheme:_=c,disableTransitionOnChange:A=u,storageWindow:R="undefined"==typeof window?void 0:window,documentNode:M="undefined"==typeof document?void 0:document,colorSchemeNode:N="undefined"==typeof document?void 0:document.documentElement,colorSchemeSelector:T=":root",disableNestedContext:F=!1,disableStyleSheetGeneration:I=!1}){let L=a.useRef(!1),B=(0,v.Z)(),z=a.useContext(k),D=!!z&&!F,H=h[t],V=H||h,{colorSchemes:U={},components:W={},generateCssVars:q=()=>({vars:{},css:{}}),cssVarPrefix:K}=V,G=(0,p.Z)(V,$),X=Object.keys(U),Y="string"==typeof _?_:_.light,J="string"==typeof _?_:_.dark,{mode:Q,setMode:ee,systemMode:et,lightColorScheme:en,darkColorScheme:er,colorScheme:eo,setColorScheme:ei}=function(e){let{defaultMode:t="light",defaultLightColorScheme:n,defaultDarkColorScheme:r,supportedColorSchemes:o=[],modeStorageKey:i=b,colorSchemeStorageKey:l=x,storageWindow:s="undefined"==typeof window?void 0:window}=e,c=o.join(","),[u,f]=a.useState(()=>{let e=E(i,t),o=E(`${l}-light`,n),a=E(`${l}-dark`,r);return{mode:e,systemMode:C(e),lightColorScheme:o,darkColorScheme:a}}),p=S(u,e=>"light"===e?u.lightColorScheme:"dark"===e?u.darkColorScheme:void 0),h=a.useCallback(e=>{f(n=>{if(e===n.mode)return n;let r=e||t;try{localStorage.setItem(i,r)}catch(e){}return(0,d.Z)({},n,{mode:r,systemMode:C(r)})})},[i,t]),m=a.useCallback(e=>{e?"string"==typeof e?e&&!c.includes(e)?console.error(`\`${e}\` does not exist in \`theme.colorSchemes\`.`):f(t=>{let n=(0,d.Z)({},t);return S(t,t=>{try{localStorage.setItem(`${l}-${t}`,e)}catch(e){}"light"===t&&(n.lightColorScheme=e),"dark"===t&&(n.darkColorScheme=e)}),n}):f(t=>{let o=(0,d.Z)({},t),i=null===e.light?n:e.light,a=null===e.dark?r:e.dark;if(i){if(c.includes(i)){o.lightColorScheme=i;try{localStorage.setItem(`${l}-light`,i)}catch(e){}}else console.error(`\`${i}\` does not exist in \`theme.colorSchemes\`.`)}if(a){if(c.includes(a)){o.darkColorScheme=a;try{localStorage.setItem(`${l}-dark`,a)}catch(e){}}else console.error(`\`${a}\` does not exist in \`theme.colorSchemes\`.`)}return o}):f(e=>{try{localStorage.setItem(`${l}-light`,n),localStorage.setItem(`${l}-dark`,r)}catch(e){}return(0,d.Z)({},e,{lightColorScheme:n,darkColorScheme:r})})},[c,l,n,r]),g=a.useCallback(e=>{"system"===u.mode&&f(t=>(0,d.Z)({},t,{systemMode:null!=e&&e.matches?"dark":"light"}))},[u.mode]),v=a.useRef(g);return v.current=g,a.useEffect(()=>{let e=(...e)=>v.current(...e),t=window.matchMedia("(prefers-color-scheme: dark)");return t.addListener(e),e(t),()=>t.removeListener(e)},[]),a.useEffect(()=>{let e=e=>{let n=e.newValue;"string"==typeof e.key&&e.key.startsWith(l)&&(!n||c.match(n))&&(e.key.endsWith("light")&&m({light:n}),e.key.endsWith("dark")&&m({dark:n})),e.key===i&&(!n||["light","dark","system"].includes(n))&&h(n||t)};if(s)return s.addEventListener("storage",e),()=>s.removeEventListener("storage",e)},[m,h,i,l,c,t,s]),(0,d.Z)({},u,{colorScheme:p,setMode:h,setColorScheme:m})}({supportedColorSchemes:X,defaultLightColorScheme:Y,defaultDarkColorScheme:J,modeStorageKey:w,colorSchemeStorageKey:j,defaultMode:Z,storageWindow:R}),ea=Q,el=eo;D&&(ea=z.mode,el=z.colorScheme);let es=ea||("system"===Z?s:Z),ec=el||("dark"===es?J:Y),{css:eu,vars:ef}=q(),ed=(0,d.Z)({},G,{components:W,colorSchemes:U,cssVarPrefix:K,vars:ef,getColorSchemeSelector:e=>`[${P}="${e}"] &`}),ep={},eh={};Object.entries(U).forEach(([e,t])=>{let{css:n,vars:r}=q(e);ed.vars=(0,f.Z)(ed.vars,r),e===ec&&(Object.keys(t).forEach(e=>{t[e]&&"object"==typeof t[e]?ed[e]=(0,d.Z)({},ed[e],t[e]):ed[e]=t[e]}),ed.palette&&(ed.palette.colorScheme=e));let o="string"==typeof _?_:"dark"===Z?_.dark:_.light;if(e===o){if(O){let t={};O(K).forEach(e=>{t[e]=n[e],delete n[e]}),ep[`[${P}="${e}"]`]=t}ep[`${T}, [${P}="${e}"]`]=n}else eh[`${":root"===T?"":T}[${P}="${e}"]`]=n}),ed.vars=(0,f.Z)(ed.vars,ef),a.useEffect(()=>{el&&N&&N.setAttribute(P,el)},[el,P,N]),a.useEffect(()=>{let e;if(A&&L.current&&M){let t=M.createElement("style");t.appendChild(M.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),M.head.appendChild(t),window.getComputedStyle(M.body),e=setTimeout(()=>{M.head.removeChild(t)},1)}return()=>{clearTimeout(e)}},[el,A,M]),a.useEffect(()=>(L.current=!0,()=>{L.current=!1}),[]);let em=a.useMemo(()=>({mode:ea,systemMode:et,setMode:ee,lightColorScheme:en,darkColorScheme:er,colorScheme:el,setColorScheme:ei,allColorSchemes:X}),[X,el,er,en,ea,ei,ee,et]),eg=!0;(I||D&&(null==B?void 0:B.cssVarPrefix)===K)&&(eg=!1);let ev=(0,i.jsxs)(a.Fragment,{children:[eg&&(0,i.jsxs)(a.Fragment,{children:[(0,i.jsx)(g,{styles:{[T]:eu}}),(0,i.jsx)(g,{styles:ep}),(0,i.jsx)(g,{styles:eh})]}),(0,i.jsx)(y.Z,{themeId:H?t:void 0,theme:m?m(ed):ed,children:e})]});return D?ev:(0,i.jsx)(k.Provider,{value:em,children:ev})},useColorScheme:()=>{let e=a.useContext(k);if(!e)throw Error((0,h.Z)(19));return e},getInitColorSchemeScript:e=>(function(e){let{defaultMode:t="light",defaultLightColorScheme:n="light",defaultDarkColorScheme:r="dark",modeStorageKey:o=b,colorSchemeStorageKey:a=x,attribute:l=w,colorSchemeNode:s="document.documentElement"}=e||{};return(0,i.jsx)("script",{dangerouslySetInnerHTML:{__html:`(function() { try {
+ */var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,x=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case f:case i:case l:case a:case p:return e;default:switch(e=e&&e.$$typeof){case c:case d:case g:case m:case s:return e;default:return t}}case o:return t}}}function C(e){return w(e)===f}t.AsyncMode=u,t.ConcurrentMode=f,t.ContextConsumer=c,t.ContextProvider=s,t.Element=r,t.ForwardRef=d,t.Fragment=i,t.Lazy=g,t.Memo=m,t.Portal=o,t.Profiler=l,t.StrictMode=a,t.Suspense=p,t.isAsyncMode=function(e){return C(e)||w(e)===u},t.isConcurrentMode=C,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===d},t.isFragment=function(e){return w(e)===i},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===l},t.isStrictMode=function(e){return w(e)===a},t.isSuspense=function(e){return w(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===f||e===l||e===a||e===p||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===y||e.$$typeof===b||e.$$typeof===x||e.$$typeof===v)},t.typeOf=w},21296:function(e,t,n){"use strict";e.exports=n(96103)},62705:function(e,t,n){var r=n(55639).Symbol;e.exports=r},44239:function(e,t,n){var r=n(62705),o=n(89607),i=n(2333),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},27561:function(e,t,n){var r=n(67990),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},31957:function(e,t,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},89607:function(e,t,n){var r=n(62705),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,l=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,l),n=e[l];try{e[l]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[l]=n:delete e[l]),o}},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},55639:function(e,t,n){var r=n(31957),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},67990:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},23279:function(e,t,n){var r=n(13218),o=n(7771),i=n(14841),a=Math.max,l=Math.min;e.exports=function(e,t,n){var s,c,u,f,d,p,h=0,m=!1,g=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function y(t){var n=s,r=c;return s=c=void 0,h=t,f=e.apply(r,n)}function b(e){var n=e-p,r=e-h;return void 0===p||n>=t||n<0||g&&r>=u}function x(){var e,n,r,i=o();if(b(i))return w(i);d=setTimeout(x,(e=i-p,n=i-h,r=t-e,g?l(r,u-n):r))}function w(e){return(d=void 0,v&&s)?y(e):(s=c=void 0,f)}function C(){var e,n=o(),r=b(n);if(s=arguments,c=this,p=n,r){if(void 0===d)return h=e=p,d=setTimeout(x,t),m?y(e):f;if(g)return clearTimeout(d),d=setTimeout(x,t),y(p)}return void 0===d&&(d=setTimeout(x,t)),f}return t=i(t)||0,r(n)&&(m=!!n.leading,u=(g="maxWait"in n)?a(i(n.maxWait)||0,t):u,v="trailing"in n?!!n.trailing:v),C.cancel=function(){void 0!==d&&clearTimeout(d),h=0,s=p=c=d=void 0},C.flush=function(){return void 0===d?f:w(o())},C}},13218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},37005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},33448:function(e,t,n){var r=n(44239),o=n(37005);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},7771:function(e,t,n){var r=n(55639);e.exports=function(){return r.Date.now()}},23493:function(e,t,n){var r=n(23279),o=n(13218);e.exports=function(e,t,n){var i=!0,a=!0;if("function"!=typeof e)throw TypeError("Expected a function");return o(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),r(e,t,{leading:i,maxWait:t,trailing:a})}},14841:function(e,t,n){var r=n(27561),o=n(13218),i=n(33448),a=0/0,l=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return a;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||c.test(e)?u(e.slice(2),n?2:8):l.test(e)?a:+e}},83454:function(e,t,n){"use strict";var r,o;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(o=n.g.process)?void 0:o.env)?n.g.process:n(77663)},6840:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return n(48271)}])},41468:function(e,t,n){"use strict";n.d(t,{R:function(){return c},p:function(){return s}});var r=n(85893),o=n(67294),i=n(50489),a=n(577),l=n(39332);let s=(0,o.createContext)({scene:"",chatId:"",modelList:[],model:"",dbParam:void 0,dialogueList:[],agentList:[],setAgentList:()=>{},setModel:()=>{},setIsContract:()=>{},setIsMenuExpand:()=>{},setDbParam:()=>void 0,queryDialogueList:()=>{},refreshDialogList:()=>{},history:[],setHistory:()=>{},docId:void 0,setDocId:()=>{}}),c=e=>{var t,n,c;let{children:u}=e,f=(0,l.useSearchParams)(),d=null!==(t=null==f?void 0:f.get("id"))&&void 0!==t?t:"",p=null!==(n=null==f?void 0:f.get("scene"))&&void 0!==n?n:"",h=null!==(c=null==f?void 0:f.get("db_param"))&&void 0!==c?c:"",[m,g]=(0,o.useState)(!1),[v,y]=(0,o.useState)(""),[b,x]=(0,o.useState)("chat_dashboard"!==p),[w,C]=(0,o.useState)(h),[S,E]=(0,o.useState)([]),[$,O]=(0,o.useState)([]),[k,j]=(0,o.useState)(),{run:P,data:Z=[],refresh:_}=(0,a.Z)(async()=>{let[,e]=await (0,i.Vx)((0,i.iP)());return null!=e?e:[]},{manual:!0}),{data:A=[]}=(0,a.Z)(async()=>{let[,e]=await (0,i.Vx)((0,i.Vw)());return null!=e?e:[]});(0,o.useEffect)(()=>{y(A[0])},[A,null==A?void 0:A.length]);let R=(0,o.useMemo)(()=>Z.find(e=>e.conv_uid===d),[d,Z]);return(0,r.jsx)(s.Provider,{value:{isContract:m,isMenuExpand:b,scene:p,chatId:d,modelList:A,model:v,dbParam:w||h,dialogueList:Z,agentList:S,setAgentList:E,setModel:y,setIsContract:g,setIsMenuExpand:x,setDbParam:C,queryDialogueList:P,refreshDialogList:_,currentDialogue:R,history:$,setHistory:O,docId:k,setDocId:j},children:u})}},58989:function(e,t,n){"use strict";n.d(t,{Z:function(){return z}});let r={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class o{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||r,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=Array(e),n=0;n{this.observers[e]=this.observers[e]||[],this.observers[e].push(t)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e]=this.observers[e].filter(e=>e!==t)}}emit(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r{e(...n)})}if(this.observers["*"]){let t=[].concat(this.observers["*"]);t.forEach(t=>{t.apply(t,[e,...n])})}}}function l(){let e,t;let n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}function s(e){return null==e?"":""+e}function c(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}let i="string"!=typeof t?[].concat(t):t.split(".");for(;i.length>1;){if(o())return{};let t=r(i.shift());!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{}}return o()?{}:{obj:e,k:r(i.shift())}}function u(e,t,n){let{obj:r,k:o}=c(e,t,Object);r[o]=n}function f(e,t){let{obj:n,k:r}=c(e,t);if(n)return n[r]}function d(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var p={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function h(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,e=>p[e]):e}let m=[" ",",","?","!",";"];function g(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];let r=t.split(n),o=e;for(let e=0;ee+i;)i++,l=o[a=r.slice(e,e+i).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(a)){if("string"==typeof l)return l;if(a&&"string"==typeof l[a])return l[a]}let s=r.slice(e+i).join(n);if(s)return g(l,s,n);return}o=o[r[e]]}return o}function v(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class y extends a{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."));let l=f(this.data,a);return l||!i||"string"!=typeof n?l:g(this.data&&this.data[e]&&this.data[e][t],n,o)}addResource(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(a=e.split("."),r=t,t=a[1]),this.addNamespaces(t),u(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(let r in n)("string"==typeof n[r]||"[object Array]"===Object.prototype.toString.apply(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),r=n,n=t,t=a[1]),this.addNamespaces(t);let l=f(this.data,a)||{};r?function e(t,n,r){for(let o in n)"__proto__"!==o&&"constructor"!==o&&(o in t?"string"==typeof t[o]||t[o]instanceof String||"string"==typeof n[o]||n[o]instanceof String?r&&(t[o]=n[o]):e(t[o],n[o],r):t[o]=n[o]);return t}(l,n,o):l={...l,...n},u(this.data,a,l),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return(t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI)?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e),n=t&&Object.keys(t)||[];return!!n.find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var b={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(e=>{this.processors[e]&&(t=this.processors[e].process(t,n,r,o))}),t}};let x={};class w extends a{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),function(e,t,n){e.forEach(e=>{t[e]&&(n[e]=t[e])})}(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=i.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;let n=this.resolve(e,t);return n&&void 0!==n.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");let r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!function(e,t,n){t=t||"",n=n||"";let r=m.filter(e=>0>t.indexOf(e)&&0>n.indexOf(e));if(0===r.length)return!0;let o=RegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`),i=!o.test(e);if(!i){let t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i}(e,n,r);if(i&&!a){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:o};let i=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}translate(e,t,n){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);let r=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:i,namespaces:a}=this.extractFromKey(e[e.length-1],t),l=a[a.length-1],s=t.lng||this.language,c=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(s&&"cimode"===s.toLowerCase()){if(c){let e=t.nsSeparator||this.options.nsSeparator;return r?{res:`${l}${e}${i}`,usedKey:i,exactUsedKey:i,usedLng:s,usedNS:l}:`${l}${e}${i}`}return r?{res:i,usedKey:i,exactUsedKey:i,usedLng:s,usedNS:l}:i}let u=this.resolve(e,t),f=u&&u.res,d=u&&u.usedKey||i,p=u&&u.exactUsedKey||i,h=Object.prototype.toString.apply(f),m=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,g=!this.i18nFormat||this.i18nFormat.handleAsObject,v="string"!=typeof f&&"boolean"!=typeof f&&"number"!=typeof f;if(g&&f&&v&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(h)&&!("string"==typeof m&&"[object Array]"===h)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(d,f,{...t,ns:a}):`key '${i} (${this.language})' returned an object instead of string.`;return r?(u.res=e,u):e}if(o){let e="[object Array]"===h,n=e?[]:{},r=e?p:d;for(let e in f)if(Object.prototype.hasOwnProperty.call(f,e)){let i=`${r}${o}${e}`;n[e]=this.translate(i,{...t,joinArrays:!1,ns:a}),n[e]===i&&(n[e]=f[e])}f=n}}else if(g&&"string"==typeof m&&"[object Array]"===h)(f=f.join(m))&&(f=this.extendTranslation(f,e,t,n));else{let r=!1,a=!1,c=void 0!==t.count&&"string"!=typeof t.count,d=w.hasDefaultValue(t),p=c?this.pluralResolver.getSuffix(s,t.count,t):"",h=t.ordinal&&c?this.pluralResolver.getSuffix(s,t.count,{ordinal:!1}):"",m=t[`defaultValue${p}`]||t[`defaultValue${h}`]||t.defaultValue;!this.isValidLookup(f)&&d&&(r=!0,f=m),this.isValidLookup(f)||(a=!0,f=i);let g=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,v=g&&a?void 0:f,y=d&&m!==f&&this.options.updateMissing;if(a||r||y){if(this.logger.log(y?"updateKey":"missingKey",s,l,i,y?m:f),o){let e=this.resolve(i,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[],n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t{let o=d&&r!==f?r:v;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,n,o,y,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,l,n,o,y,t),this.emit("missingKey",e,l,n,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&c?e.forEach(e=>{this.pluralResolver.getSuffixes(e,t).forEach(n=>{r([e],i+n,t[`defaultValue${n}`]||m)})}):r(e,i,m))}f=this.extendTranslation(f,e,t,u,n),a&&f===i&&this.options.appendNamespaceToMissingKey&&(f=`${l}:${i}`),(a||r)&&this.options.parseMissingKeyHandler&&(f="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${i}`:i,r?f:void 0):this.options.parseMissingKeyHandler(f))}return r?(u.res=f,u):f}extendTranslation(e,t,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){let a;n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let l="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(l){let t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let s=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language,n),l){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;a1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(t))return;let l=this.extractFromKey(e,a),s=l.key;n=s;let c=l.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));let u=void 0!==a.count&&"string"!=typeof a.count,f=u&&!a.ordinal&&0===a.count&&this.pluralResolver.shouldUseIntlApi(),d=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,p=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);c.forEach(e=>{this.isValidLookup(t)||(i=e,!x[`${p[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(i)&&(x[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(n=>{let i;if(this.isValidLookup(t))return;o=n;let l=[s];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(l,s,n,e,a);else{let e;u&&(e=this.pluralResolver.getSuffix(n,a.count,a));let t=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(l.push(s+e),a.ordinal&&0===e.indexOf(r)&&l.push(s+e.replace(r,this.options.pluralSeparator)),f&&l.push(s+t)),d){let n=`${s}${this.options.contextSeparator}${a.context}`;l.push(n),u&&(l.push(n+e),a.ordinal&&0===e.indexOf(r)&&l.push(n+e.replace(r,this.options.pluralSeparator)),f&&l.push(n+t))}}for(;i=l.pop();)this.isValidLookup(t)||(r=i,t=this.getResource(n,e,i,a))}))})}),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}static hasDefaultValue(e){let t="defaultValue";for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}function C(e){return e.charAt(0).toUpperCase()+e.slice(1)}class S{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=i.create("languageUtils")}getScriptPartFromCode(e){if(!(e=v(e))||0>e.indexOf("-"))return null;let t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(!(e=v(e))||0>e.indexOf("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if("string"==typeof e&&e.indexOf("-")>-1){let t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map(e=>e.toLowerCase()):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=C(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=C(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=C(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){let t;return e?(e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>{if(e===n||!(0>e.indexOf("-")&&0>n.indexOf("-"))&&0===e.indexOf(n))return e})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],o=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return"string"==typeof e&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),n.forEach(e=>{0>r.indexOf(e)&&o(this.formatLanguageCode(e))}),r}}let E=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],$={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},O=["v1","v2","v3"],k=["v4"],j={zero:0,one:1,two:2,few:3,many:4,other:5};class P{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=i.create("pluralResolver"),(!this.options.compatibilityJSON||k.includes(this.options.compatibilityJSON))&&("undefined"==typeof Intl||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=function(){let e={};return E.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:$[t.fc]}})}),e}()}addRule(e,t){this.rules[e]=t}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(v(e),{type:t.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((e,t)=>j[e]-j[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):n.numbers.map(n=>this.getSuffix(e,n,t)):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:this.getSuffixRetroCompatible(r,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){let n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),r=e.numbers[n];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===r?r="plural":1===r&&(r=""));let o=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?`_plural_${r.toString()}`:o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!O.includes(this.options.compatibilityJSON)}}function Z(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4)||void 0===arguments[4]||arguments[4],i=function(e,t,n){let r=f(e,n);return void 0!==r?r:f(t,n)}(e,t,n);return!i&&o&&"string"==typeof n&&void 0===(i=g(e,n,r))&&(i=g(t,n,r)),i}class _{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=i.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});let t=e.interpolation;this.escape=void 0!==t.escape?t.escape:h,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?d(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?d(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?d(t.nestingPrefix):t.nestingPrefixEscaped||d("$t("),this.nestingSuffix=t.nestingSuffix?d(t.nestingSuffix):t.nestingSuffixEscaped||d(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=`${this.prefix}(.+?)${this.suffix}`;this.regexp=RegExp(e,"g");let t=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=RegExp(t,"g");let n=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=RegExp(n,"g")}interpolate(e,t,n,r){let o,i,a;let l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}let u=e=>{if(0>e.indexOf(this.formatSeparator)){let o=Z(t,l,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}let o=e.split(this.formatSeparator),i=o.shift().trim(),a=o.join(this.formatSeparator).trim();return this.format(Z(t,l,i,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...r,...t,interpolationkey:i})};this.resetRegExp();let f=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,d=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,p=[{regex:this.regexpUnescape,safeValue:e=>c(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?c(this.escape(e)):c(e)}];return p.forEach(t=>{for(a=0;o=t.regex.exec(e);){let n=o[1].trim();if(void 0===(i=u(n))){if("function"==typeof f){let t=f(e,o,r);i="string"==typeof t?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else if(d){i=o[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else"string"==typeof i||this.useRawValueToEscape||(i=s(i));let l=t.safeValue(i);if(e=e.replace(o[0],l),d?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++a>=this.maxReplaces)break}}),e}nest(e,t){let n,r,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function a(e,t){let n=this.nestingOptionsSeparator;if(0>e.indexOf(n))return e;let r=e.split(RegExp(`${n}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,o);let a=i.match(/'/g),l=i.match(/"/g);(a&&a.length%2==0&&!l||l.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return delete o.defaultValue,e}for(;n=this.nestingRegexp.exec(e);){let l=[];(o=(o={...i}).replace&&"string"!=typeof o.replace?o.replace:o).applyPostProcessor=!1,delete o.defaultValue;let c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){let e=n[1].split(this.formatSeparator).map(e=>e.trim());n[1]=e.shift(),l=e,c=!0}if((r=t(a.call(this,n[1].trim(),o),o))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=s(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),c&&(r=l.reduce((e,t)=>this.format(e,t,i.lng,{...i,interpolationkey:n[1].trim()}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}function A(e){let t={};return function(n,r,o){let i=r+JSON.stringify(o),a=t[i];return a||(a=e(v(r),o),t[i]=a),a(n)}}class R{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=i.create("formatter"),this.options=e,this.formats={number:A((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:A((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:A((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:A((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:A((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})},this.init(e)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=A(t)}format(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.split(this.formatSeparator),i=o.reduce((e,t)=>{let{formatName:o,formatOptions:i}=function(e){let t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){let r=e.split("(");t=r[0].toLowerCase().trim();let o=r[1].substring(0,r[1].length-1);if("currency"===t&&0>o.indexOf(":"))n.currency||(n.currency=o.trim());else if("relativetime"===t&&0>o.indexOf(":"))n.range||(n.range=o.trim());else{let e=o.split(";");e.forEach(e=>{if(!e)return;let[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,"");n[t.trim()]||(n[t.trim()]=o),"false"===o&&(n[t.trim()]=!1),"true"===o&&(n[t.trim()]=!0),isNaN(o)||(n[t.trim()]=parseInt(o,10))})}}return{formatName:t,formatOptions:n}}(t);if(this.formats[o]){let t=e;try{let a=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},l=a.locale||a.lng||r.locale||r.lng||n;t=this.formats[o](e,l,{...i,...r,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e);return i}}class M extends a{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=i.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,r.backend,r)}queueLoad(e,t,n,r){let o={},i={},a={},l={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===i[a]&&(i[a]=!0):(this.state[a]=1,r=!1,void 0===i[a]&&(i[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===l[t]&&(l[t]=!0)))}),r||(a[e]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(e,t,n){let r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),n&&this.store.addResourceBundle(o,i,n),this.state[e]=t?-1:2;let a={};this.queue.forEach(n=>{(function(e,t,n,r){let{obj:o,k:i}=c(e,t,Object);o[i]=o[i]||[],r&&(o[i]=o[i].concat(n)),r||o[i].push(n)})(n.loaded,[o],i),void 0!==n.pending[e]&&(delete n.pending[e],n.pendingCount--),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{a[e]||(a[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:i});return}this.readingCalls++;let a=(a,l)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(a&&l&&r{this.read.call(this,e,t,n,r+1,2*o,i)},o);return}i(a,l)},l=this.backend[n].bind(this.backend);if(2===l.length){try{let n=l(e,t);n&&"function"==typeof n.then?n.then(e=>a(null,e)).catch(a):a(null,n)}catch(e){a(e)}return}return l(e,t,a)}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);let o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(n,i)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,i),this.loaded(e,n,i)})}saveMissing(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(null!=n&&""!==n){if(this.backend&&this.backend.create){let l={...i,isUpdate:o},s=this.backend.create.bind(this.backend);if(s.length<6)try{let o;(o=5===s.length?s(e,t,n,r,l):s(e,t,n,r))&&"function"==typeof o.then?o.then(e=>a(null,e)).catch(a):a(null,o)}catch(e){a(e)}else s(e,t,n,r,a,l)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}function N(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let t={};if("object"==typeof e[1]&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:(e,t,n,r)=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function T(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&0>e.supportedLngs.indexOf("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function F(){}class I extends a{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=T(e),this.services={},this.logger=i,this.modules={external:[]},!function(e){let t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})}(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:0>t.ns.indexOf("translation")&&(t.defaultNS=t.ns[0]));let r=N();function o(e){return e?"function"==typeof e?new e:e:null}if(this.options={...r,...this.options,...T(t)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){let t;this.modules.logger?i.init(o(this.modules.logger),this.options):i.init(null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!=typeof Intl&&(t=R);let n=new S(this.options);this.store=new y(this.options.resources,this.options);let a=this.services;a.logger=i,a.resourceStore=this.store,a.languageUtils=n,a.pluralResolver=new P(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),t&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(a.formatter=o(t),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new _(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new M(o(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o1?n-1:0),o=1;o{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,n||(n=F),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(t=>{this[t]=function(){return e.store[t](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(t=>{this[t]=function(){return e.store[t](...arguments),e}});let a=l(),s=()=>{let e=(e,t)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(t),n(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?s():setTimeout(s,0),a}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F,n=t,r="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();let e=[],t=t=>{if(!t||"cimode"===t)return;let n=this.services.languageUtils.toResolveHierarchy(t);n.forEach(t=>{"cimode"!==t&&0>e.indexOf(t)&&e.push(t)})};if(r)t(r);else{let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.forEach(e=>t(e))}this.options.preload&&this.options.preload.forEach(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=l();return e||(e=this.languages),t||(t=this.options.ns),n||(n=F),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&b.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let e=0;e-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;let r=l();this.emit("languageChanging",e);let o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(e,i)=>{i?(o(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,r.resolve(function(){return n.t(...arguments)}),t&&t(e,function(){return n.t(...arguments)})},a=t=>{e||t||!this.services.languageDetector||(t=[]);let n="string"==typeof t?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||o(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,e=>{i(e,n)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),r}getFixedT(e,t,n){var r=this;let o=function(e,t){let i,a;if("object"!=typeof t){for(var l=arguments.length,s=Array(l>2?l-2:0),c=2;c`${i.keyPrefix}${u}${e}`):i.keyPrefix?`${i.keyPrefix}${u}${e}`:e,r.t(a,i)};return"string"==typeof e?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;let i=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return -1===n||2===n};if(t.precheck){let e=t.precheck(this,i);if(void 0!==e)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(n,e)&&(!r||i(o,e)))}loadNamespaces(e,t){let n=l();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach(e=>{0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=l();"string"==typeof e&&(e=[e]);let r=this.options.preload||[],o=e.filter(e=>0>r.indexOf(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";let t=this.services&&this.services.languageUtils||new S(N());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new I(e,t)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F,n=e.forkResourceStore;n&&delete e.forkResourceStore;let r={...this.options,...e,isClone:!0},o=new I(r);return(void 0!==e.debug||void 0!==e.prefix)&&(o.logger=o.logger.clone(e)),["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new y(this.store.data,r),o.services.resourceStore=o.store),o.translator=new w(o.services,r),o.translator.on("*",function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r{let{componentCls:t,width:n,notificationMarginEdge:r}=e,o=new y.E4("antNotificationTopFadeIn",{"0%":{marginTop:"-100%",opacity:0},"100%":{marginTop:0,opacity:1}}),i=new y.E4("antNotificationBottomFadeIn",{"0%":{marginBottom:"-100%",opacity:0},"100%":{marginBottom:0,opacity:1}}),a=new y.E4("antNotificationLeftFadeIn",{"0%":{right:{_skip_check_:!0,value:n},opacity:0},"100%":{right:{_skip_check_:!0,value:0},opacity:1}});return{[`&${t}-top, &${t}-bottom`]:{marginInline:0},[`&${t}-top`]:{[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:o}},[`&${t}-bottom`]:{[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:i}},[`&${t}-topLeft, &${t}-bottomLeft`]:{marginInlineEnd:0,marginInlineStart:r,[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:a}}}};let S=e=>{let{iconCls:t,componentCls:n,boxShadow:r,fontSizeLG:o,notificationMarginBottom:i,borderRadiusLG:a,colorSuccess:l,colorInfo:s,colorWarning:c,colorError:u,colorTextHeading:f,notificationBg:d,notificationPadding:p,notificationMarginEdge:h,motionDurationMid:m,motionEaseInOut:g,fontSize:v,lineHeight:x,width:w,notificationIconSize:S,colorText:E}=e,$=`${n}-notice`,O=new y.E4("antNotificationFadeIn",{"0%":{left:{_skip_check_:!0,value:w},opacity:0},"100%":{left:{_skip_check_:!0,value:0},opacity:1}}),k=new y.E4("antNotificationFadeOut",{"0%":{maxHeight:e.animationMaxHeight,marginBottom:i,opacity:1},"100%":{maxHeight:0,marginBottom:0,paddingTop:0,paddingBottom:0,opacity:0}}),j={position:"relative",width:w,maxWidth:`calc(100vw - ${2*h}px)`,marginBottom:i,marginInlineStart:"auto",padding:p,overflow:"hidden",lineHeight:x,wordWrap:"break-word",background:d,borderRadius:a,boxShadow:r,[`${n}-close-icon`]:{fontSize:v,cursor:"pointer"},[`${$}-message`]:{marginBottom:e.marginXS,color:f,fontSize:o,lineHeight:e.lineHeightLG},[`${$}-description`]:{fontSize:v,color:E},[`&${$}-closable ${$}-message`]:{paddingInlineEnd:e.paddingLG},[`${$}-with-icon ${$}-message`]:{marginBottom:e.marginXS,marginInlineStart:e.marginSM+S,fontSize:o},[`${$}-with-icon ${$}-description`]:{marginInlineStart:e.marginSM+S,fontSize:v},[`${$}-icon`]:{position:"absolute",fontSize:S,lineHeight:0,[`&-success${t}`]:{color:l},[`&-info${t}`]:{color:s},[`&-warning${t}`]:{color:c},[`&-error${t}`]:{color:u}},[`${$}-close`]:{position:"absolute",top:e.notificationPaddingVertical,insetInlineEnd:e.notificationPaddingHorizontal,color:e.colorIcon,outline:"none",width:e.notificationCloseButtonSize,height:e.notificationCloseButtonSize,borderRadius:e.borderRadiusSM,transition:`background-color ${e.motionDurationMid}, color ${e.motionDurationMid}`,display:"flex",alignItems:"center",justifyContent:"center","&:hover":{color:e.colorIconHover,backgroundColor:e.wireframe?"transparent":e.colorFillContent}},[`${$}-btn`]:{float:"right",marginTop:e.marginSM}};return[{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,b.Wf)(e)),{position:"fixed",zIndex:e.zIndexPopup,marginInlineEnd:h,[`${n}-hook-holder`]:{position:"relative"},[`&${n}-top, &${n}-bottom`]:{[$]:{marginInline:"auto auto"}},[`&${n}-topLeft, &${n}-bottomLeft`]:{[$]:{marginInlineEnd:"auto",marginInlineStart:0}},[`${n}-fade-enter, ${n}-fade-appear`]:{animationDuration:e.motionDurationMid,animationTimingFunction:g,animationFillMode:"both",opacity:0,animationPlayState:"paused"},[`${n}-fade-leave`]:{animationTimingFunction:g,animationFillMode:"both",animationDuration:m,animationPlayState:"paused"},[`${n}-fade-enter${n}-fade-enter-active, ${n}-fade-appear${n}-fade-appear-active`]:{animationName:O,animationPlayState:"running"},[`${n}-fade-leave${n}-fade-leave-active`]:{animationName:k,animationPlayState:"running"}}),C(e)),{"&-rtl":{direction:"rtl",[`${$}-btn`]:{float:"left"}}})},{[n]:{[$]:Object.assign({},j)}},{[`${$}-pure-panel`]:Object.assign(Object.assign({},j),{margin:0})}]};var E=(0,x.Z)("Notification",e=>{let t=e.paddingMD,n=e.paddingLG,r=(0,w.TS)(e,{notificationBg:e.colorBgElevated,notificationPaddingVertical:t,notificationPaddingHorizontal:n,notificationIconSize:e.fontSizeLG*e.lineHeightLG,notificationCloseButtonSize:.55*e.controlHeightLG,notificationMarginBottom:e.margin,notificationPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`,notificationMarginEdge:e.marginLG,animationMaxHeight:150});return[S(r)]},e=>({zIndexPopup:e.zIndexPopupBase+50,width:384})),$=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function O(e,t){return null===t||!1===t?null:t||i.createElement("span",{className:`${e}-close-x`},i.createElement(u.Z,{className:`${e}-close-icon`}))}d.Z,s.Z,c.Z,f.Z,p.Z;let k={success:s.Z,info:d.Z,error:c.Z,warning:f.Z},j=e=>{let{prefixCls:t,icon:n,type:r,message:o,description:a,btn:l,role:s="alert"}=e,c=null;return n?c=i.createElement("span",{className:`${t}-icon`},n):r&&(c=i.createElement(k[r]||null,{className:m()(`${t}-icon`,`${t}-icon-${r}`)})),i.createElement("div",{className:m()({[`${t}-with-icon`]:c}),role:s},c,i.createElement("div",{className:`${t}-message`},o),i.createElement("div",{className:`${t}-description`},a),l&&i.createElement("div",{className:`${t}-btn`},l))};var P=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let Z=e=>{let{children:t,prefixCls:n}=e,[,r]=E(n);return i.createElement(g.JB,{classNames:{list:r,notice:r}},t)},_=(e,t)=>{let{prefixCls:n,key:r}=t;return i.createElement(Z,{prefixCls:n,key:r},e)},A=i.forwardRef((e,t)=>{let{top:n,bottom:r,prefixCls:o,getContainer:a,maxCount:l,rtl:s,onAllRemoved:c}=e,{getPrefixCls:u,getPopupContainer:f,notification:d}=i.useContext(v.E_),p=o||u("notification"),[h,y]=(0,g.lm)({prefixCls:p,style:e=>(function(e,t,n){let r;switch(e){case"top":r={left:"50%",transform:"translateX(-50%)",right:"auto",top:t,bottom:"auto"};break;case"topLeft":r={left:0,top:t,bottom:"auto"};break;case"topRight":r={right:0,top:t,bottom:"auto"};break;case"bottom":r={left:"50%",transform:"translateX(-50%)",right:"auto",top:"auto",bottom:n};break;case"bottomLeft":r={left:0,top:"auto",bottom:n};break;default:r={right:0,top:"auto",bottom:n}}return r})(e,null!=n?n:24,null!=r?r:24),className:()=>m()({[`${p}-rtl`]:s}),motion:()=>({motionName:`${p}-fade`}),closable:!0,closeIcon:O(p),duration:4.5,getContainer:()=>(null==a?void 0:a())||(null==f?void 0:f())||document.body,maxCount:l,onAllRemoved:c,renderNotifications:_});return i.useImperativeHandle(t,()=>Object.assign(Object.assign({},h),{prefixCls:p,notification:d})),y});function R(e){let t=i.useRef(null),n=i.useMemo(()=>{let n=n=>{var r;if(!t.current)return;let{open:o,prefixCls:a,notification:l}=t.current,s=`${a}-notice`,{message:c,description:u,icon:f,type:d,btn:p,className:h,style:g,role:v="alert",closeIcon:y}=n,b=P(n,["message","description","icon","type","btn","className","style","role","closeIcon"]),x=O(s,y);return o(Object.assign(Object.assign({placement:null!==(r=null==e?void 0:e.placement)&&void 0!==r?r:"topRight"},b),{content:i.createElement(j,{prefixCls:s,icon:f,type:d,message:c,description:u,btn:p,role:v}),className:m()(d&&`${s}-${d}`,h,null==l?void 0:l.className),style:Object.assign(Object.assign({},null==l?void 0:l.style),g),closeIcon:x,closable:!!x}))},r={open:n,destroy:e=>{var n,r;void 0!==e?null===(n=t.current)||void 0===n||n.close(e):null===(r=t.current)||void 0===r||r.destroy()}};return["success","info","warning","error"].forEach(e=>{r[e]=t=>n(Object.assign(Object.assign({},t),{type:e}))}),r},[]);return[n,i.createElement(A,Object.assign({key:"notification-holder"},e,{ref:t}))]}let M=null,N=e=>e(),T=[],F={};function I(){let{prefixCls:e,getContainer:t,rtl:n,maxCount:r,top:o,bottom:i}=F,a=null!=e?e:(0,l.w6)().getPrefixCls("notification"),s=(null==t?void 0:t())||document.body;return{prefixCls:a,getContainer:()=>s,rtl:n,maxCount:r,top:o,bottom:i}}let L=i.forwardRef((e,t)=>{let[n,r]=i.useState(I),[o,a]=R(n),s=(0,l.w6)(),c=s.getRootPrefixCls(),u=s.getIconPrefixCls(),f=s.getTheme(),d=()=>{r(I)};return i.useEffect(d,[]),i.useImperativeHandle(t,()=>{let e=Object.assign({},o);return Object.keys(e).forEach(t=>{e[t]=function(){return d(),o[t].apply(o,arguments)}}),{instance:e,sync:d}}),i.createElement(l.ZP,{prefixCls:c,iconPrefixCls:u,theme:f},a)});function B(){if(!M){let e=document.createDocumentFragment(),t={fragment:e};M=t,N(()=>{(0,a.s)(i.createElement(L,{ref:e=>{let{instance:n,sync:r}=e||{};Promise.resolve().then(()=>{!t.instance&&n&&(t.instance=n,t.sync=r,B())})}}),e)});return}M.instance&&(T.forEach(e=>{switch(e.type){case"open":N(()=>{M.instance.open(Object.assign(Object.assign({},F),e.config))});break;case"destroy":N(()=>{null==M||M.instance.destroy(e.key)})}}),T=[])}function z(e){T.push({type:"open",config:e}),B()}let D={open:z,destroy:function(e){T.push({type:"destroy",key:e}),B()},config:function(e){F=Object.assign(Object.assign({},F),e),N(()=>{var e;null===(e=null==M?void 0:M.sync)||void 0===e||e.call(M)})},useNotification:function(e){return R(e)},_InternalPanelDoNotUseOrYouWillBeFired:e=>{let{prefixCls:t,className:n,icon:r,type:o,message:a,description:l,btn:s,closable:c=!0,closeIcon:u}=e,f=$(e,["prefixCls","className","icon","type","message","description","btn","closable","closeIcon"]),{getPrefixCls:d}=i.useContext(v.E_),p=t||d("notification"),h=`${p}-notice`,[,y]=E(p);return i.createElement(g.qX,Object.assign({},f,{prefixCls:p,className:m()(n,y,`${h}-pure-panel`),eventKey:"pure",duration:null,closable:c,closeIcon:O(p,u),content:i.createElement(j,{prefixCls:h,icon:r,type:o,message:a,description:l,btn:s})}))}};["success","info","warning","error"].forEach(e=>{D[e]=t=>z(Object.assign(Object.assign({},t),{type:e}))});let H=(e,t)=>e.then(e=>{let{data:n}=e;if(!n)throw Error("Network Error!");if(!n.success){if("*"===t||n.err_code&&t&&t.includes(n.err_code));else{var r;D.error({message:"Request error",description:null!==(r=null==n?void 0:n.err_msg)&&void 0!==r?r:"The interface is abnormal. Please try again later"})}}return[null,n.data,n,e]}).catch(e=>(D.error({message:"Request error",description:e.message}),[e,null,null,null])),V=()=>eN("/api/v1/chat/dialogue/scenes"),U=e=>eN("/api/v1/chat/dialogue/new",e),W=()=>eM("/api/v1/chat/db/list"),q=()=>eM("/api/v1/chat/db/support/type"),K=e=>eN("/api/v1/chat/db/delete?db_name=".concat(e)),G=e=>eN("/api/v1/chat/db/edit",e),X=e=>eN("/api/v1/chat/db/add",e),Y=e=>eN("/api/v1/chat/db/test/connect",e),J=()=>eM("/api/v1/chat/dialogue/list"),Q=()=>eM("/api/v1/model/types"),ee=e=>eN("/api/v1/chat/mode/params/list?chat_mode=".concat(e)),et=e=>eM("/api/v1/chat/dialogue/messages/history?con_uid=".concat(e)),en=e=>{let{convUid:t,chatMode:n,data:r,config:o,model:i}=e;return eN("/api/v1/chat/mode/params/file/load?conv_uid=".concat(t,"&chat_mode=").concat(n,"&model_name=").concat(i),r,{headers:{"Content-Type":"multipart/form-data"},...o})},er=e=>eN("/api/v1/chat/dialogue/delete?con_uid=".concat(e)),eo=e=>eN("/knowledge/".concat(e,"/arguments"),{}),ei=(e,t)=>eN("/knowledge/".concat(e,"/argument/save"),t),ea=()=>eN("/knowledge/space/list",{}),el=(e,t)=>eN("/knowledge/".concat(e,"/document/list"),t),es=(e,t)=>eN("/knowledge/".concat(e,"/document/add"),t),ec=e=>eN("/knowledge/space/add",e),eu=(e,t)=>eN("/knowledge/".concat(e,"/document/sync"),t),ef=(e,t)=>eN("/knowledge/".concat(e,"/document/upload"),t),ed=(e,t)=>eN("/knowledge/".concat(e,"/chunk/list"),t),ep=(e,t)=>eN("/knowledge/".concat(e,"/document/delete"),t),eh=e=>eN("/knowledge/space/delete",e),em=()=>eM("/api/v1/worker/model/list"),eg=e=>eN("/api/v1/worker/model/stop",e),ev=e=>eN("/api/v1/worker/model/start",e),ey=()=>eM("/api/v1/worker/model/params"),eb=e=>eN("/api/v1/agent/query",e),ex=e=>eN("/api/v1/agent/hub/update",null!=e?e:{channel:"",url:"",branch:"",authorization:""}),ew=e=>eN("/api/v1/agent/my",void 0,{params:{user:e}}),eC=(e,t)=>eN("/api/v1/agent/install",void 0,{params:{plugin_name:e,user:t},timeout:6e4}),eS=(e,t)=>eN("/api/v1/agent/uninstall",void 0,{params:{plugin_name:e,user:t},timeout:6e4}),eE=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;return eN("/api/v1/personal/agent/upload",t,{params:{user:e},headers:{"Content-Type":"multipart/form-data"},...n})},e$=()=>eM("/api/v1/feedback/select",void 0),eO=(e,t)=>eM("/api/v1/feedback/find?conv_uid=".concat(e,"&conv_index=").concat(t),void 0),ek=e=>{let{data:t,config:n}=e;return eN("/api/v1/feedback/commit",t,{headers:{"Content-Type":"application/json"},...n})},ej=e=>eN("/prompt/list",e),eP=e=>eN("/prompt/update",e),eZ=e=>eN("/prompt/add",e);var e_=n(83454);let eA=o.Z.create({baseURL:null!==(r=e_.env.API_BASE_URL)&&void 0!==r?r:""}),eR=["/db/add","/db/test/connect","/db/summary","/params/file/load","/chat/prepare","/model/start","/model/stop","/editor/sql/run","/sql/editor/submit","/editor/chart/run","/chart/editor/submit","/document/upload","/document/sync","/agent/install","/agent/uninstall","/personal/agent/upload"];eA.interceptors.request.use(e=>{let t=eR.some(t=>e.url&&e.url.indexOf(t)>=0);return e.timeout||(e.timeout=t?6e4:1e4),e});let eM=(e,t,n)=>eA.get(e,{params:t,...n}),eN=(e,t,n)=>eA.post(e,t,n)},82579:function(e,t,n){"use strict";n.d(t,{RD:function(){return a},In:function(){return o},zM:function(){return i},je:function(){return l},DL:function(){return s},si:function(){return c},FD:function(){return u},s2:function(){return h},Rp:function(){return m},IN:function(){return f},ig:function(){return d},ol:function(){return p}});var r=n(85893),o=function(){return(0,r.jsxs)("svg",{viewBox:"0 0 1059 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"11020",className:"w-full h-full",children:[(0,r.jsx)("path",{d:"M617.931034 971.034483H335.448276c62.834759 0 70.62069-140.994207 70.62069-211.862069h247.172413c0 70.867862 7.785931 211.862069 70.62069 211.862069h-105.931035z",fill:"#4DB5E3","p-id":"11021"}),(0,r.jsx)("path",{d:"M282.482759 953.37931h512a35.310345 35.310345 0 0 1 0 70.62069H282.482759a35.310345 35.310345 0 0 1 0-70.62069z",fill:"#47C5FC","p-id":"11022"}),(0,r.jsx)("path",{d:"M0 0m73.145379 0l913.019587 0q73.145379 0 73.145379 73.145379l0 683.502345q0 73.145379-73.145379 73.145379l-913.019587 0q-73.145379 0-73.145379-73.145379l0-683.502345q0-73.145379 73.145379-73.145379Z",fill:"#47C5FC","p-id":"11023"}),(0,r.jsx)("path",{d:"M52.965517 52.965517h953.379311v723.862069H52.965517z",fill:"#FFFFFF","p-id":"11024"}),(0,r.jsx)("path",{d:"M600.275862 564.965517h335.448276a17.655172 17.655172 0 0 1 0 35.310345H600.275862a17.655172 17.655172 0 0 1 0-35.310345z m0 88.275862h205.78869a17.655172 17.655172 0 0 1 0 35.310345H600.275862a17.655172 17.655172 0 0 1 0-35.310345z m278.068966 0H935.724138a17.655172 17.655172 0 0 1 0 35.310345h-57.37931a17.655172 17.655172 0 0 1 0-35.310345z",fill:"#C7EAF9","p-id":"11025"}),(0,r.jsx)("path",{d:"M194.206897 211.862069h282.482758a17.655172 17.655172 0 1 1 0 35.310345H194.206897a17.655172 17.655172 0 1 1 0-35.310345z m0 88.275862h171.59062a17.655172 17.655172 0 1 1 0 35.310345H194.206897a17.655172 17.655172 0 1 1 0-35.310345z m238.344827 0H476.689655a17.655172 17.655172 0 1 1 0 35.310345h-44.137931a17.655172 17.655172 0 1 1 0-35.310345z",fill:"#C7EAF9","p-id":"11026"}),(0,r.jsx)("path",{d:"M194.206897 176.551724H141.241379v52.965517a17.655172 17.655172 0 1 1-35.310345 0V158.896552a17.655172 17.655172 0 0 1 17.655173-17.655173h70.62069a17.655172 17.655172 0 0 1 0 35.310345z",fill:"#C7EAF9","p-id":"11027"}),(0,r.jsx)("path",{d:"M317.793103 564.965517h141.24138a141.241379 141.241379 0 1 1-141.24138-141.241379v141.241379z",fill:"#47C5FC","p-id":"11028"}),(0,r.jsx)("path",{d:"M335.448276 406.068966a141.241379 141.241379 0 0 1 141.241379 141.241379h-141.241379v-141.241379z",fill:"#FFDE21","p-id":"11029"}),(0,r.jsx)("path",{d:"M582.62069 176.551724h52.965517v247.172414h-52.965517z",fill:"#FFDE21","p-id":"11030"}),(0,r.jsx)("path",{d:"M688.551724 247.172414h52.965517v176.551724h-52.965517z",fill:"#47C5FC","p-id":"11031"}),(0,r.jsx)("path",{d:"M794.482759 300.137931h52.965517v123.586207h-52.965517z",fill:"#47C5FC","p-id":"11032"}),(0,r.jsx)("path",{d:"M900.413793 353.103448h52.965517v70.62069h-52.965517z",fill:"#FFDE21","p-id":"11033"})]})},i=function(){return(0,r.jsxs)("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"13568",className:"w-full h-full",children:[(0,r.jsx)("path",{d:"M185.66 459H70.5c-5.54 0-10 4.48-10 10v373.26c0 5.52 4.46 10 10 10h115.16c5.52 0 10-4.48 10-10V469c0-5.52-4.48-10-10-10z m-10 373.26H80.5V479h95.16v353.26z",fill:"#23130D","p-id":"13569"}),(0,r.jsx)("path",{d:"M80.5 479h95.16v353.26H80.5z",fill:"#F9C139","p-id":"13570"}),(0,r.jsx)("path",{d:"M80.5 479H100v353.26h-19.5z",fill:"#FFFFFF",opacity:".4","p-id":"13571"}),(0,r.jsx)("path",{d:"M156.16 479h19.5v353.26h-19.5z",fill:"#1C1817",opacity:".2","p-id":"13572"}),(0,r.jsx)("path",{d:"M377.62 556.06h-115.16c-5.54 0-10 4.48-10 10v276.2c0 5.52 4.46 10 10 10h115.16c5.54 0 10-4.48 10-10v-276.2c0-5.52-4.46-10-10-10z m-10 276.2h-95.16v-256.2h95.16v256.2z",fill:"#23130D","p-id":"13573"}),(0,r.jsx)("path",{d:"M272.46 576.06h95.16v256.2h-95.16z",fill:"#EC7063","p-id":"13574"}),(0,r.jsx)("path",{d:"M569.58 358.02h-115.16c-5.54 0-10 4.48-10 10v474.24c0 5.52 4.46 10 10 10h115.16c5.54 0 10-4.48 10-10V368.02c0-5.52-4.46-10-10-10z m-10 474.24h-95.16V378.02h95.16v454.24z",fill:"#23130D","p-id":"13575"}),(0,r.jsx)("path",{d:"M464.42 378.02h95.16v454.24h-95.16z",fill:"#72AF5F","p-id":"13576"}),(0,r.jsx)("path",{d:"M761.54 419.62h-115.16c-5.54 0-10 4.48-10 10v412.64c0 5.52 4.46 10 10 10h115.16c5.54 0 10-4.48 10-10V429.62c0-5.52-4.46-10-10-10z m-10 412.64h-95.16V439.62h95.16v392.64z",fill:"#23130D","p-id":"13577"}),(0,r.jsx)("path",{d:"M656.38 439.62h95.16v392.64h-95.16z",fill:"#EC7063","p-id":"13578"}),(0,r.jsx)("path",{d:"M953.5 281.94h-115.16c-5.52 0-10 4.48-10 10v550.32c0 5.52 4.48 10 10 10h115.16c5.54 0 10-4.48 10-10V291.94c0-5.52-4.46-10-10-10z m-10 550.32h-95.16V301.94h95.16v530.32z",fill:"#23130D","p-id":"13579"}),(0,r.jsx)("path",{d:"M848.34 301.94h95.16v530.32h-95.16z",fill:"#72AF5F","p-id":"13580"}),(0,r.jsx)("path",{d:"M953.51 883.768H70.49a10 10 0 1 0 0 20h883.02c5.524 0 10-4.476 10-10s-4.476-10-10-10zM895.92 120.24c-36.72 0-66.62 29.88-66.62 66.6 0 10.8 2.6 21 7.2 30.04l-84.72 60.34c-12.12-12.5-29.08-20.3-47.82-20.3-26.08 0-48.7 15.08-59.64 36.96l-66.56-21.38c0.56-3.46 0.86-7 0.86-10.62 0-36.72-29.88-66.6-66.62-66.6s-66.62 29.88-66.62 66.6c0 14.88 4.92 28.64 13.18 39.74l-99.32 100.32a66.24 66.24 0 0 0-39.2-12.8c-22.16 0-41.8 10.88-53.92 27.56l-75.9-39.12c2.26-6.7 3.5-13.84 3.5-21.28 0-36.72-29.88-66.6-66.62-66.6-36.72 0-66.6 29.88-66.6 66.6 0 36.74 29.88 66.62 66.6 66.62 22.16 0 41.82-10.88 53.94-27.58l75.9 39.14a66.316 66.316 0 0 0-3.52 21.28c0 36.72 29.88 66.6 66.62 66.6s66.62-29.88 66.62-66.6c0-14.9-4.92-28.64-13.2-39.76l99.32-100.32a66.18 66.18 0 0 0 39.22 12.82c26.08 0 48.7-15.08 59.62-36.96l66.58 21.38c-0.56 3.46-0.86 7-0.86 10.6 0 36.74 29.88 66.62 66.62 66.62s66.62-29.88 66.62-66.62c0-10.8-2.6-21-7.18-30.02l84.7-60.34c12.12 12.5 29.08 20.3 47.82 20.3 36.74 0 66.62-29.88 66.62-66.62 0-36.72-29.88-66.6-66.62-66.6zM127.1 402.92c-25.7 0-46.6-20.92-46.6-46.62 0-25.7 20.9-46.6 46.6-46.6 25.7 0 46.62 20.9 46.62 46.6 0 25.7-20.92 46.62-46.62 46.62z m192.94 99.44c-25.7 0-46.62-20.9-46.62-46.6 0-25.72 20.92-46.62 46.62-46.62 25.7 0 46.62 20.9 46.62 46.62 0 25.7-20.92 46.6-46.62 46.6zM512 308.5c-25.7 0-46.62-20.92-46.62-46.62s20.92-46.6 46.62-46.6 46.62 20.9 46.62 46.6-20.92 46.62-46.62 46.62z m191.96 61.64c-25.7 0-46.62-20.9-46.62-46.62 0-4.94 0.8-9.72 2.22-14.2l0.02-0.02v-0.02c6.04-18.76 23.64-32.36 44.38-32.36 25.7 0 46.62 20.9 46.62 46.6 0 25.72-20.92 46.62-46.62 46.62z m191.96-136.68c-25.7 0-46.62-20.9-46.62-46.62 0-25.7 20.92-46.6 46.62-46.6 25.7 0 46.62 20.9 46.62 46.6 0 25.72-20.92 46.62-46.62 46.62z",fill:"#23130D","p-id":"13581"}),(0,r.jsx)("path",{d:"M942.54 186.84c0 25.72-20.92 46.62-46.62 46.62-25.7 0-46.62-20.9-46.62-46.62 0-25.7 20.92-46.6 46.62-46.6 25.7 0 46.62 20.9 46.62 46.6z",fill:"#72AF5F","p-id":"13582"}),(0,r.jsx)("path",{d:"M750.58 323.52c0 25.72-20.92 46.62-46.62 46.62-25.7 0-46.62-20.9-46.62-46.62 0-4.94 0.8-9.72 2.22-14.2l0.02-0.02v-0.02c6.04-18.76 23.64-32.36 44.38-32.36 25.7 0 46.62 20.9 46.62 46.6z",fill:"#EC7063","p-id":"13583"}),(0,r.jsx)("path",{d:"M558.62 261.88c0 25.7-20.92 46.62-46.62 46.62s-46.62-20.92-46.62-46.62 20.92-46.6 46.62-46.6 46.62 20.9 46.62 46.6z",fill:"#72AF5F","p-id":"13584"}),(0,r.jsx)("path",{d:"M366.66 455.76c0 25.7-20.92 46.6-46.62 46.6-25.7 0-46.62-20.9-46.62-46.6 0-25.72 20.92-46.62 46.62-46.62 25.7 0 46.62 20.9 46.62 46.62z",fill:"#EC7063","p-id":"13585"}),(0,r.jsx)("path",{d:"M173.72 356.3c0 25.7-20.92 46.62-46.62 46.62-25.7 0-46.6-20.92-46.6-46.62 0-25.7 20.9-46.6 46.6-46.6 25.7 0 46.62 20.9 46.62 46.6z",fill:"#F9C139","p-id":"13586"}),(0,r.jsx)("path",{d:"M173.72 356.3c0 25.7-20.92 46.62-46.62 46.62a45.6 45.6 0 0 1-12-1.58c19.9-5.3 34.62-23.48 34.62-45.04s-14.72-39.74-34.62-45.04c3.82-1.02 7.84-1.56 12-1.56 25.7 0 46.62 20.9 46.62 46.6zM366.66 455.74c0 25.7-20.92 46.62-46.62 46.62a45.6 45.6 0 0 1-12-1.58c19.9-5.3 34.62-23.48 34.62-45.04s-14.72-39.74-34.62-45.04c3.82-1.02 7.84-1.56 12-1.56 25.7 0 46.62 20.9 46.62 46.6zM558.62 261.88c0 25.7-20.92 46.62-46.62 46.62a45.6 45.6 0 0 1-12-1.58c19.9-5.3 34.62-23.48 34.62-45.04s-14.72-39.74-34.62-45.04c3.82-1.02 7.84-1.56 12-1.56 25.7 0 46.62 20.9 46.62 46.6zM750.58 323.52c0 25.7-20.92 46.62-46.62 46.62a45.6 45.6 0 0 1-12-1.58c19.9-5.3 34.62-23.48 34.62-45.04s-14.72-39.74-34.62-45.04c3.82-1.02 7.84-1.56 12-1.56 25.7 0 46.62 20.9 46.62 46.6zM943.5 186.84c0 25.7-20.92 46.62-46.62 46.62a45.6 45.6 0 0 1-12-1.58c19.9-5.3 34.62-23.48 34.62-45.04s-14.72-39.74-34.62-45.04c3.82-1.02 7.84-1.56 12-1.56 25.7 0 46.62 20.9 46.62 46.6z",fill:"#1C1817",opacity:".2","p-id":"13587"}),(0,r.jsx)("path",{d:"M272.46 575.06h19.5v257.2h-19.5z",fill:"#FFFFFF",opacity:".4","p-id":"13588"}),(0,r.jsx)("path",{d:"M348.12 575.06h19.5v257.2h-19.5z",fill:"#1C1817",opacity:".2","p-id":"13589"}),(0,r.jsx)("path",{d:"M463.94 378.746h19.5V832.26h-19.5z",fill:"#FFFFFF",opacity:".4","p-id":"13590"}),(0,r.jsx)("path",{d:"M539.6 378.746h19.5V832.26h-19.5z",fill:"#1C1817",opacity:".2","p-id":"13591"}),(0,r.jsx)("path",{d:"M656.38 438.7h19.5v393.56h-19.5z",fill:"#FFFFFF",opacity:".4","p-id":"13592"}),(0,r.jsx)("path",{d:"M732.04 438.7h19.5v393.56h-19.5z",fill:"#1C1817",opacity:".2","p-id":"13593"}),(0,r.jsx)("path",{d:"M848.34 302.306h19.5V832.26h-19.5z",fill:"#FFFFFF",opacity:".4","p-id":"13594"}),(0,r.jsx)("path",{d:"M924 302.306h19.5V832.26H924z",fill:"#1C1817",opacity:".2","p-id":"13595"})]})},a=function(){return(0,r.jsx)("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4946",className:"w-full h-full",children:(0,r.jsx)("path",{d:"M512 128C323.413333 128 170.666667 204.373333 170.666667 298.666667s152.746667 170.666667 341.333333 170.666666 341.333333-76.373333 341.333333-170.666666-152.746667-170.666667-341.333333-170.666667M170.666667 384v128c0 94.293333 152.746667 170.666667 341.333333 170.666667s341.333333-76.373333 341.333333-170.666667V384c0 94.293333-152.746667 170.666667-341.333333 170.666667s-341.333333-76.373333-341.333333-170.666667m0 213.333333v128c0 94.293333 152.746667 170.666667 341.333333 170.666667s341.333333-76.373333 341.333333-170.666667v-128c0 94.293333-152.746667 170.666667-341.333333 170.666667s-341.333333-76.373333-341.333333-170.666667z",fill:"#FFCA28","p-id":"4947"})})},l=function(){return(0,r.jsxs)("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"27999",className:"w-full h-full",children:[(0,r.jsx)("path",{d:"M701.781333 199.68a22.869333 22.869333 0 0 1 22.698667 22.186667v349.696h45.738667l34.133333-392.533334a22.698667 22.698667 0 0 0-20.650667-24.576L315.221333 113.834667A22.869333 22.869333 0 0 0 290.133333 134.656l-5.632 65.024z",fill:"#FFC670","p-id":"28000"}),(0,r.jsx)("path",{d:"M313.002667 674.816A25.6 25.6 0 0 1 338.773333 648.533333h154.965334a51.2 51.2 0 0 0 32.085333-11.264l69.12-54.954666a51.2 51.2 0 0 1 32.085333-11.264h97.450667V221.866667a22.869333 22.869333 0 0 0-22.698667-22.869334H231.253333A22.869333 22.869333 0 0 0 208.554667 221.866667v638.805333a22.698667 22.698667 0 0 0 22.698666 22.698667h81.749334z",fill:"#FFF6E6","p-id":"28001"}),(0,r.jsx)("path",{d:"M724.48 571.562667v-94.890667a472.234667 472.234667 0 0 1-38.570667 94.890667zM313.002667 757.418667a514.56 514.56 0 0 1-104.448-15.36v119.466666a22.698667 22.698667 0 0 0 22.698666 22.698667h81.749334z",fill:"#FFEBCC","p-id":"28002"}),(0,r.jsx)("path",{d:"M594.944 582.826667l-69.12 54.954666a51.2 51.2 0 0 1-32.085333 11.264h-154.965334a25.6 25.6 0 0 0-25.770666 25.770667v209.578667a25.770667 25.770667 0 0 0 25.770666 25.770666h450.901334a25.941333 25.941333 0 0 0 25.770666-25.770666V597.333333a25.941333 25.941333 0 0 0-25.770666-25.770666h-162.645334a51.2 51.2 0 0 0-32.085333 11.264z",fill:"#96DDFF","p-id":"28003"}),(0,r.jsx)("path",{d:"M564.224 840.874667a971.776 971.776 0 0 1-251.221333-31.402667v74.922667a25.770667 25.770667 0 0 0 25.770666 25.770666h450.901334a25.941333 25.941333 0 0 0 25.770666-25.770666v-74.922667a971.776 971.776 0 0 1-251.221333 31.402667z",fill:"#69BAF9","p-id":"28004"}),(0,r.jsx)("path",{d:"M789.674667 554.496h-0.853334l32.768-373.418667A39.936 39.936 0 0 0 785.066667 137.898667l-468.48-40.96A40.106667 40.106667 0 0 0 273.066667 133.12l-4.266667 49.664h-37.546667A39.765333 39.765333 0 0 0 191.488 221.866667v638.805333a39.765333 39.765333 0 0 0 39.765333 39.765333h68.266667a43.178667 43.178667 0 0 0 39.765333 26.794667h450.389334a43.008 43.008 0 0 0 42.837333-42.837333V597.333333a43.008 43.008 0 0 0-42.837333-42.837333zM307.2 136.533333a5.632 5.632 0 0 1 6.144-5.12l468.650667 40.96a5.632 5.632 0 0 1 5.12 6.144l-32.597334 375.978667h-12.970666V221.866667a39.765333 39.765333 0 0 0-39.765334-39.765334H303.445333z m-11.605333 538.794667v190.976h-64.341334a5.632 5.632 0 0 1-5.632-5.632V221.866667a5.632 5.632 0 0 1 5.632-5.632h470.528a5.632 5.632 0 0 1 5.632 5.632v332.629333h-80.384a68.266667 68.266667 0 0 0-42.666666 15.018667l-69.12 54.954666a34.133333 34.133333 0 0 1-21.504 7.509334h-154.965334a42.837333 42.837333 0 0 0-42.837333 42.837333z m502.784 209.066667a8.704 8.704 0 0 1-8.704 8.704H338.773333a8.704 8.704 0 0 1-8.704-8.704V674.816a8.704 8.704 0 0 1 8.704-8.704h154.965334a68.266667 68.266667 0 0 0 42.837333-15.018667l68.266667-54.954666a35.328 35.328 0 0 1 21.504-7.509334h162.645333a8.704 8.704 0 0 1 8.704 8.704z",fill:"#3D3D63","p-id":"28005"}),(0,r.jsx)("path",{d:"M744.789333 823.808h-64.341333a17.066667 17.066667 0 0 0 0 34.133333h64.341333a17.066667 17.066667 0 0 0 0-34.133333zM421.546667 309.248H512a17.066667 17.066667 0 0 0 0-34.133333h-90.453333a17.066667 17.066667 0 0 0 0 34.133333zM324.266667 406.016h283.989333a17.066667 17.066667 0 0 0 0-34.133333H324.266667a17.066667 17.066667 0 0 0 0 34.133333zM625.322667 474.965333a17.066667 17.066667 0 0 0-17.066667-17.066666H324.266667a17.066667 17.066667 0 0 0 0 34.133333h283.989333a17.066667 17.066667 0 0 0 17.066667-17.066667z",fill:"#3D3D63","p-id":"28006"})]})},s=function(){return(0,r.jsxs)("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7028",className:"w-full h-full",children:[(0,r.jsx)("path",{d:"M163.560759 0.702493A152.675051 152.675051 0 0 0 11.822365 153.377544v632.243311a152.675051 152.675051 0 0 0 151.738394 151.738395h476.055797a152.675051 152.675051 0 0 0 152.675052-152.675052V314.950835A57.136062 57.136062 0 0 0 775.197622 274.674594L519.256163 17.093986a58.072719 58.072719 0 0 0-41.212898-17.093986z",fill:"#41CC8B","p-id":"7029"}),(0,r.jsx)("path",{d:"M775.197622 274.674594L519.256163 17.093986a57.604391 57.604391 0 0 0-29.738852-15.689001 5.854105 5.854105 0 0 0-6.790762 5.854105V131.834439a178.433112 178.433112 0 0 0 178.433113 178.433112H784.564189a5.854105 5.854105 0 0 0 5.854105-6.790762A55.965241 55.965241 0 0 0 775.197622 274.674594z",fill:"#05B25F","p-id":"7030"}),(0,r.jsx)("path",{d:"M667.482095 281.69952h114.03796a51.98445 51.98445 0 0 0-6.322433-7.024926L519.256163 17.093986l-7.727418-6.322433v114.506288A156.187514 156.187514 0 0 0 667.482095 281.69952z",fill:"#B0F9D7","p-id":"7031"}),(0,r.jsx)("path",{d:"M92.140681 419.856391h117.082095v28.333867H128.904459v39.807913h67.205123v28.802195H128.904459v46.832838h81.957466v28.802195H92.140681zM274.554585 523.825292L232.639195 462.005946h40.510405l14.284015 23.416419q6.322433 11.239881 12.644867 21.777269l5.151612-10.771553 6.322433-11.005716 11.942374-23.416419H363.068649l-41.91539 66.268465 44.72536 63.69266h-40.978733l-15.923165-23.416419L302.185959 555.671621l-7.024925-11.239881-7.024926 11.239881-6.088269 11.70821-13.347359 23.416419H229.829225zM400.534919 576.980563a65.565973 65.565973 0 0 1-19.903956-50.111137 64.629316 64.629316 0 0 1 21.777269-50.813629 76.57169 76.57169 0 0 1 51.047794-17.796478 66.50263 66.50263 0 0 1 41.681225 14.518179l-17.796478 22.011434a35.124628 35.124628 0 0 0-22.011434-8.664075 33.251315 33.251315 0 0 0-26.226389 11.239881 41.447062 41.447062 0 0 0-10.303224 29.504688 40.978733 40.978733 0 0 0 10.06906 28.802195 32.782987 32.782987 0 0 0 25.523896 11.005717 46.832838 46.832838 0 0 0 27.865539-11.005717l14.752344 23.416419a72.590899 72.590899 0 0 1-46.832838 15.689001 70.249257 70.249257 0 0 1-49.642808-17.796478zM535.88182 576.746398a63.926824 63.926824 0 0 1-20.840613-49.876972 67.439287 67.439287 0 0 1 20.372285-50.345301 65.565973 65.565973 0 0 1 46.832838-18.264806 57.838555 57.838555 0 0 1 44.72536 17.562314 65.331809 65.331809 0 0 1 14.986508 44.72536 51.047793 51.047793 0 0 1-1.873313 15.454836h-88.514064a35.827121 35.827121 0 0 0 13.113195 23.416419 40.276241 40.276241 0 0 0 26.460553 8.429911 62.990167 62.990167 0 0 0 32.080494-9.132403l12.87903 21.074777a93.665676 93.665676 0 0 1-50.111136 14.284015 71.420078 71.420078 0 0 1-50.111137-17.32815z m73.527556-63.224331c0-19.201464-9.132403-28.802195-27.163046-28.802195a29.504688 29.504688 0 0 0-20.138121 7.25909 33.719643 33.719643 0 0 0-11.005716 21.543105zM672.399543 555.671621v-149.396752h37.232106V555.671621a10.771553 10.771553 0 0 0 2.575806 7.961583 6.322433 6.322433 0 0 0 5.151612 2.341642h5.151612l4.44912 25.289732a53.857764 53.857764 0 0 1-19.435628 3.044135c-23.416419 0.468328-35.124628-12.644866-35.124628-38.637092z",fill:"#F5F6FA","p-id":"7032"})]})},c=function(){return(0,r.jsxs)("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"34873",className:"w-full h-full",children:[(0,r.jsx)("path",{d:"M392.32 403.84a48 48 0 0 1-48 48h-96a48 48 0 0 1-48-48V236.16h192z",fill:"#EA5E5A","p-id":"34874"}),(0,r.jsx)("path",{d:"M259.84 176h24.32v24.32h-24.32zM307.84 176h24.32v24.32h-24.32z",fill:"#34303D","p-id":"34875"}),(0,r.jsx)("path",{d:"M380.16 236.16h-24.32V152.32H236.16v83.84h-24.32V128h168.32v108.16z",fill:"#34303D","p-id":"34876"}),(0,r.jsx)("path",{d:"M344.32 464h-96a60.16 60.16 0 0 1-60.16-60.16V224h215.68v179.84a60.16 60.16 0 0 1-60.16 60.16zM211.84 248.32v155.52a35.84 35.84 0 0 0 35.84 35.84h96a35.84 35.84 0 0 0 35.84-35.84V248.32z",fill:"#34303D","p-id":"34877"}),(0,r.jsx)("path",{d:"M236.16 272h120.32v24.32H236.16zM236.16 320h120.32v24.32H236.16zM320 512h-48a24.32 24.32 0 0 1-23.68-23.68v-36.48h24.32v35.84H320v-35.84h24.32v35.84A24.32 24.32 0 0 1 320 512z",fill:"#34303D","p-id":"34878"}),(0,r.jsx)("path",{d:"M632.32 620.16a48 48 0 0 1 48-48h96a48 48 0 0 1 48 48v168.32h-192z",fill:"#EA5E5A","p-id":"34879"}),(0,r.jsx)("path",{d:"M739.84 824.32h24.32v24.32h-24.32zM691.84 824.32h24.32v24.32h-24.32z",fill:"#34303D","p-id":"34880"}),(0,r.jsx)("path",{d:"M812.16 896h-168.32v-108.16h24.32v84.48h119.68v-84.48h24.32V896z",fill:"#34303D","p-id":"34881"}),(0,r.jsx)("path",{d:"M835.84 800H620.16V620.16a60.16 60.16 0 0 1 60.16-60.16h96a60.16 60.16 0 0 1 60.16 60.16z m-192-23.68h168.32V620.16a35.84 35.84 0 0 0-35.84-35.84h-96a35.84 35.84 0 0 0-35.84 35.84z",fill:"#34303D","p-id":"34882"}),(0,r.jsx)("path",{d:"M668.16 680.32h120.32v24.32h-120.32zM668.16 728.32h120.32v24.32h-120.32zM776.32 572.16h-23.68v-35.84H704v35.84h-23.68v-35.84A24.32 24.32 0 0 1 704 512h48a24.32 24.32 0 0 1 24.32 24.32z",fill:"#34303D","p-id":"34883"}),(0,r.jsx)("path",{d:"M403.84 848a120.32 120.32 0 0 1-119.68-119.68V499.84h24.32v227.84a96 96 0 0 0 192 0V296.32a120.32 120.32 0 0 1 240 0v227.84h-23.68V296.32a96 96 0 0 0-192 0v432a120.32 120.32 0 0 1-119.68 120.32z",fill:"#34303D","p-id":"34884"}),(0,r.jsx)("path",{d:"M608 284.16h24.32v24.32H608zM608 332.16h24.32v24.32H608zM608 380.16h24.32v24.32H608zM392.32 620.16h24.32v24.32h-24.32zM392.32 668.16h24.32v24.32h-24.32zM392.32 716.16h24.32v24.32h-24.32z",fill:"#34303D","p-id":"34885"}),(0,r.jsx)("path",{d:"M691.84 296.32h-23.68a48 48 0 0 0-96 0h-24.32a72.32 72.32 0 0 1 144 0zM403.84 800a72.32 72.32 0 0 1-71.68-71.68h24.32a48 48 0 0 0 96 0h24.32a72.32 72.32 0 0 1-72.96 71.68z",fill:"#34303D","p-id":"34886"})]})},u=function(){return(0,r.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",children:(0,r.jsx)("path",{d:"M593.054 120.217C483.656 148.739 402.91 248.212 402.91 366.546c0 140.582 113.962 254.544 254.544 254.544 118.334 0 217.808-80.746 246.328-190.144C909.17 457.12 912 484.23 912 512c0 220.914-179.086 400-400 400S112 732.914 112 512s179.086-400 400-400c27.77 0 54.88 2.83 81.054 8.217z","p-id":"5941"})})},f=function(){return(0,r.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",version:"1.1",children:(0,r.jsx)("path",{d:"M513.89 950.72c-5.5 0-11-1.4-15.99-4.2L143.84 743c-9.85-5.73-15.99-16.17-15.99-27.64V308.58c0-11.33 6.14-21.91 15.99-27.64L497.9 77.43c9.85-5.73 22.14-5.73 31.99 0l354.06 203.52c9.85 5.73 15.99 16.17 15.99 27.64V715.5c0 11.33-6.14 21.91-15.99 27.64L529.89 946.52c-4.99 2.8-10.49 4.2-16 4.2zM191.83 697.15L513.89 882.2l322.07-185.05V326.92L513.89 141.87 191.83 326.92v370.23z m322.06-153.34c-5.37 0-10.88-1.4-15.99-4.33L244.29 393.91c-15.35-8.79-20.6-28.27-11.77-43.56 8.83-15.28 28.41-20.5 43.76-11.72l253.61 145.7c15.35 8.79 20.6 28.27 11.77 43.56-6.01 10.32-16.76 15.92-27.77 15.92z m0 291.52c-17.66 0-31.99-14.26-31.99-31.84V530.44L244.55 393.91s-0.13 0-0.13-0.13l-100.45-57.69c-15.35-8.79-20.6-28.27-11.77-43.56s28.41-20.5 43.76-11.72l354.06 203.52c9.85 5.73 15.99 16.17 15.99 27.64v291.39c-0.13 17.71-14.46 31.97-32.12 31.97z m0 115.39c-17.66 0-31.99-14.26-31.99-31.84V511.97c0-17.58 14.33-31.84 31.99-31.84s31.99 14.26 31.99 31.84v406.91c0 17.7-14.33 31.84-31.99 31.84z m0-406.91c-11 0-21.75-5.73-27.77-15.92-8.83-15.28-3.58-34.64 11.77-43.56l354.06-203.52c15.35-8.79 34.8-3.57 43.76 11.72 8.83 15.28 3.58 34.64-11.77 43.56L529.89 539.61c-4.99 2.93-10.49 4.2-16 4.2z"})})},d=function(){return(0,r.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",version:"1.1",children:(0,r.jsx)("path",{d:"M602.24 246.72a17.28 17.28 0 0 0-11.84-16.32l-42.88-14.4A90.56 90.56 0 0 1 490.24 160l-14.4-42.88a17.28 17.28 0 0 0-32 0L428.8 160a90.56 90.56 0 0 1-57.28 57.28l-42.88 14.4a17.28 17.28 0 0 0 0 32l42.88 14.4a90.56 90.56 0 0 1 57.28 57.28l14.4 42.88a17.28 17.28 0 0 0 32 0l14.4-42.88a90.56 90.56 0 0 1 57.28-57.28l42.88-14.4a17.28 17.28 0 0 0 12.48-16.96z m301.12 221.76l-48.32-16a101.44 101.44 0 0 1-64-64l-16-48.32a19.2 19.2 0 0 0-36.8 0l-16 48.32a101.44 101.44 0 0 1-64 64l-48.32 16a19.2 19.2 0 0 0 0 36.8l48.32 16a101.44 101.44 0 0 1 64 64l16 48.32a19.2 19.2 0 0 0 36.8 0l16-48.32a101.44 101.44 0 0 1 64-64l48.32-16a19.2 19.2 0 0 0 0-36.8z m-376.64 195.52l-64-20.8a131.84 131.84 0 0 1-83.52-83.52l-20.8-64a25.28 25.28 0 0 0-47.68 0l-20.8 64a131.84 131.84 0 0 1-82.24 83.52l-64 20.8a25.28 25.28 0 0 0 0 47.68l64 20.8a131.84 131.84 0 0 1 83.52 83.84l20.8 64a25.28 25.28 0 0 0 47.68 0l20.8-64a131.84 131.84 0 0 1 83.52-83.52l64-20.8a25.28 25.28 0 0 0 0-47.68z","p-id":"3992"})})},p=function(){return(0,r.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",children:(0,r.jsx)("path",{d:"M554.6 64h-85.4v128h85.4V64z m258.2 87.4L736 228.2l59.8 59.8 76.8-76.8-59.8-59.8z m-601.6 0l-59.8 59.8 76.8 76.8 59.8-59.8-76.8-76.8zM512 256c-140.8 0-256 115.2-256 256s115.2 256 256 256 256-115.2 256-256-115.2-256-256-256z m448 213.4h-128v85.4h128v-85.4z m-768 0H64v85.4h128v-85.4zM795.8 736L736 795.8l76.8 76.8 59.8-59.8-76.8-76.8z m-567.6 0l-76.8 76.8 59.8 59.8 76.8-76.8-59.8-59.8z m326.4 96h-85.4v128h85.4v-128z","p-id":"7802"})})};function h(){return(0,r.jsxs)("svg",{className:"mr-1",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4602",width:"1.5em",height:"1.5em",children:[(0,r.jsx)("path",{d:"M688 312v-48c0-4.4-3.6-8-8-8H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8zM296 400c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H296zM672 516c-119.3 0-216 96.7-216 216s96.7 216 216 216 216-96.7 216-216-96.7-216-216-216z m107.5 323.5C750.8 868.2 712.6 884 672 884s-78.8-15.8-107.5-44.5C535.8 810.8 520 772.6 520 732s15.8-78.8 44.5-107.5C593.2 595.8 631.4 580 672 580s78.8 15.8 107.5 44.5C808.2 653.2 824 691.4 824 732s-15.8 78.8-44.5 107.5z","p-id":"4603",fill:"#87d068"}),(0,r.jsx)("path",{d:"M761 656h-44.3c-2.6 0-5 1.2-6.5 3.3l-63.5 87.8-23.1-31.9c-1.5-2.1-3.9-3.3-6.5-3.3H573c-6.5 0-10.3 7.4-6.5 12.7l73.8 102.1c3.2 4.4 9.7 4.4 12.9 0l114.2-158c3.9-5.3 0.1-12.7-6.4-12.7z","p-id":"4604",fill:"#87d068"}),(0,r.jsx)("path",{d:"M440 852H208V148h560v344c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h272c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z","p-id":"4605",fill:"#87d068"})]})}function m(){return(0,r.jsxs)("svg",{className:"mr-1",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4838",width:"1.5em",height:"1.5em",children:[(0,r.jsx)("path",{d:"M296 256c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H296zM488 456v-48c0-4.4-3.6-8-8-8H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8z","p-id":"4839",fill:"#2db7f5"}),(0,r.jsx)("path",{d:"M440 852H208V148h560v344c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h272c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z","p-id":"4840",fill:"#2db7f5"}),(0,r.jsx)("path",{d:"M544.1 736.4c1.8-34.5 16.2-66.8 40.8-91.4 26.2-26.2 62-41 99.1-41 37.4 0 72.6 14.6 99.1 41 3.2 3.2 6.3 6.6 9.2 10.1L769.2 673c-5.3 4.1-3.5 12.5 3 14.1l93.3 22.5c5 1.2 9.8-2.6 9.9-7.7l0.6-95.4c0-6.7-7.6-10.5-12.9-6.4l-20.3 15.8C805.4 569.6 748.1 540 684 540c-109.9 0-199.6 86.9-204 195.7-0.2 4.5 3.5 8.3 8 8.3h48.1c4.3 0 7.8-3.3 8-7.6zM880 744h-48.1c-4.3 0-7.8 3.3-8 7.6-1.8 34.5-16.2 66.8-40.8 91.4-26.2 26.2-62 41-99.1 41-37.4 0-72.6-14.6-99.1-41-3.2-3.2-6.3-6.6-9.2-10.1l23.1-17.9c5.3-4.1 3.5-12.5-3-14.1l-93.3-22.5c-5-1.2-9.8 2.6-9.9 7.7l-0.6 95.4c0 6.7 7.6 10.5 12.9 6.4l20.3-15.8C562.6 918.4 619.9 948 684 948c109.9 0 199.6-86.9 204-195.7 0.2-4.5-3.5-8.3-8-8.3z","p-id":"4841",fill:"#2db7f5"})]})}n(67294)},32665:function(e,t,n){"use strict";function r(e){}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"clientHookInServerComponentError",{enumerable:!0,get:function(){return r}}),n(38754),n(67294),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},41219:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ReadonlyURLSearchParams:function(){return p},useSearchParams:function(){return h},usePathname:function(){return m},ServerInsertedHTMLContext:function(){return s.ServerInsertedHTMLContext},useServerInsertedHTML:function(){return s.useServerInsertedHTML},useRouter:function(){return g},useParams:function(){return v},useSelectedLayoutSegments:function(){return y},useSelectedLayoutSegment:function(){return b},redirect:function(){return c.redirect},notFound:function(){return u.notFound}});let r=n(67294),o=n(27473),i=n(35802),a=n(32665),l=n(43512),s=n(98751),c=n(96885),u=n(86323),f=Symbol("internal for urlsearchparams readonly");function d(){return Error("ReadonlyURLSearchParams cannot be modified")}class p{[Symbol.iterator](){return this[f][Symbol.iterator]()}append(){throw d()}delete(){throw d()}set(){throw d()}sort(){throw d()}constructor(e){this[f]=e,this.entries=e.entries.bind(e),this.forEach=e.forEach.bind(e),this.get=e.get.bind(e),this.getAll=e.getAll.bind(e),this.has=e.has.bind(e),this.keys=e.keys.bind(e),this.values=e.values.bind(e),this.toString=e.toString.bind(e)}}function h(){(0,a.clientHookInServerComponentError)("useSearchParams");let e=(0,r.useContext)(i.SearchParamsContext),t=(0,r.useMemo)(()=>e?new p(e):null,[e]);return t}function m(){return(0,a.clientHookInServerComponentError)("usePathname"),(0,r.useContext)(i.PathnameContext)}function g(){(0,a.clientHookInServerComponentError)("useRouter");let e=(0,r.useContext)(o.AppRouterContext);if(null===e)throw Error("invariant expected app router to be mounted");return e}function v(){(0,a.clientHookInServerComponentError)("useParams");let e=(0,r.useContext)(o.GlobalLayoutRouterContext);return e?function e(t,n){void 0===n&&(n={});let r=t[1];for(let t of Object.values(r)){let r=t[0],o=Array.isArray(r),i=o?r[1]:r;!i||i.startsWith("__PAGE__")||(o&&(n[r[0]]=r[1]),n=e(t,n))}return n}(e.tree):null}function y(e){void 0===e&&(e="children"),(0,a.clientHookInServerComponentError)("useSelectedLayoutSegments");let{tree:t}=(0,r.useContext)(o.LayoutRouterContext);return function e(t,n,r,o){let i;if(void 0===r&&(r=!0),void 0===o&&(o=[]),r)i=t[1][n];else{var a;let e=t[1];i=null!=(a=e.children)?a:Object.values(e)[0]}if(!i)return o;let s=i[0],c=(0,l.getSegmentValue)(s);return!c||c.startsWith("__PAGE__")?o:(o.push(c),e(i,n,!1,o))}(t,e)}function b(e){void 0===e&&(e="children"),(0,a.clientHookInServerComponentError)("useSelectedLayoutSegment");let t=y(e);return 0===t.length?null:t[0]}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},86323:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{notFound:function(){return r},isNotFoundError:function(){return o}});let n="NEXT_NOT_FOUND";function r(){let e=Error(n);throw e.digest=n,e}function o(e){return(null==e?void 0:e.digest)===n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},96885:function(e,t,n){"use strict";var r,o;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{RedirectType:function(){return r},getRedirectError:function(){return l},redirect:function(){return s},isRedirectError:function(){return c},getURLFromRedirectError:function(){return u},getRedirectTypeFromError:function(){return f}});let i=n(68214),a="NEXT_REDIRECT";function l(e,t){let n=Error(a);n.digest=a+";"+t+";"+e;let r=i.requestAsyncStorage.getStore();return r&&(n.mutableCookies=r.mutableCookies),n}function s(e,t){throw void 0===t&&(t="replace"),l(e,t)}function c(e){if("string"!=typeof(null==e?void 0:e.digest))return!1;let[t,n,r]=e.digest.split(";",3);return t===a&&("replace"===n||"push"===n)&&"string"==typeof r}function u(e){return c(e)?e.digest.split(";",3)[2]:null}function f(e){if(!c(e))throw Error("Not a redirect error");return e.digest.split(";",3)[1]}(o=r||(r={})).push="push",o.replace="replace",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},43512:function(e,t){"use strict";function n(e){return Array.isArray(e)?e[1]:e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSegmentValue",{enumerable:!0,get:function(){return n}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},29382:function(e,t){"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{PrefetchKind:function(){return n},ACTION_REFRESH:function(){return o},ACTION_NAVIGATE:function(){return i},ACTION_RESTORE:function(){return a},ACTION_SERVER_PATCH:function(){return l},ACTION_PREFETCH:function(){return s},ACTION_FAST_REFRESH:function(){return c},ACTION_SERVER_ACTION:function(){return u}});let o="refresh",i="navigate",a="restore",l="server-patch",s="prefetch",c="fast-refresh",u="server-action";(r=n||(n={})).AUTO="auto",r.FULL="full",r.TEMPORARY="temporary",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},75476:function(e,t){"use strict";function n(e,t,n,r){return!1}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getDomainLocale",{enumerable:!0,get:function(){return n}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},69873:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return y}});let r=n(38754),o=n(61757),i=o._(n(67294)),a=r._(n(68965)),l=n(38083),s=n(2478),c=n(76226);n(59941);let u=r._(n(31720)),f={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image/",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0};function d(e){return void 0!==e.default}function p(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function h(e,t,n,r,o,i,a){if(!e||e["data-loaded-src"]===t)return;e["data-loaded-src"]=t;let l="decode"in e?e.decode():Promise.resolve();l.catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("blur"===n&&i(!0),null==r?void 0:r.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let n=!1,o=!1;r.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>n,isPropagationStopped:()=>o,persist:()=>{},preventDefault:()=>{n=!0,t.preventDefault()},stopPropagation:()=>{o=!0,t.stopPropagation()}})}(null==o?void 0:o.current)&&o.current(e)}})}function m(e){let[t,n]=i.version.split("."),r=parseInt(t,10),o=parseInt(n,10);return r>18||18===r&&o>=3?{fetchPriority:e}:{fetchpriority:e}}let g=(0,i.forwardRef)((e,t)=>{let{imgAttributes:n,heightInt:r,widthInt:o,qualityInt:a,className:l,imgStyle:s,blurStyle:c,isLazy:u,fetchPriority:f,fill:d,placeholder:p,loading:g,srcString:v,config:y,unoptimized:b,loader:x,onLoadRef:w,onLoadingCompleteRef:C,setBlurComplete:S,setShowAltText:E,onLoad:$,onError:O,...k}=e;return g=u?"lazy":g,i.default.createElement("img",{...k,...m(f),loading:g,width:o,height:r,decoding:"async","data-nimg":d?"fill":"1",className:l,style:{...s,...c},...n,ref:(0,i.useCallback)(e=>{t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e)),e&&(O&&(e.src=e.src),e.complete&&h(e,v,p,w,C,S,b))},[v,p,w,C,S,O,b,t]),onLoad:e=>{let t=e.currentTarget;h(t,v,p,w,C,S,b)},onError:e=>{E(!0),"blur"===p&&S(!0),O&&O(e)}})}),v=(0,i.forwardRef)((e,t)=>{var n;let r,o,{src:h,sizes:v,unoptimized:y=!1,priority:b=!1,loading:x,className:w,quality:C,width:S,height:E,fill:$,style:O,onLoad:k,onLoadingComplete:j,placeholder:P="empty",blurDataURL:Z,fetchPriority:_,layout:A,objectFit:R,objectPosition:M,lazyBoundary:N,lazyRoot:T,...F}=e,I=(0,i.useContext)(c.ImageConfigContext),L=(0,i.useMemo)(()=>{let e=f||I||s.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),n=e.deviceSizes.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:n}},[I]),B=F.loader||u.default;delete F.loader;let z="__next_img_default"in B;if(z){if("custom"===L.loader)throw Error('Image with src "'+h+'" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader')}else{let e=B;B=t=>{let{config:n,...r}=t;return e(r)}}if(A){"fill"===A&&($=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[A];e&&(O={...O,...e});let t={responsive:"100vw",fill:"100vw"}[A];t&&!v&&(v=t)}let D="",H=p(S),V=p(E);if("object"==typeof(n=h)&&(d(n)||void 0!==n.src)){let e=d(h)?h.default:h;if(!e.src)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(e));if(!e.height||!e.width)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(e));if(r=e.blurWidth,o=e.blurHeight,Z=Z||e.blurDataURL,D=e.src,!$){if(H||V){if(H&&!V){let t=H/e.width;V=Math.round(e.height*t)}else if(!H&&V){let t=V/e.height;H=Math.round(e.width*t)}}else H=e.width,V=e.height}}let U=!b&&("lazy"===x||void 0===x);(!(h="string"==typeof h?h:D)||h.startsWith("data:")||h.startsWith("blob:"))&&(y=!0,U=!1),L.unoptimized&&(y=!0),z&&h.endsWith(".svg")&&!L.dangerouslyAllowSVG&&(y=!0),b&&(_="high");let[W,q]=(0,i.useState)(!1),[K,G]=(0,i.useState)(!1),X=p(C),Y=Object.assign($?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:R,objectPosition:M}:{},K?{}:{color:"transparent"},O),J="blur"===P&&Z&&!W?{backgroundSize:Y.objectFit||"cover",backgroundPosition:Y.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:'url("data:image/svg+xml;charset=utf-8,'+(0,l.getImageBlurSvg)({widthInt:H,heightInt:V,blurWidth:r,blurHeight:o,blurDataURL:Z,objectFit:Y.objectFit})+'")'}:{},Q=function(e){let{config:t,src:n,unoptimized:r,width:o,quality:i,sizes:a,loader:l}=e;if(r)return{src:n,srcSet:void 0,sizes:void 0};let{widths:s,kind:c}=function(e,t,n){let{deviceSizes:r,allSizes:o}=e;if(n){let e=/(^|\s)(1?\d?\d)vw/g,t=[];for(let r;r=e.exec(n);r)t.push(parseInt(r[2]));if(t.length){let e=.01*Math.min(...t);return{widths:o.filter(t=>t>=r[0]*e),kind:"w"}}return{widths:o,kind:"w"}}if("number"!=typeof t)return{widths:r,kind:"w"};let i=[...new Set([t,2*t].map(e=>o.find(t=>t>=e)||o[o.length-1]))];return{widths:i,kind:"x"}}(t,o,a),u=s.length-1;return{sizes:a||"w"!==c?a:"100vw",srcSet:s.map((e,r)=>l({config:t,src:n,quality:i,width:e})+" "+("w"===c?e:r+1)+c).join(", "),src:l({config:t,src:n,quality:i,width:s[u]})}}({config:L,src:h,unoptimized:y,width:H,quality:X,sizes:v,loader:B}),ee=h,et=(0,i.useRef)(k);(0,i.useEffect)(()=>{et.current=k},[k]);let en=(0,i.useRef)(j);(0,i.useEffect)(()=>{en.current=j},[j]);let er={isLazy:U,imgAttributes:Q,heightInt:V,widthInt:H,qualityInt:X,className:w,imgStyle:Y,blurStyle:J,loading:x,config:L,fetchPriority:_,fill:$,unoptimized:y,placeholder:P,loader:B,srcString:ee,onLoadRef:et,onLoadingCompleteRef:en,setBlurComplete:q,setShowAltText:G,...F};return i.default.createElement(i.default.Fragment,null,i.default.createElement(g,{...er,ref:t}),b?i.default.createElement(a.default,null,i.default.createElement("link",{key:"__nimg-"+Q.src+Q.srcSet+Q.sizes,rel:"preload",as:"image",href:Q.srcSet?void 0:Q.src,imageSrcSet:Q.srcSet,imageSizes:Q.sizes,crossOrigin:F.crossOrigin,referrerPolicy:F.referrerPolicy,...m(_)})):null)}),y=v;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9940:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return x}});let r=n(38754),o=r._(n(67294)),i=n(65722),a=n(65723),l=n(28904),s=n(95514),c=n(27521),u=n(44293),f=n(27473),d=n(81307),p=n(75476),h=n(66318),m=n(29382),g=new Set;function v(e,t,n,r,o,i){if(!i&&!(0,a.isLocalURL)(t))return;if(!r.bypassPrefetchedCheck){let o=void 0!==r.locale?r.locale:"locale"in e?e.locale:void 0,i=t+"%"+n+"%"+o;if(g.has(i))return;g.add(i)}let l=i?e.prefetch(t,o):e.prefetch(t,n,r);Promise.resolve(l).catch(e=>{})}function y(e){return"string"==typeof e?e:(0,l.formatUrl)(e)}let b=o.default.forwardRef(function(e,t){let n,r;let{href:l,as:g,children:b,prefetch:x=null,passHref:w,replace:C,shallow:S,scroll:E,locale:$,onClick:O,onMouseEnter:k,onTouchStart:j,legacyBehavior:P=!1,...Z}=e;n=b,P&&("string"==typeof n||"number"==typeof n)&&(n=o.default.createElement("a",null,n));let _=!1!==x,A=null===x?m.PrefetchKind.AUTO:m.PrefetchKind.FULL,R=o.default.useContext(u.RouterContext),M=o.default.useContext(f.AppRouterContext),N=null!=R?R:M,T=!R,{href:F,as:I}=o.default.useMemo(()=>{if(!R){let e=y(l);return{href:e,as:g?y(g):e}}let[e,t]=(0,i.resolveHref)(R,l,!0);return{href:e,as:g?(0,i.resolveHref)(R,g):t||e}},[R,l,g]),L=o.default.useRef(F),B=o.default.useRef(I);P&&(r=o.default.Children.only(n));let z=P?r&&"object"==typeof r&&r.ref:t,[D,H,V]=(0,d.useIntersection)({rootMargin:"200px"}),U=o.default.useCallback(e=>{(B.current!==I||L.current!==F)&&(V(),B.current=I,L.current=F),D(e),z&&("function"==typeof z?z(e):"object"==typeof z&&(z.current=e))},[I,z,F,V,D]);o.default.useEffect(()=>{N&&H&&_&&v(N,F,I,{locale:$},{kind:A},T)},[I,F,H,$,_,null==R?void 0:R.locale,N,T,A]);let W={ref:U,onClick(e){P||"function"!=typeof O||O(e),P&&r.props&&"function"==typeof r.props.onClick&&r.props.onClick(e),N&&!e.defaultPrevented&&function(e,t,n,r,i,l,s,c,u,f){let{nodeName:d}=e.currentTarget,p="A"===d.toUpperCase();if(p&&(function(e){let t=e.currentTarget,n=t.getAttribute("target");return n&&"_self"!==n||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||!u&&!(0,a.isLocalURL)(n)))return;e.preventDefault();let h=()=>{"beforePopState"in t?t[i?"replace":"push"](n,r,{shallow:l,locale:c,scroll:s}):t[i?"replace":"push"](r||n,{forceOptimisticNavigation:!f})};u?o.default.startTransition(h):h()}(e,N,F,I,C,S,E,$,T,_)},onMouseEnter(e){P||"function"!=typeof k||k(e),P&&r.props&&"function"==typeof r.props.onMouseEnter&&r.props.onMouseEnter(e),N&&(_||!T)&&v(N,F,I,{locale:$,priority:!0,bypassPrefetchedCheck:!0},{kind:A},T)},onTouchStart(e){P||"function"!=typeof j||j(e),P&&r.props&&"function"==typeof r.props.onTouchStart&&r.props.onTouchStart(e),N&&(_||!T)&&v(N,F,I,{locale:$,priority:!0,bypassPrefetchedCheck:!0},{kind:A},T)}};if((0,s.isAbsoluteUrl)(I))W.href=I;else if(!P||w||"a"===r.type&&!("href"in r.props)){let e=void 0!==$?$:null==R?void 0:R.locale,t=(null==R?void 0:R.isLocaleDomain)&&(0,p.getDomainLocale)(I,e,null==R?void 0:R.locales,null==R?void 0:R.domainLocales);W.href=t||(0,h.addBasePath)((0,c.addLocale)(I,e,null==R?void 0:R.defaultLocale))}return P?o.default.cloneElement(r,W):o.default.createElement("a",{...Z,...W},n)}),x=b;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81307:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useIntersection",{enumerable:!0,get:function(){return s}});let r=n(67294),o=n(82997),i="function"==typeof IntersectionObserver,a=new Map,l=[];function s(e){let{rootRef:t,rootMargin:n,disabled:s}=e,c=s||!i,[u,f]=(0,r.useState)(!1),d=(0,r.useRef)(null),p=(0,r.useCallback)(e=>{d.current=e},[]);(0,r.useEffect)(()=>{if(i){if(c||u)return;let e=d.current;if(e&&e.tagName){let r=function(e,t,n){let{id:r,observer:o,elements:i}=function(e){let t;let n={root:e.root||null,margin:e.rootMargin||""},r=l.find(e=>e.root===n.root&&e.margin===n.margin);if(r&&(t=a.get(r)))return t;let o=new Map,i=new IntersectionObserver(e=>{e.forEach(e=>{let t=o.get(e.target),n=e.isIntersecting||e.intersectionRatio>0;t&&n&&t(n)})},e);return t={id:n,observer:i,elements:o},l.push(n),a.set(n,t),t}(n);return i.set(e,t),o.observe(e),function(){if(i.delete(e),o.unobserve(e),0===i.size){o.disconnect(),a.delete(r);let e=l.findIndex(e=>e.root===r.root&&e.margin===r.margin);e>-1&&l.splice(e,1)}}}(e,e=>e&&f(e),{root:null==t?void 0:t.current,rootMargin:n});return r}}else if(!u){let e=(0,o.requestIdleCallback)(()=>f(!0));return()=>(0,o.cancelIdleCallback)(e)}},[c,n,t,u,d.current]);let h=(0,r.useCallback)(()=>{f(!1)},[]);return[p,u,h]}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},38083:function(e,t){"use strict";function n(e){let{widthInt:t,heightInt:n,blurWidth:r,blurHeight:o,blurDataURL:i,objectFit:a}=e,l=r||t,s=o||n,c=i.startsWith("data:image/jpeg")?"%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='1 1'/%3E%3C/feComponentTransfer%3E%":"";return l&&s?"%3Csvg xmlns='http%3A//www.w3.org/2000/svg' viewBox='0 0 "+l+" "+s+"'%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='"+(r&&o?"1":"20")+"'/%3E"+c+"%3C/filter%3E%3Cimage preserveAspectRatio='none' filter='url(%23b)' x='0' y='0' height='100%25' width='100%25' href='"+i+"'/%3E%3C/svg%3E":"%3Csvg xmlns='http%3A//www.w3.org/2000/svg'%3E%3Cimage style='filter:blur(20px)' preserveAspectRatio='"+("contain"===a?"xMidYMid":"cover"===a?"xMidYMid slice":"none")+"' x='0' y='0' height='100%25' width='100%25' href='"+i+"'/%3E%3C/svg%3E"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return n}})},31720:function(e,t){"use strict";function n(e){let{config:t,src:n,width:r,quality:o}=e;return t.path+"?url="+encodeURIComponent(n)+"&w="+r+"&q="+(o||75)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}}),n.__next_img_default=!0;let r=n},98751:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ServerInsertedHTMLContext:function(){return i},useServerInsertedHTML:function(){return a}});let r=n(61757),o=r._(n(67294)),i=o.default.createContext(null);function a(e){let t=(0,o.useContext)(i);t&&t(e)}},48271:function(e,t,n){"use strict";let r,o;n.r(t),n.d(t,{default:function(){return eT}});var i=n(85893),a=n(67294),l=n(41468),s=n(50489),c=n(98399),u=n(82579),f=n(59766),d=n(87462),p=n(63366),h=n(71387),m=n(70917);function g(e){let{styles:t,defaultTheme:n={}}=e,r="function"==typeof t?e=>t(null==e||0===Object.keys(e).length?n:e):t;return(0,i.jsx)(m.xB,{styles:r})}var v=n(56760),y=n(71927);let b="mode",x="color-scheme",w="data-color-scheme";function C(e){if("undefined"!=typeof window&&"system"===e){let e=window.matchMedia("(prefers-color-scheme: dark)");return e.matches?"dark":"light"}}function S(e,t){return"light"===e.mode||"system"===e.mode&&"light"===e.systemMode?t("light"):"dark"===e.mode||"system"===e.mode&&"dark"===e.systemMode?t("dark"):void 0}function E(e,t){let n;if("undefined"!=typeof window){try{(n=localStorage.getItem(e)||void 0)||localStorage.setItem(e,t)}catch(e){}return n||t}}let $=["colorSchemes","components","generateCssVars","cssVarPrefix"];var O=n(1812),k=n(13951),j=n(2548);let{CssVarsProvider:P,useColorScheme:Z,getInitColorSchemeScript:_}=function(e){let{themeId:t,theme:n={},attribute:r=w,modeStorageKey:o=b,colorSchemeStorageKey:l=x,defaultMode:s="light",defaultColorScheme:c,disableTransitionOnChange:u=!1,resolveTheme:m,excludeVariablesFromRoot:O}=e;n.colorSchemes&&("string"!=typeof c||n.colorSchemes[c])&&("object"!=typeof c||n.colorSchemes[null==c?void 0:c.light])&&("object"!=typeof c||n.colorSchemes[null==c?void 0:c.dark])||console.error(`MUI: \`${c}\` does not exist in \`theme.colorSchemes\`.`);let k=a.createContext(void 0),j="string"==typeof c?c:c.light,P="string"==typeof c?c:c.dark;return{CssVarsProvider:function({children:e,theme:h=n,modeStorageKey:w=o,colorSchemeStorageKey:j=l,attribute:P=r,defaultMode:Z=s,defaultColorScheme:_=c,disableTransitionOnChange:A=u,storageWindow:R="undefined"==typeof window?void 0:window,documentNode:M="undefined"==typeof document?void 0:document,colorSchemeNode:N="undefined"==typeof document?void 0:document.documentElement,colorSchemeSelector:T=":root",disableNestedContext:F=!1,disableStyleSheetGeneration:I=!1}){let L=a.useRef(!1),B=(0,v.Z)(),z=a.useContext(k),D=!!z&&!F,H=h[t],V=H||h,{colorSchemes:U={},components:W={},generateCssVars:q=()=>({vars:{},css:{}}),cssVarPrefix:K}=V,G=(0,p.Z)(V,$),X=Object.keys(U),Y="string"==typeof _?_:_.light,J="string"==typeof _?_:_.dark,{mode:Q,setMode:ee,systemMode:et,lightColorScheme:en,darkColorScheme:er,colorScheme:eo,setColorScheme:ei}=function(e){let{defaultMode:t="light",defaultLightColorScheme:n,defaultDarkColorScheme:r,supportedColorSchemes:o=[],modeStorageKey:i=b,colorSchemeStorageKey:l=x,storageWindow:s="undefined"==typeof window?void 0:window}=e,c=o.join(","),[u,f]=a.useState(()=>{let e=E(i,t),o=E(`${l}-light`,n),a=E(`${l}-dark`,r);return{mode:e,systemMode:C(e),lightColorScheme:o,darkColorScheme:a}}),p=S(u,e=>"light"===e?u.lightColorScheme:"dark"===e?u.darkColorScheme:void 0),h=a.useCallback(e=>{f(n=>{if(e===n.mode)return n;let r=e||t;try{localStorage.setItem(i,r)}catch(e){}return(0,d.Z)({},n,{mode:r,systemMode:C(r)})})},[i,t]),m=a.useCallback(e=>{e?"string"==typeof e?e&&!c.includes(e)?console.error(`\`${e}\` does not exist in \`theme.colorSchemes\`.`):f(t=>{let n=(0,d.Z)({},t);return S(t,t=>{try{localStorage.setItem(`${l}-${t}`,e)}catch(e){}"light"===t&&(n.lightColorScheme=e),"dark"===t&&(n.darkColorScheme=e)}),n}):f(t=>{let o=(0,d.Z)({},t),i=null===e.light?n:e.light,a=null===e.dark?r:e.dark;if(i){if(c.includes(i)){o.lightColorScheme=i;try{localStorage.setItem(`${l}-light`,i)}catch(e){}}else console.error(`\`${i}\` does not exist in \`theme.colorSchemes\`.`)}if(a){if(c.includes(a)){o.darkColorScheme=a;try{localStorage.setItem(`${l}-dark`,a)}catch(e){}}else console.error(`\`${a}\` does not exist in \`theme.colorSchemes\`.`)}return o}):f(e=>{try{localStorage.setItem(`${l}-light`,n),localStorage.setItem(`${l}-dark`,r)}catch(e){}return(0,d.Z)({},e,{lightColorScheme:n,darkColorScheme:r})})},[c,l,n,r]),g=a.useCallback(e=>{"system"===u.mode&&f(t=>(0,d.Z)({},t,{systemMode:null!=e&&e.matches?"dark":"light"}))},[u.mode]),v=a.useRef(g);return v.current=g,a.useEffect(()=>{let e=(...e)=>v.current(...e),t=window.matchMedia("(prefers-color-scheme: dark)");return t.addListener(e),e(t),()=>t.removeListener(e)},[]),a.useEffect(()=>{let e=e=>{let n=e.newValue;"string"==typeof e.key&&e.key.startsWith(l)&&(!n||c.match(n))&&(e.key.endsWith("light")&&m({light:n}),e.key.endsWith("dark")&&m({dark:n})),e.key===i&&(!n||["light","dark","system"].includes(n))&&h(n||t)};if(s)return s.addEventListener("storage",e),()=>s.removeEventListener("storage",e)},[m,h,i,l,c,t,s]),(0,d.Z)({},u,{colorScheme:p,setMode:h,setColorScheme:m})}({supportedColorSchemes:X,defaultLightColorScheme:Y,defaultDarkColorScheme:J,modeStorageKey:w,colorSchemeStorageKey:j,defaultMode:Z,storageWindow:R}),ea=Q,el=eo;D&&(ea=z.mode,el=z.colorScheme);let es=ea||("system"===Z?s:Z),ec=el||("dark"===es?J:Y),{css:eu,vars:ef}=q(),ed=(0,d.Z)({},G,{components:W,colorSchemes:U,cssVarPrefix:K,vars:ef,getColorSchemeSelector:e=>`[${P}="${e}"] &`}),ep={},eh={};Object.entries(U).forEach(([e,t])=>{let{css:n,vars:r}=q(e);ed.vars=(0,f.Z)(ed.vars,r),e===ec&&(Object.keys(t).forEach(e=>{t[e]&&"object"==typeof t[e]?ed[e]=(0,d.Z)({},ed[e],t[e]):ed[e]=t[e]}),ed.palette&&(ed.palette.colorScheme=e));let o="string"==typeof _?_:"dark"===Z?_.dark:_.light;if(e===o){if(O){let t={};O(K).forEach(e=>{t[e]=n[e],delete n[e]}),ep[`[${P}="${e}"]`]=t}ep[`${T}, [${P}="${e}"]`]=n}else eh[`${":root"===T?"":T}[${P}="${e}"]`]=n}),ed.vars=(0,f.Z)(ed.vars,ef),a.useEffect(()=>{el&&N&&N.setAttribute(P,el)},[el,P,N]),a.useEffect(()=>{let e;if(A&&L.current&&M){let t=M.createElement("style");t.appendChild(M.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),M.head.appendChild(t),window.getComputedStyle(M.body),e=setTimeout(()=>{M.head.removeChild(t)},1)}return()=>{clearTimeout(e)}},[el,A,M]),a.useEffect(()=>(L.current=!0,()=>{L.current=!1}),[]);let em=a.useMemo(()=>({mode:ea,systemMode:et,setMode:ee,lightColorScheme:en,darkColorScheme:er,colorScheme:el,setColorScheme:ei,allColorSchemes:X}),[X,el,er,en,ea,ei,ee,et]),eg=!0;(I||D&&(null==B?void 0:B.cssVarPrefix)===K)&&(eg=!1);let ev=(0,i.jsxs)(a.Fragment,{children:[eg&&(0,i.jsxs)(a.Fragment,{children:[(0,i.jsx)(g,{styles:{[T]:eu}}),(0,i.jsx)(g,{styles:ep}),(0,i.jsx)(g,{styles:eh})]}),(0,i.jsx)(y.Z,{themeId:H?t:void 0,theme:m?m(ed):ed,children:e})]});return D?ev:(0,i.jsx)(k.Provider,{value:em,children:ev})},useColorScheme:()=>{let e=a.useContext(k);if(!e)throw Error((0,h.Z)(19));return e},getInitColorSchemeScript:e=>(function(e){let{defaultMode:t="light",defaultLightColorScheme:n="light",defaultDarkColorScheme:r="dark",modeStorageKey:o=b,colorSchemeStorageKey:a=x,attribute:l=w,colorSchemeNode:s="document.documentElement"}=e||{};return(0,i.jsx)("script",{dangerouslySetInnerHTML:{__html:`(function() { try {
var mode = localStorage.getItem('${o}') || '${t}';
var cssColorScheme = mode;
var colorScheme = '';
From a475dbca3ea09830a7e29e30dcda72539344f5e9 Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Sat, 2 Dec 2023 21:21:27 +0800
Subject: [PATCH 22/26] fix:update recall method
---
pilot/scene/chat_knowledge/v1/chat.py | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/pilot/scene/chat_knowledge/v1/chat.py b/pilot/scene/chat_knowledge/v1/chat.py
index 9fa13c55e..0bb8cf846 100644
--- a/pilot/scene/chat_knowledge/v1/chat.py
+++ b/pilot/scene/chat_knowledge/v1/chat.py
@@ -139,16 +139,15 @@ async def generate_input_values(self) -> Dict:
print("no relevant docs to retrieve")
context = "no relevant docs to retrieve"
else:
- self.chunks_with_score = [
- (
- self.chunk_dao.get_document_chunks(
- query=DocumentChunkEntity(content=d.page_content),
- document_ids=self.document_ids,
- )[0],
- score,
+ self.chunks_with_score = []
+ for d, score in candidates_with_scores:
+ chucks = self.chunk_dao.get_document_chunks(
+ query=DocumentChunkEntity(content=d.page_content),
+ document_ids=self.document_ids,
)
- for d, score in candidates_with_scores
- ]
+ if len(chucks) > 0:
+ self.chunks_with_score.append((chucks[0], score))
+
context = [doc.page_content for doc, _ in candidates_with_scores]
context = context[: self.max_token]
From 029df675b5bde5c7206f2faca29a079db1ccbfe9 Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Sat, 2 Dec 2023 23:43:14 +0800
Subject: [PATCH 23/26] fix:rag awel example
---
pilot/scene/operator/_experimental.py | 2 --
1 file changed, 2 deletions(-)
diff --git a/pilot/scene/operator/_experimental.py b/pilot/scene/operator/_experimental.py
index f0ee06179..1f5ba87d2 100644
--- a/pilot/scene/operator/_experimental.py
+++ b/pilot/scene/operator/_experimental.py
@@ -184,7 +184,6 @@ async def map(self, input_value: ChatContext) -> ChatContext:
from pilot.configs.model_config import EMBEDDING_MODEL_CONFIG
from pilot.embedding_engine.embedding_engine import EmbeddingEngine
from pilot.embedding_engine.embedding_factory import EmbeddingFactory
- from pilot.scene.chat_knowledge.v1.chat import _merge_by_key
# TODO, decompose the current operator into some atomic operators
knowledge_space = input_value.select_param
@@ -223,7 +222,6 @@ async def map(self, input_value: ChatContext) -> ChatContext:
input_value.current_user_input,
top_k,
)
- sources = _merge_by_key(list(map(lambda doc: doc.metadata, docs)), "source")
if not docs or len(docs) == 0:
print("no relevant docs to retrieve")
context = "no relevant docs to retrieve"
From 221eb8a2e6405af6f3b2df71a33dd496ba410245 Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Mon, 4 Dec 2023 09:39:06 +0800
Subject: [PATCH 24/26] refactor:rename summary file
---
pilot/rag/extracter/{SummaryExtractor.py => summary.py} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename pilot/rag/extracter/{SummaryExtractor.py => summary.py} (100%)
diff --git a/pilot/rag/extracter/SummaryExtractor.py b/pilot/rag/extracter/summary.py
similarity index 100%
rename from pilot/rag/extracter/SummaryExtractor.py
rename to pilot/rag/extracter/summary.py
From c6cb8c4496c61e00927506928a9ab34df7882549 Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Mon, 4 Dec 2023 09:40:52 +0800
Subject: [PATCH 25/26] chore:update migrate script
---
docker/examples/metadata/duckdb2mysql.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/docker/examples/metadata/duckdb2mysql.py b/docker/examples/metadata/duckdb2mysql.py
index 76bf9cec7..40d68be78 100644
--- a/docker/examples/metadata/duckdb2mysql.py
+++ b/docker/examples/metadata/duckdb2mysql.py
@@ -40,7 +40,6 @@ def migrate_table(duckdb_file_path, source_table, destination_table, conn_mysql)
cursor_mysql.execute(insert_query, row)
conn_mysql.commit()
finally:
- # 关闭 DuckDB 连接
conn_duckdb.close()
From a3b1ec7be1367955fbe5b9878b1ca74ec5d24f8a Mon Sep 17 00:00:00 2001
From: aries_ckt <916701291@qq.com>
Date: Mon, 4 Dec 2023 10:19:06 +0800
Subject: [PATCH 26/26] refactor:update summary unuseful code
---
pilot/rag/extracter/summary.py | 33 ---------------------------------
1 file changed, 33 deletions(-)
diff --git a/pilot/rag/extracter/summary.py b/pilot/rag/extracter/summary.py
index ccc385851..5eb09d65a 100644
--- a/pilot/rag/extracter/summary.py
+++ b/pilot/rag/extracter/summary.py
@@ -93,36 +93,3 @@ async def _mapreduce_extract_summary(
return await self._mapreduce_extract_summary(
summary_iters, model_name, max_iteration, llm_metadata.concurrency_limit
)
-
- # async def _refine_extract_summary(
- # self, doc: str, conn_uid: str, model_name: str = None
- # ):
- # """Extract triplets from text by llm
- # Args:
- # doc: Document
- # conn_uid: str,chat conversation id
- # model_name: str, model name
- # Returns:
- # chat: BaseChat, refine summary chat.
- # """
- # from pilot.scene.base import ChatScene
- #
- # chat_param = {
- # "chat_session_id": conn_uid,
- # "current_user_input": "",
- # "select_param": doc,
- # "model_name": model_name,
- # "model_cache_enable": False,
- # }
- # executor = CFG.SYSTEM_APP.get_component(
- # ComponentType.EXECUTOR_DEFAULT, ExecutorFactory
- # ).create()
- # from pilot.openapi.api_v1.api_v1 import CHAT_FACTORY
- #
- # chat = await blocking_func_to_async(
- # executor,
- # CHAT_FACTORY.get_implementation,
- # ChatScene.ExtractRefineSummary.value(),
- # **{"chat_param": chat_param},
- # )
- # return chat