diff --git a/changai/changai/api/v2/assets/changai_alias_map.json b/changai/changai/api/v2/assets/changai_alias_map.json index 670016b..61b40c7 100644 --- a/changai/changai/api/v2/assets/changai_alias_map.json +++ b/changai/changai/api/v2/assets/changai_alias_map.json @@ -12,6 +12,8 @@ "heyyyy": "hey", "hai": "hi", "hi": "hi", + "ur": "your", + "u": "you", "hiii": "hi", "hiiii": "hi", "yo": "hey", @@ -1316,6 +1318,9 @@ "sounds great": "i agree", "sounds right": "i agree", "looks good": "i agree", + "feine": "fine", + "fiene": "fine", + "fein": "fine", "looks right": "i agree", "that works": "i agree", "that works for me": "i agree", diff --git a/changai/changai/api/v2/assets/non_erp_combined.processed.cache.pkl b/changai/changai/api/v2/assets/non_erp_combined.processed.cache.pkl index e3aac62..25d4599 100644 Binary files a/changai/changai/api/v2/assets/non_erp_combined.processed.cache.pkl and b/changai/changai/api/v2/assets/non_erp_combined.processed.cache.pkl differ diff --git a/changai/changai/api/v2/assets/non_erp_combined.processed.json b/changai/changai/api/v2/assets/non_erp_combined.processed.json index 205fd06..67b7e84 100644 --- a/changai/changai/api/v2/assets/non_erp_combined.processed.json +++ b/changai/changai/api/v2/assets/non_erp_combined.processed.json @@ -27,13 +27,20 @@ "priority": 105, "is_active": true }, - { + { "category": "greeting", - "user_input": "how is ur day", + "user_input": "how is your day", "response": "Pretty good, thanks for asking! ChangAI here and ready to help. How's your day going?", "priority": 105, "is_active": true }, + { + "category": "greeting", + "user_input": "no fine", + "response": "Okay! If you need any assistance or have questions, feel free to ask. I'm here to help!", + "priority": 105, + "is_active": true + }, { "category": "greeting", "user_input": "hello erpgulf", @@ -136857,208 +136864,208 @@ "is_active": true }, { - "category": "positive", - "user_input": "sounds good", - "response": "Great! Let me know if you need anything else.", - "priority": 100, - "is_active": true -}, -{ - "category": "positive", - "user_input": "looks good", - "response": "Glad to hear that. Let me know if you need more help.", - "priority": 100, - "is_active": true -}, -{ - "category": "positive", - "user_input": "perfect", - "response": "Awesome! Happy to help.", - "priority": 100, - "is_active": true -}, -{ - "category": "negative", - "user_input": "no", - "response": "Okay. Let me know if you need anything else.", - "priority": 100, - "is_active": true -}, -{ - "category": "negative", - "user_input": "nope", - "response": "Understood.", - "priority": 100, - "is_active": true -}, -{ - "category": "negative", - "user_input": "nah", - "response": "Alright.", - "priority": 100, - "is_active": true -}, -{ - "category": "negative", - "user_input": "never", - "response": "Got it.", - "priority": 100, - "is_active": true -}, -{ - "category": "negative", - "user_input": "not really", - "response": "Okay, understood.", - "priority": 100, - "is_active": true -}, -{ - "category": "negative", - "user_input": "no thanks", - "response": "No problem.", - "priority": 100, - "is_active": true -}, -{ - "category": "negative", - "user_input": "no thank you", - "response": "Alright.", - "priority": 100, - "is_active": true -}, -{ - "category": "negative", - "user_input": "negative", - "response": "Understood.", - "priority": 100, - "is_active": true -}, -{ - "category": "system", - "user_input": "cancel", - "response": "Cancelled.", - "priority": 100, - "is_active": true -}, -{ - "category": "system", - "user_input": "stop", - "response": "Stopped.", - "priority": 100, - "is_active": true -}, -{ - "category": "system", - "user_input": "ignore", - "response": "Okay, ignoring it.", - "priority": 100, - "is_active": true -}, -{ - "category": "system", - "user_input": "forget it", - "response": "Alright, leaving it.", - "priority": 100, - "is_active": true -}, -{ - "category": "system", - "user_input": "never mind", - "response": "Okay.", - "priority": 100, - "is_active": true -}, -{ - "category": "system", - "user_input": "nevermind", - "response": "Okay.", - "priority": 100, - "is_active": true -}, -{ - "category": "system", - "user_input": "leave it", - "response": "Alright.", - "priority": 100, - "is_active": true -}, -{ - "category": "system", - "user_input": "skip", - "response": "Skipped.", - "priority": 100, - "is_active": true -}, -{ - "category": "system", - "user_input": "drop it", - "response": "Okay, dropping it.", - "priority": 100, - "is_active": true -}, -{ - "category": "system", - "user_input": "not now", - "response": "Okay, maybe later.", - "priority": 100, - "is_active": true -}, -{ - "category": "system", - "user_input": "later", - "response": "Sure, we can do it later.", - "priority": 100, - "is_active": true -}, -{ - "category": "system", - "user_input": "wrong", - "response": "Sorry about that. Let me correct it.", - "priority": 120, - "is_active": true -}, -{ - "category": "system", - "user_input": "incorrect", - "response": "Apologies. Let me fix it.", - "priority": 120, - "is_active": true -}, -{ - "category": "system", - "user_input": "that's wrong", - "response": "Sorry. Let me correct it.", - "priority": 120, - "is_active": true -}, -{ - "category": "system", - "user_input": "not what i asked", - "response": "Sorry. Let me understand your request better.", - "priority": 120, - "is_active": true -}, -{ - "category": "system", - "user_input": "not what i want", - "response": "Understood. Let me adjust it.", - "priority": 120, - "is_active": true -}, -{ - "category": "system", - "user_input": "that's not right", - "response": "Sorry about that. Let me fix it.", - "priority": 120, - "is_active": true -}, -{ - "category": "system", - "user_input": "no that's wrong", - "response": "Apologies. Let me correct it.", - "priority": 120, - "is_active": true -}, + "category": "positive", + "user_input": "sounds good", + "response": "Great! Let me know if you need anything else.", + "priority": 100, + "is_active": true + }, + { + "category": "positive", + "user_input": "looks good", + "response": "Glad to hear that. Let me know if you need more help.", + "priority": 100, + "is_active": true + }, + { + "category": "positive", + "user_input": "perfect", + "response": "Awesome! Happy to help.", + "priority": 100, + "is_active": true + }, + { + "category": "negative", + "user_input": "no", + "response": "Okay. Let me know if you need anything else.", + "priority": 100, + "is_active": true + }, + { + "category": "negative", + "user_input": "nope", + "response": "Understood.", + "priority": 100, + "is_active": true + }, + { + "category": "negative", + "user_input": "nah", + "response": "Alright.", + "priority": 100, + "is_active": true + }, + { + "category": "negative", + "user_input": "never", + "response": "Got it.", + "priority": 100, + "is_active": true + }, + { + "category": "negative", + "user_input": "not really", + "response": "Okay, understood.", + "priority": 100, + "is_active": true + }, + { + "category": "negative", + "user_input": "no thanks", + "response": "No problem.", + "priority": 100, + "is_active": true + }, + { + "category": "negative", + "user_input": "no thank you", + "response": "Alright.", + "priority": 100, + "is_active": true + }, + { + "category": "negative", + "user_input": "negative", + "response": "Understood.", + "priority": 100, + "is_active": true + }, + { + "category": "system", + "user_input": "cancel", + "response": "Cancelled.", + "priority": 100, + "is_active": true + }, + { + "category": "system", + "user_input": "stop", + "response": "Stopped.", + "priority": 100, + "is_active": true + }, + { + "category": "system", + "user_input": "ignore", + "response": "Okay, ignoring it.", + "priority": 100, + "is_active": true + }, + { + "category": "system", + "user_input": "forget it", + "response": "Alright, leaving it.", + "priority": 100, + "is_active": true + }, + { + "category": "system", + "user_input": "never mind", + "response": "Okay.", + "priority": 100, + "is_active": true + }, + { + "category": "system", + "user_input": "nevermind", + "response": "Okay.", + "priority": 100, + "is_active": true + }, + { + "category": "system", + "user_input": "leave it", + "response": "Alright.", + "priority": 100, + "is_active": true + }, + { + "category": "system", + "user_input": "skip", + "response": "Skipped.", + "priority": 100, + "is_active": true + }, + { + "category": "system", + "user_input": "drop it", + "response": "Okay, dropping it.", + "priority": 100, + "is_active": true + }, + { + "category": "system", + "user_input": "not now", + "response": "Okay, maybe later.", + "priority": 100, + "is_active": true + }, + { + "category": "system", + "user_input": "later", + "response": "Sure, we can do it later.", + "priority": 100, + "is_active": true + }, + { + "category": "system", + "user_input": "wrong", + "response": "Sorry about that. Let me correct it.", + "priority": 120, + "is_active": true + }, + { + "category": "system", + "user_input": "incorrect", + "response": "Apologies. Let me fix it.", + "priority": 120, + "is_active": true + }, + { + "category": "system", + "user_input": "that's wrong", + "response": "Sorry. Let me correct it.", + "priority": 120, + "is_active": true + }, + { + "category": "system", + "user_input": "not what i asked", + "response": "Sorry. Let me understand your request better.", + "priority": 120, + "is_active": true + }, + { + "category": "system", + "user_input": "not what i want", + "response": "Understood. Let me adjust it.", + "priority": 120, + "is_active": true + }, + { + "category": "system", + "user_input": "that's not right", + "response": "Sorry about that. Let me fix it.", + "priority": 120, + "is_active": true + }, + { + "category": "system", + "user_input": "no that's wrong", + "response": "Apologies. Let me correct it.", + "priority": 120, + "is_active": true + }, { "category": "system", "user_input": "كل شيء توقف", diff --git a/changai/changai/api/v2/auto_gen_api.py b/changai/changai/api/v2/auto_gen_api.py index 9391743..ab51097 100644 --- a/changai/changai/api/v2/auto_gen_api.py +++ b/changai/changai/api/v2/auto_gen_api.py @@ -197,10 +197,10 @@ def _extract_existing_keys(data: List[Any]) -> Set[tuple]: return keys -def _build_master_data_row(entity_type: str, entity_id: str,title_field:str) -> Dict[str, Any]: +def _build_master_data_row(entity_type: str, entity_id:str,title_field:str) -> Dict[str, Any]: return { "entity_type": entity_type, - "entity_id": entity_id, + "entity_id": title_field, "filters": {"field": title_field if title_field else "name", "value": entity_id}, } diff --git a/changai/changai/api/v2/build_cards_faiss_index_v2.py b/changai/changai/api/v2/build_cards_faiss_index_v2.py index 9e1cad2..f761773 100644 --- a/changai/changai/api/v2/build_cards_faiss_index_v2.py +++ b/changai/changai/api/v2/build_cards_faiss_index_v2.py @@ -18,6 +18,7 @@ def get_app_fvs_base(): "changai", "api", "v2", "fvs_stores", "erpnext" ) + def get_private_fvs_base(): return frappe.get_site_path("private", "changai", "fvs_stores", "erpnext") @@ -271,10 +272,10 @@ def _build_entity_metadata(md: Dict[str, Any]) -> Dict[str, Any]: return { "type": "entity", "entity_type": md.get("entity_type"), - "entity_id": md.get("entity_id"), - "canonical_name": md.get("canonical_name"), - "aliases": md.get("aliases", []), - "description": md.get("description", ""), + "entity_id": md.get('entity_id'), + "entity_label": f"{md.get('filters', {}).get('field')}:{md.get('filters', {}).get('value')}" + # "canonical_name": md.get("canonical_name"), + # "aliases": md.get("aliases", []), } diff --git a/changai/changai/api/v2/fvs_stores/erpnext/masterdata_fvs/index.faiss b/changai/changai/api/v2/fvs_stores/erpnext/masterdata_fvs/index.faiss deleted file mode 100644 index 52aafef..0000000 Binary files a/changai/changai/api/v2/fvs_stores/erpnext/masterdata_fvs/index.faiss and /dev/null differ diff --git a/changai/changai/api/v2/fvs_stores/erpnext/masterdata_fvs/index.pkl b/changai/changai/api/v2/fvs_stores/erpnext/masterdata_fvs/index.pkl deleted file mode 100644 index a6cc36a..0000000 Binary files a/changai/changai/api/v2/fvs_stores/erpnext/masterdata_fvs/index.pkl and /dev/null differ diff --git a/changai/changai/api/v2/schema_utils.py b/changai/changai/api/v2/schema_utils.py index 8ee4269..fd5664c 100644 --- a/changai/changai/api/v2/schema_utils.py +++ b/changai/changai/api/v2/schema_utils.py @@ -12,6 +12,18 @@ from frappe import _ from pathlib import Path + +def word_match(entity_word,values): + from changai.changai.api.v2.auto_gen_api import _read_filedoctype + from changai.changai.api.v2.text2sql_pipeline_v2 import is_erp_query + master_data_content = _read_filedoctype("master_data.yaml") + master_items = master_data_content["data"] + values = [item["filters"]["value"] for item in master_items] + response = is_erp_query(True, entity_word, values, 70) + return response + + + def _safe_join(base: Path, rel: str) -> Path: """ Prevent path traversal. Only allow reading inside base directory. diff --git a/changai/changai/api/v2/store_chats.py b/changai/changai/api/v2/store_chats.py index 35dde5b..dc578e0 100644 --- a/changai/changai/api/v2/store_chats.py +++ b/changai/changai/api/v2/store_chats.py @@ -19,7 +19,6 @@ def save_message_doc(session_id:str,message_type:str,content:str): def save_turn_2(session_id: str, user_text: str=None, bot_text: Any = None,type_:str=None): # find existing document doc_name = frappe.db.exists(CHANGAI_CHAT_HIST_DOC, {"session_id": session_id}) - history = [] if doc_name: raw = frappe.db.get_value(CHANGAI_CHAT_HIST_DOC, doc_name, "content") diff --git a/changai/changai/api/v2/text2sql_pipeline_v2.py b/changai/changai/api/v2/text2sql_pipeline_v2.py index 8a79fbc..062e18a 100644 --- a/changai/changai/api/v2/text2sql_pipeline_v2.py +++ b/changai/changai/api/v2/text2sql_pipeline_v2.py @@ -206,7 +206,8 @@ def enrich_fields_for_sql_context(table: str, fields: list[str]) -> list[str]: out.insert(0, f) return out -@frappe.whitelist(allow_guest=False) + + def format_schema_context(grouped: dict[str, list[str]]) -> str: parts = [] @@ -249,9 +250,7 @@ def publish_pipeline_update(request_id, stage, message, data=None, done=False, e message=payload, user=frappe.session.user, ) -# @frappe.whitelist(allow_guest=False) -# def test(): -# return publish_pipeline_update("session_1775182859529_ecd7cd87-cec1-42f4-be0d-c969b48a5117_1775182993037", "test_stage", "Test realtime working") + def _safe_join(base: Path, rel: str) -> Path: """ @@ -382,15 +381,16 @@ def download_model_from_ui(): "trainer_*", "optimizer*" ] - ) - _EMBEDDER_INSTANCE = None return {"status": "success", "message": "Embedding model downloaded successfully."} except Exception as e: frappe.log_error(frappe.get_traceback(), "Embedding Model Download Failed") - frappe.throw(_("Model download failed: {0}\n Check Quick Start Guide Here 👇:\n{1}").format(str(e),CHANGAI_GUIDE_LINK)) + frappe.throw(_("Model download failed: {0}\n Check Quick Start Guide Here 👇:\n{1}
" + "Download Embedding Model.
" + "ERPGulf.com." +).format(str(e),CHANGAI_GUIDE_LINK,settingsUrl,ERPGULF_LINK)) _FIELD_DOCS_CACHE = None @@ -434,19 +434,8 @@ def load_field_matrix(): def _get_cached_embedding_test(q: str) -> tuple: t0=time.time() - # publish_pipeline_update( - # request_id, - # "embedding_start", - # "embedding started" - # ) emb = get_embedding_engine() emb_load_time = time.time() - t0 - - # publish_pipeline_update( - # request_id, - # "embedding_end", - # "get_embedding_engine ended" - # ) t1 = time.time() vec = emb.embed_query(q) embed_query_time = time.time() - t1 @@ -464,10 +453,13 @@ def get_embedding_engine(): _EMBEDDER_INSTANCE = None # reset if model missing frappe.throw( _( - "Go to ChangAI Settings and click 'Download Embedding Model'.

" + "Go to ChangAI Settings and click" + "Download Embedding Model.

" "Check this Quick Start Guide for more detail: " "Click here" - ).format(CHANGAI_GUIDE_LINK), + "ERPGulf.com." + + ).format(CHANGAI_GUIDE_LINK,settingsUrl,ERPGULF_LINK), title=_("Embedding Model Required") ) @@ -781,20 +773,24 @@ def _get_gemini_vertex_config(config): def _throw_missing_vertex_field(project_id: str, location: str, credentials_json: str) -> None: if not project_id: frappe.throw( - _("Gemini Project ID is missing.

Please go to ChangAI Settings and enter your Gemini Project ID.
" - "Check Quick Start Guide 👇:
Click here").format(CHANGAI_GUIDE_LINK), + _("Gemini Project ID is missing.

Please Go to Settings Page and enter your Gemini Project ID.
" + "Check Quick Start Guide 👇:
Click here
" + "ERPGulf.com.").format(CHANGAI_GUIDE_LINK,settingsUrl,ERPGULF_LINK), title=_("Missing Gemini Project ID"), ) if not location: frappe.throw( - _("Gemini Location is missing.

Please go to ChangAI Settings and enter your Gemini Location.
" - "Check Quick Start Guide 👇:
Click here").format(CHANGAI_GUIDE_LINK), + _("Gemini Location is missing.

Please Go to Settings Page and enter your Gemini Location.
" + "Check Quick Start Guide 👇:
Click here
" + "ERPGulf.com.").format(CHANGAI_GUIDE_LINK,settingsUrl,ERPGULF_LINK), title=_("Missing Gemini Location"), ) if not credentials_json: frappe.throw( - _("Service Account Credentials are missing.

Please go to ChangAI Settings and enter your Service Account Credential.
" - "Check Quick Start Guide 👇:
Click here").format(CHANGAI_GUIDE_LINK), + _("Service Account Credentials are missing.

Please Go to Settings Page and enter your Service Account Credential.
" + "Check Quick Start Guide 👇:
Click here" + "ERPGulf.com." +).format(CHANGAI_GUIDE_LINK,settingsUrl,ERPGULF_LINK), title=_("Missing Service Account Credentials"), ) @@ -832,9 +828,12 @@ def _get_api_key_client(config): "Google AI Studio.

" "Option 2 (Vertex AI / Service Account):
" "Fill in Gemini Project ID, Gemini Location, " - "and Service Account Credentials in ChangAI Settings.
" - "ChangAI Quick Start Guide 👇:
Click here" - ).format(CHANGAI_GUIDE_LINK), + "and Service Account Credentials in Got to Settings Page.
" + "ChangAI Quick Start Guide 👇:
" + "Click here
" + "ERPGulf.com." + + ).format(CHANGAI_GUIDE_LINK,settingsUrl,ERPGULF_LINK), title=_("Gemini Authentication Not Configured"), ) @@ -870,37 +869,47 @@ def _handle_gemini_api_exception(e: Exception) -> None: if isinstance(e, google_exceptions.ResourceExhausted): frappe.throw( _("Gemini API quota exceeded.

Please wait and try again or upgrade your plan.
Check Quick Start Guide 👇:
" - "Click here").format(CHANGAI_GUIDE_LINK), + "Click here
" + "ERPGulf.com." +).format(CHANGAI_GUIDE_LINK,ERPGULF_LINK), + title=_("Gemini Quota Exceeded"), ) if isinstance(e, google_exceptions.Unauthenticated): frappe.throw( _("Gemini API key is invalid.

Please go to ChangAI Settings and enter a valid Gemini API Key.
" - "Check ChangAI Quick Start Guide 👇:
Click here").format(CHANGAI_GUIDE_LINK), + "Check ChangAI Quick Start Guide 👇:
Click here
" + "ERPGulf.com." +).format(CHANGAI_GUIDE_LINK,ERPGULF_LINK), title=_("Invalid Gemini API Key"), ) if isinstance(e, google_exceptions.PermissionDenied): frappe.throw( _("Gemini API permission denied.

Please check your API key permissions.
" - "Check ChangAI Quick Start Guide 👇:
Click here").format(CHANGAI_GUIDE_LINK), + "Check ChangAI Quick Start Guide 👇:
Click here
" + "ERPGulf.com." +).format(CHANGAI_GUIDE_LINK,ERPGULF_LINK), title=_("Gemini Permission Denied"), ) if isinstance(e, google_exceptions.InvalidArgument): frappe.throw( _("Invalid request to Gemini API: {0}
" - "Check ChangAI Quick Start Guide 👇:
" - "Click here").format(str(e),CHANGAI_GUIDE_LINK), + "Check ChangAI Quick Start Guide 👇:
" + "Click here
" + "ERPGulf.com.").format(str(e),CHANGAI_GUIDE_LINK,ERPGULF_LINK), title=_("Gemini Invalid Request"), ) frappe.log_error(frappe.get_traceback(), "Gemini API Unexpected Error") frappe.throw( _("Gemini API error: {0}
" - "Check ChangAI Quick Start Guide 👇:
" - "Click here").format(str(e),CHANGAI_GUIDE_LINK), + "Check ChangAI Quick Start Guide 👇:
" + "Click here
" + "ERPGulf.com.").format(str(e),CHANGAI_GUIDE_LINK,ERPGULF_LINK), title=_("Gemini API Error"), ) + def gemini_client(): global _GEMINI_CLIENT,_GEMINI_CONFIG if _GEMINI_CLIENT is None: @@ -1010,6 +1019,9 @@ def _safe_strip(v): # Shared State class SQLState(TypedDict, total=False): + entity_type_list:List[str] + entity_type:str + final_prompt:str request_id: str sendNonErptoAI:bool session_id: str @@ -1109,7 +1121,19 @@ def tokenize_mixed(text): return re.findall(r'[\u0600-\u06FF]+|[a-zA-Z0-9]+', text.lower()) -def is_erp_query(q: str, words_list: list,cut_off_perc:int) -> bool: +def is_erp_query(master_match:bool, q: str, words_list: list,cut_off_perc:int) -> bool: + if master_match: + match = process.extract( + q.strip().lower(), + [v.strip().lower() for v in words_list], + scorer=fuzz.WRatio, + limit=5 ) + # matched_value = match[ + return { + "matched_value": match, + } + + words = tokenize_mixed(q) for word in words: @@ -1133,39 +1157,12 @@ def is_erp_query(q: str, words_list: list,cut_off_perc:int) -> bool: return False -@frappe.whitelist(allow_guest=False) -def test_is_erp_query(q: str,cut_off_perc:int=85) -> bool: - words = tokenize_mixed(q) - - for word in words: - - # if len(word) <= 2: - # continue - - # if word in STOP_WORDS: - # continue - - match = process.extractOne( - word, - THREAD_WORDS, - scorer=fuzz.ratio, - score_cutoff=cut_off_perc - ) - - if match: - matched_word = match[0] # the matched keyword - match_score = match[1] # the score - return True, matched_word, match_score - - return False - - def guardrail_router(state: SQLState) -> SQLState: request_id = state.get("request_id") chat_id = state.get("session_id") raw_q = state.get("question") or "" try: - is_erp= is_erp_query(raw_q,BUSINESS_KEYWORDS,80) + is_erp= is_erp_query(False,raw_q,BUSINESS_KEYWORDS,80) if is_erp: query_type = "ERP" elif is_thread_erp(raw_q, chat_id): @@ -1187,42 +1184,6 @@ def guardrail_router(state: SQLState) -> SQLState: return state -@frappe.whitelist(allow_guest=False) -def test_guardrail_router(question: str, chat_id: str = None, request_id: str = None) -> Dict: - """Test API for guardrail_router — mirrors its logic without pipeline state""" - - if not chat_id: - chat_id = frappe.generate_hash(length=10) - - if not request_id: - request_id = frappe.generate_hash(length=10) - - raw_q = str(question).strip() - - try: - is_erp = is_erp_query(raw_q, BUSINESS_KEYWORDS, 80) - if is_erp: - query_type = "ERP" - # elif is_thread_erp(raw_q, chat_id): - # query_type = "ERP" - else: - query_type = "NON_ERP" - except Exception as e: - frappe.log_error(frappe.get_traceback(), "Test Guardrail Router Error") - return { - "question": raw_q, - "query_type": "NON_ERP", - "error": str(e) - } - - return { - "question": raw_q, - "chat_id": chat_id, - "query_type": query_type, - "is_erp": is_erp, - } - - def send_non_erp_request(state: SQLState) -> SQLState: qstn =state.get("question") if not qstn: @@ -1290,6 +1251,9 @@ def rewrite_question(state: SQLState) -> SQLState: "formatting_prompt": prompt, "error": None, } + + except frappe.exceptions.ValidationError: + raise except Exception as e: publish_pipeline_update( @@ -1301,11 +1265,7 @@ def rewrite_question(state: SQLState) -> SQLState: ) return {**state, "error": str(e)} -# @frappe.whitelist(allow_guest=True) -# def testing(): -# res=get_table_vs() -# if res: -# return True + def get_table_vs(): global _VS_TABLE @@ -1484,6 +1444,7 @@ def build_hnsw_index(embeddings): return index + def call_retrieve_multi_line(user_question: str, request_id: str) -> Dict[str, Any]: try: top_tables = call_fvs_table_search(user_question, request_id) @@ -1643,6 +1604,7 @@ def generate_sql(state:SQLState) -> SQLState: if config["retriever_structure"]=="multi line": context = fields + (entity_block or "") prompt = fill_sql_prompt(formatted_q, context) + state["final_prompt"] = prompt else: prompt=fill_sql_prompt(formatted_q,state["context"]) try: @@ -1686,7 +1648,6 @@ def validate_sql(state: SQLState) -> SQLState: return {**state, "validation": val} -@frappe.whitelist(allow_guest=False) def remote_entity_embedder(q: str) -> Union[list, str]: config = ChangAIConfig.get() payload = {"version": config["entity_retriever"], "input": {"query": q}} @@ -1719,7 +1680,7 @@ def get_master_vs(): frappe.throw(_( "FAISS MASTER store not found at {0}.

" "Please open " - "ChangAI Settings" + "Go to Settings Page" "and click on the Update Master Data button in the Training tab.

" "Check Quick Start Guide Here 👇
" "Click here


" @@ -1742,22 +1703,53 @@ def get_master_vs(): return _VS_MASTER -def local_entity_embedder(q: str) -> List[Dict[str, Any]]: - hits = get_master_vs().similarity_search(q, k=15) +import re + +def append_entity_field_to_schema(top_fields: str, table_name: str, field_name: str) -> str: + """ + Append field_name to the FIELDS section of table_name if missing. + Example: append customer_name into TABLE: tabCustomer block. + """ + + pattern = rf"(TABLE:\s*{re.escape(table_name)}\n.*?FIELDS:\n)(.*?)(?=\n\nTABLE:|\Z)" + + def replace_block(match): + header = match.group(1) + fields_block = match.group(2) + + # already exists + if re.search(rf"^- {re.escape(field_name)}(\s|$)", fields_block, re.MULTILINE): + return match.group(0) + + return header + fields_block.rstrip() + f"\n- {field_name}\n" + + return re.sub(pattern, replace_block, top_fields, count=1, flags=re.DOTALL) + + +def local_entity_embedder(q: str,state: SQLState = None) -> List[Dict[str, Any]]: + hits = get_master_vs().similarity_search(q, k=20) out, seen = [], set() for h in hits: - entity_type = h.metadata.get("entity_type") - entity_id = h.metadata.get("entity_id") - key = (entity_type, entity_id) - if entity_type and key not in seen: + entity_type = h.metadata.get("entity_type") # example: tabCustomer + entity_id = h.metadata.get("entity_id") # example: customer_name + entity_label = h.metadata.get("entity_label") + # if entity_type in state["selected_tables"]: + # state["selected_fields"] = append_entity_field_to_schema( + # top_fields=state["selected_fields"], + # table_name=entity_type, + # field_name=entity_id + # ) + + key = (entity_type, entity_label) + if key not in seen: seen.add(key) - out.append({"entity_type": entity_type, "entity_id": entity_id}) + out.append({"entity_type": entity_type, "entity_id": entity_id, "entity_label": entity_label}) return out -def call_entity_retriever(qstn: str) -> Dict[str, Any]: + +def call_entity_retriever(qstn: str,state: SQLState) -> Dict[str, Any]: config = ChangAIConfig.get() if config["REMOTE"] and config["llm"] == "QWEN3": - response = remote_entity_embedder(qstn) if not response.get("ok"): @@ -1772,8 +1764,12 @@ def call_entity_retriever(qstn: str) -> Dict[str, Any]: return {"raw": body, "cards": cards} else: - results = local_entity_embedder(qstn) - cards = [f"{r['entity_type']}:{r['entity_id']}" for r in results if r.get("entity_type")] + results = local_entity_embedder(qstn,state) + cards = [ + r.get("entity_label") + for r in results + if r.get("entity_label") + ] return {"raw": results, "cards": cards} @@ -1831,11 +1827,11 @@ def detect_specific_entities(state: SQLState) -> SQLState: frappe.throw(_( "Master Data does not exist. Because of this, results may not be accurate. " "For better accuracy, please open " - "ChangAI Settings " + "Go to Settings Page " "and click on the Update Master Data button in the Training tab.

" "Check Quick Start Guide Here 👇:
" "Click here
" - "ERPGulf.com" + "ERPGulf.com" ).format(settingsUrl, CHANGAI_GUIDE_LINK, ERPGULF_LINK)) if not res.get("update_status") and res.get("days", 0) > 0: @@ -1843,14 +1839,14 @@ def detect_specific_entities(state: SQLState) -> SQLState: "Your master data is {0} days old. " "Because of this, results may not be accurate. " "For better accuracy, please open " - "ChangAI Settings " + "Go to Settings Page " "and click on the Update Master Data button in the Training tab.

" "Check Quick Start Guide Here 👇:
" "Click here
" "ERPGulf.com" ).format(res.get("days"), settingsUrl, CHANGAI_GUIDE_LINK, ERPGULF_LINK)) - out = call_entity_retriever(q) + out = call_entity_retriever(q,state) return { **state, "entity_cards": out.get("cards") or [], @@ -2056,6 +2052,10 @@ def routeNonErpToAI(state: SQLState): try: res = call_gemini(question,sys_prompt) return {**state, "non_erp_res": res} + # except ValidationError as ve: + # return {**state,"error":str(ve)} + except frappe.exceptions.ValidationError: + raise except Exception as e: return {**state, "non_erp_res": "Model Calling Failed .Please try Again","error":str(e)} @@ -2196,7 +2196,6 @@ def to_json_if_needed(v: Any) -> Any: return doc.name -@frappe.whitelist(allow_guest=False) def format_data_conversationally(user_data: Any) -> str: return render_template( CONVERSATION_TEMPLATE, # nosemgrep: frappe-semgrep-rules.rules.security.frappe-ssti @@ -2205,7 +2204,6 @@ def format_data_conversationally(user_data: Any) -> str: ) -@frappe.whitelist(allow_guest=False) def format_data(qstn: str, sql_data: Any) -> Dict[str, str]: if isinstance(sql_data, (dict, list)): db_result_json = json.dumps(sql_data, ensure_ascii=False, default=str) @@ -2574,13 +2572,12 @@ def hits_to_schema_context( return "\n".join(lines) -@frappe.whitelist(allow_guest=False) -def debug_entity_retriever(q: str): +def debug_entity_retriever(q: str,state: SQLState): resp = remote_entity_embedder(q) # this returns {"ok":..., "body":...} return { "query": q, "raw_response": resp, - "parsed_entity_cards": call_entity_retriever(q), + "parsed_entity_cards": call_entity_retriever(q,state) } @@ -2633,14 +2630,14 @@ def _handle_non_erp(final: SQLState, user_question: str, chat_id: str) -> Dict: def _get_sql_error_message(err: Any, val: Dict) -> str: - if err: - frappe.log_error(err, "ChangAI SQL Pipeline Error") - return "⚠️ The model encountered an error generating your query. Please try the same Question again." + # if err: + # frappe.log_error(err, "ChangAI SQL Pipeline Error") + # return "⚠️ The model encountered an error generating your query. Please try the same Question again." error_text = (val.get("error") or "").strip() if not error_text: - return "⚠️ Could not process your request. Please try rephrasing." + return "⚠️ Could nprocess your request. Please try rephrasing." if "Empty SQL from LLM" in error_text: return "⚠️ The model could not generate a SQL query for your question. Please try rephrasing." @@ -2768,7 +2765,7 @@ def get_last_thread_message(chat_id: str): THREAD_WORDS = [ # English confirmation - "yes", "yep", "yeah", "yup", "yes please", + "yes", "yep", "yeah", "yup", "yes please","list", "of course", "sure", "surely", "absolutely", "definitely", "certainly", "indeed", "correct", "ofcourse", "right", "exactly", "precisely", @@ -2776,14 +2773,14 @@ def get_last_thread_message(chat_id: str): "do it", "show me", "please", "go on", "continue", "proceed", "why not", "aye", "affirmative", "true", "agreed", - "hmm", "hm", "umm", "uh", "ah", + "hmm", "hm", "umm", "uh", "ah","give", "interesting", "i see", "got it", "ok got it", "and", "so", "then", "also", "but", "what", "how", "when", "who", "where", "why", "more", "less", "again", "another", "other", "next", "previous", "back", "forward", "noted", "understood", "makes sense", - "okay okay", "fine fine", "sure sure", + "okay okay", "fine fine", "sure sure","show", # Arabic confirmation "نعم", "أجل", "بالتأكيد", "طبعاً", "حسناً", "موافق", "صحيح", "بالضبط", "تماماً", "إي", @@ -2799,10 +2796,9 @@ def get_last_thread_message(chat_id: str): "اتركه", "مش محتاج", "مو صح", "خطأ", ] -@frappe.whitelist(allow_guest=False) def is_thread_erp(q:str,chat_id:str): msg_type = get_last_thread_message(chat_id) - if msg_type == "erp" and is_erp_query(q, THREAD_WORDS,85): + if msg_type == "erp" and is_erp_query(False,q, THREAD_WORDS,85): return True else: return False @@ -2830,18 +2826,19 @@ def run_text2sql_pipeline(user_question: str, chat_id: str, request_id: str, sen selected_tables = final.get("selected_tables") or [] fields = _safe_strip(final.get("selected_fields") or "") sql_prompt = _safe_strip(final.get("sql_prompt") or "") + final_prompt = final.get("final_prompt") or "" try: context = final.get("context") except Exception as e: frappe.log_error(e, "Error occurred while fetching final values") err = final.get("error") - # guard empty sql - # if not sql: - # return _error_response(memory_status, user_question, formatted_q, context, - # selected_tables, fields, sql, - # {"ok": False, "error": "SQL is empty"}, - # entity_debug, 0, "SQL not valid or missing", err) + # # # guard empty sql + # # # if not sql: + # # # return _error_response(memory_status, user_question, formatted_q, context, + # # # selected_tables, fields, sql, + # # # {"ok": False, "error": "SQL is empty"}, + # # # entity_debug, 0, "SQL not valid or missing", err) # retried_sql1, retried_orm1, retry1_val_res = retry_sql(retried_sql, retry_val_res.get("error"), formatted_q, sql_prompt) # if retry1_val_res.get("ok"): # return _handle_sql_result(memory_status, sql_prompt, final, retried_sql1, retried_orm1, @@ -2897,16 +2894,6 @@ def _error_response(memory_status, user_question, formatted_q, context, } -# @frappe.whitelist(allow_guest=False) -# def test(user_qstn, session_id): -# prompt = inject_prompt(user_qstn, session_id) - -# try: -# raw = call_model(prompt, "llm") -# standalone, contains_values = _parse_rewrite_response(raw, user_qstn) -# return standalone, contains_values -# except Exception as e: -# print(f"Error during model call: {e}") _WARMUP_COUNT=0 def load_on_startup(): global _WARMUP_COUNT,_EMBEDDER_INSTANCE, _VS_TABLE, _FULL_FIELDS_VS, _VS_MASTER, _FIELD_DOCS_CACHE, sym_spell, _GEMINI_CLIENT @@ -2966,16 +2953,6 @@ def _init_keywords(): _word_is_erp(kw) # result gets cached — first real request is instant -@frappe.whitelist(allow_guest=False) -def test(): - test_docs=["Customer","Employee","Item","Sales Order"] - result = [] - for doc in test_docs: - meta = frappe.get_meta(doc) - title_field = meta.title_field - result.append((doc, title_field)) - return result - def get_embedding_engine_test(): global _EMBEDDER_INSTANCE diff --git a/changai/changai/doctype/changai_settings/changai_settings.js b/changai/changai/doctype/changai_settings/changai_settings.js index ccaf584..e27147e 100644 --- a/changai/changai/doctype/changai_settings/changai_settings.js +++ b/changai/changai/doctype/changai_settings/changai_settings.js @@ -159,8 +159,13 @@ frappe.ui.form.on("ChangAI Settings", { fieldname: "tts_provider", text: "Choose the Text-to-Speech provider. Use Polly for high-quality AI voices with AWS Polly credentials; otherwise browser speech is used automatically" , + }, + { + fieldname: "module_and_description", + text: "Add modules with their descriptions, select them from the table, then click Create Train Data to generate the training dataset.", } + ]; applyTooltips(frm, fieldsWithTooltips); frm.add_custom_button(__('Download Embedding Model'), () => { diff --git a/changai/changai/doctype/changai_settings/changai_settings.json b/changai/changai/doctype/changai_settings/changai_settings.json index 17cdfa1..df9b4a7 100644 --- a/changai/changai/doctype/changai_settings/changai_settings.json +++ b/changai/changai/doctype/changai_settings/changai_settings.json @@ -10,6 +10,8 @@ "remote", "from_language", "to_language", + "gemini_authentication_free_tier_section", + "gemini_api_key", "models_section", "embedder", "qwen3_4b_instruct", @@ -21,8 +23,6 @@ "gemini_location", "gemini_project_id", "gemini_json_content", - "gemini_authentication_free_tier_section", - "gemini_api_key", "section_break_gnue", "retain_memory", "last_schema_sync", @@ -392,7 +392,7 @@ "index_web_pages_for_search": 1, "issingle": 1, "links": [], - "modified": "2026-05-18 07:06:57.303210", + "modified": "2026-05-21 16:38:55.838611", "modified_by": "Administrator", "module": "Changai", "name": "ChangAI Settings", diff --git a/changai/changai/prompts/sql_rewrite_sys_prompt.txt b/changai/changai/prompts/sql_rewrite_sys_prompt.txt index 05c369d..c21a877 100644 --- a/changai/changai/prompts/sql_rewrite_sys_prompt.txt +++ b/changai/changai/prompts/sql_rewrite_sys_prompt.txt @@ -3,7 +3,10 @@ Return ONLY valid JSON: {{"standalone_question":"...","contains_values":true/false}} TASK 1 — FOLLOW-UP -- If the query depends on previous messages, rewrite it as a complete standalone question. +- Analyze the last user message and last AI reply together. +- If the last AI reply ended with a question and the user message is a reply to it, + rewrite using the AI’s last question intent. +- If the query depends on chat history, rewrite it as a complete standalone question by analysing the chat history . - Otherwise keep it unchanged. TASK 2 — ENTITY DETECTION diff --git a/changai/changai/prompts/sql_system_prompt.txt b/changai/changai/prompts/sql_system_prompt.txt index 3f749dc..012f39f 100644 --- a/changai/changai/prompts/sql_system_prompt.txt +++ b/changai/changai/prompts/sql_system_prompt.txt @@ -30,11 +30,20 @@ For every table in your SQL, answer internally: NO → remove it immediately. No exceptions. ═══ ENTITY FILTERING ═══ -- If ENTITY_CARDS exist, use ONLY those exact values (no spelling/case changes). -- NEVER use entity string literals from the user question directly. -- Match user-mentioned names to the closest ENTITY_CARD using fuzzy/semantic matching. - Account for typos, abbreviations, and partial names. +- If ENTITY_CARDS exist, use ONLY those exact entity values in enity card (no spelling/case changes). +- NEVER EVER use entity string literals dirently in writing SQL from the user question directly. +- Match user-mentioned names to the closest ENTITY_CARD using typos/phonetic matching/fuzzy/semantic matching, abbreviations, and partial names. - Always use the exact entity card value in SQL and ORM. + ENTITY CARD FILTERING RULE: + If the user mentions an entity that is the same as, similar to, or a partial match of any provided entity card, you MUST use that entity card's exact filter_field and filter_value in the SQL WHERE clause. + Do NOT use the raw user text for filtering. + Do NOT default to the `name` field unless the entity card filter_field is `name`. +- Consider very bad typos, pronunciation similarity, sound-alike names, abbreviations, and partial matches,phonetic matching when matching user enteity text with entity cards. + important - always use the filter field given in entity cards for filtering with that enitity value +CRITICAL ENTITY FILTER OVERRIDE RULE: +If a matching ENTITY_CARD is found for a user-mentioned entity, the SQL WHERE clause MUST use ONLY: +- the ENTITY_CARD filter_field +- the ENTITY_CARD filter_value ═══ DOCSTATUS LAW ═══ - docstatus ONLY exists on submittable transaction doctypes: diff --git a/changai/changai/prompts/sql_user_prompt.txt b/changai/changai/prompts/sql_user_prompt.txt index 57c7310..6ba79c9 100644 --- a/changai/changai/prompts/sql_user_prompt.txt +++ b/changai/changai/prompts/sql_user_prompt.txt @@ -1,5 +1,10 @@ USER QUESTION: {question} You are FORBIDDEN from using any table or field that is not explicitly listed in the SCHEMA CONTEXT. No exceptions. +ENTITY_CARDS provide the exact field and value to use in SQL filtering. +When ENTITY_CARDS are provided, they may contain values in the format: +field_name:field_value +When generating SQL for entity retrieval, you MUST use the exact field name and exact field value provided in the ENTITY_CARDS context for WHERE conditions. +Do not use the raw user text or replace the field name with another field like `name`. SCHEMA CONTEXT: {context} GENERIC FIELDS (available on ALL transaction doctypes): name, creation, modified, owner, company, docstatus, naming_series, amended_from diff --git a/changai/changai/replicate_model_files/changai_retriever/.cog/tmp/build20251119113343.789672/requirements.txt b/changai/changai/replicate_model_files/changai_retriever/.cog/tmp/build20251119113343.789672/requirements.txt index 07f72be..00ccb89 100644 --- a/changai/changai/replicate_model_files/changai_retriever/.cog/tmp/build20251119113343.789672/requirements.txt +++ b/changai/changai/replicate_model_files/changai_retriever/.cog/tmp/build20251119113343.789672/requirements.txt @@ -1,5 +1,5 @@ --extra-index-url https://download.pytorch.org/whl/cpu -torch==2.3.1 +torch>=2.8.0 faiss-cpu==1.8.0 numpy==1.26.4 sentence-transformers>=2.6.0 diff --git a/changai/changai/replicate_model_files/entity_retriever/.cog/tmp/build20251221171616.080360/requirements.txt b/changai/changai/replicate_model_files/entity_retriever/.cog/tmp/build20251221171616.080360/requirements.txt index 07f72be..00ccb89 100644 --- a/changai/changai/replicate_model_files/entity_retriever/.cog/tmp/build20251221171616.080360/requirements.txt +++ b/changai/changai/replicate_model_files/entity_retriever/.cog/tmp/build20251221171616.080360/requirements.txt @@ -1,5 +1,5 @@ --extra-index-url https://download.pytorch.org/whl/cpu -torch==2.3.1 +torch>=2.8.0 faiss-cpu==1.8.0 numpy==1.26.4 sentence-transformers>=2.6.0 diff --git a/changai/public/dist/changai-chatbot.js b/changai/public/dist/changai-chatbot.js index d392363..ab89094 100644 --- a/changai/public/dist/changai-chatbot.js +++ b/changai/public/dist/changai-chatbot.js @@ -1,7 +1,7 @@ -var vp=Object.defineProperty;var _p=(Pt,re,pt)=>re in Pt?vp(Pt,re,{enumerable:!0,configurable:!0,writable:!0,value:pt}):Pt[re]=pt;var we=(Pt,re,pt)=>_p(Pt,typeof re!="symbol"?re+"":re,pt);(function(){"use strict";var Ns;function Pt(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const re={},pt=[],Qt=()=>{},Dl=()=>!1,es=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Bs=e=>e.startsWith("onUpdate:"),ht=Object.assign,ei=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Nl=Object.prototype.hasOwnProperty,he=(e,t)=>Nl.call(e,t),X=Array.isArray,pn=e=>ts(e)==="[object Map]",ti=e=>ts(e)==="[object Set]",me=e=>typeof e=="function",Ce=e=>typeof e=="string",zt=e=>typeof e=="symbol",Ae=e=>e!==null&&typeof e=="object",ni=e=>(Ae(e)||me(e))&&me(e.then)&&me(e.catch),si=Object.prototype.toString,ts=e=>si.call(e),Fl=e=>ts(e).slice(8,-1),ri=e=>ts(e)==="[object Object]",Hs=e=>Ce(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Cn=Pt(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ns=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Bl=/-(\w)/g,Ut=ns(e=>e.replace(Bl,(t,n)=>n?n.toUpperCase():"")),Hl=/\B([A-Z])/g,Jt=ns(e=>e.replace(Hl,"-$1").toLowerCase()),ii=ns(e=>e.charAt(0).toUpperCase()+e.slice(1)),zs=ns(e=>e?`on${ii(e)}`:""),jt=(e,t)=>!Object.is(e,t),ss=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},js=e=>{const t=parseFloat(e);return isNaN(t)?e:t},zl=e=>{const t=Ce(e)?Number(e):NaN;return isNaN(t)?e:t};let oi;const rs=()=>oi||(oi=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});function Vs(e){if(X(e)){const t={};for(let n=0;n{if(n){const s=n.split(jl);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function ye(e){let t="";if(Ce(e))t=e;else if(X(e))for(let n=0;n!!(e&&e.__v_isRef===!0),Qe=e=>Ce(e)?e:e==null?"":X(e)||Ae(e)&&(e.toString===si||!me(e.toString))?ai(e)?Qe(e.value):JSON.stringify(e,ui,2):String(e),ui=(e,t)=>ai(t)?ui(e,t.value):pn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r],i)=>(n[qs(s,i)+" =>"]=r,n),{})}:ti(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>qs(n))}:zt(t)?qs(t):Ae(t)&&!X(t)&&!ri(t)?String(t):t,qs=(e,t="")=>{var n;return zt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let Je;class Gl{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Je,!t&&Je&&(this.index=(Je.scopes||(Je.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0&&--this._on===0&&(Je=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n0)return;if(In){let t=In;for(In=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Pn;){let t=Pn;for(Pn=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function pi(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function hi(e){let t,n=e.depsTail,s=n;for(;s;){const r=s.prevDep;s.version===-1?(s===n&&(n=r),Zs(s),Yl(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=r}e.deps=t,e.depsTail=n}function Ys(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(gi(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function gi(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Mn)||(e.globalVersion=Mn,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ys(e))))return;e.flags|=2;const t=e.dep,n=_e,s=gt;_e=e,gt=!0;try{pi(e);const r=e.fn(e._value);(t.version===0||jt(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{_e=n,gt=s,hi(e),e.flags&=-3}}function Zs(e,t=!1){const{dep:n,prevSub:s,nextSub:r}=e;if(s&&(s.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Zs(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Yl(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let gt=!0;const mi=[];function It(){mi.push(gt),gt=!1}function Mt(){const e=mi.pop();gt=e===void 0?!0:e}function bi(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=_e;_e=void 0;try{t()}finally{_e=n}}}let Mn=0;class Zl{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Xs{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!_e||!gt||_e===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==_e)n=this.activeLink=new Zl(_e,this),_e.deps?(n.prevDep=_e.depsTail,_e.depsTail.nextDep=n,_e.depsTail=n):_e.deps=_e.depsTail=n,xi(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=_e.depsTail,n.nextDep=void 0,_e.depsTail.nextDep=n,_e.depsTail=n,_e.deps===n&&(_e.deps=s)}return n}trigger(t){this.version++,Mn++,this.notify(t)}notify(t){Gs();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ks()}}}function xi(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)xi(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Qs=new WeakMap,en=Symbol(""),Js=Symbol(""),Ln=Symbol("");function Ue(e,t,n){if(gt&&_e){let s=Qs.get(e);s||Qs.set(e,s=new Map);let r=s.get(n);r||(s.set(n,r=new Xs),r.map=s,r.key=n),r.track()}}function Lt(e,t,n,s,r,i){const o=Qs.get(e);if(!o){Mn++;return}const a=l=>{l&&l.trigger()};if(Gs(),t==="clear")o.forEach(a);else{const l=X(e),c=l&&Hs(n);if(l&&n==="length"){const u=Number(s);o.forEach((p,g)=>{(g==="length"||g===Ln||!zt(g)&&g>=u)&&a(p)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),c&&a(o.get(Ln)),t){case"add":l?c&&a(o.get("length")):(a(o.get(en)),pn(e)&&a(o.get(Js)));break;case"delete":l||(a(o.get(en)),pn(e)&&a(o.get(Js)));break;case"set":pn(e)&&a(o.get(en));break}}Ks()}function hn(e){const t=oe(e);return t===e?t:(Ue(t,"iterate",Ln),lt(e)?t:t.map(Fe))}function is(e){return Ue(e=oe(e),"iterate",Ln),e}const Xl={__proto__:null,[Symbol.iterator](){return er(this,Symbol.iterator,Fe)},concat(...e){return hn(this).concat(...e.map(t=>X(t)?hn(t):t))},entries(){return er(this,"entries",e=>(e[1]=Fe(e[1]),e))},every(e,t){return Ot(this,"every",e,t,void 0,arguments)},filter(e,t){return Ot(this,"filter",e,t,n=>n.map(Fe),arguments)},find(e,t){return Ot(this,"find",e,t,Fe,arguments)},findIndex(e,t){return Ot(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ot(this,"findLast",e,t,Fe,arguments)},findLastIndex(e,t){return Ot(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ot(this,"forEach",e,t,void 0,arguments)},includes(...e){return tr(this,"includes",e)},indexOf(...e){return tr(this,"indexOf",e)},join(e){return hn(this).join(e)},lastIndexOf(...e){return tr(this,"lastIndexOf",e)},map(e,t){return Ot(this,"map",e,t,void 0,arguments)},pop(){return On(this,"pop")},push(...e){return On(this,"push",e)},reduce(e,...t){return yi(this,"reduce",e,t)},reduceRight(e,...t){return yi(this,"reduceRight",e,t)},shift(){return On(this,"shift")},some(e,t){return Ot(this,"some",e,t,void 0,arguments)},splice(...e){return On(this,"splice",e)},toReversed(){return hn(this).toReversed()},toSorted(e){return hn(this).toSorted(e)},toSpliced(...e){return hn(this).toSpliced(...e)},unshift(...e){return On(this,"unshift",e)},values(){return er(this,"values",Fe)}};function er(e,t,n){const s=is(e),r=s[t]();return s!==e&&!lt(e)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.value&&(i.value=n(i.value)),i}),r}const Ql=Array.prototype;function Ot(e,t,n,s,r,i){const o=is(e),a=o!==e&&!lt(e),l=o[t];if(l!==Ql[t]){const p=l.apply(e,i);return a?Fe(p):p}let c=n;o!==e&&(a?c=function(p,g){return n.call(this,Fe(p),g,e)}:n.length>2&&(c=function(p,g){return n.call(this,p,g,e)}));const u=l.call(o,c,s);return a&&r?r(u):u}function yi(e,t,n,s){const r=is(e);let i=n;return r!==e&&(lt(e)?n.length>3&&(i=function(o,a,l){return n.call(this,o,a,l,e)}):i=function(o,a,l){return n.call(this,o,Fe(a),l,e)}),r[t](i,...s)}function tr(e,t,n){const s=oe(e);Ue(s,"iterate",Ln);const r=s[t](...n);return(r===-1||r===!1)&&sr(n[0])?(n[0]=oe(n[0]),s[t](...n)):r}function On(e,t,n=[]){It(),Gs();const s=oe(e)[t].apply(e,n);return Ks(),Mt(),s}const Jl=Pt("__proto__,__v_isRef,__isVue"),wi=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(zt));function ea(e){zt(e)||(e=String(e));const t=oe(this);return Ue(t,"has",e),t.hasOwnProperty(e)}class vi{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(r?i?Ai:Ei:i?Si:Ti).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=X(t);if(!r){let l;if(o&&(l=Xl[n]))return l;if(n==="hasOwnProperty")return ea}const a=Reflect.get(t,n,je(t)?t:s);return(zt(n)?wi.has(n):Jl(n))||(r||Ue(t,"get",n),i)?a:je(a)?o&&Hs(n)?a:a.value:Ae(a)?r?Ri(a):us(a):a}}class _i extends vi{constructor(t=!1){super(!1,t)}set(t,n,s,r){let i=t[n];if(!this._isShallow){const l=Vt(i);if(!lt(s)&&!Vt(s)&&(i=oe(i),s=oe(s)),!X(t)&&je(i)&&!je(s))return l?!1:(i.value=s,!0)}const o=X(t)&&Hs(n)?Number(n)e,os=e=>Reflect.getPrototypeOf(e);function ia(e,t,n){return function(...s){const r=this.__v_raw,i=oe(r),o=pn(i),a=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,c=r[e](...s),u=n?nr:t?fs:Fe;return!t&&Ue(i,"iterate",l?Js:en),{next(){const{value:p,done:g}=c.next();return g?{value:p,done:g}:{value:a?[u(p[0]),u(p[1])]:u(p),done:g}},[Symbol.iterator](){return this}}}}function ls(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function oa(e,t){const n={get(r){const i=this.__v_raw,o=oe(i),a=oe(r);e||(jt(r,a)&&Ue(o,"get",r),Ue(o,"get",a));const{has:l}=os(o),c=t?nr:e?fs:Fe;if(l.call(o,r))return c(i.get(r));if(l.call(o,a))return c(i.get(a));i!==o&&i.get(r)},get size(){const r=this.__v_raw;return!e&&Ue(oe(r),"iterate",en),Reflect.get(r,"size",r)},has(r){const i=this.__v_raw,o=oe(i),a=oe(r);return e||(jt(r,a)&&Ue(o,"has",r),Ue(o,"has",a)),r===a?i.has(r):i.has(r)||i.has(a)},forEach(r,i){const o=this,a=o.__v_raw,l=oe(a),c=t?nr:e?fs:Fe;return!e&&Ue(l,"iterate",en),a.forEach((u,p)=>r.call(i,c(u),c(p),o))}};return ht(n,e?{add:ls("add"),set:ls("set"),delete:ls("delete"),clear:ls("clear")}:{add(r){!t&&!lt(r)&&!Vt(r)&&(r=oe(r));const i=oe(this);return os(i).has.call(i,r)||(i.add(r),Lt(i,"add",r,r)),this},set(r,i){!t&&!lt(i)&&!Vt(i)&&(i=oe(i));const o=oe(this),{has:a,get:l}=os(o);let c=a.call(o,r);c||(r=oe(r),c=a.call(o,r));const u=l.call(o,r);return o.set(r,i),c?jt(i,u)&&Lt(o,"set",r,i):Lt(o,"add",r,i),this},delete(r){const i=oe(this),{has:o,get:a}=os(i);let l=o.call(i,r);l||(r=oe(r),l=o.call(i,r)),a&&a.call(i,r);const c=i.delete(r);return l&&Lt(i,"delete",r,void 0),c},clear(){const r=oe(this),i=r.size!==0,o=r.clear();return i&&Lt(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=ia(r,e,t)}),n}function as(e,t){const n=oa(e,t);return(s,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(he(n,r)&&r in s?n:s,r,i)}const la={get:as(!1,!1)},aa={get:as(!1,!0)},ua={get:as(!0,!1)},ca={get:as(!0,!0)},Ti=new WeakMap,Si=new WeakMap,Ei=new WeakMap,Ai=new WeakMap;function fa(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function da(e){return e.__v_skip||!Object.isExtensible(e)?0:fa(Fl(e))}function us(e){return Vt(e)?e:cs(e,!1,ta,la,Ti)}function pa(e){return cs(e,!1,sa,aa,Si)}function Ri(e){return cs(e,!0,na,ua,Ei)}function Tp(e){return cs(e,!0,ra,ca,Ai)}function cs(e,t,n,s,r){if(!Ae(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=da(e);if(i===0)return e;const o=r.get(e);if(o)return o;const a=new Proxy(e,i===2?s:n);return r.set(e,a),a}function gn(e){return Vt(e)?gn(e.__v_raw):!!(e&&e.__v_isReactive)}function Vt(e){return!!(e&&e.__v_isReadonly)}function lt(e){return!!(e&&e.__v_isShallow)}function sr(e){return e?!!e.__v_raw:!1}function oe(e){const t=e&&e.__v_raw;return t?oe(t):e}function ha(e){return!he(e,"__v_skip")&&Object.isExtensible(e)&&Us(e,"__v_skip",!0),e}const Fe=e=>Ae(e)?us(e):e,fs=e=>Ae(e)?Ri(e):e;function je(e){return e?e.__v_isRef===!0:!1}function Q(e){return ga(e,!1)}function ga(e,t){return je(e)?e:new ma(e,t)}class ma{constructor(t,n){this.dep=new Xs,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:oe(t),this._value=n?t:Fe(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||lt(t)||Vt(t);t=s?t:oe(t),jt(t,n)&&(this._rawValue=t,this._value=s?t:Fe(t),this.dep.trigger())}}function ba(e){return je(e)?e.value:e}const xa={get:(e,t,n)=>t==="__v_raw"?e:ba(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return je(r)&&!je(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function Ci(e){return gn(e)?e:new Proxy(e,xa)}class ya{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Xs(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Mn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&_e!==this)return di(this,!0),!0}get value(){const t=this.dep.track();return gi(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function wa(e,t,n=!1){let s,r;return me(e)?s=e:(s=e.get,r=e.set),new ya(s,r,n)}const ds={},ps=new WeakMap;let tn;function va(e,t=!1,n=tn){if(n){let s=ps.get(n);s||ps.set(n,s=[]),s.push(e)}}function _a(e,t,n=re){const{immediate:s,deep:r,once:i,scheduler:o,augmentJob:a,call:l}=n,c=O=>r?O:lt(O)||r===!1||r===0?$t(O,1):$t(O);let u,p,g,w,E=!1,m=!1;if(je(e)?(p=()=>e.value,E=lt(e)):gn(e)?(p=()=>c(e),E=!0):X(e)?(m=!0,E=e.some(O=>gn(O)||lt(O)),p=()=>e.map(O=>{if(je(O))return O.value;if(gn(O))return c(O);if(me(O))return l?l(O,2):O()})):me(e)?t?p=l?()=>l(e,2):e:p=()=>{if(g){It();try{g()}finally{Mt()}}const O=tn;tn=u;try{return l?l(e,3,[w]):e(w)}finally{tn=O}}:p=Qt,t&&r){const O=p,A=r===!0?1/0:r;p=()=>$t(O(),A)}const R=Kl(),S=()=>{u.stop(),R&&R.active&&ei(R.effects,u)};if(i&&t){const O=t;t=(...A)=>{O(...A),S()}}let V=m?new Array(e.length).fill(ds):ds;const K=O=>{if(!(!(u.flags&1)||!u.dirty&&!O))if(t){const A=u.run();if(r||E||(m?A.some((C,J)=>jt(C,V[J])):jt(A,V))){g&&g();const C=tn;tn=u;try{const J=[A,V===ds?void 0:m&&V[0]===ds?[]:V,w];V=A,l?l(t,3,J):t(...J)}finally{tn=C}}}else u.run()};return a&&a(K),u=new ci(p),u.scheduler=o?()=>o(K,!1):K,w=O=>va(O,!1,u),g=u.onStop=()=>{const O=ps.get(u);if(O){if(l)l(O,4);else for(const A of O)A();ps.delete(u)}},t?s?K(!0):V=u.run():o?o(K.bind(null,!0),!0):u.run(),S.pause=u.pause.bind(u),S.resume=u.resume.bind(u),S.stop=S,S}function $t(e,t=1/0,n){if(t<=0||!Ae(e)||e.__v_skip||(n=n||new Set,n.has(e)))return e;if(n.add(e),t--,je(e))$t(e.value,t,n);else if(X(e))for(let s=0;s{$t(s,t,n)});else if(ri(e)){for(const s in e)$t(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&$t(e[s],t,n)}return e}const $n=[];let rr=!1;function Sp(e,...t){if(rr)return;rr=!0,It();const n=$n.length?$n[$n.length-1].component:null,s=n&&n.appContext.config.warnHandler,r=ka();if(s)mn(s,n,11,[e+t.map(i=>{var o,a;return(a=(o=i.toString)==null?void 0:o.call(i))!=null?a:JSON.stringify(i)}).join(""),n&&n.proxy,r.map(({vnode:i})=>`at <${mo(n,i.type)}>`).join(` +var vp=Object.defineProperty;var _p=(Pt,se,pt)=>se in Pt?vp(Pt,se,{enumerable:!0,configurable:!0,writable:!0,value:pt}):Pt[se]=pt;var we=(Pt,se,pt)=>_p(Pt,typeof se!="symbol"?se+"":se,pt);(function(){"use strict";var Ns;function Pt(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const se={},pt=[],Qt=()=>{},Dl=()=>!1,es=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Bs=e=>e.startsWith("onUpdate:"),ht=Object.assign,ei=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Nl=Object.prototype.hasOwnProperty,ge=(e,t)=>Nl.call(e,t),Q=Array.isArray,pn=e=>ts(e)==="[object Map]",ti=e=>ts(e)==="[object Set]",be=e=>typeof e=="function",Ce=e=>typeof e=="string",zt=e=>typeof e=="symbol",Ae=e=>e!==null&&typeof e=="object",ni=e=>(Ae(e)||be(e))&&be(e.then)&&be(e.catch),si=Object.prototype.toString,ts=e=>si.call(e),Fl=e=>ts(e).slice(8,-1),ri=e=>ts(e)==="[object Object]",Hs=e=>Ce(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Cn=Pt(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ns=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Bl=/-(\w)/g,Ut=ns(e=>e.replace(Bl,(t,n)=>n?n.toUpperCase():"")),Hl=/\B([A-Z])/g,Jt=ns(e=>e.replace(Hl,"-$1").toLowerCase()),ii=ns(e=>e.charAt(0).toUpperCase()+e.slice(1)),zs=ns(e=>e?`on${ii(e)}`:""),jt=(e,t)=>!Object.is(e,t),ss=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},js=e=>{const t=parseFloat(e);return isNaN(t)?e:t},zl=e=>{const t=Ce(e)?Number(e):NaN;return isNaN(t)?e:t};let oi;const rs=()=>oi||(oi=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});function Vs(e){if(Q(e)){const t={};for(let n=0;n{if(n){const s=n.split(jl);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function ye(e){let t="";if(Ce(e))t=e;else if(Q(e))for(let n=0;n!!(e&&e.__v_isRef===!0),Qe=e=>Ce(e)?e:e==null?"":Q(e)||Ae(e)&&(e.toString===si||!be(e.toString))?ai(e)?Qe(e.value):JSON.stringify(e,ui,2):String(e),ui=(e,t)=>ai(t)?ui(e,t.value):pn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r],i)=>(n[qs(s,i)+" =>"]=r,n),{})}:ti(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>qs(n))}:zt(t)?qs(t):Ae(t)&&!Q(t)&&!ri(t)?String(t):t,qs=(e,t="")=>{var n;return zt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let Je;class Gl{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Je,!t&&Je&&(this.index=(Je.scopes||(Je.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0&&--this._on===0&&(Je=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n0)return;if(In){let t=In;for(In=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Pn;){let t=Pn;for(Pn=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function pi(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function hi(e){let t,n=e.depsTail,s=n;for(;s;){const r=s.prevDep;s.version===-1?(s===n&&(n=r),Zs(s),Yl(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=r}e.deps=t,e.depsTail=n}function Ys(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(gi(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function gi(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Mn)||(e.globalVersion=Mn,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ys(e))))return;e.flags|=2;const t=e.dep,n=_e,s=gt;_e=e,gt=!0;try{pi(e);const r=e.fn(e._value);(t.version===0||jt(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{_e=n,gt=s,hi(e),e.flags&=-3}}function Zs(e,t=!1){const{dep:n,prevSub:s,nextSub:r}=e;if(s&&(s.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Zs(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Yl(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let gt=!0;const mi=[];function It(){mi.push(gt),gt=!1}function Mt(){const e=mi.pop();gt=e===void 0?!0:e}function bi(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=_e;_e=void 0;try{t()}finally{_e=n}}}let Mn=0;class Zl{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Xs{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!_e||!gt||_e===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==_e)n=this.activeLink=new Zl(_e,this),_e.deps?(n.prevDep=_e.depsTail,_e.depsTail.nextDep=n,_e.depsTail=n):_e.deps=_e.depsTail=n,xi(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=_e.depsTail,n.nextDep=void 0,_e.depsTail.nextDep=n,_e.depsTail=n,_e.deps===n&&(_e.deps=s)}return n}trigger(t){this.version++,Mn++,this.notify(t)}notify(t){Gs();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ks()}}}function xi(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)xi(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Qs=new WeakMap,en=Symbol(""),Js=Symbol(""),Ln=Symbol("");function Ue(e,t,n){if(gt&&_e){let s=Qs.get(e);s||Qs.set(e,s=new Map);let r=s.get(n);r||(s.set(n,r=new Xs),r.map=s,r.key=n),r.track()}}function Lt(e,t,n,s,r,i){const o=Qs.get(e);if(!o){Mn++;return}const a=l=>{l&&l.trigger()};if(Gs(),t==="clear")o.forEach(a);else{const l=Q(e),c=l&&Hs(n);if(l&&n==="length"){const u=Number(s);o.forEach((p,g)=>{(g==="length"||g===Ln||!zt(g)&&g>=u)&&a(p)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),c&&a(o.get(Ln)),t){case"add":l?c&&a(o.get("length")):(a(o.get(en)),pn(e)&&a(o.get(Js)));break;case"delete":l||(a(o.get(en)),pn(e)&&a(o.get(Js)));break;case"set":pn(e)&&a(o.get(en));break}}Ks()}function hn(e){const t=oe(e);return t===e?t:(Ue(t,"iterate",Ln),lt(e)?t:t.map(Fe))}function is(e){return Ue(e=oe(e),"iterate",Ln),e}const Xl={__proto__:null,[Symbol.iterator](){return er(this,Symbol.iterator,Fe)},concat(...e){return hn(this).concat(...e.map(t=>Q(t)?hn(t):t))},entries(){return er(this,"entries",e=>(e[1]=Fe(e[1]),e))},every(e,t){return Ot(this,"every",e,t,void 0,arguments)},filter(e,t){return Ot(this,"filter",e,t,n=>n.map(Fe),arguments)},find(e,t){return Ot(this,"find",e,t,Fe,arguments)},findIndex(e,t){return Ot(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ot(this,"findLast",e,t,Fe,arguments)},findLastIndex(e,t){return Ot(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ot(this,"forEach",e,t,void 0,arguments)},includes(...e){return tr(this,"includes",e)},indexOf(...e){return tr(this,"indexOf",e)},join(e){return hn(this).join(e)},lastIndexOf(...e){return tr(this,"lastIndexOf",e)},map(e,t){return Ot(this,"map",e,t,void 0,arguments)},pop(){return On(this,"pop")},push(...e){return On(this,"push",e)},reduce(e,...t){return yi(this,"reduce",e,t)},reduceRight(e,...t){return yi(this,"reduceRight",e,t)},shift(){return On(this,"shift")},some(e,t){return Ot(this,"some",e,t,void 0,arguments)},splice(...e){return On(this,"splice",e)},toReversed(){return hn(this).toReversed()},toSorted(e){return hn(this).toSorted(e)},toSpliced(...e){return hn(this).toSpliced(...e)},unshift(...e){return On(this,"unshift",e)},values(){return er(this,"values",Fe)}};function er(e,t,n){const s=is(e),r=s[t]();return s!==e&&!lt(e)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.value&&(i.value=n(i.value)),i}),r}const Ql=Array.prototype;function Ot(e,t,n,s,r,i){const o=is(e),a=o!==e&&!lt(e),l=o[t];if(l!==Ql[t]){const p=l.apply(e,i);return a?Fe(p):p}let c=n;o!==e&&(a?c=function(p,g){return n.call(this,Fe(p),g,e)}:n.length>2&&(c=function(p,g){return n.call(this,p,g,e)}));const u=l.call(o,c,s);return a&&r?r(u):u}function yi(e,t,n,s){const r=is(e);let i=n;return r!==e&&(lt(e)?n.length>3&&(i=function(o,a,l){return n.call(this,o,a,l,e)}):i=function(o,a,l){return n.call(this,o,Fe(a),l,e)}),r[t](i,...s)}function tr(e,t,n){const s=oe(e);Ue(s,"iterate",Ln);const r=s[t](...n);return(r===-1||r===!1)&&sr(n[0])?(n[0]=oe(n[0]),s[t](...n)):r}function On(e,t,n=[]){It(),Gs();const s=oe(e)[t].apply(e,n);return Ks(),Mt(),s}const Jl=Pt("__proto__,__v_isRef,__isVue"),wi=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(zt));function ea(e){zt(e)||(e=String(e));const t=oe(this);return Ue(t,"has",e),t.hasOwnProperty(e)}class vi{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(r?i?Ai:Ei:i?Si:Ti).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=Q(t);if(!r){let l;if(o&&(l=Xl[n]))return l;if(n==="hasOwnProperty")return ea}const a=Reflect.get(t,n,je(t)?t:s);return(zt(n)?wi.has(n):Jl(n))||(r||Ue(t,"get",n),i)?a:je(a)?o&&Hs(n)?a:a.value:Ae(a)?r?Ri(a):us(a):a}}class _i extends vi{constructor(t=!1){super(!1,t)}set(t,n,s,r){let i=t[n];if(!this._isShallow){const l=Vt(i);if(!lt(s)&&!Vt(s)&&(i=oe(i),s=oe(s)),!Q(t)&&je(i)&&!je(s))return l?!1:(i.value=s,!0)}const o=Q(t)&&Hs(n)?Number(n)e,os=e=>Reflect.getPrototypeOf(e);function ia(e,t,n){return function(...s){const r=this.__v_raw,i=oe(r),o=pn(i),a=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,c=r[e](...s),u=n?nr:t?fs:Fe;return!t&&Ue(i,"iterate",l?Js:en),{next(){const{value:p,done:g}=c.next();return g?{value:p,done:g}:{value:a?[u(p[0]),u(p[1])]:u(p),done:g}},[Symbol.iterator](){return this}}}}function ls(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function oa(e,t){const n={get(r){const i=this.__v_raw,o=oe(i),a=oe(r);e||(jt(r,a)&&Ue(o,"get",r),Ue(o,"get",a));const{has:l}=os(o),c=t?nr:e?fs:Fe;if(l.call(o,r))return c(i.get(r));if(l.call(o,a))return c(i.get(a));i!==o&&i.get(r)},get size(){const r=this.__v_raw;return!e&&Ue(oe(r),"iterate",en),Reflect.get(r,"size",r)},has(r){const i=this.__v_raw,o=oe(i),a=oe(r);return e||(jt(r,a)&&Ue(o,"has",r),Ue(o,"has",a)),r===a?i.has(r):i.has(r)||i.has(a)},forEach(r,i){const o=this,a=o.__v_raw,l=oe(a),c=t?nr:e?fs:Fe;return!e&&Ue(l,"iterate",en),a.forEach((u,p)=>r.call(i,c(u),c(p),o))}};return ht(n,e?{add:ls("add"),set:ls("set"),delete:ls("delete"),clear:ls("clear")}:{add(r){!t&&!lt(r)&&!Vt(r)&&(r=oe(r));const i=oe(this);return os(i).has.call(i,r)||(i.add(r),Lt(i,"add",r,r)),this},set(r,i){!t&&!lt(i)&&!Vt(i)&&(i=oe(i));const o=oe(this),{has:a,get:l}=os(o);let c=a.call(o,r);c||(r=oe(r),c=a.call(o,r));const u=l.call(o,r);return o.set(r,i),c?jt(i,u)&&Lt(o,"set",r,i):Lt(o,"add",r,i),this},delete(r){const i=oe(this),{has:o,get:a}=os(i);let l=o.call(i,r);l||(r=oe(r),l=o.call(i,r)),a&&a.call(i,r);const c=i.delete(r);return l&&Lt(i,"delete",r,void 0),c},clear(){const r=oe(this),i=r.size!==0,o=r.clear();return i&&Lt(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=ia(r,e,t)}),n}function as(e,t){const n=oa(e,t);return(s,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(ge(n,r)&&r in s?n:s,r,i)}const la={get:as(!1,!1)},aa={get:as(!1,!0)},ua={get:as(!0,!1)},ca={get:as(!0,!0)},Ti=new WeakMap,Si=new WeakMap,Ei=new WeakMap,Ai=new WeakMap;function fa(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function da(e){return e.__v_skip||!Object.isExtensible(e)?0:fa(Fl(e))}function us(e){return Vt(e)?e:cs(e,!1,ta,la,Ti)}function pa(e){return cs(e,!1,sa,aa,Si)}function Ri(e){return cs(e,!0,na,ua,Ei)}function Tp(e){return cs(e,!0,ra,ca,Ai)}function cs(e,t,n,s,r){if(!Ae(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=da(e);if(i===0)return e;const o=r.get(e);if(o)return o;const a=new Proxy(e,i===2?s:n);return r.set(e,a),a}function gn(e){return Vt(e)?gn(e.__v_raw):!!(e&&e.__v_isReactive)}function Vt(e){return!!(e&&e.__v_isReadonly)}function lt(e){return!!(e&&e.__v_isShallow)}function sr(e){return e?!!e.__v_raw:!1}function oe(e){const t=e&&e.__v_raw;return t?oe(t):e}function ha(e){return!ge(e,"__v_skip")&&Object.isExtensible(e)&&Us(e,"__v_skip",!0),e}const Fe=e=>Ae(e)?us(e):e,fs=e=>Ae(e)?Ri(e):e;function je(e){return e?e.__v_isRef===!0:!1}function J(e){return ga(e,!1)}function ga(e,t){return je(e)?e:new ma(e,t)}class ma{constructor(t,n){this.dep=new Xs,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:oe(t),this._value=n?t:Fe(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||lt(t)||Vt(t);t=s?t:oe(t),jt(t,n)&&(this._rawValue=t,this._value=s?t:Fe(t),this.dep.trigger())}}function ba(e){return je(e)?e.value:e}const xa={get:(e,t,n)=>t==="__v_raw"?e:ba(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return je(r)&&!je(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function Ci(e){return gn(e)?e:new Proxy(e,xa)}class ya{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Xs(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Mn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&_e!==this)return di(this,!0),!0}get value(){const t=this.dep.track();return gi(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function wa(e,t,n=!1){let s,r;return be(e)?s=e:(s=e.get,r=e.set),new ya(s,r,n)}const ds={},ps=new WeakMap;let tn;function va(e,t=!1,n=tn){if(n){let s=ps.get(n);s||ps.set(n,s=[]),s.push(e)}}function _a(e,t,n=se){const{immediate:s,deep:r,once:i,scheduler:o,augmentJob:a,call:l}=n,c=O=>r?O:lt(O)||r===!1||r===0?$t(O,1):$t(O);let u,p,g,w,E=!1,m=!1;if(je(e)?(p=()=>e.value,E=lt(e)):gn(e)?(p=()=>c(e),E=!0):Q(e)?(m=!0,E=e.some(O=>gn(O)||lt(O)),p=()=>e.map(O=>{if(je(O))return O.value;if(gn(O))return c(O);if(be(O))return l?l(O,2):O()})):be(e)?t?p=l?()=>l(e,2):e:p=()=>{if(g){It();try{g()}finally{Mt()}}const O=tn;tn=u;try{return l?l(e,3,[w]):e(w)}finally{tn=O}}:p=Qt,t&&r){const O=p,z=r===!0?1/0:r;p=()=>$t(O(),z)}const A=Kl(),T=()=>{u.stop(),A&&A.active&&ei(A.effects,u)};if(i&&t){const O=t;t=(...z)=>{O(...z),T()}}let W=m?new Array(e.length).fill(ds):ds;const K=O=>{if(!(!(u.flags&1)||!u.dirty&&!O))if(t){const z=u.run();if(r||E||(m?z.some((P,I)=>jt(P,W[I])):jt(z,W))){g&&g();const P=tn;tn=u;try{const I=[z,W===ds?void 0:m&&W[0]===ds?[]:W,w];W=z,l?l(t,3,I):t(...I)}finally{tn=P}}}else u.run()};return a&&a(K),u=new ci(p),u.scheduler=o?()=>o(K,!1):K,w=O=>va(O,!1,u),g=u.onStop=()=>{const O=ps.get(u);if(O){if(l)l(O,4);else for(const z of O)z();ps.delete(u)}},t?s?K(!0):W=u.run():o?o(K.bind(null,!0),!0):u.run(),T.pause=u.pause.bind(u),T.resume=u.resume.bind(u),T.stop=T,T}function $t(e,t=1/0,n){if(t<=0||!Ae(e)||e.__v_skip||(n=n||new Set,n.has(e)))return e;if(n.add(e),t--,je(e))$t(e.value,t,n);else if(Q(e))for(let s=0;s{$t(s,t,n)});else if(ri(e)){for(const s in e)$t(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&$t(e[s],t,n)}return e}const $n=[];let rr=!1;function Sp(e,...t){if(rr)return;rr=!0,It();const n=$n.length?$n[$n.length-1].component:null,s=n&&n.appContext.config.warnHandler,r=ka();if(s)mn(s,n,11,[e+t.map(i=>{var o,a;return(a=(o=i.toString)==null?void 0:o.call(i))!=null?a:JSON.stringify(i)}).join(""),n&&n.proxy,r.map(({vnode:i})=>`at <${mo(n,i.type)}>`).join(` `),r]);else{const i=[`[Vue warn]: ${e}`,...t];r.length&&i.push(` `,...Ta(r))}Mt(),rr=!1}function ka(){let e=$n[$n.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const s=e.component&&e.component.parent;e=s&&s.vnode}return t}function Ta(e){const t=[];return e.forEach((n,s)=>{t.push(...s===0?[]:[` -`],...Sa(n))}),t}function Sa({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",s=e.component?e.component.parent==null:!1,r=` at <${mo(e.component,e.type,s)}`,i=">"+n;return e.props?[r,...Ea(e.props),i]:[r+i]}function Ea(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(s=>{t.push(...Pi(s,e[s]))}),n.length>3&&t.push(" ..."),t}function Pi(e,t,n){return Ce(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:je(t)?(t=Pi(e,oe(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):me(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=oe(t),n?t:[`${e}=`,t])}function mn(e,t,n,s){try{return s?e(...s):e()}catch(r){hs(r,t,n)}}function _t(e,t,n,s){if(me(e)){const r=mn(e,t,n,s);return r&&ni(r)&&r.catch(i=>{hs(i,t,n)}),r}if(X(e)){const r=[];for(let i=0;i>>1,r=Ge[s],i=Dn(r);i=Dn(n)?Ge.push(e):Ge.splice(Ra(t),0,e),e.flags|=1,Mi()}}function Mi(){gs||(gs=Ii.then($i))}function Ca(e){X(e)?bn.push(...e):qt&&e.id===-1?qt.splice(xn+1,0,e):e.flags&1||(bn.push(e),e.flags|=1),Mi()}function Li(e,t,n=kt+1){for(;nDn(n)-Dn(s));if(bn.length=0,qt){qt.push(...t);return}for(qt=t,xn=0;xne.id==null?e.flags&2?-1:1/0:e.id;function $i(e){try{for(kt=0;kt{s._d&&lo(-1);const i=ms(t);let o;try{o=e(...r)}finally{ms(i),s._d&&lo(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function Pa(e,t){if(at===null)return e;const n=Es(at),s=e.dirs||(e.dirs=[]);for(let r=0;re.__isTeleport,Wt=Symbol("_leaveCb"),bs=Symbol("_enterCb");function Ma(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Hn(()=>{e.isMounted=!0}),xs(()=>{e.isUnmounting=!0}),e}const ut=[Function,Array],Bi={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ut,onEnter:ut,onAfterEnter:ut,onEnterCancelled:ut,onBeforeLeave:ut,onLeave:ut,onAfterLeave:ut,onLeaveCancelled:ut,onBeforeAppear:ut,onAppear:ut,onAfterAppear:ut,onAppearCancelled:ut},Hi=e=>{const t=e.subTree;return t.component?Hi(t.component):t},La={name:"BaseTransition",props:Bi,setup(e,{slots:t}){const n=co(),s=Ma();return()=>{const r=t.default&&Vi(t.default(),!0);if(!r||!r.length)return;const i=zi(r),o=oe(e),{mode:a}=o;if(s.isLeaving)return lr(i);const l=ji(i);if(!l)return lr(i);let c=or(l,o,s,n,p=>c=p);l.type!==Ke&&Nn(l,c);let u=n.subTree&&ji(n.subTree);if(u&&u.type!==Ke&&!on(l,u)&&Hi(n).type!==Ke){let p=or(u,o,s,n);if(Nn(u,p),a==="out-in"&&l.type!==Ke)return s.isLeaving=!0,p.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete p.afterLeave,u=void 0},lr(i);a==="in-out"&&l.type!==Ke?p.delayLeave=(g,w,E)=>{const m=Ui(s,u);m[String(u.key)]=u,g[Wt]=()=>{w(),g[Wt]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{E(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function zi(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Ke){t=n;break}}return t}const Oa=La;function Ui(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function or(e,t,n,s,r){const{appear:i,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:p,onBeforeLeave:g,onLeave:w,onAfterLeave:E,onLeaveCancelled:m,onBeforeAppear:R,onAppear:S,onAfterAppear:V,onAppearCancelled:K}=t,O=String(e.key),A=Ui(n,e),C=(W,ne)=>{W&&_t(W,s,9,ne)},J=(W,ne)=>{const xe=ne[1];C(W,ne),X(W)?W.every($=>$.length<=1)&&xe():W.length<=1&&xe()},te={mode:o,persisted:a,beforeEnter(W){let ne=l;if(!n.isMounted)if(i)ne=R||l;else return;W[Wt]&&W[Wt](!0);const xe=A[O];xe&&on(e,xe)&&xe.el[Wt]&&xe.el[Wt](),C(ne,[W])},enter(W){let ne=c,xe=u,$=p;if(!n.isMounted)if(i)ne=S||c,xe=V||u,$=K||p;else return;let Y=!1;const G=W[bs]=z=>{Y||(Y=!0,z?C($,[W]):C(xe,[W]),te.delayedLeave&&te.delayedLeave(),W[bs]=void 0)};ne?J(ne,[W,G]):G()},leave(W,ne){const xe=String(e.key);if(W[bs]&&W[bs](!0),n.isUnmounting)return ne();C(g,[W]);let $=!1;const Y=W[Wt]=G=>{$||($=!0,ne(),G?C(m,[W]):C(E,[W]),W[Wt]=void 0,A[xe]===e&&delete A[xe])};A[xe]=e,w?J(w,[W,Y]):Y()},clone(W){const ne=or(W,t,n,s,r);return r&&r(ne),ne}};return te}function lr(e){if(ar(e))return e=Gt(e),e.children=null,e}function ji(e){if(!ar(e))return Fi(e.type)&&e.children?zi(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&me(n.default))return n.default()}}function Nn(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Nn(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Vi(e,t=!1,n){let s=[],r=0;for(let i=0;i1)for(let i=0;iFn(E,t&&(X(t)?t[m]:t),n,s,r));return}if(Bn(s)&&!r){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Fn(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?Es(s.component):s.el,o=r?null:i,{i:a,r:l}=e,c=t&&t.r,u=a.refs===re?a.refs={}:a.refs,p=a.setupState,g=oe(p),w=p===re?()=>!1:E=>he(g,E);if(c!=null&&c!==l&&(Ce(c)?(u[c]=null,w(c)&&(p[c]=null)):je(c)&&(c.value=null)),me(l))mn(l,a,12,[o,u]);else{const E=Ce(l),m=je(l);if(E||m){const R=()=>{if(e.f){const S=E?w(l)?p[l]:u[l]:l.value;r?X(S)&&ei(S,i):X(S)?S.includes(i)||S.push(i):E?(u[l]=[i],w(l)&&(p[l]=u[l])):(l.value=[i],e.k&&(u[e.k]=l.value))}else E?(u[l]=o,w(l)&&(p[l]=o)):m&&(l.value=o,e.k&&(u[e.k]=o))};o?(R.id=-1,nt(R,n)):R()}}}rs().requestIdleCallback,rs().cancelIdleCallback;const Bn=e=>!!e.type.__asyncLoader,ar=e=>e.type.__isKeepAlive;function Da(e,t,n=Yt,s=!1){if(n){const r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...o)=>{It();const a=xr(n),l=_t(t,n,e,o);return a(),Mt(),l});return s?r.unshift(i):r.push(i),i}}const qi=e=>(t,n=Yt)=>{(!Vn||e==="sp")&&Da(e,(...s)=>t(...s),n)},Hn=qi("m"),xs=qi("bum"),Na=Symbol.for("v-ndc");function ys(e,t,n,s){let r;const i=n,o=X(e);if(o||Ce(e)){const a=o&&gn(e);let l=!1,c=!1;a&&(l=!lt(e),c=Vt(e),e=is(e)),r=new Array(e.length);for(let u=0,p=e.length;ut(a,l,void 0,i));else{const a=Object.keys(e);r=new Array(a.length);for(let l=0,c=a.length;le?po(e)?Es(e):ur(e.parent):null,zn=ht(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ur(e.parent),$root:e=>ur(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>e.type,$forceUpdate:e=>e.f||(e.f=()=>{ir(e.update)}),$nextTick:e=>e.n||(e.n=Tt.bind(e.proxy)),$watch:e=>Qt}),cr=(e,t)=>e!==re&&!e.__isScriptSetup&&he(e,t),Fa={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:r,props:i,accessCache:o,type:a,appContext:l}=e;let c;if(t[0]!=="$"){const w=o[t];if(w!==void 0)switch(w){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return i[t]}else{if(cr(s,t))return o[t]=1,s[t];if(r!==re&&he(r,t))return o[t]=2,r[t];if((c=e.propsOptions[0])&&he(c,t))return o[t]=3,i[t];if(n!==re&&he(n,t))return o[t]=4,n[t];o[t]=0}}const u=zn[t];let p,g;if(u)return t==="$attrs"&&Ue(e.attrs,"get",""),u(e);if((p=a.__cssModules)&&(p=p[t]))return p;if(n!==re&&he(n,t))return o[t]=4,n[t];if(g=l.config.globalProperties,he(g,t))return g[t]},set({_:e},t,n){const{data:s,setupState:r,ctx:i}=e;return cr(r,t)?(r[t]=n,!0):s!==re&&he(s,t)?(s[t]=n,!0):he(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,propsOptions:i}},o){let a;return!!n[o]||e!==re&&he(e,o)||cr(t,o)||(a=i[0])&&he(a,o)||he(s,o)||he(zn,o)||he(r.config.globalProperties,o)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:he(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Wi(){return{app:null,config:{isNativeTag:Dl,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Ba=0;function Ha(e,t){return function(s,r=null){me(s)||(s=ht({},s)),r!=null&&!Ae(r)&&(r=null);const i=Wi(),o=new WeakSet,a=[];let l=!1;const c=i.app={_uid:Ba++,_component:s,_props:r,_container:null,_context:i,_instance:null,version:Su,get config(){return i.config},set config(u){},use(u,...p){return o.has(u)||(u&&me(u.install)?(o.add(u),u.install(c,...p)):me(u)&&(o.add(u),u(c,...p))),c},mixin(u){return c},component(u,p){return p?(i.components[u]=p,c):i.components[u]},directive(u,p){return p?(i.directives[u]=p,c):i.directives[u]},mount(u,p,g){if(!l){const w=c._ceVNode||Me(s,r);return w.appContext=i,g===!0?g="svg":g===!1&&(g=void 0),e(w,u,g),l=!0,c._container=u,u.__vue_app__=c,Es(w.component)}},onUnmount(u){a.push(u)},unmount(){l&&(_t(a,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(u,p){return i.provides[u]=p,c},runWithContext(u){const p=yn;yn=c;try{return u()}finally{yn=p}}};return c}}let yn=null;function za(e,t,n=!1){const s=co();if(s||yn){let r=yn?yn._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return n&&me(t)?t.call(s&&s.proxy):t}}const Gi={},Ki=()=>Object.create(Gi),Yi=e=>Object.getPrototypeOf(e)===Gi;function Ua(e,t,n,s=!1){const r={},i=Ki();e.propsDefaults=Object.create(null),Zi(e,t,r,i);for(const o in e.propsOptions[0])o in r||(r[o]=void 0);n?e.props=s?r:pa(r):e.type.props?e.props=r:e.props=i,e.attrs=i}function ja(e,t,n,s){const{props:r,attrs:i,vnode:{patchFlag:o}}=e,a=oe(r),[l]=e.propsOptions;let c=!1;if((s||o>0)&&!(o&16)){if(o&8){const u=e.vnode.dynamicProps;for(let p=0;pe==="_"||e==="__"||e==="_ctx"||e==="$stable",pr=e=>X(e)?e.map(Et):[Et(e)],qa=(e,t,n)=>{if(t._n)return t;const s=Ni((...r)=>pr(t(...r)),n);return s._c=!1,s},Qi=(e,t,n)=>{const s=e._ctx;for(const r in e){if(dr(r))continue;const i=e[r];if(me(i))t[r]=qa(r,i,s);else if(i!=null){const o=pr(i);t[r]=()=>o}}},Ji=(e,t)=>{const n=pr(t);e.slots.default=()=>n},eo=(e,t,n)=>{for(const s in t)(n||!dr(s))&&(e[s]=t[s])},Wa=(e,t,n)=>{const s=e.slots=Ki();if(e.vnode.shapeFlag&32){const r=t.__;r&&Us(s,"__",r,!0);const i=t._;i?(eo(s,t,n),n&&Us(s,"_",i,!0)):Qi(t,s)}else t&&Ji(e,t)},Ga=(e,t,n)=>{const{vnode:s,slots:r}=e;let i=!0,o=re;if(s.shapeFlag&32){const a=t._;a?n&&a===1?i=!1:eo(r,t,n):(i=!t.$stable,Qi(t,r)),o=t}else t&&(Ji(e,t),o={default:1});if(i)for(const a in r)!dr(a)&&o[a]==null&&delete r[a]},nt=au;function Ka(e){return Ya(e)}function Ya(e,t){const n=rs();n.__VUE__=!0;const{insert:s,remove:r,patchProp:i,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:p,nextSibling:g,setScopeId:w=Qt,insertStaticContent:E}=e,m=(f,h,b,k=null,v=null,_=null,M=void 0,I=null,P=!!h.dynamicChildren)=>{if(f===h)return;f&&!on(f,h)&&(k=le(f),de(f,v,_,!0),f=null),h.patchFlag===-2&&(P=!1,h.dynamicChildren=null);const{type:T,ref:B,shapeFlag:L}=h;switch(T){case vs:R(f,h,b,k);break;case Ke:S(f,h,b,k);break;case gr:f==null&&V(h,b,k,M);break;case Be:$(f,h,b,k,v,_,M,I,P);break;default:L&1?A(f,h,b,k,v,_,M,I,P):L&6?Y(f,h,b,k,v,_,M,I,P):(L&64||L&128)&&T.process(f,h,b,k,v,_,M,I,P,ze)}B!=null&&v?Fn(B,f&&f.ref,_,h||f,!h):B==null&&f&&f.ref!=null&&Fn(f.ref,null,_,f,!0)},R=(f,h,b,k)=>{if(f==null)s(h.el=a(h.children),b,k);else{const v=h.el=f.el;h.children!==f.children&&c(v,h.children)}},S=(f,h,b,k)=>{f==null?s(h.el=l(h.children||""),b,k):h.el=f.el},V=(f,h,b,k)=>{[f.el,f.anchor]=E(f.children,h,b,k,f.el,f.anchor)},K=({el:f,anchor:h},b,k)=>{let v;for(;f&&f!==h;)v=g(f),s(f,b,k),f=v;s(h,b,k)},O=({el:f,anchor:h})=>{let b;for(;f&&f!==h;)b=g(f),r(f),f=b;r(h)},A=(f,h,b,k,v,_,M,I,P)=>{h.type==="svg"?M="svg":h.type==="math"&&(M="mathml"),f==null?C(h,b,k,v,_,M,I,P):W(f,h,v,_,M,I,P)},C=(f,h,b,k,v,_,M,I)=>{let P,T;const{props:B,shapeFlag:L,transition:H,dirs:q}=f;if(P=f.el=o(f.type,_,B&&B.is,B),L&8?u(P,f.children):L&16&&te(f.children,P,null,k,v,hr(f,_),M,I),q&&nn(f,null,k,"created"),J(P,f,f.scopeId,M,k),B){for(const fe in B)fe!=="value"&&!Cn(fe)&&i(P,fe,null,B[fe],_,k);"value"in B&&i(P,"value",null,B.value,_),(T=B.onVnodeBeforeMount)&&At(T,k,f)}q&&nn(f,null,k,"beforeMount");const ee=Za(v,H);ee&&H.beforeEnter(P),s(P,h,b),((T=B&&B.onVnodeMounted)||ee||q)&&nt(()=>{T&&At(T,k,f),ee&&H.enter(P),q&&nn(f,null,k,"mounted")},v)},J=(f,h,b,k,v)=>{if(b&&w(f,b),k)for(let _=0;_{for(let T=P;T{const I=h.el=f.el;let{patchFlag:P,dynamicChildren:T,dirs:B}=h;P|=f.patchFlag&16;const L=f.props||re,H=h.props||re;let q;if(b&&sn(b,!1),(q=H.onVnodeBeforeUpdate)&&At(q,b,h,f),B&&nn(h,f,b,"beforeUpdate"),b&&sn(b,!0),(L.innerHTML&&H.innerHTML==null||L.textContent&&H.textContent==null)&&u(I,""),T?ne(f.dynamicChildren,T,I,b,k,hr(h,v),_):M||We(f,h,I,null,b,k,hr(h,v),_,!1),P>0){if(P&16)xe(I,L,H,b,v);else if(P&2&&L.class!==H.class&&i(I,"class",null,H.class,v),P&4&&i(I,"style",L.style,H.style,v),P&8){const ee=h.dynamicProps;for(let fe=0;fe{q&&At(q,b,h,f),B&&nn(h,f,b,"updated")},k)},ne=(f,h,b,k,v,_,M)=>{for(let I=0;I{if(h!==b){if(h!==re)for(const _ in h)!Cn(_)&&!(_ in b)&&i(f,_,h[_],null,v,k);for(const _ in b){if(Cn(_))continue;const M=b[_],I=h[_];M!==I&&_!=="value"&&i(f,_,I,M,v,k)}"value"in b&&i(f,"value",h.value,b.value,v)}},$=(f,h,b,k,v,_,M,I,P)=>{const T=h.el=f?f.el:a(""),B=h.anchor=f?f.anchor:a("");let{patchFlag:L,dynamicChildren:H,slotScopeIds:q}=h;q&&(I=I?I.concat(q):q),f==null?(s(T,b,k),s(B,b,k),te(h.children||[],b,B,v,_,M,I,P)):L>0&&L&64&&H&&f.dynamicChildren?(ne(f.dynamicChildren,H,b,v,_,M,I),(h.key!=null||v&&h===v.subTree)&&to(f,h,!0)):We(f,h,b,B,v,_,M,I,P)},Y=(f,h,b,k,v,_,M,I,P)=>{h.slotScopeIds=I,f==null?h.shapeFlag&512?v.ctx.activate(h,b,k,M,P):G(h,b,k,v,_,M,P):z(f,h,P)},G=(f,h,b,k,v,_,M)=>{const I=f.component=gu(f,k,v);if(ar(f)&&(I.ctx.renderer=ze),mu(I,!1,M),I.asyncDep){if(v&&v.registerDep(I,ue,M),!f.el){const P=I.subTree=Me(Ke);S(null,P,h,b),f.placeholder=P.el}}else ue(I,f,h,b,v,_,M)},z=(f,h,b)=>{const k=h.component=f.component;if(ou(f,h,b))if(k.asyncDep&&!k.asyncResolved){Se(k,h,b);return}else k.next=h,k.update();else h.el=f.el,k.vnode=h},ue=(f,h,b,k,v,_,M)=>{const I=()=>{if(f.isMounted){let{next:L,bu:H,u:q,parent:ee,vnode:fe}=f;{const it=no(f);if(it){L&&(L.el=fe.el,Se(f,L,M)),it.asyncDep.then(()=>{f.isUnmounted||I()});return}}let se=L,Te;sn(f,!1),L?(L.el=fe.el,Se(f,L,M)):L=fe,H&&ss(H),(Te=L.props&&L.props.onVnodeBeforeUpdate)&&At(Te,ee,L,fe),sn(f,!0);const Oe=ro(f),rt=f.subTree;f.subTree=Oe,m(rt,Oe,p(rt.el),le(rt),f,v,_),L.el=Oe.el,se===null&&lu(f,Oe.el),q&&nt(q,v),(Te=L.props&&L.props.onVnodeUpdated)&&nt(()=>At(Te,ee,L,fe),v)}else{let L;const{el:H,props:q}=h,{bm:ee,m:fe,parent:se,root:Te,type:Oe}=f,rt=Bn(h);sn(f,!1),ee&&ss(ee),!rt&&(L=q&&q.onVnodeBeforeMount)&&At(L,se,h),sn(f,!0);{Te.ce&&Te.ce._def.shadowRoot!==!1&&Te.ce._injectChildStyle(Oe);const it=f.subTree=ro(f);m(null,it,b,k,f,v,_),h.el=it.el}if(fe&&nt(fe,v),!rt&&(L=q&&q.onVnodeMounted)){const it=h;nt(()=>At(L,se,it),v)}(h.shapeFlag&256||se&&Bn(se.vnode)&&se.vnode.shapeFlag&256)&&f.a&&nt(f.a,v),f.isMounted=!0,h=b=k=null}};f.scope.on();const P=f.effect=new ci(I);f.scope.off();const T=f.update=P.run.bind(P),B=f.job=P.runIfDirty.bind(P);B.i=f,B.id=f.uid,P.scheduler=()=>ir(B),sn(f,!0),T()},Se=(f,h,b)=>{h.component=f;const k=f.vnode.props;f.vnode=h,f.next=null,ja(f,h.props,k,b),Ga(f,h.children,b),It(),Li(f),Mt()},We=(f,h,b,k,v,_,M,I,P=!1)=>{const T=f&&f.children,B=f?f.shapeFlag:0,L=h.children,{patchFlag:H,shapeFlag:q}=h;if(H>0){if(H&128){ce(T,L,b,k,v,_,M,I,P);return}else if(H&256){xt(T,L,b,k,v,_,M,I,P);return}}q&8?(B&16&&ge(T,v,_),L!==T&&u(b,L)):B&16?q&16?ce(T,L,b,k,v,_,M,I,P):ge(T,v,_,!0):(B&8&&u(b,""),q&16&&te(L,b,k,v,_,M,I,P))},xt=(f,h,b,k,v,_,M,I,P)=>{f=f||pt,h=h||pt;const T=f.length,B=h.length,L=Math.min(T,B);let H;for(H=0;HB?ge(f,v,_,!0,!1,L):te(h,b,k,v,_,M,I,P,L)},ce=(f,h,b,k,v,_,M,I,P)=>{let T=0;const B=h.length;let L=f.length-1,H=B-1;for(;T<=L&&T<=H;){const q=f[T],ee=h[T]=P?Kt(h[T]):Et(h[T]);if(on(q,ee))m(q,ee,b,null,v,_,M,I,P);else break;T++}for(;T<=L&&T<=H;){const q=f[L],ee=h[H]=P?Kt(h[H]):Et(h[H]);if(on(q,ee))m(q,ee,b,null,v,_,M,I,P);else break;L--,H--}if(T>L){if(T<=H){const q=H+1,ee=qH)for(;T<=L;)de(f[T],v,_,!0),T++;else{const q=T,ee=T,fe=new Map;for(T=ee;T<=H;T++){const $e=h[T]=P?Kt(h[T]):Et(h[T]);$e.key!=null&&fe.set($e.key,T)}let se,Te=0;const Oe=H-ee+1;let rt=!1,it=0;const Ft=new Array(Oe);for(T=0;T=Oe){de($e,v,_,!0);continue}let Xe;if($e.key!=null)Xe=fe.get($e.key);else for(se=ee;se<=H;se++)if(Ft[se-ee]===0&&on($e,h[se])){Xe=se;break}Xe===void 0?de($e,v,_,!0):(Ft[Xe-ee]=T+1,Xe>=it?it=Xe:rt=!0,m($e,h[Xe],b,null,v,_,M,I,P),Te++)}const Qn=rt?Xa(Ft):pt;for(se=Qn.length-1,T=Oe-1;T>=0;T--){const $e=ee+T,Xe=h[$e],ot=h[$e+1],Bt=$e+1{const{el:_,type:M,transition:I,children:P,shapeFlag:T}=f;if(T&6){N(f.component.subTree,h,b,k);return}if(T&128){f.suspense.move(h,b,k);return}if(T&64){M.move(f,h,b,ze);return}if(M===Be){s(_,h,b);for(let L=0;LI.enter(_),v);else{const{leave:L,delayLeave:H,afterLeave:q}=I,ee=()=>{f.ctx.isUnmounted?r(_):s(_,h,b)},fe=()=>{L(_,()=>{ee(),q&&q()})};H?H(_,ee,fe):fe()}else s(_,h,b)},de=(f,h,b,k=!1,v=!1)=>{const{type:_,props:M,ref:I,children:P,dynamicChildren:T,shapeFlag:B,patchFlag:L,dirs:H,cacheIndex:q}=f;if(L===-2&&(v=!1),I!=null&&(It(),Fn(I,null,b,f,!0),Mt()),q!=null&&(h.renderCache[q]=void 0),B&256){h.ctx.deactivate(f);return}const ee=B&1&&H,fe=!Bn(f);let se;if(fe&&(se=M&&M.onVnodeBeforeUnmount)&&At(se,h,f),B&6)ve(f.component,b,k);else{if(B&128){f.suspense.unmount(b,k);return}ee&&nn(f,null,h,"beforeUnmount"),B&64?f.type.remove(f,h,b,ze,k):T&&!T.hasOnce&&(_!==Be||L>0&&L&64)?ge(T,h,b,!1,!0):(_===Be&&L&384||!v&&B&16)&&ge(P,h,b),k&&pe(f)}(fe&&(se=M&&M.onVnodeUnmounted)||ee)&&nt(()=>{se&&At(se,h,f),ee&&nn(f,null,h,"unmounted")},b)},pe=f=>{const{type:h,el:b,anchor:k,transition:v}=f;if(h===Be){ke(b,k);return}if(h===gr){O(f);return}const _=()=>{r(b),v&&!v.persisted&&v.afterLeave&&v.afterLeave()};if(f.shapeFlag&1&&v&&!v.persisted){const{leave:M,delayLeave:I}=v,P=()=>M(b,_);I?I(f.el,_,P):P()}else _()},ke=(f,h)=>{let b;for(;f!==h;)b=g(f),r(f),f=b;r(h)},ve=(f,h,b)=>{const{bum:k,scope:v,job:_,subTree:M,um:I,m:P,a:T,parent:B,slots:{__:L}}=f;so(P),so(T),k&&ss(k),B&&X(L)&&L.forEach(H=>{B.renderCache[H]=void 0}),v.stop(),_&&(_.flags|=8,de(M,f,h,b)),I&&nt(I,h),nt(()=>{f.isUnmounted=!0},h),h&&h.pendingBranch&&!h.isUnmounted&&f.asyncDep&&!f.asyncResolved&&f.suspenseId===h.pendingId&&(h.deps--,h.deps===0&&h.resolve())},ge=(f,h,b,k=!1,v=!1,_=0)=>{for(let M=_;M{if(f.shapeFlag&6)return le(f.component.subTree);if(f.shapeFlag&128)return f.suspense.next();const h=g(f.anchor||f.el),b=h&&h[Ia];return b?g(b):h};let yt=!1;const Ct=(f,h,b)=>{f==null?h._vnode&&de(h._vnode,null,null,!0):m(h._vnode||null,f,h,null,null,null,b),h._vnode=f,yt||(yt=!0,Li(),Oi(),yt=!1)},ze={p:m,um:de,m:N,r:pe,mt:G,mc:te,pc:We,pbc:ne,n:le,o:e};return{render:Ct,hydrate:void 0,createApp:Ha(Ct)}}function hr({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function sn({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Za(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function to(e,t,n=!1){const s=e.children,r=t.children;if(X(s)&&X(r))for(let i=0;i>1,e[n[a]]0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,o=n[i-1];i-- >0;)n[i]=o,o=t[o];return n}function no(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:no(t)}function so(e){if(e)for(let t=0;tza(Qa);function rn(e,t,n){return eu(e,t,n)}function eu(e,t,n=re){const{immediate:s,deep:r,flush:i,once:o}=n,a=ht({},n),l=t&&s||!t&&i!=="post";let c;if(Vn){if(i==="sync"){const w=Ja();c=w.__watcherHandles||(w.__watcherHandles=[])}else if(!l){const w=()=>{};return w.stop=Qt,w.resume=Qt,w.pause=Qt,w}}const u=Yt;a.call=(w,E,m)=>_t(w,u,E,m);let p=!1;i==="post"?a.scheduler=w=>{nt(w,u&&u.suspense)}:i!=="sync"&&(p=!0,a.scheduler=(w,E)=>{E?w():ir(w)}),a.augmentJob=w=>{t&&(w.flags|=4),p&&(w.flags|=2,u&&(w.id=u.uid,w.i=u))};const g=_a(e,t,a);return Vn&&(c?c.push(g):l&&g()),g}const tu=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ut(t)}Modifiers`]||e[`${Jt(t)}Modifiers`];function nu(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||re;let r=n;const i=t.startsWith("update:"),o=i&&tu(s,t.slice(7));o&&(o.trim&&(r=n.map(u=>Ce(u)?u.trim():u)),o.number&&(r=n.map(js)));let a,l=s[a=zs(t)]||s[a=zs(Ut(t))];!l&&i&&(l=s[a=zs(Jt(t))]),l&&_t(l,e,6,r);const c=s[a+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,_t(c,e,6,r)}}function su(e,t,n=!1){const s=t.emitsCache,r=s.get(e);if(r!==void 0)return r;const i=e.emits;let o={};return i?(X(i)?i.forEach(a=>o[a]=null):ht(o,i),Ae(e)&&s.set(e,o),o):(Ae(e)&&s.set(e,null),null)}function ws(e,t){return!e||!es(t)?!1:(t=t.slice(2).replace(/Once$/,""),he(e,t[0].toLowerCase()+t.slice(1))||he(e,Jt(t))||he(e,t))}function Ep(){}function ro(e){const{type:t,vnode:n,proxy:s,withProxy:r,propsOptions:[i],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:p,data:g,setupState:w,ctx:E,inheritAttrs:m}=e,R=ms(e);let S,V;try{if(n.shapeFlag&4){const O=r||s,A=O;S=Et(c.call(A,O,u,p,w,g,E)),V=a}else{const O=t;S=Et(O.length>1?O(p,{attrs:a,slots:o,emit:l}):O(p,null)),V=t.props?a:ru(a)}}catch(O){Un.length=0,hs(O,e,1),S=Me(Ke)}let K=S;if(V&&m!==!1){const O=Object.keys(V),{shapeFlag:A}=K;O.length&&A&7&&(i&&O.some(Bs)&&(V=iu(V,i)),K=Gt(K,V,!1,!0))}return n.dirs&&(K=Gt(K,null,!1,!0),K.dirs=K.dirs?K.dirs.concat(n.dirs):n.dirs),n.transition&&Nn(K,n.transition),S=K,ms(R),S}const ru=e=>{let t;for(const n in e)(n==="class"||n==="style"||es(n))&&((t||(t={}))[n]=e[n]);return t},iu=(e,t)=>{const n={};for(const s in e)(!Bs(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function ou(e,t,n){const{props:s,children:r,component:i}=e,{props:o,children:a,patchFlag:l}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return s?io(s,o,c):!!o;if(l&8){const u=t.dynamicProps;for(let p=0;pe.__isSuspense;function au(e,t){t&&t.pendingBranch?X(e)?t.effects.push(...e):t.effects.push(e):Ca(e)}const Be=Symbol.for("v-fgt"),vs=Symbol.for("v-txt"),Ke=Symbol.for("v-cmt"),gr=Symbol.for("v-stc"),Un=[];let st=null;function F(e=!1){Un.push(st=e?null:[])}function uu(){Un.pop(),st=Un[Un.length-1]||null}let jn=1;function lo(e,t=!1){jn+=e,e<0&&st&&t&&(st.hasOnce=!0)}function ao(e){return e.dynamicChildren=jn>0?st||pt:null,uu(),jn>0&&st&&st.push(e),e}function j(e,t,n,s,r,i){return ao(x(e,t,n,s,r,i,!0))}function St(e,t,n,s,r){return ao(Me(e,t,n,s,r,!0))}function _s(e){return e?e.__v_isVNode===!0:!1}function on(e,t){return e.type===t.type&&e.key===t.key}const uo=({key:e})=>e!=null?e:null,ks=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Ce(e)||je(e)||me(e)?{i:at,r:e,k:t,f:!!n}:e:null);function x(e,t=null,n=null,s=0,r=null,i=e===Be?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&uo(t),ref:t&&ks(t),scopeId:Di,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:at};return a?(mr(l,n),i&128&&e.normalize(l)):n&&(l.shapeFlag|=Ce(n)?8:16),jn>0&&!o&&st&&(l.patchFlag>0||i&6)&&l.patchFlag!==32&&st.push(l),l}const Me=cu;function cu(e,t=null,n=null,s=0,r=null,i=!1){if((!e||e===Na)&&(e=Ke),_s(e)){const a=Gt(e,t,!0);return n&&mr(a,n),jn>0&&!i&&st&&(a.shapeFlag&6?st[st.indexOf(e)]=a:st.push(a)),a.patchFlag=-2,a}if(ku(e)&&(e=e.__vccOpts),t){t=fu(t);let{class:a,style:l}=t;a&&!Ce(a)&&(t.class=ye(a)),Ae(l)&&(sr(l)&&!X(l)&&(l=ht({},l)),t.style=Vs(l))}const o=Ce(e)?1:oo(e)?128:Fi(e)?64:Ae(e)?4:me(e)?2:0;return x(e,t,n,s,r,o,i,!0)}function fu(e){return e?sr(e)||Yi(e)?ht({},e):e:null}function Gt(e,t,n=!1,s=!1){const{props:r,ref:i,patchFlag:o,children:a,transition:l}=e,c=t?du(r||{},t):r,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&uo(c),ref:t&&t.ref?n&&i?X(i)?i.concat(ks(t)):[i,ks(t)]:ks(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Be?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Gt(e.ssContent),ssFallback:e.ssFallback&&Gt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&s&&Nn(u,l.clone(u)),u}function Ts(e=" ",t=0){return Me(vs,null,e,t)}function Ve(e="",t=!1){return t?(F(),St(Ke,null,e)):Me(Ke,null,e)}function Et(e){return e==null||typeof e=="boolean"?Me(Ke):X(e)?Me(Be,null,e.slice()):_s(e)?Kt(e):Me(vs,null,String(e))}function Kt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Gt(e)}function mr(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(X(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),mr(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!Yi(t)?t._ctx=at:r===3&&at&&(at.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else me(t)?(t={default:t,_ctx:at},n=32):(t=String(t),s&64?(n=16,t=[Ts(t)]):n=8);e.children=t,e.shapeFlag|=n}function du(...e){const t={};for(let n=0;nYt||at;let Ss,br;{const e=rs(),t=(n,s)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),i=>{r.length>1?r.forEach(o=>o(i)):r[0](i)}};Ss=t("__VUE_INSTANCE_SETTERS__",n=>Yt=n),br=t("__VUE_SSR_SETTERS__",n=>Vn=n)}const xr=e=>{const t=Yt;return Ss(e),e.scope.on(),()=>{e.scope.off(),Ss(t)}},fo=()=>{Yt&&Yt.scope.off(),Ss(null)};function po(e){return e.vnode.shapeFlag&4}let Vn=!1;function mu(e,t=!1,n=!1){t&&br(t);const{props:s,children:r}=e.vnode,i=po(e);Ua(e,s,i,t),Wa(e,r,n||t);const o=i?bu(e,t):void 0;return t&&br(!1),o}function bu(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Fa);const{setup:s}=n;if(s){It();const r=e.setupContext=s.length>1?yu(e):null,i=xr(e),o=mn(s,e,0,[e.props,r]),a=ni(o);if(Mt(),i(),(a||e.sp)&&!Bn(e)&&$a(e),a){if(o.then(fo,fo),t)return o.then(l=>{ho(e,l)}).catch(l=>{hs(l,e,0)});e.asyncDep=o}else ho(e,o)}else go(e)}function ho(e,t,n){me(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ae(t)&&(e.setupState=Ci(t)),go(e)}function go(e,t,n){const s=e.type;e.render||(e.render=s.render||Qt)}const xu={get(e,t){return Ue(e,"get",""),e[t]}};function yu(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,xu),slots:e.slots,emit:e.emit,expose:t}}function Es(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Ci(ha(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in zn)return zn[n](e)},has(t,n){return n in t||n in zn}})):e.proxy}const wu=/(?:^|[-_])(\w)/g,vu=e=>e.replace(wu,t=>t.toUpperCase()).replace(/[-_]/g,"");function _u(e,t=!0){return me(e)?e.displayName||e.name:e.name||t&&e.__name}function mo(e,t,n=!1){let s=_u(t);if(!s&&t.__file){const r=t.__file.match(/([^/\\]+)\.\w+$/);r&&(s=r[1])}if(!s&&e&&e.parent){const r=i=>{for(const o in i)if(i[o]===t)return o};s=r(e.components||e.parent.type.components)||r(e.appContext.components)}return s?vu(s):n?"App":"Anonymous"}function ku(e){return me(e)&&"__vccOpts"in e}const Re=(e,t)=>wa(e,t,Vn);function Tu(e,t,n){const s=arguments.length;return s===2?Ae(t)&&!X(t)?_s(t)?Me(e,null,[t]):Me(e,t):Me(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&_s(n)&&(n=[n]),Me(e,t,n))}const Su="3.5.18";let yr;const bo=typeof window!="undefined"&&window.trustedTypes;if(bo)try{yr=bo.createPolicy("vue",{createHTML:e=>e})}catch{}const xo=yr?e=>yr.createHTML(e):e=>e,Eu="http://www.w3.org/2000/svg",Au="http://www.w3.org/1998/Math/MathML",Dt=typeof document!="undefined"?document:null,yo=Dt&&Dt.createElement("template"),Ru={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t==="svg"?Dt.createElementNS(Eu,e):t==="mathml"?Dt.createElementNS(Au,e):n?Dt.createElement(e,{is:n}):Dt.createElement(e);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>Dt.createTextNode(e),createComment:e=>Dt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Dt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,i){const o=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===i||!(r=r.nextSibling)););else{yo.innerHTML=xo(s==="svg"?`${e}`:s==="mathml"?`${e}`:e);const a=yo.content;if(s==="svg"||s==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Zt="transition",qn="animation",Wn=Symbol("_vtc"),wo={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Cu=ht({},Bi,wo),Pu=(e=>(e.displayName="Transition",e.props=Cu,e))((e,{slots:t})=>Tu(Oa,Iu(e),t)),ln=(e,t=[])=>{X(e)?e.forEach(n=>n(...t)):e&&e(...t)},vo=e=>e?X(e)?e.some(t=>t.length>1):e.length>1:!1;function Iu(e){const t={};for(const $ in e)$ in wo||(t[$]=e[$]);if(e.css===!1)return t;const{name:n="v",type:s,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=i,appearActiveClass:c=o,appearToClass:u=a,leaveFromClass:p=`${n}-leave-from`,leaveActiveClass:g=`${n}-leave-active`,leaveToClass:w=`${n}-leave-to`}=e,E=Mu(r),m=E&&E[0],R=E&&E[1],{onBeforeEnter:S,onEnter:V,onEnterCancelled:K,onLeave:O,onLeaveCancelled:A,onBeforeAppear:C=S,onAppear:J=V,onAppearCancelled:te=K}=t,W=($,Y,G,z)=>{$._enterCancelled=z,an($,Y?u:a),an($,Y?c:o),G&&G()},ne=($,Y)=>{$._isLeaving=!1,an($,p),an($,w),an($,g),Y&&Y()},xe=$=>(Y,G)=>{const z=$?J:V,ue=()=>W(Y,$,G);ln(z,[Y,ue]),_o(()=>{an(Y,$?l:i),Nt(Y,$?u:a),vo(z)||ko(Y,s,m,ue)})};return ht(t,{onBeforeEnter($){ln(S,[$]),Nt($,i),Nt($,o)},onBeforeAppear($){ln(C,[$]),Nt($,l),Nt($,c)},onEnter:xe(!1),onAppear:xe(!0),onLeave($,Y){$._isLeaving=!0;const G=()=>ne($,Y);Nt($,p),$._enterCancelled?(Nt($,g),Eo()):(Eo(),Nt($,g)),_o(()=>{$._isLeaving&&(an($,p),Nt($,w),vo(O)||ko($,s,R,G))}),ln(O,[$,G])},onEnterCancelled($){W($,!1,void 0,!0),ln(K,[$])},onAppearCancelled($){W($,!0,void 0,!0),ln(te,[$])},onLeaveCancelled($){ne($),ln(A,[$])}})}function Mu(e){if(e==null)return null;if(Ae(e))return[wr(e.enter),wr(e.leave)];{const t=wr(e);return[t,t]}}function wr(e){return zl(e)}function Nt(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Wn]||(e[Wn]=new Set)).add(t)}function an(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[Wn];n&&(n.delete(t),n.size||(e[Wn]=void 0))}function _o(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Lu=0;function ko(e,t,n,s){const r=e._endId=++Lu,i=()=>{r===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:o,timeout:a,propCount:l}=Ou(e,t);if(!o)return s();const c=o+"end";let u=0;const p=()=>{e.removeEventListener(c,g),i()},g=w=>{w.target===e&&++u>=l&&p()};setTimeout(()=>{u(n[E]||"").split(", "),r=s(`${Zt}Delay`),i=s(`${Zt}Duration`),o=To(r,i),a=s(`${qn}Delay`),l=s(`${qn}Duration`),c=To(a,l);let u=null,p=0,g=0;t===Zt?o>0&&(u=Zt,p=o,g=i.length):t===qn?c>0&&(u=qn,p=c,g=l.length):(p=Math.max(o,c),u=p>0?o>c?Zt:qn:null,g=u?u===Zt?i.length:l.length:0);const w=u===Zt&&/\b(transform|all)(,|$)/.test(s(`${Zt}Property`).toString());return{type:u,timeout:p,propCount:g,hasTransform:w}}function To(e,t){for(;e.lengthSo(n)+So(e[s])))}function So(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Eo(){return document.body.offsetHeight}function $u(e,t,n){const s=e[Wn];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Ao=Symbol("_vod"),Du=Symbol("_vsh"),Nu=Symbol(""),Fu=/(^|;)\s*display\s*:/;function Bu(e,t,n){const s=e.style,r=Ce(n);let i=!1;if(n&&!r){if(t)if(Ce(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&As(s,a,"")}else for(const o in t)n[o]==null&&As(s,o,"");for(const o in n)o==="display"&&(i=!0),As(s,o,n[o])}else if(r){if(t!==n){const o=s[Nu];o&&(n+=";"+o),s.cssText=n,i=Fu.test(n)}}else t&&e.removeAttribute("style");Ao in e&&(e[Ao]=i?s.display:"",e[Du]&&(s.display="none"))}const Ro=/\s*!important$/;function As(e,t,n){if(X(n))n.forEach(s=>As(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Hu(e,t);Ro.test(n)?e.setProperty(Jt(s),n.replace(Ro,""),"important"):e[s]=n}}const Co=["Webkit","Moz","ms"],vr={};function Hu(e,t){const n=vr[t];if(n)return n;let s=Ut(t);if(s!=="filter"&&s in e)return vr[t]=s;s=ii(s);for(let r=0;r_r||(Vu.then(()=>_r=0),_r=Date.now());function Wu(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;_t(Gu(s,n.value),t,5,[s])};return n.value=e,n.attached=qu(),n}function Gu(e,t){if(X(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const $o=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ku=(e,t,n,s,r,i)=>{const o=r==="svg";t==="class"?$u(e,s,o):t==="style"?Bu(e,n,s):es(t)?Bs(t)||Uu(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Yu(e,t,s,o))?(Mo(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Io(e,t,s,o,i,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Ce(s))?Mo(e,Ut(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Io(e,t,s,o))};function Yu(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&$o(t)&&me(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return $o(t)&&Ce(n)?!1:t in e}const Do=e=>{const t=e.props["onUpdate:modelValue"]||!1;return X(t)?n=>ss(t,n):t};function Zu(e){e.target.composing=!0}function No(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const kr=Symbol("_assign"),Xu={created(e,{modifiers:{lazy:t,trim:n,number:s}},r){e[kr]=Do(r);const i=s||r.props&&r.props.type==="number";wn(e,t?"change":"input",o=>{if(o.target.composing)return;let a=e.value;n&&(a=a.trim()),i&&(a=js(a)),e[kr](a)}),n&&wn(e,"change",()=>{e.value=e.value.trim()}),t||(wn(e,"compositionstart",Zu),wn(e,"compositionend",No),wn(e,"change",No))},mounted(e,{value:t}){e.value=t==null?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:r,number:i}},o){if(e[kr]=Do(o),e.composing)return;const a=(i||e.type==="number")&&!/^0\d/.test(e.value)?js(e.value):e.value,l=t==null?"":t;a!==l&&(document.activeElement===e&&e.type!=="range"&&(s&&t===n||r&&e.value.trim()===l)||(e.value=l))}},Qu=["ctrl","shift","alt","meta"],Ju={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Qu.some(n=>e[`${n}Key`]&&!t.includes(n))},ct=(e,t)=>{const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=(r,...i)=>{for(let o=0;o{const t=tc().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=rc(s);if(!r)return;const i=t._component;!me(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=n(r,!1,sc(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},t};function sc(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function rc(e){return Ce(e)?document.querySelector(e):e}const ic=["aria-pressed"],oc={key:0,viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":"true"},lc={key:1,viewBox:"0 0 24 24",width:"18",height:"18","aria-hidden":"true",fill:"none"},ac={__name:"ChatbotToggler",props:{isOpen:{type:Boolean,required:!0}},emits:["toggle"],setup(e){return(t,n)=>(F(),j("button",{class:"fixed bottom-5 right-5 z-9999 grid h-12 w-12 appearance-none place-items-center rounded-full border border-white/20 bg-gradient-to-br from-brand-500 to-brand-600 text-white shadow-[0_20px_36px_-20px_rgba(109,79,194,0.85)] transition-all duration-250 hover:-translate-y-0.5 hover:from-brand-600 hover:to-violet-700 hover:shadow-[0_22px_40px_-22px_rgba(109,79,194,1)] focus:outline-none max-[600px]:bottom-3 max-[600px]:right-3 max-[600px]:h-13 max-[600px]:w-13",style:{"border-radius":"9999px"},"aria-pressed":e.isOpen?"true":"false",onClick:n[0]||(n[0]=s=>t.$emit("toggle"))},[e.isOpen?(F(),j("svg",lc,n[2]||(n[2]=[x("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},null,-1)]))):(F(),j("svg",oc,n[1]||(n[1]=[x("path",{d:"M4 4h16a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H8l-4 4v-4H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z",fill:"currentColor",stroke:"currentColor","stroke-width":"2","stroke-linecap":"miter","stroke-linejoin":"miter"},null,-1)])))],8,ic))}},uc={class:"chat-header relative flex min-h-14 items-center justify-between px-4 pb-2.5 pt-3 text-white sm:px-5"},cc={class:"flex min-w-0 flex-1 items-center gap-2 sm:gap-2.5"},fc={xmlns:"http://www.w3.org/2000/svg",width:"35",height:"35",viewBox:"0 0 1024 1024",class:"h-8 w-8 shrink-0 rounded-full bg-white p-1.5 shadow-md motion-safe:animate-soft-float",style:{fill:"#6d4fc2"}},dc={class:"ml-2 flex items-center gap-1.5"},pc=["title"],hc=["title","aria-label"],gc={key:0,viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},mc={key:1,viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},bc=["title","aria-label"],xc={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},yc={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},wc={key:2,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},vc={__name:"ChatHeader",props:{windowMode:{type:String,required:!0},autoReadEnabled:{type:Boolean,required:!0},activeTtsProvider:{type:String,required:!0}},emits:["close","cycleResize","toggleAutoRead"],setup(e){const t=e,n={default:"Compact",half:"Half Screen",full:"Full Screen"},s=Re(()=>n[t.windowMode]||"Compact"),r=Re(()=>t.windowMode==="default"?"Half Screen":t.windowMode==="half"?"Full Screen":"Compact"),i=Re(()=>t.activeTtsProvider==="polly"?"TTS: Polly":t.activeTtsProvider==="browser"?"TTS: Browser":"TTS: Off"),o=Re(()=>t.activeTtsProvider==="polly"?"bg-emerald-500/45":t.activeTtsProvider==="browser"?"bg-amber-500/45":"bg-slate-500/35");return(a,l)=>(F(),j("div",uc,[x("div",cc,[(F(),j("svg",fc,l[3]||(l[3]=[x("path",{d:"M738.3 287.6H285.7c-59 0-106.8 47.8-106.8 106.8v303.1c0 59 47.8 106.8 106.8 106.8h81.5v111.1c0 .7.8 1.1 1.4.7l166.9-110.6 41.8-.8h117.4l43.6-.4c59 0 106.8-47.8 106.8-106.8V394.5c0-59-47.8-106.9-106.8-106.9zM351.7 448.2c0-29.5 23.9-53.5 53.5-53.5s53.5 23.9 53.5 53.5-23.9 53.5-53.5 53.5-53.5-23.9-53.5-53.5zm157.9 267.1c-67.8 0-123.8-47.5-132.3-109h264.6c-8.6 61.5-64.5 109-132.3 109zm110-213.7c-29.5 0-53.5-23.9-53.5-53.5s23.9-53.5 53.5-53.5 53.5 23.9 53.5 53.5-23.9 53.5-53.5 53.5zM867.2 644.5V453.1h26.5c19.4 0 35.1 15.7 35.1 35.1v121.1c0 19.4-15.7 35.1-35.1 35.1h-26.5zM95.2 609.4V488.2c0-19.4 15.7-35.1 35.1-35.1h26.5v191.3h-26.5c-19.4 0-35.1-15.7-35.1-35.1zM561.5 149.6c0 23.4-15.6 43.3-36.9 49.7v44.9h-30v-44.9c-21.4-6.5-36.9-26.3-36.9-49.7 0-28.6 23.3-51.9 51.9-51.9s51.9 23.3 51.9 51.9z"},null,-1)]))),l[4]||(l[4]=x("h2",{class:"truncate text-xs font-semibold tracking-[0.01em] sm:text-base text-white/95"},"ChangAI from ERPGulf",-1))]),x("div",dc,[x("span",{class:ye(["hidden rounded-full border border-white/25 px-2 py-1 text-[10px] font-semibold uppercase tracking-wide text-white/95 shadow-sm backdrop-blur-sm sm:inline",o.value]),title:`TTS provider: ${i.value}`},Qe(i.value),11,pc),x("button",{class:ye(["h-8 min-w-8 appearance-none items-center justify-center rounded-md border border-white/20 px-2 text-xs font-semibold text-white/90 transition-all duration-200 focus:outline-none sm:flex",e.autoReadEnabled?"bg-white/24 shadow-sm":"hover:bg-white/15"]),style:{"border-radius":"0.375rem"},title:e.autoReadEnabled?"Auto speech on":"Auto speech off","aria-label":e.autoReadEnabled?"Turn off auto speech":"Turn on auto speech",onClick:l[0]||(l[0]=c=>a.$emit("toggleAutoRead"))},[e.autoReadEnabled?(F(),j("svg",gc,l[5]||(l[5]=[x("path",{d:"M11 5L6 9H3v6h3l5 4V5z"},null,-1),x("path",{d:"M15 9a4 4 0 0 1 0 6"},null,-1),x("path",{d:"M18 7a7 7 0 0 1 0 10"},null,-1)]))):(F(),j("svg",mc,l[6]||(l[6]=[x("path",{d:"M11 5L6 9H3v6h3l5 4V5z"},null,-1),x("path",{d:"M22 9l-6 6"},null,-1),x("path",{d:"M16 9l6 6"},null,-1)])))],10,hc),x("button",{class:ye(["flex h-8 min-w-8 appearance-none items-center justify-center rounded-md border border-white/20 px-2 text-xs font-semibold text-white/90 transition-all duration-200 focus:outline-none","bg-white/20 shadow-sm hover:bg-white/25"]),style:{"border-radius":"0.375rem"},title:`Resize mode: ${s.value} (click to ${r.value})`,"aria-label":`Resize mode ${s.value}. Click to switch to ${r.value}`,onClick:l[1]||(l[1]=c=>a.$emit("cycleResize"))},[e.windowMode==="default"?(F(),j("svg",xc,l[7]||(l[7]=[x("rect",{x:"7",y:"8",width:"10",height:"8",rx:"2"},null,-1)]))):e.windowMode==="half"?(F(),j("svg",yc,l[8]||(l[8]=[x("rect",{x:"4",y:"5",width:"16",height:"14",rx:"2"},null,-1),x("path",{d:"M12 5v14"},null,-1)]))):(F(),j("svg",wc,l[9]||(l[9]=[x("rect",{x:"4",y:"5",width:"16",height:"14",rx:"2"},null,-1),x("path",{d:"M8 8H6v2M16 8h2v2M8 16H6v-2M16 16h2v-2"},null,-1)])))],8,bc),x("button",{class:"grid h-8 w-8 shrink-0 appearance-none place-items-center rounded-full border border-white/20 text-white transition-all duration-200 hover:scale-105 hover:bg-white/20 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/70",style:{"border-radius":"9999px"},"aria-label":"Close chatbot",onClick:l[2]||(l[2]=c=>a.$emit("close"))},l[10]||(l[10]=[x("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",width:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[x("path",{d:"M6 9l6 6 6-6"})],-1)]))])]))}},_c={class:"flex gap-1.5 border-b border-slate-200/80 px-2.5 pb-2.5 pt-1"},kc=["onClick"],Tc={class:"inline-flex items-center gap-1.5"},Sc={__name:"TabBar",props:{modelValue:{type:String,required:!0},debugEnabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e){const t=e,n=Re(()=>{const s=[{id:"chat",label:"Chats"},{id:"debug",label:"Debug"},{id:"support",label:"Support"},{id:"settings",label:"Settings"}];return t.debugEnabled?s:s.filter(r=>r.id!=="debug")});return(s,r)=>(F(),j("div",_c,[(F(!0),j(Be,null,ys(n.value,i=>(F(),j("button",{key:i.id,class:ye(["group min-w-0 flex-1 h-9 appearance-none rounded-lg border border-transparent bg-transparent px-2 text-xs font-semibold transition-all duration-200 focus:outline-none",e.modelValue===i.id?"border-white/30 bg-linear-to-r from-violet-300/36 via-indigo-300/30 to-sky-300/28 text-white shadow-[0_4px_10px_rgba(20,24,40,0.22)]":"text-white/80 hover:border-white/25 hover:bg-white/12 hover:text-white"]),onClick:o=>s.$emit("update:modelValue",i.id)},[x("span",Tc,[x("span",{class:ye(["h-1.5 w-1.5 rounded-full transition-colors duration-200",e.modelValue===i.id?"bg-white":"bg-white/40 group-hover:bg-white/70"])},null,2),Ts(" "+Qe(i.label),1)])],10,kc))),128))]))}},Ec=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},Ac={},Rc={xmlns:"http://www.w3.org/2000/svg",width:"50",height:"50",viewBox:"0 0 1024 1024",class:"h-7.5 w-7.5 shrink-0 self-end rounded-full bg-gradient-to-br from-brand-500 to-brand-600 p-1.5 fill-white shadow-[0_10px_18px_-12px_rgba(109,79,194,0.85)]"};function Cc(e,t){return F(),j("svg",Rc,t[0]||(t[0]=[x("path",{d:"M738.3 287.6H285.7c-59 0-106.8 47.8-106.8 106.8v303.1c0 59 47.8 106.8 106.8 106.8h81.5v111.1c0 .7.8 1.1 1.4.7l166.9-110.6 41.8-.8h117.4l43.6-.4c59 0 106.8-47.8 106.8-106.8V394.5c0-59-47.8-106.9-106.8-106.9zM351.7 448.2c0-29.5 23.9-53.5 53.5-53.5s53.5 23.9 53.5 53.5-23.9 53.5-53.5 53.5-53.5-23.9-53.5-53.5zm157.9 267.1c-67.8 0-123.8-47.5-132.3-109h264.6c-8.6 61.5-64.5 109-132.3 109zm110-213.7c-29.5 0-53.5-23.9-53.5-53.5s23.9-53.5 53.5-53.5 53.5 23.9 53.5 53.5-23.9 53.5-53.5 53.5zM867.2 644.5V453.1h26.5c19.4 0 35.1 15.7 35.1 35.1v121.1c0 19.4-15.7 35.1-35.1 35.1h-26.5zM95.2 609.4V488.2c0-19.4 15.7-35.1 35.1-35.1h26.5v191.3h-26.5c-19.4 0-35.1-15.7-35.1-35.1zM561.5 149.6c0 23.4-15.6 43.3-36.9 49.7v44.9h-30v-44.9c-21.4-6.5-36.9-26.3-36.9-49.7 0-28.6 23.3-51.9 51.9-51.9s51.9 23.3 51.9 51.9z"},null,-1)]))}const Bo=Ec(Ac,[["render",Cc]]),Rs={PIPELINE:"changai.changai.api.v2.text2sql_pipeline_v2.run_text2sql_pipeline",SUPPORT:"changai.changai.api.v2.text2sql_pipeline_v2.support_bot",SETTINGS:"changai.changai.api.v2.text2sql_pipeline_v2.get_frontend_settings",TTS:"changai.changai.api.v2.text2sql_pipeline_v2.synthesize_tts"};function Tr(e,t={},n="actual"){return n==="test"?Promise.resolve({Bot:`[TEST MODE] ${JSON.stringify(t)}`}):!window.frappe||!window.frappe.call?Promise.reject(new Error("Frappe API is unavailable in actual mode.")):new Promise((s,r)=>{window.frappe.call({method:e,args:t,callback(i){s(i.message)},error(i){r(i)}})})}function Pc(e,t,n="actual",s=null,r){if(n==="test")return{promise:Promise.resolve({Bot:`[TEST MODE] ${JSON.stringify({user_question:e,chat_id:t,request_id:s,sendNonErptoAI:r})}`}),cancel:()=>!1};if(!window.frappe||!window.frappe.call)return{promise:Promise.reject(new Error("Frappe API is unavailable in actual mode.")),cancel:()=>!1};let i=null,o=!1;return{promise:new Promise((c,u)=>{i=window.frappe.call({method:Rs.PIPELINE,args:{user_question:e,chat_id:t,request_id:s,sendNonErptoAI:r},callback(p){o=!0,c(p.message)},error(p){o=!0,u(p)}})}),cancel:()=>o||!i||typeof i.abort!="function"?!1:(i.abort(),o=!0,!0)}}function Ic(e,t="actual"){return Tr(Rs.SUPPORT,{message:e},t)}function Mc(e="actual"){return Tr(Rs.SETTINGS,{},e)}function Lc(e,t="Zayd",n="actual"){return Tr(Rs.TTS,{text:e,voice_id:t},n)}function Sr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var un=Sr();function Ho(e){un=e}var cn={exec:()=>null};function ie(e,t=""){let n=typeof e=="string"?e:e.source,s={replace:(r,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(qe.caret,"$1"),n=n.replace(r,o),s},getRegex:()=>new RegExp(n,t)};return s}var Oc=((e="")=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},$c=/^(?:[ \t]*(?:\n|$))+/,Dc=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Nc=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Gn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Fc=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Er=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,zo=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Uo=ie(zo).replace(/bull/g,Er).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Bc=ie(zo).replace(/bull/g,Er).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ar=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Hc=/^[^\n]+/,Rr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,zc=ie(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Rr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Uc=ie(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Er).getRegex(),Cs="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Cr=/|$))/,jc=ie("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Cr).replace("tag",Cs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),jo=ie(Ar).replace("hr",Gn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Cs).getRegex(),Vc=ie(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",jo).getRegex(),Pr={blockquote:Vc,code:Dc,def:zc,fences:Nc,heading:Fc,hr:Gn,html:jc,lheading:Uo,list:Uc,newline:$c,paragraph:jo,table:cn,text:Hc},Vo=ie("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Gn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Cs).getRegex(),qc={...Pr,lheading:Bc,table:Vo,paragraph:ie(Ar).replace("hr",Gn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Vo).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Cs).getRegex()},Wc={...Pr,html:ie(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Cr).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:cn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ie(Ar).replace("hr",Gn).replace("heading",` *#{1,6} *[^ +`],...Sa(n))}),t}function Sa({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",s=e.component?e.component.parent==null:!1,r=` at <${mo(e.component,e.type,s)}`,i=">"+n;return e.props?[r,...Ea(e.props),i]:[r+i]}function Ea(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(s=>{t.push(...Pi(s,e[s]))}),n.length>3&&t.push(" ..."),t}function Pi(e,t,n){return Ce(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:je(t)?(t=Pi(e,oe(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):be(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=oe(t),n?t:[`${e}=`,t])}function mn(e,t,n,s){try{return s?e(...s):e()}catch(r){hs(r,t,n)}}function _t(e,t,n,s){if(be(e)){const r=mn(e,t,n,s);return r&&ni(r)&&r.catch(i=>{hs(i,t,n)}),r}if(Q(e)){const r=[];for(let i=0;i>>1,r=Ge[s],i=Dn(r);i=Dn(n)?Ge.push(e):Ge.splice(Ra(t),0,e),e.flags|=1,Mi()}}function Mi(){gs||(gs=Ii.then($i))}function Ca(e){Q(e)?bn.push(...e):qt&&e.id===-1?qt.splice(xn+1,0,e):e.flags&1||(bn.push(e),e.flags|=1),Mi()}function Li(e,t,n=kt+1){for(;nDn(n)-Dn(s));if(bn.length=0,qt){qt.push(...t);return}for(qt=t,xn=0;xne.id==null?e.flags&2?-1:1/0:e.id;function $i(e){try{for(kt=0;kt{s._d&&lo(-1);const i=ms(t);let o;try{o=e(...r)}finally{ms(i),s._d&&lo(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function Pa(e,t){if(at===null)return e;const n=Es(at),s=e.dirs||(e.dirs=[]);for(let r=0;re.__isTeleport,Wt=Symbol("_leaveCb"),bs=Symbol("_enterCb");function Ma(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Hn(()=>{e.isMounted=!0}),xs(()=>{e.isUnmounting=!0}),e}const ut=[Function,Array],Bi={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ut,onEnter:ut,onAfterEnter:ut,onEnterCancelled:ut,onBeforeLeave:ut,onLeave:ut,onAfterLeave:ut,onLeaveCancelled:ut,onBeforeAppear:ut,onAppear:ut,onAfterAppear:ut,onAppearCancelled:ut},Hi=e=>{const t=e.subTree;return t.component?Hi(t.component):t},La={name:"BaseTransition",props:Bi,setup(e,{slots:t}){const n=co(),s=Ma();return()=>{const r=t.default&&Vi(t.default(),!0);if(!r||!r.length)return;const i=zi(r),o=oe(e),{mode:a}=o;if(s.isLeaving)return lr(i);const l=ji(i);if(!l)return lr(i);let c=or(l,o,s,n,p=>c=p);l.type!==Ke&&Nn(l,c);let u=n.subTree&&ji(n.subTree);if(u&&u.type!==Ke&&!on(l,u)&&Hi(n).type!==Ke){let p=or(u,o,s,n);if(Nn(u,p),a==="out-in"&&l.type!==Ke)return s.isLeaving=!0,p.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete p.afterLeave,u=void 0},lr(i);a==="in-out"&&l.type!==Ke?p.delayLeave=(g,w,E)=>{const m=Ui(s,u);m[String(u.key)]=u,g[Wt]=()=>{w(),g[Wt]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{E(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function zi(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Ke){t=n;break}}return t}const Oa=La;function Ui(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function or(e,t,n,s,r){const{appear:i,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:p,onBeforeLeave:g,onLeave:w,onAfterLeave:E,onLeaveCancelled:m,onBeforeAppear:A,onAppear:T,onAfterAppear:W,onAppearCancelled:K}=t,O=String(e.key),z=Ui(n,e),P=(j,te)=>{j&&_t(j,s,9,te)},I=(j,te)=>{const ue=te[1];P(j,te),Q(j)?j.every($=>$.length<=1)&&ue():j.length<=1&&ue()},re={mode:o,persisted:a,beforeEnter(j){let te=l;if(!n.isMounted)if(i)te=A||l;else return;j[Wt]&&j[Wt](!0);const ue=z[O];ue&&on(e,ue)&&ue.el[Wt]&&ue.el[Wt](),P(te,[j])},enter(j){let te=c,ue=u,$=p;if(!n.isMounted)if(i)te=T||c,ue=W||u,$=K||p;else return;let Z=!1;const Y=j[bs]=B=>{Z||(Z=!0,B?P($,[j]):P(ue,[j]),re.delayedLeave&&re.delayedLeave(),j[bs]=void 0)};te?I(te,[j,Y]):Y()},leave(j,te){const ue=String(e.key);if(j[bs]&&j[bs](!0),n.isUnmounting)return te();P(g,[j]);let $=!1;const Z=j[Wt]=Y=>{$||($=!0,te(),Y?P(m,[j]):P(E,[j]),j[Wt]=void 0,z[ue]===e&&delete z[ue])};z[ue]=e,w?I(w,[j,Z]):Z()},clone(j){const te=or(j,t,n,s,r);return r&&r(te),te}};return re}function lr(e){if(ar(e))return e=Gt(e),e.children=null,e}function ji(e){if(!ar(e))return Fi(e.type)&&e.children?zi(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&be(n.default))return n.default()}}function Nn(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Nn(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Vi(e,t=!1,n){let s=[],r=0;for(let i=0;i1)for(let i=0;iFn(E,t&&(Q(t)?t[m]:t),n,s,r));return}if(Bn(s)&&!r){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Fn(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?Es(s.component):s.el,o=r?null:i,{i:a,r:l}=e,c=t&&t.r,u=a.refs===se?a.refs={}:a.refs,p=a.setupState,g=oe(p),w=p===se?()=>!1:E=>ge(g,E);if(c!=null&&c!==l&&(Ce(c)?(u[c]=null,w(c)&&(p[c]=null)):je(c)&&(c.value=null)),be(l))mn(l,a,12,[o,u]);else{const E=Ce(l),m=je(l);if(E||m){const A=()=>{if(e.f){const T=E?w(l)?p[l]:u[l]:l.value;r?Q(T)&&ei(T,i):Q(T)?T.includes(i)||T.push(i):E?(u[l]=[i],w(l)&&(p[l]=u[l])):(l.value=[i],e.k&&(u[e.k]=l.value))}else E?(u[l]=o,w(l)&&(p[l]=o)):m&&(l.value=o,e.k&&(u[e.k]=o))};o?(A.id=-1,nt(A,n)):A()}}}rs().requestIdleCallback,rs().cancelIdleCallback;const Bn=e=>!!e.type.__asyncLoader,ar=e=>e.type.__isKeepAlive;function Da(e,t,n=Yt,s=!1){if(n){const r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...o)=>{It();const a=xr(n),l=_t(t,n,e,o);return a(),Mt(),l});return s?r.unshift(i):r.push(i),i}}const qi=e=>(t,n=Yt)=>{(!Vn||e==="sp")&&Da(e,(...s)=>t(...s),n)},Hn=qi("m"),xs=qi("bum"),Na=Symbol.for("v-ndc");function ys(e,t,n,s){let r;const i=n,o=Q(e);if(o||Ce(e)){const a=o&&gn(e);let l=!1,c=!1;a&&(l=!lt(e),c=Vt(e),e=is(e)),r=new Array(e.length);for(let u=0,p=e.length;ut(a,l,void 0,i));else{const a=Object.keys(e);r=new Array(a.length);for(let l=0,c=a.length;le?po(e)?Es(e):ur(e.parent):null,zn=ht(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ur(e.parent),$root:e=>ur(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>e.type,$forceUpdate:e=>e.f||(e.f=()=>{ir(e.update)}),$nextTick:e=>e.n||(e.n=Tt.bind(e.proxy)),$watch:e=>Qt}),cr=(e,t)=>e!==se&&!e.__isScriptSetup&&ge(e,t),Fa={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:r,props:i,accessCache:o,type:a,appContext:l}=e;let c;if(t[0]!=="$"){const w=o[t];if(w!==void 0)switch(w){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return i[t]}else{if(cr(s,t))return o[t]=1,s[t];if(r!==se&&ge(r,t))return o[t]=2,r[t];if((c=e.propsOptions[0])&&ge(c,t))return o[t]=3,i[t];if(n!==se&&ge(n,t))return o[t]=4,n[t];o[t]=0}}const u=zn[t];let p,g;if(u)return t==="$attrs"&&Ue(e.attrs,"get",""),u(e);if((p=a.__cssModules)&&(p=p[t]))return p;if(n!==se&&ge(n,t))return o[t]=4,n[t];if(g=l.config.globalProperties,ge(g,t))return g[t]},set({_:e},t,n){const{data:s,setupState:r,ctx:i}=e;return cr(r,t)?(r[t]=n,!0):s!==se&&ge(s,t)?(s[t]=n,!0):ge(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,propsOptions:i}},o){let a;return!!n[o]||e!==se&&ge(e,o)||cr(t,o)||(a=i[0])&&ge(a,o)||ge(s,o)||ge(zn,o)||ge(r.config.globalProperties,o)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ge(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Wi(){return{app:null,config:{isNativeTag:Dl,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Ba=0;function Ha(e,t){return function(s,r=null){be(s)||(s=ht({},s)),r!=null&&!Ae(r)&&(r=null);const i=Wi(),o=new WeakSet,a=[];let l=!1;const c=i.app={_uid:Ba++,_component:s,_props:r,_container:null,_context:i,_instance:null,version:Su,get config(){return i.config},set config(u){},use(u,...p){return o.has(u)||(u&&be(u.install)?(o.add(u),u.install(c,...p)):be(u)&&(o.add(u),u(c,...p))),c},mixin(u){return c},component(u,p){return p?(i.components[u]=p,c):i.components[u]},directive(u,p){return p?(i.directives[u]=p,c):i.directives[u]},mount(u,p,g){if(!l){const w=c._ceVNode||Me(s,r);return w.appContext=i,g===!0?g="svg":g===!1&&(g=void 0),e(w,u,g),l=!0,c._container=u,u.__vue_app__=c,Es(w.component)}},onUnmount(u){a.push(u)},unmount(){l&&(_t(a,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(u,p){return i.provides[u]=p,c},runWithContext(u){const p=yn;yn=c;try{return u()}finally{yn=p}}};return c}}let yn=null;function za(e,t,n=!1){const s=co();if(s||yn){let r=yn?yn._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return n&&be(t)?t.call(s&&s.proxy):t}}const Gi={},Ki=()=>Object.create(Gi),Yi=e=>Object.getPrototypeOf(e)===Gi;function Ua(e,t,n,s=!1){const r={},i=Ki();e.propsDefaults=Object.create(null),Zi(e,t,r,i);for(const o in e.propsOptions[0])o in r||(r[o]=void 0);n?e.props=s?r:pa(r):e.type.props?e.props=r:e.props=i,e.attrs=i}function ja(e,t,n,s){const{props:r,attrs:i,vnode:{patchFlag:o}}=e,a=oe(r),[l]=e.propsOptions;let c=!1;if((s||o>0)&&!(o&16)){if(o&8){const u=e.vnode.dynamicProps;for(let p=0;pe==="_"||e==="__"||e==="_ctx"||e==="$stable",pr=e=>Q(e)?e.map(Et):[Et(e)],qa=(e,t,n)=>{if(t._n)return t;const s=Ni((...r)=>pr(t(...r)),n);return s._c=!1,s},Qi=(e,t,n)=>{const s=e._ctx;for(const r in e){if(dr(r))continue;const i=e[r];if(be(i))t[r]=qa(r,i,s);else if(i!=null){const o=pr(i);t[r]=()=>o}}},Ji=(e,t)=>{const n=pr(t);e.slots.default=()=>n},eo=(e,t,n)=>{for(const s in t)(n||!dr(s))&&(e[s]=t[s])},Wa=(e,t,n)=>{const s=e.slots=Ki();if(e.vnode.shapeFlag&32){const r=t.__;r&&Us(s,"__",r,!0);const i=t._;i?(eo(s,t,n),n&&Us(s,"_",i,!0)):Qi(t,s)}else t&&Ji(e,t)},Ga=(e,t,n)=>{const{vnode:s,slots:r}=e;let i=!0,o=se;if(s.shapeFlag&32){const a=t._;a?n&&a===1?i=!1:eo(r,t,n):(i=!t.$stable,Qi(t,r)),o=t}else t&&(Ji(e,t),o={default:1});if(i)for(const a in r)!dr(a)&&o[a]==null&&delete r[a]},nt=au;function Ka(e){return Ya(e)}function Ya(e,t){const n=rs();n.__VUE__=!0;const{insert:s,remove:r,patchProp:i,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:p,nextSibling:g,setScopeId:w=Qt,insertStaticContent:E}=e,m=(f,h,b,k=null,v=null,_=null,M=void 0,C=null,R=!!h.dynamicChildren)=>{if(f===h)return;f&&!on(f,h)&&(k=le(f),pe(f,v,_,!0),f=null),h.patchFlag===-2&&(R=!1,h.dynamicChildren=null);const{type:S,ref:H,shapeFlag:L}=h;switch(S){case vs:A(f,h,b,k);break;case Ke:T(f,h,b,k);break;case gr:f==null&&W(h,b,k,M);break;case Be:$(f,h,b,k,v,_,M,C,R);break;default:L&1?z(f,h,b,k,v,_,M,C,R):L&6?Z(f,h,b,k,v,_,M,C,R):(L&64||L&128)&&S.process(f,h,b,k,v,_,M,C,R,ze)}H!=null&&v?Fn(H,f&&f.ref,_,h||f,!h):H==null&&f&&f.ref!=null&&Fn(f.ref,null,_,f,!0)},A=(f,h,b,k)=>{if(f==null)s(h.el=a(h.children),b,k);else{const v=h.el=f.el;h.children!==f.children&&c(v,h.children)}},T=(f,h,b,k)=>{f==null?s(h.el=l(h.children||""),b,k):h.el=f.el},W=(f,h,b,k)=>{[f.el,f.anchor]=E(f.children,h,b,k,f.el,f.anchor)},K=({el:f,anchor:h},b,k)=>{let v;for(;f&&f!==h;)v=g(f),s(f,b,k),f=v;s(h,b,k)},O=({el:f,anchor:h})=>{let b;for(;f&&f!==h;)b=g(f),r(f),f=b;r(h)},z=(f,h,b,k,v,_,M,C,R)=>{h.type==="svg"?M="svg":h.type==="math"&&(M="mathml"),f==null?P(h,b,k,v,_,M,C,R):j(f,h,v,_,M,C,R)},P=(f,h,b,k,v,_,M,C)=>{let R,S;const{props:H,shapeFlag:L,transition:U,dirs:G}=f;if(R=f.el=o(f.type,_,H&&H.is,H),L&8?u(R,f.children):L&16&&re(f.children,R,null,k,v,hr(f,_),M,C),G&&nn(f,null,k,"created"),I(R,f,f.scopeId,M,k),H){for(const de in H)de!=="value"&&!Cn(de)&&i(R,de,null,H[de],_,k);"value"in H&&i(R,"value",null,H.value,_),(S=H.onVnodeBeforeMount)&&At(S,k,f)}G&&nn(f,null,k,"beforeMount");const ee=Za(v,U);ee&&U.beforeEnter(R),s(R,h,b),((S=H&&H.onVnodeMounted)||ee||G)&&nt(()=>{S&&At(S,k,f),ee&&U.enter(R),G&&nn(f,null,k,"mounted")},v)},I=(f,h,b,k,v)=>{if(b&&w(f,b),k)for(let _=0;_{for(let S=R;S{const C=h.el=f.el;let{patchFlag:R,dynamicChildren:S,dirs:H}=h;R|=f.patchFlag&16;const L=f.props||se,U=h.props||se;let G;if(b&&sn(b,!1),(G=U.onVnodeBeforeUpdate)&&At(G,b,h,f),H&&nn(h,f,b,"beforeUpdate"),b&&sn(b,!0),(L.innerHTML&&U.innerHTML==null||L.textContent&&U.textContent==null)&&u(C,""),S?te(f.dynamicChildren,S,C,b,k,hr(h,v),_):M||We(f,h,C,null,b,k,hr(h,v),_,!1),R>0){if(R&16)ue(C,L,U,b,v);else if(R&2&&L.class!==U.class&&i(C,"class",null,U.class,v),R&4&&i(C,"style",L.style,U.style,v),R&8){const ee=h.dynamicProps;for(let de=0;de{G&&At(G,b,h,f),H&&nn(h,f,b,"updated")},k)},te=(f,h,b,k,v,_,M)=>{for(let C=0;C{if(h!==b){if(h!==se)for(const _ in h)!Cn(_)&&!(_ in b)&&i(f,_,h[_],null,v,k);for(const _ in b){if(Cn(_))continue;const M=b[_],C=h[_];M!==C&&_!=="value"&&i(f,_,C,M,v,k)}"value"in b&&i(f,"value",h.value,b.value,v)}},$=(f,h,b,k,v,_,M,C,R)=>{const S=h.el=f?f.el:a(""),H=h.anchor=f?f.anchor:a("");let{patchFlag:L,dynamicChildren:U,slotScopeIds:G}=h;G&&(C=C?C.concat(G):G),f==null?(s(S,b,k),s(H,b,k),re(h.children||[],b,H,v,_,M,C,R)):L>0&&L&64&&U&&f.dynamicChildren?(te(f.dynamicChildren,U,b,v,_,M,C),(h.key!=null||v&&h===v.subTree)&&to(f,h,!0)):We(f,h,b,H,v,_,M,C,R)},Z=(f,h,b,k,v,_,M,C,R)=>{h.slotScopeIds=C,f==null?h.shapeFlag&512?v.ctx.activate(h,b,k,M,R):Y(h,b,k,v,_,M,R):B(f,h,R)},Y=(f,h,b,k,v,_,M)=>{const C=f.component=gu(f,k,v);if(ar(f)&&(C.ctx.renderer=ze),mu(C,!1,M),C.asyncDep){if(v&&v.registerDep(C,ce,M),!f.el){const R=C.subTree=Me(Ke);T(null,R,h,b),f.placeholder=R.el}}else ce(C,f,h,b,v,_,M)},B=(f,h,b)=>{const k=h.component=f.component;if(ou(f,h,b))if(k.asyncDep&&!k.asyncResolved){Se(k,h,b);return}else k.next=h,k.update();else h.el=f.el,k.vnode=h},ce=(f,h,b,k,v,_,M)=>{const C=()=>{if(f.isMounted){let{next:L,bu:U,u:G,parent:ee,vnode:de}=f;{const it=no(f);if(it){L&&(L.el=de.el,Se(f,L,M)),it.asyncDep.then(()=>{f.isUnmounted||C()});return}}let ne=L,Te;sn(f,!1),L?(L.el=de.el,Se(f,L,M)):L=de,U&&ss(U),(Te=L.props&&L.props.onVnodeBeforeUpdate)&&At(Te,ee,L,de),sn(f,!0);const Oe=ro(f),rt=f.subTree;f.subTree=Oe,m(rt,Oe,p(rt.el),le(rt),f,v,_),L.el=Oe.el,ne===null&&lu(f,Oe.el),G&&nt(G,v),(Te=L.props&&L.props.onVnodeUpdated)&&nt(()=>At(Te,ee,L,de),v)}else{let L;const{el:U,props:G}=h,{bm:ee,m:de,parent:ne,root:Te,type:Oe}=f,rt=Bn(h);sn(f,!1),ee&&ss(ee),!rt&&(L=G&&G.onVnodeBeforeMount)&&At(L,ne,h),sn(f,!0);{Te.ce&&Te.ce._def.shadowRoot!==!1&&Te.ce._injectChildStyle(Oe);const it=f.subTree=ro(f);m(null,it,b,k,f,v,_),h.el=it.el}if(de&&nt(de,v),!rt&&(L=G&&G.onVnodeMounted)){const it=h;nt(()=>At(L,ne,it),v)}(h.shapeFlag&256||ne&&Bn(ne.vnode)&&ne.vnode.shapeFlag&256)&&f.a&&nt(f.a,v),f.isMounted=!0,h=b=k=null}};f.scope.on();const R=f.effect=new ci(C);f.scope.off();const S=f.update=R.run.bind(R),H=f.job=R.runIfDirty.bind(R);H.i=f,H.id=f.uid,R.scheduler=()=>ir(H),sn(f,!0),S()},Se=(f,h,b)=>{h.component=f;const k=f.vnode.props;f.vnode=h,f.next=null,ja(f,h.props,k,b),Ga(f,h.children,b),It(),Li(f),Mt()},We=(f,h,b,k,v,_,M,C,R=!1)=>{const S=f&&f.children,H=f?f.shapeFlag:0,L=h.children,{patchFlag:U,shapeFlag:G}=h;if(U>0){if(U&128){fe(S,L,b,k,v,_,M,C,R);return}else if(U&256){xt(S,L,b,k,v,_,M,C,R);return}}G&8?(H&16&&me(S,v,_),L!==S&&u(b,L)):H&16?G&16?fe(S,L,b,k,v,_,M,C,R):me(S,v,_,!0):(H&8&&u(b,""),G&16&&re(L,b,k,v,_,M,C,R))},xt=(f,h,b,k,v,_,M,C,R)=>{f=f||pt,h=h||pt;const S=f.length,H=h.length,L=Math.min(S,H);let U;for(U=0;UH?me(f,v,_,!0,!1,L):re(h,b,k,v,_,M,C,R,L)},fe=(f,h,b,k,v,_,M,C,R)=>{let S=0;const H=h.length;let L=f.length-1,U=H-1;for(;S<=L&&S<=U;){const G=f[S],ee=h[S]=R?Kt(h[S]):Et(h[S]);if(on(G,ee))m(G,ee,b,null,v,_,M,C,R);else break;S++}for(;S<=L&&S<=U;){const G=f[L],ee=h[U]=R?Kt(h[U]):Et(h[U]);if(on(G,ee))m(G,ee,b,null,v,_,M,C,R);else break;L--,U--}if(S>L){if(S<=U){const G=U+1,ee=GU)for(;S<=L;)pe(f[S],v,_,!0),S++;else{const G=S,ee=S,de=new Map;for(S=ee;S<=U;S++){const $e=h[S]=R?Kt(h[S]):Et(h[S]);$e.key!=null&&de.set($e.key,S)}let ne,Te=0;const Oe=U-ee+1;let rt=!1,it=0;const Ft=new Array(Oe);for(S=0;S=Oe){pe($e,v,_,!0);continue}let Xe;if($e.key!=null)Xe=de.get($e.key);else for(ne=ee;ne<=U;ne++)if(Ft[ne-ee]===0&&on($e,h[ne])){Xe=ne;break}Xe===void 0?pe($e,v,_,!0):(Ft[Xe-ee]=S+1,Xe>=it?it=Xe:rt=!0,m($e,h[Xe],b,null,v,_,M,C,R),Te++)}const Qn=rt?Xa(Ft):pt;for(ne=Qn.length-1,S=Oe-1;S>=0;S--){const $e=ee+S,Xe=h[$e],ot=h[$e+1],Bt=$e+1{const{el:_,type:M,transition:C,children:R,shapeFlag:S}=f;if(S&6){N(f.component.subTree,h,b,k);return}if(S&128){f.suspense.move(h,b,k);return}if(S&64){M.move(f,h,b,ze);return}if(M===Be){s(_,h,b);for(let L=0;LC.enter(_),v);else{const{leave:L,delayLeave:U,afterLeave:G}=C,ee=()=>{f.ctx.isUnmounted?r(_):s(_,h,b)},de=()=>{L(_,()=>{ee(),G&&G()})};U?U(_,ee,de):de()}else s(_,h,b)},pe=(f,h,b,k=!1,v=!1)=>{const{type:_,props:M,ref:C,children:R,dynamicChildren:S,shapeFlag:H,patchFlag:L,dirs:U,cacheIndex:G}=f;if(L===-2&&(v=!1),C!=null&&(It(),Fn(C,null,b,f,!0),Mt()),G!=null&&(h.renderCache[G]=void 0),H&256){h.ctx.deactivate(f);return}const ee=H&1&&U,de=!Bn(f);let ne;if(de&&(ne=M&&M.onVnodeBeforeUnmount)&&At(ne,h,f),H&6)ve(f.component,b,k);else{if(H&128){f.suspense.unmount(b,k);return}ee&&nn(f,null,h,"beforeUnmount"),H&64?f.type.remove(f,h,b,ze,k):S&&!S.hasOnce&&(_!==Be||L>0&&L&64)?me(S,h,b,!1,!0):(_===Be&&L&384||!v&&H&16)&&me(R,h,b),k&&he(f)}(de&&(ne=M&&M.onVnodeUnmounted)||ee)&&nt(()=>{ne&&At(ne,h,f),ee&&nn(f,null,h,"unmounted")},b)},he=f=>{const{type:h,el:b,anchor:k,transition:v}=f;if(h===Be){ke(b,k);return}if(h===gr){O(f);return}const _=()=>{r(b),v&&!v.persisted&&v.afterLeave&&v.afterLeave()};if(f.shapeFlag&1&&v&&!v.persisted){const{leave:M,delayLeave:C}=v,R=()=>M(b,_);C?C(f.el,_,R):R()}else _()},ke=(f,h)=>{let b;for(;f!==h;)b=g(f),r(f),f=b;r(h)},ve=(f,h,b)=>{const{bum:k,scope:v,job:_,subTree:M,um:C,m:R,a:S,parent:H,slots:{__:L}}=f;so(R),so(S),k&&ss(k),H&&Q(L)&&L.forEach(U=>{H.renderCache[U]=void 0}),v.stop(),_&&(_.flags|=8,pe(M,f,h,b)),C&&nt(C,h),nt(()=>{f.isUnmounted=!0},h),h&&h.pendingBranch&&!h.isUnmounted&&f.asyncDep&&!f.asyncResolved&&f.suspenseId===h.pendingId&&(h.deps--,h.deps===0&&h.resolve())},me=(f,h,b,k=!1,v=!1,_=0)=>{for(let M=_;M{if(f.shapeFlag&6)return le(f.component.subTree);if(f.shapeFlag&128)return f.suspense.next();const h=g(f.anchor||f.el),b=h&&h[Ia];return b?g(b):h};let yt=!1;const Ct=(f,h,b)=>{f==null?h._vnode&&pe(h._vnode,null,null,!0):m(h._vnode||null,f,h,null,null,null,b),h._vnode=f,yt||(yt=!0,Li(),Oi(),yt=!1)},ze={p:m,um:pe,m:N,r:he,mt:Y,mc:re,pc:We,pbc:te,n:le,o:e};return{render:Ct,hydrate:void 0,createApp:Ha(Ct)}}function hr({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function sn({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Za(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function to(e,t,n=!1){const s=e.children,r=t.children;if(Q(s)&&Q(r))for(let i=0;i>1,e[n[a]]0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,o=n[i-1];i-- >0;)n[i]=o,o=t[o];return n}function no(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:no(t)}function so(e){if(e)for(let t=0;tza(Qa);function rn(e,t,n){return eu(e,t,n)}function eu(e,t,n=se){const{immediate:s,deep:r,flush:i,once:o}=n,a=ht({},n),l=t&&s||!t&&i!=="post";let c;if(Vn){if(i==="sync"){const w=Ja();c=w.__watcherHandles||(w.__watcherHandles=[])}else if(!l){const w=()=>{};return w.stop=Qt,w.resume=Qt,w.pause=Qt,w}}const u=Yt;a.call=(w,E,m)=>_t(w,u,E,m);let p=!1;i==="post"?a.scheduler=w=>{nt(w,u&&u.suspense)}:i!=="sync"&&(p=!0,a.scheduler=(w,E)=>{E?w():ir(w)}),a.augmentJob=w=>{t&&(w.flags|=4),p&&(w.flags|=2,u&&(w.id=u.uid,w.i=u))};const g=_a(e,t,a);return Vn&&(c?c.push(g):l&&g()),g}const tu=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ut(t)}Modifiers`]||e[`${Jt(t)}Modifiers`];function nu(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||se;let r=n;const i=t.startsWith("update:"),o=i&&tu(s,t.slice(7));o&&(o.trim&&(r=n.map(u=>Ce(u)?u.trim():u)),o.number&&(r=n.map(js)));let a,l=s[a=zs(t)]||s[a=zs(Ut(t))];!l&&i&&(l=s[a=zs(Jt(t))]),l&&_t(l,e,6,r);const c=s[a+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,_t(c,e,6,r)}}function su(e,t,n=!1){const s=t.emitsCache,r=s.get(e);if(r!==void 0)return r;const i=e.emits;let o={};return i?(Q(i)?i.forEach(a=>o[a]=null):ht(o,i),Ae(e)&&s.set(e,o),o):(Ae(e)&&s.set(e,null),null)}function ws(e,t){return!e||!es(t)?!1:(t=t.slice(2).replace(/Once$/,""),ge(e,t[0].toLowerCase()+t.slice(1))||ge(e,Jt(t))||ge(e,t))}function Ep(){}function ro(e){const{type:t,vnode:n,proxy:s,withProxy:r,propsOptions:[i],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:p,data:g,setupState:w,ctx:E,inheritAttrs:m}=e,A=ms(e);let T,W;try{if(n.shapeFlag&4){const O=r||s,z=O;T=Et(c.call(z,O,u,p,w,g,E)),W=a}else{const O=t;T=Et(O.length>1?O(p,{attrs:a,slots:o,emit:l}):O(p,null)),W=t.props?a:ru(a)}}catch(O){Un.length=0,hs(O,e,1),T=Me(Ke)}let K=T;if(W&&m!==!1){const O=Object.keys(W),{shapeFlag:z}=K;O.length&&z&7&&(i&&O.some(Bs)&&(W=iu(W,i)),K=Gt(K,W,!1,!0))}return n.dirs&&(K=Gt(K,null,!1,!0),K.dirs=K.dirs?K.dirs.concat(n.dirs):n.dirs),n.transition&&Nn(K,n.transition),T=K,ms(A),T}const ru=e=>{let t;for(const n in e)(n==="class"||n==="style"||es(n))&&((t||(t={}))[n]=e[n]);return t},iu=(e,t)=>{const n={};for(const s in e)(!Bs(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function ou(e,t,n){const{props:s,children:r,component:i}=e,{props:o,children:a,patchFlag:l}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return s?io(s,o,c):!!o;if(l&8){const u=t.dynamicProps;for(let p=0;pe.__isSuspense;function au(e,t){t&&t.pendingBranch?Q(e)?t.effects.push(...e):t.effects.push(e):Ca(e)}const Be=Symbol.for("v-fgt"),vs=Symbol.for("v-txt"),Ke=Symbol.for("v-cmt"),gr=Symbol.for("v-stc"),Un=[];let st=null;function F(e=!1){Un.push(st=e?null:[])}function uu(){Un.pop(),st=Un[Un.length-1]||null}let jn=1;function lo(e,t=!1){jn+=e,e<0&&st&&t&&(st.hasOnce=!0)}function ao(e){return e.dynamicChildren=jn>0?st||pt:null,uu(),jn>0&&st&&st.push(e),e}function q(e,t,n,s,r,i){return ao(x(e,t,n,s,r,i,!0))}function St(e,t,n,s,r){return ao(Me(e,t,n,s,r,!0))}function _s(e){return e?e.__v_isVNode===!0:!1}function on(e,t){return e.type===t.type&&e.key===t.key}const uo=({key:e})=>e!=null?e:null,ks=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Ce(e)||je(e)||be(e)?{i:at,r:e,k:t,f:!!n}:e:null);function x(e,t=null,n=null,s=0,r=null,i=e===Be?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&uo(t),ref:t&&ks(t),scopeId:Di,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:at};return a?(mr(l,n),i&128&&e.normalize(l)):n&&(l.shapeFlag|=Ce(n)?8:16),jn>0&&!o&&st&&(l.patchFlag>0||i&6)&&l.patchFlag!==32&&st.push(l),l}const Me=cu;function cu(e,t=null,n=null,s=0,r=null,i=!1){if((!e||e===Na)&&(e=Ke),_s(e)){const a=Gt(e,t,!0);return n&&mr(a,n),jn>0&&!i&&st&&(a.shapeFlag&6?st[st.indexOf(e)]=a:st.push(a)),a.patchFlag=-2,a}if(ku(e)&&(e=e.__vccOpts),t){t=fu(t);let{class:a,style:l}=t;a&&!Ce(a)&&(t.class=ye(a)),Ae(l)&&(sr(l)&&!Q(l)&&(l=ht({},l)),t.style=Vs(l))}const o=Ce(e)?1:oo(e)?128:Fi(e)?64:Ae(e)?4:be(e)?2:0;return x(e,t,n,s,r,o,i,!0)}function fu(e){return e?sr(e)||Yi(e)?ht({},e):e:null}function Gt(e,t,n=!1,s=!1){const{props:r,ref:i,patchFlag:o,children:a,transition:l}=e,c=t?du(r||{},t):r,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&uo(c),ref:t&&t.ref?n&&i?Q(i)?i.concat(ks(t)):[i,ks(t)]:ks(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Be?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Gt(e.ssContent),ssFallback:e.ssFallback&&Gt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&s&&Nn(u,l.clone(u)),u}function Ts(e=" ",t=0){return Me(vs,null,e,t)}function Ve(e="",t=!1){return t?(F(),St(Ke,null,e)):Me(Ke,null,e)}function Et(e){return e==null||typeof e=="boolean"?Me(Ke):Q(e)?Me(Be,null,e.slice()):_s(e)?Kt(e):Me(vs,null,String(e))}function Kt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Gt(e)}function mr(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(Q(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),mr(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!Yi(t)?t._ctx=at:r===3&&at&&(at.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else be(t)?(t={default:t,_ctx:at},n=32):(t=String(t),s&64?(n=16,t=[Ts(t)]):n=8);e.children=t,e.shapeFlag|=n}function du(...e){const t={};for(let n=0;nYt||at;let Ss,br;{const e=rs(),t=(n,s)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),i=>{r.length>1?r.forEach(o=>o(i)):r[0](i)}};Ss=t("__VUE_INSTANCE_SETTERS__",n=>Yt=n),br=t("__VUE_SSR_SETTERS__",n=>Vn=n)}const xr=e=>{const t=Yt;return Ss(e),e.scope.on(),()=>{e.scope.off(),Ss(t)}},fo=()=>{Yt&&Yt.scope.off(),Ss(null)};function po(e){return e.vnode.shapeFlag&4}let Vn=!1;function mu(e,t=!1,n=!1){t&&br(t);const{props:s,children:r}=e.vnode,i=po(e);Ua(e,s,i,t),Wa(e,r,n||t);const o=i?bu(e,t):void 0;return t&&br(!1),o}function bu(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Fa);const{setup:s}=n;if(s){It();const r=e.setupContext=s.length>1?yu(e):null,i=xr(e),o=mn(s,e,0,[e.props,r]),a=ni(o);if(Mt(),i(),(a||e.sp)&&!Bn(e)&&$a(e),a){if(o.then(fo,fo),t)return o.then(l=>{ho(e,l)}).catch(l=>{hs(l,e,0)});e.asyncDep=o}else ho(e,o)}else go(e)}function ho(e,t,n){be(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ae(t)&&(e.setupState=Ci(t)),go(e)}function go(e,t,n){const s=e.type;e.render||(e.render=s.render||Qt)}const xu={get(e,t){return Ue(e,"get",""),e[t]}};function yu(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,xu),slots:e.slots,emit:e.emit,expose:t}}function Es(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Ci(ha(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in zn)return zn[n](e)},has(t,n){return n in t||n in zn}})):e.proxy}const wu=/(?:^|[-_])(\w)/g,vu=e=>e.replace(wu,t=>t.toUpperCase()).replace(/[-_]/g,"");function _u(e,t=!0){return be(e)?e.displayName||e.name:e.name||t&&e.__name}function mo(e,t,n=!1){let s=_u(t);if(!s&&t.__file){const r=t.__file.match(/([^/\\]+)\.\w+$/);r&&(s=r[1])}if(!s&&e&&e.parent){const r=i=>{for(const o in i)if(i[o]===t)return o};s=r(e.components||e.parent.type.components)||r(e.appContext.components)}return s?vu(s):n?"App":"Anonymous"}function ku(e){return be(e)&&"__vccOpts"in e}const Re=(e,t)=>wa(e,t,Vn);function Tu(e,t,n){const s=arguments.length;return s===2?Ae(t)&&!Q(t)?_s(t)?Me(e,null,[t]):Me(e,t):Me(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&_s(n)&&(n=[n]),Me(e,t,n))}const Su="3.5.18";let yr;const bo=typeof window!="undefined"&&window.trustedTypes;if(bo)try{yr=bo.createPolicy("vue",{createHTML:e=>e})}catch{}const xo=yr?e=>yr.createHTML(e):e=>e,Eu="http://www.w3.org/2000/svg",Au="http://www.w3.org/1998/Math/MathML",Dt=typeof document!="undefined"?document:null,yo=Dt&&Dt.createElement("template"),Ru={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t==="svg"?Dt.createElementNS(Eu,e):t==="mathml"?Dt.createElementNS(Au,e):n?Dt.createElement(e,{is:n}):Dt.createElement(e);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>Dt.createTextNode(e),createComment:e=>Dt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Dt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,i){const o=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===i||!(r=r.nextSibling)););else{yo.innerHTML=xo(s==="svg"?`${e}`:s==="mathml"?`${e}`:e);const a=yo.content;if(s==="svg"||s==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Zt="transition",qn="animation",Wn=Symbol("_vtc"),wo={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Cu=ht({},Bi,wo),Pu=(e=>(e.displayName="Transition",e.props=Cu,e))((e,{slots:t})=>Tu(Oa,Iu(e),t)),ln=(e,t=[])=>{Q(e)?e.forEach(n=>n(...t)):e&&e(...t)},vo=e=>e?Q(e)?e.some(t=>t.length>1):e.length>1:!1;function Iu(e){const t={};for(const $ in e)$ in wo||(t[$]=e[$]);if(e.css===!1)return t;const{name:n="v",type:s,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=i,appearActiveClass:c=o,appearToClass:u=a,leaveFromClass:p=`${n}-leave-from`,leaveActiveClass:g=`${n}-leave-active`,leaveToClass:w=`${n}-leave-to`}=e,E=Mu(r),m=E&&E[0],A=E&&E[1],{onBeforeEnter:T,onEnter:W,onEnterCancelled:K,onLeave:O,onLeaveCancelled:z,onBeforeAppear:P=T,onAppear:I=W,onAppearCancelled:re=K}=t,j=($,Z,Y,B)=>{$._enterCancelled=B,an($,Z?u:a),an($,Z?c:o),Y&&Y()},te=($,Z)=>{$._isLeaving=!1,an($,p),an($,w),an($,g),Z&&Z()},ue=$=>(Z,Y)=>{const B=$?I:W,ce=()=>j(Z,$,Y);ln(B,[Z,ce]),_o(()=>{an(Z,$?l:i),Nt(Z,$?u:a),vo(B)||ko(Z,s,m,ce)})};return ht(t,{onBeforeEnter($){ln(T,[$]),Nt($,i),Nt($,o)},onBeforeAppear($){ln(P,[$]),Nt($,l),Nt($,c)},onEnter:ue(!1),onAppear:ue(!0),onLeave($,Z){$._isLeaving=!0;const Y=()=>te($,Z);Nt($,p),$._enterCancelled?(Nt($,g),Eo()):(Eo(),Nt($,g)),_o(()=>{$._isLeaving&&(an($,p),Nt($,w),vo(O)||ko($,s,A,Y))}),ln(O,[$,Y])},onEnterCancelled($){j($,!1,void 0,!0),ln(K,[$])},onAppearCancelled($){j($,!0,void 0,!0),ln(re,[$])},onLeaveCancelled($){te($),ln(z,[$])}})}function Mu(e){if(e==null)return null;if(Ae(e))return[wr(e.enter),wr(e.leave)];{const t=wr(e);return[t,t]}}function wr(e){return zl(e)}function Nt(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Wn]||(e[Wn]=new Set)).add(t)}function an(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[Wn];n&&(n.delete(t),n.size||(e[Wn]=void 0))}function _o(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Lu=0;function ko(e,t,n,s){const r=e._endId=++Lu,i=()=>{r===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:o,timeout:a,propCount:l}=Ou(e,t);if(!o)return s();const c=o+"end";let u=0;const p=()=>{e.removeEventListener(c,g),i()},g=w=>{w.target===e&&++u>=l&&p()};setTimeout(()=>{u(n[E]||"").split(", "),r=s(`${Zt}Delay`),i=s(`${Zt}Duration`),o=To(r,i),a=s(`${qn}Delay`),l=s(`${qn}Duration`),c=To(a,l);let u=null,p=0,g=0;t===Zt?o>0&&(u=Zt,p=o,g=i.length):t===qn?c>0&&(u=qn,p=c,g=l.length):(p=Math.max(o,c),u=p>0?o>c?Zt:qn:null,g=u?u===Zt?i.length:l.length:0);const w=u===Zt&&/\b(transform|all)(,|$)/.test(s(`${Zt}Property`).toString());return{type:u,timeout:p,propCount:g,hasTransform:w}}function To(e,t){for(;e.lengthSo(n)+So(e[s])))}function So(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Eo(){return document.body.offsetHeight}function $u(e,t,n){const s=e[Wn];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Ao=Symbol("_vod"),Du=Symbol("_vsh"),Nu=Symbol(""),Fu=/(^|;)\s*display\s*:/;function Bu(e,t,n){const s=e.style,r=Ce(n);let i=!1;if(n&&!r){if(t)if(Ce(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&As(s,a,"")}else for(const o in t)n[o]==null&&As(s,o,"");for(const o in n)o==="display"&&(i=!0),As(s,o,n[o])}else if(r){if(t!==n){const o=s[Nu];o&&(n+=";"+o),s.cssText=n,i=Fu.test(n)}}else t&&e.removeAttribute("style");Ao in e&&(e[Ao]=i?s.display:"",e[Du]&&(s.display="none"))}const Ro=/\s*!important$/;function As(e,t,n){if(Q(n))n.forEach(s=>As(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Hu(e,t);Ro.test(n)?e.setProperty(Jt(s),n.replace(Ro,""),"important"):e[s]=n}}const Co=["Webkit","Moz","ms"],vr={};function Hu(e,t){const n=vr[t];if(n)return n;let s=Ut(t);if(s!=="filter"&&s in e)return vr[t]=s;s=ii(s);for(let r=0;r_r||(Vu.then(()=>_r=0),_r=Date.now());function Wu(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;_t(Gu(s,n.value),t,5,[s])};return n.value=e,n.attached=qu(),n}function Gu(e,t){if(Q(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const $o=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ku=(e,t,n,s,r,i)=>{const o=r==="svg";t==="class"?$u(e,s,o):t==="style"?Bu(e,n,s):es(t)?Bs(t)||Uu(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Yu(e,t,s,o))?(Mo(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Io(e,t,s,o,i,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Ce(s))?Mo(e,Ut(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Io(e,t,s,o))};function Yu(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&$o(t)&&be(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return $o(t)&&Ce(n)?!1:t in e}const Do=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Q(t)?n=>ss(t,n):t};function Zu(e){e.target.composing=!0}function No(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const kr=Symbol("_assign"),Xu={created(e,{modifiers:{lazy:t,trim:n,number:s}},r){e[kr]=Do(r);const i=s||r.props&&r.props.type==="number";wn(e,t?"change":"input",o=>{if(o.target.composing)return;let a=e.value;n&&(a=a.trim()),i&&(a=js(a)),e[kr](a)}),n&&wn(e,"change",()=>{e.value=e.value.trim()}),t||(wn(e,"compositionstart",Zu),wn(e,"compositionend",No),wn(e,"change",No))},mounted(e,{value:t}){e.value=t==null?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:r,number:i}},o){if(e[kr]=Do(o),e.composing)return;const a=(i||e.type==="number")&&!/^0\d/.test(e.value)?js(e.value):e.value,l=t==null?"":t;a!==l&&(document.activeElement===e&&e.type!=="range"&&(s&&t===n||r&&e.value.trim()===l)||(e.value=l))}},Qu=["ctrl","shift","alt","meta"],Ju={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Qu.some(n=>e[`${n}Key`]&&!t.includes(n))},ct=(e,t)=>{const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=(r,...i)=>{for(let o=0;o{const t=tc().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=rc(s);if(!r)return;const i=t._component;!be(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=n(r,!1,sc(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},t};function sc(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function rc(e){return Ce(e)?document.querySelector(e):e}const ic=["aria-pressed"],oc={key:0,viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":"true"},lc={key:1,viewBox:"0 0 24 24",width:"18",height:"18","aria-hidden":"true",fill:"none"},ac={__name:"ChatbotToggler",props:{isOpen:{type:Boolean,required:!0}},emits:["toggle"],setup(e){return(t,n)=>(F(),q("button",{class:"fixed bottom-5 right-5 z-9999 grid h-12 w-12 appearance-none place-items-center rounded-full border border-white/20 bg-gradient-to-br from-brand-500 to-brand-600 text-white shadow-[0_20px_36px_-20px_rgba(109,79,194,0.85)] transition-all duration-250 hover:-translate-y-0.5 hover:from-brand-600 hover:to-violet-700 hover:shadow-[0_22px_40px_-22px_rgba(109,79,194,1)] focus:outline-none max-[600px]:bottom-3 max-[600px]:right-3 max-[600px]:h-13 max-[600px]:w-13",style:{"border-radius":"9999px"},"aria-pressed":e.isOpen?"true":"false",onClick:n[0]||(n[0]=s=>t.$emit("toggle"))},[e.isOpen?(F(),q("svg",lc,n[2]||(n[2]=[x("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},null,-1)]))):(F(),q("svg",oc,n[1]||(n[1]=[x("path",{d:"M4 4h16a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H8l-4 4v-4H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z",fill:"currentColor",stroke:"currentColor","stroke-width":"2","stroke-linecap":"miter","stroke-linejoin":"miter"},null,-1)])))],8,ic))}},uc={class:"chat-header relative flex min-h-14 items-center justify-between px-4 pb-2.5 pt-3 text-white sm:px-5"},cc={class:"flex min-w-0 flex-1 items-center gap-2 sm:gap-2.5"},fc={xmlns:"http://www.w3.org/2000/svg",width:"35",height:"35",viewBox:"0 0 1024 1024",class:"h-8 w-8 shrink-0 rounded-full bg-white p-1.5 shadow-md motion-safe:animate-soft-float",style:{fill:"#6d4fc2"}},dc={class:"ml-2 flex items-center gap-1.5"},pc=["title"],hc=["title","aria-label"],gc={key:0,viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},mc={key:1,viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},bc=["title","aria-label"],xc={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},yc={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},wc={key:2,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},vc={__name:"ChatHeader",props:{windowMode:{type:String,required:!0},autoReadEnabled:{type:Boolean,required:!0},activeTtsProvider:{type:String,required:!0}},emits:["close","cycleResize","toggleAutoRead"],setup(e){const t=e,n={default:"Compact",half:"Half Screen",full:"Full Screen"},s=Re(()=>n[t.windowMode]||"Compact"),r=Re(()=>t.windowMode==="default"?"Half Screen":t.windowMode==="half"?"Full Screen":"Compact"),i=Re(()=>t.activeTtsProvider==="polly"?"TTS: Polly":t.activeTtsProvider==="browser"?"TTS: Browser":"TTS: Off"),o=Re(()=>t.activeTtsProvider==="polly"?"bg-emerald-500/45":t.activeTtsProvider==="browser"?"bg-amber-500/45":"bg-slate-500/35");return(a,l)=>(F(),q("div",uc,[x("div",cc,[(F(),q("svg",fc,l[3]||(l[3]=[x("path",{d:"M738.3 287.6H285.7c-59 0-106.8 47.8-106.8 106.8v303.1c0 59 47.8 106.8 106.8 106.8h81.5v111.1c0 .7.8 1.1 1.4.7l166.9-110.6 41.8-.8h117.4l43.6-.4c59 0 106.8-47.8 106.8-106.8V394.5c0-59-47.8-106.9-106.8-106.9zM351.7 448.2c0-29.5 23.9-53.5 53.5-53.5s53.5 23.9 53.5 53.5-23.9 53.5-53.5 53.5-53.5-23.9-53.5-53.5zm157.9 267.1c-67.8 0-123.8-47.5-132.3-109h264.6c-8.6 61.5-64.5 109-132.3 109zm110-213.7c-29.5 0-53.5-23.9-53.5-53.5s23.9-53.5 53.5-53.5 53.5 23.9 53.5 53.5-23.9 53.5-53.5 53.5zM867.2 644.5V453.1h26.5c19.4 0 35.1 15.7 35.1 35.1v121.1c0 19.4-15.7 35.1-35.1 35.1h-26.5zM95.2 609.4V488.2c0-19.4 15.7-35.1 35.1-35.1h26.5v191.3h-26.5c-19.4 0-35.1-15.7-35.1-35.1zM561.5 149.6c0 23.4-15.6 43.3-36.9 49.7v44.9h-30v-44.9c-21.4-6.5-36.9-26.3-36.9-49.7 0-28.6 23.3-51.9 51.9-51.9s51.9 23.3 51.9 51.9z"},null,-1)]))),l[4]||(l[4]=x("h2",{class:"truncate text-xs font-semibold tracking-[0.01em] sm:text-base text-white/95"},"ChangAI from ERPGulf",-1))]),x("div",dc,[x("span",{class:ye(["hidden rounded-full border border-white/25 px-2 py-1 text-[10px] font-semibold uppercase tracking-wide text-white/95 shadow-sm backdrop-blur-sm sm:inline",o.value]),title:`TTS provider: ${i.value}`},Qe(i.value),11,pc),x("button",{class:ye(["h-8 min-w-8 appearance-none items-center justify-center rounded-md border border-white/20 px-2 text-xs font-semibold text-white/90 transition-all duration-200 focus:outline-none sm:flex",e.autoReadEnabled?"bg-white/24 shadow-sm":"hover:bg-white/15"]),style:{"border-radius":"0.375rem"},title:e.autoReadEnabled?"Auto speech on":"Auto speech off","aria-label":e.autoReadEnabled?"Turn off auto speech":"Turn on auto speech",onClick:l[0]||(l[0]=c=>a.$emit("toggleAutoRead"))},[e.autoReadEnabled?(F(),q("svg",gc,l[5]||(l[5]=[x("path",{d:"M11 5L6 9H3v6h3l5 4V5z"},null,-1),x("path",{d:"M15 9a4 4 0 0 1 0 6"},null,-1),x("path",{d:"M18 7a7 7 0 0 1 0 10"},null,-1)]))):(F(),q("svg",mc,l[6]||(l[6]=[x("path",{d:"M11 5L6 9H3v6h3l5 4V5z"},null,-1),x("path",{d:"M22 9l-6 6"},null,-1),x("path",{d:"M16 9l6 6"},null,-1)])))],10,hc),x("button",{class:ye(["flex h-8 min-w-8 appearance-none items-center justify-center rounded-md border border-white/20 px-2 text-xs font-semibold text-white/90 transition-all duration-200 focus:outline-none","bg-white/20 shadow-sm hover:bg-white/25"]),style:{"border-radius":"0.375rem"},title:`Resize mode: ${s.value} (click to ${r.value})`,"aria-label":`Resize mode ${s.value}. Click to switch to ${r.value}`,onClick:l[1]||(l[1]=c=>a.$emit("cycleResize"))},[e.windowMode==="default"?(F(),q("svg",xc,l[7]||(l[7]=[x("rect",{x:"7",y:"8",width:"10",height:"8",rx:"2"},null,-1)]))):e.windowMode==="half"?(F(),q("svg",yc,l[8]||(l[8]=[x("rect",{x:"4",y:"5",width:"16",height:"14",rx:"2"},null,-1),x("path",{d:"M12 5v14"},null,-1)]))):(F(),q("svg",wc,l[9]||(l[9]=[x("rect",{x:"4",y:"5",width:"16",height:"14",rx:"2"},null,-1),x("path",{d:"M8 8H6v2M16 8h2v2M8 16H6v-2M16 16h2v-2"},null,-1)])))],8,bc),x("button",{class:"grid h-8 w-8 shrink-0 appearance-none place-items-center rounded-full border border-white/20 text-white transition-all duration-200 hover:scale-105 hover:bg-white/20 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/70",style:{"border-radius":"9999px"},"aria-label":"Close chatbot",onClick:l[2]||(l[2]=c=>a.$emit("close"))},l[10]||(l[10]=[x("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",width:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[x("path",{d:"M6 9l6 6 6-6"})],-1)]))])]))}},_c={class:"flex gap-1.5 border-b border-slate-200/80 px-2.5 pb-2.5 pt-1"},kc=["onClick"],Tc={class:"inline-flex items-center gap-1.5"},Sc={__name:"TabBar",props:{modelValue:{type:String,required:!0},debugEnabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e){const t=e,n=Re(()=>{const s=[{id:"chat",label:"Chats"},{id:"debug",label:"Debug"},{id:"support",label:"Support"},{id:"settings",label:"Settings"}];return t.debugEnabled?s:s.filter(r=>r.id!=="debug")});return(s,r)=>(F(),q("div",_c,[(F(!0),q(Be,null,ys(n.value,i=>(F(),q("button",{key:i.id,class:ye(["group min-w-0 flex-1 h-9 appearance-none rounded-lg border border-transparent bg-transparent px-2 text-xs font-semibold transition-all duration-200 focus:outline-none",e.modelValue===i.id?"border-white/30 bg-linear-to-r from-violet-300/36 via-indigo-300/30 to-sky-300/28 text-white shadow-[0_4px_10px_rgba(20,24,40,0.22)]":"text-white/80 hover:border-white/25 hover:bg-white/12 hover:text-white"]),onClick:o=>s.$emit("update:modelValue",i.id)},[x("span",Tc,[x("span",{class:ye(["h-1.5 w-1.5 rounded-full transition-colors duration-200",e.modelValue===i.id?"bg-white":"bg-white/40 group-hover:bg-white/70"])},null,2),Ts(" "+Qe(i.label),1)])],10,kc))),128))]))}},Ec=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},Ac={},Rc={xmlns:"http://www.w3.org/2000/svg",width:"50",height:"50",viewBox:"0 0 1024 1024",class:"h-7.5 w-7.5 shrink-0 self-end rounded-full bg-gradient-to-br from-brand-500 to-brand-600 p-1.5 fill-white shadow-[0_10px_18px_-12px_rgba(109,79,194,0.85)]"};function Cc(e,t){return F(),q("svg",Rc,t[0]||(t[0]=[x("path",{d:"M738.3 287.6H285.7c-59 0-106.8 47.8-106.8 106.8v303.1c0 59 47.8 106.8 106.8 106.8h81.5v111.1c0 .7.8 1.1 1.4.7l166.9-110.6 41.8-.8h117.4l43.6-.4c59 0 106.8-47.8 106.8-106.8V394.5c0-59-47.8-106.9-106.8-106.9zM351.7 448.2c0-29.5 23.9-53.5 53.5-53.5s53.5 23.9 53.5 53.5-23.9 53.5-53.5 53.5-53.5-23.9-53.5-53.5zm157.9 267.1c-67.8 0-123.8-47.5-132.3-109h264.6c-8.6 61.5-64.5 109-132.3 109zm110-213.7c-29.5 0-53.5-23.9-53.5-53.5s23.9-53.5 53.5-53.5 53.5 23.9 53.5 53.5-23.9 53.5-53.5 53.5zM867.2 644.5V453.1h26.5c19.4 0 35.1 15.7 35.1 35.1v121.1c0 19.4-15.7 35.1-35.1 35.1h-26.5zM95.2 609.4V488.2c0-19.4 15.7-35.1 35.1-35.1h26.5v191.3h-26.5c-19.4 0-35.1-15.7-35.1-35.1zM561.5 149.6c0 23.4-15.6 43.3-36.9 49.7v44.9h-30v-44.9c-21.4-6.5-36.9-26.3-36.9-49.7 0-28.6 23.3-51.9 51.9-51.9s51.9 23.3 51.9 51.9z"},null,-1)]))}const Bo=Ec(Ac,[["render",Cc]]),Rs={PIPELINE:"changai.changai.api.v2.text2sql_pipeline_v2.run_text2sql_pipeline",SUPPORT:"changai.changai.api.v2.text2sql_pipeline_v2.support_bot",SETTINGS:"changai.changai.api.v2.text2sql_pipeline_v2.get_frontend_settings",TTS:"changai.changai.api.v2.text2sql_pipeline_v2.synthesize_tts"};function Tr(e,t={},n="actual"){return n==="test"?Promise.resolve({Bot:`[TEST MODE] ${JSON.stringify(t)}`}):!window.frappe||!window.frappe.call?Promise.reject(new Error("Frappe API is unavailable in actual mode.")):new Promise((s,r)=>{window.frappe.call({method:e,args:t,callback(i){s(i.message)},error(i){r(i)}})})}function Pc(e,t,n="actual",s=null,r){if(n==="test")return{promise:Promise.resolve({Bot:`[TEST MODE] ${JSON.stringify({user_question:e,chat_id:t,request_id:s,sendNonErptoAI:r})}`}),cancel:()=>!1};if(!window.frappe||!window.frappe.call)return{promise:Promise.reject(new Error("Frappe API is unavailable in actual mode.")),cancel:()=>!1};let i=null,o=!1;return{promise:new Promise((c,u)=>{i=window.frappe.call({method:Rs.PIPELINE,args:{user_question:e,chat_id:t,request_id:s,sendNonErptoAI:r},callback(p){o=!0,c(p.message)},error(p){o=!0,u(p)}})}),cancel:()=>o||!i||typeof i.abort!="function"?!1:(i.abort(),o=!0,!0)}}function Ic(e,t="actual"){return Tr(Rs.SUPPORT,{message:e},t)}function Mc(e="actual"){return Tr(Rs.SETTINGS,{},e)}function Lc(e,t="Zayd",n="actual"){return Tr(Rs.TTS,{text:e,voice_id:t},n)}function Sr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var un=Sr();function Ho(e){un=e}var cn={exec:()=>null};function ie(e,t=""){let n=typeof e=="string"?e:e.source,s={replace:(r,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(qe.caret,"$1"),n=n.replace(r,o),s},getRegex:()=>new RegExp(n,t)};return s}var Oc=((e="")=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},$c=/^(?:[ \t]*(?:\n|$))+/,Dc=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Nc=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Gn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Fc=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Er=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,zo=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Uo=ie(zo).replace(/bull/g,Er).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Bc=ie(zo).replace(/bull/g,Er).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ar=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Hc=/^[^\n]+/,Rr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,zc=ie(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Rr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Uc=ie(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Er).getRegex(),Cs="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Cr=/|$))/,jc=ie("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Cr).replace("tag",Cs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),jo=ie(Ar).replace("hr",Gn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Cs).getRegex(),Vc=ie(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",jo).getRegex(),Pr={blockquote:Vc,code:Dc,def:zc,fences:Nc,heading:Fc,hr:Gn,html:jc,lheading:Uo,list:Uc,newline:$c,paragraph:jo,table:cn,text:Hc},Vo=ie("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Gn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Cs).getRegex(),qc={...Pr,lheading:Bc,table:Vo,paragraph:ie(Ar).replace("hr",Gn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Vo).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Cs).getRegex()},Wc={...Pr,html:ie(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Cr).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:cn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ie(Ar).replace("hr",Gn).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",Uo).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Gc=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Kc=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,qo=/^( {2,}|\\)\n(?!\s*$)/,Yc=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Oc?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Go=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,ef=ie(Go,"u").replace(/punct/g,vn).getRegex(),tf=ie(Go,"u").replace(/punct/g,Wo).getRegex(),Ko="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",nf=ie(Ko,"gu").replace(/notPunctSpace/g,Ir).replace(/punctSpace/g,Ps).replace(/punct/g,vn).getRegex(),sf=ie(Ko,"gu").replace(/notPunctSpace/g,Qc).replace(/punctSpace/g,Xc).replace(/punct/g,Wo).getRegex(),rf=ie("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ir).replace(/punctSpace/g,Ps).replace(/punct/g,vn).getRegex(),of=ie(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,vn).getRegex(),lf="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",af=ie(lf,"gu").replace(/notPunctSpace/g,Ir).replace(/punctSpace/g,Ps).replace(/punct/g,vn).getRegex(),uf=ie(/\\(punct)/,"gu").replace(/punct/g,vn).getRegex(),cf=ie(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ff=ie(Cr).replace("(?:-->|$)","-->").getRegex(),df=ie("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",ff).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Is=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,pf=ie(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Is).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Yo=ie(/^!?\[(label)\]\[(ref)\]/).replace("label",Is).replace("ref",Rr).getRegex(),Zo=ie(/^!?\[(ref)\](?:\[\])?/).replace("ref",Rr).getRegex(),hf=ie("reflink|nolink(?!\\()","g").replace("reflink",Yo).replace("nolink",Zo).getRegex(),Xo=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Mr={_backpedal:cn,anyPunctuation:uf,autolink:cf,blockSkip:Jc,br:qo,code:Kc,del:cn,delLDelim:cn,delRDelim:cn,emStrongLDelim:ef,emStrongRDelimAst:nf,emStrongRDelimUnd:rf,escape:Gc,link:pf,nolink:Zo,punctuation:Zc,reflink:Yo,reflinkSearch:hf,tag:df,text:Yc,url:cn},gf={...Mr,link:ie(/^!?\[(label)\]\((.*?)\)/).replace("label",Is).getRegex(),reflink:ie(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Is).getRegex()},Lr={...Mr,emStrongRDelimAst:sf,emStrongLDelim:tf,delLDelim:of,delRDelim:af,url:ie(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Xo).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ie(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Qo=e=>bf[e];function Rt(e,t){if(t){if(qe.escapeTest.test(e))return e.replace(qe.escapeReplace,Qo)}else if(qe.escapeTestNoEncode.test(e))return e.replace(qe.escapeReplaceNoEncode,Qo);return e}function Jo(e){try{e=encodeURI(e).replace(qe.percentDecode,"%")}catch{return null}return e}function el(e,t){var i;let n=e.replace(qe.findPipe,(o,a,l)=>{let c=!1,u=a;for(;--u>=0&&l[u]==="\\";)c=!c;return c?"|":" |"}),s=n.split(qe.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!((i=s.at(-1))!=null&&i.trim())&&s.pop(),t)if(s.length>t)s.splice(t);else for(;s.length=0&&qe.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(` `)}function xf(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let s=0;s0?-2:-1}function yf(e,t=0){let n=t,s="";for(let r of e)if(r===" "){let i=4-n%4;s+=" ".repeat(i),n+=i}else s+=r,n++;return s}function nl(e,t,n,s,r){let i=t.href,o=t.title||null,a=e[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:o,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,l}function wf(e,t,n){let s=e.match(n.other.indentCodeCompensation);if(s===null)return t;let r=s[1];return t.split(` @@ -22,11 +22,11 @@ ${u}`:u;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo `);continue}}return{type:"blockquote",raw:s,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),s=n.length>1,r={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let i=this.rules.other.listItemRegex(n),o=!1;for(;e;){let l=!1,c="",u="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let p=yf(t[2].split(` `,1)[0],t[1].length),g=e.split(` `,1)[0],w=!p.trim(),E=0;if(this.options.pedantic?(E=2,u=p.trimStart()):w?E=t[1].length+1:(E=p.search(this.rules.other.nonSpaceChar),E=E>4?1:E,u=p.slice(E),E+=t[1].length),w&&this.rules.other.blankLine.test(g)&&(c+=g+` -`,e=e.substring(g.length+1),l=!0),!l){let m=this.rules.other.nextBulletRegex(E),R=this.rules.other.hrRegex(E),S=this.rules.other.fencesBeginRegex(E),V=this.rules.other.headingBeginRegex(E),K=this.rules.other.htmlBeginRegex(E),O=this.rules.other.blockquoteBeginRegex(E);for(;e;){let A=e.split(` -`,1)[0],C;if(g=A,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),C=g):C=g.replace(this.rules.other.tabCharGlobal," "),S.test(g)||V.test(g)||K.test(g)||O.test(g)||m.test(g)||R.test(g))break;if(C.search(this.rules.other.nonSpaceChar)>=E||!g.trim())u+=` -`+C.slice(E);else{if(w||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(p)||V.test(p)||R.test(p))break;u+=` -`+g}w=!g.trim(),c+=A+` -`,e=e.substring(A.length+1),p=C.slice(E)}}r.loose||(o?r.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0)),r.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(u),loose:!1,text:u,tokens:[]}),r.raw+=c}let a=r.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let l of r.items){this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]);let c=l.tokens[0];if(l.task&&((c==null?void 0:c.type)==="text"||(c==null?void 0:c.type)==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),c.raw=c.raw.replace(this.rules.other.listReplaceTask,""),c.text=c.text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}let u=this.rules.other.listTaskCheckbox.exec(l.raw);if(u){let p={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};l.checked=p.checked,r.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=p.raw+l.tokens[0].raw,l.tokens[0].text=p.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(p)):l.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):l.tokens.unshift(p)}}else l.task&&(l.task=!1);if(!r.loose){let u=l.tokens.filter(g=>g.type==="space"),p=u.length>0&&u.some(g=>this.rules.other.anyLine.test(g.raw));r.loose=p}}if(r.loose)for(let l of r.items){l.loose=!0;for(let c of l.tokens)c.type==="text"&&(c.type="paragraph")}return r}}html(e){let t=this.rules.block.html.exec(e);if(t){let n=tl(t[0]);return{type:"html",block:!0,raw:n,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:n}}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:Xt(t[0],` +`,e=e.substring(g.length+1),l=!0),!l){let m=this.rules.other.nextBulletRegex(E),A=this.rules.other.hrRegex(E),T=this.rules.other.fencesBeginRegex(E),W=this.rules.other.headingBeginRegex(E),K=this.rules.other.htmlBeginRegex(E),O=this.rules.other.blockquoteBeginRegex(E);for(;e;){let z=e.split(` +`,1)[0],P;if(g=z,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),P=g):P=g.replace(this.rules.other.tabCharGlobal," "),T.test(g)||W.test(g)||K.test(g)||O.test(g)||m.test(g)||A.test(g))break;if(P.search(this.rules.other.nonSpaceChar)>=E||!g.trim())u+=` +`+P.slice(E);else{if(w||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(p)||W.test(p)||A.test(p))break;u+=` +`+g}w=!g.trim(),c+=z+` +`,e=e.substring(z.length+1),p=P.slice(E)}}r.loose||(o?r.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0)),r.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(u),loose:!1,text:u,tokens:[]}),r.raw+=c}let a=r.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let l of r.items){this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]);let c=l.tokens[0];if(l.task&&((c==null?void 0:c.type)==="text"||(c==null?void 0:c.type)==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),c.raw=c.raw.replace(this.rules.other.listReplaceTask,""),c.text=c.text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}let u=this.rules.other.listTaskCheckbox.exec(l.raw);if(u){let p={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};l.checked=p.checked,r.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=p.raw+l.tokens[0].raw,l.tokens[0].text=p.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(p)):l.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):l.tokens.unshift(p)}}else l.task&&(l.task=!1);if(!r.loose){let u=l.tokens.filter(g=>g.type==="space"),p=u.length>0&&u.some(g=>this.rules.other.anyLine.test(g.raw));r.loose=p}}if(r.loose)for(let l of r.items){l.loose=!0;for(let c of l.tokens)c.type==="text"&&(c.type="paragraph")}return r}}html(e){let t=this.rules.block.html.exec(e);if(t){let n=tl(t[0]);return{type:"html",block:!0,raw:n,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:n}}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:Xt(t[0],` `),href:s,title:r}}}table(e){var o;let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=el(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=(o=t[3])!=null&&o.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(` `):[],i={type:"table",raw:Xt(t[0],` `),header:[],align:[],rows:[]};if(n.length===s.length){for(let a of s)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a({text:l,tokens:this.lexer.inline(l),header:!1,align:i.align[c]})));return i}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:Xt(t[0],` @@ -45,7 +45,7 @@ ${u}`:u;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):n.push(l),s=c.length!==t.length,t=t.substring(l.raw.length);continue}if(l=this.tokenizer.text(t)){t=t.substring(l.raw.length);let u=n.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+l.raw,u.text+=` -`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):n.push(l);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var c,u,p,g,w,E;this.tokenizer.lexer=this;let s=t,r=null;if(this.tokens.links){let m=Object.keys(this.tokens.links);if(m.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(s))!==null;)m.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(s))!==null;)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(s))!==null;)i=r[2]?r[2].length:0,s=s.slice(0,r.index+i)+"["+"a".repeat(r[0].length-i-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=(p=(u=(c=this.options.hooks)==null?void 0:c.emStrongMask)==null?void 0:u.call({lexer:this},s))!=null?p:s;let o=!1,a="",l=1/0;for(;t;){if(t.length(m=S.call({lexer:this},t,n))?(t=t.substring(m.raw.length),n.push(m),!0):!1))continue;if(m=this.tokenizer.escape(t)){t=t.substring(m.raw.length),n.push(m);continue}if(m=this.tokenizer.tag(t)){t=t.substring(m.raw.length),n.push(m);continue}if(m=this.tokenizer.link(t)){t=t.substring(m.raw.length),n.push(m);continue}if(m=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(m.raw.length);let S=n.at(-1);m.type==="text"&&(S==null?void 0:S.type)==="text"?(S.raw+=m.raw,S.text+=m.text):n.push(m);continue}if(m=this.tokenizer.emStrong(t,s,a)){t=t.substring(m.raw.length),n.push(m);continue}if(m=this.tokenizer.codespan(t)){t=t.substring(m.raw.length),n.push(m);continue}if(m=this.tokenizer.br(t)){t=t.substring(m.raw.length),n.push(m);continue}if(m=this.tokenizer.del(t,s,a)){t=t.substring(m.raw.length),n.push(m);continue}if(m=this.tokenizer.autolink(t)){t=t.substring(m.raw.length),n.push(m);continue}if(!this.state.inLink&&(m=this.tokenizer.url(t))){t=t.substring(m.raw.length),n.push(m);continue}let R=t;if((E=this.options.extensions)!=null&&E.startInline){let S=1/0,V=t.slice(1),K;this.options.extensions.startInline.forEach(O=>{K=O.call({lexer:this},V),typeof K=="number"&&K>=0&&(S=Math.min(S,K))}),S<1/0&&S>=0&&(R=t.substring(0,S+1))}if(m=this.tokenizer.inlineText(R)){t=t.substring(m.raw.length),m.raw.slice(-1)!=="_"&&(a=m.raw.slice(-1)),o=!0;let S=n.at(-1);(S==null?void 0:S.type)==="text"?(S.raw+=m.raw,S.text+=m.text):n.push(m);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return n}infiniteLoopError(t){let n="Infinite loop on byte: "+t;if(!this.options.silent)throw new Error(n)}},Os=class{constructor(e){we(this,"options");we(this,"parser");this.options=e||un}space(e){return""}code({text:e,lang:t,escaped:n}){var i;let s=(i=(t||"").match(qe.notSpaceStart))==null?void 0:i[0],r=e.replace(qe.endingNewline,"")+` +`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):n.push(l);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var c,u,p,g,w,E;this.tokenizer.lexer=this;let s=t,r=null;if(this.tokens.links){let m=Object.keys(this.tokens.links);if(m.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(s))!==null;)m.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(s))!==null;)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(s))!==null;)i=r[2]?r[2].length:0,s=s.slice(0,r.index+i)+"["+"a".repeat(r[0].length-i-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=(p=(u=(c=this.options.hooks)==null?void 0:c.emStrongMask)==null?void 0:u.call({lexer:this},s))!=null?p:s;let o=!1,a="",l=1/0;for(;t;){if(t.length(m=T.call({lexer:this},t,n))?(t=t.substring(m.raw.length),n.push(m),!0):!1))continue;if(m=this.tokenizer.escape(t)){t=t.substring(m.raw.length),n.push(m);continue}if(m=this.tokenizer.tag(t)){t=t.substring(m.raw.length),n.push(m);continue}if(m=this.tokenizer.link(t)){t=t.substring(m.raw.length),n.push(m);continue}if(m=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(m.raw.length);let T=n.at(-1);m.type==="text"&&(T==null?void 0:T.type)==="text"?(T.raw+=m.raw,T.text+=m.text):n.push(m);continue}if(m=this.tokenizer.emStrong(t,s,a)){t=t.substring(m.raw.length),n.push(m);continue}if(m=this.tokenizer.codespan(t)){t=t.substring(m.raw.length),n.push(m);continue}if(m=this.tokenizer.br(t)){t=t.substring(m.raw.length),n.push(m);continue}if(m=this.tokenizer.del(t,s,a)){t=t.substring(m.raw.length),n.push(m);continue}if(m=this.tokenizer.autolink(t)){t=t.substring(m.raw.length),n.push(m);continue}if(!this.state.inLink&&(m=this.tokenizer.url(t))){t=t.substring(m.raw.length),n.push(m);continue}let A=t;if((E=this.options.extensions)!=null&&E.startInline){let T=1/0,W=t.slice(1),K;this.options.extensions.startInline.forEach(O=>{K=O.call({lexer:this},W),typeof K=="number"&&K>=0&&(T=Math.min(T,K))}),T<1/0&&T>=0&&(A=t.substring(0,T+1))}if(m=this.tokenizer.inlineText(A)){t=t.substring(m.raw.length),m.raw.slice(-1)!=="_"&&(a=m.raw.slice(-1)),o=!0;let T=n.at(-1);(T==null?void 0:T.type)==="text"?(T.raw+=m.raw,T.text+=m.text):n.push(m);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return n}infiniteLoopError(t){let n="Infinite loop on byte: "+t;if(!this.options.silent)throw new Error(n)}},Os=class{constructor(e){we(this,"options");we(this,"parser");this.options=e||un}space(e){return""}code({text:e,lang:t,escaped:n}){var i;let s=(i=(t||"").match(qe.notSpaceStart))==null?void 0:i[0],r=e.replace(qe.endingNewline,"")+` `;return s?'
'+(n?r:Rt(r,!0))+`
`:"
"+(n?r:Rt(r,!0))+`
`}blockquote({tokens:e}){return`
@@ -64,6 +64,6 @@ ${this.parser.parse(e)}
${e} `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+` `}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${Rt(e,!0)}`}br(e){return"
"}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){let s=this.parser.parseInline(n),r=Jo(e);if(r===null)return s;e=r;let i='
",i}image({href:e,title:t,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let r=Jo(e);if(r===null)return Rt(n);e=r;let i=`${Rt(n)}{let l=o[a].flat(1/0);n=n.concat(this.walkTokens(l,t))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let i=t.renderers[r.name];i?t.renderers[r.name]=function(...o){let a=r.renderer.apply(this,o);return a===!1&&(a=i.apply(this,o)),a}:t.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=t[r.level];i?i.unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),s.extensions=t),n.renderer){let r=this.defaults.renderer||new Os(this.defaults);for(let i in n.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let o=i,a=n.renderer[o],l=r[o];r[o]=(...c)=>{let u=a.apply(r,c);return u===!1&&(u=l.apply(r,c)),u||""}}s.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new Ls(this.defaults);for(let i in n.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let o=i,a=n.tokenizer[o],l=r[o];r[o]=(...c)=>{let u=a.apply(r,c);return u===!1&&(u=l.apply(r,c)),u}}s.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new Yn;for(let i in n.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let o=i,a=n.hooks[o],l=r[o];Yn.passThroughHooks.has(i)?r[o]=c=>{if(this.defaults.async&&Yn.passThroughHooksRespectAsync.has(i))return(async()=>{let p=await a.call(r,c);return l.call(r,p)})();let u=a.call(r,c);return l.call(r,u)}:r[o]=(...c)=>{if(this.defaults.async)return(async()=>{let p=await a.apply(r,c);return p===!1&&(p=await l.apply(r,c)),p})();let u=a.apply(r,c);return u===!1&&(u=l.apply(r,c)),u}}s.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,i=n.walkTokens;s.walkTokens=function(o){let a=[];return a.push(i.call(this,o)),r&&(a=a.concat(r.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return mt.lex(e,t!=null?t:this.defaults)}parser(e,t){return bt.parse(e,t!=null?t:this.defaults)}parseMarkdown(e){return(t,n)=>{let s={...n},r={...this.defaults,...s},i=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&s.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=e),r.async)return(async()=>{let o=r.hooks?await r.hooks.preprocess(t):t,a=await(r.hooks?await r.hooks.provideLexer(e):e?mt.lex:mt.lexInline)(o,r),l=r.hooks?await r.hooks.processAllTokens(a):a;r.walkTokens&&await Promise.all(this.walkTokens(l,r.walkTokens));let c=await(r.hooks?await r.hooks.provideParser(e):e?bt.parse:bt.parseInline)(l,r);return r.hooks?await r.hooks.postprocess(c):c})().catch(i);try{r.hooks&&(t=r.hooks.preprocess(t));let o=(r.hooks?r.hooks.provideLexer(e):e?mt.lex:mt.lexInline)(t,r);r.hooks&&(o=r.hooks.processAllTokens(o)),r.walkTokens&&this.walkTokens(o,r.walkTokens);let a=(r.hooks?r.hooks.provideParser(e):e?bt.parse:bt.parseInline)(o,r);return r.hooks&&(a=r.hooks.postprocess(a)),a}catch(o){return i(o)}}}onError(e,t){return n=>{if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,e){let s="

An error occurred:

"+Rt(n.message+"",!0)+"
";return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}}},fn=new vf;function be(e,t){return fn.parse(e,t)}be.options=be.setOptions=function(e){return fn.setOptions(e),be.defaults=fn.defaults,Ho(be.defaults),be},be.getDefaults=Sr,be.defaults=un,be.use=function(...e){return fn.use(...e),be.defaults=fn.defaults,Ho(be.defaults),be},be.walkTokens=function(e,t){return fn.walkTokens(e,t)},be.parseInline=fn.parseInline,be.Parser=bt,be.parser=bt.parse,be.Renderer=Os,be.TextRenderer=Or,be.Lexer=mt,be.lexer=mt.lex,be.Tokenizer=Ls,be.Hooks=Yn,be.parse=be,be.options,be.setOptions,be.use,be.walkTokens,be.parseInline,bt.parse,mt.lex;function sl(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=Array(t);n2?s-2:0),i=2;i1?n-1:0),r=1;r1?n-1:0),r=1;r2&&arguments[2]!==void 0?arguments[2]:Zn;if(il&&il(e,null),!Ze(t))return e;let s=t.length;for(;s--;){let r=t[s];if(typeof r=="string"){const i=n(r);i!==r&&(Af(t)||(t[s]=i),r=i)}e[r]=!0}return e}function Df(e){for(let t=0;t/g),jf=ft(/\${[\w\W]*/g),Vf=ft(/^data-[\-\w.\u00B7-\uFFFF]+$/),qf=ft(/^aria-[\-\w]+$/),ml=ft(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Wf=ft(/^(?:\w+script|data):/i),Gf=ft(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Kf=ft(/^html$/i),Yf=ft(/^[a-z][.\w]*(-[.\w]+)+$/i),An={element:1,text:3,progressingInstruction:7,comment:8,document:9},Zf=function(){return typeof window=="undefined"?null:window},Xf=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let s=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(s=n.getAttribute(r));const i="dompurify"+(s?"#"+s:"");try{return t.createPolicy(i,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return null}},bl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function xl(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Zf();const t=U=>xl(U);if(t.version="3.4.3",t.removed=[],!e||!e.document||e.document.nodeType!==An.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const s=n,r=s.currentScript,i=e.DocumentFragment,o=e.HTMLTemplateElement,a=e.Node,l=e.Element,c=e.NodeFilter,u=e.NamedNodeMap,p=u===void 0?e.NamedNodeMap||e.MozNamedAttrMap:u,g=e.HTMLFormElement,w=e.DOMParser,E=e.trustedTypes,m=l.prototype,R=En(m,"cloneNode"),S=En(m,"remove"),V=En(m,"nextSibling"),K=En(m,"childNodes"),O=En(m,"parentNode");if(typeof o=="function"){const U=n.createElement("template");U.content&&U.content.ownerDocument&&(n=U.content.ownerDocument)}let A,C="";const J=n,te=J.implementation,W=J.createNodeIterator,ne=J.createDocumentFragment,xe=J.getElementsByTagName,$=s.importNode;let Y=bl();t.isSupported=typeof rl=="function"&&typeof O=="function"&&te&&te.createHTMLDocument!==void 0;const G=zf,z=Uf,ue=jf,Se=Vf,We=qf,xt=Wf,ce=Gf,N=Yf;let de=ml,pe=null;const ke=Z({},[...dl,...Fr,...Br,...Hr,...pl]);let ve=null;const ge=Z({},[...hl,...zr,...gl,...Ds]);let le=Object.seal(_n(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),yt=null,Ct=null;const ze=Object.seal(_n(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ur=!0,f=!0,h=!1,b=!0,k=!1,v=!0,_=!1,M=!1,I=!1,P=!1,T=!1,B=!1,L=!0,H=!1;const q="user-content-";let ee=!0,fe=!1,se={},Te=null;const Oe=Z({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let rt=null;const it=Z({},["audio","video","img","source","image","track"]);let Ft=null;const Qn=Z({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),$e="http://www.w3.org/1998/Math/MathML",Xe="http://www.w3.org/2000/svg",ot="http://www.w3.org/1999/xhtml";let Bt=ot,jr=!1,Vr=null;const hp=Z({},[$e,Xe,ot],Nr);let qr=Z({},["mi","mo","mn","ms","mtext"]),Wr=Z({},["annotation-xml"]);const gp=Z({},["title","style","font","a","script"]);let Jn=null;const mp=["application/xhtml+xml","text/html"],bp="text/html";let Le=null,Rn=null;const xp=n.createElement("form"),Sl=function(d){return d instanceof RegExp||d instanceof Function},Gr=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Rn&&Rn===d)return;(!d||typeof d!="object")&&(d={}),d=et(d),Jn=mp.indexOf(d.PARSER_MEDIA_TYPE)===-1?bp:d.PARSER_MEDIA_TYPE,Le=Jn==="application/xhtml+xml"?Nr:Zn,pe=Ee(d,"ALLOWED_TAGS")&&Ze(d.ALLOWED_TAGS)?Z({},d.ALLOWED_TAGS,Le):ke,ve=Ee(d,"ALLOWED_ATTR")&&Ze(d.ALLOWED_ATTR)?Z({},d.ALLOWED_ATTR,Le):ge,Vr=Ee(d,"ALLOWED_NAMESPACES")&&Ze(d.ALLOWED_NAMESPACES)?Z({},d.ALLOWED_NAMESPACES,Nr):hp,Ft=Ee(d,"ADD_URI_SAFE_ATTR")&&Ze(d.ADD_URI_SAFE_ATTR)?Z(et(Qn),d.ADD_URI_SAFE_ATTR,Le):Qn,rt=Ee(d,"ADD_DATA_URI_TAGS")&&Ze(d.ADD_DATA_URI_TAGS)?Z(et(it),d.ADD_DATA_URI_TAGS,Le):it,Te=Ee(d,"FORBID_CONTENTS")&&Ze(d.FORBID_CONTENTS)?Z({},d.FORBID_CONTENTS,Le):Oe,yt=Ee(d,"FORBID_TAGS")&&Ze(d.FORBID_TAGS)?Z({},d.FORBID_TAGS,Le):et({}),Ct=Ee(d,"FORBID_ATTR")&&Ze(d.FORBID_ATTR)?Z({},d.FORBID_ATTR,Le):et({}),se=Ee(d,"USE_PROFILES")?d.USE_PROFILES&&typeof d.USE_PROFILES=="object"?et(d.USE_PROFILES):d.USE_PROFILES:!1,Ur=d.ALLOW_ARIA_ATTR!==!1,f=d.ALLOW_DATA_ATTR!==!1,h=d.ALLOW_UNKNOWN_PROTOCOLS||!1,b=d.ALLOW_SELF_CLOSE_IN_ATTR!==!1,k=d.SAFE_FOR_TEMPLATES||!1,v=d.SAFE_FOR_XML!==!1,_=d.WHOLE_DOCUMENT||!1,P=d.RETURN_DOM||!1,T=d.RETURN_DOM_FRAGMENT||!1,B=d.RETURN_TRUSTED_TYPE||!1,I=d.FORCE_BODY||!1,L=d.SANITIZE_DOM!==!1,H=d.SANITIZE_NAMED_PROPS||!1,ee=d.KEEP_CONTENT!==!1,fe=d.IN_PLACE||!1,de=Ff(d.ALLOWED_URI_REGEXP)?d.ALLOWED_URI_REGEXP:ml,Bt=typeof d.NAMESPACE=="string"?d.NAMESPACE:ot,qr=Ee(d,"MATHML_TEXT_INTEGRATION_POINTS")&&d.MATHML_TEXT_INTEGRATION_POINTS&&typeof d.MATHML_TEXT_INTEGRATION_POINTS=="object"?et(d.MATHML_TEXT_INTEGRATION_POINTS):Z({},["mi","mo","mn","ms","mtext"]),Wr=Ee(d,"HTML_INTEGRATION_POINTS")&&d.HTML_INTEGRATION_POINTS&&typeof d.HTML_INTEGRATION_POINTS=="object"?et(d.HTML_INTEGRATION_POINTS):Z({},["annotation-xml"]);const y=Ee(d,"CUSTOM_ELEMENT_HANDLING")&&d.CUSTOM_ELEMENT_HANDLING&&typeof d.CUSTOM_ELEMENT_HANDLING=="object"?et(d.CUSTOM_ELEMENT_HANDLING):_n(null);if(le=_n(null),Ee(y,"tagNameCheck")&&Sl(y.tagNameCheck)&&(le.tagNameCheck=y.tagNameCheck),Ee(y,"attributeNameCheck")&&Sl(y.attributeNameCheck)&&(le.attributeNameCheck=y.attributeNameCheck),Ee(y,"allowCustomizedBuiltInElements")&&typeof y.allowCustomizedBuiltInElements=="boolean"&&(le.allowCustomizedBuiltInElements=y.allowCustomizedBuiltInElements),k&&(f=!1),T&&(P=!0),se&&(pe=Z({},pl),ve=_n(null),se.html===!0&&(Z(pe,dl),Z(ve,hl)),se.svg===!0&&(Z(pe,Fr),Z(ve,zr),Z(ve,Ds)),se.svgFilters===!0&&(Z(pe,Br),Z(ve,zr),Z(ve,Ds)),se.mathMl===!0&&(Z(pe,Hr),Z(ve,gl),Z(ve,Ds))),ze.tagCheck=null,ze.attributeCheck=null,Ee(d,"ADD_TAGS")&&(typeof d.ADD_TAGS=="function"?ze.tagCheck=d.ADD_TAGS:Ze(d.ADD_TAGS)&&(pe===ke&&(pe=et(pe)),Z(pe,d.ADD_TAGS,Le))),Ee(d,"ADD_ATTR")&&(typeof d.ADD_ATTR=="function"?ze.attributeCheck=d.ADD_ATTR:Ze(d.ADD_ATTR)&&(ve===ge&&(ve=et(ve)),Z(ve,d.ADD_ATTR,Le))),Ee(d,"ADD_URI_SAFE_ATTR")&&Ze(d.ADD_URI_SAFE_ATTR)&&Z(Ft,d.ADD_URI_SAFE_ATTR,Le),Ee(d,"FORBID_CONTENTS")&&Ze(d.FORBID_CONTENTS)&&(Te===Oe&&(Te=et(Te)),Z(Te,d.FORBID_CONTENTS,Le)),Ee(d,"ADD_FORBID_CONTENTS")&&Ze(d.ADD_FORBID_CONTENTS)&&(Te===Oe&&(Te=et(Te)),Z(Te,d.ADD_FORBID_CONTENTS,Le)),ee&&(pe["#text"]=!0),_&&Z(pe,["html","head","body"]),pe.table&&(Z(pe,["tbody"]),delete yt.tbody),d.TRUSTED_TYPES_POLICY){if(typeof d.TRUSTED_TYPES_POLICY.createHTML!="function")throw $s('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof d.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw $s('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');A=d.TRUSTED_TYPES_POLICY,C=A.createHTML("")}else A===void 0&&(A=Xf(E,r)),A!==null&&typeof C=="string"&&(C=A.createHTML(""));Ye&&Ye(d),Rn=d},El=Z({},[...Fr,...Br,...Bf]),Al=Z({},[...Hr,...Hf]),yp=function(d){let y=O(d);(!y||!y.tagName)&&(y={namespaceURI:Bt,tagName:"template"});const D=Zn(d.tagName),ae=Zn(y.tagName);return Vr[d.namespaceURI]?d.namespaceURI===Xe?y.namespaceURI===ot?D==="svg":y.namespaceURI===$e?D==="svg"&&(ae==="annotation-xml"||qr[ae]):!!El[D]:d.namespaceURI===$e?y.namespaceURI===ot?D==="math":y.namespaceURI===Xe?D==="math"&&Wr[ae]:!!Al[D]:d.namespaceURI===ot?y.namespaceURI===Xe&&!Wr[ae]||y.namespaceURI===$e&&!qr[ae]?!1:!Al[D]&&(gp[D]||!El[D]):!!(Jn==="application/xhtml+xml"&&Vr[d.namespaceURI]):!1},wt=function(d){Tn(t.removed,{element:d});try{O(d).removeChild(d)}catch{S(d)}},dn=function(d,y){try{Tn(t.removed,{attribute:y.getAttributeNode(d),from:y})}catch{Tn(t.removed,{attribute:null,from:y})}if(y.removeAttribute(d),d==="is")if(P||T)try{wt(y)}catch{}else try{y.setAttribute(d,"")}catch{}},Rl=function(d){let y=null,D=null;if(I)d=""+d;else{const Ie=al(d,/^[\r\n\t ]+/);D=Ie&&Ie[0]}Jn==="application/xhtml+xml"&&Bt===ot&&(d=''+d+"");const ae=A?A.createHTML(d):d;if(Bt===ot)try{y=new w().parseFromString(ae,Jn)}catch{}if(!y||!y.documentElement){y=te.createDocument(Bt,"template",null);try{y.documentElement.innerHTML=jr?C:ae}catch{}}const De=y.body||y.documentElement;return d&&D&&De.insertBefore(n.createTextNode(D),De.childNodes[0]||null),Bt===ot?xe.call(y,_?"html":"body")[0]:_?y.documentElement:De},Cl=function(d){return W.call(d.ownerDocument||d,d,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Kr=function(d){return d instanceof g&&(typeof d.nodeName!="string"||typeof d.textContent!="string"||typeof d.removeChild!="function"||!(d.attributes instanceof p)||typeof d.removeAttribute!="function"||typeof d.setAttribute!="function"||typeof d.namespaceURI!="string"||typeof d.insertBefore!="function"||typeof d.hasChildNodes!="function")},Yr=function(d){return typeof a=="function"&&d instanceof a};function Ht(U,d,y){kn(U,D=>{D.call(t,d,y,Rn)})}const Pl=function(d){let y=null;if(Ht(Y.beforeSanitizeElements,d,null),Kr(d))return wt(d),!0;const D=Le(d.nodeName);if(Ht(Y.uponSanitizeElement,d,{tagName:D,allowedTags:pe}),v&&d.hasChildNodes()&&!Yr(d.firstElementChild)&&He(/<[/\w!]/g,d.innerHTML)&&He(/<[/\w!]/g,d.textContent)||v&&d.namespaceURI===ot&&D==="style"&&Yr(d.firstElementChild)||d.nodeType===An.progressingInstruction||v&&d.nodeType===An.comment&&He(/<[/\w]/g,d.data))return wt(d),!0;if(yt[D]||!(ze.tagCheck instanceof Function&&ze.tagCheck(D))&&!pe[D]){if(!yt[D]&&Ml(D)&&(le.tagNameCheck instanceof RegExp&&He(le.tagNameCheck,D)||le.tagNameCheck instanceof Function&&le.tagNameCheck(D)))return!1;if(ee&&!Te[D]){const ae=O(d)||d.parentNode,De=K(d)||d.childNodes;if(De&&ae){const Ie=De.length;for(let tt=Ie-1;tt>=0;--tt){const dt=R(De[tt],!0);ae.insertBefore(dt,V(d))}}}return wt(d),!0}return d instanceof l&&!yp(d)||(D==="noscript"||D==="noembed"||D==="noframes")&&He(/<\/no(script|embed|frames)/i,d.innerHTML)?(wt(d),!0):(k&&d.nodeType===An.text&&(y=d.textContent,kn([G,z,ue],ae=>{y=Sn(y,ae," ")}),d.textContent!==y&&(Tn(t.removed,{element:d.cloneNode()}),d.textContent=y)),Ht(Y.afterSanitizeElements,d,null),!1)},Il=function(d,y,D){if(Ct[y]||L&&(y==="id"||y==="name")&&(D in n||D in xp))return!1;const ae=ve[y]||ze.attributeCheck instanceof Function&&ze.attributeCheck(y,d);if(!(f&&!Ct[y]&&He(Se,y))){if(!(Ur&&He(We,y))){if(!ae||Ct[y]){if(!(Ml(d)&&(le.tagNameCheck instanceof RegExp&&He(le.tagNameCheck,d)||le.tagNameCheck instanceof Function&&le.tagNameCheck(d))&&(le.attributeNameCheck instanceof RegExp&&He(le.attributeNameCheck,y)||le.attributeNameCheck instanceof Function&&le.attributeNameCheck(y,d))||y==="is"&&le.allowCustomizedBuiltInElements&&(le.tagNameCheck instanceof RegExp&&He(le.tagNameCheck,D)||le.tagNameCheck instanceof Function&&le.tagNameCheck(D))))return!1}else if(!Ft[y]){if(!He(de,Sn(D,ce,""))){if(!((y==="src"||y==="xlink:href"||y==="href")&&d!=="script"&&ul(D,"data:")===0&&rt[d])){if(!(h&&!He(xt,Sn(D,ce,"")))){if(D)return!1}}}}}}return!0},wp=Z({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ml=function(d){return!wp[Zn(d)]&&He(N,d)},Ll=function(d){Ht(Y.beforeSanitizeAttributes,d,null);const y=d.attributes;if(!y||Kr(d))return;const D={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ve,forceKeepAttr:void 0};let ae=y.length;for(;ae--;){const De=y[ae],Ie=De.name,tt=De.namespaceURI,dt=De.value,vt=Le(Ie),Xr=dt;let Ne=Ie==="value"?Xr:Mf(Xr);if(D.attrName=vt,D.attrValue=Ne,D.keepAttr=!0,D.forceKeepAttr=void 0,Ht(Y.uponSanitizeAttribute,d,D),Ne=D.attrValue,H&&(vt==="id"||vt==="name")&&ul(Ne,q)!==0&&(dn(Ie,d),Ne=q+Ne),v&&He(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ne)){dn(Ie,d);continue}if(vt==="attributename"&&al(Ne,"href")){dn(Ie,d);continue}if(D.forceKeepAttr)continue;if(!D.keepAttr){dn(Ie,d);continue}if(!b&&He(/\/>/i,Ne)){dn(Ie,d);continue}k&&kn([G,z,ue],$l=>{Ne=Sn(Ne,$l," ")});const Ol=Le(d.nodeName);if(!Il(Ol,vt,Ne)){dn(Ie,d);continue}if(A&&typeof E=="object"&&typeof E.getAttributeType=="function"&&!tt)switch(E.getAttributeType(Ol,vt)){case"TrustedHTML":{Ne=A.createHTML(Ne);break}case"TrustedScriptURL":{Ne=A.createScriptURL(Ne);break}}if(Ne!==Xr)try{tt?d.setAttributeNS(tt,Ie,Ne):d.setAttribute(Ie,Ne),Kr(d)?wt(d):ll(t.removed)}catch{dn(Ie,d)}}Ht(Y.afterSanitizeAttributes,d,null)},Zr=function(d){let y=null;const D=Cl(d);for(Ht(Y.beforeSanitizeShadowDOM,d,null);y=D.nextNode();)Ht(Y.uponSanitizeShadowNode,y,null),Pl(y),Ll(y),y.content instanceof i&&Zr(y.content);Ht(Y.afterSanitizeShadowDOM,d,null)},Fs=function(d){if(d.nodeType===An.element&&d.shadowRoot instanceof i){const ae=d.shadowRoot;Fs(ae),Zr(ae)}const y=d.childNodes;if(!y)return;const D=[];kn(y,ae=>{Tn(D,ae)});for(const ae of D)Fs(ae)};return t.sanitize=function(U){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y=null,D=null,ae=null,De=null;if(jr=!U,jr&&(U=""),typeof U!="string"&&!Yr(U)&&(U=Nf(U),typeof U!="string"))throw $s("dirty is not a string, aborting");if(!t.isSupported)return U;if(M||Gr(d),t.removed=[],typeof U=="string"&&(fe=!1),fe){const dt=U.nodeName;if(typeof dt=="string"){const vt=Le(dt);if(!pe[vt]||yt[vt])throw $s("root node is forbidden and cannot be sanitized in-place")}Fs(U)}else if(U instanceof a)y=Rl(""),D=y.ownerDocument.importNode(U,!0),D.nodeType===An.element&&D.nodeName==="BODY"||D.nodeName==="HTML"?y=D:y.appendChild(D),Fs(D);else{if(!P&&!k&&!_&&U.indexOf("<")===-1)return A&&B?A.createHTML(U):U;if(y=Rl(U),!y)return P?null:B?C:""}y&&I&&wt(y.firstChild);const Ie=Cl(fe?U:y);for(;ae=Ie.nextNode();)Pl(ae),Ll(ae),ae.content instanceof i&&Zr(ae.content);if(fe)return U;if(P){if(k){y.normalize();let dt=y.innerHTML;kn([G,z,ue],vt=>{dt=Sn(dt,vt," ")}),y.innerHTML=dt}if(T)for(De=ne.call(y.ownerDocument);y.firstChild;)De.appendChild(y.firstChild);else De=y;return(ve.shadowroot||ve.shadowrootmode)&&(De=$.call(s,De,!0)),De}let tt=_?y.outerHTML:y.innerHTML;return _&&pe["!doctype"]&&y.ownerDocument&&y.ownerDocument.doctype&&y.ownerDocument.doctype.name&&He(Kf,y.ownerDocument.doctype.name)&&(tt=" -`+tt),k&&kn([G,z,ue],dt=>{tt=Sn(tt,dt," ")}),A&&B?A.createHTML(tt):tt},t.setConfig=function(){let U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Gr(U),M=!0},t.clearConfig=function(){Rn=null,M=!1},t.isValidAttribute=function(U,d,y){Rn||Gr({});const D=Le(U),ae=Le(d);return Il(D,ae,y)},t.addHook=function(U,d){typeof d=="function"&&Tn(Y[U],d)},t.removeHook=function(U,d){if(d!==void 0){const y=Pf(Y[U],d);return y===-1?void 0:If(Y[U],y,1)[0]}return ll(Y[U])},t.removeHooks=function(U){Y[U]=[]},t.removeAllHooks=function(){Y=bl()},t}var Qf=xl();const Jf={key:1,class:"flex min-w-0 max-w-[calc(100%-2.5rem)] flex-1 flex-col max-[600px]:max-w-[calc(100%-2.25rem)]"},ed={key:0,class:"flex w-fit flex-col items-start gap-1"},td=["aria-label"],nd={class:"inline-flex items-center gap-1.5"},sd={class:"text-[8px] font-semibold tracking-[0.12em] uppercase text-[#3a67c9]"},rd={key:1,class:"flex w-fit max-w-full flex-col items-start gap-2"},id={class:"chat-card relative w-fit max-w-full whitespace-pre-line rounded-[10px_10px_10px_3px] px-4 py-3 text-xs leading-relaxed wrap-anywhere text-slate-900"},od=["innerHTML"],ld={key:0,class:"pointer-events-none absolute inset-x-0 bottom-0 h-14 rounded-b-[10px] bg-linear-to-t from-white via-white/92 to-white/0","aria-hidden":"true"},ad={key:0,class:"flex flex-wrap items-center gap-2"},ud=["title","aria-label"],cd={key:1,class:"flex flex-wrap items-center"},fd=["title","aria-label"],dd={viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},pd=["innerHTML"],yl={__name:"ChatMessage",props:{message:{type:Object,required:!0},autoReadEnabled:{type:Boolean,default:!1},ttsConfig:{type:Object,default:()=>({enableVoiceChat:!1,pollyAvailable:!1,usePolly:!0,voiceId:"Zayd"})}},setup(e){const t=e,n=Q(!1),s=Q(null),r=Q(!1),i=Q(!1),o=Re(()=>typeof window!="undefined"&&"speechSynthesis"in window&&"SpeechSynthesisUtterance"in window);function a(A){typeof window!="undefined"&&window.dispatchEvent(new CustomEvent("changai-tts-provider",{detail:{provider:A}}))}function l(A){if(typeof A!="string")return"";const C=A.replace(/[\u{1F000}-\u{1FFFF}]/gu,"").replace(/[\u{2600}-\u{26FF}]/gu,"").replace(/[\u{2700}-\u{27BF}]/gu,"").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/#{1,6}\s+/g,"").replace(/[-*+]\s+/g,"").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/\s+/g," ");return C.includes("<")?(new DOMParser().parseFromString(A,"text/html").body.textContent||"").replace(/\s+/g," ").trim():C.trim()}function c(){o.value&&window.speechSynthesis.cancel(),s.value&&(s.value.pause(),s.value.src="",s.value=null),n.value=!1}function u(){var A,C,J;if(i.value=!i.value,i.value)c();else{const te=m.value;if(!t.autoReadEnabled||!((A=t.ttsConfig)!=null&&A.enableVoiceChat)||!te||E())return;if((C=t.ttsConfig)!=null&&C.pollyAvailable&&((J=t.ttsConfig)!=null&&J.usePolly)){g(te).catch(W=>{p(te)});return}p(te)}}function p(A){if(!o.value||!A)return;window.dispatchEvent(new CustomEvent("changai-tts-stop")),window.speechSynthesis.cancel();const C=new SpeechSynthesisUtterance(A);C.rate=1,C.pitch=1,C.onend=()=>{n.value=!1},C.onerror=()=>{n.value=!1},n.value=!0,a("browser"),window.speechSynthesis.speak(C)}async function g(A){var ne;const C=await Lc(A,((ne=t.ttsConfig)==null?void 0:ne.voiceId)||"Zayd");if(!(C!=null&&C.ok)||!(C!=null&&C.audio_base64))throw new Error((C==null?void 0:C.error)||"Polly synthesis failed");window.dispatchEvent(new CustomEvent("changai-tts-stop")),c();const J=(C==null?void 0:C.mime_type)||"audio/mpeg",te=new Audio(`data:${J};base64,${C.audio_base64}`);s.value=te,n.value=!0;let W=!1;te.onplay=()=>{W=!0,a("polly")},te.onended=()=>{s.value===te&&(s.value=null),n.value=!1},te.onerror=()=>{s.value===te&&(s.value=null),n.value=!1},await te.play(),W||a("polly")}function w(){c()}function E(){var A;return!!((A=t.message)!=null&&A.isStatus)}const m=Re(()=>{var A;return l(((A=t.message)==null?void 0:A.text)||"")}),R=Re(()=>{var A;return((A=t.message)==null?void 0:A.role)!=="user"&&E()}),S=Re(()=>{var A;return(A=t.message)!=null&&A.isStatus?t.message.statusType==="support"?"Sending to support":m.value||"Thinking":""}),V=Re(()=>{var J;if(((J=t.message)==null?void 0:J.role)==="user"||R.value)return!1;const A=m.value,C=A.split(/\n+/).filter(Boolean).length;return A.length>520||C>8}),K=Re(()=>{var A,C;return((A=t.message)==null?void 0:A.role)!=="user"&&!R.value&&((C=t.ttsConfig)==null?void 0:C.enableVoiceChat)}),O=Re(()=>{var C;const A=((C=t.message)==null?void 0:C.text)||"";return Qf.sanitize(be.parse(A))});return rn(()=>t.message.text,async(A,C)=>{var W,ne,xe;if(!t.autoReadEnabled||t.message.role==="user"||i.value)return;if(!((W=t.ttsConfig)!=null&&W.enableVoiceChat)){a("off");return}const J=l(A);if(!J||E())return;const te=l(C||"");if(J!==te){if((ne=t.ttsConfig)!=null&&ne.pollyAvailable&&((xe=t.ttsConfig)!=null&&xe.usePolly))try{await g(J);return}catch{}p(J)}}),rn(()=>t.message.text,()=>{r.value=!1,i.value=!1}),Hn(()=>{typeof window!="undefined"&&window.addEventListener("changai-tts-stop",w)}),xs(()=>{typeof window!="undefined"&&window.removeEventListener("changai-tts-stop",w),n.value&&c()}),(A,C)=>(F(),j("div",{class:ye(["motion-safe:animate-fade-rise flex w-full gap-1.5",e.message.role==="user"?"flex-col items-end":"items-start"])},[e.message.role!=="user"?(F(),St(Bo,{key:0})):Ve("",!0),e.message.role!=="user"?(F(),j("div",Jf,[R.value?(F(),j("div",ed,[x("div",{class:"chat-card inline-flex w-fit rounded-[10px_10px_10px_3px] px-3 py-2",role:"status","aria-live":"polite","aria-label":S.value},[x("div",nd,[C[1]||(C[1]=x("span",{class:"relative inline-flex h-4 w-4 shrink-0 items-center justify-center"},[x("span",{class:"absolute inset-0 rounded-full border border-transparent border-t-[#4b89ff] border-r-[#4b89ff]/70 animate-gemini-arc"}),x("svg",{viewBox:"0 0 24 24",class:"relative h-3 w-3 text-[#4b89ff] animate-gemini-spark","aria-hidden":"true"},[x("path",{fill:"currentColor",d:"M12 2.8c.52 3.22 1.6 5.66 3.22 7.28 1.62 1.62 4.06 2.7 7.28 3.22-3.22.52-5.66 1.6-7.28 3.22-1.62 1.62-2.7 4.06-3.22 7.28-.52-3.22-1.6-5.66-3.22-7.28-1.62-1.62-4.06-2.7-7.28-3.22 3.22-.52 5.66-1.6 7.28-3.22 1.62-1.62 2.7-4.06 3.22-7.28Z"})])],-1)),x("span",sd,Qe(S.value),1)])],8,td)])):(F(),j("div",rd,[x("div",id,[x("div",{class:ye(["overflow-x-auto",V.value&&!r.value?"max-h-48 overflow-y-hidden":""]),innerHTML:O.value},null,10,od),V.value&&!r.value?(F(),j("div",ld)):Ve("",!0)]),V.value?(F(),j("div",ad,[x("button",{type:"button",class:"inline-flex items-center rounded-full border border-slate-200 bg-white px-2.5 py-1 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-600 transition-colors duration-200 hover:border-brand-200 hover:text-brand-600",title:r.value?"Collapse response":"Expand response","aria-label":r.value?"Collapse response":"Expand response",onClick:C[0]||(C[0]=J=>r.value=!r.value)},Qe(r.value?"Collapse":"Expand"),9,ud)])):Ve("",!0),K.value?(F(),j("div",cd,[x("button",{type:"button",class:ye(["inline-flex h-8 w-8 items-center justify-center rounded-full border transition-colors duration-200",i.value?"border-red-200 bg-red-50 text-red-600 hover:border-red-300 hover:bg-red-100":"border-green-200 bg-green-50 text-green-600 hover:border-green-300 hover:bg-green-100"]),title:i.value?"Unmute voice playback":"Mute voice playback","aria-label":i.value?"Unmute voice playback":"Mute voice playback",onClick:u},[(F(),j("svg",dd,[C[6]||(C[6]=x("path",{d:"M11 5L6 9H3v6h3l5 4V5Z"},null,-1)),i.value?(F(),j(Be,{key:0},[C[2]||(C[2]=x("path",{d:"M15 9l4 6"},null,-1)),C[3]||(C[3]=x("path",{d:"M19 9l-4 6"},null,-1))],64)):(F(),j(Be,{key:1},[C[4]||(C[4]=x("path",{d:"M15 10a3 3 0 0 1 0 4"},null,-1)),C[5]||(C[5]=x("path",{d:"M17.5 7.5a6 6 0 0 1 0 9"},null,-1))],64))]))],10,fd)])):Ve("",!0)]))])):(F(),j("div",{key:2,class:"w-fit max-w-[85%] whitespace-pre-line rounded-[13px_13px_3px_13px] bg-linear-to-br from-brand-500 to-brand-600 px-4 py-3 text-[11px] leading-relaxed wrap-anywhere text-white shadow-[0_14px_30px_-18px_rgba(109,79,194,0.85)] max-[600px]:max-w-[88%]",innerHTML:O.value},null,8,pd))],2))}},hd={class:"flex flex-col gap-4 sm:gap-5"},gd={class:"motion-safe:animate-fade-rise flex w-full items-start gap-1.5"},md={__name:"ChatTab",props:{messages:{type:Array,required:!0},autoReadEnabled:{type:Boolean,default:!1},ttsConfig:{type:Object,required:!0}},setup(e){return(t,n)=>(F(),j("div",hd,[x("div",gd,[Me(Bo),n[0]||(n[0]=x("p",{class:"w-fit max-w-[calc(100%-2.5rem)] whitespace-pre-line rounded-[10px_10px_10px_3px] bg-brand-50 px-4 py-3 text-xs leading-relaxed wrap-anywhere text-slate-900 max-[600px]:max-w-[calc(100%-2.25rem)]"},[Ts(" Hello there 👋 I am ChangAI from "),x("a",{target:"_blank",href:"https://erpgulf.com",rel:"noopener noreferrer",style:{color:"#1e90ff"}},"ERPGulf.com"),Ts(", your ERP assistant."),x("br"),x("a",{target:"_blank",href:"https://app.erpgulf.com/en/articles/chang-ai-quick-start-guide",rel:"noopener noreferrer",style:{color:"#1e90ff"}},"ChangAI Quick Start Guide - Click here.")],-1))]),(F(!0),j(Be,null,ys(e.messages,(s,r)=>(F(),St(yl,{key:r,message:s,autoReadEnabled:e.autoReadEnabled,ttsConfig:e.ttsConfig},null,8,["message","autoReadEnabled","ttsConfig"]))),128))]))}};function wl(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function vl(e){var t,n;return(e==null?void 0:e.message)||((t=e==null?void 0:e.responseJSON)==null?void 0:t.exception)||((n=e==null?void 0:e.responseJSON)==null?void 0:n.message)||(e==null?void 0:e.responseText)||String(e)}function bd(e){return typeof e=="string"?e:e&&typeof e=="object"?e.error?`⚠️ ${e.error}`:e.answer||e.text||"":""}const xd={key:0,class:"rounded-lg bg-brand-50 px-4 py-3 text-xs text-black"},yd={class:"whitespace-pre-wrap wrap-anywhere text-[11px] leading-relaxed text-black"},wd={key:1,class:"mb-3 min-w-0 overflow-x-auto rounded-lg bg-brand-50 p-2 text-[11px]"},vd={class:"whitespace-pre-wrap wrap-anywhere text-[11px] leading-relaxed text-black"},_d={__name:"DebugTab",props:{logs:{type:Array,required:!0},currentDebug:{type:Object,default:null}},setup(e){const t=new Set(["gemini_json_content","private_key","private_key_id","client_secret","client_id","aws_access_key","aws_secret_key","api_key","token","access_token","refresh_token","password","secret","authorization","embed_version_id","llm_version_id","entity_retriever","retriever","deploy_url","support_api_url","get_ticket_details_url"]);function n(r,i=0){if(i>10||r===null||r===void 0||typeof r=="string"||typeof r=="number"||typeof r=="boolean")return r;if(Array.isArray(r))return r.map(o=>n(o,i+1));if(typeof r=="object"){const o={};for(const[a,l]of Object.entries(r))t.has(a.toLowerCase())||(o[a]=n(l,i+1));return o}return r}function s(r){return wl(n(r))}return(r,i)=>(F(),j("div",null,[e.logs.length===0?(F(),j("p",xd,"No debug data yet.")):Ve("",!0),(F(!0),j(Be,null,ys(e.logs,(o,a)=>(F(),j("div",{key:a,class:"mb-3 min-w-0 overflow-x-auto rounded-lg bg-gray-100 p-2 text-[11px]"},[x("pre",yd,Qe(s(o)),1)]))),128)),e.currentDebug?(F(),j("div",wd,[x("pre",vd,Qe(s(e.currentDebug)),1)])):Ve("",!0)]))}},kd={class:"flex flex-col gap-4 sm:gap-5"},Td={key:0,class:"chat-card motion-safe:animate-fade-rise rounded-lg px-4 py-3 text-xs text-slate-900"},Sd={__name:"SupportTab",props:{messages:{type:Array,required:!0},autoReadEnabled:{type:Boolean,default:!1},ttsConfig:{type:Object,required:!0}},setup(e){return(t,n)=>(F(),j("div",kd,[e.messages.length===0?(F(),j("p",Td,"Send a message to Support.")):Ve("",!0),(F(!0),j(Be,null,ys(e.messages,(s,r)=>(F(),St(yl,{key:r,message:s,autoReadEnabled:e.autoReadEnabled,ttsConfig:e.ttsConfig},null,8,["message","autoReadEnabled","ttsConfig"]))),128))]))}},Ed={class:"flex flex-col gap-4"},Ad={class:"chat-card motion-safe:animate-fade-rise rounded-xl p-4"},Rd={class:"flex items-start justify-between gap-4"},Cd=["aria-pressed","title"],Pd={class:"chat-card motion-safe:animate-fade-rise rounded-xl p-4"},Id={class:"flex items-start justify-between gap-4"},Md={class:"mt-2 text-[11px] text-slate-500"},Ld={key:0,class:"mt-1 text-[11px] text-slate-500"},Od={key:1,class:"mt-1 text-[11px] text-slate-500"},$d=["aria-pressed","disabled"],Dd={key:0,class:"mt-3 rounded-md bg-amber-50 px-2.5 py-2 text-xs text-amber-700"},Nd={key:1,class:"mt-3 rounded-md bg-amber-50 px-2.5 py-2 text-xs text-amber-700"},Fd={class:"chat-card motion-safe:animate-fade-rise rounded-xl p-4"},Bd={class:"flex items-start justify-between gap-4"},Hd=["aria-pressed","title"],zd={class:"chat-card motion-safe:animate-fade-rise rounded-xl p-4"},Ud={class:"flex items-start justify-between gap-4"},jd=["aria-pressed","title"],Vd={__name:"SettingsTab",props:{autoReadEnabled:{type:Boolean,required:!0},ttsConfig:{type:Object,required:!0},settings:{type:Object,default:null},debugEnabled:{type:Boolean,default:!1},sendNonERPtoaiEnabled:{type:Boolean,default:!1}},emits:["toggleAutoRead","togglePollyPreference","toggleDebug","toggleSendNonERP"],setup(e){const t=e,n=Re(()=>{var s,r;return(s=t.ttsConfig)!=null&&s.enableVoiceChat?(r=t.ttsConfig)!=null&&r.pollyAvailable?"Available":"Unavailable":"Voice disabled on server"});return(s,r)=>{var i,o,a,l,c,u,p,g,w,E,m,R,S,V,K;return F(),j("div",Ed,[r[10]||(r[10]=x("div",{class:"chat-card motion-safe:animate-fade-rise rounded-xl p-4 text-slate-900"},[x("h3",{class:"text-sm font-semibold tracking-[0.01em]"},"Speech Settings"),x("p",{class:"mt-1 text-xs leading-relaxed text-slate-600"},"These controls apply only inside this chatbot box for the current browser session.")],-1)),x("div",Ad,[x("div",Rd,[r[4]||(r[4]=x("div",null,[x("p",{class:"text-sm font-semibold text-slate-900"},"Auto Read Replies"),x("p",{class:"mt-1 text-xs text-slate-600"},"Automatically read bot replies aloud.")],-1)),x("button",{class:ye(["group relative h-7 w-12 shrink-0 rounded-full border border-slate-200 transition-all duration-200",e.autoReadEnabled?"bg-emerald-500/95":"bg-slate-300"]),"aria-pressed":e.autoReadEnabled?"true":"false",title:e.autoReadEnabled?"Disable auto read":"Enable auto read",onClick:r[0]||(r[0]=O=>s.$emit("toggleAutoRead"))},[x("span",{class:ye(["absolute top-0.5 h-5.5 w-5.5 rounded-full bg-white shadow-sm transition-all duration-200",e.autoReadEnabled?"left-[1.45rem]":"left-0.5"])},null,2)],10,Cd)]),x("p",{class:ye(["mt-3 text-[11px] font-medium",e.autoReadEnabled?"text-emerald-700":"text-slate-500"])},Qe(e.autoReadEnabled?"Auto read is active.":"Auto read is currently off."),3)]),x("div",Pd,[x("div",Id,[x("div",null,[r[5]||(r[5]=x("p",{class:"text-sm font-semibold text-slate-900"},"Use Amazon Polly",-1)),r[6]||(r[6]=x("p",{class:"mt-1 text-xs text-slate-600"},"Use Polly when available; otherwise browser speech is used automatically.",-1)),x("p",Md,"Availability: "+Qe(n.value),1),(i=e.settings)!=null&&i.aws_region?(F(),j("p",Ld,"Region: "+Qe(e.settings.aws_region),1)):Ve("",!0),(o=e.ttsConfig)!=null&&o.voiceId?(F(),j("p",Od,"Voice: "+Qe(e.ttsConfig.voiceId),1)):Ve("",!0)]),x("button",{class:ye(["relative h-7 w-12 shrink-0 rounded-full border border-slate-200 transition-all duration-200 disabled:cursor-not-allowed disabled:opacity-55",(a=e.ttsConfig)!=null&&a.usePolly&&((l=e.ttsConfig)!=null&&l.enableVoiceChat)&&((c=e.ttsConfig)!=null&&c.pollyAvailable)?"bg-emerald-500/95":"bg-slate-300"]),"aria-pressed":(u=e.ttsConfig)!=null&&u.usePolly&&((p=e.ttsConfig)!=null&&p.enableVoiceChat)&&((g=e.ttsConfig)!=null&&g.pollyAvailable)?"true":"false",disabled:!((w=e.ttsConfig)!=null&&w.pollyAvailable)||!((E=e.ttsConfig)!=null&&E.enableVoiceChat),onClick:r[1]||(r[1]=O=>s.$emit("togglePollyPreference"))},[x("span",{class:ye(["absolute top-0.5 h-5.5 w-5.5 rounded-full bg-white shadow-sm transition-all duration-200",(m=e.ttsConfig)!=null&&m.usePolly&&((R=e.ttsConfig)!=null&&R.enableVoiceChat)&&((S=e.ttsConfig)!=null&&S.pollyAvailable)?"left-[1.45rem]":"left-0.5"])},null,2)],10,$d)]),(V=e.ttsConfig)!=null&&V.enableVoiceChat?(K=e.ttsConfig)!=null&&K.pollyAvailable?Ve("",!0):(F(),j("p",Nd,"Polly is not available for this site. Browser speech will be used.")):(F(),j("p",Dd,"Voice chat is disabled in ChangAI Settings."))]),x("div",Fd,[x("div",Bd,[x("div",null,[r[7]||(r[7]=x("p",{class:"text-sm font-semibold text-slate-900"},"Enable Debug Tab",-1)),r[8]||(r[8]=x("p",{class:"mt-1 text-xs text-slate-600"}," Show or hide the Debug tab inside this chatbot. ",-1)),x("p",{class:ye(["mt-2 text-[11px] font-medium",e.debugEnabled?"text-emerald-700":"text-slate-500"])},Qe(e.debugEnabled?"Debug tab is active.":"Debug tab is currently off."),3)]),x("button",{type:"button",class:ye(["relative h-7 w-12 shrink-0 rounded-full border border-slate-200 transition-all duration-200",e.debugEnabled?"bg-emerald-500/95":"bg-slate-300"]),"aria-pressed":e.debugEnabled?"true":"false",title:e.debugEnabled?"Disable debug tab":"Enable debug tab",onClick:r[2]||(r[2]=O=>s.$emit("toggleDebug"))},[x("span",{class:ye(["absolute top-0.5 h-5.5 w-5.5 rounded-full bg-white shadow-sm transition-all duration-200",e.debugEnabled?"left-[1.45rem]":"left-0.5"])},null,2)],10,Hd)])]),x("div",zd,[x("div",Ud,[r[9]||(r[9]=x("div",null,[x("p",{class:"text-sm font-semibold text-slate-900"},"Send non-ERP questions directly to AI"),x("p",{class:"mt-1 text-xs text-slate-600"},"Questions unrelated to your ERP will skip the system and go straight to AI")],-1)),x("button",{class:ye(["group relative h-7 w-12 shrink-0 rounded-full border border-slate-200 transition-all duration-200",e.sendNonERPtoaiEnabled?"bg-emerald-500/95":"bg-slate-300"]),"aria-pressed":e.sendNonERPtoaiEnabled?"true":"false",title:e.sendNonERPtoaiEnabled?"Non-ERP questions are being sent directly to AI":"Enable direct AI reply for non-ERP questions",onClick:r[3]||(r[3]=O=>s.$emit("toggleSendNonERP"))},[x("span",{class:ye(["absolute top-0.5 h-5.5 w-5.5 rounded-full bg-white shadow-sm transition-all duration-200",e.sendNonERPtoaiEnabled?"left-[1.45rem]":"left-0.5"])},null,2)],10,jd)]),x("p",{class:ye(["mt-3 text-[11px] font-medium",e.sendNonERPtoaiEnabled?"text-emerald-700":"text-slate-500"])},Qe(e.sendNonERPtoaiEnabled?"Non-ERP questions are now routed directly to AI":"Direct AI routing is currently off"),3)])])}}},qd={key:0,class:"pointer-events-none absolute -top-14 left-0 right-0 z-20 flex justify-center px-2",role:"status","aria-live":"polite"},Wd={__name:"StatusToast",props:{visible:{type:Boolean,required:!0},message:{type:String,default:""},type:{type:String,default:"info"},dismissible:{type:Boolean,default:!0}},emits:["close"],setup(e){const t=e,n=Re(()=>t.type==="error"?"bg-red-50 text-red-700 ring-red-200":(t.type==="listening","bg-blue-50 text-blue-700 ring-blue-200")),s=Re(()=>t.type==="error"?"bg-red-500":t.type==="listening"?"bg-blue-500 animate-pulse":"bg-blue-500");return(r,i)=>(F(),St(Pu,{"enter-active-class":"transition duration-200 ease-out","enter-from-class":"translate-y-1 opacity-0","enter-to-class":"translate-y-0 opacity-100","leave-active-class":"transition duration-150 ease-in","leave-from-class":"translate-y-0 opacity-100","leave-to-class":"translate-y-1 opacity-0"},{default:Ni(()=>[e.visible?(F(),j("div",qd,[x("div",{class:ye(["pointer-events-auto flex max-w-[92%] items-start gap-2 rounded-lg px-3 py-2 text-xs shadow-lg ring-1",n.value])},[x("span",{class:ye(["mt-0.5 h-2 w-2 shrink-0 rounded-full",s.value])},null,2),x("span",null,Qe(e.message),1),e.dismissible?(F(),j("button",{key:0,type:"button",class:"ml-1 appearance-none border-0 text-current/80 transition hover:text-current focus:outline-none","aria-label":"Dismiss notification",onClick:i[0]||(i[0]=o=>r.$emit("close"))}," × ")):Ve("",!0)],2)])):Ve("",!0)]),_:1}))}},Gd={class:"relative w-full"},Kd=["placeholder","disabled"],Yd=["title","aria-label","disabled"],Zd={key:0,viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor","aria-hidden":"true"},Xd={key:1,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},Qd={key:2,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true",class:"animate-spin"},Jd=["title","aria-label","disabled"],ep={key:0,viewBox:"0 0 24 24",width:"18",height:"18",fill:"none","aria-hidden":"true",class:"text-rose-600 motion-safe:animate-stop-button-pulse"},tp={key:1,viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor","aria-hidden":"true"},np={__name:"ChatForm",props:{placeholder:{type:String,default:"Message..."},disabled:{type:Boolean,default:!1},isAwaitingResponse:{type:Boolean,default:!1}},emits:["submit","cancel"],setup(e,{expose:t,emit:n}){const s=e,r=n,i=Q(""),o=Q(null),a=Q(!1),l=Q(!1),c=Q(!1),u=Q(!1),p=Q(!1),g=Q(!1),w=Q(!1),E=Q(""),m=Q("info"),R=Q("Voice input is unavailable in this browser/context.");let S=null,V=null,K=null;const O=Q(""),A=Q(!1),C=Re(()=>c.value?"Requesting microphone permission...":u.value?"Starting voice input...":p.value?"Stopping voice input...":l.value?a.value?"Stop voice input":"Start voice input":"Voice input is unavailable in this browser/context"),J=Re(()=>s.isAwaitingResponse?"Stop response":"Send"),te=Re(()=>s.isAwaitingResponse?!1:s.disabled||!i.value.trim()),W=Re(()=>s.isAwaitingResponse?"bg-white border border-rose-100 shadow-[0_8px_20px_-12px_rgba(159,18,57,0.35)] hover:bg-rose-50":"bg-linear-to-br from-brand-500 to-brand-600 text-white shadow-[0_10px_24px_-16px_rgba(109,79,194,0.85)] hover:from-brand-600 hover:to-violet-700");function ne(){return typeof window=="undefined"?null:window.SpeechRecognition||window.webkitSpeechRecognition||null}function xe(){var pe;const ce=ne(),N=typeof window!="undefined"?window.isSecureContext:!1,de=typeof navigator!="undefined"&&!!((pe=navigator.mediaDevices)!=null&&pe.getUserMedia);l.value=!!(ce&&N&&de),N?(!de||!ce)&&(R.value="Voice input is not supported in this browser."):R.value="Voice input requires HTTPS (or localhost).",ce&&l.value&&(S=new ce,S.continuous=!0,S.interimResults=!0,S.lang=typeof navigator!="undefined"&&navigator.language||"en-US",S.onstart=()=>{a.value=!0,u.value=!1,p.value=!1,$(),Se("Listening... Tap mic to stop","listening",{persistent:!0,key:"listening"})},S.onend=()=>{a.value=!1,u.value=!1,p.value=!1,$(),O.value==="listening"&&We(),A.value&&(A.value=!1,xt())},S.onerror=ke=>{if(a.value=!1,u.value=!1,p.value=!1,$(),A.value=!1,(ke==null?void 0:ke.error)==="not-allowed"||(ke==null?void 0:ke.error)==="service-not-allowed"){Se("Microphone permission denied. Please allow microphone access in browser settings.","error");return}if((ke==null?void 0:ke.error)==="audio-capture"){Se("No microphone detected. Please connect a microphone and try again.","error");return}if((ke==null?void 0:ke.error)==="no-speech"){Se("No speech detected. Try speaking a bit louder.","info");return}Se("Voice input failed. Please try again.","error")},S.onresult=ke=>{let ve="";for(let ge=ke.resultIndex;ge{if(S&&!(!a.value&&!p.value))try{S.abort()}catch{p.value=!1,A.value=!1}},1200)}}function G(){if(!l.value||!S){Se(R.value,"error");return}if(a.value||u.value||p.value){Y({submitAfterStop:a.value});return}ue()}async function z(){var ce;if(g.value)return!0;if(!((ce=navigator.mediaDevices)!=null&&ce.getUserMedia))return Se("Microphone API is unavailable in this browser.","error"),!1;c.value=!0,Se("Requesting microphone permission...","info",{persistent:!0,key:"requesting"});try{return(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach(de=>de.stop()),g.value=!0,!0}catch(N){return(N==null?void 0:N.name)==="NotAllowedError"||(N==null?void 0:N.name)==="SecurityError"?Se("Microphone permission denied. Please allow it and try again.","error"):(N==null?void 0:N.name)==="NotFoundError"?Se("No microphone found on this device.","error"):Se("Unable to access microphone. Please check browser permissions.","error"),!1}finally{c.value=!1,O.value==="requesting"&&We()}}async function ue(){var N;if(!(!S||a.value||u.value||p.value||!await z()||!S)){A.value=!1,(N=o.value)==null||N.focus(),u.value=!0;try{S.start()}catch(de){u.value=!1,p.value=!1,(de==null?void 0:de.name)!=="InvalidStateError"&&Se("Unable to start voice input. Please try again.","error")}}}function Se(ce,N="info",de={}){const{duration:pe=4200,persistent:ke=!1,key:ve=""}=de;E.value=ce,m.value=N,O.value=ve,w.value=!0,V&&clearTimeout(V),ke||(V=setTimeout(()=>{w.value=!1,O.value=""},pe))}function We(){w.value=!1,O.value="",V&&(clearTimeout(V),V=null)}function xt(){if(s.isAwaitingResponse){r("cancel");return}const ce=i.value.trim();ce&&((a.value||u.value||p.value)&&S&&Y({submitAfterStop:!1}),r("submit",ce),i.value="")}return t({focus:()=>{var ce;return(ce=o.value)==null?void 0:ce.focus()}}),Hn(()=>{xe()}),xs(()=>{if(S&&(a.value||u.value||p.value)){A.value=!1,$();try{S.abort()}catch{}}$(),We()}),(ce,N)=>(F(),j("div",Gd,[x("form",{class:"group flex min-h-11 items-center gap-2 rounded-full border border-slate-200/90 bg-white/95 px-3 shadow-[0_12px_26px_-20px_rgba(15,23,42,0.7)] transition-all duration-250 focus-within:-translate-y-0.5 focus-within:border-brand-200 focus-within:shadow-[0_18px_30px_-20px_rgba(13,110,253,0.5)] focus-within:ring-2 focus-within:ring-brand-500/25",style:{"border-radius":"9999px"},autocomplete:"off",onSubmit:ct(xt,["prevent"]),onClick:N[5]||(N[5]=ct(()=>{},["stop"])),onMousedown:N[6]||(N[6]=ct(()=>{},["stop"])),onKeydown:N[7]||(N[7]=ct(()=>{},["stop"])),onKeyup:N[8]||(N[8]=ct(()=>{},["stop"]))},[Pa(x("input",{ref_key:"inputRef",ref:o,type:"text","onUpdate:modelValue":N[0]||(N[0]=de=>i.value=de),class:"h-11 w-full border-none bg-transparent text-sm font-medium text-slate-800 placeholder:text-slate-400 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",placeholder:e.disabled?"Waiting for response...":e.placeholder,disabled:e.disabled,required:"",onKeydown:N[1]||(N[1]=ct(()=>{},["stop"])),onKeyup:N[2]||(N[2]=ct(()=>{},["stop"])),onKeypress:N[3]||(N[3]=ct(()=>{},["stop"])),onInput:N[4]||(N[4]=ct(()=>{},["stop"]))},null,40,Kd),[[Xu,i.value]]),x("button",{type:"button",class:ye(["grid h-8 w-8 shrink-0 appearance-none place-items-center rounded-full border border-transparent text-slate-600 transition-all duration-200 hover:-translate-y-0.5 hover:border-slate-200 hover:bg-slate-100 hover:text-slate-900 focus:outline-none disabled:cursor-not-allowed disabled:opacity-40",a.value?"border-red-200 bg-red-100 text-red-600 shadow-[0_10px_20px_-18px_rgba(220,38,38,0.9)] hover:bg-red-100 hover:text-red-600":""]),style:{"border-radius":"9999px"},title:C.value,"aria-label":C.value,disabled:e.disabled||!l.value||c.value||u.value||p.value,onClick:G},[a.value&&!c.value?(F(),j("svg",Zd,N[9]||(N[9]=[x("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"},null,-1)]))):c.value?(F(),j("svg",Qd,N[11]||(N[11]=[x("circle",{cx:"12",cy:"12",r:"9",opacity:"0.3"},null,-1),x("path",{d:"M21 12a9 9 0 0 1-9 9"},null,-1)]))):(F(),j("svg",Xd,N[10]||(N[10]=[x("path",{d:"M12 3a3 3 0 0 0-3 3v6a3 3 0 0 0 6 0V6a3 3 0 0 0-3-3z"},null,-1),x("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"},null,-1),x("path",{d:"M12 19v3"},null,-1)])))],10,Yd),x("button",{type:"submit",title:J.value,"aria-label":J.value,class:ye(["grid h-8 w-8 shrink-0 appearance-none place-items-center rounded-full border-0 transition-all duration-200 hover:-translate-y-0.5 focus:outline-none disabled:cursor-not-allowed disabled:opacity-40",W.value]),style:{"border-radius":"9999px"},disabled:te.value},[e.isAwaitingResponse?(F(),j("svg",ep,N[12]||(N[12]=[x("circle",{cx:"12",cy:"12",r:"8",stroke:"currentColor","stroke-width":"2.1",class:"opacity-95"},null,-1),x("rect",{x:"9",y:"9",width:"6",height:"6",rx:"1.35",fill:"currentColor"},null,-1)]))):(F(),j("svg",tp,N[13]||(N[13]=[x("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.59 5.58L20 12l-8-8-8 8z"},null,-1)])))],10,Jd)],32),Me(Wd,{visible:w.value,message:E.value,type:m.value,dismissible:m.value!=="listening",onClose:We},null,8,["visible","message","type","dismissible"])]))}},sp={class:"relative overflow-hidden bg-linear-to-br from-brand-600 via-brand-500 to-violet-400"},rp={class:"min-w-0"},ip={key:1,class:"border-t border-slate-200/80 bg-white/90 px-3 py-3 pb-[calc(12px+env(safe-area-inset-bottom))] backdrop-blur-sm sm:px-4 sm:py-4"},op=56,lp={__name:"ChatbotPopup",props:{isOpen:{type:Boolean,required:!0},activeTab:{type:String,required:!0},debugEnabled:{type:Boolean,default:!1},sendNonERPtoaiEnabled:{type:Boolean,default:!1},chatHistory:{type:Array,required:!0},debugLogs:{type:Array,required:!0},currentDebug:{type:Object,default:null},supportHistory:{type:Array,required:!0},autoReadEnabled:{type:Boolean,required:!0},ttsConfig:{type:Object,required:!0},activeTtsProvider:{type:String,required:!0},settings:{type:Object,default:null},isAwaitingResponse:{type:Boolean,default:!1}},emits:["close","submit","cancelResponse","update:activeTab","toggleAutoRead","togglePollyPreference","toggleDebug","toggleSendNonERP"],setup(e,{expose:t,emit:n}){const s=e,r=n,i=Q(null),o=Q(null),a=Q(s.activeTab),l=Q("default"),c=Q(!1);function u(){const m=i.value;if(!s.isOpen||!m){c.value=!1;return}const R=m.scrollHeight-m.clientHeight;if(R<=4){c.value=!1;return}const S=R-m.scrollTop;c.value=S>op}function p(){const m=i.value;m&&(m.scrollTo({top:m.scrollHeight,behavior:"smooth"}),setTimeout(()=>{u()},220))}function g(){Tt(()=>{u()})}function w(){if(l.value==="default"){l.value="half";return}if(l.value==="half"){l.value="full";return}l.value="default"}const E=Re(()=>{const m="chat-shell fixed z-[9999] flex min-h-0 flex-col overflow-hidden border border-slate-200/80 shadow-[0_32px_80px_-44px_rgba(2,6,23,0.7),0_18px_40px_-24px_rgba(15,23,42,0.45)] transition-all duration-300 ease-out origin-bottom-right",R=s.isOpen?"pointer-events-auto opacity-100 translate-x-0 translate-y-0 scale-100 motion-safe:animate-surface-in":"pointer-events-none opacity-0 translate-x-1/5 translate-y-8 scale-95";return l.value==="full"?[m,R,"inset-0 h-screen w-screen max-h-screen max-w-screen rounded-none origin-center"]:l.value==="half"?[m,R,"bottom-[74px] right-5 h-[min(86vh,860px)] w-[min(50vw,860px)] rounded-2xl","max-[900px]:bottom-[78px] max-[900px]:right-3 max-[900px]:h-[min(86vh,760px)] max-[900px]:w-[min(70vw,760px)] max-[900px]:rounded-[14px]","max-[600px]:inset-0 max-[600px]:h-screen max-[600px]:w-screen max-[600px]:max-h-screen max-[600px]:max-w-screen max-[600px]:rounded-none max-[600px]:pb-[env(safe-area-inset-bottom)]"]:[m,R,"bottom-[74px] right-5 h-[min(560px,72vh)] w-[min(360px,calc(100vw-40px))] rounded-2xl","max-[900px]:bottom-[78px] max-[900px]:right-3 max-[900px]:h-[min(70vh,540px)] max-[900px]:w-[min(360px,calc(100vw-24px))] max-[900px]:rounded-[14px]","max-[600px]:inset-0 max-[600px]:h-screen max-[600px]:w-screen max-[600px]:max-h-screen max-[600px]:max-w-screen max-[600px]:rounded-none max-[600px]:pb-[env(safe-area-inset-bottom)]"]});return rn(()=>s.activeTab,m=>{a.value=m,g()}),rn(()=>s.isOpen,m=>{m&&a.value!=="settings"&&Tt(()=>{var R;return(R=o.value)==null?void 0:R.focus()}),g()}),rn(a,m=>{r("update:activeTab",m),g()}),rn(()=>[s.chatHistory.length,s.supportHistory.length,s.debugLogs.length,s.currentDebug],()=>{g()}),rn(()=>s.debugEnabled,m=>{!m&&a.value==="debug"&&(a.value="chat"),g()}),Hn(()=>{g()}),t({scrollToBottom(){Tt(()=>{p()})}}),(m,R)=>(F(),j("div",{class:ye(E.value),onKeydown:R[9]||(R[9]=ct(()=>{},["stop"])),onKeyup:R[10]||(R[10]=ct(()=>{},["stop"])),onKeypress:R[11]||(R[11]=ct(()=>{},["stop"]))},[R[14]||(R[14]=x("div",{class:"pointer-events-none absolute -right-14 -top-14 h-36 w-36 rounded-full bg-brand-500/15 blur-2xl"},null,-1)),R[15]||(R[15]=x("div",{class:"pointer-events-none absolute -bottom-14 -left-12 h-32 w-32 rounded-full bg-violet-400/15 blur-2xl"},null,-1)),x("div",sp,[R[12]||(R[12]=x("div",{class:"pointer-events-none absolute inset-0 opacity-45",style:{background:"linear-gradient(120deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.02) 52%, rgba(255,255,255,0.12) 100%)"}},null,-1)),Me(vc,{windowMode:l.value,autoReadEnabled:e.autoReadEnabled,activeTtsProvider:e.activeTtsProvider,onClose:R[0]||(R[0]=S=>m.$emit("close")),onCycleResize:w,onToggleAutoRead:R[1]||(R[1]=S=>m.$emit("toggleAutoRead"))},null,8,["windowMode","autoReadEnabled","activeTtsProvider"]),Me(Sc,{modelValue:a.value,"onUpdate:modelValue":R[2]||(R[2]=S=>a.value=S),debugEnabled:e.debugEnabled},null,8,["modelValue","debugEnabled"])]),x("div",{class:"chat-scrollbar min-h-0 flex-1 overflow-x-hidden overflow-y-scroll bg-slate-50/60 px-4 py-4 max-[900px]:px-3.5 max-[900px]:py-3.5 max-[600px]:px-3 max-[600px]:py-3",ref_key:"chatBodyRef",ref:i,onScrollPassive:u},[x("div",rp,[a.value==="chat"?(F(),St(md,{key:0,messages:e.chatHistory,autoReadEnabled:e.autoReadEnabled,ttsConfig:e.ttsConfig},null,8,["messages","autoReadEnabled","ttsConfig"])):a.value==="debug"&&e.debugEnabled?(F(),St(_d,{key:1,logs:e.debugLogs,currentDebug:e.currentDebug},null,8,["logs","currentDebug"])):a.value==="support"?(F(),St(Sd,{key:2,messages:e.supportHistory,autoReadEnabled:e.autoReadEnabled,ttsConfig:e.ttsConfig},null,8,["messages","autoReadEnabled","ttsConfig"])):a.value==="settings"?(F(),St(Vd,{key:3,autoReadEnabled:e.autoReadEnabled,ttsConfig:e.ttsConfig,settings:e.settings,debugEnabled:e.debugEnabled,sendNonERPtoaiEnabled:e.sendNonERPtoaiEnabled,onToggleAutoRead:R[3]||(R[3]=S=>m.$emit("toggleAutoRead")),onTogglePollyPreference:R[4]||(R[4]=S=>m.$emit("togglePollyPreference")),onToggleDebug:R[5]||(R[5]=S=>m.$emit("toggleDebug")),onToggleSendNonERP:R[6]||(R[6]=S=>m.$emit("toggleSendNonERP"))},null,8,["autoReadEnabled","ttsConfig","settings","debugEnabled","sendNonERPtoaiEnabled"])):Ve("",!0)])],544),c.value?(F(),j("button",{key:0,type:"button",class:ye(["absolute right-4 z-20 grid h-9 w-9 place-items-center rounded-full border border-brand-200/70 bg-white/95 text-brand-600 shadow-[0_14px_26px_-16px_rgba(15,23,42,0.65)] transition-all duration-200 hover:-translate-y-0.5 hover:border-brand-300 hover:text-brand-700 focus:outline-none",a.value!=="settings"?"bottom-[calc(90px+env(safe-area-inset-bottom))] sm:bottom-[96px]":"bottom-4 sm:bottom-5"]),title:"Scroll to bottom","aria-label":"Scroll to bottom",onClick:p},R[13]||(R[13]=[x("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},[x("path",{d:"M7 10l5 5 5-5"})],-1)]),2)):Ve("",!0),a.value!=="settings"?(F(),j("div",ip,[Me(np,{ref_key:"chatFormRef",ref:o,placeholder:a.value==="support"?"Message Support...":"Message...",disabled:a.value==="chat"&&e.isAwaitingResponse,isAwaitingResponse:a.value==="chat"&&e.isAwaitingResponse,onSubmit:R[7]||(R[7]=S=>m.$emit("submit",S)),onCancel:R[8]||(R[8]=S=>m.$emit("cancelResponse"))},null,8,["placeholder","disabled","isAwaitingResponse"])])):Ve("",!0)],34))}},_l="changai_chat_id",kl="changai_polly_enabled";function ap(){let e=sessionStorage.getItem(_l);return e||(e=`session_${Date.now()}_${crypto.randomUUID()}`,sessionStorage.setItem(_l,e)),e}function up(){const e=localStorage.getItem(kl);return e===null?!0:e==="true"}function cp(e){localStorage.setItem(kl,String(!!e))}const fp={__name:"App",setup(e){const t=Q(!1),n=Q("chat"),s=Q([]),r=Q([]),i=Q(!1),o=Q([]),a=Q(null),l=Q("actual"),c=Q(!0),u=Q(null),p=Q(!1),g=Q(null),w=Q(!1),E=Q({enableVoiceChat:!1,pollyAvailable:!1,usePolly:!0,voiceId:"Zayd",enable_changai:!1}),m=Q("off"),R=Q(null),S=Re(()=>R.value!==null);function V(){if(!E.value.enableVoiceChat){m.value="off";return}m.value=E.value.usePolly?"polly":"browser"}function K(G){var ue;const z=(ue=G==null?void 0:G.detail)==null?void 0:ue.provider;(z==="polly"||z==="browser"||z==="off")&&(m.value=z)}async function O(){var ue,Se,We,xt,ce;if(!(p.value||u.value)){p.value=!0;try{u.value=await Mc(l.value),E.value={enableVoiceChat:!!((ue=u.value)!=null&&ue.enable_voice_chat),pollyAvailable:!!((Se=u.value)!=null&&Se.polly_enabled),usePolly:!!((We=u.value)!=null&&We.polly_enabled)&&up(),voiceId:((xt=u.value)==null?void 0:xt.polly_voice_id)||"Zayd",enable_changai:!!((ce=u.value)!=null&&ce.enable_changai)},V(),r.value.push({type:"settings",settings:u.value})}catch(N){const de=vl(N);r.value.push({type:"settings",error:de})}finally{p.value=!1}}}function A(){t.value=!t.value}function C(){var G;(G=a.value)==null||G.scrollToBottom()}function J(){c.value=!c.value}function te(){const G=!E.value.usePolly;E.value={...E.value,usePolly:G&&E.value.pollyAvailable},cp(E.value.usePolly),V()}function W(){w.value=!w.value}async function ne(G){n.value==="support"?await Y(G):await xe(G)}async function xe(G){var ve;g.value=null,l.value==="actual"&&await O(),s.value.push({role:"user",text:G}),await Tt(),C();const z=us({role:"model",text:"Thinking...",cancelable:!0,isStatus:!0,statusType:"thinking"});s.value.push(z),await Tt(),C();let ue=!1;const Se=ap(),We=`${Se}_${Date.now()}`,xt=w.value,ce=Pc(G,Se,l.value,We,w.value),N=`debug_${We}`;let de=Date.now();const pe=[],ke=ge=>{var ze;const le=Date.now(),yt=((le-de)/1e3).toFixed(2);de=le;const Ct=`${ge.message} (${yt}s)`;if(ge.message&&(pe.push(Ct),g.value=Ct),!ge.done&&ge.message&&(z.text=ge.message,z.statusType="pipeline"),ge.done){z.cancelable=!1,ge.error?(z.text=`⚠️ ${ge.message||"Something failed"}`,z.isStatus=!1,z.statusType=null):(ze=ge.data)!=null&&ze.answer&&(z.text=ge.data.answer,z.isStatus=!1,z.statusType=null),frappe.realtime.off(N),g.value=null;return}};frappe.realtime.on(N,ke),R.value=()=>{ue||(ue=!0,ce.cancel(),frappe.realtime.off(N),z.isStatus=!1,z.statusType=null,z.text="Cancelled by user.",r.value.push({type:"cancelled",user:G,steps:[...pe]}),g.value=null,z.cancelable=!1,R.value=null)};try{const ge=await ce.promise;if(ue)return;z.cancelable=!1;const le=((ve=bd(ge==null?void 0:ge.Bot))==null?void 0:ve.trim())||"No response.";z.isStatus=!1,z.statusType=null,z.text=le,r.value.push({type:"success",user:G,steps:[...pe],final_response:ge}),g.value=null}catch(ge){if(ue)return;frappe.realtime.off(N),z.cancelable=!1,z.isStatus=!1,z.statusType=null;const le=vl(ge);g.value=null,r.value.push({type:"failed",user:G,steps:[...pe],error:le}),z.isStatus=!1,z.statusType=null,z.text="⚠️ Something went wrong. Please try again."}finally{frappe.realtime.off(N),ue||(R.value=null)}await Tt(),C()}function $(){var G;(G=R.value)==null||G.call(R)}async function Y(G){o.value.push({role:"user",text:G}),await Tt(),C();const z=us({role:"model",text:"Sending to support...",isStatus:!0,statusType:"support"});o.value.push(z),await Tt(),C();try{const ue=await Ic(G,l.value);z.text=ue?wl(ue):"Support request sent successfully."}catch{z.text="⚠️ Failed to reach support. Please try again."}await Tt(),C()}return Hn(()=>{typeof window!="undefined"&&window.addEventListener("changai-tts-provider",K),l.value==="actual"&&O()}),xs(()=>{typeof window!="undefined"&&window.removeEventListener("changai-tts-provider",K)}),(G,z)=>(F(),j(Be,null,[E.value.enable_changai?(F(),St(ac,{key:0,isOpen:t.value,onToggle:A},null,8,["isOpen"])):Ve("",!0),Me(lp,{ref_key:"popupRef",ref:a,isOpen:t.value,activeTab:n.value,"onUpdate:activeTab":z[0]||(z[0]=ue=>n.value=ue),chatHistory:s.value,debugLogs:r.value,currentDebug:g.value,supportHistory:o.value,autoReadEnabled:c.value,ttsConfig:E.value,activeTtsProvider:m.value,settings:u.value,isAwaitingResponse:S.value,debugEnabled:i.value,sendNonERPtoaiEnabled:w.value,onToggleDebug:z[1]||(z[1]=ue=>i.value=!i.value),onClose:z[2]||(z[2]=ue=>t.value=!1),onSubmit:ne,onCancelResponse:$,onToggleAutoRead:J,onTogglePollyPreference:te,onToggleSendNonERP:W},null,8,["isOpen","activeTab","chatHistory","debugLogs","currentDebug","supportHistory","autoReadEnabled","ttsConfig","activeTtsProvider","settings","isAwaitingResponse","debugEnabled","sendNonERPtoaiEnabled"])],64))}};function dp(){const e=document.querySelector('link[href*="/assets/changai/dist/changai-chatbot.css"]');if(e!=null&&e.href)return e.href;const t=Array.from(document.scripts).find(n=>{var s;return(s=n.src)==null?void 0:s.includes("/assets/changai/dist/changai-chatbot.js")});return t!=null&&t.src?t.src.replace(/changai-chatbot\.js(\?.*)?$/,"changai-chatbot.css$1"):null}function pp(e){const t=dp();if(!t){const n=Array.from(document.querySelectorAll("style[data-vite-dev-id]"));return n.length&&n.forEach(s=>{const r=document.createElement("style");r.dataset.changaiShadowDevStyle="1",r.textContent=s.textContent||"",e.appendChild(r)}),Promise.resolve()}return e.querySelector('link[data-changai-shadow-style="1"]')?Promise.resolve():new Promise(n=>{const s=document.createElement("link");s.rel="stylesheet",s.href=t,s.dataset.changaiShadowStyle="1",s.onload=()=>n(),s.onerror=()=>n(),e.appendChild(s),setTimeout(n,1200)})}async function Tl(){if(document.getElementById("changai-chatbot-host"))return;const e=document.createElement("div");e.id="changai-chatbot-host",document.body.appendChild(e);const t=e.attachShadow({mode:"open"});await pp(t);const n=document.createElement("div");n.id="changai-chatbot-root",t.appendChild(n),nc(fp).mount(n);function s(r){r.stopPropagation()}n.addEventListener("keydown",s),n.addEventListener("keyup",s),n.addEventListener("keypress",s)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Tl):Tl()})(); +Please report this to https://github.com/markedjs/marked.`,e){let s="

An error occurred:

"+Rt(n.message+"",!0)+"
";return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}}},fn=new vf;function xe(e,t){return fn.parse(e,t)}xe.options=xe.setOptions=function(e){return fn.setOptions(e),xe.defaults=fn.defaults,Ho(xe.defaults),xe},xe.getDefaults=Sr,xe.defaults=un,xe.use=function(...e){return fn.use(...e),xe.defaults=fn.defaults,Ho(xe.defaults),xe},xe.walkTokens=function(e,t){return fn.walkTokens(e,t)},xe.parseInline=fn.parseInline,xe.Parser=bt,xe.parser=bt.parse,xe.Renderer=Os,xe.TextRenderer=Or,xe.Lexer=mt,xe.lexer=mt.lex,xe.Tokenizer=Ls,xe.Hooks=Yn,xe.parse=xe,xe.options,xe.setOptions,xe.use,xe.walkTokens,xe.parseInline,bt.parse,mt.lex;function sl(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=Array(t);n2?s-2:0),i=2;i1?n-1:0),r=1;r1?n-1:0),r=1;r2&&arguments[2]!==void 0?arguments[2]:Zn;if(il&&il(e,null),!Ze(t))return e;let s=t.length;for(;s--;){let r=t[s];if(typeof r=="string"){const i=n(r);i!==r&&(Af(t)||(t[s]=i),r=i)}e[r]=!0}return e}function Df(e){for(let t=0;t/g),jf=ft(/\${[\w\W]*/g),Vf=ft(/^data-[\-\w.\u00B7-\uFFFF]+$/),qf=ft(/^aria-[\-\w]+$/),ml=ft(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Wf=ft(/^(?:\w+script|data):/i),Gf=ft(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Kf=ft(/^html$/i),Yf=ft(/^[a-z][.\w]*(-[.\w]+)+$/i),An={element:1,text:3,progressingInstruction:7,comment:8,document:9},Zf=function(){return typeof window=="undefined"?null:window},Xf=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let s=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(s=n.getAttribute(r));const i="dompurify"+(s?"#"+s:"");try{return t.createPolicy(i,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return null}},bl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function xl(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Zf();const t=V=>xl(V);if(t.version="3.4.3",t.removed=[],!e||!e.document||e.document.nodeType!==An.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const s=n,r=s.currentScript,i=e.DocumentFragment,o=e.HTMLTemplateElement,a=e.Node,l=e.Element,c=e.NodeFilter,u=e.NamedNodeMap,p=u===void 0?e.NamedNodeMap||e.MozNamedAttrMap:u,g=e.HTMLFormElement,w=e.DOMParser,E=e.trustedTypes,m=l.prototype,A=En(m,"cloneNode"),T=En(m,"remove"),W=En(m,"nextSibling"),K=En(m,"childNodes"),O=En(m,"parentNode");if(typeof o=="function"){const V=n.createElement("template");V.content&&V.content.ownerDocument&&(n=V.content.ownerDocument)}let z,P="";const I=n,re=I.implementation,j=I.createNodeIterator,te=I.createDocumentFragment,ue=I.getElementsByTagName,$=s.importNode;let Z=bl();t.isSupported=typeof rl=="function"&&typeof O=="function"&&re&&re.createHTMLDocument!==void 0;const Y=zf,B=Uf,ce=jf,Se=Vf,We=qf,xt=Wf,fe=Gf,N=Yf;let pe=ml,he=null;const ke=X({},[...dl,...Fr,...Br,...Hr,...pl]);let ve=null;const me=X({},[...hl,...zr,...gl,...Ds]);let le=Object.seal(_n(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),yt=null,Ct=null;const ze=Object.seal(_n(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ur=!0,f=!0,h=!1,b=!0,k=!1,v=!0,_=!1,M=!1,C=!1,R=!1,S=!1,H=!1,L=!0,U=!1;const G="user-content-";let ee=!0,de=!1,ne={},Te=null;const Oe=X({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let rt=null;const it=X({},["audio","video","img","source","image","track"]);let Ft=null;const Qn=X({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),$e="http://www.w3.org/1998/Math/MathML",Xe="http://www.w3.org/2000/svg",ot="http://www.w3.org/1999/xhtml";let Bt=ot,jr=!1,Vr=null;const hp=X({},[$e,Xe,ot],Nr);let qr=X({},["mi","mo","mn","ms","mtext"]),Wr=X({},["annotation-xml"]);const gp=X({},["title","style","font","a","script"]);let Jn=null;const mp=["application/xhtml+xml","text/html"],bp="text/html";let Le=null,Rn=null;const xp=n.createElement("form"),Sl=function(d){return d instanceof RegExp||d instanceof Function},Gr=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Rn&&Rn===d)return;(!d||typeof d!="object")&&(d={}),d=et(d),Jn=mp.indexOf(d.PARSER_MEDIA_TYPE)===-1?bp:d.PARSER_MEDIA_TYPE,Le=Jn==="application/xhtml+xml"?Nr:Zn,he=Ee(d,"ALLOWED_TAGS")&&Ze(d.ALLOWED_TAGS)?X({},d.ALLOWED_TAGS,Le):ke,ve=Ee(d,"ALLOWED_ATTR")&&Ze(d.ALLOWED_ATTR)?X({},d.ALLOWED_ATTR,Le):me,Vr=Ee(d,"ALLOWED_NAMESPACES")&&Ze(d.ALLOWED_NAMESPACES)?X({},d.ALLOWED_NAMESPACES,Nr):hp,Ft=Ee(d,"ADD_URI_SAFE_ATTR")&&Ze(d.ADD_URI_SAFE_ATTR)?X(et(Qn),d.ADD_URI_SAFE_ATTR,Le):Qn,rt=Ee(d,"ADD_DATA_URI_TAGS")&&Ze(d.ADD_DATA_URI_TAGS)?X(et(it),d.ADD_DATA_URI_TAGS,Le):it,Te=Ee(d,"FORBID_CONTENTS")&&Ze(d.FORBID_CONTENTS)?X({},d.FORBID_CONTENTS,Le):Oe,yt=Ee(d,"FORBID_TAGS")&&Ze(d.FORBID_TAGS)?X({},d.FORBID_TAGS,Le):et({}),Ct=Ee(d,"FORBID_ATTR")&&Ze(d.FORBID_ATTR)?X({},d.FORBID_ATTR,Le):et({}),ne=Ee(d,"USE_PROFILES")?d.USE_PROFILES&&typeof d.USE_PROFILES=="object"?et(d.USE_PROFILES):d.USE_PROFILES:!1,Ur=d.ALLOW_ARIA_ATTR!==!1,f=d.ALLOW_DATA_ATTR!==!1,h=d.ALLOW_UNKNOWN_PROTOCOLS||!1,b=d.ALLOW_SELF_CLOSE_IN_ATTR!==!1,k=d.SAFE_FOR_TEMPLATES||!1,v=d.SAFE_FOR_XML!==!1,_=d.WHOLE_DOCUMENT||!1,R=d.RETURN_DOM||!1,S=d.RETURN_DOM_FRAGMENT||!1,H=d.RETURN_TRUSTED_TYPE||!1,C=d.FORCE_BODY||!1,L=d.SANITIZE_DOM!==!1,U=d.SANITIZE_NAMED_PROPS||!1,ee=d.KEEP_CONTENT!==!1,de=d.IN_PLACE||!1,pe=Ff(d.ALLOWED_URI_REGEXP)?d.ALLOWED_URI_REGEXP:ml,Bt=typeof d.NAMESPACE=="string"?d.NAMESPACE:ot,qr=Ee(d,"MATHML_TEXT_INTEGRATION_POINTS")&&d.MATHML_TEXT_INTEGRATION_POINTS&&typeof d.MATHML_TEXT_INTEGRATION_POINTS=="object"?et(d.MATHML_TEXT_INTEGRATION_POINTS):X({},["mi","mo","mn","ms","mtext"]),Wr=Ee(d,"HTML_INTEGRATION_POINTS")&&d.HTML_INTEGRATION_POINTS&&typeof d.HTML_INTEGRATION_POINTS=="object"?et(d.HTML_INTEGRATION_POINTS):X({},["annotation-xml"]);const y=Ee(d,"CUSTOM_ELEMENT_HANDLING")&&d.CUSTOM_ELEMENT_HANDLING&&typeof d.CUSTOM_ELEMENT_HANDLING=="object"?et(d.CUSTOM_ELEMENT_HANDLING):_n(null);if(le=_n(null),Ee(y,"tagNameCheck")&&Sl(y.tagNameCheck)&&(le.tagNameCheck=y.tagNameCheck),Ee(y,"attributeNameCheck")&&Sl(y.attributeNameCheck)&&(le.attributeNameCheck=y.attributeNameCheck),Ee(y,"allowCustomizedBuiltInElements")&&typeof y.allowCustomizedBuiltInElements=="boolean"&&(le.allowCustomizedBuiltInElements=y.allowCustomizedBuiltInElements),k&&(f=!1),S&&(R=!0),ne&&(he=X({},pl),ve=_n(null),ne.html===!0&&(X(he,dl),X(ve,hl)),ne.svg===!0&&(X(he,Fr),X(ve,zr),X(ve,Ds)),ne.svgFilters===!0&&(X(he,Br),X(ve,zr),X(ve,Ds)),ne.mathMl===!0&&(X(he,Hr),X(ve,gl),X(ve,Ds))),ze.tagCheck=null,ze.attributeCheck=null,Ee(d,"ADD_TAGS")&&(typeof d.ADD_TAGS=="function"?ze.tagCheck=d.ADD_TAGS:Ze(d.ADD_TAGS)&&(he===ke&&(he=et(he)),X(he,d.ADD_TAGS,Le))),Ee(d,"ADD_ATTR")&&(typeof d.ADD_ATTR=="function"?ze.attributeCheck=d.ADD_ATTR:Ze(d.ADD_ATTR)&&(ve===me&&(ve=et(ve)),X(ve,d.ADD_ATTR,Le))),Ee(d,"ADD_URI_SAFE_ATTR")&&Ze(d.ADD_URI_SAFE_ATTR)&&X(Ft,d.ADD_URI_SAFE_ATTR,Le),Ee(d,"FORBID_CONTENTS")&&Ze(d.FORBID_CONTENTS)&&(Te===Oe&&(Te=et(Te)),X(Te,d.FORBID_CONTENTS,Le)),Ee(d,"ADD_FORBID_CONTENTS")&&Ze(d.ADD_FORBID_CONTENTS)&&(Te===Oe&&(Te=et(Te)),X(Te,d.ADD_FORBID_CONTENTS,Le)),ee&&(he["#text"]=!0),_&&X(he,["html","head","body"]),he.table&&(X(he,["tbody"]),delete yt.tbody),d.TRUSTED_TYPES_POLICY){if(typeof d.TRUSTED_TYPES_POLICY.createHTML!="function")throw $s('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof d.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw $s('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');z=d.TRUSTED_TYPES_POLICY,P=z.createHTML("")}else z===void 0&&(z=Xf(E,r)),z!==null&&typeof P=="string"&&(P=z.createHTML(""));Ye&&Ye(d),Rn=d},El=X({},[...Fr,...Br,...Bf]),Al=X({},[...Hr,...Hf]),yp=function(d){let y=O(d);(!y||!y.tagName)&&(y={namespaceURI:Bt,tagName:"template"});const D=Zn(d.tagName),ae=Zn(y.tagName);return Vr[d.namespaceURI]?d.namespaceURI===Xe?y.namespaceURI===ot?D==="svg":y.namespaceURI===$e?D==="svg"&&(ae==="annotation-xml"||qr[ae]):!!El[D]:d.namespaceURI===$e?y.namespaceURI===ot?D==="math":y.namespaceURI===Xe?D==="math"&&Wr[ae]:!!Al[D]:d.namespaceURI===ot?y.namespaceURI===Xe&&!Wr[ae]||y.namespaceURI===$e&&!qr[ae]?!1:!Al[D]&&(gp[D]||!El[D]):!!(Jn==="application/xhtml+xml"&&Vr[d.namespaceURI]):!1},wt=function(d){Tn(t.removed,{element:d});try{O(d).removeChild(d)}catch{T(d)}},dn=function(d,y){try{Tn(t.removed,{attribute:y.getAttributeNode(d),from:y})}catch{Tn(t.removed,{attribute:null,from:y})}if(y.removeAttribute(d),d==="is")if(R||S)try{wt(y)}catch{}else try{y.setAttribute(d,"")}catch{}},Rl=function(d){let y=null,D=null;if(C)d=""+d;else{const Ie=al(d,/^[\r\n\t ]+/);D=Ie&&Ie[0]}Jn==="application/xhtml+xml"&&Bt===ot&&(d=''+d+"");const ae=z?z.createHTML(d):d;if(Bt===ot)try{y=new w().parseFromString(ae,Jn)}catch{}if(!y||!y.documentElement){y=re.createDocument(Bt,"template",null);try{y.documentElement.innerHTML=jr?P:ae}catch{}}const De=y.body||y.documentElement;return d&&D&&De.insertBefore(n.createTextNode(D),De.childNodes[0]||null),Bt===ot?ue.call(y,_?"html":"body")[0]:_?y.documentElement:De},Cl=function(d){return j.call(d.ownerDocument||d,d,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Kr=function(d){return d instanceof g&&(typeof d.nodeName!="string"||typeof d.textContent!="string"||typeof d.removeChild!="function"||!(d.attributes instanceof p)||typeof d.removeAttribute!="function"||typeof d.setAttribute!="function"||typeof d.namespaceURI!="string"||typeof d.insertBefore!="function"||typeof d.hasChildNodes!="function")},Yr=function(d){return typeof a=="function"&&d instanceof a};function Ht(V,d,y){kn(V,D=>{D.call(t,d,y,Rn)})}const Pl=function(d){let y=null;if(Ht(Z.beforeSanitizeElements,d,null),Kr(d))return wt(d),!0;const D=Le(d.nodeName);if(Ht(Z.uponSanitizeElement,d,{tagName:D,allowedTags:he}),v&&d.hasChildNodes()&&!Yr(d.firstElementChild)&&He(/<[/\w!]/g,d.innerHTML)&&He(/<[/\w!]/g,d.textContent)||v&&d.namespaceURI===ot&&D==="style"&&Yr(d.firstElementChild)||d.nodeType===An.progressingInstruction||v&&d.nodeType===An.comment&&He(/<[/\w]/g,d.data))return wt(d),!0;if(yt[D]||!(ze.tagCheck instanceof Function&&ze.tagCheck(D))&&!he[D]){if(!yt[D]&&Ml(D)&&(le.tagNameCheck instanceof RegExp&&He(le.tagNameCheck,D)||le.tagNameCheck instanceof Function&&le.tagNameCheck(D)))return!1;if(ee&&!Te[D]){const ae=O(d)||d.parentNode,De=K(d)||d.childNodes;if(De&&ae){const Ie=De.length;for(let tt=Ie-1;tt>=0;--tt){const dt=A(De[tt],!0);ae.insertBefore(dt,W(d))}}}return wt(d),!0}return d instanceof l&&!yp(d)||(D==="noscript"||D==="noembed"||D==="noframes")&&He(/<\/no(script|embed|frames)/i,d.innerHTML)?(wt(d),!0):(k&&d.nodeType===An.text&&(y=d.textContent,kn([Y,B,ce],ae=>{y=Sn(y,ae," ")}),d.textContent!==y&&(Tn(t.removed,{element:d.cloneNode()}),d.textContent=y)),Ht(Z.afterSanitizeElements,d,null),!1)},Il=function(d,y,D){if(Ct[y]||L&&(y==="id"||y==="name")&&(D in n||D in xp))return!1;const ae=ve[y]||ze.attributeCheck instanceof Function&&ze.attributeCheck(y,d);if(!(f&&!Ct[y]&&He(Se,y))){if(!(Ur&&He(We,y))){if(!ae||Ct[y]){if(!(Ml(d)&&(le.tagNameCheck instanceof RegExp&&He(le.tagNameCheck,d)||le.tagNameCheck instanceof Function&&le.tagNameCheck(d))&&(le.attributeNameCheck instanceof RegExp&&He(le.attributeNameCheck,y)||le.attributeNameCheck instanceof Function&&le.attributeNameCheck(y,d))||y==="is"&&le.allowCustomizedBuiltInElements&&(le.tagNameCheck instanceof RegExp&&He(le.tagNameCheck,D)||le.tagNameCheck instanceof Function&&le.tagNameCheck(D))))return!1}else if(!Ft[y]){if(!He(pe,Sn(D,fe,""))){if(!((y==="src"||y==="xlink:href"||y==="href")&&d!=="script"&&ul(D,"data:")===0&&rt[d])){if(!(h&&!He(xt,Sn(D,fe,"")))){if(D)return!1}}}}}}return!0},wp=X({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ml=function(d){return!wp[Zn(d)]&&He(N,d)},Ll=function(d){Ht(Z.beforeSanitizeAttributes,d,null);const y=d.attributes;if(!y||Kr(d))return;const D={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ve,forceKeepAttr:void 0};let ae=y.length;for(;ae--;){const De=y[ae],Ie=De.name,tt=De.namespaceURI,dt=De.value,vt=Le(Ie),Xr=dt;let Ne=Ie==="value"?Xr:Mf(Xr);if(D.attrName=vt,D.attrValue=Ne,D.keepAttr=!0,D.forceKeepAttr=void 0,Ht(Z.uponSanitizeAttribute,d,D),Ne=D.attrValue,U&&(vt==="id"||vt==="name")&&ul(Ne,G)!==0&&(dn(Ie,d),Ne=G+Ne),v&&He(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ne)){dn(Ie,d);continue}if(vt==="attributename"&&al(Ne,"href")){dn(Ie,d);continue}if(D.forceKeepAttr)continue;if(!D.keepAttr){dn(Ie,d);continue}if(!b&&He(/\/>/i,Ne)){dn(Ie,d);continue}k&&kn([Y,B,ce],$l=>{Ne=Sn(Ne,$l," ")});const Ol=Le(d.nodeName);if(!Il(Ol,vt,Ne)){dn(Ie,d);continue}if(z&&typeof E=="object"&&typeof E.getAttributeType=="function"&&!tt)switch(E.getAttributeType(Ol,vt)){case"TrustedHTML":{Ne=z.createHTML(Ne);break}case"TrustedScriptURL":{Ne=z.createScriptURL(Ne);break}}if(Ne!==Xr)try{tt?d.setAttributeNS(tt,Ie,Ne):d.setAttribute(Ie,Ne),Kr(d)?wt(d):ll(t.removed)}catch{dn(Ie,d)}}Ht(Z.afterSanitizeAttributes,d,null)},Zr=function(d){let y=null;const D=Cl(d);for(Ht(Z.beforeSanitizeShadowDOM,d,null);y=D.nextNode();)Ht(Z.uponSanitizeShadowNode,y,null),Pl(y),Ll(y),y.content instanceof i&&Zr(y.content);Ht(Z.afterSanitizeShadowDOM,d,null)},Fs=function(d){if(d.nodeType===An.element&&d.shadowRoot instanceof i){const ae=d.shadowRoot;Fs(ae),Zr(ae)}const y=d.childNodes;if(!y)return;const D=[];kn(y,ae=>{Tn(D,ae)});for(const ae of D)Fs(ae)};return t.sanitize=function(V){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y=null,D=null,ae=null,De=null;if(jr=!V,jr&&(V=""),typeof V!="string"&&!Yr(V)&&(V=Nf(V),typeof V!="string"))throw $s("dirty is not a string, aborting");if(!t.isSupported)return V;if(M||Gr(d),t.removed=[],typeof V=="string"&&(de=!1),de){const dt=V.nodeName;if(typeof dt=="string"){const vt=Le(dt);if(!he[vt]||yt[vt])throw $s("root node is forbidden and cannot be sanitized in-place")}Fs(V)}else if(V instanceof a)y=Rl(""),D=y.ownerDocument.importNode(V,!0),D.nodeType===An.element&&D.nodeName==="BODY"||D.nodeName==="HTML"?y=D:y.appendChild(D),Fs(D);else{if(!R&&!k&&!_&&V.indexOf("<")===-1)return z&&H?z.createHTML(V):V;if(y=Rl(V),!y)return R?null:H?P:""}y&&C&&wt(y.firstChild);const Ie=Cl(de?V:y);for(;ae=Ie.nextNode();)Pl(ae),Ll(ae),ae.content instanceof i&&Zr(ae.content);if(de)return V;if(R){if(k){y.normalize();let dt=y.innerHTML;kn([Y,B,ce],vt=>{dt=Sn(dt,vt," ")}),y.innerHTML=dt}if(S)for(De=te.call(y.ownerDocument);y.firstChild;)De.appendChild(y.firstChild);else De=y;return(ve.shadowroot||ve.shadowrootmode)&&(De=$.call(s,De,!0)),De}let tt=_?y.outerHTML:y.innerHTML;return _&&he["!doctype"]&&y.ownerDocument&&y.ownerDocument.doctype&&y.ownerDocument.doctype.name&&He(Kf,y.ownerDocument.doctype.name)&&(tt=" +`+tt),k&&kn([Y,B,ce],dt=>{tt=Sn(tt,dt," ")}),z&&H?z.createHTML(tt):tt},t.setConfig=function(){let V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Gr(V),M=!0},t.clearConfig=function(){Rn=null,M=!1},t.isValidAttribute=function(V,d,y){Rn||Gr({});const D=Le(V),ae=Le(d);return Il(D,ae,y)},t.addHook=function(V,d){typeof d=="function"&&Tn(Z[V],d)},t.removeHook=function(V,d){if(d!==void 0){const y=Pf(Z[V],d);return y===-1?void 0:If(Z[V],y,1)[0]}return ll(Z[V])},t.removeHooks=function(V){Z[V]=[]},t.removeAllHooks=function(){Z=bl()},t}var Qf=xl();const Jf={key:1,class:"flex min-w-0 max-w-[calc(100%-2.5rem)] flex-1 flex-col max-[600px]:max-w-[calc(100%-2.25rem)]"},ed={key:0,class:"flex w-fit flex-col items-start gap-1"},td=["aria-label"],nd={class:"inline-flex items-center gap-1.5"},sd={class:"text-[8px] font-semibold tracking-[0.12em] uppercase text-[#3a67c9]"},rd={key:1,class:"flex w-fit max-w-full flex-col items-start gap-2"},id={class:"chat-card relative w-fit max-w-full whitespace-pre-line rounded-[10px_10px_10px_3px] px-4 py-3 text-xs leading-relaxed wrap-anywhere text-slate-900"},od=["innerHTML"],ld={key:0,class:"pointer-events-none absolute inset-x-0 bottom-0 h-14 rounded-b-[10px] bg-linear-to-t from-white via-white/92 to-white/0","aria-hidden":"true"},ad={key:0,class:"flex flex-wrap items-center gap-2"},ud=["title","aria-label"],cd={key:1,class:"flex flex-wrap items-center"},fd=["title","aria-label"],dd={viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},pd=["innerHTML"],yl={__name:"ChatMessage",props:{message:{type:Object,required:!0},autoReadEnabled:{type:Boolean,default:!1},ttsConfig:{type:Object,default:()=>({enableVoiceChat:!1,pollyAvailable:!1,usePolly:!0,voiceId:"Zayd"})}},setup(e){const t=e,n=J(!1),s=J(null),r=J(!1),i=J(!1),o=Re(()=>typeof window!="undefined"&&"speechSynthesis"in window&&"SpeechSynthesisUtterance"in window);function a(P){typeof window!="undefined"&&window.dispatchEvent(new CustomEvent("changai-tts-provider",{detail:{provider:P}}))}function l(P){if(typeof P!="string")return"";const I=P.replace(/[\u{1F000}-\u{1FFFF}]/gu,"").replace(/[\u{2600}-\u{26FF}]/gu,"").replace(/[\u{2700}-\u{27BF}]/gu,"").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/#{1,6}\s+/g,"").replace(/[-*+]\s+/g,"").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/\s+/g," ");return I.includes("<")?(new DOMParser().parseFromString(P,"text/html").body.textContent||"").replace(/\s+/g," ").trim():I.trim()}function c(){o.value&&window.speechSynthesis.cancel(),s.value&&(s.value.pause(),s.value.src="",s.value=null),n.value=!1}function u(){var P,I,re;if(i.value=!i.value,i.value)c();else{const j=A.value;if(!t.autoReadEnabled||!((P=t.ttsConfig)!=null&&P.enableVoiceChat)||!j||E())return;if((I=t.ttsConfig)!=null&&I.pollyAvailable&&((re=t.ttsConfig)!=null&&re.usePolly)){g(j).catch(te=>{p(j)});return}p(j)}}function p(P){if(!o.value||!P)return;window.dispatchEvent(new CustomEvent("changai-tts-stop")),window.speechSynthesis.cancel();const I=new SpeechSynthesisUtterance(P);I.rate=1,I.pitch=1,I.onend=()=>{n.value=!1},I.onerror=()=>{n.value=!1},n.value=!0,a("browser"),window.speechSynthesis.speak(I)}async function g(P){var ue;const I=await Lc(P,((ue=t.ttsConfig)==null?void 0:ue.voiceId)||"Zayd");if(!(I!=null&&I.ok)||!(I!=null&&I.audio_base64))throw new Error((I==null?void 0:I.error)||"Polly synthesis failed");window.dispatchEvent(new CustomEvent("changai-tts-stop")),c();const re=(I==null?void 0:I.mime_type)||"audio/mpeg",j=new Audio(`data:${re};base64,${I.audio_base64}`);s.value=j,n.value=!0;let te=!1;j.onplay=()=>{te=!0,a("polly")},j.onended=()=>{s.value===j&&(s.value=null),n.value=!1},j.onerror=()=>{s.value===j&&(s.value=null),n.value=!1},await j.play(),te||a("polly")}function w(){c()}function E(){var P;return!!((P=t.message)!=null&&P.isStatus)}function m(P){const I=P.target.closest("a");!I||!I.href||(P.preventDefault(),P.stopPropagation(),window.open(I.href,"_blank","noopener,noreferrer"))}const A=Re(()=>{var P;return l(((P=t.message)==null?void 0:P.text)||"")}),T=Re(()=>{var P;return((P=t.message)==null?void 0:P.role)!=="user"&&E()}),W=Re(()=>{var P;return(P=t.message)!=null&&P.isStatus?t.message.statusType==="support"?"Sending to support":A.value||"Thinking":""}),K=Re(()=>{var re;if(((re=t.message)==null?void 0:re.role)==="user"||T.value)return!1;const P=A.value,I=P.split(/\n+/).filter(Boolean).length;return P.length>520||I>8}),O=Re(()=>{var P,I;return((P=t.message)==null?void 0:P.role)!=="user"&&!T.value&&((I=t.ttsConfig)==null?void 0:I.enableVoiceChat)}),z=Re(()=>{var I;const P=((I=t.message)==null?void 0:I.text)||"";return Qf.sanitize(xe.parse(P))});return rn(()=>t.message.text,async(P,I)=>{var te,ue,$;if(!t.autoReadEnabled||t.message.role==="user"||i.value)return;if(!((te=t.ttsConfig)!=null&&te.enableVoiceChat)){a("off");return}const re=l(P);if(!re||E())return;const j=l(I||"");if(re!==j){if((ue=t.ttsConfig)!=null&&ue.pollyAvailable&&(($=t.ttsConfig)!=null&&$.usePolly))try{await g(re);return}catch{}p(re)}}),rn(()=>t.message.text,()=>{r.value=!1,i.value=!1}),Hn(()=>{typeof window!="undefined"&&window.addEventListener("changai-tts-stop",w)}),xs(()=>{typeof window!="undefined"&&window.removeEventListener("changai-tts-stop",w),n.value&&c()}),(P,I)=>(F(),q("div",{class:ye(["motion-safe:animate-fade-rise flex w-full gap-1.5",e.message.role==="user"?"flex-col items-end":"items-start"])},[e.message.role!=="user"?(F(),St(Bo,{key:0})):Ve("",!0),e.message.role!=="user"?(F(),q("div",Jf,[T.value?(F(),q("div",ed,[x("div",{class:"chat-card inline-flex w-fit rounded-[10px_10px_10px_3px] px-3 py-2",role:"status","aria-live":"polite","aria-label":W.value},[x("div",nd,[I[1]||(I[1]=x("span",{class:"relative inline-flex h-4 w-4 shrink-0 items-center justify-center"},[x("span",{class:"absolute inset-0 rounded-full border border-transparent border-t-[#4b89ff] border-r-[#4b89ff]/70 animate-gemini-arc"}),x("svg",{viewBox:"0 0 24 24",class:"relative h-3 w-3 text-[#4b89ff] animate-gemini-spark","aria-hidden":"true"},[x("path",{fill:"currentColor",d:"M12 2.8c.52 3.22 1.6 5.66 3.22 7.28 1.62 1.62 4.06 2.7 7.28 3.22-3.22.52-5.66 1.6-7.28 3.22-1.62 1.62-2.7 4.06-3.22 7.28-.52-3.22-1.6-5.66-3.22-7.28-1.62-1.62-4.06-2.7-7.28-3.22 3.22-.52 5.66-1.6 7.28-3.22 1.62-1.62 2.7-4.06 3.22-7.28Z"})])],-1)),x("span",sd,Qe(W.value),1)])],8,td)])):(F(),q("div",rd,[x("div",id,[x("div",{class:ye(["overflow-x-auto",K.value&&!r.value?"max-h-48 overflow-y-hidden":""]),innerHTML:z.value,onClick:m},null,10,od),K.value&&!r.value?(F(),q("div",ld)):Ve("",!0)]),K.value?(F(),q("div",ad,[x("button",{type:"button",class:"inline-flex items-center rounded-full border border-slate-200 bg-white px-2.5 py-1 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-600 transition-colors duration-200 hover:border-brand-200 hover:text-brand-600",title:r.value?"Collapse response":"Expand response","aria-label":r.value?"Collapse response":"Expand response",onClick:I[0]||(I[0]=re=>r.value=!r.value)},Qe(r.value?"Collapse":"Expand"),9,ud)])):Ve("",!0),O.value?(F(),q("div",cd,[x("button",{type:"button",class:ye(["inline-flex h-8 w-8 items-center justify-center rounded-full border transition-colors duration-200",i.value?"border-red-200 bg-red-50 text-red-600 hover:border-red-300 hover:bg-red-100":"border-green-200 bg-green-50 text-green-600 hover:border-green-300 hover:bg-green-100"]),title:i.value?"Unmute voice playback":"Mute voice playback","aria-label":i.value?"Unmute voice playback":"Mute voice playback",onClick:u},[(F(),q("svg",dd,[I[6]||(I[6]=x("path",{d:"M11 5L6 9H3v6h3l5 4V5Z"},null,-1)),i.value?(F(),q(Be,{key:0},[I[2]||(I[2]=x("path",{d:"M15 9l4 6"},null,-1)),I[3]||(I[3]=x("path",{d:"M19 9l-4 6"},null,-1))],64)):(F(),q(Be,{key:1},[I[4]||(I[4]=x("path",{d:"M15 10a3 3 0 0 1 0 4"},null,-1)),I[5]||(I[5]=x("path",{d:"M17.5 7.5a6 6 0 0 1 0 9"},null,-1))],64))]))],10,fd)])):Ve("",!0)]))])):(F(),q("div",{key:2,class:"w-fit max-w-[85%] whitespace-pre-line rounded-[13px_13px_3px_13px] bg-linear-to-br from-brand-500 to-brand-600 px-4 py-3 text-[11px] leading-relaxed wrap-anywhere text-white shadow-[0_14px_30px_-18px_rgba(109,79,194,0.85)] max-[600px]:max-w-[88%]",innerHTML:z.value},null,8,pd))],2))}},hd={class:"flex flex-col gap-4 sm:gap-5"},gd={class:"motion-safe:animate-fade-rise flex w-full items-start gap-1.5"},md={__name:"ChatTab",props:{messages:{type:Array,required:!0},autoReadEnabled:{type:Boolean,default:!1},ttsConfig:{type:Object,required:!0}},setup(e){return(t,n)=>(F(),q("div",hd,[x("div",gd,[Me(Bo),n[0]||(n[0]=x("p",{class:"w-fit max-w-[calc(100%-2.5rem)] whitespace-pre-line rounded-[10px_10px_10px_3px] bg-brand-50 px-4 py-3 text-xs leading-relaxed wrap-anywhere text-slate-900 max-[600px]:max-w-[calc(100%-2.25rem)]"},[Ts(" Hello there 👋 I am ChangAI from "),x("a",{target:"_blank",href:"https://erpgulf.com",rel:"noopener noreferrer",style:{color:"#1e90ff"}},"ERPGulf.com"),Ts(", your ERP assistant."),x("br"),x("a",{target:"_blank",href:"https://app.erpgulf.com/en/articles/chang-ai-quick-start-guide",rel:"noopener noreferrer",style:{color:"#1e90ff"}},"ChangAI Quick Start Guide - Click here.")],-1))]),(F(!0),q(Be,null,ys(e.messages,(s,r)=>(F(),St(yl,{key:r,message:s,autoReadEnabled:e.autoReadEnabled,ttsConfig:e.ttsConfig},null,8,["message","autoReadEnabled","ttsConfig"]))),128))]))}};function wl(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function vl(e){var t,n;return(e==null?void 0:e.message)||((t=e==null?void 0:e.responseJSON)==null?void 0:t.exception)||((n=e==null?void 0:e.responseJSON)==null?void 0:n.message)||(e==null?void 0:e.responseText)||String(e)}function bd(e){return typeof e=="string"?e:e&&typeof e=="object"?e.error?`⚠️ ${e.error}`:e.answer||e.text||"":""}const xd={key:0,class:"rounded-lg bg-brand-50 px-4 py-3 text-xs text-black"},yd={class:"whitespace-pre-wrap wrap-anywhere text-[11px] leading-relaxed text-black"},wd={key:1,class:"mb-3 min-w-0 overflow-x-auto rounded-lg bg-brand-50 p-2 text-[11px]"},vd={class:"whitespace-pre-wrap wrap-anywhere text-[11px] leading-relaxed text-black"},_d={__name:"DebugTab",props:{logs:{type:Array,required:!0},currentDebug:{type:Object,default:null}},setup(e){const t=new Set(["gemini_json_content","private_key","private_key_id","client_secret","client_id","aws_access_key","aws_secret_key","api_key","token","access_token","refresh_token","password","secret","authorization","embed_version_id","llm_version_id","entity_retriever","retriever","deploy_url","support_api_url","get_ticket_details_url"]);function n(r,i=0){if(i>10||r===null||r===void 0||typeof r=="string"||typeof r=="number"||typeof r=="boolean")return r;if(Array.isArray(r))return r.map(o=>n(o,i+1));if(typeof r=="object"){const o={};for(const[a,l]of Object.entries(r))t.has(a.toLowerCase())||(o[a]=n(l,i+1));return o}return r}function s(r){return wl(n(r))}return(r,i)=>(F(),q("div",null,[e.logs.length===0?(F(),q("p",xd,"No debug data yet.")):Ve("",!0),(F(!0),q(Be,null,ys(e.logs,(o,a)=>(F(),q("div",{key:a,class:"mb-3 min-w-0 overflow-x-auto rounded-lg bg-gray-100 p-2 text-[11px]"},[x("pre",yd,Qe(s(o)),1)]))),128)),e.currentDebug?(F(),q("div",wd,[x("pre",vd,Qe(s(e.currentDebug)),1)])):Ve("",!0)]))}},kd={class:"flex flex-col gap-4 sm:gap-5"},Td={key:0,class:"chat-card motion-safe:animate-fade-rise rounded-lg px-4 py-3 text-xs text-slate-900"},Sd={__name:"SupportTab",props:{messages:{type:Array,required:!0},autoReadEnabled:{type:Boolean,default:!1},ttsConfig:{type:Object,required:!0}},setup(e){return(t,n)=>(F(),q("div",kd,[e.messages.length===0?(F(),q("p",Td,"Send a message to Support.")):Ve("",!0),(F(!0),q(Be,null,ys(e.messages,(s,r)=>(F(),St(yl,{key:r,message:s,autoReadEnabled:e.autoReadEnabled,ttsConfig:e.ttsConfig},null,8,["message","autoReadEnabled","ttsConfig"]))),128))]))}},Ed={class:"flex flex-col gap-4"},Ad={class:"chat-card motion-safe:animate-fade-rise rounded-xl p-4"},Rd={class:"flex items-start justify-between gap-4"},Cd=["aria-pressed","title"],Pd={class:"chat-card motion-safe:animate-fade-rise rounded-xl p-4"},Id={class:"flex items-start justify-between gap-4"},Md={class:"mt-2 text-[11px] text-slate-500"},Ld={key:0,class:"mt-1 text-[11px] text-slate-500"},Od={key:1,class:"mt-1 text-[11px] text-slate-500"},$d=["aria-pressed","disabled"],Dd={key:0,class:"mt-3 rounded-md bg-amber-50 px-2.5 py-2 text-xs text-amber-700"},Nd={key:1,class:"mt-3 rounded-md bg-amber-50 px-2.5 py-2 text-xs text-amber-700"},Fd={class:"chat-card motion-safe:animate-fade-rise rounded-xl p-4"},Bd={class:"flex items-start justify-between gap-4"},Hd=["aria-pressed","title"],zd={class:"chat-card motion-safe:animate-fade-rise rounded-xl p-4"},Ud={class:"flex items-start justify-between gap-4"},jd=["aria-pressed","title"],Vd={__name:"SettingsTab",props:{autoReadEnabled:{type:Boolean,required:!0},ttsConfig:{type:Object,required:!0},settings:{type:Object,default:null},debugEnabled:{type:Boolean,default:!1},sendNonERPtoaiEnabled:{type:Boolean,default:!1}},emits:["toggleAutoRead","togglePollyPreference","toggleDebug","toggleSendNonERP"],setup(e){const t=e,n=Re(()=>{var s,r;return(s=t.ttsConfig)!=null&&s.enableVoiceChat?(r=t.ttsConfig)!=null&&r.pollyAvailable?"Available":"Unavailable":"Voice disabled on server"});return(s,r)=>{var i,o,a,l,c,u,p,g,w,E,m,A,T,W,K;return F(),q("div",Ed,[r[10]||(r[10]=x("div",{class:"chat-card motion-safe:animate-fade-rise rounded-xl p-4 text-slate-900"},[x("h3",{class:"text-sm font-semibold tracking-[0.01em]"},"Speech Settings"),x("p",{class:"mt-1 text-xs leading-relaxed text-slate-600"},"These controls apply only inside this chatbot box for the current browser session.")],-1)),x("div",Ad,[x("div",Rd,[r[4]||(r[4]=x("div",null,[x("p",{class:"text-sm font-semibold text-slate-900"},"Auto Read Replies"),x("p",{class:"mt-1 text-xs text-slate-600"},"Automatically read bot replies aloud.")],-1)),x("button",{class:ye(["group relative h-7 w-12 shrink-0 rounded-full border border-slate-200 transition-all duration-200",e.autoReadEnabled?"bg-emerald-500/95":"bg-slate-300"]),"aria-pressed":e.autoReadEnabled?"true":"false",title:e.autoReadEnabled?"Disable auto read":"Enable auto read",onClick:r[0]||(r[0]=O=>s.$emit("toggleAutoRead"))},[x("span",{class:ye(["absolute top-0.5 h-5.5 w-5.5 rounded-full bg-white shadow-sm transition-all duration-200",e.autoReadEnabled?"left-[1.45rem]":"left-0.5"])},null,2)],10,Cd)]),x("p",{class:ye(["mt-3 text-[11px] font-medium",e.autoReadEnabled?"text-emerald-700":"text-slate-500"])},Qe(e.autoReadEnabled?"Auto read is active.":"Auto read is currently off."),3)]),x("div",Pd,[x("div",Id,[x("div",null,[r[5]||(r[5]=x("p",{class:"text-sm font-semibold text-slate-900"},"Use Amazon Polly",-1)),r[6]||(r[6]=x("p",{class:"mt-1 text-xs text-slate-600"},"Use Polly when available; otherwise browser speech is used automatically.",-1)),x("p",Md,"Availability: "+Qe(n.value),1),(i=e.settings)!=null&&i.aws_region?(F(),q("p",Ld,"Region: "+Qe(e.settings.aws_region),1)):Ve("",!0),(o=e.ttsConfig)!=null&&o.voiceId?(F(),q("p",Od,"Voice: "+Qe(e.ttsConfig.voiceId),1)):Ve("",!0)]),x("button",{class:ye(["relative h-7 w-12 shrink-0 rounded-full border border-slate-200 transition-all duration-200 disabled:cursor-not-allowed disabled:opacity-55",(a=e.ttsConfig)!=null&&a.usePolly&&((l=e.ttsConfig)!=null&&l.enableVoiceChat)&&((c=e.ttsConfig)!=null&&c.pollyAvailable)?"bg-emerald-500/95":"bg-slate-300"]),"aria-pressed":(u=e.ttsConfig)!=null&&u.usePolly&&((p=e.ttsConfig)!=null&&p.enableVoiceChat)&&((g=e.ttsConfig)!=null&&g.pollyAvailable)?"true":"false",disabled:!((w=e.ttsConfig)!=null&&w.pollyAvailable)||!((E=e.ttsConfig)!=null&&E.enableVoiceChat),onClick:r[1]||(r[1]=O=>s.$emit("togglePollyPreference"))},[x("span",{class:ye(["absolute top-0.5 h-5.5 w-5.5 rounded-full bg-white shadow-sm transition-all duration-200",(m=e.ttsConfig)!=null&&m.usePolly&&((A=e.ttsConfig)!=null&&A.enableVoiceChat)&&((T=e.ttsConfig)!=null&&T.pollyAvailable)?"left-[1.45rem]":"left-0.5"])},null,2)],10,$d)]),(W=e.ttsConfig)!=null&&W.enableVoiceChat?(K=e.ttsConfig)!=null&&K.pollyAvailable?Ve("",!0):(F(),q("p",Nd,"Polly is not available for this site. Browser speech will be used.")):(F(),q("p",Dd,"Voice chat is disabled in ChangAI Settings."))]),x("div",Fd,[x("div",Bd,[x("div",null,[r[7]||(r[7]=x("p",{class:"text-sm font-semibold text-slate-900"},"Enable Debug Tab",-1)),r[8]||(r[8]=x("p",{class:"mt-1 text-xs text-slate-600"}," Show or hide the Debug tab inside this chatbot. ",-1)),x("p",{class:ye(["mt-2 text-[11px] font-medium",e.debugEnabled?"text-emerald-700":"text-slate-500"])},Qe(e.debugEnabled?"Debug tab is active.":"Debug tab is currently off."),3)]),x("button",{type:"button",class:ye(["relative h-7 w-12 shrink-0 rounded-full border border-slate-200 transition-all duration-200",e.debugEnabled?"bg-emerald-500/95":"bg-slate-300"]),"aria-pressed":e.debugEnabled?"true":"false",title:e.debugEnabled?"Disable debug tab":"Enable debug tab",onClick:r[2]||(r[2]=O=>s.$emit("toggleDebug"))},[x("span",{class:ye(["absolute top-0.5 h-5.5 w-5.5 rounded-full bg-white shadow-sm transition-all duration-200",e.debugEnabled?"left-[1.45rem]":"left-0.5"])},null,2)],10,Hd)])]),x("div",zd,[x("div",Ud,[r[9]||(r[9]=x("div",null,[x("p",{class:"text-sm font-semibold text-slate-900"},"Send non-ERP questions directly to AI"),x("p",{class:"mt-1 text-xs text-slate-600"},"Questions unrelated to your ERP will skip the system and go straight to AI")],-1)),x("button",{class:ye(["group relative h-7 w-12 shrink-0 rounded-full border border-slate-200 transition-all duration-200",e.sendNonERPtoaiEnabled?"bg-emerald-500/95":"bg-slate-300"]),"aria-pressed":e.sendNonERPtoaiEnabled?"true":"false",title:e.sendNonERPtoaiEnabled?"Non-ERP questions are being sent directly to AI":"Enable direct AI reply for non-ERP questions",onClick:r[3]||(r[3]=O=>s.$emit("toggleSendNonERP"))},[x("span",{class:ye(["absolute top-0.5 h-5.5 w-5.5 rounded-full bg-white shadow-sm transition-all duration-200",e.sendNonERPtoaiEnabled?"left-[1.45rem]":"left-0.5"])},null,2)],10,jd)]),x("p",{class:ye(["mt-3 text-[11px] font-medium",e.sendNonERPtoaiEnabled?"text-emerald-700":"text-slate-500"])},Qe(e.sendNonERPtoaiEnabled?"Non-ERP questions are now routed directly to AI":"Direct AI routing is currently off"),3)])])}}},qd={key:0,class:"pointer-events-none absolute -top-14 left-0 right-0 z-20 flex justify-center px-2",role:"status","aria-live":"polite"},Wd={__name:"StatusToast",props:{visible:{type:Boolean,required:!0},message:{type:String,default:""},type:{type:String,default:"info"},dismissible:{type:Boolean,default:!0}},emits:["close"],setup(e){const t=e,n=Re(()=>t.type==="error"?"bg-red-50 text-red-700 ring-red-200":(t.type==="listening","bg-blue-50 text-blue-700 ring-blue-200")),s=Re(()=>t.type==="error"?"bg-red-500":t.type==="listening"?"bg-blue-500 animate-pulse":"bg-blue-500");return(r,i)=>(F(),St(Pu,{"enter-active-class":"transition duration-200 ease-out","enter-from-class":"translate-y-1 opacity-0","enter-to-class":"translate-y-0 opacity-100","leave-active-class":"transition duration-150 ease-in","leave-from-class":"translate-y-0 opacity-100","leave-to-class":"translate-y-1 opacity-0"},{default:Ni(()=>[e.visible?(F(),q("div",qd,[x("div",{class:ye(["pointer-events-auto flex max-w-[92%] items-start gap-2 rounded-lg px-3 py-2 text-xs shadow-lg ring-1",n.value])},[x("span",{class:ye(["mt-0.5 h-2 w-2 shrink-0 rounded-full",s.value])},null,2),x("span",null,Qe(e.message),1),e.dismissible?(F(),q("button",{key:0,type:"button",class:"ml-1 appearance-none border-0 text-current/80 transition hover:text-current focus:outline-none","aria-label":"Dismiss notification",onClick:i[0]||(i[0]=o=>r.$emit("close"))}," × ")):Ve("",!0)],2)])):Ve("",!0)]),_:1}))}},Gd={class:"relative w-full"},Kd=["placeholder","disabled"],Yd=["title","aria-label","disabled"],Zd={key:0,viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor","aria-hidden":"true"},Xd={key:1,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},Qd={key:2,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true",class:"animate-spin"},Jd=["title","aria-label","disabled"],ep={key:0,viewBox:"0 0 24 24",width:"18",height:"18",fill:"none","aria-hidden":"true",class:"text-rose-600 motion-safe:animate-stop-button-pulse"},tp={key:1,viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor","aria-hidden":"true"},np={__name:"ChatForm",props:{placeholder:{type:String,default:"Message..."},disabled:{type:Boolean,default:!1},isAwaitingResponse:{type:Boolean,default:!1}},emits:["submit","cancel"],setup(e,{expose:t,emit:n}){const s=e,r=n,i=J(""),o=J(null),a=J(!1),l=J(!1),c=J(!1),u=J(!1),p=J(!1),g=J(!1),w=J(!1),E=J(""),m=J("info"),A=J("Voice input is unavailable in this browser/context.");let T=null,W=null,K=null;const O=J(""),z=J(!1),P=Re(()=>c.value?"Requesting microphone permission...":u.value?"Starting voice input...":p.value?"Stopping voice input...":l.value?a.value?"Stop voice input":"Start voice input":"Voice input is unavailable in this browser/context"),I=Re(()=>s.isAwaitingResponse?"Stop response":"Send"),re=Re(()=>s.isAwaitingResponse?!1:s.disabled||!i.value.trim()),j=Re(()=>s.isAwaitingResponse?"bg-white border border-rose-100 shadow-[0_8px_20px_-12px_rgba(159,18,57,0.35)] hover:bg-rose-50":"bg-linear-to-br from-brand-500 to-brand-600 text-white shadow-[0_10px_24px_-16px_rgba(109,79,194,0.85)] hover:from-brand-600 hover:to-violet-700");function te(){return typeof window=="undefined"?null:window.SpeechRecognition||window.webkitSpeechRecognition||null}function ue(){var he;const fe=te(),N=typeof window!="undefined"?window.isSecureContext:!1,pe=typeof navigator!="undefined"&&!!((he=navigator.mediaDevices)!=null&&he.getUserMedia);l.value=!!(fe&&N&&pe),N?(!pe||!fe)&&(A.value="Voice input is not supported in this browser."):A.value="Voice input requires HTTPS (or localhost).",fe&&l.value&&(T=new fe,T.continuous=!0,T.interimResults=!0,T.lang=typeof navigator!="undefined"&&navigator.language||"en-US",T.onstart=()=>{a.value=!0,u.value=!1,p.value=!1,$(),Se("Listening... Tap mic to stop","listening",{persistent:!0,key:"listening"})},T.onend=()=>{a.value=!1,u.value=!1,p.value=!1,$(),O.value==="listening"&&We(),z.value&&(z.value=!1,xt())},T.onerror=ke=>{if(a.value=!1,u.value=!1,p.value=!1,$(),z.value=!1,(ke==null?void 0:ke.error)==="not-allowed"||(ke==null?void 0:ke.error)==="service-not-allowed"){Se("Microphone permission denied. Please allow microphone access in browser settings.","error");return}if((ke==null?void 0:ke.error)==="audio-capture"){Se("No microphone detected. Please connect a microphone and try again.","error");return}if((ke==null?void 0:ke.error)==="no-speech"){Se("No speech detected. Try speaking a bit louder.","info");return}Se("Voice input failed. Please try again.","error")},T.onresult=ke=>{let ve="";for(let me=ke.resultIndex;me{if(T&&!(!a.value&&!p.value))try{T.abort()}catch{p.value=!1,z.value=!1}},1200)}}function Y(){if(!l.value||!T){Se(A.value,"error");return}if(a.value||u.value||p.value){Z({submitAfterStop:a.value});return}ce()}async function B(){var fe;if(g.value)return!0;if(!((fe=navigator.mediaDevices)!=null&&fe.getUserMedia))return Se("Microphone API is unavailable in this browser.","error"),!1;c.value=!0,Se("Requesting microphone permission...","info",{persistent:!0,key:"requesting"});try{return(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach(pe=>pe.stop()),g.value=!0,!0}catch(N){return(N==null?void 0:N.name)==="NotAllowedError"||(N==null?void 0:N.name)==="SecurityError"?Se("Microphone permission denied. Please allow it and try again.","error"):(N==null?void 0:N.name)==="NotFoundError"?Se("No microphone found on this device.","error"):Se("Unable to access microphone. Please check browser permissions.","error"),!1}finally{c.value=!1,O.value==="requesting"&&We()}}async function ce(){var N;if(!(!T||a.value||u.value||p.value||!await B()||!T)){z.value=!1,(N=o.value)==null||N.focus(),u.value=!0;try{T.start()}catch(pe){u.value=!1,p.value=!1,(pe==null?void 0:pe.name)!=="InvalidStateError"&&Se("Unable to start voice input. Please try again.","error")}}}function Se(fe,N="info",pe={}){const{duration:he=4200,persistent:ke=!1,key:ve=""}=pe;E.value=fe,m.value=N,O.value=ve,w.value=!0,W&&clearTimeout(W),ke||(W=setTimeout(()=>{w.value=!1,O.value=""},he))}function We(){w.value=!1,O.value="",W&&(clearTimeout(W),W=null)}function xt(){if(s.isAwaitingResponse){r("cancel");return}const fe=i.value.trim();fe&&((a.value||u.value||p.value)&&T&&Z({submitAfterStop:!1}),r("submit",fe),i.value="")}return t({focus:()=>{var fe;return(fe=o.value)==null?void 0:fe.focus()}}),Hn(()=>{ue()}),xs(()=>{if(T&&(a.value||u.value||p.value)){z.value=!1,$();try{T.abort()}catch{}}$(),We()}),(fe,N)=>(F(),q("div",Gd,[x("form",{class:"group flex min-h-11 items-center gap-2 rounded-full border border-slate-200/90 bg-white/95 px-3 shadow-[0_12px_26px_-20px_rgba(15,23,42,0.7)] transition-all duration-250 focus-within:-translate-y-0.5 focus-within:border-brand-200 focus-within:shadow-[0_18px_30px_-20px_rgba(13,110,253,0.5)] focus-within:ring-2 focus-within:ring-brand-500/25",style:{"border-radius":"9999px"},autocomplete:"off",onSubmit:ct(xt,["prevent"]),onClick:N[5]||(N[5]=ct(()=>{},["stop"])),onMousedown:N[6]||(N[6]=ct(()=>{},["stop"])),onKeydown:N[7]||(N[7]=ct(()=>{},["stop"])),onKeyup:N[8]||(N[8]=ct(()=>{},["stop"]))},[Pa(x("input",{ref_key:"inputRef",ref:o,type:"text","onUpdate:modelValue":N[0]||(N[0]=pe=>i.value=pe),class:"h-11 w-full border-none bg-transparent text-sm font-medium text-slate-800 placeholder:text-slate-400 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",placeholder:e.disabled?"Waiting for response...":e.placeholder,disabled:e.disabled,required:"",onKeydown:N[1]||(N[1]=ct(()=>{},["stop"])),onKeyup:N[2]||(N[2]=ct(()=>{},["stop"])),onKeypress:N[3]||(N[3]=ct(()=>{},["stop"])),onInput:N[4]||(N[4]=ct(()=>{},["stop"]))},null,40,Kd),[[Xu,i.value]]),x("button",{type:"button",class:ye(["grid h-8 w-8 shrink-0 appearance-none place-items-center rounded-full border border-transparent text-slate-600 transition-all duration-200 hover:-translate-y-0.5 hover:border-slate-200 hover:bg-slate-100 hover:text-slate-900 focus:outline-none disabled:cursor-not-allowed disabled:opacity-40",a.value?"border-red-200 bg-red-100 text-red-600 shadow-[0_10px_20px_-18px_rgba(220,38,38,0.9)] hover:bg-red-100 hover:text-red-600":""]),style:{"border-radius":"9999px"},title:P.value,"aria-label":P.value,disabled:e.disabled||!l.value||c.value||u.value||p.value,onClick:Y},[a.value&&!c.value?(F(),q("svg",Zd,N[9]||(N[9]=[x("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"},null,-1)]))):c.value?(F(),q("svg",Qd,N[11]||(N[11]=[x("circle",{cx:"12",cy:"12",r:"9",opacity:"0.3"},null,-1),x("path",{d:"M21 12a9 9 0 0 1-9 9"},null,-1)]))):(F(),q("svg",Xd,N[10]||(N[10]=[x("path",{d:"M12 3a3 3 0 0 0-3 3v6a3 3 0 0 0 6 0V6a3 3 0 0 0-3-3z"},null,-1),x("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"},null,-1),x("path",{d:"M12 19v3"},null,-1)])))],10,Yd),x("button",{type:"submit",title:I.value,"aria-label":I.value,class:ye(["grid h-8 w-8 shrink-0 appearance-none place-items-center rounded-full border-0 transition-all duration-200 hover:-translate-y-0.5 focus:outline-none disabled:cursor-not-allowed disabled:opacity-40",j.value]),style:{"border-radius":"9999px"},disabled:re.value},[e.isAwaitingResponse?(F(),q("svg",ep,N[12]||(N[12]=[x("circle",{cx:"12",cy:"12",r:"8",stroke:"currentColor","stroke-width":"2.1",class:"opacity-95"},null,-1),x("rect",{x:"9",y:"9",width:"6",height:"6",rx:"1.35",fill:"currentColor"},null,-1)]))):(F(),q("svg",tp,N[13]||(N[13]=[x("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.59 5.58L20 12l-8-8-8 8z"},null,-1)])))],10,Jd)],32),Me(Wd,{visible:w.value,message:E.value,type:m.value,dismissible:m.value!=="listening",onClose:We},null,8,["visible","message","type","dismissible"])]))}},sp={class:"relative overflow-hidden bg-linear-to-br from-brand-600 via-brand-500 to-violet-400"},rp={class:"min-w-0"},ip={key:1,class:"border-t border-slate-200/80 bg-white/90 px-3 py-3 pb-[calc(12px+env(safe-area-inset-bottom))] backdrop-blur-sm sm:px-4 sm:py-4"},op=56,lp={__name:"ChatbotPopup",props:{isOpen:{type:Boolean,required:!0},activeTab:{type:String,required:!0},debugEnabled:{type:Boolean,default:!1},sendNonERPtoaiEnabled:{type:Boolean,default:!1},chatHistory:{type:Array,required:!0},debugLogs:{type:Array,required:!0},currentDebug:{type:Object,default:null},supportHistory:{type:Array,required:!0},autoReadEnabled:{type:Boolean,required:!0},ttsConfig:{type:Object,required:!0},activeTtsProvider:{type:String,required:!0},settings:{type:Object,default:null},isAwaitingResponse:{type:Boolean,default:!1}},emits:["close","submit","cancelResponse","update:activeTab","toggleAutoRead","togglePollyPreference","toggleDebug","toggleSendNonERP"],setup(e,{expose:t,emit:n}){const s=e,r=n,i=J(null),o=J(null),a=J(s.activeTab),l=J("default"),c=J(!1);function u(){const m=i.value;if(!s.isOpen||!m){c.value=!1;return}const A=m.scrollHeight-m.clientHeight;if(A<=4){c.value=!1;return}const T=A-m.scrollTop;c.value=T>op}function p(){const m=i.value;m&&(m.scrollTo({top:m.scrollHeight,behavior:"smooth"}),setTimeout(()=>{u()},220))}function g(){Tt(()=>{u()})}function w(){if(l.value==="default"){l.value="half";return}if(l.value==="half"){l.value="full";return}l.value="default"}const E=Re(()=>{const m="chat-shell fixed z-[9999] flex min-h-0 flex-col overflow-hidden border border-slate-200/80 shadow-[0_32px_80px_-44px_rgba(2,6,23,0.7),0_18px_40px_-24px_rgba(15,23,42,0.45)] transition-all duration-300 ease-out origin-bottom-right",A=s.isOpen?"pointer-events-auto opacity-100 translate-x-0 translate-y-0 scale-100 motion-safe:animate-surface-in":"pointer-events-none opacity-0 translate-x-1/5 translate-y-8 scale-95";return l.value==="full"?[m,A,"inset-0 h-screen w-screen max-h-screen max-w-screen rounded-none origin-center"]:l.value==="half"?[m,A,"bottom-[74px] right-5 h-[min(86vh,860px)] w-[min(50vw,860px)] rounded-2xl","max-[900px]:bottom-[78px] max-[900px]:right-3 max-[900px]:h-[min(86vh,760px)] max-[900px]:w-[min(70vw,760px)] max-[900px]:rounded-[14px]","max-[600px]:inset-0 max-[600px]:h-screen max-[600px]:w-screen max-[600px]:max-h-screen max-[600px]:max-w-screen max-[600px]:rounded-none max-[600px]:pb-[env(safe-area-inset-bottom)]"]:[m,A,"bottom-[74px] right-5 h-[min(560px,72vh)] w-[min(360px,calc(100vw-40px))] rounded-2xl","max-[900px]:bottom-[78px] max-[900px]:right-3 max-[900px]:h-[min(70vh,540px)] max-[900px]:w-[min(360px,calc(100vw-24px))] max-[900px]:rounded-[14px]","max-[600px]:inset-0 max-[600px]:h-screen max-[600px]:w-screen max-[600px]:max-h-screen max-[600px]:max-w-screen max-[600px]:rounded-none max-[600px]:pb-[env(safe-area-inset-bottom)]"]});return rn(()=>s.activeTab,m=>{a.value=m,g()}),rn(()=>s.isOpen,m=>{m&&a.value!=="settings"&&Tt(()=>{var A;return(A=o.value)==null?void 0:A.focus()}),g()}),rn(a,m=>{r("update:activeTab",m),g()}),rn(()=>[s.chatHistory.length,s.supportHistory.length,s.debugLogs.length,s.currentDebug],()=>{g()}),rn(()=>s.debugEnabled,m=>{!m&&a.value==="debug"&&(a.value="chat"),g()}),Hn(()=>{g()}),t({scrollToBottom(){Tt(()=>{p()})}}),(m,A)=>(F(),q("div",{class:ye(E.value),onKeydown:A[9]||(A[9]=ct(()=>{},["stop"])),onKeyup:A[10]||(A[10]=ct(()=>{},["stop"])),onKeypress:A[11]||(A[11]=ct(()=>{},["stop"]))},[A[14]||(A[14]=x("div",{class:"pointer-events-none absolute -right-14 -top-14 h-36 w-36 rounded-full bg-brand-500/15 blur-2xl"},null,-1)),A[15]||(A[15]=x("div",{class:"pointer-events-none absolute -bottom-14 -left-12 h-32 w-32 rounded-full bg-violet-400/15 blur-2xl"},null,-1)),x("div",sp,[A[12]||(A[12]=x("div",{class:"pointer-events-none absolute inset-0 opacity-45",style:{background:"linear-gradient(120deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.02) 52%, rgba(255,255,255,0.12) 100%)"}},null,-1)),Me(vc,{windowMode:l.value,autoReadEnabled:e.autoReadEnabled,activeTtsProvider:e.activeTtsProvider,onClose:A[0]||(A[0]=T=>m.$emit("close")),onCycleResize:w,onToggleAutoRead:A[1]||(A[1]=T=>m.$emit("toggleAutoRead"))},null,8,["windowMode","autoReadEnabled","activeTtsProvider"]),Me(Sc,{modelValue:a.value,"onUpdate:modelValue":A[2]||(A[2]=T=>a.value=T),debugEnabled:e.debugEnabled},null,8,["modelValue","debugEnabled"])]),x("div",{class:"chat-scrollbar min-h-0 flex-1 overflow-x-hidden overflow-y-scroll bg-slate-50/60 px-4 py-4 max-[900px]:px-3.5 max-[900px]:py-3.5 max-[600px]:px-3 max-[600px]:py-3",ref_key:"chatBodyRef",ref:i,onScrollPassive:u},[x("div",rp,[a.value==="chat"?(F(),St(md,{key:0,messages:e.chatHistory,autoReadEnabled:e.autoReadEnabled,ttsConfig:e.ttsConfig},null,8,["messages","autoReadEnabled","ttsConfig"])):a.value==="debug"&&e.debugEnabled?(F(),St(_d,{key:1,logs:e.debugLogs,currentDebug:e.currentDebug},null,8,["logs","currentDebug"])):a.value==="support"?(F(),St(Sd,{key:2,messages:e.supportHistory,autoReadEnabled:e.autoReadEnabled,ttsConfig:e.ttsConfig},null,8,["messages","autoReadEnabled","ttsConfig"])):a.value==="settings"?(F(),St(Vd,{key:3,autoReadEnabled:e.autoReadEnabled,ttsConfig:e.ttsConfig,settings:e.settings,debugEnabled:e.debugEnabled,sendNonERPtoaiEnabled:e.sendNonERPtoaiEnabled,onToggleAutoRead:A[3]||(A[3]=T=>m.$emit("toggleAutoRead")),onTogglePollyPreference:A[4]||(A[4]=T=>m.$emit("togglePollyPreference")),onToggleDebug:A[5]||(A[5]=T=>m.$emit("toggleDebug")),onToggleSendNonERP:A[6]||(A[6]=T=>m.$emit("toggleSendNonERP"))},null,8,["autoReadEnabled","ttsConfig","settings","debugEnabled","sendNonERPtoaiEnabled"])):Ve("",!0)])],544),c.value?(F(),q("button",{key:0,type:"button",class:ye(["absolute right-4 z-20 grid h-9 w-9 place-items-center rounded-full border border-brand-200/70 bg-white/95 text-brand-600 shadow-[0_14px_26px_-16px_rgba(15,23,42,0.65)] transition-all duration-200 hover:-translate-y-0.5 hover:border-brand-300 hover:text-brand-700 focus:outline-none",a.value!=="settings"?"bottom-[calc(90px+env(safe-area-inset-bottom))] sm:bottom-[96px]":"bottom-4 sm:bottom-5"]),title:"Scroll to bottom","aria-label":"Scroll to bottom",onClick:p},A[13]||(A[13]=[x("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},[x("path",{d:"M7 10l5 5 5-5"})],-1)]),2)):Ve("",!0),a.value!=="settings"?(F(),q("div",ip,[Me(np,{ref_key:"chatFormRef",ref:o,placeholder:a.value==="support"?"Message Support...":"Message...",disabled:a.value==="chat"&&e.isAwaitingResponse,isAwaitingResponse:a.value==="chat"&&e.isAwaitingResponse,onSubmit:A[7]||(A[7]=T=>m.$emit("submit",T)),onCancel:A[8]||(A[8]=T=>m.$emit("cancelResponse"))},null,8,["placeholder","disabled","isAwaitingResponse"])])):Ve("",!0)],34))}},_l="changai_chat_id",kl="changai_polly_enabled";function ap(){let e=sessionStorage.getItem(_l);return e||(e=`session_${Date.now()}_${crypto.randomUUID()}`,sessionStorage.setItem(_l,e)),e}function up(){const e=localStorage.getItem(kl);return e===null?!0:e==="true"}function cp(e){localStorage.setItem(kl,String(!!e))}const fp={__name:"App",setup(e){const t=J(!1),n=J("chat"),s=J([]),r=J([]),i=J(!1),o=J([]),a=J(null),l=J("actual"),c=J(!0),u=J(null),p=J(!1),g=J(null),w=J(!1),E=J({enableVoiceChat:!1,pollyAvailable:!1,usePolly:!0,voiceId:"Zayd",enable_changai:!1}),m=J("off"),A=J(null),T=Re(()=>A.value!==null);function W(){if(!E.value.enableVoiceChat){m.value="off";return}m.value=E.value.usePolly?"polly":"browser"}function K(Y){var ce;const B=(ce=Y==null?void 0:Y.detail)==null?void 0:ce.provider;(B==="polly"||B==="browser"||B==="off")&&(m.value=B)}async function O(){var ce,Se,We,xt,fe;if(!(p.value||u.value)){p.value=!0;try{u.value=await Mc(l.value),E.value={enableVoiceChat:!!((ce=u.value)!=null&&ce.enable_voice_chat),pollyAvailable:!!((Se=u.value)!=null&&Se.polly_enabled),usePolly:!!((We=u.value)!=null&&We.polly_enabled)&&up(),voiceId:((xt=u.value)==null?void 0:xt.polly_voice_id)||"Zayd",enable_changai:!!((fe=u.value)!=null&&fe.enable_changai)},W(),r.value.push({type:"settings",settings:u.value})}catch(N){const pe=vl(N);r.value.push({type:"settings",error:pe})}finally{p.value=!1}}}function z(){t.value=!t.value}function P(){var Y;(Y=a.value)==null||Y.scrollToBottom()}function I(){c.value=!c.value}function re(){const Y=!E.value.usePolly;E.value={...E.value,usePolly:Y&&E.value.pollyAvailable},cp(E.value.usePolly),W()}function j(){w.value=!w.value}async function te(Y){n.value==="support"?await Z(Y):await ue(Y)}async function ue(Y){var ve;g.value=null,l.value==="actual"&&await O(),s.value.push({role:"user",text:Y}),await Tt(),P();const B=us({role:"model",text:"Thinking...",cancelable:!0,isStatus:!0,statusType:"thinking"});s.value.push(B),await Tt(),P();let ce=!1;const Se=ap(),We=`${Se}_${Date.now()}`,xt=w.value,fe=Pc(Y,Se,l.value,We,w.value),N=`debug_${We}`;let pe=Date.now();const he=[],ke=me=>{var ze;const le=Date.now(),yt=((le-pe)/1e3).toFixed(2);pe=le;const Ct=`${me.message} (${yt}s)`;if(me.message&&(he.push(Ct),g.value=Ct),!me.done&&me.message&&(B.text=me.message,B.statusType="pipeline"),me.done){B.cancelable=!1,me.error?(B.text=`⚠️ ${me.message||"Something failed"}`,B.isStatus=!1,B.statusType=null):(ze=me.data)!=null&&ze.answer&&(B.text=me.data.answer,B.isStatus=!1,B.statusType=null),frappe.realtime.off(N),g.value=null;return}};frappe.realtime.on(N,ke),A.value=()=>{ce||(ce=!0,fe.cancel(),frappe.realtime.off(N),B.isStatus=!1,B.statusType=null,B.text="Cancelled by user.",r.value.push({type:"cancelled",user:Y,steps:[...he]}),g.value=null,B.cancelable=!1,A.value=null)};try{const me=await fe.promise;if(ce)return;B.cancelable=!1;const le=((ve=bd(me==null?void 0:me.Bot))==null?void 0:ve.trim())||"No response.";B.isStatus=!1,B.statusType=null,B.text=le,r.value.push({type:"success",user:Y,steps:[...he],final_response:me}),g.value=null}catch(me){if(ce)return;frappe.realtime.off(N),B.cancelable=!1,B.isStatus=!1,B.statusType=null;const le=vl(me);g.value=null,r.value.push({type:"failed",user:Y,steps:[...he],error:le}),error==="ERR_NETWORK_CHANGED"&&(B.isStatus=!1,B.statusType=null,B.text="⚠️ Network error. Please check your connection and try again."),B.isStatus=!1,B.statusType=null,B.text="⚠️ Something went wrong. Please try again."}finally{frappe.realtime.off(N),ce||(A.value=null)}await Tt(),P()}function $(){var Y;(Y=A.value)==null||Y.call(A)}async function Z(Y){o.value.push({role:"user",text:Y}),await Tt(),P();const B=us({role:"model",text:"Sending to support...",isStatus:!0,statusType:"support"});o.value.push(B),await Tt(),P();try{const ce=await Ic(Y,l.value);B.text=ce?wl(ce):"Support request sent successfully."}catch{B.text="⚠️ Failed to reach support. Please try again."}await Tt(),P()}return Hn(()=>{typeof window!="undefined"&&window.addEventListener("changai-tts-provider",K),l.value==="actual"&&O()}),xs(()=>{typeof window!="undefined"&&window.removeEventListener("changai-tts-provider",K)}),(Y,B)=>(F(),q(Be,null,[E.value.enable_changai?(F(),St(ac,{key:0,isOpen:t.value,onToggle:z},null,8,["isOpen"])):Ve("",!0),Me(lp,{ref_key:"popupRef",ref:a,isOpen:t.value,activeTab:n.value,"onUpdate:activeTab":B[0]||(B[0]=ce=>n.value=ce),chatHistory:s.value,debugLogs:r.value,currentDebug:g.value,supportHistory:o.value,autoReadEnabled:c.value,ttsConfig:E.value,activeTtsProvider:m.value,settings:u.value,isAwaitingResponse:T.value,debugEnabled:i.value,sendNonERPtoaiEnabled:w.value,onToggleDebug:B[1]||(B[1]=ce=>i.value=!i.value),onClose:B[2]||(B[2]=ce=>t.value=!1),onSubmit:te,onCancelResponse:$,onToggleAutoRead:I,onTogglePollyPreference:re,onToggleSendNonERP:j},null,8,["isOpen","activeTab","chatHistory","debugLogs","currentDebug","supportHistory","autoReadEnabled","ttsConfig","activeTtsProvider","settings","isAwaitingResponse","debugEnabled","sendNonERPtoaiEnabled"])],64))}};function dp(){const e=document.querySelector('link[href*="/assets/changai/dist/changai-chatbot.css"]');if(e!=null&&e.href)return e.href;const t=Array.from(document.scripts).find(n=>{var s;return(s=n.src)==null?void 0:s.includes("/assets/changai/dist/changai-chatbot.js")});return t!=null&&t.src?t.src.replace(/changai-chatbot\.js(\?.*)?$/,"changai-chatbot.css$1"):null}function pp(e){const t=dp();if(!t){const n=Array.from(document.querySelectorAll("style[data-vite-dev-id]"));return n.length&&n.forEach(s=>{const r=document.createElement("style");r.dataset.changaiShadowDevStyle="1",r.textContent=s.textContent||"",e.appendChild(r)}),Promise.resolve()}return e.querySelector('link[data-changai-shadow-style="1"]')?Promise.resolve():new Promise(n=>{const s=document.createElement("link");s.rel="stylesheet",s.href=t,s.dataset.changaiShadowStyle="1",s.onload=()=>n(),s.onerror=()=>n(),e.appendChild(s),setTimeout(n,1200)})}async function Tl(){if(document.getElementById("changai-chatbot-host"))return;const e=document.createElement("div");e.id="changai-chatbot-host",document.body.appendChild(e);const t=e.attachShadow({mode:"open"});await pp(t);const n=document.createElement("div");n.id="changai-chatbot-root",t.appendChild(n),nc(fp).mount(n);function s(r){r.stopPropagation()}n.addEventListener("keydown",s),n.addEventListener("keyup",s),n.addEventListener("keypress",s)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Tl):Tl()})(); diff --git a/frontend/src/components/ChatMessage.vue b/frontend/src/components/ChatMessage.vue index 60914b0..0d3303b 100644 --- a/frontend/src/components/ChatMessage.vue +++ b/frontend/src/components/ChatMessage.vue @@ -38,6 +38,7 @@ class="overflow-x-auto" :class="shouldCollapse && !isExpanded ? 'max-h-48 overflow-y-hidden' : ''" v-html="renderedMessage" + @click="handleMessageClick" >
getSpeakableText(props.message?.text || '')) const isLoadingStatus = computed(() => ( @@ -356,4 +366,5 @@ onBeforeUnmount(() => { stopSpeech() } }) + diff --git a/pyproject.toml b/pyproject.toml index 2918c06..45e50c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,26 +7,35 @@ description = "ChangAI" readme = "README.md" dynamic = ["version"] dependencies = [ - "cffi>=1.17.1", + "cffi", "openai>=1.64.0,<2.0.0", "anthropic>=0.79.0,<1.0.0", - "google-genai>=1.60.0,<2.0.0", - "google-auth>=2.38.0,<2.49.0", - "google-cloud-aiplatform>=1.135.0,<2.0.0", + "google-genai<2.0.0", + "google-auth", + "google-cloud-aiplatform<2.0.0", "langchain-core", "langchain-community", "langchain-huggingface", "langgraph", - "symspellpy>=6.7.7,<7.0.0", - "transformers>=4.49.0,<5.0.0", - "sentence-transformers>=5.0.0", - "faiss-cpu>=1.7.4,<2.0.0", - "numpy>=1.22.0", - "sqlglot>=27.0.0", - "boto3>=1.34.0", - "PyQRCode>=1.2.1", - "pypng>=0.20220715.0", - "opencv-python-headless>=4.8.0,<5.0.0" + "symspellpy", + "transformers", + "sentence-transformers", + "faiss-cpu<2.0.0", + "numpy", + "sqlglot", + "boto3", + "PyQRCode", + "pypng", + "opencv-python-headless", + "rapidfuzz", + "Pillow", + "pandas", + "scikit-learn", + "tabulate", + "regex", + "aiohttp", + "paramiko", + "tomli-w" ] [build-system]