diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..c7707166 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +lightrag/api/webui/** -diff diff --git a/.gitignore b/.gitignore index a4afe4ea..dd1c386b 100644 --- a/.gitignore +++ b/.gitignore @@ -64,3 +64,6 @@ gui/ # unit-test files test_* + +# Cline files +memory-bank/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 169a7cc7..0629b743 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,16 +3,21 @@ repos: rev: v5.0.0 hooks: - id: trailing-whitespace + exclude: ^lightrag/api/webui/ - id: end-of-file-fixer + exclude: ^lightrag/api/webui/ - id: requirements-txt-fixer + exclude: ^lightrag/api/webui/ - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.6.4 hooks: - id: ruff-format + exclude: ^lightrag/api/webui/ - id: ruff args: [--fix, --ignore=E402] + exclude: ^lightrag/api/webui/ - repo: https://github.com/mgedmin/check-manifest @@ -20,3 +25,4 @@ repos: hooks: - id: check-manifest stages: [manual] + exclude: ^lightrag/api/webui/ diff --git a/README.md b/README.md index 018a94e6..61e7b20f 100644 --- a/README.md +++ b/README.md @@ -37,28 +37,30 @@ This repository hosts the code of LightRAG. The structure of this code is based
+ + +
🎉 News - -- [x] [2025.02.05]🎯📢Our team has released [VideoRAG](https://github.com/HKUDS/VideoRAG) understanding extremely long-context videos. -- [x] [2025.01.13]🎯📢Our team has released [MiniRAG](https://github.com/HKUDS/MiniRAG) making RAG simpler with small models. -- [x] [2025.01.06]🎯📢You can now [use PostgreSQL for Storage](#using-postgresql-for-storage). -- [x] [2024.12.31]🎯📢LightRAG now supports [deletion by document ID](https://github.com/HKUDS/LightRAG?tab=readme-ov-file#delete). -- [x] [2024.11.25]🎯📢LightRAG now supports seamless integration of [custom knowledge graphs](https://github.com/HKUDS/LightRAG?tab=readme-ov-file#insert-custom-kg), empowering users to enhance the system with their own domain expertise. -- [x] [2024.11.19]🎯📢A comprehensive guide to LightRAG is now available on [LearnOpenCV](https://learnopencv.com/lightrag). Many thanks to the blog author. -- [x] [2024.11.12]🎯📢LightRAG now supports [Oracle Database 23ai for all storage types (KV, vector, and graph)](https://github.com/HKUDS/LightRAG/blob/main/examples/lightrag_oracle_demo.py). -- [x] [2024.11.11]🎯📢LightRAG now supports [deleting entities by their names](https://github.com/HKUDS/LightRAG?tab=readme-ov-file#delete). -- [x] [2024.11.09]🎯📢Introducing the [LightRAG Gui](https://lightrag-gui.streamlit.app), which allows you to insert, query, visualize, and download LightRAG knowledge. -- [x] [2024.11.04]🎯📢You can now [use Neo4J for Storage](https://github.com/HKUDS/LightRAG?tab=readme-ov-file#using-neo4j-for-storage). -- [x] [2024.10.29]🎯📢LightRAG now supports multiple file types, including PDF, DOC, PPT, and CSV via `textract`. -- [x] [2024.10.20]🎯📢We've added a new feature to LightRAG: Graph Visualization. -- [x] [2024.10.18]🎯📢We've added a link to a [LightRAG Introduction Video](https://youtu.be/oageL-1I0GE). Thanks to the author! -- [x] [2024.10.17]🎯📢We have created a [Discord channel](https://discord.gg/yF2MmDJyGJ)! Welcome to join for sharing and discussions! 🎉🎉 -- [x] [2024.10.16]🎯📢LightRAG now supports [Ollama models](https://github.com/HKUDS/LightRAG?tab=readme-ov-file#quick-start)! -- [x] [2024.10.15]🎯📢LightRAG now supports [Hugging Face models](https://github.com/HKUDS/LightRAG?tab=readme-ov-file#quick-start)! +- [X] [2025.02.05]🎯📢Our team has released [VideoRAG](https://github.com/HKUDS/VideoRAG) understanding extremely long-context videos. +- [X] [2025.01.13]🎯📢Our team has released [MiniRAG](https://github.com/HKUDS/MiniRAG) making RAG simpler with small models. +- [X] [2025.01.06]🎯📢You can now [use PostgreSQL for Storage](#using-postgresql-for-storage). +- [X] [2024.12.31]🎯📢LightRAG now supports [deletion by document ID](https://github.com/HKUDS/LightRAG?tab=readme-ov-file#delete). +- [X] [2024.11.25]🎯📢LightRAG now supports seamless integration of [custom knowledge graphs](https://github.com/HKUDS/LightRAG?tab=readme-ov-file#insert-custom-kg), empowering users to enhance the system with their own domain expertise. +- [X] [2024.11.19]🎯📢A comprehensive guide to LightRAG is now available on [LearnOpenCV](https://learnopencv.com/lightrag). Many thanks to the blog author. +- [X] [2024.11.12]🎯📢LightRAG now supports [Oracle Database 23ai for all storage types (KV, vector, and graph)](https://github.com/HKUDS/LightRAG/blob/main/examples/lightrag_oracle_demo.py). +- [X] [2024.11.11]🎯📢LightRAG now supports [deleting entities by their names](https://github.com/HKUDS/LightRAG?tab=readme-ov-file#delete). +- [X] [2024.11.09]🎯📢Introducing the [LightRAG Gui](https://lightrag-gui.streamlit.app), which allows you to insert, query, visualize, and download LightRAG knowledge. +- [X] [2024.11.04]🎯📢You can now [use Neo4J for Storage](https://github.com/HKUDS/LightRAG?tab=readme-ov-file#using-neo4j-for-storage). +- [X] [2024.10.29]🎯📢LightRAG now supports multiple file types, including PDF, DOC, PPT, and CSV via `textract`. +- [X] [2024.10.20]🎯📢We've added a new feature to LightRAG: Graph Visualization. +- [X] [2024.10.18]🎯📢We've added a link to a [LightRAG Introduction Video](https://youtu.be/oageL-1I0GE). Thanks to the author! +- [X] [2024.10.17]🎯📢We have created a [Discord channel](https://discord.gg/yF2MmDJyGJ)! Welcome to join for sharing and discussions! 🎉🎉 +- [X] [2024.10.16]🎯📢LightRAG now supports [Ollama models](https://github.com/HKUDS/LightRAG?tab=readme-ov-file#quick-start)! +- [X] [2024.10.15]🎯📢LightRAG now supports [Hugging Face models](https://github.com/HKUDS/LightRAG?tab=readme-ov-file#quick-start)!
@@ -82,16 +84,20 @@ This repository hosts the code of LightRAG. The structure of this code is based cd LightRAG pip install -e . ``` + * Install from PyPI + ```bash pip install lightrag-hku ``` ## Quick Start + * [Video demo](https://www.youtube.com/watch?v=g21royNJ4fw) of running LightRAG locally. * All the code can be found in the `examples`. * Set OpenAI API key in environment if using OpenAI models: `export OPENAI_API_KEY="sk-...".` * Download the demo text "A Christmas Carol by Charles Dickens": + ```bash curl https://raw.githubusercontent.com/gusye1234/nano-graphrag/main/tests/mock_data.txt > ./book.txt ``` @@ -187,6 +193,7 @@ class QueryParam: Using Open AI-like APIs * LightRAG also supports Open AI-like chat/embeddings APIs: + ```python async def llm_model_func( prompt, system_prompt=None, history_messages=[], keyword_extraction=False, **kwargs @@ -225,6 +232,7 @@ async def initialize_rag(): return rag ``` +
@@ -252,12 +260,14 @@ rag = LightRAG( ), ) ``` +
Using Ollama Models ### Overview + If you want to use Ollama models, you need to pull model you plan to use and embedding model, for example `nomic-embed-text`. Then you only need to set LightRAG as follows: @@ -281,31 +291,37 @@ rag = LightRAG( ``` ### Increasing context size + In order for LightRAG to work context should be at least 32k tokens. By default Ollama models have context size of 8k. You can achieve this using one of two ways: #### Increasing the `num_ctx` parameter in Modelfile. 1. Pull the model: + ```bash ollama pull qwen2 ``` 2. Display the model file: + ```bash ollama show --modelfile qwen2 > Modelfile ``` 3. Edit the Modelfile by adding the following line: + ```bash PARAMETER num_ctx 32768 ``` 4. Create the modified model: + ```bash ollama create -f Modelfile qwen2m ``` #### Setup `num_ctx` via Ollama API. + Tiy can use `llm_model_kwargs` param to configure ollama: ```python @@ -325,6 +341,7 @@ rag = LightRAG( ), ) ``` + #### Low RAM GPUs In order to run this experiment on low RAM GPU you should select small model and tune context window (increasing context increase memory consumption). For example, running this ollama example on repurposed mining GPU with 6Gb of RAM required to set context size to 26k while using `gemma2:2b`. It was able to find 197 entities and 19 relations on `book.txt`. @@ -402,6 +419,7 @@ if __name__ == "__main__": ``` #### For detailed documentation and examples, see: + - [LlamaIndex Documentation](lightrag/llm/Readme.md) - [Direct OpenAI Example](examples/lightrag_llamaindex_direct_demo.py) - [LiteLLM Proxy Example](examples/lightrag_llamaindex_litellm_demo.py) @@ -483,13 +501,16 @@ print(response_custom) We've introduced a new function `query_with_separate_keyword_extraction` to enhance the keyword extraction capabilities. This function separates the keyword extraction process from the user's prompt, focusing solely on the query to improve the relevance of extracted keywords. ##### How It Works? + The function operates by dividing the input into two parts: + - `User Query` - `Prompt` It then performs keyword extraction exclusively on the `user query`. This separation ensures that the extraction process is focused and relevant, unaffected by any additional language in the `prompt`. It also allows the `prompt` to serve purely for response formatting, maintaining the intent and clarity of the user's original question. ##### Usage Example + This `example` shows how to tailor the function for educational content, focusing on detailed explanations for older students. ```python @@ -563,6 +584,7 @@ custom_kg = { rag.insert_custom_kg(custom_kg) ``` +
## Insert @@ -593,6 +615,7 @@ rag.insert(["TEXT1", "TEXT2", "TEXT3", ...]) # Documents will be processed in b ``` The `insert_batch_size` parameter in `addon_params` controls how many documents are processed in each batch during insertion. This is useful for: + - Managing memory usage with large document collections - Optimizing processing speed - Providing better progress tracking @@ -647,6 +670,7 @@ text_content = textract.process(file_path) rag.insert(text_content.decode('utf-8')) ``` + ## Storage @@ -685,6 +709,7 @@ async def initialize_rag(): return rag ``` + see test_neo4j.py for a working example. @@ -693,6 +718,7 @@ see test_neo4j.py for a working example. Using PostgreSQL for Storage For production level scenarios you will most likely want to leverage an enterprise solution. PostgreSQL can provide a one-stop solution for you as KV store, VectorDB (pgvector) and GraphDB (apache AGE). + * PostgreSQL is lightweight,the whole binary distribution including all necessary plugins can be zipped to 40MB: Ref to [Windows Release](https://github.com/ShanGor/apache-age-windows/releases/tag/PG17%2Fv1.5.0-rc0) as it is easy to install for Linux/Mac. * If you prefer docker, please start with this image if you are a beginner to avoid hiccups (DO read the overview): https://hub.docker.com/r/shangor/postgres-for-rag * How to start? Ref to: [examples/lightrag_zhipu_postgres_demo.py](https://github.com/HKUDS/LightRAG/blob/main/examples/lightrag_zhipu_postgres_demo.py) @@ -735,6 +761,7 @@ For production level scenarios you will most likely want to leverage an enterpri > It is a known issue of the release version: https://github.com/apache/age/pull/1721 > > You can Compile the AGE from source code and fix it. + > @@ -742,9 +769,11 @@ For production level scenarios you will most likely want to leverage an enterpri Using Faiss for Storage - Install the required dependencies: + ``` pip install faiss-cpu ``` + You can also install `faiss-gpu` if you have GPU support. - Here we are using `sentence-transformers` but you can also use `OpenAIEmbedding` model with `3072` dimensions. @@ -810,6 +839,7 @@ relation = rag.create_relation("Google", "Gmail", { "weight": 2.0 }) ``` +
@@ -835,6 +865,7 @@ updated_relation = rag.edit_relation("Google", "Google Mail", { "weight": 3.0 }) ``` +
All operations are available in both synchronous and asynchronous versions. The asynchronous versions have the prefix "a" (e.g., `acreate_entity`, `aedit_relation`). @@ -851,6 +882,55 @@ All operations are available in both synchronous and asynchronous versions. The These operations maintain data consistency across both the graph database and vector database components, ensuring your knowledge graph remains coherent. +## Data Export Functions + +## Overview + +LightRAG allows you to export your knowledge graph data in various formats for analysis, sharing, and backup purposes. The system supports exporting entities, relations, and relationship data. + +## Export Functions + +### Basic Usage + +```python +# Basic CSV export (default format) +rag.export_data("knowledge_graph.csv") + +# Specify any format +rag.export_data("output.xlsx", file_format="excel") +``` + +### Different File Formats supported + +```python +#Export data in CSV format +rag.export_data("graph_data.csv", file_format="csv") + +# Export data in Excel sheet +rag.export_data("graph_data.xlsx", file_format="excel") + +# Export data in markdown format +rag.export_data("graph_data.md", file_format="md") + +# Export data in Text +rag.export_data("graph_data.txt", file_format="txt") +``` +## Additional Options + +Include vector embeddings in the export (optional): + +```python +rag.export_data("complete_data.csv", include_vector_data=True) +``` +## Data Included in Export + +All exports include: + +* Entity information (names, IDs, metadata) +* Relation data (connections between entities) +* Relationship information from vector database + + ## Entity Merging
@@ -913,6 +993,7 @@ rag.merge_entities( ``` When merging entities: + * All relationships from source entities are redirected to the target entity * Duplicate relationships are intelligently merged * Self-relationships (loops) are prevented @@ -946,6 +1027,7 @@ rag.clear_cache(modes=["local"]) ``` Valid modes are: + - `"default"`: Extraction cache - `"naive"`: Naive search cache - `"local"`: Local search cache @@ -960,33 +1042,33 @@ Valid modes are:
Parameters -| **Parameter** | **Type** | **Explanation** | **Default** | -|----------------------------------------------| --- |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------| -| **working\_dir** | `str` | Directory where the cache will be stored | `lightrag_cache+timestamp` | -| **kv\_storage** | `str` | Storage type for documents and text chunks. Supported types: `JsonKVStorage`, `OracleKVStorage` | `JsonKVStorage` | -| **vector\_storage** | `str` | Storage type for embedding vectors. Supported types: `NanoVectorDBStorage`, `OracleVectorDBStorage` | `NanoVectorDBStorage` | -| **graph\_storage** | `str` | Storage type for graph edges and nodes. Supported types: `NetworkXStorage`, `Neo4JStorage`, `OracleGraphStorage` | `NetworkXStorage` | -| **chunk\_token\_size** | `int` | Maximum token size per chunk when splitting documents | `1200` | -| **chunk\_overlap\_token\_size** | `int` | Overlap token size between two chunks when splitting documents | `100` | -| **tiktoken\_model\_name** | `str` | Model name for the Tiktoken encoder used to calculate token numbers | `gpt-4o-mini` | -| **entity\_extract\_max\_gleaning** | `int` | Number of loops in the entity extraction process, appending history messages | `1` | -| **entity\_summary\_to\_max\_tokens** | `int` | Maximum token size for each entity summary | `500` | -| **node\_embedding\_algorithm** | `str` | Algorithm for node embedding (currently not used) | `node2vec` | -| **node2vec\_params** | `dict` | Parameters for node embedding | `{"dimensions": 1536,"num_walks": 10,"walk_length": 40,"window_size": 2,"iterations": 3,"random_seed": 3,}` | -| **embedding\_func** | `EmbeddingFunc` | Function to generate embedding vectors from text | `openai_embed` | -| **embedding\_batch\_num** | `int` | Maximum batch size for embedding processes (multiple texts sent per batch) | `32` | -| **embedding\_func\_max\_async** | `int` | Maximum number of concurrent asynchronous embedding processes | `16` | -| **llm\_model\_func** | `callable` | Function for LLM generation | `gpt_4o_mini_complete` | -| **llm\_model\_name** | `str` | LLM model name for generation | `meta-llama/Llama-3.2-1B-Instruct` | -| **llm\_model\_max\_token\_size** | `int` | Maximum token size for LLM generation (affects entity relation summaries) | `32768`(default value changed by env var MAX_TOKENS) | -| **llm\_model\_max\_async** | `int` | Maximum number of concurrent asynchronous LLM processes | `16`(default value changed by env var MAX_ASYNC) | -| **llm\_model\_kwargs** | `dict` | Additional parameters for LLM generation | | -| **vector\_db\_storage\_cls\_kwargs** | `dict` | Additional parameters for vector database, like setting the threshold for nodes and relations retrieval. | cosine_better_than_threshold: 0.2(default value changed by env var COSINE_THRESHOLD) | -| **enable\_llm\_cache** | `bool` | If `TRUE`, stores LLM results in cache; repeated prompts return cached responses | `TRUE` | -| **enable\_llm\_cache\_for\_entity\_extract** | `bool` | If `TRUE`, stores LLM results in cache for entity extraction; Good for beginners to debug your application | `TRUE` | -| **addon\_params** | `dict` | Additional parameters, e.g., `{"example_number": 1, "language": "Simplified Chinese", "entity_types": ["organization", "person", "geo", "event"], "insert_batch_size": 10}`: sets example limit, output language, and batch size for document processing | `example_number: all examples, language: English, insert_batch_size: 10` | -| **convert\_response\_to\_json\_func** | `callable` | Not used | `convert_response_to_json` | -| **embedding\_cache\_config** | `dict` | Configuration for question-answer caching. Contains three parameters:
- `enabled`: Boolean value to enable/disable cache lookup functionality. When enabled, the system will check cached responses before generating new answers.
- `similarity_threshold`: Float value (0-1), similarity threshold. When a new question's similarity with a cached question exceeds this threshold, the cached answer will be returned directly without calling the LLM.
- `use_llm_check`: Boolean value to enable/disable LLM similarity verification. When enabled, LLM will be used as a secondary check to verify the similarity between questions before returning cached answers. | Default: `{"enabled": False, "similarity_threshold": 0.95, "use_llm_check": False}` | +| **Parameter** | **Type** | **Explanation** | **Default** | +| -------------------------------------------------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| **working\_dir** | `str` | Directory where the cache will be stored | `lightrag_cache+timestamp` | +| **kv\_storage** | `str` | Storage type for documents and text chunks. Supported types:`JsonKVStorage`, `OracleKVStorage` | `JsonKVStorage` | +| **vector\_storage** | `str` | Storage type for embedding vectors. Supported types:`NanoVectorDBStorage`, `OracleVectorDBStorage` | `NanoVectorDBStorage` | +| **graph\_storage** | `str` | Storage type for graph edges and nodes. Supported types:`NetworkXStorage`, `Neo4JStorage`, `OracleGraphStorage` | `NetworkXStorage` | +| **chunk\_token\_size** | `int` | Maximum token size per chunk when splitting documents | `1200` | +| **chunk\_overlap\_token\_size** | `int` | Overlap token size between two chunks when splitting documents | `100` | +| **tiktoken\_model\_name** | `str` | Model name for the Tiktoken encoder used to calculate token numbers | `gpt-4o-mini` | +| **entity\_extract\_max\_gleaning** | `int` | Number of loops in the entity extraction process, appending history messages | `1` | +| **entity\_summary\_to\_max\_tokens** | `int` | Maximum token size for each entity summary | `500` | +| **node\_embedding\_algorithm** | `str` | Algorithm for node embedding (currently not used) | `node2vec` | +| **node2vec\_params** | `dict` | Parameters for node embedding | `{"dimensions": 1536,"num_walks": 10,"walk_length": 40,"window_size": 2,"iterations": 3,"random_seed": 3,}` | +| **embedding\_func** | `EmbeddingFunc` | Function to generate embedding vectors from text | `openai_embed` | +| **embedding\_batch\_num** | `int` | Maximum batch size for embedding processes (multiple texts sent per batch) | `32` | +| **embedding\_func\_max\_async** | `int` | Maximum number of concurrent asynchronous embedding processes | `16` | +| **llm\_model\_func** | `callable` | Function for LLM generation | `gpt_4o_mini_complete` | +| **llm\_model\_name** | `str` | LLM model name for generation | `meta-llama/Llama-3.2-1B-Instruct` | +| **llm\_model\_max\_token\_size** | `int` | Maximum token size for LLM generation (affects entity relation summaries) | `32768`(default value changed by env var MAX_TOKENS) | +| **llm\_model\_max\_async** | `int` | Maximum number of concurrent asynchronous LLM processes | `16`(default value changed by env var MAX_ASYNC) | +| **llm\_model\_kwargs** | `dict` | Additional parameters for LLM generation | | +| **vector\_db\_storage\_cls\_kwargs** | `dict` | Additional parameters for vector database, like setting the threshold for nodes and relations retrieval. | cosine_better_than_threshold: 0.2(default value changed by env var COSINE_THRESHOLD) | +| **enable\_llm\_cache** | `bool` | If `TRUE`, stores LLM results in cache; repeated prompts return cached responses | `TRUE` | +| **enable\_llm\_cache\_for\_entity\_extract** | `bool` | If `TRUE`, stores LLM results in cache for entity extraction; Good for beginners to debug your application | `TRUE` | +| **addon\_params** | `dict` | Additional parameters, e.g.,`{"example_number": 1, "language": "Simplified Chinese", "entity_types": ["organization", "person", "geo", "event"], "insert_batch_size": 10}`: sets example limit, output language, and batch size for document processing | `example_number: all examples, language: English, insert_batch_size: 10` | +| **convert\_response\_to\_json\_func** | `callable` | Not used | `convert_response_to_json` | +| **embedding\_cache\_config** | `dict` | Configuration for question-answer caching. Contains three parameters:`
`- `enabled`: Boolean value to enable/disable cache lookup functionality. When enabled, the system will check cached responses before generating new answers.`
`- `similarity_threshold`: Float value (0-1), similarity threshold. When a new question's similarity with a cached question exceeds this threshold, the cached answer will be returned directly without calling the LLM.`
`- `use_llm_check`: Boolean value to enable/disable LLM similarity verification. When enabled, LLM will be used as a secondary check to verify the similarity between questions before returning cached answers. | Default:`{"enabled": False, "similarity_threshold": 0.95, "use_llm_check": False}` |
@@ -996,12 +1078,15 @@ Valid modes are: Click to view error handling details The API includes comprehensive error handling: + - File not found errors (404) - Processing errors (500) - Supports multiple file encodings (UTF-8 and GBK) +
## API + LightRag can be installed with API support to serve a Fast api interface to perform data upload and indexing/Rag operations/Rescan of the input folder etc.. [LightRag API](lightrag/api/README.md) @@ -1035,7 +1120,6 @@ net.show('knowledge_graph.html')
Graph visualization with Neo4 - * The following code can be found in `examples/graph_visual_with_neo4j.py` ```python @@ -1171,10 +1255,13 @@ LightRag can be installed with Tools support to add extra tools like the graphml
## Evaluation + ### Dataset + The dataset used in LightRAG can be downloaded from [TommyChien/UltraDomain](https://huggingface.co/datasets/TommyChien/UltraDomain). ### Generate Query + LightRAG uses the following prompt to generate high-level queries, with the corresponding code in `example/generate_query.py`.
@@ -1203,9 +1290,11 @@ Output the results in the following structure: - User 5: [user description] ... ``` +
### Batch Eval + To evaluate the performance of two RAG systems on high-level queries, LightRAG uses the following prompt, with the specific code available in `example/batch_eval.py`.
@@ -1253,37 +1342,40 @@ Output your evaluation in the following JSON format: }} }} ``` +
### Overall Performance Table -| | **Agriculture** | | **CS** | | **Legal** | | **Mix** | | -|----------------------|-------------------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------| -| | NaiveRAG | **LightRAG** | NaiveRAG | **LightRAG** | NaiveRAG | **LightRAG** | NaiveRAG | **LightRAG** | -| **Comprehensiveness** | 32.4% | **67.6%** | 38.4% | **61.6%** | 16.4% | **83.6%** | 38.8% | **61.2%** | -| **Diversity** | 23.6% | **76.4%** | 38.0% | **62.0%** | 13.6% | **86.4%** | 32.4% | **67.6%** | -| **Empowerment** | 32.4% | **67.6%** | 38.8% | **61.2%** | 16.4% | **83.6%** | 42.8% | **57.2%** | -| **Overall** | 32.4% | **67.6%** | 38.8% | **61.2%** | 15.2% | **84.8%** | 40.0% | **60.0%** | -| | RQ-RAG | **LightRAG** | RQ-RAG | **LightRAG** | RQ-RAG | **LightRAG** | RQ-RAG | **LightRAG** | -| **Comprehensiveness** | 31.6% | **68.4%** | 38.8% | **61.2%** | 15.2% | **84.8%** | 39.2% | **60.8%** | -| **Diversity** | 29.2% | **70.8%** | 39.2% | **60.8%** | 11.6% | **88.4%** | 30.8% | **69.2%** | -| **Empowerment** | 31.6% | **68.4%** | 36.4% | **63.6%** | 15.2% | **84.8%** | 42.4% | **57.6%** | -| **Overall** | 32.4% | **67.6%** | 38.0% | **62.0%** | 14.4% | **85.6%** | 40.0% | **60.0%** | -| | HyDE | **LightRAG** | HyDE | **LightRAG** | HyDE | **LightRAG** | HyDE | **LightRAG** | -| **Comprehensiveness** | 26.0% | **74.0%** | 41.6% | **58.4%** | 26.8% | **73.2%** | 40.4% | **59.6%** | -| **Diversity** | 24.0% | **76.0%** | 38.8% | **61.2%** | 20.0% | **80.0%** | 32.4% | **67.6%** | -| **Empowerment** | 25.2% | **74.8%** | 40.8% | **59.2%** | 26.0% | **74.0%** | 46.0% | **54.0%** | -| **Overall** | 24.8% | **75.2%** | 41.6% | **58.4%** | 26.4% | **73.6%** | 42.4% | **57.6%** | -| | GraphRAG | **LightRAG** | GraphRAG | **LightRAG** | GraphRAG | **LightRAG** | GraphRAG | **LightRAG** | -| **Comprehensiveness** | 45.6% | **54.4%** | 48.4% | **51.6%** | 48.4% | **51.6%** | **50.4%** | 49.6% | -| **Diversity** | 22.8% | **77.2%** | 40.8% | **59.2%** | 26.4% | **73.6%** | 36.0% | **64.0%** | -| **Empowerment** | 41.2% | **58.8%** | 45.2% | **54.8%** | 43.6% | **56.4%** | **50.8%** | 49.2% | -| **Overall** | 45.2% | **54.8%** | 48.0% | **52.0%** | 47.2% | **52.8%** | **50.4%** | 49.6% | +| | **Agriculture** | | **CS** | | **Legal** | | **Mix** | | +| --------------------------- | --------------------- | ------------------ | ------------ | ------------------ | --------------- | ------------------ | --------------- | ------------------ | +| | NaiveRAG | **LightRAG** | NaiveRAG | **LightRAG** | NaiveRAG | **LightRAG** | NaiveRAG | **LightRAG** | +| **Comprehensiveness** | 32.4% | **67.6%** | 38.4% | **61.6%** | 16.4% | **83.6%** | 38.8% | **61.2%** | +| **Diversity** | 23.6% | **76.4%** | 38.0% | **62.0%** | 13.6% | **86.4%** | 32.4% | **67.6%** | +| **Empowerment** | 32.4% | **67.6%** | 38.8% | **61.2%** | 16.4% | **83.6%** | 42.8% | **57.2%** | +| **Overall** | 32.4% | **67.6%** | 38.8% | **61.2%** | 15.2% | **84.8%** | 40.0% | **60.0%** | +| | RQ-RAG | **LightRAG** | RQ-RAG | **LightRAG** | RQ-RAG | **LightRAG** | RQ-RAG | **LightRAG** | +| **Comprehensiveness** | 31.6% | **68.4%** | 38.8% | **61.2%** | 15.2% | **84.8%** | 39.2% | **60.8%** | +| **Diversity** | 29.2% | **70.8%** | 39.2% | **60.8%** | 11.6% | **88.4%** | 30.8% | **69.2%** | +| **Empowerment** | 31.6% | **68.4%** | 36.4% | **63.6%** | 15.2% | **84.8%** | 42.4% | **57.6%** | +| **Overall** | 32.4% | **67.6%** | 38.0% | **62.0%** | 14.4% | **85.6%** | 40.0% | **60.0%** | +| | HyDE | **LightRAG** | HyDE | **LightRAG** | HyDE | **LightRAG** | HyDE | **LightRAG** | +| **Comprehensiveness** | 26.0% | **74.0%** | 41.6% | **58.4%** | 26.8% | **73.2%** | 40.4% | **59.6%** | +| **Diversity** | 24.0% | **76.0%** | 38.8% | **61.2%** | 20.0% | **80.0%** | 32.4% | **67.6%** | +| **Empowerment** | 25.2% | **74.8%** | 40.8% | **59.2%** | 26.0% | **74.0%** | 46.0% | **54.0%** | +| **Overall** | 24.8% | **75.2%** | 41.6% | **58.4%** | 26.4% | **73.6%** | 42.4% | **57.6%** | +| | GraphRAG | **LightRAG** | GraphRAG | **LightRAG** | GraphRAG | **LightRAG** | GraphRAG | **LightRAG** | +| **Comprehensiveness** | 45.6% | **54.4%** | 48.4% | **51.6%** | 48.4% | **51.6%** | **50.4%** | 49.6% | +| **Diversity** | 22.8% | **77.2%** | 40.8% | **59.2%** | 26.4% | **73.6%** | 36.0% | **64.0%** | +| **Empowerment** | 41.2% | **58.8%** | 45.2% | **54.8%** | 43.6% | **56.4%** | **50.8%** | 49.2% | +| **Overall** | 45.2% | **54.8%** | 48.0% | **52.0%** | 47.2% | **52.8%** | **50.4%** | 49.6% | ## Reproduce + All the code can be found in the `./reproduce` directory. ### Step-0 Extract Unique Contexts + First, we need to extract unique contexts in the datasets.
@@ -1340,9 +1432,11 @@ def extract_unique_contexts(input_directory, output_directory): print("All files have been processed.") ``` +
### Step-1 Insert Contexts + For the extracted contexts, we insert them into the LightRAG system.
@@ -1366,6 +1460,7 @@ def insert_text(rag, file_path): if retries == max_retries: print("Insertion failed after exceeding the maximum number of retries") ``` +
### Step-2 Generate Queries @@ -1390,9 +1485,11 @@ def get_summary(context, tot_tokens=2000): return summary ``` + ### Step-3 Query + For the queries generated in Step-2, we will extract them and query LightRAG.
@@ -1409,6 +1506,7 @@ def extract_queries(file_path): return queries ``` +
## Star History @@ -1441,4 +1539,5 @@ archivePrefix={arXiv}, primaryClass={cs.IR} } ``` + **Thank you for your interest in our work!** diff --git a/lightrag/__init__.py b/lightrag/__init__.py index 382060f7..89475dca 100644 --- a/lightrag/__init__.py +++ b/lightrag/__init__.py @@ -1,5 +1,5 @@ from .lightrag import LightRAG as LightRAG, QueryParam as QueryParam -__version__ = "1.2.5" +__version__ = "1.2.6" __author__ = "Zirui Guo" __url__ = "https://github.com/HKUDS/LightRAG" diff --git a/lightrag/api/gunicorn_config.py b/lightrag/api/gunicorn_config.py index 0594ceae..23e46807 100644 --- a/lightrag/api/gunicorn_config.py +++ b/lightrag/api/gunicorn_config.py @@ -59,7 +59,7 @@ logconfig_dict = { }, "filters": { "path_filter": { - "()": "lightrag.api.lightrag_server.LightragPathFilter", + "()": "lightrag.utils.LightragPathFilter", }, }, "loggers": { diff --git a/lightrag/api/lightrag_server.py b/lightrag/api/lightrag_server.py index fd09a691..24494705 100644 --- a/lightrag/api/lightrag_server.py +++ b/lightrag/api/lightrag_server.py @@ -55,41 +55,6 @@ config = configparser.ConfigParser() config.read("config.ini") -class LightragPathFilter(logging.Filter): - """Filter for lightrag logger to filter out frequent path access logs""" - - def __init__(self): - super().__init__() - # Define paths to be filtered - self.filtered_paths = ["/documents", "/health", "/webui/"] - - def filter(self, record): - try: - # Check if record has the required attributes for an access log - if not hasattr(record, "args") or not isinstance(record.args, tuple): - return True - if len(record.args) < 5: - return True - - # Extract method, path and status from the record args - method = record.args[1] - path = record.args[2] - status = record.args[4] - - # Filter out successful GET requests to filtered paths - if ( - method == "GET" - and (status == 200 or status == 304) - and path in self.filtered_paths - ): - return False - - return True - except Exception: - # In case of any error, let the message through - return True - - def create_app(args): # Setup logging logger.setLevel(args.log_level) @@ -177,6 +142,9 @@ def create_app(args): if api_key else "", version=__api_version__, + openapi_url="/openapi.json", # Explicitly set OpenAPI schema URL + docs_url="/docs", # Explicitly set docs URL + redoc_url="/redoc", # Explicitly set redoc URL openapi_tags=[{"name": "api"}], lifespan=lifespan, ) @@ -516,7 +484,7 @@ def configure_logging(): }, "filters": { "path_filter": { - "()": "lightrag.api.lightrag_server.LightragPathFilter", + "()": "lightrag.utils.LightragPathFilter", }, }, } diff --git a/lightrag/api/routers/document_routes.py b/lightrag/api/routers/document_routes.py index c1666192..7b6f11c1 100644 --- a/lightrag/api/routers/document_routes.py +++ b/lightrag/api/routers/document_routes.py @@ -99,6 +99,37 @@ class DocsStatusesResponse(BaseModel): statuses: Dict[DocStatus, List[DocStatusResponse]] = {} +class PipelineStatusResponse(BaseModel): + """Response model for pipeline status + + Attributes: + autoscanned: Whether auto-scan has started + busy: Whether the pipeline is currently busy + job_name: Current job name (e.g., indexing files/indexing texts) + job_start: Job start time as ISO format string (optional) + docs: Total number of documents to be indexed + batchs: Number of batches for processing documents + cur_batch: Current processing batch + request_pending: Flag for pending request for processing + latest_message: Latest message from pipeline processing + history_messages: List of history messages + """ + + autoscanned: bool = False + busy: bool = False + job_name: str = "Default Job" + job_start: Optional[str] = None + docs: int = 0 + batchs: int = 0 + cur_batch: int = 0 + request_pending: bool = False + latest_message: str = "" + history_messages: Optional[List[str]] = None + + class Config: + extra = "allow" # Allow additional fields from the pipeline status + + class DocumentManager: def __init__( self, @@ -247,7 +278,7 @@ async def pipeline_enqueue_file(rag: LightRAG, file_path: Path) -> bool: if global_args["main_args"].document_loading_engine == "DOCLING": if not pm.is_installed("docling"): # type: ignore pm.install("docling") - from docling.document_converter import DocumentConverter + from docling.document_converter import DocumentConverter # type: ignore converter = DocumentConverter() result = converter.convert(file_path) @@ -266,7 +297,7 @@ async def pipeline_enqueue_file(rag: LightRAG, file_path: Path) -> bool: if global_args["main_args"].document_loading_engine == "DOCLING": if not pm.is_installed("docling"): # type: ignore pm.install("docling") - from docling.document_converter import DocumentConverter + from docling.document_converter import DocumentConverter # type: ignore converter = DocumentConverter() result = converter.convert(file_path) @@ -286,7 +317,7 @@ async def pipeline_enqueue_file(rag: LightRAG, file_path: Path) -> bool: if global_args["main_args"].document_loading_engine == "DOCLING": if not pm.is_installed("docling"): # type: ignore pm.install("docling") - from docling.document_converter import DocumentConverter + from docling.document_converter import DocumentConverter # type: ignore converter = DocumentConverter() result = converter.convert(file_path) @@ -307,7 +338,7 @@ async def pipeline_enqueue_file(rag: LightRAG, file_path: Path) -> bool: if global_args["main_args"].document_loading_engine == "DOCLING": if not pm.is_installed("docling"): # type: ignore pm.install("docling") - from docling.document_converter import DocumentConverter + from docling.document_converter import DocumentConverter # type: ignore converter = DocumentConverter() result = converter.convert(file_path) @@ -718,17 +749,33 @@ def create_document_routes( logger.error(traceback.format_exc()) raise HTTPException(status_code=500, detail=str(e)) - @router.get("/pipeline_status", dependencies=[Depends(optional_api_key)]) - async def get_pipeline_status(): + @router.get( + "/pipeline_status", + dependencies=[Depends(optional_api_key)], + response_model=PipelineStatusResponse, + ) + async def get_pipeline_status() -> PipelineStatusResponse: """ Get the current status of the document indexing pipeline. This endpoint returns information about the current state of the document processing pipeline, - including whether it's busy, the current job name, when it started, how many documents - are being processed, how many batches there are, and which batch is currently being processed. + including the processing status, progress information, and history messages. Returns: - dict: A dictionary containing the pipeline status information + PipelineStatusResponse: A response object containing: + - autoscanned (bool): Whether auto-scan has started + - busy (bool): Whether the pipeline is currently busy + - job_name (str): Current job name (e.g., indexing files/indexing texts) + - job_start (str, optional): Job start time as ISO format string + - docs (int): Total number of documents to be indexed + - batchs (int): Number of batches for processing documents + - cur_batch (int): Current processing batch + - request_pending (bool): Flag for pending request for processing + - latest_message (str): Latest message from pipeline processing + - history_messages (List[str], optional): List of history messages + + Raises: + HTTPException: If an error occurs while retrieving pipeline status (500) """ try: from lightrag.kg.shared_storage import get_namespace_data @@ -746,7 +793,7 @@ def create_document_routes( if status_dict.get("job_start"): status_dict["job_start"] = str(status_dict["job_start"]) - return status_dict + return PipelineStatusResponse(**status_dict) except Exception as e: logger.error(f"Error getting pipeline status: {str(e)}") logger.error(traceback.format_exc()) diff --git a/lightrag/api/webui/assets/index-CJz72b6Q.js b/lightrag/api/webui/assets/index-BlVvSIic.js similarity index 97% rename from lightrag/api/webui/assets/index-CJz72b6Q.js rename to lightrag/api/webui/assets/index-BlVvSIic.js index 26bfadd6..379cdc89 100644 --- a/lightrag/api/webui/assets/index-CJz72b6Q.js +++ b/lightrag/api/webui/assets/index-BlVvSIic.js @@ -236,23 +236,23 @@ ${(t=e.config)==null?void 0:t.url}`):e});const sq=async(e,t,n)=>(await Mr.get(`/ margin-right: `).concat(u,"px ").concat(r,`; `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),` } - + .`).concat(hd,` { right: `).concat(u,"px ").concat(r,`; } - + .`).concat(md,` { margin-right: `).concat(u,"px ").concat(r,`; } - + .`).concat(hd," .").concat(hd,` { right: 0 `).concat(r,`; } - + .`).concat(md," .").concat(md,` { margin-right: 0 `).concat(r,`; } - + body[`).concat(cl,`] { `).concat(X8,": ").concat(u,`px; } @@ -702,7 +702,7 @@ void main() { vec2 sourceCompensationVector = vec2(-sourceDirection * unitNormal.y, sourceDirection * unitNormal.x) * (webGLSourceRadius + webGLSourceArrowHeadLength); - + // Target arrow head float targetRadius = a_targetRadius * a_targetRadiusCoef; float targetDirection = sign(targetRadius); @@ -1009,7 +1009,7 @@ void main() { position = viewportToClipspace(viewportOffsetPosition, u_dimensions); gl_Position = vec4(position, 0, 1); - + `).concat(n?` v_targetSize = a_targetSize * u_pixelRatio / u_sizeRatio; v_targetPoint = viewportTarget; @@ -1038,7 +1038,7 @@ void main() { * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var aN;function uJ(){if(aN)return am;aN=1;var e=nf();function t(g,b){return g===b&&(g!==0||1/g===1/b)||g!==g&&b!==b}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function u(g,b){var m=b(),S=r({inst:{value:m,getSnapshot:b}}),v=S[0].inst,A=S[1];return i(function(){v.value=m,v.getSnapshot=b,c(v)&&A({inst:v})},[g,m,b]),a(function(){return c(v)&&A({inst:v}),g(function(){c(v)&&A({inst:v})})},[g]),l(m),m}function c(g){var b=g.getSnapshot;g=g.value;try{var m=b();return!n(g,m)}catch{return!0}}function f(g,b){return b()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return am.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,am}var oN;function cJ(){return oN||(oN=1,rm.exports=uJ()),rm.exports}var dJ=cJ(),Hs='[cmdk-group=""]',om='[cmdk-group-items=""]',fJ='[cmdk-group-heading=""]',w0='[cmdk-item=""]',iN=`${w0}:not([aria-disabled="true"])`,$x="cmdk-item-select",Qo="data-value",pJ=(e,t,n)=>sJ(e,t,n),O3=k.createContext(void 0),ku=()=>k.useContext(O3),D3=k.createContext(void 0),x0=()=>k.useContext(D3),I3=k.createContext(void 0),L3=k.forwardRef((e,t)=>{let n=ol(()=>{var U,L;return{search:"",value:(L=(U=e.value)!=null?U:e.defaultValue)!=null?L:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=ol(()=>new Set),a=ol(()=>new Map),i=ol(()=>new Map),l=ol(()=>new Set),u=M3(e),{label:c,children:f,value:p,onValueChange:g,filter:b,shouldFilter:m,loop:S,disablePointerSelection:v=!1,vimBindings:A=!0,...R}=e,x=En(),T=En(),C=En(),N=k.useRef(null),_=kJ();ii(()=>{if(p!==void 0){let U=p.trim();n.current.value=U,O.emit()}},[p]),ii(()=>{_(6,P)},[]);let O=k.useMemo(()=>({subscribe:U=>(l.current.add(U),()=>l.current.delete(U)),snapshot:()=>n.current,setState:(U,L,Y)=>{var Q,se,re;if(!Object.is(n.current[U],L)){if(n.current[U]=L,U==="search")q(),M(),_(1,H);else if(U==="value"&&(Y||_(5,P),((Q=u.current)==null?void 0:Q.value)!==void 0)){let le=L??"";(re=(se=u.current).onValueChange)==null||re.call(se,le);return}O.emit()}},emit:()=>{l.current.forEach(U=>U())}}),[]),z=k.useMemo(()=>({value:(U,L,Y)=>{var Q;L!==((Q=i.current.get(U))==null?void 0:Q.value)&&(i.current.set(U,{value:L,keywords:Y}),n.current.filtered.items.set(U,I(L,Y)),_(2,()=>{M(),O.emit()}))},item:(U,L)=>(r.current.add(U),L&&(a.current.has(L)?a.current.get(L).add(U):a.current.set(L,new Set([U]))),_(3,()=>{q(),M(),n.current.value||H(),O.emit()}),()=>{i.current.delete(U),r.current.delete(U),n.current.filtered.items.delete(U);let Y=W();_(4,()=>{q(),(Y==null?void 0:Y.getAttribute("id"))===U&&H(),O.emit()})}),group:U=>(a.current.has(U)||a.current.set(U,new Set),()=>{i.current.delete(U),a.current.delete(U)}),filter:()=>u.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:x,inputId:C,labelId:T,listInnerRef:N}),[]);function I(U,L){var Y,Q;let se=(Q=(Y=u.current)==null?void 0:Y.filter)!=null?Q:pJ;return U?se(U,n.current.search,L):0}function M(){if(!n.current.search||u.current.shouldFilter===!1)return;let U=n.current.filtered.items,L=[];n.current.filtered.groups.forEach(Q=>{let se=a.current.get(Q),re=0;se.forEach(le=>{let Ae=U.get(le);re=Math.max(Ae,re)}),L.push([Q,re])});let Y=N.current;Z().sort((Q,se)=>{var re,le;let Ae=Q.getAttribute("id"),ae=se.getAttribute("id");return((re=U.get(ae))!=null?re:0)-((le=U.get(Ae))!=null?le:0)}).forEach(Q=>{let se=Q.closest(om);se?se.appendChild(Q.parentElement===se?Q:Q.closest(`${om} > *`)):Y.appendChild(Q.parentElement===Y?Q:Q.closest(`${om} > *`))}),L.sort((Q,se)=>se[1]-Q[1]).forEach(Q=>{var se;let re=(se=N.current)==null?void 0:se.querySelector(`${Hs}[${Qo}="${encodeURIComponent(Q[0])}"]`);re==null||re.parentElement.appendChild(re)})}function H(){let U=Z().find(Y=>Y.getAttribute("aria-disabled")!=="true"),L=U==null?void 0:U.getAttribute(Qo);O.setState("value",L||void 0)}function q(){var U,L,Y,Q;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let se=0;for(let re of r.current){let le=(L=(U=i.current.get(re))==null?void 0:U.value)!=null?L:"",Ae=(Q=(Y=i.current.get(re))==null?void 0:Y.keywords)!=null?Q:[],ae=I(le,Ae);n.current.filtered.items.set(re,ae),ae>0&&se++}for(let[re,le]of a.current)for(let Ae of le)if(n.current.filtered.items.get(Ae)>0){n.current.filtered.groups.add(re);break}n.current.filtered.count=se}function P(){var U,L,Y;let Q=W();Q&&(((U=Q.parentElement)==null?void 0:U.firstChild)===Q&&((Y=(L=Q.closest(Hs))==null?void 0:L.querySelector(fJ))==null||Y.scrollIntoView({block:"nearest"})),Q.scrollIntoView({block:"nearest"}))}function W(){var U;return(U=N.current)==null?void 0:U.querySelector(`${w0}[aria-selected="true"]`)}function Z(){var U;return Array.from(((U=N.current)==null?void 0:U.querySelectorAll(iN))||[])}function j(U){let L=Z()[U];L&&O.setState("value",L.getAttribute(Qo))}function G(U){var L;let Y=W(),Q=Z(),se=Q.findIndex(le=>le===Y),re=Q[se+U];(L=u.current)!=null&&L.loop&&(re=se+U<0?Q[Q.length-1]:se+U===Q.length?Q[0]:Q[se+U]),re&&O.setState("value",re.getAttribute(Qo))}function B(U){let L=W(),Y=L==null?void 0:L.closest(Hs),Q;for(;Y&&!Q;)Y=U>0?wJ(Y,Hs):xJ(Y,Hs),Q=Y==null?void 0:Y.querySelector(iN);Q?O.setState("value",Q.getAttribute(Qo)):G(U)}let X=()=>j(Z().length-1),D=U=>{U.preventDefault(),U.metaKey?X():U.altKey?B(1):G(1)},V=U=>{U.preventDefault(),U.metaKey?j(0):U.altKey?B(-1):G(-1)};return k.createElement(Xe.div,{ref:t,tabIndex:-1,...R,"cmdk-root":"",onKeyDown:U=>{var L;if((L=R.onKeyDown)==null||L.call(R,U),!U.defaultPrevented)switch(U.key){case"n":case"j":{A&&U.ctrlKey&&D(U);break}case"ArrowDown":{D(U);break}case"p":case"k":{A&&U.ctrlKey&&V(U);break}case"ArrowUp":{V(U);break}case"Home":{U.preventDefault(),j(0);break}case"End":{U.preventDefault(),X();break}case"Enter":if(!U.nativeEvent.isComposing&&U.keyCode!==229){U.preventDefault();let Y=W();if(Y){let Q=new Event($x);Y.dispatchEvent(Q)}}}}},k.createElement("label",{"cmdk-label":"",htmlFor:z.inputId,id:z.labelId,style:TJ},c),Nf(e,U=>k.createElement(D3.Provider,{value:O},k.createElement(O3.Provider,{value:z},U))))}),gJ=k.forwardRef((e,t)=>{var n,r;let a=En(),i=k.useRef(null),l=k.useContext(I3),u=ku(),c=M3(e),f=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:l==null?void 0:l.forceMount;ii(()=>{if(!f)return u.item(a,l==null?void 0:l.id)},[f]);let p=F3(a,i,[e.value,e.children,i],e.keywords),g=x0(),b=li(_=>_.value&&_.value===p.current),m=li(_=>f||u.filter()===!1?!0:_.search?_.filtered.items.get(a)>0:!0);k.useEffect(()=>{let _=i.current;if(!(!_||e.disabled))return _.addEventListener($x,S),()=>_.removeEventListener($x,S)},[m,e.onSelect,e.disabled]);function S(){var _,O;v(),(O=(_=c.current).onSelect)==null||O.call(_,p.current)}function v(){g.setState("value",p.current,!0)}if(!m)return null;let{disabled:A,value:R,onSelect:x,forceMount:T,keywords:C,...N}=e;return k.createElement(Xe.div,{ref:ru([i,t]),...N,id:a,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!b,"data-disabled":!!A,"data-selected":!!b,onPointerMove:A||u.getDisablePointerSelection()?void 0:v,onClick:A?void 0:S},e.children)}),hJ=k.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,l=En(),u=k.useRef(null),c=k.useRef(null),f=En(),p=ku(),g=li(m=>a||p.filter()===!1?!0:m.search?m.filtered.groups.has(l):!0);ii(()=>p.group(l),[]),F3(l,u,[e.value,e.heading,c]);let b=k.useMemo(()=>({id:l,forceMount:a}),[a]);return k.createElement(Xe.div,{ref:ru([u,t]),...i,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&k.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),Nf(e,m=>k.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},k.createElement(I3.Provider,{value:b},m))))}),mJ=k.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=k.useRef(null),i=li(l=>!l.search);return!n&&!i?null:k.createElement(Xe.div,{ref:ru([a,t]),...r,"cmdk-separator":"",role:"separator"})}),bJ=k.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,i=x0(),l=li(p=>p.search),u=li(p=>p.value),c=ku(),f=k.useMemo(()=>{var p;let g=(p=c.listInnerRef.current)==null?void 0:p.querySelector(`${w0}[${Qo}="${encodeURIComponent(u)}"]`);return g==null?void 0:g.getAttribute("id")},[]);return k.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),k.createElement(Xe.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":f,id:c.inputId,type:"text",value:a?e.value:l,onChange:p=>{a||i.setState("search",p.target.value),n==null||n(p.target.value)}})}),yJ=k.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=k.useRef(null),l=k.useRef(null),u=ku();return k.useEffect(()=>{if(l.current&&i.current){let c=l.current,f=i.current,p,g=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let b=c.offsetHeight;f.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return g.observe(c),()=>{cancelAnimationFrame(p),g.unobserve(c)}}},[]),k.createElement(Xe.div,{ref:ru([i,t]),...a,"cmdk-list":"",role:"listbox","aria-label":r,id:u.listId},Nf(e,c=>k.createElement("div",{ref:ru([l,u.listInnerRef]),"cmdk-list-sizer":""},c)))}),vJ=k.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:l,...u}=e;return k.createElement(Bk,{open:n,onOpenChange:r},k.createElement(Uk,{container:l},k.createElement(gf,{"cmdk-overlay":"",className:a}),k.createElement(hf,{"aria-label":e.label,"cmdk-dialog":"",className:i},k.createElement(L3,{ref:t,...u}))))}),SJ=k.forwardRef((e,t)=>li(n=>n.filtered.count===0)?k.createElement(Xe.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),EJ=k.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return k.createElement(Xe.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Nf(e,l=>k.createElement("div",{"aria-hidden":!0},l)))}),jn=Object.assign(L3,{List:yJ,Item:gJ,Input:bJ,Group:hJ,Separator:mJ,Dialog:vJ,Empty:SJ,Loading:EJ});function wJ(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function xJ(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function M3(e){let t=k.useRef(e);return ii(()=>{t.current=e}),t}var ii=typeof window>"u"?k.useEffect:k.useLayoutEffect;function ol(e){let t=k.useRef();return t.current===void 0&&(t.current=e()),t}function ru(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function li(e){let t=x0(),n=()=>e(t.snapshot());return dJ.useSyncExternalStore(t.subscribe,n,n)}function F3(e,t,n,r=[]){let a=k.useRef(),i=ku();return ii(()=>{var l;let u=(()=>{var f;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(f=p.current.textContent)==null?void 0:f.trim():a.current}})(),c=r.map(f=>f.trim());i.value(e,u,c),(l=t.current)==null||l.setAttribute(Qo,u),a.current=u}),a}var kJ=()=>{let[e,t]=k.useState(),n=ol(()=>new Map);return ii(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function AJ(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Nf({asChild:e,children:t},n){return e&&k.isValidElement(t)?k.cloneElement(AJ(t),{ref:t.ref},n(t.props.children)):n(t)}var TJ={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const z3=Bk,P3=GP,_J=Uk,B3=k.forwardRef(({className:e,...t},n)=>w.jsx(gf,{ref:n,className:Me("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...t}));B3.displayName=gf.displayName;const k0=k.forwardRef(({className:e,children:t,...n},r)=>w.jsxs(_J,{children:[w.jsx(B3,{}),w.jsxs(hf,{ref:r,className:Me("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...n,children:[t,w.jsxs(Hk,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[w.jsx(dP,{className:"h-4 w-4"}),w.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));k0.displayName=hf.displayName;const A0=({className:e,...t})=>w.jsx("div",{className:Me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});A0.displayName="DialogHeader";const T0=k.forwardRef(({className:e,...t},n)=>w.jsx(jk,{ref:n,className:Me("text-lg leading-none font-semibold tracking-tight",e),...t}));T0.displayName=jk.displayName;const _0=k.forwardRef(({className:e,...t},n)=>w.jsx(Gk,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));_0.displayName=Gk.displayName;const Of=k.forwardRef(({className:e,...t},n)=>w.jsx(jn,{ref:n,className:Me("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));Of.displayName=jn.displayName;const R0=k.forwardRef(({className:e,...t},n)=>w.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[w.jsx(r8,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),w.jsx(jn.Input,{ref:n,className:Me("placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));R0.displayName=jn.Input.displayName;const Df=k.forwardRef(({className:e,...t},n)=>w.jsx(jn.List,{ref:n,className:Me("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));Df.displayName=jn.List.displayName;const C0=k.forwardRef((e,t)=>w.jsx(jn.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));C0.displayName=jn.Empty.displayName;const Ml=k.forwardRef(({className:e,...t},n)=>w.jsx(jn.Group,{ref:n,className:Me("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t}));Ml.displayName=jn.Group.displayName;const RJ=k.forwardRef(({className:e,...t},n)=>w.jsx(jn.Separator,{ref:n,className:Me("bg-border -mx-1 h-px",e),...t}));RJ.displayName=jn.Separator.displayName;const Fl=k.forwardRef(({className:e,...t},n)=>w.jsx(jn.Item,{ref:n,className:Me("data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));Fl.displayName=jn.Item.displayName;const CJ=({layout:e,autoRunFor:t})=>{const n=br(),{stop:r,start:a,isRunning:i}=e;return k.useEffect(()=>{if(!n)return;let l=null;return t!==void 0&&t>-1&&n.getGraph().order>0&&(a(),l=t>0?window.setTimeout(()=>{r()},t):null),()=>{r(),l&&clearTimeout(l)}},[t,a,r,n]),w.jsx(Lt,{size:"icon",onClick:()=>i?r():a(),tooltip:i?"Stop the layout animation":"Start the layout animation",variant:Yr,children:i?w.jsx(Zq,{}):w.jsx(Jq,{})})},NJ=()=>{const e=br(),[t,n]=k.useState("Circular"),[r,a]=k.useState(!1),i=We.use.graphLayoutMaxIterations(),l=wQ(),u=yQ(),c=JQ(),f=YQ({settings:{margin:1}}),p=CQ({maxIterations:i}),g=_3({iterations:i}),b=KQ(),m=NQ(),S=BQ(),v=k.useMemo(()=>({Circular:{layout:l},Circlepack:{layout:u},Random:{layout:c},Noverlaps:{layout:f,worker:b},"Force Directed":{layout:p,worker:m},"Force Atlas":{layout:g,worker:S}}),[u,l,p,g,f,c,m,b,S]),A=k.useCallback(R=>{console.debug(R);const{positions:x}=v[R].layout;zX(e.getGraph(),x(),{duration:500}),n(R)},[v,e]);return w.jsxs(w.Fragment,{children:[w.jsx("div",{children:v[t]&&"worker"in v[t]&&w.jsx(CJ,{layout:v[t].worker})}),w.jsx("div",{children:w.jsxs(kf,{open:r,onOpenChange:a,children:[w.jsx(Af,{asChild:!0,children:w.jsx(Lt,{size:"icon",variant:Yr,onClick:()=>a(R=>!R),tooltip:"Layout Graph",children:w.jsx(Uq,{})})}),w.jsx(yu,{side:"right",align:"center",className:"p-1",children:w.jsx(Of,{children:w.jsx(Df,{children:w.jsx(Ml,{children:Object.keys(v).map(R=>w.jsx(Fl,{onSelect:()=>{A(R)},className:"cursor-pointer text-xs",children:R},R))})})})})]})})]})};var Sd={exports:{}},OJ=Sd.exports,lN;function DJ(){return lN||(lN=1,function(e){(function(t,n,r){function a(c){var f=this,p=u();f.next=function(){var g=2091639*f.s0+f.c*23283064365386963e-26;return f.s0=f.s1,f.s1=f.s2,f.s2=g-(f.c=g|0)},f.c=1,f.s0=p(" "),f.s1=p(" "),f.s2=p(" "),f.s0-=p(c),f.s0<0&&(f.s0+=1),f.s1-=p(c),f.s1<0&&(f.s1+=1),f.s2-=p(c),f.s2<0&&(f.s2+=1),p=null}function i(c,f){return f.c=c.c,f.s0=c.s0,f.s1=c.s1,f.s2=c.s2,f}function l(c,f){var p=new a(c),g=f&&f.state,b=p.next;return b.int32=function(){return p.next()*4294967296|0},b.double=function(){return b()+(b()*2097152|0)*11102230246251565e-32},b.quick=b,g&&(typeof g=="object"&&i(g,p),b.state=function(){return i(p,{})}),b}function u(){var c=4022871197,f=function(p){p=String(p);for(var g=0;g>>0,b-=c,b*=c,c=b>>>0,b-=c,c+=b*4294967296}return(c>>>0)*23283064365386963e-26};return f}n&&n.exports?n.exports=l:this.alea=l})(OJ,e)}(Sd)),Sd.exports}var Ed={exports:{}},IJ=Ed.exports,sN;function LJ(){return sN||(sN=1,function(e){(function(t,n,r){function a(u){var c=this,f="";c.x=0,c.y=0,c.z=0,c.w=0,c.next=function(){var g=c.x^c.x<<11;return c.x=c.y,c.y=c.z,c.z=c.w,c.w^=c.w>>>19^g^g>>>8},u===(u|0)?c.x=u:f+=u;for(var p=0;p>>0)/4294967296};return g.double=function(){do var b=f.next()>>>11,m=(f.next()>>>0)/4294967296,S=(b+m)/(1<<21);while(S===0);return S},g.int32=f.next,g.quick=g,p&&(typeof p=="object"&&i(p,f),g.state=function(){return i(f,{})}),g}n&&n.exports?n.exports=l:this.xor128=l})(IJ,e)}(Ed)),Ed.exports}var wd={exports:{}},MJ=wd.exports,uN;function FJ(){return uN||(uN=1,function(e){(function(t,n,r){function a(u){var c=this,f="";c.next=function(){var g=c.x^c.x>>>2;return c.x=c.y,c.y=c.z,c.z=c.w,c.w=c.v,(c.d=c.d+362437|0)+(c.v=c.v^c.v<<4^(g^g<<1))|0},c.x=0,c.y=0,c.z=0,c.w=0,c.v=0,u===(u|0)?c.x=u:f+=u;for(var p=0;p>>4),c.next()}function i(u,c){return c.x=u.x,c.y=u.y,c.z=u.z,c.w=u.w,c.v=u.v,c.d=u.d,c}function l(u,c){var f=new a(u),p=c&&c.state,g=function(){return(f.next()>>>0)/4294967296};return g.double=function(){do var b=f.next()>>>11,m=(f.next()>>>0)/4294967296,S=(b+m)/(1<<21);while(S===0);return S},g.int32=f.next,g.quick=g,p&&(typeof p=="object"&&i(p,f),g.state=function(){return i(f,{})}),g}n&&n.exports?n.exports=l:this.xorwow=l})(MJ,e)}(wd)),wd.exports}var xd={exports:{}},zJ=xd.exports,cN;function PJ(){return cN||(cN=1,function(e){(function(t,n,r){function a(u){var c=this;c.next=function(){var p=c.x,g=c.i,b,m;return b=p[g],b^=b>>>7,m=b^b<<24,b=p[g+1&7],m^=b^b>>>10,b=p[g+3&7],m^=b^b>>>3,b=p[g+4&7],m^=b^b<<7,b=p[g+7&7],b=b^b<<13,m^=b^b<<9,p[g]=m,c.i=g+1&7,m};function f(p,g){var b,m=[];if(g===(g|0))m[0]=g;else for(g=""+g,b=0;b0;--b)p.next()}f(c,u)}function i(u,c){return c.x=u.x.slice(),c.i=u.i,c}function l(u,c){u==null&&(u=+new Date);var f=new a(u),p=c&&c.state,g=function(){return(f.next()>>>0)/4294967296};return g.double=function(){do var b=f.next()>>>11,m=(f.next()>>>0)/4294967296,S=(b+m)/(1<<21);while(S===0);return S},g.int32=f.next,g.quick=g,p&&(p.x&&i(p,f),g.state=function(){return i(f,{})}),g}n&&n.exports?n.exports=l:this.xorshift7=l})(zJ,e)}(xd)),xd.exports}var kd={exports:{}},BJ=kd.exports,dN;function UJ(){return dN||(dN=1,function(e){(function(t,n,r){function a(u){var c=this;c.next=function(){var p=c.w,g=c.X,b=c.i,m,S;return c.w=p=p+1640531527|0,S=g[b+34&127],m=g[b=b+1&127],S^=S<<13,m^=m<<17,S^=S>>>15,m^=m>>>12,S=g[b]=S^m,c.i=b,S+(p^p>>>16)|0};function f(p,g){var b,m,S,v,A,R=[],x=128;for(g===(g|0)?(m=g,g=null):(g=g+"\0",m=0,x=Math.max(x,g.length)),S=0,v=-32;v>>15,m^=m<<4,m^=m>>>13,v>=0&&(A=A+1640531527|0,b=R[v&127]^=m+A,S=b==0?S+1:0);for(S>=128&&(R[(g&&g.length||0)&127]=-1),S=127,v=4*128;v>0;--v)m=R[S+34&127],b=R[S=S+1&127],m^=m<<13,b^=b<<17,m^=m>>>15,b^=b>>>12,R[S]=m^b;p.w=A,p.X=R,p.i=S}f(c,u)}function i(u,c){return c.i=u.i,c.w=u.w,c.X=u.X.slice(),c}function l(u,c){u==null&&(u=+new Date);var f=new a(u),p=c&&c.state,g=function(){return(f.next()>>>0)/4294967296};return g.double=function(){do var b=f.next()>>>11,m=(f.next()>>>0)/4294967296,S=(b+m)/(1<<21);while(S===0);return S},g.int32=f.next,g.quick=g,p&&(p.X&&i(p,f),g.state=function(){return i(f,{})}),g}n&&n.exports?n.exports=l:this.xor4096=l})(BJ,e)}(kd)),kd.exports}var Ad={exports:{}},jJ=Ad.exports,fN;function GJ(){return fN||(fN=1,function(e){(function(t,n,r){function a(u){var c=this,f="";c.next=function(){var g=c.b,b=c.c,m=c.d,S=c.a;return g=g<<25^g>>>7^b,b=b-m|0,m=m<<24^m>>>8^S,S=S-g|0,c.b=g=g<<20^g>>>12^b,c.c=b=b-m|0,c.d=m<<16^b>>>16^S,c.a=S-g|0},c.a=0,c.b=0,c.c=-1640531527,c.d=1367130551,u===Math.floor(u)?(c.a=u/4294967296|0,c.b=u|0):f+=u;for(var p=0;p>>0)/4294967296};return g.double=function(){do var b=f.next()>>>11,m=(f.next()>>>0)/4294967296,S=(b+m)/(1<<21);while(S===0);return S},g.int32=f.next,g.quick=g,p&&(typeof p=="object"&&i(p,f),g.state=function(){return i(f,{})}),g}n&&n.exports?n.exports=l:this.tychei=l})(jJ,e)}(Ad)),Ad.exports}var Td={exports:{}};const HJ={},$J=Object.freeze(Object.defineProperty({__proto__:null,default:HJ},Symbol.toStringTag,{value:"Module"})),qJ=pH($J);var VJ=Td.exports,pN;function WJ(){return pN||(pN=1,function(e){(function(t,n,r){var a=256,i=6,l=52,u="random",c=r.pow(a,i),f=r.pow(2,l),p=f*2,g=a-1,b;function m(C,N,_){var O=[];N=N==!0?{entropy:!0}:N||{};var z=R(A(N.entropy?[C,T(n)]:C??x(),3),O),I=new S(O),M=function(){for(var H=I.g(i),q=c,P=0;H=p;)H/=2,q/=2,P>>>=1;return(H+P)/q};return M.int32=function(){return I.g(4)|0},M.quick=function(){return I.g(4)/4294967296},M.double=M,R(T(I.S),n),(N.pass||_||function(H,q,P,W){return W&&(W.S&&v(W,I),H.state=function(){return v(I,{})}),P?(r[u]=H,q):H})(M,z,"global"in N?N.global:this==r,N.state)}function S(C){var N,_=C.length,O=this,z=0,I=O.i=O.j=0,M=O.S=[];for(_||(C=[_++]);z{if(!e||!Array.isArray(e.nodes)||!Array.isArray(e.edges))return!1;for(const t of e.nodes)if(!t.id||!t.labels||!t.properties)return!1;for(const t of e.edges)if(!t.id||!t.source||!t.target)return!1;for(const t of e.edges){const n=e.getNode(t.source),r=e.getNode(t.target);if(n==null||r==null)return!1}return!0},QJ=async(e,t,n)=>{let r=null;try{r=await sq(e,t,n)}catch(i){return Pn.getState().setErrorMessage(Nr(i),"Query Graphs Error!"),null}let a=null;if(r){const i={},l={};for(let p=0;p0){const p=A9-iR;for(const g of r.nodes)g.size=Math.round(iR+p*Math.pow((g.degree-u)/f,.5))}a=new cQ,a.nodes=r.nodes,a.edges=r.edges,a.nodeIdMap=i,a.edgeIdMap=l,ZJ(a)||(a=null,console.error("Invalid graph data")),console.log("Graph data loaded")}return a},JJ=e=>{const t=new nu;for(const n of(e==null?void 0:e.nodes)??[])t.addNode(n.id,{label:n.labels.join(", "),color:n.color,x:n.x,y:n.y,size:n.size,borderColor:E9,borderSize:.2});for(const n of(e==null?void 0:e.edges)??[])n.dynamicId=t.addDirectedEdge(n.source,n.target,{label:n.type||void 0});return t},Ji={label:"",maxQueryDepth:0,minDegree:0},U3=()=>{const e=We.use.queryLabel(),t=Et.use.rawGraph(),n=Et.use.sigmaGraph(),r=We.use.graphQueryMaxDepth(),a=We.use.graphMinDegree(),i=k.useCallback(c=>(t==null?void 0:t.getNode(c))||null,[t]),l=k.useCallback((c,f=!0)=>(t==null?void 0:t.getEdge(c,f))||null,[t]);return k.useEffect(()=>{if(e){if(Ji.label!==e||Ji.maxQueryDepth!==r||Ji.minDegree!==a){Ji.label=e,Ji.maxQueryDepth=r,Ji.minDegree=a;const c=Et.getState();c.reset(),QJ(e,r,a).then(f=>{c.setSigmaGraph(JJ(f)),f==null||f.buildDynamicMap(),c.setRawGraph(f)})}}else{const c=Et.getState();c.reset(),c.setSigmaGraph(new nu)}},[e,r,a]),{lightrageGraph:k.useCallback(()=>{if(n)return n;const c=new nu;return Et.getState().setSigmaGraph(c),c},[n]),getNode:i,getEdge:l}},ed=e=>!!(e.type.startsWith("mouse")&&e.buttons!==0),eee=({disableHoverEffect:e})=>{const{lightrageGraph:t}=U3(),n=br(),r=i3(),a=o3(),i=dZ(),l=We.use.graphLayoutMaxIterations(),{assign:u}=_3({iterations:l}),{theme:c}=l0(),f=We.use.enableHideUnselectedEdges(),p=Et.use.selectedNode(),g=Et.use.focusedNode(),b=Et.use.selectedEdge(),m=Et.use.focusedEdge();return k.useEffect(()=>{const S=t();i(S),u()},[u,i,t,l]),k.useEffect(()=>{const{setFocusedNode:S,setSelectedNode:v,setFocusedEdge:A,setSelectedEdge:R,clearSelection:x}=Et.getState();r({enterNode:T=>{ed(T.event.original)||S(T.node)},leaveNode:T=>{ed(T.event.original)||S(null)},clickNode:T=>{v(T.node),R(null)},clickEdge:T=>{R(T.edge),v(null)},enterEdge:T=>{ed(T.event.original)||A(T.edge)},leaveEdge:T=>{ed(T.event.original)||A(null)},clickStage:()=>x()})},[r]),k.useEffect(()=>{const S=c==="dark",v=S?y9:void 0,A=S?x9:void 0;a({nodeReducer:(R,x)=>{const T=n.getGraph(),C={...x,highlighted:x.highlighted||!1,labelColor:v};if(!e){C.highlighted=!1;const N=g||p,_=m||b;if(N)(R===N||T.neighbors(N).includes(R))&&(C.highlighted=!0,R===p&&(C.borderColor=w9));else if(_)T.extremities(_).includes(R)&&(C.highlighted=!0,C.size=3);else return C;C.highlighted?S&&(C.labelColor=v9):C.color=S9}return C},edgeReducer:(R,x)=>{const T=n.getGraph(),C={...x,hidden:!1,labelColor:v,color:A};if(!e){const N=g||p;N?f?T.extremities(R).includes(N)||(C.hidden=!0):T.extremities(R).includes(N)&&(C.color=oR):(m||b)&&(R===b?C.color=k9:R===m?C.color=oR:f&&(C.hidden=!0))}return C}})},[p,g,b,m,a,n,e,c,f]),null},tee=()=>{const{zoomIn:e,zoomOut:t,reset:n}=l3({duration:200,factor:1.5}),r=k.useCallback(()=>e(),[e]),a=k.useCallback(()=>t(),[t]),i=k.useCallback(()=>n(),[n]);return w.jsxs(w.Fragment,{children:[w.jsx(Lt,{variant:Yr,onClick:r,tooltip:"Zoom In",size:"icon",children:w.jsx(h8,{})}),w.jsx(Lt,{variant:Yr,onClick:a,tooltip:"Zoom Out",size:"icon",children:w.jsx(b8,{})}),w.jsx(Lt,{variant:Yr,onClick:i,tooltip:"Reset Zoom",size:"icon",children:w.jsx(Fq,{})})]})},nee=()=>{const{isFullScreen:e,toggle:t}=fZ();return w.jsx(w.Fragment,{children:e?w.jsx(Lt,{variant:Yr,onClick:t,tooltip:"Windowed",size:"icon",children:w.jsx(Wq,{})}):w.jsx(Lt,{variant:Yr,onClick:t,tooltip:"Full Screen",size:"icon",children:w.jsx(qq,{})})})};function j3(e){const t=k.useRef({value:e,previous:e});return k.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var N0="Checkbox",[ree,rve]=mr(N0),[aee,oee]=ree(N0),G3=k.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:i,required:l,disabled:u,value:c="on",onCheckedChange:f,form:p,...g}=e,[b,m]=k.useState(null),S=ft(t,C=>m(C)),v=k.useRef(!1),A=b?p||!!b.closest("form"):!0,[R=!1,x]=Oa({prop:a,defaultProp:i,onChange:f}),T=k.useRef(R);return k.useEffect(()=>{const C=b==null?void 0:b.form;if(C){const N=()=>x(T.current);return C.addEventListener("reset",N),()=>C.removeEventListener("reset",N)}},[b,x]),w.jsxs(aee,{scope:n,state:R,disabled:u,children:[w.jsx(Xe.button,{type:"button",role:"checkbox","aria-checked":ho(R)?"mixed":R,"aria-required":l,"data-state":q3(R),"data-disabled":u?"":void 0,disabled:u,value:c,...g,ref:S,onKeyDown:Ye(e.onKeyDown,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:Ye(e.onClick,C=>{x(N=>ho(N)?!0:!N),A&&(v.current=C.isPropagationStopped(),v.current||C.stopPropagation())})}),A&&w.jsx(iee,{control:b,bubbles:!v.current,name:r,value:c,checked:R,required:l,disabled:u,form:p,style:{transform:"translateX(-100%)"},defaultChecked:ho(i)?!1:i})]})});G3.displayName=N0;var H3="CheckboxIndicator",$3=k.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,i=oee(H3,n);return w.jsx(Jn,{present:r||ho(i.state)||i.state===!0,children:w.jsx(Xe.span,{"data-state":q3(i.state),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});$3.displayName=H3;var iee=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:a,...i}=e,l=k.useRef(null),u=j3(n),c=yB(t);k.useEffect(()=>{const p=l.current,g=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(g,"checked").set;if(u!==n&&m){const S=new Event("click",{bubbles:r});p.indeterminate=ho(n),m.call(p,ho(n)?!1:n),p.dispatchEvent(S)}},[u,n,r]);const f=k.useRef(ho(n)?!1:n);return w.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a??f.current,...i,tabIndex:-1,ref:l,style:{...e.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function ho(e){return e==="indeterminate"}function q3(e){return ho(e)?"indeterminate":e?"checked":"unchecked"}var V3=G3,lee=$3;const Ks=k.forwardRef(({className:e,...t},n)=>w.jsx(V3,{ref:n,className:Me("peer border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground h-4 w-4 shrink-0 rounded-sm border focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:w.jsx(lee,{className:Me("flex items-center justify-center text-current"),children:w.jsx(Nk,{className:"h-4 w-4"})})}));Ks.displayName=V3.displayName;var see="Separator",hN="horizontal",uee=["horizontal","vertical"],W3=k.forwardRef((e,t)=>{const{decorative:n,orientation:r=hN,...a}=e,i=cee(r)?r:hN,u=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return w.jsx(Xe.div,{"data-orientation":i,...u,...a,ref:t})});W3.displayName=see;function cee(e){return uee.includes(e)}var Y3=W3;const il=k.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>w.jsx(Y3,{ref:a,decorative:n,orientation:t,className:Me("bg-border shrink-0",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));il.displayName=Y3.displayName;const so=({checked:e,onCheckedChange:t,label:n})=>w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx(Ks,{checked:e,onCheckedChange:t}),w.jsx("label",{htmlFor:"terms",className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n})]}),lm=({value:e,onEditFinished:t,label:n,min:r,max:a})=>{const[i,l]=k.useState(e),u=k.useCallback(f=>{const p=f.target.value.trim();if(p.length===0){l(null);return}const g=Number.parseInt(p);if(!isNaN(g)&&g!==i){if(r!==void 0&&ga)return;l(g)}},[i,r,a]),c=k.useCallback(()=>{i!==null&&e!==i&&t(i)},[e,i,t]);return w.jsxs("div",{className:"flex flex-col gap-2",children:[w.jsx("label",{htmlFor:"terms",className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n}),w.jsx(Eo,{type:"number",value:i===null?"":i,onChange:u,className:"h-6 w-full min-w-0 pr-1",min:r,max:a,onBlur:c,onKeyDown:f=>{f.key==="Enter"&&c()}})]})};function dee(){const[e,t]=k.useState(!1),[n,r]=k.useState(""),a=We.use.showPropertyPanel(),i=We.use.showNodeSearchBar(),l=We.use.showNodeLabel(),u=We.use.enableEdgeEvents(),c=We.use.enableNodeDrag(),f=We.use.enableHideUnselectedEdges(),p=We.use.showEdgeLabel(),g=We.use.graphQueryMaxDepth(),b=We.use.graphMinDegree(),m=We.use.graphLayoutMaxIterations(),S=We.use.enableHealthCheck(),v=We.use.apiKey();k.useEffect(()=>{r(v||"")},[v,e]);const A=k.useCallback(()=>We.setState(P=>({enableNodeDrag:!P.enableNodeDrag})),[]),R=k.useCallback(()=>We.setState(P=>({enableEdgeEvents:!P.enableEdgeEvents})),[]),x=k.useCallback(()=>We.setState(P=>({enableHideUnselectedEdges:!P.enableHideUnselectedEdges})),[]),T=k.useCallback(()=>We.setState(P=>({showEdgeLabel:!P.showEdgeLabel})),[]),C=k.useCallback(()=>We.setState(P=>({showPropertyPanel:!P.showPropertyPanel})),[]),N=k.useCallback(()=>We.setState(P=>({showNodeSearchBar:!P.showNodeSearchBar})),[]),_=k.useCallback(()=>We.setState(P=>({showNodeLabel:!P.showNodeLabel})),[]),O=k.useCallback(()=>We.setState(P=>({enableHealthCheck:!P.enableHealthCheck})),[]),z=k.useCallback(P=>{P<1||We.setState({graphQueryMaxDepth:P})},[]),I=k.useCallback(P=>{P<0||We.setState({graphMinDegree:P})},[]),M=k.useCallback(P=>{P<1||We.setState({graphLayoutMaxIterations:P})},[]),H=k.useCallback(async()=>{We.setState({apiKey:n||null}),await Pn.getState().check(),t(!1)},[n]),q=k.useCallback(P=>{r(P.target.value)},[r]);return w.jsxs(kf,{open:e,onOpenChange:t,children:[w.jsx(Af,{asChild:!0,children:w.jsx(Lt,{variant:Yr,tooltip:"Settings",size:"icon",children:w.jsx(l8,{})})}),w.jsx(yu,{side:"right",align:"start",className:"mb-2 p-2",onCloseAutoFocus:P=>P.preventDefault(),children:w.jsxs("div",{className:"flex flex-col gap-2",children:[w.jsx(so,{checked:S,onCheckedChange:O,label:"Health Check"}),w.jsx(il,{}),w.jsx(so,{checked:a,onCheckedChange:C,label:"Show Property Panel"}),w.jsx(so,{checked:i,onCheckedChange:N,label:"Show Search Bar"}),w.jsx(il,{}),w.jsx(so,{checked:l,onCheckedChange:_,label:"Show Node Label"}),w.jsx(so,{checked:c,onCheckedChange:A,label:"Node Draggable"}),w.jsx(il,{}),w.jsx(so,{checked:p,onCheckedChange:T,label:"Show Edge Label"}),w.jsx(so,{checked:f,onCheckedChange:x,label:"Hide Unselected Edges"}),w.jsx(so,{checked:u,onCheckedChange:R,label:"Edge Events"}),w.jsx(il,{}),w.jsx(lm,{label:"Max Query Depth",min:1,value:g,onEditFinished:z}),w.jsx(lm,{label:"Minimum Degree",min:0,value:b,onEditFinished:I}),w.jsx(lm,{label:"Max Layout Iterations",min:1,max:20,value:m,onEditFinished:M}),w.jsx(il,{}),w.jsxs("div",{className:"flex flex-col gap-2",children:[w.jsx("label",{className:"text-sm font-medium",children:"API Key"}),w.jsxs("form",{className:"flex h-6 gap-2",onSubmit:P=>P.preventDefault(),children:[w.jsx("div",{className:"w-0 flex-1",children:w.jsx(Eo,{type:"password",value:n,onChange:q,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"})}),w.jsx(Lt,{onClick:H,variant:"outline",size:"sm",className:"max-h-full shrink-0",children:"Save"})]})]})]})})]})}const fee="ENTRIES",K3="KEYS",X3="VALUES",fn="";class sm{constructor(t,n){const r=t._tree,a=Array.from(r.keys());this.set=t,this._type=n,this._path=a.length>0?[{node:r,keys:a}]:[]}next(){const t=this.dive();return this.backtrack(),t}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:t,keys:n}=el(this._path);if(el(n)===fn)return{done:!1,value:this.result()};const r=t.get(el(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const t=el(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:t})=>el(t)).filter(t=>t!==fn).join("")}value(){return el(this._path).node.get(fn)}result(){switch(this._type){case X3:return this.value();case K3:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const el=e=>e[e.length-1],pee=(e,t,n)=>{const r=new Map;if(t===void 0)return r;const a=t.length+1,i=a+n,l=new Uint8Array(i*a).fill(n+1);for(let u=0;u{const c=i*l;e:for(const f of e.keys())if(f===fn){const p=a[c-1];p<=n&&r.set(u,[e.get(f),p])}else{let p=i;for(let g=0;gn)continue e}Z3(e.get(f),t,n,r,a,p,l,u+f)}};class po{constructor(t=new Map,n=""){this._size=void 0,this._tree=t,this._prefix=n}atPrefix(t){if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");const[n,r]=Gd(this._tree,t.slice(this._prefix.length));if(n===void 0){const[a,i]=O0(r);for(const l of a.keys())if(l!==fn&&l.startsWith(i)){const u=new Map;return u.set(l.slice(i.length),a.get(l)),new po(u,t)}}return new po(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(t){return this._size=void 0,gee(this._tree,t)}entries(){return new sm(this,fee)}forEach(t){for(const[n,r]of this)t(n,r,this)}fuzzyGet(t,n){return pee(this._tree,t,n)}get(t){const n=qx(this._tree,t);return n!==void 0?n.get(fn):void 0}has(t){const n=qx(this._tree,t);return n!==void 0&&n.has(fn)}keys(){return new sm(this,K3)}set(t,n){if(typeof t!="string")throw new Error("key must be a string");return this._size=void 0,um(this._tree,t).set(fn,n),this}get size(){if(this._size)return this._size;this._size=0;const t=this.entries();for(;!t.next().done;)this._size+=1;return this._size}update(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=um(this._tree,t);return r.set(fn,n(r.get(fn))),this}fetch(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=um(this._tree,t);let a=r.get(fn);return a===void 0&&r.set(fn,a=n()),a}values(){return new sm(this,X3)}[Symbol.iterator](){return this.entries()}static from(t){const n=new po;for(const[r,a]of t)n.set(r,a);return n}static fromObject(t){return po.from(Object.entries(t))}}const Gd=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(const r of e.keys())if(r!==fn&&t.startsWith(r))return n.push([e,r]),Gd(e.get(r),t.slice(r.length),n);return n.push([e,t]),Gd(void 0,"",n)},qx=(e,t)=>{if(t.length===0||e==null)return e;for(const n of e.keys())if(n!==fn&&t.startsWith(n))return qx(e.get(n),t.slice(n.length))},um=(e,t)=>{const n=t.length;e:for(let r=0;e&&r{const[n,r]=Gd(e,t);if(n!==void 0){if(n.delete(fn),n.size===0)Q3(r);else if(n.size===1){const[a,i]=n.entries().next().value;J3(r,a,i)}}},Q3=e=>{if(e.length===0)return;const[t,n]=O0(e);if(t.delete(n),t.size===0)Q3(e.slice(0,-1));else if(t.size===1){const[r,a]=t.entries().next().value;r!==fn&&J3(e.slice(0,-1),r,a)}},J3=(e,t,n)=>{if(e.length===0)return;const[r,a]=O0(e);r.set(a+t,n),r.delete(a)},O0=e=>e[e.length-1],D0="or",e4="and",hee="and_not";class mo{constructor(t){if((t==null?void 0:t.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');const n=t.autoVacuum==null||t.autoVacuum===!0?fm:t.autoVacuum;this._options={...dm,...t,autoVacuum:n,searchOptions:{...mN,...t.searchOptions||{}},autoSuggestOptions:{...See,...t.autoSuggestOptions||{}}},this._index=new po,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=Wx,this.addFields(this._options.fields)}add(t){const{extractField:n,tokenize:r,processTerm:a,fields:i,idField:l}=this._options,u=n(t,l);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${l}"`);if(this._idToShortId.has(u))throw new Error(`MiniSearch: duplicate ID ${u}`);const c=this.addDocumentId(u);this.saveStoredFields(c,t);for(const f of i){const p=n(t,f);if(p==null)continue;const g=r(p.toString(),f),b=this._fieldIds[f],m=new Set(g).size;this.addFieldLength(c,b,this._documentCount-1,m);for(const S of g){const v=a(S,f);if(Array.isArray(v))for(const A of v)this.addTerm(b,c,A);else v&&this.addTerm(b,c,v)}}}addAll(t){for(const n of t)this.add(n)}addAllAsync(t,n={}){const{chunkSize:r=10}=n,a={chunk:[],promise:Promise.resolve()},{chunk:i,promise:l}=t.reduce(({chunk:u,promise:c},f,p)=>(u.push(f),(p+1)%r===0?{chunk:[],promise:c.then(()=>new Promise(g=>setTimeout(g,0))).then(()=>this.addAll(u))}:{chunk:u,promise:c}),a);return l.then(()=>this.addAll(i))}remove(t){const{tokenize:n,processTerm:r,extractField:a,fields:i,idField:l}=this._options,u=a(t,l);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${l}"`);const c=this._idToShortId.get(u);if(c==null)throw new Error(`MiniSearch: cannot remove document with ID ${u}: it is not in the index`);for(const f of i){const p=a(t,f);if(p==null)continue;const g=n(p.toString(),f),b=this._fieldIds[f],m=new Set(g).size;this.removeFieldLength(c,b,this._documentCount,m);for(const S of g){const v=r(S,f);if(Array.isArray(v))for(const A of v)this.removeTerm(b,c,A);else v&&this.removeTerm(b,c,v)}}this._storedFields.delete(c),this._documentIds.delete(c),this._idToShortId.delete(u),this._fieldLength.delete(c),this._documentCount-=1}removeAll(t){if(t)for(const n of t)this.remove(n);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new po,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(t){const n=this._idToShortId.get(t);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${t}: it is not in the index`);this._idToShortId.delete(t),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((r,a)=>{this.removeFieldLength(n,a,this._documentCount,r)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:t,minDirtCount:n,batchSize:r,batchWait:a}=this._options.autoVacuum;this.conditionalVacuum({batchSize:r,batchWait:a},{minDirtCount:n,minDirtFactor:t})}discardAll(t){const n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const r of t)this.discard(r)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(t){const{idField:n,extractField:r}=this._options,a=r(t,n);this.discard(a),this.add(t)}vacuum(t={}){return this.conditionalVacuum(t)}conditionalVacuum(t,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const r=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=Wx,this.performVacuuming(t,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)}async performVacuuming(t,n){const r=this._dirtCount;if(this.vacuumConditionsMet(n)){const a=t.batchSize||Vx.batchSize,i=t.batchWait||Vx.batchWait;let l=1;for(const[u,c]of this._index){for(const[f,p]of c)for(const[g]of p)this._documentIds.has(g)||(p.size<=1?c.delete(f):p.delete(g));this._index.get(u).size===0&&this._index.delete(u),l%a===0&&await new Promise(f=>setTimeout(f,i)),l+=1}this._dirtCount-=r}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(t){if(t==null)return!0;let{minDirtCount:n,minDirtFactor:r}=t;return n=n||fm.minDirtCount,r=r||fm.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=r}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(t){return this._idToShortId.has(t)}getStoredFields(t){const n=this._idToShortId.get(t);if(n!=null)return this._storedFields.get(n)}search(t,n={}){const{searchOptions:r}=this._options,a={...r,...n},i=this.executeQuery(t,n),l=[];for(const[u,{score:c,terms:f,match:p}]of i){const g=f.length||1,b={id:this._documentIds.get(u),score:c*g,terms:Object.keys(p),queryTerms:f,match:p};Object.assign(b,this._storedFields.get(u)),(a.filter==null||a.filter(b))&&l.push(b)}return t===mo.wildcard&&a.boostDocument==null||l.sort(yN),l}autoSuggest(t,n={}){n={...this._options.autoSuggestOptions,...n};const r=new Map;for(const{score:i,terms:l}of this.search(t,n)){const u=l.join(" "),c=r.get(u);c!=null?(c.score+=i,c.count+=1):r.set(u,{score:i,terms:l,count:1})}const a=[];for(const[i,{score:l,terms:u,count:c}]of r)a.push({suggestion:i,terms:u,score:l/c});return a.sort(yN),a}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),n)}static async loadJSONAsync(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(t),n)}static getDefault(t){if(dm.hasOwnProperty(t))return cm(dm,t);throw new Error(`MiniSearch: unknown option "${t}"`)}static loadJS(t,n){const{index:r,documentIds:a,fieldLength:i,storedFields:l,serializationVersion:u}=t,c=this.instantiateMiniSearch(t,n);c._documentIds=td(a),c._fieldLength=td(i),c._storedFields=td(l);for(const[f,p]of c._documentIds)c._idToShortId.set(p,f);for(const[f,p]of r){const g=new Map;for(const b of Object.keys(p)){let m=p[b];u===1&&(m=m.ds),g.set(parseInt(b,10),td(m))}c._index.set(f,g)}return c}static async loadJSAsync(t,n){const{index:r,documentIds:a,fieldLength:i,storedFields:l,serializationVersion:u}=t,c=this.instantiateMiniSearch(t,n);c._documentIds=await nd(a),c._fieldLength=await nd(i),c._storedFields=await nd(l);for(const[p,g]of c._documentIds)c._idToShortId.set(g,p);let f=0;for(const[p,g]of r){const b=new Map;for(const m of Object.keys(g)){let S=g[m];u===1&&(S=S.ds),b.set(parseInt(m,10),await nd(S))}++f%1e3===0&&await t4(0),c._index.set(p,b)}return c}static instantiateMiniSearch(t,n){const{documentCount:r,nextId:a,fieldIds:i,averageFieldLength:l,dirtCount:u,serializationVersion:c}=t;if(c!==1&&c!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const f=new mo(n);return f._documentCount=r,f._nextId=a,f._idToShortId=new Map,f._fieldIds=i,f._avgFieldLength=l,f._dirtCount=u||0,f._index=new po,f}executeQuery(t,n={}){if(t===mo.wildcard)return this.executeWildcardQuery(n);if(typeof t!="string"){const b={...n,...t,queries:void 0},m=t.queries.map(S=>this.executeQuery(S,b));return this.combineResults(m,b.combineWith)}const{tokenize:r,processTerm:a,searchOptions:i}=this._options,l={tokenize:r,processTerm:a,...i,...n},{tokenize:u,processTerm:c}=l,g=u(t).flatMap(b=>c(b)).filter(b=>!!b).map(vee(l)).map(b=>this.executeQuerySpec(b,l));return this.combineResults(g,l.combineWith)}executeQuerySpec(t,n){const r={...this._options.searchOptions,...n},a=(r.fields||this._options.fields).reduce((v,A)=>({...v,[A]:cm(r.boost,A)||1}),{}),{boostDocument:i,weights:l,maxFuzzy:u,bm25:c}=r,{fuzzy:f,prefix:p}={...mN.weights,...l},g=this._index.get(t.term),b=this.termResults(t.term,t.term,1,t.termBoost,g,a,i,c);let m,S;if(t.prefix&&(m=this._index.atPrefix(t.term)),t.fuzzy){const v=t.fuzzy===!0?.2:t.fuzzy,A=v<1?Math.min(u,Math.round(t.term.length*v)):v;A&&(S=this._index.fuzzyGet(t.term,A))}if(m)for(const[v,A]of m){const R=v.length-t.term.length;if(!R)continue;S==null||S.delete(v);const x=p*v.length/(v.length+.3*R);this.termResults(t.term,v,x,t.termBoost,A,a,i,c,b)}if(S)for(const v of S.keys()){const[A,R]=S.get(v);if(!R)continue;const x=f*v.length/(v.length+R);this.termResults(t.term,v,x,t.termBoost,A,a,i,c,b)}return b}executeWildcardQuery(t){const n=new Map,r={...this._options.searchOptions,...t};for(const[a,i]of this._documentIds){const l=r.boostDocument?r.boostDocument(i,"",this._storedFields.get(a)):1;n.set(a,{score:l,terms:[],match:{}})}return n}combineResults(t,n=D0){if(t.length===0)return new Map;const r=n.toLowerCase(),a=mee[r];if(!a)throw new Error(`Invalid combination operator: ${n}`);return t.reduce(a)||new Map}toJSON(){const t=[];for(const[n,r]of this._index){const a={};for(const[i,l]of r)a[i]=Object.fromEntries(l);t.push([n,a])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:t,serializationVersion:2}}termResults(t,n,r,a,i,l,u,c,f=new Map){if(i==null)return f;for(const p of Object.keys(l)){const g=l[p],b=this._fieldIds[p],m=i.get(b);if(m==null)continue;let S=m.size;const v=this._avgFieldLength[b];for(const A of m.keys()){if(!this._documentIds.has(A)){this.removeTerm(b,A,n),S-=1;continue}const R=u?u(this._documentIds.get(A),n,this._storedFields.get(A)):1;if(!R)continue;const x=m.get(A),T=this._fieldLength.get(A)[b],C=yee(x,S,this._documentCount,T,v,c),N=r*a*g*R*C,_=f.get(A);if(_){_.score+=N,Eee(_.terms,t);const O=cm(_.match,n);O?O.push(p):_.match[n]=[p]}else f.set(A,{score:N,terms:[t],match:{[n]:[p]}})}}return f}addTerm(t,n,r){const a=this._index.fetch(r,vN);let i=a.get(t);if(i==null)i=new Map,i.set(n,1),a.set(t,i);else{const l=i.get(n);i.set(n,(l||0)+1)}}removeTerm(t,n,r){if(!this._index.has(r)){this.warnDocumentChanged(n,t,r);return}const a=this._index.fetch(r,vN),i=a.get(t);i==null||i.get(n)==null?this.warnDocumentChanged(n,t,r):i.get(n)<=1?i.size<=1?a.delete(t):i.delete(n):i.set(n,i.get(n)-1),this._index.get(r).size===0&&this._index.delete(r)}warnDocumentChanged(t,n,r){for(const a of Object.keys(this._fieldIds))if(this._fieldIds[a]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(t)} has changed before removal: term "${r}" was not present in field "${a}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(t){const n=this._nextId;return this._idToShortId.set(t,n),this._documentIds.set(n,t),this._documentCount+=1,this._nextId+=1,n}addFields(t){for(let n=0;nObject.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,mee={[D0]:(e,t)=>{for(const n of t.keys()){const r=e.get(n);if(r==null)e.set(n,t.get(n));else{const{score:a,terms:i,match:l}=t.get(n);r.score=r.score+a,r.match=Object.assign(r.match,l),bN(r.terms,i)}}return e},[e4]:(e,t)=>{const n=new Map;for(const r of t.keys()){const a=e.get(r);if(a==null)continue;const{score:i,terms:l,match:u}=t.get(r);bN(a.terms,l),n.set(r,{score:a.score+i,terms:a.terms,match:Object.assign(a.match,u)})}return n},[hee]:(e,t)=>{for(const n of t.keys())e.delete(n);return e}},bee={k:1.2,b:.7,d:.5},yee=(e,t,n,r,a,i)=>{const{k:l,b:u,d:c}=i;return Math.log(1+(n-t+.5)/(t+.5))*(c+e*(l+1)/(e+l*(1-u+u*r/a)))},vee=e=>(t,n,r)=>{const a=typeof e.fuzzy=="function"?e.fuzzy(t,n,r):e.fuzzy||!1,i=typeof e.prefix=="function"?e.prefix(t,n,r):e.prefix===!0,l=typeof e.boostTerm=="function"?e.boostTerm(t,n,r):1;return{term:t,fuzzy:a,prefix:i,termBoost:l}},dm={idField:"id",extractField:(e,t)=>e[t],tokenize:e=>e.split(wee),processTerm:e=>e.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(e,t)=>{typeof(console==null?void 0:console[e])=="function"&&console[e](t)},autoVacuum:!0},mN={combineWith:D0,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:bee},See={combineWith:e4,prefix:(e,t,n)=>t===n.length-1},Vx={batchSize:1e3,batchWait:10},Wx={minDirtFactor:.1,minDirtCount:20},fm={...Vx,...Wx},Eee=(e,t)=>{e.includes(t)||e.push(t)},bN=(e,t)=>{for(const n of t)e.includes(n)||e.push(n)},yN=({score:e},{score:t})=>t-e,vN=()=>new Map,td=e=>{const t=new Map;for(const n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},nd=async e=>{const t=new Map;let n=0;for(const r of Object.keys(e))t.set(parseInt(r,10),e[r]),++n%1e3===0&&await t4(0);return t},t4=e=>new Promise(t=>setTimeout(t,e)),wee=/[\n\r\p{Z}\p{P}]+/u;function Yx(){return Yx=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);nye.createElement("div",{className:"node"},ye.createElement("span",{className:"render "+(n?"circle":"disc"),style:{backgroundColor:t||"#000"}}),ye.createElement("span",{className:`label ${n?"text-muted":""} ${e?"":"text-italic"}`},e||r.no_label||"No label")),Dee=({id:e,labels:t})=>{const n=br(),r=k.useMemo(()=>{const a=n.getGraph().getNodeAttributes(e),i=n.getSetting("nodeReducer");return Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},a),i?i(e,a):{})},[n,e]);return ye.createElement(Zx,Object.assign({},r,{labels:t}))},Iee=({label:e,color:t,source:n,target:r,hidden:a,directed:i,labels:l={}})=>ye.createElement("div",{className:"edge"},ye.createElement(Zx,Object.assign({},n,{labels:l})),ye.createElement("div",{className:"body"},ye.createElement("div",{className:"render"},ye.createElement("span",{className:a?"dotted":"dash",style:{borderColor:t||"#000"}})," ",i&&ye.createElement("span",{className:"arrow",style:{borderTopColor:t||"#000"}})),ye.createElement("span",{className:`label ${a?"text-muted":""} ${e?"":"fst-italic"}`},e||l.no_label||"No label")),ye.createElement(Zx,Object.assign({},r,{labels:l}))),Lee=({id:e,labels:t})=>{const n=br(),r=k.useMemo(()=>{const a=n.getGraph().getEdgeAttributes(e),i=n.getSetting("nodeReducer"),l=n.getSetting("edgeReducer"),u=n.getGraph().getNodeAttributes(n.getGraph().source(e)),c=n.getGraph().getNodeAttributes(n.getGraph().target(e));return Object.assign(Object.assign(Object.assign({color:n.getSetting("defaultEdgeColor"),directed:n.getGraph().isDirected(e)},a),l?l(e,a):{}),{source:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},u),i?i(e,u):{}),target:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},c),i?i(e,c):{})})},[n,e]);return ye.createElement(Iee,Object.assign({},r,{labels:t}))};function I0(e,t){const[n,r]=k.useState(e);return k.useEffect(()=>{const a=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(a)}},[e,t]),n}function Mee({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:a,notFound:i,loadingSkeleton:l,label:u,placeholder:c="Select...",value:f,onChange:p,onFocus:g,disabled:b=!1,className:m,noResultsMessage:S}){const[v,A]=k.useState(!1),[R,x]=k.useState(!1),[T,C]=k.useState([]),[N,_]=k.useState(!1),[O,z]=k.useState(null),[I,M]=k.useState(f),[H,q]=k.useState(null),[P,W]=k.useState(""),Z=I0(P,t?0:150),[j,G]=k.useState([]);k.useEffect(()=>{A(!0),M(f)},[f]),k.useEffect(()=>{v||(async()=>{try{_(!0),z(null);const V=f!==null?await e(f):[];G(V),C(V)}catch(V){z(V instanceof Error?V.message:"Failed to fetch options")}finally{_(!1)}})()},[v,e,f]),k.useEffect(()=>{const D=async()=>{try{_(!0),z(null);const V=await e(Z);G(V),C(V)}catch(V){z(V instanceof Error?V.message:"Failed to fetch options")}finally{_(!1)}};v&&t?t&&C(Z?j.filter(V=>n?n(V,Z):!0):j):D()},[e,Z,v,t,n]);const B=k.useCallback(D=>{D!==I&&(M(D),p(D)),x(!1)},[I,M,x,p]),X=k.useCallback(D=>{D!==H&&(q(D),g(D))},[H,q,g]);return w.jsx("div",{className:Me(b&&"cursor-not-allowed opacity-50",m),onFocus:()=>{x(!0)},onBlur:()=>x(!1),children:w.jsxs(Of,{shouldFilter:!1,className:"bg-transparent",children:[w.jsxs("div",{children:[w.jsx(R0,{placeholder:c,value:P,className:"max-h-8",onValueChange:D=>{W(D),D&&!R&&x(!0)}}),N&&T.length>0&&w.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:w.jsx(cP,{className:"h-4 w-4 animate-spin"})})]}),w.jsxs(Df,{hidden:!R||Z.length===0,children:[O&&w.jsx("div",{className:"text-destructive p-4 text-center",children:O}),N&&T.length===0&&(l||w.jsx(Fee,{})),!N&&!O&&T.length===0&&(i||w.jsx(C0,{children:S??`No ${u.toLowerCase()} found.`})),w.jsx(Ml,{children:T.map((D,V)=>w.jsxs(w.Fragment,{children:[w.jsx(Fl,{value:a(D),onSelect:B,onMouseEnter:()=>X(a(D)),className:"truncate",children:r(D)},a(D)+`${V}`),V!==T.length-1&&w.jsx("div",{className:"bg-foreground/10 h-[1px]"},V)]}))})]})]})})}function Fee(){return w.jsx(Ml,{children:w.jsx(Fl,{disabled:!0,children:w.jsxs("div",{className:"flex w-full items-center gap-2",children:[w.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),w.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[w.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),w.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}function zee(e){return w.jsxs("div",{children:[e.type==="nodes"&&w.jsx(Dee,{id:e.id}),e.type==="edges"&&w.jsx(Lee,{id:e.id}),e.type==="message"&&w.jsx("div",{children:e.message})]})}const pm="__message_item",rd={graph:null,searchEngine:null},Pee=({onChange:e,onFocus:t,value:n})=>{const r=Et.use.sigmaGraph(),a=k.useMemo(()=>{if(rd.graph==r)return rd.searchEngine;if(!r||r.nodes().length==0)return;rd.graph=r;const l=new mo({idField:"id",fields:["label"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=r.nodes().map(c=>({id:c,label:r.getNodeAttribute(c,"label")}));return l.addAll(u),rd.searchEngine=l,l},[r]),i=k.useCallback(async l=>{if(t&&t(null),!l||!a)return[];const u=a.search(l).map(c=>({id:c.id,type:"nodes"}));return u.length<=lh?u:[...u.slice(0,lh),{type:"message",id:pm,message:`And ${u.length-lh} others`}]},[a,t]);return w.jsx(Mee,{className:"bg-background/60 w-24 rounded-xl border-1 opacity-60 backdrop-blur-lg transition-all hover:w-fit hover:opacity-100",fetcher:i,renderOption:zee,getOptionValue:l=>l.id,value:n&&n.type!=="message"?n.id:null,onChange:l=>{l!==pm&&e(l?{id:l,type:"nodes"}:null)},onFocus:l=>{l!==pm&&t&&t(l?{id:l,type:"nodes"}:null)},label:"item",placeholder:"Search nodes..."})},Bee=({...e})=>w.jsx(Pee,{...e});function Uee({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:a,getDisplayValue:i,notFound:l,loadingSkeleton:u,label:c,placeholder:f="Select...",value:p,onChange:g,disabled:b=!1,className:m,triggerClassName:S,searchInputClassName:v,noResultsMessage:A,triggerTooltip:R,clearable:x=!0}){const[T,C]=k.useState(!1),[N,_]=k.useState(!1),[O,z]=k.useState([]),[I,M]=k.useState(!1),[H,q]=k.useState(null),[P,W]=k.useState(p),[Z,j]=k.useState(null),[G,B]=k.useState(""),X=I0(G,t?0:150),[D,V]=k.useState([]);k.useEffect(()=>{C(!0),W(p)},[p]),k.useEffect(()=>{if(p&&O.length>0){const L=O.find(Y=>a(Y)===p);L&&j(L)}},[p,O,a]),k.useEffect(()=>{T||(async()=>{try{M(!0),q(null);const Y=await e(p);V(Y),z(Y)}catch(Y){q(Y instanceof Error?Y.message:"Failed to fetch options")}finally{M(!1)}})()},[T,e,p]),k.useEffect(()=>{const L=async()=>{try{M(!0),q(null);const Y=await e(X);V(Y),z(Y)}catch(Y){q(Y instanceof Error?Y.message:"Failed to fetch options")}finally{M(!1)}};T&&t?t&&z(X?D.filter(Y=>n?n(Y,X):!0):D):L()},[e,X,T,t,n]);const U=k.useCallback(L=>{const Y=x&&L===P?"":L;W(Y),j(O.find(Q=>a(Q)===Y)||null),g(Y),_(!1)},[P,g,x,O,a]);return w.jsxs(kf,{open:N,onOpenChange:_,children:[w.jsx(Af,{asChild:!0,children:w.jsxs(Lt,{variant:"outline",role:"combobox","aria-expanded":N,className:Me("justify-between",b&&"cursor-not-allowed opacity-50",S),disabled:b,tooltip:R,side:"bottom",children:[Z?i(Z):f,w.jsx(Aq,{className:"opacity-50",size:10})]})}),w.jsx(yu,{className:Me("p-0",m),onCloseAutoFocus:L=>L.preventDefault(),children:w.jsxs(Of,{shouldFilter:!1,children:[w.jsxs("div",{className:"relative w-full border-b",children:[w.jsx(R0,{placeholder:`Search ${c.toLowerCase()}...`,value:G,onValueChange:L=>{B(L)},className:v}),I&&O.length>0&&w.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:w.jsx(cP,{className:"h-4 w-4 animate-spin"})})]}),w.jsxs(Df,{children:[H&&w.jsx("div",{className:"text-destructive p-4 text-center",children:H}),I&&O.length===0&&(u||w.jsx(jee,{})),!I&&!H&&O.length===0&&(l||w.jsx(C0,{children:A??`No ${c.toLowerCase()} found.`})),w.jsx(Ml,{children:O.map(L=>w.jsxs(Fl,{value:a(L),onSelect:U,className:"truncate",children:[r(L),w.jsx(Nk,{className:Me("ml-auto h-3 w-3",P===a(L)?"opacity-100":"opacity-0")})]},a(L)))})]})]})})]})}function jee(){return w.jsx(Ml,{children:w.jsx(Fl,{disabled:!0,children:w.jsxs("div",{className:"flex w-full items-center gap-2",children:[w.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),w.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[w.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),w.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const tl={graph:null,searchEngine:null,labels:[]},Gee=()=>{const e=We.use.queryLabel(),t=Et.use.sigmaGraph(),n=k.useCallback(async()=>{if(tl.graph==t)return{labels:tl.labels,searchEngine:tl.searchEngine};const i=["*"].concat(await uq());i.includes(We.getState().queryLabel)||We.getState().setQueryLabel(i[0]);const l=new mo({idField:"id",fields:["value"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=i.map((c,f)=>({id:f,value:c}));return l.addAll(u),tl.graph=t,tl.searchEngine=l,tl.labels=i,{labels:i,searchEngine:l}},[t]),r=k.useCallback(async i=>{const{labels:l,searchEngine:u}=await n();let c=l;return i&&(c=u.search(i).map(f=>l[f.id])),c.length<=sh?c:[...c.slice(0,sh),`And ${c.length-sh} others`]},[n]),a=k.useCallback(i=>{i.startsWith("And ")&&i.endsWith(" others")||We.getState().setQueryLabel(i)},[]);return w.jsx(Uee,{className:"ml-2",triggerClassName:"max-h-8",searchInputClassName:"max-h-8",triggerTooltip:"Select query label",fetcher:r,renderOption:i=>w.jsx("div",{children:i}),getOptionValue:i=>i,getDisplayValue:i=>w.jsx("div",{children:i}),notFound:w.jsx("div",{className:"py-6 text-center text-sm",children:"No labels found"}),label:"Label",placeholder:"Search labels...",value:e!==null?e:"",onChange:a})},Mn=({text:e,className:t,tooltipClassName:n,tooltip:r,side:a,onClick:i})=>r?w.jsx(FB,{delayDuration:200,children:w.jsxs(zB,{children:[w.jsx(PB,{asChild:!0,children:w.jsx("label",{className:Me(t,i!==void 0?"cursor-pointer":void 0),onClick:i,children:e})}),w.jsx(a0,{side:a,className:n,children:r})]})}):w.jsx("label",{className:Me(t,i!==void 0?"cursor-pointer":void 0),onClick:i,children:e}),Hee=()=>{const{getNode:e,getEdge:t}=U3(),n=Et.use.selectedNode(),r=Et.use.focusedNode(),a=Et.use.selectedEdge(),i=Et.use.focusedEdge(),[l,u]=k.useState(null),[c,f]=k.useState(null);return k.useEffect(()=>{let p=null,g=null;r?(p="node",g=e(r)):n?(p="node",g=e(n)):i?(p="edge",g=t(i,!0)):a&&(p="edge",g=t(a,!0)),g?(p=="node"?u($ee(g)):u(qee(g)),f(p)):(u(null),f(null))},[r,n,i,a,u,f,e,t]),l?w.jsx("div",{className:"bg-background/80 max-w-xs rounded-lg border-2 p-2 text-xs backdrop-blur-lg",children:c=="node"?w.jsx(Vee,{node:l}):w.jsx(Wee,{edge:l})}):w.jsx(w.Fragment,{})},$ee=e=>{const t=Et.getState(),n=[];if(t.sigmaGraph&&t.rawGraph)for(const r of t.sigmaGraph.edges(e.id)){const a=t.rawGraph.getEdge(r,!0);if(a){const i=e.id===a.source,l=i?a.target:a.source,u=t.rawGraph.getNode(l);u&&n.push({type:i?"Target":"Source",id:l,label:u.labels.join(", ")})}}return{...e,relationships:n}},qee=e=>{var a,i;const t=Et.getState(),n=(a=t.rawGraph)==null?void 0:a.getNode(e.source),r=(i=t.rawGraph)==null?void 0:i.getNode(e.target);return{...e,sourceNode:n,targetNode:r}},Wr=({name:e,value:t,onClick:n,tooltip:r})=>w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("label",{className:"text-primary/60 tracking-wide",children:e}),":",w.jsx(Mn,{className:"hover:bg-primary/20 rounded p-1 text-ellipsis",tooltipClassName:"max-w-80",text:t,tooltip:r||t,side:"left",onClick:n})]}),Vee=({node:e})=>w.jsxs("div",{className:"flex flex-col gap-2",children:[w.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-sky-300",children:"Node"}),w.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[w.jsx(Wr,{name:"Id",value:e.id}),w.jsx(Wr,{name:"Labels",value:e.labels.join(", "),onClick:()=>{Et.getState().setSelectedNode(e.id,!0)}}),w.jsx(Wr,{name:"Degree",value:e.degree})]}),w.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),w.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>w.jsx(Wr,{name:t,value:e.properties[t]},t))}),e.relationships.length>0&&w.jsxs(w.Fragment,{children:[w.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600/90",children:"Relationships"}),w.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:e.relationships.map(({type:t,id:n,label:r})=>w.jsx(Wr,{name:t,value:r,onClick:()=>{Et.getState().setSelectedNode(n,!0)}},n))})]})]}),Wee=({edge:e})=>w.jsxs("div",{className:"flex flex-col gap-2",children:[w.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600",children:"Relationship"}),w.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[w.jsx(Wr,{name:"Id",value:e.id}),e.type&&w.jsx(Wr,{name:"Type",value:e.type}),w.jsx(Wr,{name:"Source",value:e.sourceNode?e.sourceNode.labels.join(", "):e.source,onClick:()=>{Et.getState().setSelectedNode(e.source,!0)}}),w.jsx(Wr,{name:"Target",value:e.targetNode?e.targetNode.labels.join(", "):e.target,onClick:()=>{Et.getState().setSelectedNode(e.target,!0)}})]}),w.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),w.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>w.jsx(Wr,{name:t,value:e.properties[t]},t))})]}),SN={allowInvalidContainer:!0,defaultNodeType:"default",defaultEdgeType:"curvedArrow",renderEdgeLabels:!1,edgeProgramClasses:{arrow:QU,curvedArrow:uQ,curvedNoArrow:sQ},nodeProgramClasses:{default:qZ,circel:Su,point:vZ},labelGridCellSize:60,labelRenderedSizeThreshold:12,enableEdgeEvents:!0,labelColor:{color:"#000",attribute:"labelColor"},edgeLabelColor:{color:"#000",attribute:"labelColor"},edgeLabelSize:8,labelSize:12},Yee=()=>{const e=i3(),t=br(),[n,r]=k.useState(null);return k.useEffect(()=>{e({downNode:a=>{r(a.node),t.getGraph().setNodeAttribute(a.node,"highlighted",!0)},mousemovebody:a=>{if(!n)return;const i=t.viewportToGraph(a);t.getGraph().setNodeAttribute(n,"x",i.x),t.getGraph().setNodeAttribute(n,"y",i.y),a.preventSigmaDefault(),a.original.preventDefault(),a.original.stopPropagation()},mouseup:()=>{n&&(r(null),t.getGraph().removeNodeAttribute(n,"highlighted"))},mousedown:()=>{t.getCustomBBox()||t.setCustomBBox(t.getBBox())}})},[e,t,n]),null},Kee=()=>{const[e,t]=k.useState(SN),n=Et.use.selectedNode(),r=Et.use.focusedNode(),a=Et.use.moveToSelectedNode(),i=We.use.showPropertyPanel(),l=We.use.showNodeSearchBar(),u=We.use.showNodeLabel(),c=We.use.enableEdgeEvents(),f=We.use.enableNodeDrag(),p=We.use.showEdgeLabel();k.useEffect(()=>{t({...SN,enableEdgeEvents:c,renderEdgeLabels:p,renderLabels:u})},[u,c,p]);const g=k.useCallback(v=>{v===null?Et.getState().setFocusedNode(null):v.type==="nodes"&&Et.getState().setFocusedNode(v.id)},[]),b=k.useCallback(v=>{v===null?Et.getState().setSelectedNode(null):v.type==="nodes"&&Et.getState().setSelectedNode(v.id,!0)},[]),m=k.useMemo(()=>r??n,[r,n]),S=k.useMemo(()=>n?{type:"nodes",id:n}:null,[n]);return w.jsxs(pZ,{settings:e,className:"!bg-background !size-full overflow-hidden",children:[w.jsx(eee,{}),f&&w.jsx(Yee,{}),w.jsx(fQ,{node:m,move:a}),w.jsxs("div",{className:"absolute top-2 left-2 flex items-start gap-2",children:[w.jsx(Gee,{}),l&&w.jsx(Bee,{value:S,onFocus:g,onChange:b})]}),w.jsxs("div",{className:"bg-background/60 absolute bottom-2 left-2 flex flex-col rounded-xl border-2 backdrop-blur-lg",children:[w.jsx(dee,{}),w.jsx(tee,{}),w.jsx(NJ,{}),w.jsx(nee,{})]}),i&&w.jsx("div",{className:"absolute top-2 right-2",children:w.jsx(Hee,{})})]})},r4=k.forwardRef(({className:e,...t},n)=>w.jsx("div",{className:"relative w-full overflow-auto",children:w.jsx("table",{ref:n,className:Me("w-full caption-bottom text-sm",e),...t})}));r4.displayName="Table";const a4=k.forwardRef(({className:e,...t},n)=>w.jsx("thead",{ref:n,className:Me("[&_tr]:border-b",e),...t}));a4.displayName="TableHeader";const o4=k.forwardRef(({className:e,...t},n)=>w.jsx("tbody",{ref:n,className:Me("[&_tr:last-child]:border-0",e),...t}));o4.displayName="TableBody";const Xee=k.forwardRef(({className:e,...t},n)=>w.jsx("tfoot",{ref:n,className:Me("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));Xee.displayName="TableFooter";const Qx=k.forwardRef(({className:e,...t},n)=>w.jsx("tr",{ref:n,className:Me("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));Qx.displayName="TableRow";const Ta=k.forwardRef(({className:e,...t},n)=>w.jsx("th",{ref:n,className:Me("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));Ta.displayName="TableHead";const _a=k.forwardRef(({className:e,...t},n)=>w.jsx("td",{ref:n,className:Me("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));_a.displayName="TableCell";const Zee=k.forwardRef(({className:e,...t},n)=>w.jsx("caption",{ref:n,className:Me("text-muted-foreground mt-4 text-sm",e),...t}));Zee.displayName="TableCaption";const ou=k.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:Me("bg-card text-card-foreground rounded-xl border shadow",e),...t}));ou.displayName="Card";const Hd=k.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:Me("flex flex-col space-y-1.5 p-6",e),...t}));Hd.displayName="CardHeader";const iu=k.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:Me("leading-none font-semibold tracking-tight",e),...t}));iu.displayName="CardTitle";const If=k.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));If.displayName="CardDescription";const $d=k.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:Me("p-6 pt-0",e),...t}));$d.displayName="CardContent";const Qee=k.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:Me("flex items-center p-6 pt-0",e),...t}));Qee.displayName="CardFooter";function Jee({title:e,description:t,icon:n=Lq,action:r,className:a,...i}){return w.jsxs(ou,{className:Me("flex w-full flex-col items-center justify-center space-y-6 bg-transparent p-16",a),...i,children:[w.jsx("div",{className:"mr-4 shrink-0 rounded-full border border-dashed p-4",children:w.jsx(n,{className:"text-muted-foreground size-8","aria-hidden":"true"})}),w.jsxs("div",{className:"flex flex-col items-center gap-1.5 text-center",children:[w.jsx(iu,{children:e}),t?w.jsx(If,{children:t}):null]}),r||null]})}var gm={exports:{}},hm,EN;function ete(){if(EN)return hm;EN=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return hm=e,hm}var mm,wN;function tte(){if(wN)return mm;wN=1;var e=ete();function t(){}function n(){}return n.resetWarningCache=t,mm=function(){function r(l,u,c,f,p,g){if(g!==e){var b=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw b.name="Invariant Violation",b}}r.isRequired=r;function a(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},mm}var xN;function nte(){return xN||(xN=1,gm.exports=tte()()),gm.exports}var rte=nte();const Ct=an(rte),ate=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function El(e,t,n){const r=ote(e),{webkitRelativePath:a}=e,i=typeof t=="string"?t:typeof a=="string"&&a.length>0?a:`./${e.name}`;return typeof r.path!="string"&&kN(r,"path",i),kN(r,"relativePath",i),r}function ote(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),a=ate.get(r);a&&Object.defineProperty(e,"type",{value:a,writable:!1,configurable:!1,enumerable:!0})}return e}function kN(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const ite=[".DS_Store","Thumbs.db"];function lte(e){return ci(this,void 0,void 0,function*(){return qd(e)&&ste(e.dataTransfer)?fte(e.dataTransfer,e.type):ute(e)?cte(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?dte(e):[]})}function ste(e){return qd(e)}function ute(e){return qd(e)&&qd(e.target)}function qd(e){return typeof e=="object"&&e!==null}function cte(e){return Jx(e.target.files).map(t=>El(t))}function dte(e){return ci(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>El(n))})}function fte(e,t){return ci(this,void 0,void 0,function*(){if(e.items){const n=Jx(e.items).filter(a=>a.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(pte));return AN(i4(r))}return AN(Jx(e.files).map(n=>El(n)))})}function AN(e){return e.filter(t=>ite.indexOf(t.name)===-1)}function Jx(e){if(e===null)return[];const t=[];for(let n=0;n[...t,...Array.isArray(n)?i4(n):[n]],[])}function TN(e,t){return ci(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const i=yield e.getAsFileSystemHandle();if(i===null)throw new Error(`${e} is not a File`);if(i!==void 0){const l=yield i.getFile();return l.handle=i,El(l)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return El(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function gte(e){return ci(this,void 0,void 0,function*(){return e.isDirectory?l4(e):hte(e)})}function l4(e){const t=e.createReader();return new Promise((n,r)=>{const a=[];function i(){t.readEntries(l=>ci(this,void 0,void 0,function*(){if(l.length){const u=Promise.all(l.map(gte));a.push(u),i()}else try{const u=yield Promise.all(a);n(u)}catch(u){r(u)}}),l=>{r(l)})}i()})}function hte(e){return ci(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const a=El(r,e.fullPath);t(a)},r=>{n(r)})})})}var ad={},_N;function mte(){return _N||(_N=1,ad.__esModule=!0,ad.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",a=(e.type||"").toLowerCase(),i=a.replace(/\/.*$/,"");return n.some(function(l){var u=l.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?i===u.replace(/\/.*$/,""):a===u})}return!0}),ad}var bte=mte();const bm=an(bte);function RN(e){return Ste(e)||vte(e)||u4(e)||yte()}function yte(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xx(e){return Aee(e)||Tee(e)||_ee(e)||Ree()}function Cee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Nee(e,t){if(e==null)return{};var n,r,a=Cee(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;rye.createElement("div",{className:"node"},ye.createElement("span",{className:"render "+(n?"circle":"disc"),style:{backgroundColor:t||"#000"}}),ye.createElement("span",{className:`label ${n?"text-muted":""} ${e?"":"text-italic"}`},e||r.no_label||"No label")),Dee=({id:e,labels:t})=>{const n=br(),r=k.useMemo(()=>{const a=n.getGraph().getNodeAttributes(e),i=n.getSetting("nodeReducer");return Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},a),i?i(e,a):{})},[n,e]);return ye.createElement(Zx,Object.assign({},r,{labels:t}))},Iee=({label:e,color:t,source:n,target:r,hidden:a,directed:i,labels:l={}})=>ye.createElement("div",{className:"edge"},ye.createElement(Zx,Object.assign({},n,{labels:l})),ye.createElement("div",{className:"body"},ye.createElement("div",{className:"render"},ye.createElement("span",{className:a?"dotted":"dash",style:{borderColor:t||"#000"}})," ",i&&ye.createElement("span",{className:"arrow",style:{borderTopColor:t||"#000"}})),ye.createElement("span",{className:`label ${a?"text-muted":""} ${e?"":"fst-italic"}`},e||l.no_label||"No label")),ye.createElement(Zx,Object.assign({},r,{labels:l}))),Lee=({id:e,labels:t})=>{const n=br(),r=k.useMemo(()=>{const a=n.getGraph().getEdgeAttributes(e),i=n.getSetting("nodeReducer"),l=n.getSetting("edgeReducer"),u=n.getGraph().getNodeAttributes(n.getGraph().source(e)),c=n.getGraph().getNodeAttributes(n.getGraph().target(e));return Object.assign(Object.assign(Object.assign({color:n.getSetting("defaultEdgeColor"),directed:n.getGraph().isDirected(e)},a),l?l(e,a):{}),{source:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},u),i?i(e,u):{}),target:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},c),i?i(e,c):{})})},[n,e]);return ye.createElement(Iee,Object.assign({},r,{labels:t}))};function I0(e,t){const[n,r]=k.useState(e);return k.useEffect(()=>{const a=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(a)}},[e,t]),n}function Mee({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:a,notFound:i,loadingSkeleton:l,label:u,placeholder:c="Select...",value:f,onChange:p,onFocus:g,disabled:b=!1,className:m,noResultsMessage:S}){const[v,A]=k.useState(!1),[R,x]=k.useState(!1),[T,C]=k.useState([]),[N,_]=k.useState(!1),[O,z]=k.useState(null),[I,M]=k.useState(f),[H,q]=k.useState(null),[P,W]=k.useState(""),Z=I0(P,t?0:150),[j,G]=k.useState([]);k.useEffect(()=>{A(!0),M(f)},[f]),k.useEffect(()=>{v||(async()=>{try{_(!0),z(null);const V=f!==null?await e(f):[];G(V),C(V)}catch(V){z(V instanceof Error?V.message:"Failed to fetch options")}finally{_(!1)}})()},[v,e,f]),k.useEffect(()=>{const D=async()=>{try{_(!0),z(null);const V=await e(Z);G(V),C(V)}catch(V){z(V instanceof Error?V.message:"Failed to fetch options")}finally{_(!1)}};v&&t?t&&C(Z?j.filter(V=>n?n(V,Z):!0):j):D()},[e,Z,v,t,n]);const B=k.useCallback(D=>{D!==I&&(M(D),p(D)),x(!1)},[I,M,x,p]),X=k.useCallback(D=>{D!==H&&(q(D),g(D))},[H,q,g]);return w.jsx("div",{className:Me(b&&"cursor-not-allowed opacity-50",m),onFocus:()=>{x(!0)},onBlur:()=>x(!1),children:w.jsxs(Of,{shouldFilter:!1,className:"bg-transparent",children:[w.jsxs("div",{children:[w.jsx(R0,{placeholder:c,value:P,className:"max-h-8",onValueChange:D=>{W(D),D&&!R&&x(!0)}}),N&&T.length>0&&w.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:w.jsx(cP,{className:"h-4 w-4 animate-spin"})})]}),w.jsxs(Df,{hidden:!R||Z.length===0,children:[O&&w.jsx("div",{className:"text-destructive p-4 text-center",children:O}),N&&T.length===0&&(l||w.jsx(Fee,{})),!N&&!O&&T.length===0&&(i||w.jsx(C0,{children:S??`No ${u.toLowerCase()} found.`})),w.jsx(Ml,{children:T.map((D,V)=>w.jsxs(w.Fragment,{children:[w.jsx(Fl,{value:a(D),onSelect:B,onMouseEnter:()=>X(a(D)),className:"truncate",children:r(D)},a(D)+`${V}`),V!==T.length-1&&w.jsx("div",{className:"bg-foreground/10 h-[1px]"},V)]}))})]})]})})}function Fee(){return w.jsx(Ml,{children:w.jsx(Fl,{disabled:!0,children:w.jsxs("div",{className:"flex w-full items-center gap-2",children:[w.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),w.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[w.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),w.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}function zee(e){return w.jsxs("div",{children:[e.type==="nodes"&&w.jsx(Dee,{id:e.id}),e.type==="edges"&&w.jsx(Lee,{id:e.id}),e.type==="message"&&w.jsx("div",{children:e.message})]})}const pm="__message_item",rd={graph:null,searchEngine:null},Pee=({onChange:e,onFocus:t,value:n})=>{const r=Et.use.sigmaGraph(),a=k.useMemo(()=>{if(rd.graph==r)return rd.searchEngine;if(!r||r.nodes().length==0)return;rd.graph=r;const l=new mo({idField:"id",fields:["label"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=r.nodes().map(c=>({id:c,label:r.getNodeAttribute(c,"label")}));return l.addAll(u),rd.searchEngine=l,l},[r]),i=k.useCallback(async l=>{if(t&&t(null),!l||!a)return[];const u=a.search(l).map(c=>({id:c.id,type:"nodes"}));return u.length<=lh?u:[...u.slice(0,lh),{type:"message",id:pm,message:`And ${u.length-lh} others`}]},[a,t]);return w.jsx(Mee,{className:"bg-background/60 w-24 rounded-xl border-1 opacity-60 backdrop-blur-lg transition-all hover:w-fit hover:opacity-100",fetcher:i,renderOption:zee,getOptionValue:l=>l.id,value:n&&n.type!=="message"?n.id:null,onChange:l=>{l!==pm&&e(l?{id:l,type:"nodes"}:null)},onFocus:l=>{l!==pm&&t&&t(l?{id:l,type:"nodes"}:null)},label:"item",placeholder:"Search nodes..."})},Bee=({...e})=>w.jsx(Pee,{...e});function Uee({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:a,getDisplayValue:i,notFound:l,loadingSkeleton:u,label:c,placeholder:f="Select...",value:p,onChange:g,disabled:b=!1,className:m,triggerClassName:S,searchInputClassName:v,noResultsMessage:A,triggerTooltip:R,clearable:x=!0}){const[T,C]=k.useState(!1),[N,_]=k.useState(!1),[O,z]=k.useState([]),[I,M]=k.useState(!1),[H,q]=k.useState(null),[P,W]=k.useState(p),[Z,j]=k.useState(null),[G,B]=k.useState(""),X=I0(G,t?0:150),[D,V]=k.useState([]);k.useEffect(()=>{C(!0),W(p)},[p]),k.useEffect(()=>{if(p&&O.length>0){const L=O.find(Y=>a(Y)===p);L&&j(L)}},[p,O,a]),k.useEffect(()=>{T||(async()=>{try{M(!0),q(null);const Y=await e(p);V(Y),z(Y)}catch(Y){q(Y instanceof Error?Y.message:"Failed to fetch options")}finally{M(!1)}})()},[T,e,p]),k.useEffect(()=>{const L=async()=>{try{M(!0),q(null);const Y=await e(X);V(Y),z(Y)}catch(Y){q(Y instanceof Error?Y.message:"Failed to fetch options")}finally{M(!1)}};T&&t?t&&z(X?D.filter(Y=>n?n(Y,X):!0):D):L()},[e,X,T,t,n]);const U=k.useCallback(L=>{const Y=x&&L===P?"":L;W(Y),j(O.find(Q=>a(Q)===Y)||null),g(Y),_(!1)},[P,g,x,O,a]);return w.jsxs(kf,{open:N,onOpenChange:_,children:[w.jsx(Af,{asChild:!0,children:w.jsxs(Lt,{variant:"outline",role:"combobox","aria-expanded":N,className:Me("justify-between",b&&"cursor-not-allowed opacity-50",S),disabled:b,tooltip:R,side:"bottom",children:[Z?i(Z):f,w.jsx(Aq,{className:"opacity-50",size:10})]})}),w.jsx(yu,{className:Me("p-0",m),onCloseAutoFocus:L=>L.preventDefault(),children:w.jsxs(Of,{shouldFilter:!1,children:[w.jsxs("div",{className:"relative w-full border-b",children:[w.jsx(R0,{placeholder:`Search ${c.toLowerCase()}...`,value:G,onValueChange:L=>{B(L)},className:v}),I&&O.length>0&&w.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:w.jsx(cP,{className:"h-4 w-4 animate-spin"})})]}),w.jsxs(Df,{children:[H&&w.jsx("div",{className:"text-destructive p-4 text-center",children:H}),I&&O.length===0&&(u||w.jsx(jee,{})),!I&&!H&&O.length===0&&(l||w.jsx(C0,{children:A??`No ${c.toLowerCase()} found.`})),w.jsx(Ml,{children:O.map(L=>w.jsxs(Fl,{value:a(L),onSelect:U,className:"truncate",children:[r(L),w.jsx(Nk,{className:Me("ml-auto h-3 w-3",P===a(L)?"opacity-100":"opacity-0")})]},a(L)))})]})]})})]})}function jee(){return w.jsx(Ml,{children:w.jsx(Fl,{disabled:!0,children:w.jsxs("div",{className:"flex w-full items-center gap-2",children:[w.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),w.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[w.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),w.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const tl={graph:null,searchEngine:null,labels:[]},Gee=()=>{const e=We.use.queryLabel(),t=Et.use.sigmaGraph(),n=k.useCallback(async()=>{if(tl.graph==t)return{labels:tl.labels,searchEngine:tl.searchEngine};const i=["*"].concat(await uq());i.includes(We.getState().queryLabel)||We.getState().setQueryLabel(i[0]);const l=new mo({idField:"id",fields:["value"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=i.map((c,f)=>({id:f,value:c}));return l.addAll(u),tl.graph=t,tl.searchEngine=l,tl.labels=i,{labels:i,searchEngine:l}},[t]),r=k.useCallback(async i=>{const{labels:l,searchEngine:u}=await n();let c=l;return i&&(c=u.search(i).map(f=>l[f.id])),c.length<=sh?c:[...c.slice(0,sh),`And ${c.length-sh} others`]},[n]),a=k.useCallback(i=>{i.startsWith("And ")&&i.endsWith(" others")||We.getState().setQueryLabel(i)},[]);return w.jsx(Uee,{className:"ml-2",triggerClassName:"max-h-8",searchInputClassName:"max-h-8",triggerTooltip:"Select query label",fetcher:r,renderOption:i=>w.jsx("div",{children:i}),getOptionValue:i=>i,getDisplayValue:i=>w.jsx("div",{children:i}),notFound:w.jsx("div",{className:"py-6 text-center text-sm",children:"No labels found"}),label:"Label",placeholder:"Search labels...",value:e!==null?e:"",onChange:a})},Mn=({text:e,className:t,tooltipClassName:n,tooltip:r,side:a,onClick:i})=>r?w.jsx(FB,{delayDuration:200,children:w.jsxs(zB,{children:[w.jsx(PB,{asChild:!0,children:w.jsx("label",{className:Me(t,i!==void 0?"cursor-pointer":void 0),onClick:i,children:e})}),w.jsx(a0,{side:a,className:n,children:r})]})}):w.jsx("label",{className:Me(t,i!==void 0?"cursor-pointer":void 0),onClick:i,children:e}),Hee=()=>{const{getNode:e,getEdge:t}=U3(),n=Et.use.selectedNode(),r=Et.use.focusedNode(),a=Et.use.selectedEdge(),i=Et.use.focusedEdge(),[l,u]=k.useState(null),[c,f]=k.useState(null);return k.useEffect(()=>{let p=null,g=null;r?(p="node",g=e(r)):n?(p="node",g=e(n)):i?(p="edge",g=t(i,!0)):a&&(p="edge",g=t(a,!0)),g?(p=="node"?u($ee(g)):u(qee(g)),f(p)):(u(null),f(null))},[r,n,i,a,u,f,e,t]),l?w.jsx("div",{className:"bg-background/80 max-w-xs rounded-lg border-2 p-2 text-xs backdrop-blur-lg",children:c=="node"?w.jsx(Vee,{node:l}):w.jsx(Wee,{edge:l})}):w.jsx(w.Fragment,{})},$ee=e=>{const t=Et.getState(),n=[];if(t.sigmaGraph&&t.rawGraph)for(const r of t.sigmaGraph.edges(e.id)){const a=t.rawGraph.getEdge(r,!0);if(a){const l=e.id===a.source?a.target:a.source,u=t.rawGraph.getNode(l);u&&n.push({type:"Neighbour",id:l,label:u.properties.entity_id?u.properties.entity_id:u.labels.join(", ")})}}return{...e,relationships:n}},qee=e=>{var a,i;const t=Et.getState(),n=(a=t.rawGraph)==null?void 0:a.getNode(e.source),r=(i=t.rawGraph)==null?void 0:i.getNode(e.target);return{...e,sourceNode:n,targetNode:r}},Wr=({name:e,value:t,onClick:n,tooltip:r})=>w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("label",{className:"text-primary/60 tracking-wide",children:e}),":",w.jsx(Mn,{className:"hover:bg-primary/20 rounded p-1 text-ellipsis",tooltipClassName:"max-w-80",text:t,tooltip:r||t,side:"left",onClick:n})]}),Vee=({node:e})=>w.jsxs("div",{className:"flex flex-col gap-2",children:[w.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-sky-300",children:"Node"}),w.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[w.jsx(Wr,{name:"Id",value:e.id}),w.jsx(Wr,{name:"Labels",value:e.labels.join(", "),onClick:()=>{Et.getState().setSelectedNode(e.id,!0)}}),w.jsx(Wr,{name:"Degree",value:e.degree})]}),w.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),w.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>w.jsx(Wr,{name:t,value:e.properties[t]},t))}),e.relationships.length>0&&w.jsxs(w.Fragment,{children:[w.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600/90",children:"Relationships"}),w.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:e.relationships.map(({type:t,id:n,label:r})=>w.jsx(Wr,{name:t,value:r,onClick:()=>{Et.getState().setSelectedNode(n,!0)}},n))})]})]}),Wee=({edge:e})=>w.jsxs("div",{className:"flex flex-col gap-2",children:[w.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600",children:"Relationship"}),w.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[w.jsx(Wr,{name:"Id",value:e.id}),e.type&&w.jsx(Wr,{name:"Type",value:e.type}),w.jsx(Wr,{name:"Source",value:e.sourceNode?e.sourceNode.labels.join(", "):e.source,onClick:()=>{Et.getState().setSelectedNode(e.source,!0)}}),w.jsx(Wr,{name:"Target",value:e.targetNode?e.targetNode.labels.join(", "):e.target,onClick:()=>{Et.getState().setSelectedNode(e.target,!0)}})]}),w.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),w.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>w.jsx(Wr,{name:t,value:e.properties[t]},t))})]}),SN={allowInvalidContainer:!0,defaultNodeType:"default",defaultEdgeType:"curvedArrow",renderEdgeLabels:!1,edgeProgramClasses:{arrow:QU,curvedArrow:uQ,curvedNoArrow:sQ},nodeProgramClasses:{default:qZ,circel:Su,point:vZ},labelGridCellSize:60,labelRenderedSizeThreshold:12,enableEdgeEvents:!0,labelColor:{color:"#000",attribute:"labelColor"},edgeLabelColor:{color:"#000",attribute:"labelColor"},edgeLabelSize:8,labelSize:12},Yee=()=>{const e=i3(),t=br(),[n,r]=k.useState(null);return k.useEffect(()=>{e({downNode:a=>{r(a.node),t.getGraph().setNodeAttribute(a.node,"highlighted",!0)},mousemovebody:a=>{if(!n)return;const i=t.viewportToGraph(a);t.getGraph().setNodeAttribute(n,"x",i.x),t.getGraph().setNodeAttribute(n,"y",i.y),a.preventSigmaDefault(),a.original.preventDefault(),a.original.stopPropagation()},mouseup:()=>{n&&(r(null),t.getGraph().removeNodeAttribute(n,"highlighted"))},mousedown:()=>{t.getCustomBBox()||t.setCustomBBox(t.getBBox())}})},[e,t,n]),null},Kee=()=>{const[e,t]=k.useState(SN),n=Et.use.selectedNode(),r=Et.use.focusedNode(),a=Et.use.moveToSelectedNode(),i=We.use.showPropertyPanel(),l=We.use.showNodeSearchBar(),u=We.use.showNodeLabel(),c=We.use.enableEdgeEvents(),f=We.use.enableNodeDrag(),p=We.use.showEdgeLabel();k.useEffect(()=>{t({...SN,enableEdgeEvents:c,renderEdgeLabels:p,renderLabels:u})},[u,c,p]);const g=k.useCallback(v=>{v===null?Et.getState().setFocusedNode(null):v.type==="nodes"&&Et.getState().setFocusedNode(v.id)},[]),b=k.useCallback(v=>{v===null?Et.getState().setSelectedNode(null):v.type==="nodes"&&Et.getState().setSelectedNode(v.id,!0)},[]),m=k.useMemo(()=>r??n,[r,n]),S=k.useMemo(()=>n?{type:"nodes",id:n}:null,[n]);return w.jsxs(pZ,{settings:e,className:"!bg-background !size-full overflow-hidden",children:[w.jsx(eee,{}),f&&w.jsx(Yee,{}),w.jsx(fQ,{node:m,move:a}),w.jsxs("div",{className:"absolute top-2 left-2 flex items-start gap-2",children:[w.jsx(Gee,{}),l&&w.jsx(Bee,{value:S,onFocus:g,onChange:b})]}),w.jsxs("div",{className:"bg-background/60 absolute bottom-2 left-2 flex flex-col rounded-xl border-2 backdrop-blur-lg",children:[w.jsx(dee,{}),w.jsx(tee,{}),w.jsx(NJ,{}),w.jsx(nee,{})]}),i&&w.jsx("div",{className:"absolute top-2 right-2",children:w.jsx(Hee,{})})]})},r4=k.forwardRef(({className:e,...t},n)=>w.jsx("div",{className:"relative w-full overflow-auto",children:w.jsx("table",{ref:n,className:Me("w-full caption-bottom text-sm",e),...t})}));r4.displayName="Table";const a4=k.forwardRef(({className:e,...t},n)=>w.jsx("thead",{ref:n,className:Me("[&_tr]:border-b",e),...t}));a4.displayName="TableHeader";const o4=k.forwardRef(({className:e,...t},n)=>w.jsx("tbody",{ref:n,className:Me("[&_tr:last-child]:border-0",e),...t}));o4.displayName="TableBody";const Xee=k.forwardRef(({className:e,...t},n)=>w.jsx("tfoot",{ref:n,className:Me("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));Xee.displayName="TableFooter";const Qx=k.forwardRef(({className:e,...t},n)=>w.jsx("tr",{ref:n,className:Me("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));Qx.displayName="TableRow";const Ta=k.forwardRef(({className:e,...t},n)=>w.jsx("th",{ref:n,className:Me("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));Ta.displayName="TableHead";const _a=k.forwardRef(({className:e,...t},n)=>w.jsx("td",{ref:n,className:Me("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));_a.displayName="TableCell";const Zee=k.forwardRef(({className:e,...t},n)=>w.jsx("caption",{ref:n,className:Me("text-muted-foreground mt-4 text-sm",e),...t}));Zee.displayName="TableCaption";const ou=k.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:Me("bg-card text-card-foreground rounded-xl border shadow",e),...t}));ou.displayName="Card";const Hd=k.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:Me("flex flex-col space-y-1.5 p-6",e),...t}));Hd.displayName="CardHeader";const iu=k.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:Me("leading-none font-semibold tracking-tight",e),...t}));iu.displayName="CardTitle";const If=k.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));If.displayName="CardDescription";const $d=k.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:Me("p-6 pt-0",e),...t}));$d.displayName="CardContent";const Qee=k.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:Me("flex items-center p-6 pt-0",e),...t}));Qee.displayName="CardFooter";function Jee({title:e,description:t,icon:n=Lq,action:r,className:a,...i}){return w.jsxs(ou,{className:Me("flex w-full flex-col items-center justify-center space-y-6 bg-transparent p-16",a),...i,children:[w.jsx("div",{className:"mr-4 shrink-0 rounded-full border border-dashed p-4",children:w.jsx(n,{className:"text-muted-foreground size-8","aria-hidden":"true"})}),w.jsxs("div",{className:"flex flex-col items-center gap-1.5 text-center",children:[w.jsx(iu,{children:e}),t?w.jsx(If,{children:t}):null]}),r||null]})}var gm={exports:{}},hm,EN;function ete(){if(EN)return hm;EN=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return hm=e,hm}var mm,wN;function tte(){if(wN)return mm;wN=1;var e=ete();function t(){}function n(){}return n.resetWarningCache=t,mm=function(){function r(l,u,c,f,p,g){if(g!==e){var b=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw b.name="Invariant Violation",b}}r.isRequired=r;function a(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},mm}var xN;function nte(){return xN||(xN=1,gm.exports=tte()()),gm.exports}var rte=nte();const Ct=an(rte),ate=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function El(e,t,n){const r=ote(e),{webkitRelativePath:a}=e,i=typeof t=="string"?t:typeof a=="string"&&a.length>0?a:`./${e.name}`;return typeof r.path!="string"&&kN(r,"path",i),kN(r,"relativePath",i),r}function ote(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),a=ate.get(r);a&&Object.defineProperty(e,"type",{value:a,writable:!1,configurable:!1,enumerable:!0})}return e}function kN(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const ite=[".DS_Store","Thumbs.db"];function lte(e){return ci(this,void 0,void 0,function*(){return qd(e)&&ste(e.dataTransfer)?fte(e.dataTransfer,e.type):ute(e)?cte(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?dte(e):[]})}function ste(e){return qd(e)}function ute(e){return qd(e)&&qd(e.target)}function qd(e){return typeof e=="object"&&e!==null}function cte(e){return Jx(e.target.files).map(t=>El(t))}function dte(e){return ci(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>El(n))})}function fte(e,t){return ci(this,void 0,void 0,function*(){if(e.items){const n=Jx(e.items).filter(a=>a.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(pte));return AN(i4(r))}return AN(Jx(e.files).map(n=>El(n)))})}function AN(e){return e.filter(t=>ite.indexOf(t.name)===-1)}function Jx(e){if(e===null)return[];const t=[];for(let n=0;n[...t,...Array.isArray(n)?i4(n):[n]],[])}function TN(e,t){return ci(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const i=yield e.getAsFileSystemHandle();if(i===null)throw new Error(`${e} is not a File`);if(i!==void 0){const l=yield i.getFile();return l.handle=i,El(l)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return El(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function gte(e){return ci(this,void 0,void 0,function*(){return e.isDirectory?l4(e):hte(e)})}function l4(e){const t=e.createReader();return new Promise((n,r)=>{const a=[];function i(){t.readEntries(l=>ci(this,void 0,void 0,function*(){if(l.length){const u=Promise.all(l.map(gte));a.push(u),i()}else try{const u=yield Promise.all(a);n(u)}catch(u){r(u)}}),l=>{r(l)})}i()})}function hte(e){return ci(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const a=El(r,e.fullPath);t(a)},r=>{n(r)})})})}var ad={},_N;function mte(){return _N||(_N=1,ad.__esModule=!0,ad.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",a=(e.type||"").toLowerCase(),i=a.replace(/\/.*$/,"");return n.some(function(l){var u=l.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?i===u.replace(/\/.*$/,""):a===u})}return!0}),ad}var bte=mte();const bm=an(bte);function RN(e){return Ste(e)||vte(e)||u4(e)||yte()}function yte(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vte(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ste(e){if(Array.isArray(e))return ek(e)}function CN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function NN(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:Ate,message:"File type must be ".concat(r)}},ON=function(t){return{code:Tte,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},DN=function(t){return{code:_te,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},Nte={code:Rte,message:"Too many files"};function c4(e,t){var n=e.type==="application/x-moz-file"||kte(e,t);return[n,n?null:Cte(t)]}function d4(e,t,n){if(Jo(e.size))if(Jo(t)&&Jo(n)){if(e.size>n)return[!1,ON(n)];if(e.sizen)return[!1,ON(n)]}return[!0,null]}function Jo(e){return e!=null}function Ote(e){var t=e.files,n=e.accept,r=e.minSize,a=e.maxSize,i=e.multiple,l=e.maxFiles,u=e.validator;return!i&&t.length>1||i&&l>=1&&t.length>l?!1:t.every(function(c){var f=c4(c,n),p=lu(f,1),g=p[0],b=d4(c,r,a),m=lu(b,1),S=m[0],v=u?u(c):null;return g&&S&&!v})}function Vd(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function od(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function IN(e){e.preventDefault()}function Dte(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Ite(e){return e.indexOf("Edge/")!==-1}function Lte(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Dte(e)||Ite(e)}function $r(){for(var e=arguments.length,t=new Array(e),n=0;n1?a-1:0),l=1;l