diff --git a/.gitignore b/.gitignore index fab542482..c53da76a2 100644 --- a/.gitignore +++ b/.gitignore @@ -189,3 +189,7 @@ test.py !/.venv/ + +sqlbot-xpack + +.claude diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..a45f1a63d --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,30 @@ +# Contributing + +As a contributor, you should agree that: + +a. The producer can adjust the open-source agreement to be more strict or relaxed as deemed necessary. +b. Your contributed code may be used for commercial purposes, including but not limited to its cloud business operations. + +## Create pull request +PR are always welcome, even if they only contain small fixes like typos or a few lines of code. If there will be a significant effort, please document it as an issue and get a discussion going before starting to work on it. + +Please submit a PR broken down into small changes' bit by bit. A PR consisting of a lot of features and code changes may be hard to review. It is recommended to submit PRs in an incremental fashion. + +This [development guideline](https://sqlbot.org/docs/v1/installation/source_run/) contains information about repository structure, how to set up development environment, how to run it, and more. + +Note: If you split your pull request to small changes, please make sure any of the changes goes to master will not break anything. Otherwise, it can not be merged until this feature complete. + +## Report issues +It is a great way to contribute by reporting an issue. Well-written and complete bug reports are always welcome! Please open an issue and follow the template to fill in required information. + +Before opening any issue, please look up the existing issues to avoid submitting a duplication. +If you find a match, you can "subscribe" to it to get notified on updates. If you have additional helpful information about the issue, please leave a comment. + +When reporting issues, always include: + +* Which version you are using. +* Steps to reproduce the issue. +* Snapshots or log files if needed + +Because the issues are open to the public, when submitting files, be sure to remove any sensitive information, e.g. username, password, IP address, and company name. You can +replace those parts with "REDACTED" or other strings like "****". diff --git a/Dockerfile b/Dockerfile index b1c1e9256..c8727b40a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -95,6 +95,6 @@ EXPOSE 3000 8000 8001 5432 # Add health check HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ - CMD curl -f http://localhost:8000 || exit 1 + CMD python3 -c "import os, urllib.request; urllib.request.urlopen(f'http://localhost:8000/{os.environ.get(\"CONTEXT_PATH\", \"\")}', timeout=3)" || exit 1 ENTRYPOINT ["sh", "start.sh"] diff --git a/README.md b/README.md index 078478e34..c5a258844 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,23 @@ SQLBot 是一款基于大语言模型和 RAG 的智能问数系统,由 DataEas - **易于集成**:支持多种集成方式,提供 Web 嵌入、弹窗嵌入、MCP 调用等能力;能够快速嵌入到 n8n、Dify、MaxKB、DataEase 等应用,让各类应用快速拥有智能问数能力。 - **越问越准**:支持自定义提示词、术语库配置,可维护 SQL 示例校准逻辑,精准匹配业务场景;高效运营,基于用户交互数据持续迭代优化,问数效果随使用逐步提升,越问越准。 +## 支持的大模型服务商 + +| 服务商 | API 兼容 | +|--------|----------| +| 阿里云百炼 | OpenAI 兼容 | +| 千帆大模型 | OpenAI 兼容 | +| DeepSeek | OpenAI 兼容 | +| 腾讯混元 | OpenAI 兼容 | +| 讯飞星火 | OpenAI 兼容 | +| Gemini | OpenAI 兼容 | +| OpenAI | 原生 | +| Kimi | OpenAI 兼容 | +| 腾讯云 | OpenAI 兼容 | +| 火山引擎 | OpenAI 兼容 | +| MiniMax | OpenAI 兼容 | +| 通用 OpenAI 兼容 | 自定义 | + ## 快速开始 ### 安装部署 @@ -66,7 +83,7 @@ docker run -d \ 如你有更多问题,可以加入我们的技术交流群与我们交流。 -contact_me_qr +contact_me_qr ## UI 展示 diff --git a/backend/alembic/env.py b/backend/alembic/env.py index 0ae300dd7..19e19fce6 100755 --- a/backend/alembic/env.py +++ b/backend/alembic/env.py @@ -24,13 +24,14 @@ # from apps.system.models.user import SQLModel # noqa # from apps.settings.models.setting_models import SQLModel -from apps.chat.models.chat_model import SQLModel +#from apps.chat.models.chat_model import SQLModel from apps.terminology.models.terminology_model import SQLModel -#from apps.custom_prompt.models.custom_prompt_model import SQLModel -from apps.data_training.models.data_training_model import SQLModel +from sqlbot_xpack.custom_prompt.models.custom_prompt_model import SQLModel +#from apps.data_training.models.data_training_model import SQLModel # from apps.dashboard.models.dashboard_model import SQLModel from common.core.config import settings # noqa #from apps.datasource.models.datasource import SQLModel +from apps.system.models.system_model import SQLModel target_metadata = SQLModel.metadata diff --git a/backend/alembic/versions/061_assistant_oid_ddl.py b/backend/alembic/versions/061_assistant_oid_ddl.py index d88bd3824..d4bdb4b5b 100644 --- a/backend/alembic/versions/061_assistant_oid_ddl.py +++ b/backend/alembic/versions/061_assistant_oid_ddl.py @@ -31,7 +31,9 @@ def upgrade(): try: config = json.loads(row.configuration) if isinstance(row.configuration, str) else row.configuration oid_value = config.get('oid', 1) if isinstance(config, dict) else 1 - if isinstance(oid_value, int) and oid_value != 1: + if oid_value != 1: + if not isinstance(oid_value, int): + oid_value = int(oid_value) conn.execute( sa.text("UPDATE sys_assistant SET oid = :oid WHERE id = :id"), {"oid": oid_value, "id": row.id} diff --git a/backend/alembic/versions/062_update_chat_log_dll.py b/backend/alembic/versions/062_update_chat_log_dll.py new file mode 100644 index 000000000..9d729b875 --- /dev/null +++ b/backend/alembic/versions/062_update_chat_log_dll.py @@ -0,0 +1,36 @@ +"""062_update_chat_log_dll + +Revision ID: c9ab05247503 +Revises: 547df942eb90 +Create Date: 2026-01-27 14:20:35.069255 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes +from sqlalchemy.dialects import postgresql + +# revision identifiers, used by Alembic. +revision = 'c9ab05247503' +down_revision = '547df942eb90' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('chat_log', sa.Column('local_operation', sa.Boolean(), nullable=True)) + sql = ''' + UPDATE chat_log SET local_operation = false + ''' + op.execute(sql) + op.alter_column('chat_log', 'local_operation', + existing_type=sa.BOOLEAN(), + nullable=False) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('chat_log', 'local_operation') + # ### end Alembic commands ### diff --git a/backend/alembic/versions/063_update_chat_log_dll.py b/backend/alembic/versions/063_update_chat_log_dll.py new file mode 100644 index 000000000..f4c8e01d1 --- /dev/null +++ b/backend/alembic/versions/063_update_chat_log_dll.py @@ -0,0 +1,36 @@ +"""063_update_chat_log_dll + +Revision ID: c8751179a8de +Revises: c9ab05247503 +Create Date: 2026-01-29 14:41:21.022781 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes +from sqlalchemy.dialects import postgresql + +# revision identifiers, used by Alembic. +revision = 'c8751179a8de' +down_revision = 'c9ab05247503' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('chat_log', sa.Column('error', sa.Boolean(), nullable=True)) + sql = ''' + UPDATE chat_log SET error = false + ''' + op.execute(sql) + op.alter_column('chat_log', 'error', + existing_type=sa.BOOLEAN(), + nullable=False) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('chat_log', 'error') + # ### end Alembic commands ### diff --git a/backend/alembic/versions/064_system_variable.py b/backend/alembic/versions/064_system_variable.py new file mode 100644 index 000000000..330228fa9 --- /dev/null +++ b/backend/alembic/versions/064_system_variable.py @@ -0,0 +1,82 @@ +"""062_system_variable + +Revision ID: ed947895d470 +Revises: 547df942eb90 +Create Date: 2026-01-26 10:16:59.877303 + +""" +import sqlalchemy as sa +import sqlmodel.sql.sqltypes +from alembic import op +from sqlalchemy import String, BigInteger, DateTime +from sqlalchemy.dialects import postgresql +from sqlalchemy.dialects.postgresql import JSONB +from sqlalchemy.sql import table, column + +# revision identifiers, used by Alembic. +revision = 'ed947895d470' +down_revision = 'c8751179a8de' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('system_variable', + sa.Column('id', sa.BigInteger(), sa.Identity(always=True), nullable=False), + sa.Column('name', sqlmodel.sql.sqltypes.AutoString(length=128), nullable=False), + sa.Column('var_type', sqlmodel.sql.sqltypes.AutoString(length=128), nullable=False), + sa.Column('type', sqlmodel.sql.sqltypes.AutoString(length=128), nullable=False), + sa.Column('value', postgresql.JSONB(astext_type=sa.Text()), nullable=True), + sa.Column('create_time', sa.DateTime(), nullable=True), + sa.Column('create_by', sa.BigInteger(), nullable=True), + sa.PrimaryKeyConstraint('id') + ) + + variable_table = table( + "system_variable", + column("id", BigInteger), + column("name", String), + column("var_type", String), + column("type", String), + column("value", JSONB), + column("create_time", DateTime), + column("create_by", BigInteger), + ) + + op.bulk_insert( + variable_table, + [ + { + "name": "i18n_variable.name", + "var_type": "text", + "type": "system", + "value": ["name"], + "create_time": None, + "create_by": None + }, + { + "name": "i18n_variable.account", + "var_type": "text", + "type": "system", + "value": ["account"], + "create_time": None, + "create_by": None + }, + { + "name": "i18n_variable.email", + "var_type": "text", + "type": "system", + "value": ["email"], + "create_time": None, + "create_by": None + } + ] + ) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_table('system_variable') + # ### end Alembic commands ### diff --git a/backend/alembic/versions/065_user_bind_var.py b/backend/alembic/versions/065_user_bind_var.py new file mode 100644 index 000000000..140198960 --- /dev/null +++ b/backend/alembic/versions/065_user_bind_var.py @@ -0,0 +1,29 @@ +"""063_user + +Revision ID: 8ff90df7871d +Revises: ed947895d470 +Create Date: 2026-01-26 15:30:11.348083 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes +from sqlalchemy.dialects import postgresql + +# revision identifiers, used by Alembic. +revision = '8ff90df7871d' +down_revision = 'ed947895d470' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('sys_user', sa.Column('system_variables', postgresql.JSONB(astext_type=sa.Text()), nullable=True)) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('sys_user', 'system_variables') + # ### end Alembic commands ### diff --git a/backend/alembic/versions/066_update_assistant_model.py b/backend/alembic/versions/066_update_assistant_model.py new file mode 100644 index 000000000..9e7ea17ce --- /dev/null +++ b/backend/alembic/versions/066_update_assistant_model.py @@ -0,0 +1,30 @@ +"""066_update_assistant_model + +Revision ID: 8adc3a4919be +Revises: 8ff90df7871d +Create Date: 2026-04-28 15:55:42.757276 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes +from sqlalchemy.dialects import postgresql + +# revision identifiers, used by Alembic. +revision = '8adc3a4919be' +down_revision = '8ff90df7871d' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('sys_assistant', sa.Column('enable_custom_model', sa.Boolean(), nullable=True)) + op.add_column('sys_assistant', sa.Column('custom_model', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=True)) + # ### end Alembic commands ### + + +def downgrade(): + op.drop_column('sys_assistant', 'custom_model') + op.drop_column('sys_assistant', 'enable_custom_model') + # ### end Alembic commands ### diff --git a/backend/alembic/versions/067_ai_model_workspace_mapping.py b/backend/alembic/versions/067_ai_model_workspace_mapping.py new file mode 100644 index 000000000..aa558ba25 --- /dev/null +++ b/backend/alembic/versions/067_ai_model_workspace_mapping.py @@ -0,0 +1,34 @@ +"""067_ai_model_workspace_mapping + +Revision ID: e51127e9aa4a +Revises: 8adc3a4919be +Create Date: 2026-06-01 14:14:23.112843 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes +from sqlalchemy.dialects import postgresql + +# revision identifiers, used by Alembic. +revision = 'e51127e9aa4a' +down_revision = '8adc3a4919be' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('ai_model_workspace_mapping', + sa.Column('id', sa.BigInteger(), nullable=False), + sa.Column('ai_model_id', sa.BigInteger(), nullable=True), + sa.Column('workspace_id', sa.BigInteger(), nullable=True), + sa.PrimaryKeyConstraint('id') + ) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_table('ai_model_workspace_mapping') + # ### end Alembic commands ### diff --git a/backend/alembic/versions/068_alter_sys_logs_user_agent_length.py b/backend/alembic/versions/068_alter_sys_logs_user_agent_length.py new file mode 100644 index 000000000..2ecbf966a --- /dev/null +++ b/backend/alembic/versions/068_alter_sys_logs_user_agent_length.py @@ -0,0 +1,29 @@ +"""068_alter_sys_logs_user_agent_length + +Revision ID: a1b2c3d4e5f6 +Revises: e51127e9aa4a +Create Date: 2026-06-09 00:00:00.000000 + +""" +from alembic import op +import sqlalchemy as sa + +# revision identifiers, used by Alembic. +revision = 'a1b2c3d4e5f6' +down_revision = 'e51127e9aa4a' +branch_labels = None +depends_on = None + + +def upgrade(): + op.alter_column('sys_logs', 'user_agent', + existing_type=sa.VARCHAR(length=255), + type_=sa.VARCHAR(length=500), + existing_nullable=True) + + +def downgrade(): + op.alter_column('sys_logs', 'user_agent', + existing_type=sa.VARCHAR(length=500), + type_=sa.VARCHAR(length=255), + existing_nullable=True) diff --git a/backend/alembic/versions/069_term_custom_prompt.py b/backend/alembic/versions/069_term_custom_prompt.py new file mode 100644 index 000000000..e02aaac37 --- /dev/null +++ b/backend/alembic/versions/069_term_custom_prompt.py @@ -0,0 +1,31 @@ +"""069_term_custom_prompt + +Revision ID: 1f82cad3546e +Revises: a1b2c3d4e5f6 +Create Date: 2026-06-15 14:51:12.280391 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes +from sqlalchemy.dialects import postgresql + +# revision identifiers, used by Alembic. +revision = '1f82cad3546e' +down_revision = 'a1b2c3d4e5f6' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('custom_prompt', sa.Column('advanced_application', sa.BigInteger(), nullable=True)) + op.add_column('terminology', sa.Column('advanced_application', sa.BigInteger(), nullable=True)) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('terminology', 'advanced_application') + op.drop_column('custom_prompt', 'advanced_application') + # ### end Alembic commands ### diff --git a/backend/alembic/versions/070_add_table_column_comments.py b/backend/alembic/versions/070_add_table_column_comments.py new file mode 100644 index 000000000..2b0aa4e5a --- /dev/null +++ b/backend/alembic/versions/070_add_table_column_comments.py @@ -0,0 +1,440 @@ +"""070_add_table_column_comments + +为所有数据库表和字段添加中文备注(COMMENT ON)。 +Revision ID: 070a1b2c3d4e5 +Revises: 1f82cad3546e +Create Date: 2026-06-25 00:00:00.000000 + +""" +from alembic import op + +# revision identifiers, used by Alembic. +revision = '070a1b2c3d4e5' +down_revision = '1f82cad3546e' +branch_labels = None +depends_on = None + +# 表和列备注定义:key 为 "表名" 或 "表名.列名",value 为备注文本 +_COMMENTS = { + # ========== alembic_version 迁移版本记录表 ========== + 'alembic_version': 'Alembic迁移版本记录表', + 'alembic_version.version_num': '当前已应用的迁移版本号', + + # ========== sys_user 用户表 ========== + 'sys_user': '系统用户表', + 'sys_user.id': '用户ID', + 'sys_user.account': '用户账号', + 'sys_user.name': '用户名称', + 'sys_user.password': '用户密码', + 'sys_user.email': '用户邮箱', + 'sys_user.oid': '组织ID', + 'sys_user.status': '用户状态', + 'sys_user.origin': '用户来源', + 'sys_user.create_time': '创建时间', + 'sys_user.language': '用户语言偏好', + 'sys_user.system_variables': '用户自定义系统变量', + + # ========== sys_user_platform 用户平台关联表 ========== + 'sys_user_platform': '用户平台关联表', + 'sys_user_platform.id': '主键ID', + 'sys_user_platform.uid': '用户ID', + 'sys_user_platform.origin': '平台来源', + 'sys_user_platform.platform_uid': '平台用户ID', + + # ========== ai_model AI模型表 ========== + 'ai_model': 'AI模型配置表', + 'ai_model.id': '模型ID', + 'ai_model.supplier': '模型供应商', + 'ai_model.name': '模型名称', + 'ai_model.model_type': '模型类型', + 'ai_model.base_model': '基础模型标识', + 'ai_model.default_model': '是否默认模型', + 'ai_model.api_key': 'API密钥', + 'ai_model.api_domain': 'API域名地址', + 'ai_model.protocol': '通信协议', + 'ai_model.config': '模型配置信息', + 'ai_model.status': '模型状态', + 'ai_model.create_time': '创建时间', + + # ========== ai_model_workspace_mapping 模型工作空间映射表 ========== + 'ai_model_workspace_mapping': 'AI模型与工作空间映射表', + 'ai_model_workspace_mapping.id': '主键ID', + 'ai_model_workspace_mapping.ai_model_id': 'AI模型ID', + 'ai_model_workspace_mapping.workspace_id': '工作空间ID', + + # ========== sys_workspace 工作空间表 ========== + 'sys_workspace': '工作空间表', + 'sys_workspace.id': '工作空间ID', + 'sys_workspace.name': '工作空间名称', + 'sys_workspace.create_time': '创建时间', + + # ========== sys_user_ws 用户工作空间关联表 ========== + 'sys_user_ws': '用户工作空间权限表', + 'sys_user_ws.id': '主键ID', + 'sys_user_ws.uid': '用户ID', + 'sys_user_ws.oid': '组织ID', + 'sys_user_ws.weight': '权重值', + + # ========== sys_assistant AI助手表 ========== + 'sys_assistant': 'AI助手配置表', + 'sys_assistant.id': '助手ID', + 'sys_assistant.name': '助手名称', + 'sys_assistant.type': '助手类型', + 'sys_assistant.domain': '助手适用领域', + 'sys_assistant.description': '助手描述信息', + 'sys_assistant.configuration': '助手配置', + 'sys_assistant.create_time': '创建时间', + 'sys_assistant.app_id': '应用ID', + 'sys_assistant.app_secret': '应用密钥', + 'sys_assistant.oid': '组织ID', + 'sys_assistant.enable_custom_model': '是否启用自定义模型', + 'sys_assistant.custom_model': '自定义模型名称', + + # ========== sys_authentication 认证配置表 ========== + 'sys_authentication': '认证配置表', + 'sys_authentication.id': '认证配置ID', + 'sys_authentication.name': '认证配置名称', + 'sys_authentication.type': '认证类型', + 'sys_authentication.config': '认证配置详情', + 'sys_authentication.create_time': '创建时间', + 'sys_authentication.enable': '是否启用', + 'sys_authentication.valid': '配置是否有效', + + # ========== sys_apikey API密钥表 ========== + 'sys_apikey': 'API密钥表', + 'sys_apikey.id': '密钥ID', + 'sys_apikey.access_key': '访问密钥', + 'sys_apikey.secret_key': '密钥', + 'sys_apikey.create_time': '创建时间', + 'sys_apikey.uid': '绑定用户ID', + 'sys_apikey.status': '密钥状态', + + # ========== system_variable 系统变量表 ========== + 'system_variable': '系统变量表', + 'system_variable.id': '变量ID', + 'system_variable.name': '变量名称', + 'system_variable.var_type': '变量数据类型', + 'system_variable.type': '变量分类', + 'system_variable.value': '变量值', + 'system_variable.create_time': '创建时间', + 'system_variable.create_by': '创建人ID', + + # ========== terms 术语设置表 ========== + 'terms': '术语设置表', + 'terms.id': '术语ID', + 'terms.term': '术语名称', + 'terms.definition': '术语定义', + 'terms.domain': '所属领域', + 'terms.create_time': '创建时间', + + # ========== custom_prompt 自定义提示词表 ========== + 'custom_prompt': '自定义提示词表', + 'custom_prompt.id': '提示词ID', + 'custom_prompt.oid': '组织ID', + 'custom_prompt.type': '提示词类型', + 'custom_prompt.create_time': '创建时间', + 'custom_prompt.name': '提示词名称', + 'custom_prompt.prompt': '提示词内容', + 'custom_prompt.specific_ds': '是否关联特定数据源', + 'custom_prompt.datasource_ids': '关联数据源ID列表', + 'custom_prompt.advanced_application': '高级应用ID', + + # ========== core_datasource 数据源表 ========== + 'core_datasource': '数据源配置表', + 'core_datasource.id': '数据源ID', + 'core_datasource.name': '数据源名称', + 'core_datasource.description': '数据源描述', + 'core_datasource.type': '数据源类型', + 'core_datasource.type_name': '数据源类型名称', + 'core_datasource.configuration': '连接配置信息', + 'core_datasource.create_time': '创建时间', + 'core_datasource.create_by': '创建人ID', + 'core_datasource.status': '连接状态', + 'core_datasource.num': '数据源编号', + 'core_datasource.oid': '组织ID', + 'core_datasource.table_relation': '表关系配置', + 'core_datasource.embedding': '向量嵌入信息', + 'core_datasource.recommended_config': '推荐问题配置', + + # ========== core_table 数据源表信息 ========== + 'core_table': '数据源表信息', + 'core_table.id': '表记录ID', + 'core_table.ds_id': '所属数据源ID', + 'core_table.checked': '是否启用', + 'core_table.table_name': '表名称', + 'core_table.table_comment': '表注释', + 'core_table.custom_comment': '自定义表注释', + 'core_table.embedding': '表向量嵌入信息', + + # ========== ds_recommended_problem 推荐问题表 ========== + 'ds_recommended_problem': '数据源推荐问题表', + 'ds_recommended_problem.id': '问题ID', + 'ds_recommended_problem.datasource_id': '数据源ID', + 'ds_recommended_problem.question': '推荐问题内容', + 'ds_recommended_problem.remark': '问题备注', + 'ds_recommended_problem.sort': '排序序号', + 'ds_recommended_problem.create_time': '创建时间', + 'ds_recommended_problem.create_by': '创建人ID', + + # ========== core_field 数据源字段信息 ========== + 'core_field': '数据源字段信息表', + 'core_field.id': '字段记录ID', + 'core_field.ds_id': '所属数据源ID', + 'core_field.table_id': '所属表ID', + 'core_field.checked': '是否启用', + 'core_field.field_name': '字段名称', + 'core_field.field_type': '字段类型', + 'core_field.field_comment': '字段注释', + 'core_field.custom_comment': '自定义字段注释', + 'core_field.field_index': '字段序号', + + # ========== data_training 数据训练(示例库)表 ========== + 'data_training': 'SQL示例训练库表', + 'data_training.id': '训练记录ID', + 'data_training.oid': '组织ID', + 'data_training.datasource': '关联数据源ID', + 'data_training.create_time': '创建时间', + 'data_training.question': '训练问题', + 'data_training.description': '训练描述', + 'data_training.embedding': '向量嵌入数据', + 'data_training.enabled': '是否启用', + 'data_training.advanced_application': '高级应用ID', + + # ========== terminology 术语表 ========== + 'terminology': '术语管理表', + 'terminology.id': '术语ID', + 'terminology.oid': '组织ID', + 'terminology.pid': '父级术语ID', + 'terminology.create_time': '创建时间', + 'terminology.word': '术语词条', + 'terminology.description': '术语描述', + 'terminology.embedding': '向量嵌入数据', + 'terminology.specific_ds': '是否关联特定数据源', + 'terminology.datasource_ids': '关联数据源ID列表', + 'terminology.enabled': '是否启用', + 'terminology.advanced_application': '高级应用ID', + + # ========== core_dashboard 仪表板表 ========== + 'core_dashboard': '仪表板表', + 'core_dashboard.id': '仪表板ID', + 'core_dashboard.name': '仪表板名称', + 'core_dashboard.pid': '父级仪表板ID', + 'core_dashboard.workspace_id': '所属工作空间ID', + 'core_dashboard.org_id': '组织ID', + 'core_dashboard.level': '层级', + 'core_dashboard.node_type': '节点类型', + 'core_dashboard.type': '仪表板类型', + 'core_dashboard.canvas_style_data': '画布样式数据', + 'core_dashboard.component_data': '组件数据', + 'core_dashboard.canvas_view_info': '画布视图信息', + 'core_dashboard.mobile_layout': '是否移动端布局', + 'core_dashboard.status': '状态', + 'core_dashboard.self_watermark_status': '水印状态', + 'core_dashboard.sort': '排序序号', + 'core_dashboard.create_time': '创建时间', + 'core_dashboard.create_by': '创建人', + 'core_dashboard.update_time': '更新时间', + 'core_dashboard.update_by': '更新人', + 'core_dashboard.remark': '备注', + 'core_dashboard.source': '来源标识', + 'core_dashboard.delete_flag': '删除标记', + 'core_dashboard.delete_time': '删除时间', + 'core_dashboard.delete_by': '删除人', + 'core_dashboard.version': '版本号', + 'core_dashboard.content_id': '内容ID', + 'core_dashboard.check_version': '检查版本', + + # ========== chat_log 聊天日志表 ========== + 'chat_log': 'AI聊天执行日志表', + 'chat_log.id': '日志ID', + 'chat_log.type': '聊天类型', + 'chat_log.operate': '操作类型', + 'chat_log.pid': '父级日志ID', + 'chat_log.ai_modal_id': '使用的AI模型ID', + 'chat_log.base_modal': '基础模型标识', + 'chat_log.messages': '消息内容', + 'chat_log.reasoning_content': '推理内容', + 'chat_log.start_time': '开始时间', + 'chat_log.finish_time': '结束时间', + 'chat_log.token_usage': 'Token消耗统计', + 'chat_log.local_operation': '是否本地操作', + 'chat_log.error': '是否发生错误', + + # ========== chat 聊天主表 ========== + 'chat': 'AI聊天会话表', + 'chat.id': '聊天会话ID', + 'chat.oid': '组织ID', + 'chat.create_time': '创建时间', + 'chat.create_by': '创建人ID', + 'chat.brief': '会话摘要', + 'chat.chat_type': '聊天类型', + 'chat.datasource': '关联数据源ID', + 'chat.engine_type': '数据引擎类型', + 'chat.origin': '会话来源', + 'chat.brief_generate': '是否已生成摘要', + 'chat.recommended_question_answer': '推荐问题回答', + 'chat.recommended_question': '推荐问题内容', + 'chat.recommended_generate': '是否已生成推荐问题', + + # ========== chat_record 聊天记录表 ========== + 'chat_record': 'AI聊天记录表', + 'chat_record.id': '记录ID', + 'chat_record.chat_id': '关联聊天会话ID', + 'chat_record.ai_modal_id': '使用的AI模型ID', + 'chat_record.first_chat': '是否首轮对话', + 'chat_record.create_time': '创建时间', + 'chat_record.finish_time': '完成时间', + 'chat_record.create_by': '创建人ID', + 'chat_record.datasource': '关联数据源ID', + 'chat_record.engine_type': '数据引擎类型', + 'chat_record.question': '用户问题内容', + 'chat_record.sql_answer': 'SQL生成回答', + 'chat_record.sql': '生成的SQL语句', + 'chat_record.sql_exec_result': 'SQL执行结果', + 'chat_record.data': '查询返回数据', + 'chat_record.chart_answer': '图表生成回答', + 'chat_record.chart': '图表配置信息', + 'chat_record.analysis': '分析结果内容', + 'chat_record.predict': '预测结果内容', + 'chat_record.predict_data': '预测数据', + 'chat_record.recommended_question_answer': '推荐问题回答', + 'chat_record.recommended_question': '推荐问题列表', + 'chat_record.datasource_select_answer': '数据源选择回答', + 'chat_record.finish': '是否已完成', + 'chat_record.error': '错误信息', + 'chat_record.analysis_record_id': '关联分析记录ID', + 'chat_record.predict_record_id': '关联预测记录ID', + 'chat_record.regenerate_record_id': '关联重新生成记录ID', + + # ========== sys_logs 系统操作日志表 ========== + 'sys_logs': '系统操作日志表', + 'sys_logs.id': '日志ID', + 'sys_logs.operation_type': '操作类型', + 'sys_logs.operation_detail': '操作详情', + 'sys_logs.user_id': '操作用户ID', + 'sys_logs.operation_status': '操作状态', + 'sys_logs.ip_address': '操作IP地址', + 'sys_logs.user_agent': '用户代理信息', + 'sys_logs.execution_time': '执行耗时', + 'sys_logs.error_message': '错误信息', + 'sys_logs.create_time': '创建时间', + 'sys_logs.module': '操作模块', + 'sys_logs.oid': '组织ID', + 'sys_logs.resource_id': '操作资源ID', + 'sys_logs.request_method': '请求方法', + 'sys_logs.request_path': '请求路径', + 'sys_logs.remark': '备注', + 'sys_logs.user_name': '操作用户名称', + 'sys_logs.resource_name': '操作资源名称', + + # ========== sys_logs_resource 日志关联资源表 ========== + 'sys_logs_resource': '操作日志关联资源表', + 'sys_logs_resource.id': '主键ID', + 'sys_logs_resource.log_id': '关联日志ID', + 'sys_logs_resource.resource_id': '资源ID', + 'sys_logs_resource.resource_name': '资源名称', + 'sys_logs_resource.module': '资源模块', + + # ========== ds_permission 数据权限表 ========== + 'ds_permission': '数据权限配置表', + 'ds_permission.id': '权限ID', + 'ds_permission.enable': '是否启用', + 'ds_permission.name': '权限名称', + 'ds_permission.auth_target_type': '授权对象类型', + 'ds_permission.auth_target_id': '授权对象ID', + 'ds_permission.type': '权限类型', + 'ds_permission.ds_id': '数据源ID', + 'ds_permission.table_id': '表ID', + 'ds_permission.expression_tree': '权限表达式树', + 'ds_permission.permissions': '权限配置', + 'ds_permission.white_list_user': '白名单用户列表', + 'ds_permission.create_time': '创建时间', + + # ========== ds_rules 数据规则表 ========== + 'ds_rules': '数据规则组表', + 'ds_rules.id': '规则组ID', + 'ds_rules.enable': '是否启用', + 'ds_rules.name': '规则组名称', + 'ds_rules.description': '规则组描述', + 'ds_rules.permission_list': '权限列表', + 'ds_rules.user_list': '用户列表', + 'ds_rules.white_list_user': '白名单用户列表', + 'ds_rules.oid': '组织ID', + 'ds_rules.create_time': '创建时间', + + # ========== license 许可证表 ========== + 'license': '系统许可证表', + 'license.id': '许可证ID', + 'license.license_key': '许可证密钥', + 'license.f2c_license': 'F2C许可证信息', + 'license.create_time': '创建时间', + 'license.update_time': '更新时间', + + # ========== rsa 密钥表 ========== + 'rsa': 'RSA密钥存储表', + 'rsa.id': '密钥ID', + 'rsa.private_key': 'RSA私钥', + 'rsa.public_key': 'RSA公钥', + 'rsa.salt': '加密盐值', + 'rsa.create_time': '创建时间', + 'rsa.update_time': '更新时间', + + # ========== sys_arg 系统参数表 ========== + 'sys_arg': '系统参数配置表', + 'sys_arg.id': '参数ID', + 'sys_arg.pkey': '参数键', + 'sys_arg.pval': '参数值', + 'sys_arg.ptype': '参数类型', + 'sys_arg.sort_no': '排序序号', + + # ========== sys_platform_token 平台令牌表 ========== + 'sys_platform_token': '平台认证令牌表', + 'sys_platform_token.id': '令牌ID', + 'sys_platform_token.token': '令牌值', + 'sys_platform_token.create_time': '创建时间', + 'sys_platform_token.exp_time': '过期时间', +} + + +def _escape_comment(comment): + return comment.replace("'", "''") + + +def _apply_table_comment(table, comment): + if comment is None: + op.execute(f"COMMENT ON TABLE {table} IS NULL") + else: + op.execute(f"COMMENT ON TABLE {table} IS '{_escape_comment(comment)}'") + + +def _apply_column_comment(table, column, comment): + if comment is None: + op.execute(f"COMMENT ON COLUMN {table}.{column} IS NULL") + else: + op.execute(f"COMMENT ON COLUMN {table}.{column} IS '{_escape_comment(comment)}'") + + +def upgrade(): + """为所有表和字段添加中文备注""" + table_keys = sorted(k for k in _COMMENTS if '.' not in k) + column_keys = sorted(k for k in _COMMENTS if '.' in k) + + for table in table_keys: + _apply_table_comment(table, _COMMENTS[table]) + + for key in column_keys: + table, column = key.split('.', 1) + _apply_column_comment(table, column, _COMMENTS[key]) + + +def downgrade(): + """移除所有表和字段的备注""" + table_keys = sorted((k for k in _COMMENTS if '.' not in k), reverse=True) + column_keys = sorted((k for k in _COMMENTS if '.' in k), reverse=True) + + for key in column_keys: + table, column = key.split('.', 1) + _apply_column_comment(table, column, None) + + for table in table_keys: + _apply_table_comment(table, None) diff --git a/backend/alembic/versions/071_modify_permission_jsonb.py b/backend/alembic/versions/071_modify_permission_jsonb.py new file mode 100644 index 000000000..cac4c64b9 --- /dev/null +++ b/backend/alembic/versions/071_modify_permission_jsonb.py @@ -0,0 +1,45 @@ +"""071_modify_permission_jsonb + +Revision ID: a2e2ecfa5a9c +Revises: 070a1b2c3d4e5 +Create Date: 2026-07-16 16:56:47.093944 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes +from sqlalchemy.dialects import postgresql + +# revision identifiers, used by Alembic. +revision = 'a2e2ecfa5a9c' +down_revision = '070a1b2c3d4e5' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.alter_column('ds_rules', 'permission_list', + existing_type=sa.Text(), + type_=postgresql.JSONB(astext_type=sa.Text()), + existing_nullable=True, + postgresql_using='permission_list::jsonb') + op.alter_column('ds_rules', 'user_list', + existing_type=sa.Text(), + type_=postgresql.JSONB(astext_type=sa.Text()), + existing_nullable=True, + postgresql_using='user_list::jsonb') + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.alter_column('ds_rules', 'permission_list', + existing_type=postgresql.JSONB(astext_type=sa.Text()), + type_=sa.Text(), + existing_nullable=True) + op.alter_column('ds_rules', 'user_list', + existing_type=postgresql.JSONB(astext_type=sa.Text()), + type_=sa.Text(), + existing_nullable=True) + # ### end Alembic commands ### diff --git a/backend/apps/ai_model/model_factory.py b/backend/apps/ai_model/model_factory.py index 03479fd8e..887005ce7 100644 --- a/backend/apps/ai_model/model_factory.py +++ b/backend/apps/ai_model/model_factory.py @@ -14,6 +14,8 @@ from common.utils.utils import prepare_model_arg from langchain_community.llms import VLLMOpenAI from langchain_openai import AzureChatOpenAI + + # from langchain_community.llms import Tongyi, VLLM class LLMConfig(BaseModel): @@ -24,16 +26,17 @@ class LLMConfig(BaseModel): api_key: Optional[str] = None api_base_url: Optional[str] = None additional_params: Dict[str, Any] = {} + class Config: frozen = True def __hash__(self): if hasattr(self, 'additional_params') and isinstance(self.additional_params, dict): - hashable_params = frozenset((k, tuple(v) if isinstance(v, (list, dict)) else v) - for k, v in self.additional_params.items()) + hashable_params = frozenset((k, tuple(v) if isinstance(v, (list, dict)) else v) + for k, v in self.additional_params.items()) else: hashable_params = None - + return hash(( self.model_id, self.model_type, @@ -61,6 +64,7 @@ def llm(self) -> BaseChatModel: """Return the langchain LLM instance""" return self._llm + class OpenAIvLLM(BaseLLM): def _init_llm(self) -> VLLMOpenAI: return VLLMOpenAI( @@ -71,6 +75,7 @@ def _init_llm(self) -> VLLMOpenAI: **self.config.additional_params, ) + class OpenAIAzureLLM(BaseLLM): def _init_llm(self) -> AzureChatOpenAI: api_version = self.config.additional_params.get("api_version") @@ -88,6 +93,8 @@ def _init_llm(self) -> AzureChatOpenAI: streaming=True, **self.config.additional_params, ) + + class OpenAILLM(BaseLLM): def _init_llm(self) -> BaseChatModel: return BaseChatOpenAI( @@ -138,11 +145,15 @@ def register_llm(cls, model_type: str, llm_class: Type[BaseLLM]): return config """ -async def get_default_config() -> LLMConfig: +async def get_default_config(custom_model_id: Optional[int] = None) -> LLMConfig: with Session(engine) as session: - db_model = session.exec( - select(AiModelDetail).where(AiModelDetail.default_model == True) - ).first() + db_model: AiModelDetail | None = None + if custom_model_id: + db_model = session.get(AiModelDetail, custom_model_id) + if not db_model: + db_model = session.exec( + select(AiModelDetail).where(AiModelDetail.default_model == True) + ).first() if not db_model: raise Exception("The system default model has not been set") @@ -150,14 +161,14 @@ async def get_default_config() -> LLMConfig: if db_model.config: try: config_raw = json.loads(db_model.config) - additional_params = {item["key"]: prepare_model_arg(item.get('val')) for item in config_raw if "key" in item and "val" in item} + additional_params = {item["key"]: prepare_model_arg(item.get('val')) for item in config_raw if + "key" in item and "val" in item} except Exception: pass if not db_model.api_domain.startswith("http"): db_model.api_domain = await sqlbot_decrypt(db_model.api_domain) if db_model.api_key: db_model.api_key = await sqlbot_decrypt(db_model.api_key) - # 构造 LLMConfig return LLMConfig( diff --git a/backend/apps/ai_model/openai/llm.py b/backend/apps/ai_model/openai/llm.py index ac1951ec2..603fd50ea 100644 --- a/backend/apps/ai_model/openai/llm.py +++ b/backend/apps/ai_model/openai/llm.py @@ -1,5 +1,5 @@ from collections.abc import Iterator, Mapping -from typing import Any, cast +from typing import Any, Optional, cast from langchain_core.language_models import LanguageModelInput from langchain_core.messages import ( @@ -27,8 +27,12 @@ def _convert_delta_to_message_chunk( role = cast(str, _dict.get("role")) content = cast(str, _dict.get("content") or "") additional_kwargs: dict = {} - if 'reasoning_content' in _dict: - additional_kwargs['reasoning_content'] = _dict.get('reasoning_content') + # 兼容 reasoning_content (DeepSeek等) 和 reasoning (Ollama/LMStudio GPT-OSS) 两种字段 + reasoning_content = _dict.get('reasoning_content') + if not reasoning_content: + reasoning_content = _dict.get('reasoning') + if reasoning_content: + additional_kwargs['reasoning_content'] = reasoning_content if _dict.get("function_call"): function_call = dict(_dict["function_call"]) if "name" in function_call and function_call["name"] is None: @@ -80,6 +84,27 @@ def _convert_delta_to_message_chunk( class BaseChatOpenAI(ChatOpenAI): + @property + def _default_params(self) -> dict[str, Any]: + max_tokens = self.max_tokens + params = super()._default_params + if max_tokens: + params["max_tokens"] = max_tokens + return params + + def _get_request_payload( + self, + input_: LanguageModelInput, + *, + stop: Optional[list[str]] = None, + **kwargs: Any, + ) -> dict: + max_tokens = self.max_tokens + payload = super()._get_request_payload(input_, stop=stop, **kwargs) + if max_tokens: + payload["max_tokens"] = max_tokens + return payload + usage_metadata: dict = {} # custom_get_token_ids = custom_get_token_ids @@ -95,10 +120,10 @@ def _stream(self, *args: Any, **kwargs: Any) -> Iterator[ChatGenerationChunk]: yield chunk def _convert_chunk_to_generation_chunk( - self, - chunk: dict, - default_chunk_class: type, - base_generation_info: dict | None, + self, + chunk: dict, + default_chunk_class: type, + base_generation_info: dict | None, ) -> ChatGenerationChunk | None: if chunk.get("type") == "content.delta": # from beta.chat.completions.stream return None @@ -150,12 +175,12 @@ def _convert_chunk_to_generation_chunk( return generation_chunk def invoke( - self, - input: LanguageModelInput, - config: RunnableConfig | None = None, - *, - stop: list[str] | None = None, - **kwargs: Any, + self, + input: LanguageModelInput, + config: RunnableConfig | None = None, + *, + stop: list[str] | None = None, + **kwargs: Any, ) -> BaseMessage: config = ensure_config(config) chat_result = cast( diff --git a/backend/apps/api.py b/backend/apps/api.py index 27d5f9890..ec5a4209f 100644 --- a/backend/apps/api.py +++ b/backend/apps/api.py @@ -5,7 +5,7 @@ from apps.data_training.api import data_training from apps.datasource.api import datasource, table_relation, recommended_problem from apps.mcp import mcp -from apps.system.api import login, user, aimodel, workspace, assistant, parameter, apikey +from apps.system.api import login, user, aimodel, workspace, assistant, parameter, apikey, variable_api from apps.terminology.api import terminology from apps.settings.api import base #from audit.api import audit_api @@ -30,4 +30,6 @@ api_router.include_router(recommended_problem.router) +api_router.include_router(variable_api.router) + #api_router.include_router(audit_api.router) diff --git a/backend/apps/chat/api/chat.py b/backend/apps/chat/api/chat.py index 56c5fe66d..8a2bed721 100644 --- a/backend/apps/chat/api/chat.py +++ b/backend/apps/chat/api/chat.py @@ -10,19 +10,21 @@ from sqlalchemy import and_, select from starlette.responses import JSONResponse -from apps.chat.curd.chat import delete_chat_with_user, get_chart_data_with_user, get_chat_predict_data_with_user, list_chats, get_chat_with_records, create_chat, rename_chat, \ - delete_chat, get_chat_chart_data, get_chat_predict_data, get_chat_with_records_with_data, get_chat_record_by_id, \ - format_json_data, format_json_list_data, get_chart_config, list_recent_questions,get_chat as get_chat_exec, rename_chat_with_user +from apps.chat.curd.chat import delete_chat_with_user, get_chart_data_with_user, get_chat_predict_data_with_user, \ + list_chats, get_chat_with_records, create_chat, get_chat_chart_data, get_chat_predict_data, \ + get_chat_with_records_with_data, get_chat_record_by_id, \ + format_json_data, format_json_list_data, get_chart_config, list_recent_questions, rename_chat_with_user, \ + get_chat_log_history, get_chart_data_with_user_live from apps.chat.models.chat_model import CreateChat, ChatRecord, RenameChat, ChatQuestion, AxisObj, QuickCommand, \ - ChatInfo, Chat, ChatFinishStep + ChatInfo, Chat, ChatFinishStep, ChatQuestionBase, SimpleChat from apps.chat.task.llm import LLMService from apps.swagger.i18n import PLACEHOLDER_PREFIX from apps.system.schemas.permission import SqlbotPermission, require_permissions +from common.audit.models.log_model import OperationType, OperationModules +from common.audit.schemas.logger_decorator import LogConfig, system_log from common.core.deps import CurrentAssistant, SessionDep, CurrentUser, Trans from common.utils.command_utils import parse_quick_command from common.utils.data_format import DataFormat -from common.audit.models.log_model import OperationType, OperationModules -from common.audit.schemas.logger_decorator import LogConfig, system_log router = APIRouter(tags=["Data Q&A"], prefix="/chat") @@ -69,6 +71,7 @@ def inner(): return await asyncio.to_thread(inner) """ + @router.get("/record/{chat_record_id}/data", summary=f"{PLACEHOLDER_PREFIX}get_chart_data") async def chat_record_data(session: SessionDep, current_user: CurrentUser, chat_record_id: int): def inner(): @@ -78,29 +81,40 @@ def inner(): return await asyncio.to_thread(inner) +@router.get("/record/{chat_record_id}/data_live", summary=f"{PLACEHOLDER_PREFIX}get_chart_data_live") +async def chat_record_data_live(session: SessionDep, current_user: CurrentUser, chat_record_id: int): + def inner(): + data = get_chart_data_with_user_live(chat_record_id=chat_record_id, session=session, current_user=current_user) + return format_json_data(data) + + return await asyncio.to_thread(inner) + + @router.get("/record/{chat_record_id}/predict_data", summary=f"{PLACEHOLDER_PREFIX}get_chart_predict_data") async def chat_predict_data(session: SessionDep, current_user: CurrentUser, chat_record_id: int): def inner(): - data = get_chat_predict_data_with_user(chat_record_id=chat_record_id, session=session, current_user=current_user) + data = get_chat_predict_data_with_user(chat_record_id=chat_record_id, session=session, + current_user=current_user) return format_json_list_data(data) return await asyncio.to_thread(inner) -""" @router.post("/rename", response_model=str, summary=f"{PLACEHOLDER_PREFIX}rename_chat") -@system_log(LogConfig( - operation_type=OperationType.UPDATE, - module=OperationModules.CHAT, - resource_id_expr="chat.id" -)) -async def rename(session: SessionDep, chat: RenameChat): - try: - return rename_chat(session=session, rename_object=chat) - except Exception as e: - raise HTTPException( - status_code=500, - detail=str(e) - ) """ +@router.get("/record/{chat_record_id}/log", summary=f"{PLACEHOLDER_PREFIX}get_record_log") +async def chat_record_log(session: SessionDep, current_user: CurrentUser, chat_record_id: int): + def inner(): + return get_chat_log_history(session, chat_record_id, current_user) + + return await asyncio.to_thread(inner) + + +@router.get("/record/{chat_record_id}/usage", summary=f"{PLACEHOLDER_PREFIX}get_record_usage") +async def chat_record_usage(session: SessionDep, current_user: CurrentUser, chat_record_id: int): + def inner(): + return get_chat_log_history(session, chat_record_id, current_user, True) + + return await asyncio.to_thread(inner) + @router.post("/rename", response_model=str, summary=f"{PLACEHOLDER_PREFIX}rename_chat") @system_log(LogConfig( @@ -117,30 +131,15 @@ async def rename(session: SessionDep, current_user: CurrentUser, chat: RenameCha detail=str(e) ) -""" @router.delete("/{chart_id}/{brief}", response_model=str, summary=f"{PLACEHOLDER_PREFIX}delete_chat") -@system_log(LogConfig( - operation_type=OperationType.DELETE, - module=OperationModules.CHAT, - resource_id_expr="chart_id", - remark_expr="brief" -)) -async def delete(session: SessionDep, chart_id: int, brief: str): - try: - return delete_chat(session=session, chart_id=chart_id) - except Exception as e: - raise HTTPException( - status_code=500, - detail=str(e) - ) """ -@router.delete("/{chart_id}/{brief}", response_model=str, summary=f"{PLACEHOLDER_PREFIX}delete_chat") +@router.delete("/{chart_id}", response_model=str, summary=f"{PLACEHOLDER_PREFIX}delete_chat") @system_log(LogConfig( operation_type=OperationType.DELETE, module=OperationModules.CHAT, resource_id_expr="chart_id", - remark_expr="brief" + remark_expr="chat.brief" )) -async def delete(session: SessionDep, current_user: CurrentUser, chart_id: int, brief: str): +async def delete(session: SessionDep, current_user: CurrentUser, chart_id: int, chat: SimpleChat): try: return delete_chat_with_user(session=session, current_user=current_user, chart_id=chart_id) except Exception as e: @@ -149,6 +148,7 @@ async def delete(session: SessionDep, current_user: CurrentUser, chart_id: int, detail=str(e) ) + @router.post("/start", response_model=ChatInfo, summary=f"{PLACEHOLDER_PREFIX}start_chat") @require_permissions(permission=SqlbotPermission(type='ds', keyExpression="create_chat_obj.datasource")) @system_log(LogConfig( @@ -172,9 +172,11 @@ async def start_chat(session: SessionDep, current_user: CurrentUser, create_chat module=OperationModules.CHAT, result_id_expr="id" )) -async def start_chat(session: SessionDep, current_user: CurrentUser): +async def start_chat(session: SessionDep, current_user: CurrentUser, current_assistant: CurrentAssistant, + create_chat_obj: CreateChat = CreateChat(origin=2)): try: - return create_chat(session, current_user, CreateChat(origin=2), False) + return create_chat(session, current_user, create_chat_obj, create_chat_obj and create_chat_obj.datasource, + current_assistant) except Exception as e: raise HTTPException( status_code=500, @@ -213,7 +215,7 @@ def _err(_e: Exception): @router.get("/recent_questions/{datasource_id}", response_model=List[str], summary=f"{PLACEHOLDER_PREFIX}get_recommend_questions") -#@require_permissions(permission=SqlbotPermission(type='ds', keyExpression="datasource_id")) +# @require_permissions(permission=SqlbotPermission(type='ds', keyExpression="datasource_id")) async def recommend_questions(session: SessionDep, current_user: CurrentUser, datasource_id: int = Path(..., description=f"{PLACEHOLDER_PREFIX}ds_id")): return list_recent_questions(session=session, current_user=current_user, datasource_id=datasource_id) @@ -234,15 +236,17 @@ def find_base_question(record_id: int, session: SessionDep): @router.post("/question", summary=f"{PLACEHOLDER_PREFIX}ask_question") @require_permissions(permission=SqlbotPermission(type='chat', keyExpression="request_question.chat_id")) -async def question_answer(session: SessionDep, current_user: CurrentUser, request_question: ChatQuestion, +async def question_answer(session: SessionDep, current_user: CurrentUser, request_question: ChatQuestionBase, current_assistant: CurrentAssistant): - return await question_answer_inner(session, current_user, request_question, current_assistant, embedding=True) + question = ChatQuestion(chat_id=request_question.chat_id, question=request_question.question) + return await question_answer_inner(session, current_user, question, current_assistant, embedding=True) async def question_answer_inner(session: SessionDep, current_user: CurrentUser, request_question: ChatQuestion, current_assistant: Optional[CurrentAssistant] = None, in_chat: bool = True, stream: bool = True, - finish_step: ChatFinishStep = ChatFinishStep.GENERATE_CHART, embedding: bool = False): + finish_step: ChatFinishStep = ChatFinishStep.GENERATE_CHART, embedding: bool = False, + return_img: bool = True): try: command, text_before_command, record_id, warning_info = parse_quick_command(request_question.question) if command: @@ -298,7 +302,7 @@ async def question_answer_inner(session: SessionDep, current_user: CurrentUser, request_question.question = text_before_command request_question.regenerate_record_id = rec_id return await stream_sql(session, current_user, request_question, current_assistant, in_chat, stream, - finish_step, embedding) + finish_step, embedding, return_img) elif command == QuickCommand.ANALYSIS: return await analysis_or_predict(session, current_user, rec_id, 'analysis', current_assistant, in_chat, @@ -311,7 +315,7 @@ async def question_answer_inner(session: SessionDep, current_user: CurrentUser, raise Exception(f'Unknown command: {command.value}') else: return await stream_sql(session, current_user, request_question, current_assistant, in_chat, stream, - finish_step, embedding) + finish_step, embedding, return_img) except Exception as e: traceback.print_exc() @@ -333,12 +337,13 @@ def _err(_e: Exception): async def stream_sql(session: SessionDep, current_user: CurrentUser, request_question: ChatQuestion, current_assistant: Optional[CurrentAssistant] = None, in_chat: bool = True, stream: bool = True, - finish_step: ChatFinishStep = ChatFinishStep.GENERATE_CHART, embedding: bool = False): + finish_step: ChatFinishStep = ChatFinishStep.GENERATE_CHART, embedding: bool = False, + return_img: bool = True): try: llm_service = await LLMService.create(session, current_user, request_question, current_assistant, embedding=embedding) llm_service.init_record(session=session) - llm_service.run_task_async(in_chat=in_chat, stream=stream, finish_step=finish_step) + llm_service.run_task_async(in_chat=in_chat, stream=stream, finish_step=finish_step, return_img=return_img) except Exception as e: traceback.print_exc() @@ -442,8 +447,8 @@ def _err(_e: Exception): @router.get("/record/{chat_record_id}/excel/export/{chat_id}", summary=f"{PLACEHOLDER_PREFIX}export_chart_data") -@system_log(LogConfig(operation_type=OperationType.EXPORT,module=OperationModules.CHAT,resource_id_expr="chat_id",)) -async def export_excel(session: SessionDep, current_user: CurrentUser, chat_record_id: int,chat_id: int, trans: Trans): +@system_log(LogConfig(operation_type=OperationType.EXPORT, module=OperationModules.CHAT, resource_id_expr="chat_id", )) +async def export_excel(session: SessionDep, current_user: CurrentUser, chat_record_id: int, chat_id: int, trans: Trans): chat_record = session.get(ChatRecord, chat_record_id) if not chat_record: raise HTTPException( @@ -476,11 +481,26 @@ async def export_excel(session: SessionDep, current_user: CurrentUser, chat_reco if chart_info.get('columns') and len(chart_info.get('columns')) > 0: for column in chart_info.get('columns'): fields.append(AxisObj(name=column.get('name'), value=column.get('value'))) - if chart_info.get('axis'): - for _type in ['x', 'y', 'series']: - if chart_info.get('axis').get(_type): - column = chart_info.get('axis').get(_type) - fields.append(AxisObj(name=column.get('name'), value=column.get('value'))) + # 处理 axis + if axis := chart_info.get('axis'): + # 处理 x 轴 + if x_axis := axis.get('x'): + if 'name' in x_axis or 'value' in x_axis: + fields.append(AxisObj(name=x_axis.get('name'), value=x_axis.get('value'))) + + # 处理 y 轴 - 兼容数组和对象格式 + if y_axis := axis.get('y'): + if isinstance(y_axis, list): + for column in y_axis: + if 'name' in column or 'value' in column: + fields.append(AxisObj(name=column.get('name'), value=column.get('value'))) + elif isinstance(y_axis, dict) and ('name' in y_axis or 'value' in y_axis): + fields.append(AxisObj(name=y_axis.get('name'), value=y_axis.get('value'))) + + # 处理 series + if series := axis.get('series'): + if 'name' in series or 'value' in series: + fields.append(AxisObj(name=series.get('name'), value=series.get('value'))) _predict_data = [] if is_predict_data: @@ -488,7 +508,8 @@ async def export_excel(session: SessionDep, current_user: CurrentUser, chat_reco def inner(): - data_list = DataFormat.convert_large_numbers_in_object_array(_data + _predict_data) + data_list = DataFormat.convert_large_numbers_in_object_array(obj_array=_data + _predict_data, + int_threshold=1e11) md_data, _fields_list = DataFormat.convert_object_array_for_pandas(fields, data_list) diff --git a/backend/apps/chat/curd/chat.py b/backend/apps/chat/curd/chat.py index 2baa09106..e261c2b6f 100644 --- a/backend/apps/chat/curd/chat.py +++ b/backend/apps/chat/curd/chat.py @@ -1,5 +1,6 @@ import datetime -from typing import List, Optional +from decimal import Decimal +from typing import List, Optional, Union, Dict, Any import orjson import sqlparse @@ -8,12 +9,17 @@ from sqlalchemy.orm import aliased from apps.chat.models.chat_model import Chat, ChatRecord, CreateChat, ChatInfo, RenameChat, ChatQuestion, ChatLog, \ - TypeEnum, OperationEnum, ChatRecordResult + TypeEnum, OperationEnum, ChatRecordResult, ChatLogHistory, ChatLogHistoryItem +from apps.datasource.crud.datasource import get_ds from apps.datasource.crud.recommended_problem import get_datasource_recommended_chart from apps.datasource.models.datasource import CoreDatasource -from apps.system.crud.assistant import AssistantOutDsFactory +from apps.db.constant import DB +from apps.db.db import exec_sql +from apps.system.crud.assistant import AssistantOutDs, AssistantOutDsFactory +from apps.system.schemas.system_schema import AssistantOutDsSchema from common.core.deps import CurrentAssistant, SessionDep, CurrentUser, Trans -from common.utils.utils import extract_nested_json +from common.utils.data_format import DataFormat +from common.utils.utils import extract_nested_json, SQLBotLogUtil def get_chat_record_by_id(session: SessionDep, record_id: int): @@ -50,7 +56,8 @@ def list_recent_questions(session: SessionDep, current_user: CurrentUser, dataso .join(Chat, ChatRecord.chat_id == Chat.id) # 关联Chat表 .filter( Chat.datasource == datasource_id, # 使用Chat表的datasource字段 - ChatRecord.question.isnot(None) + ChatRecord.question.isnot(None), + ChatRecord.create_by == current_user.id ) .group_by(ChatRecord.question) .order_by(desc(func.max(ChatRecord.create_time))) @@ -59,6 +66,7 @@ def list_recent_questions(session: SessionDep, current_user: CurrentUser, dataso ) return [record[0] for record in chat_records] if chat_records else [] + def rename_chat_with_user(session: SessionDep, current_user: CurrentUser, rename_object: RenameChat) -> str: chat = session.get(Chat, rename_object.id) if not chat: @@ -75,6 +83,7 @@ def rename_chat_with_user(session: SessionDep, current_user: CurrentUser, rename session.commit() return brief + def rename_chat(session: SessionDep, rename_object: RenameChat) -> str: chat = session.get(Chat, rename_object.id) if not chat: @@ -101,6 +110,7 @@ def delete_chat(session, chart_id) -> str: return f'Chat with id {chart_id} has been deleted' + def delete_chat_with_user(session, current_user: CurrentUser, chart_id) -> str: chat = session.query(Chat).filter(Chat.id == chart_id).first() if not chat: @@ -124,23 +134,41 @@ def get_chart_config(session: SessionDep, chart_record_id: int): return {} -def format_chart_fields(chart_info: dict): +def _format_column(column: dict) -> str: + """格式化单个column字段""" + value = column.get('value', '') + name = column.get('name', '') + if value != name and name: + return f"{value}({name})" + return value + + +def format_chart_fields(chart_info: dict) -> list: fields = [] - if chart_info.get('columns') and len(chart_info.get('columns')) > 0: - for column in chart_info.get('columns'): - column_str = column.get('value') - if column.get('value') != column.get('name'): - column_str = column_str + '(' + column.get('name') + ')' - fields.append(column_str) - if chart_info.get('axis'): - for _type in ['x', 'y', 'series']: - if chart_info.get('axis').get(_type): - column = chart_info.get('axis').get(_type) - column_str = column.get('value') - if column.get('value') != column.get('name'): - column_str = column_str + '(' + column.get('name') + ')' - fields.append(column_str) - return fields + + # 处理 columns + for column in chart_info.get('columns') or []: + fields.append(_format_column(column)) + + # 处理 axis + if axis := chart_info.get('axis'): + # 处理 x 轴 + if x_axis := axis.get('x'): + fields.append(_format_column(x_axis)) + + # 处理 y 轴 + if y_axis := axis.get('y'): + if isinstance(y_axis, list): + for column in y_axis: + fields.append(_format_column(column)) + else: + fields.append(_format_column(y_axis)) + + # 处理 series + if series := axis.get('series'): + fields.append(_format_column(series)) + + return [field for field in fields if field] # 过滤空字符串 def get_last_execute_sql_error(session: SessionDep, chart_id: int): @@ -159,7 +187,8 @@ def get_last_execute_sql_error(session: SessionDep, chart_id: int): def format_json_data(origin_data: dict): - result = {'fields': origin_data.get('fields') if origin_data.get('fields') else []} + result = {'fields': origin_data.get('fields') if origin_data.get('fields') else [], + 'fields_info': origin_data.get('fields_info') if origin_data.get('fields_info') else None} _list = origin_data.get('data') if origin_data.get('data') else [] data = format_json_list_data(_list) result['data'] = data @@ -180,11 +209,11 @@ def format_json_list_data(origin_data: list[dict]): value = str(value) # 小数且超过15位有效数字 → 转字符串并标记为文本列 elif isinstance(value, float): - decimal_str = format(value, '.16f').rstrip('0').rstrip('.') + decimal_str = str(Decimal(str(value))).rstrip('0').rstrip('.') if len(decimal_str) > 15: value = str(value) _row[key] = value - data.append(_row) + data.append(DataFormat.normalize_qualified_sql_column_keys(_row)) return data @@ -199,6 +228,7 @@ def get_chat_chart_config(session: SessionDep, chat_record_id: int): pass return {} + def get_chart_data_with_user(session: SessionDep, current_user: CurrentUser, chat_record_id: int): stmt = select(ChatRecord.data).where(and_(ChatRecord.id == chat_record_id, ChatRecord.create_by == current_user.id)) res = session.execute(stmt) @@ -209,6 +239,36 @@ def get_chart_data_with_user(session: SessionDep, current_user: CurrentUser, cha pass return {} + +def get_chart_data_with_user_live(session: SessionDep, current_user: CurrentUser, chat_record_id: int): + stmt = select(ChatRecord.datasource, ChatRecord.sql).where( + and_(ChatRecord.id == chat_record_id, ChatRecord.create_by == current_user.id)) + row = session.execute(stmt).first() + return get_chart_data_ds(session, row.datasource, row.sql) + + +def get_chart_data_ds(session: SessionDep, ds_id, sql): + json_result: Dict[str, Any] = {'status': 'success', 'data': [], 'message': ''} + try: + datasource = get_ds(session, ds_id) + if datasource is None: + json_result['status'] = 'failed' + json_result['message'] = 'Datasource not found' + return json_result + else: + result = exec_sql(ds=datasource, sql=sql, origin_column=False) + _data = DataFormat.convert_large_numbers_in_object_array(result.get('data')) + _data = DataFormat.normalize_qualified_sql_column_keys_in_object_array(_data) + json_result['data'] = _data + return json_result + except Exception as e: + SQLBotLogUtil.error(f"Function failed: {e}") + json_result['status'] = 'failed' + json_result['message'] = f"{e}" + pass + return json_result + + def get_chat_chart_data(session: SessionDep, chat_record_id: int): stmt = select(ChatRecord.data).where(and_(ChatRecord.id == chat_record_id)) res = session.execute(stmt) @@ -219,8 +279,10 @@ def get_chat_chart_data(session: SessionDep, chat_record_id: int): pass return {} + def get_chat_predict_data_with_user(session: SessionDep, current_user: CurrentUser, chat_record_id: int): - stmt = select(ChatRecord.predict_data).where(and_(ChatRecord.id == chat_record_id, ChatRecord.create_by == current_user.id)) + stmt = select(ChatRecord.predict_data).where( + and_(ChatRecord.id == chat_record_id, ChatRecord.create_by == current_user.id)) res = session.execute(stmt) for row in res: try: @@ -229,6 +291,7 @@ def get_chat_predict_data_with_user(session: SessionDep, current_user: CurrentUs pass return {} + def get_chat_predict_data(session: SessionDep, chat_record_id: int): stmt = select(ChatRecord.predict_data).where(and_(ChatRecord.id == chat_record_id)) res = session.execute(stmt) @@ -278,7 +341,7 @@ def get_chat_with_records(session: SessionDep, chart_id: int, current_user: Curr predict_alias_log = aliased(ChatLog) stmt = (select(ChatRecord.id, ChatRecord.chat_id, ChatRecord.create_time, ChatRecord.finish_time, - ChatRecord.question, ChatRecord.sql_answer, ChatRecord.sql, + ChatRecord.question, ChatRecord.sql_answer, ChatRecord.sql, ChatRecord.datasource, ChatRecord.chart_answer, ChatRecord.chart, ChatRecord.analysis, ChatRecord.predict, ChatRecord.datasource_select_answer, ChatRecord.analysis_record_id, ChatRecord.predict_record_id, ChatRecord.regenerate_record_id, @@ -305,7 +368,7 @@ def get_chat_with_records(session: SessionDep, chart_id: int, current_user: Curr ChatRecord.create_time)) if with_data: stmt = select(ChatRecord.id, ChatRecord.chat_id, ChatRecord.create_time, ChatRecord.finish_time, - ChatRecord.question, ChatRecord.sql_answer, ChatRecord.sql, + ChatRecord.question, ChatRecord.sql_answer, ChatRecord.sql, ChatRecord.datasource, ChatRecord.chart_answer, ChatRecord.chart, ChatRecord.analysis, ChatRecord.predict, ChatRecord.datasource_select_answer, ChatRecord.analysis_record_id, ChatRecord.predict_record_id, ChatRecord.regenerate_record_id, @@ -316,12 +379,63 @@ def get_chat_with_records(session: SessionDep, chart_id: int, current_user: Curr result = session.execute(stmt).all() record_list: list[ChatRecordResult] = [] + + # 批量获取所有ChatRecord的token消耗 + record_ids = [row.id for row in result] + token_usage_map = {} + + if record_ids: + # 查询所有相关ChatLog的token_usage + log_stmt = select(ChatLog.pid, ChatLog.token_usage).where( + and_( + ChatLog.pid.in_(record_ids), + ChatLog.local_operation == False, + ChatLog.operate != OperationEnum.GENERATE_RECOMMENDED_QUESTIONS, + ChatLog.token_usage.is_not(None) # 排除token_usage为空的记录 + ) + ) + log_results = session.execute(log_stmt).all() + + # 按pid分组计算total_tokens总和 + for pid, token_usage in log_results: + if pid and token_usage is not None: + tokens_to_add = 0 + + if isinstance(token_usage, dict): + # 处理字典类型: {"input_tokens": 961, "total_tokens": 1006, "output_tokens": 45} + if token_usage: # 非空字典 + if "total_tokens" in token_usage: + token_value = token_usage["total_tokens"] + if isinstance(token_value, (int, float)): + tokens_to_add = int(token_value) + elif isinstance(token_usage, (int, float)): + tokens_to_add = int(token_usage) + if tokens_to_add > 0: + if pid not in token_usage_map: + token_usage_map[pid] = 0 + token_usage_map[pid] += tokens_to_add + for row in result: + # 计算耗时 + duration = None + if row.create_time and row.finish_time: + try: + time_diff = row.finish_time - row.create_time + duration = time_diff.total_seconds() # 转换为秒 + except Exception: + duration = None + + # 获取token总消耗 + total_tokens = token_usage_map.get(row.id, 0) + if not with_data: record_list.append( ChatRecordResult(id=row.id, chat_id=row.chat_id, create_time=row.create_time, finish_time=row.finish_time, + duration=duration, + total_tokens=total_tokens, question=row.question, sql_answer=row.sql_answer, sql=row.sql, + datasource=row.datasource, chart_answer=row.chart_answer, chart=row.chart, analysis=row.analysis, predict=row.predict, datasource_select_answer=row.datasource_select_answer, @@ -338,7 +452,10 @@ def get_chat_with_records(session: SessionDep, chart_id: int, current_user: Curr record_list.append( ChatRecordResult(id=row.id, chat_id=row.chat_id, create_time=row.create_time, finish_time=row.finish_time, + duration=duration, + total_tokens=total_tokens, question=row.question, sql_answer=row.sql_answer, sql=row.sql, + datasource=row.datasource, chart_answer=row.chart_answer, chart=row.chart, analysis=row.analysis, predict=row.predict, datasource_select_answer=row.datasource_select_answer, @@ -409,9 +526,151 @@ def format_record(record: ChatRecordResult): except Exception: pass + # 格式化duration字段,保留2位小数 + if 'duration' in _dict and _dict['duration'] is not None: + try: + # 可以格式化为更易读的形式 + _dict['duration'] = round(_dict['duration'], 2) # 保留2位小数 + except Exception: + pass + + # 格式化total_tokens字段 + if 'total_tokens' in _dict and _dict['total_tokens'] is not None: + try: + # 确保是整数类型 + _dict['total_tokens'] = int(_dict['total_tokens']) if _dict['total_tokens'] else 0 + except Exception: + _dict['total_tokens'] = 0 + + # 去除返回前端多余的字段 + _dict.pop('sql_reasoning_content', None) + _dict.pop('chart_reasoning_content', None) + _dict.pop('analysis_reasoning_content', None) + _dict.pop('predict_reasoning_content', None) + return _dict +def get_chat_log_history(session: SessionDep, chat_record_id: int, current_user: CurrentUser, + without_steps: bool = False) -> ChatLogHistory: + """ + 获取ChatRecord的详细历史记录 + + Args: + session: 数据库会话 + chat_record_id: ChatRecord的ID + current_user: 当前用户 + without_steps + + Returns: + ChatLogHistory: 包含历史步骤和时间信息的对象 + """ + # 1. 首先验证ChatRecord存在且属于当前用户 + chat_record = session.get(ChatRecord, chat_record_id) + if not chat_record: + raise Exception(f"ChatRecord with id {chat_record_id} not found") + + if chat_record.create_by != current_user.id: + raise Exception(f"ChatRecord with id {chat_record_id} not owned by the current user") + + # 2. 查询与该ChatRecord相关的所有ChatLog记录 + chat_logs = session.query(ChatLog).filter( + ChatLog.pid == chat_record_id, + ChatLog.operate != OperationEnum.GENERATE_RECOMMENDED_QUESTIONS + ).order_by(ChatLog.start_time).all() + + # 3. 计算总的时间和token信息 + total_tokens = 0 + steps = [] + + for log in chat_logs: + # 计算单条记录的token消耗 + log_tokens = 0 + if log.token_usage is not None: + if isinstance(log.token_usage, dict): + if log.token_usage and "total_tokens" in log.token_usage: + token_value = log.token_usage["total_tokens"] + if isinstance(token_value, (int, float)): + log_tokens = int(token_value) + elif isinstance(log.token_usage, (int, float)): + log_tokens = log.token_usage + + # 累加到总token消耗 + total_tokens += log_tokens + + if not without_steps: + # 计算单条记录的耗时 + duration = None + if log.start_time and log.finish_time: + try: + time_diff = log.finish_time - log.start_time + duration = round(time_diff.total_seconds(), 2) + except Exception: + duration = None + + # 获取操作类型的枚举名称 + operate_name = None + message = None + if log.operate: + # 如果是OperationEnum枚举实例 + if isinstance(log.operate, OperationEnum): + operate_name = log.operate.name + # 如果是字符串,尝试从枚举值获取名称 + elif isinstance(log.operate, str): + try: + # 通过枚举值找到对应的枚举实例 + for enum_item in OperationEnum: + if enum_item.value == log.operate: + operate_name = enum_item.name + break + except Exception: + operate_name = log.operate + else: + operate_name = str(log.operate) + + if log.messages is not None: + message = log.messages + if not log.operate == OperationEnum.CHOOSE_TABLE: + try: + message = orjson.loads(log.messages) + except Exception: + pass + + # 创建ChatLogHistoryItem + history_item = ChatLogHistoryItem( + start_time=log.start_time, + finish_time=log.finish_time, + duration=duration, + total_tokens=log_tokens, + operate=operate_name, + local_operation=log.local_operation, + error=log.error, + message=message, + ) + + steps.append(history_item) + + # 4. 计算总耗时(使用ChatRecord的时间) + total_duration = None + if chat_record.create_time and chat_record.finish_time: + try: + time_diff = chat_record.finish_time - chat_record.create_time + total_duration = round(time_diff.total_seconds(), 2) + except Exception: + total_duration = None + + # 5. 创建并返回ChatLogHistory对象 + chat_log_history = ChatLogHistory( + start_time=chat_record.create_time, # 使用ChatRecord的create_time + finish_time=chat_record.finish_time, # 使用ChatRecord的finish_time + duration=total_duration, + total_tokens=total_tokens, + steps=steps + ) + + return chat_log_history + + def get_chat_brief_generate(session: SessionDep, chat_id: int): chat = get_chat(session=session, chat_id=chat_id) if chat is not None and chat.brief_generate is not None: @@ -447,7 +706,7 @@ def list_generate_chart_logs(session: SessionDep, chart_id: int) -> List[ChatLog def create_chat(session: SessionDep, current_user: CurrentUser, create_chat_obj: CreateChat, - require_datasource: bool = True) -> ChatInfo: + require_datasource: bool = True, current_assistant: CurrentAssistant = None) -> ChatInfo: if not create_chat_obj.datasource and require_datasource: raise Exception("Datasource cannot be None") @@ -459,10 +718,17 @@ def create_chat(session: SessionDep, current_user: CurrentUser, create_chat_obj: oid=current_user.oid if current_user.oid is not None else 1, brief=create_chat_obj.question.strip()[:20], origin=create_chat_obj.origin if create_chat_obj.origin is not None else 0) - ds: CoreDatasource | None = None + ds: CoreDatasource | AssistantOutDsSchema | None = None if create_chat_obj.datasource: chat.datasource = create_chat_obj.datasource - ds = session.get(CoreDatasource, create_chat_obj.datasource) + if current_assistant and current_assistant.type == 1: + out_ds_instance: AssistantOutDs = AssistantOutDsFactory.get_instance(current_assistant) + ds = out_ds_instance.get_ds(chat.datasource) + ds.type_name = DB.get_db(ds.type) + else: + ds = session.get(CoreDatasource, create_chat_obj.datasource) + if ds.oid != current_user.oid: + raise Exception(f"Datasource with id {create_chat_obj.datasource} does not belong to current workspace") if not ds: raise Exception(f"Datasource with id {create_chat_obj.datasource} not found") @@ -494,7 +760,7 @@ def create_chat(session: SessionDep, current_user: CurrentUser, create_chat_obj: record.finish = True record.create_time = datetime.datetime.now() record.create_by = current_user.id - if ds.recommended_config == 2: + if isinstance(ds, CoreDatasource) and ds.recommended_config == 2: questions = get_datasource_recommended_chart(session, ds.id) record.recommended_question = orjson.dumps(questions).decode() record.recommended_question_answer = orjson.dumps({ @@ -574,10 +840,11 @@ def save_analysis_predict_record(session: SessionDep, base_record: ChatRecord, a return result -def start_log(session: SessionDep, ai_modal_id: int, ai_modal_name: str, operate: OperationEnum, record_id: int, - full_message: list[dict]) -> ChatLog: +def start_log(session: SessionDep, ai_modal_id: int = None, ai_modal_name: str = None, operate: OperationEnum = None, + record_id: int = None, full_message: Union[list[dict], dict] = None, + local_operation: bool = False) -> ChatLog: log = ChatLog(type=TypeEnum.CHAT, operate=operate, pid=record_id, ai_modal_id=ai_modal_id, base_modal=ai_modal_name, - messages=full_message, start_time=datetime.datetime.now()) + messages=full_message, start_time=datetime.datetime.now(), local_operation=local_operation) result = ChatLog(**log.model_dump()) @@ -590,7 +857,8 @@ def start_log(session: SessionDep, ai_modal_id: int, ai_modal_name: str, operate return result -def end_log(session: SessionDep, log: ChatLog, full_message: list[dict], reasoning_content: str = None, +def end_log(session: SessionDep, log: ChatLog, full_message: Union[list[dict], dict, str], + reasoning_content: str = None, token_usage=None) -> ChatLog: if token_usage is None: token_usage = {} @@ -611,6 +879,17 @@ def end_log(session: SessionDep, log: ChatLog, full_message: list[dict], reasoni return log +def trigger_log_error(session: SessionDep, log: ChatLog) -> ChatLog: + log.error = True + stmt = update(ChatLog).where(and_(ChatLog.id == log.id)).values( + error=True + ) + session.execute(stmt) + session.commit() + + return log + + def save_sql_answer(session: SessionDep, record_id: int, answer: str) -> ChatRecord: if not record_id: raise Exception("Record id cannot be None") @@ -834,6 +1113,14 @@ def save_error_message(session: SessionDep, record_id: int, message: str) -> Cha session.commit() + # log error finish + stmt = update(ChatLog).where(and_(ChatLog.pid == record.id, ChatLog.finish_time.is_(None))).values( + finish_time=record.finish_time, + error=True + ) + session.execute(stmt) + session.commit() + return result diff --git a/backend/apps/chat/models/chat_model.py b/backend/apps/chat/models/chat_model.py index fdcd1a400..6e550afb5 100644 --- a/backend/apps/chat/models/chat_model.py +++ b/backend/apps/chat/models/chat_model.py @@ -1,8 +1,9 @@ from datetime import datetime from enum import Enum -from typing import List, Optional, Union +from typing import List, Optional, Any, Union from fastapi import Body +from langchain_core.messages import SystemMessage, HumanMessage, AIMessage from pydantic import BaseModel from sqlalchemy import Column, Integer, Text, BigInteger, DateTime, Identity, Boolean from sqlalchemy import Enum as SQLAlchemyEnum @@ -40,6 +41,12 @@ class OperationEnum(Enum): GENERATE_SQL_WITH_PERMISSIONS = '5' CHOOSE_DATASOURCE = '6' GENERATE_DYNAMIC_SQL = '7' + CHOOSE_TABLE = '8' + FILTER_TERMS = '9' + FILTER_SQL_EXAMPLE = '10' + FILTER_CUSTOM_PROMPT = '11' + EXECUTE_SQL = '12' + GENERATE_PICTURE = '13' class ChatFinishStep(Enum): @@ -71,6 +78,8 @@ class ChatLog(SQLModel, table=True): start_time: datetime = Field(sa_column=Column(DateTime(timezone=False), nullable=True)) finish_time: datetime = Field(sa_column=Column(DateTime(timezone=False), nullable=True)) token_usage: Optional[dict | None | int] = Field(sa_column=Column(JSONB)) + local_operation: bool = Field(default=False) + error: bool = Field(default=False) class Chat(SQLModel, table=True): @@ -132,6 +141,7 @@ class ChatRecordResult(BaseModel): question: Optional[str] = None sql_answer: Optional[str] = None sql: Optional[str] = None + datasource: Optional[int] = None data: Optional[str] = None chart_answer: Optional[str] = None chart: Optional[str] = None @@ -149,6 +159,8 @@ class ChatRecordResult(BaseModel): chart_reasoning_content: Optional[str] = None analysis_reasoning_content: Optional[str] = None predict_reasoning_content: Optional[str] = None + duration: Optional[float] = None # 耗时字段(单位:秒) + total_tokens: Optional[int] = None # token总消耗 class CreateChat(BaseModel): @@ -163,6 +175,9 @@ class RenameChat(BaseModel): brief: str = '' brief_generate: bool = True +class SimpleChat(BaseModel): + id: int = None + brief: str = '' class ChatInfo(BaseModel): id: Optional[int] = None @@ -175,11 +190,30 @@ class ChatInfo(BaseModel): ds_type: str = '' datasource_name: str = '' datasource_exists: bool = True - recommended_question: Optional[str] = None - recommended_generate: Optional[bool] = False + recommended_question: Optional[str] = None + recommended_generate: Optional[bool] = False records: List[ChatRecord | dict] = [] +class ChatLogHistoryItem(BaseModel): + start_time: Optional[datetime] = None + finish_time: Optional[datetime] = None + duration: Optional[float] = None # 耗时字段(单位:秒) + total_tokens: Optional[int] = None # token总消耗 + operate: Optional[str] = None + local_operation: Optional[bool] = False + message: Optional[str | dict | list] = None + error: Optional[bool] = False + + +class ChatLogHistory(BaseModel): + start_time: Optional[datetime] = None + finish_time: Optional[datetime] = None + duration: Optional[float] = None # 耗时字段(单位:秒) + total_tokens: Optional[int] = None # token总消耗 + steps: List[ChatLogHistoryItem | dict] = [] + + class AiModelQuestion(BaseModel): question: str = None ai_modal_id: int = None @@ -198,8 +232,11 @@ class AiModelQuestion(BaseModel): custom_prompt: str = "" error_msg: str = "" regenerate_record_id: Optional[int] = None + sample_data: str = "" + sqlbot_name: str = "SQLBot" def sql_sys_question(self, db_type: Union[str, DB], enable_query_limit: bool = True): + templates: dict[str, str] = {} _sql_template = get_sql_example_template(db_type) _base_template = get_sql_template() _process_check = _sql_template.get('process_check') if _sql_template.get('process_check') else _base_template[ @@ -215,66 +252,91 @@ def sql_sys_question(self, db_type: Union[str, DB], enable_query_limit: bool = T 'example_answer_2'] _example_answer_3 = _sql_template['example_answer_3_with_limit'] if enable_query_limit else _sql_template[ 'example_answer_3'] - return _base_template['system'].format(engine=self.engine, schema=self.db_schema, question=self.question, - lang=self.lang, terminologies=self.terminologies, - data_training=self.data_training, custom_prompt=self.custom_prompt, - process_check=_process_check, - base_sql_rules=_base_sql_rules, - basic_sql_examples=_sql_examples, - example_engine=_example_engine, - example_answer_1=_example_answer_1, - example_answer_2=_example_answer_2, - example_answer_3=_example_answer_3) + + templates['system'] = _base_template['system'].format(lang=self.lang, process_check=_process_check, + sqlbot_name=self.sqlbot_name) + templates['rules'] = _base_template['generate_rules'].format(lang=self.lang, + sqlbot_name=self.sqlbot_name, + base_sql_rules=_base_sql_rules, + basic_sql_examples=_sql_examples, + example_engine=_example_engine, + example_answer_1=_example_answer_1, + example_answer_2=_example_answer_2, + example_answer_3=_example_answer_3) + templates['schema'] = _base_template['generate_basic_info'].format(engine=self.engine, schema=self.db_schema, + sample_data=self.sample_data) + + if self.terminologies: + templates['terminologies'] = _base_template['generate_terminologies_info'].format( + terminologies=self.terminologies) + + if self.data_training: + templates['data_training'] = _base_template['generate_data_training_info'].format( + data_training=self.data_training) + + if self.custom_prompt: + templates['custom_prompt'] = _base_template['generate_custom_prompt_info'].format( + custom_prompt=self.custom_prompt) + + return templates def sql_user_question(self, current_time: str, change_title: bool): _question = self.question if self.regenerate_record_id: _question = get_sql_template()['regenerate_hint'] + self.question - return get_sql_template()['user'].format(engine=self.engine, schema=self.db_schema, question=_question, + return get_sql_template()['user'].format(lang=self.lang, engine=self.engine, schema=self.db_schema, + question=_question, rule=self.rule, current_time=current_time, error_msg=self.error_msg, change_title=change_title) def chart_sys_question(self): - return get_chart_template()['system'].format(sql=self.sql, question=self.question, lang=self.lang) + templates: dict[str, str] = { + 'system': get_chart_template()['system'].format(lang=self.lang, sqlbot_name=self.sqlbot_name), + 'rules': get_chart_template()['generate_rules'].format(lang=self.lang) + } + return templates - def chart_user_question(self, chart_type: Optional[str] = None): - return get_chart_template()['user'].format(sql=self.sql, question=self.question, rule=self.rule, - chart_type=chart_type) + def chart_user_question(self, chart_type: Optional[str] = '', schema: Optional[str] = ''): + return get_chart_template()['user'].format(lang=self.lang, sql=self.sql, question=self.question, rule=self.rule, + chart_type=chart_type, schema=schema) def analysis_sys_question(self): return get_analysis_template()['system'].format(lang=self.lang, terminologies=self.terminologies, - custom_prompt=self.custom_prompt) + custom_prompt=self.custom_prompt, sqlbot_name=self.sqlbot_name) def analysis_user_question(self): return get_analysis_template()['user'].format(fields=self.fields, data=self.data) def predict_sys_question(self): - return get_predict_template()['system'].format(lang=self.lang, custom_prompt=self.custom_prompt) + return get_predict_template()['system'].format(lang=self.lang, custom_prompt=self.custom_prompt, + sqlbot_name=self.sqlbot_name) def predict_user_question(self): return get_predict_template()['user'].format(fields=self.fields, data=self.data) def datasource_sys_question(self): - return get_datasource_template()['system'].format(lang=self.lang) + return get_datasource_template()['system'].format(lang=self.lang, sqlbot_name=self.sqlbot_name) def datasource_user_question(self, datasource_list: str = "[]"): - return get_datasource_template()['user'].format(question=self.question, data=datasource_list) + return get_datasource_template()['user'].format(lang=self.lang, question=self.question, data=datasource_list) def guess_sys_question(self, articles_number: int = 4): - return get_guess_question_template()['system'].format(lang=self.lang, articles_number=articles_number) + return get_guess_question_template()['system'].format(lang=self.lang, articles_number=articles_number, + sqlbot_name=self.sqlbot_name) def guess_user_question(self, old_questions: str = "[]"): return get_guess_question_template()['user'].format(question=self.question, schema=self.db_schema, old_questions=old_questions) def filter_sys_question(self): - return get_permissions_template()['system'].format(lang=self.lang, engine=self.engine) + return get_permissions_template()['system'].format(lang=self.lang, engine=self.engine, + sqlbot_name=self.sqlbot_name) def filter_user_question(self): return get_permissions_template()['user'].format(sql=self.sql, filter=self.filter) def dynamic_sys_question(self): - return get_dynamic_template()['system'].format(lang=self.lang, engine=self.engine) + return get_dynamic_template()['system'].format(lang=self.lang, engine=self.engine, sqlbot_name=self.sqlbot_name) def dynamic_user_question(self): return get_dynamic_template()['user'].format(sql=self.sql, sub_query=self.sub_query) @@ -282,23 +344,42 @@ def dynamic_user_question(self): class ChatQuestion(AiModelQuestion): chat_id: int + datasource_id: Optional[int] = None class ChatMcp(ChatQuestion): token: str -class ChatStart(BaseModel): +class McpDs(BaseModel): + token: str = Body(description='用户token') + oid: Optional[str] = Body(description='组织ID,如果不传则为最后一次登录SQLBot时所使用的组织ID', default=None) + + +class ChatToken(BaseModel): username: str = Body(description='用户名') password: str = Body(description='密码') -class McpQuestion(BaseModel): +class ChatStart(BaseModel): + username: str = Body(description='用户名', default=None) + password: str = Body(description='密码', default=None) + token: str = Body(description='token', default=None) + oid: Optional[str] = Body( + description='组织ID,仅当数据源ID为空时有效,如果不传则为最后一次登录SQLBot时所使用的组织ID', default=None) + + +class ChatQuestionBase(BaseModel): question: str = Body(description='用户提问') chat_id: int = Body(description='会话ID') + + +class McpQuestion(ChatQuestionBase): token: str = Body(description='token') stream: Optional[bool] = Body(description='是否流式输出,默认为true开启, 关闭false则返回JSON对象', default=True) - lang: Optional[str] = Body(description='语言:zh-CN|en|ko-KR', default='zh-CN') + lang: Optional[str] = Body(description='语言:zh-CN|zh-TW|en|ko-KR', default='zh-CN') + datasource_id: Optional[int | str] = Body(description='数据源ID,仅当当前对话没有确定数据源时有效', default=None) + return_img: Optional[bool] = Body(description='是否返回图表,默认为true开启, 关闭false则仅返回数据', default=True) class AxisObj(BaseModel): @@ -318,3 +399,30 @@ class McpAssistant(BaseModel): url: str = Body(description='第三方数据接口') authorization: str = Body(description='第三方接口凭证') stream: Optional[bool] = Body(description='是否流式输出,默认为true开启, 关闭false则返回JSON对象', default=True) + + +class SystemPromptMessage(SystemMessage): + sqlbot_system: bool = True + + def __init__( + self, content: Union[str, list[Union[str, dict]]], **kwargs: Any + ) -> None: + super().__init__(content=content, **kwargs) + + +class HumanPromptMessage(HumanMessage): + sqlbot_system: bool = True + + def __init__( + self, content: Union[str, list[Union[str, dict]]], **kwargs: Any + ) -> None: + super().__init__(content=content, **kwargs) + + +class AIPromptMessage(AIMessage): + sqlbot_system: bool = True + + def __init__( + self, content: Union[str, list[Union[str, dict]]], **kwargs: Any + ) -> None: + super().__init__(content=content, **kwargs) diff --git a/backend/apps/chat/task/llm.py b/backend/apps/chat/task/llm.py index 8187f5b44..e9ef80420 100644 --- a/backend/apps/chat/task/llm.py +++ b/backend/apps/chat/task/llm.py @@ -11,16 +11,18 @@ import orjson import pandas as pd import requests +import sqlglot import sqlparse from langchain.chat_models.base import BaseChatModel from langchain_community.utilities import SQLDatabase -from langchain_core.messages import BaseMessage, SystemMessage, HumanMessage, AIMessage, BaseMessageChunk +from langchain_core.messages import BaseMessage, HumanMessage, AIMessage, BaseMessageChunk from sqlalchemy import and_, select from sqlalchemy.orm import sessionmaker, scoped_session from sqlbot_xpack.config.model import SysArgModel from sqlbot_xpack.custom_prompt.curd.custom_prompt import find_custom_prompts from sqlbot_xpack.custom_prompt.models.custom_prompt_model import CustomPromptTypeEnum from sqlbot_xpack.license.license_manage import SQLBotLicenseUtil +from sqlglot import exp from sqlmodel import Session from apps.ai_model.model_factory import LLMConfig, LLMFactory, get_default_config @@ -31,17 +33,19 @@ get_old_questions, save_analysis_predict_record, rename_chat, get_chart_config, \ get_chat_chart_data, list_generate_sql_logs, list_generate_chart_logs, start_log, end_log, \ get_last_execute_sql_error, format_json_data, format_chart_fields, get_chat_brief_generate, get_chat_predict_data, \ - get_chat_chart_config + get_chat_chart_config, trigger_log_error from apps.chat.models.chat_model import ChatQuestion, ChatRecord, Chat, RenameChat, ChatLog, OperationEnum, \ - ChatFinishStep, AxisObj + ChatFinishStep, AxisObj, SystemPromptMessage, HumanPromptMessage, AIPromptMessage from apps.data_training.curd.data_training import get_training_template -from apps.datasource.crud.datasource import get_table_schema +from apps.datasource.crud.datasource import get_table_schema, get_tables_sample_data from apps.datasource.crud.permission import get_row_permission_filters, is_normal_user from apps.datasource.embedding.ds_embedding import get_ds_embedding from apps.datasource.models.datasource import CoreDatasource -from apps.db.db import exec_sql, get_version, check_connection +from apps.db.db import exec_sql, get_version, check_connection, get_sqlglot_dialect +from apps.system.crud.aimodel_manage import get_ai_model_list_by_workspace from apps.system.crud.assistant import AssistantOutDs, AssistantOutDsFactory, get_assistant_ds from apps.system.crud.parameter_manage import get_groups +from apps.system.crud.user import user_ws_list from apps.system.schemas.system_schema import AssistantOutDsSchema from apps.terminology.curd.terminology import get_terminology_template from common.core.config import settings @@ -54,8 +58,6 @@ warnings.filterwarnings("ignore") -base_message_count_limit = 6 - executor = ThreadPoolExecutor(max_workers=200) dynamic_ds_types = [1, 3] @@ -66,14 +68,36 @@ i18n = I18n() +def extract_tables_from_sql(sql: str, ds_type: str = None) -> set: + """从 SQL 中提取真实表名(排除 CTE 别名)""" + tables = set() + dialect = get_sqlglot_dialect(ds_type) + try: + statements = sqlglot.parse(sql, dialect=dialect) + for stmt in statements: + if stmt: + # 收集 CTE 别名,排除嵌套 CTE + cte_names = set() + for cte in stmt.find_all(exp.CTE): + if cte.alias: + cte_names.add(cte.alias) + for table in stmt.find_all(exp.Table): + if table.name and table.name not in cte_names: + tables.add(table.name) + except Exception: + pass + return tables + + class LLMService: ds: CoreDatasource chat_question: ChatQuestion + oid: int record: ChatRecord config: LLMConfig llm: BaseChatModel - sql_message: List[Union[BaseMessage, dict[str, Any]]] = [] - chart_message: List[Union[BaseMessage, dict[str, Any]]] = [] + sql_message: List[Union[BaseMessage, dict[str, Any]]] + chart_message: List[Union[BaseMessage, dict[str, Any]]] # session: Session = db_session current_user: CurrentUser @@ -81,12 +105,10 @@ class LLMService: out_ds_instance: Optional[AssistantOutDs] = None change_title: bool = False - generate_sql_logs: List[ChatLog] = [] - generate_chart_logs: List[ChatLog] = [] - - current_logs: dict[OperationEnum, ChatLog] = {} - - chunk_list: List[str] = [] + generate_sql_logs: List[ChatLog] + generate_chart_logs: List[ChatLog] + current_logs: dict[OperationEnum, ChatLog] + chunk_list: List[str] future: Future trans: I18nHelper = None @@ -95,18 +117,56 @@ class LLMService: articles_number: int = 4 enable_sql_row_limit: bool = settings.GENERATE_SQL_QUERY_LIMIT_ENABLED + base_message_round_count_limit: int = settings.GENERATE_SQL_QUERY_HISTORY_ROUND_COUNT def __init__(self, session: Session, current_user: CurrentUser, chat_question: ChatQuestion, current_assistant: Optional[CurrentAssistant] = None, no_reasoning: bool = False, embedding: bool = False, config: LLMConfig = None): + self.sql_message = [] + self.chart_message = [] + self.generate_sql_logs = [] + self.generate_chart_logs = [] + self.current_logs = {} self.chunk_list = [] self.current_user = current_user self.current_assistant = current_assistant + + self.table_name_list = [] + + chat_question.lang = get_lang_name(current_user.language) + self.trans = i18n(lang=current_user.language) + chat_id = chat_question.chat_id chat: Chat | None = session.get(Chat, chat_id) if not chat: raise SingleMessageError(f"Chat with id {chat_id} not found") + self.oid = chat.oid + + if self.oid and not current_assistant: + w_list = user_ws_list(session, self.current_user.id) + oid_list = [item.id for item in w_list] + if int(self.oid) not in oid_list: + raise SingleMessageError("Current user cannot not access this chat") + if self.oid and current_assistant: + if self.oid != self.current_user.oid: + raise SingleMessageError("Current assistant user cannot not access this chat") + + self.current_user.oid = chat.oid ds: CoreDatasource | AssistantOutDsSchema | None = None + if not chat.datasource and chat_question.datasource_id: + _ds = session.get(CoreDatasource, chat_question.datasource_id) + if _ds: + if _ds.oid != self.oid: + raise SingleMessageError( + f"Datasource with id {chat_question.datasource_id} does not belong to current workspace") + chat.datasource = _ds.id + chat.engine_type = _ds.type_name + # save chat + session.add(chat) + session.flush() + session.refresh(chat) + session.commit() + if chat.datasource: # Get available datasource if current_assistant and current_assistant.type in dynamic_ds_types: @@ -115,23 +175,17 @@ def __init__(self, session: Session, current_user: CurrentUser, chat_question: C if not ds: raise SingleMessageError("No available datasource configuration found") chat_question.engine = ds.type + get_version(ds) - chat_question.db_schema = self.out_ds_instance.get_db_schema(ds.id, chat_question.question) else: ds = session.get(CoreDatasource, chat.datasource) if not ds: raise SingleMessageError("No available datasource configuration found") chat_question.engine = (ds.type_name if ds.type != 'excel' else 'PostgreSQL') + get_version(ds) - chat_question.db_schema = get_table_schema(session=session, current_user=current_user, ds=ds, - question=chat_question.question, embedding=embedding) self.generate_sql_logs = list_generate_sql_logs(session=session, chart_id=chat_id) self.generate_chart_logs = list_generate_chart_logs(session=session, chart_id=chat_id) self.change_title = not get_chat_brief_generate(session=session, chat_id=chat_id) - chat_question.lang = get_lang_name(current_user.language) - self.trans = i18n(lang=current_user.language) - self.ds = ( ds if isinstance(ds, AssistantOutDsSchema) else CoreDatasource(**ds.model_dump())) if ds else None self.chat_question = chat_question @@ -161,16 +215,38 @@ def __init__(self, session: Session, current_user: CurrentUser, chat_question: C @classmethod async def create(cls, *args, **kwargs): - config: LLMConfig = await get_default_config() + specialized_model_id = None + _ai_model_list = [] + if args[3]: + if args[1]: + ws_id = args[1].oid + _ai_model_list = get_ai_model_list_by_workspace(args[0], ws_id) + if args[3].enable_custom_model: + if args[3].custom_model: + if any(str(model.id) == str(args[3].custom_model) for model in _ai_model_list): + specialized_model_id = args[3].custom_model + print("use custom model: id[" + specialized_model_id + "]") + config: LLMConfig = await get_default_config(specialized_model_id) instance = cls(*args, **kwargs, config=config) chat_params: list[SysArgModel] = await get_groups(args[0], "chat") for config in chat_params: + if config.pkey == 'chat.sqlbot_name': + if config.pval.strip(): + instance.chat_question.sqlbot_name = config.pval if config.pkey == 'chat.limit_rows': if config.pval.lower().strip() == 'true': instance.enable_sql_row_limit = True else: instance.enable_sql_row_limit = False + if config.pkey == 'chat.context_record_count': + count_value = config.pval + if count_value is None: + count_value = settings.GENERATE_SQL_QUERY_HISTORY_ROUND_COUNT + count_value = int(count_value) + if count_value < 0: + count_value = 0 + instance.base_message_round_count_limit = count_value return instance def is_running(self, timeout=0.5): @@ -183,7 +259,10 @@ def is_running(self, timeout=0.5): except Exception as e: return True - def init_messages(self): + def init_messages(self, session: Session): + + self.table_name_list = self.choose_table_schema(session) + last_sql_messages: List[dict[str, Any]] = self.generate_sql_logs[-1].messages if len( self.generate_sql_logs) > 0 else [] if self.chat_question.regenerate_record_id: @@ -192,40 +271,72 @@ def init_messages(self): filter(lambda obj: obj.pid == self.chat_question.regenerate_record_id, self.generate_sql_logs), None) last_sql_messages: List[dict[str, Any]] = _temp_log.messages if _temp_log else [] - # todo maybe can configure - count_limit = 0 - base_message_count_limit + # 排除所有的系统提示词 + last_sql_messages = [obj for obj in last_sql_messages if obj.get("sqlbot_system") != True] + + count_limit = self.base_message_round_count_limit self.sql_message = [] # add sys prompt - self.sql_message.append(SystemMessage( - content=self.chat_question.sql_sys_question(self.ds.type, self.enable_sql_row_limit))) + _system_templates = self.chat_question.sql_sys_question(self.ds.type, self.enable_sql_row_limit) + self.sql_message.append(SystemPromptMessage(content=_system_templates['system'])) + self.sql_message.append(HumanPromptMessage(content=_system_templates['rules'])) + self.sql_message.append( + AIPromptMessage(content='我已掌握所有规则,包括表结构、SQL规范、安全限制和输出格式,我会严格遵守这些规则。')) + self.sql_message.append(HumanPromptMessage(content=_system_templates['schema'])) + self.sql_message.append( + AIPromptMessage(content='我已确认您提供的数据库信息与表结构schema,我生成的SQL不会超出您提供的范围。')) + if _system_templates.get('custom_prompt'): + self.sql_message.append(HumanPromptMessage(content=_system_templates['custom_prompt'])) + self.sql_message.append(AIPromptMessage(content='我已确认您提供的额外信息,我会进行参考。')) + if _system_templates.get('terminologies'): + self.sql_message.append(HumanPromptMessage(content=_system_templates['terminologies'])) + self.sql_message.append(AIPromptMessage(content='我已确认您提供的术语信息,我会进行参考。')) + if _system_templates.get('data_training'): + self.sql_message.append(HumanPromptMessage(content=_system_templates['data_training'])) + self.sql_message.append(AIPromptMessage(content='我已确认您提供的SQL示例,我会进行参考。')) + if last_sql_messages is not None and len(last_sql_messages) > 0: - # limit count - for last_sql_message in last_sql_messages[count_limit:]: + last_rounds = get_last_conversation_rounds(last_sql_messages, rounds=count_limit) + + for _msg_dict in last_rounds: _msg: BaseMessage - if last_sql_message['type'] == 'human': - _msg = HumanMessage(content=last_sql_message['content']) + if _msg_dict.get('type') == 'human': + _msg = HumanMessage(content=_msg_dict.get('content')) self.sql_message.append(_msg) - elif last_sql_message['type'] == 'ai': - _msg = AIMessage(content=last_sql_message['content']) + elif _msg_dict.get('type') == 'ai': + _msg = AIMessage(content=_msg_dict.get('content')) self.sql_message.append(_msg) last_chart_messages: List[dict[str, Any]] = self.generate_chart_logs[-1].messages if len( self.generate_chart_logs) > 0 else [] + if self.chat_question.regenerate_record_id: + # filter record before regenerate_record_id + _temp_log = next( + filter(lambda obj: obj.pid == self.chat_question.regenerate_record_id, self.generate_chart_logs), None) + last_chart_messages: List[dict[str, Any]] = _temp_log.messages if _temp_log else [] + + # 排除所有的系统提示词 + last_chart_messages = [obj for obj in last_chart_messages if obj.get("sqlbot_system") != True] + + count_chart_limit = self.base_message_round_count_limit self.chart_message = [] # add sys prompt - self.chart_message.append(SystemMessage(content=self.chat_question.chart_sys_question())) - + _chart_system_templates = self.chat_question.chart_sys_question() + self.chart_message.append(SystemPromptMessage(content=_chart_system_templates['system'])) + self.chart_message.append(HumanPromptMessage(content=_chart_system_templates['rules'])) + self.chart_message.append(AIPromptMessage(content='我已掌握所有规则,我会严格遵守这些规则来生成符合要求的JSON。')) if last_chart_messages is not None and len(last_chart_messages) > 0: - # limit count - for last_chart_message in last_chart_messages: + last_rounds = get_last_conversation_rounds(last_chart_messages, rounds=count_chart_limit) + + for _msg_dict in last_rounds: _msg: BaseMessage - if last_chart_message.get('type') == 'human': - _msg = HumanMessage(content=last_chart_message.get('content')) + if _msg_dict.get('type') == 'human': + _msg = HumanMessage(content=_msg_dict.get('content')) self.chart_message.append(_msg) - elif last_chart_message.get('type') == 'ai': - _msg = AIMessage(content=last_chart_message.get('content')) + elif _msg_dict.get('type') == 'ai': + _msg = AIMessage(content=_msg_dict.get('content')) self.chart_message.append(_msg) def init_record(self, session: Session) -> ChatRecord: @@ -245,6 +356,110 @@ def get_fields_from_chart(self, _session: Session): chart_info = get_chart_config(_session, self.record.id) return format_chart_fields(chart_info) + def filter_terminology_template(self, _session: Session, oid: int = None, ds_id: int = None): + self.current_logs[OperationEnum.FILTER_TERMS] = start_log(session=_session, + operate=OperationEnum.FILTER_TERMS, + record_id=self.record.id, local_operation=True) + calculate_oid = oid + calculate_ds_id = ds_id + if self.current_assistant: + calculate_oid = self.current_assistant.oid if self.current_assistant.type != 4 else self.oid + if self.current_assistant.type == 1: + calculate_ds_id = None + if self.current_assistant and self.current_assistant.type == 1: + self.chat_question.terminologies, term_list = get_terminology_template(_session, + self.chat_question.question, + calculate_oid, + None, self.current_assistant.id) + else: + self.chat_question.terminologies, term_list = get_terminology_template(_session, + self.chat_question.question, + calculate_oid, + calculate_ds_id) + + self.current_logs[OperationEnum.FILTER_TERMS] = end_log(session=_session, + log=self.current_logs[OperationEnum.FILTER_TERMS], + full_message=term_list) + + def filter_custom_prompts(self, _session: Session, custom_prompt_type: CustomPromptTypeEnum, oid: int = None, + ds_id: int = None): + if SQLBotLicenseUtil.valid(): + self.current_logs[OperationEnum.FILTER_CUSTOM_PROMPT] = start_log(session=_session, + operate=OperationEnum.FILTER_CUSTOM_PROMPT, + record_id=self.record.id, + local_operation=True) + calculate_oid = oid + calculate_ds_id = ds_id + if self.current_assistant: + calculate_oid = self.current_assistant.oid if self.current_assistant.type != 4 else self.oid + if self.current_assistant.type == 1: + calculate_ds_id = None + if self.current_assistant and self.current_assistant.type == 1: + self.chat_question.custom_prompt, prompt_list = find_custom_prompts(_session, + custom_prompt_type, + calculate_oid, + None, self.current_assistant.id) + else: + self.chat_question.custom_prompt, prompt_list = find_custom_prompts(_session, + custom_prompt_type, + calculate_oid, + calculate_ds_id) + self.current_logs[OperationEnum.FILTER_CUSTOM_PROMPT] = end_log(session=_session, + log=self.current_logs[ + OperationEnum.FILTER_CUSTOM_PROMPT], + full_message=prompt_list) + + def filter_training_template(self, _session: Session, oid: int = None, ds_id: int = None): + self.current_logs[OperationEnum.FILTER_SQL_EXAMPLE] = start_log(session=_session, + operate=OperationEnum.FILTER_SQL_EXAMPLE, + record_id=self.record.id, + local_operation=True) + calculate_oid = oid + calculate_ds_id = ds_id + if self.current_assistant: + calculate_oid = self.current_assistant.oid if self.current_assistant.type != 4 else self.oid + if self.current_assistant.type == 1: + calculate_ds_id = None + if self.current_assistant and self.current_assistant.type == 1: + self.chat_question.data_training, example_list = get_training_template(_session, + self.chat_question.question, + calculate_oid, + None, self.current_assistant.id) + else: + self.chat_question.data_training, example_list = get_training_template(_session, + self.chat_question.question, + calculate_oid, + calculate_ds_id) + self.current_logs[OperationEnum.FILTER_SQL_EXAMPLE] = end_log(session=_session, + log=self.current_logs[ + OperationEnum.FILTER_SQL_EXAMPLE], + full_message=example_list) + + def choose_table_schema(self, _session: Session): + self.current_logs[OperationEnum.CHOOSE_TABLE] = start_log(session=_session, + operate=OperationEnum.CHOOSE_TABLE, + record_id=self.record.id, + local_operation=True) + self.chat_question.db_schema, tables = self.out_ds_instance.get_db_schema( + self.ds.id, self.chat_question.question) if self.out_ds_instance else get_table_schema( + session=_session, + current_user=self.current_user, + ds=self.ds, + question=self.chat_question.question) + + # Get sample data for all tables + if not self.out_ds_instance: + self.chat_question.sample_data = get_tables_sample_data( + session=_session, + current_user=self.current_user, + ds=self.ds, + table_list=tables) + + self.current_logs[OperationEnum.CHOOSE_TABLE] = end_log(session=_session, + log=self.current_logs[OperationEnum.CHOOSE_TABLE], + full_message=self.chat_question.db_schema) + return tables + def generate_analysis(self, _session: Session): fields = self.get_fields_from_chart(_session) self.chat_question.fields = orjson.dumps(fields).decode() @@ -253,13 +468,12 @@ def generate_analysis(self, _session: Session): analysis_msg: List[Union[BaseMessage, dict[str, Any]]] = [] ds_id = self.ds.id if isinstance(self.ds, CoreDatasource) else None - self.chat_question.terminologies = get_terminology_template(_session, self.chat_question.question, - self.current_user.oid, ds_id) - if SQLBotLicenseUtil.valid(): - self.chat_question.custom_prompt = find_custom_prompts(_session, CustomPromptTypeEnum.ANALYSIS, - self.current_user.oid, ds_id) - analysis_msg.append(SystemMessage(content=self.chat_question.analysis_sys_question())) + self.filter_terminology_template(_session, self.oid, ds_id) + + self.filter_custom_prompts(_session, CustomPromptTypeEnum.ANALYSIS, self.oid, ds_id) + + analysis_msg.append(SystemPromptMessage(content=self.chat_question.analysis_sys_question())) analysis_msg.append(HumanMessage(content=self.chat_question.analysis_user_question())) self.current_logs[OperationEnum.ANALYSIS] = start_log(session=_session, @@ -269,6 +483,8 @@ def generate_analysis(self, _session: Session): record_id=self.record.id, full_message=[ {'type': msg.type, + 'sqlbot_system': getattr(msg, 'sqlbot_system', + False) is True, 'content': msg.content} for msg in analysis_msg]) @@ -290,6 +506,8 @@ def generate_analysis(self, _session: Session): OperationEnum.ANALYSIS], full_message=[ {'type': msg.type, + 'sqlbot_system': getattr(msg, 'sqlbot_system', + False) is True, 'content': msg.content} for msg in analysis_msg], reasoning_content=full_thinking_text, @@ -303,13 +521,11 @@ def generate_predict(self, _session: Session): data = get_chat_chart_data(_session, self.record.id) self.chat_question.data = orjson.dumps(data.get('data')).decode() - if SQLBotLicenseUtil.valid(): - ds_id = self.ds.id if isinstance(self.ds, CoreDatasource) else None - self.chat_question.custom_prompt = find_custom_prompts(_session, CustomPromptTypeEnum.PREDICT_DATA, - self.current_user.oid, ds_id) + ds_id = self.ds.id if isinstance(self.ds, CoreDatasource) else None + self.filter_custom_prompts(_session, CustomPromptTypeEnum.PREDICT_DATA, self.oid, ds_id) predict_msg: List[Union[BaseMessage, dict[str, Any]]] = [] - predict_msg.append(SystemMessage(content=self.chat_question.predict_sys_question())) + predict_msg.append(SystemPromptMessage(content=self.chat_question.predict_sys_question())) predict_msg.append(HumanMessage(content=self.chat_question.predict_user_question())) self.current_logs[OperationEnum.PREDICT_DATA] = start_log(session=_session, @@ -319,6 +535,8 @@ def generate_predict(self, _session: Session): record_id=self.record.id, full_message=[ {'type': msg.type, + 'sqlbot_system': getattr(msg, 'sqlbot_system', + False) is True, 'content': msg.content} for msg in predict_msg]) @@ -341,6 +559,8 @@ def generate_predict(self, _session: Session): OperationEnum.PREDICT_DATA], full_message=[ {'type': msg.type, + 'sqlbot_system': getattr(msg, 'sqlbot_system', + False) is True, 'content': msg.content} for msg in predict_msg], reasoning_content=full_thinking_text, @@ -350,15 +570,22 @@ def generate_recommend_questions_task(self, _session: Session): # get schema if self.ds and not self.chat_question.db_schema: - self.chat_question.db_schema = self.out_ds_instance.get_db_schema( + self.chat_question.db_schema, tables = self.out_ds_instance.get_db_schema( self.ds.id, self.chat_question.question) if self.out_ds_instance else get_table_schema( session=_session, current_user=self.current_user, ds=self.ds, question=self.chat_question.question, embedding=False) + # Get sample data for all tables + # if not self.out_ds_instance: + # self.chat_question.sample_data = get_tables_sample_data( + # session=_session, + # current_user=self.current_user, + # ds=self.ds) + guess_msg: List[Union[BaseMessage, dict[str, Any]]] = [] - guess_msg.append(SystemMessage(content=self.chat_question.guess_sys_question(self.articles_number))) + guess_msg.append(SystemPromptMessage(content=self.chat_question.guess_sys_question(self.articles_number))) old_questions = list(map(lambda q: q.strip(), get_old_questions(_session, self.record.datasource))) guess_msg.append( @@ -371,6 +598,9 @@ def generate_recommend_questions_task(self, _session: Session): record_id=self.record.id, full_message=[ {'type': msg.type, + 'sqlbot_system': getattr(msg, + 'sqlbot_system', + False) is True, 'content': msg.content} for msg in guess_msg]) @@ -392,23 +622,27 @@ def generate_recommend_questions_task(self, _session: Session): OperationEnum.GENERATE_RECOMMENDED_QUESTIONS], full_message=[ {'type': msg.type, + 'sqlbot_system': getattr(msg, + 'sqlbot_system', + False) is True, 'content': msg.content} for msg in guess_msg], reasoning_content=full_thinking_text, token_usage=token_usage) self.record = save_recommend_question_answer(session=_session, record_id=self.record.id, - answer={'content': full_guess_text}, articles_number=self.articles_number) + answer={'content': full_guess_text}, + articles_number=self.articles_number) yield {'recommended_question': self.record.recommended_question} def select_datasource(self, _session: Session): datasource_msg: List[Union[BaseMessage, dict[str, Any]]] = [] - datasource_msg.append(SystemMessage(self.chat_question.datasource_sys_question())) + datasource_msg.append(SystemPromptMessage(self.chat_question.datasource_sys_question())) if self.current_assistant and self.current_assistant.type != 4: _ds_list = get_assistant_ds(session=_session, llm_service=self) else: stmt = select(CoreDatasource.id, CoreDatasource.name, CoreDatasource.description).where( - and_(CoreDatasource.oid == self.current_user.oid)) + and_(CoreDatasource.oid == self.oid)) _ds_list = [ { "id": ds.id, @@ -427,7 +661,7 @@ def select_datasource(self, _session: Session): if not ignore_auto_select: if settings.TABLE_EMBEDDING_ENABLED and ( not self.current_assistant or (self.current_assistant and self.current_assistant.type != 1)): - _ds_list = get_ds_embedding(_session, self.current_user, _ds_list, self.out_ds_instance, + _ds_list = get_ds_embedding(_session, _ds_list, self.out_ds_instance, self.chat_question.question, self.current_assistant) # yield {'content': '{"id":' + str(ds.get('id')) + '}'} @@ -443,6 +677,9 @@ def select_datasource(self, _session: Session): operate=OperationEnum.CHOOSE_DATASOURCE, record_id=self.record.id, full_message=[{'type': msg.type, + 'sqlbot_system': getattr(msg, + 'sqlbot_system', + False) is True, 'content': msg.content} for msg in datasource_msg]) @@ -462,6 +699,9 @@ def select_datasource(self, _session: Session): OperationEnum.CHOOSE_DATASOURCE], full_message=[ {'type': msg.type, + 'sqlbot_system': getattr(msg, + 'sqlbot_system', + False) is True, 'content': msg.content} for msg in datasource_msg], reasoning_content=full_thinking_text, @@ -486,8 +726,7 @@ def select_datasource(self, _session: Session): _ds = self.out_ds_instance.get_ds(data['id']) self.ds = _ds self.chat_question.engine = _ds.type + get_version(self.ds) - self.chat_question.db_schema = self.out_ds_instance.get_db_schema(self.ds.id, - self.chat_question.question) + _engine_type = self.chat_question.engine _chat.engine_type = _ds.type else: @@ -498,9 +737,7 @@ def select_datasource(self, _session: Session): self.ds = CoreDatasource(**_ds.model_dump()) self.chat_question.engine = (_ds.type_name if _ds.type != 'excel' else 'PostgreSQL') + get_version( self.ds) - self.chat_question.db_schema = get_table_schema(session=_session, - current_user=self.current_user, ds=self.ds, - question=self.chat_question.question) + _engine_type = self.chat_question.engine _chat.engine_type = _ds.type_name # save chat @@ -532,19 +769,13 @@ def select_datasource(self, _session: Session): oid = self.ds.oid if isinstance(self.ds, CoreDatasource) else 1 ds_id = self.ds.id if isinstance(self.ds, CoreDatasource) else None - self.chat_question.terminologies = get_terminology_template(_session, self.chat_question.question, oid, - ds_id) - if self.current_assistant and self.current_assistant.type == 1: - self.chat_question.data_training = get_training_template(_session, self.chat_question.question, - oid, None, self.current_assistant.id) - else: - self.chat_question.data_training = get_training_template(_session, self.chat_question.question, - oid, ds_id) - if SQLBotLicenseUtil.valid(): - self.chat_question.custom_prompt = find_custom_prompts(_session, CustomPromptTypeEnum.GENERATE_SQL, - oid, ds_id) + self.filter_terminology_template(_session, oid, ds_id) + + self.filter_training_template(_session, oid, ds_id) - self.init_messages() + self.filter_custom_prompts(_session, CustomPromptTypeEnum.GENERATE_SQL, oid, ds_id) + + self.init_messages(_session) if _error: raise _error @@ -561,7 +792,10 @@ def generate_sql(self, _session: Session): operate=OperationEnum.GENERATE_SQL, record_id=self.record.id, full_message=[ - {'type': msg.type, 'content': msg.content} for msg + {'type': msg.type, + 'sqlbot_system': getattr(msg, 'sqlbot_system', + False) is True, + 'content': msg.content} for msg in self.sql_message]) full_thinking_text = '' full_sql_text = '' @@ -578,7 +812,11 @@ def generate_sql(self, _session: Session): self.current_logs[OperationEnum.GENERATE_SQL] = end_log(session=_session, log=self.current_logs[OperationEnum.GENERATE_SQL], - full_message=[{'type': msg.type, 'content': msg.content} + full_message=[{'type': msg.type, + 'sqlbot_system': getattr(msg, + 'sqlbot_system', + False) is True, + 'content': msg.content} for msg in self.sql_message], reasoning_content=full_thinking_text, token_usage=token_usage) @@ -590,7 +828,7 @@ def generate_with_sub_sql(self, session: Session, sql, sub_mappings: list): self.chat_question.sql = sql self.chat_question.sub_query = sub_query dynamic_sql_msg: List[Union[BaseMessage, dict[str, Any]]] = [] - dynamic_sql_msg.append(SystemMessage(content=self.chat_question.dynamic_sys_question())) + dynamic_sql_msg.append(SystemPromptMessage(content=self.chat_question.dynamic_sys_question())) dynamic_sql_msg.append(HumanMessage(content=self.chat_question.dynamic_user_question())) self.current_logs[OperationEnum.GENERATE_DYNAMIC_SQL] = start_log(session=session, @@ -599,6 +837,9 @@ def generate_with_sub_sql(self, session: Session, sql, sub_mappings: list): operate=OperationEnum.GENERATE_DYNAMIC_SQL, record_id=self.record.id, full_message=[{'type': msg.type, + 'sqlbot_system': getattr(msg, + 'sqlbot_system', + False) is True, 'content': msg.content} for msg in dynamic_sql_msg]) @@ -620,6 +861,9 @@ def generate_with_sub_sql(self, session: Session, sql, sub_mappings: list): OperationEnum.GENERATE_DYNAMIC_SQL], full_message=[ {'type': msg.type, + 'sqlbot_system': getattr(msg, + 'sqlbot_system', + False) is True, 'content': msg.content} for msg in dynamic_sql_msg], reasoning_content=full_thinking_text, @@ -648,7 +892,7 @@ def build_table_filter(self, session: Session, sql: str, filters: list): self.chat_question.sql = sql self.chat_question.filter = filter permission_sql_msg: List[Union[BaseMessage, dict[str, Any]]] = [] - permission_sql_msg.append(SystemMessage(content=self.chat_question.filter_sys_question())) + permission_sql_msg.append(SystemPromptMessage(content=self.chat_question.filter_sys_question())) permission_sql_msg.append(HumanMessage(content=self.chat_question.filter_user_question())) self.current_logs[OperationEnum.GENERATE_SQL_WITH_PERMISSIONS] = start_log(session=session, @@ -658,6 +902,9 @@ def build_table_filter(self, session: Session, sql: str, filters: list): record_id=self.record.id, full_message=[ {'type': msg.type, + 'sqlbot_system': getattr(msg, + 'sqlbot_system', + False) is True, 'content': msg.content} for msg in permission_sql_msg]) @@ -678,6 +925,9 @@ def build_table_filter(self, session: Session, sql: str, filters: list): OperationEnum.GENERATE_SQL_WITH_PERMISSIONS], full_message=[ {'type': msg.type, + 'sqlbot_system': getattr(msg, + 'sqlbot_system', + False) is True, 'content': msg.content} for msg in permission_sql_msg], reasoning_content=full_thinking_text, @@ -703,9 +953,9 @@ def generate_assistant_filter(self, _session: Session, sql, tables: List): return None return self.build_table_filter(session=_session, sql=sql, filters=filters) - def generate_chart(self, _session: Session, chart_type: Optional[str] = ''): + def generate_chart(self, _session: Session, chart_type: Optional[str] = '', schema: Optional[str] = ''): # append current question - self.chart_message.append(HumanMessage(self.chat_question.chart_user_question(chart_type))) + self.chart_message.append(HumanMessage(self.chat_question.chart_user_question(chart_type, schema))) self.current_logs[OperationEnum.GENERATE_CHART] = start_log(session=_session, ai_modal_id=self.chat_question.ai_modal_id, @@ -713,7 +963,10 @@ def generate_chart(self, _session: Session, chart_type: Optional[str] = ''): operate=OperationEnum.GENERATE_CHART, record_id=self.record.id, full_message=[ - {'type': msg.type, 'content': msg.content} for + {'type': msg.type, + 'sqlbot_system': getattr(msg, 'sqlbot_system', + False) is True, + 'content': msg.content} for msg in self.chart_message]) full_thinking_text = '' @@ -734,17 +987,23 @@ def generate_chart(self, _session: Session, chart_type: Optional[str] = ''): self.current_logs[OperationEnum.GENERATE_CHART] = end_log(session=_session, log=self.current_logs[OperationEnum.GENERATE_CHART], full_message=[ - {'type': msg.type, 'content': msg.content} + {'type': msg.type, + 'sqlbot_system': getattr(msg, 'sqlbot_system', + False) is True, + 'content': msg.content} for msg in self.chart_message], reasoning_content=full_thinking_text, token_usage=token_usage) - @staticmethod - def check_sql(res: str) -> tuple[str, Optional[list]]: + def check_sql(self, session: Session, res: str, operate: OperationEnum) -> tuple[str, Optional[list]]: json_str = extract_nested_json(res) + + log = self.current_logs[operate] + if json_str is None: - raise SingleMessageError(orjson.dumps({'message': 'Cannot parse sql from answer', - 'traceback': "Cannot parse sql from answer:\n" + res}).decode()) + trigger_log_error(session, log) + raise SingleMessageError(orjson.dumps({'message': 'SQL answer is not a valid json object', + 'traceback': "SQL answer is not a valid json object:\n" + res}).decode()) sql: str data: dict try: @@ -756,12 +1015,15 @@ def check_sql(res: str) -> tuple[str, Optional[list]]: message = data['message'] raise SingleMessageError(message) except SingleMessageError as e: + trigger_log_error(session, log) raise e except Exception: + trigger_log_error(session, log) raise SingleMessageError(orjson.dumps({'message': 'Cannot parse sql from answer', 'traceback': "Cannot parse sql from answer:\n" + res}).decode()) if sql.strip() == '': + trigger_log_error(session, log) raise SingleMessageError("SQL query is empty") return sql, data.get('tables') @@ -805,8 +1067,8 @@ def get_brief_from_sql_answer(res: str) -> Optional[str]: return brief - def check_save_sql(self, session: Session, res: str) -> str: - sql, *_ = self.check_sql(res=res) + def check_save_sql(self, session: Session, res: str, operate: OperationEnum) -> str: + sql, *_ = self.check_sql(session=session, res=res, operate=operate) save_sql(session=session, sql=sql, record_id=self.record.id) self.chat_question.sql = sql @@ -902,6 +1164,7 @@ def save_sql_data(self, session: Session, data_obj: Dict[str, Any]): data_obj['limit'] = limit else: data_obj['data'] = data_result + data_obj['datasource'] = self.ds.id return save_sql_exec_data(session=session, record_id=self.record.id, data=orjson.dumps(data_obj).decode()) except Exception as e: @@ -952,18 +1215,18 @@ def await_result(self): yield chunk def run_task_async(self, in_chat: bool = True, stream: bool = True, - finish_step: ChatFinishStep = ChatFinishStep.GENERATE_CHART): + finish_step: ChatFinishStep = ChatFinishStep.GENERATE_CHART, return_img: bool = True): if in_chat: stream = True - self.future = executor.submit(self.run_task_cache, in_chat, stream, finish_step) + self.future = executor.submit(self.run_task_cache, in_chat, stream, finish_step, return_img) def run_task_cache(self, in_chat: bool = True, stream: bool = True, - finish_step: ChatFinishStep = ChatFinishStep.GENERATE_CHART): - for chunk in self.run_task(in_chat, stream, finish_step): + finish_step: ChatFinishStep = ChatFinishStep.GENERATE_CHART, return_img: bool = True): + for chunk in self.run_task(in_chat, stream, finish_step, return_img): self.chunk_list.append(chunk) def run_task(self, in_chat: bool = True, stream: bool = True, - finish_step: ChatFinishStep = ChatFinishStep.GENERATE_CHART): + finish_step: ChatFinishStep = ChatFinishStep.GENERATE_CHART, return_img: bool = True): json_result: Dict[str, Any] = {'success': True} _session = None try: @@ -971,19 +1234,14 @@ def run_task(self, in_chat: bool = True, stream: bool = True, if self.ds: oid = self.ds.oid if isinstance(self.ds, CoreDatasource) else 1 ds_id = self.ds.id if isinstance(self.ds, CoreDatasource) else None - self.chat_question.terminologies = get_terminology_template(_session, self.chat_question.question, - oid, ds_id) - if self.current_assistant and self.current_assistant.type == 1: - self.chat_question.data_training = get_training_template(_session, self.chat_question.question, - oid, None, self.current_assistant.id) - else: - self.chat_question.data_training = get_training_template(_session, self.chat_question.question, - oid, ds_id) - if SQLBotLicenseUtil.valid(): - self.chat_question.custom_prompt = find_custom_prompts(_session, - CustomPromptTypeEnum.GENERATE_SQL, - oid, ds_id) - self.init_messages() + + self.filter_terminology_template(_session, oid, ds_id) + + self.filter_training_template(_session, oid, ds_id) + + self.filter_custom_prompts(_session, CustomPromptTypeEnum.GENERATE_SQL, oid, ds_id) + + self.init_messages(_session) # return id if in_chat: @@ -1015,12 +1273,6 @@ def run_task(self, in_chat: bool = True, stream: bool = True, 'engine_type': self.ds.type_name or self.ds.type, 'type': 'datasource'}).decode() + '\n\n' - self.chat_question.db_schema = self.out_ds_instance.get_db_schema( - self.ds.id, self.chat_question.question) if self.out_ds_instance else get_table_schema( - session=_session, - current_user=self.current_user, - ds=self.ds, - question=self.chat_question.question) else: self.validate_history_ds(_session) @@ -1066,28 +1318,48 @@ def run_task(self, in_chat: bool = True, stream: bool = True, sqlbot_temp_sql_text = None assistant_dynamic_sql = None # row permission + + sql_operate = OperationEnum.GENERATE_SQL + sql, tables = self.check_sql(session=_session, res=full_sql_text, operate=sql_operate) + + # 表名安全检查:用 sqlglot 解析真实 SQL,不信任 AI 返回的 tables + actual_tables = extract_tables_from_sql(sql, ds_type=self.ds.type) + if not actual_tables: + raise SingleMessageError( + "SQL parsing failed: unable to extract table names. " + "This may indicate an unsupported SQL syntax or a security issue." + ) + allowed_tables = set(self.table_name_list) + unauthorized_tables = actual_tables - allowed_tables + if unauthorized_tables: + raise SingleMessageError( + f"SQL contains unauthorized tables: {', '.join(unauthorized_tables)}. " + f"Allowed tables: {', '.join(allowed_tables)}" + ) + if ((not self.current_assistant or is_page_embedded) and is_normal_user( self.current_user)) or use_dynamic_ds: - sql, tables = self.check_sql(res=full_sql_text) sql_result = None if use_dynamic_ds: dynamic_sql_result = self.generate_assistant_dynamic_sql(_session, sql, tables) sqlbot_temp_sql_text = dynamic_sql_result.get( 'sqlbot_temp_sql_text') if dynamic_sql_result else None - # sql_result = self.generate_assistant_filter(sql, tables) else: sql_result = self.generate_filter(_session, sql, tables) # maybe no sql and tables if sql_result: SQLBotLogUtil.info(sql_result) - sql = self.check_save_sql(session=_session, res=sql_result) + sql_operate = OperationEnum.GENERATE_SQL_WITH_PERMISSIONS + sql = self.check_save_sql(session=_session, res=sql_result, operate=sql_operate) elif dynamic_sql_result and sqlbot_temp_sql_text: - assistant_dynamic_sql = self.check_save_sql(session=_session, res=sqlbot_temp_sql_text) + sql_operate = OperationEnum.GENERATE_DYNAMIC_SQL + assistant_dynamic_sql = self.check_save_sql(session=_session, res=sqlbot_temp_sql_text, + operate=sql_operate) else: - sql = self.check_save_sql(session=_session, res=full_sql_text) + sql = self.check_save_sql(session=_session, res=full_sql_text, operate=sql_operate) else: - sql = self.check_save_sql(session=_session, res=full_sql_text) + sql = self.check_save_sql(session=_session, res=full_sql_text, operate=sql_operate) SQLBotLogUtil.info('sql: ' + sql) @@ -1117,9 +1389,17 @@ def run_task(self, in_chat: bool = True, stream: bool = True, yield json_result return + self.current_logs[OperationEnum.EXECUTE_SQL] = start_log(session=_session, + operate=OperationEnum.EXECUTE_SQL, + record_id=self.record.id, local_operation=True) result = self.execute_sql(sql=real_execute_sql) + self.current_logs[OperationEnum.EXECUTE_SQL] = end_log(session=_session, + log=self.current_logs[OperationEnum.EXECUTE_SQL], + full_message={'sql': real_execute_sql, + 'count': len(result.get('data'))}) _data = DataFormat.convert_large_numbers_in_object_array(result.get('data')) + _data = DataFormat.normalize_qualified_sql_column_keys_in_object_array(_data) result["data"] = _data self.save_sql_data(session=_session, data_obj=result) @@ -1154,7 +1434,16 @@ def run_task(self, in_chat: bool = True, stream: bool = True, return # generate chart - chart_res = self.generate_chart(_session, chart_type) + used_tables_schema, used_tables = self.out_ds_instance.get_db_schema( + self.ds.id, self.chat_question.question, embedding=False, + table_list=tables) if self.out_ds_instance else get_table_schema( + session=_session, + current_user=self.current_user, + ds=self.ds, + question=self.chat_question.question, + embedding=False, table_list=tables) + SQLBotLogUtil.info('used_tables_schema: \n' + used_tables_schema) + chart_res = self.generate_chart(_session, chart_type, used_tables_schema) full_chart_text = '' for chunk in chart_res: full_chart_text += chunk.get('content') @@ -1195,8 +1484,12 @@ def run_task(self, in_chat: bool = True, stream: bool = True, else: # generate picture try: - if chart.get('type') != 'table': + if chart.get('type') != 'table' and return_img: # yield '### generated chart picture\n\n' + self.current_logs[OperationEnum.GENERATE_PICTURE] = start_log(session=_session, + operate=OperationEnum.GENERATE_PICTURE, + record_id=self.record.id, + local_operation=True) image_url, error = request_picture(self.record.chat_id, self.record.id, chart, format_json_data(result)) SQLBotLogUtil.info(image_url) @@ -1206,6 +1499,11 @@ def run_task(self, in_chat: bool = True, stream: bool = True, json_result['image_url'] = image_url if error is not None: raise error + + self.current_logs[OperationEnum.GENERATE_PICTURE] = end_log(session=_session, + log=self.current_logs[ + OperationEnum.GENERATE_PICTURE], + full_message=image_url) except Exception as e: if stream: if chart.get('type') != 'table': @@ -1469,7 +1767,7 @@ def request_picture(chat_id: int, record_id: int, chart: dict, data: dict): y = None series = None multi_quota_fields = [] - multi_quota_name =None + multi_quota_name = None if chart.get('axis'): axis_data = chart.get('axis') @@ -1637,8 +1935,36 @@ def get_lang_name(lang: str): if not lang: return '简体中文' normalized = lang.lower() + if normalized.startswith('zh-tw'): + return '繁体中文' if normalized.startswith('en'): return '英文' if normalized.startswith('ko'): return '韩语' return '简体中文' + + +def get_last_conversation_rounds(messages, rounds=settings.GENERATE_SQL_QUERY_HISTORY_ROUND_COUNT): + """获取最后N轮对话,处理不完整对话的情况""" + if not messages or rounds <= 0: + return [] + + # 找到所有用户消息的位置 + human_indices = [] + for index, msg in enumerate(messages): + if msg.get('type') == 'human': + human_indices.append(index) + + # 如果没有用户消息,返回空 + if not human_indices: + return [] + + # 计算从哪个索引开始 + if len(human_indices) <= rounds: + # 如果用户消息数少于等于需要的轮数,从第一个用户消息开始 + start_index = human_indices[0] + else: + # 否则,从倒数第N个用户消息开始 + start_index = human_indices[-rounds] + + return messages[start_index:] diff --git a/backend/apps/dashboard/crud/dashboard_service.py b/backend/apps/dashboard/crud/dashboard_service.py index 4154024d4..ff33f8352 100644 --- a/backend/apps/dashboard/crud/dashboard_service.py +++ b/backend/apps/dashboard/crud/dashboard_service.py @@ -1,4 +1,9 @@ +import base64 + +from orjson import orjson from sqlalchemy import select, and_, text + +from apps.chat.curd.chat import get_chart_data_ds from apps.dashboard.models.dashboard_model import CoreDashboard, CreateDashboard, QueryDashboard, DashboardBaseResponse from common.core.deps import SessionDep, CurrentUser import uuid @@ -27,7 +32,7 @@ def list_resource(session: SessionDep, dashboard: QueryDashboard, current_user: nodes = [DashboardBaseResponse(**row) for row in result.mappings()] tree = build_tree_generic(nodes, root_pid="root") return tree - + def load_resource(session: SessionDep, dashboard: QueryDashboard): sql = text(""" @@ -41,7 +46,17 @@ def load_resource(session: SessionDep, dashboard: QueryDashboard): WHERE cd.id = :dashboard_id """) result = session.execute(sql, {"dashboard_id": dashboard.id}).mappings().first() - return result + + result_dict = dict(result) + canvas_view_obj = orjson.loads(result_dict['canvas_view_info']) + for item in canvas_view_obj.values(): + if all(key in item for key in ['datasource', 'sql']) and item['datasource'] is not None and item['sql'] is not None: + data_result = get_chart_data_ds(session, item['datasource'], item['sql']) + item['data']['data'] = data_result['data'] + item['status'] = data_result['status'] + item['message'] = data_result['message'] + result_dict['canvas_view_info'] = orjson.dumps(canvas_view_obj) + return result_dict def get_create_base_info(user: CurrentUser, dashboard: CreateDashboard): diff --git a/backend/apps/data_training/api/data_training.py b/backend/apps/data_training/api/data_training.py index ce2ecec13..d3e662cfb 100644 --- a/backend/apps/data_training/api/data_training.py +++ b/backend/apps/data_training/api/data_training.py @@ -27,6 +27,7 @@ @router.get("/page/{current_page}/{page_size}", summary=f"{PLACEHOLDER_PREFIX}get_dt_page") +@require_permissions(permission=SqlbotPermission(role=['ws_admin'])) async def pager(session: SessionDep, current_user: CurrentUser, current_page: int, page_size: int, question: Optional[str] = Query(None, description="搜索问题(可选)")): current_page, page_size, total_count, total_pages, _list = page_data_training(session, current_page, page_size, @@ -43,7 +44,9 @@ async def pager(session: SessionDep, current_user: CurrentUser, current_page: in @router.put("", response_model=int, summary=f"{PLACEHOLDER_PREFIX}create_or_update_dt") -@system_log(LogConfig(operation_type=OperationType.CREATE_OR_UPDATE, module=OperationModules.DATA_TRAINING,resource_id_expr='info.id', result_id_expr="result_self")) +@require_permissions(permission=SqlbotPermission(role=['ws_admin'], type='ds', keyExpression="info.datasource")) +@system_log(LogConfig(operation_type=OperationType.CREATE_OR_UPDATE, module=OperationModules.DATA_TRAINING, + resource_id_expr='info.id', result_id_expr="result_self")) async def create_or_update(session: SessionDep, current_user: CurrentUser, trans: Trans, info: DataTrainingInfo): oid = current_user.oid if info.id: @@ -53,14 +56,16 @@ async def create_or_update(session: SessionDep, current_user: CurrentUser, trans @router.delete("", summary=f"{PLACEHOLDER_PREFIX}delete_dt") -@system_log(LogConfig(operation_type=OperationType.DELETE, module=OperationModules.DATA_TRAINING,resource_id_expr='id_list')) +@system_log( + LogConfig(operation_type=OperationType.DELETE, module=OperationModules.DATA_TRAINING, resource_id_expr='id_list')) @require_permissions(permission=SqlbotPermission(role=['ws_admin'])) async def delete(session: SessionDep, id_list: list[int]): delete_training(session, id_list) @router.get("/{id}/enable/{enabled}", summary=f"{PLACEHOLDER_PREFIX}enable_dt") -@system_log(LogConfig(operation_type=OperationType.UPDATE, module=OperationModules.DATA_TRAINING,resource_id_expr='id')) +@system_log( + LogConfig(operation_type=OperationType.UPDATE, module=OperationModules.DATA_TRAINING, resource_id_expr='id')) @require_permissions(permission=SqlbotPermission(role=['ws_admin'])) async def enable(session: SessionDep, id: int, enabled: bool, trans: Trans): enable_training(session, id, enabled, trans) @@ -87,9 +92,7 @@ def inner(): fields.append(AxisObj(name=trans('i18n_data_training.problem_description'), value='question')) fields.append(AxisObj(name=trans('i18n_data_training.sample_sql'), value='description')) fields.append(AxisObj(name=trans('i18n_data_training.effective_data_sources'), value='datasource_name')) - if current_user.oid == 1: - fields.append( - AxisObj(name=trans('i18n_data_training.advanced_application'), value='advanced_application_name')) + fields.append(AxisObj(name=trans('i18n_data_training.advanced_application'), value='advanced_application_name')) md_data, _fields_list = DataFormat.convert_object_array_for_pandas(fields, data_list) @@ -125,10 +128,9 @@ def inner(): fields.append(AxisObj(name=trans('i18n_data_training.sample_sql_template'), value='description')) fields.append( AxisObj(name=trans('i18n_data_training.effective_data_sources_template'), value='datasource_name')) - if current_user.oid == 1: - fields.append( - AxisObj(name=trans('i18n_data_training.advanced_application_template'), - value='advanced_application_name')) + fields.append( + AxisObj(name=trans('i18n_data_training.advanced_application_template'), + value='advanced_application_name')) md_data, _fields_list = DataFormat.convert_object_array_for_pandas(fields, data_list) @@ -158,6 +160,7 @@ def inner(): @router.post("/uploadExcel", summary=f"{PLACEHOLDER_PREFIX}upload_excel_dt") @system_log(LogConfig(operation_type=OperationType.IMPORT, module=OperationModules.DATA_TRAINING)) +@require_permissions(permission=SqlbotPermission(role=['ws_admin'])) async def upload_excel(trans: Trans, current_user: CurrentUser, file: UploadFile = File(...)): ALLOWED_EXTENSIONS = {"xlsx", "xls"} if not file.filename.lower().endswith(tuple(ALLOWED_EXTENSIONS)): @@ -172,10 +175,7 @@ async def upload_excel(trans: Trans, current_user: CurrentUser, file: UploadFile oid = current_user.oid - use_cols = [0, 1, 2] # 问题, 描述, 数据源名称 - # 根据oid确定要读取的列 - if oid == 1: - use_cols = [0, 1, 2, 3] # 问题, 描述, 数据源名称, 高级应用名称 + use_cols = [0, 1, 2, 3] # 问题, 描述, 数据源名称, 高级应用名称 def inner(): @@ -208,19 +208,14 @@ def inner(): description = row[1].strip() if pd.notna(row[1]) and row[1].strip() else '' datasource_name = row[2].strip() if pd.notna(row[2]) and row[2].strip() else '' - advanced_application_name = '' - if oid == 1 and len(row) > 3: + advanced_application_name = None + if len(row) > 3: advanced_application_name = row[3].strip() if pd.notna(row[3]) and row[3].strip() else '' - if oid == 1: - import_data.append( - DataTrainingInfo(oid=oid, question=question, description=description, - datasource_name=datasource_name, - advanced_application_name=advanced_application_name)) - else: - import_data.append( - DataTrainingInfo(oid=oid, question=question, description=description, - datasource_name=datasource_name)) + import_data.append( + DataTrainingInfo(oid=oid, question=question, description=description, + datasource_name=datasource_name, + advanced_application_name=advanced_application_name)) res = batch_create_training(session, import_data, oid, trans) @@ -244,9 +239,8 @@ def inner(): fields.append(AxisObj(name=trans('i18n_data_training.problem_description'), value='question')) fields.append(AxisObj(name=trans('i18n_data_training.sample_sql'), value='description')) fields.append(AxisObj(name=trans('i18n_data_training.effective_data_sources'), value='datasource_name')) - if current_user.oid == 1: - fields.append( - AxisObj(name=trans('i18n_data_training.advanced_application'), value='advanced_application_name')) + fields.append( + AxisObj(name=trans('i18n_data_training.advanced_application'), value='advanced_application_name')) fields.append(AxisObj(name=trans('i18n_data_training.error_info'), value='errors')) md_data, _fields_list = DataFormat.convert_object_array_for_pandas(fields, data_list) diff --git a/backend/apps/data_training/curd/data_training.py b/backend/apps/data_training/curd/data_training.py index 20ea3fb65..07cee6bfe 100644 --- a/backend/apps/data_training/curd/data_training.py +++ b/backend/apps/data_training/curd/data_training.py @@ -162,10 +162,7 @@ def create_training(session: SessionDep, info: DataTrainingInfo, oid: int, trans # 检查数据源和高级应用不能同时为空 if info.datasource is None and info.advanced_application is None: - if oid == 1: - raise Exception(trans("i18n_data_training.datasource_assistant_cannot_be_none")) - else: - raise Exception(trans("i18n_data_training.datasource_cannot_be_none")) + raise Exception(trans("i18n_data_training.datasource_assistant_cannot_be_none")) # 检查重复记录 stmt = select(DataTraining.id).where( @@ -221,10 +218,7 @@ def update_training(session: SessionDep, info: DataTrainingInfo, oid: int, trans raise Exception(trans("i18n_data_training.description_cannot_be_empty")) if info.datasource is None and info.advanced_application is None: - if oid == 1: - raise Exception(trans("i18n_data_training.datasource_assistant_cannot_be_none")) - else: - raise Exception(trans("i18n_data_training.datasource_cannot_be_none")) + raise Exception(trans("i18n_data_training.datasource_assistant_cannot_be_none")) count = session.query(DataTraining).filter( DataTraining.id == info.id @@ -310,11 +304,11 @@ def batch_create_training(session: SessionDep, info_list: List[DataTrainingInfo] datasource_name_to_id[ds.name.strip()] = ds.id assistant_name_to_id = {} - if oid == 1: - assistant_stmt = select(AssistantModel.id, AssistantModel.name).where(AssistantModel.type == 1) - assistant_result = session.execute(assistant_stmt).all() - for assistant in assistant_result: - assistant_name_to_id[assistant.name.strip()] = assistant.id + + assistant_stmt = select(AssistantModel.id, AssistantModel.name).where(and_(AssistantModel.type == 1, AssistantModel.oid == oid)) + assistant_result = session.execute(assistant_stmt).all() + for assistant in assistant_result: + assistant_name_to_id[assistant.name.strip()] = assistant.id # 验证和转换数据 valid_records = [] @@ -338,7 +332,7 @@ def batch_create_training(session: SessionDep, info_list: List[DataTrainingInfo] # 高级应用验证和转换 advanced_application_id = None - if oid == 1 and info.advanced_application_name and info.advanced_application_name.strip(): + if info.advanced_application_name and info.advanced_application_name.strip(): if info.advanced_application_name.strip() in assistant_name_to_id: advanced_application_id = assistant_name_to_id[info.advanced_application_name.strip()] else: @@ -346,12 +340,8 @@ def batch_create_training(session: SessionDep, info_list: List[DataTrainingInfo] trans("i18n_data_training.advanced_application_not_found").format(info.advanced_application_name)) # 检查数据源和高级应用不能同时为空 - if oid == 1: - if not datasource_id and not advanced_application_id: - error_messages.append(trans("i18n_data_training.datasource_assistant_cannot_be_none")) - else: - if not datasource_id: - error_messages.append(trans("i18n_data_training.datasource_cannot_be_none")) + if not datasource_id and not advanced_application_id: + error_messages.append(trans("i18n_data_training.datasource_assistant_cannot_be_none")) if error_messages: failed_records.append({ @@ -610,15 +600,15 @@ def to_xml_string(_dict: list[dict] | dict, root: str = 'sql-examples') -> str: def get_training_template(session: SessionDep, question: str, oid: Optional[int] = 1, datasource: Optional[int] = None, - advanced_application_id: Optional[int] = None) -> str: + advanced_application_id: Optional[int] = None) -> tuple[str, list[dict]]: if not oid: oid = 1 if not datasource and not advanced_application_id: - return '' + return '', [] _results = select_training_by_question(session, question, oid, datasource, advanced_application_id) if _results and len(_results) > 0: data_training = to_xml_string(_results) template = get_base_data_training_template().format(data_training=data_training) - return template + return template, _results else: - return '' + return '', [] diff --git a/backend/apps/datasource/api/datasource.py b/backend/apps/datasource/api/datasource.py index e05306f49..90801fdf2 100644 --- a/backend/apps/datasource/api/datasource.py +++ b/backend/apps/datasource/api/datasource.py @@ -4,41 +4,42 @@ import os import traceback import uuid +import re from io import StringIO from typing import List from urllib.parse import quote -import orjson import pandas as pd from fastapi import APIRouter, File, UploadFile, HTTPException, Path from fastapi.responses import StreamingResponse +from psycopg2 import sql from sqlalchemy import and_ from apps.db.db import get_schema from apps.db.engine import get_engine_conn from apps.swagger.i18n import PLACEHOLDER_PREFIX from apps.system.schemas.permission import SqlbotPermission, require_permissions +from common.audit.models.log_model import OperationType, OperationModules +from common.audit.schemas.logger_decorator import LogConfig, system_log from common.core.config import settings from common.core.deps import SessionDep, CurrentUser, Trans from common.utils.utils import SQLBotLogUtil from ..crud.datasource import get_datasource_list, check_status, create_ds, update_ds, delete_ds, getTables, getFields, \ - execSql, update_table_and_fields, getTablesByDs, chooseTables, preview, updateTable, updateField, get_ds, fieldEnum, \ + update_table_and_fields, getTablesByDs, chooseTables, preview, updateTable, updateField, get_ds, fieldEnum, \ check_status_by_id, sync_single_fields from ..crud.field import get_fields_by_table_id from ..crud.table import get_tables_by_ds_id from ..models.datasource import CoreDatasource, CreateDatasource, TableObj, CoreTable, CoreField, FieldObj, \ - TableSchemaResponse, ColumnSchemaResponse, PreviewResponse -from common.audit.models.log_model import OperationType, OperationModules -from common.audit.schemas.logger_decorator import LogConfig, system_log + TableSchemaResponse, ColumnSchemaResponse, PreviewResponse, ImportRequest +from ..utils.excel import parse_excel_preview, USER_TYPE_TO_PANDAS router = APIRouter(tags=["Datasource"], prefix="/datasource") path = settings.EXCEL_PATH @router.get("/ws/{oid}", include_in_schema=False) +@require_permissions(permission=SqlbotPermission(role=['ws_admin'])) async def query_by_oid(session: SessionDep, user: CurrentUser, oid: int) -> List[CoreDatasource]: - if not user.isAdmin: - raise Exception("no permission to execute") return get_datasource_list(session=session, user=user, oid=oid) @@ -64,6 +65,7 @@ def inner(): @router.get("/check/{ds_id}", response_model=bool, summary=f"{PLACEHOLDER_PREFIX}ds_check") +@require_permissions(permission=SqlbotPermission(type='ds', keyExpression="ds_id")) async def check_by_id(session: SessionDep, trans: Trans, ds_id: int = Path(..., description=f"{PLACEHOLDER_PREFIX}ds_id")): def inner(): @@ -76,14 +78,11 @@ def inner(): @system_log(LogConfig(operation_type=OperationType.CREATE, module=OperationModules.DATASOURCE, result_id_expr="id")) @require_permissions(permission=SqlbotPermission(role=['ws_admin'])) async def add(session: SessionDep, trans: Trans, user: CurrentUser, ds: CreateDatasource): - def inner(): - return create_ds(session, trans, user, ds) - - return await asyncio.to_thread(inner) + return await create_ds(session, trans, user, ds) @router.post("/chooseTables/{id}", response_model=None, summary=f"{PLACEHOLDER_PREFIX}ds_choose_tables") -@require_permissions(permission=SqlbotPermission(role=['ws_admin'], permission=SqlbotPermission(type='ds', keyExpression="id"))) +@require_permissions(permission=SqlbotPermission(role=['ws_admin'], type='ds', keyExpression="id")) async def choose_tables(session: SessionDep, trans: Trans, tables: List[CoreTable], id: int = Path(..., description=f"{PLACEHOLDER_PREFIX}ds_id")): def inner(): @@ -93,7 +92,7 @@ def inner(): @router.post("/update", response_model=CoreDatasource, summary=f"{PLACEHOLDER_PREFIX}ds_update") -@require_permissions(permission=SqlbotPermission(role=['ws_admin'], permission=SqlbotPermission(type='ds', keyExpression="ds.id"))) +@require_permissions(permission=SqlbotPermission(role=['ws_admin'], type='ds', keyExpression="ds.id")) @system_log( LogConfig(operation_type=OperationType.UPDATE, module=OperationModules.DATASOURCE, resource_id_expr="ds.id")) async def update(session: SessionDep, trans: Trans, user: CurrentUser, ds: CoreDatasource): @@ -108,7 +107,7 @@ def inner(): @system_log(LogConfig(operation_type=OperationType.DELETE, module=OperationModules.DATASOURCE, resource_id_expr="id", )) async def delete(session: SessionDep, id: int = Path(..., description=f"{PLACEHOLDER_PREFIX}ds_id"), name: str = None): - return delete_ds(session, id) + return await delete_ds(session, id) @router.post("/getTables/{id}", response_model=List[TableSchemaResponse], summary=f"{PLACEHOLDER_PREFIX}ds_get_tables") @@ -165,6 +164,7 @@ async def get_fields(session: SessionDep, @router.post("/syncFields/{id}", response_model=None, summary=f"{PLACEHOLDER_PREFIX}ds_sync_fields") +@require_permissions(permission=SqlbotPermission(role=['ws_admin'])) async def sync_fields(session: SessionDep, trans: Trans, id: int = Path(..., description=f"{PLACEHOLDER_PREFIX}ds_table_id")): return sync_single_fields(session, trans, id) @@ -226,6 +226,7 @@ async def edit_field(session: SessionDep, field: CoreField): @router.post("/previewData/{id}", response_model=PreviewResponse, summary=f"{PLACEHOLDER_PREFIX}ds_preview_data") +@require_permissions(permission=SqlbotPermission(type='ds', keyExpression="id")) async def preview_data(session: SessionDep, trans: Trans, current_user: CurrentUser, data: TableObj, id: int = Path(..., description=f"{PLACEHOLDER_PREFIX}ds_id")): def inner(): @@ -243,8 +244,9 @@ def inner(): # not used -@router.post("/fieldEnum/{id}", include_in_schema=False) -async def field_enum(session: SessionDep, id: int): +@router.post("/fieldEnum/{ds_id}/{id}", include_in_schema=False) +@require_permissions(permission=SqlbotPermission(type='ds', keyExpression="ds_id")) +async def field_enum(session: SessionDep, ds_id: int, id: int): def inner(): return fieldEnum(session, id) @@ -315,7 +317,9 @@ def inner(): # return await asyncio.to_thread(inner) +# deprecated @router.post("/uploadExcel", response_model=None, summary=f"{PLACEHOLDER_PREFIX}ds_upload_excel") +@require_permissions(permission=SqlbotPermission(role=['ws_admin'])) async def upload_excel(session: SessionDep, file: UploadFile = File(..., description=f"{PLACEHOLDER_PREFIX}ds_excel")): ALLOWED_EXTENSIONS = {"xlsx", "xls", "csv"} if not file.filename.lower().endswith(tuple(ALLOWED_EXTENSIONS)): @@ -372,10 +376,10 @@ def insert_pg(df, tableName, engine): # output.seek(0) # pg copy - cursor.copy_expert( - sql=f"""COPY "{tableName}" FROM STDIN WITH CSV DELIMITER E'\t'""", - file=output + query = sql.SQL("COPY {} FROM STDIN WITH CSV DELIMITER E'\t'").format( + sql.Identifier(tableName) ) + cursor.copy_expert(sql=query.as_string(cursor.connection), file=output) conn.commit() except Exception as e: traceback.print_exc() @@ -394,6 +398,7 @@ def insert_pg(df, tableName, engine): @router.get("/exportDsSchema/{id}", response_model=None, summary=f"{PLACEHOLDER_PREFIX}ds_export_ds_schema") +@require_permissions(permission=SqlbotPermission(role=['ws_admin'], type='ds', keyExpression="id")) async def export_ds_schema(session: SessionDep, id: int = Path(..., description=f"{PLACEHOLDER_PREFIX}ds_id")): # { # 'sheet':'', sheet name @@ -468,6 +473,7 @@ def inner(): @router.post("/uploadDsSchema/{id}", response_model=None, summary=f"{PLACEHOLDER_PREFIX}ds_upload_ds_schema") +@require_permissions(permission=SqlbotPermission(role=['ws_admin'], type='ds', keyExpression="id")) async def upload_ds_schema(session: SessionDep, id: int = Path(..., description=f"{PLACEHOLDER_PREFIX}ds_id"), file: UploadFile = File(...)): ALLOWED_EXTENSIONS = {"xlsx", "xls"} @@ -526,3 +532,97 @@ async def upload_ds_schema(session: SessionDep, id: int = Path(..., description= return True except Exception as e: raise HTTPException(status_code=500, detail=f"Parse Excel Failed: {str(e)}") + + +@router.post("/parseExcel", response_model=None, summary=f"{PLACEHOLDER_PREFIX}ds_parse_excel") +@require_permissions(permission=SqlbotPermission(role=['ws_admin'])) +async def parse_excel(file: UploadFile = File(..., description=f"{PLACEHOLDER_PREFIX}ds_excel")): + ALLOWED_EXTENSIONS = {".xlsx", ".xls", ".csv"} + if not file.filename.lower().endswith(tuple(ALLOWED_EXTENSIONS)): + raise HTTPException(400, "Only support .xlsx/.xls/.csv") + + os.makedirs(path, exist_ok=True) + filename = f"{file.filename.split('.')[0].split('/')[-1]}_{hashlib.sha256(uuid.uuid4().bytes).hexdigest()[:10]}.{file.filename.split('.')[-1]}" + save_path = os.path.join(path, filename) + with open(save_path, "wb") as f: + f.write(await file.read()) + + def inner(): + sheets_data = parse_excel_preview(save_path) + return { + "filePath": filename, + "data": sheets_data + } + + return await asyncio.to_thread(inner) + + +@router.post("/importToDb", response_model=None, summary=f"{PLACEHOLDER_PREFIX}ds_import_to_db") +@require_permissions(permission=SqlbotPermission(role=['ws_admin'])) +async def import_to_db(session: SessionDep, trans: Trans, import_req: ImportRequest): + save_path = os.path.join(path, import_req.filePath) + if not os.path.exists(save_path): + raise HTTPException(400, "File not found") + + def inner(): + engine = get_engine_conn() + results = [] + + for sheet_info in import_req.sheets: + sheet_name = sheet_info.sheetName + table_name = f"excel_{filter_string(sheet_name)}_{hashlib.sha256(uuid.uuid4().bytes).hexdigest()[:10]}" + fields = sheet_info.fields + + field_mapping = {f.fieldName: f.fieldType for f in fields} + dtype_dict = { + col: USER_TYPE_TO_PANDAS.get(field_mapping.get(col, 'string'), 'string') + for col in field_mapping.keys() + } + + try: + if save_path.endswith(".csv"): + df = pd.read_csv(save_path, engine='c', dtype=dtype_dict) + sheet_name = "Sheet1" + else: + df = pd.read_excel(save_path, sheet_name=sheet_name, engine='calamine', dtype=dtype_dict) + except Exception as e: + raise HTTPException(500, f"{trans('i18n_ds_upload_error')}: {str(e)}") + + conn = engine.raw_connection() + cursor = conn.cursor() + try: + df.to_sql( + table_name, + engine, + if_exists='replace', + index=False + ) + output = StringIO() + df.to_csv(output, sep='\t', header=False, index=False) + + query = sql.SQL("COPY {} FROM STDIN WITH CSV DELIMITER E'\t'").format( + sql.Identifier(table_name) + ) + cursor.copy_expert(sql=query.as_string(cursor.connection), file=output) + conn.commit() + results.append({ + "sheetName": sheet_name, + "tableName": table_name, + "tableComment": "", + "rows": len(df) + }) + except Exception as e: + raise HTTPException(500, f"Insert data failed for {table_name}: {str(e)}") + finally: + cursor.close() + conn.close() + + return {"filename": import_req.filePath, "sheets": results} + + return await asyncio.to_thread(inner) + + +# only allow chinese, a-z, A-Z, 0-9 +def filter_string(text): + pattern = r'[^\u4e00-\u9fa5a-zA-Z0-9]' + return re.sub(pattern, '', text) diff --git a/backend/apps/datasource/crud/datasource.py b/backend/apps/datasource/crud/datasource.py index 795add8d1..acd7522e5 100644 --- a/backend/apps/datasource/crud/datasource.py +++ b/backend/apps/datasource/crud/datasource.py @@ -13,10 +13,12 @@ from apps.db.constant import DB from apps.db.db import get_tables, get_fields, exec_sql, check_connection from apps.db.engine import get_engine_config, get_engine_conn +from apps.system.schemas.auth import CacheName, CacheNamespace from common.core.config import settings from common.core.deps import SessionDep, CurrentUser, Trans from common.utils.embedding_threads import run_save_table_embeddings, run_save_ds_embeddings -from common.utils.utils import deepcopy_ignore_extra +from common.utils.utils import SQLBotLogUtil, deepcopy_ignore_extra, equals_ignore_case +from common.core.sqlbot_cache import cache, clear_cache from .table import get_tables_by_ds_id from ..crud.field import delete_field_by_ds_id, update_field from ..crud.table import delete_table_by_ds_id, update_table @@ -29,7 +31,7 @@ def get_datasource_list(session: SessionDep, user: CurrentUser, oid: Optional[in if user.isAdmin and oid: current_oid = oid return session.exec( - select(CoreDatasource).where(CoreDatasource.oid == current_oid).order_by(CoreDatasource.name)).all() + select(CoreDatasource).where(CoreDatasource.oid == int(current_oid)).order_by(CoreDatasource.name)).all() def get_ds(session: SessionDep, id: int): @@ -64,7 +66,8 @@ def check_name(session: SessionDep, trans: Trans, user: CurrentUser, ds: CoreDat raise HTTPException(status_code=500, detail=trans('i18n_ds_name_exist')) -def create_ds(session: SessionDep, trans: Trans, user: CurrentUser, create_ds: CreateDatasource): +@clear_cache(namespace=CacheNamespace.AUTH_INFO, cacheName=CacheName.DS_ID_LIST, keyExpression="user.oid") +async def create_ds(session: SessionDep, trans: Trans, user: CurrentUser, create_ds: CreateDatasource): ds = CoreDatasource() deepcopy_ignore_extra(create_ds, ds) check_name(session, trans, user, ds) @@ -117,7 +120,7 @@ def update_ds_recommended_config(session: SessionDep, datasource_id: int, recomm session.commit() -def delete_ds(session: SessionDep, id: int): +async def delete_ds(session: SessionDep, id: int): term = session.exec(select(CoreDatasource).where(CoreDatasource.id == id)).first() if term.type == "excel": # drop all tables for current datasource @@ -132,6 +135,8 @@ def delete_ds(session: SessionDep, id: int): session.commit() delete_table_by_ds_id(session, id) delete_field_by_ds_id(session, id) + if term: + await clear_ws_ds_cache(term.oid) return { "message": f"Datasource with ID {id} deleted successfully." } @@ -323,18 +328,19 @@ def preview(session: SessionDep, current_user: CurrentUser, id: int, data: Table if fields is None or len(fields) == 0: return {"fields": [], "data": [], "sql": ''} + table = session.query(CoreTable).filter(CoreTable.id == data.table.id).first() conf = DatasourceConf(**json.loads(aes_decrypt(ds.configuration))) if ds.type != "excel" else get_engine_config() sql: str = "" - if ds.type == "mysql" or ds.type == "doris" or ds.type == "starrocks": - sql = f"""SELECT `{"`, `".join(fields)}` FROM `{data.table.table_name}` + if ds.type == "mysql" or ds.type == "doris" or ds.type == "starrocks" or ds.type == "hive": + sql = f"""SELECT `{"`, `".join(fields)}` FROM `{table.table_name}` {where} LIMIT 100""" elif ds.type == "sqlServer": - sql = f"""SELECT TOP 100 [{"], [".join(fields)}] FROM [{conf.dbSchema}].[{data.table.table_name}] + sql = f"""SELECT TOP 100 [{"], [".join(fields)}] FROM [{conf.dbSchema}].[{table.table_name}] {where} """ elif ds.type == "pg" or ds.type == "excel" or ds.type == "redshift" or ds.type == "kingbase": - sql = f"""SELECT "{'", "'.join(fields)}" FROM "{conf.dbSchema}"."{data.table.table_name}" + sql = f"""SELECT "{'", "'.join(fields)}" FROM "{conf.dbSchema}"."{table.table_name}" {where} LIMIT 100""" elif ds.type == "oracle": @@ -343,22 +349,22 @@ def preview(session: SessionDep, current_user: CurrentUser, id: int, data: Table # ORDER BY "{fields[0]}" # OFFSET 0 ROWS FETCH NEXT 100 ROWS ONLY""" sql = f"""SELECT * FROM - (SELECT "{'", "'.join(fields)}" FROM "{conf.dbSchema}"."{data.table.table_name}" + (SELECT "{'", "'.join(fields)}" FROM "{conf.dbSchema}"."{table.table_name}" {where} ORDER BY "{fields[0]}") WHERE ROWNUM <= 100 """ elif ds.type == "ck": - sql = f"""SELECT "{'", "'.join(fields)}" FROM "{data.table.table_name}" + sql = f"""SELECT "{'", "'.join(fields)}" FROM "{table.table_name}" {where} LIMIT 100""" elif ds.type == "dm": - sql = f"""SELECT "{'", "'.join(fields)}" FROM "{conf.dbSchema}"."{data.table.table_name}" - {where} + sql = f"""SELECT "{'", "'.join(fields)}" FROM "{conf.dbSchema}"."{table.table_name}" + {where} LIMIT 100""" elif ds.type == "es": - sql = f"""SELECT "{'", "'.join(fields)}" FROM "{data.table.table_name}" - {where} + sql = f"""SELECT "{'", "'.join(fields)}" FROM "{table.table_name}" + {where} LIMIT 100""" return exec_sql(ds, sql, True) @@ -396,7 +402,9 @@ def updateNum(session: SessionDep, ds: CoreDatasource): def get_table_obj_by_ds(session: SessionDep, current_user: CurrentUser, ds: CoreDatasource) -> List[TableAndFields]: _list: List = [] - tables = session.query(CoreTable).filter(CoreTable.ds_id == ds.id).all() + tables = session.query(CoreTable).filter( + and_(CoreTable.ds_id == ds.id, CoreTable.checked == True) + ).all() conf = DatasourceConf(**json.loads(aes_decrypt(ds.configuration))) if ds.type != "excel" else get_engine_config() schema = conf.dbSchema if conf.dbSchema is not None and conf.dbSchema != "" else conf.database @@ -424,19 +432,98 @@ def get_table_obj_by_ds(session: SessionDep, current_user: CurrentUser, ds: Core return _list +def get_table_sample_data(ds: CoreDatasource, table_name: str, fields: list) -> str: + """Get 3 sample rows from a table in JSON format to help AI understand the data""" + if not fields: + return "" + + db = DB.get_db(ds.type) + # Get prefix/suffix for identifier quoting + prefix = db.prefix if hasattr(db, 'prefix') else '"' + suffix = db.suffix if hasattr(db, 'suffix') else '"' + + # Build field list with proper quoting + field_names = [] + for field in fields[:10]: # Limit to first 10 fields to avoid too wide results + field_name = f"{prefix}{field.field_name}{suffix}" + field_names.append(field_name) + + # Build LIMIT query based on database type + if equals_ignore_case(ds.type, "sqlServer"): + query = f"SELECT TOP 3 {','.join(field_names)} FROM {prefix}{table_name}{suffix}" + elif equals_ignore_case(ds.type, "ck"): + query = f"SELECT {','.join(field_names)} FROM {table_name} LIMIT 3" + elif equals_ignore_case(ds.type, "hive"): + query = f"SELECT {','.join(field_names)} FROM {table_name} LIMIT 3" + elif equals_ignore_case(ds.type, "oracle"): + query = f"SELECT {','.join(field_names)} FROM \"{table_name}\" WHERE ROWNUM <= 3" + elif equals_ignore_case(ds.type, "dm"): + query = f"SELECT {','.join(field_names)} FROM \"{table_name}\" WHERE ROWNUM <= 3" + else: + query = f"SELECT {','.join(field_names)} FROM {prefix}{table_name}{suffix} LIMIT 3" + + try: + result = exec_sql(ds=ds, sql=query, origin_column=True) + if result and result.get('data') and len(result['data']) > 0: + import json + # Truncate long string values for readability + json_rows = [] + for row in result['data'][:3]: + truncated_row = {} + for key, value in row.items(): + if value is None: + truncated_row[key] = None + elif isinstance(value, str): + # Truncate long strings + if len(value) > 100: + value = value[:100] + '...' + truncated_row[key] = value.replace('\n', ' ').replace('\r', ' ') + else: + truncated_row[key] = value + json_rows.append(truncated_row) + return json.dumps(json_rows, ensure_ascii=False, indent=2) + except Exception: + pass + return "" + + +def get_tables_sample_data(session: SessionDep, current_user: CurrentUser, ds: CoreDatasource, + table_list: list[str] = None) -> str: + """Get sample data (3 rows) for all tables to help AI understand the data""" + table_objs = get_table_obj_by_ds(session=session, current_user=current_user, ds=ds) + if len(table_objs) == 0: + return "" + + sample_data_parts = [] + for obj in table_objs: + if table_list is not None and obj.table.table_name not in table_list: + continue + if obj.fields: + sample = get_table_sample_data(ds, obj.table.table_name, obj.fields) + if sample: + sample_data_parts.append(f"# Table: {obj.table.table_name}\n{sample}") + return "\n".join(sample_data_parts) + + def get_table_schema(session: SessionDep, current_user: CurrentUser, ds: CoreDatasource, question: str, - embedding: bool = True) -> str: + embedding: bool = True, table_list: list[str] = None) -> tuple[str, list]: schema_str = "" table_objs = get_table_obj_by_ds(session=session, current_user=current_user, ds=ds) if len(table_objs) == 0: - return schema_str + return schema_str, [] db_name = table_objs[0].schema schema_str += f"【DB_ID】 {db_name}\n【Schema】\n" tables = [] all_tables = [] # temp save all tables + table_name_list = [] for obj in table_objs: + # 如果传入了table_list,则只处理在列表中的表 + if table_list is not None and obj.table.table_name not in table_list: + continue + schema_table = '' - schema_table += f"# Table: {db_name}.{obj.table.table_name}" if ds.type != "mysql" and ds.type != "es" else f"# Table: {obj.table.table_name}" + no_schema_types = ["mysql", "es", "sqlite", "hive", "doris", "starrocks"] + schema_table += f"# Table: {db_name}.{obj.table.table_name}" if ds.type not in no_schema_types and db_name else f"# Table: {obj.table.table_name}" table_comment = '' if obj.table.custom_comment: table_comment = obj.table.custom_comment.strip() @@ -458,10 +545,15 @@ def get_table_schema(session: SessionDep, current_user: CurrentUser, ds: CoreDat schema_table += ",\n".join(field_list) schema_table += '\n]\n' - t_obj = {"id": obj.table.id, "schema_table": schema_table, "embedding": obj.table.embedding} + t_obj = {"id": obj.table.id, "table_name": obj.table.table_name, "schema_table": schema_table, + "embedding": obj.table.embedding} tables.append(t_obj) all_tables.append(t_obj) + # 如果没有符合过滤条件的表,直接返回 + if not tables: + return schema_str, [] + # do table embedding if embedding and tables and settings.TABLE_EMBEDDING_ENABLED: tables = calc_table_embedding(tables, question) @@ -469,6 +561,7 @@ def get_table_schema(session: SessionDep, current_user: CurrentUser, ds: CoreDat if tables: for s in tables: schema_str += s.get('schema_table') + table_name_list.append(s.get('table_name')) # field relation if tables and ds.table_relation: @@ -500,6 +593,7 @@ def get_table_schema(session: SessionDep, current_user: CurrentUser, ds: CoreDat if lost_tables: for s in lost_tables: schema_str += s.get('schema_table') + table_name_list.append(s.get('table_name')) # get field dict relation_field_ids = [] @@ -517,4 +611,16 @@ def get_table_schema(session: SessionDep, current_user: CurrentUser, ds: CoreDat for ele in all_relations: schema_str += f"{table_dict.get(int(ele.get('source').get('cell')))}.{field_dict.get(int(ele.get('source').get('port')))}={table_dict.get(int(ele.get('target').get('cell')))}.{field_dict.get(int(ele.get('target').get('port')))}\n" - return schema_str + return schema_str, table_name_list + + +@cache(namespace=CacheNamespace.AUTH_INFO, cacheName=CacheName.DS_ID_LIST, keyExpression="oid") +async def get_ws_ds(session, oid) -> list: + stmt = select(CoreDatasource.id).distinct().where(CoreDatasource.oid == oid) + db_list = session.exec(stmt).all() + return db_list + + +@clear_cache(namespace=CacheNamespace.AUTH_INFO, cacheName=CacheName.DS_ID_LIST, keyExpression="oid") +async def clear_ws_ds_cache(oid): + SQLBotLogUtil.info(f"ds cache for ws [{oid}] has been cleaned") diff --git a/backend/apps/datasource/crud/permission.py b/backend/apps/datasource/crud/permission.py index 870718121..dfa56c75f 100644 --- a/backend/apps/datasource/crud/permission.py +++ b/backend/apps/datasource/crud/permission.py @@ -1,7 +1,7 @@ import json from typing import List, Optional -from sqlalchemy import and_ +from sqlalchemy import and_, cast, or_ from sqlbot_xpack.permissions.api.permission import transRecord2DTO from sqlbot_xpack.permissions.models.ds_permission import DsPermission, PermissionDTO from sqlbot_xpack.permissions.models.ds_rules import DsRules @@ -9,6 +9,7 @@ from apps.datasource.crud.row_permission import transFilterTree from apps.datasource.models.datasource import CoreDatasource, CoreField, CoreTable from common.core.deps import CurrentUser, SessionDep +from sqlalchemy.dialects.postgresql import JSONB def get_row_permission_filters(session: SessionDep, current_user: CurrentUser, ds: CoreDatasource, @@ -22,7 +23,7 @@ def get_row_permission_filters(session: SessionDep, current_user: CurrentUser, d filters = [] if is_normal_user(current_user): - contain_rules = session.query(DsRules).all() + # contain_rules = session.query(DsRules).all() for table in table_list: row_permissions = session.query(DsPermission).filter( and_(DsPermission.table_id == table.id, DsPermission.type == 'row')).all() @@ -30,18 +31,27 @@ def get_row_permission_filters(session: SessionDep, current_user: CurrentUser, d if row_permissions is not None: for permission in row_permissions: # check permission and user in same rules - flag = False - for r in contain_rules: - p_list = json.loads(r.permission_list) - u_list = json.loads(r.user_list) - if p_list is not None and u_list is not None and permission.id in p_list and ( - current_user.id in u_list or f'{current_user.id}' in u_list): - flag = True - break - if flag: + obj = session.query(DsRules).filter( + and_(DsRules.permission_list.op('@>')(cast([permission.id], JSONB)), + or_(DsRules.user_list.op('@>')(cast([f'{current_user.id}'], JSONB)), + DsRules.user_list.op('@>')(cast([current_user.id], JSONB)))) + ).first() + if obj is not None: res.append(transRecord2DTO(session, permission)) - where_str = transFilterTree(session, res, ds) - filters.append({"table": table.table_name, "filter": where_str}) + + # flag = False + # for r in contain_rules: + # p_list = json.loads(r.permission_list) + # u_list = json.loads(r.user_list) + # if p_list is not None and u_list is not None and permission.id in p_list and ( + # current_user.id in u_list or f'{current_user.id}' in u_list): + # flag = True + # break + # if flag: + # res.append(transRecord2DTO(session, permission)) + where_str = transFilterTree(session, current_user, res, ds) + if where_str: + filters.append({"table": table.table_name, "filter": where_str}) return filters @@ -53,22 +63,26 @@ def get_column_permission_fields(session: SessionDep, current_user: CurrentUser, if column_permissions is not None: for permission in column_permissions: # check permission and user in same rules - # obj = session.query(DsRules).filter( - # and_(DsRules.permission_list.op('@>')(cast([permission.id], JSONB)), - # or_(DsRules.user_list.op('@>')(cast([f'{current_user.id}'], JSONB)), - # DsRules.user_list.op('@>')(cast([current_user.id], JSONB)))) - # ).first() - flag = False - for r in contain_rules: - p_list = json.loads(r.permission_list) - u_list = json.loads(r.user_list) - if p_list is not None and u_list is not None and permission.id in p_list and ( - current_user.id in u_list or f'{current_user.id}' in u_list): - flag = True - break - if flag: + obj = session.query(DsRules).filter( + and_(DsRules.permission_list.op('@>')(cast([permission.id], JSONB)), + or_(DsRules.user_list.op('@>')(cast([f'{current_user.id}'], JSONB)), + DsRules.user_list.op('@>')(cast([current_user.id], JSONB)))) + ).first() + if obj is not None: permission_list = json.loads(permission.permissions) fields = filter_list(fields, permission_list) + + # flag = False + # for r in contain_rules: + # p_list = json.loads(r.permission_list) + # u_list = json.loads(r.user_list) + # if p_list is not None and u_list is not None and permission.id in p_list and ( + # current_user.id in u_list or f'{current_user.id}' in u_list): + # flag = True + # break + # if flag: + # permission_list = json.loads(permission.permissions) + # fields = filter_list(fields, permission_list) return fields diff --git a/backend/apps/datasource/crud/row_permission.py b/backend/apps/datasource/crud/row_permission.py index 16f97971c..b19063af5 100644 --- a/backend/apps/datasource/crud/row_permission.py +++ b/backend/apps/datasource/crud/row_permission.py @@ -2,12 +2,30 @@ # Date: 2025/6/25 from typing import List, Dict + from apps.datasource.models.datasource import CoreField, CoreDatasource from apps.db.constant import DB -from common.core.deps import SessionDep +from apps.system.models.system_variable_model import SystemVariable +from common.core.deps import SessionDep, CurrentUser + + +def _escape_sql_value(value: str) -> str: + """Escape a string value for safe inclusion in a SQL literal. + Replaces single quotes with two single quotes (standard SQL escaping) + and strips characters that could break out of the string context. + """ + if value is None: + return value + # Standard SQL escaping: double any embedded single-quote characters + escaped = str(value).replace("'", "''") + # Remove backslashes that some drivers interpret as escape characters + escaped = escaped.replace("\\", "\\\\") + return escaped -def transFilterTree(session: SessionDep, tree_list: List[any], ds: CoreDatasource) -> str | None: + +def transFilterTree(session: SessionDep, current_user: CurrentUser, tree_list: List[any], + ds: CoreDatasource) -> str | None: if tree_list is None: return None res: List[str] = [] @@ -15,16 +33,22 @@ def transFilterTree(session: SessionDep, tree_list: List[any], ds: CoreDatasourc tree = dto.tree if tree is None: continue - tree_exp = transTreeToWhere(session, tree, ds) + tree_exp = transTreeToWhere(session, current_user, tree, ds) if tree_exp is not None: res.append(tree_exp) return " AND ".join(res) -def transTreeToWhere(session: SessionDep, tree: any, ds: CoreDatasource) -> str | None: +_VALID_LOGIC_OPS = {"AND", "OR"} + + +def transTreeToWhere(session: SessionDep, current_user: CurrentUser, tree: any, ds: CoreDatasource) -> str | None: if tree is None: return None logic = tree['logic'] + # Validate the logic operator to prevent injection via this field + if logic.upper() not in _VALID_LOGIC_OPS: + return None items = tree['items'] list: List[str] = [] @@ -32,16 +56,16 @@ def transTreeToWhere(session: SessionDep, tree: any, ds: CoreDatasource) -> str for item in items: exp: str = None if item['type'] == 'item': - exp = transTreeItem(session, item, ds) + exp = transTreeItem(session, current_user, item, ds) elif item['type'] == 'tree': - exp = transTreeToWhere(session, item['sub_tree'], ds) + exp = transTreeToWhere(session, current_user, item['sub_tree'], ds) if exp is not None: list.append(exp) return '(' + f' {logic} '.join(list) + ')' if len(list) > 0 else None -def transTreeItem(session: SessionDep, item: Dict, ds: CoreDatasource) -> str | None: +def transTreeItem(session: SessionDep, current_user: CurrentUser, item: Dict, ds: CoreDatasource) -> str | None: res: str = None field = session.query(CoreField).filter(CoreField.id == int(item['field_id'])).first() if field is None: @@ -49,46 +73,133 @@ def transTreeItem(session: SessionDep, item: Dict, ds: CoreDatasource) -> str | db = DB.get_db(ds.type) whereName = db.prefix + field.field_name + db.suffix + whereTerm = transFilterTerm(item['term']) + if item['filter_type'] == 'enum': if len(item['enum_value']) > 0: + escaped_values = [_escape_sql_value(v) for v in item['enum_value']] if ds['type'] == 'sqlServer' and ( field.field_type == 'nchar' or field.field_type == 'NCHAR' or field.field_type == 'nvarchar' or field.field_type == 'NVARCHAR'): - res = "(" + whereName + " IN (N'" + "',N'".join(item['enum_value']) + "'))" + res = "(" + whereName + " IN (N'" + "',N'".join(escaped_values) + "'))" else: - res = "(" + whereName + " IN ('" + "','".join(item['enum_value']) + "'))" + res = "(" + whereName + " IN ('" + "','".join(escaped_values) + "'))" else: - value = item['value'] - whereTerm = transFilterTerm(item['term']) - whereValue = '' + # if system variable, do check and get value + # new field: value_type(variable or normal), variable_id + value_type = item.get('value_type') + if value_type and value_type == 'variable': + # get system variable + variable_id = item.get('variable_id') + if variable_id is not None: + sys_variable = session.query(SystemVariable).filter(SystemVariable.id == variable_id).first() + if sys_variable is None: + return None - if item['term'] == 'null': - whereValue = '' - elif item['term'] == 'not_null': - whereValue = '' - elif item['term'] == 'empty': - whereValue = "''" - elif item['term'] == 'not_empty': - whereValue = "''" - elif item['term'] == 'in' or item['term'] == 'not in': - if ds.type == 'sqlServer' and ( - field.field_type == 'nchar' or field.field_type == 'NCHAR' or field.field_type == 'nvarchar' or field.field_type == 'NVARCHAR'): - whereValue = "(N'" + "', N'".join(value.split(",")) + "')" - else: - whereValue = "('" + "', '".join(value.split(",")) + "')" - elif item['term'] == 'like' or item['term'] == 'not like': - if ds.type == 'sqlServer' and ( - field.field_type == 'nchar' or field.field_type == 'NCHAR' or field.field_type == 'nvarchar' or field.field_type == 'NVARCHAR'): - whereValue = f"N'%{value}%'" + # do inner system variable + if sys_variable.type == 'system': + res = whereName + whereTerm + getSysVariableValue(sys_variable, current_user, ds, field, item) + else: + # check user variable + user_variables = current_user.system_variables + if user_variables is None or len(user_variables) == 0 or not userHaveVariable(user_variables, + sys_variable): + return None + else: + # get user variable + u_variable = None + for u in user_variables: + if u.get('variableId') == sys_variable.id: + u_variable = u + break + if u_variable is None: + return None + + # check value + values = u_variable.get('variableValues') + if sys_variable.var_type == 'text': + set_sys = set(sys_variable.value) + values = [x for x in values if x in set_sys] + if values is None or len(values) == 0: + return None + elif sys_variable.var_type == 'number': + if (sys_variable.value[0] is not None and values[0] < sys_variable.value[0]) or ( + sys_variable.value[1] is not None and values[0] > sys_variable.value[1]): + return None + elif sys_variable.var_type == 'datetime': + if (sys_variable.value[0] is not None and values[0] < sys_variable.value[0]) or ( + sys_variable.value[1] is not None and values[0] > sys_variable.value[1]): + return None + + # build exp + whereValue = '' + if item['term'] == 'null': + whereValue = '' + elif item['term'] == 'not_null': + whereValue = '' + elif item['term'] == 'empty': + whereValue = "''" + elif item['term'] == 'not_empty': + whereValue = "''" + elif item['term'] == 'in' or item['term'] == 'not in': + escaped_values = [_escape_sql_value(v) for v in values] + if ds.type == 'sqlServer' and ( + field.field_type == 'nchar' or field.field_type == 'NCHAR' or field.field_type == 'nvarchar' or field.field_type == 'NVARCHAR'): + whereValue = "(N'" + "', N'".join(escaped_values) + "')" + else: + whereValue = "('" + "', '".join(escaped_values) + "')" + elif item['term'] == 'like' or item['term'] == 'not like': + escaped_v = _escape_sql_value(values[0]) + if ds.type == 'sqlServer' and ( + field.field_type == 'nchar' or field.field_type == 'NCHAR' or field.field_type == 'nvarchar' or field.field_type == 'NVARCHAR'): + whereValue = f"N'%{escaped_v}%'" + else: + whereValue = f"'%{escaped_v}%'" + else: + escaped_v = _escape_sql_value(values[0]) + if ds.type == 'sqlServer' and ( + field.field_type == 'nchar' or field.field_type == 'NCHAR' or field.field_type == 'nvarchar' or field.field_type == 'NVARCHAR'): + whereValue = f"N'{escaped_v}'" + else: + whereValue = f"'{escaped_v}'" + + res = whereName + whereTerm + whereValue else: - whereValue = f"'%{value}%'" + return None else: - if ds.type == 'sqlServer' and ( - field.field_type == 'nchar' or field.field_type == 'NCHAR' or field.field_type == 'nvarchar' or field.field_type == 'NVARCHAR'): - whereValue = f"N'{value}'" + value = item['value'] + whereValue = '' + + if item['term'] == 'null': + whereValue = '' + elif item['term'] == 'not_null': + whereValue = '' + elif item['term'] == 'empty': + whereValue = "''" + elif item['term'] == 'not_empty': + whereValue = "''" + elif item['term'] == 'in' or item['term'] == 'not in': + escaped_values = [_escape_sql_value(v) for v in value.split(",")] + if ds.type == 'sqlServer' and ( + field.field_type == 'nchar' or field.field_type == 'NCHAR' or field.field_type == 'nvarchar' or field.field_type == 'NVARCHAR'): + whereValue = "(N'" + "', N'".join(escaped_values) + "')" + else: + whereValue = "('" + "', '".join(escaped_values) + "')" + elif item['term'] == 'like' or item['term'] == 'not like': + escaped_v = _escape_sql_value(value) + if ds.type == 'sqlServer' and ( + field.field_type == 'nchar' or field.field_type == 'NCHAR' or field.field_type == 'nvarchar' or field.field_type == 'NVARCHAR'): + whereValue = f"N'%{escaped_v}%'" + else: + whereValue = f"'%{escaped_v}%'" else: - whereValue = f"'{value}'" + escaped_v = _escape_sql_value(value) + if ds.type == 'sqlServer' and ( + field.field_type == 'nchar' or field.field_type == 'NCHAR' or field.field_type == 'nvarchar' or field.field_type == 'NVARCHAR'): + whereValue = f"N'{escaped_v}'" + else: + whereValue = f"'{escaped_v}'" - res = whereName + whereTerm + whereValue + res = whereName + whereTerm + whereValue return res @@ -124,3 +235,53 @@ def transFilterTerm(term: str) -> str: if term == "between": return " BETWEEN " return "" + + +def userHaveVariable(user_variables: List, sys_variable: SystemVariable): + for u in user_variables: + if sys_variable.id == u.get('variableId'): + return True + return False + + +def getSysVariableValue(sys_variable: SystemVariable, current_user: CurrentUser, ds: CoreDatasource, field: CoreField, + item: Dict, ): + v = None + if sys_variable.value[0] == 'name': + v = current_user.name + if sys_variable.value[0] == 'account': + v = current_user.account + if sys_variable.value[0] == 'email': + v = current_user.email + + escaped_v = _escape_sql_value(v) if v is not None else v + + whereValue = '' + if item['term'] == 'null': + whereValue = '' + elif item['term'] == 'not_null': + whereValue = '' + elif item['term'] == 'empty': + whereValue = "''" + elif item['term'] == 'not_empty': + whereValue = "''" + elif item['term'] == 'in' or item['term'] == 'not in': + if ds.type == 'sqlServer' and ( + field.field_type == 'nchar' or field.field_type == 'NCHAR' or field.field_type == 'nvarchar' or field.field_type == 'NVARCHAR'): + whereValue = f"(N'{escaped_v}')" + else: + whereValue = f"('{escaped_v}')" + elif item['term'] == 'like' or item['term'] == 'not like': + if ds.type == 'sqlServer' and ( + field.field_type == 'nchar' or field.field_type == 'NCHAR' or field.field_type == 'nvarchar' or field.field_type == 'NVARCHAR'): + whereValue = f"N'%{escaped_v}%'" + else: + whereValue = f"'%{escaped_v}%'" + else: + if ds.type == 'sqlServer' and ( + field.field_type == 'nchar' or field.field_type == 'NCHAR' or field.field_type == 'nvarchar' or field.field_type == 'NVARCHAR'): + whereValue = f"N'{escaped_v}'" + else: + whereValue = f"'{escaped_v}'" + + return whereValue diff --git a/backend/apps/datasource/embedding/ds_embedding.py b/backend/apps/datasource/embedding/ds_embedding.py index 19feada2d..f75ee7df5 100644 --- a/backend/apps/datasource/embedding/ds_embedding.py +++ b/backend/apps/datasource/embedding/ds_embedding.py @@ -11,11 +11,11 @@ from apps.system.crud.assistant import AssistantOutDs from common.core.config import settings from common.core.deps import CurrentAssistant -from common.core.deps import SessionDep, CurrentUser +from common.core.deps import SessionDep from common.utils.utils import SQLBotLogUtil -def get_ds_embedding(session: SessionDep, current_user: CurrentUser, _ds_list, out_ds: AssistantOutDs, +def get_ds_embedding(session: SessionDep, _ds_list, out_ds: AssistantOutDs, question: str, current_assistant: Optional[CurrentAssistant] = None): _list = [] @@ -23,7 +23,7 @@ def get_ds_embedding(session: SessionDep, current_user: CurrentUser, _ds_list, o if out_ds.ds_list: for _ds in out_ds.ds_list: ds = out_ds.get_ds(_ds.id) - table_schema = out_ds.get_db_schema(_ds.id, question, embedding=False) + table_schema, tables = out_ds.get_db_schema(_ds.id, question, embedding=False) ds_info = f"{ds.name}, {ds.description}\n" ds_schema = ds_info + table_schema _list.append({"id": ds.id, "ds_schema": ds_schema, "cosine_similarity": 0.0, "ds": ds}) diff --git a/backend/apps/datasource/embedding/table_embedding.py b/backend/apps/datasource/embedding/table_embedding.py index c467ecd8d..186debec4 100644 --- a/backend/apps/datasource/embedding/table_embedding.py +++ b/backend/apps/datasource/embedding/table_embedding.py @@ -45,7 +45,7 @@ def calc_table_embedding(tables: list[dict], question: str): for table in tables: _list.append( {"id": table.get('id'), "schema_table": table.get('schema_table'), "embedding": table.get('embedding'), - "cosine_similarity": 0.0}) + "cosine_similarity": 0.0, "table_name": table.get('table_name')}) if _list: try: @@ -70,7 +70,7 @@ def calc_table_embedding(tables: list[dict], question: str): end_time = time.time() SQLBotLogUtil.info(str(end_time - start_time)) SQLBotLogUtil.info(json.dumps([{"id": ele.get('id'), "schema_table": ele.get('schema_table'), - "cosine_similarity": ele.get('cosine_similarity')} + "cosine_similarity": ele.get('cosine_similarity'), "table_name": ele.get('table_name')} for ele in _list])) return _list except Exception: diff --git a/backend/apps/datasource/models/datasource.py b/backend/apps/datasource/models/datasource.py index ddd37c7f1..42f1dcd25 100644 --- a/backend/apps/datasource/models/datasource.py +++ b/backend/apps/datasource/models/datasource.py @@ -120,6 +120,9 @@ class DatasourceConf(BaseModel): sheets: List = '' mode: str = '' timeout: int = 30 + lowVersion: bool = False + ssl: bool = False + poolSize: int = 5 def to_dict(self): return { @@ -134,12 +137,15 @@ def to_dict(self): "filename": self.filename, "sheets": self.sheets, "mode": self.mode, - "timeout": self.timeout + "timeout": self.timeout, + "lowVersion": self.lowVersion, + "ssl": self.ssl, + "poolSize": self.poolSize } class TableSchema: - def __init__(self, attr1, attr2): + def __init__(self, attr1, attr2=None): self.tableName = attr1 self.tableComment = attr2 if attr2 is None or isinstance(attr2, str) else attr2.decode("utf-8") @@ -188,3 +194,18 @@ class PreviewResponse(BaseModel): fields: List | None = [] data: List | None = [] sql: str | None = '' + + +class FieldInfo(BaseModel): + fieldName: object + fieldType: str + + +class SheetFields(BaseModel): + sheetName: str + fields: List[FieldInfo] + + +class ImportRequest(BaseModel): + filePath: str + sheets: List[SheetFields] diff --git a/backend/apps/datasource/utils/__init__.py b/backend/apps/datasource/utils/__init__.py index e69de29bb..5c7cf4850 100644 --- a/backend/apps/datasource/utils/__init__.py +++ b/backend/apps/datasource/utils/__init__.py @@ -0,0 +1,6 @@ +from .excel import ( + FIELD_TYPE_MAP, + USER_TYPE_TO_PANDAS, + infer_field_type, + parse_excel_preview, +) diff --git a/backend/apps/datasource/utils/excel.py b/backend/apps/datasource/utils/excel.py new file mode 100644 index 000000000..dd4044358 --- /dev/null +++ b/backend/apps/datasource/utils/excel.py @@ -0,0 +1,64 @@ +import pandas as pd + +FIELD_TYPE_MAP = { + 'int64': 'int', + 'int32': 'int', + 'float64': 'float', + 'float32': 'float', + 'datetime64': 'datetime', + 'datetime64[ns]': 'datetime', + 'object': 'string', + 'string': 'string', + 'bool': 'string', +} + +USER_TYPE_TO_PANDAS = { + 'int': 'int64', + 'float': 'float64', + 'datetime': 'datetime64[ns]', + 'string': 'string', +} + + +def infer_field_type(dtype) -> str: + dtype_str = str(dtype) + return FIELD_TYPE_MAP.get(dtype_str, 'string') + + +def parse_excel_preview(save_path: str, max_rows: int = 10): + sheets_data = [] + if save_path.endswith(".csv"): + df = pd.read_csv(save_path, engine='c') + fields = [] + for col in df.columns: + fields.append({ + "fieldName": col, + "fieldType": infer_field_type(df[col].dtype) + }) + preview_df = df.head(max_rows).replace({pd.NA: None, float('nan'): None}) + preview_data = preview_df.to_dict(orient='records') + sheets_data.append({ + "sheetName": "Sheet1", + "fields": fields, + "data": preview_data, + "rows": len(df) + }) + else: + sheet_names = pd.ExcelFile(save_path).sheet_names + for sheet_name in sheet_names: + df = pd.read_excel(save_path, sheet_name=sheet_name, engine='calamine') + fields = [] + for col in df.columns: + fields.append({ + "fieldName": col, + "fieldType": infer_field_type(df[col].dtype) + }) + preview_df = df.head(max_rows).replace({pd.NA: None, float('nan'): None}) + preview_data = preview_df.to_dict(orient='records') + sheets_data.append({ + "sheetName": sheet_name, + "fields": fields, + "data": preview_data, + "rows": len(df) + }) + return sheets_data diff --git a/backend/apps/db/constant.py b/backend/apps/db/constant.py index 3b6a66c12..dcec81901 100644 --- a/backend/apps/db/constant.py +++ b/backend/apps/db/constant.py @@ -2,6 +2,7 @@ # Date: 2025/7/16 from enum import Enum +from typing import List from common.utils.utils import equals_ignore_case @@ -15,26 +16,29 @@ def __init__(self, type_name): class DB(Enum): - excel = ('excel', 'Excel/CSV', '"', '"', ConnectType.sqlalchemy, 'PostgreSQL') - redshift = ('redshift', 'AWS Redshift', '"', '"', ConnectType.py_driver, 'AWS_Redshift') - ck = ('ck', 'ClickHouse', '"', '"', ConnectType.sqlalchemy, 'ClickHouse') - dm = ('dm', '达梦', '"', '"', ConnectType.py_driver, 'DM') - doris = ('doris', 'Apache Doris', '`', '`', ConnectType.py_driver, 'Doris') - es = ('es', 'Elasticsearch', '"', '"', ConnectType.py_driver, 'Elasticsearch') - kingbase = ('kingbase', 'Kingbase', '"', '"', ConnectType.py_driver, 'Kingbase') - sqlServer = ('sqlServer', 'Microsoft SQL Server', '[', ']', ConnectType.sqlalchemy, 'Microsoft_SQL_Server') - mysql = ('mysql', 'MySQL', '`', '`', ConnectType.sqlalchemy, 'MySQL') - oracle = ('oracle', 'Oracle', '"', '"', ConnectType.sqlalchemy, 'Oracle') - pg = ('pg', 'PostgreSQL', '"', '"', ConnectType.sqlalchemy, 'PostgreSQL') - starrocks = ('starrocks', 'StarRocks', '`', '`', ConnectType.py_driver, 'StarRocks') - - def __init__(self, type, db_name, prefix, suffix, connect_type: ConnectType, template_name: str): + excel = ('excel', 'Excel/CSV', '"', '"', ConnectType.sqlalchemy, 'PostgreSQL', []) + redshift = ('redshift', 'AWS Redshift', '"', '"', ConnectType.py_driver, 'AWS_Redshift', []) + ck = ('ck', 'ClickHouse', '"', '"', ConnectType.sqlalchemy, 'ClickHouse', []) + dm = ('dm', '达梦', '"', '"', ConnectType.py_driver, 'DM', []) + doris = ('doris', 'Apache Doris', '`', '`', ConnectType.py_driver, 'Doris', []) + es = ('es', 'Elasticsearch', '"', '"', ConnectType.py_driver, 'Elasticsearch', []) + kingbase = ('kingbase', 'Kingbase', '"', '"', ConnectType.py_driver, 'Kingbase', []) + sqlServer = ('sqlServer', 'Microsoft SQL Server', '[', ']', ConnectType.sqlalchemy, 'Microsoft_SQL_Server', []) + mysql = ('mysql', 'MySQL', '`', '`', ConnectType.sqlalchemy, 'MySQL', ['local_infile']) + oracle = ('oracle', 'Oracle', '"', '"', ConnectType.sqlalchemy, 'Oracle', []) + pg = ('pg', 'PostgreSQL', '"', '"', ConnectType.sqlalchemy, 'PostgreSQL', []) + starrocks = ('starrocks', 'StarRocks', '`', '`', ConnectType.py_driver, 'StarRocks', []) + hive = ('hive', 'Apache Hive', '`', '`', ConnectType.py_driver, 'Hive', []) + + def __init__(self, type, db_name, prefix, suffix, connect_type: ConnectType, template_name: str, + illegalParams: List[str]): self.type = type self.db_name = db_name self.prefix = prefix self.suffix = suffix self.connect_type = connect_type self.template_name = template_name + self.illegalParams = illegalParams @classmethod def get_db(cls, type, default_if_none=False): diff --git a/backend/apps/db/db.py b/backend/apps/db/db.py index fd58d2125..738dd0526 100644 --- a/backend/apps/db/db.py +++ b/backend/apps/db/db.py @@ -3,9 +3,9 @@ import os import platform import urllib.parse +from datetime import datetime, date, time, timedelta from decimal import Decimal -from datetime import timedelta -from typing import Optional +from typing import Optional, List import oracledb import psycopg2 @@ -32,6 +32,11 @@ from fastapi import HTTPException from apps.db.es_engine import get_es_connect, get_es_index, get_es_fields, get_es_data_by_http from common.core.config import settings +import sqlglot +from sqlglot import expressions as exp +from pyhive import hive +from sqlalchemy.pool import NullPool +from dbutils.pooled_db import PooledDB try: if os.path.exists(settings.ORACLE_CLIENT_PATH): @@ -54,6 +59,7 @@ def get_uri(ds: CoreDatasource) -> str: def get_uri_from_config(type: str, conf: DatasourceConf) -> str: db_url: str if equals_ignore_case(type, "mysql"): + checkParams(conf.extraJdbc, DB.mysql.illegalParams) if conf.extraJdbc is not None and conf.extraJdbc != '': db_url = f"mysql+pymysql://{urllib.parse.quote(conf.username)}:{urllib.parse.quote(conf.password)}@{conf.host}:{conf.port}/{conf.database}?{conf.extraJdbc}" else: @@ -69,7 +75,7 @@ def get_uri_from_config(type: str, conf: DatasourceConf) -> str: else: db_url = f"postgresql+psycopg2://{urllib.parse.quote(conf.username)}:{urllib.parse.quote(conf.password)}@{conf.host}:{conf.port}/{conf.database}" elif equals_ignore_case(type, "oracle"): - if equals_ignore_case(conf.mode, "service_name"): + if equals_ignore_case(conf.mode, "service_name", "serviceName"): if conf.extraJdbc is not None and conf.extraJdbc != '': db_url = f"oracle+oracledb://{urllib.parse.quote(conf.username)}:{urllib.parse.quote(conf.password)}@{conf.host}:{conf.port}?service_name={conf.database}&{conf.extraJdbc}" else: @@ -105,44 +111,65 @@ def get_extra_config(conf: DatasourceConf): def get_origin_connect(type: str, conf: DatasourceConf): extra_config_dict = get_extra_config(conf) if equals_ignore_case(type, "sqlServer"): - return pymssql.connect( - server=conf.host, - port=str(conf.port), - user=conf.username, - password=conf.password, - database=conf.database, - timeout=conf.timeout, - tds_version='7.0', # options: '4.2', '7.0', '8.0' ..., - **extra_config_dict - ) + # none or true, set tds_version = 7.0 + if conf.lowVersion is None or conf.lowVersion: + return pymssql.connect( + server=conf.host, + port=str(conf.port), + user=conf.username, + password=conf.password, + database=conf.database, + timeout=conf.timeout, + tds_version='7.0', # options: '4.2', '7.0', '8.0' ..., + **extra_config_dict + ) + else: + return pymssql.connect( + server=conf.host, + port=str(conf.port), + user=conf.username, + password=conf.password, + database=conf.database, + timeout=conf.timeout, + **extra_config_dict + ) # use sqlalchemy -def get_engine(ds: CoreDatasource, timeout: int = 0) -> Engine: +def get_engine(ds: CoreDatasource, timeout: int = 0, use_pool: bool = False) -> Engine: conf = DatasourceConf(**json.loads(aes_decrypt(ds.configuration))) if not equals_ignore_case(ds.type, "excel") else get_engine_config() if conf.timeout is None: conf.timeout = timeout if timeout > 0: conf.timeout = timeout + + db_config = { + 'pool_size': conf.poolSize if conf.poolSize else 5, + 'max_overflow': 20, + 'pool_recycle': 3600 + } if use_pool else { + 'poolclass': NullPool + } + if equals_ignore_case(ds.type, "pg"): if conf.dbSchema is not None and conf.dbSchema != "": engine = create_engine(get_uri(ds), connect_args={"options": f"-c search_path={urllib.parse.quote(conf.dbSchema)}", - "connect_timeout": conf.timeout}, - pool_timeout=conf.timeout) + "connect_timeout": conf.timeout}, **db_config) else: - engine = create_engine(get_uri(ds), - connect_args={"connect_timeout": conf.timeout}, - pool_timeout=conf.timeout) + engine = create_engine(get_uri(ds), connect_args={"connect_timeout": conf.timeout}, **db_config) elif equals_ignore_case(ds.type, 'sqlServer'): engine = create_engine('mssql+pymssql://', creator=lambda: get_origin_connect(ds.type, conf), - pool_timeout=conf.timeout) + **db_config) elif equals_ignore_case(ds.type, 'oracle'): - engine = create_engine(get_uri(ds), - pool_timeout=conf.timeout) - else: # mysql, ck - engine = create_engine(get_uri(ds), connect_args={"connect_timeout": conf.timeout}, pool_timeout=conf.timeout) + engine = create_engine(get_uri(ds), **db_config) + elif equals_ignore_case(ds.type, 'mysql'): # mysql + ssl_mode = {"require": True} if conf.ssl else None + engine = create_engine(get_uri(ds), connect_args={"connect_timeout": conf.timeout, "ssl": ssl_mode}, + **db_config) + else: # ck + engine = create_engine(get_uri(ds), connect_args={"connect_timeout": conf.timeout}, **db_config) return engine @@ -152,10 +179,114 @@ def get_session(ds: CoreDatasource | AssistantOutDsSchema): out_conf = get_out_ds_conf(ds, 30) ds.configuration = out_conf - engine = get_engine(ds) - session_maker = sessionmaker(bind=engine) - session = session_maker() - return session + # engine = get_engine(ds) + # session_maker = sessionmaker(bind=engine) + + # get session from pool + session = pool_manager.get_pool(ds=ds, **{}) + return session() + + +def get_driver_connection(ds: CoreDatasource | AssistantOutDsSchema, db_config: dict = {}, use_pool: bool = False): + conf = DatasourceConf(**json.loads(aes_decrypt(ds.configuration))) + extra_config_dict = get_extra_config(conf) + + pool_config = { + 'maxconnections': conf.poolSize if conf.poolSize else 5, + 'mincached': 5, + 'maxcached': 10, + 'blocking': True, + 'maxusage': 100, + 'ping': 1, + } if use_pool else {} + conn_conf = extra_config_dict | db_config | pool_config + + conn = None + if equals_ignore_case(ds.type, 'dm'): + if not use_pool: + conn = dmPython.connect(user=conf.username, password=conf.password, server=conf.host, + port=conf.port, **conn_conf) + else: + conn = PooledDB( + creator=dmPython, + user=conf.username, + password=conf.password, + server=conf.host, + port=conf.port, + **conn_conf + ) + elif equals_ignore_case(ds.type, 'doris', 'starrocks'): + ssl_args = {'ssl': {'ssl_mode': 'REQUIRE'}} if conf.ssl else {} + args = conn_conf | ssl_args + if not use_pool: + conn = pymysql.connect(user=conf.username, passwd=conf.password, host=conf.host, + port=conf.port, db=conf.database, connect_timeout=conf.timeout, + read_timeout=conf.timeout, **conn_conf, + **args) + else: + conn = PooledDB( + creator=pymysql, + user=conf.username, + passwd=conf.password, + host=conf.host, + port=conf.port, + db=conf.database, + connect_timeout=conf.timeout, + read_timeout=conf.timeout, + **args + ) + elif equals_ignore_case(ds.type, 'redshift'): + if not use_pool: + conn = redshift_connector.connect(host=conf.host, port=conf.port, database=conf.database, user=conf.username, + password=conf.password, + timeout=conf.timeout, **conn_conf) + else: + conn = PooledDB( + creator=redshift_connector, + host=conf.host, + port=conf.port, + database=conf.database, + user=conf.username, + password=conf.password, + timeout=conf.timeout, + **conn_conf + ) + elif equals_ignore_case(ds.type, 'kingbase'): + if not use_pool: + conn = psycopg2.connect(host=conf.host, port=conf.port, database=conf.database, user=conf.username, + password=conf.password, + options=f"-c statement_timeout={conf.timeout * 1000}", + **conn_conf) + else: + conn = PooledDB( + creator=psycopg2, + host=conf.host, + port=conf.port, + database=conf.database, + user=conf.username, + password=conf.password, + options=f"-c statement_timeout={conf.timeout * 1000}", + **conn_conf + ) + elif equals_ignore_case(ds.type, 'hive'): + if not use_pool: + conn = hive.connect(host=conf.host, port=conf.port, username=conf.username, + database=conf.database, **conn_conf) + else: + conn = PooledDB( + creator=hive, + host=conf.host, + port=conf.port, + username=conf.username, + database=conf.database, **conn_conf + ) + + return conn + + +def get_driver_pool(ds: CoreDatasource | AssistantOutDsSchema, db_config: dict = {}): + pool = driver_pool_manager.get_pool(ds, db_config) + return pool def check_connection(trans: Optional[Trans], ds: CoreDatasource | AssistantOutDsSchema, is_raise: bool = False): @@ -191,9 +322,10 @@ def check_connection(trans: Optional[Trans], ds: CoreDatasource | AssistantOutDs raise HTTPException(status_code=500, detail=trans('i18n_ds_invalid') + f': {e.args}') return False elif equals_ignore_case(ds.type, 'doris', 'starrocks'): + ssl_args = {'ssl': {'ssl_mode': 'REQUIRE'}} if conf.ssl else {} with pymysql.connect(user=conf.username, passwd=conf.password, host=conf.host, port=conf.port, db=conf.database, connect_timeout=10, - read_timeout=10, **extra_config_dict) as conn, conn.cursor() as cursor: + read_timeout=10, **extra_config_dict, **ssl_args) as conn, conn.cursor() as cursor: try: cursor.execute('select 1') SQLBotLogUtil.info("success") @@ -231,6 +363,19 @@ def check_connection(trans: Optional[Trans], ds: CoreDatasource | AssistantOutDs if is_raise: raise HTTPException(status_code=500, detail=trans('i18n_ds_invalid') + f': {e.args}') return False + elif equals_ignore_case(ds.type, 'hive'): + with hive.connect(host=conf.host, port=conf.port, username=conf.username, + database=conf.database, **extra_config_dict) as conn, conn.cursor() as cursor: + try: + cursor.execute('select 1') + SQLBotLogUtil.info("success") + return True + except Exception as e: + SQLBotLogUtil.error(f"Datasource {ds.id} connection failed: {e}") + if is_raise: + raise HTTPException(status_code=500, detail=trans('i18n_ds_invalid') + f': {e.args}') + return False + elif equals_ignore_case(ds.type, 'es'): es_conn = get_es_connect(conf) if es_conn.ping(): @@ -273,6 +418,8 @@ def get_version(ds: CoreDatasource | AssistantOutDsSchema): # conf.timeout = 10 db = DB.get_db(ds.type) sql = get_version_sql(ds, conf) + if not sql: + return '' try: if db.connect_type == ConnectType.sqlalchemy: with get_session(ds) as session: @@ -282,19 +429,17 @@ def get_version(ds: CoreDatasource | AssistantOutDsSchema): else: extra_config_dict = get_extra_config(conf) if equals_ignore_case(ds.type, 'dm'): - with dmPython.connect(user=conf.username, password=conf.password, server=conf.host, - port=conf.port) as conn, conn.cursor() as cursor: + with get_driver_pool(ds).connection() as conn, conn.cursor() as cursor: cursor.execute(sql, timeout=10, **extra_config_dict) res = cursor.fetchall() version = res[0][0] elif equals_ignore_case(ds.type, 'doris', 'starrocks'): - with pymysql.connect(user=conf.username, passwd=conf.password, host=conf.host, - port=conf.port, db=conf.database, connect_timeout=10, - read_timeout=10, **extra_config_dict) as conn, conn.cursor() as cursor: + t_conf = {'connect_timeout': 10, 'read_timeout': 10} + with get_driver_pool(ds, t_conf).connection() as conn, conn.cursor() as cursor: cursor.execute(sql) res = cursor.fetchall() version = res[0][0] - elif equals_ignore_case(ds.type, 'redshift', 'es'): + elif equals_ignore_case(ds.type, 'redshift', 'es', 'hive'): version = '' except Exception as e: print(e) @@ -306,41 +451,42 @@ def get_schema(ds: CoreDatasource): conf = DatasourceConf(**json.loads(aes_decrypt(ds.configuration))) if ds.type != "excel" else get_engine_config() db = DB.get_db(ds.type) if db.connect_type == ConnectType.sqlalchemy: - with get_session(ds) as session: + with sessionmaker(bind=get_engine(ds))() as session: sql: str = '' if equals_ignore_case(ds.type, "sqlServer"): - sql = """select name from sys.schemas""" + sql = """select name + from sys.schemas""" elif equals_ignore_case(ds.type, "pg", "excel"): - sql = """SELECT nspname FROM pg_namespace""" + sql = """SELECT nspname + FROM pg_namespace""" elif equals_ignore_case(ds.type, "oracle"): - sql = """select * from all_users""" + sql = """select * + from all_users""" with session.execute(text(sql)) as result: res = result.fetchall() res_list = [item[0] for item in res] return res_list else: - extra_config_dict = get_extra_config(conf) + # extra_config_dict = get_extra_config(conf) if equals_ignore_case(ds.type, 'dm'): - with dmPython.connect(user=conf.username, password=conf.password, server=conf.host, - port=conf.port, **extra_config_dict) as conn, conn.cursor() as cursor: - cursor.execute("""select OBJECT_NAME from dba_objects where object_type='SCH'""", timeout=conf.timeout) + with get_driver_connection(ds) as conn, conn.cursor() as cursor: + cursor.execute("""select OBJECT_NAME + from all_objects + where object_type = 'SCH'""", timeout=conf.timeout) res = cursor.fetchall() res_list = [item[0] for item in res] return res_list elif equals_ignore_case(ds.type, 'redshift'): - with redshift_connector.connect(host=conf.host, port=conf.port, database=conf.database, user=conf.username, - password=conf.password, - timeout=conf.timeout, **extra_config_dict) as conn, conn.cursor() as cursor: - cursor.execute("""SELECT nspname FROM pg_namespace""") + with get_driver_connection(ds) as conn, conn.cursor() as cursor: + cursor.execute("""SELECT nspname + FROM pg_namespace""") res = cursor.fetchall() res_list = [item[0] for item in res] return res_list elif equals_ignore_case(ds.type, 'kingbase'): - with psycopg2.connect(host=conf.host, port=conf.port, database=conf.database, user=conf.username, - password=conf.password, - options=f"-c statement_timeout={conf.timeout * 1000}", - **extra_config_dict) as conn, conn.cursor() as cursor: - cursor.execute("""SELECT nspname FROM pg_namespace""") + with get_driver_connection(ds) as conn, conn.cursor() as cursor: + cursor.execute("""SELECT nspname + FROM pg_namespace""") res = cursor.fetchall() res_list = [item[0] for item in res] return res_list @@ -352,41 +498,34 @@ def get_tables(ds: CoreDatasource): db = DB.get_db(ds.type) sql, sql_param = get_table_sql(ds, conf, get_version(ds)) if db.connect_type == ConnectType.sqlalchemy: - with get_session(ds) as session: + with sessionmaker(bind=get_engine(ds))() as session: with session.execute(text(sql), {"param": sql_param}) as result: res = result.fetchall() res_list = [TableSchema(*item) for item in res] return res_list else: - extra_config_dict = get_extra_config(conf) + # extra_config_dict = get_extra_config(conf) if equals_ignore_case(ds.type, 'dm'): - with dmPython.connect(user=conf.username, password=conf.password, server=conf.host, - port=conf.port, **extra_config_dict) as conn, conn.cursor() as cursor: + with get_driver_connection(ds) as conn, conn.cursor() as cursor: cursor.execute(sql, {"param": sql_param}, timeout=conf.timeout) res = cursor.fetchall() res_list = [TableSchema(*item) for item in res] return res_list elif equals_ignore_case(ds.type, 'doris', 'starrocks'): - with pymysql.connect(user=conf.username, passwd=conf.password, host=conf.host, - port=conf.port, db=conf.database, connect_timeout=conf.timeout, - read_timeout=conf.timeout, **extra_config_dict) as conn, conn.cursor() as cursor: + # ssl_args = {'ssl': {'ssl_mode': 'REQUIRE'}} if conf.ssl else {} + with get_driver_connection(ds) as conn, conn.cursor() as cursor: cursor.execute(sql, (sql_param,)) res = cursor.fetchall() res_list = [TableSchema(*item) for item in res] return res_list elif equals_ignore_case(ds.type, 'redshift'): - with redshift_connector.connect(host=conf.host, port=conf.port, database=conf.database, user=conf.username, - password=conf.password, - timeout=conf.timeout, **extra_config_dict) as conn, conn.cursor() as cursor: + with get_driver_connection(ds) as conn, conn.cursor() as cursor: cursor.execute(sql, (sql_param,)) res = cursor.fetchall() res_list = [TableSchema(*item) for item in res] return res_list elif equals_ignore_case(ds.type, 'kingbase'): - with psycopg2.connect(host=conf.host, port=conf.port, database=conf.database, user=conf.username, - password=conf.password, - options=f"-c statement_timeout={conf.timeout * 1000}", - **extra_config_dict) as conn, conn.cursor() as cursor: + with get_driver_connection(ds) as conn, conn.cursor() as cursor: cursor.execute(sql.format(sql_param)) res = cursor.fetchall() res_list = [TableSchema(*item) for item in res] @@ -395,6 +534,12 @@ def get_tables(ds: CoreDatasource): res = get_es_index(conf) res_list = [TableSchema(*item) for item in res] return res_list + elif equals_ignore_case(ds.type, 'hive'): + with get_driver_connection(ds) as conn, conn.cursor() as cursor: + cursor.execute(sql) + res = cursor.fetchall() + res_list = [TableSchema(*item) for item in res] + return res_list def get_fields(ds: CoreDatasource, table_name: str = None): @@ -409,35 +554,28 @@ def get_fields(ds: CoreDatasource, table_name: str = None): res_list = [ColumnSchema(*item) for item in res] return res_list else: - extra_config_dict = get_extra_config(conf) + # extra_config_dict = get_extra_config(conf) if equals_ignore_case(ds.type, 'dm'): - with dmPython.connect(user=conf.username, password=conf.password, server=conf.host, - port=conf.port, **extra_config_dict) as conn, conn.cursor() as cursor: + with get_driver_pool(ds).connection() as conn, conn.cursor() as cursor: cursor.execute(sql, {"param1": p1, "param2": p2}, timeout=conf.timeout) res = cursor.fetchall() res_list = [ColumnSchema(*item) for item in res] return res_list elif equals_ignore_case(ds.type, 'doris', 'starrocks'): - with pymysql.connect(user=conf.username, passwd=conf.password, host=conf.host, - port=conf.port, db=conf.database, connect_timeout=conf.timeout, - read_timeout=conf.timeout, **extra_config_dict) as conn, conn.cursor() as cursor: + # ssl_args = {'ssl': {'ssl_mode': 'REQUIRE'}} if conf.ssl else {} + with get_driver_pool(ds).connection() as conn, conn.cursor() as cursor: cursor.execute(sql, (p1, p2)) res = cursor.fetchall() res_list = [ColumnSchema(*item) for item in res] return res_list elif equals_ignore_case(ds.type, 'redshift'): - with redshift_connector.connect(host=conf.host, port=conf.port, database=conf.database, user=conf.username, - password=conf.password, - timeout=conf.timeout, **extra_config_dict) as conn, conn.cursor() as cursor: + with get_driver_pool(ds).connection() as conn, conn.cursor() as cursor: cursor.execute(sql, (p1, p2)) res = cursor.fetchall() res_list = [ColumnSchema(*item) for item in res] return res_list elif equals_ignore_case(ds.type, 'kingbase'): - with psycopg2.connect(host=conf.host, port=conf.port, database=conf.database, user=conf.username, - password=conf.password, - options=f"-c statement_timeout={conf.timeout * 1000}", - **extra_config_dict) as conn, conn.cursor() as cursor: + with get_driver_pool(ds).connection() as conn, conn.cursor() as cursor: cursor.execute(sql.format(p1, p2)) res = cursor.fetchall() res_list = [ColumnSchema(*item) for item in res] @@ -446,126 +584,648 @@ def get_fields(ds: CoreDatasource, table_name: str = None): res = get_es_fields(conf, table_name) res_list = [ColumnSchema(*item) for item in res] return res_list + elif equals_ignore_case(ds.type, 'hive'): + with get_driver_pool(ds).connection() as conn, conn.cursor() as cursor: + cursor.execute(sql) + res = cursor.fetchall() + res_list = [ColumnSchema(*item) for item in res] + return res_list -def convert_value(value): - """转换值为JSON可序列化的类型""" +def convert_value(value, datetime_format='space'): + """ + 将Python值转换为JSON可序列化的类型 + + :param value: 要转换的值 + :param datetime_format: 日期时间格式 + 'iso' - 2024-01-15T14:30:45 (ISO标准,带T) + 'space' - 2024-01-15 14:30:45 (空格分隔,更常见) + 'auto' - 自动选择 + """ + if value is None: + return None + # 处理 bytes 类型(包括 BIT 字段) + if isinstance(value, bytes): + # 1. 尝试判断是否是 BIT 类型 + if len(value) <= 8: # BIT 类型通常不会很长 + try: + # 转换为整数 + int_val = int.from_bytes(value, 'big') + + # 如果是 0 或 1,返回布尔值更直观 + if int_val in (0, 1): + return bool(int_val) + else: + return int_val + except: + # 如果转换失败,尝试解码为字符串 + pass + + # 2. 尝试解码为 UTF-8 字符串 + try: + return value.decode('utf-8') + except UnicodeDecodeError: + # 3. 如果包含非打印字符,返回十六进制 + if any(b < 32 and b not in (9, 10, 13) for b in value): # 非打印字符 + return f"0x{value.hex()}" + else: + # 4. 尝试 Latin-1 解码(不会失败) + return value.decode('latin-1') + + elif isinstance(value, bytearray): + # 处理 bytearray + return convert_value(bytes(value)) + if isinstance(value, timedelta): # 将 timedelta 转换为秒数(整数)或字符串 return str(value) # 或 value.total_seconds() elif isinstance(value, Decimal): return float(value) - elif hasattr(value, 'isoformat'): # 处理 datetime/date/time - return value.isoformat() + # 4. 处理 datetime + elif isinstance(value, datetime): + if datetime_format == 'iso': + return value.isoformat() + elif datetime_format == 'space': + return value.strftime('%Y-%m-%d %H:%M:%S') + else: # 'auto' 或其他 + # 自动判断:没有时间部分只显示日期 + if value.hour == 0 and value.minute == 0 and value.second == 0 and value.microsecond == 0: + return value.strftime('%Y-%m-%d') + else: + return value.strftime('%Y-%m-%d %H:%M:%S') + + # 5. 处理 date + elif isinstance(value, date): + return value.isoformat() # 总是 YYYY-MM-DD + + # 6. 处理 time + elif isinstance(value, time): + return str(value) else: return value +def is_numeric_type_code(type_code, dialect_name: str) -> bool: + """ + 根据数据库方言和 type_code 判断是否为数值类型 + + Args: + type_code: cursor.description[col_idx][1] 的值 + dialect_name: SQLAlchemy dialect name (mysql/postgresql/mssql/oracle/sqlite 等) + + Returns: + bool: 是否为数值类型 + """ + dialect_name = dialect_name.lower() + + # ---------- MySQL (pymysql) ---------- + if dialect_name == 'mysql': + if isinstance(type_code, int): + return type_code in { + 1, # TINYINT + 2, # SMALLINT + 3, # INT + 4, # FLOAT + 5, # DOUBLE + 8, # BIGINT + 9, # MEDIUMINT + 16, # BIT + 246, # DECIMAL/NEWDECIMAL + } + return False + + # ---------- PostgreSQL (psycopg2) ---------- + if dialect_name == 'postgresql': + if isinstance(type_code, int): + return type_code in { + 20, # int8 + 21, # int2 + 23, # int4 + 700, # float4 + 701, # float8 + 1700, # numeric + 16, # boolean + } + return False + + # ---------- Oracle (cx_Oracle / oracledb) ---------- + if dialect_name == 'oracle': + type_str = str(type_code).upper() + return any(kw in type_str for kw in ['NUMBER', 'FLOAT', 'INTEGER', 'BINARY_FLOAT', 'BINARY_DOUBLE']) + + if dialect_name == 'clickhouse': + if isinstance(type_code, str): + upper_type = type_code.upper() + # 数值类型关键字 + numeric_prefixes = ( + 'INT', # Int8/16/32/64 + 'UINT', # UInt8/16/32/64 ✅ 加上 UINT + 'FLOAT', # Float32, Float64 + 'DECIMAL', # Decimal, Decimal32/64/128 + 'BOOL', # Bool + 'BIT', # 极少数场景 + ) + return any(upper_type.startswith(p) for p in numeric_prefixes) + + # ---------- SQL Server (pyodbc / pymssql) ---------- + if dialect_name == 'mssql': + if isinstance(type_code, int): + # SQL Server (pyodbc / ODBC) 数值类型码 + return type_code in { + 2, # smallint + 3, # int + 4, # tinyint + 5, # float / real / decimal / numeric / money / smallmoney + 6, # bit + 7, # bigint + } + + # ---------- SQLite ---------- + if dialect_name == 'sqlite': + if isinstance(type_code, int): + return type_code in {1, 2, 3, 4, 5} # INTEGER, FLOAT, NUMERIC, etc. + return False + + # ---------- 未知数据库,保守返回 False ---------- + return False + + def exec_sql(ds: CoreDatasource | AssistantOutDsSchema, sql: str, origin_column=False): while sql.endswith(';'): sql = sql[:-1] + # check execute sql only contain read operations + is_safe, error_reason = check_sql_read(sql, ds) + if not is_safe: + raise ValueError(f"SQL can only contain read operations: {error_reason}") db = DB.get_db(ds.type) if db.connect_type == ConnectType.sqlalchemy: with get_session(ds) as session: + # 获取当前数据库方言 + dialect_name = session.bind.dialect.name + with session.execute(text(sql)) as result: try: columns = result.keys()._keys if origin_column else [item.lower() for item in result.keys()._keys] + + fields_info = [] + + for col_idx, col_name in enumerate(columns): + is_numeric = False + try: + type_code = result.cursor.description[col_idx][1] + is_numeric = is_numeric_type_code(type_code, dialect_name) + except (IndexError, AttributeError): + pass + + fields_info.append({ + "name": col_name, + "is_numeric": is_numeric + }) + res = result.fetchall() result_list = [ {str(columns[i]): convert_value(value) for i, value in enumerate(tuple_item)} for tuple_item in res ] - return {"fields": columns, "data": result_list, + return {"fields": columns, "data": result_list, "fields_info": fields_info, "sql": bytes.decode(base64.b64encode(bytes(sql, 'utf-8')))} except Exception as ex: raise ParseSQLResultError(str(ex)) else: conf = DatasourceConf(**json.loads(aes_decrypt(ds.configuration))) - extra_config_dict = get_extra_config(conf) + # extra_config_dict = get_extra_config(conf) if equals_ignore_case(ds.type, 'dm'): - with dmPython.connect(user=conf.username, password=conf.password, server=conf.host, - port=conf.port, **extra_config_dict) as conn, conn.cursor() as cursor: + with get_driver_pool(ds).connection() as conn, conn.cursor() as cursor: try: cursor.execute(sql, timeout=conf.timeout) res = cursor.fetchall() columns = [field[0] for field in cursor.description] if origin_column else [field[0].lower() for field in cursor.description] + fields_info = build_fields_info_from_cursor(cursor, origin_column, 'dm') result_list = [ {str(columns[i]): convert_value(value) for i, value in enumerate(tuple_item)} for tuple_item in res ] - return {"fields": columns, "data": result_list, + return {"fields": columns, "data": result_list, "fields_info": fields_info, "sql": bytes.decode(base64.b64encode(bytes(sql, 'utf-8')))} except Exception as ex: raise ParseSQLResultError(str(ex)) elif equals_ignore_case(ds.type, 'doris', 'starrocks'): - with pymysql.connect(user=conf.username, passwd=conf.password, host=conf.host, - port=conf.port, db=conf.database, connect_timeout=conf.timeout, - read_timeout=conf.timeout, **extra_config_dict) as conn, conn.cursor() as cursor: + with get_driver_pool(ds).connection() as conn, conn.cursor() as cursor: try: cursor.execute(sql) res = cursor.fetchall() columns = [field[0] for field in cursor.description] if origin_column else [field[0].lower() for field in cursor.description] + fields_info = build_fields_info_from_cursor(cursor, origin_column, 'mysql') result_list = [ {str(columns[i]): convert_value(value) for i, value in enumerate(tuple_item)} for tuple_item in res ] - return {"fields": columns, "data": result_list, + return {"fields": columns, "data": result_list, "fields_info": fields_info, "sql": bytes.decode(base64.b64encode(bytes(sql, 'utf-8')))} except Exception as ex: raise ParseSQLResultError(str(ex)) elif equals_ignore_case(ds.type, 'redshift'): - with redshift_connector.connect(host=conf.host, port=conf.port, database=conf.database, user=conf.username, - password=conf.password, - timeout=conf.timeout, **extra_config_dict) as conn, conn.cursor() as cursor: + with get_driver_pool(ds).connection() as conn, conn.cursor() as cursor: try: cursor.execute(sql) res = cursor.fetchall() columns = [field[0] for field in cursor.description] if origin_column else [field[0].lower() for field in cursor.description] + fields_info = build_fields_info_from_cursor(cursor, origin_column, 'postgresql') result_list = [ {str(columns[i]): convert_value(value) for i, value in enumerate(tuple_item)} for tuple_item in res ] - return {"fields": columns, "data": result_list, + return {"fields": columns, "data": result_list, "fields_info": fields_info, "sql": bytes.decode(base64.b64encode(bytes(sql, 'utf-8')))} except Exception as ex: raise ParseSQLResultError(str(ex)) elif equals_ignore_case(ds.type, 'kingbase'): - with psycopg2.connect(host=conf.host, port=conf.port, database=conf.database, user=conf.username, - password=conf.password, - options=f"-c statement_timeout={conf.timeout * 1000}", - **extra_config_dict) as conn, conn.cursor() as cursor: + with get_driver_pool(ds).connection() as conn, conn.cursor() as cursor: try: cursor.execute(sql) res = cursor.fetchall() columns = [field[0] for field in cursor.description] if origin_column else [field[0].lower() for field in cursor.description] + fields_info = build_fields_info_from_cursor(cursor, origin_column, 'postgresql') result_list = [ {str(columns[i]): convert_value(value) for i, value in enumerate(tuple_item)} for tuple_item in res ] - return {"fields": columns, "data": result_list, + return {"fields": columns, "data": result_list, "fields_info": fields_info, "sql": bytes.decode(base64.b64encode(bytes(sql, 'utf-8')))} except Exception as ex: raise ParseSQLResultError(str(ex)) elif equals_ignore_case(ds.type, 'es'): try: - res, columns = get_es_data_by_http(conf, sql) - columns = [field.get('name') for field in columns] if origin_column else [field.get('name').lower() for - field in - columns] + res, raw_columns = get_es_data_by_http(conf, sql) + columns = [field.get('name') for field in raw_columns] if origin_column else [field.get('name').lower() + for + field in + raw_columns] + fields_info = build_fields_info_from_es(raw_columns, origin_column) result_list = [ {str(columns[i]): convert_value(value) for i, value in enumerate(tuple_item)} for tuple_item in res ] - return {"fields": columns, "data": result_list, + return {"fields": columns, "data": result_list, "fields_info": fields_info, "sql": bytes.decode(base64.b64encode(bytes(sql, 'utf-8')))} except Exception as ex: raise Exception(str(ex)) + elif equals_ignore_case(ds.type, 'hive'): + with get_driver_pool(ds).connection() as conn, conn.cursor() as cursor: + try: + # Hive uses backticks for identifiers; normalize quoted identifiers as a compatibility fallback. + hive_sql = re.sub(r'"([A-Za-z_][A-Za-z0-9_]*)"', r'`\1`', sql) + cursor.execute(hive_sql) + res = cursor.fetchall() + columns = [field[0] for field in cursor.description] if origin_column else [field[0].lower() for + field in + cursor.description] + fields_info = build_fields_info_from_cursor(cursor, origin_column, 'hive') + result_list = [ + {str(columns[i]): convert_value(value) for i, value in enumerate(tuple_item)} for tuple_item in + res + ] + return {"fields": columns, "data": result_list, "fields_info": fields_info, + "sql": bytes.decode(base64.b64encode(bytes(hive_sql, 'utf-8')))} + except Exception as ex: + raise ParseSQLResultError(str(ex)) + + +def build_fields_info_from_cursor(cursor, origin_column, db_type='postgresql'): + """ + 根据数据库游标的 description 构建字段信息列表 + + Args: + cursor: 数据库游标对象 + origin_column: 是否保留原始列名大小写 + db_type: 数据库类型,支持 'mysql', 'postgresql', 'redshift', 'kingbase', 'dm', 'hive' + + Returns: + list: 包含字段名和是否数值类型的字典列表 + """ + fields_info = [] + + for col_info in cursor.description: + col_name = col_info[0] + + if db_type in ('mysql', 'mariadb', 'doris', 'starrocks'): + # MySQL/pymysql 类型码 + is_numeric = col_info[1] in ( + 1, # TINYINT + 2, # SMALLINT + 3, # INT + 4, # FLOAT + 5, # DOUBLE + 8, # BIGINT + 9, # MEDIUMINT + 16, # BIT + 246, # DECIMAL/NEWDECIMAL + ) + elif db_type in ('postgresql', 'redshift', 'kingbase'): + # PostgreSQL/psycopg2 类型 OID + is_numeric = col_info[1] in ( + 16, # bool + 20, # int8 + 21, # int2 + 23, # int4 + 700, # float4 + 701, # float8 + 790, # money + 1700, # numeric + ) + elif db_type == 'dm': + # 达梦数据库类型码 + # 获取类型类名 + type_name = col_info[1].__name__.upper() if hasattr(col_info[1], '__name__') else str(col_info[1]).upper() + + is_numeric = type_name in { + 'INT', 'INTEGER', + 'BIGINT', 'SMALLINT', 'TINYINT', + 'NUMBER', 'NUMERIC', 'DECIMAL', + 'FLOAT', 'DOUBLE', 'REAL', + 'BIT', 'BOOLEAN', + } + elif db_type == 'hive': + # Hive 类型对象转字符串判断 + type_str = str(col_info[1]).lower() + NUMERIC_PREFIXES = ('tinyint', 'smallint', 'int', 'bigint', 'float', 'double', 'decimal', 'numeric') + is_numeric = type_str == 'boolean' or any(type_str.startswith(p) for p in NUMERIC_PREFIXES) + else: + is_numeric = False + + fields_info.append({ + "name": col_name if origin_column else col_name.lower(), + "is_numeric": is_numeric + }) + + return fields_info + + +def build_fields_info_from_es(raw_columns, origin_column): + """ + 专门为 Elasticsearch 构建字段信息 + + Args: + raw_columns: ES 返回的列信息列表 + origin_column: 是否保留原始列名大小写 + + Returns: + list: 包含字段名和是否数值类型的字典列表 + """ + fields_info = [] + + for field in raw_columns: + field_name = field.get('name') if origin_column else field.get('name').lower() + field_type = field.get('type', '').lower() + + is_numeric = field_type in ( + 'long', 'integer', 'short', 'byte', + 'double', 'float', 'half_float', 'scaled_float', + 'unsigned_long', 'boolean' + ) + + fields_info.append({ + "name": field_name, + "is_numeric": is_numeric + }) + + return fields_info + + +def get_sqlglot_dialect(ds_type: str) -> str: + """根据数据源类型获取 sqlglot dialect""" + if equals_ignore_case(ds_type, 'mysql', 'doris', 'starrocks'): + return 'mysql' + elif equals_ignore_case(ds_type, 'sqlServer'): + return 'tsql' + elif equals_ignore_case(ds_type, 'hive'): + return 'hive' + return None + + +# 通用危险函数(适用于所有数据库) +COMMON_DANGEROUS_FUNCTIONS = {'version', 'current_user', 'user', 'database'} + +# 特定数据库的危险函数 +DS_SPECIFIC_DANGEROUS_FUNCTIONS = { + 'mysql': {'LOAD_FILE', 'INTO OUTFILE', 'INTO DUMPFILE'}, + 'doris': {'LOAD_FILE', 'INTO OUTFILE', 'INTO DUMPFILE'}, + 'starrocks': {'LOAD_FILE', 'INTO OUTFILE', 'INTO DUMPFILE'}, + 'postgresql': {'pg_read_file', 'pg_write_file', 'lo_import', 'lo_export'}, + 'sqlserver': {'EXEC', 'xp_cmdshell', 'sp_executesql'}, + 'oracle': {'UTL_FILE', 'DBMS_PIPE', 'DBMS_LOCK'}, + 'hive': {'ADD FILE', 'ADD JAR'}, +} + +# 危险模式正则表达式(用于检查特殊语法) +import re + +DANGEROUS_PATTERNS = [ + r'\bINTO\s+OUTFILE\b', + r'\bINTO\s+DUMPFILE\b', + r'\bEXEC\s*\(', + r'\bCOPY\s+.*\bTO\s+PROGRAM\b', +] + + +def get_dangerous_functions(ds_type: str) -> set: + """获取危险函数(通用 + 特定数据源)""" + functions = COMMON_DANGEROUS_FUNCTIONS.copy() + ds_key = ds_type.lower() if ds_type else '' + if ds_key in DS_SPECIFIC_DANGEROUS_FUNCTIONS: + functions.update(DS_SPECIFIC_DANGEROUS_FUNCTIONS[ds_key]) + return functions + + +def check_dangerous_functions(statements: list, ds_type: str) -> bool: + """检查是否使用了危险函数,返回 True 表示安全""" + dangerous_functions = get_dangerous_functions(ds_type) + dangerous_functions_upper = {f.upper() for f in dangerous_functions} + + for stmt in statements: + if stmt: + for func in stmt.find_all(exp.Anonymous): + if func.name.upper() in dangerous_functions_upper: + return False + return True + + +def check_sql_read(sql: str, ds: CoreDatasource | AssistantOutDsSchema) -> tuple[bool, str]: + """ + 检查 SQL 是否为安全的只读查询 + 返回: (是否安全, 错误原因) + """ + try: + normalized_sql = sql.strip().lstrip("(").strip() + first_keyword = normalized_sql.split(None, 1)[0].upper() if normalized_sql else "" + + # 根据配置决定是否允许元数据查询 + if settings.SQLBOT_ALLOW_METADATA_QUERIES: + allowed_read_commands = {"SELECT", "WITH", "SHOW", "DESCRIBE", "DESC", "EXPLAIN"} + else: + allowed_read_commands = {"SELECT", "WITH"} + + denied_write_commands = { + "INSERT", "UPDATE", "DELETE", "CREATE", "DROP", "ALTER", + "TRUNCATE", "MERGE", "COPY", "REPLACE", "GRANT", "REVOKE", + "USE", "SET", "CALL" + } + + if not first_keyword: + raise ValueError("Parse SQL Error") + if first_keyword in denied_write_commands: + return False, f"Write operation '{first_keyword}' is not allowed" + + # 1. 使用正则检查特殊模式 + for pattern in DANGEROUS_PATTERNS: + if re.search(pattern, sql, re.IGNORECASE): + return False, f"SQL contains dangerous pattern: {pattern}" + + dialect = get_sqlglot_dialect(ds.type) + statements = sqlglot.parse(sql, dialect=dialect) + + if not statements: + raise ValueError("Parse SQL Error") + + # 2. 使用 sqlglot 检查函数调用 + dangerous_functions = get_dangerous_functions(ds.type) + dangerous_functions_upper = {f.upper() for f in dangerous_functions} + for stmt in statements: + if stmt: + for func in stmt.find_all(exp.Anonymous): + if func.name.upper() in dangerous_functions_upper: + return False, f"SQL contains dangerous function: {func.name}" + + # 3. 检查写操作类型 + write_types = ( + exp.Insert, exp.Update, exp.Delete, + exp.Create, exp.Drop, exp.Alter, + exp.Merge, exp.Copy + ) + + for stmt in statements: + if stmt is None: + continue + if isinstance(stmt, write_types): + return False, f"SQL contains write operation: {type(stmt).__name__}" + + if first_keyword not in allowed_read_commands: + return False, f"SQL command '{first_keyword}' is not allowed. Only SELECT and WITH are permitted" + + return True, "" + + except Exception as e: + raise ValueError(f"Parse SQL Error: {e}") + + +def checkParams(extraParams: str, illegalParams: List[str]): + kvs = extraParams.split('&') + for kv in kvs: + if kv and '=' in kv: + k, v = kv.split('=') + if k in illegalParams: + raise HTTPException(status_code=500, detail=f'Illegal Parameter: {k}') + + +import threading +from collections import OrderedDict + + +class ConnectionPoolManager: + def __init__(self, max_pools=500): + """ + init + :param max_pools: max pool + """ + self.max_pools = max_pools + self._pools = OrderedDict() # 使用有序字典实现 LRU + self._lock = threading.Lock() # 保证多线程安全 + + def get_pool(self, ds: CoreDatasource | AssistantOutDsSchema, **db_config): + """ + get connection pool(lazy load + LRU update) + """ + with self._lock: + if ds.id: + # 1. 如果连接池已存在,将其移动到字典末尾(标记为最近使用) + if ds.id in self._pools: + self._pools.move_to_end(ds.id) + print(f"[LRU] return: {ds.id}") + return self._pools[ds.id] + + # 2. 如果连接池不存在,检查是否达到上限,若达到则淘汰最久未使用的(字典头部) + if len(self._pools) >= self.max_pools: + oldest_id, oldest_pool = self._pools.popitem(last=False) + oldest_pool.close() # 安全关闭被驱逐的连接池 + print(f"[LRU] remove oldest: {oldest_id}") + + # 3. 创建新连接池并放入字典末尾 + engine = get_engine(ds, use_pool=True) + new_pool = sessionmaker(bind=engine) + self._pools[ds.id] = new_pool + print(f"[LRU] create: {ds.id}") + return new_pool + + def close_all(self): + """stop""" + with self._lock: + for pool in self._pools.values(): + pool.close() + self._pools.clear() + + +pool_manager = ConnectionPoolManager(max_pools=500) + + +class DriverConnectionPoolManager: + def __init__(self, max_pools=500): + """ + init + :param max_pools: max pool + """ + self.max_pools = max_pools + self._pools = OrderedDict() # 使用有序字典实现 LRU + self._lock = threading.Lock() # 保证多线程安全 + + def get_pool(self, ds: CoreDatasource | AssistantOutDsSchema, db_config): + """ + get connection pool(lazy load + LRU update) + """ + with self._lock: + if ds.id: + # 1. 如果连接池已存在,将其移动到字典末尾(标记为最近使用) + if ds.id in self._pools: + self._pools.move_to_end(ds.id) + print(f"[LRU] return: {ds.id}") + return self._pools[ds.id] + + # 2. 如果连接池不存在,检查是否达到上限,若达到则淘汰最久未使用的(字典头部) + if len(self._pools) >= self.max_pools: + oldest_id, oldest_pool = self._pools.popitem(last=False) + oldest_pool.close() # 安全关闭被驱逐的连接池 + print(f"[LRU] remove oldest: {oldest_id}") + + # 3. 创建新连接池并放入字典末尾 + new_pool = get_driver_connection(ds, db_config, use_pool=True) + self._pools[ds.id] = new_pool + print(f"[LRU] create: {ds.id}") + return new_pool + + def close_all(self): + """stop""" + with self._lock: + for pool in self._pools.values(): + pool.close() + self._pools.clear() + + +driver_pool_manager = DriverConnectionPoolManager(max_pools=500) diff --git a/backend/apps/db/db_sql.py b/backend/apps/db/db_sql.py index 8f0710fa2..496075378 100644 --- a/backend/apps/db/db_sql.py +++ b/backend/apps/db/db_sql.py @@ -29,7 +29,7 @@ def get_version_sql(ds: CoreDatasource, conf: DatasourceConf): return """ SELECT * FROM v$version """ - elif equals_ignore_case(ds.type, "redshift"): + elif equals_ignore_case(ds.type, "redshift", "sqlite", "hive"): return '' @@ -162,6 +162,10 @@ def get_table_sql(ds: CoreDatasource, conf: DatasourceConf, db_version: str = '' """, conf.dbSchema elif equals_ignore_case(ds.type, "es"): return "", None + elif equals_ignore_case(ds.type, "hive"): + return """ + SHOW TABLES + """, None def get_field_sql(ds: CoreDatasource, conf: DatasourceConf, table_name: str = None): @@ -271,11 +275,10 @@ def get_field_sql(ds: CoreDatasource, conf: DatasourceConf, table_name: str = No c.DATA_TYPE AS "DATA_TYPE", COALESCE(com.COMMENTS, '') AS "COMMENTS" FROM - ALL_TAB_COLS c + ALL_TAB_COLUMNS c LEFT JOIN ALL_COL_COMMENTS com - ON c.OWNER = com.OWNER - AND c.TABLE_NAME = com.TABLE_NAME + ON c.TABLE_NAME = com.TABLE_NAME AND c.COLUMN_NAME = com.COLUMN_NAME WHERE c.OWNER = :param1 @@ -313,3 +316,6 @@ def get_field_sql(ds: CoreDatasource, conf: DatasourceConf, table_name: str = No return sql1 + sql2, conf.dbSchema, table_name elif equals_ignore_case(ds.type, "es"): return "", None, None + elif equals_ignore_case(ds.type, "hive"): + sql1 = f"DESCRIBE {table_name}" + return sql1, None, None diff --git a/backend/apps/db/es_engine.py b/backend/apps/db/es_engine.py index 27f46b766..9e147d63f 100644 --- a/backend/apps/db/es_engine.py +++ b/backend/apps/db/es_engine.py @@ -113,13 +113,13 @@ def get_es_data_by_http(conf: DatasourceConf, sql: str): # Security improvement: Enable SSL certificate verification # Note: In production, always set verify=True or provide path to CA bundle # If using self-signed certificates, provide the cert path: verify='/path/to/cert.pem' - verify_ssl = True if not url.startswith('https://localhost') else False + # verify_ssl = True if not url.startswith('https://localhost') else False response = requests.post( host, data=json.dumps({"query": sql}), headers=get_es_auth(conf), - verify=verify_ssl, + verify=False, timeout=30 # Add timeout to prevent hanging ) diff --git a/backend/apps/mcp/mcp.py b/backend/apps/mcp/mcp.py index b935ffb10..2be45074c 100644 --- a/backend/apps/mcp/mcp.py +++ b/backend/apps/mcp/mcp.py @@ -2,6 +2,7 @@ # Date: 2025/7/1 import json from datetime import timedelta +from typing import Optional import jwt from fastapi import HTTPException, status, APIRouter @@ -12,17 +13,20 @@ from apps.chat.api.chat import create_chat, question_answer_inner from apps.chat.models.chat_model import ChatMcp, CreateChat, ChatStart, McpQuestion, McpAssistant, ChatQuestion, \ - ChatFinishStep + ChatFinishStep, McpDs, ChatToken from apps.datasource.crud.datasource import get_datasource_list -from apps.system.crud.user import authenticate +from apps.system.crud.user import authenticate, user_ws_options from apps.system.crud.user import get_db_user from apps.system.models.system_model import UserWsModel from apps.system.models.user import UserModel from apps.system.schemas.system_schema import BaseUserDTO, AssistantHeader from apps.system.schemas.system_schema import UserInfoDTO +from common.audit.models.log_model import OperationType, OperationModules +from common.audit.schemas.logger_decorator import LogConfig, system_log +from common.audit.schemas.request_context import RequestContext from common.core import security from common.core.config import settings -from common.core.deps import SessionDep +from common.core.deps import SessionDep, Trans from common.core.schemas import TokenPayload, XOAuth2PasswordBearer, Token from common.core.security import create_access_token @@ -33,19 +37,21 @@ router = APIRouter(tags=["mcp"], prefix="/mcp") -# @router.post("/access_token", operation_id="access_token") -# def local_login( -# session: SessionDep, -# form_data: Annotated[OAuth2PasswordRequestForm, Depends()] -# ) -> Token: -# user = authenticate(session=session, account=form_data.username, password=form_data.password) -# if not user: -# raise HTTPException(status_code=400, detail="Incorrect account or password") -# access_token_expires = timedelta(minutes=settings.ACCESS_TOKEN_EXPIRE_MINUTES) -# user_dict = user.to_dict() -# return Token(access_token=create_access_token( -# user_dict, expires_delta=access_token_expires -# )) +@router.post("/access_token", operation_id="access_token") +async def access_token(session: SessionDep, chat: ChatToken): + user: BaseUserDTO = authenticate(session=session, account=chat.username, password=chat.password) + if not user: + raise HTTPException(status_code=400, detail="Incorrect account or password") + + if not user.oid or user.oid == 0: + raise HTTPException(status_code=400, detail="No associated workspace, Please contact the administrator") + access_token_expires = timedelta(minutes=settings.ACCESS_TOKEN_EXPIRE_MINUTES) + user_dict = user.to_dict() + t = Token(access_token=create_access_token( + user_dict, expires_delta=access_token_expires + )) + # c = create_chat(session, user, CreateChat(origin=1), False) + return {"access_token": t.access_token} def get_user(session: SessionDep, token: str): @@ -80,10 +86,74 @@ def get_user(session: SessionDep, token: str): return session_user -@router.post("/mcp_ds_list", operation_id="mcp_datasource_list") -async def datasource_list(session: SessionDep, token: str): +@router.post("/mcp_start", operation_id="mcp_start") +@system_log(LogConfig( + operation_type=OperationType.CREATE, + module=OperationModules.CHAT, + result_id_expr="id", + save_on_success_only=True +)) +async def mcp_start(session: SessionDep, trans: Trans, chat: ChatStart): + res_token = None + user = None + if chat.token: + res_token = chat.token + user = get_user(session, chat.token) + else: + user = authenticate(session=session, account=chat.username, password=chat.password) + if not user: + raise HTTPException(status_code=400, detail="Incorrect account or password") + + if not user.oid or user.oid == 0: + raise HTTPException(status_code=400, detail="No associated workspace, Please contact the administrator") + access_token_expires = timedelta(minutes=settings.ACCESS_TOKEN_EXPIRE_MINUTES) + user_dict = user.to_dict() + t = Token(access_token=create_access_token( + user_dict, expires_delta=access_token_expires + )) + res_token = t.access_token + + if chat.oid: + w_list = await user_ws_options(session, user.id, trans) + oid_list = [item.id for item in w_list] + if int(chat.oid) not in oid_list: + raise HTTPException(status_code=400, detail="The current user is not in the selected workspace") + + user.oid = int(chat.oid) + + request = RequestContext.get_request() + request.state.current_user = user + + c = create_chat(session, user, CreateChat(origin=1), False) + return {"access_token": res_token, "chat_id": c.id} + + +@router.post("/mcp_ws_list", operation_id="mcp_ws_list") +async def ws_list(session: SessionDep, trans: Trans, token: str): session_user = get_user(session, token) - return get_datasource_list(session=session, user=session_user) + return await user_ws_options(session, session_user.id, trans) + + +@router.post("/mcp_ds_list", operation_id="mcp_datasource_list") +async def datasource_list(session: SessionDep, trans: Trans, mcp_ds: McpDs): + session_user = get_user(session, mcp_ds.token) + if mcp_ds.oid: + w_list = await user_ws_options(session, session_user.id, trans) + oid_list = [item.id for item in w_list] + if int(mcp_ds.oid) not in oid_list: + raise HTTPException(status_code=400, detail="The current user is not in the selected workspace") + + session_user.oid = int(mcp_ds.oid) + ds_list = get_datasource_list(session=session, user=session_user) + result = [] + for item in ds_list: + dic = item.__dict__ + dic.pop('embedding', None) + dic.pop('table_relation', None) + dic.pop('recommended_config', None) + dic.pop('configuration', None) + result.append(dic) + return result # @@ -93,33 +163,41 @@ async def datasource_list(session: SessionDep, token: str): # return session.query(AiModelDetail).all() -@router.post("/mcp_start", operation_id="mcp_start") -async def mcp_start(session: SessionDep, chat: ChatStart): - user: BaseUserDTO = authenticate(session=session, account=chat.username, password=chat.password) - if not user: - raise HTTPException(status_code=400, detail="Incorrect account or password") - - if not user.oid or user.oid == 0: - raise HTTPException(status_code=400, detail="No associated workspace, Please contact the administrator") - access_token_expires = timedelta(minutes=settings.ACCESS_TOKEN_EXPIRE_MINUTES) - user_dict = user.to_dict() - t = Token(access_token=create_access_token( - user_dict, expires_delta=access_token_expires - )) - c = create_chat(session, user, CreateChat(origin=1), False) - return {"access_token": t.access_token, "chat_id": c.id} - - @router.post("/mcp_question", operation_id="mcp_question") -async def mcp_question(session: SessionDep, chat: McpQuestion): +async def mcp_question(session: SessionDep, trans: Trans, chat: McpQuestion): session_user = get_user(session, chat.token) - - mcp_chat = ChatMcp(token=chat.token, chat_id=chat.chat_id, question=chat.question) + lang = chat.lang + if lang in ["zh-CN", "zh-TW", "en", "ko-KR"]: + session_user.language = lang + # if chat.oid: + # w_list = await user_ws_options(session, session_user.id, trans) + # oid_list = [item.id for item in w_list] + # if int(chat.oid) not in oid_list: + # raise HTTPException(status_code=400, detail="The current user is not in the selected workspace") + # + # session_user.oid = int(chat.oid) + ds_id: Optional[int] = None + if chat.datasource_id: + if isinstance(chat.datasource_id, str): + if chat.datasource_id.strip() == "": + ds_id = None + else: + try: + ds_id = int(chat.datasource_id.strip()) + except ValueError: + raise HTTPException(status_code=400, detail="Invalid datasource ID") + elif isinstance(chat.datasource_id, int): + ds_id = chat.datasource_id + else: + raise HTTPException(status_code=400, detail="Invalid datasource ID") + + mcp_chat = ChatMcp(token=chat.token, chat_id=chat.chat_id, question=chat.question, datasource_id=ds_id) return await question_answer_inner(session=session, current_user=session_user, request_question=mcp_chat, - in_chat=False, stream=chat.stream) + in_chat=False, stream=chat.stream, return_img=chat.return_img) +# Cordys crm @router.post("/mcp_assistant", operation_id="mcp_assistant") async def mcp_assistant(session: SessionDep, chat: McpAssistant): session_user = BaseUserDTO(**{ diff --git a/backend/apps/swagger/i18n.py b/backend/apps/swagger/i18n.py index c0ed7a746..39a6aa71e 100644 --- a/backend/apps/swagger/i18n.py +++ b/backend/apps/swagger/i18n.py @@ -107,6 +107,10 @@ def load_translation(lang: str) -> Dict[str, str]: { "name": "Audit", "description": f"{PLACEHOLDER_PREFIX}audit_api" + }, + { + "name": "System_variable", + "description": f"{PLACEHOLDER_PREFIX}variable_api" } ] diff --git a/backend/apps/swagger/locales/en.json b/backend/apps/swagger/locales/en.json index f4499c9a9..5d84258f4 100644 --- a/backend/apps/swagger/locales/en.json +++ b/backend/apps/swagger/locales/en.json @@ -22,6 +22,8 @@ "ds_preview_data": "Preview Data", "ds_upload_excel": "Upload Excel", "ds_excel": "File", + "ds_parse_excel": "Parse Excel and Preview Data", + "ds_import_to_db": "Import Data to Database", "ds_export_ds_schema": "Export Comment", "ds_upload_ds_schema": "Upload Comment", @@ -90,6 +92,13 @@ "system_model_create": "Save Model", "system_model_update": "Update Model", "system_model_del": "Delete Model", + "enable_custom_model": "Enable Custom Model", + "custom_model": "Custom Model", + "system_model_ws_mapping": "Query Model-Workspace Authorization Relationships", + "system_model_ws_mapping_update": "Update Model-Workspace Authorization Relationships", + "system_model_ws_mapping_add": "Add Model-Workspace Authorization Relationships", + "system_model_ws_mapping_delete": "Delete Model-Workspace Authorization Relationships", + "system_model_list_by_ws": "Get Model List by Workspace", "model_name": "Name", "model_type": "Type", "base_model": "Base Model", @@ -115,6 +124,8 @@ "assistant_type": "Assistant Type (0: Basic, 1: Advanced, 4: Page)", "assistant_configuration": "Configuration", "assistant_description": "Description", + "assistant_enableCustomModel": "Use specified model", + "assistant_customModel": "Large Language Model", "system_embedded_api": "Page Embedded API", "embedded_resetsecret_api": "Reset Secret", @@ -140,7 +151,10 @@ "get_chat": "Get Chat Details", "get_chat_with_data": "Get Chat Details (With Data)", "get_chart_data": "Get Chart Data", + "get_chart_data_live": "Get Chart Data Live", "get_chart_predict_data": "Get Chart Prediction Data", + "get_record_log": "Get Chart Record Log", + "get_record_usage": "Get Chart Record Token Usage & Duration", "rename_chat": "Rename Chat", "delete_chat": "Delete Chat", "start_chat": "Create Chat", @@ -188,5 +202,11 @@ "delete_resource_api": "Delete Resource", "create_canvas_api": "Create Dashboard", "update_canvas_api": "Update Dashboard", - "check_name_api": "Name Validation" + "check_name_api": "Name Validation", + + "variable_api": "System Variable", + "variable_save": "Save", + "variable_delete": "Delete", + "variable_list": "List", + "variable_page": "Pager" } \ No newline at end of file diff --git a/backend/apps/swagger/locales/zh.json b/backend/apps/swagger/locales/zh.json index 443dd4731..397fda5e3 100644 --- a/backend/apps/swagger/locales/zh.json +++ b/backend/apps/swagger/locales/zh.json @@ -22,6 +22,8 @@ "ds_preview_data": "预览数据", "ds_upload_excel": "上传Excel", "ds_excel": "文件", + "ds_parse_excel": "解析Excel并预览数据", + "ds_import_to_db": "导入数据到数据库", "ds_export_ds_schema": "导出备注信息", "ds_upload_ds_schema": "导入备注信息", @@ -90,6 +92,13 @@ "system_model_create": "保存模型", "system_model_update": "更新模型", "system_model_del": "删除模型", + "enable_custom_model": "启用自定义模型", + "custom_model": "自定义模型", + "system_model_ws_mapping": "查询模型授权工作空间的关联关系", + "system_model_ws_mapping_update": "更新模型授权工作空间的关联关系", + "system_model_ws_mapping_add": "新增模型授权工作空间的关联关系", + "system_model_ws_mapping_delete": "删除模型授权工作空间的关联关系", + "system_model_list_by_ws": "根据工作空间获取模型列表", "model_name": "名称", "model_type": "类型", "base_model": "基础模型", @@ -115,6 +124,8 @@ "assistant_type": "助手类型(0: 基础, 1: 高级, 4: 页面)", "assistant_configuration": "配置", "assistant_description": "描述", + "assistant_enableCustomModel": "使用指定大模型", + "assistant_customModel": "大语言模型", "system_embedded_api": "页面嵌入式api", "embedded_resetsecret_api": "重置 Secret", @@ -140,7 +151,10 @@ "get_chat": "获取对话详情", "get_chat_with_data": "获取对话详情(带数据)", "get_chart_data": "获取图表数据", + "get_chart_data_live": "获取图表实时数据", "get_chart_predict_data": "获取图表预测数据", + "get_record_log": "获取对话日志", + "get_record_usage": "获取对话Token使用量及耗时", "rename_chat": "重命名对话", "delete_chat": "删除对话", "start_chat": "创建对话", @@ -188,5 +202,11 @@ "delete_resource_api": "删除资源", "create_canvas_api": "新建仪表板", "update_canvas_api": "更新仪表板", - "check_name_api": "名称校验" + "check_name_api": "名称校验", + + "variable_api": "系统变量", + "variable_save": "保存变量", + "variable_delete": "删除变量", + "variable_list": "获取变量", + "variable_page": "获取变量分页" } diff --git a/backend/apps/system/api/aimodel.py b/backend/apps/system/api/aimodel.py index ce37229e2..620adac7b 100644 --- a/backend/apps/system/api/aimodel.py +++ b/backend/apps/system/api/aimodel.py @@ -1,16 +1,17 @@ import json from typing import List, Union +from fastapi import APIRouter, Path, Query, Body from fastapi.responses import StreamingResponse +from sqlmodel import func, select, update, delete + from apps.ai_model.model_factory import LLMConfig, LLMFactory from apps.swagger.i18n import PLACEHOLDER_PREFIX +from apps.system.crud.aimodel_manage import get_ai_model_list_by_workspace +from apps.system.models.system_model import AiModelDetail, AiModelWorkspaceMapping, AiModelBrief from apps.system.schemas.ai_model_schema import AiModelConfigItem, AiModelCreator, AiModelEditor, AiModelGridItem -from fastapi import APIRouter, Path, Query -from sqlmodel import func, select, update - -from apps.system.models.system_model import AiModelDetail from apps.system.schemas.permission import SqlbotPermission, require_permissions -from common.core.deps import SessionDep, Trans +from common.core.deps import SessionDep, Trans, CurrentUser from common.utils.crypto import sqlbot_decrypt from common.utils.time import get_timestamp from common.utils.utils import SQLBotLogUtil, prepare_model_arg @@ -19,12 +20,14 @@ from common.audit.models.log_model import OperationType, OperationModules from common.audit.schemas.logger_decorator import LogConfig, system_log + @router.post("/status", include_in_schema=False) -@require_permissions(permission=SqlbotPermission(role=['admin'])) +@require_permissions(permission=SqlbotPermission(role=['admin'])) async def check_llm(info: AiModelCreator, trans: Trans): async def generate(): try: - additional_params = {item.key: prepare_model_arg(item.val) for item in info.config_list if item.key and item.val} + additional_params = {item.key: prepare_model_arg(item.val) for item in info.config_list if + item.key and item.val} config = LLMConfig( model_type="openai" if info.protocol == 1 else "vllm", model_name=info.base_model, @@ -39,14 +42,15 @@ async def generate(): yield json.dumps({"content": chunk}) + "\n" if chunk and isinstance(chunk, dict) and chunk.content: yield json.dumps({"content": chunk.content}) + "\n" - + except Exception as e: SQLBotLogUtil.error(f"Error checking LLM: {e}") error_msg = trans('i18n_llm.validate_error', msg=str(e)) yield json.dumps({"error": error_msg}) + "\n" - + return StreamingResponse(generate(), media_type="application/x-ndjson") + @router.get("/default", include_in_schema=False) async def check_default(session: SessionDep, trans: Trans): db_model = session.exec( @@ -54,8 +58,10 @@ async def check_default(session: SessionDep, trans: Trans): ).first() if not db_model: raise Exception(trans('i18n_llm.miss_default')) - -@router.put("/default/{id}", summary=f"{PLACEHOLDER_PREFIX}system_model_default", description=f"{PLACEHOLDER_PREFIX}system_model_default") + + +@router.put("/default/{id}", summary=f"{PLACEHOLDER_PREFIX}system_model_default", + description=f"{PLACEHOLDER_PREFIX}system_model_default") @require_permissions(permission=SqlbotPermission(role=['admin'])) @system_log(LogConfig(operation_type=OperationType.UPDATE, module=OperationModules.AI_MODEL, resource_id_expr="id")) async def set_default(session: SessionDep, id: int = Path(description="ID")): @@ -76,27 +82,46 @@ async def set_default(session: SessionDep, id: int = Path(description="ID")): session.rollback() raise e -@router.get("", response_model=list[AiModelGridItem], summary=f"{PLACEHOLDER_PREFIX}system_model_grid", description=f"{PLACEHOLDER_PREFIX}system_model_grid") -@require_permissions(permission=SqlbotPermission(role=['admin'])) + +@router.get("", response_model=list[AiModelGridItem], summary=f"{PLACEHOLDER_PREFIX}system_model_grid", + description=f"{PLACEHOLDER_PREFIX}system_model_grid") +@require_permissions(permission=SqlbotPermission(role=['admin'])) async def query( session: SessionDep, keyword: Union[str, None] = Query(default=None, max_length=255, description=f"{PLACEHOLDER_PREFIX}keyword") ): - statement = select(AiModelDetail.id, - AiModelDetail.name, - AiModelDetail.model_type, - AiModelDetail.base_model, - AiModelDetail.supplier, - AiModelDetail.protocol, - AiModelDetail.default_model) + # 子查询:统计每个 model 绑定的 workspace 数量 + count_sub = ( + select( + AiModelWorkspaceMapping.ai_model_id, + func.count().label("ws_mapping_count") + ) + .group_by(AiModelWorkspaceMapping.ai_model_id) + .subquery() + ) + statement = ( + select( + AiModelDetail.id, + AiModelDetail.name, + AiModelDetail.model_type, + AiModelDetail.base_model, + AiModelDetail.supplier, + AiModelDetail.protocol, + AiModelDetail.default_model, + func.coalesce(count_sub.c.ws_mapping_count, 0).label("ws_mapping_count"), + ) + .outerjoin(count_sub, AiModelDetail.id == count_sub.c.ai_model_id) + ) if keyword is not None: statement = statement.where(AiModelDetail.name.like(f"%{keyword}%")) statement = statement.order_by(AiModelDetail.default_model.desc(), AiModelDetail.name, AiModelDetail.create_time) items = session.exec(statement).all() return items -@router.get("/{id}", response_model=AiModelEditor, summary=f"{PLACEHOLDER_PREFIX}system_model_query", description=f"{PLACEHOLDER_PREFIX}system_model_query") -@require_permissions(permission=SqlbotPermission(role=['admin'])) + +@router.get("/{id}", response_model=AiModelEditor, summary=f"{PLACEHOLDER_PREFIX}system_model_query", + description=f"{PLACEHOLDER_PREFIX}system_model_query") +@require_permissions(permission=SqlbotPermission(role=['admin'])) async def get_model_by_id( session: SessionDep, id: int = Path(description="ID") @@ -124,7 +149,9 @@ async def get_model_by_id( data["config_list"] = config_list return AiModelEditor(**data) -@router.post("", summary=f"{PLACEHOLDER_PREFIX}system_model_create", description=f"{PLACEHOLDER_PREFIX}system_model_create") + +@router.post("", summary=f"{PLACEHOLDER_PREFIX}system_model_create", + description=f"{PLACEHOLDER_PREFIX}system_model_create") @require_permissions(permission=SqlbotPermission(role=['admin'])) @system_log(LogConfig(operation_type=OperationType.CREATE, module=OperationModules.AI_MODEL, result_id_expr="id")) async def add_model( @@ -143,9 +170,12 @@ async def add_model( session.commit() return detail -@router.put("", summary=f"{PLACEHOLDER_PREFIX}system_model_update", description=f"{PLACEHOLDER_PREFIX}system_model_update") + +@router.put("", summary=f"{PLACEHOLDER_PREFIX}system_model_update", + description=f"{PLACEHOLDER_PREFIX}system_model_update") @require_permissions(permission=SqlbotPermission(role=['admin'])) -@system_log(LogConfig(operation_type=OperationType.UPDATE, module=OperationModules.AI_MODEL, resource_id_expr="editor.id")) +@system_log( + LogConfig(operation_type=OperationType.UPDATE, module=OperationModules.AI_MODEL, resource_id_expr="editor.id")) async def update_model( session: SessionDep, editor: AiModelEditor @@ -155,12 +185,14 @@ async def update_model( data["config"] = json.dumps([item.model_dump(exclude_unset=True) for item in editor.config_list]) data.pop("config_list", None) db_model = session.get(AiModelDetail, id) - #update_data = AiModelDetail.model_validate(data) + # update_data = AiModelDetail.model_validate(data) db_model.sqlmodel_update(data) session.add(db_model) session.commit() -@router.delete("/{id}", summary=f"{PLACEHOLDER_PREFIX}system_model_del", description=f"{PLACEHOLDER_PREFIX}system_model_del") + +@router.delete("/{id}", summary=f"{PLACEHOLDER_PREFIX}system_model_del", + description=f"{PLACEHOLDER_PREFIX}system_model_del") @require_permissions(permission=SqlbotPermission(role=['admin'])) @system_log(LogConfig(operation_type=OperationType.DELETE, module=OperationModules.AI_MODEL, resource_id_expr="id")) async def delete_model( @@ -170,9 +202,161 @@ async def delete_model( ): item = session.get(AiModelDetail, id) if item.default_model: - raise Exception(trans('i18n_llm.delete_default_error', key = item.name)) + raise Exception(trans('i18n_llm.delete_default_error', key=item.name)) session.delete(item) session.commit() - - \ No newline at end of file + +@router.get("/{id}/ws_mapping", response_model=List[str], summary=f"{PLACEHOLDER_PREFIX}system_model_ws_mapping", + description=f"{PLACEHOLDER_PREFIX}system_model_ws_mapping") +@require_permissions(permission=SqlbotPermission(role=['admin'])) +async def get_model_ws_mapping_by_id( + session: SessionDep, + id: int = Path(description="ID") +): + db_model = session.get(AiModelDetail, id) + if not db_model: + raise ValueError(f"AiModelDetail with id {id} not found") + + # 根据 ai_model_id 查询关联的 workspace_id 列表 + stmt = ( + select(AiModelWorkspaceMapping.workspace_id) + .where(AiModelWorkspaceMapping.ai_model_id == id) + .distinct() + ) + ws_ids: List[int] = session.exec(stmt).all() + + return [str(ws_id) for ws_id in ws_ids] + + +@router.put("/{id}/ws_mapping", response_model=List[str], summary=f"{PLACEHOLDER_PREFIX}system_model_ws_mapping_update", + description=f"{PLACEHOLDER_PREFIX}system_model_ws_mapping_update") +@require_permissions(permission=SqlbotPermission(role=['admin'])) +async def update_model_ws_mapping_by_id( + session: SessionDep, + id: int = Path(description="ID"), + ws_ids: List[str] = Body(description="workspace id list"), +): + if ws_ids is None: + ws_ids = [] + # 提前去重 + ws_ids = list({int(ws_id) for ws_id in ws_ids}) + + db_model = session.get(AiModelDetail, id) + if not db_model: + raise ValueError(f"AiModelDetail with id {id} not found") + + # 根据 ai_model_id 更新关联的 workspace_id 列表 + # 1. 批量删除旧映射 + session.execute( + delete(AiModelWorkspaceMapping) + .where(AiModelWorkspaceMapping.ai_model_id == id) + ) + + # 2. 插入去重后的映射关系 + for ws_id in ws_ids: + session.add( + AiModelWorkspaceMapping(ai_model_id=id, workspace_id=ws_id) + ) + + session.commit() + + return [str(ws_id) for ws_id in ws_ids] + + +# 新增映射(在已有基础上追加) +@router.post("/{id}/ws_mapping", response_model=List[str], summary=f"{PLACEHOLDER_PREFIX}system_model_ws_mapping_add", + description=f"{PLACEHOLDER_PREFIX}system_model_ws_mapping_add") +@require_permissions(permission=SqlbotPermission(role=['admin'])) +async def add_model_ws_mapping_by_id( + session: SessionDep, + id: int = Path(description="ID"), + ws_ids: List[str] = Body(description="workspace id list"), +): + if ws_ids is None: + ws_ids = [] + ws_ids = list({int(ws_id) for ws_id in ws_ids}) + + db_model = session.get(AiModelDetail, id) + if not db_model: + raise ValueError(f"AiModelDetail with id {id} not found") + + # 查询已存在的映射,过滤掉重复的 + existing_stmt = ( + select(AiModelWorkspaceMapping.workspace_id) + .where( + AiModelWorkspaceMapping.ai_model_id == id, + AiModelWorkspaceMapping.workspace_id.in_(ws_ids), + ) + ) + existing_ws_ids = set(session.exec(existing_stmt).all()) + + # 只插入不存在的映射 + new_ws_ids = [ws_id for ws_id in ws_ids if ws_id not in existing_ws_ids] + for ws_id in new_ws_ids: + session.add( + AiModelWorkspaceMapping(ai_model_id=id, workspace_id=ws_id) + ) + + session.commit() + + # 返回完整的映射列表 + all_stmt = ( + select(AiModelWorkspaceMapping.workspace_id) + .where(AiModelWorkspaceMapping.ai_model_id == id) + .distinct() + ) + all_ws_ids: List[int] = session.exec(all_stmt).all() + + return [str(ws_id) for ws_id in all_ws_ids] + + +# 删除指定映射 +@router.delete("/{id}/ws_mapping", response_model=List[str], + summary=f"{PLACEHOLDER_PREFIX}system_model_ws_mapping_delete", + description=f"{PLACEHOLDER_PREFIX}system_model_ws_mapping_delete") +@require_permissions(permission=SqlbotPermission(role=['admin'])) +async def delete_model_ws_mapping_by_id( + session: SessionDep, + id: int = Path(description="ID"), + ws_ids: List[str] = Body(description="workspace id list"), +): + if ws_ids is None: + ws_ids = [] + ws_ids = list({int(ws_id) for ws_id in ws_ids}) + + db_model = session.get(AiModelDetail, id) + if not db_model: + raise ValueError(f"AiModelDetail with id {id} not found") + + # 只删除指定的映射 + if ws_ids: + session.execute( + delete(AiModelWorkspaceMapping) + .where( + AiModelWorkspaceMapping.ai_model_id == id, + AiModelWorkspaceMapping.workspace_id.in_(ws_ids), + ) + ) + + session.commit() + + # 返回剩余的映射列表 + stmt = ( + select(AiModelWorkspaceMapping.workspace_id) + .where(AiModelWorkspaceMapping.ai_model_id == id) + .distinct() + ) + remaining_ws_ids: List[int] = session.exec(stmt).all() + + return [str(ws_id) for ws_id in remaining_ws_ids] + + +@router.get("/list/by_ws", response_model=List[AiModelBrief], summary=f"{PLACEHOLDER_PREFIX}system_model_list_by_ws", + description=f"{PLACEHOLDER_PREFIX}system_model_list_by_ws") +@require_permissions(permission=SqlbotPermission(role=['ws_admin'])) +async def get_model_by_ws( + session: SessionDep, + current_user: CurrentUser +): + return get_ai_model_list_by_workspace(session, current_user.oid, False) diff --git a/backend/apps/system/api/assistant.py b/backend/apps/system/api/assistant.py index 59c954786..138e534c2 100644 --- a/backend/apps/system/api/assistant.py +++ b/backend/apps/system/api/assistant.py @@ -1,6 +1,7 @@ import json import os -from datetime import timedelta +from datetime import datetime, timedelta, timezone +from zoneinfo import ZoneInfo from typing import List, Optional from fastapi import APIRouter, Form, HTTPException, Path, Query, Request, Response, UploadFile @@ -8,41 +9,97 @@ from sqlbot_xpack.file_utils import SQLBotFileUtils from sqlmodel import select +from apps.datasource.models.datasource import CoreDatasource +from apps.db.constant import DB from apps.swagger.i18n import PLACEHOLDER_PREFIX -from apps.system.crud.assistant import get_assistant_info +from apps.system.crud.assistant import AssistantOutDs, AssistantOutDsFactory, get_assistant_info from apps.system.crud.assistant_manage import dynamic_upgrade_cors, save from apps.system.models.system_model import AssistantModel from apps.system.schemas.auth import CacheName, CacheNamespace +from apps.system.schemas.permission import SqlbotPermission, require_permissions from apps.system.schemas.system_schema import AssistantBase, AssistantDTO, AssistantUiSchema, AssistantValidator from common.core.config import settings -from common.core.deps import SessionDep, Trans, CurrentUser +from common.core.deps import CurrentAssistant, SessionDep, Trans, CurrentUser from common.core.security import create_access_token from common.core.sqlbot_cache import clear_cache from common.utils.utils import get_origin_from_referer, origin_match_domain - router = APIRouter(tags=["system_assistant"], prefix="/system/assistant") from common.audit.models.log_model import OperationType, OperationModules from common.audit.schemas.logger_decorator import LogConfig, system_log - +from sqlbot_xpack.core import decrypt_embedded_sign @router.get("/info/{id}", include_in_schema=False) -async def info(request: Request, response: Response, session: SessionDep, trans: Trans, id: int) -> AssistantModel: +async def info(request: Request, response: Response, session: SessionDep, trans: Trans, id: int, virtual: Optional[int] = Query(None)): if not id: raise Exception('miss assistant id') db_model = await get_assistant_info(session=session, assistant_id=id) if not db_model: raise RuntimeError(f"assistant application not exist") db_model = AssistantModel.model_validate(db_model) - - origin = request.headers.get("origin") or get_origin_from_referer(request) - if not origin: - raise RuntimeError(trans('i18n_embedded.invalid_origin', origin=origin or '')) - origin = origin.rstrip('/') - if not origin_match_domain(origin, db_model.domain): - raise RuntimeError(trans('i18n_embedded.invalid_origin', origin=origin or '')) - + + # 校验 SQLBOT-EMBEDDED-SIGN 请求头 + sign_header = request.headers.get("SQLBOT-EMBEDDED-SIGN") + if not sign_header: + raise RuntimeError(trans('i18n_embedded.invalid_origin', origin='')) + + sign_data = await decrypt_embedded_sign(sign_header) + + # 校验 assistant_id 与 id 参数一致 + if str(sign_data.get("assistant_id")) != str(id): + raise RuntimeError(trans('i18n_embedded.invalid_origin', origin='')) + + # 校验 target(来源域名)是否合法 + target = sign_data.get("target", "") + if not origin_match_domain(target, db_model.domain): + raise RuntimeError(trans('i18n_embedded.invalid_origin', origin=target or '')) + + # 校验 sign_time 是否在 10 秒内 + sign_time_str = sign_data.get("sign_time", "") + sign_time = datetime.fromisoformat(sign_time_str) + now_utc = datetime.now(timezone.utc) + sign_time_utc = sign_time.astimezone(timezone.utc) + if abs((now_utc - sign_time_utc).total_seconds()) > 10: + raise RuntimeError(trans('i18n_embedded.invalid_origin', origin=target or '')) + + # 校验是否为真实浏览器请求(非自动化工具) + if sign_data.get("webdriver", False): + raise RuntimeError(trans('i18n_embedded.invalid_origin', origin=target or '')) + + # 校验 User-Agent 一致性(签名中的 navigator.userAgent 与请求头一致) + sign_user_agent = sign_data.get("user_agent", "") + request_user_agent = request.headers.get("User-Agent", "") + if sign_user_agent != request_user_agent: + raise RuntimeError(trans('i18n_embedded.invalid_origin', origin=target or '')) + + # 校验 timezone 与 sign_time 偏移一致性(防时区伪造) + tz_name = sign_data.get("timezone", "") + tz = ZoneInfo(tz_name) + sign_time_naive = sign_time.replace(tzinfo=None) + if tz.utcoffset(sign_time_naive) != sign_time.utcoffset(): + raise RuntimeError(trans('i18n_embedded.invalid_origin', origin=target or '')) + + origin = target.rstrip('/') + response.headers["Access-Control-Allow-Origin"] = origin - return db_model + + + assistant_oid = 1 + if (db_model.type == 0): + configuration = db_model.configuration + config_obj = json.loads(configuration) if configuration else {} + assistant_oid = config_obj.get('oid', 1) + + access_token_expires = timedelta(minutes=settings.ACCESS_TOKEN_EXPIRE_MINUTES) + assistantDict = { + "id": virtual, "account": 'sqlbot-inner-assistant', "oid": assistant_oid, "assistant_id": id + } + access_token = create_access_token( + assistantDict, expires_delta=access_token_expires + ) + + result = db_model.model_dump() + result["token"] = access_token + return result @router.get("/app/{appId}", include_in_schema=False) @@ -64,7 +121,7 @@ async def getApp(request: Request, response: Response, session: SessionDep, tran return db_model -@router.get("/validator", response_model=AssistantValidator, include_in_schema=False) +""" @router.get("/validator", response_model=AssistantValidator, include_in_schema=False) async def validator(session: SessionDep, id: int, virtual: Optional[int] = Query(None)): if not id: raise Exception('miss assistant id') @@ -86,7 +143,7 @@ async def validator(session: SessionDep, id: int, virtual: Optional[int] = Query access_token = create_access_token( assistantDict, expires_delta=access_token_expires ) - return AssistantValidator(True, True, True, access_token) + return AssistantValidator(True, True, True, access_token) """ @router.get('/picture/{file_id}', summary=f"{PLACEHOLDER_PREFIX}assistant_picture_api", description=f"{PLACEHOLDER_PREFIX}assistant_picture_api") @@ -108,6 +165,7 @@ def iterfile(): @router.patch('/ui', summary=f"{PLACEHOLDER_PREFIX}assistant_ui_api", description=f"{PLACEHOLDER_PREFIX}assistant_ui_api") +@require_permissions(permission=SqlbotPermission(role=['ws_admin'])) @system_log(LogConfig(operation_type=OperationType.UPDATE, module=OperationModules.APPLICATION, result_id_expr="id")) async def ui(session: SessionDep, data: str = Form(), files: List[UploadFile] = []): json_data = json.loads(data) @@ -127,7 +185,7 @@ async def ui(session: SessionDep, data: str = Form(), files: List[UploadFile] = file.filename = file_name if flag_name == 'logo' or flag_name == 'float_icon': try: - SQLBotFileUtils.check_file(file=file, file_types=[".jpg", ".png", ".svg"], + SQLBotFileUtils.check_file(file=file, file_types=[".jpg", ".jpeg", ".png"], limit_file_size=(10 * 1024 * 1024)) except ValueError as e: error_msg = str(e) @@ -163,22 +221,77 @@ async def ui(session: SessionDep, data: str = Form(), files: List[UploadFile] = async def clear_ui_cache(id: int): pass +@router.get("/ds", include_in_schema=False, response_model=list[dict]) +async def ds(session: SessionDep, current_assistant: CurrentAssistant): + if current_assistant.type == 0: + online = current_assistant.online + configuration = current_assistant.configuration + config: dict[any] = json.loads(configuration) + oid: int = int(config['oid']) + stmt = select(CoreDatasource.id, CoreDatasource.name, CoreDatasource.description, CoreDatasource.type, CoreDatasource.type_name, CoreDatasource.num).where( + CoreDatasource.oid == oid) + if not online: + public_list: list[int] = config.get('public_list') or None + if public_list: + stmt = stmt.where(CoreDatasource.id.in_(public_list)) + else: + return [] + db_ds_list = session.exec(stmt) + return [ + { + "id": ds.id, + "name": ds.name, + "description": ds.description, + "type": ds.type, + "type_name": ds.type_name, + "num": ds.num, + } + for ds in db_ds_list] + if current_assistant.type == 1: + out_ds_instance: AssistantOutDs = AssistantOutDsFactory.get_instance(current_assistant) + return [ + { + "id": str(ds.id), + "name": ds.name, + "description": ds.description or ds.comment, + "type": ds.type, + "type_name": get_db_type(ds.type), + "num": len(ds.tables) if ds.tables else 0, + } + for ds in out_ds_instance.ds_list + if get_db_type(ds.type) + ] + + return None + +def get_db_type(type): + try: + db = DB.get_db(type) + return db.db_name + except Exception: + return None + @router.get("", response_model=list[AssistantModel], summary=f"{PLACEHOLDER_PREFIX}assistant_grid_api", description=f"{PLACEHOLDER_PREFIX}assistant_grid_api") +@require_permissions(permission=SqlbotPermission(role=['ws_admin'])) async def query(session: SessionDep, current_user: CurrentUser): list_result = session.exec(select(AssistantModel).where(AssistantModel.oid == current_user.oid, AssistantModel.type != 4).order_by(AssistantModel.name, AssistantModel.create_time)).all() + for model in list_result: + model.enable_custom_model = model.enable_custom_model or False return list_result @router.get("/advanced_application", response_model=list[AssistantModel], include_in_schema=False) -async def query_advanced_application(session: SessionDep): - list_result = session.exec(select(AssistantModel).where(AssistantModel.type == 1).order_by(AssistantModel.name, +@require_permissions(permission=SqlbotPermission(role=['ws_admin'])) +async def query_advanced_application(session: SessionDep, current_user: CurrentUser): + list_result = session.exec(select(AssistantModel).where(AssistantModel.type == 1, AssistantModel.oid == current_user.oid).order_by(AssistantModel.name, AssistantModel.create_time)).all() return list_result @router.post("", summary=f"{PLACEHOLDER_PREFIX}assistant_create_api", description=f"{PLACEHOLDER_PREFIX}assistant_create_api") +@require_permissions(permission=SqlbotPermission(role=['ws_admin'])) @system_log(LogConfig(operation_type=OperationType.CREATE, module=OperationModules.APPLICATION, result_id_expr="id")) async def add(request: Request, session: SessionDep, current_user: CurrentUser, creator: AssistantBase): oid = current_user.oid if creator.type != 4 else 1 @@ -186,6 +299,7 @@ async def add(request: Request, session: SessionDep, current_user: CurrentUser, @router.put("", summary=f"{PLACEHOLDER_PREFIX}assistant_update_api", description=f"{PLACEHOLDER_PREFIX}assistant_update_api") +@require_permissions(permission=SqlbotPermission(role=['ws_admin'])) @clear_cache(namespace=CacheNamespace.EMBEDDED_INFO, cacheName=CacheName.ASSISTANT_INFO, keyExpression="editor.id") @system_log(LogConfig(operation_type=OperationType.UPDATE, module=OperationModules.APPLICATION, resource_id_expr="editor.id")) async def update(request: Request, session: SessionDep, editor: AssistantDTO): @@ -200,16 +314,17 @@ async def update(request: Request, session: SessionDep, editor: AssistantDTO): dynamic_upgrade_cors(request=request, session=session) -@router.get("/{id}", response_model=AssistantModel, summary=f"{PLACEHOLDER_PREFIX}assistant_query_api", description=f"{PLACEHOLDER_PREFIX}assistant_query_api") +""" @router.get("/{id}", response_model=AssistantModel, summary=f"{PLACEHOLDER_PREFIX}assistant_query_api", description=f"{PLACEHOLDER_PREFIX}assistant_query_api") async def get_one(session: SessionDep, id: int = Path(description="ID")): db_model = await get_assistant_info(session=session, assistant_id=id) if not db_model: raise ValueError(f"AssistantModel with id {id} not found") db_model = AssistantModel.model_validate(db_model) - return db_model + return db_model """ @router.delete("/{id}", summary=f"{PLACEHOLDER_PREFIX}assistant_del_api", description=f"{PLACEHOLDER_PREFIX}assistant_del_api") +@require_permissions(permission=SqlbotPermission(role=['ws_admin'])) @clear_cache(namespace=CacheNamespace.EMBEDDED_INFO, cacheName=CacheName.ASSISTANT_INFO, keyExpression="id") @system_log(LogConfig(operation_type=OperationType.DELETE, module=OperationModules.APPLICATION, resource_id_expr="id")) async def delete(request: Request, session: SessionDep, id: int = Path(description="ID")): @@ -219,3 +334,4 @@ async def delete(request: Request, session: SessionDep, id: int = Path(descripti session.delete(db_model) session.commit() dynamic_upgrade_cors(request=request, session=session) + diff --git a/backend/apps/system/api/user.py b/backend/apps/system/api/user.py index a8c152d22..20b379ef7 100644 --- a/backend/apps/system/api/user.py +++ b/backend/apps/system/api/user.py @@ -58,17 +58,34 @@ async def pager( status: Optional[int] = Query(None, description=f"{PLACEHOLDER_PREFIX}status"), origins: Optional[list[int]] = Query(None, description=f"{PLACEHOLDER_PREFIX}origin"), oidlist: Optional[list[int]] = Query(None, description=f"{PLACEHOLDER_PREFIX}oid"), + order_by: Optional[str] = Query(None, description="排序字段"), + desc: Optional[bool] = Query(False, description="是否降序"), ): pagination = PaginationParams(page=pageNum, size=pageSize) paginator = Paginator(session) - filters = {} - + + # 允许排序的字段白名单(防止 SQL 注入) + SORT_COLUMNS = { + 'account': UserModel.account, + 'create_time': UserModel.create_time, + 'name': UserModel.name, + 'email': UserModel.email, + 'status': UserModel.status, + } + sort_field = SORT_COLUMNS.get(order_by, UserModel.account) + sort_clause = sort_field.desc() if desc else sort_field.asc() + + # SELECT 列必须包含 ORDER BY 列(PostgreSQL DISTINCT 约束) + select_columns = [UserModel.id, UserModel.account] + if order_by and order_by != 'account': + select_columns.append(sort_field) + origin_stmt = ( - select(UserModel.id, UserModel.account) + select(*select_columns) .join(UserWsModel, UserModel.id == UserWsModel.uid, isouter=True) .where(UserModel.id != 1) .distinct() - .order_by(UserModel.account) + .order_by(sort_clause) ) if oidlist: @@ -89,8 +106,7 @@ async def pager( user_page = await paginator.get_paginated_response( stmt=origin_stmt, - pagination=pagination, - **filters) + pagination=pagination) uid_list = [item.get('id') for item in user_page.items] if not uid_list: return user_page @@ -98,7 +114,7 @@ async def pager( select(UserModel, UserWsModel.oid.label('ws_oid')) .join(UserWsModel, UserModel.id == UserWsModel.uid, isouter=True) .where(UserModel.id.in_(uid_list)) - .order_by(UserModel.account, UserModel.create_time) + .order_by(sort_clause) ) user_workspaces = session.exec(stmt).all() merged = defaultdict(list) @@ -176,11 +192,12 @@ async def user_create(session: SessionDep, creator: UserCreator, trans: Trans): async def create(session: SessionDep, creator: UserCreator, trans: Trans): if check_account_exists(session=session, account=creator.account): raise Exception(trans('i18n_exist', msg = f"{trans('i18n_user.account')} [{creator.account}]")) - if check_email_exists(session=session, email=creator.email): - raise Exception(trans('i18n_exist', msg = f"{trans('i18n_user.email')} [{creator.email}]")) + """ if check_email_exists(session=session, email=creator.email): + raise Exception(trans('i18n_exist', msg = f"{trans('i18n_user.email')} [{creator.email}]")) """ if not check_email_format(creator.email): raise Exception(trans('i18n_format_invalid', key = f"{trans('i18n_user.email')} [{creator.email}]")) - data = creator.model_dump(exclude_unset=True) + #data = creator.model_dump(exclude_unset=True) + data = creator.model_dump() user_model = UserModel.model_validate(data) #user_model.create_time = get_timestamp() user_model.language = "zh-CN" @@ -215,30 +232,40 @@ async def update(session: SessionDep, editor: UserEditor, trans: Trans): raise Exception(f"User with id [{editor.id}] not found!") if editor.account != user_model.account: raise Exception(f"account cannot be changed!") - if editor.email != user_model.email and check_email_exists(session=session, email=editor.email): - raise Exception(trans('i18n_exist', msg = f"{trans('i18n_user.email')} [{editor.email}]")) + """ if editor.email != user_model.email and check_email_exists(session=session, email=editor.email): + raise Exception(trans('i18n_exist', msg = f"{trans('i18n_user.email')} [{editor.email}]")) """ if not check_email_format(editor.email): raise Exception(trans('i18n_format_invalid', key = f"{trans('i18n_user.email')} [{editor.email}]")) origin_oid: int = user_model.oid - del_stmt = sqlmodel_delete(UserWsModel).where(UserWsModel.uid == editor.id) - session.exec(del_stmt) + + uws_list_stmt = select(UserWsModel).where(UserWsModel.uid == editor.id) + uws_list = session.exec(uws_list_stmt).all() + + existing_oids = {uws.oid for uws in uws_list} + new_oid_set = set(editor.oid_list) if editor.oid_list else set() + oids_to_remove = existing_oids - new_oid_set + oids_to_add = new_oid_set - existing_oids + + if oids_to_remove: + del_stmt = sqlmodel_delete(UserWsModel).where(UserWsModel.uid == editor.id, UserWsModel.oid.in_(oids_to_remove)) + session.exec(del_stmt) data = editor.model_dump(exclude_unset=True) user_model.sqlmodel_update(data) user_model.oid = 0 if editor.oid_list: - # need to validate oid_list - db_model_list = [ - UserWsModel.model_validate({ - "oid": oid, - "uid": user_model.id, - "weight": 0 - }) - for oid in editor.oid_list - ] - session.add_all(db_model_list) user_model.oid = origin_oid if origin_oid in editor.oid_list else editor.oid_list[0] + if oids_to_add: + db_uws_model_list = [ + UserWsModel.model_validate({ + "oid": oid, + "uid": user_model.id, + "weight": 0 + }) + for oid in oids_to_add + ] + session.add_all(db_uws_model_list) session.add(user_model) @router.delete("/{id}", summary=f"{PLACEHOLDER_PREFIX}user_del_api", description=f"{PLACEHOLDER_PREFIX}user_del_api") @@ -262,7 +289,7 @@ async def batch_del(session: SessionDep, id_list: list[int]): @clear_cache(namespace=CacheNamespace.AUTH_INFO, cacheName=CacheName.USER_INFO, keyExpression="current_user.id") async def langChange(session: SessionDep, current_user: CurrentUser, trans: Trans, language: UserLanguage): lang = language.language - if lang not in ["zh-CN", "en", "ko-KR"]: + if lang not in ["zh-CN", "zh-TW", "en", "ko-KR"]: raise Exception(trans('i18n_user.language_not_support', key = lang)) db_user: UserModel = get_db_user(session=session, user_id=current_user.id) db_user.language = lang diff --git a/backend/apps/system/api/variable_api.py b/backend/apps/system/api/variable_api.py new file mode 100644 index 000000000..ca5c952f5 --- /dev/null +++ b/backend/apps/system/api/variable_api.py @@ -0,0 +1,39 @@ +# Author: Junjun +# Date: 2026/1/26 +from typing import List +from fastapi import APIRouter + +from apps.swagger.i18n import PLACEHOLDER_PREFIX +from apps.system.crud.system_variable import save, delete, list_all, list_page +from apps.system.models.system_variable_model import SystemVariable +from common.core.config import settings +from common.core.deps import SessionDep, CurrentUser, Trans +from apps.system.schemas.permission import SqlbotPermission, require_permissions + +router = APIRouter(tags=["System_variable"], prefix="/sys_variable") +path = settings.EXCEL_PATH + + +@router.post("/save", response_model=None, summary=f"{PLACEHOLDER_PREFIX}variable_save") +@require_permissions(permission=SqlbotPermission(role=['admin'])) +async def save_variable(session: SessionDep, user: CurrentUser, trans: Trans, variable: SystemVariable): + return save(session, user, trans, variable) + + +@router.post("/delete",response_model=None, summary=f"{PLACEHOLDER_PREFIX}variable_delete") +@require_permissions(permission=SqlbotPermission(role=['admin'])) +async def delete_variable(session: SessionDep, ids: List[int]): + return delete(session, ids) + + +@router.post("/listAll",response_model=None, summary=f"{PLACEHOLDER_PREFIX}variable_list") +@require_permissions(permission=SqlbotPermission(role=['ws_admin'])) +async def list_all_data(session: SessionDep, trans: Trans, variable: SystemVariable = None): + return list_all(session, trans, variable) + + +@router.post("/listPage/{pageNum}/{pageSize}",response_model=None, summary=f"{PLACEHOLDER_PREFIX}variable_page") +@require_permissions(permission=SqlbotPermission(role=['admin'])) +async def pager(session: SessionDep, trans: Trans, pageNum: int, pageSize: int, + variable: SystemVariable = None): + return await list_page(session, trans, pageNum, pageSize, variable) diff --git a/backend/apps/system/crud/aimodel_manage.py b/backend/apps/system/crud/aimodel_manage.py index 2d4f5b752..b0fabdbd1 100644 --- a/backend/apps/system/crud/aimodel_manage.py +++ b/backend/apps/system/crud/aimodel_manage.py @@ -1,10 +1,11 @@ +from sqlmodel import Session, select, or_ -from apps.system.models.system_model import AiModelDetail +from apps.system.models.system_model import AiModelDetail, AiModelBrief, AiModelWorkspaceMapping from common.core.db import engine -from sqlmodel import Session, select from common.utils.crypto import sqlbot_encrypt from common.utils.utils import SQLBotLogUtil + async def async_model_info(): with Session(engine) as session: model_list = session.exec(select(AiModelDetail)).all() @@ -27,7 +28,40 @@ async def async_model_info(): session.add(model) if any_model_change: session.commit() - SQLBotLogUtil.info("✅ 异步加密已有模型的密钥和地址完成") - - - \ No newline at end of file + SQLBotLogUtil.info("✅ 异步加密已有模型的密钥和地址完成") + + +def get_ai_model_list_by_workspace(session: Session, workspace_id: int, with_default: bool = True): + sub_stmt = ( + select(AiModelWorkspaceMapping.ai_model_id) + .where(AiModelWorkspaceMapping.workspace_id == workspace_id) + .distinct() + ) + + # 查询:关联的模型 + default_model 为 True 的模型,默认模型排第一 + base_condition = AiModelDetail.id.in_(sub_stmt) + if with_default: + where_condition = or_(base_condition, AiModelDetail.default_model == True) + else: + where_condition = base_condition + stmt = ( + select( + AiModelDetail.id, + AiModelDetail.name, + AiModelDetail.default_model, + AiModelDetail.supplier, + ) + .where(where_condition) + .order_by(AiModelDetail.default_model.desc()) + ) + rows = session.exec(stmt).all() + + return [ + AiModelBrief( + id=row[0], + name=row[1], + default_model=row[2], + supplier=row[3], + ) + for row in rows + ] diff --git a/backend/apps/system/crud/assistant.py b/backend/apps/system/crud/assistant.py index 5cd27af83..0c9d60083 100644 --- a/backend/apps/system/crud/assistant.py +++ b/backend/apps/system/crud/assistant.py @@ -5,12 +5,10 @@ import requests from fastapi import FastAPI -from sqlalchemy import Engine, create_engine from sqlmodel import Session, select from starlette.middleware.cors import CORSMiddleware -# from apps.datasource.embedding.table_embedding import get_table_embedding -from apps.datasource.models.datasource import CoreDatasource, DatasourceConf +from apps.datasource.models.datasource import CoreDatasource from apps.datasource.utils.utils import aes_encrypt from apps.system.models.system_model import AssistantModel from apps.system.schemas.auth import CacheName, CacheNamespace @@ -19,8 +17,24 @@ from common.core.db import engine from common.core.sqlbot_cache import cache from common.utils.aes_crypto import simple_aes_decrypt -from common.utils.utils import equals_ignore_case, get_domain_list, string_to_numeric_hash +from common.utils.utils import SQLBotLogUtil, get_domain_list, string_to_numeric_hash from common.core.deps import Trans +from common.core.response_middleware import ResponseMiddleware + + +def _update_cors_middleware_instance(app: FastAPI, updated_origins: list[str]): + """遍历 middleware 栈,找到 CORSMiddleware 实例并更新其 allow_origins。 + + 仅修改 middleware.kwargs 不会影响已构建的中间件实例, + 需要直接更新实例的 allow_origins 属性。 + """ + stack = getattr(app, 'middleware_stack', None) + while stack is not None and hasattr(stack, 'app'): + if isinstance(stack, CORSMiddleware): + stack.allow_origins = updated_origins + return + stack = stack.app + @cache(namespace=CacheNamespace.EMBEDDED_INFO, cacheName=CacheName.ASSISTANT_INFO, keyExpression="assistant_id") @@ -87,13 +101,23 @@ def init_dynamic_cors(app: FastAPI): seen.add(domain) unique_domains.append(domain) cors_middleware = None + response_middleware = None for middleware in app.user_middleware: - if middleware.cls == CORSMiddleware: + if not cors_middleware and middleware.cls == CORSMiddleware: cors_middleware = middleware + if not response_middleware and middleware.cls == ResponseMiddleware: + response_middleware = middleware + if cors_middleware and response_middleware: break + + updated_origins = list(set(settings.all_cors_origins + unique_domains)) if cors_middleware: - updated_origins = list(set(settings.all_cors_origins + unique_domains)) cors_middleware.kwargs['allow_origins'] = updated_origins + _update_cors_middleware_instance(app, updated_origins) + if response_middleware: + for instance in ResponseMiddleware.instances: + instance.update_allow_origins(updated_origins) + except Exception as e: return False, e @@ -130,7 +154,8 @@ def get_ds_from_api(self): cookies[item['key']] = item['value'] if item['target'] == 'param': param[item['key']] = item['value'] - res = requests.get(url=endpoint, params=param, headers=header, cookies=cookies, timeout=10) + timeout = int(config.get('timeout')) if config.get('timeout') else 10 + res = requests.get(url=endpoint, params=param, headers=header, cookies=cookies, timeout=timeout) if res.status_code == 200: result_json: dict[any] = json.loads(res.text) if result_json.get('code') == 0 or result_json.get('code') == 200: @@ -144,7 +169,8 @@ def get_ds_from_api(self): else: raise Exception(f"Failed to get datasource list from {endpoint}, error: {result_json.get('message')}") else: - raise Exception(f"Failed to get datasource list from {endpoint}, status code: {res.status_code}") + SQLBotLogUtil.error(f"Failed to get datasource list from {endpoint}, response: {res}") + raise Exception(f"Failed to get datasource list from {endpoint}, response: {res}") def get_first_element(self, text: str): parts = re.split(r'[,;]', text.strip()) @@ -170,14 +196,20 @@ def get_simple_ds_list(self): else: raise Exception("Datasource list is not found.") - def get_db_schema(self, ds_id: int, question: str, embedding: bool = True) -> str: + def get_db_schema(self, ds_id: int, question: str = '', embedding: bool = True, + table_list: list[str] = None) -> tuple[str, list]: ds = self.get_ds(ds_id) schema_str = "" db_name = ds.db_schema if ds.db_schema is not None and ds.db_schema != "" else ds.dataBase schema_str += f"【DB_ID】 {db_name}\n【Schema】\n" tables = [] + table_name_list = [] i = 0 for table in ds.tables: + # 如果传入了 table_list,则只处理在列表中的表 + if table_list is not None and table.name not in table_list: + continue + i += 1 schema_table = '' schema_table += f"# Table: {db_name}.{table.name}" if ds.type != "mysql" and ds.type != "es" else f"# Table: {table.name}" @@ -198,6 +230,7 @@ def get_db_schema(self, ds_id: int, question: str, embedding: bool = True) -> st schema_table += '\n]\n' t_obj = {"id": i, "schema_table": schema_table} tables.append(t_obj) + table_name_list.append(table.name) # do table embedding # if embedding and tables and settings.TABLE_EMBEDDING_ENABLED: @@ -207,7 +240,7 @@ def get_db_schema(self, ds_id: int, question: str, embedding: bool = True) -> st for s in tables: schema_str += s.get('schema_table') - return schema_str + return schema_str, table_name_list def get_ds(self, ds_id: int, trans: Trans = None): if self.ds_list: @@ -221,11 +254,11 @@ def get_ds(self, ds_id: int, trans: Trans = None): def convert2schema(self, ds_dict: dict, config: dict[any]) -> AssistantOutDsSchema: id_marker: str = '' - attr_list = ['name', 'type', 'host', 'port', 'user', 'dataBase', 'schema'] + attr_list = ['name', 'type', 'host', 'port', 'user', 'dataBase', 'schema', 'mode', 'lowVersion'] if config.get('encrypt', False): key = config.get('aes_key', None) iv = config.get('aes_iv', None) - aes_attrs = ['host', 'user', 'password', 'dataBase', 'db_schema', 'schema'] + aes_attrs = ['host', 'user', 'password', 'dataBase', 'db_schema', 'schema', 'mode', 'lowVersion'] for attr in aes_attrs: if attr in ds_dict and ds_dict[attr]: try: @@ -233,10 +266,13 @@ def convert2schema(self, ds_dict: dict, config: dict[any]) -> AssistantOutDsSche except Exception as e: raise Exception( f"Failed to encrypt {attr} for datasource {ds_dict.get('name')}, error: {str(e)}") - for attr in attr_list: - if attr in ds_dict: - id_marker += str(ds_dict.get(attr, '')) + '--sqlbot--' - id = string_to_numeric_hash(id_marker) + + id = ds_dict.get('id', None) + if not id: + for attr in attr_list: + if attr in ds_dict: + id_marker += str(ds_dict.get(attr, '')) + '--sqlbot--' + id = string_to_numeric_hash(id_marker) db_schema = ds_dict.get('schema', ds_dict.get('db_schema', '')) ds_dict.pop("schema", None) return AssistantOutDsSchema(**{**ds_dict, "id": id, "db_schema": db_schema}) @@ -258,7 +294,9 @@ def get_out_ds_conf(ds: AssistantOutDsSchema, timeout: int = 30) -> str: "driver": '', "extraJdbc": ds.extraParams or '', "dbSchema": ds.db_schema or '', - "timeout": timeout or 30 + "timeout": timeout or 30, + "mode": ds.mode or '', + "lowVersion": ds.lowVersion or False, } conf["extraJdbc"] = '' return aes_encrypt(json.dumps(conf)) diff --git a/backend/apps/system/crud/assistant_manage.py b/backend/apps/system/crud/assistant_manage.py index b3f285caa..f9dce3675 100644 --- a/backend/apps/system/crud/assistant_manage.py +++ b/backend/apps/system/crud/assistant_manage.py @@ -9,6 +9,18 @@ from apps.system.models.system_model import AssistantModel from common.utils.time import get_timestamp from common.utils.utils import get_domain_list +from common.core.response_middleware import ResponseMiddleware + + +def _update_cors_middleware_instance(app: FastAPI, updated_origins: list[str]): + """遍历 middleware 栈,找到 CORSMiddleware 实例并更新其 allow_origins。""" + stack = getattr(app, 'middleware_stack', None) + while stack is not None and hasattr(stack, 'app'): + if isinstance(stack, CORSMiddleware): + stack.allow_origins = updated_origins + return + stack = stack.app + def dynamic_upgrade_cors(request: Request, session: Session): @@ -24,14 +36,22 @@ def dynamic_upgrade_cors(request: Request, session: Session): unique_domains.append(domain) app: FastAPI = request.app cors_middleware = None + response_middleware = None for middleware in app.user_middleware: - if middleware.cls == CORSMiddleware: + if not cors_middleware and middleware.cls == CORSMiddleware: cors_middleware = middleware + if not response_middleware and middleware.cls == ResponseMiddleware: + response_middleware = middleware + if cors_middleware and response_middleware: break + + updated_origins = list(set(settings.all_cors_origins + unique_domains)) if cors_middleware: - updated_origins = list(set(settings.all_cors_origins + unique_domains)) cors_middleware.kwargs['allow_origins'] = updated_origins - + _update_cors_middleware_instance(app, updated_origins) + if response_middleware: + for instance in ResponseMiddleware.instances: + instance.update_allow_origins(updated_origins) async def save(request: Request, session: Session, creator: AssistantBase, oid: Optional[int] = 1): db_model = AssistantModel.model_validate(creator) diff --git a/backend/apps/system/crud/parameter_manage.py b/backend/apps/system/crud/parameter_manage.py index f80edd29c..65aaf164a 100644 --- a/backend/apps/system/crud/parameter_manage.py +++ b/backend/apps/system/crud/parameter_manage.py @@ -15,7 +15,7 @@ async def get_groups(session: SessionDep, flag: str) -> list[SysArgModel]: async def save_parameter_args(session: SessionDep, request: Request): allow_file_mapping = { - """ "test_logo": { "types": [".jpg", ".jpeg", ".png", ".svg"], "size": 5 * 1024 * 1024 } """ + """ "test_logo": { "types": [".jpg", ".jpeg", ".png"], "size": 5 * 1024 * 1024 } """ } form_data = await request.form() files = form_data.getlist("files") diff --git a/backend/apps/system/crud/system_variable.py b/backend/apps/system/crud/system_variable.py new file mode 100644 index 000000000..0ead75d28 --- /dev/null +++ b/backend/apps/system/crud/system_variable.py @@ -0,0 +1,99 @@ +# Author: Junjun +# Date: 2026/1/26 +import datetime +from typing import List + +from fastapi import HTTPException +from sqlalchemy import and_ +from sqlmodel import select + +from apps.system.models.system_variable_model import SystemVariable +from common.core.deps import SessionDep, CurrentUser, Trans +from common.core.pagination import Paginator +from common.core.schemas import PaginationParams + + +def save(session: SessionDep, user: CurrentUser, trans: Trans, variable: SystemVariable): + checkName(session, trans, variable) + variable.type = 'custom' + if variable.id is None: + variable.create_time = datetime.datetime.now() + variable.create_by = user.id + session.add(variable) + session.commit() + else: + record = session.query(SystemVariable).filter(SystemVariable.id == variable.id).first() + update_data = variable.model_dump(exclude_unset=True) + for field, value in update_data.items(): + setattr(record, field, value) + session.add(record) + session.commit() + return True + + +def delete(session: SessionDep, ids: List[int]): + session.query(SystemVariable).filter(SystemVariable.id.in_(ids)).delete() + + +def list_all(session: SessionDep, trans: Trans, variable: SystemVariable): + if variable.name is None: + records = session.query(SystemVariable).order_by(SystemVariable.type.desc(), + SystemVariable.name.asc()).all() + else: + records = session.query(SystemVariable).filter( + and_(SystemVariable.name.ilike(f'%{variable.name}%'), SystemVariable.type != 'system')).order_by( + SystemVariable.type.desc(), SystemVariable.name.asc()).all() + + res = [] + for r in records: + data = SystemVariable(**r.__dict__) + if data.type == 'system': + data.name = trans(data.name) + res.append(data) + return res + + +async def list_page(session: SessionDep, trans: Trans, pageNum: int, pageSize: int, variable: SystemVariable): + pagination = PaginationParams(page=pageNum, size=pageSize) + paginator = Paginator(session) + filters = {} + + if variable.name is None: + stmt = select(SystemVariable).order_by(SystemVariable.type.desc(), SystemVariable.name.asc()) + else: + stmt = select(SystemVariable).where( + and_(SystemVariable.name.ilike(f'%{variable.name}%'), SystemVariable.type != 'system')).order_by( + SystemVariable.type.desc(), SystemVariable.name.asc()) + + variable_page = await paginator.get_paginated_response( + stmt=stmt, + pagination=pagination, + **filters) + + res = [] + for r in variable_page.items: + data = SystemVariable(**r) + if data.type == 'system': + data.name = trans(data.name) + res.append(data) + + return {"items": res, "page": variable_page.page, "size": variable_page.size, "total": variable_page.total, + "total_pages": variable_page.total_pages} + + +def checkName(session: SessionDep, trans: Trans, variable: SystemVariable): + if variable.id is None: + records = session.query(SystemVariable).filter(SystemVariable.name == variable.name).all() + if records and len(records) > 0: + raise HTTPException(status_code=500, detail=trans('i18n_variable.name_exist')) + else: + records = session.query(SystemVariable).filter( + and_(SystemVariable.name == variable.name, SystemVariable.id != variable.id)).all() + if records and len(records) > 0: + raise HTTPException(status_code=500, detail=trans('i18n_variable.name_exist')) + + +def checkValue(session: SessionDep, trans: Trans, values: List): + # values: [{"variableId":1,"variableValues":["a","b"]}] + + pass diff --git a/backend/apps/system/crud/user.py b/backend/apps/system/crud/user.py index 1f5ccb59e..5f9928b1b 100644 --- a/backend/apps/system/crud/user.py +++ b/backend/apps/system/crud/user.py @@ -1,21 +1,23 @@ - from typing import Optional + from sqlmodel import Session, func, select, delete as sqlmodel_delete + from apps.system.models.system_model import UserWsModel, WorkspaceModel from apps.system.schemas.auth import CacheName, CacheNamespace from apps.system.schemas.system_schema import EMAIL_REGEX, PWD_REGEX, BaseUserDTO, UserInfoDTO, UserWs from common.core.deps import SessionDep +from common.core.security import verify_md5pwd from common.core.sqlbot_cache import cache, clear_cache -from common.utils.locale import I18n +from common.utils.locale import I18n, I18nHelper from common.utils.utils import SQLBotLogUtil from ..models.user import UserModel, UserPlatformModel -from common.core.security import verify_md5pwd -import re + def get_db_user(*, session: Session, user_id: int) -> UserModel: db_user = session.get(UserModel, user_id) return db_user + def get_user_by_account(*, session: Session, account: str) -> BaseUserDTO | None: statement = select(UserModel).where(UserModel.account == account) db_user = session.exec(statement).first() @@ -23,19 +25,22 @@ def get_user_by_account(*, session: Session, account: str) -> BaseUserDTO | None return None return BaseUserDTO.model_validate(db_user.model_dump()) + @cache(namespace=CacheNamespace.AUTH_INFO, cacheName=CacheName.USER_INFO, keyExpression="user_id") async def get_user_info(*, session: Session, user_id: int) -> UserInfoDTO | None: - db_user: UserModel = get_db_user(session = session, user_id = user_id) + db_user: UserModel = get_db_user(session=session, user_id=user_id) if not db_user: return None userInfo = UserInfoDTO.model_validate(db_user.model_dump()) userInfo.isAdmin = userInfo.id == 1 and userInfo.account == 'admin' if userInfo.isAdmin: return userInfo - ws_model: UserWsModel = session.exec(select(UserWsModel).where(UserWsModel.uid == userInfo.id, UserWsModel.oid == userInfo.oid)).first() + ws_model: UserWsModel = session.exec( + select(UserWsModel).where(UserWsModel.uid == userInfo.id, UserWsModel.oid == userInfo.oid)).first() userInfo.weight = ws_model.weight if ws_model else -1 return userInfo + def authenticate(*, session: Session, account: str, password: str) -> BaseUserDTO | None: db_user = get_user_by_account(session=session, account=account) if not db_user: @@ -44,7 +49,8 @@ def authenticate(*, session: Session, account: str, password: str) -> BaseUserDT return None return db_user -async def user_ws_options(session: Session, uid: int, trans: Optional[I18n] = None) -> list[UserWs]: + +def user_ws_list(session: Session, uid: int, trans: Optional[I18n | I18nHelper] = None) -> list[UserWs]: if uid == 1: stmt = select(WorkspaceModel.id, WorkspaceModel.name).order_by(WorkspaceModel.name, WorkspaceModel.create_time) else: @@ -57,16 +63,20 @@ async def user_ws_options(session: Session, uid: int, trans: Optional[I18n] = No if not trans: return result.all() list_result = [ - UserWs(id = id, name = trans(name) if name.startswith('i18n') else name) + UserWs(id=id, name=trans(name) if name.startswith('i18n') else name) for id, name in result.all() ] if list_result: list_result.sort(key=lambda x: x.name) return list_result - + +async def user_ws_options(session: Session, uid: int, trans: Optional[I18n | I18nHelper] = None) -> list[UserWs]: + return user_ws_list(session, uid, trans) + + @clear_cache(namespace=CacheNamespace.AUTH_INFO, cacheName=CacheName.USER_INFO, keyExpression="id") async def single_delete(session: SessionDep, id: int): - user_model: UserModel = get_db_user(session = session, user_id = id) + user_model: UserModel = get_db_user(session=session, user_id=id) del_stmt = sqlmodel_delete(UserWsModel).where(UserWsModel.uid == id) session.exec(del_stmt) if user_model and user_model.origin and user_model.origin != 0: @@ -75,20 +85,23 @@ async def single_delete(session: SessionDep, id: int): session.delete(user_model) session.commit() -@clear_cache(namespace=CacheNamespace.AUTH_INFO, cacheName=CacheName.USER_INFO, keyExpression="id") + +@clear_cache(namespace=CacheNamespace.AUTH_INFO, cacheName=CacheName.USER_INFO, keyExpression="id") async def clean_user_cache(id: int): SQLBotLogUtil.info(f"User cache for [{id}] has been cleaned") def check_account_exists(*, session: Session, account: str) -> bool: return session.exec(select(func.count()).select_from(UserModel).where(UserModel.account == account)).one() > 0 + + def check_email_exists(*, session: Session, email: str) -> bool: return session.exec(select(func.count()).select_from(UserModel).where(UserModel.email == email)).one() > 0 - def check_email_format(email: str) -> bool: return bool(EMAIL_REGEX.fullmatch(email)) + def check_pwd_format(pwd: str) -> bool: return bool(PWD_REGEX.fullmatch(pwd)) diff --git a/backend/apps/system/middleware/auth.py b/backend/apps/system/middleware/auth.py index e888204a7..feeb246aa 100644 --- a/backend/apps/system/middleware/auth.py +++ b/backend/apps/system/middleware/auth.py @@ -1,15 +1,17 @@ import base64 import json +import re from typing import Optional from fastapi import Request from fastapi.responses import JSONResponse +from starlette.responses import Response import jwt from sqlmodel import Session from starlette.middleware.base import BaseHTTPMiddleware from apps.system.crud.apikey_manage import get_api_key from apps.system.models.system_model import ApiKeyModel, AssistantModel -from common.core.db import engine +from common.core.db import engine from apps.system.crud.assistant import get_assistant_info, get_assistant_user from apps.system.crud.user import get_user_by_account, get_user_info from apps.system.schemas.system_schema import AssistantHeader, UserInfoDTO @@ -17,7 +19,7 @@ from common.core.config import settings from common.core.schemas import TokenPayload from common.utils.locale import I18n -from common.utils.utils import SQLBotLogUtil, get_origin_from_referer +from common.utils.utils import SQLBotLogUtil, get_origin_from_referer, origin_match_domain from common.utils.whitelist import whiteUtils from fastapi.security.utils import get_authorization_scheme_param from common.core.deps import get_i18n @@ -31,6 +33,26 @@ def __init__(self, app): async def dispatch(self, request, call_next): if self.is_options(request) or whiteUtils.is_whitelisted(request.url.path): + # 动态处理 /system/assistant/info/{id} 的 CORS 预检 + if request.method == "OPTIONS": + origin = request.headers.get("origin", "") + if origin: + match = re.search(r'/system/assistant/info/(\d+)', request.url.path) + if match: + assistant_id = int(match.group(1)) + with Session(engine) as session: + db_model = session.get(AssistantModel, assistant_id) + if db_model and origin_match_domain(origin, db_model.domain): + return Response( + status_code=200, + headers={ + "Access-Control-Allow-Origin": origin, + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Headers": "*", + "Access-Control-Allow-Credentials": "true", + "Access-Control-Max-Age": "600", + }, + ) return await call_next(request) assistantTokenKey = settings.ASSISTANT_TOKEN_KEY assistantToken = request.headers.get(assistantTokenKey) @@ -171,15 +193,7 @@ async def validateAssistant(self, assistantToken: Optional[str], trans: I18n) -> assistant_info = await get_assistant_info(session=session, assistant_id=payload['assistant_id']) assistant_info = AssistantModel.model_validate(assistant_info) assistant_info = AssistantHeader.model_validate(assistant_info.model_dump(exclude_unset=True)) - if assistant_info and assistant_info.type == 0: - if payload['oid']: - session_user.oid = int(payload['oid']) - else: - assistant_oid = 1 - configuration = assistant_info.configuration - config_obj = json.loads(configuration) if configuration else {} - assistant_oid = config_obj.get('oid', 1) - session_user.oid = int(assistant_oid) + session_user.oid = int(assistant_info.oid) return True, session_user, assistant_info except Exception as e: @@ -226,7 +240,8 @@ async def validateEmbedded(self, param: str, trans: I18n) -> tuple[any]: if not session_user.oid or session_user.oid == 0: message = trans('i18n_login.no_associated_ws', msg = trans('i18n_concat_admin')) raise Exception(message) - + if session_user.oid: + assistant_info.oid = int(session_user.oid) return True, session_user, assistant_info except Exception as e: SQLBotLogUtil.exception(f"Embedded validation error: {str(e)}") diff --git a/backend/apps/system/models/system_model.py b/backend/apps/system/models/system_model.py index 472f18681..6b3602329 100644 --- a/backend/apps/system/models/system_model.py +++ b/backend/apps/system/models/system_model.py @@ -1,6 +1,8 @@ - from typing import Optional + +from pydantic import field_serializer from sqlmodel import BigInteger, Field, Text, SQLModel + from common.core.models import SnowflakeBase from common.core.schemas import BaseCreatorDTO @@ -9,74 +11,98 @@ class AiModelBase: supplier: int = Field(nullable=False) name: str = Field(max_length=255, nullable=False) model_type: int = Field(nullable=False) - base_model: str = Field(max_length = 255, nullable=False) + base_model: str = Field(max_length=255, nullable=False) default_model: bool = Field(default=False, nullable=False) + class AiModelDetail(SnowflakeBase, AiModelBase, table=True): - __tablename__ = "ai_model" - api_key: str | None = Field(nullable=True) - api_domain: str = Field(nullable=False) - protocol: int = Field(nullable=False, default = 1) - config: str = Field(sa_type = Text()) - status: int = Field(nullable=False, default = 1) - create_time: int = Field(default=0, sa_type=BigInteger()) - + __tablename__ = "ai_model" + api_key: str | None = Field(default=None, nullable=True, sa_type=Text()) + api_domain: str = Field(nullable=False, sa_type=Text()) + protocol: int = Field(nullable=False, default=1) + config: str = Field(sa_type=Text()) + status: int = Field(nullable=False, default=1) + create_time: int = Field(default=0, sa_type=BigInteger()) + + +class AiModelWorkspaceMapping(SnowflakeBase, table=True): + __tablename__ = "ai_model_workspace_mapping" + ai_model_id: int = Field(default=None, nullable=True, sa_type=BigInteger()) + workspace_id: int = Field(default=None, nullable=True, sa_type=BigInteger()) +class AiModelBrief(SQLModel): + id: int + name: str + default_model: bool + supplier: int + + @field_serializer("id") + def id_to_str(self, v: int) -> str: + return str(v) + class WorkspaceBase(SQLModel): name: str = Field(max_length=255, nullable=False) + class WorkspaceEditor(WorkspaceBase, BaseCreatorDTO): pass - + + class WorkspaceModel(SnowflakeBase, WorkspaceBase, table=True): __tablename__ = "sys_workspace" create_time: int = Field(default=0, sa_type=BigInteger()) - + + class UserWsBaseModel(SQLModel): uid: int = Field(nullable=False, sa_type=BigInteger()) oid: int = Field(nullable=False, sa_type=BigInteger()) - weight: int = Field(default=0, nullable=False) - + weight: int = Field(default=0, nullable=False) + + class UserWsModel(SnowflakeBase, UserWsBaseModel, table=True): __tablename__ = "sys_user_ws" - + class AssistantBaseModel(SQLModel): name: str = Field(max_length=255, nullable=False) type: int = Field(nullable=False, default=0) domain: str = Field(max_length=255, nullable=False) - description: Optional[str] = Field(sa_type = Text(), nullable=True) - configuration: Optional[str] = Field(sa_type = Text(), nullable=True) + description: Optional[str] = Field(sa_type=Text(), nullable=True) + configuration: Optional[str] = Field(sa_type=Text(), nullable=True) create_time: int = Field(default=0, sa_type=BigInteger()) - app_id: Optional[str] = Field(default=None, max_length=255, nullable=True) + app_id: Optional[str] = Field(default=None, max_length=255, nullable=True) app_secret: Optional[str] = Field(default=None, max_length=255, nullable=True) oid: Optional[int] = Field(nullable=True, sa_type=BigInteger(), default=1) + enable_custom_model: Optional[bool] = Field(default=False, nullable=True) + custom_model: Optional[str] = Field(default=None, max_length=255, nullable=True) + class AssistantModel(SnowflakeBase, AssistantBaseModel, table=True): __tablename__ = "sys_assistant" - + class AuthenticationBaseModel(SQLModel): name: str = Field(max_length=255, nullable=False) type: int = Field(nullable=False, default=0) - config: Optional[str] = Field(sa_type = Text(), nullable=True) - - + config: Optional[str] = Field(sa_type=Text(), nullable=True) + + class AuthenticationModel(SnowflakeBase, AuthenticationBaseModel, table=True): __tablename__ = "sys_authentication" create_time: Optional[int] = Field(default=0, sa_type=BigInteger()) enable: bool = Field(default=False, nullable=False) valid: bool = Field(default=False, nullable=False) - + class ApiKeyBaseModel(SQLModel): access_key: str = Field(max_length=255, nullable=False) secret_key: str = Field(max_length=255, nullable=False) create_time: int = Field(default=0, sa_type=BigInteger()) - uid: int = Field(default=0,nullable=False, sa_type=BigInteger()) + uid: int = Field(default=0, nullable=False, sa_type=BigInteger()) status: bool = Field(default=True, nullable=False) - + + class ApiKeyModel(SnowflakeBase, ApiKeyBaseModel, table=True): - __tablename__ = "sys_apikey" \ No newline at end of file + __tablename__ = "sys_apikey" diff --git a/backend/apps/system/models/system_variable_model.py b/backend/apps/system/models/system_variable_model.py new file mode 100644 index 000000000..896868984 --- /dev/null +++ b/backend/apps/system/models/system_variable_model.py @@ -0,0 +1,20 @@ +# Author: Junjun +# Date: 2026/1/26 + +from datetime import datetime +from typing import List + +from sqlalchemy import Column, BigInteger, Identity, DateTime +from sqlalchemy.dialects.postgresql import JSONB +from sqlmodel import SQLModel, Field + + +class SystemVariable(SQLModel, table=True): + __tablename__ = "system_variable" + id: int = Field(sa_column=Column(BigInteger, Identity(always=True), nullable=False, primary_key=True)) + name: str = Field(max_length=128, nullable=False) + var_type: str = Field(max_length=128, nullable=False) + type: str = Field(max_length=128, nullable=False) + value: List = Field(sa_column=Column(JSONB, nullable=True)) + create_time: datetime = Field(sa_column=Column(DateTime(timezone=False), nullable=True)) + create_by: int = Field(sa_column=Column(BigInteger())) \ No newline at end of file diff --git a/backend/apps/system/models/user.py b/backend/apps/system/models/user.py index a6ed524f6..0004f057e 100644 --- a/backend/apps/system/models/user.py +++ b/backend/apps/system/models/user.py @@ -1,13 +1,14 @@ +from typing import List, Optional -from typing import Optional -from sqlmodel import BigInteger, SQLModel, Field +from sqlalchemy import Column, BigInteger +from sqlalchemy.dialects.postgresql import JSONB +from sqlmodel import SQLModel, Field from common.core.models import SnowflakeBase from common.core.security import default_md5_pwd from common.utils.time import get_timestamp - class BaseUserPO(SQLModel): account: str = Field(max_length=255, unique=True) oid: int = Field(nullable=False, sa_type=BigInteger(), default=0) @@ -18,17 +19,22 @@ class BaseUserPO(SQLModel): origin: int = Field(nullable=False, default=0) create_time: int = Field(default_factory=get_timestamp, sa_type=BigInteger(), nullable=False) language: str = Field(max_length=255, default="zh-CN") - + #system_variables: List = Field(sa_column=Column(JSONB, nullable=True)) + system_variables: Optional[List] = Field( + default=None, + sa_column=Column(JSONB, nullable=True) + ) + + class UserModel(SnowflakeBase, BaseUserPO, table=True): __tablename__ = "sys_user" - + class UserPlatformBase(SQLModel): uid: int = Field(nullable=False, sa_type=BigInteger()) origin: int = Field(nullable=False, default=0) platform_uid: str = Field(max_length=255, nullable=False) - + + class UserPlatformModel(SnowflakeBase, UserPlatformBase, table=True): __tablename__ = "sys_user_platform" - - diff --git a/backend/apps/system/schemas/ai_model_schema.py b/backend/apps/system/schemas/ai_model_schema.py index 019aa358b..7f523eb93 100644 --- a/backend/apps/system/schemas/ai_model_schema.py +++ b/backend/apps/system/schemas/ai_model_schema.py @@ -14,7 +14,7 @@ class AiModelItem(BaseModel): default_model: bool = Field(default=False, description=f"{PLACEHOLDER_PREFIX}default_model") class AiModelGridItem(AiModelItem, BaseCreatorDTO): - pass + ws_mapping_count: int = Field(default=0, description="workspace mapping count") class AiModelConfigItem(BaseModel): key: str = Field(description=f"{PLACEHOLDER_PREFIX}arg_name") diff --git a/backend/apps/system/schemas/auth.py b/backend/apps/system/schemas/auth.py index 14db17d97..de4a4dfe3 100644 --- a/backend/apps/system/schemas/auth.py +++ b/backend/apps/system/schemas/auth.py @@ -17,6 +17,7 @@ class CacheName(Enum): ASSISTANT_INFO = "assistant:info" ASSISTANT_DS = "assistant:ds" ASK_INFO = "ask:info" + DS_ID_LIST = "ds:id:list" def __str__(self): return self.value diff --git a/backend/apps/system/schemas/permission.py b/backend/apps/system/schemas/permission.py index d0dccd243..45c78f81d 100644 --- a/backend/apps/system/schemas/permission.py +++ b/backend/apps/system/schemas/permission.py @@ -8,10 +8,13 @@ from starlette.middleware.base import BaseHTTPMiddleware from sqlmodel import Session, select from apps.chat.models.chat_model import Chat +from apps.datasource.crud.datasource import get_ws_ds from apps.datasource.models.datasource import CoreDatasource from common.core.db import engine from apps.system.schemas.system_schema import UserInfoDTO +from common.utils.locale import I18n +i18n = I18n() class SqlbotPermission(BaseModel): role: Optional[list[str]] = None @@ -22,7 +25,7 @@ async def get_ws_resource(oid, type) -> list: with Session(engine) as session: stmt = None if type == 'ds' or type == 'datasource': - stmt = select(CoreDatasource.id).where(CoreDatasource.oid == oid) + return await get_ws_ds(session, oid) if type == 'chat': stmt = select(Chat.id).where(Chat.oid == oid) if stmt is not None: @@ -32,6 +35,9 @@ async def get_ws_resource(oid, type) -> list: async def check_ws_permission(oid, type, resource) -> bool: + if not resource or (isinstance(resource, list) and len(resource) == 0): + return True + resource_id_list = await get_ws_resource(oid, type) if not resource_id_list: return False @@ -45,6 +51,7 @@ def decorator(func): @wraps(func) async def wrapper(*args, **kwargs): request = RequestContext.get_request() + current_user: UserInfoDTO = getattr(request.state, 'current_user', None) if not current_user: raise HTTPException( @@ -53,7 +60,9 @@ async def wrapper(*args, **kwargs): ) current_oid = current_user.oid - if current_user.isAdmin: + trans = i18n(request) + + if current_user.isAdmin and not permission.type: return await func(*args, **kwargs) role_list = permission.role keyExpression = permission.keyExpression @@ -61,9 +70,11 @@ async def wrapper(*args, **kwargs): if role_list: if 'admin' in role_list and not current_user.isAdmin: - raise Exception('no permission to execute, only for admin') - if 'ws_admin' in role_list and current_user.weight == 0: - raise Exception('no permission to execute, only for workspace admin') + #raise Exception('no permission to execute, only for admin') + raise Exception(trans('i18n_permission.only_admin')) + if 'ws_admin' in role_list and current_user.weight == 0 and not current_user.isAdmin: + #raise Exception('no permission to execute, only for workspace admin') + raise Exception(trans('i18n_permission.only_ws_admin')) if not resource_type: return await func(*args, **kwargs) if keyExpression: @@ -77,7 +88,8 @@ async def wrapper(*args, **kwargs): value = bound_args.args[index] if await check_ws_permission(current_oid, resource_type, value): return await func(*args, **kwargs) - raise Exception('no permission to execute or resource do not exist!') + #raise Exception('no permission to execute or resource do not exist!') + raise Exception(trans('i18n_permission.permission_resource_limit')) parts = keyExpression.split('.') if not bound_args.arguments.get(parts[0]): @@ -87,7 +99,7 @@ async def wrapper(*args, **kwargs): value = getattr(value, part) if await check_ws_permission(current_oid, resource_type, value): return await func(*args, **kwargs) - raise Exception('no permission to execute or resource do not exist!') + raise Exception(trans('i18n_permission.permission_resource_limit')) return await func(*args, **kwargs) diff --git a/backend/apps/system/schemas/system_schema.py b/backend/apps/system/schemas/system_schema.py index 08d0d7509..db2f255b4 100644 --- a/backend/apps/system/schemas/system_schema.py +++ b/backend/apps/system/schemas/system_schema.py @@ -1,5 +1,5 @@ import re -from typing import Optional +from typing import Optional,List from pydantic import BaseModel, Field, field_validator @@ -32,7 +32,7 @@ class BaseUser(BaseModel): class BaseUserDTO(BaseUser, BaseCreatorDTO): - language: str = Field(pattern=r"^(zh-CN|en|ko-KR)$", default="zh-CN", description="用户语言") + language: str = Field(pattern=r"^(zh-CN|zh-TW|en|ko-KR)$", default="zh-CN", description="用户语言") password: str status: int = 1 origin: int = 0 @@ -47,8 +47,8 @@ def to_dict(self): @field_validator("language") def validate_language(cls, lang: str) -> str: - if not re.fullmatch(r"^(zh-CN|en|ko-KR)$", lang): - raise ValueError("Language must be 'zh-CN', 'en', or 'ko-KR'") + if not re.fullmatch(r"^(zh-CN|zh-TW|en|ko-KR)$", lang): + raise ValueError("Language must be 'zh-CN', 'zh-TW', 'en', or 'ko-KR'") return lang @@ -58,6 +58,7 @@ class UserCreator(BaseUser): status: int = Field(default=1, description=f"{PLACEHOLDER_PREFIX}status") origin: Optional[int] = Field(default=0, description=f"{PLACEHOLDER_PREFIX}origin") oid_list: Optional[list[int]] = Field(default=None, description=f"{PLACEHOLDER_PREFIX}oid") + system_variables: Optional[List] = Field(default=[]) """ @field_validator("email") def validate_email(cls, lang: str) -> str: @@ -109,6 +110,9 @@ class AssistantBase(BaseModel): type: int = Field(default=0, description=f"{PLACEHOLDER_PREFIX}assistant_type") # 0普通小助手 1高级 4页面嵌入 configuration: Optional[str] = Field(default=None, description=f"{PLACEHOLDER_PREFIX}assistant_configuration") description: Optional[str] = Field(default=None, description=f"{PLACEHOLDER_PREFIX}assistant_description") + oid: Optional[int] = Field(default=1, description=f"{PLACEHOLDER_PREFIX}oid") + enable_custom_model: Optional[bool] = Field(default=False, description=f"{PLACEHOLDER_PREFIX}enable_custom_model") + custom_model: Optional[str] = Field(description=f"{PLACEHOLDER_PREFIX}custom_model") class AssistantDTO(AssistantBase, BaseCreatorDTO): @@ -192,6 +196,8 @@ class AssistantOutDsSchema(AssistantOutDsBase): password: Optional[str] = None db_schema: Optional[str] = None extraParams: Optional[str] = None + mode: Optional[str] = None + lowVersion: Optional[bool] = False tables: Optional[list[AssistantTableSchema]] = None diff --git a/backend/apps/terminology/api/terminology.py b/backend/apps/terminology/api/terminology.py index 2a8cb0b4c..979cdf41f 100644 --- a/backend/apps/terminology/api/terminology.py +++ b/backend/apps/terminology/api/terminology.py @@ -26,6 +26,7 @@ @router.get("/page/{current_page}/{page_size}", summary=f"{PLACEHOLDER_PREFIX}get_term_page") +@require_permissions(permission=SqlbotPermission(role=['ws_admin'])) async def pager(session: SessionDep, current_user: CurrentUser, current_page: int, page_size: int, word: Optional[str] = Query(None, description="搜索术语(可选)"), dslist: Optional[list[int]] = Query(None, description="数据集ID集合(可选)")): @@ -42,6 +43,7 @@ async def pager(session: SessionDep, current_user: CurrentUser, current_page: in @router.put("", summary=f"{PLACEHOLDER_PREFIX}create_or_update_term") +@require_permissions(permission=SqlbotPermission(role=['ws_admin'], type='ds', keyExpression="info.datasource_ids")) @system_log(LogConfig(operation_type=OperationType.CREATE_OR_UPDATE, module=OperationModules.TERMINOLOGY,resource_id_expr='info.id', result_id_expr="result_self")) async def create_or_update(session: SessionDep, current_user: CurrentUser, trans: Trans, info: TerminologyInfo): oid = current_user.oid @@ -80,6 +82,7 @@ def inner(): "description": obj.description, "all_data_sources": 'N' if obj.specific_ds else 'Y', "datasource": ', '.join(obj.datasource_names) if obj.datasource_names and obj.specific_ds else '', + "advanced_application_name": obj.advanced_application_name or '', } data_list.append(_data) @@ -89,6 +92,7 @@ def inner(): fields.append(AxisObj(name=trans('i18n_terminology.term_description'), value='description')) fields.append(AxisObj(name=trans('i18n_terminology.effective_data_sources'), value='datasource')) fields.append(AxisObj(name=trans('i18n_terminology.all_data_sources'), value='all_data_sources')) + fields.append(AxisObj(name=trans('i18n_data_training.advanced_application'), value='advanced_application_name')) md_data, _fields_list = DataFormat.convert_object_array_for_pandas(fields, data_list) @@ -117,6 +121,7 @@ def inner(): "description": trans('i18n_terminology.term_description_template_example_1'), "all_data_sources": 'N', "datasource": trans('i18n_terminology.effective_data_sources_template_example_1'), + "advanced_application_name": '', } data_list.append(_data1) _data2 = { @@ -125,6 +130,7 @@ def inner(): "description": trans('i18n_terminology.term_description_template_example_2'), "all_data_sources": 'Y', "datasource": '', + "advanced_application_name": '', } data_list.append(_data2) @@ -134,6 +140,7 @@ def inner(): fields.append(AxisObj(name=trans('i18n_terminology.term_description_template'), value='description')) fields.append(AxisObj(name=trans('i18n_terminology.effective_data_sources_template'), value='datasource')) fields.append(AxisObj(name=trans('i18n_terminology.all_data_sources_template'), value='all_data_sources')) + fields.append(AxisObj(name=trans('i18n_data_training.advanced_application'), value='advanced_application_name')) md_data, _fields_list = DataFormat.convert_object_array_for_pandas(fields, data_list) @@ -163,6 +170,7 @@ def inner(): @router.post("/uploadExcel", summary=f"{PLACEHOLDER_PREFIX}upload_term") @system_log(LogConfig(operation_type=OperationType.IMPORT, module=OperationModules.TERMINOLOGY)) +@require_permissions(permission=SqlbotPermission(role=['ws_admin'])) async def upload_excel(trans: Trans, current_user: CurrentUser, file: UploadFile = File(...)): ALLOWED_EXTENSIONS = {"xlsx", "xls"} if not file.filename.lower().endswith(tuple(ALLOWED_EXTENSIONS)): @@ -177,7 +185,7 @@ async def upload_excel(trans: Trans, current_user: CurrentUser, file: UploadFile oid = current_user.oid - use_cols = [0, 1, 2, 3, 4] + use_cols = [0, 1, 2, 3, 4, 5] def inner(): @@ -214,9 +222,11 @@ def inner(): 3].strip() else [] all_datasource = True if pd.notna(row[4]) and row[4].lower().strip() in ['y', 'yes', 'true'] else False specific_ds = False if all_datasource else True + advanced_application_name = row[5].strip() if pd.notna(row[5]) and row[5].strip() else None import_data.append(TerminologyInfo(word=word, description=description, other_words=other_words, - datasource_names=datasource_names, specific_ds=specific_ds)) + datasource_names=datasource_names, specific_ds=specific_ds, + advanced_application_name=advanced_application_name)) res = batch_create_terminology(session, import_data, oid, trans) @@ -234,6 +244,7 @@ def inner(): "all_data_sources": 'N' if obj['data'].specific_ds else 'Y', "datasource": ', '.join(obj['data'].datasource_names) if obj['data'].datasource_names and obj[ 'data'].specific_ds else '', + "advanced_application_name": obj['data'].advanced_application_name or '', "errors": obj['errors'] } data_list.append(_data) @@ -244,6 +255,7 @@ def inner(): fields.append(AxisObj(name=trans('i18n_terminology.term_description'), value='description')) fields.append(AxisObj(name=trans('i18n_terminology.effective_data_sources'), value='datasource')) fields.append(AxisObj(name=trans('i18n_terminology.all_data_sources'), value='all_data_sources')) + fields.append(AxisObj(name=trans('i18n_data_training.advanced_application'), value='advanced_application_name')) fields.append(AxisObj(name=trans('i18n_data_training.error_info'), value='errors')) md_data, _fields_list = DataFormat.convert_object_array_for_pandas(fields, data_list) diff --git a/backend/apps/terminology/curd/terminology.py b/backend/apps/terminology/curd/terminology.py index 4a866cbeb..7ca6128ab 100644 --- a/backend/apps/terminology/curd/terminology.py +++ b/backend/apps/terminology/curd/terminology.py @@ -10,8 +10,9 @@ from apps.ai_model.embedding import EmbeddingModelCache from apps.datasource.models.datasource import CoreDatasource +from apps.system.models.system_model import AssistantModel from apps.template.generate_chart.generator import get_base_terminology_template -from apps.terminology.models.terminology_model import Terminology, TerminologyInfo +from apps.terminology.models.terminology_model import Terminology, TerminologyInfo, TerminologyInfoResult from common.core.config import settings from common.core.deps import SessionDep, Trans from common.utils.embedding_threads import run_save_terminology_embeddings @@ -141,7 +142,9 @@ def build_terminology_query(session: SessionDep, oid: int, name: Optional[str] = Terminology.datasource_ids, children_subquery.c.other_words, func.jsonb_agg(CoreDatasource.name).filter(CoreDatasource.id.isnot(None)).label('datasource_names'), - Terminology.enabled + Terminology.enabled, + Terminology.advanced_application, + AssistantModel.name.label('advanced_application_name'), ) .outerjoin( children_subquery, @@ -155,6 +158,8 @@ def build_terminology_query(session: SessionDep, oid: int, name: Optional[str] = CoreDatasource, CoreDatasource.id == datasource_names_subquery.c.ds_id ) + .outerjoin(AssistantModel, + and_(Terminology.advanced_application == AssistantModel.id, AssistantModel.type == 1)) .where(and_(Terminology.id.in_(paginated_parent_ids), Terminology.oid == oid)) .group_by( Terminology.id, @@ -163,6 +168,8 @@ def build_terminology_query(session: SessionDep, oid: int, name: Optional[str] = Terminology.description, Terminology.specific_ds, Terminology.datasource_ids, + Terminology.advanced_application, + AssistantModel.name, children_subquery.c.other_words, Terminology.enabled ) @@ -172,7 +179,7 @@ def build_terminology_query(session: SessionDep, oid: int, name: Optional[str] = return stmt, total_count, total_pages, current_page, page_size -def execute_terminology_query(session: SessionDep, stmt) -> List[TerminologyInfo]: +def execute_terminology_query(session: SessionDep, stmt) -> List[TerminologyInfoResult]: """ 执行查询并返回术语信息列表 """ @@ -180,7 +187,7 @@ def execute_terminology_query(session: SessionDep, stmt) -> List[TerminologyInfo result = session.execute(stmt) for row in result: - _list.append(TerminologyInfo( + _list.append(TerminologyInfoResult( id=row.id, word=row.word, create_time=row.create_time, @@ -190,6 +197,8 @@ def execute_terminology_query(session: SessionDep, stmt) -> List[TerminologyInfo datasource_ids=row.datasource_ids if row.datasource_ids is not None else [], datasource_names=row.datasource_names if row.datasource_names is not None else [], enabled=row.enabled if row.enabled is not None else False, + advanced_application=str(row.advanced_application) if row.advanced_application else None, + advanced_application_name=row.advanced_application_name, )) return _list @@ -240,8 +249,8 @@ def create_terminology(session: SessionDep, info: TerminologyInfo, oid: int, tra datasource_ids = info.datasource_ids if info.datasource_ids is not None else [] if specific_ds: - if not datasource_ids: - raise Exception(trans("i18n_terminology.datasource_cannot_be_none")) + if not datasource_ids and info.advanced_application is None: + raise Exception(trans("i18n_data_training.datasource_assistant_cannot_be_none")) parent = Terminology( word=info.word.strip(), @@ -250,7 +259,8 @@ def create_terminology(session: SessionDep, info: TerminologyInfo, oid: int, tra oid=oid, specific_ds=specific_ds, enabled=info.enabled, - datasource_ids=datasource_ids + datasource_ids=datasource_ids, + advanced_application=info.advanced_application, ) words = [info.word.strip()] @@ -267,30 +277,63 @@ def create_terminology(session: SessionDep, info: TerminologyInfo, oid: int, tra # 基础查询条件(word 和 oid 必须满足) base_query = and_( Terminology.word.in_(words), - Terminology.oid == oid + Terminology.oid == oid, ) # 构建查询 query = session.query(Terminology).filter(base_query) - if specific_ds: - # 仅当 specific_ds=False 时,检查数据源条件 - query = query.where( - or_( - or_(Terminology.specific_ds == False, Terminology.specific_ds.is_(None)), - and_( - Terminology.specific_ds == True, - Terminology.datasource_ids.isnot(None), - text(""" - EXISTS ( - SELECT 1 FROM jsonb_array_elements(datasource_ids) AS elem - WHERE elem::text::int = ANY(:datasource_ids) - ) - """) + # 作用域重复检查 + scope_conditions = [] + + if not specific_ds: + # 全部数据源:与有数据源的记录冲突,也与同为全部数据源的记录冲突 + scope_conditions.append( + and_( + Terminology.specific_ds == True, + Terminology.datasource_ids.isnot(None), + func.jsonb_array_length(Terminology.datasource_ids) > 0, + ) + ) + scope_conditions.append( + Terminology.specific_ds == False, + ) + elif specific_ds and datasource_ids: + # 指定数据源:与全部数据源冲突,也与有数据源重叠的记录冲突 + scope_conditions.append( + Terminology.specific_ds == False, + ) + ds_overlap_conditions = [ + Terminology.datasource_ids.contains([ds_id]) + for ds_id in datasource_ids + ] + scope_conditions.append( + and_( + Terminology.specific_ds == True, + Terminology.datasource_ids.isnot(None), + or_(*ds_overlap_conditions) + ) + ) + else: + # 不选数据源:仅与同为不选数据源的记录冲突 + scope_conditions.append( + and_( + Terminology.specific_ds == True, + or_( + Terminology.datasource_ids.is_(None), + func.jsonb_array_length(Terminology.datasource_ids) == 0, ) ) ) - query = query.params(datasource_ids=datasource_ids) + + # 高级应用重复检查:advanced_application 相同时同名即重复 + if info.advanced_application is not None: + scope_conditions.append( + Terminology.advanced_application == info.advanced_application + ) + + if scope_conditions: + query = query.where(or_(*scope_conditions)) # 转换为 EXISTS 查询并获取结果 exists = session.query(query.exists()).scalar() @@ -396,6 +439,14 @@ def batch_create_terminology(session: SessionDep, info_list: List[TerminologyInf for ds in datasource_result: datasource_name_to_id[ds.name.strip()] = ds.id + # 预加载高级应用名称到ID的映射 + assistant_name_to_id = {} + assistant_stmt = select(AssistantModel.id, AssistantModel.name).where( + and_(AssistantModel.oid == oid, AssistantModel.type == 1)) + assistant_result = session.execute(assistant_stmt).all() + for a in assistant_result: + assistant_name_to_id[a.name.strip()] = a.id + # 验证和转换数据源名称 valid_records = [] for info in deduplicated_list: @@ -411,6 +462,7 @@ def batch_create_terminology(session: SessionDep, info_list: List[TerminologyInf # 根据specific_ds决定是否验证数据源 specific_ds = info.specific_ds if info.specific_ds is not None else False datasource_ids = [] + advanced_application = info.advanced_application if specific_ds: # specific_ds为True时需要验证数据源 @@ -424,12 +476,21 @@ def batch_create_terminology(session: SessionDep, info_list: List[TerminologyInf else: error_messages.append(trans("i18n_terminology.datasource_not_found").format(ds_name)) - # 检查specific_ds为True时必须有数据源 - if not datasource_ids: - error_messages.append(trans("i18n_terminology.datasource_cannot_be_none")) + # 解析高级应用名称到ID + if advanced_application is None and info.advanced_application_name: + if info.advanced_application_name.strip() in assistant_name_to_id: + advanced_application = assistant_name_to_id[info.advanced_application_name.strip()] + else: + error_messages.append(trans("i18n_data_training.advanced_application_not_found").format( + info.advanced_application_name)) + + # 检查specific_ds为True时datasource_ids和advanced_application不能同时为空 + if specific_ds and not datasource_ids and advanced_application is None: + error_messages.append(trans("i18n_data_training.datasource_assistant_cannot_be_none")) else: # specific_ds为False时忽略数据源名称 datasource_ids = [] + advanced_application = None # 检查主词和其他词是否重复(过滤空字符串) words = [info.word.strip().lower()] @@ -456,11 +517,13 @@ def batch_create_terminology(session: SessionDep, info_list: List[TerminologyInf processed_info = TerminologyInfo( word=info.word.strip(), description=info.description.strip(), - other_words=[w for w in info.other_words if w and w.strip()], # 过滤空字符串 + other_words=[w for w in info.other_words if w and w.strip()], datasource_ids=datasource_ids, datasource_names=info.datasource_names, specific_ds=specific_ds, - enabled=info.enabled if info.enabled is not None else True + enabled=info.enabled if info.enabled is not None else True, + advanced_application=advanced_application, + advanced_application_name=info.advanced_application_name, ) valid_records.append(processed_info) @@ -512,8 +575,8 @@ def update_terminology(session: SessionDep, info: TerminologyInfo, oid: int, tra datasource_ids = info.datasource_ids if info.datasource_ids is not None else [] if specific_ds: - if not datasource_ids: - raise Exception(trans("i18n_terminology.datasource_cannot_be_none")) + if not datasource_ids and info.advanced_application is None: + raise Exception(trans("i18n_data_training.datasource_assistant_cannot_be_none")) words = [info.word.strip()] for child in info.other_words: @@ -536,24 +599,57 @@ def update_terminology(session: SessionDep, info: TerminologyInfo, oid: int, tra # 构建查询 query = session.query(Terminology).filter(base_query) - if specific_ds: - # 仅当 specific_ds=False 时,检查数据源条件 - query = query.where( - or_( - or_(Terminology.specific_ds == False, Terminology.specific_ds.is_(None)), - and_( - Terminology.specific_ds == True, - Terminology.datasource_ids.isnot(None), - text(""" - EXISTS ( - SELECT 1 FROM jsonb_array_elements(datasource_ids) AS elem - WHERE elem::text::int = ANY(:datasource_ids) - ) - """) # 检查是否包含任意目标值 + # 作用域重复检查 + scope_conditions = [] + + if not specific_ds: + # 全部数据源:与有数据源的记录冲突,也与同为全部数据源的记录冲突 + scope_conditions.append( + and_( + Terminology.specific_ds == True, + Terminology.datasource_ids.isnot(None), + func.jsonb_array_length(Terminology.datasource_ids) > 0, + ) + ) + scope_conditions.append( + Terminology.specific_ds == False, + ) + elif specific_ds and datasource_ids: + # 指定数据源:与全部数据源冲突,也与有数据源重叠的记录冲突 + scope_conditions.append( + Terminology.specific_ds == False, + ) + ds_overlap_conditions = [ + Terminology.datasource_ids.contains([ds_id]) + for ds_id in datasource_ids + ] + scope_conditions.append( + and_( + Terminology.specific_ds == True, + Terminology.datasource_ids.isnot(None), + or_(*ds_overlap_conditions) + ) + ) + else: + # 不选数据源:仅与同为不选数据源的记录冲突 + scope_conditions.append( + and_( + Terminology.specific_ds == True, + or_( + Terminology.datasource_ids.is_(None), + func.jsonb_array_length(Terminology.datasource_ids) == 0, ) ) ) - query = query.params(datasource_ids=datasource_ids) + + # 高级应用重复检查:advanced_application 相同时同名即重复 + if info.advanced_application is not None: + scope_conditions.append( + Terminology.advanced_application == info.advanced_application + ) + + if scope_conditions: + query = query.where(or_(*scope_conditions)) # 转换为 EXISTS 查询并获取结果 exists = session.query(query.exists()).scalar() @@ -567,6 +663,7 @@ def update_terminology(session: SessionDep, info: TerminologyInfo, oid: int, tra specific_ds=specific_ds, datasource_ids=datasource_ids, enabled=info.enabled, + advanced_application=info.advanced_application, ) session.execute(stmt) session.commit() @@ -590,7 +687,8 @@ def update_terminology(session: SessionDep, info: TerminologyInfo, oid: int, tra oid=oid, enabled=info.enabled, specific_ds=specific_ds, - datasource_ids=datasource_ids + datasource_ids=datasource_ids, + advanced_application=info.advanced_application, ) ) @@ -711,8 +809,22 @@ def save_embeddings(session_maker, ids: List[int]): LIMIT {settings.EMBEDDING_TERMINOLOGY_TOP_COUNT} """ +embedding_sql_with_advanced_application = f""" +SELECT id, pid, word, similarity +FROM +(SELECT id, pid, word, oid, specific_ds, advanced_application, enabled, +( 1 - (embedding <=> :embedding_array) ) AS similarity +FROM terminology AS child +) TEMP +WHERE similarity > {settings.EMBEDDING_TERMINOLOGY_SIMILARITY} AND oid = :oid AND enabled = true +AND advanced_application = :advanced_application_id +ORDER BY similarity DESC +LIMIT {settings.EMBEDDING_TERMINOLOGY_TOP_COUNT} +""" -def select_terminology_by_word(session: SessionDep, word: str, oid: int, datasource: int = None): + +def select_terminology_by_word(session: SessionDep, word: str, oid: int, datasource: int = None, + advanced_application_id: Optional[int] = None): if word.strip() == "": return [] @@ -729,7 +841,9 @@ def select_terminology_by_word(session: SessionDep, word: str, oid: int, datasou ) ) - if datasource is not None: + if advanced_application_id is not None: + stmt = stmt.where(Terminology.advanced_application == advanced_application_id) + elif datasource is not None: stmt = stmt.where( or_( or_(Terminology.specific_ds == False, Terminology.specific_ds.is_(None)), @@ -760,7 +874,11 @@ def select_terminology_by_word(session: SessionDep, word: str, oid: int, datasou embedding = model.embed_query(word) - if datasource is not None: + if advanced_application_id is not None: + results = session.execute(text(embedding_sql_with_advanced_application), + {'embedding_array': str(embedding), 'oid': oid, + 'advanced_application_id': advanced_application_id}).fetchall() + elif datasource is not None: results = session.execute(text(embedding_sql_with_datasource), {'embedding_array': str(embedding), 'oid': oid, 'datasource': datasource}).fetchall() @@ -846,13 +964,14 @@ def to_xml_string(_dict: list[dict] | dict, root: str = 'terminologies') -> str: def get_terminology_template(session: SessionDep, question: str, oid: Optional[int] = 1, - datasource: Optional[int] = None) -> str: + datasource: Optional[int] = None, + advanced_application_id: Optional[int] = None) -> tuple[str, list[dict]]: if not oid: oid = 1 - _results = select_terminology_by_word(session, question, oid, datasource) + _results = select_terminology_by_word(session, question, oid, datasource, advanced_application_id) if _results and len(_results) > 0: terminology = to_xml_string(_results) template = get_base_terminology_template().format(terminologies=terminology) - return template + return template, _results else: - return '' + return '', [] diff --git a/backend/apps/terminology/models/terminology_model.py b/backend/apps/terminology/models/terminology_model.py index 850aadabe..a0887eb77 100644 --- a/backend/apps/terminology/models/terminology_model.py +++ b/backend/apps/terminology/models/terminology_model.py @@ -20,6 +20,7 @@ class Terminology(SQLModel, table=True): specific_ds: Optional[bool] = Field(sa_column=Column(Boolean, default=False)) datasource_ids: Optional[list[int]] = Field(sa_column=Column(JSONB), default=[]) enabled: Optional[bool] = Field(sa_column=Column(Boolean, default=True)) + advanced_application: Optional[int] = Field(sa_column=Column(BigInteger, nullable=True)) class TerminologyInfo(BaseModel): @@ -32,3 +33,18 @@ class TerminologyInfo(BaseModel): datasource_ids: Optional[list[int]] = [] datasource_names: Optional[list[str]] = [] enabled: Optional[bool] = True + advanced_application: Optional[int] = None + advanced_application_name: Optional[str] = None + +class TerminologyInfoResult(BaseModel): + id: Optional[int] = None + create_time: Optional[datetime] = None + word: Optional[str] = None + description: Optional[str] = None + other_words: Optional[List[str]] = [] + specific_ds: Optional[bool] = False + datasource_ids: Optional[list[int]] = [] + datasource_names: Optional[list[str]] = [] + enabled: Optional[bool] = True + advanced_application: Optional[str] = None + advanced_application_name: Optional[str] = None diff --git a/backend/common/audit/schemas/logger_decorator.py b/backend/common/audit/schemas/logger_decorator.py index bd7a777cb..957ff5659 100644 --- a/backend/common/audit/schemas/logger_decorator.py +++ b/backend/common/audit/schemas/logger_decorator.py @@ -127,12 +127,34 @@ def get_client_info(request: Request) -> Dict[str, Optional[str]]: user_agent = None if request: - # Obtain IP address - if request.client: + # Prefer real client IP headers, then fallback to socket peer IP. + header_candidates = [ + "x-forwarded-for", + "x-real-ip", + "cf-connecting-ip", + "x-client-ip", + "x-forwarded", + "forwarded", + ] + for key in header_candidates: + value = request.headers.get(key) + if value: + if key == "x-forwarded-for": + ip_address = value.split(",")[0].strip() + elif key == "forwarded": + # RFC 7239 format, e.g. for=203.0.113.43;proto=https;by=203.0.113.1 + parts = [part.strip() for part in value.split(";")] + for part in parts: + if part.lower().startswith("for="): + ip_address = part.split("=", 1)[1].strip().strip('"') + break + else: + ip_address = value.strip() + if ip_address: + break + + if not ip_address and request.client: ip_address = request.client.host - # Attempt to obtain the real IP from X-Forwarded-For - if "x-forwarded-for" in request.headers: - ip_address = request.headers["x-forwarded-for"].split(",")[0].strip() # Get User Agent user_agent = request.headers.get("user-agent") diff --git a/backend/common/core/config.py b/backend/common/core/config.py index aa91c3048..4b9baeaec 100644 --- a/backend/common/core/config.py +++ b/backend/common/core/config.py @@ -31,7 +31,6 @@ class Settings(BaseSettings): PROJECT_NAME: str = "SQLBot" #CONTEXT_PATH: str = "/sqlbot" CONTEXT_PATH: str = "" - API_V1_STR: str = CONTEXT_PATH + "/api/v1" SECRET_KEY: str = secrets.token_urlsafe(32) # 60 minutes * 24 hours * 8 days = 8 days ACCESS_TOKEN_EXPIRE_MINUTES: int = 60 * 24 * 8 @@ -48,6 +47,11 @@ def all_cors_origins(self) -> list[str]: self.FRONTEND_HOST ] + @computed_field # type: ignore[prop-decorator] + @property + def API_V1_STR(self) -> str: + return self.CONTEXT_PATH + "/api/v1" + POSTGRES_SERVER: str = 'localhost' POSTGRES_PORT: int = 5432 POSTGRES_USER: str = 'root' @@ -71,6 +75,8 @@ def all_cors_origins(self) -> list[str]: SCRIPT_DIR: str = f"{BASE_DIR}/scripts" UPLOAD_DIR: str = "/opt/sqlbot/data/file" SQLBOT_KEY_EXPIRED: int = 100 # License key expiration timestamp, 0 means no expiration + + SQLBOT_DOC_ENABLED: bool = True @computed_field # type: ignore[prop-decorator] @property @@ -105,6 +111,11 @@ def SQLALCHEMY_DATABASE_URI(self) -> PostgresDsn | str: # 是否启用SQL查询行数限制,默认值,可被参数配置覆盖 GENERATE_SQL_QUERY_LIMIT_ENABLED: bool = True + GENERATE_SQL_QUERY_HISTORY_ROUND_COUNT: int = 3 + + # 安全配置:是否允许元数据查询(SHOW/DESCRIBE/DESC/EXPLAIN) + # 默认关闭,防止通过元数据查询泄露数据库结构 + SQLBOT_ALLOW_METADATA_QUERIES: bool = False PARSE_REASONING_BLOCK_ENABLED: bool = True DEFAULT_REASONING_CONTENT_START: str = '' diff --git a/backend/common/core/response_middleware.py b/backend/common/core/response_middleware.py index dfd9f1dc5..91aa61783 100644 --- a/backend/common/core/response_middleware.py +++ b/backend/common/core/response_middleware.py @@ -1,4 +1,5 @@ import json +from typing import Optional from starlette.exceptions import HTTPException from starlette.middleware.base import BaseHTTPMiddleware @@ -10,18 +11,28 @@ class ResponseMiddleware(BaseHTTPMiddleware): - def __init__(self, app): - super().__init__(app) + instances = [] + def __init__(self, app, allow_origins: Optional[list[str]] = None): + super().__init__(app) + self.allow_origins = allow_origins or ["'self'"] + ResponseMiddleware.instances.append(self) + + def update_allow_origins(self, new_allow_origins: Optional[list[str]] = None): + if not new_allow_origins: + return + self.allow_origins = list(set(self.allow_origins + new_allow_origins)) + + async def dispatch(self, request, call_next): response = await call_next(request) direct_paths = [ f"{settings.API_V1_STR}/mcp/mcp_question", f"{settings.API_V1_STR}/mcp/mcp_assistant", - "/openapi.json", - "/docs", - "/redoc" + f"{settings.CONTEXT_PATH}/openapi.json", + f"{settings.CONTEXT_PATH}/docs", + f"{settings.CONTEXT_PATH}/redoc" ] route = request.scope.get("route") @@ -29,7 +40,7 @@ async def dispatch(self, request, call_next): path_pattern = '' if not route else route.path_format if (isinstance(response, JSONResponse) - or request.url.path == f"{settings.API_V1_STR}/openapi.json" + or request.url.path == f"{settings.CONTEXT_PATH}/openapi.json" or path_pattern in direct_paths): return response if response.status_code != 200: @@ -76,7 +87,13 @@ async def dispatch(self, request, call_next): if k.lower() not in ("content-length", "content-type") } ) - + content_type = response.headers.get("content-type", "") + static_content_types = ["text/html", "javascript", "typescript", "css"] + if any(ct in content_type for ct in static_content_types): + if self.allow_origins: + frame_ancestors_value = " ".join(self.allow_origins) + response.headers["Content-Security-Policy"] = f"frame-ancestors {frame_ancestors_value};" + return response diff --git a/backend/common/utils/data_format.py b/backend/common/utils/data_format.py index 1991fb3e4..56a83f866 100644 --- a/backend/common/utils/data_format.py +++ b/backend/common/utils/data_format.py @@ -1,3 +1,5 @@ +from decimal import Decimal + import pandas as pd from apps.chat.models.chat_model import AxisObj @@ -17,6 +19,34 @@ def safe_convert_to_string(df): return df_copy + @staticmethod + def normalize_qualified_sql_column_keys(row: dict) -> dict: + """Add unqualified keys for names like ``alias.column`` (Hive/MySQL return shape). + + Chart bindings use the bare column name (``table_name``) while drivers may return + ``_u2.table_name``. Only adds ``short`` when absent to avoid clobbering real duplicates. + """ + if not row: + return row + out = dict(row) + for k, v in row.items(): + ks = str(k) + if "." not in ks: + continue + short = ks.rsplit(".", 1)[-1] + if short not in out: + out[short] = v + return out + + @staticmethod + def normalize_qualified_sql_column_keys_in_object_array(obj_array: list) -> list: + if not obj_array: + return obj_array + return [ + DataFormat.normalize_qualified_sql_column_keys(obj) if isinstance(obj, dict) else obj + for obj in obj_array + ] + @staticmethod def convert_large_numbers_in_object_array(obj_array, int_threshold=1e15, float_threshold=1e10): """处理对象数组,将每个对象中的大数字转换为字符串""" @@ -25,7 +55,7 @@ def format_float_without_scientific(value): """格式化浮点数,避免科学记数法""" if value == 0: return "0" - formatted = f"{value:.15f}" + formatted = str(Decimal(str(value))) if '.' in formatted: formatted = formatted.rstrip('0').rstrip('.') return formatted diff --git a/backend/common/utils/whitelist.py b/backend/common/utils/whitelist.py index 9080062e9..bdbea3420 100644 --- a/backend/common/utils/whitelist.py +++ b/backend/common/utils/whitelist.py @@ -7,7 +7,6 @@ "/", "/docs", "/login/*", - "*.json", "*.ico", "*.html", "*.js", @@ -22,6 +21,7 @@ "*.ttf", "*.eot", "*.otf", + "*.css.map", "/mcp*", "/system/license", "/system/config/key", @@ -90,4 +90,4 @@ def add_path(self, path: str) -> None: if "*" in path: self._compile_patterns() -whiteUtils = WhitelistChecker() \ No newline at end of file +whiteUtils = WhitelistChecker() diff --git a/backend/locales/en.json b/backend/locales/en.json index fb9e1ad8a..43db335b8 100644 --- a/backend/locales/en.json +++ b/backend/locales/en.json @@ -13,7 +13,8 @@ "no_associated_ws": "No associated workspace, {msg}", "user_disable": "Account is disabled, {msg}", "origin_error": "Invalid login method", - "prohibit_auto_create": "Automatically creating users is prohibited. Please synchronize users first" + "prohibit_auto_create": "Automatically creating users is prohibited. Please synchronize users first", + "no_platform_user": "Account does not exist. Please sync the user first." }, "i18n_user": { "account": "Account", @@ -40,7 +41,9 @@ "only_admin": "Only administrators are allowed to call!", "no_permission": "No permission to call {url}{msg}", "authenticate_invalid": "Authentication invalid【{msg}】", - "token_expired": "Token expired" + "token_expired": "Token expired", + "only_ws_admin": "Workspace administrator access required!", + "permission_resource_limit": "Access denied or resource not found!" }, "i18n_llm": { "validate_error": "Validation failed [{msg}]", @@ -48,6 +51,7 @@ "miss_default": "Default large language model has not been configured" }, "i18n_ds_invalid": "Datasource connection is invalid", + "i18n_ds_upload_error": "Upload Failed", "i18n_embedded": { "invalid_origin": "Domain name validation failed【{origin}】" }, @@ -184,5 +188,11 @@ "update_status": "Update Status", "update_table_relation": "Change Table Relation" }, - "i18n_table_not_exist": "Table not exist" + "i18n_table_not_exist": "Table not exist", + "i18n_variable": { + "name_exist": "Name exist", + "name": "Name", + "account": "Account", + "email": "Email" + } } \ No newline at end of file diff --git a/backend/locales/ko-KR.json b/backend/locales/ko-KR.json index 4d5cdd764..bccbfdbb9 100644 --- a/backend/locales/ko-KR.json +++ b/backend/locales/ko-KR.json @@ -13,7 +13,8 @@ "no_associated_ws": "연결된 작업 공간이 없습니다, {msg}", "user_disable": "계정이 비활성화되었습니다, {msg}", "origin_error": "잘못된 로그인 방식입니다", - "prohibit_auto_create": "사용자 자동 생성이 금지되어 있습니다. 먼저 사용자를 동기화해 주세요" + "prohibit_auto_create": "사용자 자동 생성이 금지되어 있습니다. 먼저 사용자를 동기화해 주세요", + "no_platform_user": "계정이 존재하지 않습니다. 먼저 사용자를 동기화하세요." }, "i18n_user": { "account": "계정", @@ -40,7 +41,9 @@ "only_admin": "관리자만 호출할 수 있습니다!", "no_permission": "{url}{msg} 호출 권한이 없습니다", "authenticate_invalid": "인증 무효 【{msg}】", - "token_expired": "토큰이 만료됨" + "token_expired": "토큰이 만료됨", + "only_ws_admin": "워크스페이스 관리자만 사용 가능합니다!", + "permission_resource_limit": "권한이 없거나 리소스를 찾을 수 없습니다!" }, "i18n_llm": { "validate_error": "검증 실패 [{msg}]", @@ -48,6 +51,7 @@ "miss_default": "기본 대형 언어 모델이 구성되지 않았습니다" }, "i18n_ds_invalid": "데이터 소스 연결이 무효합니다", + "i18n_ds_upload_error": "파일 업로드 실패", "i18n_embedded": { "invalid_origin": "도메인 이름 검증 실패 【{origin}】" }, @@ -184,5 +188,11 @@ "update_status": "상태 업데이트", "update_table_relation": "테이블 관계 변경" }, - "i18n_table_not_exist": "현재 테이블이 존재하지 않습니다" + "i18n_table_not_exist": "현재 테이블이 존재하지 않습니다", + "i18n_variable": { + "name_exist": "변수 이름이 이미 존재합니다", + "name": "이름", + "account": "계정", + "email": "이메일" + } } \ No newline at end of file diff --git a/backend/locales/zh-CN.json b/backend/locales/zh-CN.json index 8fe37bcf7..788e911e7 100644 --- a/backend/locales/zh-CN.json +++ b/backend/locales/zh-CN.json @@ -13,7 +13,8 @@ "no_associated_ws": "没有关联的工作空间,{msg}", "user_disable": "账号已禁用,{msg}", "origin_error": "登录方式错误", - "prohibit_auto_create": "禁止自动创建用户,请先同步用户" + "prohibit_auto_create": "禁止自动创建用户,请先同步用户", + "no_platform_user": "账号不存在,请先同步用户" }, "i18n_user": { "account": "账号", @@ -40,7 +41,9 @@ "only_admin": "仅支持管理员调用!", "no_permission": "无权调用{url}{msg}", "authenticate_invalid": "认证无效【{msg}】", - "token_expired": "Token 已过期" + "token_expired": "Token 已过期", + "only_ws_admin": "仅支持工作空间管理员调用!", + "permission_resource_limit": "没有操作权限或资源不存在!" }, "i18n_llm": { "validate_error": "校验失败[{msg}]", @@ -48,6 +51,7 @@ "miss_default": "尚未配置默认大语言模型" }, "i18n_ds_invalid": "数据源连接无效", + "i18n_ds_upload_error": "上传文件失败", "i18n_embedded": { "invalid_origin": "域名校验失败【{origin}】" }, @@ -184,5 +188,11 @@ "update_status": "更新状态", "update_table_relation": "变更表关系" }, - "i18n_table_not_exist": "当前表不存在" + "i18n_table_not_exist": "当前表不存在", + "i18n_variable": { + "name_exist": "变量名称已存在", + "name": "姓名", + "account": "账号", + "email": "邮箱" + } } \ No newline at end of file diff --git a/backend/locales/zh-TW.json b/backend/locales/zh-TW.json new file mode 100644 index 000000000..6b37aca9f --- /dev/null +++ b/backend/locales/zh-TW.json @@ -0,0 +1,198 @@ +{ + "i18n_default_workspace": "默認工作空間", + "i18n_ds_name_exist": "名稱已存在", + "i18n_concat_admin": "請聯繫管理員!", + "i18n_exist": "{msg}已存在!", + "i18n_name": "名稱", + "i18n_not_exist": "{msg}不存在!", + "i18n_error": "{key}錯誤!", + "i18n_miss_args": "缺失{key}參數!", + "i18n_format_invalid": "{key}格式不正確!", + "i18n_login": { + "account_pwd_error": "帳號或密碼錯誤!", + "no_associated_ws": "沒有關聯的工作空間,{msg}", + "user_disable": "帳號已禁用,{msg}", + "origin_error": "登入方式錯誤", + "prohibit_auto_create": "禁止自動建立用戶,請先同步用戶", + "no_platform_user": "帳號不存在,請先同步用戶" + }, + "i18n_user": { + "account": "帳號", + "email": "郵箱", + "password": "密碼", + "language_not_support": "系統不支援[{key}]語言!", + "ws_miss": "當前用戶不在工作空間[{ws}]中!", + "name": "姓名", + "status": "用戶狀態", + "origin": "用戶來源", + "workspace": "工作空間", + "role": "角色", + "platform_user_id": "外部用戶唯一標識", + "administrator": "管理員", + "ordinary_member": "普通成員", + "status_enabled": "已啟用", + "status_disabled": "已禁用", + "local_creation": "本地建立" + }, + "i18n_ws": { + "title": "工作空間" + }, + "i18n_permission": { + "only_admin": "僅支援管理員調用!", + "no_permission": "無權調用{url}{msg}", + "authenticate_invalid": "認證無效【{msg}】", + "token_expired": "Token 已過期", + "only_ws_admin": "僅支援工作空間管理員調用!", + "permission_resource_limit": "沒有操作權限或資源不存在!" + }, + "i18n_llm": { + "validate_error": "校驗失敗[{msg}]", + "delete_default_error": "無法刪除默認模型[{key}]!", + "miss_default": "尚未配置默認大語言模型" + }, + "i18n_ds_invalid": "數據源連接無效", + "i18n_ds_upload_error": "上傳文件失敗", + "i18n_embedded": { + "invalid_origin": "網域校驗失敗【{origin}】" + }, + "i18n_chat": { + "record_id_in_mcp": "響應ID: " + }, + "i18n_terminology": { + "terminology_not_exists": "該術語不存在", + "datasource_cannot_be_none": "數據源不能為空", + "cannot_be_repeated": "術語名稱,同義詞不能重複", + "exists_in_db": "術語名稱,同義詞已存在", + "term_name": "術語名稱", + "term_description": "術語描述", + "effective_data_sources": "生效數據源", + "all_data_sources": "所有數據源", + "synonyms": "同義詞", + "term_name_template": "術語名稱(必填)", + "term_description_template": "術語描述(必填)", + "effective_data_sources_template": "生效數據源(支援多個,用\",\"分割)", + "all_data_sources_template": "所有數據源(Y:應用到全部數據源,N:應用到指定數據源)", + "synonyms_template": "同義詞(支援多個,用\",\"分割)", + "term_name_template_example_1": "術語1", + "term_description_template_example_1": "術語1描述", + "effective_data_sources_template_example_1": "生效數據源1, 生效數據源2", + "synonyms_template_example_1": "同義詞1, 同義詞2", + "term_name_template_example_2": "術語2", + "term_description_template_example_2": "術語2描述", + "synonyms_template_example_2": "同義詞3", + "word_cannot_be_empty": "術語名稱不能為空", + "description_cannot_be_empty": "術語描述不能為空", + "datasource_not_found": "找不到數據源" + }, + "i18n_data_training": { + "datasource_list_is_not_found": "數據源列表未找到", + "datasource_id_not_found": "數據源ID: {key} 未找到", + "datasource_cannot_be_none": "數據源不能為空", + "datasource_assistant_cannot_be_none": "數據源或高級應用不能都為空", + "data_training_not_exists": "該範例不存在", + "exists_in_db": "該問題已存在", + "data_training": "SQL 範例庫", + "problem_description": "問題描述", + "sample_sql": "範例 SQL", + "effective_data_sources": "生效數據源", + "advanced_application": "高級應用", + "problem_description_template": "問題描述(必填)", + "sample_sql_template": "範例 SQL(必填)", + "effective_data_sources_template": "生效數據源", + "advanced_application_template": "高級應用", + "problem_description_template_example": "查詢TEST表內所有ID", + "effective_data_sources_template_example": "生效數據源1", + "advanced_application_template_example": "生效高級應用名稱", + "error_info": "錯誤訊息", + "question_cannot_be_empty": "問題不能為空", + "description_cannot_be_empty": "範例 SQL 不能為空", + "datasource_not_found": "找不到數據源", + "advanced_application_not_found": "找不到高級應用" + }, + "i18n_custom_prompt": { + "exists_in_db": "模版名稱已存在", + "not_exists": "該模版不存在", + "prompt_word_name": "提示詞名稱", + "prompt_word_content": "提示詞內容", + "effective_data_sources": "生效數據源", + "all_data_sources": "所有數據源", + "prompt_word_name_template": "提示詞名稱(必填)", + "prompt_word_content_template": "提示詞內容(必填)", + "effective_data_sources_template": "生效數據源(支援多個,用\",\"分割)", + "all_data_sources_template": "所有數據源(Y:應用到全部數據源,N:應用到指定數據源)", + "prompt_word_name_template_example1": "提示詞1", + "prompt_word_content_template_example1": "詳細描述你的提示詞", + "effective_data_sources_template_example1": "生效數據源1, 生效數據源2", + "prompt_word_name_template_example2": "提示詞2", + "prompt_word_content_template_example2": "詳細描述你的提示詞", + "name_cannot_be_empty": "名稱不能為空", + "prompt_cannot_be_empty": "提示詞內容不能為空", + "type_cannot_be_empty": "類型不能為空", + "datasource_not_found": "找不到數據源", + "datasource_cannot_be_none": "數據源不能為空" + }, + "i18n_excel_export": { + "data_is_empty": "表單數據為空,無法導出數據" + }, + "i18n_excel_import": { + "col_num_not_match": "EXCEL列數量不匹配" + }, + "i18n_authentication": { + "record_not_exist": "{msg} 記錄不存在,請先儲存!" + }, + "i18n_audit": { + "success": "成功", + "failed": "失敗", + "system_log": "操作日誌", + "operation_type_name": "操作類型", + "operation_detail_info": "操作詳情", + "user_name": "操作用戶", + "oid_name": "工作空間", + "operation_status_name": "操作狀態", + "error_message": "錯誤訊息", + "ip_address": "IP 地址", + "create_time": "操作時間", + "chat": "智能問數", + "datasource": "數據源", + "dashboard": "儀表板", + "member": "成員", + "permission": "權限", + "terminology": "術語", + "data_training": "SQL 範例庫", + "prompt_words": "提示詞", + "user": "用戶", + "workspace": "工作空間", + "ai_model": "AI 模型", + "application": "應用", + "theme": "外觀配置", + "create": "新建", + "delete": "刪除", + "update": "更新", + "edit": "編輯", + "login": "登入", + "export": "匯出", + "import": "匯入", + "add": "新增", + "create_or_update": "變更", + "api_key": "API Key", + "params_setting": "參數配置", + "rules": "權限規則", + "log_setting": "登入認證", + "setting": "設定", + "system_management": "系統管理", + "opt_log": "操作日誌", + "prediction": "數據預測", + "analysis": "數據分析", + "reset_pwd": "重置密碼", + "update_pwd": "更新密碼", + "update_status": "更新狀態", + "update_table_relation": "變更表關係" + }, + "i18n_table_not_exist": "當前表不存在", + "i18n_variable": { + "name_exist": "變數名稱已存在", + "name": "姓名", + "account": "帳號", + "email": "郵箱" + } +} \ No newline at end of file diff --git a/backend/main.py b/backend/main.py index e473af875..a8bab9743 100644 --- a/backend/main.py +++ b/backend/main.py @@ -10,8 +10,10 @@ from fastapi.routing import APIRoute from fastapi.staticfiles import StaticFiles from fastapi_mcp import FastApiMCP +from starlette.datastructures import MutableHeaders from starlette.exceptions import HTTPException as StarletteHTTPException from starlette.middleware.cors import CORSMiddleware +from starlette.middleware.base import BaseHTTPMiddleware from alembic import command from apps.api import api_router @@ -70,13 +72,27 @@ def custom_generate_unique_id(route: APIRoute) -> str: app = FastAPI( title=settings.PROJECT_NAME, - openapi_url=f"{settings.API_V1_STR}/openapi.json", + openapi_url=f"{settings.CONTEXT_PATH}/openapi.json" if settings.SQLBOT_DOC_ENABLED else None, generate_unique_id_function=custom_generate_unique_id, lifespan=lifespan, docs_url=None, redoc_url=None ) + +class McpClientIpForwardMiddleware(BaseHTTPMiddleware): + async def dispatch(self, request: Request, call_next): + client_host = request.client.host if request.client else None + if client_host: + headers = MutableHeaders(scope=request.scope) + if not headers.get("x-real-ip"): + headers["x-real-ip"] = client_host + if not headers.get("x-forwarded-for"): + headers["x-forwarded-for"] = client_host + if not headers.get("x-client-ip"): + headers["x-client-ip"] = client_host + return await call_next(request) + # cache docs for different text _openapi_cache: Dict[str, Dict[str, Any]] = {} @@ -152,27 +168,29 @@ def generate_openapi_for_lang(lang: str) -> Dict[str, Any]: # custom /openapi.json and /docs -@app.get("/openapi.json", include_in_schema=False) -async def custom_openapi(request: Request): - lang = get_language_from_request(request) - schema = generate_openapi_for_lang(lang) - return JSONResponse(schema) - - -@app.get("/docs", include_in_schema=False) -async def custom_swagger_ui(request: Request): - lang = get_language_from_request(request) - from fastapi.openapi.docs import get_swagger_ui_html - return get_swagger_ui_html( - openapi_url=f"/openapi.json?lang={lang}", - title="SQLBot API Docs", - swagger_favicon_url="https://fastapi.tiangolo.com/img/favicon.png", - swagger_js_url="/swagger-ui-bundle.js", - swagger_css_url="/swagger-ui.css", - ) +if settings.SQLBOT_DOC_ENABLED: + @app.get(f"{settings.CONTEXT_PATH}/openapi.json", include_in_schema=False) + async def custom_openapi(request: Request): + lang = get_language_from_request(request) + schema = generate_openapi_for_lang(lang) + return JSONResponse(schema) + + + @app.get(f"{settings.CONTEXT_PATH}/docs", include_in_schema=False) + async def custom_swagger_ui(request: Request): + lang = get_language_from_request(request) + from fastapi.openapi.docs import get_swagger_ui_html + return get_swagger_ui_html( + openapi_url=f"./openapi.json?lang={lang}", + title="SQLBot API Docs", + swagger_favicon_url="https://fastapi.tiangolo.com/img/favicon.png", + swagger_js_url="./swagger-ui-bundle.js", + swagger_css_url="./swagger-ui.css", + ) mcp_app = FastAPI() +mcp_app.add_middleware(McpClientIpForwardMiddleware) # mcp server, images path images_path = settings.MCP_IMAGE_PATH os.makedirs(images_path, exist_ok=True) @@ -184,7 +202,8 @@ async def custom_swagger_ui(request: Request): description="SQLBot MCP Server", describe_all_responses=True, describe_full_response_schema=True, - include_operations=["mcp_datasource_list", "get_model_list", "mcp_question", "mcp_start", "mcp_assistant"] + include_operations=["mcp_datasource_list", "get_model_list", "mcp_question", "mcp_start", "mcp_assistant", "mcp_ws_list", "access_token"], + headers=["Authorization", "X-Forwarded-For", "X-Real-IP", "CF-Connecting-IP", "X-Client-IP"] ) mcp.mount(mcp_app) diff --git a/backend/pyproject.toml b/backend/pyproject.toml index 256396ecf..1c38a592d 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "sqlbot" -version = "1.5.0" +version = "1.10.0" description = "" requires-python = "==3.11.*" dependencies = [ @@ -39,7 +39,7 @@ dependencies = [ "pyyaml (>=6.0.2,<7.0.0)", "fastapi-mcp (>=0.3.4,<0.4.0)", "tabulate>=0.9.0", - "sqlbot-xpack>=0.0.5.0,<0.0.6.0", + "sqlbot-xpack>=0.0.5.32,<0.0.6.0", "fastapi-cache2>=0.2.2", "sqlparse>=0.5.3", "redis>=6.2.0", @@ -52,6 +52,11 @@ dependencies = [ "redshift-connector>=2.1.8", "elasticsearch[requests] (>=7.10,<8.0)", "ldap3>=2.9.1", + "sqlglot>=28.6.0", + "numpy==2.3.5", + "pyhive[hive_pure_sasl]>=0.7.0", + "thrift-sasl", + "dbutils>=3.1.2", ] [project.optional-dependencies] @@ -74,7 +79,7 @@ explicit = true [[tool.uv.index]] name = "default" -url = "https://mirrors.hust.edu.cn/pypi/web/simple" +url = "http://mirrors.aliyun.com/pypi/simple" default = true [[tool.uv.index]] diff --git a/backend/templates/sql_examples/AWS_Redshift.yaml b/backend/templates/sql_examples/AWS_Redshift.yaml index 40036b975..768bdca6b 100644 --- a/backend/templates/sql_examples/AWS_Redshift.yaml +++ b/backend/templates/sql_examples/AWS_Redshift.yaml @@ -51,6 +51,7 @@ template: COUNT("t1"."订单ID") AS "total_orders", CONCAT(ROUND("t1"."折扣率" * 100, 2), '%') AS "discount_percent" FROM "TEST"."SALES" "t1" + GROUP BY "t1"."订单ID", "t1"."金额", "t1"."折扣率" LIMIT 100 diff --git a/backend/templates/sql_examples/DM.yaml b/backend/templates/sql_examples/DM.yaml index 29e65d82c..df050f6e8 100644 --- a/backend/templates/sql_examples/DM.yaml +++ b/backend/templates/sql_examples/DM.yaml @@ -52,6 +52,7 @@ template: COUNT("t1"."订单ID") AS "total_orders", TO_CHAR("t1"."折扣率" * 100, '990.99') || '%' AS "discount_percent" FROM "TEST"."ORDERS" "t1" + GROUP BY "t1"."订单ID", "t1"."金额", "t1"."折扣率" LIMIT 100 diff --git a/backend/templates/sql_examples/Doris.yaml b/backend/templates/sql_examples/Doris.yaml index b973c529d..9e16b7593 100644 --- a/backend/templates/sql_examples/Doris.yaml +++ b/backend/templates/sql_examples/Doris.yaml @@ -53,6 +53,7 @@ template: COUNT(`t1`.`订单ID`) AS `total_orders`, CONCAT(ROUND(`t1`.`折扣率` * 100, 2), '%') AS `discount_percent` FROM `test`.`orders` `t1` + GROUP BY `t1`.`订单ID`, `t1`.`金额`, `t1`.`折扣率` LIMIT 100 diff --git a/backend/templates/sql_examples/Hive.yaml b/backend/templates/sql_examples/Hive.yaml new file mode 100644 index 000000000..f7998b930 --- /dev/null +++ b/backend/templates/sql_examples/Hive.yaml @@ -0,0 +1,88 @@ +template: + quot_rule: | + + 必须对数据库名、表名、字段名、别名外层加反引号(`)。 + + 1. 点号(.)不能包含在引号内,必须写成 `database`.`table` + 2. 即使标识符不含特殊字符或非关键字,也需强制加反引号 + 3. 在多表关联(JOIN)/ 多子查询的 SQL 中,只要多个表 / 子查询存在 同名字段,所有引用该字段的位置,必须显式指定 表别名 + + + + limit_rule: | + + 当需要限制行数时,必须使用标准的LIMIT语法 + + + other_rule: | + 必须为每个表生成别名(不加AS) + {multi_table_condition} + 禁止使用星号(*),必须明确字段名 + 中文/特殊字符字段需保留原名并添加英文别名 + 不能用 + 拼接字符串,字符串必须使用单引号 + 分组非常严格:SELECT 里的字段必须出现在 GROUP BY 里,或者是聚合函数 + 函数字段必须加别名 + 百分比字段保留两位小数并以%结尾 + WHERE 条件中不能使用 >、<、>=、<= 等比较运算符,必须使用 = + HIVE 中没有 NOT IN 操作符,必须使用 LEFT JOIN 或 EXISTS 替代 + 判空使用 NVL()函数 + 避免与数据库关键字冲突 + + basic_example: | + + + 📌 以下示例严格遵循中的 Hive 规范,展示符合要求的 SQL 写法与典型错误案例。 + ⚠️ 注意:示例中的表名、字段名均为演示虚构,实际使用时需替换为用户提供的真实标识符。 + 🔍 重点观察: + 1. 反引号包裹所有数据库对象的规范用法 + 2. 中英别名/百分比/函数等特殊字段的处理 + 3. 关键字冲突的规避方式 + + + 查询 ods.orders 表的前100条订单(含中文字段和百分比) + + SELECT * FROM ods.orders LIMIT 100 -- 错误:未加引号、使用星号 + SELECT `订单ID`, `金额` FROM `ods`.`orders` `t1` LIMIT 100 -- 错误:缺少英文别名 + SELECT COUNT(`订单ID`) FROM `ods`.`orders` `t1` -- 错误:函数未加别名 + + + SELECT + `t1`.`订单ID` AS `order_id`, + `t1`.`金额` AS `amount`, + COUNT(`t1`.`订单ID`) AS `total_orders`, + CONCAT(CAST(ROUND(`t1`.`折扣率` * 100, 2) AS STRING), '%') AS `discount_percent` + FROM `ods`.`orders` `t1` + GROUP BY `t1`.`订单ID`, `t1`.`金额`, `t1`.`折扣率` + LIMIT 100 + + + + + 统计 dim.users(含关键字字段user)的活跃占比 + + SELECT user, status FROM dim.users -- 错误:未处理关键字和引号 + SELECT `user`, ROUND(active_ratio) FROM `dim`.`users` -- 错误:百分比格式错误 + + + SELECT + `u`.`user` AS `username`, + CONCAT(CAST(ROUND(`u`.`active_ratio` * 100, 2) AS STRING), '%') AS `active_percent` + FROM `dim`.`users` `u` + WHERE `u`.`status` = 1 + + + + + example_engine: Apache Hive 2.X + example_answer_1: | + {"success":true,"sql":"SELECT `country` AS `country_name`, `continent` AS `continent_name`, `year` AS `year`, `gdp` AS `gdp` FROM `Sample_Database`.`sample_country_gdp` ORDER BY `country`, `year`","tables":["sample_country_gdp"],"chart-type":"line"} + example_answer_1_with_limit: | + {"success":true,"sql":"SELECT `country` AS `country_name`, `continent` AS `continent_name`, `year` AS `year`, `gdp` AS `gdp` FROM `Sample_Database`.`sample_country_gdp` ORDER BY `country`, `year` LIMIT 1000","tables":["sample_country_gdp"],"chart-type":"line"} + example_answer_2: | + {"success":true,"sql":"SELECT `country` AS `country_name`, `gdp` AS `gdp` FROM `Sample_Database`.`sample_country_gdp` WHERE `year` = '2024' ORDER BY `gdp` DESC","tables":["sample_country_gdp"],"chart-type":"pie"} + example_answer_2_with_limit: | + {"success":true,"sql":"SELECT `country` AS `country_name`, `gdp` AS `gdp` FROM `Sample_Database`.`sample_country_gdp` WHERE `year` = '2024' ORDER BY `gdp` DESC LIMIT 1000","tables":["sample_country_gdp"],"chart-type":"pie"} + example_answer_3: | + {"success":true,"sql":"SELECT `country` AS `country_name`, `gdp` AS `gdp` FROM `Sample_Database`.`sample_country_gdp` WHERE `year` = '2025' AND `country` = '中国'","tables":["sample_country_gdp"],"chart-type":"table"} + example_answer_3_with_limit: | + {"success":true,"sql":"SELECT `country` AS `country_name`, `gdp` AS `gdp` FROM `Sample_Database`.`sample_country_gdp` WHERE `year` = '2025' AND `country` = '中国' LIMIT 1000","tables":["sample_country_gdp"],"chart-type":"table"} diff --git a/backend/templates/sql_examples/Microsoft_SQL_Server.yaml b/backend/templates/sql_examples/Microsoft_SQL_Server.yaml index 856ac2a6a..31bc77c5f 100644 --- a/backend/templates/sql_examples/Microsoft_SQL_Server.yaml +++ b/backend/templates/sql_examples/Microsoft_SQL_Server.yaml @@ -52,6 +52,7 @@ template: COUNT([o].[订单ID]) AS [total_orders], CONVERT(VARCHAR, ROUND([o].[折扣率] * 100, 2)) + '%' AS [discount_percent] FROM [Sales].[Orders] [o] + GROUP BY [o].[订单ID], [o].[金额], [o].[折扣率] diff --git a/backend/templates/sql_examples/MySQL.yaml b/backend/templates/sql_examples/MySQL.yaml index 1335ec9e4..36e27e818 100644 --- a/backend/templates/sql_examples/MySQL.yaml +++ b/backend/templates/sql_examples/MySQL.yaml @@ -51,6 +51,7 @@ template: COUNT(`t1`.`订单ID`) AS `total_orders`, CONCAT(ROUND(`t1`.`折扣率` * 100, 2), '%') AS `discount_percent` FROM `test`.`orders` `t1` + GROUP BY `t1`.`订单ID`, `t1`.`金额`, `t1`.`折扣率` LIMIT 100 diff --git a/backend/templates/sql_examples/Oracle.yaml b/backend/templates/sql_examples/Oracle.yaml index 44e7ebedc..e3c52288b 100644 --- a/backend/templates/sql_examples/Oracle.yaml +++ b/backend/templates/sql_examples/Oracle.yaml @@ -3,14 +3,16 @@ template: 1. 分析用户问题,确定查询需求 2. 根据表结构生成基础SQL - 3. 强制检查:SQL是否包含GROUP BY/聚合函数? - 4. 如果是GROUP BY查询:必须使用外层查询结构包裹 - 5. 强制检查:应用数据量限制规则 - 6. 应用其他规则(引号、别名等) - 7. 最终验证:GROUP BY查询的ROWNUM位置是否正确? - 8. 强制检查:检查语法是否正确? - 9. 确定图表类型 - 10. 返回JSON结果 + 3. 强制检查:逐字验证SQL中使用的表名和字段名是否在中定义,且字符必须完全匹配(包括繁简体、大小写、特殊字符),不得有任何转换。如發现任何不一致,必须重新生成SQL。 + 4. 强制检查:应用数据量限制规则(默认限制或用户指定数量) + 5. 应用其他规则(引号、别名、格式化等) + 6. 最终验证:GROUP BY查询的ROWNUM位置是否正确? + 7. 强制检查:验证SQL语法是否符合规范 + 8. 确定图表类型(根据规则选择table/column/bar/line/pie) + 9. 确定对话标题 + 10. 生成JSON结果 + 11. 强制检查:JSON格式是否正确 + 12. 返回JSON结果 quot_rule: | @@ -114,6 +116,7 @@ template: COUNT("t1"."订单ID") AS "total_orders", TO_CHAR("t1"."折扣率" * 100, '990.99') || '%' AS "discount_percent" FROM "TEST"."ORDERS" "t1" + GROUP BY "t1"."订单ID", "t1"."金额", "t1"."折扣率" WHERE ROWNUM <= 100 diff --git a/backend/templates/sql_examples/PostgreSQL.yaml b/backend/templates/sql_examples/PostgreSQL.yaml index 42a9cfe41..268e8b7b5 100644 --- a/backend/templates/sql_examples/PostgreSQL.yaml +++ b/backend/templates/sql_examples/PostgreSQL.yaml @@ -46,6 +46,7 @@ template: COUNT("t1"."订单ID") AS "total_orders", ROUND("t1"."折扣率" * 100, 2) || '%' AS "discount_percent" FROM "TEST"."ORDERS" "t1" + GROUP BY "t1"."订单ID", "t1"."金额", "t1"."折扣率" LIMIT 100 diff --git a/backend/templates/template.yaml b/backend/templates/template.yaml index fffa9f903..8c2308575 100644 --- a/backend/templates/template.yaml +++ b/backend/templates/template.yaml @@ -13,13 +13,15 @@ template: 1. 分析用户问题,确定查询需求 2. 根据表结构生成基础SQL - 3. 强制检查:验证SQL中使用的表名和字段名是否在中定义 + 3. 强制检查:逐字验证SQL中使用的表名和字段名是否在中定义,且字符必须完全匹配(包括繁简体、大小写、特殊字符),不得有任何转换。如發现任何不一致,必须重新生成SQL。 4. 强制检查:应用数据量限制规则(默认限制或用户指定数量) 5. 应用其他规则(引号、别名、格式化等) 6. 强制检查:验证SQL语法是否符合规范 7. 确定图表类型(根据规则选择table/column/bar/line/pie) 8. 确定对话标题 - 9. 返回JSON结果 + 9. 生成JSON结果 + 10. 强制检查:JSON格式是否正确 + 11. 返回JSON结果 query_limit: | @@ -65,26 +67,27 @@ template: system: | - 你是"SQLBOT",智能问数小助手,可以根据用户提问,专业生成SQL,查询数据并进行图表展示。 + 你是智能问数小助手:"{sqlbot_name}"。你可以根据用户提问,专业生成SQL,查询数据并进行图表展示。 你当前的任务是根据给定的表结构和用户问题生成SQL语句、对话标题、可能适合展示的图表类型以及该SQL中所用到的表名。 我们会在块内提供给你信息,帮助你生成SQL: 内有等信息; 其中,:提供数据库引擎及版本信息; :以 M-Schema 格式提供数据库表结构信息; - :提供一组术语,块内每一个就是术语,其中同一个内的多个代表术语的多种叫法,也就是术语与它的同义词,即该术语对应的描述,其中也可能是能够用来参考的计算公式,或者是一些其他的查询条件; - :提供一组SQL示例,你可以参考这些示例来生成你的回答,其中内是提问,内是对于该提问的解释或者对应应该回答的SQL示例。 + :提供一组术语,块内每一个就是术语,其中同一个内的多个代表术语的多种叫法,也就是术语与它的同义词,即该术语对应的描述,其中也可能是能够用来参考的计算公式,或者是一些其他的查询条件; + :提供一组SQL示例,你可以参考这些示例来生成你的回答,其中内是提问,内是对于该提问的解释或者对应应该回答的SQL示例。 若有块,它会提供一组,可能会是额外添加的背景信息,或者是额外的生成SQL的要求,请结合额外信息或要求后生成你的回答。 - 用户的提问在内,内则会提供上次执行你提供的SQL时会出现的错误信息,内的会告诉你用户当前提问的时间 你必须遵守内规定的生成SQL规则 你必须遵守内规定的检查步骤生成你的回答 + 用户的提问在内,内则会提供上次执行你提供的SQL时会出现的错误信息,内的会告诉你用户当前提问的时间 + ⚠️ 重要警告:SQL语句中的数据库标识符(表名、字段名)必须严格保持原样,不得因回应语言而进行任何转换。即使整个回应使用繁体中文,SQL中的标识符也必须保持与完全一致(通常为简体中文)。这是确保SQL可执行的关键要求。 + {process_check} + + generate_rules: | + 以下是你必须遵守的规则和可以参考的基础示例: - - 请使用语言:{lang} 回答,若有深度思考过程,则思考过程也需要使用 {lang} 输出 - 即使示例中显示了中文消息,在实际生成时也必须翻译成英文 - - + 你只能生成查询用的SQL语句,不得生成增删改相关或操作数据库以及操作数据库数据的SQL @@ -93,10 +96,42 @@ template: 生成的SQL必须符合内提供数据库引擎的规范 + + 严格保持数据库标识符原样 + + 无论用户要求使用何种语言回应,SQL语句中的所有数据库标识符(表名、字段名)必须严格保持与中完全相同的字符。 + + 重要:当中提供的是简体中文标识符时: + 1. SQL中必须使用完全相同的简体中文字符 + 2. 绝对不允许进行繁简转换 + 3. 不允许进行任何字符替换、修改或标准化 + 4. 即使回应文本是繁体中文,SQL中的标识符也必须保持简体 + + 检查方法:生成SQL後,必须逐字对比SQL中的标识符与中的标识符,确保: + - 字符完全一致 + - 繁简体完全一致 + - 大小写完全一致 + - 特殊字符(如斜杠"/")完全一致 + + 如果发现不一致,必须重新生成SQL。 + + + + 标识符處理优先级 + + 1. 首先从中複製标识符到SQL中 + 2. 生成其他回应文本(如brief、message) + 3. 根据用户语言要求,只对非SQL部分的文本进行语言转换 + 4. 绝对不触及SQL中的标识符 + + 若用户提问中提供了参考SQL,你需要判断该SQL是否是查询语句 + 你只需要根据提供给你的信息生成的SQL,不需要你实际去数据库进行查询 + + 请使用JSON格式返回你的回答: 若能生成,则返回格式如:{{"success":true,"sql":"你生成的SQL语句","tables":["该SQL用到的表名1","该SQL用到的表名2",...],"chart-type":"table","brief":"如何需要生成对话标题,在这里填写你生成的对话标题,否则不需要这个字段"}} 若不能生成,则返回格式如:{{"success":false,"message":"说明无法生成SQL的原因"}} @@ -105,9 +140,38 @@ template: 如果问题是图表展示相关,可参考的图表类型为表格(table)、柱状图(column)、条形图(bar)、折线图(line)或饼图(pie), 返回的JSON内chart-type值则为 table/column/bar/line/pie 中的一个 图表类型选择原则推荐:趋势 over time 用 line,分类对比用 column/bar,占比用 pie,原始数据查看用 table - - 如果图表类型为柱状图(column)、条形图(bar)或折线图(line), 在生成的SQL中必须指定一个维度字段和一个指标字段,其中维度字段必须参与排序。 + + 图表字段维度与指标数量限制规则 + + + 柱状图(column)、条形图(bar)、折线图(line): + 必须有一个维度字段(横轴) + 最多有一个分类维度字段(如系列/颜色分组) + 有分类维度时,只能有一个指标字段(纵轴) + 没有分类维度时,可以有多个指标字段 + + + 饼图(pie): + 必须有一个分类维度字段(扇区) + 不能有其他维度字段 + 只能有一个指标字段(扇区大小) + + + + + 如果图表类型为柱状图(column)、条形图(bar)或折线图(line) + 在生成的SQL中必须指定一个维度字段和一个指标字段,其中维度字段必须参与排序 如果有分类用的字段,该字段参与次一级的排序 + + 此规则与"图表字段维度与指标数量限制规则"共同使用 + 当有多个指标字段时,选择主要指标字段进行排序 + + + + 如果图表类型为柱状图(column)、条形图(bar)或折线图(line)或饼图(pie) + 且查询的字段中包含分类字段(非数值类型字段,如城市、类别、状态等) + 在没有明确业务场景说明、或用户没有明确指定不需要聚合的情况下 + 必须对数值类型指标字段进行聚合计算(默认使用SUM函数) 如果问题是图表展示相关且与生成SQL查询无关时,请参考上一次回答的SQL来生成SQL @@ -141,10 +205,19 @@ template: 是否生成对话标题在内,如果为True需要生成,否则不需要生成,生成的对话标题要求在20字以内 + + 禁止要求额外信息 + + 禁止在回答中向用户询问或要求任何额外信息 + 只基于表结构和问题生成SQL,不考虑业务逻辑 + 即使查询条件不完整(如无时间范围),也必须生成可行的SQL + + + + 不论之前是否有回答相同的问题,都必须检查生成的SQL中使用的表名和字段名是否在内有定义 + - {process_check} - {basic_sql_examples} @@ -194,7 +267,7 @@ template: 今天天气如何? - {{"success":false,"message":"我是智能问数小助手,我无法回答您的问题。"}} + {{"success":false,"message":"我是{sqlbot_name},我无法回答您的问题。"}} @@ -202,7 +275,7 @@ template: 请清空数据库 - {{"success":false,"message":"我是智能问数小助手,我只能查询数据,不能操作数据库来修改数据或者修改表结构。"}} + {{"success":false,"message":"我是{sqlbot_name},我只能查询数据,不能操作数据库来修改数据或者修改表结构。"}} @@ -255,23 +328,36 @@ template: - - 以下是正式的信息: + + generate_terminologies_info: | + 以下是你可以参考的术语: + {terminologies} + + generate_data_training_info: | + 以下是你可以参考的SQL示例: + {data_training} + + generate_custom_prompt_info: | + 以下是你可以参考的额外信息: + {custom_prompt} + + generate_basic_info: | + ## 以下是数据库与表结构信息,你生成的SQL使用到的表名与字段必须在提供的范围内 {engine} {schema} - - {terminologies} - {data_training} + + {sample_data} + - {custom_prompt} - - ### 响应, 请根据上述要求直接返回JSON结果: - ```json user: | + ## 请根据上述要求,使用语言:{lang} 进行回答,若有深度思考过程,则思考过程也需要使用 {lang} 输出 + ## 如果内的提问与上述要求冲突,你必须停止生成SQL并告知生成SQL失败的原因 + ## 回答中不需要输出你的分析,请直接输出符合要求的JSON + ## 必须注意:不论要求你用什么语言回答,生成SQL中使用到的表名与字段名是否完全和中提供的表名字与段名的字符保持一致! {current_time} @@ -288,16 +374,30 @@ template: chart: system: | - 你是"SQLBOT",智能问数小助手,可以根据用户提问,专业生成SQL,查询数据并进行图表展示。 + 你是智能问数小助手:"{sqlbot_name}"。你可以根据用户提问,专业生成SQL,查询数据并进行图表展示。 你当前的任务是根据给定SQL语句和用户问题,生成数据可视化图表的配置项。 - 用户的提问在内,内是给定需要参考的SQL,内是推荐你生成的图表类型 + 用户会提供给你如下信息,帮助你生成配置项: + :用户的提问 + :需要参考的SQL + :以 M-Schema 格式提供 SQL 内用到表的数据库表结构信息,你可以参考字段名与字段备注来生成图表使用到的字段名 + :推荐你生成的图表类型 + 你必须遵守内规定的生成图表结构的规则 + 你必须遵守内规定的检查步骤生成你的回答 - 你必须遵守以下规则: + + 1. 分析提供的,结合确认图表需要的指标,维度和分类 + 2. 应用规则 + 3. 检查指标,维度和分类字段是否在SQL内存在 + 4. 结合确认指标,维度和分类展示用的名称 + 5. 生成JSON结果 + 6. 强制检查:JSON格式是否正确 + 7. 返回JSON结果 + + + generate_rules: | + 以下是你必须遵守的规则和可以参考的基础示例: - - 请使用语言:{lang} 回答,若有深度思考过程,则思考过程也需要使用 {lang} 输出 - 支持的图表类型为表格(table)、柱状图(column)、条形图(bar)、折线图(line)或饼图(pie), 提供给你的值则为 table/column/bar/line/pie 中的一个,若没有推荐类型,则由你自己选择一个合适的类型。 图表类型选择原则推荐:趋势 over time 用 line,分类对比用 column/bar,占比用 pie,原始数据查看用 table @@ -430,17 +530,20 @@ template: - - ### 响应, 请根据上述要求直接返回JSON结果: - ```json user: | + ## 请根据上述要求,使用语言:{lang} 进行回答,若有深度思考过程,则思考过程也需要使用 {lang} 输出 + ## 回答中不需要输出你的分析,请直接输出符合要求的JSON + ## 必须注意:不论要求你用什么语言回答,生成图表结构中的value字段内容必须与提供的SQL中提供的字段别名的字符保持一致! {question} {sql} + + {schema} + {chart_type} @@ -466,8 +569,7 @@ template: [] - 若你的给出的JSON不是{lang}的,则必须翻译为{lang} - ### 响应, 请直接返回JSON结果: - ```json + ### 响应, 请直接返回JSON结果(不要包含任何其他文本): user: | ### 表结构: @@ -483,7 +585,7 @@ template: analysis: system: | - 你是"SQLBOT",智能问数小助手,可以根据用户提问,专业生成SQL与可视化图表。 + 你是智能问数小助手:"{sqlbot_name}"。你可以根据用户提问,专业生成SQL与可视化图表。 你当前的任务是根据给定的数据分析数据,并给出你的分析结果。 我们会在块内提供给你信息,帮助你进行分析: 内有等信息; @@ -516,7 +618,7 @@ template: predict: system: | - 你是"SQLBOT",智能问数小助手,可以根据用户提问,专业生成SQL与可视化图表。 + 你是智能问数小助手:"{sqlbot_name}"。你可以根据用户提问,专业生成SQL与可视化图表。 你当前的任务是根据给定的数据进行数据预测,并给出你的预测结果。 若有块,它会提供一组,可能会是额外添加的背景信息,或者是额外的分析要求,请结合额外信息或要求后生成你的回答。 用户会在提问中提供给你信息: @@ -557,10 +659,9 @@ template: datasource: system: | - ### 请使用语言:{lang} 回答 - - ### 说明: - 你是一个数据分析师,你需要根据用户的提问,以及提供的数据源列表(格式为JSON数组:[{{"id": 数据源ID1,"name":"数据源名称1","description":"数据源描述1"}},{{"id": 数据源ID2,"name":"数据源名称2","description":"数据源描述2"}}]),根据名称和描述找出最符合用户提问的数据源,这个数据源后续将被用来进行数据的分析 + + 你是一个数据分析师,你需要根据用户的提问,以及提供的数据源列表(格式为JSON数组:[{{"id": 数据源ID1,"name":"数据源名称1","description":"数据源描述1"}},{{"id": 数据源ID2,"name":"数据源名称2","description":"数据源描述2"}}]),根据名称和描述找出最符合用户提问的数据源,这个数据源后续将被用来进行数据的分析 + ### 要求: - 以JSON格式返回你找到的符合提问的数据源ID,格式为:{{"id": 符合要求的数据源ID}} @@ -568,9 +669,9 @@ template: - 如果没有符合要求的数据源,则返回:{{"fail":"没有找到匹配的数据源"}} - 不需要思考过程,请直接返回JSON结果 - ### 响应, 请直接返回JSON结果: - ```json user: | + ## 请根据上述要求,使用语言:{lang} 进行回答符合要求的JSON结果 + ### 数据源列表: {data} @@ -579,7 +680,7 @@ template: permissions: system: | - 你是"SQLBOT",智能问数小助手,可以根据用户提问,专业生成SQL与可视化图表。 + 你是智能问数小助手:"{sqlbot_name}"。你可以根据用户提问,专业生成SQL与可视化图表。 你当前的任务是在给定的SQL基础上,根据提供的一组过滤条件,将过滤条件添加到该SQL内并生成一句新SQL 提供的SQL在内,提供的过滤条件在 diff --git a/docs/README.en.md b/docs/README.en.md index 0c6ea87e8..9848d3799 100644 --- a/docs/README.en.md +++ b/docs/README.en.md @@ -30,6 +30,23 @@ SQLBot is an intelligent data query system based on large language models and RA - **Easy Integration:** Supports multiple integration methods, providing capabilities such as web embedding, pop-up embedding, and MCP invocation. It can be quickly embedded into applications such as n8n, Dify, MaxKB, and DataEase, allowing various applications to quickly acquire intelligent data collection capabilities. - **Increasingly Accurate with Use:** Supports customizable prompts and terminology library configurations, maintainable SQL example calibration logic, and accurate matching of business scenarios. Efficient operation, based on continuous iteration and optimization using user interaction data, the data collection effect gradually improves with use, becoming more accurate with each use. +## Supported LLM Providers + +| Provider | API Compatibility | +|----------|-------------------| +| Alibaba Cloud Bailian | OpenAI Compatible | +| Qianfan Model | OpenAI Compatible | +| DeepSeek | OpenAI Compatible | +| Tencent Hunyuan | OpenAI Compatible | +| iFlytek Spark | OpenAI Compatible | +| Gemini | OpenAI Compatible | +| OpenAI | Native | +| Kimi | OpenAI Compatible | +| Tencent Cloud | OpenAI Compatible | +| Volcano Engine | OpenAI Compatible | +| MiniMax | OpenAI Compatible | +| Generic OpenAI Compatible | Custom | + ## Quick Start ### Installation and Deployment diff --git a/frontend/index.html b/frontend/index.html index 97c846b88..382730d02 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -4,7 +4,7 @@ - SQLBot +
diff --git a/frontend/package.json b/frontend/package.json index e7d83cee7..280710df8 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -11,7 +11,7 @@ }, "scripts": { "dev": "vue-tsc -b && vite", - "build": "vue-tsc -b && vite build", + "build": "vue-tsc -b &&NODE_OPTIONS=--max_old_space_size=4096 vite build", "preview": "vite preview", "lint": "eslint . --ext .vue,.js,.ts,.jsx,.tsx --fix" }, @@ -24,6 +24,7 @@ "@npkg/tinymce-plugins": "^0.0.7", "@tinymce/tinymce-vue": "^5.1.0", "@vueuse/core": "^14.1.0", + "core-js": "^3.49.0", "dayjs": "^1.11.13", "element-plus": "^2.10.1", "element-plus-secondary": "^1.0.0", @@ -55,17 +56,23 @@ "@types/node": "^22.14.1", "@typescript-eslint/eslint-plugin": "^8.34.0", "@typescript-eslint/parser": "^8.34.0", + "@vitejs/plugin-legacy": "^6.1.1", "@vitejs/plugin-vue": "^5.2.2", "@vue/tsconfig": "^0.7.0", + "autoprefixer": "^10.5.2", "axios": "^1.8.4", "crypto-js": "^4.2.0", + "css-has-pseudo": "^8.0.0", "eslint": "^9.28.0", "eslint-config-prettier": "^10.1.5", "eslint-plugin-prettier": "^5.4.1", "eslint-plugin-vue": "^10.2.0", + "flex-gap-polyfill": "^5.0.0", "globals": "^16.2.0", - "less": "^4.3.0", + "less": "4.4.2", "pinia": "^3.0.2", + "postcss": "^8.5.16", + "postcss-preset-env": "^11.3.2", "prettier": "^3.5.3", "typescript": "~5.7.2", "typescript-eslint": "^8.34.0", diff --git a/frontend/postcss.config.js b/frontend/postcss.config.js new file mode 100644 index 000000000..bca102202 --- /dev/null +++ b/frontend/postcss.config.js @@ -0,0 +1,14 @@ +import autoprefixer from 'autoprefixer' +import postcssPresetEnv from 'postcss-preset-env' +import cssHasPseudo from 'css-has-pseudo' + +export default { + plugins: [ + cssHasPseudo({ preserve: true }), + autoprefixer(), + postcssPresetEnv({ + stage: 3, + browsers: 'Chrome 81', + }), + ], +} diff --git a/frontend/public/assistant.js b/frontend/public/assistant.js deleted file mode 100644 index a986eaa97..000000000 --- a/frontend/public/assistant.js +++ /dev/null @@ -1,865 +0,0 @@ -;(function () { - window.sqlbot_assistant_handler = window.sqlbot_assistant_handler || {} - const defaultData = { - id: '1', - show_guide: false, - float_icon: '', - domain_url: 'http://localhost:5173', - header_font_color: 'rgb(100, 106, 115)', - x_type: 'right', - y_type: 'bottom', - x_val: '30', - y_val: '30', - float_icon_drag: false, - } - const script_id_prefix = 'sqlbot-assistant-float-script-' - const guideHtml = ` -
-
-
-
-
- - - -
- -
🌟 遇见问题,不再有障碍!
-

你好,我是你的智能小助手。
- 点我,开启高效解答模式,让问题变成过去式。

-
- -
- -
-` - - const chatButtonHtml = (data) => ` -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
` - - const getChatContainerHtml = (data) => { - let srcUrl = `${data.domain_url}/#/assistant?id=${data.id}&online=${!!data.online}&name=${encodeURIComponent(data.name)}` - if (data.userFlag) { - srcUrl += `&userFlag=${data.userFlag || ''}` - } - if (data.history) { - srcUrl += `&history=${data.history}` - } - return ` -
- -
-
- - - -
-
- - - -
-
- - - -
-
-` - } - - function getHighestZIndexValue() { - try { - let maxZIndex = -Infinity - let foundAny = false - - const allElements = document.all || document.querySelectorAll('*') - - for (let i = 0; i < allElements.length; i++) { - const element = allElements[i] - - if (!element || element.nodeType !== 1) continue - - const styles = window.getComputedStyle(element) - - const position = styles.position - if (position === 'static') continue - - const zIndex = styles.zIndex - let zIndexValue - - if (zIndex === 'auto') { - zIndexValue = 0 - } else { - zIndexValue = parseInt(zIndex, 10) - if (isNaN(zIndexValue)) continue - } - - foundAny = true - - // 快速返回:如果找到很大的z-index,很可能就是最大值 - /* if (zIndexValue > 10000) { - return zIndexValue; - } */ - - if (zIndexValue > maxZIndex) { - maxZIndex = zIndexValue - } - } - return foundAny ? maxZIndex : 0 - } catch (error) { - console.warn('获取最高z-index时出错,返回默认值0:', error) - return 0 - } - } - - /** - * 初始化引导 - * @param {*} root - */ - const initGuide = (root) => { - root.insertAdjacentHTML('beforeend', guideHtml) - const button = root.querySelector('.sqlbot-assistant-button') - const close_icon = root.querySelector('.sqlbot-assistant-close') - const close_func = () => { - root.removeChild(root.querySelector('.sqlbot-assistant-tips')) - root.removeChild(root.querySelector('.sqlbot-assistant-mask')) - localStorage.setItem('sqlbot_assistant_mask_tip', true) - } - button.onclick = close_func - close_icon.onclick = close_func - } - const initChat = (root, data) => { - // 添加对话icon - root.insertAdjacentHTML('beforeend', chatButtonHtml(data)) - // 添加对话框 - root.insertAdjacentHTML('beforeend', getChatContainerHtml(data)) - // 按钮元素 - const chat_button = root.querySelector('.sqlbot-assistant-chat-button') - let chat_button_img = root.querySelector('.sqlbot-assistant-chat-button > svg') - if (data.float_icon) { - chat_button_img = root.querySelector('.sqlbot-assistant-chat-button > img') - } - chat_button_img.style.display = 'block' - // 对话框元素 - const chat_container = root.querySelector('#sqlbot-assistant-chat-container') - // 引导层 - const mask_content = root.querySelector('.sqlbot-assistant-mask > .sqlbot-assistant-content') - const mask_tips = root.querySelector('.sqlbot-assistant-tips') - chat_button_img.onload = (event) => { - if (mask_content) { - mask_content.style.width = chat_button_img.width + 'px' - mask_content.style.height = chat_button_img.height + 'px' - if (data.x_type == 'left') { - mask_tips.style.marginLeft = - (chat_button_img.naturalWidth > 500 ? 500 : chat_button_img.naturalWidth) - 64 + 'px' - } else { - mask_tips.style.marginRight = - (chat_button_img.naturalWidth > 500 ? 500 : chat_button_img.naturalWidth) - 64 + 'px' - } - } - } - - const viewport = root.querySelector('.sqlbot-assistant-openviewport') - const closeviewport = root.querySelector('.sqlbot-assistant-closeviewport') - const close_func = () => { - chat_container.style['display'] = - chat_container.style['display'] == 'block' ? 'none' : 'block' - chat_button.style['display'] = chat_container.style['display'] == 'block' ? 'none' : 'block' - } - close_icon = chat_container.querySelector('.sqlbot-assistant-chat-close') - chat_button.onclick = close_func - close_icon.onclick = close_func - const viewport_func = () => { - if (chat_container.classList.contains('sqlbot-assistant-enlarge')) { - chat_container.classList.remove('sqlbot-assistant-enlarge') - viewport.classList.remove('sqlbot-assistant-viewportnone') - closeviewport.classList.add('sqlbot-assistant-viewportnone') - } else { - chat_container.classList.add('sqlbot-assistant-enlarge') - viewport.classList.add('sqlbot-assistant-viewportnone') - closeviewport.classList.remove('sqlbot-assistant-viewportnone') - } - } - if (data.float_icon_drag) { - chat_button.setAttribute('draggable', 'true') - - let startX = 0 - let startY = 0 - const img = new Image() - img.src = 'data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=' - chat_button.addEventListener('dragstart', (e) => { - startX = e.clientX - chat_button.offsetLeft - startY = e.clientY - chat_button.offsetTop - e.dataTransfer.setDragImage(img, 0, 0) - }) - - chat_button.addEventListener('drag', (e) => { - if (e.clientX && e.clientY) { - const left = e.clientX - startX - const top = e.clientY - startY - - const maxX = window.innerWidth - chat_button.offsetWidth - const maxY = window.innerHeight - chat_button.offsetHeight - - chat_button.style.left = Math.min(Math.max(0, left), maxX) + 'px' - chat_button.style.top = Math.min(Math.max(0, top), maxY) + 'px' - } - }) - - let touchStartX = 0 - let touchStartY = 0 - - chat_button.addEventListener('touchstart', (e) => { - touchStartX = e.touches[0].clientX - chat_button.offsetLeft - touchStartY = e.touches[0].clientY - chat_button.offsetTop - e.preventDefault() - }) - - chat_button.addEventListener('touchmove', (e) => { - const left = e.touches[0].clientX - touchStartX - const top = e.touches[0].clientY - touchStartY - - const maxX = window.innerWidth - chat_button.offsetWidth - const maxY = window.innerHeight - chat_button.offsetHeight - - chat_button.style.left = Math.min(Math.max(0, left), maxX) + 'px' - chat_button.style.top = Math.min(Math.max(0, top), maxY) + 'px' - - e.preventDefault() - }) - } - /* const drag = (e) => { - if (['touchmove', 'touchstart'].includes(e.type)) { - chat_button.style.top = e.touches[0].clientY - chat_button_img.clientHeight / 2 + 'px' - chat_button.style.left = e.touches[0].clientX - chat_button_img.clientHeight / 2 + 'px' - } else { - chat_button.style.top = e.y - chat_button_img.clientHeight / 2 + 'px' - chat_button.style.left = e.x - chat_button_img.clientHeight / 2 + 'px' - } - chat_button.style.width = chat_button_img.clientHeight + 'px' - chat_button.style.height = chat_button_img.clientHeight + 'px' - } - if (data.float_icon_drag) { - chat_button.setAttribute('draggable', 'true') - chat_button.addEventListener('drag', drag) - chat_button.addEventListener('dragover', (e) => { - e.preventDefault() - }) - chat_button.addEventListener('dragend', drag) - chat_button.addEventListener('touchstart', drag) - chat_button.addEventListener('touchmove', drag) - } */ - viewport.onclick = viewport_func - closeviewport.onclick = viewport_func - } - /** - * 第一次进来的引导提示 - */ - function initsqlbot_assistant(data) { - const sqlbot_div = document.createElement('div') - const root = document.createElement('div') - const sqlbot_root_id = 'sqlbot-assistant-root-' + data.id - root.id = sqlbot_root_id - initsqlbot_assistantStyle(sqlbot_div, sqlbot_root_id, data) - sqlbot_div.appendChild(root) - document.body.appendChild(sqlbot_div) - const sqlbot_assistant_mask_tip = localStorage.getItem('sqlbot_assistant_mask_tip') - if (sqlbot_assistant_mask_tip == null && data.show_guide) { - initGuide(root) - } - initChat(root, data) - } - - // 初始化全局样式 - function initsqlbot_assistantStyle(root, sqlbot_assistantId, data) { - const maxZIndex = getHighestZIndexValue() - const zIndex = Math.max((maxZIndex || 0) + 1, 10000) - const maskZIndex = zIndex + 1 - style = document.createElement('style') - style.type = 'text/css' - style.innerText = ` - /* 放大 */ - #sqlbot-assistant .sqlbot-assistant-enlarge { - width: 50%!important; - height: 100%!important; - bottom: 0!important; - right: 0 !important; - } - @media only screen and (max-width: 768px){ - #sqlbot-assistant .sqlbot-assistant-enlarge { - width: 100%!important; - height: 100%!important; - right: 0 !important; - bottom: 0!important; - } - } - - /* 引导 */ - - #sqlbot-assistant .sqlbot-assistant-mask { - position: fixed; - z-index: ${maskZIndex}; - background-color: transparent; - height: 100%; - width: 100%; - top: 0; - left: 0; - } - #sqlbot-assistant .sqlbot-assistant-mask .sqlbot-assistant-content { - width: 64px; - height: 64px; - box-shadow: 1px 1px 1px 9999px rgba(0,0,0,.6); - position: absolute; - ${data.x_type}: ${data.x_val}px; - ${data.y_type}: ${data.y_val}px; - z-index: ${maskZIndex}; - } - #sqlbot-assistant .sqlbot-assistant-tips { - position: fixed; - ${data.x_type}:calc(${data.x_val}px + 75px); - ${data.y_type}: calc(${data.y_val}px + 0px); - padding: 22px 24px 24px; - border-radius: 6px; - color: #ffffff; - font-size: 14px; - background: #3370FF; - z-index: ${maskZIndex}; - } - #sqlbot-assistant .sqlbot-assistant-tips .sqlbot-assistant-arrow { - position: absolute; - background: #3370FF; - width: 10px; - height: 10px; - pointer-events: none; - transform: rotate(45deg); - box-sizing: border-box; - /* left */ - ${data.x_type}: -5px; - ${data.y_type}: 33px; - border-left-color: transparent; - border-bottom-color: transparent - } - #sqlbot-assistant .sqlbot-assistant-tips .sqlbot-assistant-title { - font-size: 20px; - font-weight: 500; - margin-bottom: 8px; - } - #sqlbot-assistant .sqlbot-assistant-tips .sqlbot-assistant-button { - text-align: right; - margin-top: 24px; - } - #sqlbot-assistant .sqlbot-assistant-tips .sqlbot-assistant-button button { - border-radius: 4px; - background: #FFF; - padding: 3px 12px; - color: #3370FF; - cursor: pointer; - outline: none; - border: none; - } - #sqlbot-assistant .sqlbot-assistant-tips .sqlbot-assistant-button button::after{ - border: none; - } - #sqlbot-assistant .sqlbot-assistant-tips .sqlbot-assistant-close { - position: absolute; - right: 20px; - top: 20px; - cursor: pointer; - - } - #sqlbot-assistant-chat-container { - width: 460px; - height: 640px; - display:none; - } - @media only screen and (max-width: 768px) { - #sqlbot-assistant-chat-container { - width: 100%; - height: 70%; - right: 0 !important; - } - } - - #sqlbot-assistant .sqlbot-assistant-chat-button{ - position: fixed; - ${data.x_type}: ${data.x_val}px; - ${data.y_type}: ${data.y_val}px; - cursor: pointer; - z-index: ${zIndex}; - } - #sqlbot-assistant #sqlbot-assistant-chat-container{ - z-index: ${zIndex}; - position: relative; - border-radius: 8px; - //border: 1px solid #ffffff; - background: linear-gradient(188deg, rgba(235, 241, 255, 0.20) 39.6%, rgba(231, 249, 255, 0.20) 94.3%), #EFF0F1; - box-shadow: 0px 4px 8px 0px rgba(31, 35, 41, 0.10); - position: fixed;bottom: 16px;right: 16px;overflow: hidden; - } - - .ed-overlay-dialog { - margin-top: 50px; - } - .ed-drawer { - margin-top: 50px; - } - - #sqlbot-assistant #sqlbot-assistant-chat-container .sqlbot-assistant-operate{ - top: 18px; - right: 15px; - position: absolute; - display: flex; - align-items: center; - line-height: 18px; - } - #sqlbot-assistant #sqlbot-assistant-chat-container .sqlbot-assistant-operate .sqlbot-assistant-chat-close{ - margin-left:15px; - cursor: pointer; - } - #sqlbot-assistant #sqlbot-assistant-chat-container .sqlbot-assistant-operate .sqlbot-assistant-openviewport{ - - cursor: pointer; - } - #sqlbot-assistant #sqlbot-assistant-chat-container .sqlbot-assistant-operate .sqlbot-assistant-closeviewport{ - - cursor: pointer; - } - #sqlbot-assistant #sqlbot-assistant-chat-container .sqlbot-assistant-viewportnone{ - display:none; - } - #sqlbot-assistant #sqlbot-assistant-chat-container #sqlbot-assistant-chat-iframe-${data.id} { - height:100%; - width:100%; - border: none; - } - #sqlbot-assistant #sqlbot-assistant-chat-container { - animation: appear .4s ease-in-out; - } - @keyframes appear { - from { - height: 0;; - } - - to { - height: 600px; - } - }`.replaceAll('#sqlbot-assistant ', `#${sqlbot_assistantId} `) - root.appendChild(style) - } - function getParam(src, key) { - const url = new URL(src) - return url.searchParams.get(key) - } - function parsrCertificate(config) { - const certificateList = config.certificate - if (!certificateList?.length) { - return null - } - const list = certificateList.map((item) => formatCertificate(item)).filter((item) => !!item) - return JSON.stringify(list) - } - function isEmpty(obj) { - return obj == null || typeof obj == 'undefined' - } - function formatCertificate(item) { - const { type, source, target, target_key, target_val } = item - let source_val = null - if (type.toLocaleLowerCase() == 'localstorage') { - source_val = localStorage.getItem(source) - } - if (type.toLocaleLowerCase() == 'sessionstorage') { - source_val = sessionStorage.getItem(source) - } - if (type.toLocaleLowerCase() == 'cookie') { - source_val = getCookie(source) - } - if (type.toLocaleLowerCase() == 'custom') { - source_val = source - } - if (isEmpty(source_val)) { - return null - } - return { - target, - key: target_key || source, - value: (target_val && eval(target_val)) || source_val, - } - } - function getCookie(key) { - if (!key || !document.cookie) { - return null - } - const cookies = document.cookie.split(';') - for (let i = 0; i < cookies.length; i++) { - const cookie = cookies[i].trim() - - if (cookie.startsWith(key + '=')) { - return decodeURIComponent(cookie.substring(key.length + 1)) - } - } - return null - } - function registerMessageEvent(id, data) { - const iframe = document.getElementById(`sqlbot-assistant-chat-iframe-${id}`) - const url = iframe.src - const eventName = 'sqlbot_assistant_event' - window.addEventListener('message', (event) => { - if (event.data?.eventName === eventName) { - if (event.data?.messageId !== id) { - return - } - if (event.data?.busi == 'ready' && event.data?.ready) { - params = { - eventName, - messageId: id, - hostOrigin: window.location.origin, - } - if (data.type === 1) { - const certificate = parsrCertificate(data) - params['busi'] = 'certificate' - params['certificate'] = certificate - } - const contentWindow = iframe.contentWindow - contentWindow.postMessage(params, url) - } - } - }) - } - function loadScript(src, id) { - const domain_url = getDomain(src) - const online = getParam(src, 'online') - const userFlag = getParam(src, 'userFlag') - const history = getParam(src, 'history') - let url = `${domain_url}/api/v1/system/assistant/info/${id}` - if (domain_url.includes('5173')) { - url = url.replace('5173', '8000') - } - fetch(url) - .then((response) => response.json()) - .then((res) => { - if (!res.data) { - throw new Error(res) - } - const data = res.data - const config_json = data.configuration - let tempData = Object.assign(defaultData, data) - if (tempData.configuration) { - delete tempData.configuration - } - if (config_json) { - const config = JSON.parse(config_json) - if (config) { - delete config.id - tempData = Object.assign(tempData, config) - } - } - tempData['id'] = id - tempData['domain_url'] = domain_url - - if (tempData['float_icon'] && !tempData['float_icon'].startsWith('http://')) { - tempData['float_icon'] = - `${domain_url}/api/v1/system/assistant/picture/${tempData['float_icon']}` - - if (domain_url.includes('5173')) { - tempData['float_icon'] = tempData['float_icon'].replace('5173', '8000') - } - } - - tempData['online'] = online && online.toString().toLowerCase() == 'true' - tempData['userFlag'] = userFlag - tempData['history'] = history - initsqlbot_assistant(tempData) - registerMessageEvent(id, tempData) - }) - .catch((e) => { - showMsg('嵌入失败', e.message) - }) - } - function getDomain(src) { - return src.substring(0, src.indexOf('/assistant.js')) - } - function init() { - const sqlbotScripts = document.querySelectorAll(`script[id^="${script_id_prefix}"]`) - const scriptsArray = Array.from(sqlbotScripts) - const src_list = scriptsArray.map((script) => script.src) - src_list.forEach((src) => { - const id = getParam(src, 'id') - window.sqlbot_assistant_handler[id] = window.sqlbot_assistant_handler[id] || {} - window.sqlbot_assistant_handler[id]['id'] = id - const propName = script_id_prefix + id + '-state' - if (window[propName]) { - return true - } - window[propName] = true - loadScript(src, id) - expposeGlobalMethods(id) - }) - } - - function showMsg(title, content) { - // 检查并创建容器(如果不存在) - let container = document.getElementById('messageContainer') - if (!container) { - container = document.createElement('div') - container.id = 'messageContainer' - container.style.position = 'fixed' - container.style.bottom = '20px' - container.style.right = '20px' - container.style.zIndex = '1000' - document.body.appendChild(container) - } else { - // 如果容器已存在,先移除旧弹窗 - const oldMessage = container.querySelector('div') - if (oldMessage) { - oldMessage.style.transform = 'translateX(120%)' - oldMessage.style.opacity = '0' - setTimeout(() => { - container.removeChild(oldMessage) - }, 300) - } - } - - // 创建弹窗元素 - const messageBox = document.createElement('div') - messageBox.style.width = '240px' - messageBox.style.minHeight = '100px' - messageBox.style.background = 'linear-gradient(135deg, #ff6b6b, #ff8e8e)' - messageBox.style.borderRadius = '8px' - messageBox.style.boxShadow = '0 4px 12px rgba(0, 0, 0, 0.15)' - messageBox.style.padding = '15px' - messageBox.style.color = 'white' - messageBox.style.fontFamily = 'Arial, sans-serif' - messageBox.style.display = 'flex' - messageBox.style.flexDirection = 'column' - messageBox.style.transform = 'translateX(120%)' - messageBox.style.transition = 'transform 0.3s ease-out' - messageBox.style.opacity = '0' - messageBox.style.transition = 'opacity 0.3s ease, transform 0.3s ease' - messageBox.style.overflow = 'hidden' - - // 创建标题元素 - const titleElement = document.createElement('div') - titleElement.style.fontSize = '18px' - titleElement.style.fontWeight = 'bold' - titleElement.style.marginBottom = '10px' - titleElement.style.borderBottom = '1px solid rgba(255, 255, 255, 0.3)' - titleElement.style.paddingBottom = '8px' - titleElement.textContent = title - - // 创建内容元素 - const contentElement = document.createElement('div') - contentElement.style.fontSize = '14px' - contentElement.style.flexGrow = '1' - contentElement.style.overflow = 'auto' - contentElement.textContent = content - - // 组装元素 - messageBox.appendChild(titleElement) - messageBox.appendChild(contentElement) - - // 添加到容器 - container.appendChild(messageBox) - - // 触发显示动画 - setTimeout(() => { - messageBox.style.transform = 'translateX(0)' - messageBox.style.opacity = '1' - }, 10) - - // 3秒后自动隐藏 - setTimeout(() => { - messageBox.style.transform = 'translateX(120%)' - messageBox.style.opacity = '0' - setTimeout(() => { - container.removeChild(messageBox) - // 如果容器是空的,也移除容器 - if (container.children.length === 0) { - document.body.removeChild(container) - } - }, 300) - }, 5000) - } - - /* function hideMsg() { - const container = document.getElementById('messageContainer'); - if (container) { - const messageBox = container.querySelector('div'); - if (messageBox) { - messageBox.style.transform = 'translateX(120%)'; - messageBox.style.opacity = '0'; - setTimeout(() => { - container.removeChild(messageBox); - // 如果容器是空的,也移除容器 - if (container.children.length === 0) { - document.body.removeChild(container); - } - }, 300); - } - } - } */ - - function updateParam(target_url, key, newValue) { - try { - const url = new URL(target_url) - const [hashPath, hashQuery] = url.hash.split('?') - let searchParams - if (hashQuery) { - searchParams = new URLSearchParams(hashQuery) - } else { - searchParams = url.searchParams - } - searchParams.set(key, newValue) - if (hashQuery) { - url.hash = `${hashPath}?${searchParams.toString()}` - } else { - url.search = searchParams.toString() - } - return url.toString() - } catch (e) { - console.error('Invalid URL:', target_url) - return target_url - } - } - function expposeGlobalMethods(id) { - window.sqlbot_assistant_handler[id]['setOnline'] = (online) => { - if (online != null && typeof online != 'boolean') { - throw new Error('The parameter can only be of type boolean') - } - const iframe = document.getElementById(`sqlbot-assistant-chat-iframe-${id}`) - if (iframe) { - const url = iframe.src - const eventName = 'sqlbot_assistant_event' - const params = { - busi: 'setOnline', - online, - eventName, - messageId: id, - } - const contentWindow = iframe.contentWindow - contentWindow.postMessage(params, url) - } - } - window.sqlbot_assistant_handler[id]['refresh'] = (online, userFlag) => { - if (online != null && typeof online != 'boolean') { - throw new Error('The parameter can only be of type boolean') - } - const iframe = document.getElementById(`sqlbot-assistant-chat-iframe-${id}`) - if (iframe) { - const url = iframe.src - let new_url = updateParam(url, 't', Date.now()) - if (online != null) { - new_url = updateParam(new_url, 'online', online) - } - if (userFlag != null) { - new_url = updateParam(new_url, 'userFlag', userFlag) - } - iframe.src = 'about:blank' - setTimeout(() => { - iframe.src = new_url - }, 500) - } - } - window.sqlbot_assistant_handler[id]['destroy'] = () => { - const sqlbot_root_id = 'sqlbot-assistant-root-' + id - const container_div = document.getElementById(sqlbot_root_id) - if (container_div) { - const root_div = container_div.parentNode - if (root_div?.parentNode) { - root_div.parentNode.removeChild(root_div) - } - } - - const scriptDom = document.getElementById(`sqlbot-assistant-float-script-${id}`) - if (scriptDom) { - scriptDom.parentNode.removeChild(scriptDom) - } - const propName = script_id_prefix + id + '-state' - if (window[propName]) { - delete window[propName] - } - delete window.sqlbot_assistant_handler[id] - } - window.sqlbot_assistant_handler[id]['setHistory'] = (show) => { - if (show != null && typeof show != 'boolean') { - throw new Error('The parameter can only be of type boolean') - } - const iframe = document.getElementById(`sqlbot-assistant-chat-iframe-${id}`) - if (iframe) { - const url = iframe.src - const eventName = 'sqlbot_assistant_event' - const params = { - busi: 'setHistory', - show, - eventName, - messageId: id, - } - const contentWindow = iframe.contentWindow - contentWindow.postMessage(params, url) - } - } - window.sqlbot_assistant_handler[id]['createConversation'] = (param) => { - const iframe = document.getElementById(`sqlbot-assistant-chat-iframe-${id}`) - if (iframe) { - const url = iframe.src - const eventName = 'sqlbot_assistant_event' - const params = { - busi: 'createConversation', - param, - eventName, - messageId: id, - } - const contentWindow = iframe.contentWindow - contentWindow.postMessage(params, url) - } - } - } - // window.addEventListener('load', init) - const executeWhenReady = (fn) => { - if ( - document.readyState === 'complete' || - (document.readyState !== 'loading' && !document.documentElement.doScroll) - ) { - setTimeout(fn, 0) - } else { - const onReady = () => { - document.removeEventListener('DOMContentLoaded', onReady) - window.removeEventListener('load', onReady) - fn() - } - document.addEventListener('DOMContentLoaded', onReady) - window.addEventListener('load', onReady) - } - } - - executeWhenReady(init) -})() diff --git a/frontend/public/swagger-ui-bundle.js b/frontend/public/swagger-ui-bundle.js index c04c4240b..dcfadae0b 100644 --- a/frontend/public/swagger-ui-bundle.js +++ b/frontend/public/swagger-ui-bundle.js @@ -11,7 +11,7 @@ (() => { var s = { 251: (s, o) => { - ;(o.read = function (s, o, i, a, u) { + ;((o.read = function (s, o, i, a, u) { var _, w, x = 8 * u - a - 1, @@ -34,7 +34,7 @@ if (0 === _) _ = 1 - j else { if (_ === C) return w ? NaN : (1 / 0) * (U ? -1 : 1) - ;(w += Math.pow(2, a)), (_ -= j) + ;((w += Math.pow(2, a)), (_ -= j)) } return (U ? -1 : 1) * w * Math.pow(2, _ - a) }), @@ -67,7 +67,7 @@ ); for (w = (w << u) | x, j += u; j > 0; s[i + U] = 255 & w, U += V, w /= 256, j -= 8); s[i + U - V] |= 128 * z - }) + })) }, 462: (s, o, i) => { 'use strict' @@ -88,14 +88,14 @@ var a = !0 } catch (s) {} var u = w.call(s) - return a && (o ? (s[x] = i) : delete s[x]), u + return (a && (o ? (s[x] = i) : delete s[x]), u) } }, 694: (s, o, i) => { 'use strict' i(91599) var a = i(37257) - i(12560), (s.exports = a) + ;(i(12560), (s.exports = a)) }, 953: (s, o, i) => { 'use strict' @@ -137,7 +137,7 @@ }, 2205: function (s, o, i) { var a - ;(a = void 0 !== i.g ? i.g : this), + ;((a = void 0 !== i.g ? i.g : this), (s.exports = (function (s) { if (s.CSS && s.CSS.escape) return s.CSS.escape var cssEscape = function (s) { @@ -145,7 +145,6 @@ for ( var o, i = String(s), a = i.length, u = -1, _ = '', w = i.charCodeAt(0); ++u < a; - ) 0 != (o = i.charCodeAt(u)) ? (_ += @@ -168,8 +167,8 @@ : (_ += '�') return _ } - return s.CSS || (s.CSS = {}), (s.CSS.escape = cssEscape), cssEscape - })(a)) + return (s.CSS || (s.CSS = {}), (s.CSS.escape = cssEscape), cssEscape) + })(a))) }, 2209: (s, o, i) => { 'use strict' @@ -207,7 +206,7 @@ ) } var o = checkType.bind(null, !1) - return (o.isRequired = checkType.bind(null, !0)), o + return ((o.isRequired = checkType.bind(null, !0)), o) } function createIterableSubclassTypeChecker(s, o) { return (function createImmutableTypeChecker(s, o) { @@ -235,7 +234,7 @@ return u.Iterable.isIterable(s) && o(s) }) } - ;((a = { + ;(((a = { listOf: w, mapOf: w, orderedMapOf: w, @@ -259,7 +258,7 @@ iterable: _, }).iterable.indexed = createIterableSubclassTypeChecker('Indexed', u.Iterable.isIndexed)), (a.iterable.keyed = createIterableSubclassTypeChecker('Keyed', u.Iterable.isKeyed)), - (s.exports = a) + (s.exports = a)) }, 2404: (s, o, i) => { var a = i(60270) @@ -292,7 +291,7 @@ var a = i(6925) function emptyFunction() {} function emptyFunctionWithReset() {} - ;(emptyFunctionWithReset.resetWarningCache = emptyFunction), + ;((emptyFunctionWithReset.resetWarningCache = emptyFunction), (s.exports = function () { function shim(s, o, i, u, _, w) { if (w !== a) { @@ -329,8 +328,8 @@ checkPropTypes: emptyFunctionWithReset, resetWarningCache: emptyFunction, } - return (s.PropTypes = s), s - }) + return ((s.PropTypes = s), s) + })) }, 2874: (s) => { s.exports = {} @@ -431,7 +430,7 @@ if (null !== _) return Promise.resolve(createIterResult(_, !1)) i = new Promise(this[B]) } - return (this[L] = i), i + return ((this[L] = i), i) }, }), Symbol.asyncIterator, @@ -481,9 +480,9 @@ ) } var a = i[w] - null !== a && + ;(null !== a && ((i[L] = null), (i[w] = null), (i[x] = null), a(createIterResult(void 0, !0))), - (i[j] = !0) + (i[j] = !0)) }), s.on('readable', onReadable.bind(null, i)), i @@ -500,17 +499,19 @@ j = i(86804) class Namespace { constructor(s) { - ;(this.elementMap = {}), + ;((this.elementMap = {}), (this.elementDetection = []), (this.Element = j.Element), (this.KeyValuePair = j.KeyValuePair), (s && s.noDefault) || this.useDefault(), (this._attributeElementKeys = []), - (this._attributeElementArrayKeys = []) + (this._attributeElementArrayKeys = [])) } use(s) { return ( - s.namespace && s.namespace({ base: this }), s.load && s.load({ base: this }), this + s.namespace && s.namespace({ base: this }), + s.load && s.load({ base: this }), + this ) } useDefault() { @@ -534,10 +535,10 @@ ) } register(s, o) { - return (this._elements = void 0), (this.elementMap[s] = o), this + return ((this._elements = void 0), (this.elementMap[s] = o), this) } unregister(s) { - return (this._elements = void 0), delete this.elementMap[s], this + return ((this._elements = void 0), delete this.elementMap[s], this) } detect(s, o, i) { return ( @@ -585,7 +586,7 @@ return new C(this) } } - ;(C.prototype.Namespace = Namespace), (s.exports = Namespace) + ;((C.prototype.Namespace = Namespace), (s.exports = Namespace)) }, 3121: (s, o, i) => { 'use strict' @@ -617,7 +618,7 @@ var U = o[3] if (U) { var V = s[3] - ;(s[3] = V ? a(V, U, o[4]) : U), (s[4] = V ? _(s[3], w) : o[4]) + ;((s[3] = V ? a(V, U, o[4]) : U), (s[4] = V ? _(s[3], w) : o[4])) } return ( (U = o[5]) && @@ -684,7 +685,7 @@ u = i(30294), _ = i(40346), w = {} - ;(w['[object Float32Array]'] = + ;((w['[object Float32Array]'] = w['[object Float64Array]'] = w['[object Int8Array]'] = w['[object Int16Array]'] = @@ -712,7 +713,7 @@ !1), (s.exports = function baseIsTypedArray(s) { return _(s) && u(s.length) && !!w[a(s)] - }) + })) }, 4993: (s, o, i) => { 'use strict' @@ -737,15 +738,15 @@ ? window.URL.createObjectURL(u) : window.webkitURL.createObjectURL(u), w = document.createElement('a') - ;(w.style.display = 'none'), + ;((w.style.display = 'none'), (w.href = _), w.setAttribute('download', o), void 0 === w.download && w.setAttribute('target', '_blank'), document.body.appendChild(w), w.click(), setTimeout(function () { - document.body.removeChild(w), window.URL.revokeObjectURL(_) - }, 200) + ;(document.body.removeChild(w), window.URL.revokeObjectURL(_)) + }, 200)) } } }, @@ -771,7 +772,7 @@ ee = j(w), ie = j(x), ae = C - ;((a && ae(new a(new ArrayBuffer(1))) != V) || + ;(((a && ae(new a(new ArrayBuffer(1))) != V) || (u && ae(new u()) != L) || (_ && ae(_.resolve()) != B) || (w && ae(new w()) != $) || @@ -795,7 +796,7 @@ } return o }), - (s.exports = ae) + (s.exports = ae)) }, 6048: (s) => { s.exports = function negate(s) { @@ -838,7 +839,7 @@ _ = i(92340) class ArrayElement extends u { constructor(s, o, i) { - super(s || [], o, i), (this.element = 'array') + ;(super(s || [], o, i), (this.element = 'array')) } primitive() { return 'array' @@ -854,7 +855,7 @@ return this.content[s] } set(s, o) { - return (this.content[s] = this.refract(o)), this + return ((this.content[s] = this.refract(o)), this) } remove(s) { const o = this.content.splice(s, 1) @@ -908,7 +909,7 @@ this.content.unshift(this.refract(s)) } push(s) { - return this.content.push(this.refract(s)), this + return (this.content.push(this.refract(s)), this) } add(s) { this.push(s) @@ -919,8 +920,10 @@ u = void 0 === i.results ? [] : i.results return ( this.forEach((o, i, _) => { - a && void 0 !== o.findElements && o.findElements(s, { results: u, recursive: a }), - s(o, i, _) && u.push(o) + ;(a && + void 0 !== o.findElements && + o.findElements(s, { results: u, recursive: a }), + s(o, i, _) && u.push(o)) }), u ) @@ -983,7 +986,7 @@ return this.getIndex(this.length - 1) } } - ;(ArrayElement.empty = function empty() { + ;((ArrayElement.empty = function empty() { return new this() }), (ArrayElement['fantasy-land/empty'] = ArrayElement.empty), @@ -991,7 +994,7 @@ (ArrayElement.prototype[Symbol.iterator] = function symbol() { return this.content[Symbol.iterator]() }), - (s.exports = ArrayElement) + (s.exports = ArrayElement)) }, 6499: (s, o, i) => { 'use strict' @@ -1106,14 +1109,14 @@ _extends.apply(null, arguments) ) } - ;(s.exports = _extends), (s.exports.__esModule = !0), (s.exports.default = s.exports) + ;((s.exports = _extends), (s.exports.__esModule = !0), (s.exports.default = s.exports)) }, 8048: (s, o, i) => { const a = i(6205) - ;(o.wordBoundary = () => ({ type: a.POSITION, value: 'b' })), + ;((o.wordBoundary = () => ({ type: a.POSITION, value: 'b' })), (o.nonWordBoundary = () => ({ type: a.POSITION, value: 'B' })), (o.begin = () => ({ type: a.POSITION, value: '^' })), - (o.end = () => ({ type: a.POSITION, value: '$' })) + (o.end = () => ({ type: a.POSITION, value: '$' }))) }, 8068: (s) => { 'use strict' @@ -1142,7 +1145,7 @@ C = { dictionary: 'alphanum', shuffle: !0, debug: !1, length: x, counter: 0 }, j = class _ShortUniqueId { constructor(s = {}) { - __publicField(this, 'counter'), + ;(__publicField(this, 'counter'), __publicField(this, 'debug'), __publicField(this, 'dict'), __publicField(this, 'version'), @@ -1201,17 +1204,17 @@ }), __publicField(this, 'log', (...s) => { const o = [...s] - ;(o[0] = '[short-unique-id] '.concat(s[0])), + ;((o[0] = '[short-unique-id] '.concat(s[0])), !0 !== this.debug || 'undefined' == typeof console || null === console || - console.log(...o) + console.log(...o)) }), __publicField(this, '_normalizeDictionary', (s, o) => { let i if (s && Array.isArray(s) && s.length > 1) i = s else { - ;(i = []), (this.dictIndex = 0) + ;((i = []), (this.dictIndex = 0)) const o = '_'.concat(s, '_dict_ranges'), a = this._dict_ranges[o] let u = 0 @@ -1222,18 +1225,18 @@ i = new Array(u) let _ = 0 for (const [, s] of Object.entries(a)) { - ;(this.dictRange = s), + ;((this.dictRange = s), (this.lowerBound = this.dictRange[0]), - (this.upperBound = this.dictRange[1]) + (this.upperBound = this.dictRange[1])) const o = this.lowerBound <= this.upperBound, a = this.lowerBound, u = this.upperBound if (o) for (let s = a; s < u; s++) - (i[_++] = String.fromCharCode(s)), (this.dictIndex = s) + ((i[_++] = String.fromCharCode(s)), (this.dictIndex = s)) else for (let s = a; s > u; s--) - (i[_++] = String.fromCharCode(s)), (this.dictIndex = s) + ((i[_++] = String.fromCharCode(s)), (this.dictIndex = s)) } i.length = _ } @@ -1246,9 +1249,9 @@ return i }), __publicField(this, 'setDictionary', (s, o) => { - ;(this.dict = this._normalizeDictionary(s, o)), + ;((this.dict = this._normalizeDictionary(s, o)), (this.dictLength = this.dict.length), - this.setCounter(0) + this.setCounter(0)) }), __publicField(this, 'seq', () => this.sequentialUUID()), __publicField(this, 'sequentialUUID', () => { @@ -1258,10 +1261,10 @@ const a = [] do { const u = i % s - ;(i = Math.trunc(i / s)), a.push(o[u]) + ;((i = Math.trunc(i / s)), a.push(o[u])) } while (0 !== i) const u = a.join('') - return (this.counter += 1), u + return ((this.counter += 1), u) }), __publicField(this, 'rnd', (s = this.uuidLength || x) => this.randomUUID(s)), __publicField(this, 'randomUUID', (s = this.uuidLength || x) => { @@ -1300,7 +1303,7 @@ i = this._collisionCache.get(o) if (void 0 !== i) return i const a = Number.parseFloat(Math.sqrt((Math.PI / 2) * s).toFixed(20)) - return this._collisionCache.set(o, a), a + return (this._collisionCache.set(o, a), a) } ), __publicField( @@ -1373,11 +1376,14 @@ __publicField(this, 'validate', (s, o) => { const i = o ? this._normalizeDictionary(o) : this.dict return s.split('').every((s) => i.includes(s)) - }) + })) const o = __spreadValues(__spreadValues({}, C), s) - ;(this.counter = 0), (this.debug = !1), (this.dict = []), (this.version = '5.3.2') + ;((this.counter = 0), + (this.debug = !1), + (this.dict = []), + (this.version = '5.3.2')) const { dictionary: i, shuffle: a, length: u, counter: _ } = o - ;(this.uuidLength = u), + ;((this.uuidLength = u), this.setDictionary(i, a), this.setCounter(_), (this.debug = o.debug), @@ -1402,7 +1408,7 @@ (this.uniqueness = this.uniqueness.bind(this)), (this.getVersion = this.getVersion.bind(this)), (this.stamp = this.stamp.bind(this)), - (this.parseStamp = this.parseStamp.bind(this)) + (this.parseStamp = this.parseStamp.bind(this))) } } __publicField(j, 'default', j) @@ -1420,7 +1426,7 @@ })(s({}, '__esModule', { value: !0 }), L) ) })() - ;(s.exports = o.default), 'undefined' != typeof window && (o = o.default) + ;((s.exports = o.default), 'undefined' != typeof window && (o = o.default)) }, 9325: (s, o, i) => { var a = i(34840), @@ -1433,7 +1439,7 @@ 'use strict' var s = Array.prototype.slice function createClass(s, o) { - o && (s.prototype = Object.create(o.prototype)), (s.prototype.constructor = s) + ;(o && (s.prototype = Object.create(o.prototype)), (s.prototype.constructor = s)) } function Iterable(s) { return isIterable(s) ? s : Seq(s) @@ -1462,7 +1468,7 @@ function isOrdered(s) { return !(!s || !s[u]) } - createClass(KeyedIterable, Iterable), + ;(createClass(KeyedIterable, Iterable), createClass(IndexedIterable, Iterable), createClass(SetIterable, Iterable), (Iterable.isIterable = isIterable), @@ -1472,7 +1478,7 @@ (Iterable.isOrdered = isOrdered), (Iterable.Keyed = KeyedIterable), (Iterable.Indexed = IndexedIterable), - (Iterable.Set = SetIterable) + (Iterable.Set = SetIterable)) var o = '@@__IMMUTABLE_ITERABLE__@@', i = '@@__IMMUTABLE_KEYED__@@', a = '@@__IMMUTABLE_INDEXED__@@', @@ -1485,7 +1491,7 @@ L = { value: !1 }, B = { value: !1 } function MakeRef(s) { - return (s.value = !1), s + return ((s.value = !1), s) } function SetRef(s) { s && (s.value = !0) @@ -1498,7 +1504,7 @@ return a } function ensureSize(s) { - return void 0 === s.size && (s.size = s.__iterate(returnTrue)), s.size + return (void 0 === s.size && (s.size = s.__iterate(returnTrue)), s.size) } function wrapIndex(s, o) { if ('number' != typeof o) { @@ -1542,7 +1548,7 @@ } function iteratorValue(s, o, i, a) { var u = 0 === s ? o : 1 === s ? i : [o, i] - return a ? (a.value = u) : (a = { value: u, done: !1 }), a + return (a ? (a.value = u) : (a = { value: u, done: !1 }), a) } function iteratorDone() { return { value: void 0, done: !0 } @@ -1596,7 +1602,7 @@ : indexedSeqFromValue(s) ).toSetSeq() } - ;(Iterator.prototype.toString = function () { + ;((Iterator.prototype.toString = function () { return '[Iterator]' }), (Iterator.KEYS = $), @@ -1663,23 +1669,23 @@ (Seq.isSeq = isSeq), (Seq.Keyed = KeyedSeq), (Seq.Set = SetSeq), - (Seq.Indexed = IndexedSeq) + (Seq.Indexed = IndexedSeq)) var ee, ie, ae, ce = '@@__IMMUTABLE_SEQ__@@' function ArraySeq(s) { - ;(this._array = s), (this.size = s.length) + ;((this._array = s), (this.size = s.length)) } function ObjectSeq(s) { var o = Object.keys(s) - ;(this._object = s), (this._keys = o), (this.size = o.length) + ;((this._object = s), (this._keys = o), (this.size = o.length)) } function IterableSeq(s) { - ;(this._iterable = s), (this.size = s.length || s.size) + ;((this._iterable = s), (this.size = s.length || s.size)) } function IteratorSeq(s) { - ;(this._iterator = s), (this._iteratorCache = []) + ;((this._iterator = s), (this._iteratorCache = [])) } function isSeq(s) { return !(!s || !s[ce]) @@ -1821,12 +1827,12 @@ else { u = !0 var _ = s - ;(s = o), (o = _) + ;((s = o), (o = _)) } var w = !0, x = o.__iterate(function (o, a) { if (i ? !s.has(o) : u ? !is(o, s.get(a, j)) : !is(s.get(a, j), o)) - return (w = !1), !1 + return ((w = !1), !1) }) return w && s.size === x } @@ -1868,7 +1874,7 @@ function KeyedCollection() {} function IndexedCollection() {} function SetCollection() {} - ;(Seq.prototype[ce] = !0), + ;((Seq.prototype[ce] = !0), createClass(ArraySeq, IndexedSeq), (ArraySeq.prototype.get = function (s, o) { return this.has(s) ? this._array[wrapIndex(this, s)] : o @@ -2054,7 +2060,7 @@ _ = 0 return new Iterator(function () { var w = u - return (u += o ? -a : a), _ > i ? iteratorDone() : iteratorValue(s, _++, w) + return ((u += o ? -a : a), _ > i ? iteratorDone() : iteratorValue(s, _++, w)) }) }), (Range.prototype.equals = function (s) { @@ -2068,7 +2074,7 @@ createClass(SetCollection, Collection), (Collection.Keyed = KeyedCollection), (Collection.Indexed = IndexedCollection), - (Collection.Set = SetCollection) + (Collection.Set = SetCollection)) var le = 'function' == typeof Math.imul && -2 === Math.imul(4294967295, 2) ? Math.imul @@ -2133,10 +2139,10 @@ void 0 !== s.propertyIsEnumerable && s.propertyIsEnumerable === s.constructor.prototype.propertyIsEnumerable ) - (s.propertyIsEnumerable = function () { + ((s.propertyIsEnumerable = function () { return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments) }), - (s.propertyIsEnumerable[_e] = o) + (s.propertyIsEnumerable[_e] = o)) else { if (void 0 === s.nodeType) throw new Error('Unable to set a non-enumerable property on object.') @@ -2148,7 +2154,7 @@ var pe = Object.isExtensible, de = (function () { try { - return Object.defineProperty({}, '@', {}), !0 + return (Object.defineProperty({}, '@', {}), !0) } catch (s) { return !1 } @@ -2182,16 +2188,16 @@ ? s : emptyMap().withMutations(function (o) { var i = KeyedIterable(s) - assertNotInfinite(i.size), + ;(assertNotInfinite(i.size), i.forEach(function (s, i) { return o.set(i, s) - }) + })) }) } function isMap(s) { return !(!s || !s[Re]) } - createClass(Map, KeyedCollection), + ;(createClass(Map, KeyedCollection), (Map.of = function () { var o = s.call(arguments, 0) return emptyMap().withMutations(function (s) { @@ -2277,7 +2283,7 @@ }), (Map.prototype.withMutations = function (s) { var o = this.asMutable() - return s(o), o.wasAltered() ? o.__ensureOwner(this.__ownerID) : this + return (s(o), o.wasAltered() ? o.__ensureOwner(this.__ownerID) : this) }), (Map.prototype.asMutable = function () { return this.__ownerID ? this : this.__ensureOwner(new OwnerID()) @@ -2297,7 +2303,7 @@ return ( this._root && this._root.iterate(function (o) { - return a++, s(o[1], o[0], i) + return (a++, s(o[1], o[0], i)) }, o), a ) @@ -2309,29 +2315,29 @@ ? makeMap(this.size, this._root, s, this.__hash) : ((this.__ownerID = s), (this.__altered = !1), this) }), - (Map.isMap = isMap) + (Map.isMap = isMap)) var Te, Re = '@@__IMMUTABLE_MAP__@@', $e = Map.prototype function ArrayMapNode(s, o) { - ;(this.ownerID = s), (this.entries = o) + ;((this.ownerID = s), (this.entries = o)) } function BitmapIndexedNode(s, o, i) { - ;(this.ownerID = s), (this.bitmap = o), (this.nodes = i) + ;((this.ownerID = s), (this.bitmap = o), (this.nodes = i)) } function HashArrayMapNode(s, o, i) { - ;(this.ownerID = s), (this.count = o), (this.nodes = i) + ;((this.ownerID = s), (this.count = o), (this.nodes = i)) } function HashCollisionNode(s, o, i) { - ;(this.ownerID = s), (this.keyHash = o), (this.entries = i) + ;((this.ownerID = s), (this.keyHash = o), (this.entries = i)) } function ValueNode(s, o, i) { - ;(this.ownerID = s), (this.keyHash = o), (this.entry = i) + ;((this.ownerID = s), (this.keyHash = o), (this.entry = i)) } function MapIterator(s, o, i) { - ;(this._type = o), + ;((this._type = o), (this._reverse = i), - (this._stack = s._root && mapIteratorFrame(s._root)) + (this._stack = s._root && mapIteratorFrame(s._root))) } function mapIteratorValue(s, o) { return iteratorValue(s, o[0], o[1]) @@ -2363,7 +2369,7 @@ u = s.size + (_.value ? (i === j ? -1 : 1) : 0) } else { if (i === j) return s - ;(u = 1), (a = new ArrayMapNode(s.__ownerID, [[o, i]])) + ;((u = 1), (a = new ArrayMapNode(s.__ownerID, [[o, i]]))) } return s.__ownerID ? ((s.size = u), (s._root = a), (s.__hash = void 0), (s.__altered = !0), s) @@ -2416,17 +2422,17 @@ function expandNodes(s, o, i, a, u) { for (var _ = 0, w = new Array(x), C = 0; 0 !== i; C++, i >>>= 1) w[C] = 1 & i ? o[_++] : void 0 - return (w[a] = u), new HashArrayMapNode(s, _ + 1, w) + return ((w[a] = u), new HashArrayMapNode(s, _ + 1, w)) } function mergeIntoMapWith(s, o, i) { for (var a = [], u = 0; u < i.length; u++) { var _ = i[u], w = KeyedIterable(_) - isIterable(_) || + ;(isIterable(_) || (w = w.map(function (s) { return fromJS(s) })), - a.push(w) + a.push(w)) } return mergeIntoCollectionWith(s, o, a) } @@ -2492,23 +2498,23 @@ } function setIn(s, o, i, a) { var u = a ? s : arrCopy(s) - return (u[o] = i), u + return ((u[o] = i), u) } function spliceIn(s, o, i, a) { var u = s.length + 1 - if (a && o + 1 === u) return (s[o] = i), s + if (a && o + 1 === u) return ((s[o] = i), s) for (var _ = new Array(u), w = 0, x = 0; x < u; x++) x === o ? ((_[x] = i), (w = -1)) : (_[x] = s[x + w]) return _ } function spliceOut(s, o, i) { var a = s.length - 1 - if (i && o === a) return s.pop(), s + if (i && o === a) return (s.pop(), s) for (var u = new Array(a), _ = 0, w = 0; w < a; w++) - w === o && (_ = 1), (u[w] = s[w + _]) + (w === o && (_ = 1), (u[w] = s[w + _])) return u } - ;($e[Re] = !0), + ;(($e[Re] = !0), ($e[_] = $e.remove), ($e.removeIn = $e.deleteIn), (ArrayMapNode.prototype.get = function (s, o, i, a) { @@ -2675,7 +2681,7 @@ o = this._stack = this._stack.__prev } return iteratorDone() - }) + })) var qe = x / 4, ze = x / 2, We = x / 4 @@ -2691,16 +2697,16 @@ a > 0 && a < x ? makeList(0, a, w, null, new VNode(i.toArray())) : o.withMutations(function (s) { - s.setSize(a), + ;(s.setSize(a), i.forEach(function (o, i) { return s.set(i, o) - }) + })) })) } function isList(s) { return !(!s || !s[He]) } - createClass(List, IndexedCollection), + ;(createClass(List, IndexedCollection), (List.of = function () { return this(arguments) }), @@ -2796,7 +2802,6 @@ for ( var i, a = 0, u = iterateList(this, o); (i = u()) !== et && !1 !== s(i, a++, this); - ); return a }), @@ -2815,13 +2820,13 @@ ) : ((this.__ownerID = s), this) }), - (List.isList = isList) + (List.isList = isList)) var He = '@@__IMMUTABLE_LIST__@@', Ye = List.prototype function VNode(s, o) { - ;(this.array = s), (this.ownerID = o) + ;((this.array = s), (this.ownerID = o)) } - ;(Ye[He] = !0), + ;((Ye[He] = !0), (Ye[_] = Ye.remove), (Ye.setIn = $e.setIn), (Ye.deleteIn = Ye.removeIn = $e.removeIn), @@ -2846,7 +2851,7 @@ if (_ && !u) return this var j = editableVNode(this, s) if (!_) for (var L = 0; L < a; L++) j.array[L] = void 0 - return u && (j.array[a] = u), j + return (u && (j.array[a] = u), j) }), (VNode.prototype.removeAfter = function (s, o, i) { if (i === (o ? 1 << o : 0) || 0 === this.array.length) return this @@ -2859,8 +2864,8 @@ return this } var x = editableVNode(this, s) - return x.array.splice(u + 1), a && (x.array[u] = a), x - }) + return (x.array.splice(u + 1), a && (x.array[u] = a), x) + })) var Xe, Qe, et = {} @@ -2971,12 +2976,12 @@ if (o >= getTailOffset(s._capacity)) return s._tail if (o < 1 << (s._level + w)) { for (var i = s._root, a = s._level; i && a > 0; ) - (i = i.array[(o >>> a) & C]), (a -= w) + ((i = i.array[(o >>> a) & C]), (a -= w)) return i } } function setListBounds(s, o, i) { - void 0 !== o && (o |= 0), void 0 !== i && (i |= 0) + ;(void 0 !== o && (o |= 0), void 0 !== i && (i |= 0)) var a = s.__ownerID || new OwnerID(), u = s._origin, _ = s._capacity, @@ -2985,10 +2990,10 @@ if (x === u && j === _) return s if (x >= j) return s.clear() for (var L = s._level, B = s._root, $ = 0; x + $ < 0; ) - (B = new VNode(B && B.array.length ? [void 0, B] : [], a)), ($ += 1 << (L += w)) + ((B = new VNode(B && B.array.length ? [void 0, B] : [], a)), ($ += 1 << (L += w))) $ && ((x += $), (u += $), (j += $), (_ += $)) for (var U = getTailOffset(_), V = getTailOffset(j); V >= 1 << (L + w); ) - (B = new VNode(B && B.array.length ? [B] : [], a)), (L += w) + ((B = new VNode(B && B.array.length ? [B] : [], a)), (L += w)) var z = s._tail, Y = V < U ? listNodeFor(s, j - 1) : V > U ? new VNode([], a) : z if (z && V > U && x < _ && z.array.length) { @@ -2999,16 +3004,16 @@ Z.array[(U >>> w) & C] = z } if ((j < _ && (Y = Y && Y.removeAfter(a, 0, j)), x >= V)) - (x -= V), (j -= V), (L = w), (B = null), (Y = Y && Y.removeBefore(a, 0, x)) + ((x -= V), (j -= V), (L = w), (B = null), (Y = Y && Y.removeBefore(a, 0, x))) else if (x > u || V < U) { for ($ = 0; B; ) { var ae = (x >>> L) & C if ((ae !== V >>> L) & C) break - ae && ($ += (1 << L) * ae), (L -= w), (B = B.array[ae]) + ;(ae && ($ += (1 << L) * ae), (L -= w), (B = B.array[ae])) } - B && x > u && (B = B.removeBefore(a, L, x - $)), + ;(B && x > u && (B = B.removeBefore(a, L, x - $)), B && V < U && (B = B.removeAfter(a, L, V - $)), - $ && ((x -= $), (j -= $)) + $ && ((x -= $), (j -= $))) } return s.__ownerID ? ((s.size = j - x), @@ -3026,14 +3031,14 @@ for (var a = [], u = 0, _ = 0; _ < i.length; _++) { var w = i[_], x = IndexedIterable(w) - x.size > u && (u = x.size), + ;(x.size > u && (u = x.size), isIterable(w) || (x = x.map(function (s) { return fromJS(s) })), - a.push(x) + a.push(x)) } - return u > s.size && (s = s.setSize(u)), mergeIntoCollectionWith(s, o, a) + return (u > s.size && (s = s.setSize(u)), mergeIntoCollectionWith(s, o, a)) } function getTailOffset(s) { return s < x ? 0 : ((s - 1) >>> w) << w @@ -3045,10 +3050,10 @@ ? s : emptyOrderedMap().withMutations(function (o) { var i = KeyedIterable(s) - assertNotInfinite(i.size), + ;(assertNotInfinite(i.size), i.forEach(function (s, i) { return o.set(i, s) - }) + })) }) } function isOrderedMap(s) { @@ -3091,23 +3096,23 @@ : ((a = _.remove(o)), (u = C === w.size - 1 ? w.pop() : w.set(C, void 0))) } else if (L) { if (i === w.get(C)[1]) return s - ;(a = _), (u = w.set(C, [o, i])) - } else (a = _.set(o, w.size)), (u = w.set(w.size, [o, i])) + ;((a = _), (u = w.set(C, [o, i]))) + } else ((a = _.set(o, w.size)), (u = w.set(w.size, [o, i]))) return s.__ownerID ? ((s.size = a.size), (s._map = a), (s._list = u), (s.__hash = void 0), s) : makeOrderedMap(a, u) } function ToKeyedSequence(s, o) { - ;(this._iter = s), (this._useKeys = o), (this.size = s.size) + ;((this._iter = s), (this._useKeys = o), (this.size = s.size)) } function ToIndexedSequence(s) { - ;(this._iter = s), (this.size = s.size) + ;((this._iter = s), (this.size = s.size)) } function ToSetSequence(s) { - ;(this._iter = s), (this.size = s.size) + ;((this._iter = s), (this.size = s.size)) } function FromEntriesSequence(s) { - ;(this._iter = s), (this.size = s.size) + ;((this._iter = s), (this.size = s.size)) } function flipFactory(s) { var o = makeSequence(s) @@ -3146,7 +3151,7 @@ var s = a.next() if (!s.done) { var o = s.value[0] - ;(s.value[0] = s.value[1]), (s.value[1] = o) + ;((s.value[0] = s.value[1]), (s.value[1] = o)) } return s }) @@ -3243,7 +3248,7 @@ x = 0 return ( s.__iterate(function (s, _, C) { - if (o.call(i, s, _, C)) return x++, u(s, a ? _ : x - 1, w) + if (o.call(i, s, _, C)) return (x++, u(s, a ? _ : x - 1, w)) }, _), x ) @@ -3281,7 +3286,7 @@ u = (isOrdered(s) ? OrderedMap() : Map()).asMutable() s.__iterate(function (_, w) { u.update(o.call(i, _, w, s), function (s) { - return (s = s || []).push(a ? [w, _] : _), s + return ((s = s || []).push(a ? [w, _] : _), s) }) }) var _ = iterableClass(s) @@ -3321,7 +3326,8 @@ j = 0 return ( s.__iterate(function (s, i) { - if (!C || !(C = w++ < _)) return j++, !1 !== o(s, a ? i : j - 1, u) && j !== x + if (!C || !(C = w++ < _)) + return (j++, !1 !== o(s, a ? i : j - 1, u) && j !== x) }), j ) @@ -3389,7 +3395,7 @@ C = 0 return ( s.__iterate(function (s, _, j) { - if (!x || !(x = o.call(i, s, _, j))) return C++, u(s, a ? _ : C - 1, w) + if (!x || !(x = o.call(i, s, _, j))) return (C++, u(s, a ? _ : C - 1, w)) }), C ) @@ -3408,7 +3414,7 @@ ? s : iteratorValue(u, j++, u === $ ? void 0 : s.value[1], s) var B = s.value - ;(_ = B[0]), (L = B[1]), C && (C = o.call(i, L, _, w)) + ;((_ = B[0]), (L = B[1]), C && (C = o.call(i, L, _, w))) } while (C) return u === V ? s : iteratorValue(u, _, L, s) }) @@ -3467,7 +3473,7 @@ ) }, u) } - return flatDeep(s, 0), _ + return (flatDeep(s, 0), _) }), (a.__iteratorUncached = function (a, u) { var _ = s.__iterator(a, u), @@ -3480,7 +3486,7 @@ var C = s.value if ((a === V && (C = C[1]), (o && !(w.length < o)) || !isIterable(C))) return i ? s : iteratorValue(a, x++, C, s) - w.push(_), (_ = C.__iterator(a, u)) + ;(w.push(_), (_ = C.__iterator(a, u))) } else _ = w.pop() } return iteratorDone() @@ -3584,13 +3590,12 @@ for ( var i, a = this.__iterator(U, o), u = 0; !(i = a.next()).done && !1 !== s(i.value, u++, this); - ); return u }), (a.__iteratorUncached = function (s, a) { var u = i.map(function (s) { - return (s = Iterable(s)), getIterator(a ? s.reverse() : s) + return ((s = Iterable(s)), getIterator(a ? s.reverse() : s)) }), _ = 0, w = !1 @@ -3629,7 +3634,7 @@ if (s !== Object(s)) throw new TypeError('Expected [K, V] tuple: ' + s) } function resolveSize(s) { - return assertNotInfinite(s.size), ensureSize(s) + return (assertNotInfinite(s.size), ensureSize(s)) } function iterableClass(s) { return isKeyed(s) ? KeyedIterable : isIndexed(s) ? IndexedIterable : SetIterable @@ -3663,18 +3668,18 @@ if (!i) { i = !0 var w = Object.keys(s) - setProps(u, w), + ;(setProps(u, w), (u.size = w.length), (u._name = o), (u._keys = w), - (u._defaultValues = s) + (u._defaultValues = s)) } this._map = Map(_) }, u = (a.prototype = Object.create(tt)) - return (u.constructor = a), a + return ((u.constructor = a), a) } - createClass(OrderedMap, Map), + ;(createClass(OrderedMap, Map), (OrderedMap.of = function () { return this(arguments) }), @@ -3861,7 +3866,7 @@ return this._map ? this._map.get(s, i) : i }), (Record.prototype.clear = function () { - if (this.__ownerID) return this._map && this._map.clear(), this + if (this.__ownerID) return (this._map && this._map.clear(), this) var s = this.constructor return s._empty || (s._empty = makeRecord(this, emptyMap())) }), @@ -3900,11 +3905,11 @@ if (s === this.__ownerID) return this var o = this._map && this._map.__ensureOwner(s) return s ? makeRecord(this, o, s) : ((this.__ownerID = s), (this._map = o), this) - }) + })) var tt = Record.prototype function makeRecord(s, o, i) { var a = Object.create(Object.getPrototypeOf(s)) - return (a._map = o), (a.__ownerID = i), a + return ((a._map = o), (a.__ownerID = i), a) } function recordName(s) { return s._name || s.constructor.name || 'Record' @@ -3920,7 +3925,7 @@ return this.get(o) }, set: function (s) { - invariant(this.__ownerID, 'Cannot set on an immutable record.'), this.set(o, s) + ;(invariant(this.__ownerID, 'Cannot set on an immutable record.'), this.set(o, s)) }, }) } @@ -3931,16 +3936,16 @@ ? s : emptySet().withMutations(function (o) { var i = SetIterable(s) - assertNotInfinite(i.size), + ;(assertNotInfinite(i.size), i.forEach(function (s) { return o.add(s) - }) + })) }) } function isSet(s) { return !(!s || !s[nt]) } - ;(tt[_] = tt.remove), + ;((tt[_] = tt.remove), (tt.deleteIn = tt.removeIn = $e.removeIn), (tt.merge = $e.merge), (tt.mergeWith = $e.mergeWith), @@ -4056,7 +4061,7 @@ var o = this._map.__ensureOwner(s) return s ? this.__make(o, s) : ((this.__ownerID = s), (this._map = o), this) }), - (Set.isSet = isSet) + (Set.isSet = isSet)) var rt, nt = '@@__IMMUTABLE_SET__@@', st = Set.prototype @@ -4071,7 +4076,7 @@ } function makeSet(s, o) { var i = Object.create(st) - return (i.size = s ? s.size : 0), (i._map = s), (i.__ownerID = o), i + return ((i.size = s ? s.size : 0), (i._map = s), (i.__ownerID = o), i) } function emptySet() { return rt || (rt = makeSet(emptyMap())) @@ -4083,16 +4088,16 @@ ? s : emptyOrderedSet().withMutations(function (o) { var i = SetIterable(s) - assertNotInfinite(i.size), + ;(assertNotInfinite(i.size), i.forEach(function (s) { return o.add(s) - }) + })) }) } function isOrderedSet(s) { return isSet(s) && isOrdered(s) } - ;(st[nt] = !0), + ;((st[nt] = !0), (st[_] = st.remove), (st.mergeDeep = st.merge), (st.mergeDeepWith = st.mergeWith), @@ -4111,12 +4116,12 @@ (OrderedSet.prototype.toString = function () { return this.__toString('OrderedSet {', '}') }), - (OrderedSet.isOrderedSet = isOrderedSet) + (OrderedSet.isOrderedSet = isOrderedSet)) var ot, it = OrderedSet.prototype function makeOrderedSet(s, o) { var i = Object.create(it) - return (i.size = s ? s.size : 0), (i._map = s), (i.__ownerID = o), i + return ((i.size = s ? s.size : 0), (i._map = s), (i.__ownerID = o), i) } function emptyOrderedSet() { return ot || (ot = makeOrderedSet(emptyOrderedMap())) @@ -4127,7 +4132,7 @@ function isStack(s) { return !(!s || !s[ct]) } - ;(it[u] = !0), + ;((it[u] = !0), (it.__empty = emptyOrderedSet), (it.__make = makeOrderedSet), createClass(Stack, IndexedCollection), @@ -4168,7 +4173,7 @@ i = this._head return ( s.reverse().forEach(function (s) { - o++, (i = { value: s, next: i }) + ;(o++, (i = { value: s, next: i })) }), this.__ownerID ? ((this.size = o), @@ -4235,12 +4240,12 @@ return new Iterator(function () { if (a) { var o = a.value - return (a = a.next), iteratorValue(s, i++, o) + return ((a = a.next), iteratorValue(s, i++, o)) } return iteratorDone() }) }), - (Stack.isStack = isStack) + (Stack.isStack = isStack)) var at, ct = '@@__IMMUTABLE_STACK__@@', lt = Stack.prototype @@ -4268,7 +4273,7 @@ s ) } - ;(lt[ct] = !0), + ;((lt[ct] = !0), (lt.withMutations = $e.withMutations), (lt.asMutable = $e.asMutable), (lt.asImmutable = $e.asImmutable), @@ -4367,7 +4372,7 @@ var i = !0 return ( this.__iterate(function (a, u, _) { - if (!s.call(o, a, u, _)) return (i = !1), !1 + if (!s.call(o, a, u, _)) return ((i = !1), !1) }), i ) @@ -4380,15 +4385,15 @@ return a ? a[1] : i }, forEach: function (s, o) { - return assertNotInfinite(this.size), this.__iterate(o ? s.bind(o) : s) + return (assertNotInfinite(this.size), this.__iterate(o ? s.bind(o) : s)) }, join: function (s) { - assertNotInfinite(this.size), (s = void 0 !== s ? '' + s : ',') + ;(assertNotInfinite(this.size), (s = void 0 !== s ? '' + s : ',')) var o = '', i = !0 return ( this.__iterate(function (a) { - i ? (i = !1) : (o += s), (o += null != a ? a.toString() : '') + ;(i ? (i = !1) : (o += s), (o += null != a ? a.toString() : '')) }), o ) @@ -4466,7 +4471,7 @@ var a = i return ( this.__iterate(function (i, u, _) { - if (s.call(o, i, u, _)) return (a = [u, i]), !1 + if (s.call(o, i, u, _)) return ((a = [u, i]), !1) }), a ) @@ -4594,9 +4599,9 @@ hashCode: function () { return this.__hash || (this.__hash = hashIterable(this)) }, - }) + })) var ut = Iterable.prototype - ;(ut[o] = !0), + ;((ut[o] = !0), (ut[Z] = ut.values), (ut.__toJS = ut.toArray), (ut.__toStringMapper = quoteString), @@ -4634,7 +4639,7 @@ .flip() ) }, - }) + })) var pt = KeyedIterable.prototype function keyMapper(s, o) { return o @@ -4779,7 +4784,7 @@ var s = [this].concat(arrCopy(arguments)), o = zipWithFactory(this.toSeq(), IndexedSeq.of, s), i = o.flatten(!0) - return o.size && (i.size = o.size * s.length), reify(this, i) + return (o.size && (i.size = o.size * s.length), reify(this, i)) }, keySeq: function () { return Range(0, this.size) @@ -4798,7 +4803,7 @@ }, zipWith: function (s) { var o = arrCopy(arguments) - return (o[0] = this), reify(this, zipWithFactory(this, s, o)) + return ((o[0] = this), reify(this, zipWithFactory(this, s, o))) }, }), (IndexedIterable.prototype[a] = !0), @@ -4881,7 +4886,7 @@ ye = '[object Function]', be = '[object Object]', _e = {} - ;(_e[fe] = + ;((_e[fe] = _e['[object Array]'] = _e['[object ArrayBuffer]'] = _e['[object DataView]'] = @@ -4930,7 +4935,7 @@ xe || (xe = new a()) var He = xe.get(s) if (He) return He - xe.set(s, Pe), + ;(xe.set(s, Pe), le(s) ? s.forEach(function (a) { Pe.add(baseClone(a, o, i, a, s, xe)) @@ -4938,15 +4943,15 @@ : ae(s) && s.forEach(function (a, u) { Pe.set(u, baseClone(a, o, i, u, s, xe)) - }) + })) var Ye = qe ? void 0 : ($e ? (Re ? U : $) : Re ? de : pe)(s) return ( u(Ye || s, function (a, u) { - Ye && (a = s[(u = a)]), _(Pe, u, baseClone(a, o, i, u, s, xe)) + ;(Ye && (a = s[(u = a)]), _(Pe, u, baseClone(a, o, i, u, s, xe))) }), Pe ) - }) + })) }, 10023: (s, o, i) => { const a = i(6205), @@ -4974,7 +4979,7 @@ { type: a.CHAR, value: 12288 }, { type: a.CHAR, value: 65279 }, ] - ;(o.words = () => ({ type: a.SET, set: WORDS(), not: !1 })), + ;((o.words = () => ({ type: a.SET, set: WORDS(), not: !1 })), (o.notWords = () => ({ type: a.SET, set: WORDS(), not: !0 })), (o.ints = () => ({ type: a.SET, set: INTS(), not: !1 })), (o.notInts = () => ({ type: a.SET, set: INTS(), not: !0 })), @@ -4989,7 +4994,7 @@ { type: a.CHAR, value: 8233 }, ], not: !0, - })) + }))) }, 10043: (s, o, i) => { 'use strict' @@ -5031,14 +5036,14 @@ _ = i(92340) class Element { constructor(s, o, i) { - o && (this.meta = o), i && (this.attributes = i), (this.content = s) + ;(o && (this.meta = o), i && (this.attributes = i), (this.content = s)) } freeze() { Object.isFrozen(this) || (this._meta && ((this.meta.parent = this), this.meta.freeze()), this._attributes && ((this.attributes.parent = this), this.attributes.freeze()), this.children.forEach((s) => { - ;(s.parent = this), s.freeze() + ;((s.parent = this), s.freeze()) }, this), this.content && Array.isArray(this.content) && Object.freeze(this.content), Object.freeze(this)) @@ -5076,7 +5081,7 @@ if ('' === this.id.toValue()) throw Error('Cannot create reference to an element that does not contain an ID') const o = new this.RefElement(this.id.toValue()) - return s && (o.path = s), o + return (s && (o.path = s), o) } findRecursive(...s) { if (arguments.length > 1 && !this.isFrozen) @@ -5116,7 +5121,7 @@ ) } set(s) { - return (this.content = s), this + return ((this.content = s), this) } equals(s) { return a(this.toValue(), s) @@ -5125,7 +5130,7 @@ if (!this.meta.hasKey(s)) { if (this.isFrozen) { const s = this.refract(o) - return s.freeze(), s + return (s.freeze(), s) } this.meta.set(s, o) } @@ -5165,7 +5170,7 @@ if (!this._meta) { if (this.isFrozen) { const s = new this.ObjectElement() - return s.freeze(), s + return (s.freeze(), s) } this._meta = new this.ObjectElement() } @@ -5178,7 +5183,7 @@ if (!this._attributes) { if (this.isFrozen) { const s = new this.ObjectElement() - return s.freeze(), s + return (s.freeze(), s) } this._attributes = new this.ObjectElement() } @@ -5225,14 +5230,14 @@ get parents() { let { parent: s } = this const o = new _() - for (; s; ) o.push(s), (s = s.parent) + for (; s; ) (o.push(s), (s = s.parent)) return o } get children() { if (Array.isArray(this.content)) return new _(this.content) if (this.content instanceof u) { const s = new _([this.content.key]) - return this.content.value && s.push(this.content.value), s + return (this.content.value && s.push(this.content.value), s) } return this.content instanceof Element ? new _([this.content]) : new _() } @@ -5240,10 +5245,10 @@ const s = new _() return ( this.children.forEach((o) => { - s.push(o), + ;(s.push(o), o.recursiveChildren.forEach((o) => { s.push(o) - }) + })) }), s ) @@ -5262,12 +5267,12 @@ u = i(30655), _ = i(73126), w = i(12205) - ;(s.exports = function callBind(s) { + ;((s.exports = function callBind(s) { var o = _(arguments), i = s.length - (arguments.length - 1) return a(o, 1 + (i > 0 ? i : 0), !0) }), - u ? u(s.exports, 'apply', { value: w }) : (s.exports.apply = w) + u ? u(s.exports, 'apply', { value: w }) : (s.exports.apply = w)) }, 10776: (s, o, i) => { var a = i(30756), @@ -5356,7 +5361,7 @@ } return u(s, this, arguments) } - return (Wrapper.prototype = s.prototype), Wrapper + return ((Wrapper.prototype = s.prototype), Wrapper) } s.exports = function (s, o) { var i, @@ -5376,7 +5381,7 @@ fe = ce ? j : j[ae] || B(j, ae, {})[ae], ye = fe.prototype for (V in o) - (u = !(i = C(ce ? V : ae + (le ? '.' : '#') + V, s.forced)) && de && $(de, V)), + ((u = !(i = C(ce ? V : ae + (le ? '.' : '#') + V, s.forced)) && de && $(de, V)), (Y = fe[V]), u && (Z = s.dontCallGetSet ? (ie = x(de, V)) && ie.value : de[V]), (z = u && Z ? Z : o[V]), @@ -5394,7 +5399,7 @@ pe && ($(j, (U = ae + 'Prototype')) || B(j, U, {}), B(j[U], V, z), - s.real && ye && (i || !ye[V]) && B(ye, V, z))) + s.real && ye && (i || !ye[V]) && B(ye, V, z)))) } }, 11287: (s) => { @@ -5481,7 +5486,7 @@ const a = i(10316) s.exports = class BooleanElement extends a { constructor(s, o, i) { - super(s, o, i), (this.element = 'boolean') + ;(super(s, o, i), (this.element = 'boolean')) } primitive() { return 'boolean' @@ -5510,7 +5515,7 @@ u = i(45951), _ = i(14840), w = i(93742) - for (var x in a) _(u[x], x), (w[x] = w.Array) + for (var x in a) (_(u[x], x), (w[x] = w.Array)) }, 12651: (s, o, i) => { var a = i(74218) @@ -5588,7 +5593,7 @@ const a = i(10316) s.exports = class RefElement extends a { constructor(s, o, i) { - super(s || [], o, i), (this.element = 'ref'), this.path || (this.path = 'element') + ;(super(s || [], o, i), (this.element = 'ref'), this.path || (this.path = 'element')) } get path() { return this.attributes.get('path') @@ -5678,9 +5683,9 @@ ) } function deepmerge(s, i, a) { - ;((a = a || {}).arrayMerge = a.arrayMerge || defaultArrayMerge), + ;(((a = a || {}).arrayMerge = a.arrayMerge || defaultArrayMerge), (a.isMergeableObject = a.isMergeableObject || o), - (a.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified) + (a.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified)) var u = Array.isArray(i) return u === Array.isArray(s) ? u @@ -5748,13 +5753,13 @@ z = Object.assign, Y = {} function E(s, o, i) { - ;(this.props = s), (this.context = o), (this.refs = Y), (this.updater = i || V) + ;((this.props = s), (this.context = o), (this.refs = Y), (this.updater = i || V)) } function F() {} function G(s, o, i) { - ;(this.props = s), (this.context = o), (this.refs = Y), (this.updater = i || V) + ;((this.props = s), (this.context = o), (this.refs = Y), (this.updater = i || V)) } - ;(E.prototype.isReactComponent = {}), + ;((E.prototype.isReactComponent = {}), (E.prototype.setState = function (s, o) { if ('object' != typeof s && 'function' != typeof s && null != s) throw Error( @@ -5765,9 +5770,9 @@ (E.prototype.forceUpdate = function (s) { this.updater.enqueueForceUpdate(this, s, 'forceUpdate') }), - (F.prototype = E.prototype) + (F.prototype = E.prototype)) var Z = (G.prototype = new F()) - ;(Z.constructor = G), z(Z, E.prototype), (Z.isPureReactComponent = !0) + ;((Z.constructor = G), z(Z, E.prototype), (Z.isPureReactComponent = !0)) var ee = Array.isArray, ie = Object.prototype.hasOwnProperty, ae = { current: null }, @@ -5876,14 +5881,14 @@ C += R((x = x.value), o, u, (L = _ + Q(x, j++)), w) else if ('object' === x) throw ( - ((o = String(s)), + (o = String(s)), Error( 'Objects are not valid as a React child (found: ' + ('[object Object]' === o ? 'object with keys {' + Object.keys(s).join(', ') + '}' : o) + '). If you meant to render a collection of children, use an array instead.' - )) + ) ) return C } @@ -5901,7 +5906,7 @@ function T(s) { if (-1 === s._status) { var o = s._result - ;(o = o()).then( + ;((o = o()).then( function (o) { ;(0 !== s._status && -1 !== s._status) || ((s._status = 1), (s._result = o)) }, @@ -5909,7 +5914,7 @@ ;(0 !== s._status && -1 !== s._status) || ((s._status = 2), (s._result = o)) } ), - -1 === s._status && ((s._status = 0), (s._result = o)) + -1 === s._status && ((s._status = 0), (s._result = o))) } if (1 === s._status) return s._result.default throw s._result @@ -5920,7 +5925,7 @@ function X() { throw Error('act(...) is not supported in production builds of React.') } - ;(o.Children = { + ;((o.Children = { map: S, forEach: function (s, o, i) { S( @@ -6011,7 +6016,7 @@ (o.createElement = M), (o.createFactory = function (s) { var o = M.bind(null, s) - return (o.type = s), o + return ((o.type = s), o) }), (o.createRef = function () { return { current: null } @@ -6079,7 +6084,7 @@ (o.useTransition = function () { return pe.current.useTransition() }), - (o.version = '18.3.1') + (o.version = '18.3.1')) }, 15325: (s, o, i) => { var a = i(96131) @@ -6097,7 +6102,7 @@ ArrayBuffer.isView || function isView(s) { try { - return _(s), !0 + return (_(s), !0) } catch (s) { return !1 } @@ -6203,12 +6208,12 @@ return ( s.removeAllRanges(), function () { - 'Caret' === s.type && s.removeAllRanges(), + ;('Caret' === s.type && s.removeAllRanges(), s.rangeCount || i.forEach(function (o) { s.addRange(o) }), - o && o.focus() + o && o.focus()) } ) } @@ -6228,7 +6233,7 @@ u = i(65606) function CorkedRequest(s) { var o = this - ;(this.next = null), + ;((this.next = null), (this.entry = null), (this.finish = function () { !(function onCorkedFinish(s, o, i) { @@ -6236,13 +6241,13 @@ s.entry = null for (; a; ) { var u = a.callback - o.pendingcb--, u(i), (a = a.next) + ;(o.pendingcb--, u(i), (a = a.next)) } o.corkedRequestsFree.next = s })(o, s) - }) + })) } - ;(s.exports = Writable), (Writable.WritableState = WritableState) + ;((s.exports = Writable), (Writable.WritableState = WritableState)) var _ = { deprecate: i(94643) }, w = i(40345), x = i(48287).Buffer, @@ -6270,7 +6275,7 @@ ce = L.errorOrDestroy function nop() {} function WritableState(s, o, _) { - ;(a = a || i(25382)), + ;((a = a || i(25382)), (s = s || {}), 'boolean' != typeof _ && (_ = o instanceof a), (this.objectMode = !!s.objectMode), @@ -6281,9 +6286,9 @@ (this.ending = !1), (this.ended = !1), (this.finished = !1), - (this.destroyed = !1) + (this.destroyed = !1)) var w = !1 === s.decodeStrings - ;(this.decodeStrings = !w), + ;((this.decodeStrings = !w), (this.defaultEncoding = s.defaultEncoding || 'utf8'), (this.length = 0), (this.writing = !1), @@ -6298,15 +6303,15 @@ if ('function' != typeof _) throw new z() if ( ((function onwriteStateUpdate(s) { - ;(s.writing = !1), + ;((s.writing = !1), (s.writecb = null), (s.length -= s.writelen), - (s.writelen = 0) + (s.writelen = 0)) })(i), o) ) !(function onwriteError(s, o, i, a, _) { - --o.pendingcb, + ;(--o.pendingcb, i ? (u.nextTick(_, a), u.nextTick(finishMaybe, s, o), @@ -6315,12 +6320,16 @@ : (_(a), (s._writableState.errorEmitted = !0), ce(s, a), - finishMaybe(s, o)) + finishMaybe(s, o))) })(s, i, a, o, _) else { var w = needFinish(i) || s.destroyed - w || i.corked || i.bufferProcessing || !i.bufferedRequest || clearBuffer(s, i), - a ? u.nextTick(afterWrite, s, i, w, _) : afterWrite(s, i, w, _) + ;(w || + i.corked || + i.bufferProcessing || + !i.bufferedRequest || + clearBuffer(s, i), + a ? u.nextTick(afterWrite, s, i, w, _) : afterWrite(s, i, w, _)) } })(o, s) }), @@ -6334,22 +6343,22 @@ (this.emitClose = !1 !== s.emitClose), (this.autoDestroy = !!s.autoDestroy), (this.bufferedRequestCount = 0), - (this.corkedRequestsFree = new CorkedRequest(this)) + (this.corkedRequestsFree = new CorkedRequest(this))) } function Writable(s) { var o = this instanceof (a = a || i(25382)) if (!o && !j.call(Writable, this)) return new Writable(s) - ;(this._writableState = new WritableState(s, this, o)), + ;((this._writableState = new WritableState(s, this, o)), (this.writable = !0), s && ('function' == typeof s.write && (this._write = s.write), 'function' == typeof s.writev && (this._writev = s.writev), 'function' == typeof s.destroy && (this._destroy = s.destroy), 'function' == typeof s.final && (this._final = s.final)), - w.call(this) + w.call(this)) } function doWrite(s, o, i, a, u, _, w) { - ;(o.writelen = a), + ;((o.writelen = a), (o.writecb = w), (o.writing = !0), (o.sync = !0), @@ -6358,16 +6367,16 @@ : i ? s._writev(u, o.onwrite) : s._write(u, _, o.onwrite), - (o.sync = !1) + (o.sync = !1)) } function afterWrite(s, o, i, a) { - i || + ;(i || (function onwriteDrain(s, o) { 0 === o.length && o.needDrain && ((o.needDrain = !1), s.emit('drain')) })(s, o), o.pendingcb--, a(), - finishMaybe(s, o) + finishMaybe(s, o)) } function clearBuffer(s, o) { o.bufferProcessing = !0 @@ -6377,15 +6386,15 @@ u = new Array(a), _ = o.corkedRequestsFree _.entry = i - for (var w = 0, x = !0; i; ) (u[w] = i), i.isBuf || (x = !1), (i = i.next), (w += 1) - ;(u.allBuffers = x), + for (var w = 0, x = !0; i; ) ((u[w] = i), i.isBuf || (x = !1), (i = i.next), (w += 1)) + ;((u.allBuffers = x), doWrite(s, o, !0, o.length, u, '', _.finish), o.pendingcb++, (o.lastBufferedRequest = null), _.next ? ((o.corkedRequestsFree = _.next), (_.next = null)) : (o.corkedRequestsFree = new CorkedRequest(o)), - (o.bufferedRequestCount = 0) + (o.bufferedRequestCount = 0)) } else { for (; i; ) { var C = i.chunk, @@ -6401,7 +6410,7 @@ } null === i && (o.lastBufferedRequest = null) } - ;(o.bufferedRequest = i), (o.bufferProcessing = !1) + ;((o.bufferedRequest = i), (o.bufferProcessing = !1)) } function needFinish(s) { return ( @@ -6410,11 +6419,11 @@ } function callFinal(s, o) { s._final(function (i) { - o.pendingcb--, + ;(o.pendingcb--, i && ce(s, i), (o.prefinished = !0), s.emit('prefinish'), - finishMaybe(s, o) + finishMaybe(s, o)) }) } function finishMaybe(s, o) { @@ -6435,9 +6444,9 @@ } return i } - i(56698)(Writable, w), + ;(i(56698)(Writable, w), (WritableState.prototype.getBuffer = function getBuffer() { - for (var s = this.bufferedRequest, o = []; s; ) o.push(s), (s = s.next) + for (var s = this.bufferedRequest, o = []; s; ) (o.push(s), (s = s.next)) return o }), (function () { @@ -6491,7 +6500,7 @@ a.ending ? (function writeAfterEnd(s, o) { var i = new ie() - ce(s, i), u.nextTick(o, i) + ;(ce(s, i), u.nextTick(o, i)) })(this, i) : (w || (function validChunk(s, o, i, a) { @@ -6523,7 +6532,7 @@ j || (o.needDrain = !0) if (o.writing || o.corked) { var L = o.lastBufferedRequest - ;(o.lastBufferedRequest = { + ;((o.lastBufferedRequest = { chunk: a, encoding: u, isBuf: i, @@ -6533,7 +6542,7 @@ L ? (L.next = o.lastBufferedRequest) : (o.bufferedRequest = o.lastBufferedRequest), - (o.bufferedRequestCount += 1) + (o.bufferedRequestCount += 1)) } else doWrite(s, o, !1, C, a, u, _) return j })(this, a, w, s, o, i))), @@ -6573,7 +6582,7 @@ )) ) throw new ae(s) - return (this._writableState.defaultEncoding = s), this + return ((this._writableState.defaultEncoding = s), this) }), Object.defineProperty(Writable.prototype, 'writableBuffer', { enumerable: !1, @@ -6601,10 +6610,10 @@ a.corked && ((a.corked = 1), this.uncork()), a.ending || (function endWritable(s, o, i) { - ;(o.ending = !0), + ;((o.ending = !0), finishMaybe(s, o), - i && (o.finished ? u.nextTick(i) : s.once('finish', i)) - ;(o.ended = !0), (s.writable = !1) + i && (o.finished ? u.nextTick(i) : s.once('finish', i))) + ;((o.ended = !0), (s.writable = !1)) })(this, a, i), this ) @@ -6628,7 +6637,7 @@ (Writable.prototype._undestroy = L.undestroy), (Writable.prototype._destroy = function (s, o) { o(s) - }) + })) }, 16946: (s, o, i) => { 'use strict' @@ -6646,7 +6655,7 @@ : w }, 16962: (s, o) => { - ;(o.aliasToReal = { + ;((o.aliasToReal = { each: 'forEach', eachRight: 'forEachRight', entries: 'toPairs', @@ -7139,7 +7148,7 @@ zip: !0, zipObject: !0, zipObjectDeep: !0, - }) + })) }, 17255: (s, o, i) => { var a = i(47422) @@ -7369,7 +7378,7 @@ var a = i(12651) s.exports = function mapCacheDelete(s) { var o = a(this, s).delete(s) - return (this.size -= o ? 1 : 0), o + return ((this.size -= o ? 1 : 0), o) } }, 17965: (s, o, i) => { @@ -7384,7 +7393,7 @@ C, j, L = !1 - o || (o = {}), (i = o.debug || !1) + ;(o || (o = {}), (i = o.debug || !1)) try { if ( ((w = a()), @@ -7404,12 +7413,12 @@ j.addEventListener('copy', function (a) { if ((a.stopPropagation(), o.format)) if ((a.preventDefault(), void 0 === a.clipboardData)) { - i && console.warn('unable to use e.clipboardData'), + ;(i && console.warn('unable to use e.clipboardData'), i && console.warn('trying IE specific stuff'), - window.clipboardData.clearData() + window.clipboardData.clearData()) var _ = u[o.format] || u.default window.clipboardData.setData(_, s) - } else a.clipboardData.clearData(), a.clipboardData.setData(o.format, s) + } else (a.clipboardData.clearData(), a.clipboardData.setData(o.format, s)) o.onCopy && (a.preventDefault(), o.onCopy(a.clipboardData)) }), document.body.appendChild(j), @@ -7420,25 +7429,25 @@ throw new Error('copy command was unsuccessful') L = !0 } catch (a) { - i && console.error('unable to copy using execCommand: ', a), - i && console.warn('trying IE specific stuff') + ;(i && console.error('unable to copy using execCommand: ', a), + i && console.warn('trying IE specific stuff')) try { - window.clipboardData.setData(o.format || 'text', s), + ;(window.clipboardData.setData(o.format || 'text', s), o.onCopy && o.onCopy(window.clipboardData), - (L = !0) + (L = !0)) } catch (a) { - i && console.error('unable to copy using clipboardData: ', a), + ;(i && console.error('unable to copy using clipboardData: ', a), i && console.error('falling back to prompt'), (_ = (function format(s) { var o = (/mac os x/i.test(navigator.userAgent) ? '⌘' : 'Ctrl') + '+C' return s.replace(/#{\s*key\s*}/g, o) })('message' in o ? o.message : 'Copy to clipboard: #{key}, Enter')), - window.prompt(_, s) + window.prompt(_, s)) } } finally { - C && ('function' == typeof C.removeRange ? C.removeRange(x) : C.removeAllRanges()), + ;(C && ('function' == typeof C.removeRange ? C.removeRange(x) : C.removeAllRanges()), j && document.body.removeChild(j), - w() + w()) } return L } @@ -7449,7 +7458,7 @@ _ = i(70981) s.exports = function createRecurry(s, o, i, w, x, C, j, L, B, $) { var U = 8 & o - ;(o |= U ? 32 : 64), 4 & (o &= ~(U ? 64 : 32)) || (o &= -4) + ;((o |= U ? 32 : 64), 4 & (o &= ~(U ? 64 : 32)) || (o &= -4)) var V = [ s, o, @@ -7463,7 +7472,7 @@ $, ], z = i.apply(void 0, V) - return a(s) && u(z, V), (z.placeholder = w), _(z, s, o) + return (a(s) && u(z, V), (z.placeholder = w), _(z, s, o)) } }, 19123: (s, o, i) => { @@ -7500,7 +7509,7 @@ switch (typeof w) { case 'object': if (null === w) break - w._attr && get_attributes(w._attr), + ;(w._attr && get_attributes(w._attr), w._cdata && j.push(('/g, ']]]]>') + ']]>'), w.forEach && @@ -7513,7 +7522,7 @@ : j.push(resolve(s, o, i + 1)) : (j.pop(), (x = !0), j.push(u(s))) }), - x || j.push('')) + x || j.push(''))) break default: j.push(u(w)) @@ -7539,13 +7548,13 @@ format(s, u) } } - s( + ;(s( !1, (a > 1 ? o.indents : '') + (o.name ? '' : '') + (o.indent && !i ? '\n' : '') ), - i && i() + i && i()) } function interrupt(o) { return ( @@ -7571,7 +7580,7 @@ return s(!1, o.indent ? '\n' : '') interrupt(o) || proceed() } - ;(s.exports = function xml(s, o) { + ;((s.exports = function xml(s, o) { 'object' != typeof o && (o = { indent: o }) var i = o.stream ? new _() : null, u = '', @@ -7584,10 +7593,10 @@ function append(s, o) { if ((void 0 !== o && (u += o), s && !w && ((i = i || new _()), (w = !0)), s && w)) { var a = u - delay(function () { + ;(delay(function () { i.emit('data', a) }), - (u = '') + (u = '')) } } function add(s, o) { @@ -7597,7 +7606,7 @@ if (i) { var s = u delay(function () { - i.emit('data', s), i.emit('end'), (i.readable = !1), i.emit('close') + ;(i.emit('data', s), i.emit('end'), (i.readable = !1), i.emit('close')) }) } } @@ -7608,14 +7617,14 @@ o.declaration && (function addXmlDeclaration(s) { var o = { version: '1.0', encoding: s.encoding || 'UTF-8' } - s.standalone && (o.standalone = s.standalone), + ;(s.standalone && (o.standalone = s.standalone), add({ '?xml': { _attr: o } }), - (u = u.replace('/>', '?>')) + (u = u.replace('/>', '?>'))) })(o.declaration), s && s.forEach ? s.forEach(function (o, i) { var a - i + 1 === s.length && (a = end), add(o, a) + ;(i + 1 === s.length && (a = end), add(o, a)) }) : add(s, end), i ? ((i.readable = !0), i) : u @@ -7638,11 +7647,11 @@ ) }, close: function (s) { - void 0 !== s && this.push(s), this.end && this.end() + ;(void 0 !== s && this.push(s), this.end && this.end()) }, } return s - }) + })) }, 19219: (s) => { s.exports = function cacheHas(s, o) { @@ -7732,7 +7741,7 @@ !z) ) try { - le.name !== ae && _(le, 'name', ae), (le.constructor = de) + ;(le.name !== ae && _(le, 'name', ae), (le.constructor = de)) } catch (s) {} return de } @@ -7790,7 +7799,7 @@ _ = i(68969), w = i(77797) s.exports = function baseUnset(s, o) { - return (o = a(o, s)), null == (s = _(s, o)) || delete s[w(u(o))] + return ((o = a(o, s)), null == (s = _(s, o)) || delete s[w(u(o))]) } }, 20181: (s, o, i) => { @@ -7850,7 +7859,7 @@ function invokeFunc(o) { var i = a, _ = u - return (a = u = void 0), (j = o), (w = s.apply(_, i)) + return ((a = u = void 0), (j = o), (w = s.apply(_, i))) } function shouldInvoke(s) { var i = s - C @@ -7868,7 +7877,7 @@ ) } function trailingEdge(s) { - return (x = void 0), V && a ? invokeFunc(s) : ((a = u = void 0), w) + return ((x = void 0), V && a ? invokeFunc(s) : ((a = u = void 0), w)) } function debounced() { var s = now(), @@ -7876,11 +7885,11 @@ if (((a = arguments), (u = this), (C = s), i)) { if (void 0 === x) return (function leadingEdge(s) { - return (j = s), (x = setTimeout(timerExpired, o)), L ? invokeFunc(s) : w + return ((j = s), (x = setTimeout(timerExpired, o)), L ? invokeFunc(s) : w) })(C) - if (B) return (x = setTimeout(timerExpired, o)), invokeFunc(C) + if (B) return ((x = setTimeout(timerExpired, o)), invokeFunc(C)) } - return void 0 === x && (x = setTimeout(timerExpired, o)), w + return (void 0 === x && (x = setTimeout(timerExpired, o)), w) } return ( (o = toNumber(o) || 0), @@ -7889,7 +7898,7 @@ (_ = (B = 'maxWait' in i) ? $(toNumber(i.maxWait) || 0, o) : _), (V = 'trailing' in i ? !!i.trailing : V)), (debounced.cancel = function cancel() { - void 0 !== x && clearTimeout(x), (j = 0), (a = C = u = x = void 0) + ;(void 0 !== x && clearTimeout(x), (j = 0), (a = C = u = x = void 0)) }), (debounced.flush = function flush() { return void 0 === x ? w : trailingEdge(now()) @@ -7915,13 +7924,13 @@ var a = i(48287).Buffer class NonError extends Error { constructor(s) { - super(NonError._prepareSuperMessage(s)), + ;(super(NonError._prepareSuperMessage(s)), Object.defineProperty(this, 'name', { value: 'NonError', configurable: !0, writable: !0, }), - Error.captureStackTrace && Error.captureStackTrace(this, NonError) + Error.captureStackTrace && Error.captureStackTrace(this, NonError)) } static _prepareSuperMessage(s) { try { @@ -7952,7 +7961,7 @@ return ((s) => { s[_] = !0 const o = s.toJSON() - return delete s[_], o + return (delete s[_], o) })(s) for (const [i, u] of Object.entries(s)) 'function' == typeof a && a.isBuffer(u) @@ -7994,7 +8003,7 @@ if (s instanceof Error) return s if ('object' == typeof s && null !== s && !Array.isArray(s)) { const o = new Error() - return destroyCircular({ from: s, seen: [], to_: o, maxDepth: i, depth: 0 }), o + return (destroyCircular({ from: s, seen: [], to_: o, maxDepth: i, depth: 0 }), o) } return new NonError(s) }, @@ -8023,13 +8032,13 @@ C = _.Deno, j = (x && x.versions) || (C && C.version), L = j && j.v8 - L && (u = (a = L.split('.'))[0] > 0 && a[0] < 4 ? 1 : +(a[0] + a[1])), + ;(L && (u = (a = L.split('.'))[0] > 0 && a[0] < 4 ? 1 : +(a[0] + a[1])), !u && w && (!(a = w.match(/Edge\/(\d+)/)) || a[1] >= 74) && (a = w.match(/Chrome\/(\d+)/)) && (u = +a[1]), - (s.exports = u) + (s.exports = u)) }, 20850: (s, o, i) => { 'use strict' @@ -8049,7 +8058,6 @@ x && u(i[0], i[1], x) && ((w = _ < 3 ? void 0 : w), (_ = 1)), o = Object(o); ++a < _; - ) { var C = i[a] C && s(o, C, a, w) @@ -8072,12 +8080,12 @@ this.set(a[0], a[1]) } } - ;(Hash.prototype.clear = a), + ;((Hash.prototype.clear = a), (Hash.prototype.delete = u), (Hash.prototype.get = _), (Hash.prototype.has = w), (Hash.prototype.set = x), - (s.exports = Hash) + (s.exports = Hash)) }, 21791: (s, o, i) => { var a = i(16547), @@ -8088,7 +8096,7 @@ for (var x = -1, C = o.length; ++x < C; ) { var j = o[x], L = _ ? _(i[j], s[j], j, i, s) : void 0 - void 0 === L && (L = s[j]), w ? u(i, j, L) : a(i, j, L) + ;(void 0 === L && (L = s[j]), w ? u(i, j, L) : a(i, j, L)) } return i } @@ -8106,7 +8114,7 @@ switch (i) { case '[object DataView]': if (s.byteLength != o.byteLength || s.byteOffset != o.byteOffset) return !1 - ;(s = s.buffer), (o = o.buffer) + ;((s = s.buffer), (o = o.buffer)) case '[object ArrayBuffer]': return !(s.byteLength != o.byteLength || !B(new u(s), new u(o))) case '[object Boolean]': @@ -8125,9 +8133,9 @@ if ((U || (U = C), s.size != o.size && !V)) return !1 var z = $.get(s) if (z) return z == o - ;(a |= 2), $.set(s, o) + ;((a |= 2), $.set(s, o)) var Y = w(U(s), U(o), a, j, B, $) - return $.delete(s), Y + return ($.delete(s), Y) case '[object Symbol]': if (L) return L.call(s) == L.call(o) } @@ -8137,7 +8145,7 @@ 22032: (s, o, i) => { var a = i(81042) s.exports = function hashClear() { - ;(this.__data__ = a ? a(null) : {}), (this.size = 0) + ;((this.__data__ = a ? a(null) : {}), (this.size = 0)) } }, 22225: (s) => { @@ -8203,7 +8211,7 @@ var _ = new Set(), w = {} function fa(s, o) { - ha(s, o), ha(s + 'Capture', o) + ;(ha(s, o), ha(s + 'Capture', o)) } function ha(s, o) { for (w[s] = o, s = 0; s < o.length; s++) _.add(o[s]) @@ -8219,17 +8227,17 @@ L = {}, B = {} function v(s, o, i, a, u, _, w) { - ;(this.acceptsBooleans = 2 === o || 3 === o || 4 === o), + ;((this.acceptsBooleans = 2 === o || 3 === o || 4 === o), (this.attributeName = a), (this.attributeNamespace = u), (this.mustUseProperty = i), (this.propertyName = s), (this.type = o), (this.sanitizeURL = _), - (this.removeEmptyString = w) + (this.removeEmptyString = w)) } var $ = {} - 'children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style' + ;('children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style' .split(' ') .forEach(function (s) { $[s] = new v(s, 0, !1, s, null, !1, !1) @@ -8267,7 +8275,7 @@ }), ['rowSpan', 'start'].forEach(function (s) { $[s] = new v(s, 5, !1, s.toLowerCase(), null, !1, !1) - }) + })) var U = /[\-:]([a-z])/g function sa(s) { return s[1].toUpperCase() @@ -8332,7 +8340,7 @@ : ((i = 3 === (u = u.type) || (4 === u && !0 === i) ? '' : '' + i), a ? s.setAttributeNS(a, o, i) : s.setAttribute(o, i)))) } - 'accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height' + ;('accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height' .split(' ') .forEach(function (s) { var o = s.replace(U, sa) @@ -8362,7 +8370,7 @@ )), ['src', 'href', 'action', 'formAction'].forEach(function (s) { $[s] = new v(s, 1, !1, s.toLowerCase(), null, !0, !0) - }) + })) var V = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, z = Symbol.for('react.element'), Y = Symbol.for('react.portal'), @@ -8376,11 +8384,11 @@ de = Symbol.for('react.suspense_list'), fe = Symbol.for('react.memo'), ye = Symbol.for('react.lazy') - Symbol.for('react.scope'), Symbol.for('react.debug_trace_mode') + ;(Symbol.for('react.scope'), Symbol.for('react.debug_trace_mode')) var be = Symbol.for('react.offscreen') - Symbol.for('react.legacy_hidden'), + ;(Symbol.for('react.legacy_hidden'), Symbol.for('react.cache'), - Symbol.for('react.tracing_marker') + Symbol.for('react.tracing_marker')) var _e = Symbol.iterator function Ka(s) { return null === s || 'object' != typeof s @@ -8450,7 +8458,6 @@ w = u.length - 1, x = _.length - 1; 1 <= w && 0 <= x && u[w] !== _[x]; - ) x-- for (; 1 <= w && 0 <= x; w--, x--) @@ -8471,7 +8478,7 @@ } } } finally { - ;(xe = !1), (Error.prepareStackTrace = i) + ;((xe = !1), (Error.prepareStackTrace = i)) } return (s = s ? s.displayName || s.name : '') ? Ma(s) : '' } @@ -8534,7 +8541,7 @@ case fe: return null !== (o = s.displayName || null) ? o : Qa(s.type) || 'Memo' case ye: - ;(o = s._payload), (s = s._init) + ;((o = s._payload), (s = s._init)) try { return Qa(s(o)) } catch (s) {} @@ -8633,7 +8640,7 @@ return u.call(this) }, set: function (s) { - ;(a = '' + s), _.call(this, s) + ;((a = '' + s), _.call(this, s)) }, }), Object.defineProperty(s, o, { enumerable: i.enumerable }), @@ -8645,7 +8652,7 @@ a = '' + s }, stopTracking: function () { - ;(s._valueTracker = null), delete s[o] + ;((s._valueTracker = null), delete s[o]) }, } ) @@ -8684,13 +8691,13 @@ function Za(s, o) { var i = null == o.defaultValue ? '' : o.defaultValue, a = null != o.checked ? o.checked : o.defaultChecked - ;(i = Sa(null != o.value ? o.value : i)), + ;((i = Sa(null != o.value ? o.value : i)), (s._wrapperState = { initialChecked: a, initialValue: i, controlled: 'checkbox' === o.type || 'radio' === o.type ? null != o.checked : null != o.value, - }) + })) } function ab(s, o) { null != (o = o.checked) && ta(s, 'checked', o, !1) @@ -8704,25 +8711,25 @@ ? ((0 === i && '' === s.value) || s.value != i) && (s.value = '' + i) : s.value !== '' + i && (s.value = '' + i) else if ('submit' === a || 'reset' === a) return void s.removeAttribute('value') - o.hasOwnProperty('value') + ;(o.hasOwnProperty('value') ? cb(s, o.type, i) : o.hasOwnProperty('defaultValue') && cb(s, o.type, Sa(o.defaultValue)), null == o.checked && null != o.defaultChecked && - (s.defaultChecked = !!o.defaultChecked) + (s.defaultChecked = !!o.defaultChecked)) } function db(s, o, i) { if (o.hasOwnProperty('value') || o.hasOwnProperty('defaultValue')) { var a = o.type if (!(('submit' !== a && 'reset' !== a) || (void 0 !== o.value && null !== o.value))) return - ;(o = '' + s._wrapperState.initialValue), + ;((o = '' + s._wrapperState.initialValue), i || o === s.value || (s.value = o), - (s.defaultValue = o) + (s.defaultValue = o)) } - '' !== (i = s.name) && (s.name = ''), + ;('' !== (i = s.name) && (s.name = ''), (s.defaultChecked = !!s._wrapperState.initialChecked), - '' !== i && (s.name = i) + '' !== i && (s.name = i)) } function cb(s, o, i) { ;('number' === o && Xa(s.ownerDocument) === s) || @@ -8736,13 +8743,13 @@ o = {} for (var u = 0; u < i.length; u++) o['$' + i[u]] = !0 for (i = 0; i < s.length; i++) - (u = o.hasOwnProperty('$' + s[i].value)), + ((u = o.hasOwnProperty('$' + s[i].value)), s[i].selected !== u && (s[i].selected = u), - u && a && (s[i].defaultSelected = !0) + u && a && (s[i].defaultSelected = !0)) } else { for (i = '' + Sa(i), o = null, u = 0; u < s.length; u++) { if (s[u].value === i) - return (s[u].selected = !0), void (a && (s[u].defaultSelected = !0)) + return ((s[u].selected = !0), void (a && (s[u].defaultSelected = !0))) null !== o || s[u].disabled || (o = s[u]) } null !== o && (o.selected = !0) @@ -8767,17 +8774,17 @@ } o = i } - null == o && (o = ''), (i = o) + ;(null == o && (o = ''), (i = o)) } s._wrapperState = { initialValue: Sa(i) } } function ib(s, o) { var i = Sa(o.value), a = Sa(o.defaultValue) - null != i && + ;(null != i && ((i = '' + i) !== s.value && (s.value = i), null == o.defaultValue && s.defaultValue !== i && (s.defaultValue = i)), - null != a && (s.defaultValue = '' + a) + null != a && (s.defaultValue = '' + a)) } function jb(s) { var o = s.textContent @@ -8812,7 +8819,6 @@ '' + o.valueOf().toString() + '', o = Te.firstChild; s.firstChild; - ) s.removeChild(s.firstChild) for (; o.firstChild; ) s.appendChild(o.firstChild) @@ -8890,12 +8896,12 @@ if (o.hasOwnProperty(i)) { var a = 0 === i.indexOf('--'), u = rb(i, o[i], a) - 'float' === i && (i = 'cssFloat'), a ? s.setProperty(i, u) : (s[i] = u) + ;('float' === i && (i = 'cssFloat'), a ? s.setProperty(i, u) : (s[i] = u)) } } Object.keys(qe).forEach(function (s) { ze.forEach(function (o) { - ;(o = o + s.charAt(0).toUpperCase() + s.substring(1)), (qe[o] = qe[s]) + ;((o = o + s.charAt(0).toUpperCase() + s.substring(1)), (qe[o] = qe[s])) }) }) var We = we( @@ -8988,7 +8994,7 @@ try { return Gb(s, o, i) } finally { - ;(et = !1), (null !== Xe || null !== Qe) && (Hb(), Fb()) + ;((et = !1), (null !== Xe || null !== Qe) && (Hb(), Fb())) } } function Kb(s, o) { @@ -9009,14 +9015,14 @@ case 'onMouseUp': case 'onMouseUpCapture': case 'onMouseEnter': - ;(a = !a.disabled) || + ;((a = !a.disabled) || (a = !( 'button' === (s = s.type) || 'input' === s || 'select' === s || 'textarea' === s )), - (s = !a) + (s = !a)) break e default: s = !1 @@ -9029,13 +9035,13 @@ if (x) try { var rt = {} - Object.defineProperty(rt, 'passive', { + ;(Object.defineProperty(rt, 'passive', { get: function () { tt = !0 }, }), window.addEventListener('test', rt, rt), - window.removeEventListener('test', rt, rt) + window.removeEventListener('test', rt, rt)) } catch (Re) { tt = !1 } @@ -9053,11 +9059,11 @@ it = null, at = { onError: function (s) { - ;(nt = !0), (st = s) + ;((nt = !0), (st = s)) }, } function Tb(s, o, i, a, u, _, w, x, C) { - ;(nt = !1), (st = null), Nb.apply(at, arguments) + ;((nt = !1), (st = null), Nb.apply(at, arguments)) } function Vb(s) { var o = s, @@ -9066,7 +9072,7 @@ else { s = o do { - !!(4098 & (o = s).flags) && (i = o.return), (s = o.return) + ;(!!(4098 & (o = s).flags) && (i = o.return), (s = o.return)) } while (s) } return 3 === o.tag ? i : null @@ -9103,21 +9109,21 @@ } if (u.child === _.child) { for (_ = u.child; _; ) { - if (_ === i) return Xb(u), s - if (_ === a) return Xb(u), o + if (_ === i) return (Xb(u), s) + if (_ === a) return (Xb(u), o) _ = _.sibling } throw Error(p(188)) } - if (i.return !== a.return) (i = u), (a = _) + if (i.return !== a.return) ((i = u), (a = _)) else { for (var w = !1, x = u.child; x; ) { if (x === i) { - ;(w = !0), (i = u), (a = _) + ;((w = !0), (i = u), (a = _)) break } if (x === a) { - ;(w = !0), (a = u), (i = _) + ;((w = !0), (a = u), (i = _)) break } x = x.sibling @@ -9125,11 +9131,11 @@ if (!w) { for (x = _.child; x; ) { if (x === i) { - ;(w = !0), (i = _), (a = u) + ;((w = !0), (i = _), (a = u)) break } if (x === a) { - ;(w = !0), (a = _), (i = u) + ;((w = !0), (a = _), (i = u)) break } x = x.sibling @@ -9170,7 +9176,7 @@ var Et = Math.clz32 ? Math.clz32 : function nc(s) { - return (s >>>= 0), 0 === s ? 32 : (31 - ((wt(s) / xt) | 0)) | 0 + return ((s >>>= 0), 0 === s ? 32 : (31 - ((wt(s) / xt) | 0)) | 0) }, wt = Math.log, xt = Math.LN2 @@ -9246,7 +9252,7 @@ return o if ((4 & a && (a |= 16 & i), 0 !== (o = s.entangledLanes))) for (s = s.entanglements, o &= a; 0 < o; ) - (u = 1 << (i = 31 - Et(o))), (a |= s[i]), (o &= ~u) + ((u = 1 << (i = 31 - Et(o))), (a |= s[i]), (o &= ~u)) return a } function vc(s, o) { @@ -9284,23 +9290,23 @@ } function yc() { var s = kt - return !(4194240 & (kt <<= 1)) && (kt = 64), s + return (!(4194240 & (kt <<= 1)) && (kt = 64), s) } function zc(s) { for (var o = [], i = 0; 31 > i; i++) o.push(s) return o } function Ac(s, o, i) { - ;(s.pendingLanes |= o), + ;((s.pendingLanes |= o), 536870912 !== o && ((s.suspendedLanes = 0), (s.pingedLanes = 0)), - ((s = s.eventTimes)[(o = 31 - Et(o))] = i) + ((s = s.eventTimes)[(o = 31 - Et(o))] = i)) } function Cc(s, o) { var i = (s.entangledLanes |= o) for (s = s.entanglements; i; ) { var a = 31 - Et(i), u = 1 << a - ;(u & o) | (s[a] & o) && (s[a] |= o), (i &= ~u) + ;((u & o) | (s[a] & o) && (s[a] |= o), (i &= ~u)) } } var At = 0 @@ -9385,9 +9391,9 @@ if (null !== s.blockedOn) return !1 for (var o = s.targetContainers; 0 < o.length; ) { var i = Yc(s.domEventName, s.eventSystemFlags, o[0], s.nativeEvent) - if (null !== i) return null !== (o = Cb(i)) && jt(o), (s.blockedOn = i), !1 + if (null !== i) return (null !== (o = Cb(i)) && jt(o), (s.blockedOn = i), !1) var a = new (i = s.nativeEvent).constructor(i.type, i) - ;(He = a), i.target.dispatchEvent(a), (He = null), o.shift() + ;((He = a), i.target.dispatchEvent(a), (He = null), o.shift()) } return !0 } @@ -9395,12 +9401,12 @@ Xc(s) && i.delete(o) } function $c() { - ;(Nt = !1), + ;((Nt = !1), null !== Rt && Xc(Rt) && (Rt = null), null !== Dt && Xc(Dt) && (Dt = null), null !== Lt && Xc(Lt) && (Lt = null), Ft.forEach(Zc), - Bt.forEach(Zc) + Bt.forEach(Zc)) } function ad(s, o) { s.blockedOn === o && @@ -9430,7 +9436,7 @@ ) (i = $t[o]).blockedOn === s && (i.blockedOn = null) for (; 0 < $t.length && null === (o = $t[0]).blockedOn; ) - Vc(o), null === o.blockedOn && $t.shift() + (Vc(o), null === o.blockedOn && $t.shift()) } var Ut = V.ReactCurrentBatchConfig, Vt = !0 @@ -9439,9 +9445,9 @@ _ = Ut.transition Ut.transition = null try { - ;(At = 1), fd(s, o, i, a) + ;((At = 1), fd(s, o, i, a)) } finally { - ;(At = u), (Ut.transition = _) + ;((At = u), (Ut.transition = _)) } } function gd(s, o, i, a) { @@ -9449,29 +9455,33 @@ _ = Ut.transition Ut.transition = null try { - ;(At = 4), fd(s, o, i, a) + ;((At = 4), fd(s, o, i, a)) } finally { - ;(At = u), (Ut.transition = _) + ;((At = u), (Ut.transition = _)) } } function fd(s, o, i, a) { if (Vt) { var u = Yc(s, o, i, a) - if (null === u) hd(s, o, a, zt, i), Sc(s, a) + if (null === u) (hd(s, o, a, zt, i), Sc(s, a)) else if ( (function Uc(s, o, i, a, u) { switch (o) { case 'focusin': - return (Rt = Tc(Rt, s, o, i, a, u)), !0 + return ((Rt = Tc(Rt, s, o, i, a, u)), !0) case 'dragenter': - return (Dt = Tc(Dt, s, o, i, a, u)), !0 + return ((Dt = Tc(Dt, s, o, i, a, u)), !0) case 'mouseover': - return (Lt = Tc(Lt, s, o, i, a, u)), !0 + return ((Lt = Tc(Lt, s, o, i, a, u)), !0) case 'pointerover': var _ = u.pointerId - return Ft.set(_, Tc(Ft.get(_) || null, s, o, i, a, u)), !0 + return (Ft.set(_, Tc(Ft.get(_) || null, s, o, i, a, u)), !0) case 'gotpointercapture': - return (_ = u.pointerId), Bt.set(_, Tc(Bt.get(_) || null, s, o, i, a, u)), !0 + return ( + (_ = u.pointerId), + Bt.set(_, Tc(Bt.get(_) || null, s, o, i, a, u)), + !0 + ) } return !1 })(u, s, o, i, a) @@ -9504,7 +9514,7 @@ return 3 === o.tag ? o.stateNode.containerInfo : null s = null } else o !== s && (s = null) - return (zt = s), null + return ((zt = s), null) } function jd(s) { switch (s) { @@ -9925,9 +9935,10 @@ return 'input' === o ? !!jr[s.type] : 'textarea' === o } function ne(s, o, i, a) { - Eb(a), + ;(Eb(a), 0 < (o = oe(o, 'onChange')).length && - ((i = new Qt('onChange', 'change', null, i, a)), s.push({ event: i, listeners: o })) + ((i = new Qt('onChange', 'change', null, i, a)), + s.push({ event: i, listeners: o }))) } var Pr = null, Ir = null @@ -9947,7 +9958,7 @@ var Mr = 'oninput' in document if (!Mr) { var Rr = document.createElement('div') - Rr.setAttribute('oninput', 'return;'), (Mr = 'function' == typeof Rr.oninput) + ;(Rr.setAttribute('oninput', 'return;'), (Mr = 'function' == typeof Rr.oninput)) } Nr = Mr } else Nr = !1 @@ -9959,7 +9970,7 @@ function Be(s) { if ('value' === s.propertyName && te(Ir)) { var o = [] - ne(o, Ir, s, xb(s)), Jb(re, o) + ;(ne(o, Ir, s, xb(s)), Jb(re, o)) } } function Ce(s, o, i) { @@ -10065,16 +10076,16 @@ if (o !== i && i && i.ownerDocument && Le(i.ownerDocument.documentElement, i)) { if (null !== a && Ne(i)) if (((o = a.start), void 0 === (s = a.end) && (s = o), 'selectionStart' in i)) - (i.selectionStart = o), (i.selectionEnd = Math.min(s, i.value.length)) + ((i.selectionStart = o), (i.selectionEnd = Math.min(s, i.value.length))) else if ( (s = ((o = i.ownerDocument || document) && o.defaultView) || window).getSelection ) { s = s.getSelection() var u = i.textContent.length, _ = Math.min(a.start, u) - ;(a = void 0 === a.end ? _ : Math.min(a.end, u)), + ;((a = void 0 === a.end ? _ : Math.min(a.end, u)), !s.extend && _ > a && ((u = a), (a = _), (_ = u)), - (u = Ke(i, _)) + (u = Ke(i, _))) var w = Ke(i, a) u && w && @@ -10092,7 +10103,7 @@ for (o = [], s = i; (s = s.parentNode); ) 1 === s.nodeType && o.push({ element: s, left: s.scrollLeft, top: s.scrollTop }) for ('function' == typeof i.focus && i.focus(), i = 0; i < o.length; i++) - ((s = o[i]).element.scrollLeft = s.left), (s.element.scrollTop = s.top) + (((s = o[i]).element.scrollLeft = s.left), (s.element.scrollTop = s.top)) } } var Lr = x && 'documentMode' in document && 11 >= document.documentMode, @@ -10165,13 +10176,13 @@ ' ' ) function ff(s, o) { - Gr.set(s, o), fa(o, [s]) + ;(Gr.set(s, o), fa(o, [s])) } for (var Xr = 0; Xr < Yr.length; Xr++) { var Qr = Yr[Xr] ff(Qr.toLowerCase(), 'on' + (Qr[0].toUpperCase() + Qr.slice(1))) } - ff(Wr, 'onAnimationEnd'), + ;(ff(Wr, 'onAnimationEnd'), ff(Jr, 'onAnimationIteration'), ff(Hr, 'onAnimationStart'), ff('dblclick', 'onDoubleClick'), @@ -10204,7 +10215,7 @@ fa( 'onCompositionUpdate', 'compositionupdate focusout keydown keypress keyup mousedown'.split(' ') - ) + )) var Zr = 'abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting'.split( ' ' @@ -10212,15 +10223,15 @@ en = new Set('cancel close invalid load scroll toggle'.split(' ').concat(Zr)) function nf(s, o, i) { var a = s.type || 'unknown-event' - ;(s.currentTarget = i), + ;((s.currentTarget = i), (function Ub(s, o, i, a, u, _, w, x, C) { if ((Tb.apply(this, arguments), nt)) { if (!nt) throw Error(p(198)) var j = st - ;(nt = !1), (st = null), ot || ((ot = !0), (it = j)) + ;((nt = !1), (st = null), ot || ((ot = !0), (it = j))) } })(a, o, void 0, s), - (s.currentTarget = null) + (s.currentTarget = null)) } function se(s, o) { o = !!(4 & o) @@ -10236,7 +10247,7 @@ C = x.instance, j = x.currentTarget if (((x = x.listener), C !== _ && u.isPropagationStopped())) break e - nf(u, x, j), (_ = C) + ;(nf(u, x, j), (_ = C)) } else for (w = 0; w < a.length; w++) { @@ -10247,7 +10258,7 @@ C !== _ && u.isPropagationStopped()) ) break e - nf(u, x, j), (_ = C) + ;(nf(u, x, j), (_ = C)) } } } @@ -10261,15 +10272,15 @@ } function qf(s, o, i) { var a = 0 - o && (a |= 4), pf(i, s, a, o) + ;(o && (a |= 4), pf(i, s, a, o)) } var tn = '_reactListening' + Math.random().toString(36).slice(2) function sf(s) { if (!s[tn]) { - ;(s[tn] = !0), + ;((s[tn] = !0), _.forEach(function (o) { 'selectionchange' !== o && (en.has(o) || qf(o, !1, s), qf(o, !0, s)) - }) + })) var o = 9 === s.nodeType ? s : s.ownerDocument null === o || o[tn] || ((o[tn] = !0), qf('selectionchange', !1, o)) } @@ -10285,7 +10296,7 @@ default: u = fd } - ;(i = u.bind(null, o, i, s)), + ;((i = u.bind(null, o, i, s)), (u = void 0), !tt || ('touchstart' !== o && 'touchmove' !== o && 'wheel' !== o) || (u = !0), a @@ -10294,7 +10305,7 @@ : s.addEventListener(o, i, !0) : void 0 !== u ? s.addEventListener(o, i, { passive: u }) - : s.addEventListener(o, i, !1) + : s.addEventListener(o, i, !1)) } function hd(s, o, i, a, u) { var _ = a @@ -10344,10 +10355,10 @@ C = mr break case 'focusin': - ;(j = 'focus'), (C = sr) + ;((j = 'focus'), (C = sr)) break case 'focusout': - ;(j = 'blur'), (C = sr) + ;((j = 'blur'), (C = sr)) break case 'beforeblur': case 'afterblur': @@ -10473,16 +10484,17 @@ e: { for ($ = j, V = 0, U = L = C; U; U = vf(U)) V++ for (U = 0, z = $; z; z = vf(z)) U++ - for (; 0 < V - U; ) (L = vf(L)), V-- - for (; 0 < U - V; ) ($ = vf($)), U-- + for (; 0 < V - U; ) ((L = vf(L)), V--) + for (; 0 < U - V; ) (($ = vf($)), U--) for (; V--; ) { if (L === $ || (null !== $ && L === $.alternate)) break e - ;(L = vf(L)), ($ = vf($)) + ;((L = vf(L)), ($ = vf($))) } L = null } else L = null - null !== C && wf(w, x, C, L, !1), null !== j && null !== B && wf(w, B, j, L, !0) + ;(null !== C && wf(w, x, C, L, !1), + null !== j && null !== B && wf(w, B, j, L, !0)) } if ( 'select' === @@ -10525,7 +10537,7 @@ case 'contextmenu': case 'mouseup': case 'dragend': - ;(qr = !1), Ue(w, i, u) + ;((qr = !1), Ue(w, i, u)) break case 'selectionchange': if (Lr) break @@ -10553,7 +10565,7 @@ Cr ? ge(s, i) && (ie = 'onCompositionEnd') : 'keydown' === s && 229 === i.keyCode && (ie = 'onCompositionStart') - ie && + ;(ie && (kr && 'ko' !== i.locale && (Cr || 'onCompositionStart' !== ie @@ -10598,7 +10610,7 @@ 0 < (a = oe(a, 'onBeforeInput')).length && ((u = new lr('onBeforeInput', 'beforeinput', null, i, u)), w.push({ event: u, listeners: a }), - (u.data = ee)) + (u.data = ee))) } se(w, o) }) @@ -10610,12 +10622,12 @@ for (var i = o + 'Capture', a = []; null !== s; ) { var u = s, _ = u.stateNode - 5 === u.tag && + ;(5 === u.tag && null !== _ && ((u = _), null != (_ = Kb(s, i)) && a.unshift(tf(s, _, u)), null != (_ = Kb(s, o)) && a.push(tf(s, _, u))), - (s = s.return) + (s = s.return)) } return a } @@ -10632,13 +10644,13 @@ C = x.alternate, j = x.stateNode if (null !== C && C === a) break - 5 === x.tag && + ;(5 === x.tag && null !== j && ((x = j), u ? null != (C = Kb(i, _)) && w.unshift(tf(i, C, x)) : u || (null != (C = Kb(i, _)) && w.push(tf(i, C, x)))), - (i = i.return) + (i = i.return)) } 0 !== w.length && s.push({ event: o, listeners: w }) } @@ -10687,7 +10699,7 @@ var u = i.nextSibling if ((s.removeChild(i), u && 8 === u.nodeType)) if ('/$' === (i = u.data)) { - if (0 === a) return s.removeChild(u), void bd(o) + if (0 === a) return (s.removeChild(u), void bd(o)) a-- } else ('$' !== i && '$?' !== i && '$!' !== i) || a++ i = u @@ -10764,7 +10776,7 @@ 0 > bn || ((s.current = vn[bn]), (vn[bn] = null), bn--) } function G(s, o) { - bn++, (vn[bn] = s.current), (s.current = o) + ;(bn++, (vn[bn] = s.current), (s.current = o)) } var _n = {}, Sn = Uf(_n), @@ -10790,11 +10802,11 @@ return null != (s = s.childContextTypes) } function $f() { - E(En), E(Sn) + ;(E(En), E(Sn)) } function ag(s, o, i) { if (Sn.current !== _n) throw Error(p(168)) - G(Sn, o), G(En, i) + ;(G(Sn, o), G(En, i)) } function bg(s, o, i) { var a = s.stateNode @@ -10815,14 +10827,14 @@ function dg(s, o, i) { var a = s.stateNode if (!a) throw Error(p(169)) - i + ;(i ? ((s = bg(s, o, wn)), (a.__reactInternalMemoizedMergedChildContext = s), E(En), E(Sn), G(Sn, s)) : E(En), - G(En, i) + G(En, i)) } var xn = null, kn = !1, @@ -10843,11 +10855,11 @@ a = a(!0) } while (null !== a) } - ;(xn = null), (kn = !1) + ;((xn = null), (kn = !1)) } catch (o) { throw (null !== xn && (xn = xn.slice(s + 1)), ct(mt, jg), o) } finally { - ;(At = o), (On = !1) + ;((At = o), (On = !1)) } } return null @@ -10862,36 +10874,36 @@ Mn = 1, Rn = '' function tg(s, o) { - ;(An[Cn++] = Pn), (An[Cn++] = jn), (jn = s), (Pn = o) + ;((An[Cn++] = Pn), (An[Cn++] = jn), (jn = s), (Pn = o)) } function ug(s, o, i) { - ;(In[Tn++] = Mn), (In[Tn++] = Rn), (In[Tn++] = Nn), (Nn = s) + ;((In[Tn++] = Mn), (In[Tn++] = Rn), (In[Tn++] = Nn), (Nn = s)) var a = Mn s = Rn var u = 32 - Et(a) - 1 - ;(a &= ~(1 << u)), (i += 1) + ;((a &= ~(1 << u)), (i += 1)) var _ = 32 - Et(o) + u if (30 < _) { var w = u - (u % 5) - ;(_ = (a & ((1 << w) - 1)).toString(32)), + ;((_ = (a & ((1 << w) - 1)).toString(32)), (a >>= w), (u -= w), (Mn = (1 << (32 - Et(o) + u)) | (i << u) | a), - (Rn = _ + s) - } else (Mn = (1 << _) | (i << u) | a), (Rn = s) + (Rn = _ + s)) + } else ((Mn = (1 << _) | (i << u) | a), (Rn = s)) } function vg(s) { null !== s.return && (tg(s, 1), ug(s, 1, 0)) } function wg(s) { - for (; s === jn; ) (jn = An[--Cn]), (An[Cn] = null), (Pn = An[--Cn]), (An[Cn] = null) + for (; s === jn; ) ((jn = An[--Cn]), (An[Cn] = null), (Pn = An[--Cn]), (An[Cn] = null)) for (; s === Nn; ) - (Nn = In[--Tn]), + ((Nn = In[--Tn]), (In[Tn] = null), (Rn = In[--Tn]), (In[Tn] = null), (Mn = In[--Tn]), - (In[Tn] = null) + (In[Tn] = null)) } var Dn = null, Ln = null, @@ -10899,10 +10911,10 @@ Bn = null function Ag(s, o) { var i = Bg(5, null, null, 0) - ;(i.elementType = 'DELETED'), + ;((i.elementType = 'DELETED'), (i.stateNode = o), (i.return = s), - null === (o = s.deletions) ? ((s.deletions = [i]), (s.flags |= 16)) : o.push(i) + null === (o = s.deletions) ? ((s.deletions = [i]), (s.flags |= 16)) : o.push(i)) } function Cg(s, o) { switch (s.tag) { @@ -10954,7 +10966,7 @@ } } else { if (Dg(s)) throw Error(p(418)) - ;(s.flags = (-4097 & s.flags) | 2), (Fn = !1), (Dn = s) + ;((s.flags = (-4097 & s.flags) | 2), (Fn = !1), (Dn = s)) } } } @@ -10965,7 +10977,7 @@ } function Gg(s) { if (s !== Dn) return !1 - if (!Fn) return Fg(s), (Fn = !0), !1 + if (!Fn) return (Fg(s), (Fn = !0), !1) var o if ( ((o = 3 !== s.tag) && @@ -10974,7 +10986,7 @@ o && (o = Ln)) ) { if (Dg(s)) throw (Hg(), Error(p(418))) - for (; o; ) Ag(s, o), (o = Lf(o.nextSibling)) + for (; o; ) (Ag(s, o), (o = Lf(o.nextSibling))) } if ((Fg(s), 13 === s.tag)) { if (!(s = null !== (s = s.memoizedState) ? s.dehydrated : null)) throw Error(p(317)) @@ -11001,7 +11013,7 @@ for (var s = Ln; s; ) s = Lf(s.nextSibling) } function Ig() { - ;(Ln = Dn = null), (Fn = !1) + ;((Ln = Dn = null), (Fn = !1)) } function Jg(s) { null === Bn ? (Bn = [s]) : Bn.push(s) @@ -11036,7 +11048,7 @@ } function Mg(s, o) { throw ( - ((s = Object.prototype.toString.call(o)), + (s = Object.prototype.toString.call(o)), Error( p( 31, @@ -11044,7 +11056,7 @@ ? 'object with keys {' + Object.keys(o).join(', ') + '}' : s ) - )) + ) ) } function Ng(s) { @@ -11059,16 +11071,16 @@ } function c(o, i) { if (!s) return null - for (; null !== i; ) b(o, i), (i = i.sibling) + for (; null !== i; ) (b(o, i), (i = i.sibling)) return null } function d(s, o) { for (s = new Map(); null !== o; ) - null !== o.key ? s.set(o.key, o) : s.set(o.index, o), (o = o.sibling) + (null !== o.key ? s.set(o.key, o) : s.set(o.index, o), (o = o.sibling)) return s } function e(s, o) { - return ((s = Pg(s, o)).index = 0), (s.sibling = null), s + return (((s = Pg(s, o)).index = 0), (s.sibling = null), s) } function f(o, i, a) { return ( @@ -11083,7 +11095,7 @@ ) } function g(o) { - return s && null === o.alternate && (o.flags |= 2), o + return (s && null === o.alternate && (o.flags |= 2), o) } function h(s, o, i, a) { return null === o || 6 !== o.tag @@ -11117,7 +11129,7 @@ } function q(s, o, i) { if (('string' == typeof o && '' !== o) || 'number' == typeof o) - return ((o = Qg('' + o, s.mode, i)).return = s), o + return (((o = Qg('' + o, s.mode, i)).return = s), o) if ('object' == typeof o && null !== o) { switch (o.$$typeof) { case z: @@ -11127,11 +11139,11 @@ i ) case Y: - return ((o = Sg(o, s.mode, i)).return = s), o + return (((o = Sg(o, s.mode, i)).return = s), o) case ye: return q(s, (0, o._init)(o._payload), i) } - if (Pe(o) || Ka(o)) return ((o = Tg(o, s.mode, i, null)).return = s), o + if (Pe(o) || Ka(o)) return (((o = Tg(o, s.mode, i, null)).return = s), o) Mg(s, o) } return null @@ -11183,18 +11195,18 @@ null === x && (x = j) break } - s && x && null === L.alternate && b(o, x), + ;(s && x && null === L.alternate && b(o, x), (i = f(L, i, C)), null === w ? (_ = L) : (w.sibling = L), (w = L), - (x = j) + (x = j)) } - if (C === a.length) return c(o, x), Fn && tg(o, C), _ + if (C === a.length) return (c(o, x), Fn && tg(o, C), _) if (null === x) { for (; C < a.length; C++) null !== (x = q(o, a[C], u)) && ((i = f(x, i, C)), null === w ? (_ = x) : (w.sibling = x), (w = x)) - return Fn && tg(o, C), _ + return (Fn && tg(o, C), _) } for (x = d(o, x); C < a.length; C++) null !== (j = y(x, o, C, a[C], u)) && @@ -11226,18 +11238,18 @@ null === x && (x = j) break } - s && x && null === B.alternate && b(o, x), + ;(s && x && null === B.alternate && b(o, x), (i = f(B, i, C)), null === w ? (_ = B) : (w.sibling = B), (w = B), - (x = j) + (x = j)) } - if (L.done) return c(o, x), Fn && tg(o, C), _ + if (L.done) return (c(o, x), Fn && tg(o, C), _) if (null === x) { for (; !L.done; C++, L = a.next()) null !== (L = q(o, L.value, u)) && ((i = f(L, i, C)), null === w ? (_ = L) : (w.sibling = L), (w = L)) - return Fn && tg(o, C), _ + return (Fn && tg(o, C), _) } for (x = d(o, x); !L.done; C++, L = a.next()) null !== (L = y(x, o, C, L.value, u)) && @@ -11270,7 +11282,7 @@ if (_.key === u) { if ((u = i.type) === Z) { if (7 === _.tag) { - c(s, _.sibling), ((o = e(_, i.props.children)).return = s), (s = o) + ;(c(s, _.sibling), ((o = e(_, i.props.children)).return = s), (s = o)) break e } } else if ( @@ -11280,16 +11292,16 @@ u.$$typeof === ye && Ng(u) === _.type) ) { - c(s, _.sibling), + ;(c(s, _.sibling), ((o = e(_, i.props)).ref = Lg(s, _, i)), (o.return = s), - (s = o) + (s = o)) break e } c(s, _) break } - b(s, _), (_ = _.sibling) + ;(b(s, _), (_ = _.sibling)) } i.type === Z ? (((o = Tg(i.props.children, s.mode, a, i.key)).return = s), (s = o)) @@ -11307,15 +11319,15 @@ o.stateNode.containerInfo === i.containerInfo && o.stateNode.implementation === i.implementation ) { - c(s, o.sibling), ((o = e(o, i.children || [])).return = s), (s = o) + ;(c(s, o.sibling), ((o = e(o, i.children || [])).return = s), (s = o)) break e } c(s, o) break } - b(s, o), (o = o.sibling) + ;(b(s, o), (o = o.sibling)) } - ;((o = Sg(i, s.mode, a)).return = s), (s = o) + ;(((o = Sg(i, s.mode, a)).return = s), (s = o)) } return g(s) case ye: @@ -11345,7 +11357,7 @@ } function ah(s) { var o = Vn.current - E(Vn), (s._currentValue = o) + ;(E(Vn), (s._currentValue = o)) } function bh(s, o, i) { for (; null !== s; ) { @@ -11361,18 +11373,18 @@ } } function ch(s, o) { - ;(zn = s), + ;((zn = s), (Jn = Wn = null), null !== (s = s.dependencies) && null !== s.firstContext && - (!!(s.lanes & o) && (bs = !0), (s.firstContext = null)) + (!!(s.lanes & o) && (bs = !0), (s.firstContext = null))) } function eh(s) { var o = s._currentValue if (Jn !== s) if (((s = { context: s, memoizedValue: o, next: null }), null === Wn)) { if (null === zn) throw Error(p(308)) - ;(Wn = s), (zn.dependencies = { lanes: 0, firstContext: s }) + ;((Wn = s), (zn.dependencies = { lanes: 0, firstContext: s })) } else Wn = Wn.next = s return o } @@ -11392,10 +11404,10 @@ s.lanes |= o var i = s.alternate for (null !== i && (i.lanes |= o), i = s, s = s.return; null !== s; ) - (s.childLanes |= o), + ((s.childLanes |= o), null !== (i = s.alternate) && (i.childLanes |= o), (i = s), - (s = s.return) + (s = s.return)) return 3 === i.tag ? i.stateNode : null } var Kn = !1 @@ -11409,7 +11421,7 @@ } } function lh(s, o) { - ;(s = s.updateQueue), + ;((s = s.updateQueue), o.updateQueue === s && (o.updateQueue = { baseState: s.baseState, @@ -11417,7 +11429,7 @@ lastBaseUpdate: s.lastBaseUpdate, shared: s.shared, effects: s.effects, - }) + })) } function mh(s, o) { return { eventTime: s, lane: o, tag: 0, payload: null, callback: null, next: null } @@ -11444,7 +11456,7 @@ function oh(s, o, i) { if (null !== (o = o.updateQueue) && ((o = o.shared), 4194240 & i)) { var a = o.lanes - ;(i |= a &= s.pendingLanes), (o.lanes = i), Cc(s, i) + ;((i |= a &= s.pendingLanes), (o.lanes = i), Cc(s, i)) } } function ph(s, o) { @@ -11463,7 +11475,7 @@ callback: i.callback, next: null, } - null === _ ? (u = _ = w) : (_ = _.next = w), (i = i.next) + ;(null === _ ? (u = _ = w) : (_ = _.next = w), (i = i.next)) } while (null !== i) null === _ ? (u = _ = o) : (_ = _.next = o) } else u = _ = o @@ -11478,8 +11490,8 @@ void (s.updateQueue = i) ) } - null === (s = i.lastBaseUpdate) ? (i.firstBaseUpdate = o) : (s.next = o), - (i.lastBaseUpdate = o) + ;(null === (s = i.lastBaseUpdate) ? (i.firstBaseUpdate = o) : (s.next = o), + (i.lastBaseUpdate = o)) } function qh(s, o, i, a) { var u = s.updateQueue @@ -11491,7 +11503,7 @@ u.shared.pending = null var C = x, j = C.next - ;(C.next = null), null === w ? (_ = j) : (w.next = j), (w = C) + ;((C.next = null), null === w ? (_ = j) : (w.next = j), (w = C)) var L = s.alternate null !== L && (x = (L = L.updateQueue).lastBaseUpdate) !== w && @@ -11541,7 +11553,7 @@ 0 !== x.lane && ((s.flags |= 64), null === ($ = u.effects) ? (u.effects = [x]) : $.push(x)) } else - (U = { + ((U = { eventTime: U, lane: $, tag: x.tag, @@ -11550,13 +11562,13 @@ next: null, }), null === L ? ((j = L = U), (C = B)) : (L = L.next = U), - (w |= $) + (w |= $)) if (null === (x = x.next)) { if (null === (x = u.shared.pending)) break - ;(x = ($ = x).next), + ;((x = ($ = x).next), ($.next = null), (u.lastBaseUpdate = $), - (u.shared.pending = null) + (u.shared.pending = null)) } } if ( @@ -11568,10 +11580,10 @@ ) { u = o do { - ;(w |= u.lane), (u = u.next) + ;((w |= u.lane), (u = u.next)) } while (u !== o) } else null === _ && (u.shared.lanes = 0) - ;(Ws |= w), (s.lanes = w), (s.memoizedState = B) + ;((Ws |= w), (s.lanes = w), (s.memoizedState = B)) } } function sh(s, o, i) { @@ -11602,10 +11614,10 @@ default: o = lb((o = (s = 8 === s ? o.parentNode : o).namespaceURI || null), (s = s.tagName)) } - E(Yn), G(Yn, o) + ;(E(Yn), G(Yn, o)) } function zh() { - E(Yn), E(Xn), E(Qn) + ;(E(Yn), E(Xn), E(Qn)) } function Ah(s) { xh(Qn.current) @@ -11629,7 +11641,7 @@ } else if (19 === o.tag && void 0 !== o.memoizedProps.revealOrder) { if (128 & o.flags) return o } else if (null !== o.child) { - ;(o.child.return = o), (o = o.child) + ;((o.child.return = o), (o = o.child)) continue } if (o === s) break @@ -11637,7 +11649,7 @@ if (null === o.return || o.return === s) return null o = o.return } - ;(o.sibling.return = o.return), (o = o.sibling) + ;((o.sibling.return = o.return), (o = o.sibling)) } return null } @@ -11678,11 +11690,11 @@ _ = 0 do { if (((ls = !1), (us = 0), 25 <= _)) throw Error(p(301)) - ;(_ += 1), + ;((_ += 1), (as = os = null), (o.updateQueue = null), (ts.current = ms), - (s = i(a, u)) + (s = i(a, u))) } while (ls) } if ( @@ -11698,7 +11710,7 @@ } function Sh() { var s = 0 !== us - return (us = 0), s + return ((us = 0), s) } function Th() { var s = { @@ -11708,7 +11720,7 @@ queue: null, next: null, } - return null === as ? (ss.memoizedState = as = s) : (as = as.next = s), as + return (null === as ? (ss.memoizedState = as = s) : (as = as.next = s), as) } function Uh() { if (null === os) { @@ -11716,17 +11728,17 @@ s = null !== s ? s.memoizedState : null } else s = os.next var o = null === as ? ss.memoizedState : as.next - if (null !== o) (as = o), (os = s) + if (null !== o) ((as = o), (os = s)) else { if (null === s) throw Error(p(310)) - ;(s = { + ;((s = { memoizedState: (os = s).memoizedState, baseState: os.baseState, baseQueue: os.baseQueue, queue: os.queue, next: null, }), - null === as ? (ss.memoizedState = as = s) : (as = as.next = s) + null === as ? (ss.memoizedState = as = s) : (as = as.next = s)) } return as } @@ -11744,19 +11756,19 @@ if (null !== _) { if (null !== u) { var w = u.next - ;(u.next = _.next), (_.next = w) + ;((u.next = _.next), (_.next = w)) } - ;(a.baseQueue = u = _), (i.pending = null) + ;((a.baseQueue = u = _), (i.pending = null)) } if (null !== u) { - ;(_ = u.next), (a = a.baseState) + ;((_ = u.next), (a = a.baseState)) var x = (w = null), C = null, j = _ do { var L = j.lane if ((ns & L) === L) - null !== C && + (null !== C && (C = C.next = { lane: 0, @@ -11765,7 +11777,7 @@ eagerState: j.eagerState, next: null, }), - (a = j.hasEagerState ? j.eagerState : s(a, j.action)) + (a = j.hasEagerState ? j.eagerState : s(a, j.action))) else { var B = { lane: L, @@ -11774,21 +11786,23 @@ eagerState: j.eagerState, next: null, } - null === C ? ((x = C = B), (w = a)) : (C = C.next = B), (ss.lanes |= L), (Ws |= L) + ;(null === C ? ((x = C = B), (w = a)) : (C = C.next = B), + (ss.lanes |= L), + (Ws |= L)) } j = j.next } while (null !== j && j !== _) - null === C ? (w = a) : (C.next = x), + ;(null === C ? (w = a) : (C.next = x), Dr(a, o.memoizedState) || (bs = !0), (o.memoizedState = a), (o.baseState = w), (o.baseQueue = C), - (i.lastRenderedState = a) + (i.lastRenderedState = a)) } if (null !== (s = i.interleaved)) { u = s do { - ;(_ = u.lane), (ss.lanes |= _), (Ws |= _), (u = u.next) + ;((_ = u.lane), (ss.lanes |= _), (Ws |= _), (u = u.next)) } while (u !== s) } else null === u && (i.lanes = 0) return [o.memoizedState, i.dispatch] @@ -11805,12 +11819,12 @@ i.pending = null var w = (u = u.next) do { - ;(_ = s(_, w.action)), (w = w.next) + ;((_ = s(_, w.action)), (w = w.next)) } while (w !== u) - Dr(_, o.memoizedState) || (bs = !0), + ;(Dr(_, o.memoizedState) || (bs = !0), (o.memoizedState = _), null === o.baseQueue && (o.baseState = _), - (i.lastRenderedState = _) + (i.lastRenderedState = _)) } return [_, a] } @@ -11833,16 +11847,16 @@ return u } function di(s, o, i) { - ;(s.flags |= 16384), + ;((s.flags |= 16384), (s = { getSnapshot: o, value: i }), null === (o = ss.updateQueue) ? ((o = { lastEffect: null, stores: null }), (ss.updateQueue = o), (o.stores = [s])) : null === (i = o.stores) ? (o.stores = [s]) - : i.push(s) + : i.push(s)) } function ci(s, o, i, a) { - ;(o.value = i), (o.getSnapshot = a), ei(o) && fi(s) + ;((o.value = i), (o.getSnapshot = a), ei(o) && fi(s)) } function ai(s, o, i) { return i(function () { @@ -11899,7 +11913,7 @@ } function ki(s, o, i, a) { var u = Th() - ;(ss.flags |= s), (u.memoizedState = bi(1 | o, i, void 0, void 0 === a ? null : a)) + ;((ss.flags |= s), (u.memoizedState = bi(1 | o, i, void 0, void 0 === a ? null : a))) } function li(s, o, i, a) { var u = Uh() @@ -11910,7 +11924,7 @@ if (((_ = w.destroy), null !== a && Mh(a, w.deps))) return void (u.memoizedState = bi(o, i, _, a)) } - ;(ss.flags |= s), (u.memoizedState = bi(1 | o, i, _, a)) + ;((ss.flags |= s), (u.memoizedState = bi(1 | o, i, _, a))) } function mi(s, o) { return ki(8390656, 8, s, o) @@ -11940,7 +11954,7 @@ : void 0 } function qi(s, o, i) { - return (i = null != i ? i.concat([s]) : null), li(4, 4, pi.bind(null, o, s), i) + return ((i = null != i ? i.concat([s]) : null), li(4, 4, pi.bind(null, o, s), i)) } function ri() {} function si(s, o) { @@ -11964,13 +11978,13 @@ } function vi(s, o) { var i = At - ;(At = 0 !== i && 4 > i ? i : 4), s(!0) + ;((At = 0 !== i && 4 > i ? i : 4), s(!0)) var a = rs.transition rs.transition = {} try { - s(!1), o() + ;(s(!1), o()) } finally { - ;(At = i), (rs.transition = a) + ;((At = i), (rs.transition = a)) } } function wi() { @@ -11983,7 +11997,7 @@ ) Ai(o, i) else if (null !== (i = hh(s, o, i, a))) { - gi(i, s, a, R()), Bi(i, o, a) + ;(gi(i, s, a, R()), Bi(i, o, a)) } } function ii(s, o, i) { @@ -12018,12 +12032,12 @@ function Ai(s, o) { ls = cs = !0 var i = s.pending - null === i ? (o.next = o) : ((o.next = i.next), (i.next = o)), (s.pending = o) + ;(null === i ? (o.next = o) : ((o.next = i.next), (i.next = o)), (s.pending = o)) } function Bi(s, o, i) { if (4194240 & i) { var a = o.lanes - ;(i |= a &= s.pendingLanes), (o.lanes = i), Cc(s, i) + ;((i |= a &= s.pendingLanes), (o.lanes = i), Cc(s, i)) } } var hs = { @@ -12049,13 +12063,14 @@ ds = { readContext: eh, useCallback: function (s, o) { - return (Th().memoizedState = [s, void 0 === o ? null : o]), s + return ((Th().memoizedState = [s, void 0 === o ? null : o]), s) }, useContext: eh, useEffect: mi, useImperativeHandle: function (s, o, i) { return ( - (i = null != i ? i.concat([s]) : null), ki(4194308, 4, pi.bind(null, o, s), i) + (i = null != i ? i.concat([s]) : null), + ki(4194308, 4, pi.bind(null, o, s), i) ) }, useLayoutEffect: function (s, o) { @@ -12066,7 +12081,7 @@ }, useMemo: function (s, o) { var i = Th() - return (o = void 0 === o ? null : o), (s = s()), (i.memoizedState = [s, o]), s + return ((o = void 0 === o ? null : o), (s = s()), (i.memoizedState = [s, o]), s) }, useReducer: function (s, o, i) { var a = Th() @@ -12087,7 +12102,7 @@ ) }, useRef: function (s) { - return (s = { current: s }), (Th().memoizedState = s) + return ((s = { current: s }), (Th().memoizedState = s)) }, useState: hi, useDebugValue: ri, @@ -12097,7 +12112,7 @@ useTransition: function () { var s = hi(!1), o = s[0] - return (s = vi.bind(null, s[1])), (Th().memoizedState = s), [o, s] + return ((s = vi.bind(null, s[1])), (Th().memoizedState = s), [o, s]) }, useMutableSource: function () {}, useSyncExternalStore: function (s, o, i) { @@ -12125,9 +12140,9 @@ o = Fs.identifierPrefix if (Fn) { var i = Rn - ;(o = ':' + o + 'R' + (i = (Mn & ~(1 << (32 - Et(Mn) - 1))).toString(32) + i)), + ;((o = ':' + o + 'R' + (i = (Mn & ~(1 << (32 - Et(Mn) - 1))).toString(32) + i)), 0 < (i = us++) && (o += 'H' + i.toString(32)), - (o += ':') + (o += ':')) } else o = ':' + o + 'r' + (i = ps++).toString(32) + ':' return (s.memoizedState = o) }, @@ -12195,9 +12210,9 @@ return o } function Di(s, o, i, a) { - ;(i = null == (i = i(a, (o = s.memoizedState))) ? o : we({}, o, i)), + ;((i = null == (i = i(a, (o = s.memoizedState))) ? o : we({}, o, i)), (s.memoizedState = i), - 0 === s.lanes && (s.updateQueue.baseState = i) + 0 === s.lanes && (s.updateQueue.baseState = i)) } var gs = { isMounted: function (s) { @@ -12208,28 +12223,28 @@ var a = R(), u = yi(s), _ = mh(a, u) - ;(_.payload = o), + ;((_.payload = o), null != i && (_.callback = i), - null !== (o = nh(s, _, u)) && (gi(o, s, u, a), oh(o, s, u)) + null !== (o = nh(s, _, u)) && (gi(o, s, u, a), oh(o, s, u))) }, enqueueReplaceState: function (s, o, i) { s = s._reactInternals var a = R(), u = yi(s), _ = mh(a, u) - ;(_.tag = 1), + ;((_.tag = 1), (_.payload = o), null != i && (_.callback = i), - null !== (o = nh(s, _, u)) && (gi(o, s, u, a), oh(o, s, u)) + null !== (o = nh(s, _, u)) && (gi(o, s, u, a), oh(o, s, u))) }, enqueueForceUpdate: function (s, o) { s = s._reactInternals var i = R(), a = yi(s), u = mh(i, a) - ;(u.tag = 2), + ;((u.tag = 2), null != o && (u.callback = o), - null !== (o = nh(s, u, a)) && (gi(o, s, a, i), oh(o, s, a)) + null !== (o = nh(s, u, a)) && (gi(o, s, a, i), oh(o, s, a))) }, } function Fi(s, o, i, a, u, _, w) { @@ -12258,17 +12273,17 @@ ) } function Hi(s, o, i, a) { - ;(s = o.state), + ;((s = o.state), 'function' == typeof o.componentWillReceiveProps && o.componentWillReceiveProps(i, a), 'function' == typeof o.UNSAFE_componentWillReceiveProps && o.UNSAFE_componentWillReceiveProps(i, a), - o.state !== s && gs.enqueueReplaceState(o, o.state, null) + o.state !== s && gs.enqueueReplaceState(o, o.state, null)) } function Ii(s, o, i, a) { var u = s.stateNode - ;(u.props = i), (u.state = s.memoizedState), (u.refs = {}), kh(s) + ;((u.props = i), (u.state = s.memoizedState), (u.refs = {}), kh(s)) var _ = o.contextType - 'object' == typeof _ && null !== _ + ;('object' == typeof _ && null !== _ ? (u.context = eh(_)) : ((_ = Zf(o) ? wn : Sn.current), (u.context = Yf(s, _))), (u.state = s.memoizedState), @@ -12284,14 +12299,14 @@ o !== u.state && gs.enqueueReplaceState(u, u.state, null), qh(s, i, u, a), (u.state = s.memoizedState)), - 'function' == typeof u.componentDidMount && (s.flags |= 4194308) + 'function' == typeof u.componentDidMount && (s.flags |= 4194308)) } function Ji(s, o) { try { var i = '', a = o do { - ;(i += Pa(a)), (a = a.return) + ;((i += Pa(a)), (a = a.return)) } while (a) var u = i } catch (s) { @@ -12318,11 +12333,11 @@ } var ys = 'function' == typeof WeakMap ? WeakMap : Map function Ni(s, o, i) { - ;((i = mh(-1, i)).tag = 3), (i.payload = { element: null }) + ;(((i = mh(-1, i)).tag = 3), (i.payload = { element: null })) var a = o.value return ( (i.callback = function () { - Zs || ((Zs = !0), (eo = a)), Li(0, o) + ;(Zs || ((Zs = !0), (eo = a)), Li(0, o)) }), i ) @@ -12332,20 +12347,20 @@ var a = s.type.getDerivedStateFromError if ('function' == typeof a) { var u = o.value - ;(i.payload = function () { + ;((i.payload = function () { return a(u) }), (i.callback = function () { Li(0, o) - }) + })) } var _ = s.stateNode return ( null !== _ && 'function' == typeof _.componentDidCatch && (i.callback = function () { - Li(0, o), - 'function' != typeof a && (null === to ? (to = new Set([this])) : to.add(this)) + ;(Li(0, o), + 'function' != typeof a && (null === to ? (to = new Set([this])) : to.add(this))) var s = o.stack this.componentDidCatch(o.value, { componentStack: null !== s ? s : '' }) }), @@ -12427,14 +12442,14 @@ if ((i = null !== (i = i.compare) ? i : Ie)(w, a) && s.ref === o.ref) return Zi(s, o, u) } - return (o.flags |= 1), ((s = Pg(_, a)).ref = o.ref), (s.return = o), (o.child = s) + return ((o.flags |= 1), ((s = Pg(_, a)).ref = o.ref), (s.return = o), (o.child = s)) } function bj(s, o, i, a, u) { if (null !== s) { var _ = s.memoizedProps if (Ie(_, a) && s.ref === o.ref) { if (((bs = !1), (o.pendingProps = a = _), !(s.lanes & u))) - return (o.lanes = s.lanes), Zi(s, o, u) + return ((o.lanes = s.lanes), Zi(s, o, u)) 131072 & s.flags && (bs = !0) } } @@ -12456,19 +12471,19 @@ (qs |= s), null ) - ;(o.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }), + ;((o.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }), (a = null !== _ ? _.baseLanes : i), G(Us, qs), - (qs |= a) + (qs |= a)) } else - (o.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }), + ((o.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }), G(Us, qs), - (qs |= i) + (qs |= i)) else - null !== _ ? ((a = _.baseLanes | i), (o.memoizedState = null)) : (a = i), + (null !== _ ? ((a = _.baseLanes | i), (o.memoizedState = null)) : (a = i), G(Us, qs), - (qs |= a) - return Xi(s, o, u, i), o.child + (qs |= a)) + return (Xi(s, o, u, i), o.child) } function gj(s, o) { var i = o.ref @@ -12495,7 +12510,7 @@ var _ = !0 cg(o) } else _ = !1 - if ((ch(o, u), null === o.stateNode)) ij(s, o), Gi(o, i, a), Ii(o, i, a, u), (a = !0) + if ((ch(o, u), null === o.stateNode)) (ij(s, o), Gi(o, i, a), Ii(o, i, a, u), (a = !0)) else if (null === s) { var w = o.stateNode, x = o.memoizedProps @@ -12507,13 +12522,13 @@ : (j = Yf(o, (j = Zf(i) ? wn : Sn.current))) var L = i.getDerivedStateFromProps, B = 'function' == typeof L || 'function' == typeof w.getSnapshotBeforeUpdate - B || + ;(B || ('function' != typeof w.UNSAFE_componentWillReceiveProps && 'function' != typeof w.componentWillReceiveProps) || ((x !== a || C !== j) && Hi(o, w, a, j)), - (Kn = !1) + (Kn = !1)) var $ = o.memoizedState - ;(w.state = $), + ;((w.state = $), qh(o, a, w, u), (C = o.memoizedState), x !== a || $ !== C || En.current || Kn @@ -12533,9 +12548,9 @@ (w.state = C), (w.context = j), (a = x)) - : ('function' == typeof w.componentDidMount && (o.flags |= 4194308), (a = !1)) + : ('function' == typeof w.componentDidMount && (o.flags |= 4194308), (a = !1))) } else { - ;(w = o.stateNode), + ;((w = o.stateNode), lh(s, o), (x = o.memoizedProps), (j = o.type === o.elementType ? x : Ci(o.type, x)), @@ -12544,16 +12559,16 @@ ($ = w.context), 'object' == typeof (C = i.contextType) && null !== C ? (C = eh(C)) - : (C = Yf(o, (C = Zf(i) ? wn : Sn.current))) + : (C = Yf(o, (C = Zf(i) ? wn : Sn.current)))) var U = i.getDerivedStateFromProps - ;(L = 'function' == typeof U || 'function' == typeof w.getSnapshotBeforeUpdate) || + ;((L = 'function' == typeof U || 'function' == typeof w.getSnapshotBeforeUpdate) || ('function' != typeof w.UNSAFE_componentWillReceiveProps && 'function' != typeof w.componentWillReceiveProps) || ((x !== B || $ !== C) && Hi(o, w, a, C)), (Kn = !1), ($ = o.memoizedState), (w.state = $), - qh(o, a, w, u) + qh(o, a, w, u)) var V = o.memoizedState x !== B || $ !== V || En.current || Kn ? ('function' == typeof U && (Di(o, i, U, a), (V = o.memoizedState)), @@ -12592,8 +12607,8 @@ function jj(s, o, i, a, u, _) { gj(s, o) var w = !!(128 & o.flags) - if (!a && !w) return u && dg(o, i, !1), Zi(s, o, _) - ;(a = o.stateNode), (vs.current = o) + if (!a && !w) return (u && dg(o, i, !1), Zi(s, o, _)) + ;((a = o.stateNode), (vs.current = o)) var x = w && 'function' != typeof i.getDerivedStateFromError ? null : a.render() return ( (o.flags |= 1), @@ -12607,13 +12622,13 @@ } function kj(s) { var o = s.stateNode - o.pendingContext + ;(o.pendingContext ? ag(0, o.pendingContext, o.pendingContext !== o.context) : o.context && ag(0, o.context, !1), - yh(s, o.containerInfo) + yh(s, o.containerInfo)) } function lj(s, o, i, a, u) { - return Ig(), Jg(u), (o.flags |= 256), Xi(s, o, i, a), o.child + return (Ig(), Jg(u), (o.flags |= 256), Xi(s, o, i, a), o.child) } var _s, Ss, @@ -12687,7 +12702,7 @@ if (!(1 & o.mode)) return sj(s, o, w, null) if ('$!' === u.data) { if ((a = u.nextSibling && u.nextSibling.dataset)) var x = a.dgst - return (a = x), sj(s, o, w, (a = Ki((_ = Error(p(419))), a, void 0))) + return ((a = x), sj(s, o, w, (a = Ki((_ = Error(p(419))), a, void 0)))) } if (((x = !!(w & s.childLanes)), bs || x)) { if (null !== (a = Fs)) { @@ -12731,7 +12746,7 @@ u !== _.retryLane && ((_.retryLane = u), ih(s, u), gi(a, s, u, -1)) } - return tj(), sj(s, o, w, (a = Ki(Error(p(421))))) + return (tj(), sj(s, o, w, (a = Ki(Error(p(421)))))) } return '$?' === u.data ? ((o.flags |= 128), @@ -12756,7 +12771,7 @@ o) })(s, o, x, u, a, _, i) if (w) { - ;(w = u.fallback), (x = o.mode), (a = (_ = s.child).sibling) + ;((w = u.fallback), (x = o.mode), (a = (_ = s.child).sibling)) var C = { mode: 'hidden', children: u.children } return ( 1 & x || o.child === _ @@ -12810,7 +12825,7 @@ function vj(s, o, i) { s.lanes |= o var a = s.alternate - null !== a && (a.lanes |= o), bh(s.return, o, i) + ;(null !== a && (a.lanes |= o), bh(s.return, o, i)) } function wj(s, o, i, a, u) { var _ = s.memoizedState @@ -12834,14 +12849,15 @@ var a = o.pendingProps, u = a.revealOrder, _ = a.tail - if ((Xi(s, o, a.children, i), 2 & (a = Zn.current))) (a = (1 & a) | 2), (o.flags |= 128) + if ((Xi(s, o, a.children, i), 2 & (a = Zn.current))) + ((a = (1 & a) | 2), (o.flags |= 128)) else { if (null !== s && 128 & s.flags) e: for (s = o.child; null !== s; ) { if (13 === s.tag) null !== s.memoizedState && vj(s, i, o) else if (19 === s.tag) vj(s, i, o) else if (null !== s.child) { - ;(s.child.return = s), (s = s.child) + ;((s.child.return = s), (s = s.child)) continue } if (s === o) break e @@ -12849,7 +12865,7 @@ if (null === s.return || s.return === o) break e s = s.return } - ;(s.sibling.return = s.return), (s = s.sibling) + ;((s.sibling.return = s.return), (s = s.sibling)) } a &= 1 } @@ -12857,11 +12873,11 @@ switch (u) { case 'forwards': for (i = o.child, u = null; null !== i; ) - null !== (s = i.alternate) && null === Ch(s) && (u = i), (i = i.sibling) - null === (i = u) + (null !== (s = i.alternate) && null === Ch(s) && (u = i), (i = i.sibling)) + ;(null === (i = u) ? ((u = o.child), (o.child = null)) : ((u = i.sibling), (i.sibling = null)), - wj(o, !1, u, i, _) + wj(o, !1, u, i, _)) break case 'backwards': for (i = null, u = o.child, o.child = null; null !== u; ) { @@ -12869,7 +12885,7 @@ o.child = u break } - ;(s = u.sibling), (u.sibling = i), (i = u), (u = s) + ;((s = u.sibling), (u.sibling = i), (i = u), (u = s)) } wj(o, !0, i, null, _) break @@ -12899,9 +12915,8 @@ for ( i = Pg((s = o.child), s.pendingProps), o.child = i, i.return = o; null !== s.sibling; - ) - (s = s.sibling), ((i = i.sibling = Pg(s, s.pendingProps)).return = o) + ((s = s.sibling), ((i = i.sibling = Pg(s, s.pendingProps)).return = o)) i.sibling = null } return o.child @@ -12911,12 +12926,14 @@ switch (s.tailMode) { case 'hidden': o = s.tail - for (var i = null; null !== o; ) null !== o.alternate && (i = o), (o = o.sibling) + for (var i = null; null !== o; ) + (null !== o.alternate && (i = o), (o = o.sibling)) null === i ? (s.tail = null) : (i.sibling = null) break case 'collapsed': i = s.tail - for (var a = null; null !== i; ) null !== i.alternate && (a = i), (i = i.sibling) + for (var a = null; null !== i; ) + (null !== i.alternate && (a = i), (i = i.sibling)) null === a ? o || null === s.tail ? (s.tail = null) @@ -12930,19 +12947,19 @@ a = 0 if (o) for (var u = s.child; null !== u; ) - (i |= u.lanes | u.childLanes), + ((i |= u.lanes | u.childLanes), (a |= 14680064 & u.subtreeFlags), (a |= 14680064 & u.flags), (u.return = s), - (u = u.sibling) + (u = u.sibling)) else for (u = s.child; null !== u; ) - (i |= u.lanes | u.childLanes), + ((i |= u.lanes | u.childLanes), (a |= u.subtreeFlags), (a |= u.flags), (u.return = s), - (u = u.sibling) - return (s.subtreeFlags |= a), (s.childLanes = i), o + (u = u.sibling)) + return ((s.subtreeFlags |= a), (s.childLanes = i), o) } function Ej(s, o, i) { var a = o.pendingProps @@ -12957,10 +12974,10 @@ case 12: case 9: case 14: - return S(o), null + return (S(o), null) case 1: case 17: - return Zf(o.type) && $f(), S(o), null + return (Zf(o.type) && $f(), S(o), null) case 3: return ( (a = o.stateNode), @@ -12983,18 +13000,18 @@ Bh(o) var u = xh(Qn.current) if (((i = o.type), null !== s && null != o.stateNode)) - Es(s, o, i, a, u), s.ref !== o.ref && ((o.flags |= 512), (o.flags |= 2097152)) + (Es(s, o, i, a, u), s.ref !== o.ref && ((o.flags |= 512), (o.flags |= 2097152))) else { if (!a) { if (null === o.stateNode) throw Error(p(166)) - return S(o), null + return (S(o), null) } if (((s = xh(Yn.current)), Gg(o))) { - ;(a = o.stateNode), (i = o.type) + ;((a = o.stateNode), (i = o.type)) var _ = o.memoizedProps switch (((a[hn] = o), (a[dn] = _), (s = !!(1 & o.mode)), i)) { case 'dialog': - D('cancel', a), D('close', a) + ;(D('cancel', a), D('close', a)) break case 'iframe': case 'object': @@ -13011,19 +13028,19 @@ case 'img': case 'image': case 'link': - D('error', a), D('load', a) + ;(D('error', a), D('load', a)) break case 'details': D('toggle', a) break case 'input': - Za(a, _), D('invalid', a) + ;(Za(a, _), D('invalid', a)) break case 'select': - ;(a._wrapperState = { wasMultiple: !!_.multiple }), D('invalid', a) + ;((a._wrapperState = { wasMultiple: !!_.multiple }), D('invalid', a)) break case 'textarea': - hb(a, _), D('invalid', a) + ;(hb(a, _), D('invalid', a)) } for (var x in (ub(i, _), (u = null), _)) if (_.hasOwnProperty(x)) { @@ -13041,10 +13058,10 @@ } switch (i) { case 'input': - Va(a), db(a, _, !0) + ;(Va(a), db(a, _, !0)) break case 'textarea': - Va(a), jb(a) + ;(Va(a), jb(a)) break case 'select': case 'option': @@ -13052,9 +13069,9 @@ default: 'function' == typeof _.onClick && (a.onclick = Bf) } - ;(a = u), (o.updateQueue = a), null !== a && (o.flags |= 4) + ;((a = u), (o.updateQueue = a), null !== a && (o.flags |= 4)) } else { - ;(x = 9 === u.nodeType ? u : u.ownerDocument), + ;((x = 9 === u.nodeType ? u : u.ownerDocument), 'http://www.w3.org/1999/xhtml' === s && (s = kb(i)), 'http://www.w3.org/1999/xhtml' === s ? 'script' === i @@ -13070,16 +13087,16 @@ (s[hn] = o), (s[dn] = a), _s(s, o, !1, !1), - (o.stateNode = s) + (o.stateNode = s)) e: { switch (((x = vb(i, a)), i)) { case 'dialog': - D('cancel', s), D('close', s), (u = a) + ;(D('cancel', s), D('close', s), (u = a)) break case 'iframe': case 'object': case 'embed': - D('load', s), (u = a) + ;(D('load', s), (u = a)) break case 'video': case 'audio': @@ -13087,30 +13104,30 @@ u = a break case 'source': - D('error', s), (u = a) + ;(D('error', s), (u = a)) break case 'img': case 'image': case 'link': - D('error', s), D('load', s), (u = a) + ;(D('error', s), D('load', s), (u = a)) break case 'details': - D('toggle', s), (u = a) + ;(D('toggle', s), (u = a)) break case 'input': - Za(s, a), (u = Ya(s, a)), D('invalid', s) + ;(Za(s, a), (u = Ya(s, a)), D('invalid', s)) break case 'option': default: u = a break case 'select': - ;(s._wrapperState = { wasMultiple: !!a.multiple }), + ;((s._wrapperState = { wasMultiple: !!a.multiple }), (u = we({}, a, { value: void 0 })), - D('invalid', s) + D('invalid', s)) break case 'textarea': - hb(s, a), (u = gb(s, a)), D('invalid', s) + ;(hb(s, a), (u = gb(s, a)), D('invalid', s)) } for (_ in (ub(i, u), (C = u))) if (C.hasOwnProperty(_)) { @@ -13132,19 +13149,19 @@ } switch (i) { case 'input': - Va(s), db(s, a, !1) + ;(Va(s), db(s, a, !1)) break case 'textarea': - Va(s), jb(s) + ;(Va(s), jb(s)) break case 'option': null != a.value && s.setAttribute('value', '' + Sa(a.value)) break case 'select': - ;(s.multiple = !!a.multiple), + ;((s.multiple = !!a.multiple), null != (_ = a.value) ? fb(s, !!a.multiple, _, !1) - : null != a.defaultValue && fb(s, !!a.multiple, a.defaultValue, !0) + : null != a.defaultValue && fb(s, !!a.multiple, a.defaultValue, !0)) break default: 'function' == typeof u.onClick && (s.onclick = Bf) @@ -13167,7 +13184,7 @@ } null !== o.ref && ((o.flags |= 512), (o.flags |= 2097152)) } - return S(o), null + return (S(o), null) case 6: if (s && null != o.stateNode) ws(s, o, s.memoizedProps, a) else { @@ -13189,10 +13206,10 @@ } _ && (o.flags |= 4) } else - ((a = (9 === i.nodeType ? i : i.ownerDocument).createTextNode(a))[hn] = o), - (o.stateNode = a) + (((a = (9 === i.nodeType ? i : i.ownerDocument).createTextNode(a))[hn] = o), + (o.stateNode = a)) } - return S(o), null + return (S(o), null) case 13: if ( (E(Zn), @@ -13200,16 +13217,16 @@ null === s || (null !== s.memoizedState && null !== s.memoizedState.dehydrated)) ) { if (Fn && null !== Ln && 1 & o.mode && !(128 & o.flags)) - Hg(), Ig(), (o.flags |= 98560), (_ = !1) + (Hg(), Ig(), (o.flags |= 98560), (_ = !1)) else if (((_ = Gg(o)), null !== a && null !== a.dehydrated)) { if (null === s) { if (!_) throw Error(p(318)) if (!(_ = null !== (_ = o.memoizedState) ? _.dehydrated : null)) throw Error(p(317)) _[hn] = o - } else Ig(), !(128 & o.flags) && (o.memoizedState = null), (o.flags |= 4) - S(o), (_ = !1) - } else null !== Bn && (Fj(Bn), (Bn = null)), (_ = !0) + } else (Ig(), !(128 & o.flags) && (o.memoizedState = null), (o.flags |= 4)) + ;(S(o), (_ = !1)) + } else (null !== Bn && (Fj(Bn), (Bn = null)), (_ = !0)) if (!_) return 65536 & o.flags ? o : null } return 128 & o.flags @@ -13222,11 +13239,11 @@ S(o), null) case 4: - return zh(), Ss(s, o), null === s && sf(o.stateNode.containerInfo), S(o), null + return (zh(), Ss(s, o), null === s && sf(o.stateNode.containerInfo), S(o), null) case 10: - return ah(o.type._context), S(o), null + return (ah(o.type._context), S(o), null) case 19: - if ((E(Zn), null === (_ = o.memoizedState))) return S(o), null + if ((E(Zn), null === (_ = o.memoizedState))) return (S(o), null) if (((a = !!(128 & o.flags)), null === (x = _.rendering))) if (a) Dj(_, !1) else { @@ -13241,9 +13258,8 @@ a = i, i = o.child; null !== i; - ) - (s = a), + ((s = a), ((_ = i).flags &= 14680066), null === (x = _.alternate) ? ((_.childLanes = 0), @@ -13269,8 +13285,8 @@ null === s ? null : { lanes: s.lanes, firstContext: s.firstContext })), - (i = i.sibling) - return G(Zn, (1 & Zn.current) | 2), o.child + (i = i.sibling)) + return (G(Zn, (1 & Zn.current) | 2), o.child) } s = s.sibling } @@ -13288,7 +13304,7 @@ Dj(_, !0), null === _.tail && 'hidden' === _.tailMode && !x.alternate && !Fn) ) - return S(o), null + return (S(o), null) } else 2 * ht() - _.renderingStartTime > Xs && 1073741824 !== i && @@ -13340,7 +13356,7 @@ 65536 & (s = o.flags) && !(128 & s) ? ((o.flags = (-65537 & s) | 128), o) : null ) case 5: - return Bh(o), null + return (Bh(o), null) case 13: if ((E(Zn), null !== (s = o.memoizedState) && null !== s.dehydrated)) { if (null === o.alternate) throw Error(p(340)) @@ -13348,23 +13364,23 @@ } return 65536 & (s = o.flags) ? ((o.flags = (-65537 & s) | 128), o) : null case 19: - return E(Zn), null + return (E(Zn), null) case 4: - return zh(), null + return (zh(), null) case 10: - return ah(o.type._context), null + return (ah(o.type._context), null) case 22: case 23: - return Hj(), null + return (Hj(), null) default: return null } } - ;(_s = function (s, o) { + ;((_s = function (s, o) { for (var i = o.child; null !== i; ) { if (5 === i.tag || 6 === i.tag) s.appendChild(i.stateNode) else if (4 !== i.tag && null !== i.child) { - ;(i.child.return = i), (i = i.child) + ;((i.child.return = i), (i = i.child)) continue } if (i === o) break @@ -13372,27 +13388,27 @@ if (null === i.return || i.return === o) return i = i.return } - ;(i.sibling.return = i.return), (i = i.sibling) + ;((i.sibling.return = i.return), (i = i.sibling)) } }), (Ss = function () {}), (Es = function (s, o, i, a) { var u = s.memoizedProps if (u !== a) { - ;(s = o.stateNode), xh(Yn.current) + ;((s = o.stateNode), xh(Yn.current)) var _, x = null switch (i) { case 'input': - ;(u = Ya(s, u)), (a = Ya(s, a)), (x = []) + ;((u = Ya(s, u)), (a = Ya(s, a)), (x = [])) break case 'select': - ;(u = we({}, u, { value: void 0 })), + ;((u = we({}, u, { value: void 0 })), (a = we({}, a, { value: void 0 })), - (x = []) + (x = [])) break case 'textarea': - ;(u = gb(s, u)), (a = gb(s, a)), (x = []) + ;((u = gb(s, u)), (a = gb(s, a)), (x = [])) break default: 'function' != typeof u.onClick && @@ -13425,7 +13441,7 @@ (i || (i = {}), (i[_] = '')) for (_ in j) j.hasOwnProperty(_) && C[_] !== j[_] && (i || (i = {}), (i[_] = j[_])) - } else i || (x || (x = []), x.push(L, i)), (i = j) + } else (i || (x || (x = []), x.push(L, i)), (i = j)) else 'dangerouslySetInnerHTML' === L ? ((j = j ? j.__html : void 0), @@ -13448,7 +13464,7 @@ }), (ws = function (s, o, i, a) { i !== a && (o.flags |= 4) - }) + })) var ks = !1, Os = !1, As = 'function' == typeof WeakSet ? WeakSet : Set, @@ -13479,7 +13495,7 @@ do { if ((u.tag & s) === s) { var _ = u.destroy - ;(u.destroy = void 0), void 0 !== _ && Mj(o, i, _) + ;((u.destroy = void 0), void 0 !== _ && Mj(o, i, _)) } u = u.next } while (u !== a) @@ -13501,12 +13517,12 @@ var o = s.ref if (null !== o) { var i = s.stateNode - s.tag, (s = i), 'function' == typeof o ? o(s) : (o.current = s) + ;(s.tag, (s = i), 'function' == typeof o ? o(s) : (o.current = s)) } } function Sj(s) { var o = s.alternate - null !== o && ((s.alternate = null), Sj(o)), + ;(null !== o && ((s.alternate = null), Sj(o)), (s.child = null), (s.deletions = null), (s.sibling = null), @@ -13520,7 +13536,7 @@ (s.memoizedState = null), (s.pendingProps = null), (s.stateNode = null), - (s.updateQueue = null) + (s.updateQueue = null)) } function Tj(s) { return 5 === s.tag || 3 === s.tag || 4 === s.tag @@ -13534,11 +13550,10 @@ for ( s.sibling.return = s.return, s = s.sibling; 5 !== s.tag && 6 !== s.tag && 18 !== s.tag; - ) { if (2 & s.flags) continue e if (null === s.child || 4 === s.tag) continue e - ;(s.child.return = s), (s = s.child) + ;((s.child.return = s), (s = s.child)) } if (!(2 & s.flags)) return s.stateNode } @@ -13546,7 +13561,7 @@ function Vj(s, o, i) { var a = s.tag if (5 === a || 6 === a) - (s = s.stateNode), + ((s = s.stateNode), o ? 8 === i.nodeType ? i.parentNode.insertBefore(s, o) @@ -13554,20 +13569,20 @@ : (8 === i.nodeType ? (o = i.parentNode).insertBefore(s, i) : (o = i).appendChild(s), - null != (i = i._reactRootContainer) || null !== o.onclick || (o.onclick = Bf)) + null != (i = i._reactRootContainer) || null !== o.onclick || (o.onclick = Bf))) else if (4 !== a && null !== (s = s.child)) - for (Vj(s, o, i), s = s.sibling; null !== s; ) Vj(s, o, i), (s = s.sibling) + for (Vj(s, o, i), s = s.sibling; null !== s; ) (Vj(s, o, i), (s = s.sibling)) } function Wj(s, o, i) { var a = s.tag - if (5 === a || 6 === a) (s = s.stateNode), o ? i.insertBefore(s, o) : i.appendChild(s) + if (5 === a || 6 === a) ((s = s.stateNode), o ? i.insertBefore(s, o) : i.appendChild(s)) else if (4 !== a && null !== (s = s.child)) - for (Wj(s, o, i), s = s.sibling; null !== s; ) Wj(s, o, i), (s = s.sibling) + for (Wj(s, o, i), s = s.sibling; null !== s; ) (Wj(s, o, i), (s = s.sibling)) } var Ps = null, Is = !1 function Yj(s, o, i) { - for (i = i.child; null !== i; ) Zj(s, o, i), (i = i.sibling) + for (i = i.child; null !== i; ) (Zj(s, o, i), (i = i.sibling)) } function Zj(s, o, i) { if (St && 'function' == typeof St.onCommitFiberUnmount) @@ -13580,7 +13595,7 @@ case 6: var a = Ps, u = Is - ;(Ps = null), + ;((Ps = null), Yj(s, o, i), (Is = u), null !== (Ps = a) && @@ -13588,7 +13603,7 @@ ? ((s = Ps), (i = i.stateNode), 8 === s.nodeType ? s.parentNode.removeChild(i) : s.removeChild(i)) - : Ps.removeChild(i.stateNode)) + : Ps.removeChild(i.stateNode))) break case 18: null !== Ps && @@ -13600,13 +13615,13 @@ : Kf(Ps, i.stateNode)) break case 4: - ;(a = Ps), + ;((a = Ps), (u = Is), (Ps = i.stateNode.containerInfo), (Is = !0), Yj(s, o, i), (Ps = a), - (Is = u) + (Is = u)) break case 0: case 11: @@ -13617,7 +13632,7 @@ do { var _ = u, w = _.destroy - ;(_ = _.tag), void 0 !== w && (2 & _ || 4 & _) && Mj(i, o, w), (u = u.next) + ;((_ = _.tag), void 0 !== w && (2 & _ || 4 & _) && Mj(i, o, w), (u = u.next)) } while (u !== a) } Yj(s, o, i) @@ -13625,9 +13640,9 @@ case 1: if (!Os && (Lj(i, o), 'function' == typeof (a = i.stateNode).componentWillUnmount)) try { - ;(a.props = i.memoizedProps), + ;((a.props = i.memoizedProps), (a.state = i.memoizedState), - a.componentWillUnmount() + a.componentWillUnmount()) } catch (s) { W(i, o, s) } @@ -13650,11 +13665,11 @@ if (null !== o) { s.updateQueue = null var i = s.stateNode - null === i && (i = s.stateNode = new As()), + ;(null === i && (i = s.stateNode = new As()), o.forEach(function (o) { var a = bk.bind(null, s, o) i.has(o) || (i.add(o), o.then(a, a)) - }) + })) } } function ck(s, o) { @@ -13669,24 +13684,24 @@ e: for (; null !== x; ) { switch (x.tag) { case 5: - ;(Ps = x.stateNode), (Is = !1) + ;((Ps = x.stateNode), (Is = !1)) break e case 3: case 4: - ;(Ps = x.stateNode.containerInfo), (Is = !0) + ;((Ps = x.stateNode.containerInfo), (Is = !0)) break e } x = x.return } if (null === Ps) throw Error(p(160)) - Zj(_, w, u), (Ps = null), (Is = !1) + ;(Zj(_, w, u), (Ps = null), (Is = !1)) var C = u.alternate - null !== C && (C.return = null), (u.return = null) + ;(null !== C && (C.return = null), (u.return = null)) } catch (s) { W(u, o, s) } } - if (12854 & o.subtreeFlags) for (o = o.child; null !== o; ) dk(o, s), (o = o.sibling) + if (12854 & o.subtreeFlags) for (o = o.child; null !== o; ) (dk(o, s), (o = o.sibling)) } function dk(s, o) { var i = s.alternate, @@ -13698,7 +13713,7 @@ case 15: if ((ck(o, s), ek(s), 4 & a)) { try { - Pj(3, s, s.return), Qj(3, s) + ;(Pj(3, s, s.return), Qj(3, s)) } catch (o) { W(s, s.return, o) } @@ -13710,7 +13725,7 @@ } break case 1: - ck(o, s), ek(s), 512 & a && null !== i && Lj(i, i.return) + ;(ck(o, s), ek(s), 512 & a && null !== i && Lj(i, i.return)) break case 5: if ((ck(o, s), ek(s), 512 & a && null !== i && Lj(i, i.return), 32 & s.flags)) { @@ -13728,7 +13743,7 @@ C = s.updateQueue if (((s.updateQueue = null), null !== C)) try { - 'input' === x && 'radio' === _.type && null != _.name && ab(u, _), vb(x, w) + ;('input' === x && 'radio' === _.type && null != _.name && ab(u, _), vb(x, w)) var j = vb(x, _) for (w = 0; w < C.length; w += 2) { var L = C[w], @@ -13768,7 +13783,7 @@ case 6: if ((ck(o, s), ek(s), 4 & a)) { if (null === s.stateNode) throw Error(p(162)) - ;(u = s.stateNode), (_ = s.memoizedProps) + ;((u = s.stateNode), (_ = s.memoizedProps)) try { u.nodeValue = _ } catch (o) { @@ -13786,10 +13801,10 @@ break case 4: default: - ck(o, s), ek(s) + ;(ck(o, s), ek(s)) break case 13: - ck(o, s), + ;(ck(o, s), ek(s), 8192 & (u = s.child).flags && ((_ = null !== u.memoizedState), @@ -13797,7 +13812,7 @@ !_ || (null !== u.alternate && null !== u.alternate.memoizedState) || (Ys = ht())), - 4 & a && ak(s) + 4 & a && ak(s)) break case 22: if ( @@ -13822,12 +13837,12 @@ Lj($, $.return) var V = $.stateNode if ('function' == typeof V.componentWillUnmount) { - ;(a = $), (i = $.return) + ;((a = $), (i = $.return)) try { - ;(o = a), + ;((o = a), (V.props = o.memoizedProps), (V.state = o.memoizedState), - V.componentWillUnmount() + V.componentWillUnmount()) } catch (s) { W(a, i, s) } @@ -13851,7 +13866,7 @@ if (null === L) { L = B try { - ;(u = B.stateNode), + ;((u = B.stateNode), j ? 'function' == typeof (_ = u.style).setProperty ? _.setProperty('display', 'none', 'important') @@ -13861,7 +13876,7 @@ null != (C = B.memoizedProps.style) && C.hasOwnProperty('display') ? C.display : null), - (x.style.display = rb('display', w))) + (x.style.display = rb('display', w)))) } catch (o) { W(s, s.return, o) } @@ -13877,20 +13892,20 @@ ((22 !== B.tag && 23 !== B.tag) || null === B.memoizedState || B === s) && null !== B.child ) { - ;(B.child.return = B), (B = B.child) + ;((B.child.return = B), (B = B.child)) continue } if (B === s) break e for (; null === B.sibling; ) { if (null === B.return || B.return === s) break e - L === B && (L = null), (B = B.return) + ;(L === B && (L = null), (B = B.return)) } - L === B && (L = null), (B.sibling.return = B.return), (B = B.sibling) + ;(L === B && (L = null), (B.sibling.return = B.return), (B = B.sibling)) } } break case 19: - ck(o, s), ek(s), 4 & a && ak(s) + ;(ck(o, s), ek(s), 4 & a && ak(s)) case 21: } } @@ -13911,7 +13926,7 @@ switch (a.tag) { case 5: var u = a.stateNode - 32 & a.flags && (ob(u, ''), (a.flags &= -33)), Wj(s, Uj(s), u) + ;(32 & a.flags && (ob(u, ''), (a.flags &= -33)), Wj(s, Uj(s), u)) break case 3: case 4: @@ -13929,7 +13944,7 @@ 4096 & o && (s.flags &= -4097) } function hk(s, o, i) { - ;(Cs = s), ik(s, o, i) + ;((Cs = s), ik(s, o, i)) } function ik(s, o, i) { for (var a = !!(1 & s.mode); null !== Cs; ) { @@ -13944,14 +13959,14 @@ var j = Os if (((ks = w), (Os = C) && !j)) for (Cs = u; null !== Cs; ) - (C = (w = Cs).child), + ((C = (w = Cs).child), 22 === w.tag && null !== w.memoizedState ? jk(u) : null !== C ? ((C.return = w), (Cs = C)) - : jk(u) - for (; null !== _; ) (Cs = _), ik(_, o, i), (_ = _.sibling) - ;(Cs = u), (ks = x), (Os = j) + : jk(u)) + for (; null !== _; ) ((Cs = _), ik(_, o, i), (_ = _.sibling)) + ;((Cs = u), (ks = x), (Os = j)) } kk(s) } else 8772 & u.subtreeFlags && null !== _ ? ((_.return = u), (Cs = _)) : kk(s) @@ -14052,7 +14067,7 @@ break } if (null !== (i = o.sibling)) { - ;(i.return = o.return), (Cs = i) + ;((i.return = o.return), (Cs = i)) break } Cs = o.return @@ -14067,7 +14082,7 @@ } var i = o.sibling if (null !== i) { - ;(i.return = o.return), (Cs = i) + ;((i.return = o.return), (Cs = i)) break } Cs = o.return @@ -14122,7 +14137,7 @@ } var x = o.sibling if (null !== x) { - ;(x.return = o.return), (Cs = x) + ;((x.return = o.return), (Cs = x)) break } Cs = o.return @@ -14175,11 +14190,11 @@ } function gi(s, o, i, a) { if (50 < oo) throw ((oo = 0), (io = null), Error(p(185))) - Ac(s, i, a), + ;(Ac(s, i, a), (2 & Ls && s === Fs) || (s === Fs && (!(2 & Ls) && (Js |= i), 4 === Vs && Ck(s, $s)), Dk(s, a), - 1 === i && 0 === Ls && !(1 & o.mode) && ((Xs = ht() + 500), kn && jg())) + 1 === i && 0 === Ls && !(1 & o.mode) && ((Xs = ht() + 500), kn && jg()))) } function Dk(s, o) { var i = s.callbackNode @@ -14190,30 +14205,29 @@ u = s.expirationTimes, _ = s.pendingLanes; 0 < _; - ) { var w = 31 - Et(_), x = 1 << w, C = u[w] - ;-1 === C + ;(-1 === C ? (x & i && !(x & a)) || (u[w] = vc(x, o)) : C <= o && (s.expiredLanes |= x), - (_ &= ~x) + (_ &= ~x)) } })(s, o) var a = uc(s, s === Fs ? $s : 0) - if (0 === a) null !== i && lt(i), (s.callbackNode = null), (s.callbackPriority = 0) + if (0 === a) (null !== i && lt(i), (s.callbackNode = null), (s.callbackPriority = 0)) else if (((o = a & -a), s.callbackPriority !== o)) { if ((null != i && lt(i), 1 === o)) - 0 === s.tag + (0 === s.tag ? (function ig(s) { - ;(kn = !0), hg(s) + ;((kn = !0), hg(s)) })(Ek.bind(null, s)) : hg(Ek.bind(null, s)), un(function () { !(6 & Ls) && jg() }), - (i = null) + (i = null)) else { switch (Dc(a)) { case 1: @@ -14231,7 +14245,7 @@ } i = Fk(i, Gk.bind(null, s)) } - ;(s.callbackPriority = o), (s.callbackNode = i) + ;((s.callbackPriority = o), (s.callbackNode = i)) } } function Gk(s, o) { @@ -14253,10 +14267,10 @@ } catch (o) { Mk(s, o) } - $g(), + ;($g(), (Ms.current = _), (Ls = u), - null !== Bs ? (o = 0) : ((Fs = null), ($s = 0), (o = Vs)) + null !== Bs ? (o = 0) : ((Fs = null), ($s = 0), (o = Vs))) } if (0 !== o) { if ((2 === o && 0 !== (u = xc(s)) && ((a = u), (o = Nk(s, u))), 1 === o)) @@ -14284,14 +14298,14 @@ } } if (((i = o.child), 16384 & o.subtreeFlags && null !== i)) - (i.return = o), (o = i) + ((i.return = o), (o = i)) else { if (o === s) break for (; null === o.sibling; ) { if (null === o.return || o.return === s) return !0 o = o.return } - ;(o.sibling.return = o.return), (o = o.sibling) + ;((o.sibling.return = o.return), (o = o.sibling)) } } return !0 @@ -14314,7 +14328,7 @@ if ((Ck(s, a), (130023424 & a) === a && 10 < (o = Ys + 500 - ht()))) { if (0 !== uc(s, 0)) break if (((u = s.suspendedLanes) & a) !== a) { - R(), (s.pingedLanes |= s.suspendedLanes & u) + ;(R(), (s.pingedLanes |= s.suspendedLanes & u)) break } s.timeoutHandle = an(Pk.bind(null, s, Gs, Qs), o) @@ -14326,7 +14340,7 @@ if ((Ck(s, a), (4194240 & a) === a)) break for (o = s.eventTimes, u = -1; 0 < a; ) { var w = 31 - Et(a) - ;(_ = 1 << w), (w = o[w]) > u && (u = w), (a &= ~_) + ;((_ = 1 << w), (w = o[w]) > u && (u = w), (a &= ~_)) } if ( ((a = u), @@ -14356,7 +14370,7 @@ } } } - return Dk(s, ht()), s.callbackNode === i ? Gk.bind(null, s) : null + return (Dk(s, ht()), s.callbackNode === i ? Gk.bind(null, s) : null) } function Nk(s, o) { var i = Ks @@ -14373,18 +14387,17 @@ for ( o &= ~Hs, o &= ~Js, s.suspendedLanes |= o, s.pingedLanes &= ~o, s = s.expirationTimes; 0 < o; - ) { var i = 31 - Et(o), a = 1 << i - ;(s[i] = -1), (o &= ~a) + ;((s[i] = -1), (o &= ~a)) } } function Ek(s) { if (6 & Ls) throw Error(p(327)) Hk() var o = uc(s, 0) - if (!(1 & o)) return Dk(s, ht()), null + if (!(1 & o)) return (Dk(s, ht()), null) var i = Ik(s, o) if (0 !== s.tag && 2 === i) { var a = xc(s) @@ -14418,14 +14431,14 @@ try { if (((Ds.transition = null), (At = 1), s)) return s() } finally { - ;(At = a), (Ds.transition = i), !(6 & (Ls = o)) && jg() + ;((At = a), (Ds.transition = i), !(6 & (Ls = o)) && jg()) } } function Hj() { - ;(qs = Us.current), E(Us) + ;((qs = Us.current), E(Us)) } function Kk(s, o) { - ;(s.finishedWork = null), (s.finishedLanes = 0) + ;((s.finishedWork = null), (s.finishedLanes = 0)) var i = s.timeoutHandle if ((-1 !== i && ((s.timeoutHandle = -1), cn(i)), null !== Bs)) for (i = Bs.return; null !== i; ) { @@ -14435,7 +14448,7 @@ null != (a = a.type.childContextTypes) && $f() break case 3: - zh(), E(En), E(Sn), Eh() + ;(zh(), E(En), E(Sn), Eh()) break case 5: Bh(a) @@ -14473,7 +14486,7 @@ _ = i.pending if (null !== _) { var w = _.next - ;(_.next = u), (a.next = w) + ;((_.next = u), (a.next = w)) } i.pending = a } @@ -14488,7 +14501,7 @@ if (($g(), (ts.current = hs), cs)) { for (var a = ss.memoizedState; null !== a; ) { var u = a.queue - null !== u && (u.pending = null), (a = a.next) + ;(null !== u && (u.pending = null), (a = a.next)) } cs = !1 } @@ -14500,7 +14513,7 @@ (Rs.current = null), null === i || null === i.return) ) { - ;(Vs = 1), (zs = o), (Bs = null) + ;((Vs = 1), (zs = o), (Bs = null)) break } e: { @@ -14526,34 +14539,34 @@ } var U = Ui(w) if (null !== U) { - ;(U.flags &= -257), Vi(U, w, x, 0, o), 1 & U.mode && Si(_, j, o), (C = j) + ;((U.flags &= -257), Vi(U, w, x, 0, o), 1 & U.mode && Si(_, j, o), (C = j)) var V = (o = U).updateQueue if (null === V) { var z = new Set() - z.add(C), (o.updateQueue = z) + ;(z.add(C), (o.updateQueue = z)) } else V.add(C) break e } if (!(1 & o)) { - Si(_, j, o), tj() + ;(Si(_, j, o), tj()) break e } C = Error(p(426)) } else if (Fn && 1 & x.mode) { var Y = Ui(w) if (null !== Y) { - !(65536 & Y.flags) && (Y.flags |= 256), Vi(Y, w, x, 0, o), Jg(Ji(C, x)) + ;(!(65536 & Y.flags) && (Y.flags |= 256), Vi(Y, w, x, 0, o), Jg(Ji(C, x))) break e } } - ;(_ = C = Ji(C, x)), + ;((_ = C = Ji(C, x)), 4 !== Vs && (Vs = 2), null === Ks ? (Ks = [_]) : Ks.push(_), - (_ = w) + (_ = w)) do { switch (_.tag) { case 3: - ;(_.flags |= 65536), (o &= -o), (_.lanes |= o), ph(_, Ni(0, C, o)) + ;((_.flags |= 65536), (o &= -o), (_.lanes |= o), ph(_, Ni(0, C, o))) break e case 1: x = C @@ -14568,7 +14581,7 @@ (null !== to && to.has(ee)))) ) ) { - ;(_.flags |= 65536), (o &= -o), (_.lanes |= o), ph(_, Qi(_, x, o)) + ;((_.flags |= 65536), (o &= -o), (_.lanes |= o), ph(_, Qi(_, x, o))) break e } } @@ -14577,7 +14590,7 @@ } Sk(i) } catch (s) { - ;(o = s), Bs === i && null !== i && (Bs = i = i.return) + ;((o = s), Bs === i && null !== i && (Bs = i = i.return)) continue } break @@ -14585,11 +14598,11 @@ } function Jk() { var s = Ms.current - return (Ms.current = hs), null === s ? hs : s + return ((Ms.current = hs), null === s ? hs : s) } function tj() { - ;(0 !== Vs && 3 !== Vs && 2 !== Vs) || (Vs = 4), - null === Fs || (!(268435455 & Ws) && !(268435455 & Js)) || Ck(Fs, $s) + ;((0 !== Vs && 3 !== Vs && 2 !== Vs) || (Vs = 4), + null === Fs || (!(268435455 & Ws) && !(268435455 & Js)) || Ck(Fs, $s)) } function Ik(s, o) { var i = Ls @@ -14603,7 +14616,7 @@ Mk(s, o) } if (($g(), (Ls = i), (Ms.current = a), null !== Bs)) throw Error(p(261)) - return (Fs = null), ($s = 0), Vs + return ((Fs = null), ($s = 0), Vs) } function Tk() { for (; null !== Bs; ) Uk(Bs) @@ -14613,16 +14626,18 @@ } function Uk(s) { var o = Ts(s.alternate, s, qs) - ;(s.memoizedProps = s.pendingProps), null === o ? Sk(s) : (Bs = o), (Rs.current = null) + ;((s.memoizedProps = s.pendingProps), + null === o ? Sk(s) : (Bs = o), + (Rs.current = null)) } function Sk(s) { var o = s do { var i = o.alternate if (((s = o.return), 32768 & o.flags)) { - if (null !== (i = Ij(i, o))) return (i.flags &= 32767), void (Bs = i) - if (null === s) return (Vs = 6), void (Bs = null) - ;(s.flags |= 32768), (s.subtreeFlags = 0), (s.deletions = null) + if (null !== (i = Ij(i, o))) return ((i.flags &= 32767), void (Bs = i)) + if (null === s) return ((Vs = 6), void (Bs = null)) + ;((s.flags |= 32768), (s.subtreeFlags = 0), (s.deletions = null)) } else if (null !== (i = Ej(i, o, qs))) return void (Bs = i) if (null !== (o = o.sibling)) return void (Bs = o) Bs = o = s @@ -14633,7 +14648,7 @@ var a = At, u = Ds.transition try { - ;(Ds.transition = null), + ;((Ds.transition = null), (At = 1), (function Wk(s, o, i, a) { do { @@ -14645,23 +14660,23 @@ if (null === i) return null if (((s.finishedWork = null), (s.finishedLanes = 0), i === s.current)) throw Error(p(177)) - ;(s.callbackNode = null), (s.callbackPriority = 0) + ;((s.callbackNode = null), (s.callbackPriority = 0)) var _ = i.lanes | i.childLanes if ( ((function Bc(s, o) { var i = s.pendingLanes & ~o - ;(s.pendingLanes = o), + ;((s.pendingLanes = o), (s.suspendedLanes = 0), (s.pingedLanes = 0), (s.expiredLanes &= o), (s.mutableReadLanes &= o), (s.entangledLanes &= o), - (o = s.entanglements) + (o = s.entanglements)) var a = s.eventTimes for (s = s.expirationTimes; 0 < i; ) { var u = 31 - Et(i), _ = 1 << u - ;(o[u] = 0), (a[u] = -1), (s[u] = -1), (i &= ~_) + ;((o[u] = 0), (a[u] = -1), (s[u] = -1), (i &= ~_)) } })(s, _), s === Fs && ((Bs = Fs = null), ($s = 0)), @@ -14669,16 +14684,16 @@ ro || ((ro = !0), Fk(yt, function () { - return Hk(), null + return (Hk(), null) })), (_ = !!(15990 & i.flags)), !!(15990 & i.subtreeFlags) || _) ) { - ;(_ = Ds.transition), (Ds.transition = null) + ;((_ = Ds.transition), (Ds.transition = null)) var w = At At = 1 var x = Ls - ;(Ls |= 4), + ;((Ls |= 4), (Rs.current = null), (function Oj(s, o) { if (((sn = Vt), Ne((s = Me())))) { @@ -14695,7 +14710,7 @@ _ = a.focusNode a = a.focusOffset try { - i.nodeType, _.nodeType + ;(i.nodeType, _.nodeType) } catch (s) { i = null break e @@ -14714,9 +14729,8 @@ B !== _ || (0 !== a && 3 !== B.nodeType) || (C = w + a), 3 === B.nodeType && (w += B.nodeValue.length), null !== (U = B.firstChild); - ) - ($ = B), (B = U) + (($ = B), (B = U)) for (;;) { if (B === s) break t if ( @@ -14737,10 +14751,9 @@ for ( on = { focusedElem: s, selectionRange: i }, Vt = !1, Cs = o; null !== Cs; - ) if (((s = (o = Cs).child), 1028 & o.subtreeFlags && null !== s)) - (s.return = o), (Cs = s) + ((s.return = o), (Cs = s)) else for (; null !== Cs; ) { o = Cs @@ -14783,12 +14796,12 @@ W(o, o.return, s) } if (null !== (s = o.sibling)) { - ;(s.return = o.return), (Cs = s) + ;((s.return = o.return), (Cs = s)) break } Cs = o.return } - return (V = js), (js = !1), V + return ((V = js), (js = !1), V) })(s, i), dk(i, s), Oe(on), @@ -14799,7 +14812,7 @@ pt(), (Ls = x), (At = w), - (Ds.transition = _) + (Ds.transition = _)) } else s.current = i if ( (ro && ((ro = !1), (no = s), (so = u)), @@ -14815,7 +14828,7 @@ null !== o) ) for (a = s.onRecoverableError, i = 0; i < o.length; i++) - (u = o[i]), a(u.value, { componentStack: u.stack, digest: u.digest }) + ((u = o[i]), a(u.value, { componentStack: u.stack, digest: u.digest })) if (Zs) throw ((Zs = !1), (s = eo), (eo = null), s) return ( !!(1 & so) && 0 !== s.tag && Hk(), @@ -14824,9 +14837,9 @@ jg(), null ) - })(s, o, i, a) + })(s, o, i, a)) } finally { - ;(Ds.transition = u), (At = a) + ;((Ds.transition = u), (At = a)) } return null } @@ -14857,7 +14870,7 @@ Pj(8, L, _) } var B = L.child - if (null !== B) (B.return = L), (Cs = B) + if (null !== B) ((B.return = L), (Cs = B)) else for (; null !== Cs; ) { var $ = (L = Cs).sibling, @@ -14867,7 +14880,7 @@ break } if (null !== $) { - ;($.return = U), (Cs = $) + ;(($.return = U), (Cs = $)) break } Cs = U @@ -14881,14 +14894,14 @@ V.child = null do { var Y = z.sibling - ;(z.sibling = null), (z = Y) + ;((z.sibling = null), (z = Y)) } while (null !== z) } } Cs = _ } } - if (2064 & _.subtreeFlags && null !== w) (w.return = _), (Cs = w) + if (2064 & _.subtreeFlags && null !== w) ((w.return = _), (Cs = w)) else e: for (; null !== Cs; ) { if (2048 & (_ = Cs).flags) @@ -14900,7 +14913,7 @@ } var Z = _.sibling if (null !== Z) { - ;(Z.return = _.return), (Cs = Z) + ;((Z.return = _.return), (Cs = Z)) break e } Cs = _.return @@ -14909,7 +14922,7 @@ var ee = s.current for (Cs = ee; null !== Cs; ) { var ie = (w = Cs).child - if (2064 & w.subtreeFlags && null !== ie) (ie.return = w), (Cs = ie) + if (2064 & w.subtreeFlags && null !== ie) ((ie.return = w), (Cs = ie)) else e: for (w = ee; null !== Cs; ) { if (2048 & (x = Cs).flags) @@ -14929,7 +14942,7 @@ } var ae = x.sibling if (null !== ae) { - ;(ae.return = x.return), (Cs = ae) + ;((ae.return = x.return), (Cs = ae)) break e } Cs = x.return @@ -14943,15 +14956,15 @@ } return a } finally { - ;(At = i), (Ds.transition = o) + ;((At = i), (Ds.transition = o)) } } return !1 } function Xk(s, o, i) { - ;(s = nh(s, (o = Ni(0, (o = Ji(i, o)), 1)), 1)), + ;((s = nh(s, (o = Ni(0, (o = Ji(i, o)), 1)), 1)), (o = R()), - null !== s && (Ac(s, 1, o), Dk(s, o)) + null !== s && (Ac(s, 1, o), Dk(s, o))) } function W(s, o, i) { if (3 === s.tag) Xk(s, s, i) @@ -14967,9 +14980,9 @@ 'function' == typeof o.type.getDerivedStateFromError || ('function' == typeof a.componentDidCatch && (null === to || !to.has(a))) ) { - ;(o = nh(o, (s = Qi(o, (s = Ji(i, s)), 1)), 1)), + ;((o = nh(o, (s = Qi(o, (s = Ji(i, s)), 1)), 1)), (s = R()), - null !== o && (Ac(o, 1, s), Dk(o, s)) + null !== o && (Ac(o, 1, s), Dk(o, s))) break } } @@ -14978,7 +14991,7 @@ } function Ti(s, o, i) { var a = s.pingCache - null !== a && a.delete(o), + ;(null !== a && a.delete(o), (o = R()), (s.pingedLanes |= s.suspendedLanes & i), Fs === s && @@ -14986,7 +14999,7 @@ (4 === Vs || (3 === Vs && (130023424 & $s) === $s && 500 > ht() - Ys) ? Kk(s, 0) : (Hs |= i)), - Dk(s, o) + Dk(s, o)) } function Yk(s, o) { 0 === o && @@ -14997,7 +15010,7 @@ function uj(s) { var o = s.memoizedState, i = 0 - null !== o && (i = o.retryLane), Yk(s, i) + ;(null !== o && (i = o.retryLane), Yk(s, i)) } function bk(s, o) { var i = 0 @@ -15013,13 +15026,13 @@ default: throw Error(p(314)) } - null !== a && a.delete(o), Yk(s, i) + ;(null !== a && a.delete(o), Yk(s, i)) } function Fk(s, o) { return ct(s, o) } function $k(s, o, i, a) { - ;(this.tag = s), + ;((this.tag = s), (this.key = i), (this.sibling = this.child = @@ -15040,7 +15053,7 @@ (this.subtreeFlags = this.flags = 0), (this.deletions = null), (this.childLanes = this.lanes = 0), - (this.alternate = null) + (this.alternate = null)) } function Bg(s, o, i, a) { return new $k(s, o, i, a) @@ -15087,14 +15100,14 @@ case Z: return Tg(i.children, u, _, o) case ee: - ;(w = 8), (u |= 8) + ;((w = 8), (u |= 8)) break case ie: - return ((s = Bg(12, i, o, 2 | u)).elementType = ie), (s.lanes = _), s + return (((s = Bg(12, i, o, 2 | u)).elementType = ie), (s.lanes = _), s) case pe: - return ((s = Bg(13, i, o, u)).elementType = pe), (s.lanes = _), s + return (((s = Bg(13, i, o, u)).elementType = pe), (s.lanes = _), s) case de: - return ((s = Bg(19, i, o, u)).elementType = de), (s.lanes = _), s + return (((s = Bg(19, i, o, u)).elementType = de), (s.lanes = _), s) case be: return pj(i, u, _, o) default: @@ -15113,15 +15126,15 @@ w = 14 break e case ye: - ;(w = 16), (a = null) + ;((w = 16), (a = null)) break e } throw Error(p(130, null == s ? s : typeof s, '')) } - return ((o = Bg(w, i, o, u)).elementType = s), (o.type = a), (o.lanes = _), o + return (((o = Bg(w, i, o, u)).elementType = s), (o.type = a), (o.lanes = _), o) } function Tg(s, o, i, a) { - return ((s = Bg(7, s, a, o)).lanes = i), s + return (((s = Bg(7, s, a, o)).lanes = i), s) } function pj(s, o, i, a) { return ( @@ -15132,7 +15145,7 @@ ) } function Qg(s, o, i) { - return ((s = Bg(6, s, null, o)).lanes = i), s + return (((s = Bg(6, s, null, o)).lanes = i), s) } function Sg(s, o, i) { return ( @@ -15146,7 +15159,7 @@ ) } function al(s, o, i, a, u) { - ;(this.tag = o), + ;((this.tag = o), (this.containerInfo = s), (this.finishedWork = this.pingCache = this.current = this.pendingChildren = null), (this.timeoutHandle = -1), @@ -15165,7 +15178,7 @@ (this.entanglements = zc(0)), (this.identifierPrefix = a), (this.onRecoverableError = u), - (this.mutableSourceEagerHydrationData = null) + (this.mutableSourceEagerHydrationData = null)) } function bl(s, o, i, a, u, _, w, x, C) { return ( @@ -15246,7 +15259,7 @@ } } function il(s, o) { - hl(s, o), (s = s.alternate) && hl(s, o) + ;(hl(s, o), (s = s.alternate) && hl(s, o)) } Ts = function (s, o, i) { if (null !== s) @@ -15258,7 +15271,7 @@ (function yj(s, o, i) { switch (o.tag) { case 3: - kj(o), Ig() + ;(kj(o), Ig()) break case 5: Ah(o) @@ -15272,7 +15285,7 @@ case 10: var a = o.type._context, u = o.memoizedProps.value - G(Vn, a._currentValue), (a._currentValue = u) + ;(G(Vn, a._currentValue), (a._currentValue = u)) break case 13: if (null !== (a = o.memoizedState)) @@ -15299,20 +15312,20 @@ return null case 22: case 23: - return (o.lanes = 0), dj(s, o, i) + return ((o.lanes = 0), dj(s, o, i)) } return Zi(s, o, i) })(s, o, i) ) bs = !!(131072 & s.flags) } - else (bs = !1), Fn && 1048576 & o.flags && ug(o, Pn, o.index) + else ((bs = !1), Fn && 1048576 & o.flags && ug(o, Pn, o.index)) switch (((o.lanes = 0), o.tag)) { case 2: var a = o.type - ij(s, o), (s = o.pendingProps) + ;(ij(s, o), (s = o.pendingProps)) var u = Yf(o, Sn.current) - ch(o, i), (u = Nh(null, o, a, s, u, i)) + ;(ch(o, i), (u = Nh(null, o, a, s, u, i))) var _ = Sh() return ( (o.flags |= 1), @@ -15385,10 +15398,10 @@ case 3: e: { if ((kj(o), null === s)) throw Error(p(387)) - ;(a = o.pendingProps), + ;((a = o.pendingProps), (u = (_ = o.memoizedState).element), lh(s, o), - qh(o, a, null, i) + qh(o, a, null, i)) var w = o.memoizedState if (((a = w.element), _.isDehydrated)) { if ( @@ -15418,9 +15431,8 @@ i = Un(o, null, a, i), o.child = i; i; - ) - (i.flags = (-3 & i.flags) | 4096), (i = i.sibling) + ((i.flags = (-3 & i.flags) | 4096), (i = i.sibling)) } else { if ((Ig(), a === u)) { o = Zi(s, o, i) @@ -15445,7 +15457,7 @@ o.child ) case 6: - return null === s && Eg(o), null + return (null === s && Eg(o), null) case 13: return oj(s, o, i) case 4: @@ -15462,10 +15474,10 @@ Yi(s, o, a, (u = o.elementType === a ? u : Ci(a, u)), i) ) case 7: - return Xi(s, o, o.pendingProps, i), o.child + return (Xi(s, o, o.pendingProps, i), o.child) case 8: case 12: - return Xi(s, o, o.pendingProps.children, i), o.child + return (Xi(s, o, o.pendingProps.children, i), o.child) case 10: e: { if ( @@ -15494,14 +15506,14 @@ var j = _.updateQueue if (null !== j) { var L = (j = j.shared).pending - null === L ? (C.next = C) : ((C.next = L.next), (L.next = C)), - (j.pending = C) + ;(null === L ? (C.next = C) : ((C.next = L.next), (L.next = C)), + (j.pending = C)) } } - ;(_.lanes |= i), + ;((_.lanes |= i), null !== (C = _.alternate) && (C.lanes |= i), bh(_.return, i, o), - (x.lanes |= i) + (x.lanes |= i)) break } C = C.next @@ -15509,10 +15521,10 @@ } else if (10 === _.tag) w = _.type === o.type ? null : _.child else if (18 === _.tag) { if (null === (w = _.return)) throw Error(p(341)) - ;(w.lanes |= i), + ;((w.lanes |= i), null !== (x = w.alternate) && (x.lanes |= i), bh(w, i, o), - (w = _.sibling) + (w = _.sibling)) } else w = _.child if (null !== w) w.return = _ else @@ -15522,14 +15534,14 @@ break } if (null !== (_ = w.sibling)) { - ;(_.return = w.return), (w = _) + ;((_.return = w.return), (w = _)) break } w = w.return } _ = w } - Xi(s, o, u.children, i), (o = o.child) + ;(Xi(s, o, u.children, i), (o = o.child)) } return o case 9: @@ -15543,7 +15555,7 @@ o.child ) case 14: - return (u = Ci((a = o.type), o.pendingProps)), $i(s, o, a, (u = Ci(a.type, u)), i) + return ((u = Ci((a = o.type), o.pendingProps)), $i(s, o, a, (u = Ci(a.type, u)), i)) case 15: return bj(s, o, o.type, o.pendingProps, i) case 17: @@ -15643,7 +15655,7 @@ })(i, o, s, u, a) return gl(w) } - ;(ml.prototype.render = ll.prototype.render = + ;((ml.prototype.render = ll.prototype.render = function (s) { var o = this._internalRoot if (null === o) throw Error(p(409)) @@ -15655,10 +15667,10 @@ if (null !== s) { this._internalRoot = null var o = s.containerInfo - Rk(function () { + ;(Rk(function () { fl(null, s, null, null) }), - (o[fn] = null) + (o[fn] = null)) } }), (ml.prototype.unstable_scheduleHydration = function (s) { @@ -15666,7 +15678,7 @@ var o = It() s = { blockedOn: null, target: s, priority: o } for (var i = 0; i < $t.length && 0 !== o && o < $t[i].priority; i++); - $t.splice(i, 0, s), 0 === i && Vc(s) + ;($t.splice(i, 0, s), 0 === i && Vc(s)) } }), (Ct = function (s) { @@ -15679,14 +15691,14 @@ } break case 13: - Rk(function () { + ;(Rk(function () { var o = ih(s, 1) if (null !== o) { var i = R() gi(o, s, 1, i) } }), - il(s, 1) + il(s, 1)) } }), (jt = function (s) { @@ -15710,7 +15722,7 @@ (Tt = function (s, o) { var i = At try { - return (At = s), o() + return ((At = s), o()) } finally { At = i } @@ -15732,7 +15744,7 @@ if (a !== s && a.form === s.form) { var u = Db(a) if (!u) throw Error(p(90)) - Wa(a), bb(a, u) + ;(Wa(a), bb(a, u)) } } } @@ -15745,7 +15757,7 @@ } }), (Gb = Qk), - (Hb = Rk) + (Hb = Rk)) var uo = { usingClientEntryPoint: !1, Events: [Cb, ue, Db, Eb, Fb, Qk] }, po = { findFiberByHostInstance: Wc, @@ -15787,10 +15799,10 @@ var fo = __REACT_DEVTOOLS_GLOBAL_HOOK__ if (!fo.isDisabled && fo.supportsFiber) try { - ;(_t = fo.inject(ho)), (St = fo) + ;((_t = fo.inject(ho)), (St = fo)) } catch (Re) {} } - ;(o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = uo), + ;((o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = uo), (o.createPortal = function (s, o) { var i = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null if (!nl(o)) throw Error(p(200)) @@ -15855,10 +15867,10 @@ a) ) for (s = 0; s < a.length; s++) - (u = (u = (i = a[s])._getVersion)(i._source)), + ((u = (u = (i = a[s])._getVersion)(i._source)), null == o.mutableSourceEagerHydrationData ? (o.mutableSourceEagerHydrationData = [i, u]) - : o.mutableSourceEagerHydrationData.push(i, u) + : o.mutableSourceEagerHydrationData.push(i, u)) return new ml(o) }), (o.render = function (s, o, i) { @@ -15871,7 +15883,7 @@ !!s._reactRootContainer && (Rk(function () { rl(null, null, s, !1, function () { - ;(s._reactRootContainer = null), (s[fn] = null) + ;((s._reactRootContainer = null), (s[fn] = null)) }) }), !0) @@ -15883,7 +15895,7 @@ if (null == s || void 0 === s._reactInternals) throw Error(p(38)) return rl(s, o, i, !1, a) }), - (o.version = '18.3.1-next-f1338f8080-20240426') + (o.version = '18.3.1-next-f1338f8080-20240426')) }, 22574: (s, o) => { 'use strict' @@ -15981,7 +15993,7 @@ ], x = new Array(64) function Sha256() { - this.init(), (this._w = x), u.call(this, 64, 56) + ;(this.init(), (this._w = x), u.call(this, 64, 56)) } function ch(s, o, i) { return i ^ (s & (o ^ i)) @@ -15998,7 +16010,7 @@ function gamma0(s) { return ((s >>> 7) | (s << 25)) ^ ((s >>> 18) | (s << 14)) ^ (s >>> 3) } - a(Sha256, u), + ;(a(Sha256, u), (Sha256.prototype.init = function () { return ( (this._a = 1779033703), @@ -16039,23 +16051,23 @@ for (var U = 0; U < 64; ++U) { var V = (B + sigma1(C) + ch(C, j, L) + w[U] + i[U]) | 0, z = (sigma0(a) + maj(a, u, _)) | 0 - ;(B = L), + ;((B = L), (L = j), (j = C), (C = (x + V) | 0), (x = _), (_ = u), (u = a), - (a = (V + z) | 0) + (a = (V + z) | 0)) } - ;(this._a = (a + this._a) | 0), + ;((this._a = (a + this._a) | 0), (this._b = (u + this._b) | 0), (this._c = (_ + this._c) | 0), (this._d = (x + this._d) | 0), (this._e = (C + this._e) | 0), (this._f = (j + this._f) | 0), (this._g = (L + this._g) | 0), - (this._h = (B + this._h) | 0) + (this._h = (B + this._h) | 0)) }), (Sha256.prototype._hash = function () { var s = _.allocUnsafe(32) @@ -16071,7 +16083,7 @@ s ) }), - (s.exports = Sha256) + (s.exports = Sha256)) }, 24168: (s, o, i) => { var a = i(91033), @@ -16089,7 +16101,6 @@ B = Array(L + u), $ = this && this !== _ && this instanceof wrapper ? C : s; ++j < L; - ) B[j] = w[j] for (; u--; ) B[j++] = arguments[++o] @@ -16305,7 +16316,7 @@ 24677: (s, o, i) => { 'use strict' var a = i(81214).DebounceInput - ;(a.DebounceInput = a), (s.exports = a) + ;((a.DebounceInput = a), (s.exports = a)) }, 24713: (s, o, i) => { var a = i(2523), @@ -16316,7 +16327,7 @@ var x = null == s ? 0 : s.length if (!x) return -1 var C = null == i ? 0 : _(i) - return C < 0 && (C = w(x + C, 0)), a(s, u(o, 3), C) + return (C < 0 && (C = w(x + C, 0)), a(s, u(o, 3), C)) } }, 24739: (s, o, i) => { @@ -16341,7 +16352,7 @@ $ = i(40154), U = TypeError, Result = function (s, o) { - ;(this.stopped = s), (this.result = o) + ;((this.stopped = s), (this.result = o)) }, V = Result.prototype s.exports = function (s, o, i) { @@ -16359,7 +16370,7 @@ ye = !(!i || !i.INTERRUPTED), be = a(o, le), stop = function (s) { - return z && $(z, 'normal', s), new Result(!0, s) + return (z && $(z, 'normal', s), new Result(!0, s)) }, callFn = function (s) { return pe @@ -16393,10 +16404,10 @@ s.exports = function baseSlice(s, o, i) { var a = -1, u = s.length - o < 0 && (o = -o > u ? 0 : u + o), + ;(o < 0 && (o = -o > u ? 0 : u + o), (i = i > u ? u : i) < 0 && (i += u), (u = o > i ? 0 : (i - o) >>> 0), - (o >>>= 0) + (o >>>= 0)) for (var _ = Array(u); ++a < u; ) _[a] = s[a + o] return _ } @@ -16421,7 +16432,7 @@ _typeof(s) ) } - Object.defineProperty(o, '__esModule', { value: !0 }), (o.CopyToClipboard = void 0) + ;(Object.defineProperty(o, '__esModule', { value: !0 }), (o.CopyToClipboard = void 0)) var a = _interopRequireDefault(i(96540)), u = _interopRequireDefault(i(17965)), _ = ['text', 'onCopy', 'options', 'children'] @@ -16432,11 +16443,11 @@ var i = Object.keys(s) if (Object.getOwnPropertySymbols) { var a = Object.getOwnPropertySymbols(s) - o && + ;(o && (a = a.filter(function (o) { return Object.getOwnPropertyDescriptor(s, o).enumerable })), - i.push.apply(i, a) + i.push.apply(i, a)) } return i } @@ -16465,25 +16476,25 @@ a, u = {}, _ = Object.keys(s) - for (a = 0; a < _.length; a++) (i = _[a]), o.indexOf(i) >= 0 || (u[i] = s[i]) + for (a = 0; a < _.length; a++) ((i = _[a]), o.indexOf(i) >= 0 || (u[i] = s[i])) return u })(s, o) if (Object.getOwnPropertySymbols) { var _ = Object.getOwnPropertySymbols(s) for (a = 0; a < _.length; a++) - (i = _[a]), + ((i = _[a]), o.indexOf(i) >= 0 || - (Object.prototype.propertyIsEnumerable.call(s, i) && (u[i] = s[i])) + (Object.prototype.propertyIsEnumerable.call(s, i) && (u[i] = s[i]))) } return u } function _defineProperties(s, o) { for (var i = 0; i < o.length; i++) { var a = o[i] - ;(a.enumerable = a.enumerable || !1), + ;((a.enumerable = a.enumerable || !1), (a.configurable = !0), 'value' in a && (a.writable = !0), - Object.defineProperty(s, a.key, a) + Object.defineProperty(s, a.key, a)) } } function _setPrototypeOf(s, o) { @@ -16491,7 +16502,7 @@ (_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(s, o) { - return (s.__proto__ = o), s + return ((s.__proto__ = o), s) }), _setPrototypeOf(s, o) ) @@ -16503,7 +16514,8 @@ if ('function' == typeof Proxy) return !0 try { return ( - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0 + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), + !0 ) } catch (s) { return !1 @@ -16556,11 +16568,11 @@ !(function _inherits(s, o) { if ('function' != typeof o && null !== o) throw new TypeError('Super expression must either be null or a function') - ;(s.prototype = Object.create(o && o.prototype, { + ;((s.prototype = Object.create(o && o.prototype, { constructor: { value: s, writable: !0, configurable: !0 }, })), Object.defineProperty(s, 'prototype', { writable: !1 }), - o && _setPrototypeOf(s, o) + o && _setPrototypeOf(s, o)) })(CopyToClipboard, s) var o = _createSuper(CopyToClipboard) function CopyToClipboard() { @@ -16582,8 +16594,8 @@ C = i.options, j = a.default.Children.only(x), L = (0, u.default)(_, C) - w && w(_, L), - j && j.props && 'function' == typeof j.props.onClick && j.props.onClick(o) + ;(w && w(_, L), + j && j.props && 'function' == typeof j.props.onClick && j.props.onClick(o)) } ), s @@ -16615,8 +16627,8 @@ CopyToClipboard ) })(a.default.PureComponent) - ;(o.CopyToClipboard = w), - _defineProperty(w, 'defaultProps', { onCopy: void 0, options: void 0 }) + ;((o.CopyToClipboard = w), + _defineProperty(w, 'defaultProps', { onCopy: void 0, options: void 0 })) }, 25382: (s, o, i) => { 'use strict' @@ -16638,13 +16650,13 @@ } function Duplex(s) { if (!(this instanceof Duplex)) return new Duplex(s) - _.call(this, s), + ;(_.call(this, s), w.call(this, s), (this.allowHalfOpen = !0), s && (!1 === s.readable && (this.readable = !1), !1 === s.writable && (this.writable = !1), - !1 === s.allowHalfOpen && ((this.allowHalfOpen = !1), this.once('end', onend))) + !1 === s.allowHalfOpen && ((this.allowHalfOpen = !1), this.once('end', onend)))) } function onend() { this._writableState.ended || a.nextTick(onEndNT, this) @@ -16652,7 +16664,7 @@ function onEndNT(s) { s.end() } - Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { + ;(Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { enumerable: !1, get: function get() { return this._writableState.highWaterMark @@ -16685,7 +16697,7 @@ void 0 !== this._writableState && ((this._readableState.destroyed = s), (this._writableState.destroyed = s)) }, - }) + })) }, 25594: (s, o, i) => { 'use strict' @@ -16757,7 +16769,7 @@ a(z, function (i, a) { if (!o) try { - i(s), (o = $(a, 1)) + ;(i(s), (o = $(a, 1))) } catch (s) {} }), o @@ -16818,7 +16830,7 @@ break } } - return C.delete(s), C.delete(o), z + return (C.delete(s), C.delete(o), z) } }, 26025: (s, o, i) => { @@ -16848,7 +16860,7 @@ return w[_++] }, slurpNumber = function () { - for (var i = ''; /\d/.test(s[x]); ) (i += s[x++]), (o = s[x]) + for (var i = ''; /\d/.test(s[x]); ) ((i += s[x++]), (o = s[x])) return i.length > 0 ? parseInt(i) : null }; x < C; @@ -16878,8 +16890,8 @@ j += parseInt(nextArg(), 10) break case 'f': - ;(a = String(parseFloat(nextArg()).toFixed(u || 6))), - (j += B ? a : a.replace(/^0/, '')) + ;((a = String(parseFloat(nextArg()).toFixed(u || 6))), + (j += B ? a : a.replace(/^0/, ''))) break case 'j': j += JSON.stringify(nextArg()) @@ -16902,7 +16914,7 @@ else '%' === o ? (L = !0) : (j += o) return j } - ;((o = s.exports = format).format = format), + ;(((o = s.exports = format).format = format), (o.vsprintf = function vsprintf(s, o) { return format.apply(null, [s].concat(o)) }), @@ -16910,7 +16922,7 @@ 'function' == typeof console.log && (o.printf = function printf() { console.log(format.apply(null, arguments)) - }) + })) })() }, 26571: (s) => { @@ -17173,9 +17185,9 @@ w = i(92861).Buffer, x = new Array(64) function Sha224() { - this.init(), (this._w = x), _.call(this, 64, 56) + ;(this.init(), (this._w = x), _.call(this, 64, 56)) } - a(Sha224, u), + ;(a(Sha224, u), (Sha224.prototype.init = function () { return ( (this._a = 3238371032), @@ -17202,14 +17214,14 @@ s ) }), - (s.exports = Sha224) + (s.exports = Sha224)) }, 27096: (s, o, i) => { const a = i(87586), u = i(6205), _ = i(10023), w = i(8048) - ;(s.exports = (s) => { + ;((s.exports = (s) => { var o, i, x = 0, @@ -17265,14 +17277,14 @@ var U '^' === $[x] ? ((U = !0), x++) : (U = !1) var V = a.tokenizeClass($.slice(x), s) - ;(x += V[1]), L.push({ type: u.SET, set: V[0], not: U }) + ;((x += V[1]), L.push({ type: u.SET, set: V[0], not: U })) break case '.': L.push(_.anyChar()) break case '(': var z = { type: u.GROUP, stack: [], remember: !0 } - '?' === (i = $[x]) && + ;('?' === (i = $[x]) && ((i = $[x + 1]), (x += 2), '=' === i @@ -17288,16 +17300,16 @@ L.push(z), B.push(j), (j = z), - (L = z.stack) + (L = z.stack)) break case ')': - 0 === B.length && a.error(s, 'Unmatched ) at column ' + (x - 1)), - (L = (j = B.pop()).options ? j.options[j.options.length - 1] : j.stack) + ;(0 === B.length && a.error(s, 'Unmatched ) at column ' + (x - 1)), + (L = (j = B.pop()).options ? j.options[j.options.length - 1] : j.stack)) break case '|': j.options || ((j.options = [j.stack]), delete j.stack) var Y = [] - j.options.push(Y), (L = Y) + ;(j.options.push(Y), (L = Y)) break case '{': var Z, @@ -17312,23 +17324,23 @@ : L.push({ type: u.CHAR, value: 123 }) break case '?': - 0 === L.length && repeatErr(x), - L.push({ type: u.REPETITION, min: 0, max: 1, value: L.pop() }) + ;(0 === L.length && repeatErr(x), + L.push({ type: u.REPETITION, min: 0, max: 1, value: L.pop() })) break case '+': - 0 === L.length && repeatErr(x), - L.push({ type: u.REPETITION, min: 1, max: 1 / 0, value: L.pop() }) + ;(0 === L.length && repeatErr(x), + L.push({ type: u.REPETITION, min: 1, max: 1 / 0, value: L.pop() })) break case '*': - 0 === L.length && repeatErr(x), - L.push({ type: u.REPETITION, min: 0, max: 1 / 0, value: L.pop() }) + ;(0 === L.length && repeatErr(x), + L.push({ type: u.REPETITION, min: 0, max: 1 / 0, value: L.pop() })) break default: L.push({ type: u.CHAR, value: i.charCodeAt(0) }) } - return 0 !== B.length && a.error(s, 'Unterminated group'), C + return (0 !== B.length && a.error(s, 'Unterminated group'), C) }), - (s.exports.types = u) + (s.exports.types = u)) }, 27301: (s) => { s.exports = function baseUnary(s) { @@ -17339,7 +17351,7 @@ }, 27374: (s, o) => { 'use strict' - Object.defineProperty(o, '__esModule', { value: !0 }), + ;(Object.defineProperty(o, '__esModule', { value: !0 }), (o.default = function (s, o, i) { if (void 0 === s) throw new Error( @@ -17350,7 +17362,7 @@ '" action. To ignore an action, you must explicitly return the previous state.' ) }), - (s.exports = o.default) + (s.exports = o.default)) }, 27534: (s, o, i) => { var a = i(72552), @@ -17367,7 +17379,7 @@ w = [1518500249, 1859775393, -1894007588, -899497514], x = new Array(80) function Sha() { - this.init(), (this._w = x), u.call(this, 64, 56) + ;(this.init(), (this._w = x), u.call(this, 64, 56)) } function rotl30(s) { return (s << 30) | (s >>> 2) @@ -17375,7 +17387,7 @@ function ft(s, o, i, a) { return 0 === s ? (o & i) | (~o & a) : 2 === s ? (o & i) | (o & a) | (i & a) : o ^ i ^ a } - a(Sha, u), + ;(a(Sha, u), (Sha.prototype.init = function () { return ( (this._a = 1732584193), @@ -17404,13 +17416,13 @@ for (var L = 0; L < 80; ++L) { var B = ~~(L / 20), $ = 0 | ((((o = a) << 5) | (o >>> 27)) + ft(B, u, _, x) + C + i[L] + w[B]) - ;(C = x), (x = _), (_ = rotl30(u)), (u = a), (a = $) + ;((C = x), (x = _), (_ = rotl30(u)), (u = a), (a = $)) } - ;(this._a = (a + this._a) | 0), + ;((this._a = (a + this._a) | 0), (this._b = (u + this._b) | 0), (this._c = (_ + this._c) | 0), (this._d = (x + this._d) | 0), - (this._e = (C + this._e) | 0) + (this._e = (C + this._e) | 0)) }), (Sha.prototype._hash = function () { var s = _.allocUnsafe(20) @@ -17423,7 +17435,7 @@ s ) }), - (s.exports = Sha) + (s.exports = Sha)) }, 28077: (s) => { s.exports = function baseHasIn(s, o) { @@ -17473,7 +17485,7 @@ var a = i(25160) s.exports = function castSlice(s, o, i) { var u = s.length - return (i = void 0 === i ? u : i), !o && i >= u ? s : a(s, o, i) + return ((i = void 0 === i ? u : i), !o && i >= u ? s : a(s, o, i)) } }, 28879: (s, o, i) => { @@ -17551,9 +17563,8 @@ ee = Z.length, ie = 0; ee > ie; - ) - (z = Z[ie++]), (a && !_(U, Y, z)) || (i[z] = Y[z]) + ((z = Z[ie++]), (a && !_(U, Y, z)) || (i[z] = Y[z])) return i } : $ @@ -17572,7 +17583,7 @@ var a = (i - 1) >>> 1, u = s[a] if (!(0 < g(u, o))) break e - ;(s[a] = o), (s[i] = u), (i = a) + ;((s[a] = o), (s[i] = u), (i = a)) } } function h(s) { @@ -17595,7 +17606,7 @@ : ((s[a] = x), (s[w] = i), (a = w)) else { if (!(C < u && 0 > g(j, i))) break e - ;(s[a] = j), (s[C] = i), (a = C) + ;((s[a] = j), (s[C] = i), (a = C)) } } } @@ -17633,42 +17644,42 @@ if (null === o.callback) k(w) else { if (!(o.startTime <= s)) break - k(w), (o.sortIndex = o.expirationTime), f(_, o) + ;(k(w), (o.sortIndex = o.expirationTime), f(_, o)) } o = h(w) } } function H(s) { if ((($ = !1), G(s), !B)) - if (null !== h(_)) (B = !0), I(J) + if (null !== h(_)) ((B = !0), I(J)) else { var o = h(w) null !== o && K(H, o.startTime - s) } } function J(s, i) { - ;(B = !1), $ && (($ = !1), V(ie), (ie = -1)), (L = !0) + ;((B = !1), $ && (($ = !1), V(ie), (ie = -1)), (L = !0)) var a = j try { for (G(i), C = h(_); null !== C && (!(C.expirationTime > i) || (s && !M())); ) { var u = C.callback if ('function' == typeof u) { - ;(C.callback = null), (j = C.priorityLevel) + ;((C.callback = null), (j = C.priorityLevel)) var x = u(C.expirationTime <= i) - ;(i = o.unstable_now()), + ;((i = o.unstable_now()), 'function' == typeof x ? (C.callback = x) : C === h(_) && k(_), - G(i) + G(i)) } else k(_) C = h(_) } if (null !== C) var U = !0 else { var z = h(w) - null !== z && K(H, z.startTime - i), (U = !1) + ;(null !== z && K(H, z.startTime - i), (U = !1)) } return U } finally { - ;(C = null), (j = a), (L = !1) + ;((C = null), (j = a), (L = !1)) } } 'undefined' != typeof navigator && @@ -17703,23 +17714,23 @@ else if ('undefined' != typeof MessageChannel) { var le = new MessageChannel(), pe = le.port2 - ;(le.port1.onmessage = R), + ;((le.port1.onmessage = R), (Y = function () { pe.postMessage(null) - }) + })) } else Y = function () { U(R, 0) } function I(s) { - ;(ee = s), Z || ((Z = !0), Y()) + ;((ee = s), Z || ((Z = !0), Y())) } function K(s, i) { ie = U(function () { s(o.unstable_now()) }, i) } - ;(o.unstable_IdlePriority = 5), + ;((o.unstable_IdlePriority = 5), (o.unstable_ImmediatePriority = 1), (o.unstable_LowPriority = 4), (o.unstable_NormalPriority = 3), @@ -17835,7 +17846,7 @@ j = i } } - }) + })) }, 30041: (s, o, i) => { 'use strict' @@ -17901,7 +17912,7 @@ u = function hasPropertyDescriptors() { return !!a } - ;(u.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { + ;((u.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { if (!a) return null try { return 1 !== a([], 'length', { value: 1 }).length @@ -17909,7 +17920,7 @@ return !0 } }), - (s.exports = u) + (s.exports = u)) }, 30641: (s, o, i) => { var a = i(86649), @@ -17939,29 +17950,29 @@ var a = i(39344), u = i(94033) function LazyWrapper(s) { - ;(this.__wrapped__ = s), + ;((this.__wrapped__ = s), (this.__actions__ = []), (this.__dir__ = 1), (this.__filtered__ = !1), (this.__iteratees__ = []), (this.__takeCount__ = 4294967295), - (this.__views__ = []) + (this.__views__ = [])) } - ;(LazyWrapper.prototype = a(u.prototype)), + ;((LazyWrapper.prototype = a(u.prototype)), (LazyWrapper.prototype.constructor = LazyWrapper), - (s.exports = LazyWrapper) + (s.exports = LazyWrapper)) }, 31175: (s, o, i) => { var a = i(26025) s.exports = function listCacheSet(s, o) { var i = this.__data__, u = a(i, s) - return u < 0 ? (++this.size, i.push([s, o])) : (i[u][1] = o), this + return (u < 0 ? (++this.size, i.push([s, o])) : (i[u][1] = o), this) } }, 31380: (s) => { s.exports = function setCacheAdd(s) { - return this.__data__.set(s, '__lodash_hash_undefined__'), this + return (this.__data__.set(s, '__lodash_hash_undefined__'), this) } }, 31499: (s) => { @@ -18021,9 +18032,9 @@ w = i(92861).Buffer, x = new Array(160) function Sha384() { - this.init(), (this._w = x), _.call(this, 128, 112) + ;(this.init(), (this._w = x), _.call(this, 128, 112)) } - a(Sha384, u), + ;(a(Sha384, u), (Sha384.prototype.init = function () { return ( (this._ah = 3418070365), @@ -18048,7 +18059,7 @@ (Sha384.prototype._hash = function () { var s = w.allocUnsafe(48) function writeInt64BE(o, i, a) { - s.writeInt32BE(o, a), s.writeInt32BE(i, a + 4) + ;(s.writeInt32BE(o, a), s.writeInt32BE(i, a + 4)) } return ( writeInt64BE(this._ah, this._al, 0), @@ -18060,7 +18071,7 @@ s ) }), - (s.exports = Sha384) + (s.exports = Sha384)) }, 32865: (s, o, i) => { var a = i(19570), @@ -18077,7 +18088,7 @@ 34035: (s, o, i) => { const a = i(3110), u = i(86804) - ;(o.g$ = a), + ;((o.g$ = a), (o.KeyValuePair = i(55973)), (o.G6 = u.ArraySlice), (o.ot = u.ObjectSlice), @@ -18093,7 +18104,7 @@ (o.Ft = u.LinkElement), (o.e = u.refract), i(85105), - i(75147) + i(75147)) }, 34084: (s, o, i) => { 'use strict' @@ -18378,27 +18389,28 @@ function EventEmitter() { EventEmitter.init.call(this) } - ;(s.exports = EventEmitter), + ;((s.exports = EventEmitter), (s.exports.once = function once(s, o) { return new Promise(function (i, a) { function errorListener(i) { - s.removeListener(o, resolver), a(i) + ;(s.removeListener(o, resolver), a(i)) } function resolver() { - 'function' == typeof s.removeListener && s.removeListener('error', errorListener), - i([].slice.call(arguments)) + ;('function' == typeof s.removeListener && + s.removeListener('error', errorListener), + i([].slice.call(arguments))) } - eventTargetAgnosticAddListener(s, o, resolver, { once: !0 }), + ;(eventTargetAgnosticAddListener(s, o, resolver, { once: !0 }), 'error' !== o && (function addErrorHandlerIfEventEmitter(s, o, i) { 'function' == typeof s.on && eventTargetAgnosticAddListener(s, 'error', o, i) - })(s, errorListener, { once: !0 }) + })(s, errorListener, { once: !0 })) }) }), (EventEmitter.EventEmitter = EventEmitter), (EventEmitter.prototype._events = void 0), (EventEmitter.prototype._eventsCount = 0), - (EventEmitter.prototype._maxListeners = void 0) + (EventEmitter.prototype._maxListeners = void 0)) var _ = 10 function checkListener(s) { if ('function' != typeof s) @@ -18420,7 +18432,7 @@ (w = _[o])), void 0 === w) ) - (w = _[o] = i), ++s._eventsCount + ((w = _[o] = i), ++s._eventsCount) else if ( ('function' == typeof w ? (w = _[o] = a ? [i, w] : [w, i]) @@ -18437,13 +18449,13 @@ String(o) + ' listeners added. Use emitter.setMaxListeners() to increase limit' ) - ;(x.name = 'MaxListenersExceededWarning'), + ;((x.name = 'MaxListenersExceededWarning'), (x.emitter = s), (x.type = o), (x.count = w.length), (function ProcessEmitWarning(s) { console && console.warn && console.warn(s) - })(x) + })(x)) } return s } @@ -18460,7 +18472,7 @@ function _onceWrap(s, o, i) { var a = { fired: !1, wrapFn: void 0, target: s, type: o, listener: i }, u = onceWrapper.bind(a) - return (u.listener = i), (a.wrapFn = u), u + return ((u.listener = i), (a.wrapFn = u), u) } function _listeners(s, o, i) { var a = s._events @@ -18501,11 +18513,11 @@ 'The "emitter" argument must be of type EventEmitter. Received type ' + typeof s ) s.addEventListener(o, function wrapListener(u) { - a.once && s.removeEventListener(o, wrapListener), i(u) + ;(a.once && s.removeEventListener(o, wrapListener), i(u)) }) } } - Object.defineProperty(EventEmitter, 'defaultMaxListeners', { + ;(Object.defineProperty(EventEmitter, 'defaultMaxListeners', { enumerable: !0, get: function () { return _ @@ -18521,9 +18533,9 @@ }, }), (EventEmitter.init = function () { - ;(void 0 !== this._events && this._events !== Object.getPrototypeOf(this)._events) || + ;((void 0 !== this._events && this._events !== Object.getPrototypeOf(this)._events) || ((this._events = Object.create(null)), (this._eventsCount = 0)), - (this._maxListeners = this._maxListeners || void 0) + (this._maxListeners = this._maxListeners || void 0)) }), (EventEmitter.prototype.setMaxListeners = function setMaxListeners(s) { if ('number' != typeof s || s < 0 || u(s)) @@ -18532,7 +18544,7 @@ s + '.' ) - return (this._maxListeners = s), this + return ((this._maxListeners = s), this) }), (EventEmitter.prototype.getMaxListeners = function getMaxListeners() { return _getMaxListeners(this) @@ -18567,10 +18579,10 @@ return _addListener(this, s, o, !0) }), (EventEmitter.prototype.once = function once(s, o) { - return checkListener(o), this.on(s, _onceWrap(this, s, o)), this + return (checkListener(o), this.on(s, _onceWrap(this, s, o)), this) }), (EventEmitter.prototype.prependOnceListener = function prependOnceListener(s, o) { - return checkListener(o), this.prependListener(s, _onceWrap(this, s, o)), this + return (checkListener(o), this.prependListener(s, _onceWrap(this, s, o)), this) }), (EventEmitter.prototype.removeListener = function removeListener(s, o) { var i, a, u, _, w @@ -18584,18 +18596,18 @@ else if ('function' != typeof i) { for (u = -1, _ = i.length - 1; _ >= 0; _--) if (i[_] === o || i[_].listener === o) { - ;(w = i[_].listener), (u = _) + ;((w = i[_].listener), (u = _)) break } if (u < 0) return this - 0 === u + ;(0 === u ? i.shift() : (function spliceOne(s, o) { for (; o + 1 < s.length; o++) s[o] = s[o + 1] s.pop() })(i, u), 1 === i.length && (a[s] = i[0]), - void 0 !== a.removeListener && this.emit('removeListener', s, w || o) + void 0 !== a.removeListener && this.emit('removeListener', s, w || o)) } return this }), @@ -18644,7 +18656,7 @@ (EventEmitter.prototype.listenerCount = listenerCount), (EventEmitter.prototype.eventNames = function eventNames() { return this._eventsCount > 0 ? o(this._events) : [] - }) + })) }, 37167: (s, o, i) => { var a = i(4901), @@ -18665,12 +18677,12 @@ var o = (this.__data__ = new a(s)) this.size = o.size } - ;(Stack.prototype.clear = u), + ;((Stack.prototype.clear = u), (Stack.prototype.delete = _), (Stack.prototype.get = w), (Stack.prototype.has = x), (Stack.prototype.set = C), - (s.exports = Stack) + (s.exports = Stack)) }, 37241: (s, o, i) => { var a = i(70695), @@ -18682,7 +18694,7 @@ }, 37257: (s, o, i) => { 'use strict' - i(96605), i(64502), i(36371), i(99363), i(7057) + ;(i(96605), i(64502), i(36371), i(99363), i(7057)) var a = i(92046) s.exports = a.AggregateError }, @@ -18782,7 +18794,7 @@ function invokeFunc(o) { var i = C, a = j - return (C = j = void 0), (V = o), (B = s.apply(a, i)) + return ((C = j = void 0), (V = o), (B = s.apply(a, i))) } function shouldInvoke(s) { var i = s - U @@ -18800,7 +18812,7 @@ ) } function trailingEdge(s) { - return ($ = void 0), Z && C ? invokeFunc(s) : ((C = j = void 0), B) + return (($ = void 0), Z && C ? invokeFunc(s) : ((C = j = void 0), B)) } function debounced() { var s = u(), @@ -18808,11 +18820,11 @@ if (((C = arguments), (j = this), (U = s), i)) { if (void 0 === $) return (function leadingEdge(s) { - return (V = s), ($ = setTimeout(timerExpired, o)), z ? invokeFunc(s) : B + return ((V = s), ($ = setTimeout(timerExpired, o)), z ? invokeFunc(s) : B) })(U) - if (Y) return clearTimeout($), ($ = setTimeout(timerExpired, o)), invokeFunc(U) + if (Y) return (clearTimeout($), ($ = setTimeout(timerExpired, o)), invokeFunc(U)) } - return void 0 === $ && ($ = setTimeout(timerExpired, o)), B + return (void 0 === $ && ($ = setTimeout(timerExpired, o)), B) } return ( (o = _(o) || 0), @@ -18821,7 +18833,7 @@ (L = (Y = 'maxWait' in i) ? w(_(i.maxWait) || 0, o) : L), (Z = 'trailing' in i ? !!i.trailing : Z)), (debounced.cancel = function cancel() { - void 0 !== $ && clearTimeout($), (V = 0), (C = U = j = $ = void 0) + ;(void 0 !== $ && clearTimeout($), (V = 0), (C = U = j = $ = void 0)) }), (debounced.flush = function flush() { return void 0 === $ ? B : trailingEdge(u()) @@ -18839,7 +18851,6 @@ for ( var _ = i.length, w = o ? _ : -1, x = Object(i); (o ? w-- : ++w < _) && !1 !== u(x[w], w, x); - ); return i } @@ -18874,9 +18885,9 @@ i = null == s ? 0 : s.length for (this.__data__ = new a(); ++o < i; ) this.add(s[o]) } - ;(SetCache.prototype.add = SetCache.prototype.push = u), + ;((SetCache.prototype.add = SetCache.prototype.push = u), (SetCache.prototype.has = _), - (s.exports = SetCache) + (s.exports = SetCache)) }, 39209: (s, o, i) => { 'use strict' @@ -18914,7 +18925,7 @@ if (u) return u(s) object.prototype = s var o = new object() - return (object.prototype = void 0), o + return ((object.prototype = void 0), o) } })() s.exports = _ @@ -18948,18 +18959,18 @@ } w = a(w, s) } catch (s) { - ;(x = !0), (w = s) + ;((x = !0), (w = s)) } if ('throw' === o) throw i if (x) throw w - return u(w), i + return (u(w), i) } }, 40239: (s, o, i) => { const a = i(10316) s.exports = class NumberElement extends a { constructor(s, o, i) { - super(s, o, i), (this.element = 'number') + ;(super(s, o, i), (this.element = 'number')) } primitive() { return 'number' @@ -19003,7 +19014,7 @@ }, 40961: (s, o, i) => { 'use strict' - !(function checkDCE() { + ;(!(function checkDCE() { if ( 'undefined' != typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && 'function' == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE @@ -19014,7 +19025,7 @@ console.error(s) } })(), - (s.exports = i(22551)) + (s.exports = i(22551))) }, 40975: (s, o, i) => { 'use strict' @@ -19025,7 +19036,7 @@ const a = i(10316) s.exports = class NullElement extends a { constructor(s, o, i) { - super(s || null, o, i), (this.element = 'null') + ;(super(s || null, o, i), (this.element = 'null')) } primitive() { return 'null' @@ -19121,23 +19132,23 @@ s.exports = class RandExp { constructor(s, o) { if ((this._setDefaults(s), s instanceof RegExp)) - (this.ignoreCase = s.ignoreCase), (this.multiline = s.multiline), (s = s.source) + ((this.ignoreCase = s.ignoreCase), (this.multiline = s.multiline), (s = s.source)) else { if ('string' != typeof s) throw new Error('Expected a regexp or string') - ;(this.ignoreCase = o && -1 !== o.indexOf('i')), - (this.multiline = o && -1 !== o.indexOf('m')) + ;((this.ignoreCase = o && -1 !== o.indexOf('i')), + (this.multiline = o && -1 !== o.indexOf('m'))) } this.tokens = a(s) } _setDefaults(s) { - ;(this.max = + ;((this.max = null != s.max ? s.max : null != RandExp.prototype.max ? RandExp.prototype.max : 100), (this.defaultRange = s.defaultRange ? s.defaultRange : this.defaultRange.clone()), - s.randInt && (this.randInt = s.randInt) + s.randInt && (this.randInt = s.randInt)) } gen() { return this._gen(this.tokens, []) @@ -19157,7 +19168,7 @@ w++ ) a += this._gen(i[w], o) - return s.remember && (o[s.groupNumber] = a), a + return (s.remember && (o[s.groupNumber] = a), a) case _.POSITION: return '' case _.SET: @@ -19295,7 +19306,7 @@ x = i(36800) s.exports = function some(s, o, i) { var C = w(s) ? a : _ - return i && x(s, o, i) && (o = void 0), C(s, u(o, 3)) + return (i && x(s, o, i) && (o = void 0), C(s, u(o, 3))) } }, 42824: (s, o, i) => { @@ -19326,7 +19337,7 @@ var be = j(pe), _e = !be && B(pe), Se = !be && !_e && z(pe) - ;(fe = pe), + ;((fe = pe), be || _e || Se ? j(le) ? (fe = le) @@ -19339,9 +19350,9 @@ : (fe = []) : V(pe) || C(pe) ? ((fe = le), C(le) ? (fe = Z(le)) : (U(le) && !$(le)) || (fe = x(pe))) - : (ye = !1) + : (ye = !1)) } - ye && (ce.set(pe, fe), ie(fe, pe, ee, ae, ce), ce.delete(pe)), a(s, i, fe) + ;(ye && (ce.set(pe, fe), ie(fe, pe, ee, ae, ce), ce.delete(pe)), a(s, i, fe)) } } }, @@ -19357,7 +19368,7 @@ 'use strict' var a = i(45981), u = i(85587) - ;(o.highlight = highlight), + ;((o.highlight = highlight), (o.highlightAuto = function highlightAuto(s, o) { var i, w, @@ -19370,14 +19381,14 @@ U = -1 null == B && (B = _) if ('string' != typeof s) throw u('Expected `string` for value, got `%s`', s) - ;(w = { relevance: 0, language: null, value: [] }), - (i = { relevance: 0, language: null, value: [] }) + ;((w = { relevance: 0, language: null, value: [] }), + (i = { relevance: 0, language: null, value: [] })) for (; ++U < $; ) - (C = L[U]), + ((C = L[U]), a.getLanguage(C) && (((x = highlight(C, s, o)).language = C), x.relevance > w.relevance && (w = x), - x.relevance > i.relevance && ((w = i), (i = x))) + x.relevance > i.relevance && ((w = i), (i = x)))) w.language && (i.secondBest = w) return i }), @@ -19398,13 +19409,13 @@ i, a = this.stack if ('' === s) return - ;(o = a[a.length - 1]), + ;((o = a[a.length - 1]), (i = o.children[o.children.length - 1]) && 'text' === i.type ? (i.value += s) - : o.children.push({ type: 'text', value: s }) + : o.children.push({ type: 'text', value: s })) }), (Emitter.prototype.addKeyword = function addKeyword(s, o) { - this.openNode(o), this.addText(s), this.closeNode() + ;(this.openNode(o), this.addText(s), this.closeNode()) }), (Emitter.prototype.addSublanguage = function addSublanguage(s, o) { var i = this.stack, @@ -19430,7 +19441,7 @@ properties: { className: [i] }, children: [], } - a.children.push(u), o.push(u) + ;(a.children.push(u), o.push(u)) }), (Emitter.prototype.closeNode = function close() { this.stack.pop() @@ -19439,7 +19450,7 @@ (Emitter.prototype.finalize = noop), (Emitter.prototype.toHTML = function toHtmlNoop() { return '' - }) + })) var _ = 'hljs-' function highlight(s, o, i) { var w, @@ -19463,7 +19474,9 @@ } } function Emitter(s) { - ;(this.options = s), (this.rootNode = { children: [] }), (this.stack = [this.rootNode]) + ;((this.options = s), + (this.rootNode = { children: [] }), + (this.stack = [this.rootNode])) } function noop() {} }, @@ -19511,7 +19524,7 @@ })(o, i.length, i) : o.apply(s, i) } - return _(i) && (C.prototype = i), C + return (_(i) && (C.prototype = i), C) } }, 45083: (s, o, i) => { @@ -19539,7 +19552,7 @@ 'use strict' var a, u = i(65606) - ;(s.exports = Readable), (Readable.ReadableState = ReadableState) + ;((s.exports = Readable), (Readable.ReadableState = ReadableState)) i(37007).EventEmitter var _ = function EElistenerCount(s, o) { return s.listeners(o).length @@ -19573,7 +19586,7 @@ var le = z.errorOrDestroy, pe = ['error', 'close', 'destroy', 'pause', 'resume'] function ReadableState(s, o, u) { - ;(a = a || i(25382)), + ;((a = a || i(25382)), (s = s || {}), 'boolean' != typeof u && (u = o instanceof a), (this.objectMode = !!s.objectMode), @@ -19604,36 +19617,36 @@ s.encoding && (B || (B = i(83141).I), (this.decoder = new B(s.encoding)), - (this.encoding = s.encoding)) + (this.encoding = s.encoding))) } function Readable(s) { if (((a = a || i(25382)), !(this instanceof Readable))) return new Readable(s) var o = this instanceof a - ;(this._readableState = new ReadableState(s, this, o)), + ;((this._readableState = new ReadableState(s, this, o)), (this.readable = !0), s && ('function' == typeof s.read && (this._read = s.read), 'function' == typeof s.destroy && (this._destroy = s.destroy)), - w.call(this) + w.call(this)) } function readableAddChunk(s, o, i, a, u) { j('readableAddChunk', o) var _, w = s._readableState if (null === o) - (w.reading = !1), + ((w.reading = !1), (function onEofChunk(s, o) { if ((j('onEofChunk'), o.ended)) return if (o.decoder) { var i = o.decoder.end() i && i.length && (o.buffer.push(i), (o.length += o.objectMode ? 1 : i.length)) } - ;(o.ended = !0), + ;((o.ended = !0), o.sync ? emitReadable(s) : ((o.needReadable = !1), - o.emittedReadable || ((o.emittedReadable = !0), emitReadable_(s))) - })(s, w) + o.emittedReadable || ((o.emittedReadable = !0), emitReadable_(s)))) + })(s, w)) else if ( (u || (_ = (function chunkInvalid(s, o) { @@ -19664,24 +19677,24 @@ else if (w.ended) le(s, new ie()) else { if (w.destroyed) return !1 - ;(w.reading = !1), + ;((w.reading = !1), w.decoder && !i ? ((o = w.decoder.write(o)), w.objectMode || 0 !== o.length ? addChunk(s, w, o, !1) : maybeReadMore(s, w)) - : addChunk(s, w, o, !1) + : addChunk(s, w, o, !1)) } else a || ((w.reading = !1), maybeReadMore(s, w)) return !w.ended && (w.length < w.highWaterMark || 0 === w.length) } function addChunk(s, o, i, a) { - o.flowing && 0 === o.length && !o.sync + ;(o.flowing && 0 === o.length && !o.sync ? ((o.awaitDrain = 0), s.emit('data', i)) : ((o.length += o.objectMode ? 1 : i.length), a ? o.buffer.unshift(i) : o.buffer.push(i), o.needReadable && emitReadable(s)), - maybeReadMore(s, o) + maybeReadMore(s, o)) } - Object.defineProperty(Readable.prototype, 'destroyed', { + ;(Object.defineProperty(Readable.prototype, 'destroyed', { enumerable: !1, get: function get() { return void 0 !== this._readableState && this._readableState.destroyed @@ -19716,17 +19729,17 @@ (Readable.prototype.setEncoding = function (s) { B || (B = i(83141).I) var o = new B(s) - ;(this._readableState.decoder = o), - (this._readableState.encoding = this._readableState.decoder.encoding) + ;((this._readableState.decoder = o), + (this._readableState.encoding = this._readableState.decoder.encoding)) for (var a = this._readableState.buffer.head, u = ''; null !== a; ) - (u += o.write(a.data)), (a = a.next) + ((u += o.write(a.data)), (a = a.next)) return ( this._readableState.buffer.clear(), '' !== u && this._readableState.buffer.push(u), (this._readableState.length = u.length), this ) - }) + })) var de = 1073741824 function howMuchToRead(s, o) { return s <= 0 || (0 === o.length && o.ended) @@ -19756,21 +19769,21 @@ } function emitReadable(s) { var o = s._readableState - j('emitReadable', o.needReadable, o.emittedReadable), + ;(j('emitReadable', o.needReadable, o.emittedReadable), (o.needReadable = !1), o.emittedReadable || (j('emitReadable', o.flowing), (o.emittedReadable = !0), - u.nextTick(emitReadable_, s)) + u.nextTick(emitReadable_, s))) } function emitReadable_(s) { var o = s._readableState - j('emitReadable_', o.destroyed, o.length, o.ended), + ;(j('emitReadable_', o.destroyed, o.length, o.ended), o.destroyed || (!o.length && !o.ended) || (s.emit('readable'), (o.emittedReadable = !1)), (o.needReadable = !o.flowing && !o.ended && o.length <= o.highWaterMark), - flow(s) + flow(s)) } function maybeReadMore(s, o) { o.readingMore || ((o.readingMore = !0), u.nextTick(maybeReadMore_, s, o)) @@ -19781,7 +19794,6 @@ !o.reading && !o.ended && (o.length < o.highWaterMark || (o.flowing && 0 === o.length)); - ) { var i = o.length if ((j('maybeReadMore read 0'), s.read(0), i === o.length)) break @@ -19790,21 +19802,21 @@ } function updateReadableListening(s) { var o = s._readableState - ;(o.readableListening = s.listenerCount('readable') > 0), + ;((o.readableListening = s.listenerCount('readable') > 0), o.resumeScheduled && !o.paused ? (o.flowing = !0) - : s.listenerCount('data') > 0 && s.resume() + : s.listenerCount('data') > 0 && s.resume()) } function nReadingNextTick(s) { - j('readable nexttick read 0'), s.read(0) + ;(j('readable nexttick read 0'), s.read(0)) } function resume_(s, o) { - j('resume', o.reading), + ;(j('resume', o.reading), o.reading || s.read(0), (o.resumeScheduled = !1), s.emit('resume'), flow(s), - o.flowing && !o.reading && s.read(0) + o.flowing && !o.reading && s.read(0)) } function flow(s) { var o = s._readableState @@ -19828,8 +19840,8 @@ } function endReadable(s) { var o = s._readableState - j('endReadable', o.endEmitted), - o.endEmitted || ((o.ended = !0), u.nextTick(endReadableNT, o, s)) + ;(j('endReadable', o.endEmitted), + o.endEmitted || ((o.ended = !0), u.nextTick(endReadableNT, o, s))) } function endReadableNT(s, o) { if ( @@ -19846,8 +19858,8 @@ for (var i = 0, a = s.length; i < a; i++) if (s[i] === o) return i return -1 } - ;(Readable.prototype.read = function (s) { - j('read', s), (s = parseInt(s, 10)) + ;((Readable.prototype.read = function (s) { + ;(j('read', s), (s = parseInt(s, 10))) var o = this._readableState, i = s if ( @@ -19862,7 +19874,7 @@ null ) if (0 === (s = howMuchToRead(s, o)) && o.ended) - return 0 === o.length && endReadable(this), null + return (0 === o.length && endReadable(this), null) var a, u = o.needReadable return ( @@ -19904,16 +19916,16 @@ default: a.pipes.push(s) } - ;(a.pipesCount += 1), j('pipe count=%d opts=%j', a.pipesCount, o) + ;((a.pipesCount += 1), j('pipe count=%d opts=%j', a.pipesCount, o)) var w = (!o || !1 !== o.end) && s !== u.stdout && s !== u.stderr ? onend : unpipe function onunpipe(o, u) { - j('onunpipe'), + ;(j('onunpipe'), o === i && u && !1 === u.hasUnpiped && ((u.hasUnpiped = !0), (function cleanup() { - j('cleanup'), + ;(j('cleanup'), s.removeListener('close', onclose), s.removeListener('finish', onfinish), s.removeListener('drain', x), @@ -19923,19 +19935,19 @@ i.removeListener('end', unpipe), i.removeListener('data', ondata), (C = !0), - !a.awaitDrain || (s._writableState && !s._writableState.needDrain) || x() - })()) + !a.awaitDrain || (s._writableState && !s._writableState.needDrain) || x()) + })())) } function onend() { - j('onend'), s.end() + ;(j('onend'), s.end()) } - a.endEmitted ? u.nextTick(w) : i.once('end', w), s.on('unpipe', onunpipe) + ;(a.endEmitted ? u.nextTick(w) : i.once('end', w), s.on('unpipe', onunpipe)) var x = (function pipeOnDrain(s) { return function pipeOnDrainFunctionResult() { var o = s._readableState - j('pipeOnDrain', o.awaitDrain), + ;(j('pipeOnDrain', o.awaitDrain), o.awaitDrain && o.awaitDrain--, - 0 === o.awaitDrain && _(s, 'data') && ((o.flowing = !0), flow(s)) + 0 === o.awaitDrain && _(s, 'data') && ((o.flowing = !0), flow(s))) } })(i) s.on('drain', x) @@ -19943,28 +19955,28 @@ function ondata(o) { j('ondata') var u = s.write(o) - j('dest.write', u), + ;(j('dest.write', u), !1 === u && (((1 === a.pipesCount && a.pipes === s) || (a.pipesCount > 1 && -1 !== indexOf(a.pipes, s))) && !C && (j('false write response, pause', a.awaitDrain), a.awaitDrain++), - i.pause()) + i.pause())) } function onerror(o) { - j('onerror', o), + ;(j('onerror', o), unpipe(), s.removeListener('error', onerror), - 0 === _(s, 'error') && le(s, o) + 0 === _(s, 'error') && le(s, o)) } function onclose() { - s.removeListener('finish', onfinish), unpipe() + ;(s.removeListener('finish', onfinish), unpipe()) } function onfinish() { - j('onfinish'), s.removeListener('close', onclose), unpipe() + ;(j('onfinish'), s.removeListener('close', onclose), unpipe()) } function unpipe() { - j('unpipe'), i.unpipe(s) + ;(j('unpipe'), i.unpipe(s)) } return ( i.on('data', ondata), @@ -20000,7 +20012,7 @@ if (!s) { var a = o.pipes, u = o.pipesCount - ;(o.pipes = null), (o.pipesCount = 0), (o.flowing = !1) + ;((o.pipes = null), (o.pipesCount = 0), (o.flowing = !1)) for (var _ = 0; _ < u; _++) a[_].emit('unpipe', this, { hasUnpiped: !1 }) return this } @@ -20037,12 +20049,13 @@ (Readable.prototype.addListener = Readable.prototype.on), (Readable.prototype.removeListener = function (s, o) { var i = w.prototype.removeListener.call(this, s, o) - return 'readable' === s && u.nextTick(updateReadableListening, this), i + return ('readable' === s && u.nextTick(updateReadableListening, this), i) }), (Readable.prototype.removeAllListeners = function (s) { var o = w.prototype.removeAllListeners.apply(this, arguments) return ( - ('readable' !== s && void 0 !== s) || u.nextTick(updateReadableListening, this), o + ('readable' !== s && void 0 !== s) || u.nextTick(updateReadableListening, this), + o ) }), (Readable.prototype.resume = function () { @@ -20095,14 +20108,14 @@ for (var _ = 0; _ < pe.length; _++) s.on(pe[_], this.emit.bind(this, pe[_])) return ( (this._read = function (o) { - j('wrapped _read', o), a && ((a = !1), s.resume()) + ;(j('wrapped _read', o), a && ((a = !1), s.resume())) }), this ) }), 'function' == typeof Symbol && (Readable.prototype[Symbol.asyncIterator] = function () { - return void 0 === $ && ($ = i(2955)), $(this) + return (void 0 === $ && ($ = i(2955)), $(this)) }), Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { enumerable: !1, @@ -20134,8 +20147,8 @@ }), 'function' == typeof Symbol && (Readable.from = function (s, o) { - return void 0 === U && (U = i(55157)), U(Readable, s, o) - }) + return (void 0 === U && (U = i(55157)), U(Readable, s, o)) + })) }, 45434: (s) => { var o = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/ @@ -20218,7 +20231,9 @@ o.default = i class Response { constructor(s) { - void 0 === s.data && (s.data = {}), (this.data = s.data), (this.isMatchIgnored = !1) + ;(void 0 === s.data && (s.data = {}), + (this.data = s.data), + (this.isMatchIgnored = !1)) } ignoreMatch() { this.isMatchIgnored = !0 @@ -20245,7 +20260,7 @@ const emitsWrappingTags = (s) => !!s.kind class HTMLRenderer { constructor(s, o) { - ;(this.buffer = ''), (this.classPrefix = o.classPrefix), s.walk(this) + ;((this.buffer = ''), (this.classPrefix = o.classPrefix), s.walk(this)) } addText(s) { this.buffer += escapeHTML(s) @@ -20253,7 +20268,7 @@ openNode(s) { if (!emitsWrappingTags(s)) return let o = s.kind - s.sublanguage || (o = `${this.classPrefix}${o}`), this.span(o) + ;(s.sublanguage || (o = `${this.classPrefix}${o}`), this.span(o)) } closeNode(s) { emitsWrappingTags(s) && (this.buffer += '') @@ -20267,7 +20282,7 @@ } class TokenTree { constructor() { - ;(this.rootNode = { children: [] }), (this.stack = [this.rootNode]) + ;((this.rootNode = { children: [] }), (this.stack = [this.rootNode])) } get top() { return this.stack[this.stack.length - 1] @@ -20280,7 +20295,7 @@ } openNode(s) { const o = { kind: s, children: [] } - this.add(o), this.stack.push(o) + ;(this.add(o), this.stack.push(o)) } closeNode() { if (this.stack.length > 1) return this.stack.pop() @@ -20315,7 +20330,7 @@ } class TokenTreeEmitter extends TokenTree { constructor(s) { - super(), (this.options = s) + ;(super(), (this.options = s)) } addKeyword(s, o) { '' !== s && (this.openNode(o), this.addText(s), this.closeNode()) @@ -20325,7 +20340,7 @@ } addSublanguage(s, o) { const i = s.root - ;(i.kind = o), (i.sublanguage = !0), this.add(i) + ;((i.kind = o), (i.sublanguage = !0), this.add(i)) } toHTML() { return new HTMLRenderer(this, this.options).value() @@ -20469,7 +20484,7 @@ function compileMatch(s, o) { if (s.match) { if (s.begin || s.end) throw new Error('begin & end are not supported with match') - ;(s.begin = s.match), delete s.match + ;((s.begin = s.match), delete s.match) } } function compileRelevance(s, o) { @@ -20501,11 +20516,11 @@ a ) function compileList(s, i) { - o && (i = i.map((s) => s.toLowerCase())), + ;(o && (i = i.map((s) => s.toLowerCase())), i.forEach(function (o) { const i = o.split('|') a[i[0]] = [s, scoreForKeyword(i[0], i[1])] - }) + })) } } function scoreForKeyword(s, o) { @@ -20523,24 +20538,24 @@ } class MultiRegex { constructor() { - ;(this.matchIndexes = {}), + ;((this.matchIndexes = {}), (this.regexes = []), (this.matchAt = 1), - (this.position = 0) + (this.position = 0)) } addRule(s, o) { - ;(o.position = this.position++), + ;((o.position = this.position++), (this.matchIndexes[this.matchAt] = o), this.regexes.push([o, s]), (this.matchAt += (function countMatchGroups(s) { return new RegExp(s.toString() + '|').exec('').length - 1 - })(s) + 1) + })(s) + 1)) } compile() { 0 === this.regexes.length && (this.exec = () => null) const s = this.regexes.map((s) => s[1]) - ;(this.matcherRe = langRe( + ;((this.matcherRe = langRe( (function join(s, o = '|') { let i = 0 return s @@ -20555,11 +20570,11 @@ _ += u break } - ;(_ += u.substring(0, s.index)), + ;((_ += u.substring(0, s.index)), (u = u.substring(s.index + s[0].length)), '\\' === s[0][0] && s[1] ? (_ += '\\' + String(Number(s[1]) + o)) - : ((_ += s[0]), '(' === s[0] && i++) + : ((_ += s[0]), '(' === s[0] && i++)) } return _ }) @@ -20568,7 +20583,7 @@ })(s), !0 )), - (this.lastIndex = 0) + (this.lastIndex = 0)) } exec(s) { this.matcherRe.lastIndex = this.lastIndex @@ -20576,16 +20591,16 @@ if (!o) return null const i = o.findIndex((s, o) => o > 0 && void 0 !== s), a = this.matchIndexes[i] - return o.splice(0, i), Object.assign(o, a) + return (o.splice(0, i), Object.assign(o, a)) } } class ResumableMultiRegex { constructor() { - ;(this.rules = []), + ;((this.rules = []), (this.multiRegexes = []), (this.count = 0), (this.lastIndex = 0), - (this.regexIndex = 0) + (this.regexIndex = 0)) } getMatcher(s) { if (this.multiRegexes[s]) return this.multiRegexes[s] @@ -20604,7 +20619,7 @@ this.regexIndex = 0 } addRule(s, o) { - this.rules.push([s, o]), 'begin' === o.type && this.count++ + ;(this.rules.push([s, o]), 'begin' === o.type && this.count++) } exec(s) { const o = this.getMatcher(this.regexIndex) @@ -20614,7 +20629,7 @@ if (i && i.index === this.lastIndex); else { const o = this.getMatcher(0) - ;(o.lastIndex = this.lastIndex + 1), (i = o.exec(s)) + ;((o.lastIndex = this.lastIndex + 1), (i = o.exec(s))) } return ( i && @@ -20636,11 +20651,11 @@ (function compileMode(o, i) { const a = o if (o.isCompiled) return a - ;[compileMatch].forEach((s) => s(o, i)), + ;([compileMatch].forEach((s) => s(o, i)), s.compilerExtensions.forEach((s) => s(o, i)), (o.__beforeBegin = null), [beginKeywords, compileIllegal, compileRelevance].forEach((s) => s(o, i)), - (o.isCompiled = !0) + (o.isCompiled = !0)) let u = null if ( ('object' == typeof o.keywords && @@ -20761,7 +20776,7 @@ const a = nodeStream(s) if (!a.length) return const u = document.createElement('div') - ;(u.innerHTML = o.value), + ;((u.innerHTML = o.value), (o.value = (function mergeStreams(s, o, i) { let a = 0, u = '' @@ -20798,15 +20813,15 @@ ) { _.reverse().forEach(close) do { - render(o.splice(0, 1)[0]), (o = selectStream()) + ;(render(o.splice(0, 1)[0]), (o = selectStream())) } while (o === s && o.length && o[0].offset === a) _.reverse().forEach(open) } else - 'start' === o[0].event ? _.push(o[0].node) : _.pop(), - render(o.splice(0, 1)[0]) + ('start' === o[0].event ? _.push(o[0].node) : _.pop(), + render(o.splice(0, 1)[0])) } return u + escapeHTML(i.substr(a)) - })(a, nodeStream(u), i)) + })(a, nodeStream(u), i))) }, } function tag(s) { @@ -20879,7 +20894,7 @@ const w = { code: u, language: _ } fire('before:highlight', w) const x = w.result ? w.result : _highlight(w.language, w.code, i, a) - return (x.code = w.code), fire('after:highlight', x), x + return ((x.code = w.code), fire('after:highlight', x), x) } function _highlight(s, o, a, w) { function keywordData(s, o) { @@ -20887,16 +20902,17 @@ return Object.prototype.hasOwnProperty.call(s.keywords, i) && s.keywords[i] } function processBuffer() { - null != U.subLanguage + ;(null != U.subLanguage ? (function processSubLanguage() { if ('' === Y) return let s = null if ('string' == typeof U.subLanguage) { if (!i[U.subLanguage]) return void z.addText(Y) - ;(s = _highlight(U.subLanguage, Y, !0, V[U.subLanguage])), - (V[U.subLanguage] = s.top) + ;((s = _highlight(U.subLanguage, Y, !0, V[U.subLanguage])), + (V[U.subLanguage] = s.top)) } else s = highlightAuto(Y, U.subLanguage.length ? U.subLanguage : null) - U.relevance > 0 && (Z += s.relevance), z.addSublanguage(s.emitter, s.language) + ;(U.relevance > 0 && (Z += s.relevance), + z.addSublanguage(s.emitter, s.language)) })() : (function processKeywords() { if (!U.keywords) return void z.addText(Y) @@ -20915,11 +20931,11 @@ z.addKeyword(o[0], i) } } else i += o[0] - ;(s = U.keywordPatternRe.lastIndex), (o = U.keywordPatternRe.exec(Y)) + ;((s = U.keywordPatternRe.lastIndex), (o = U.keywordPatternRe.exec(Y))) } - ;(i += Y.substr(s)), z.addText(i) + ;((i += Y.substr(s)), z.addText(i)) })(), - (Y = '') + (Y = '')) } function startNewMode(s) { return ( @@ -20936,7 +20952,7 @@ if (a) { if (s['on:end']) { const i = new Response(s) - s['on:end'](o, i), i.isMatchIgnored && (a = !1) + ;(s['on:end'](o, i), i.isMatchIgnored && (a = !1)) } if (a) { for (; s.endsParent && s.parent; ) s = s.parent @@ -20981,9 +20997,9 @@ processBuffer(), _.excludeEnd && (Y = i)) do { - U.className && z.closeNode(), + ;(U.className && z.closeNode(), U.skip || U.subLanguage || (Z += U.relevance), - (U = U.parent) + (U = U.parent)) } while (U !== u.parent) return ( u.starts && @@ -20994,7 +21010,7 @@ let C = {} function processLexeme(i, u) { const w = u && u[0] - if (((Y += i), null == w)) return processBuffer(), 0 + if (((Y += i), null == w)) return (processBuffer(), 0) if ('begin' === C.type && 'end' === u.type && C.index === u.index && '' === w) { if (((Y += o.slice(u.index, u.index + 1)), !_)) { const o = new Error('0 width match regex') @@ -21017,7 +21033,7 @@ if (ie > 1e5 && ie > 3 * u.index) { throw new Error('potential infinite loop, way more iterations than matches') } - return (Y += w), w.length + return ((Y += w), w.length) } const L = getLanguage(s) if (!L) throw (error(x.replace('{}', s)), new Error('Unknown language: "' + s + '"')) @@ -21038,7 +21054,7 @@ ae = !1 try { for (U.matcher.considerAll(); ; ) { - ie++, ae ? (ae = !1) : U.matcher.considerAll(), (U.matcher.lastIndex = ee) + ;(ie++, ae ? (ae = !1) : U.matcher.considerAll(), (U.matcher.lastIndex = ee)) const s = U.matcher.exec(o) if (!s) break const i = processLexeme(o.substring(ee, s.index), s) @@ -21095,7 +21111,7 @@ illegal: !1, top: C, } - return o.emitter.addText(s), o + return (o.emitter.addText(s), o) })(s), u = o .filter(getLanguage) @@ -21112,7 +21128,7 @@ }), [w, x] = _, L = w - return (L.second_best = x), L + return ((L.second_best = x), L) } const L = { 'before:highlightElement': ({ el: s }) => { @@ -21148,14 +21164,14 @@ return o.split(/\s+/).find((s) => shouldNotHighlight(s) || getLanguage(s)) })(s) if (shouldNotHighlight(i)) return - fire('before:highlightElement', { el: s, language: i }), (o = s) + ;(fire('before:highlightElement', { el: s, language: i }), (o = s)) const u = o.textContent, _ = i ? highlight(u, { language: i, ignoreIllegals: !0 }) : highlightAuto(u) - fire('after:highlightElement', { el: s, result: _, text: u }), + ;(fire('after:highlightElement', { el: s, result: _, text: u }), (s.innerHTML = _.value), (function updateClassName(s, o, i) { const u = o ? a[o] : i - s.classList.add('hljs'), u && s.classList.add(u) + ;(s.classList.add('hljs'), u && s.classList.add(u)) })(s, i, _.language), (s.result = { language: _.language, re: _.relevance, relavance: _.relevance }), _.second_best && @@ -21163,15 +21179,15 @@ language: _.second_best.language, re: _.second_best.relevance, relavance: _.second_best.relevance, - }) + })) } const initHighlighting = () => { if (initHighlighting.called) return - ;(initHighlighting.called = !0), + ;((initHighlighting.called = !0), deprecated( '10.6.0', 'initHighlighting() is deprecated. Use highlightAll() instead.' - ) + )) document.querySelectorAll('pre code').forEach(highlightElement) } let U = !1 @@ -21180,13 +21196,13 @@ document.querySelectorAll('pre code').forEach(highlightElement) } function getLanguage(s) { - return (s = (s || '').toLowerCase()), i[s] || i[a[s]] + return ((s = (s || '').toLowerCase()), i[s] || i[a[s]]) } function registerAliases(s, { languageName: o }) { - 'string' == typeof s && (s = [s]), + ;('string' == typeof s && (s = [s]), s.forEach((s) => { a[s.toLowerCase()] = o - }) + })) } function autoDetection(s) { const o = getLanguage(s) @@ -21198,7 +21214,7 @@ s[i] && s[i](o) }) } - 'undefined' != typeof window && + ;('undefined' != typeof window && window.addEventListener && window.addEventListener( 'DOMContentLoaded', @@ -21242,21 +21258,21 @@ ) }, configure: function configure(s) { - s.useBR && + ;(s.useBR && (deprecated('10.3.0', "'useBR' will be removed entirely in v11.0"), deprecated( '10.3.0', 'Please see https://github.com/highlightjs/highlight.js/issues/2559' )), - (j = Se(j, s)) + (j = Se(j, s))) }, initHighlighting, initHighlightingOnLoad: function initHighlightingOnLoad() { - deprecated( + ;(deprecated( '10.6.0', 'initHighlightingOnLoad() is deprecated. Use highlightAll() instead.' ), - (U = !0) + (U = !0)) }, registerLanguage: function registerLanguage(o, a) { let u = null @@ -21270,12 +21286,12 @@ !_) ) throw s - error(s), (u = C) + ;(error(s), (u = C)) } - u.name || (u.name = o), + ;(u.name || (u.name = o), (i[o] = u), (u.rawDefinition = a.bind(null, s)), - u.aliases && registerAliases(u.aliases, { languageName: o }) + u.aliases && registerAliases(u.aliases, { languageName: o })) }, unregisterLanguage: function unregisterLanguage(s) { delete i[s] @@ -21287,11 +21303,11 @@ getLanguage, registerAliases, requireLanguage: function requireLanguage(s) { - deprecated('10.4.0', 'requireLanguage will be removed entirely in v11.'), + ;(deprecated('10.4.0', 'requireLanguage will be removed entirely in v11.'), deprecated( '10.4.0', 'Please see https://github.com/highlightjs/highlight.js/pull/2844' - ) + )) const o = getLanguage(s) if (o) return o throw new Error("The '{}' language is required, but not loaded.".replace('{}', s)) @@ -21299,8 +21315,8 @@ autoDetection, inherit: Se, addPlugin: function addPlugin(s) { - !(function upgradePluginAPI(s) { - s['before:highlightBlock'] && + ;(!(function upgradePluginAPI(s) { + ;(s['before:highlightBlock'] && !s['before:highlightElement'] && (s['before:highlightElement'] = (o) => { s['before:highlightBlock'](Object.assign({ block: o.el }, o)) @@ -21309,9 +21325,9 @@ !s['after:highlightElement'] && (s['after:highlightElement'] = (o) => { s['after:highlightBlock'](Object.assign({ block: o.el }, o)) - }) + })) })(s), - u.push(s) + u.push(s)) }, vuePlugin: BuildVuePlugin(s).VuePlugin, }), @@ -21321,9 +21337,9 @@ (s.safeMode = function () { _ = !0 }), - (s.versionString = '10.7.3') + (s.versionString = '10.7.3')) for (const s in de) 'object' == typeof de[s] && o(de[s]) - return Object.assign(s, de), s.addPlugin(L), s.addPlugin(ye), s.addPlugin($), s + return (Object.assign(s, de), s.addPlugin(L), s.addPlugin(ye), s.addPlugin($), s) })({}) s.exports = xe }, @@ -21345,7 +21361,7 @@ if ((void 0 === o && (o = 'default'), (i = a(C, s, o)), !u(i) || _(i))) return i throw new j("Can't convert object to primitive value") } - return void 0 === o && (o = 'number'), x(s, o) + return (void 0 === o && (o = 'number'), x(s, o)) } }, 46076: (s, o, i) => { @@ -21414,7 +21430,10 @@ s.exports = function (s, o, i, C) { var j = o + ' Iterator' return ( - (s.prototype = u(a, { next: _(+!C, i) })), w(s, j, !1, !0), (x[j] = returnThis), s + (s.prototype = u(a, { next: _(+!C, i) })), + w(s, j, !1, !0), + (x[j] = returnThis), + s ) } }, @@ -21492,17 +21511,17 @@ 'function' == typeof Symbol && 'function' == typeof Symbol.for ? Symbol.for('nodejs.util.inspect.custom') : null - ;(o.Buffer = Buffer), + ;((o.Buffer = Buffer), (o.SlowBuffer = function SlowBuffer(s) { ;+s != s && (s = 0) return Buffer.alloc(+s) }), - (o.INSPECT_MAX_BYTES = 50) + (o.INSPECT_MAX_BYTES = 50)) const w = 2147483647 function createBuffer(s) { if (s > w) throw new RangeError('The value "' + s + '" is invalid for option "size"') const o = new Uint8Array(s) - return Object.setPrototypeOf(o, Buffer.prototype), o + return (Object.setPrototypeOf(o, Buffer.prototype), o) } function Buffer(s, o, i) { if ('number' == typeof s) { @@ -21555,7 +21574,7 @@ if (Buffer.isBuffer(s)) { const o = 0 | checked(s.length), i = createBuffer(o) - return 0 === i.length || s.copy(i, 0, 0, o), i + return (0 === i.length || s.copy(i, 0, 0, o), i) } if (void 0 !== s.length) return 'number' != typeof s.length || numberIsNaN(s.length) @@ -21580,7 +21599,7 @@ if (s < 0) throw new RangeError('The value "' + s + '" is invalid for option "size"') } function allocUnsafe(s) { - return assertSize(s), createBuffer(s < 0 ? 0 : 0 | checked(s)) + return (assertSize(s), createBuffer(s < 0 ? 0 : 0 | checked(s))) } function fromArrayLike(s) { const o = s.length < 0 ? 0 : 0 | checked(s.length), @@ -21646,7 +21665,7 @@ return base64ToBytes(s).length default: if (u) return a ? -1 : utf8ToBytes(s).length - ;(o = ('' + o).toLowerCase()), (u = !0) + ;((o = ('' + o).toLowerCase()), (u = !0)) } } function slowToString(s, o, i) { @@ -21675,12 +21694,12 @@ return utf16leSlice(this, o, i) default: if (a) throw new TypeError('Unknown encoding: ' + s) - ;(s = (s + '').toLowerCase()), (a = !0) + ;((s = (s + '').toLowerCase()), (a = !0)) } } function swap(s, o, i) { const a = s[o] - ;(s[o] = s[i]), (s[i] = a) + ;((s[o] = s[i]), (s[i] = a)) } function bidirectionalIndexOf(s, o, i, a, u) { if (0 === s.length) return -1 @@ -21726,7 +21745,7 @@ 'utf-16le' === a) ) { if (s.length < 2 || o.length < 2) return -1 - ;(w = 2), (x /= 2), (C /= 2), (i /= 2) + ;((w = 2), (x /= 2), (C /= 2), (i /= 2)) } function read(s, o) { return 1 === w ? s[o] : s.readUInt16BE(o * w) @@ -21736,7 +21755,7 @@ for (_ = i; _ < x; _++) if (read(s, _) === read(o, -1 === a ? 0 : _ - a)) { if ((-1 === a && (a = _), _ - a + 1 === C)) return a * w - } else -1 !== a && (_ -= _ - a), (a = -1) + } else (-1 !== a && (_ -= _ - a), (a = -1)) } else for (i + C > x && (i = x - C), _ = i; _ >= 0; _--) { let i = !0 @@ -21786,7 +21805,7 @@ let i, a, u const _ = [] for (let w = 0; w < s.length && !((o -= 2) < 0); ++w) - (i = s.charCodeAt(w)), (a = i >> 8), (u = i % 256), _.push(u), _.push(a) + ((i = s.charCodeAt(w)), (a = i >> 8), (u = i % 256), _.push(u), _.push(a)) return _ })(o, s.length - i), s, @@ -21812,34 +21831,34 @@ o < 128 && (_ = o) break case 2: - ;(i = s[u + 1]), - 128 == (192 & i) && ((C = ((31 & o) << 6) | (63 & i)), C > 127 && (_ = C)) + ;((i = s[u + 1]), + 128 == (192 & i) && ((C = ((31 & o) << 6) | (63 & i)), C > 127 && (_ = C))) break case 3: - ;(i = s[u + 1]), + ;((i = s[u + 1]), (a = s[u + 2]), 128 == (192 & i) && 128 == (192 & a) && ((C = ((15 & o) << 12) | ((63 & i) << 6) | (63 & a)), - C > 2047 && (C < 55296 || C > 57343) && (_ = C)) + C > 2047 && (C < 55296 || C > 57343) && (_ = C))) break case 4: - ;(i = s[u + 1]), + ;((i = s[u + 1]), (a = s[u + 2]), (x = s[u + 3]), 128 == (192 & i) && 128 == (192 & a) && 128 == (192 & x) && ((C = ((15 & o) << 18) | ((63 & i) << 12) | ((63 & a) << 6) | (63 & x)), - C > 65535 && C < 1114112 && (_ = C)) + C > 65535 && C < 1114112 && (_ = C))) } } - null === _ + ;(null === _ ? ((_ = 65533), (w = 1)) : _ > 65535 && ((_ -= 65536), a.push(((_ >>> 10) & 1023) | 55296), (_ = 56320 | (1023 & _))), a.push(_), - (u += w) + (u += w)) } return (function decodeCodePointsArray(s) { const o = s.length @@ -21850,7 +21869,7 @@ return i })(a) } - ;(o.kMaxLength = w), + ;((o.kMaxLength = w), (Buffer.TYPED_ARRAY_SUPPORT = (function typedArraySupport() { try { const s = new Uint8Array(1), @@ -21929,7 +21948,7 @@ a = o.length for (let u = 0, _ = Math.min(i, a); u < _; ++u) if (s[u] !== o[u]) { - ;(i = s[u]), (a = o[u]) + ;((i = s[u]), (a = o[u])) break } return i < a ? -1 : a < i ? 1 : 0 @@ -21986,17 +22005,17 @@ (Buffer.prototype.swap32 = function swap32() { const s = this.length if (s % 4 != 0) throw new RangeError('Buffer size must be a multiple of 32-bits') - for (let o = 0; o < s; o += 4) swap(this, o, o + 3), swap(this, o + 1, o + 2) + for (let o = 0; o < s; o += 4) (swap(this, o, o + 3), swap(this, o + 1, o + 2)) return this }), (Buffer.prototype.swap64 = function swap64() { const s = this.length if (s % 8 != 0) throw new RangeError('Buffer size must be a multiple of 64-bits') for (let o = 0; o < s; o += 8) - swap(this, o, o + 7), + (swap(this, o, o + 7), swap(this, o + 1, o + 6), swap(this, o + 2, o + 5), - swap(this, o + 3, o + 4) + swap(this, o + 3, o + 4)) return this }), (Buffer.prototype.toString = function toString() { @@ -22052,7 +22071,7 @@ j = s.slice(o, i) for (let s = 0; s < x; ++s) if (C[s] !== j[s]) { - ;(_ = C[s]), (w = j[s]) + ;((_ = C[s]), (w = j[s])) break } return _ < w ? -1 : w < _ ? 1 : 0 @@ -22067,15 +22086,17 @@ return bidirectionalIndexOf(this, s, o, i, !1) }), (Buffer.prototype.write = function write(s, o, i, a) { - if (void 0 === o) (a = 'utf8'), (i = this.length), (o = 0) - else if (void 0 === i && 'string' == typeof o) (a = o), (i = this.length), (o = 0) + if (void 0 === o) ((a = 'utf8'), (i = this.length), (o = 0)) + else if (void 0 === i && 'string' == typeof o) ((a = o), (i = this.length), (o = 0)) else { if (!isFinite(o)) throw new Error( 'Buffer.write(string, encoding, offset[, length]) is no longer supported' ) - ;(o >>>= 0), - isFinite(i) ? ((i >>>= 0), void 0 === a && (a = 'utf8')) : ((a = i), (i = void 0)) + ;((o >>>= 0), + isFinite(i) + ? ((i >>>= 0), void 0 === a && (a = 'utf8')) + : ((a = i), (i = void 0))) } const u = this.length - o if ( @@ -22105,12 +22126,12 @@ return ucs2Write(this, s, o, i) default: if (_) throw new TypeError('Unknown encoding: ' + a) - ;(a = ('' + a).toLowerCase()), (_ = !0) + ;((a = ('' + a).toLowerCase()), (_ = !0)) } }), (Buffer.prototype.toJSON = function toJSON() { return { type: 'Buffer', data: Array.prototype.slice.call(this._arr || this, 0) } - }) + })) const x = 4096 function asciiSlice(s, o, i) { let a = '' @@ -22126,7 +22147,7 @@ } function hexSlice(s, o, i) { const a = s.length - ;(!o || o < 0) && (o = 0), (!i || i < 0 || i > a) && (i = a) + ;((!o || o < 0) && (o = 0), (!i || i < 0 || i > a) && (i = a)) let u = '' for (let a = o; a < i; ++a) u += L[s[a]] return u @@ -22151,7 +22172,13 @@ function wrtBigUInt64LE(s, o, i, a, u) { checkIntBI(o, a, u, s, i, 7) let _ = Number(o & BigInt(4294967295)) - ;(s[i++] = _), (_ >>= 8), (s[i++] = _), (_ >>= 8), (s[i++] = _), (_ >>= 8), (s[i++] = _) + ;((s[i++] = _), + (_ >>= 8), + (s[i++] = _), + (_ >>= 8), + (s[i++] = _), + (_ >>= 8), + (s[i++] = _)) let w = Number((o >> BigInt(32)) & BigInt(4294967295)) return ( (s[i++] = w), @@ -22167,13 +22194,13 @@ function wrtBigUInt64BE(s, o, i, a, u) { checkIntBI(o, a, u, s, i, 7) let _ = Number(o & BigInt(4294967295)) - ;(s[i + 7] = _), + ;((s[i + 7] = _), (_ >>= 8), (s[i + 6] = _), (_ >>= 8), (s[i + 5] = _), (_ >>= 8), - (s[i + 4] = _) + (s[i + 4] = _)) let w = Number((o >> BigInt(32)) & BigInt(4294967295)) return ( (s[i + 3] = w), @@ -22192,25 +22219,33 @@ } function writeFloat(s, o, i, a, _) { return ( - (o = +o), (i >>>= 0), _ || checkIEEE754(s, 0, i, 4), u.write(s, o, i, a, 23, 4), i + 4 + (o = +o), + (i >>>= 0), + _ || checkIEEE754(s, 0, i, 4), + u.write(s, o, i, a, 23, 4), + i + 4 ) } function writeDouble(s, o, i, a, _) { return ( - (o = +o), (i >>>= 0), _ || checkIEEE754(s, 0, i, 8), u.write(s, o, i, a, 52, 8), i + 8 + (o = +o), + (i >>>= 0), + _ || checkIEEE754(s, 0, i, 8), + u.write(s, o, i, a, 52, 8), + i + 8 ) } - ;(Buffer.prototype.slice = function slice(s, o) { + ;((Buffer.prototype.slice = function slice(s, o) { const i = this.length - ;(s = ~~s) < 0 ? (s += i) < 0 && (s = 0) : s > i && (s = i), + ;((s = ~~s) < 0 ? (s += i) < 0 && (s = 0) : s > i && (s = i), (o = void 0 === o ? i : ~~o) < 0 ? (o += i) < 0 && (o = 0) : o > i && (o = i), - o < s && (o = s) + o < s && (o = s)) const a = this.subarray(s, o) - return Object.setPrototypeOf(a, Buffer.prototype), a + return (Object.setPrototypeOf(a, Buffer.prototype), a) }), (Buffer.prototype.readUintLE = Buffer.prototype.readUIntLE = function readUIntLE(s, o, i) { - ;(s >>>= 0), (o >>>= 0), i || checkOffset(s, o, this.length) + ;((s >>>= 0), (o >>>= 0), i || checkOffset(s, o, this.length)) let a = this[s], u = 1, _ = 0 @@ -22219,7 +22254,7 @@ }), (Buffer.prototype.readUintBE = Buffer.prototype.readUIntBE = function readUIntBE(s, o, i) { - ;(s >>>= 0), (o >>>= 0), i || checkOffset(s, o, this.length) + ;((s >>>= 0), (o >>>= 0), i || checkOffset(s, o, this.length)) let a = this[s + --o], u = 1 for (; o > 0 && (u *= 256); ) a += this[s + --o] * u @@ -22227,15 +22262,23 @@ }), (Buffer.prototype.readUint8 = Buffer.prototype.readUInt8 = function readUInt8(s, o) { - return (s >>>= 0), o || checkOffset(s, 1, this.length), this[s] + return ((s >>>= 0), o || checkOffset(s, 1, this.length), this[s]) }), (Buffer.prototype.readUint16LE = Buffer.prototype.readUInt16LE = function readUInt16LE(s, o) { - return (s >>>= 0), o || checkOffset(s, 2, this.length), this[s] | (this[s + 1] << 8) + return ( + (s >>>= 0), + o || checkOffset(s, 2, this.length), + this[s] | (this[s + 1] << 8) + ) }), (Buffer.prototype.readUint16BE = Buffer.prototype.readUInt16BE = function readUInt16BE(s, o) { - return (s >>>= 0), o || checkOffset(s, 2, this.length), (this[s] << 8) | this[s + 1] + return ( + (s >>>= 0), + o || checkOffset(s, 2, this.length), + (this[s] << 8) | this[s + 1] + ) }), (Buffer.prototype.readUint32LE = Buffer.prototype.readUInt32LE = function readUInt32LE(s, o) { @@ -22272,20 +22315,20 @@ return (BigInt(a) << BigInt(32)) + BigInt(u) })), (Buffer.prototype.readIntLE = function readIntLE(s, o, i) { - ;(s >>>= 0), (o >>>= 0), i || checkOffset(s, o, this.length) + ;((s >>>= 0), (o >>>= 0), i || checkOffset(s, o, this.length)) let a = this[s], u = 1, _ = 0 for (; ++_ < o && (u *= 256); ) a += this[s + _] * u - return (u *= 128), a >= u && (a -= Math.pow(2, 8 * o)), a + return ((u *= 128), a >= u && (a -= Math.pow(2, 8 * o)), a) }), (Buffer.prototype.readIntBE = function readIntBE(s, o, i) { - ;(s >>>= 0), (o >>>= 0), i || checkOffset(s, o, this.length) + ;((s >>>= 0), (o >>>= 0), i || checkOffset(s, o, this.length)) let a = o, u = 1, _ = this[s + --a] for (; a > 0 && (u *= 256); ) _ += this[s + --a] * u - return (u *= 128), _ >= u && (_ -= Math.pow(2, 8 * o)), _ + return ((u *= 128), _ >= u && (_ -= Math.pow(2, 8 * o)), _) }), (Buffer.prototype.readInt8 = function readInt8(s, o) { return ( @@ -22295,12 +22338,12 @@ ) }), (Buffer.prototype.readInt16LE = function readInt16LE(s, o) { - ;(s >>>= 0), o || checkOffset(s, 2, this.length) + ;((s >>>= 0), o || checkOffset(s, 2, this.length)) const i = this[s] | (this[s + 1] << 8) return 32768 & i ? 4294901760 | i : i }), (Buffer.prototype.readInt16BE = function readInt16BE(s, o) { - ;(s >>>= 0), o || checkOffset(s, 2, this.length) + ;((s >>>= 0), o || checkOffset(s, 2, this.length)) const i = this[s + 1] | (this[s] << 8) return 32768 & i ? 4294901760 | i : i }), @@ -22341,16 +22384,16 @@ ) })), (Buffer.prototype.readFloatLE = function readFloatLE(s, o) { - return (s >>>= 0), o || checkOffset(s, 4, this.length), u.read(this, s, !0, 23, 4) + return ((s >>>= 0), o || checkOffset(s, 4, this.length), u.read(this, s, !0, 23, 4)) }), (Buffer.prototype.readFloatBE = function readFloatBE(s, o) { - return (s >>>= 0), o || checkOffset(s, 4, this.length), u.read(this, s, !1, 23, 4) + return ((s >>>= 0), o || checkOffset(s, 4, this.length), u.read(this, s, !1, 23, 4)) }), (Buffer.prototype.readDoubleLE = function readDoubleLE(s, o) { - return (s >>>= 0), o || checkOffset(s, 8, this.length), u.read(this, s, !0, 52, 8) + return ((s >>>= 0), o || checkOffset(s, 8, this.length), u.read(this, s, !0, 52, 8)) }), (Buffer.prototype.readDoubleBE = function readDoubleBE(s, o) { - return (s >>>= 0), o || checkOffset(s, 8, this.length), u.read(this, s, !1, 52, 8) + return ((s >>>= 0), o || checkOffset(s, 8, this.length), u.read(this, s, !1, 52, 8)) }), (Buffer.prototype.writeUintLE = Buffer.prototype.writeUIntLE = function writeUIntLE(s, o, i, a) { @@ -22451,8 +22494,8 @@ _ = 1, w = 0 for (this[o] = 255 & s; ++u < i && (_ *= 256); ) - s < 0 && 0 === w && 0 !== this[o + u - 1] && (w = 1), - (this[o + u] = (((s / _) | 0) - w) & 255) + (s < 0 && 0 === w && 0 !== this[o + u - 1] && (w = 1), + (this[o + u] = (((s / _) | 0) - w) & 255)) return o + i }), (Buffer.prototype.writeIntBE = function writeIntBE(s, o, i, a) { @@ -22464,8 +22507,8 @@ _ = 1, w = 0 for (this[o + u] = 255 & s; --u >= 0 && (_ *= 256); ) - s < 0 && 0 === w && 0 !== this[o + u + 1] && (w = 1), - (this[o + u] = (((s / _) | 0) - w) & 255) + (s < 0 && 0 === w && 0 !== this[o + u + 1] && (w = 1), + (this[o + u] = (((s / _) | 0) - w) & 255)) return o + i }), (Buffer.prototype.writeInt8 = function writeInt8(s, o, i) { @@ -22574,7 +22617,8 @@ if (o < 0) throw new RangeError('targetStart out of bounds') if (i < 0 || i >= this.length) throw new RangeError('Index out of range') if (a < 0) throw new RangeError('sourceEnd out of bounds') - a > this.length && (a = this.length), s.length - o < a - i && (a = s.length - o + i) + ;(a > this.length && (a = this.length), + s.length - o < a - i && (a = s.length - o + i)) const u = a - i return ( this === s && 'function' == typeof Uint8Array.prototype.copyWithin @@ -22618,12 +22662,12 @@ for (u = 0; u < i - o; ++u) this[u + o] = _[u % w] } return this - }) + })) const C = {} function E(s, o, i) { C[s] = class NodeError extends i { constructor() { - super(), + ;(super(), Object.defineProperty(this, 'message', { value: o.apply(this, arguments), writable: !0, @@ -22631,7 +22675,7 @@ }), (this.name = `${this.name} [${s}]`), this.stack, - delete this.name + delete this.name) } get code() { return s @@ -22661,18 +22705,18 @@ const a = 'bigint' == typeof o ? 'n' : '' let u throw ( - ((u = + (u = _ > 3 ? 0 === o || o === BigInt(0) ? `>= 0${a} and < 2${a} ** ${8 * (_ + 1)}${a}` : `>= -(2${a} ** ${8 * (_ + 1) - 1}${a}) and < 2 ** ${8 * (_ + 1) - 1}${a}` : `>= ${o}${a} and <= ${i}${a}`), - new C.ERR_OUT_OF_RANGE('value', u, s)) + new C.ERR_OUT_OF_RANGE('value', u, s) ) } !(function checkBounds(s, o, i) { - validateNumber(o, 'offset'), - (void 0 !== s[o] && void 0 !== s[o + i]) || boundsError(o, s.length - (i + 1)) + ;(validateNumber(o, 'offset'), + (void 0 !== s[o] && void 0 !== s[o + i]) || boundsError(o, s.length - (i + 1))) })(a, u, _) } function validateNumber(s, o) { @@ -22684,7 +22728,7 @@ if (o < 0) throw new C.ERR_BUFFER_OUT_OF_BOUNDS() throw new C.ERR_OUT_OF_RANGE(i || 'offset', `>= ${i ? 1 : 0} and <= ${o}`, s) } - E( + ;(E( 'ERR_BUFFER_OUT_OF_BOUNDS', function (s) { return s @@ -22718,7 +22762,7 @@ ) }, RangeError - ) + )) const j = /[^+/0-9A-Za-z-_]/g function utf8ToBytes(s, o) { let i @@ -22741,7 +22785,7 @@ continue } if (i < 56320) { - ;(o -= 3) > -1 && _.push(239, 191, 189), (u = i) + ;((o -= 3) > -1 && _.push(239, 191, 189), (u = i)) continue } i = 65536 + (((u - 55296) << 10) | (i - 56320)) @@ -22812,13 +22856,13 @@ }, 48590: (s, o) => { 'use strict' - Object.defineProperty(o, '__esModule', { value: !0 }), + ;(Object.defineProperty(o, '__esModule', { value: !0 }), (o.default = function (s) { return s && '@@redux/INIT' === s.type ? 'initialState argument passed to createStore' : 'previous state received by the reducer' }), - (s.exports = o.default) + (s.exports = o.default)) }, 48648: (s) => { 'use strict' @@ -22879,7 +22923,7 @@ var a = i(37828) s.exports = function cloneArrayBuffer(s) { var o = new s.constructor(s.byteLength) - return new a(o).set(new a(s)), o + return (new a(o).set(new a(s)), o) } }, 49698: (s) => { @@ -22905,9 +22949,9 @@ var a = i(66977) function curry(s, o, i) { var u = a(s, 8, void 0, void 0, void 0, void 0, void 0, (o = i ? void 0 : o)) - return (u.placeholder = curry.placeholder), u + return ((u.placeholder = curry.placeholder), u) } - ;(curry.placeholder = {}), (s.exports = curry) + ;((curry.placeholder = {}), (s.exports = curry)) }, 50002: (s, o, i) => { var a = i(82199), @@ -22928,11 +22972,11 @@ u = memoized.cache if (u.has(a)) return u.get(a) var _ = s.apply(this, i) - return (memoized.cache = u.set(a, _) || u), _ + return ((memoized.cache = u.set(a, _) || u), _) } - return (memoized.cache = new (memoize.Cache || a)()), memoized + return ((memoized.cache = new (memoize.Cache || a)()), memoized) } - ;(memoize.Cache = a), (s.exports = memoize) + ;((memoize.Cache = a), (s.exports = memoize)) }, 50583: (s, o, i) => { var a = i(47237), @@ -22959,7 +23003,7 @@ V = x.get(o) if (U && V) return U == o && V == s var z = !0 - x.set(s, o), x.set(o, s) + ;(x.set(s, o), x.set(o, s)) for (var Y = C; ++B < L; ) { var Z = s[($ = j[B])], ee = o[$] @@ -22982,7 +23026,7 @@ ce instanceof ce) || (z = !1) } - return x.delete(s), x.delete(o), z + return (x.delete(s), x.delete(o), z) } }, 50828: (s, o, i) => { @@ -23011,7 +23055,7 @@ 51420: (s, o, i) => { var a = i(80079) s.exports = function stackClear() { - ;(this.__data__ = new a()), (this.size = 0) + ;((this.__data__ = new a()), (this.size = 0)) } }, 51459: (s) => { @@ -23051,7 +23095,7 @@ 52623: (s, o, i) => { 'use strict' var a = {} - ;(a[i(76264)('toStringTag')] = 'z'), (s.exports = '[object z]' === String(a)) + ;((a[i(76264)('toStringTag')] = 'z'), (s.exports = '[object z]' === String(a))) }, 53138: (s, o, i) => { var a = i(11331) @@ -23099,7 +23143,6 @@ $ = Array(B + L), U = !u; ++_ < B; - ) $[_] = s[_] for (var V = _; ++j < L; ) $[V + j] = i[j] @@ -23126,12 +23169,12 @@ this.set(a[0], a[1]) } } - ;(MapCache.prototype.clear = a), + ;((MapCache.prototype.clear = a), (MapCache.prototype.delete = u), (MapCache.prototype.get = _), (MapCache.prototype.has = w), (MapCache.prototype.set = x), - (s.exports = MapCache) + (s.exports = MapCache)) }, 53758: (s, o, i) => { var a = i(30980), @@ -23148,9 +23191,9 @@ } return new u(s) } - ;(lodash.prototype = _.prototype), + ;((lodash.prototype = _.prototype), (lodash.prototype.constructor = lodash), - (s.exports = lodash) + (s.exports = lodash)) }, 53812: (s, o, i) => { var a = i(72552), @@ -23240,20 +23283,20 @@ }, 55674: (s, o, i) => { 'use strict' - Object.defineProperty(o, '__esModule', { value: !0 }), + ;(Object.defineProperty(o, '__esModule', { value: !0 }), (o.validateNextState = o.getUnexpectedInvocationParameterMessage = o.getStateName = - void 0) + void 0)) var a = _interopRequireDefault(i(48590)), u = _interopRequireDefault(i(82261)), _ = _interopRequireDefault(i(27374)) function _interopRequireDefault(s) { return s && s.__esModule ? s : { default: s } } - ;(o.getStateName = a.default), + ;((o.getStateName = a.default), (o.getUnexpectedInvocationParameterMessage = u.default), - (o.validateNextState = _.default) + (o.validateNextState = _.default)) }, 55808: (s, o, i) => { var a = i(12507)('toUpperCase') @@ -23262,7 +23305,7 @@ 55973: (s) => { class KeyValuePair { constructor(s, o) { - ;(this.key = s), (this.value = o) + ;((this.key = s), (this.value = o)) } clone() { const s = new KeyValuePair() @@ -23279,15 +23322,15 @@ var a = i(39344), u = i(94033) function LodashWrapper(s, o) { - ;(this.__wrapped__ = s), + ;((this.__wrapped__ = s), (this.__actions__ = []), (this.__chain__ = !!o), (this.__index__ = 0), - (this.__values__ = void 0) + (this.__values__ = void 0)) } - ;(LodashWrapper.prototype = a(u.prototype)), + ;((LodashWrapper.prototype = a(u.prototype)), (LodashWrapper.prototype.constructor = LodashWrapper), - (s.exports = LodashWrapper) + (s.exports = LodashWrapper)) }, 56110: (s, o, i) => { var a = i(45083), @@ -23317,9 +23360,9 @@ if (o) { s.super_ = o var TempCtor = function () {} - ;(TempCtor.prototype = o.prototype), + ;((TempCtor.prototype = o.prototype), (s.prototype = new TempCtor()), - (s.prototype.constructor = s) + (s.prototype.constructor = s)) } }) }, @@ -23334,7 +23377,7 @@ C[w] = _[o + w] w = -1 for (var j = Array(o + 1); ++w < o; ) j[w] = _[w] - return (j[o] = i(C)), a(s, this, j) + return ((j[o] = i(C)), a(s, this, j)) } ) } @@ -23344,7 +23387,10 @@ var a = i(98828) s.exports = !a(function () { function F() {} - return (F.prototype.constructor = null), Object.getPrototypeOf(new F()) !== F.prototype + return ( + (F.prototype.constructor = null), + Object.getPrototypeOf(new F()) !== F.prototype + ) }) }, 57758: (s, o, i) => { @@ -23379,14 +23425,14 @@ } })(_) var x = !1 - s.on('close', function () { + ;(s.on('close', function () { x = !0 }), void 0 === a && (a = i(86238)), a(s, { readable: o, writable: u }, function (s) { if (s) return _(s) - ;(x = !0), _() - }) + ;((x = !0), _()) + })) var C = !1 return function (o) { if (!x && !C) @@ -23402,7 +23448,7 @@ ) } })(s, _, u > 0, function (s) { - x || (x = s), s && j.forEach(call), _ || (j.forEach(call), C(x)) + ;(x || (x = s), s && j.forEach(call), _ || (j.forEach(call), C(x))) }) }) return o.reduce(pipe) @@ -23430,9 +23476,9 @@ return '<' + $ + '>' + s + '' }, NullProtoObjectViaActiveX = function (s) { - s.write(scriptTag('')), s.close() + ;(s.write(scriptTag('')), s.close()) var o = s.parentWindow.Object - return (s = null), o + return ((s = null), o) }, NullProtoObject = function () { try { @@ -23456,7 +23502,7 @@ for (var u = w.length; u--; ) delete NullProtoObject[B][w[u]] return NullProtoObject() } - ;(x[U] = !0), + ;((x[U] = !0), (s.exports = Object.create || function create(s, o) { @@ -23470,7 +23516,7 @@ : (i = NullProtoObject()), void 0 === o ? i : _.f(i, o) ) - }) + })) }, 58156: (s, o, i) => { var a = i(47422) @@ -23512,7 +23558,7 @@ 59399: (s, o, i) => { 'use strict' var a = i(25264).CopyToClipboard - ;(a.CopyToClipboard = a), (s.exports = a) + ;((a.CopyToClipboard = a), (s.exports = a)) }, 59550: (s) => { 'use strict' @@ -23608,7 +23654,7 @@ ) for (_e in be) (ae || we || !(_e in xe)) && U(xe, _e, be[_e]) else a({ target: o, proto: !0, forced: ae || we }, be) - return (_ && !fe) || xe[ce] === Te || U(xe, ce, Te, { name: V }), (z[o] = Te), be + return ((_ && !fe) || xe[ce] === Te || U(xe, ce, Te, { name: V }), (z[o] = Te), be) } }, 60270: (s, o, i) => { @@ -23653,7 +23699,7 @@ x = i(10866) s.exports = class ObjectElement extends _ { constructor(s, o, i) { - super(s || [], o, i), (this.element = 'object') + ;(super(s || [], o, i), (this.element = 'object')) } primitive() { return 'object' @@ -23692,7 +23738,7 @@ ) const i = s, a = this.getMember(i) - return a ? (a.value = o) : this.content.push(new w(i, o)), this + return (a ? (a.value = o) : this.content.push(new w(i, o)), this) } keys() { return this.content.map((s) => s.key.toValue()) @@ -23793,7 +23839,7 @@ ) } function extractProtocol(s, o) { - ;(s = (s = trimLeft(s)).replace(w, '')), (o = o || {}) + ;((s = (s = trimLeft(s)).replace(w, '')), (o = o || {})) var i, a = j.exec(s), u = a[1] ? a[1].toLowerCase() : '', @@ -23858,7 +23904,7 @@ (Y[U] = Y[U] || (_ && j[3] && o[U]) || ''), j[4] && (Y[U] = Y[U].toLowerCase())) : (s = j(s, Y)) - i && (Y.query = i(Y.query)), + ;(i && (Y.query = i(Y.query)), _ && o.slashes && '/' !== Y.pathname.charAt(0) && @@ -23872,14 +23918,13 @@ _ = !1, w = 0; a--; - ) '.' === i[a] ? i.splice(a, 1) : '..' === i[a] ? (i.splice(a, 1), w++) : w && (0 === a && (_ = !0), i.splice(a, 1), w--) - return _ && i.unshift(''), ('.' !== u && '..' !== u) || i.push(''), i.join('/') + return (_ && i.unshift(''), ('.' !== u && '..' !== u) || i.push(''), i.join('/')) })(Y.pathname, o.pathname)), '/' !== Y.pathname.charAt(0) && isSpecial(Y.protocol) && @@ -23898,32 +23943,32 @@ 'file:' !== Y.protocol && isSpecial(Y.protocol) && Y.host ? Y.protocol + '//' + Y.host : 'null'), - (Y.href = Y.toString()) + (Y.href = Y.toString())) } - ;(Url.prototype = { + ;((Url.prototype = { set: function set(s, o, i) { var _ = this switch (s) { case 'query': - 'string' == typeof o && o.length && (o = (i || u.parse)(o)), (_[s] = o) + ;('string' == typeof o && o.length && (o = (i || u.parse)(o)), (_[s] = o)) break case 'port': - ;(_[s] = o), + ;((_[s] = o), a(o, _.protocol) ? o && (_.host = _.hostname + ':' + o) - : ((_.host = _.hostname), (_[s] = '')) + : ((_.host = _.hostname), (_[s] = ''))) break case 'hostname': - ;(_[s] = o), _.port && (o += ':' + _.port), (_.host = o) + ;((_[s] = o), _.port && (o += ':' + _.port), (_.host = o)) break case 'host': - ;(_[s] = o), + ;((_[s] = o), C.test(o) ? ((o = o.split(':')), (_.port = o.pop()), (_.hostname = o.join(':'))) - : ((_.hostname = o), (_.port = '')) + : ((_.hostname = o), (_.port = ''))) break case 'protocol': - ;(_.protocol = o.toLowerCase()), (_.slashes = !i) + ;((_.protocol = o.toLowerCase()), (_.slashes = !i)) break case 'pathname': case 'hash': @@ -23990,7 +24035,7 @@ (Url.location = lolcation), (Url.trimLeft = trimLeft), (Url.qs = u), - (s.exports = Url) + (s.exports = Url)) }, 61448: (s, o, i) => { var a = i(20426), @@ -24017,7 +24062,7 @@ return u.f(s, o, _(1, i)) } : function (s, o, i) { - return (s[o] = i), s + return ((s[o] = i), s) } }, 61747: (s, o, i) => { @@ -24059,10 +24104,10 @@ var x = Object(o) if (!u(o)) { var C = a(i, 3) - ;(o = _(o)), + ;((o = _(o)), (i = function (s) { return C(x[s], s, x) - }) + })) } var j = s(o, i, w) return j > -1 ? x[C ? o[j] : j] : void 0 @@ -24115,7 +24160,7 @@ var a = i(50104) s.exports = function memoizeCapped(s) { var o = a(s, function (s) { - return 500 === i.size && i.clear(), s + return (500 === i.size && i.clear(), s) }), i = o.cache return o @@ -24152,7 +24197,7 @@ }, 62802: (s, o, i) => { 'use strict' - ;(s.exports = function SHA(o) { + ;((s.exports = function SHA(o) { var i = o.toLowerCase(), a = s.exports[i] if (!a) throw new Error(i + ' is not supported (we accept pull requests)') @@ -24163,15 +24208,15 @@ (s.exports.sha224 = i(26710)), (s.exports.sha256 = i(24107)), (s.exports.sha384 = i(32827)), - (s.exports.sha512 = i(82890)) + (s.exports.sha512 = i(82890))) }, 63040: (s, o, i) => { var a = i(21549), u = i(80079), _ = i(68223) s.exports = function mapCacheClear() { - ;(this.size = 0), - (this.__data__ = { hash: new a(), map: new (_ || u)(), string: new a() }) + ;((this.size = 0), + (this.__data__ = { hash: new a(), map: new (_ || u)(), string: new a() })) } }, 63345: (s) => { @@ -24193,10 +24238,10 @@ if (!(this instanceof PassThrough)) return new PassThrough(s) a.call(this, s) } - i(56698)(PassThrough, a), + ;(i(56698)(PassThrough, a), (PassThrough.prototype._transform = function (s, o, i) { i(null, s) - }) + })) }, 63605: (s) => { s.exports = function stackGet(s) { @@ -24205,7 +24250,7 @@ }, 63702: (s) => { s.exports = function listCacheClear() { - ;(this.__data__ = []), (this.size = 0) + ;((this.__data__ = []), (this.size = 0)) } }, 63737: (s, o, i) => { @@ -24216,7 +24261,7 @@ w = [1518500249, 1859775393, -1894007588, -899497514], x = new Array(80) function Sha1() { - this.init(), (this._w = x), u.call(this, 64, 56) + ;(this.init(), (this._w = x), u.call(this, 64, 56)) } function rotl5(s) { return (s << 5) | (s >>> 27) @@ -24227,7 +24272,7 @@ function ft(s, o, i, a) { return 0 === s ? (o & i) | (~o & a) : 2 === s ? (o & i) | (o & a) | (i & a) : o ^ i ^ a } - a(Sha1, u), + ;(a(Sha1, u), (Sha1.prototype.init = function () { return ( (this._a = 1732584193), @@ -24257,13 +24302,13 @@ for (var L = 0; L < 80; ++L) { var B = ~~(L / 20), $ = (rotl5(a) + ft(B, u, _, x) + C + i[L] + w[B]) | 0 - ;(C = x), (x = _), (_ = rotl30(u)), (u = a), (a = $) + ;((C = x), (x = _), (_ = rotl30(u)), (u = a), (a = $)) } - ;(this._a = (a + this._a) | 0), + ;((this._a = (a + this._a) | 0), (this._b = (u + this._b) | 0), (this._c = (_ + this._c) | 0), (this._d = (x + this._d) | 0), - (this._e = (C + this._e) | 0) + (this._e = (C + this._e) | 0)) }), (Sha1.prototype._hash = function () { var s = _.allocUnsafe(20) @@ -24276,12 +24321,12 @@ s ) }), - (s.exports = Sha1) + (s.exports = Sha1)) }, 63862: (s) => { s.exports = function hashDelete(s) { var o = this.has(s) && delete this.__data__[s] - return (this.size -= o ? 1 : 0), o + return ((this.size -= o ? 1 : 0), o) } }, 63912: (s, o, i) => { @@ -24356,32 +24401,32 @@ Y = x.WeakMap if (w || B.state) { var Z = B.state || (B.state = new Y()) - ;(Z.get = Z.get), + ;((Z.get = Z.get), (Z.has = Z.has), (Z.set = Z.set), (a = function (s, o) { if (Z.has(s)) throw new z(V) - return (o.facade = s), Z.set(s, o), o + return ((o.facade = s), Z.set(s, o), o) }), (u = function (s) { return Z.get(s) || {} }), (_ = function (s) { return Z.has(s) - }) + })) } else { var ee = $('state') - ;(U[ee] = !0), + ;((U[ee] = !0), (a = function (s, o) { if (L(s, ee)) throw new z(V) - return (o.facade = s), j(s, ee, o), o + return ((o.facade = s), j(s, ee, o), o) }), (u = function (s) { return L(s, ee) ? s[ee] : {} }), (_ = function (s) { return L(s, ee) - }) + })) } s.exports = { set: a, @@ -24438,7 +24483,7 @@ function runTimeout(s) { if (o === setTimeout) return setTimeout(s, 0) if ((o === defaultSetTimout || !o) && setTimeout) - return (o = setTimeout), setTimeout(s, 0) + return ((o = setTimeout), setTimeout(s, 0)) try { return o(s, 0) } catch (i) { @@ -24474,14 +24519,14 @@ w = !0 for (var o = _.length; o; ) { for (u = _, _ = []; ++x < o; ) u && u[x].run() - ;(x = -1), (o = _.length) + ;((x = -1), (o = _.length)) } - ;(u = null), + ;((u = null), (w = !1), (function runClearTimeout(s) { if (i === clearTimeout) return clearTimeout(s) if ((i === defaultClearTimeout || !i) && clearTimeout) - return (i = clearTimeout), clearTimeout(s) + return ((i = clearTimeout), clearTimeout(s)) try { return i(s) } catch (o) { @@ -24491,18 +24536,18 @@ return i.call(this, s) } } - })(s) + })(s)) } } function Item(s, o) { - ;(this.fun = s), (this.array = o) + ;((this.fun = s), (this.array = o)) } function noop() {} - ;(a.nextTick = function (s) { + ;((a.nextTick = function (s) { var o = new Array(arguments.length - 1) if (arguments.length > 1) for (var i = 1; i < arguments.length; i++) o[i - 1] = arguments[i] - _.push(new Item(s, o)), 1 !== _.length || w || runTimeout(drainQueue) + ;(_.push(new Item(s, o)), 1 !== _.length || w || runTimeout(drainQueue)) }), (Item.prototype.run = function () { this.fun.apply(null, this.array) @@ -24536,7 +24581,7 @@ }), (a.umask = function () { return 0 - }) + })) }, 65772: (s) => { s.exports = function json(s) { @@ -24576,7 +24621,8 @@ w = i(22225) s.exports = function words(s, o, i) { return ( - (s = _(s)), void 0 === (o = i ? void 0 : o) ? (u(s) ? w(s) : a(s)) : s.match(o) || [] + (s = _(s)), + void 0 === (o = i ? void 0 : o) ? (u(s) ? w(s) : a(s)) : s.match(o) || [] ) } }, @@ -24657,7 +24703,7 @@ }, 67526: (s, o) => { 'use strict' - ;(o.byteLength = function byteLength(s) { + ;((o.byteLength = function byteLength(s) { var o = getLens(s), i = o[0], a = o[1] @@ -24677,14 +24723,14 @@ j = 0, L = x > 0 ? w - 4 : w for (i = 0; i < L; i += 4) - (o = + ((o = (a[s.charCodeAt(i)] << 18) | (a[s.charCodeAt(i + 1)] << 12) | (a[s.charCodeAt(i + 2)] << 6) | a[s.charCodeAt(i + 3)]), (C[j++] = (o >> 16) & 255), (C[j++] = (o >> 8) & 255), - (C[j++] = 255 & o) + (C[j++] = 255 & o)) 2 === x && ((o = (a[s.charCodeAt(i)] << 2) | (a[s.charCodeAt(i + 1)] >> 4)), (C[j++] = 255 & o)) @@ -24710,7 +24756,7 @@ ((o = (s[a - 2] << 8) + s[a - 1]), _.push(i[o >> 10] + i[(o >> 4) & 63] + i[(o << 2) & 63] + '=')) return _.join('') - }) + })) for ( var i = [], a = [], @@ -24720,20 +24766,20 @@ w < 64; ++w ) - (i[w] = _[w]), (a[_.charCodeAt(w)] = w) + ((i[w] = _[w]), (a[_.charCodeAt(w)] = w)) function getLens(s) { var o = s.length if (o % 4 > 0) throw new Error('Invalid string. Length must be a multiple of 4') var i = s.indexOf('=') - return -1 === i && (i = o), [i, i === o ? 0 : 4 - (i % 4)] + return (-1 === i && (i = o), [i, i === o ? 0 : 4 - (i % 4)]) } function encodeChunk(s, o, a) { for (var u, _, w = [], x = o; x < a; x += 3) - (u = ((s[x] << 16) & 16711680) + ((s[x + 1] << 8) & 65280) + (255 & s[x + 2])), - w.push(i[((_ = u) >> 18) & 63] + i[(_ >> 12) & 63] + i[(_ >> 6) & 63] + i[63 & _]) + ((u = ((s[x] << 16) & 16711680) + ((s[x + 1] << 8) & 65280) + (255 & s[x + 2])), + w.push(i[((_ = u) >> 18) & 63] + i[(_ >> 12) & 63] + i[(_ >> 6) & 63] + i[63 & _])) return w.join('') } - ;(a['-'.charCodeAt(0)] = 62), (a['_'.charCodeAt(0)] = 63) + ;((a['-'.charCodeAt(0)] = 62), (a['_'.charCodeAt(0)] = 63)) }, 68002: (s) => { 'use strict' @@ -24743,7 +24789,7 @@ 'use strict' var a = i(61626) s.exports = function (s, o, i, u) { - return u && u.enumerable ? (s[o] = i) : a(s, o, i), s + return (u && u.enumerable ? (s[o] = i) : a(s, o, i), s) } }, 68090: (s) => { @@ -24778,7 +24824,7 @@ u = i(48152), _ = u ? function (s, o) { - return u.set(s, o), s + return (u.set(s, o), s) } : a s.exports = _ @@ -24810,7 +24856,7 @@ u = 'object' == typeof Reflect && null !== Reflect && Reflect.apply if ('function' == typeof u && 'function' == typeof Object.defineProperty) try { - ;(o = Object.defineProperty({}, 'length', { + ;((o = Object.defineProperty({}, 'length', { get: function () { throw i }, @@ -24822,7 +24868,7 @@ }, null, o - ) + )) } catch (s) { s !== i && (u = null) } @@ -25080,7 +25126,7 @@ var a = doEval('%AsyncGenerator%') a && de && (o = de(a.prototype)) } - return (xe[s] = o), o + return ((xe[s] = o), o) }, Re = { __proto__: null, @@ -25214,7 +25260,7 @@ if (ae && B + 1 >= i.length) { var Y = ae(w, U) w = ($ = !!Y) && 'get' in Y && !('originalValue' in Y.get) ? Y.get : w[U] - } else ($ = qe(w, U)), (w = w[U]) + } else (($ = qe(w, U)), (w = w[U])) $ && !x && (xe[_] = w) } } @@ -25276,7 +25322,7 @@ const a = i(10316) s.exports = class StringElement extends a { constructor(s, o, i) { - super(s, o, i), (this.element = 'string') + ;(super(s, o, i), (this.element = 'string')) } primitive() { return 'string' @@ -25353,7 +25399,7 @@ s.exports = function mapCacheSet(s, o) { var i = a(this, s), u = i.size - return i.set(s, o), (this.size += i.size == u ? 0 : 1), this + return (i.set(s, o), (this.size += i.size == u ? 0 : 1), this) } }, 73093: (s, o, i) => { @@ -25390,7 +25436,7 @@ var z = $[U] void 0 === (V = C ? C(z, U, $) : void 0) && (V = w(z) ? z : _(o[j + 1]) ? [] : {}) } - a($, U, V), ($ = $[U]) + ;(a($, U, V), ($ = $[U])) } return s } @@ -25399,7 +25445,7 @@ var o = /\w*$/ s.exports = function cloneRegExp(s) { var i = new s.constructor(s.source, o.exec(s)) - return (i.lastIndex = s.lastIndex), i + return ((i.lastIndex = s.lastIndex), i) } }, 73402: (s) => { @@ -25481,7 +25527,7 @@ if (i) { for (var a = Array(i); i--; ) a[i] = arguments[i] var u = (a[0] = o.apply(void 0, a)) - return s.apply(void 0, a), u + return (s.apply(void 0, a), u) } } } @@ -25626,7 +25672,9 @@ var w = u[o], x = u.slice(0, o) return ( - w && _.apply(x, w), o != a && _.apply(x, u.slice(o + 1)), s.apply(this, x) + w && _.apply(x, w), + o != a && _.apply(x, u.slice(o + 1)), + s.apply(this, x) ) } })(o, w) @@ -25642,12 +25690,11 @@ for ( var i = -1, a = (o = Pe(o)).length, u = a - 1, _ = le(Object(s)), w = _; null != w && ++i < a; - ) { var x = o[i], C = w[x] - null == C || be(C) || ye(C) || _e(C) || (w[x] = le(i == u ? C : Object(C))), - (w = w[x]) + ;(null == C || be(C) || ye(C) || _e(C) || (w[x] = le(i == u ? C : Object(C))), + (w = w[x])) } return _ } @@ -25668,7 +25715,7 @@ if (!i) return s() for (var a = Array(i); i--; ) a[i] = arguments[i] var u = U ? 0 : i - 1 - return (a[u] = o(a[u])), s.apply(void 0, a) + return ((a[u] = o(a[u])), s.apply(void 0, a)) } } function wrap(s, o, i) { @@ -25738,7 +25785,7 @@ var o = $e[s] if ('function' == typeof o) { for (var i = qe.length; i--; ) if (qe[i][0] == s) return - ;(o.convert = createConverter(s, o)), qe.push([s, o]) + ;((o.convert = createConverter(s, o)), qe.push([s, o])) } }), de(qe, function (s) { @@ -25839,7 +25886,7 @@ return null } } - ;(o.stringify = function querystringify(s, o) { + ;((o.stringify = function querystringify(s, o) { o = o || '' var a, u, @@ -25864,7 +25911,7 @@ null === u || null === _ || u in a || (a[u] = _) } return a - }) + })) }, 74218: (s) => { s.exports = function isKeyable(s) { @@ -25924,7 +25971,7 @@ return j(s, o, i) } catch (s) {} if ('get' in i || 'set' in i) throw new C('Accessors not supported') - return 'value' in i && (s[o] = i.value), s + return ('value' in i && (s[o] = i.value), s) } }, 74335: (s) => { @@ -25980,14 +26027,14 @@ i.transforming = !1 var a = i.writecb if (null === a) return this.emit('error', new _()) - ;(i.writechunk = null), (i.writecb = null), null != o && this.push(o), a(s) + ;((i.writechunk = null), (i.writecb = null), null != o && this.push(o), a(s)) var u = this._readableState - ;(u.reading = !1), - (u.needReadable || u.length < u.highWaterMark) && this._read(u.highWaterMark) + ;((u.reading = !1), + (u.needReadable || u.length < u.highWaterMark) && this._read(u.highWaterMark)) } function Transform(s) { if (!(this instanceof Transform)) return new Transform(s) - C.call(this, s), + ;(C.call(this, s), (this._transformState = { afterTransform: afterTransform.bind(this), needTransform: !1, @@ -26001,7 +26048,7 @@ s && ('function' == typeof s.transform && (this._transform = s.transform), 'function' == typeof s.flush && (this._flush = s.flush)), - this.on('prefinish', prefinish) + this.on('prefinish', prefinish)) } function prefinish() { var s = this @@ -26017,9 +26064,9 @@ if (s._transformState.transforming) throw new w() return s.push(null) } - i(56698)(Transform, C), + ;(i(56698)(Transform, C), (Transform.prototype.push = function (s, o) { - return (this._transformState.needTransform = !1), C.prototype.push.call(this, s, o) + return ((this._transformState.needTransform = !1), C.prototype.push.call(this, s, o)) }), (Transform.prototype._transform = function (s, o, i) { i(new u('_transform()')) @@ -26043,7 +26090,7 @@ C.prototype._destroy.call(this, s, function (s) { o(s) }) - }) + })) }, 74733: (s, o, i) => { var a = i(21791), @@ -26068,22 +26115,22 @@ o && (i.attributes = o) } else if (s._attributes && s._attributes.length > 0) { let { attributes: a } = s - a.get('metadata') && + ;(a.get('metadata') && ((a = a.clone()), a.set('meta', a.get('metadata')), a.remove('metadata')), 'member' === s.element && o && ((a = a.clone()), a.remove('variable')), - a.length > 0 && (i.attributes = this.serialiseObject(a)) + a.length > 0 && (i.attributes = this.serialiseObject(a))) } if (a) i.content = this.enumSerialiseContent(s, i) else if (this[`${s.element}SerialiseContent`]) i.content = this[`${s.element}SerialiseContent`](s, i) else if (void 0 !== s.content) { let a - o && s.content.key + ;(o && s.content.key ? ((a = s.content.clone()), a.key.attributes.set('variable', o), (a = this.serialiseContent(a))) : (a = this.serialiseContent(s.content)), - this.shouldSerialiseContent(s, a) && (i.content = a) + this.shouldSerialiseContent(s, a) && (i.content = a)) } else this.shouldSerialiseContent(s, s.content) && s instanceof this.namespace.elements.Array && @@ -26101,7 +26148,7 @@ ) } refSerialiseContent(s, o) { - return delete o.attributes, { href: s.toValue(), path: s.path.toValue() } + return (delete o.attributes, { href: s.toValue(), path: s.path.toValue() }) } sourceMapSerialiseContent(s) { return s.toValue() @@ -26139,12 +26186,12 @@ if (o && o.length > 0) return o.content.map((s) => { const o = s.clone() - return o.attributes.remove('typeAttributes'), this.serialise(o) + return (o.attributes.remove('typeAttributes'), this.serialise(o)) }) } if (s.content) { const o = s.content.clone() - return o.attributes.remove('typeAttributes'), [this.serialise(o)] + return (o.attributes.remove('typeAttributes'), [this.serialise(o)]) } return [] } @@ -26157,30 +26204,30 @@ return new this.namespace.elements.Array(s.map(this.deserialise, this)) const o = this.namespace.getElementClass(s.element), i = new o() - i.element !== s.element && (i.element = s.element), + ;(i.element !== s.element && (i.element = s.element), s.meta && this.deserialiseObject(s.meta, i.meta), - s.attributes && this.deserialiseObject(s.attributes, i.attributes) + s.attributes && this.deserialiseObject(s.attributes, i.attributes)) const a = this.deserialiseContent(s.content) if (((void 0 === a && null !== i.content) || (i.content = a), 'enum' === i.element)) { i.content && i.attributes.set('enumerations', i.content) let s = i.attributes.get('samples') if ((i.attributes.remove('samples'), s)) { const a = s - ;(s = new this.namespace.elements.Array()), + ;((s = new this.namespace.elements.Array()), a.forEach((a) => { a.forEach((a) => { const u = new o(a) - ;(u.element = i.element), s.push(u) + ;((u.element = i.element), s.push(u)) }) - }) + })) const u = s.shift() - ;(i.content = u ? u.content : void 0), i.attributes.set('samples', s) + ;((i.content = u ? u.content : void 0), i.attributes.set('samples', s)) } else i.content = void 0 let a = i.attributes.get('default') if (a && a.length > 0) { a = a.get(0) const s = new o(a) - ;(s.element = i.element), i.attributes.set('default', s) + ;((s.element = i.element), i.attributes.set('default', s)) } } else if ('dataStructure' === i.element && Array.isArray(i.content)) [i.content] = i.content @@ -26200,7 +26247,7 @@ if (s instanceof this.namespace.elements.Element) return this.serialise(s) if (s instanceof this.namespace.KeyValuePair) { const o = { key: this.serialise(s.key) } - return s.value && (o.value = this.serialise(s.value)), o + return (s.value && (o.value = this.serialise(s.value)), o) } return s && s.map ? s.map(this.serialise, this) : s } @@ -26209,7 +26256,7 @@ if (s.element) return this.deserialise(s) if (s.key) { const o = new this.namespace.KeyValuePair(this.deserialise(s.key)) - return s.value && (o.value = this.deserialise(s.value)), o + return (s.value && (o.value = this.deserialise(s.value)), o) } if (s.map) return s.map(this.deserialise, this) } @@ -26272,9 +26319,9 @@ if (1 === a) return s if (2 === a) return s + s var u = s.length * a - if (o !== s || void 0 === o) (o = s), (i = '') + if (o !== s || void 0 === o) ((o = s), (i = '')) else if (i.length >= u) return i.substr(0, u) - for (; u > i.length && a > 1; ) 1 & a && (i += s), (a >>= 1), (s += s) + for (; u > i.length && a > 1; ) (1 & a && (i += s), (a >>= 1), (s += s)) return (i = (i += s).substr(0, u)) } }, @@ -26316,7 +26363,7 @@ 'use strict' var a = i(65606) function emitErrorAndCloseNT(s, o) { - emitErrorNT(s, o), emitCloseNT(s) + ;(emitErrorNT(s, o), emitCloseNT(s)) } function emitCloseNT(s) { ;(s._writableState && !s._writableState.emitClose) || @@ -26358,7 +26405,7 @@ this) }, undestroy: function undestroy() { - this._readableState && + ;(this._readableState && ((this._readableState.destroyed = !1), (this._readableState.reading = !1), (this._readableState.ended = !1), @@ -26370,7 +26417,7 @@ (this._writableState.finalCalled = !1), (this._writableState.prefinished = !1), (this._writableState.finished = !1), - (this._writableState.errorEmitted = !1)) + (this._writableState.errorEmitted = !1))) }, errorOrDestroy: function errorOrDestroy(s, o) { var i = s._readableState, @@ -26450,7 +26497,7 @@ L = u('wks'), B = C ? j.for || j : (j && j.withoutSetter) || w s.exports = function (s) { - return _(L, s) || (L[s] = x && _(j, s) ? j[s] : B('Symbol.' + s)), L[s] + return (_(L, s) || (L[s] = x && _(j, s) ? j[s] : B('Symbol.' + s)), L[s]) } }, 76545: (s, o, i) => { @@ -26556,7 +26603,7 @@ }, 77731: (s, o, i) => { var a = i(79920)('set', i(63560)) - ;(a.placeholder = i(2874)), (s.exports = a) + ;((a.placeholder = i(2874)), (s.exports = a)) }, 77797: (s, o, i) => { var a = i(44394) @@ -26570,7 +26617,7 @@ 'use strict' class SubRange { constructor(s, o) { - ;(this.low = s), (this.high = o), (this.length = 1 + o - s) + ;((this.low = s), (this.high = o), (this.length = 1 + o - s)) } overlaps(s) { return !(this.high < s.low || this.low > s.high) @@ -26596,7 +26643,7 @@ } class DRange { constructor(s, o) { - ;(this.ranges = []), (this.length = 0), null != s && this.add(s, o) + ;((this.ranges = []), (this.length = 0), null != s && this.add(s, o)) } _update_length() { this.length = this.ranges.reduce((s, o) => s + o.length, 0) @@ -26607,10 +26654,9 @@ for ( var i = this.ranges.slice(0, o); o < this.ranges.length && s.touches(this.ranges[o]); - ) - (s = s.add(this.ranges[o])), o++ - i.push(s), (this.ranges = i.concat(this.ranges.slice(o))), this._update_length() + ((s = s.add(this.ranges[o])), o++) + ;(i.push(s), (this.ranges = i.concat(this.ranges.slice(o))), this._update_length()) } return ( s instanceof DRange @@ -26625,10 +26671,9 @@ for ( var i = this.ranges.slice(0, o); o < this.ranges.length && s.overlaps(this.ranges[o]); - ) - (i = i.concat(this.ranges[o].subtract(s))), o++ - ;(this.ranges = i.concat(this.ranges.slice(o))), this._update_length() + ((i = i.concat(this.ranges[o].subtract(s))), o++) + ;((this.ranges = i.concat(this.ranges.slice(o))), this._update_length()) } return ( s instanceof DRange @@ -26644,7 +26689,7 @@ for (; o < this.ranges.length && s.overlaps(this.ranges[o]); ) { var a = Math.max(this.ranges[o].low, s.low), u = Math.min(this.ranges[o].high, s.high) - i.push(new SubRange(a, u)), o++ + ;(i.push(new SubRange(a, u)), o++) } } return ( @@ -26658,7 +26703,7 @@ } index(s) { for (var o = 0; o < this.ranges.length && this.ranges[o].length <= s; ) - (s -= this.ranges[o].length), o++ + ((s -= this.ranges[o].length), o++) return this.ranges[o].low + s } toString() { @@ -26669,7 +26714,7 @@ } numbers() { return this.ranges.reduce((s, o) => { - for (var i = o.low; i <= o.high; ) s.push(i), i++ + for (var i = o.low; i <= o.high; ) (s.push(i), i++) return s }, []) } @@ -26707,10 +26752,11 @@ o = !1, i = {} try { - ;(s = a(Object.prototype, '__proto__', 'set'))(i, []), (o = i instanceof Array) + ;((s = a(Object.prototype, '__proto__', 'set'))(i, []), + (o = i instanceof Array)) } catch (s) {} return function setPrototypeOf(i, a) { - return _(i), w(a), u(i) ? (o ? s(i, a) : (i.__proto__ = a), i) : i + return (_(i), w(a), u(i) ? (o ? s(i, a) : (i.__proto__ = a), i) : i) } })() : void 0) @@ -26764,12 +26810,12 @@ this.set(a[0], a[1]) } } - ;(ListCache.prototype.clear = a), + ;((ListCache.prototype.clear = a), (ListCache.prototype.delete = u), (ListCache.prototype.get = _), (ListCache.prototype.has = w), (ListCache.prototype.set = x), - (s.exports = ListCache) + (s.exports = ListCache)) }, 80218: (s, o, i) => { var a = i(13222) @@ -26798,11 +26844,11 @@ var i = Object.keys(s) if (Object.getOwnPropertySymbols) { var a = Object.getOwnPropertySymbols(s) - o && + ;(o && (a = a.filter(function (o) { return Object.getOwnPropertyDescriptor(s, o).enumerable })), - i.push.apply(i, a) + i.push.apply(i, a)) } return i } @@ -26837,10 +26883,10 @@ function _defineProperties(s, o) { for (var i = 0; i < o.length; i++) { var a = o[i] - ;(a.enumerable = a.enumerable || !1), + ;((a.enumerable = a.enumerable || !1), (a.configurable = !0), 'value' in a && (a.writable = !0), - Object.defineProperty(s, _toPropertyKey(a.key), a) + Object.defineProperty(s, _toPropertyKey(a.key), a)) } } function _toPropertyKey(s) { @@ -26861,12 +26907,12 @@ _ = (u && u.custom) || 'inspect' s.exports = (function () { function BufferList() { - !(function _classCallCheck(s, o) { + ;(!(function _classCallCheck(s, o) { if (!(s instanceof o)) throw new TypeError('Cannot call a class as a function') })(this, BufferList), (this.head = null), (this.tail = null), - (this.length = 0) + (this.length = 0)) } return ( (function _createClass(s, o, i) { @@ -26881,16 +26927,16 @@ key: 'push', value: function push(s) { var o = { data: s, next: null } - this.length > 0 ? (this.tail.next = o) : (this.head = o), + ;(this.length > 0 ? (this.tail.next = o) : (this.head = o), (this.tail = o), - ++this.length + ++this.length) }, }, { key: 'unshift', value: function unshift(s) { var o = { data: s, next: this.head } - 0 === this.length && (this.tail = o), (this.head = o), ++this.length + ;(0 === this.length && (this.tail = o), (this.head = o), ++this.length) }, }, { @@ -26911,7 +26957,7 @@ { key: 'clear', value: function clear() { - ;(this.head = this.tail = null), (this.length = 0) + ;((this.head = this.tail = null), (this.length = 0)) }, }, { @@ -26927,12 +26973,12 @@ value: function concat(s) { if (0 === this.length) return a.alloc(0) for (var o, i, u, _ = a.allocUnsafe(s >>> 0), w = this.head, x = 0; w; ) - (o = w.data), + ((o = w.data), (i = _), (u = x), a.prototype.copy.call(o, i, u), (x += w.data.length), - (w = w.next) + (w = w.next)) return _ }, }, @@ -26977,7 +27023,7 @@ } ++i } - return (this.length -= i), a + return ((this.length -= i), a) }, }, { @@ -26997,7 +27043,7 @@ } ++u } - return (this.length -= u), o + return ((this.length -= u), o) }, }, { @@ -27046,10 +27092,10 @@ var i = this.__data__ if (i instanceof a) { var w = i.__data__ - if (!u || w.length < 199) return w.push([s, o]), (this.size = ++i.size), this + if (!u || w.length < 199) return (w.push([s, o]), (this.size = ++i.size), this) i = this.__data__ = new _(w) } - return i.set(s, o), (this.size = i.size), this + return (i.set(s, o), (this.size = i.size), this) } }, 81042: (s, o, i) => { @@ -27076,7 +27122,7 @@ _typeof(s) ) } - Object.defineProperty(o, '__esModule', { value: !0 }), (o.DebounceInput = void 0) + ;(Object.defineProperty(o, '__esModule', { value: !0 }), (o.DebounceInput = void 0)) var a = _interopRequireDefault(i(96540)), u = _interopRequireDefault(i(20181)), _ = [ @@ -27104,15 +27150,15 @@ a, u = {}, _ = Object.keys(s) - for (a = 0; a < _.length; a++) (i = _[a]), o.indexOf(i) >= 0 || (u[i] = s[i]) + for (a = 0; a < _.length; a++) ((i = _[a]), o.indexOf(i) >= 0 || (u[i] = s[i])) return u })(s, o) if (Object.getOwnPropertySymbols) { var _ = Object.getOwnPropertySymbols(s) for (a = 0; a < _.length; a++) - (i = _[a]), + ((i = _[a]), o.indexOf(i) >= 0 || - (Object.prototype.propertyIsEnumerable.call(s, i) && (u[i] = s[i])) + (Object.prototype.propertyIsEnumerable.call(s, i) && (u[i] = s[i]))) } return u } @@ -27120,11 +27166,11 @@ var i = Object.keys(s) if (Object.getOwnPropertySymbols) { var a = Object.getOwnPropertySymbols(s) - o && + ;(o && (a = a.filter(function (o) { return Object.getOwnPropertyDescriptor(s, o).enumerable })), - i.push.apply(i, a) + i.push.apply(i, a)) } return i } @@ -27146,10 +27192,10 @@ function _defineProperties(s, o) { for (var i = 0; i < o.length; i++) { var a = o[i] - ;(a.enumerable = a.enumerable || !1), + ;((a.enumerable = a.enumerable || !1), (a.configurable = !0), 'value' in a && (a.writable = !0), - Object.defineProperty(s, a.key, a) + Object.defineProperty(s, a.key, a)) } } function _setPrototypeOf(s, o) { @@ -27157,7 +27203,7 @@ (_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(s, o) { - return (s.__proto__ = o), s + return ((s.__proto__ = o), s) }), _setPrototypeOf(s, o) ) @@ -27169,7 +27215,8 @@ if ('function' == typeof Proxy) return !0 try { return ( - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0 + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), + !0 ) } catch (s) { return !1 @@ -27222,16 +27269,16 @@ !(function _inherits(s, o) { if ('function' != typeof o && null !== o) throw new TypeError('Super expression must either be null or a function') - ;(s.prototype = Object.create(o && o.prototype, { + ;((s.prototype = Object.create(o && o.prototype, { constructor: { value: s, writable: !0, configurable: !0 }, })), Object.defineProperty(s, 'prototype', { writable: !1 }), - o && _setPrototypeOf(s, o) + o && _setPrototypeOf(s, o)) })(DebounceInput, s) var o = _createSuper(DebounceInput) function DebounceInput(s) { var i - !(function _classCallCheck(s, o) { + ;(!(function _classCallCheck(s, o) { if (!(s instanceof o)) throw new TypeError('Cannot call a class as a function') })(this, DebounceInput), _defineProperty( @@ -27280,17 +27327,17 @@ else if (0 === s) i.notify = i.doNotify else { var o = (0, u.default)(function (s) { - ;(i.isDebouncing = !1), i.doNotify(s) + ;((i.isDebouncing = !1), i.doNotify(s)) }, s) - ;(i.notify = function (s) { - ;(i.isDebouncing = !0), o(s) + ;((i.notify = function (s) { + ;((i.isDebouncing = !0), o(s)) }), (i.flush = function () { return o.flush() }), (i.cancel = function () { - ;(i.isDebouncing = !1), o.cancel() - }) + ;((i.isDebouncing = !1), o.cancel()) + })) } }), _defineProperty(_assertThisInitialized(i), 'doNotify', function () { @@ -27314,9 +27361,9 @@ } }), (i.isDebouncing = !1), - (i.state = { value: void 0 === s.value || null === s.value ? '' : s.value }) + (i.state = { value: void 0 === s.value || null === s.value ? '' : s.value })) var a = i.props.debounceTimeout - return i.createNotifier(a), i + return (i.createNotifier(a), i) } return ( (function _createClass(s, o, i) { @@ -27337,8 +27384,8 @@ u = s.debounceTimeout, _ = s.value, w = this.state.value - void 0 !== i && _ !== i && w !== i && this.setState({ value: i }), - a !== u && this.createNotifier(a) + ;(void 0 !== i && _ !== i && w !== i && this.setState({ value: i }), + a !== u && this.createNotifier(a)) } }, }, @@ -27363,8 +27410,8 @@ L = i.inputRef, B = _objectWithoutProperties(i, _), $ = this.state.value - ;(s = w ? { onKeyDown: this.onKeyDown } : C ? { onKeyDown: C } : {}), - (o = x ? { onBlur: this.onBlur } : j ? { onBlur: j } : {}) + ;((s = w ? { onKeyDown: this.onKeyDown } : C ? { onKeyDown: C } : {}), + (o = x ? { onBlur: this.onBlur } : j ? { onBlur: j } : {})) var U = L ? { ref: L } : {} return a.default.createElement( u, @@ -27387,7 +27434,7 @@ DebounceInput ) })(a.default.PureComponent) - ;(o.DebounceInput = w), + ;((o.DebounceInput = w), _defineProperty(w, 'defaultProps', { element: 'input', type: 'text', @@ -27399,7 +27446,7 @@ forceNotifyByEnter: !0, forceNotifyOnBlur: !0, inputRef: void 0, - }) + })) }, 81919: (s, o, i) => { 'use strict' @@ -27410,7 +27457,7 @@ function cloneSpecificValue(s) { if (s instanceof a) { var o = a.alloc ? a.alloc(s.length) : new a(s.length) - return s.copy(o), o + return (s.copy(o), o) } if (s instanceof Date) return new Date(s.getTime()) if (s instanceof RegExp) return new RegExp(s) @@ -27486,12 +27533,12 @@ ee = function AggregateError(s, o) { var i, a = u(ie, this) - w ? (i = w(new Y(), a ? _(this) : ie)) : ((i = a ? this : C(ie)), j(i, z, 'Error')), + ;(w ? (i = w(new Y(), a ? _(this) : ie)) : ((i = a ? this : C(ie)), j(i, z, 'Error')), void 0 !== o && j(i, 'message', V(o)), $(i, ee, i.stack, 1), - arguments.length > 2 && B(i, arguments[2]) + arguments.length > 2 && B(i, arguments[2])) var x = [] - return U(s, Z, { that: x }), j(i, 'errors', x), i + return (U(s, Z, { that: x }), j(i, 'errors', x), i) } w ? w(ee, Y) : x(ee, Y, { name: !0 }) var ie = (ee.prototype = C(Y.prototype, { @@ -27527,7 +27574,7 @@ function _interopRequireDefault(s) { return s && s.__esModule ? s : { default: s } } - ;(o.default = function (s, o, i) { + ;((o.default = function (s, o, i) { var _ = Object.keys(o) if (!_.length) return 'Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.' @@ -27561,7 +27608,7 @@ '". Unexpected properties will be ignored.' : null }), - (s.exports = o.default) + (s.exports = o.default)) }, 82682: (s, o, i) => { 'use strict' @@ -27571,7 +27618,7 @@ s.exports = function forEach(s, o, i) { if (!a(o)) throw new TypeError('iterator must be a function') var w - arguments.length >= 3 && (w = i), + ;(arguments.length >= 3 && (w = i), (function isArray(s) { return '[object Array]' === u.call(s) })(s) @@ -27587,7 +27634,7 @@ : (function forEachObject(s, o, i) { for (var a in s) _.call(s, a) && (null == i ? o(s[a], a, s) : o.call(i, s[a], a, s)) - })(s, o, w) + })(s, o, w)) } }, 82819: (s, o, i) => { @@ -27652,7 +27699,7 @@ ], x = new Array(160) function Sha512() { - this.init(), (this._w = x), u.call(this, 128, 112) + ;(this.init(), (this._w = x), u.call(this, 128, 112)) } function Ch(s, o, i) { return i ^ (s & (o ^ i)) @@ -27681,7 +27728,7 @@ function getCarry(s, o) { return s >>> 0 < o >>> 0 ? 1 : 0 } - a(Sha512, u), + ;(a(Sha512, u), (Sha512.prototype.init = function () { return ( (this._ah = 1779033703), @@ -27726,7 +27773,7 @@ ie < 32; ie += 2 ) - (o[ie] = s.readInt32BE(4 * ie)), (o[ie + 1] = s.readInt32BE(4 * ie + 4)) + ((o[ie] = s.readInt32BE(4 * ie)), (o[ie + 1] = s.readInt32BE(4 * ie + 4))) for (; ie < 160; ie += 2) { var ae = o[ie - 30], ce = o[ie - 30 + 1], @@ -27740,16 +27787,16 @@ Se = o[ie - 32 + 1], we = (pe + be) | 0, xe = (le + ye + getCarry(we, pe)) | 0 - ;(xe = + ;((xe = ((xe = (xe + de + getCarry((we = (we + fe) | 0), fe)) | 0) + _e + getCarry((we = (we + Se) | 0), Se)) | 0), (o[ie] = xe), - (o[ie + 1] = we) + (o[ie + 1] = we)) } for (var Pe = 0; Pe < 160; Pe += 2) { - ;(xe = o[Pe]), (we = o[Pe + 1]) + ;((xe = o[Pe]), (we = o[Pe + 1])) var Te = maj(i, a, u), Re = maj(B, $, U), $e = sigma0(i, B), @@ -27773,7 +27820,7 @@ 0 var rt = (qe + Re) | 0, nt = ($e + Te + getCarry(rt, qe)) | 0 - ;(L = j), + ;((L = j), (ee = Z), (j = C), (Z = Y), @@ -27786,9 +27833,9 @@ (U = $), (a = i), ($ = B), - (i = (tt + nt + getCarry((B = (et + rt) | 0), et)) | 0) + (i = (tt + nt + getCarry((B = (et + rt) | 0), et)) | 0)) } - ;(this._al = (this._al + B) | 0), + ;((this._al = (this._al + B) | 0), (this._bl = (this._bl + $) | 0), (this._cl = (this._cl + U) | 0), (this._dl = (this._dl + V) | 0), @@ -27803,12 +27850,12 @@ (this._eh = (this._eh + x + getCarry(this._el, z)) | 0), (this._fh = (this._fh + C + getCarry(this._fl, Y)) | 0), (this._gh = (this._gh + j + getCarry(this._gl, Z)) | 0), - (this._hh = (this._hh + L + getCarry(this._hl, ee)) | 0) + (this._hh = (this._hh + L + getCarry(this._hl, ee)) | 0)) }), (Sha512.prototype._hash = function () { var s = _.allocUnsafe(64) function writeInt64BE(o, i, a) { - s.writeInt32BE(o, a), s.writeInt32BE(i, a + 4) + ;(s.writeInt32BE(o, a), s.writeInt32BE(i, a + 4)) } return ( writeInt64BE(this._ah, this._al, 0), @@ -27822,7 +27869,7 @@ s ) }), - (s.exports = Sha512) + (s.exports = Sha512)) }, 83120: (s, o, i) => { var a = i(14528), @@ -27889,7 +27936,7 @@ return s default: if (o) return - ;(s = ('' + s).toLowerCase()), (o = !0) + ;((s = ('' + s).toLowerCase()), (o = !0)) } })(s) if ('string' != typeof o && (a.isEncoding === u || !u(s))) @@ -27899,18 +27946,18 @@ this.encoding) ) { case 'utf16le': - ;(this.text = utf16Text), (this.end = utf16End), (o = 4) + ;((this.text = utf16Text), (this.end = utf16End), (o = 4)) break case 'utf8': - ;(this.fillLast = utf8FillLast), (o = 4) + ;((this.fillLast = utf8FillLast), (o = 4)) break case 'base64': - ;(this.text = base64Text), (this.end = base64End), (o = 3) + ;((this.text = base64Text), (this.end = base64End), (o = 3)) break default: - return (this.write = simpleWrite), void (this.end = simpleEnd) + return ((this.write = simpleWrite), void (this.end = simpleEnd)) } - ;(this.lastNeed = 0), (this.lastTotal = 0), (this.lastChar = a.allocUnsafe(o)) + ;((this.lastNeed = 0), (this.lastTotal = 0), (this.lastChar = a.allocUnsafe(o))) } function utf8CheckByte(s) { return s <= 127 @@ -27928,11 +27975,11 @@ function utf8FillLast(s) { var o = this.lastTotal - this.lastNeed, i = (function utf8CheckExtraBytes(s, o, i) { - if (128 != (192 & o[0])) return (s.lastNeed = 0), '�' + if (128 != (192 & o[0])) return ((s.lastNeed = 0), '�') if (s.lastNeed > 1 && o.length > 1) { - if (128 != (192 & o[1])) return (s.lastNeed = 1), '�' + if (128 != (192 & o[1])) return ((s.lastNeed = 1), '�') if (s.lastNeed > 2 && o.length > 2 && 128 != (192 & o[2])) - return (s.lastNeed = 2), '�' + return ((s.lastNeed = 2), '�') } })(this, s) return void 0 !== i @@ -27994,13 +28041,13 @@ function simpleEnd(s) { return s && s.length ? this.write(s) : '' } - ;(o.I = StringDecoder), + ;((o.I = StringDecoder), (StringDecoder.prototype.write = function (s) { if (0 === s.length) return '' var o, i if (this.lastNeed) { if (void 0 === (o = this.fillLast(s))) return '' - ;(i = this.lastNeed), (this.lastNeed = 0) + ;((i = this.lastNeed), (this.lastNeed = 0)) } else i = 0 return i < s.length ? (o ? o + this.text(s, i) : this.text(s, i)) : o || '' }), @@ -28013,18 +28060,18 @@ var a = o.length - 1 if (a < i) return 0 var u = utf8CheckByte(o[a]) - if (u >= 0) return u > 0 && (s.lastNeed = u - 1), u + if (u >= 0) return (u > 0 && (s.lastNeed = u - 1), u) if (--a < i || -2 === u) return 0 - if (((u = utf8CheckByte(o[a])), u >= 0)) return u > 0 && (s.lastNeed = u - 2), u + if (((u = utf8CheckByte(o[a])), u >= 0)) return (u > 0 && (s.lastNeed = u - 2), u) if (--a < i || -2 === u) return 0 if (((u = utf8CheckByte(o[a])), u >= 0)) - return u > 0 && (2 === u ? (u = 0) : (s.lastNeed = u - 3)), u + return (u > 0 && (2 === u ? (u = 0) : (s.lastNeed = u - 3)), u) return 0 })(this, s, o) if (!this.lastNeed) return s.toString('utf8', o) this.lastTotal = i var a = s.length - (i - this.lastNeed) - return s.copy(this.lastChar, 0, a), s.toString('utf8', o, a) + return (s.copy(this.lastChar, 0, a), s.toString('utf8', o, a)) }), (StringDecoder.prototype.fillLast = function (s) { if (this.lastNeed <= s.length) @@ -28032,9 +28079,9 @@ s.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal) ) - s.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, s.length), - (this.lastNeed -= s.length) - }) + ;(s.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, s.length), + (this.lastNeed -= s.length)) + })) }, 83221: (s) => { s.exports = function createBaseFor(s) { @@ -28076,7 +28123,7 @@ 84058: (s, o, i) => { var a = i(14792), u = i(45539)(function (s, o, i) { - return (o = o.toLowerCase()), s + (i ? a(o) : o) + return ((o = o.toLowerCase()), s + (i ? a(o) : o)) }) s.exports = u }, @@ -28114,7 +28161,7 @@ return s && s.__esModule ? s : { default: s } })(i(9404)), u = i(55674) - ;(o.default = function (s) { + ;((o.default = function (s) { var o = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : a.default.Map, i = Object.keys(s) return function () { @@ -28123,12 +28170,12 @@ return a.withMutations(function (o) { i.forEach(function (i) { var a = (0, s[i])(o.get(i), _) - ;(0, u.validateNextState)(a, i, _), o.set(i, a) + ;((0, u.validateNextState)(a, i, _), o.set(i, a)) }) }) } }), - (s.exports = o.default) + (s.exports = o.default)) }, 85015: (s, o, i) => { var a = i(72552), @@ -28161,28 +28208,28 @@ if (!(s instanceof this.namespace.elements.Element)) throw new TypeError(`Given element \`${s}\` is not an Element instance`) const o = { element: s.element } - s._meta && s._meta.length > 0 && (o.meta = this.serialiseObject(s.meta)), + ;(s._meta && s._meta.length > 0 && (o.meta = this.serialiseObject(s.meta)), s._attributes && s._attributes.length > 0 && - (o.attributes = this.serialiseObject(s.attributes)) + (o.attributes = this.serialiseObject(s.attributes))) const i = this.serialiseContent(s.content) - return void 0 !== i && (o.content = i), o + return (void 0 !== i && (o.content = i), o) } deserialise(s) { if (!s.element) throw new Error('Given value is not an object containing an element name') const o = new (this.namespace.getElementClass(s.element))() - o.element !== s.element && (o.element = s.element), + ;(o.element !== s.element && (o.element = s.element), s.meta && this.deserialiseObject(s.meta, o.meta), - s.attributes && this.deserialiseObject(s.attributes, o.attributes) + s.attributes && this.deserialiseObject(s.attributes, o.attributes)) const i = this.deserialiseContent(s.content) - return (void 0 === i && null !== o.content) || (o.content = i), o + return ((void 0 === i && null !== o.content) || (o.content = i), o) } serialiseContent(s) { if (s instanceof this.namespace.elements.Element) return this.serialise(s) if (s instanceof this.namespace.KeyValuePair) { const o = { key: this.serialise(s.key) } - return s.value && (o.value = this.serialise(s.value)), o + return (s.value && (o.value = this.serialise(s.value)), o) } if (s && s.map) { if (0 === s.length) return @@ -28195,7 +28242,7 @@ if (s.element) return this.deserialise(s) if (s.key) { const o = new this.namespace.KeyValuePair(this.deserialise(s.key)) - return s.value && (o.value = this.deserialise(s.value)), o + return (s.value && (o.value = this.deserialise(s.value)), o) } if (s.map) return s.map(this.deserialise, this) } @@ -28249,7 +28296,7 @@ if ((B || (B = new a()), x(_))) w(s, o, C, i, baseMerge, L, B) else { var $ = L ? L(j(s, C), _, C + '', s, o, B) : void 0 - void 0 === $ && ($ = _), u(s, C, $) + ;(void 0 === $ && ($ = _), u(s, C, $)) } }, C @@ -28295,19 +28342,19 @@ var a = i(26311), u = create(Error) function create(s) { - return (FormattedError.displayName = s.displayName || s.name), FormattedError + return ((FormattedError.displayName = s.displayName || s.name), FormattedError) function FormattedError(o) { - return o && (o = a.apply(null, arguments)), new s(o) + return (o && (o = a.apply(null, arguments)), new s(o)) } } - ;(s.exports = u), + ;((s.exports = u), (u.eval = create(EvalError)), (u.range = create(RangeError)), (u.reference = create(ReferenceError)), (u.syntax = create(SyntaxError)), (u.type = create(TypeError)), (u.uri = create(URIError)), - (u.create = create) + (u.create = create)) }, 85762: (s, o, i) => { 'use strict' @@ -28371,14 +28418,14 @@ } return ( (function _inheritsLoose(s, o) { - ;(s.prototype = Object.create(o.prototype)), + ;((s.prototype = Object.create(o.prototype)), (s.prototype.constructor = s), - (s.__proto__ = o) + (s.__proto__ = o)) })(NodeError, s), NodeError ) })(a) - ;(u.prototype.name = a.name), (u.prototype.code = s), (o[s] = u) + ;((u.prototype.name = a.name), (u.prototype.code = s), (o[s] = u)) } function oneOf(s, o) { if (Array.isArray(s)) { @@ -28397,7 +28444,7 @@ } return 'of '.concat(o, ' ').concat(String(s)) } - createErrorType( + ;(createErrorType( 'ERR_INVALID_OPT_VALUE', function (s, o) { return 'The value "' + o + '" is invalid for option "' + s + '"' @@ -28465,11 +28512,11 @@ 'ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event' ), - (s.exports.F = o) + (s.exports.F = o)) }, 86215: function (s, o) { var i, a, u - ;(a = []), + ;((a = []), (i = (function () { 'use strict' var isNativeSmoothScrollEnabledOn = function (s) { @@ -28482,12 +28529,12 @@ if ('undefined' == typeof window || !('document' in window)) return {} var makeScroller = function (s, o, i) { var a - ;(o = o || 999), i || 0 === i || (i = 9) + ;((o = o || 999), i || 0 === i || (i = 9)) var setScrollTimeoutId = function (s) { a = s }, stopScroll = function () { - clearTimeout(a), setScrollTimeoutId(0) + ;(clearTimeout(a), setScrollTimeoutId(0)) }, getTopWithEdgeOffset = function (o) { return Math.max(0, s.getTopOf(o) - i) @@ -28497,12 +28544,12 @@ (stopScroll(), 0 === a || (a && a < 0) || isNativeSmoothScrollEnabledOn(s.body)) ) - s.toY(i), u && u() + (s.toY(i), u && u()) else { var _ = s.getY(), w = Math.max(0, i) - _, x = new Date().getTime() - ;(a = a || Math.min(Math.abs(w), o)), + ;((a = a || Math.min(Math.abs(w), o)), (function loopScroll() { setScrollTimeoutId( setTimeout(function () { @@ -28511,13 +28558,13 @@ 0, Math.floor(_ + w * (o < 0.5 ? 2 * o * o : o * (4 - 2 * o) - 1)) ) - s.toY(i), + ;(s.toY(i), o < 1 && s.getHeight() + i < s.body.scrollHeight ? loopScroll() - : (setTimeout(stopScroll, 99), u && u()) + : (setTimeout(stopScroll, 99), u && u())) }, 9) ) - })() + })()) } }, scrollToElem = function (s, o, i) { @@ -28612,11 +28659,11 @@ ) { var i = 'history' in window && 'pushState' in history, a = i && 'scrollRestoration' in history - a && (history.scrollRestoration = 'auto'), + ;(a && (history.scrollRestoration = 'auto'), window.addEventListener( 'load', function () { - a && + ;(a && (setTimeout(function () { history.scrollRestoration = 'manual' }, 9), @@ -28638,10 +28685,10 @@ 0 <= u && u < 9 && window.scrollTo(0, a) } } - }, 9) + }, 9)) }, !1 - ) + )) var u = new RegExp('(^|\\s)noZensmooth(\\s|$)') window.addEventListener( 'click', @@ -28671,13 +28718,13 @@ window.location = x }, L = o.setup().edgeOffset - L && + ;(L && ((C = Math.max(0, C - L)), i && (onDone = function () { history.pushState({}, '', x) })), - o.toY(C, null, onDone) + o.toY(C, null, onDone)) } } }, @@ -28686,7 +28733,7 @@ } return o })()), - void 0 === (u = 'function' == typeof i ? i.apply(o, a) : i) || (s.exports = u) + void 0 === (u = 'function' == typeof i ? i.apply(o, a) : i) || (s.exports = u)) }, 86238: (s, o, i) => { 'use strict' @@ -28694,7 +28741,7 @@ function noop() {} s.exports = function eos(s, o, i) { if ('function' == typeof o) return eos(s, null, o) - o || (o = {}), + ;(o || (o = {}), (i = (function once(s) { var o = !1 return function () { @@ -28705,7 +28752,7 @@ s.apply(this, a) } } - })(i || noop)) + })(i || noop))) var u = o.readable || (!1 !== o.readable && s.readable), _ = o.writable || (!1 !== o.writable && s.writable), w = function onlegacyfinish() { @@ -28713,11 +28760,11 @@ }, x = s._writableState && s._writableState.finished, C = function onfinish() { - ;(_ = !1), (x = !0), u || i.call(s) + ;((_ = !1), (x = !0), u || i.call(s)) }, j = s._readableState && s._readableState.endEmitted, L = function onend() { - ;(u = !1), (j = !0), _ || i.call(s) + ;((u = !1), (j = !0), _ || i.call(s)) }, B = function onerror(o) { i.call(s, o) @@ -28744,7 +28791,7 @@ !1 !== o.error && s.on('error', B), s.on('close', $), function () { - s.removeListener('complete', C), + ;(s.removeListener('complete', C), s.removeListener('abort', $), s.removeListener('request', U), s.req && s.req.removeListener('finish', C), @@ -28753,7 +28800,7 @@ s.removeListener('finish', C), s.removeListener('end', L), s.removeListener('error', B), - s.removeListener('close', $) + s.removeListener('close', $)) } ) } @@ -28762,7 +28809,7 @@ const a = i(10316) s.exports = class LinkElement extends a { constructor(s, o, i) { - super(s || [], o, i), (this.element = 'link') + ;(super(s || [], o, i), (this.element = 'link')) } get relation() { return this.attributes.get('relation') @@ -28785,7 +28832,7 @@ w = i(63345), x = Object.getOwnPropertySymbols ? function (s) { - for (var o = []; s; ) a(o, _(s)), (s = u(s)) + for (var o = []; s; ) (a(o, _(s)), (s = u(s))) return o } : w @@ -28821,7 +28868,7 @@ } return s } - ;(a.prototype.ObjectElement = L), + ;((a.prototype.ObjectElement = L), (a.prototype.RefElement = $), (a.prototype.MemberElement = j), (a.prototype.refract = refract), @@ -28841,7 +28888,7 @@ ArraySlice: U, ObjectSlice: V, KeyValuePair: z, - }) + })) }, 87068: (s, o, i) => { var a = i(37217), @@ -28866,17 +28913,20 @@ de = ae == ce if (de && j(s)) { if (!j(o)) return !1 - ;(ee = !0), (le = !1) + ;((ee = !0), (le = !1)) } if (de && !le) - return Z || (Z = new a()), ee || L(s) ? u(s, o, i, z, Y, Z) : _(s, o, ae, i, z, Y, Z) + return ( + Z || (Z = new a()), + ee || L(s) ? u(s, o, i, z, Y, Z) : _(s, o, ae, i, z, Y, Z) + ) if (!(1 & i)) { var fe = le && V.call(s, '__wrapped__'), ye = pe && V.call(o, '__wrapped__') if (fe || ye) { var be = fe ? s.value() : s, _e = ye ? o.value() : o - return Z || (Z = new a()), Y(be, _e, i, z, Z) + return (Z || (Z = new a()), Y(be, _e, i, z, Z)) } } return !!de && (Z || (Z = new a()), w(s, o, i, z, Y, Z)) @@ -28906,7 +28956,7 @@ const a = i(6205), u = i(10023), _ = { 0: 0, t: 9, n: 10, v: 11, f: 12, r: 13 } - ;(o.strToChars = function (s) { + ;((o.strToChars = function (s) { return (s = s.replace( /(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g, function (s, o, i, a, u, w, x, C) { @@ -28923,7 +28973,7 @@ ? '@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?'.indexOf(x) : _[C], L = String.fromCharCode(j) - return /[[\]{}^$.|?*+()]/.test(L) && (L = '\\' + L), L + return (/[[\]{}^$.|?*+()]/.test(L) && (L = '\\' + L), L) } )) }), @@ -28935,7 +28985,6 @@ C = /\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g; null != (_ = C.exec(s)); - ) if (_[1]) x.push(u.words()) else if (_[2]) x.push(u.ints()) @@ -28957,14 +29006,14 @@ }), (o.error = (s, o) => { throw new SyntaxError('Invalid regular expression: /' + s + '/: ' + o) - }) + })) }, 87726: (s, o, i) => { const a = i(55973), u = i(10316) s.exports = class MemberElement extends u { constructor(s, o, i, u) { - super(new a(), i, u), (this.element = 'member'), (this.key = s), (this.value = o) + ;(super(new a(), i, u), (this.element = 'member'), (this.key = s), (this.value = o)) } get key() { return this.content.key @@ -29023,7 +29072,7 @@ function Stream() { a.call(this) } - i(56698)(Stream, a), + ;(i(56698)(Stream, a), (Stream.Readable = i(45412)), (Stream.Writable = i(16708)), (Stream.Duplex = i(25382)), @@ -29040,9 +29089,9 @@ function ondrain() { i.readable && i.resume && i.resume() } - i.on('data', ondata), + ;(i.on('data', ondata), s.on('drain', ondrain), - s._isStdio || (o && !1 === o.end) || (i.on('end', onend), i.on('close', onclose)) + s._isStdio || (o && !1 === o.end) || (i.on('end', onend), i.on('close', onclose))) var u = !1 function onend() { u || ((u = !0), s.end()) @@ -29054,7 +29103,7 @@ if ((cleanup(), 0 === a.listenerCount(this, 'error'))) throw s } function cleanup() { - i.removeListener('data', ondata), + ;(i.removeListener('data', ondata), s.removeListener('drain', ondrain), i.removeListener('end', onend), i.removeListener('close', onclose), @@ -29062,7 +29111,7 @@ s.removeListener('error', onerror), i.removeListener('end', cleanup), i.removeListener('close', cleanup), - s.removeListener('close', cleanup) + s.removeListener('close', cleanup)) } return ( i.on('error', onerror), @@ -29073,7 +29122,7 @@ s.emit('pipe', i), s ) - }) + })) }, 88984: (s, o, i) => { var a = i(55527), @@ -29118,7 +29167,7 @@ 'return function (' + (function (s, o) { for (var i = '', a = 0; a < s.length; a += 1) - (i += s[a]), a + 1 < s.length && (i += o) + ((i += s[a]), a + 1 < s.length && (i += o)) return i })(C, ',') + '){ return binder.apply(this,arguments); }' @@ -29132,7 +29181,7 @@ u.prototype) ) { var L = function Empty() {} - ;(L.prototype = u.prototype), (_.prototype = new L()), (L.prototype = null) + ;((L.prototype = u.prototype), (_.prototype = new L()), (L.prototype = null)) } return _ } @@ -29172,11 +29221,11 @@ var i = {} if (null == s) return i var j = !1 - ;(o = a(o, function (o) { - return (o = w(o, s)), j || (j = o.length > 1), o + ;((o = a(o, function (o) { + return ((o = w(o, s)), j || (j = o.length > 1), o) })), x(s, L(s), i), - j && (i = u(i, 7, C)) + j && (i = u(i, 7, C))) for (var B = o.length; B--; ) _(i, o[B]) return i }) @@ -29200,35 +29249,34 @@ var a = i(92861).Buffer, u = i(15377) function Hash(s, o) { - ;(this._block = a.alloc(s)), + ;((this._block = a.alloc(s)), (this._finalSize = o), (this._blockSize = s), - (this._len = 0) + (this._len = 0)) } - ;(Hash.prototype.update = function (s, o) { + ;((Hash.prototype.update = function (s, o) { s = u(s, o || 'utf8') for ( var i = this._block, a = this._blockSize, _ = s.length, w = this._len, x = 0; x < _; - ) { for (var C = w % a, j = Math.min(_ - x, a - C), L = 0; L < j; L++) i[C + L] = s[x + L] - ;(x += j), (w += j) % a == 0 && this._update(i) + ;((x += j), (w += j) % a == 0 && this._update(i)) } - return (this._len += _), this + return ((this._len += _), this) }), (Hash.prototype.digest = function (s) { var o = this._len % this._blockSize - ;(this._block[o] = 128), + ;((this._block[o] = 128), this._block.fill(0, o + 1), - o >= this._finalSize && (this._update(this._block), this._block.fill(0)) + o >= this._finalSize && (this._update(this._block), this._block.fill(0))) var i = 8 * this._len if (i <= 4294967295) this._block.writeUInt32BE(i, this._blockSize - 4) else { var a = (4294967295 & i) >>> 0, u = (i - a) / 4294967296 - this._block.writeUInt32BE(u, this._blockSize - 8), - this._block.writeUInt32BE(a, this._blockSize - 4) + ;(this._block.writeUInt32BE(u, this._blockSize - 8), + this._block.writeUInt32BE(a, this._blockSize - 4)) } this._update(this._block) var _ = this._hash() @@ -29237,7 +29285,7 @@ (Hash.prototype._update = function () { throw new Error('_update must be implemented by subclass') }), - (s.exports = Hash) + (s.exports = Hash)) }, 90916: (s, o, i) => { var a = i(80909) @@ -29255,7 +29303,7 @@ s.exports = function stackDelete(s) { var o = this.__data__, i = o.delete(s) - return (this.size = o.size), i + return ((this.size = o.size), i) } }, 91033: (s) => { @@ -29286,7 +29334,6 @@ B = Array(j + L), $ = !u; ++C < j; - ) B[C] = i[C] for (; ++_ < x; ) ($ || _ < w) && (B[a[_]] = s[_]) @@ -29364,7 +29411,8 @@ } filter(s, o) { return ( - (s = coerceElementMatchingCallback(s)), new ArraySlice(this.elements.filter(s, o)) + (s = coerceElementMatchingCallback(s)), + new ArraySlice(this.elements.filter(s, o)) ) } reject(s, o) { @@ -29374,7 +29422,7 @@ ) } find(s, o) { - return (s = coerceElementMatchingCallback(s)), this.elements.find(s, o) + return ((s = coerceElementMatchingCallback(s)), this.elements.find(s, o)) } forEach(s, o) { this.elements.forEach(s, o) @@ -29392,7 +29440,7 @@ this.elements.unshift(this.refract(s)) } push(s) { - return this.elements.push(this.refract(s)), this + return (this.elements.push(this.refract(s)), this) } add(s) { this.push(s) @@ -29414,11 +29462,11 @@ return this.elements[0] } } - 'undefined' != typeof Symbol && + ;('undefined' != typeof Symbol && (ArraySlice.prototype[Symbol.iterator] = function symbol() { return this.elements[Symbol.iterator]() }), - (s.exports = ArraySlice) + (s.exports = ArraySlice)) }, 92361: (s, o, i) => { 'use strict' @@ -29446,7 +29494,7 @@ function SafeBuffer(s, o, i) { return u(s, o, i) } - u.from && u.alloc && u.allocUnsafe && u.allocUnsafeSlow + ;(u.from && u.alloc && u.allocUnsafe && u.allocUnsafeSlow ? (s.exports = a) : (copyProps(a, o), (o.Buffer = SafeBuffer)), (SafeBuffer.prototype = Object.create(u.prototype)), @@ -29458,7 +29506,10 @@ (SafeBuffer.alloc = function (s, o, i) { if ('number' != typeof s) throw new TypeError('Argument must be a number') var a = u(s) - return void 0 !== o ? ('string' == typeof i ? a.fill(o, i) : a.fill(o)) : a.fill(0), a + return ( + void 0 !== o ? ('string' == typeof i ? a.fill(o, i) : a.fill(o)) : a.fill(0), + a + ) }), (SafeBuffer.allocUnsafe = function (s) { if ('number' != typeof s) throw new TypeError('Argument must be a number') @@ -29467,14 +29518,14 @@ (SafeBuffer.allocUnsafeSlow = function (s) { if ('number' != typeof s) throw new TypeError('Argument must be a number') return a.SlowBuffer(s) - }) + })) }, 93243: (s, o, i) => { var a = i(56110), u = (function () { try { var s = a(Object, 'defineProperty') - return s({}, '', {}), s + return (s({}, '', {}), s) } catch (s) {} })() s.exports = u @@ -29490,7 +29541,7 @@ if (o) return s.slice() var i = s.length, a = x ? x(i) : new s.constructor(i) - return s.copy(a), a + return (s.copy(a), a) } }, 93427: (s, o, i) => { @@ -29576,7 +29627,7 @@ return function deprecated() { if (!i) { if (config('throwDeprecation')) throw new Error(o) - config('traceDeprecation') ? console.trace(o) : console.warn(o), (i = !0) + ;(config('traceDeprecation') ? console.trace(o) : console.warn(o), (i = !0)) } return s.apply(this, arguments) } @@ -29952,7 +30003,7 @@ U = i(7376), V = $('iterator'), z = !1 - ;[].keys && + ;([].keys && ('next' in (_ = [].keys()) ? (u = L(L(_))) !== Object.prototype && (a = u) : (z = !0)), !C(a) || w(function () { @@ -29965,7 +30016,7 @@ B(a, V, function () { return this }), - (s.exports = { IteratorPrototype: a, BUGGY_SAFARI_ITERATORS: z }) + (s.exports = { IteratorPrototype: a, BUGGY_SAFARI_ITERATORS: z })) }, 95950: (s, o, i) => { var a = i(70695), @@ -29998,16 +30049,16 @@ j = 7 !== new Error('e', { cause: 7 }).cause, exportGlobalErrorCauseWrapper = function (s, o) { var i = {} - ;(i[s] = w(s, o, j)), a({ global: !0, constructor: !0, arity: 1, forced: j }, i) + ;((i[s] = w(s, o, j)), a({ global: !0, constructor: !0, arity: 1, forced: j }, i)) }, exportWebAssemblyErrorCauseWrapper = function (s, o) { if (C && C[s]) { var i = {} - ;(i[s] = w(x + '.' + s, o, j)), - a({ target: x, stat: !0, constructor: !0, arity: 1, forced: j }, i) + ;((i[s] = w(x + '.' + s, o, j)), + a({ target: x, stat: !0, constructor: !0, arity: 1, forced: j }, i)) } } - exportGlobalErrorCauseWrapper('Error', function (s) { + ;(exportGlobalErrorCauseWrapper('Error', function (s) { return function Error(o) { return _(s, this, arguments) } @@ -30056,7 +30107,7 @@ return function RuntimeError(o) { return _(s, this, arguments) } - }) + })) }, 96794: (s, o, i) => { 'use strict' @@ -30081,9 +30132,9 @@ j = !0 if ('length' in s && w) { var L = w(s, 'length') - L && !L.configurable && (a = !1), L && !L.writable && (j = !1) + ;(L && !L.configurable && (a = !1), L && !L.writable && (j = !1)) } - return (a || j || !i) && (_ ? u(s, 'length', o, !0, !0) : u(s, 'length', o)), s + return ((a || j || !i) && (_ ? u(s, 'length', o, !0, !0) : u(s, 'length', o)), s) } }, 98023: (s, o, i) => { @@ -30127,7 +30178,7 @@ var s = V(this), o = s.target, i = s.index++ - if (!o || i >= o.length) return (s.target = null), j(void 0, !0) + if (!o || i >= o.length) return ((s.target = null), j(void 0, !0)) switch (s.kind) { case 'keys': return j(i, !1) @@ -30171,11 +30222,11 @@ var a = o[i] if (void 0 !== a) return a.exports var u = (o[i] = { id: i, loaded: !1, exports: {} }) - return s[i].call(u.exports, u, u.exports, __webpack_require__), (u.loaded = !0), u.exports + return (s[i].call(u.exports, u, u.exports, __webpack_require__), (u.loaded = !0), u.exports) } - ;(__webpack_require__.n = (s) => { + ;((__webpack_require__.n = (s) => { var o = s && s.__esModule ? () => s.default : () => s - return __webpack_require__.d(o, { a: o }), o + return (__webpack_require__.d(o, { a: o }), o) }), (__webpack_require__.d = (s, o) => { for (var i in o) @@ -30193,19 +30244,19 @@ })()), (__webpack_require__.o = (s, o) => Object.prototype.hasOwnProperty.call(s, o)), (__webpack_require__.r = (s) => { - 'undefined' != typeof Symbol && + ;('undefined' != typeof Symbol && Symbol.toStringTag && Object.defineProperty(s, Symbol.toStringTag, { value: 'Module' }), - Object.defineProperty(s, '__esModule', { value: !0 }) + Object.defineProperty(s, '__esModule', { value: !0 })) }), - (__webpack_require__.nmd = (s) => ((s.paths = []), s.children || (s.children = []), s)) + (__webpack_require__.nmd = (s) => ((s.paths = []), s.children || (s.children = []), s))) var i = {} return ( (() => { 'use strict' __webpack_require__.d(i, { default: () => WT }) var s = {} - __webpack_require__.r(s), + ;(__webpack_require__.r(s), __webpack_require__.d(s, { CLEAR: () => at, CLEAR_BY: () => ct, @@ -30221,9 +30272,9 @@ newSpecErrBatch: () => newSpecErrBatch, newThrownErr: () => newThrownErr, newThrownErrBatch: () => newThrownErrBatch, - }) + })) var o = {} - __webpack_require__.r(o), + ;(__webpack_require__.r(o), __webpack_require__.d(o, { AUTHORIZE: () => Rt, AUTHORIZE_OAUTH2: () => Lt, @@ -30249,9 +30300,9 @@ preAuthorizeImplicit: () => preAuthorizeImplicit, restoreAuthorization: () => restoreAuthorization, showDefinitions: () => showDefinitions, - }) + })) var a = {} - __webpack_require__.r(a), + ;(__webpack_require__.r(a), __webpack_require__.d(a, { authorized: () => Jt, definitionsForRequirements: () => definitionsForRequirements, @@ -30261,9 +30312,9 @@ isAuthorized: () => isAuthorized, selectAuthPath: () => selectAuthPath, shownDefinitions: () => zt, - }) + })) var u = {} - __webpack_require__.r(u), + ;(__webpack_require__.r(u), __webpack_require__.d(u, { TOGGLE_CONFIGS: () => gn, UPDATE_CONFIGS: () => mn, @@ -30272,19 +30323,19 @@ loaded: () => actions_loaded, toggle: () => toggle, update: () => update, - }) + })) var _ = {} - __webpack_require__.r(_), __webpack_require__.d(_, { get: () => get }) + ;(__webpack_require__.r(_), __webpack_require__.d(_, { get: () => get })) var w = {} - __webpack_require__.r(w), __webpack_require__.d(w, { transform: () => transform }) + ;(__webpack_require__.r(w), __webpack_require__.d(w, { transform: () => transform })) var x = {} - __webpack_require__.r(x), - __webpack_require__.d(x, { transform: () => parameter_oneof_transform }) + ;(__webpack_require__.r(x), + __webpack_require__.d(x, { transform: () => parameter_oneof_transform })) var C = {} - __webpack_require__.r(C), - __webpack_require__.d(C, { allErrors: () => In, lastError: () => Tn }) + ;(__webpack_require__.r(C), + __webpack_require__.d(C, { allErrors: () => In, lastError: () => Tn })) var j = {} - __webpack_require__.r(j), + ;(__webpack_require__.r(j), __webpack_require__.d(j, { SHOW: () => Fn, UPDATE_FILTER: () => Dn, @@ -30294,29 +30345,29 @@ show: () => actions_show, updateFilter: () => updateFilter, updateLayout: () => updateLayout, - }) + })) var L = {} - __webpack_require__.r(L), + ;(__webpack_require__.r(L), __webpack_require__.d(L, { current: () => current, currentFilter: () => currentFilter, isShown: () => isShown, showSummary: () => $n, whatMode: () => whatMode, - }) + })) var B = {} - __webpack_require__.r(B), - __webpack_require__.d(B, { taggedOperations: () => taggedOperations }) + ;(__webpack_require__.r(B), + __webpack_require__.d(B, { taggedOperations: () => taggedOperations })) var $ = {} - __webpack_require__.r($), + ;(__webpack_require__.r($), __webpack_require__.d($, { getActiveLanguage: () => Vn, getDefaultExpanded: () => zn, getGenerators: () => Un, getSnippetGenerators: () => getSnippetGenerators, - }) + })) var U = {} - __webpack_require__.r(U), + ;(__webpack_require__.r(U), __webpack_require__.d(U, { JsonSchemaArrayItemFile: () => JsonSchemaArrayItemFile, JsonSchemaArrayItemText: () => JsonSchemaArrayItemText, @@ -30325,9 +30376,9 @@ JsonSchema_boolean: () => JsonSchema_boolean, JsonSchema_object: () => JsonSchema_object, JsonSchema_string: () => JsonSchema_string, - }) + })) var V = {} - __webpack_require__.r(V), + ;(__webpack_require__.r(V), __webpack_require__.d(V, { allowTryItOutFor: () => allowTryItOutFor, basePath: () => Hs, @@ -30387,9 +30438,9 @@ validateBeforeExecute: () => validateBeforeExecute, validationErrors: () => validationErrors, version: () => Ls, - }) + })) var z = {} - __webpack_require__.r(z), + ;(__webpack_require__.r(z), __webpack_require__.d(z, { CLEAR_REQUEST: () => wo, CLEAR_RESPONSE: () => Eo, @@ -30433,17 +30484,17 @@ updateSpec: () => updateSpec, updateUrl: () => updateUrl, validateParams: () => validateParams, - }) + })) var Y = {} - __webpack_require__.r(Y), + ;(__webpack_require__.r(Y), __webpack_require__.d(Y, { executeRequest: () => wrap_actions_executeRequest, updateJsonSpec: () => wrap_actions_updateJsonSpec, updateSpec: () => wrap_actions_updateSpec, validateParams: () => wrap_actions_validateParams, - }) + })) var Z = {} - __webpack_require__.r(Z), + ;(__webpack_require__.r(Z), __webpack_require__.d(Z, { JsonPatchError: () => Do, _areEquals: () => _areEquals, @@ -30454,17 +30505,17 @@ getValueByPointer: () => getValueByPointer, validate: () => validate, validator: () => validator, - }) + })) var ee = {} - __webpack_require__.r(ee), + ;(__webpack_require__.r(ee), __webpack_require__.d(ee, { compare: () => compare, generate: () => generate, observe: () => observe, unobserve: () => unobserve, - }) + })) var ie = {} - __webpack_require__.r(ie), + ;(__webpack_require__.r(ie), __webpack_require__.d(ie, { hasElementSourceMap: () => hasElementSourceMap, includesClasses: () => includesClasses, @@ -30483,17 +30534,17 @@ isPrimitiveElement: () => isPrimitiveElement, isRefElement: () => Lu, isStringElement: () => ju, - }) + })) var ae = {} - __webpack_require__.r(ae), + ;(__webpack_require__.r(ae), __webpack_require__.d(ae, { isJSONReferenceElement: () => Ld, isJSONSchemaElement: () => Dd, isLinkDescriptionElement: () => Bd, isMediaElement: () => Fd, - }) + })) var ce = {} - __webpack_require__.r(ce), + ;(__webpack_require__.r(ce), __webpack_require__.d(ce, { isBooleanJsonSchemaElement: () => isBooleanJsonSchemaElement, isCallbackElement: () => Tm, @@ -30523,36 +30574,36 @@ isServerElement: () => eg, isServerVariableElement: () => rg, isServersElement: () => sg, - }) + })) var le = {} - __webpack_require__.r(le), + ;(__webpack_require__.r(le), __webpack_require__.d(le, { isJSONReferenceElement: () => Ld, isJSONSchemaElement: () => g_, isLinkDescriptionElement: () => y_, isMediaElement: () => Fd, - }) + })) var pe = {} - __webpack_require__.r(pe), + ;(__webpack_require__.r(pe), __webpack_require__.d(pe, { isJSONReferenceElement: () => Ld, isJSONSchemaElement: () => A_, isLinkDescriptionElement: () => C_, - }) + })) var de = {} - __webpack_require__.r(de), + ;(__webpack_require__.r(de), __webpack_require__.d(de, { isJSONSchemaElement: () => K_, isLinkDescriptionElement: () => G_, - }) + })) var fe = {} - __webpack_require__.r(fe), + ;(__webpack_require__.r(fe), __webpack_require__.d(fe, { isJSONSchemaElement: () => oS, isLinkDescriptionElement: () => iS, - }) + })) var ye = {} - __webpack_require__.r(ye), + ;(__webpack_require__.r(ye), __webpack_require__.d(ye, { isBooleanJsonSchemaElement: () => predicates_isBooleanJsonSchemaElement, isCallbackElement: () => zS, @@ -30583,17 +30634,17 @@ isSecuritySchemeElement: () => hE, isServerElement: () => dE, isServerVariableElement: () => fE, - }) + })) var be = {} - __webpack_require__.r(be), + ;(__webpack_require__.r(be), __webpack_require__.d(be, { cookie: () => cookie, header: () => parameter_builders_header, path: () => parameter_builders_path, query: () => query, - }) + })) var _e = {} - __webpack_require__.r(_e), + ;(__webpack_require__.r(_e), __webpack_require__.d(_e, { Button: () => Button, Col: () => Col, @@ -30604,9 +30655,9 @@ Row: () => Row, Select: () => Select, TextArea: () => TextArea, - }) + })) var Se = {} - __webpack_require__.r(Se), + ;(__webpack_require__.r(Se), __webpack_require__.d(Se, { basePath: () => NP, consumes: () => MP, @@ -30618,11 +30669,12 @@ schemes: () => DP, securityDefinitions: () => IP, validOperationMethods: () => wrap_selectors_validOperationMethods, - }) + })) var we = {} - __webpack_require__.r(we), __webpack_require__.d(we, { definitionsToAuthorize: () => LP }) + ;(__webpack_require__.r(we), + __webpack_require__.d(we, { definitionsToAuthorize: () => LP })) var xe = {} - __webpack_require__.r(xe), + ;(__webpack_require__.r(xe), __webpack_require__.d(xe, { callbacksOperations: () => $P, findSchema: () => findSchema, @@ -30630,9 +30682,9 @@ isOAS30: () => selectors_isOAS30, isSwagger2: () => selectors_isSwagger2, servers: () => BP, - }) + })) var Pe = {} - __webpack_require__.r(Pe), + ;(__webpack_require__.r(Pe), __webpack_require__.d(Pe, { CLEAR_REQUEST_BODY_VALIDATE_ERROR: () => iI, CLEAR_REQUEST_BODY_VALUE: () => aI, @@ -30657,9 +30709,9 @@ setRetainRequestBodyValueFlag: () => setRetainRequestBodyValueFlag, setSelectedServer: () => setSelectedServer, setServerVariableValue: () => setServerVariableValue, - }) + })) var Te = {} - __webpack_require__.r(Te), + ;(__webpack_require__.r(Te), __webpack_require__.d(Te, { activeExamplesMember: () => gI, hasUserEditedBody: () => dI, @@ -30677,7 +30729,7 @@ validOperationMethods: () => wI, validateBeforeExecute: () => EI, validateShallowRequired: () => validateShallowRequired, - }) + })) var Re = __webpack_require__(96540) function formatProdErrorMessage(s) { return `Minified Redux error #${s}; visit https://redux.js.org/Errors?code=${s} for the full message or use the non-minified dev environment for full errors. ` @@ -30734,7 +30786,7 @@ function unsubscribe() { if (o) { if (C) throw new Error(formatProdErrorMessage(6)) - ;(o = !1), ensureCanMutateNextListeners(), w.delete(i), (_ = null) + ;((o = !1), ensureCanMutateNextListeners(), w.delete(i), (_ = null)) } } ) @@ -30745,7 +30797,7 @@ if ('string' != typeof s.type) throw new Error(formatProdErrorMessage(17)) if (C) throw new Error(formatProdErrorMessage(9)) try { - ;(C = !0), (u = a(u, s)) + ;((C = !0), (u = a(u, s))) } finally { C = !1 } @@ -30763,7 +30815,7 @@ getState, replaceReducer: function replaceReducer(s) { if ('function' != typeof s) throw new Error(formatProdErrorMessage(10)) - ;(a = s), dispatch({ type: qe.REPLACE }) + ;((a = s), dispatch({ type: qe.REPLACE })) }, [$e]: function observable() { const s = subscribe @@ -30855,7 +30907,7 @@ } return s })() - __webpack_require__(84058), __webpack_require__(55808) + ;(__webpack_require__(84058), __webpack_require__(55808)) var ut = __webpack_require__(50104), pt = __webpack_require__.n(ut), ht = __webpack_require__(7309), @@ -30929,11 +30981,11 @@ for (let u of s.entries()) if (o[u[0]] || (a[u[0]] && a[u[0]].containsMultiple)) { if (!a[u[0]]) { - ;(a[u[0]] = { containsMultiple: !0, length: 1 }), + ;((a[u[0]] = { containsMultiple: !0, length: 1 }), (o[`${u[0]}${i}${a[u[0]].length}`] = o[u[0]]), - delete o[u[0]] + delete o[u[0]]) } - ;(a[u[0]].length += 1), (o[`${u[0]}${i}${a[u[0]].length}`] = u[1]) + ;((a[u[0]].length += 1), (o[`${u[0]}${i}${a[u[0]].length}`] = u[1])) } else o[u[0]] = u[1] return o })(s) @@ -30963,7 +31015,7 @@ function objReduce(s, o) { return Object.keys(s).reduce((i, a) => { let u = o(s[a], a) - return u && 'object' == typeof u && Object.assign(i, u), i + return (u && 'object' == typeof u && Object.assign(i, u), i) }, {}) } function systemThunkMiddleware(s) { @@ -30991,7 +31043,7 @@ ie = null != s, ae = ee || (ie && 'array' === L) || !(!ee && !ie), ce = w && null === s - if (ee && !ie && !ce && !a && !L) return _.push('Required field is not provided'), _ + if (ee && !ie && !ce && !a && !L) return (_.push('Required field is not provided'), _) if (ce || !L || !ae) return [] let le = 'string' === L && s, pe = 'array' === L && Array.isArray(s) && s.length, @@ -31008,16 +31060,16 @@ 'object' === L && 'object' == typeof s && null !== s, 'object' === L && 'string' == typeof s && s, ].some((s) => !!s) - if (ee && !fe && !a) return _.push('Required field is not provided'), _ + if (ee && !fe && !a) return (_.push('Required field is not provided'), _) if ('object' === L && (null === u || 'application/json' === u)) { let i = s if ('string' == typeof s) try { i = JSON.parse(s) } catch (s) { - return _.push('Parameter string value must be valid JSON'), _ + return (_.push('Parameter string value must be valid JSON'), _) } - o && + ;(o && o.has('required') && isFunc(x.isList) && x.isList() && @@ -31029,7 +31081,7 @@ o.get('properties').forEach((s, o) => { const w = validateValueBySchema(i[o], s, !1, a, u) _.push(...w.map((s) => ({ propKey: o, error: s }))) - }) + })) } if (Z) { let o = ((s, o) => { @@ -31158,7 +31210,10 @@ } const utils_btoa = (s) => { let o - return (o = s instanceof Ct ? s : Ct.from(s.toString(), 'utf-8')), o.toString('base64') + return ( + (o = s instanceof Ct ? s : Ct.from(s.toString(), 'utf-8')), + o.toString('base64') + ) }, It = { operationsSorter: { @@ -31248,7 +31303,7 @@ } const _ = { getState: u.getState, dispatch: (s, ...o) => dispatch(s, ...o) }, w = s.map((s) => s(_)) - return (dispatch = compose(...w)(u.dispatch)), { ...u, dispatch } + return ((dispatch = compose(...w)(u.dispatch)), { ...u, dispatch }) } })(...a) ) @@ -31256,7 +31311,7 @@ } class Store { constructor(s = {}) { - Ye()( + ;(Ye()( this, { state: {}, @@ -31272,20 +31327,20 @@ return createStoreWithMiddleware(s, o, i) })(idFn, (0, ze.fromJS)(this.state), this.getSystem)), this.buildSystem(!1), - this.register(this.plugins) + this.register(this.plugins)) } getStore() { return this.store } register(s, o = !0) { var i = combinePlugins(s, this.getSystem()) - systemExtend(this.system, i), o && this.buildSystem() + ;(systemExtend(this.system, i), o && this.buildSystem()) callAfterLoad.call(this.system, s, this.getSystem()) && this.buildSystem() } buildSystem(s = !0) { let o = this.getStore().dispatch, i = this.getStore().getState - ;(this.boundSystem = Object.assign( + ;((this.boundSystem = Object.assign( {}, this.getRootInjects(), this.getWrappedAndBoundActions(o), @@ -31294,7 +31349,7 @@ this.getFn(), this.getConfigs() )), - s && this.rebuildReducer() + s && this.rebuildReducer()) } _getSystem() { return this.boundSystem @@ -31440,7 +31495,7 @@ let u = [a.slice(0, -9)] return objMap(i, (i) => (...a) => { let _ = wrapWithTryCatch(i, this.getSystem).apply(null, [s().getIn(u), ...a]) - return 'function' == typeof _ && (_ = wrapWithTryCatch(_, this.getSystem)(o())), _ + return ('function' == typeof _ && (_ = wrapWithTryCatch(_, this.getSystem)(o())), _) }) }) } @@ -31525,7 +31580,7 @@ if (isObject(u)) for (let i in u) { let a = u[i] - Array.isArray(a) || ((a = [a]), (u[i] = a)), + ;(Array.isArray(a) || ((a = [a]), (u[i] = a)), o && o.statePlugins && o.statePlugins[s] && @@ -31533,12 +31588,12 @@ o.statePlugins[s].wrapActions[i] && (o.statePlugins[s].wrapActions[i] = u[i].concat( o.statePlugins[s].wrapActions[i] - )) + ))) } if (isObject(_)) for (let i in _) { let a = _[i] - Array.isArray(a) || ((a = [a]), (_[i] = a)), + ;(Array.isArray(a) || ((a = [a]), (_[i] = a)), o && o.statePlugins && o.statePlugins[s] && @@ -31546,7 +31601,7 @@ o.statePlugins[s].wrapSelectors[i] && (o.statePlugins[s].wrapSelectors[i] = _[i].concat( o.statePlugins[s].wrapSelectors[i] - )) + ))) } } return Ye()(s, o) @@ -31583,7 +31638,7 @@ const authorizeWithPersistOption = (s) => ({ authActions: o }) => { - o.authorize(s), o.persistAuthorizationIfNeeded() + ;(o.authorize(s), o.persistAuthorizationIfNeeded()) } function logout(s) { return { type: Dt, payload: s } @@ -31591,7 +31646,7 @@ const logoutWithPersistOption = (s) => ({ authActions: o }) => { - o.logout(s), o.persistAuthorizationIfNeeded() + ;(o.logout(s), o.persistAuthorizationIfNeeded()) }, preAuthorizeImplicit = (s) => @@ -31599,7 +31654,7 @@ let { auth: a, token: u, isValid: _ } = s, { schema: w, name: x } = a, C = w.get('flow') - delete lt.swaggerUIRedirectOauth2, + ;(delete lt.swaggerUIRedirectOauth2, 'accessCode' === C || _ || i.newAuthErr({ @@ -31616,7 +31671,7 @@ level: 'error', message: JSON.stringify(u), }) - : o.authorizeOauth2WithPersistOption({ auth: a, token: u }) + : o.authorizeOauth2WithPersistOption({ auth: a, token: u })) } function authorizeOauth2(s) { return { type: Lt, payload: s } @@ -31624,7 +31679,7 @@ const authorizeOauth2WithPersistOption = (s) => ({ authActions: o }) => { - o.authorizeOauth2(s), o.persistAuthorizationIfNeeded() + ;(o.authorizeOauth2(s), o.persistAuthorizationIfNeeded()) }, authorizePassword = (s) => @@ -31780,8 +31835,8 @@ const i = s.response.data try { const s = 'string' == typeof i ? JSON.parse(i) : i - s.error && (o += `, error: ${s.error}`), - s.error_description && (o += `, description: ${s.error_description}`) + ;(s.error && (o += `, error: ${s.error}`), + s.error_description && (o += `, description: ${s.error_description}`)) } catch (s) {} } u.newAuthErr({ authId: $, level: 'error', source: 'auth', message: o }) @@ -31801,7 +31856,7 @@ localStorage.setItem('authorized', JSON.stringify(i)) }, authPopup = (s, o) => () => { - ;(lt.swaggerUIRedirectOauth2 = o), lt.open(s) + ;((lt.swaggerUIRedirectOauth2 = o), lt.open(s)) }, $t = { [Mt]: (s, { payload: o }) => s.set('showDefinitions', o), @@ -31816,11 +31871,11 @@ else if ('basic' === u) { let s = i.getIn(['value', 'username']), u = i.getIn(['value', 'password']) - ;(a = a.setIn([o, 'value'], { + ;((a = a.setIn([o, 'value'], { username: s, header: 'Basic ' + utils_btoa(s + ':' + u), })), - (a = a.setIn([o, 'schema'], i.get('schema'))) + (a = a.setIn([o, 'schema'], i.get('schema')))) } }), s.set('authorized', a) @@ -31829,9 +31884,9 @@ [Lt]: (s, { payload: o }) => { let i, { auth: a, token: u } = o - ;(a.token = Object.assign({}, u)), (i = (0, ze.fromJS)(a)) + ;((a.token = Object.assign({}, u)), (i = (0, ze.fromJS)(a))) let _ = s.get('authorized') || (0, ze.Map)() - return (_ = _.set(i.get('name'), i)), s.set('authorized', _) + return ((_ = _.set(i.get('name'), i)), s.set('authorized', _)) }, [Dt]: (s, { payload: o }) => { let i = s.get('authorized').withMutations((s) => { @@ -31870,7 +31925,7 @@ o ) } - Symbol(), Object.getPrototypeOf({}) + ;(Symbol(), Object.getPrototypeOf({})) var qt = 'undefined' != typeof WeakRef ? WeakRef @@ -31912,11 +31967,11 @@ null != s && a(s, C) && ((C = s), 0 !== _ && _--) u = ('object' == typeof C && null !== C) || 'function' == typeof C ? new qt(C) : C } - return (x.s = 1), (x.v = C), C + return ((x.s = 1), (x.v = C), C) } return ( (memoized.clearCache = () => { - ;(i = { s: 0, v: void 0, o: null, p: null }), memoized.resetResultsCount() + ;((i = { s: 0, v: void 0, o: null, p: null }), memoized.resetResultsCount()) }), (memoized.resultsCount = () => _), (memoized.resetResultsCount = () => { @@ -31933,11 +31988,11 @@ u = 0, _ = {}, w = s.pop() - 'object' == typeof w && ((_ = w), (w = s.pop())), + ;('object' == typeof w && ((_ = w), (w = s.pop())), assertIsFunction( w, `createSelector expects an output function after the inputs, but received: [${typeof w}]` - ) + )) const x = { ...i, ..._ }, { memoize: C, @@ -31951,7 +32006,7 @@ z = getDependencies(s), Y = C( function recomputationWrapper() { - return a++, w.apply(null, arguments) + return (a++, w.apply(null, arguments)) }, ...U ) @@ -31964,7 +32019,7 @@ for (let u = 0; u < a; u++) i.push(s[u].apply(null, o)) return i })(z, arguments) - return (o = Y.apply(null, s)), o + return ((o = Y.apply(null, s)), o) }, ...V ) @@ -31986,7 +32041,8 @@ }) } return ( - Object.assign(createSelector2, { withTypes: () => createSelector2 }), createSelector2 + Object.assign(createSelector2, { withTypes: () => createSelector2 }), + createSelector2 ) } var Ut = createSelectorCreator(weakMapMemoize), @@ -32015,7 +32071,7 @@ return ( o.entrySeq().forEach(([s, o]) => { let a = (0, ze.Map)() - ;(a = a.set(s, o)), (i = i.push(a)) + ;((a = a.set(s, o)), (i = i.push(a))) }), i ) @@ -32037,19 +32093,19 @@ return ( o.valueSeq().forEach((s) => { let o = (0, ze.Map)() - s.entrySeq().forEach(([s, a]) => { + ;(s.entrySeq().forEach(([s, a]) => { let u, _ = i.get(s) - 'oauth2' === _.get('type') && + ;('oauth2' === _.get('type') && a.size && ((u = _.get('scopes')), u.keySeq().forEach((s) => { a.contains(s) || (u = u.delete(s)) }), (_ = _.set('allowedScopes', u))), - (o = o.set(s, _)) + (o = o.set(s, _))) }), - (a = a.push(o)) + (a = a.push(o))) }), a ) @@ -32174,10 +32230,10 @@ function auth() { return { afterLoad(s) { - ;(this.rootInjects = this.rootInjects || {}), + ;((this.rootInjects = this.rootInjects || {}), (this.rootInjects.initOAuth = s.authActions.configureAuth), (this.rootInjects.preauthorizeApiKey = preauthorizeApiKey.bind(null, s)), - (this.rootInjects.preauthorizeBasic = preauthorizeBasic.bind(null, s)) + (this.rootInjects.preauthorizeBasic = preauthorizeBasic.bind(null, s))) }, components: { LockAuthIcon: Yt, @@ -32255,20 +32311,20 @@ : a } function YAMLException$1(s, o) { - Error.call(this), + ;(Error.call(this), (this.name = 'YAMLException'), (this.reason = s), (this.mark = o), (this.message = formatError(this, !1)), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) - : (this.stack = new Error().stack || '') + : (this.stack = new Error().stack || '')) } - ;(YAMLException$1.prototype = Object.create(Error.prototype)), + ;((YAMLException$1.prototype = Object.create(Error.prototype)), (YAMLException$1.prototype.constructor = YAMLException$1), (YAMLException$1.prototype.toString = function toString(s) { return this.name + ': ' + formatError(this, s) - }) + })) var tr = YAMLException$1 function getLine(s, o, i, a, u) { var _ = '', @@ -32285,14 +32341,14 @@ } var rr = function makeSnippet(s, o) { if (((o = Object.create(o || null)), !s.buffer)) return null - o.maxLength || (o.maxLength = 79), + ;(o.maxLength || (o.maxLength = 79), 'number' != typeof o.indent && (o.indent = 1), 'number' != typeof o.linesBefore && (o.linesBefore = 3), - 'number' != typeof o.linesAfter && (o.linesAfter = 2) + 'number' != typeof o.linesAfter && (o.linesAfter = 2)) for (var i, a = /\r?\n|\r|\0/g, u = [0], _ = [], w = -1; (i = a.exec(s.buffer)); ) - _.push(i.index), + (_.push(i.index), u.push(i.index + i[0].length), - s.position <= i.index && w < 0 && (w = u.length - 2) + s.position <= i.index && w < 0 && (w = u.length - 2)) w < 0 && (w = u.length - 1) var x, C, @@ -32300,14 +32356,14 @@ L = Math.min(s.line + o.linesAfter, _.length).toString().length, B = o.maxLength - (o.indent + L + 3) for (x = 1; x <= o.linesBefore && !(w - x < 0); x++) - (C = getLine(s.buffer, u[w - x], _[w - x], s.position - (u[w] - u[w - x]), B)), + ((C = getLine(s.buffer, u[w - x], _[w - x], s.position - (u[w] - u[w - x]), B)), (j = er.repeat(' ', o.indent) + padStart((s.line - x + 1).toString(), L) + ' | ' + C.str + '\n' + - j) + j)) for ( C = getLine(s.buffer, u[w], _[w], s.position, B), j += @@ -32321,13 +32377,13 @@ x <= o.linesAfter && !(w + x >= _.length); x++ ) - (C = getLine(s.buffer, u[w + x], _[w + x], s.position - (u[w] - u[w + x]), B)), + ((C = getLine(s.buffer, u[w + x], _[w + x], s.position - (u[w] - u[w + x]), B)), (j += er.repeat(' ', o.indent) + padStart((s.line + x + 1).toString(), L) + ' | ' + C.str + - '\n') + '\n')) return j.replace(/\n$/, '') }, nr = [ @@ -32392,10 +32448,10 @@ return ( s[o].forEach(function (s) { var o = i.length - i.forEach(function (i, a) { + ;(i.forEach(function (i, a) { i.tag === s.tag && i.kind === s.kind && i.multi === s.multi && (o = a) }), - (i[o] = s) + (i[o] = s)) }), i ) @@ -32413,9 +32469,9 @@ throw new tr( 'Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })' ) - s.implicit && (o = o.concat(s.implicit)), s.explicit && (i = i.concat(s.explicit)) + ;(s.implicit && (o = o.concat(s.implicit)), s.explicit && (i = i.concat(s.explicit))) } - o.forEach(function (s) { + ;(o.forEach(function (s) { if (!(s instanceof ir)) throw new tr( 'Specified list of YAML types (or a single Type object) contains a non-Type object.' @@ -32434,7 +32490,7 @@ throw new tr( 'Specified list of YAML types (or a single Type object) contains a non-Type object.' ) - }) + })) var a = Object.create(Schema$1.prototype) return ( (a.implicit = (this.implicit || []).concat(o)), @@ -32711,7 +32767,7 @@ return '-.Inf' } else if (er.isNegativeZero(s)) return '-0.0' - return (i = s.toString(10)), yr.test(i) ? i.replace('e', '.e') : i + return ((i = s.toString(10)), yr.test(i) ? i.replace('e', '.e') : i) }, defaultStyle: 'lowercase', }), @@ -32789,10 +32845,10 @@ w = 0, x = [] for (o = 0; o < u; o++) - o % 4 == 0 && + (o % 4 == 0 && o && (x.push((w >> 16) & 255), x.push((w >> 8) & 255), x.push(255 & w)), - (w = (w << 6) | _.indexOf(a.charAt(o))) + (w = (w << 6) | _.indexOf(a.charAt(o)))) return ( 0 === (i = (u % 4) * 6) ? (x.push((w >> 16) & 255), x.push((w >> 8) & 255), x.push(255 & w)) @@ -32813,13 +32869,13 @@ _ = s.length, w = kr for (o = 0; o < _; o++) - o % 3 == 0 && + (o % 3 == 0 && o && ((a += w[(u >> 18) & 63]), (a += w[(u >> 12) & 63]), (a += w[(u >> 6) & 63]), (a += w[63 & u])), - (u = (u << 8) + s[o]) + (u = (u << 8) + s[o])) return ( 0 === (i = _ % 3) ? ((a += w[(u >> 18) & 63]), @@ -32897,7 +32953,7 @@ _, w = s for (_ = new Array(w.length), o = 0, i = w.length; o < i; o += 1) - (a = w[o]), (u = Object.keys(a)), (_[o] = [u[0], a[u[0]]]) + ((a = w[o]), (u = Object.keys(a)), (_[o] = [u[0], a[u[0]]])) return _ }, }), @@ -32995,9 +33051,9 @@ : (s[o] = i) } for (var qr = new Array(256), Ur = new Array(256), Vr = 0; Vr < 256; Vr++) - (qr[Vr] = simpleEscapeSequence(Vr) ? 1 : 0), (Ur[Vr] = simpleEscapeSequence(Vr)) + ((qr[Vr] = simpleEscapeSequence(Vr) ? 1 : 0), (Ur[Vr] = simpleEscapeSequence(Vr))) function State$1(s, o) { - ;(this.input = s), + ;((this.input = s), (this.filename = o.filename || null), (this.schema = o.schema || Mr), (this.onWarning = o.onWarning || null), @@ -33012,7 +33068,7 @@ (this.lineStart = 0), (this.lineIndent = 0), (this.firstTabInLine = -1), - (this.documents = []) + (this.documents = [])) } function generateError(s, o) { var i = { @@ -33022,7 +33078,7 @@ line: s.line, column: s.position - s.lineStart, } - return (i.snippet = rr(i)), new tr(o, i) + return ((i.snippet = rr(i)), new tr(o, i)) } function throwError(s, o) { throw generateError(s, o) @@ -33033,7 +33089,7 @@ var zr = { YAML: function handleYamlDirective(s, o, i) { var a, u, _ - null !== s.version && throwError(s, 'duplication of %YAML directive'), + ;(null !== s.version && throwError(s, 'duplication of %YAML directive'), 1 !== i.length && throwError(s, 'YAML directive accepts exactly one argument'), null === (a = /^([0-9]+)\.([0-9]+)$/.exec(i[0])) && throwError(s, 'ill-formed argument of the YAML directive'), @@ -33042,11 +33098,11 @@ 1 !== u && throwError(s, 'unacceptable YAML version of the document'), (s.version = i[0]), (s.checkLineBreaks = _ < 2), - 1 !== _ && 2 !== _ && throwWarning(s, 'unsupported YAML version of the document') + 1 !== _ && 2 !== _ && throwWarning(s, 'unsupported YAML version of the document')) }, TAG: function handleTagDirective(s, o, i) { var a, u - 2 !== i.length && throwError(s, 'TAG directive accepts exactly two arguments'), + ;(2 !== i.length && throwError(s, 'TAG directive accepts exactly two arguments'), (a = i[0]), (u = i[1]), Br.test(a) || @@ -33054,7 +33110,7 @@ Rr.call(s.tagMap, a) && throwError(s, 'there is a previously declared suffix for "' + a + '" tag handle'), $r.test(u) || - throwError(s, 'ill-formed tag prefix (second argument) of the TAG directive') + throwError(s, 'ill-formed tag prefix (second argument) of the TAG directive')) try { u = decodeURIComponent(u) } catch (o) { @@ -33085,16 +33141,16 @@ w < x; w += 1 ) - (_ = u[w]), Rr.call(o, _) || (setProperty(o, _, i[_]), (a[_] = !0)) + ((_ = u[w]), Rr.call(o, _) || (setProperty(o, _, i[_]), (a[_] = !0))) } function storeMappingPair(s, o, i, a, u, _, w, x, C) { var j, L if (Array.isArray(u)) for (j = 0, L = (u = Array.prototype.slice.call(u)).length; j < L; j += 1) - Array.isArray(u[j]) && throwError(s, 'nested arrays are not supported inside keys'), + (Array.isArray(u[j]) && throwError(s, 'nested arrays are not supported inside keys'), 'object' == typeof u && '[object Object]' === _class(u[j]) && - (u[j] = '[object Object]') + (u[j] = '[object Object]')) if ( ('object' == typeof u && '[object Object]' === _class(u) && (u = '[object Object]'), (u = String(u)), @@ -33105,7 +33161,7 @@ for (j = 0, L = _.length; j < L; j += 1) mergeMappings(s, o, _[j], i) else mergeMappings(s, o, _, i) else - s.json || + (s.json || Rr.call(i, u) || !Rr.call(o, u) || ((s.line = w || s.line), @@ -33113,25 +33169,25 @@ (s.position = C || s.position), throwError(s, 'duplicated mapping key')), setProperty(o, u, _), - delete i[u] + delete i[u]) return o } function readLineBreak(s) { var o - 10 === (o = s.input.charCodeAt(s.position)) + ;(10 === (o = s.input.charCodeAt(s.position)) ? s.position++ : 13 === o ? (s.position++, 10 === s.input.charCodeAt(s.position) && s.position++) : throwError(s, 'a line break is expected'), (s.line += 1), (s.lineStart = s.position), - (s.firstTabInLine = -1) + (s.firstTabInLine = -1)) } function skipSeparationSpace(s, o, i) { for (var a = 0, u = s.input.charCodeAt(s.position); 0 !== u; ) { for (; is_WHITE_SPACE(u); ) - 9 === u && -1 === s.firstTabInLine && (s.firstTabInLine = s.position), - (u = s.input.charCodeAt(++s.position)) + (9 === u && -1 === s.firstTabInLine && (s.firstTabInLine = s.position), + (u = s.input.charCodeAt(++s.position))) if (o && 35 === u) do { u = s.input.charCodeAt(++s.position) @@ -33140,12 +33196,12 @@ for ( readLineBreak(s), u = s.input.charCodeAt(s.position), a++, s.lineIndent = 0; 32 === u; - ) - s.lineIndent++, (u = s.input.charCodeAt(++s.position)) + (s.lineIndent++, (u = s.input.charCodeAt(++s.position))) } return ( - -1 !== i && 0 !== a && s.lineIndent < i && throwWarning(s, 'deficient indentation'), a + -1 !== i && 0 !== a && s.lineIndent < i && throwWarning(s, 'deficient indentation'), + a ) } function testDocumentSeparator(s) { @@ -33177,10 +33233,9 @@ throwError(s, 'tab characters must not be used in indentation')), 45 === a) && is_WS_OR_EOL(s.input.charCodeAt(s.position + 1)); - ) if (((x = !0), s.position++, skipSeparationSpace(s, !0, -1) && s.lineIndent <= o)) - w.push(null), (a = s.input.charCodeAt(s.position)) + (w.push(null), (a = s.input.charCodeAt(s.position))) else if ( ((i = s.line), composeNode(s, o, 3, !1, !0), @@ -33219,16 +33274,16 @@ : throwError(s, 'unexpected end of the stream within a verbatim tag') } else { for (; 0 !== u && !is_WS_OR_EOL(u); ) - 33 === u && + (33 === u && (w ? throwError(s, 'tag suffix cannot contain exclamation marks') : ((i = s.input.slice(o - 1, s.position + 1)), Br.test(i) || throwError(s, 'named tag handle cannot contain such characters'), (w = !0), (o = s.position + 1))), - (u = s.input.charCodeAt(++s.position)) - ;(a = s.input.slice(o, s.position)), - Fr.test(a) && throwError(s, 'tag suffix cannot contain flow indicator characters') + (u = s.input.charCodeAt(++s.position))) + ;((a = s.input.slice(o, s.position)), + Fr.test(a) && throwError(s, 'tag suffix cannot contain flow indicator characters')) } a && !$r.test(a) && throwError(s, 'tag name cannot contain such characters: ' + a) try { @@ -33257,7 +33312,6 @@ i = s.input.charCodeAt(++s.position), o = s.position; 0 !== i && !is_WS_OR_EOL(i) && !is_FLOW_INDICATOR(i); - ) i = s.input.charCodeAt(++s.position) return ( @@ -33337,7 +33391,6 @@ null !== s.anchor && (s.anchorMap[s.anchor] = $), j = s.input.charCodeAt(s.position); 0 !== j; - ) { if ( (Z || @@ -33359,7 +33412,7 @@ for (j = s.input.charCodeAt(s.position); is_WHITE_SPACE(j); ) j = s.input.charCodeAt(++s.position) if (58 === j) - is_WS_OR_EOL((j = s.input.charCodeAt(++s.position))) || + (is_WS_OR_EOL((j = s.input.charCodeAt(++s.position))) || throwError( s, 'a whitespace character is expected after the key-value separator within a block mapping' @@ -33371,23 +33424,23 @@ (Z = !1), (u = !1), (V = s.tag), - (z = s.result) + (z = s.result)) else { - if (!ee) return (s.tag = L), (s.anchor = B), !0 + if (!ee) return ((s.tag = L), (s.anchor = B), !0) throwError( s, 'can not read an implicit mapping pair; a colon is missed' ) } } else { - if (!ee) return (s.tag = L), (s.anchor = B), !0 + if (!ee) return ((s.tag = L), (s.anchor = B), !0) throwError( s, 'can not read a block mapping entry; a multiline key may not be an implicit key' ) } } else - 63 === j + (63 === j ? (Z && (storeMappingPair(s, $, U, V, z, null, w, x, C), (V = z = Y = null)), @@ -33401,7 +33454,7 @@ 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line' ), (s.position += 1), - (j = a) + (j = a)) if ( ((s.line === _ || s.lineIndent > o) && (Z && ((w = s.line), (x = s.lineStart), (C = s.position)), @@ -33438,16 +33491,15 @@ z = s.tag, Y = s.anchor, Z = Object.create(null) - if (91 === (U = s.input.charCodeAt(s.position))) (w = 93), (j = !1), (_ = []) + if (91 === (U = s.input.charCodeAt(s.position))) ((w = 93), (j = !1), (_ = [])) else { if (123 !== U) return !1 - ;(w = 125), (j = !0), (_ = {}) + ;((w = 125), (j = !0), (_ = {})) } for ( null !== s.anchor && (s.anchorMap[s.anchor] = _), U = s.input.charCodeAt(++s.position); 0 !== U; - ) { if ( (skipSeparationSpace(s, !0, o), (U = s.input.charCodeAt(s.position)) === w) @@ -33460,7 +33512,7 @@ (s.result = _), !0 ) - V + ;(V ? 44 === U && throwError(s, "expected the node content, but found ','") : throwError(s, 'missed comma between flow collection entries'), ($ = null), @@ -33491,7 +33543,7 @@ skipSeparationSpace(s, !0, o), 44 === (U = s.input.charCodeAt(s.position)) ? ((V = !0), (U = s.input.charCodeAt(++s.position))) - : (V = !1) + : (V = !1)) } throwError(s, 'unexpected end of the stream within a flow collection') })(s, $) @@ -33543,9 +33595,8 @@ for ( readLineBreak(s), s.lineIndent = 0, _ = s.input.charCodeAt(s.position); (!j || s.lineIndent < L) && 32 === _; - ) - s.lineIndent++, (_ = s.input.charCodeAt(++s.position)) + (s.lineIndent++, (_ = s.input.charCodeAt(++s.position))) if ((!j && s.lineIndent > L && (L = s.lineIndent), is_EOL(_))) B++ else { if (s.lineIndent < L) { @@ -33569,7 +33620,6 @@ B = 0, i = s.position; !is_EOL(_) && 0 !== _; - ) _ = s.input.charCodeAt(++s.position) captureSegment(s, i, s.position, !1) @@ -33583,7 +33633,6 @@ for ( s.kind = 'scalar', s.result = '', s.position++, a = u = s.position; 0 !== (i = s.input.charCodeAt(s.position)); - ) if (39 === i) { if ( @@ -33591,7 +33640,7 @@ 39 !== (i = s.input.charCodeAt(++s.position))) ) return !0 - ;(a = s.position), s.position++, (u = s.position) + ;((a = s.position), s.position++, (u = s.position)) } else is_EOL(i) ? (captureSegment(s, a, u, !0), @@ -33611,16 +33660,16 @@ for ( s.kind = 'scalar', s.result = '', s.position++, i = a = s.position; 0 !== (x = s.input.charCodeAt(s.position)); - ) { - if (34 === x) return captureSegment(s, i, s.position, !0), s.position++, !0 + if (34 === x) + return (captureSegment(s, i, s.position, !0), s.position++, !0) if (92 === x) { if ( (captureSegment(s, i, s.position, !0), is_EOL((x = s.input.charCodeAt(++s.position)))) ) skipSeparationSpace(s, !1, o) - else if (x < 256 && qr[x]) (s.result += Ur[x]), s.position++ + else if (x < 256 && qr[x]) ((s.result += Ur[x]), s.position++) else if ( (w = 120 === (C = x) ? 2 : 117 === C ? 4 : 85 === C ? 8 : 0) > 0 ) { @@ -33628,7 +33677,7 @@ (w = fromHexCode((x = s.input.charCodeAt(++s.position)))) >= 0 ? (_ = (_ << 4) + w) : throwError(s, 'expected hexadecimal character') - ;(s.result += charFromCodepoint(_)), s.position++ + ;((s.result += charFromCodepoint(_)), s.position++) } else throwError(s, 'unknown escape sequence') i = a = s.position } else @@ -33652,7 +33701,6 @@ for ( a = s.input.charCodeAt(++s.position), o = s.position; 0 !== a && !is_WS_OR_EOL(a) && !is_FLOW_INDICATOR(a); - ) a = s.input.charCodeAt(++s.position) return ( @@ -33705,7 +33753,6 @@ for ( s.kind = 'scalar', s.result = '', u = _ = s.position, w = !1; 0 !== L; - ) { if (58 === L) { if ( @@ -33729,23 +33776,23 @@ skipSeparationSpace(s, !1, -1), s.lineIndent >= o) ) { - ;(w = !0), (L = s.input.charCodeAt(s.position)) + ;((w = !0), (L = s.input.charCodeAt(s.position))) continue } - ;(s.position = _), + ;((s.position = _), (s.line = x), (s.lineStart = C), - (s.lineIndent = j) + (s.lineIndent = j)) break } } - w && + ;(w && (captureSegment(s, u, _, !1), writeFoldedLines(s, s.line - x), (u = _ = s.position), (w = !1)), is_WHITE_SPACE(L) || (_ = s.position + 1), - (L = s.input.charCodeAt(++s.position)) + (L = s.input.charCodeAt(++s.position))) } return ( captureSegment(s, u, _, !1), @@ -33774,9 +33821,9 @@ C += 1 ) if ((B = s.implicitTypes[C]).resolve(s.result)) { - ;(s.result = B.construct(s.result)), + ;((s.result = B.construct(s.result)), (s.tag = B.tag), - null !== s.anchor && (s.anchorMap[s.anchor] = s.result) + null !== s.anchor && (s.anchorMap[s.anchor] = s.result)) break } } else if ('!' !== s.tag) { @@ -33792,7 +33839,7 @@ B = L[C] break } - B || throwError(s, 'unknown tag !<' + s.tag + '>'), + ;(B || throwError(s, 'unknown tag !<' + s.tag + '>'), null !== s.result && B.kind !== s.kind && throwError( @@ -33808,10 +33855,11 @@ B.resolve(s.result, s.tag) ? ((s.result = B.construct(s.result, s.tag)), null !== s.anchor && (s.anchorMap[s.anchor] = s.result)) - : throwError(s, 'cannot resolve a node with !<' + s.tag + '> explicit tag') + : throwError(s, 'cannot resolve a node with !<' + s.tag + '> explicit tag')) } return ( - null !== s.listener && s.listener('close', s), null !== s.tag || null !== s.anchor || Y + null !== s.listener && s.listener('close', s), + null !== s.tag || null !== s.anchor || Y ) } function readDocument(s) { @@ -33830,12 +33878,10 @@ (skipSeparationSpace(s, !0, -1), (u = s.input.charCodeAt(s.position)), !(s.lineIndent > 0 || 37 !== u)); - ) { for ( w = !0, u = s.input.charCodeAt(++s.position), o = s.position; 0 !== u && !is_WS_OR_EOL(u); - ) u = s.input.charCodeAt(++s.position) for ( @@ -33843,7 +33889,6 @@ (i = s.input.slice(o, s.position)).length < 1 && throwError(s, 'directive name must not be less than one character in length'); 0 !== u; - ) { for (; is_WHITE_SPACE(u); ) u = s.input.charCodeAt(++s.position) if (35 === u) { @@ -33857,12 +33902,12 @@ u = s.input.charCodeAt(++s.position) a.push(s.input.slice(o, s.position)) } - 0 !== u && readLineBreak(s), + ;(0 !== u && readLineBreak(s), Rr.call(zr, i) ? zr[i](s, i, a) - : throwWarning(s, 'unknown document directive "' + i + '"') + : throwWarning(s, 'unknown document directive "' + i + '"')) } - skipSeparationSpace(s, !0, -1), + ;(skipSeparationSpace(s, !0, -1), 0 === s.lineIndent && 45 === s.input.charCodeAt(s.position) && 45 === s.input.charCodeAt(s.position + 1) && @@ -33879,24 +33924,23 @@ ? 46 === s.input.charCodeAt(s.position) && ((s.position += 3), skipSeparationSpace(s, !0, -1)) : s.position < s.length - 1 && - throwError(s, 'end of the stream or a document separator is expected') + throwError(s, 'end of the stream or a document separator is expected')) } function loadDocuments(s, o) { - ;(o = o || {}), + ;((o = o || {}), 0 !== (s = String(s)).length && (10 !== s.charCodeAt(s.length - 1) && 13 !== s.charCodeAt(s.length - 1) && (s += '\n'), - 65279 === s.charCodeAt(0) && (s = s.slice(1))) + 65279 === s.charCodeAt(0) && (s = s.slice(1)))) var i = new State$1(s, o), a = s.indexOf('\0') for ( -1 !== a && ((i.position = a), throwError(i, 'null byte is not allowed in input')), i.input += '\0'; 32 === i.input.charCodeAt(i.position); - ) - (i.lineIndent += 1), (i.position += 1) + ((i.lineIndent += 1), (i.position += 1)) for (; i.position < i.length - 1; ) readDocument(i) return i.documents } @@ -33956,17 +34000,17 @@ Xr = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/ function encodeHex(s) { var o, i, a - if (((o = s.toString(16).toUpperCase()), s <= 255)) (i = 'x'), (a = 2) - else if (s <= 65535) (i = 'u'), (a = 4) + if (((o = s.toString(16).toUpperCase()), s <= 255)) ((i = 'x'), (a = 2)) + else if (s <= 65535) ((i = 'u'), (a = 4)) else { if (!(s <= 4294967295)) throw new tr('code point within a string may not be greater than 0xFFFFFFFF') - ;(i = 'U'), (a = 8) + ;((i = 'U'), (a = 8)) } return '\\' + i + er.repeat('0', a - o.length) + o } function State(s) { - ;(this.schema = s.schema || Mr), + ;((this.schema = s.schema || Mr), (this.indent = Math.max(1, s.indent || 2)), (this.noArrayIndent = s.noArrayIndent || !1), (this.skipInvalid = s.skipInvalid || !1), @@ -33975,13 +34019,13 @@ var i, a, u, _, w, x, C if (null === o) return {} for (i = {}, u = 0, _ = (a = Object.keys(o)).length; u < _; u += 1) - (w = a[u]), + ((w = a[u]), (x = String(o[w])), '!!' === w.slice(0, 2) && (w = 'tag:yaml.org,2002:' + w.slice(2)), (C = s.compiledTypeMap.fallback[w]) && Hr.call(C.styleAliases, x) && (x = C.styleAliases[x]), - (i[w] = x) + (i[w] = x)) return i })(this.schema, s.styles || null)), (this.sortKeys = s.sortKeys || !1), @@ -33997,15 +34041,15 @@ (this.tag = null), (this.result = ''), (this.duplicates = []), - (this.usedDuplicates = null) + (this.usedDuplicates = null)) } function indentString(s, o) { for (var i, a = er.repeat(' ', o), u = 0, _ = -1, w = '', x = s.length; u < x; ) - -1 === (_ = s.indexOf('\n', u)) + (-1 === (_ = s.indexOf('\n', u)) ? ((i = s.slice(u)), (u = x)) : ((i = s.slice(u, _ + 1)), (u = _ + 1)), i.length && '\n' !== i && (w += a), - (w += i) + (w += i)) return w } function generateNextLine(s, o) { @@ -34092,14 +34136,14 @@ if (o || w) for (C = 0; C < s.length; j >= 65536 ? (C += 2) : C++) { if (!isPrintable((j = codePointAt(s, C)))) return 5 - ;(z = z && isPlainSafe(j, L, x)), (L = j) + ;((z = z && isPlainSafe(j, L, x)), (L = j)) } else { for (C = 0; C < s.length; j >= 65536 ? (C += 2) : C++) { if (10 === (j = codePointAt(s, C))) - (B = !0), U && (($ = $ || (C - V - 1 > a && ' ' !== s[V + 1])), (V = C)) + ((B = !0), U && (($ = $ || (C - V - 1 > a && ' ' !== s[V + 1])), (V = C))) else if (!isPrintable(j)) return 5 - ;(z = z && isPlainSafe(j, L, x)), (L = j) + ;((z = z && isPlainSafe(j, L, x)), (L = j)) } $ = $ || (U && C - V - 1 > a && ' ' !== s[V + 1]) } @@ -34172,9 +34216,9 @@ for (; (a = u.exec(s)); ) { var C = a[1], j = a[2] - ;(i = ' ' === j[0]), + ;((i = ' ' === j[0]), (_ += C + (w || i || '' === j ? '' : '\n') + foldLine(j, o)), - (w = i) + (w = i)) } return _ })(o, w), @@ -34187,10 +34231,10 @@ '"' + (function escapeString(s) { for (var o, i = '', a = 0, u = 0; u < s.length; a >= 65536 ? (u += 2) : u++) - (a = codePointAt(s, u)), + ((a = codePointAt(s, u)), !(o = Gr[a]) && isPrintable(a) ? ((i += s[u]), a >= 65536 && (i += s[u + 1])) - : (i += o || encodeHex(a)) + : (i += o || encodeHex(a))) return i })(o) + '"' @@ -34211,9 +34255,9 @@ function foldLine(s, o) { if ('' === s || ' ' === s[0]) return s for (var i, a, u = / [^ ]/g, _ = 0, w = 0, x = 0, C = ''; (i = u.exec(s)); ) - (x = i.index) - _ > o && + ((x = i.index) - _ > o && ((a = w > _ ? w : x), (C += '\n' + s.slice(_, a)), (_ = a + 1)), - (w = x) + (w = x)) return ( (C += '\n'), s.length - _ > o && w > _ @@ -34229,14 +34273,14 @@ x = '', C = s.tag for (u = 0, _ = i.length; u < _; u += 1) - (w = i[u]), + ((w = i[u]), s.replacer && (w = s.replacer.call(i, String(u), w)), (writeNode(s, o + 1, w, !0, !0, !1, !0) || (void 0 === w && writeNode(s, o + 1, null, !0, !0, !1, !0))) && ((a && '' === x) || (x += generateNextLine(s, o)), s.dump && 10 === s.dump.charCodeAt(0) ? (x += '-') : (x += '- '), - (x += s.dump)) - ;(s.tag = C), (s.dump = x || '[]') + (x += s.dump))) + ;((s.tag = C), (s.dump = x || '[]')) } function detectType(s, o, i) { var a, u, _, w, x, C @@ -34271,7 +34315,7 @@ return !1 } function writeNode(s, o, i, a, u, _, w) { - ;(s.tag = null), (s.dump = i), detectType(s, i, !1) || detectType(s, i, !0) + ;((s.tag = null), (s.dump = i), detectType(s, i, !1) || detectType(s, i, !0)) var x, C = Jr.call(s.dump), j = a @@ -34305,7 +34349,7 @@ else if ('function' == typeof s.sortKeys) $.sort(s.sortKeys) else if (s.sortKeys) throw new tr('sortKeys must be a boolean or a function') for (u = 0, _ = $.length; u < _; u += 1) - (j = ''), + ((j = ''), (a && '' === L) || (j += generateNextLine(s, o)), (x = i[(w = $[u])]), s.replacer && (x = s.replacer.call(i, w, x)), @@ -34318,8 +34362,8 @@ C && (j += generateNextLine(s, o)), writeNode(s, o + 1, x, !0, C) && (s.dump && 10 === s.dump.charCodeAt(0) ? (j += ':') : (j += ': '), - (L += j += s.dump))) - ;(s.tag = B), (s.dump = L || '{}') + (L += j += s.dump)))) + ;((s.tag = B), (s.dump = L || '{}')) })(s, o, s.dump, u), B && (s.dump = '&ref_' + L + s.dump)) : (!(function writeFlowMapping(s, o, i) { @@ -34332,7 +34376,7 @@ j = s.tag, L = Object.keys(i) for (a = 0, u = L.length; a < u; a += 1) - (x = ''), + ((x = ''), '' !== C && (x += ', '), s.condenseFlow && (x += '"'), (w = i[(_ = L[a])]), @@ -34344,8 +34388,8 @@ (s.condenseFlow ? '"' : '') + ':' + (s.condenseFlow ? '' : ' ')), - writeNode(s, o, w, !1, !1) && (C += x += s.dump)) - ;(s.tag = j), (s.dump = '{' + C + '}') + writeNode(s, o, w, !1, !1) && (C += x += s.dump))) + ;((s.tag = j), (s.dump = '{' + C + '}')) })(s, o, s.dump), B && (s.dump = '&ref_' + L + ' ' + s.dump)) else if ('[object Array]' === C) @@ -34361,12 +34405,12 @@ w = '', x = s.tag for (a = 0, u = i.length; a < u; a += 1) - (_ = i[a]), + ((_ = i[a]), s.replacer && (_ = s.replacer.call(i, String(a), _)), (writeNode(s, o, _, !1, !1) || (void 0 === _ && writeNode(s, o, null, !1, !1))) && - ('' !== w && (w += ',' + (s.condenseFlow ? '' : ' ')), (w += s.dump)) - ;(s.tag = x), (s.dump = '[' + w + ']') + ('' !== w && (w += ',' + (s.condenseFlow ? '' : ' ')), (w += s.dump))) + ;((s.tag = x), (s.dump = '[' + w + ']')) })(s, o, s.dump), B && (s.dump = '&ref_' + L + ' ' + s.dump)) else { @@ -34501,7 +34545,7 @@ try { return fn.load(s) } catch (s) { - return o && o.errActions.newThrownErr(new Error(s)), {} + return (o && o.errActions.newThrownErr(new Error(s)), {}) } })(u.text, i) ) @@ -34547,7 +34591,7 @@ actions: { scrollToElement: (s, o) => (i) => { try { - ;(o = o || i.fn.getScrollParent(s)), bn().createScroller(o).to(s) + ;((o = o || i.fn.getScrollParent(s)), bn().createScroller(o).to(s)) } catch (s) { console.error(s) } @@ -34564,13 +34608,13 @@ ({ layoutActions: o, layoutSelectors: i, getConfigs: a }) => { if (a().deepLinking && s) { let a = s.slice(1) - '!' === a[0] && (a = a.slice(1)), '/' === a[0] && (a = a.slice(1)) + ;('!' === a[0] && (a = a.slice(1)), '/' === a[0] && (a = a.slice(1))) const u = a.split('/').map((s) => s || ''), _ = i.isShownKeyFromUrlHashArray(u), [w, x = '', C = ''] = _ if ('operations' === w) { const s = i.isShownKeyFromUrlHashArray([x]) - x.indexOf('_') > -1 && + ;(x.indexOf('_') > -1 && (console.warn( 'Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead.' ), @@ -34578,9 +34622,9 @@ s.map((s) => s.replace(/_/g, ' ')), !0 )), - o.show(s, !0) + o.show(s, !0)) } - ;(x.indexOf('_') > -1 || C.indexOf('_') > -1) && + ;((x.indexOf('_') > -1 || C.indexOf('_') > -1) && (console.warn( 'Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead.' ), @@ -34589,7 +34633,7 @@ !0 )), o.show(_, !0), - o.scrollTo(_) + o.scrollTo(_)) } }, }, @@ -34644,7 +34688,7 @@ const { operation: i } = this.props, { tag: a, operationId: u } = i.toObject() let { isShownKey: _ } = i.toObject() - ;(_ = _ || ['operations', a, u]), o.layoutActions.readyToScroll(_, s) + ;((_ = _ || ['operations', a, u]), o.layoutActions.readyToScroll(_, s)) } render() { return Re.createElement( @@ -34736,7 +34780,7 @@ try { return i.transform(s, o).filter((s) => !!s) } catch (o) { - return console.error('Transformer error:', o), s + return (console.error('Transformer error:', o), s) } }, s @@ -34984,10 +35028,10 @@ return { type: Dn, payload: s } } function actions_show(s, o = !0) { - return (s = normalizeArray(s)), { type: Fn, payload: { thing: s, shown: o } } + return ((s = normalizeArray(s)), { type: Fn, payload: { thing: s, shown: o } }) } function changeMode(s, o = '') { - return (s = normalizeArray(s)), { type: Ln, payload: { thing: s, mode: o } } + return ((s = normalizeArray(s)), { type: Ln, payload: { thing: s, mode: o } }) } const Bn = { [Rn]: (s, o) => s.set('layout', o.payload), @@ -35006,7 +35050,8 @@ current = (s) => s.get('layout'), currentFilter = (s) => s.get('filter'), isShown = (s, o, i) => ( - (o = normalizeArray(o)), s.get('shown', (0, ze.fromJS)({})).get((0, ze.fromJS)(o), i) + (o = normalizeArray(o)), + s.get('shown', (0, ze.fromJS)({})).get((0, ze.fromJS)(o), i) ), whatMode = (s, o, i = '') => ((o = normalizeArray(o)), s.getIn(['modes', ...o], i)), $n = Ut( @@ -35021,7 +35066,7 @@ C = x(), { maxDisplayedTags: j } = C let L = w.currentFilter() - return L && !0 !== L && (u = _.opsFilter(u, L)), j >= 0 && (u = u.slice(0, j)), u + return (L && !0 !== L && (u = _.opsFilter(u, L)), j >= 0 && (u = u.slice(0, j)), u) } function plugins_layout() { return { @@ -35060,7 +35105,10 @@ (s, o) => (...i) => { const a = o.getConfigs().onComplete - return qn && 'function' == typeof a && (setTimeout(a, 0), (qn = !1)), s(...i) + return ( + qn && 'function' == typeof a && (setTimeout(a, 0), (qn = !1)), + s(...i) + ) }, }, }, @@ -35113,29 +35161,31 @@ w && w.size) ) for (let o of s.get('headers').entries()) { - addNewLine(), addIndent() + ;(addNewLine(), addIndent()) let [s, i] = o - addWordsWithoutLeadingSpace('-H', `${s}: ${i}`), - (u = u || (/^content-type$/i.test(s) && /^multipart\/form-data$/i.test(i))) + ;(addWordsWithoutLeadingSpace('-H', `${s}: ${i}`), + (u = u || (/^content-type$/i.test(s) && /^multipart\/form-data$/i.test(i)))) } const C = s.get('body') if (C) if (u && ['POST', 'PUT', 'PATCH'].includes(s.get('method'))) for (let [s, o] of C.entrySeq()) { let i = extractKey(s) - addNewLine(), + ;(addNewLine(), addIndent(), addWordsWithoutLeadingSpace('-F'), o instanceof lt.File && 'string' == typeof o.valueOf() ? addWords(`${i}=${o.data}${o.type ? `;type=${o.type}` : ''}`) : o instanceof lt.File ? addWords(`${i}=@${o.name}${o.type ? `;type=${o.type}` : ''}`) - : addWords(`${i}=${o}`) + : addWords(`${i}=${o}`)) } else if (C instanceof lt.File) - addNewLine(), addIndent(), addWordsWithoutLeadingSpace(`--data-binary '@${C.name}'`) + (addNewLine(), + addIndent(), + addWordsWithoutLeadingSpace(`--data-binary '@${C.name}'`)) else { - addNewLine(), addIndent(), addWordsWithoutLeadingSpace('-d ') + ;(addNewLine(), addIndent(), addWordsWithoutLeadingSpace('-d ')) let o = C ze.Map.isMap(o) ? addWordsWithoutLeadingSpace( @@ -35379,14 +35429,15 @@ this.props.expanded !== s.expanded && this.setState({ expanded: s.expanded }) } toggleCollapsed = () => { - this.props.onToggle && this.props.onToggle(this.props.modelName, !this.state.expanded), - this.setState({ expanded: !this.state.expanded }) + ;(this.props.onToggle && + this.props.onToggle(this.props.modelName, !this.state.expanded), + this.setState({ expanded: !this.state.expanded })) } onLoad = (s) => { if (s && this.props.layoutSelectors) { const o = this.props.layoutSelectors.getScrollToKey() - We().is(o, this.props.specPath) && this.toggleCollapsed(), - this.props.layoutActions.readyToScroll(this.props.specPath, s.parentElement) + ;(We().is(o, this.props.specPath) && this.toggleCollapsed(), + this.props.layoutActions.readyToScroll(this.props.specPath, s.parentElement)) } } render() { @@ -35596,10 +35647,10 @@ function _defineProperties(s, o) { for (var i = 0; i < o.length; i++) { var a = o[i] - ;(a.enumerable = a.enumerable || !1), + ;((a.enumerable = a.enumerable || !1), (a.configurable = !0), 'value' in a && (a.writable = !0), - Object.defineProperty(s, a.key, a) + Object.defineProperty(s, a.key, a)) } } function _defineProperty(s, o, i) { @@ -35619,11 +35670,11 @@ var i = Object.keys(s) if (Object.getOwnPropertySymbols) { var a = Object.getOwnPropertySymbols(s) - o && + ;(o && (a = a.filter(function (o) { return Object.getOwnPropertyDescriptor(s, o).enumerable })), - i.push.apply(i, a) + i.push.apply(i, a)) } return i } @@ -35642,7 +35693,7 @@ (_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(s, o) { - return (s.__proto__ = o), s + return ((s.__proto__ = o), s) }), _setPrototypeOf(s, o) ) @@ -35731,13 +35782,13 @@ (function _inherits(s, o) { if ('function' != typeof o && null !== o) throw new TypeError('Super expression must either be null or a function') - ;(s.prototype = Object.create(o && o.prototype, { + ;((s.prototype = Object.create(o && o.prototype, { constructor: { value: s, writable: !0, configurable: !0 }, })), - o && _setPrototypeOf(s, o) + o && _setPrototypeOf(s, o)) })(ImmutablePureComponent, s), (function _createClass(s, o, i) { - return o && _defineProperties(s.prototype, o), i && _defineProperties(s, i), s + return (o && _defineProperties(s.prototype, o), i && _defineProperties(s, i), s) })(ImmutablePureComponent, [ { key: 'shouldComponentUpdate', @@ -35931,8 +35982,8 @@ getCollapsedContent = () => ' ' handleToggle = (s, o) => { const { layoutActions: i } = this.props - i.show([...this.getSchemaBasePath(), s], o), - o && this.props.specActions.requestResolvedSubtree([...this.getSchemaBasePath(), s]) + ;(i.show([...this.getSchemaBasePath(), s], o), + o && this.props.specActions.requestResolvedSubtree([...this.getSchemaBasePath(), s])) } onLoadModels = (s) => { s && this.props.layoutActions.readyToScroll(this.getSchemaBasePath(), s) @@ -36422,16 +36473,14 @@ Re.createElement('span', { className: 'brace-close' }, '}') ), de.size - ? de - .entrySeq() - .map(([s, o]) => - Re.createElement(Pe, { - key: `${s}-${o}`, - propKey: s, - propVal: o, - propClass: 'property', - }) - ) + ? de.entrySeq().map(([s, o]) => + Re.createElement(Pe, { + key: `${s}-${o}`, + propKey: s, + propVal: o, + propClass: 'property', + }) + ) : null ) } @@ -36573,16 +36622,14 @@ Re.createElement('span', { className: 'prop-type' }, C), j && Re.createElement('span', { className: 'prop-format' }, '($', j, ')'), z.size - ? z - .entrySeq() - .map(([s, o]) => - Re.createElement(ae, { - key: `${s}-${o}`, - propKey: s, - propVal: o, - propClass: ts, - }) - ) + ? z.entrySeq().map(([s, o]) => + Re.createElement(ae, { + key: `${s}-${o}`, + propKey: s, + propVal: o, + propClass: ts, + }) + ) : null, x && V.size > 0 ? Re.createElement(pe, { extensions: V, propClass: `${ts} extension` }) @@ -36786,12 +36833,12 @@ class JsonSchema_array extends Re.PureComponent { static defaultProps = ss constructor(s, o) { - super(s, o), (this.state = { value: valueOrEmptyList(s.value), schema: s.schema }) + ;(super(s, o), (this.state = { value: valueOrEmptyList(s.value), schema: s.schema })) } UNSAFE_componentWillReceiveProps(s) { const o = valueOrEmptyList(s.value) - o !== this.state.value && this.setState({ value: o }), - s.schema !== this.state.schema && this.setState({ schema: s.schema }) + ;(o !== this.state.value && this.setState({ value: o }), + s.schema !== this.state.schema && this.setState({ schema: s.schema })) } onChange = () => { this.props.onChange(this.state.value) @@ -37134,7 +37181,7 @@ const { Cache: i } = pt() pt().Cache = Cache const a = pt()(s, o) - return (pt().Cache = i), a + return ((pt().Cache = i), a) }, fs = { string: (s) => @@ -37145,7 +37192,7 @@ /(?<=(? {}, V = a.specStr() return w({ @@ -37980,7 +38027,7 @@ (s, { path: o, system: i }) => (s.has(i) || s.set(i, []), s.get(i).push(o), s), new Map() ) - ;(Po = []), + ;((Po = []), s.forEach(async (s, o) => { if (!o) return void console.error( @@ -38080,7 +38127,7 @@ } catch (s) { console.error(s) } - }) + })) }, 35), requestResolvedSubtree = (s) => (o) => { Po.find(({ path: i, system: a }) => a === o && i.toString() === s.toString()) || @@ -38143,9 +38190,9 @@ s.server = _.selectedServer(o) || _.selectedServer() const i = _.serverVariables({ server: s.server, namespace: o }).toJS(), a = _.serverVariables({ server: s.server }).toJS() - ;(s.serverVariables = Object.keys(i).length ? i : a), + ;((s.serverVariables = Object.keys(i).length ? i : a), (s.requestContentType = _.requestContentType(w, x)), - (s.responseContentType = _.responseContentType(w, x) || '*/*') + (s.responseContentType = _.responseContentType(w, x) || '*/*')) const u = _.requestBodyValue(w, x), C = _.requestBodyInclusionSetting(w, x) u && u.toJS @@ -38158,25 +38205,25 @@ : (s.requestBody = u) } let $ = Object.assign({}, s) - ;($ = o.buildRequest($)), i.setRequest(s.pathName, s.method, $) - ;(s.requestInterceptor = async (o) => { + ;(($ = o.buildRequest($)), i.setRequest(s.pathName, s.method, $)) + ;((s.requestInterceptor = async (o) => { let a = await j.apply(void 0, [o]), u = Object.assign({}, a) - return i.setMutatedRequest(s.pathName, s.method, u), a + return (i.setMutatedRequest(s.pathName, s.method, u), a) }), - (s.responseInterceptor = L) + (s.responseInterceptor = L)) const U = Date.now() return o .execute(s) .then((o) => { - ;(o.duration = Date.now() - U), i.setResponse(s.pathName, s.method, o) + ;((o.duration = Date.now() - U), i.setResponse(s.pathName, s.method, o)) }) .catch((o) => { - 'Failed to fetch' === o.message && + ;('Failed to fetch' === o.message && ((o.name = ''), (o.message = '**Failed to fetch.** \n**Possible Reasons:** \n - CORS \n - Network Failure \n - URL scheme must be "http" or "https" for CORS request.')), - i.setResponse(s.pathName, s.method, { error: !0, err: o }) + i.setResponse(s.pathName, s.method, { error: !0, err: o })) }) }, actions_execute = @@ -38267,7 +38314,7 @@ ), [vo]: (s, { payload: { res: o, path: i, method: a } }) => { let u - ;(u = o.error + ;((u = o.error ? Object.assign( { error: !0, @@ -38278,7 +38325,7 @@ o.err.response ) : o), - (u.headers = u.headers || {}) + (u.headers = u.headers || {})) let _ = s.setIn(['responses', i, a], fromJSOrdered(u)) return ( lt.Blob && @@ -38312,19 +38359,19 @@ wrap_actions_updateSpec = (s, { specActions: o }) => (...i) => { - s(...i), o.parseToJson(...i) + ;(s(...i), o.parseToJson(...i)) }, wrap_actions_updateJsonSpec = (s, { specActions: o }) => (...i) => { - s(...i), o.invalidateResolvedSubtreeCache() + ;(s(...i), o.invalidateResolvedSubtreeCache()) const [a] = i, u = Cn()(a, ['paths']) || {} - Object.keys(u).forEach((s) => { + ;(Object.keys(u).forEach((s) => { const i = Cn()(u, [s]) as()(i) && i.$ref && o.requestResolvedSubtree(['paths', s]) }), - o.requestResolvedSubtree(['components', 'securitySchemes']) + o.requestResolvedSubtree(['components', 'securitySchemes'])) }, wrap_actions_executeRequest = (s, { specActions: o }) => @@ -38362,9 +38409,9 @@ function __() { this.constructor = s } - extendStatics(s, o), + ;(extendStatics(s, o), (s.prototype = - null === o ? Object.create(o) : ((__.prototype = o.prototype), new __())) + null === o ? Object.create(o) : ((__.prototype = o.prototype), new __()))) } })(), Mo = Object.prototype.hasOwnProperty @@ -38447,21 +38494,21 @@ x ) } - return No(PatchError, s), PatchError + return (No(PatchError, s), PatchError) })(Error), Do = Ro, Lo = _deepClone, Fo = { add: function (s, o, i) { - return (s[o] = this.value), { newDocument: i } + return ((s[o] = this.value), { newDocument: i }) }, remove: function (s, o, i) { var a = s[o] - return delete s[o], { newDocument: i, removed: a } + return (delete s[o], { newDocument: i, removed: a }) }, replace: function (s, o, i) { var a = s[o] - return (s[o] = this.value), { newDocument: i, removed: a } + return ((s[o] = this.value), { newDocument: i, removed: a }) }, move: function (s, o, i) { var a = getValueByPointer(i, this.path) @@ -38483,7 +38530,7 @@ return { newDocument: i, test: _areEquals(s[o], this.value) } }, _get: function (s, o, i) { - return (this.value = s[o]), { newDocument: i } + return ((this.value = s[o]), { newDocument: i }) }, }, Bo = { @@ -38498,7 +38545,7 @@ }, replace: function (s, o, i) { var a = s[o] - return (s[o] = this.value), { newDocument: i, removed: a } + return ((s[o] = this.value), { newDocument: i, removed: a }) }, move: Fo.move, copy: Fo.copy, @@ -38508,7 +38555,7 @@ function getValueByPointer(s, o) { if ('' == o) return s var i = { op: '_get', path: o } - return applyOperation(s, i), i.value + return (applyOperation(s, i), i.value) } function applyOperation(s, o, i, a, u, _) { if ( @@ -38520,8 +38567,8 @@ '' === o.path) ) { var w = { newDocument: s } - if ('add' === o.op) return (w.newDocument = o.value), w - if ('replace' === o.op) return (w.newDocument = o.value), (w.removed = s), w + if ('add' === o.op) return ((w.newDocument = o.value), w) + if ('replace' === o.op) return ((w.newDocument = o.value), (w.removed = s), w) if ('move' === o.op || 'copy' === o.op) return ( (w.newDocument = getValueByPointer(s, o.from)), @@ -38531,10 +38578,10 @@ if ('test' === o.op) { if (((w.test = _areEquals(s, o.value)), !1 === w.test)) throw new Do('Test operation failed', 'TEST_OPERATION_FAILED', _, o, s) - return (w.newDocument = s), w + return ((w.newDocument = s), w) } - if ('remove' === o.op) return (w.removed = s), (w.newDocument = null), w - if ('_get' === o.op) return (o.value = s), w + if ('remove' === o.op) return ((w.removed = s), (w.newDocument = null), w) + if ('_get' === o.op) return ((o.value = s), w) if (i) throw new Do( 'Operation `op` property is not one of operations defined in RFC-6902', @@ -38614,8 +38661,8 @@ throw new Do('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY') a || (s = _deepClone(s)) for (var _ = new Array(o.length), w = 0, x = o.length; w < x; w++) - (_[w] = applyOperation(s, o[w], i, !0, u, w)), (s = _[w].newDocument) - return (_.newDocument = s), _ + ((_[w] = applyOperation(s, o[w], i, !0, u, w)), (s = _[w].newDocument)) + return ((_.newDocument = s), _) } function applyReducer(s, o, i) { var a = applyOperation(s, o) @@ -38744,10 +38791,10 @@ } var $o = new WeakMap(), qo = function qo(s) { - ;(this.observers = new Map()), (this.obj = s) + ;((this.observers = new Map()), (this.obj = s)) }, Uo = function Uo(s, o) { - ;(this.callback = s), (this.observer = o) + ;((this.callback = s), (this.observer = o)) } function unobserve(s, o) { o.unobserve() @@ -38762,15 +38809,15 @@ return s.observers.get(o) })(a, o) i = u && u.observer - } else (a = new qo(s)), $o.set(s, a) + } else ((a = new qo(s)), $o.set(s, a)) if (i) return i if (((i = {}), (a.value = _deepClone(s)), o)) { - ;(i.callback = o), (i.next = null) + ;((i.callback = o), (i.next = null)) var dirtyCheck = function () { generate(i) }, fastCheck = function () { - clearTimeout(i.next), (i.next = setTimeout(dirtyCheck)) + ;(clearTimeout(i.next), (i.next = setTimeout(dirtyCheck))) } 'undefined' != typeof window && (window.addEventListener('mouseup', fastCheck), @@ -38783,7 +38830,7 @@ (i.patches = []), (i.object = s), (i.unobserve = function () { - generate(i), + ;(generate(i), clearTimeout(i.next), (function removeObserverFromMirror(s, o) { s.observers.delete(o.callback) @@ -38793,7 +38840,7 @@ window.removeEventListener('keyup', fastCheck), window.removeEventListener('mousedown', fastCheck), window.removeEventListener('keydown', fastCheck), - window.removeEventListener('change', fastCheck)) + window.removeEventListener('change', fastCheck))) }), a.observers.set(o, new Uo(o, i)), i @@ -38802,10 +38849,10 @@ function generate(s, o) { void 0 === o && (o = !1) var i = $o.get(s.object) - _generate(i.value, s.object, s.patches, '', o), - s.patches.length && applyPatch(i.value, s.patches) + ;(_generate(i.value, s.object, s.patches, '', o), + s.patches.length && applyPatch(i.value, s.patches)) var a = s.patches - return a.length > 0 && ((s.patches = []), s.callback && s.callback(a)), a + return (a.length > 0 && ((s.patches = []), s.callback && s.callback(a)), a) } function _generate(s, o, i, a, u) { if (o !== s) { @@ -38870,7 +38917,7 @@ function compare(s, o, i) { void 0 === i && (i = !1) var a = [] - return _generate(s, o, a, '', i), a + return (_generate(s, o, a, '', i), a) } Object.assign({}, Z, ee, { JsonPatchError: Ro, @@ -38906,7 +38953,7 @@ 'merge' === (o = { ...o, path: o.path && normalizeJSONPath(o.path) }).op) ) { const i = getInByJsonPath(s, o.path) - Object.assign(i, o.value), applyPatch(s, [replace(o.path, i)]) + ;(Object.assign(i, o.value), applyPatch(s, [replace(o.path, i)])) } else if ('mergeDeep' === o.op) { const i = getInByJsonPath(s, o.path), a = zo()(i, o.value, { @@ -38924,19 +38971,20 @@ s, Object.keys(o.value).reduce( (s, i) => ( - s.push({ op: 'add', path: `/${normalizeJSONPath(i)}`, value: o.value[i] }), s + s.push({ op: 'add', path: `/${normalizeJSONPath(i)}`, value: o.value[i] }), + s ), [] ) ) } else if ('replace' === o.op && '' === o.path) { let { value: a } = o - i.allowMetaPatches && + ;(i.allowMetaPatches && o.meta && isAdditiveMutation(o) && (Array.isArray(o.value) || lib_isObject(o.value)) && (a = { ...a, ...o.meta }), - (s = a) + (s = a)) } else if ( (applyPatch(s, [o]), i.allowMetaPatches && @@ -39030,7 +39078,7 @@ const u = Object.keys(s).map((a) => forEach(s[a], o, i.concat(a))) u && (a = a.concat(u)) } - return (a = flatten(a)), a + return ((a = flatten(a)), a) } function lib_normalizeArray(s) { return Array.isArray(s) ? s : [s] @@ -39070,7 +39118,7 @@ try { return getValueByPointer(s, o) } catch (s) { - return console.error(s), {} + return (console.error(s), {}) } } var Jo = __webpack_require__(48675) @@ -39086,10 +39134,10 @@ null != i && 'object' == typeof i && Object.hasOwn(i, 'cause') && !('cause' in this)) ) { const { cause: s } = i - ;(this.cause = s), + ;((this.cause = s), s instanceof Error && 'stack' in s && - (this.stack = `${this.stack}\nCAUSE: ${s.stack}`) + (this.stack = `${this.stack}\nCAUSE: ${s.stack}`)) } } } @@ -39110,10 +39158,10 @@ null != o && 'object' == typeof o && Object.hasOwn(o, 'cause') && !('cause' in this)) ) { const { cause: s } = o - ;(this.cause = s), + ;((this.cause = s), s instanceof Error && 'stack' in s && - (this.stack = `${this.stack}\nCAUSE: ${s.stack}`) + (this.stack = `${this.stack}\nCAUSE: ${s.stack}`)) } } } @@ -39246,11 +39294,11 @@ s.flags ? s.flags : (s.global ? 'g' : '') + - (s.ignoreCase ? 'i' : '') + - (s.multiline ? 'm' : '') + - (s.sticky ? 'y' : '') + - (s.unicode ? 'u' : '') + - (s.dotAll ? 's' : '') + (s.ignoreCase ? 'i' : '') + + (s.multiline ? 'm' : '') + + (s.sticky ? 'y' : '') + + (s.unicode ? 'u' : '') + + (s.dotAll ? 's' : '') ) } function _arrayFromIterator(s) { @@ -39314,7 +39362,7 @@ for (o in s) !_has(o, s) || (u && 'length' === o) || (a[a.length] = o) if (Oi) for (i = Pi.length - 1; i >= 0; ) - _has((o = Pi[i]), s) && !Ri(a, o) && (a[a.length] = o), (i -= 1) + (_has((o = Pi[i]), s) && !Ri(a, o) && (a[a.length] = o), (i -= 1)) return a }) : _curry1(function keys(s) { @@ -39488,7 +39536,7 @@ ) } function _map(s, o) { - for (var i = 0, a = o.length, u = Array(a); i < a; ) (u[i] = s(o[i])), (i += 1) + for (var i = 0, a = o.length, u = Array(a); i < a; ) ((u[i] = s(o[i])), (i += 1)) return u } function _quote(s) { @@ -39539,7 +39587,7 @@ } } function _arrayReduce(s, o, i) { - for (var a = 0, u = i.length; a < u; ) (o = s(o, i[a])), (a += 1) + for (var a = 0, u = i.length; a < u; ) ((o = s(o, i[a])), (a += 1)) return o } const ca = @@ -39580,7 +39628,7 @@ } var la = (function () { function XFilter(s, o) { - ;(this.xf = o), (this.f = s) + ;((this.xf = o), (this.f = s)) } return ( (XFilter.prototype['@@transducer/init'] = _xfBase_init), @@ -39601,14 +39649,14 @@ return _isObject(o) ? _arrayReduce( function (i, a) { - return s(o[a]) && (i[a] = o[a]), i + return (s(o[a]) && (i[a] = o[a]), i) }, {}, ea(o) ) : (function _filter(s, o) { for (var i = 0, a = o.length, u = []; i < a; ) - s(o[i]) && (u[u.length] = o[i]), (i += 1) + (s(o[i]) && (u[u.length] = o[i]), (i += 1)) return u })(s, o) }) @@ -39859,12 +39907,12 @@ return function () { for (var a = [], u = 0, _ = s, w = 0, x = !1; w < o.length || u < arguments.length; ) { var C - w < o.length && (!_isPlaceholder(o[w]) || u >= arguments.length) + ;(w < o.length && (!_isPlaceholder(o[w]) || u >= arguments.length) ? (C = o[w]) : ((C = arguments[u]), (u += 1)), (a[w] = C), _isPlaceholder(C) ? (x = !0) : (_ -= 1), - (w += 1) + (w += 1)) } return !x && _ <= 0 ? i.apply(this, a) : _arity(Math.max(0, _), _curryN(s, a, i)) } @@ -39899,12 +39947,12 @@ } var Ga = (function () { function XDropLastWhile(s, o) { - ;(this.f = s), (this.retained = []), (this.xf = o) + ;((this.f = s), (this.retained = []), (this.xf = o)) } return ( (XDropLastWhile.prototype['@@transducer/init'] = _xfBase_init), (XDropLastWhile.prototype['@@transducer/result'] = function (s) { - return (this.retained = null), this.xf['@@transducer/result'](s) + return ((this.retained = null), this.xf['@@transducer/result'](s)) }), (XDropLastWhile.prototype['@@transducer/step'] = function (s, o) { return this.f(o) ? this.retain(s, o) : this.flush(s, o) @@ -39917,7 +39965,7 @@ ) }), (XDropLastWhile.prototype.retain = function (s, o) { - return this.retained.push(o), s + return (this.retained.push(o), s) }), XDropLastWhile ) @@ -39932,14 +39980,14 @@ const sc = _curry1(function flip(s) { return $a(s.length, function (o, i) { var a = Array.prototype.slice.call(arguments, 0) - return (a[0] = i), (a[1] = o), s.apply(this, a) + return ((a[0] = i), (a[1] = o), s.apply(this, a)) }) })(_curry2(_includes)) const oc = za(function (s, o) { return pipe(Ha(''), ec(sc(s)), rc(''))(o) }) function _iterableReduce(s, o, i) { - for (var a = i.next(); !a.done; ) (o = s(o, a.value)), (a = i.next()) + for (var a = i.next(); !a.done; ) ((o = s(o, a.value)), (a = i.next())) return o } function _methodReduce(s, o, i, a) { @@ -39948,7 +39996,7 @@ const ic = _createReduce(_arrayReduce, _methodReduce, _iterableReduce) var ac = (function () { function XMap(s, o) { - ;(this.xf = o), (this.f = s) + ;((this.xf = o), (this.f = s)) } return ( (XMap.prototype['@@transducer/init'] = _xfBase_init), @@ -39976,7 +40024,7 @@ case '[object Object]': return _arrayReduce( function (i, a) { - return (i[a] = s(o[a])), i + return ((i[a] = s(o[a])), i) }, {}, ea(o) @@ -40004,8 +40052,8 @@ var a = (s = s || []).length, u = o.length, _ = [] - for (i = 0; i < a; ) (_[_.length] = s[i]), (i += 1) - for (i = 0; i < u; ) (_[_.length] = o[i]), (i += 1) + for (i = 0; i < a; ) ((_[_.length] = s[i]), (i += 1)) + for (i = 0; i < u; ) ((_[_.length] = o[i]), (i += 1)) return _ })(s, cc(i, o)) }, @@ -40092,7 +40140,7 @@ throw TypeError('`'.concat(o, '` must be a string')) } const Gc = function replaceAll(s, o, i) { - !(function checkArguments(s, o, i) { + ;(!(function checkArguments(s, o, i) { if (null == i || null == s || null == o) throw TypeError('Input values must not be `null` or `undefined`') })(s, o, i), @@ -40101,7 +40149,7 @@ (function checkSearchValue(s) { if (!('string' == typeof s || s instanceof String || s instanceof RegExp)) throw TypeError('`searchValue` must be a string or an regexp') - })(s) + })(s)) var a = new RegExp(Fc(s) ? s : Hc(s), 'g') return Lc(a, o, i) } @@ -40154,7 +40202,7 @@ stripHash = (s) => { const o = s.indexOf('#') let i = s - return o >= 0 && (i = s.substring(0, o)), i + return (o >= 0 && (i = s.substring(0, o)), i) }, url_cwd = () => { if (Yo.browser) return stripHash(globalThis.location.href) @@ -40175,7 +40223,7 @@ return ((s) => { const o = [/\?/g, '%3F', /#/g, '%23'] let i = s - isWindows() && (i = i.replace(/\\/g, '/')), (i = encodeURI(i)) + ;(isWindows() && (i = i.replace(/\\/g, '/')), (i = encodeURI(i))) for (let s = 0; s < o.length; s += 2) i = i.replace(o[s], o[s + 1]) return i })(toFileSystemPath(s)) @@ -40203,10 +40251,10 @@ function legacy_defineProperties(s, o) { for (var i = 0; i < o.length; i++) { var a = o[i] - ;(a.enumerable = a.enumerable || !1), + ;((a.enumerable = a.enumerable || !1), (a.configurable = !0), 'value' in a && (a.writable = !0), - Object.defineProperty(s, a.key, a) + Object.defineProperty(s, a.key, a)) } } function _instanceof(s, o) { @@ -40237,7 +40285,7 @@ w = !0 ); } catch (s) { - ;(x = !0), (u = s) + ;((x = !0), (u = s)) } finally { try { w || null == i.return || i.return() @@ -40267,13 +40315,13 @@ function _type_of(s) { return s && 'undefined' != typeof Symbol && s.constructor === Symbol ? 'symbol' : typeof s } - void 0 === globalThis.fetch && (globalThis.fetch = yl), + ;(void 0 === globalThis.fetch && (globalThis.fetch = yl), void 0 === globalThis.Headers && (globalThis.Headers = _l), void 0 === globalThis.Request && (globalThis.Request = Sl), void 0 === globalThis.Response && (globalThis.Response = vl), void 0 === globalThis.FormData && (globalThis.FormData = El), void 0 === globalThis.File && (globalThis.File = wl), - void 0 === globalThis.Blob && (globalThis.Blob = xl) + void 0 === globalThis.Blob && (globalThis.Blob = xl)) var __typeError = function (s) { throw TypeError(s) }, @@ -40281,7 +40329,7 @@ return o.has(s) || __typeError('Cannot ' + i) }, __privateGet = function (s, o, i) { - return __accessCheck(s, o, 'read from private field'), i ? i.call(s) : o.get(s) + return (__accessCheck(s, o, 'read from private field'), i ? i.call(s) : o.get(s)) }, __privateAdd = function (s, o, i) { return o.has(s) @@ -40291,7 +40339,11 @@ : o.set(s, i) }, __privateSet = function (s, o, i, a) { - return __accessCheck(s, o, 'write to private field'), a ? a.call(s, i) : o.set(s, i), i + return ( + __accessCheck(s, o, 'write to private field'), + a ? a.call(s, i) : o.set(s, i), + i + ) }, to_string = function (s) { return Object.prototype.toString.call(s) @@ -40356,7 +40408,7 @@ i[j] = s[j] } } catch (s) { - ;(_ = !0), (w = s) + ;((_ = !0), (w = s)) } finally { try { u || null == C.return || C.return() @@ -40399,14 +40451,16 @@ isLast: !1, update: function update(s) { var o = arguments.length > 1 && void 0 !== arguments[1] && arguments[1] - B.isRoot || (B.parent.node[B.key] = s), (B.node = s), o && (L = !1) + ;(B.isRoot || (B.parent.node[B.key] = s), (B.node = s), o && (L = !1)) }, delete: function _delete(s) { - delete B.parent.node[B.key], s && (L = !1) + ;(delete B.parent.node[B.key], s && (L = !1)) }, remove: function remove(s) { - kl(B.parent.node) ? B.parent.node.splice(B.key, 1) : delete B.parent.node[B.key], - s && (L = !1) + ;(kl(B.parent.node) + ? B.parent.node.splice(B.key, 1) + : delete B.parent.node[B.key], + s && (L = !1)) }, keys: null, before: function before(s) { @@ -40431,15 +40485,15 @@ if (!_) return B function update_state() { if ('object' === _type_of(B.node) && null !== B.node) { - ;(B.keys && B.node_ === B.node) || (B.keys = w(B.node)), - (B.isLeaf = 0 === B.keys.length) + ;((B.keys && B.node_ === B.node) || (B.keys = w(B.node)), + (B.isLeaf = 0 === B.keys.length)) for (var o = 0; o < u.length; o++) if (u[o].node_ === s) { B.circular = u[o] break } - } else (B.isLeaf = !0), (B.keys = null) - ;(B.notLeaf = !B.isLeaf), (B.notRoot = !B.isRoot) + } else ((B.isLeaf = !0), (B.keys = null)) + ;((B.notLeaf = !B.isLeaf), (B.notRoot = !B.isRoot)) } update_state() var $ = o.call(B, B.node) @@ -40447,7 +40501,7 @@ return B if ('object' === _type_of(B.node) && null !== B.node && !B.circular) { var U - u.push(B), update_state() + ;(u.push(B), update_state()) var V = !0, z = !1, Y = void 0 @@ -40464,18 +40518,18 @@ ae = _sliced_to_array(Z.value, 2), ce = ae[0], le = ae[1] - a.push(le), j.pre && j.pre.call(B, B.node[le], le) + ;(a.push(le), j.pre && j.pre.call(B, B.node[le], le)) var pe = walker(B.node[le]) - x && Pl.call(B.node, le) && !is_writable(B.node, le) && (B.node[le] = pe.node), + ;(x && Pl.call(B.node, le) && !is_writable(B.node, le) && (B.node[le] = pe.node), (pe.isLast = !!(null === (ie = B.keys) || void 0 === ie ? void 0 : ie.length) && +ce == B.keys.length - 1), (pe.isFirst = 0 == +ce), j.post && j.post.call(B, pe), - a.pop() + a.pop()) } } catch (s) { - ;(z = !0), (Y = s) + ;((z = !0), (Y = s)) } finally { try { V || null == ee.return || ee.return() @@ -40485,24 +40539,26 @@ } u.pop() } - return j.after && j.after.call(B, B.node), B + return (j.after && j.after.call(B, B.node), B) })(s).node } var Ml = (function () { function Traverse(s) { var o = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Nl - !(function _class_call_check(s, o) { + ;(!(function _class_call_check(s, o) { if (!(s instanceof o)) throw new TypeError('Cannot call a class as a function') })(this, Traverse), __privateAdd(this, Il), __privateAdd(this, Tl), __privateSet(this, Il, s), - __privateSet(this, Tl, o) + __privateSet(this, Tl, o)) } return ( (function _create_class(s, o, i) { return ( - o && legacy_defineProperties(s.prototype, o), i && legacy_defineProperties(s, i), s + o && legacy_defineProperties(s.prototype, o), + i && legacy_defineProperties(s, i), + s ) })(Traverse, [ { @@ -40544,9 +40600,9 @@ a = 0 for (a = 0; a < s.length - 1; a++) { var u = s[a] - Pl.call(i, u) || (i[u] = {}), (i = i[u]) + ;(Pl.call(i, u) || (i[u] = {}), (i = i[u])) } - return (i[s[a]] = o), o + return ((i[s[a]] = o), o) }, }, { @@ -40616,7 +40672,7 @@ for (var u = 0; u < s.length; u++) if (s[u] === a) return o[u] if ('object' === (void 0 === a ? 'undefined' : _type_of(a)) && null !== a) { var _ = legacy_copy(a, i) - s.push(a), o.push(_) + ;(s.push(a), o.push(_)) var w = i.includeSymbols ? own_enumerable_keys : Object.keys, x = !0, C = !1, @@ -40631,7 +40687,7 @@ _[$] = clone(a[$]) } } catch (s) { - ;(C = !0), (j = s) + ;((C = !0), (j = s)) } finally { try { x || null == B.return || B.return() @@ -40639,7 +40695,7 @@ if (C) throw j } } - return s.pop(), o.pop(), _ + return (s.pop(), o.pop(), _) } return a })(__privateGet(this, Il)) @@ -40649,11 +40705,11 @@ Traverse ) })() - ;(Il = new WeakMap()), (Tl = new WeakMap()) + ;((Il = new WeakMap()), (Tl = new WeakMap())) var traverse = function (s, o) { return new Ml(s, o) } - ;(traverse.get = function (s, o, i) { + ;((traverse.get = function (s, o, i) { return new Ml(s, i).get(o) }), (traverse.set = function (s, o, i, a) { @@ -40679,7 +40735,7 @@ }), (traverse.clone = function (s, o) { return new Ml(s, o).clone() - }) + })) var Rl = traverse const Dl = 'application/json, application/yaml', Ll = 'https://swagger.io', @@ -40847,7 +40903,8 @@ !(function patchValueAlreadyInPath(s, o) { const i = [s] return ( - o.path.reduce((s, o) => (i.push(s[o]), s[o]), s), pointToAncestor(o.value) + o.path.reduce((s, o) => (i.push(s[o]), s[o]), s), + pointToAncestor(o.value) ) function pointToAncestor(s) { return ( @@ -40972,7 +41029,7 @@ if (isFreelyNamed(_)) return if (!Array.isArray(s)) { const s = new TypeError('allOf must be an array') - return (s.fullPath = i), s + return ((s.fullPath = i), s) } let w = !1, x = u.value @@ -40993,7 +41050,7 @@ if (w) return null w = !0 const s = new TypeError('Elements in allOf must be objects') - return (s.fullPath = i), C.push(s) + return ((s.fullPath = i), C.push(s)) } C.push(a.mergeDeep(_, s)) const u = (function generateAbsoluteRefPatches( @@ -41043,7 +41100,7 @@ o[u].default = a.parameterMacro(_, w) } catch (s) { const o = new Error(s) - return (o.fullPath = i), o + return ((o.fullPath = i), o) } } return Wo.replace(i, o) @@ -41060,7 +41117,7 @@ u[o].default = a.modelPropertyMacro(u[o]) } catch (s) { const o = new Error(s) - return (o.fullPath = i), o + return ((o.fullPath = i), o) } return Wo.replace(i, u) }, @@ -41092,7 +41149,7 @@ : s.slice(0, -1).reduce((s, i) => { if (!s) return s const { children: a } = s - return !a[i] && o && (a[i] = context_tree_createNode(null, s)), a[i] + return (!a[i] && o && (a[i] = context_tree_createNode(null, s)), a[i]) }, this.root) } } @@ -41119,7 +41176,7 @@ return s.filter(o) } constructor(s) { - Object.assign( + ;(Object.assign( this, { spec: '', @@ -41149,7 +41206,7 @@ .filter(Wo.isFunction)), this.patches.push(Wo.add([], this.spec)), this.patches.push(Wo.context([], this.context)), - this.updatePatches(this.patches) + this.updatePatches(this.patches)) } debug(s, ...o) { this.debugLevel === s && console.log(...o) @@ -41229,7 +41286,7 @@ } updatePluginHistory(s, o) { const i = this.constructor.getPluginName(s) - ;(this.pluginHistory[i] = this.pluginHistory[i] || []), this.pluginHistory[i].push(o) + ;((this.pluginHistory[i] = this.pluginHistory[i] || []), this.pluginHistory[i].push(o)) } updatePatches(s) { Wo.normalizeArray(s).forEach((s) => { @@ -41239,11 +41296,11 @@ if (!Wo.isObject(s)) return void this.debug('updatePatches', 'Got a non-object patch', s) if ((this.showDebug && this.allPatches.push(s), Wo.isPromise(s.value))) - return this.promisedPatches.push(s), void this.promisedPatchThen(s) + return (this.promisedPatches.push(s), void this.promisedPatchThen(s)) if (Wo.isContextPatch(s)) return void this.setContext(s.path, s.value) Wo.isMutation(s) && this.updateMutations(s) } catch (s) { - console.error(s), this.errors.push(s) + ;(console.error(s), this.errors.push(s)) } }) } @@ -41266,10 +41323,10 @@ (s.value = s.value .then((o) => { const i = { ...s, value: o } - this.removePromisedPatch(s), this.updatePatches(i) + ;(this.removePromisedPatch(s), this.updatePatches(i)) }) .catch((o) => { - this.removePromisedPatch(s), this.updatePatches(o) + ;(this.removePromisedPatch(s), this.updatePatches(o)) })), s.value ) @@ -41313,7 +41370,7 @@ const s = this.nextPromisedPatch() if (s) return s.then(() => this.dispatch()).catch(() => this.dispatch()) const o = { spec: this.state, errors: this.errors } - return this.showDebug && (o.patches = this.allPatches), Promise.resolve(o) + return (this.showDebug && (o.patches = this.allPatches), Promise.resolve(o)) } if ( ((s.pluginCount = s.pluginCount || new WeakMap()), @@ -41340,7 +41397,7 @@ updatePatches(o(i, s.getLib())) } } catch (s) { - console.error(s), updatePatches([Object.assign(Object.create(s), { plugin: o })]) + ;(console.error(s), updatePatches([Object.assign(Object.create(s), { plugin: o })])) } finally { s.updatePluginHistory(o, { mutationIndex: a }) } @@ -41381,7 +41438,7 @@ } class FileWithData extends File { constructor(s, o = '', i = {}) { - super([s], o, i), (this.data = s) + ;(super([s], o, i), (this.data = s)) } valueOf() { return this.data @@ -41606,7 +41663,7 @@ return s }, new FormData()) })(s.form) - ;(s.formdata = o), (s.body = o) + ;((s.formdata = o), (s.body = o)) } else s.body = encodeFormOrQuery(a) delete s.form } @@ -41615,13 +41672,13 @@ let _ = '' if (u) { const s = new URLSearchParams(u) - Object.keys(i).forEach((o) => s.delete(o)), (_ = String(s)) + ;(Object.keys(i).forEach((o) => s.delete(o)), (_ = String(s))) } const w = ((...s) => { const o = s.filter((s) => s).join('&') return o ? `?${o}` : '' })(_, encodeFormOrQuery(i)) - ;(s.url = a + w), delete s.query + ;((s.url = a + w), delete s.query) } return s } @@ -41659,7 +41716,7 @@ } return fn.load(s) })(s, u) - ;(a.body = o), (a.obj = o) + ;((a.body = o), (a.obj = o)) } catch (s) { a.parseError = s } @@ -41667,22 +41724,22 @@ }) } async function http_http(s, o = {}) { - 'object' == typeof s && (s = (o = s).url), + ;('object' == typeof s && (s = (o = s).url), (o.headers = o.headers || {}), (o = serializeRequest(o)).headers && Object.keys(o.headers).forEach((s) => { const i = o.headers[s] 'string' == typeof i && (o.headers[s] = i.replace(/\n+/g, ' ')) }), - o.requestInterceptor && (o = (await o.requestInterceptor(o)) || o) + o.requestInterceptor && (o = (await o.requestInterceptor(o)) || o)) const i = o.headers['content-type'] || o.headers['Content-Type'] let a ;/multipart\/form-data/i.test(i) && (delete o.headers['content-type'], delete o.headers['Content-Type']) try { - ;(a = await (o.userFetch || fetch)(o.url, o)), + ;((a = await (o.userFetch || fetch)(o.url, o)), (a = await serializeResponse(a, s, o)), - o.responseInterceptor && (a = (await o.responseInterceptor(a)) || a) + o.responseInterceptor && (a = (await o.responseInterceptor(a)) || a)) } catch (s) { if (!a) throw s const o = new Error(a.statusText || `response status is ${a.status}`) @@ -41690,6 +41747,12 @@ } if (!a.ok) { const s = new Error(a.statusText || `response status is ${a.status}`) + // if (a.status === 401 && a.statusText === 'Unauthorized') { + if (a.status === 401) { + location.href = + location.pathname.replace('/docs', '/') + '#/401?title=unauthorized&target=docs' + return a + } throw ((s.status = a.status), (s.statusCode = a.status), (s.response = a), s) } return a @@ -41830,13 +41893,13 @@ const s = a[x] if (s.length > 1) s.forEach((s, o) => { - ;(s.__originalOperationId = s.__originalOperationId || s.operationId), - (s.operationId = `${x}${o + 1}`) + ;((s.__originalOperationId = s.__originalOperationId || s.operationId), + (s.operationId = `${x}${o + 1}`)) }) else if (void 0 !== w.operationId) { const o = s[0] - ;(o.__originalOperationId = o.__originalOperationId || w.operationId), - (o.operationId = x) + ;((o.__originalOperationId = o.__originalOperationId || w.operationId), + (o.operationId = x)) } } if ('parameters' !== i) { @@ -41867,7 +41930,7 @@ } } } - return (o.$$normalized = !0), s + return ((o.$$normalized = !0), s) } const mu = { name: 'generic', @@ -41938,7 +42001,7 @@ } var Eu = (function () { function XAll(s, o) { - ;(this.xf = o), (this.f = s), (this.all = !0) + ;((this.xf = o), (this.f = s), (this.all = !0)) } return ( (XAll.prototype['@@transducer/init'] = _xfBase_init), @@ -41974,7 +42037,7 @@ const xu = wu class Annotation extends Su.Om { constructor(s, o, i) { - super(s, o, i), (this.element = 'annotation') + ;(super(s, o, i), (this.element = 'annotation')) } get code() { return this.attributes.get('code') @@ -41986,13 +42049,13 @@ const ku = Annotation class Comment extends Su.Om { constructor(s, o, i) { - super(s, o, i), (this.element = 'comment') + ;(super(s, o, i), (this.element = 'comment')) } } const Ou = Comment class ParseResult extends Su.wE { constructor(s, o, i) { - super(s, o, i), (this.element = 'parseResult') + ;(super(s, o, i), (this.element = 'parseResult')) } get api() { return this.children.filter((s) => s.classes.contains('api')).first @@ -42192,7 +42255,7 @@ const Z = { ...V, replaceWith(s, o) { - V.replaceWith(s, o), (z = s) + ;(V.replaceWith(s, o), (z = s)) }, } for (let j = 0; j < s.length; j += 1) @@ -42211,7 +42274,7 @@ if (o === u) return o if (void 0 !== o) { if (!w) return o - ;(z = o), (Y = !0) + ;((z = o), (Y = !0)) } } } @@ -42223,7 +42286,7 @@ const V = { ...$, replaceWith(s, o) { - $.replaceWith(s, o), (U = s) + ;($.replaceWith(s, o), (U = s)) }, } for (let u = 0; u < s.length; u += 1) @@ -42263,7 +42326,7 @@ const Z = { ...V, replaceWith(s, o) { - V.replaceWith(s, o), (z = s) + ;(V.replaceWith(s, o), (z = s)) }, } for (let j = 0; j < s.length; j += 1) @@ -42277,7 +42340,7 @@ if (o === u) return o if (void 0 !== o) { if (!w) return o - ;(z = o), (Y = !0) + ;((z = o), (Y = !0)) } } } @@ -42289,7 +42352,7 @@ const V = { ...$, replaceWith(s, o) { - $.replaceWith(s, o), (U = s) + ;($.replaceWith(s, o), (U = s)) }, } for (let u = 0; u < s.length; u += 1) @@ -42349,7 +42412,7 @@ ae = L(ae) for (const [s, o] of ie) ae[s] = o } - ;(ee = V.index), (Z = V.keys), (ie = V.edits), (Y = V.inArray), (V = V.prev) + ;((ee = V.index), (Z = V.keys), (ie = V.edits), (Y = V.inArray), (V = V.prev)) } else if (z !== _ && void 0 !== z) { if (((i = Y ? ee : Z[ee]), (ae = z[i]), ae === _ || void 0 === ae)) continue ce.push(i) @@ -42359,7 +42422,7 @@ var pe if (!j(ae)) throw new Go(`Invalid AST Node: ${String(ae)}`, { node: ae }) if (B && le.includes(ae)) { - 'function' == typeof $ && $(ae, i, z, ce, le), ce.pop() + ;('function' == typeof $ && $(ae, i, z, ce, le), ce.pop()) continue } const _ = x(o, C(ae), s) @@ -42367,7 +42430,8 @@ for (const [s, i] of Object.entries(a)) o[s] = i const u = { replaceWith(o, a) { - 'function' == typeof a ? a(o, ae, i, z, ce, le) : z && (z[i] = o), s || (ae = o) + ;('function' == typeof a ? a(o, ae, i, z, ce, le) : z && (z[i] = o), + s || (ae = o)) }, } ye = _.call(o, ae, i, z, ce, le, u) @@ -42390,13 +42454,13 @@ } var de if ((void 0 === ye && fe && ie.push([i, ae]), !s)) - (V = { inArray: Y, index: ee, keys: Z, edits: ie, prev: V }), + ((V = { inArray: Y, index: ee, keys: Z, edits: ie, prev: V }), (Y = Array.isArray(ae)), (Z = Y ? ae : null !== (de = U[C(ae)]) && void 0 !== de ? de : []), (ee = -1), (ie = []), z !== _ && void 0 !== z && le.push(z), - (z = ae) + (z = ae)) } while (void 0 !== V) return 0 !== ie.length ? ie[ie.length - 1][1] : s } @@ -42445,7 +42509,7 @@ ae = L(ae) for (const [s, o] of ie) ae[s] = o } - ;(ee = V.index), (Z = V.keys), (ie = V.edits), (Y = V.inArray), (V = V.prev) + ;((ee = V.index), (Z = V.keys), (ie = V.edits), (Y = V.inArray), (V = V.prev)) } else if (z !== _ && void 0 !== z) { if (((i = Y ? ee : Z[ee]), (ae = z[i]), ae === _ || void 0 === ae)) continue ce.push(i) @@ -42454,7 +42518,7 @@ if (!Array.isArray(ae)) { if (!j(ae)) throw new Go(`Invalid AST Node: ${String(ae)}`, { node: ae }) if (B && le.includes(ae)) { - 'function' == typeof $ && $(ae, i, z, ce, le), ce.pop() + ;('function' == typeof $ && $(ae, i, z, ce, le), ce.pop()) continue } const _ = x(o, C(ae), s) @@ -42462,7 +42526,8 @@ for (const [s, i] of Object.entries(a)) o[s] = i const u = { replaceWith(o, a) { - 'function' == typeof a ? a(o, ae, i, z, ce, le) : z && (z[i] = o), s || (ae = o) + ;('function' == typeof a ? a(o, ae, i, z, ce, le) : z && (z[i] = o), + s || (ae = o)) }, } fe = await _.call(o, ae, i, z, ce, le, u) @@ -42483,20 +42548,20 @@ } var pe if ((void 0 === fe && de && ie.push([i, ae]), !s)) - (V = { inArray: Y, index: ee, keys: Z, edits: ie, prev: V }), + ((V = { inArray: Y, index: ee, keys: Z, edits: ie, prev: V }), (Y = Array.isArray(ae)), (Z = Y ? ae : null !== (pe = U[C(ae)]) && void 0 !== pe ? pe : []), (ee = -1), (ie = []), z !== _ && void 0 !== z && le.push(z), - (z = ae) + (z = ae)) } while (void 0 !== V) return 0 !== ie.length ? ie[ie.length - 1][1] : s } const Uu = class CloneError extends Go { value constructor(s, o) { - super(s, o), void 0 !== o && (this.value = o.value) + ;(super(s, o), void 0 !== o && (this.value = o.value)) } } const Vu = class DeepCloneError extends Uu {} @@ -42504,7 +42569,7 @@ const Wu = _curry2(function mapObjIndexed(s, o) { return _arrayReduce( function (i, a) { - return (i[a] = s(o[a], a, o)), i + return ((i[a] = s(o[a], a, o)), i) }, {}, ea(o) @@ -42517,7 +42582,7 @@ if (0 === s.length || Ju(o)) return !1 for (var i = o, a = 0; a < s.length; ) { if (Ju(i) || !_has(s[a], i)) return !1 - ;(i = i[s[a]]), (a += 1) + ;((i = i[s[a]]), (a += 1)) } return !0 }) @@ -42532,7 +42597,7 @@ const Qu = _curry2(_path) var Zu = (function () { function XDropWhile(s, o) { - ;(this.xf = o), (this.f = s) + ;((this.xf = o), (this.f = s)) } return ( (XDropWhile.prototype['@@transducer/init'] = _xfBase_init), @@ -42590,19 +42655,19 @@ _ = Cu(o) ? cloneDeep(o, a) : o, w = Cu(u) ? cloneDeep(u, a) : u, x = new Su.KeyValuePair(_, w) - return i.set(s, x), x + return (i.set(s, x), x) } if (s instanceof Su.ot) { const mapper = (s) => cloneDeep(s, a), o = [...s].map(mapper), u = new Su.ot(o) - return i.set(s, u), u + return (i.set(s, u), u) } if (s instanceof Su.G6) { const mapper = (s) => cloneDeep(s, a), o = [...s].map(mapper), u = new Su.G6(o) - return i.set(s, u), u + return (i.set(s, u), u) } if (Cu(s)) { const o = cloneShallow(s) @@ -42712,10 +42777,10 @@ returnOnTrue returnOnFalse constructor({ predicate: s = es_F, returnOnTrue: o, returnOnFalse: i } = {}) { - ;(this.result = []), + ;((this.result = []), (this.predicate = s), (this.returnOnTrue = o), - (this.returnOnFalse = i) + (this.returnOnFalse = i)) } enter(s) { return this.predicate(s) ? (this.result.push(s), this.returnOnTrue) : this.returnOnFalse @@ -42772,13 +42837,13 @@ content = [] reference = void 0 constructor(s) { - ;(this.content = s), (this.reference = []) + ;((this.content = s), (this.reference = [])) } toReference() { return this.reference } toArray() { - return this.reference.push(...this.content), this.reference + return (this.reference.push(...this.content), this.reference) } } const ip = class EphemeralObject { @@ -42786,7 +42851,7 @@ content = [] reference = void 0 constructor(s) { - ;(this.content = s), (this.reference = {}) + ;((this.content = s), (this.reference = {})) } toReference() { return this.reference @@ -42800,7 +42865,7 @@ enter: (s) => { if (this.references.has(s)) return this.references.get(s).toReference() const o = new ip(s.content) - return this.references.set(s, o), o + return (this.references.set(s, o), o) }, } EphemeralObject = { leave: (s) => s.toObject() } @@ -42809,7 +42874,7 @@ enter: (s) => { if (this.references.has(s)) return this.references.get(s).toReference() const o = new op(s.content) - return this.references.set(s, o), o + return (this.references.set(s, o), o) }, } EphemeralArray = { leave: (s) => s.toArray() } @@ -42932,16 +42997,16 @@ const _p = bp class Namespace extends Su.g$ { constructor() { - super(), + ;(super(), this.register('annotation', ku), this.register('comment', Ou), - this.register('parseResult', Au) + this.register('parseResult', Au)) } } const Sp = new Namespace(), createNamespace = (s) => { const o = new Namespace() - return fu(s) && o.use(s), o + return (fu(s) && o.use(s), o) }, Ep = Sp, toolbox = () => ({ predicates: { ...ie }, namespace: Ep }), @@ -42958,7 +43023,7 @@ C = mergeAll(x.map(La({}, 'visitor')), { ..._ }) x.forEach(_p(['pre'], [])) const j = visitor_visit(s, C, _) - return x.forEach(_p(['post'], [])), j + return (x.forEach(_p(['post'], [])), j) } dispatchPluginsSync[Symbol.for('nodejs.util.promisify.custom')] = async (s, o, i = {}) => { if (0 === o.length) return s @@ -42971,7 +43036,7 @@ L = C(x.map(La({}, 'visitor')), { ..._ }) await Promise.allSettled(x.map(_p(['pre'], []))) const B = await j(s, L, _) - return await Promise.allSettled(x.map(_p(['post'], []))), B + return (await Promise.allSettled(x.map(_p(['post'], []))), B) } const refract = (s, { Type: o, plugins: i = [] }) => { const a = new o(s) @@ -42989,7 +43054,7 @@ (s) => (o, i = {}) => refract(o, { ...i, Type: s }) - ;(Su.Sh.refract = createRefractor(Su.Sh)), + ;((Su.Sh.refract = createRefractor(Su.Sh)), (Su.wE.refract = createRefractor(Su.wE)), (Su.Om.refract = createRefractor(Su.Om)), (Su.bd.refract = createRefractor(Su.bd)), @@ -42999,12 +43064,12 @@ (Su.sI.refract = createRefractor(Su.sI)), (ku.refract = createRefractor(ku)), (Ou.refract = createRefractor(Ou)), - (Au.refract = createRefractor(Au)) + (Au.refract = createRefractor(Au))) const computeEdges = (s, o = new WeakMap()) => ( Ru(s) ? (o.set(s.key, s), computeEdges(s.key, o), o.set(s.value, s), computeEdges(s.value, o)) : s.children.forEach((i) => { - o.set(i, s), computeEdges(i, o) + ;(o.set(i, s), computeEdges(i, o)) }), o ) @@ -43065,7 +43130,7 @@ o = jp, i = this, a = 'parser.js: Parser(): ' - ;(i.ast = void 0), (i.stats = void 0), (i.trace = void 0), (i.callbacks = []) + ;((i.ast = void 0), (i.stats = void 0), (i.trace = void 0), (i.callbacks = [])) let u, _, w, @@ -43079,15 +43144,15 @@ V = 0, z = 0, Y = new (function systemData() { - ;(this.state = s.ACTIVE), + ;((this.state = s.ACTIVE), (this.phraseLength = 0), (this.refresh = () => { - ;(this.state = s.ACTIVE), (this.phraseLength = 0) - }) + ;((this.state = s.ACTIVE), (this.phraseLength = 0)) + })) })() i.parse = (Z, ee, ie, ae) => { const ce = `${a}parse(): ` - ;(B = 0), + ;((B = 0), ($ = 0), (U = 0), (V = 0), @@ -43102,7 +43167,7 @@ (L = void 0), (x = o.stringToChars(ie)), (u = Z.rules), - (_ = Z.udts) + (_ = Z.udts)) const le = ee.toLowerCase() let pe for (const s in u) @@ -43112,7 +43177,7 @@ } if (void 0 === pe) throw new Error(`${ce}start rule name '${startRule}' not recognized`) - ;(() => { + ;((() => { const s = `${a}initializeCallbacks(): ` let o, w for (C = [], j = [], o = 0; o < u.length; o += 1) C[o] = void 0 @@ -43140,7 +43205,7 @@ (L = ae), (w = [{ type: s.RNM, index: pe }]), opExecute(0, 0), - (w = void 0) + (w = void 0)) let de = !1 switch (Y.state) { case s.ACTIVE: @@ -43170,9 +43235,9 @@ if (i.phraseLength > u) { let s = `${a}opRNM(${o.name}): callback function error: ` throw ( - ((s += `sysData.phraseLength: ${i.phraseLength}`), + (s += `sysData.phraseLength: ${i.phraseLength}`), (s += ` must be <= remaining chars: ${u}`), - new Error(s)) + new Error(s) ) } switch (i.state) { @@ -43201,19 +43266,20 @@ let $, U, V const z = w[o], Z = _[z.index] - ;(Y.UdtIndex = Z.index), + ;((Y.UdtIndex = Z.index), B || ((V = i.ast && i.ast.udtDefined(z.index)), - V && ((U = u.length + z.index), ($ = i.ast.getLength()), i.ast.down(U, Z.name))) + V && + ((U = u.length + z.index), ($ = i.ast.getLength()), i.ast.down(U, Z.name)))) const ee = x.length - C - j[z.index](Y, x, C, L), + ;(j[z.index](Y, x, C, L), ((o, i, u) => { if (i.phraseLength > u) { let s = `${a}opUDT(${o.name}): callback function error: ` throw ( - ((s += `sysData.phraseLength: ${i.phraseLength}`), + (s += `sysData.phraseLength: ${i.phraseLength}`), (s += ` must be <= remaining chars: ${u}`), - new Error(s)) + new Error(s) ) } switch (i.state) { @@ -43243,7 +43309,7 @@ (V && (Y.state === s.NOMATCH ? i.ast.setLength($) - : i.ast.up(U, Z.name, C, Y.phraseLength))) + : i.ast.up(U, Z.name, C, Y.phraseLength)))) }, opExecute = (o, _) => { const j = `${a}opExecute(): `, @@ -43271,13 +43337,13 @@ ;((o, a) => { let u, _, x, C const j = w[o] - i.ast && (_ = i.ast.getLength()), (u = !0), (x = a), (C = 0) + ;(i.ast && (_ = i.ast.getLength()), (u = !0), (x = a), (C = 0)) for (let o = 0; o < j.children.length; o += 1) { if ((opExecute(j.children[o], x), Y.state === s.NOMATCH)) { u = !1 break } - ;(x += Y.phraseLength), (C += Y.phraseLength) + ;((x += Y.phraseLength), (C += Y.phraseLength)) } u ? ((Y.state = 0 === C ? s.EMPTY : s.MATCH), (Y.phraseLength = C)) @@ -43288,14 +43354,13 @@ ;((o, a) => { let u, _, C, j const L = w[o] - if (0 === L.max) return (Y.state = s.EMPTY), void (Y.phraseLength = 0) + if (0 === L.max) return ((Y.state = s.EMPTY), void (Y.phraseLength = 0)) for ( _ = a, C = 0, j = 0, i.ast && (u = i.ast.getLength()); !(_ >= x.length) && (opExecute(o + 1, _), Y.state !== s.NOMATCH) && Y.state !== s.EMPTY && ((j += 1), (C += Y.phraseLength), (_ += Y.phraseLength), j !== L.max); - ); Y.state === s.EMPTY || j >= L.min ? ((Y.state = 0 === C ? s.EMPTY : s.MATCH), (Y.phraseLength = C)) @@ -43315,7 +43380,7 @@ z) ) { const o = x.length - a - z(Y, x, a, L), + ;(z(Y, x, a, L), validateRnmCallbackResult(V, Y, o, !0), Y.state === s.ACTIVE && (($ = w), @@ -43323,8 +43388,8 @@ opExecute(0, a), (w = $), z(Y, x, a, L), - validateRnmCallbackResult(V, Y, o, !1)) - } else ($ = w), (w = V.opcodes), opExecute(0, a, Y), (w = $) + validateRnmCallbackResult(V, Y, o, !1))) + } else (($ = w), (w = V.opcodes), opExecute(0, a, Y), (w = $)) B || (j && (Y.state === s.NOMATCH @@ -43335,11 +43400,11 @@ case s.TRG: ;((o, i) => { const a = w[o] - ;(Y.state = s.NOMATCH), + ;((Y.state = s.NOMATCH), i < x.length && a.min <= x[i] && x[i] <= a.max && - ((Y.state = s.MATCH), (Y.phraseLength = 1)) + ((Y.state = s.MATCH), (Y.phraseLength = 1))) })(o, _) break case s.TBS: @@ -43348,7 +43413,7 @@ u = a.string.length if (((Y.state = s.NOMATCH), i + u <= x.length)) { for (let s = 0; s < u; s += 1) if (x[i + s] !== a.string[s]) return - ;(Y.state = s.MATCH), (Y.phraseLength = u) + ;((Y.state = s.MATCH), (Y.phraseLength = u)) } })(o, _) break @@ -43365,7 +43430,7 @@ ((a = x[i + s]), a >= 65 && a <= 90 && (a += 32), a !== u.string[s]) ) return - ;(Y.state = s.MATCH), (Y.phraseLength = _) + ;((Y.state = s.MATCH), (Y.phraseLength = _)) } } else Y.state = s.EMPTY })(o, _) @@ -43410,10 +43475,10 @@ default: throw new Error(`${j}unrecognized operator`) } - B || (_ + Y.phraseLength > z && (z = _ + Y.phraseLength)), + ;(B || (_ + Y.phraseLength > z && (z = _ + Y.phraseLength)), i.stats && i.stats.collect(Z, Y), i.trace && i.trace.up(Z, Y.state, _, Y.phraseLength), - ($ -= 1) + ($ -= 1)) } }, Op = function fnast() { @@ -43432,10 +43497,10 @@ for (; s-- > 0; ) o += ' ' return o } - ;(i.callbacks = []), + ;((i.callbacks = []), (i.init = (s, o, L) => { let B - ;(C.length = 0), (j.length = 0), (w = 0), (a = s), (u = o), (_ = L) + ;((C.length = 0), (j.length = 0), (w = 0), (a = s), (u = o), (_ = L)) const $ = [] for (B = 0; B < a.length; B += 1) $.push(a[B].lower) for (B = 0; B < u.length; B += 1) $.push(u[B].lower) @@ -43490,15 +43555,15 @@ (i.translate = (o) => { let i, a for (let u = 0; u < j.length; u += 1) - (a = j[u]), + ((a = j[u]), (i = x[a.callbackIndex]), i && (a.state === s.SEM_PRE ? i(s.SEM_PRE, _, a.phraseIndex, a.phraseLength, o) - : i && i(s.SEM_POST, _, a.phraseIndex, a.phraseLength, o)) + : i && i(s.SEM_POST, _, a.phraseIndex, a.phraseLength, o))) }), (i.setLength = (s) => { - ;(j.length = s), (C.length = s > 0 ? j[s - 1].stack : 0) + ;((j.length = s), (C.length = s > 0 ? j[s - 1].stack : 0)) }), (i.getLength = () => j.length), (i.toXml = () => { @@ -43526,7 +43591,7 @@ (i += '\n'), i ) - }) + })) }, Ap = function fntrace() { const s = Pp, @@ -43541,11 +43606,11 @@ indent = (s) => { let o = '', i = 0 - if (s >= 0) for (; s--; ) (i += 1), 5 === i ? ((o += '|'), (i = 0)) : (o += '.') + if (s >= 0) for (; s--; ) ((i += 1), 5 === i ? ((o += '|'), (i = 0)) : (o += '.')) return o } C.init = (s, o, i) => { - ;(u = s), (_ = o), (a = i) + ;((u = s), (_ = o), (a = i)) } const opName = (a) => { let w @@ -43591,14 +43656,14 @@ } return w } - ;(C.down = (s, i) => { + ;((C.down = (s, i) => { const u = indent(x), _ = Math.min(100, a.length - i) let C = o.charsToString(a, i, _) - _ < a.length - i && (C += '...'), + ;(_ < a.length - i && (C += '...'), (C = `${u}|-|[${opName(s)}]${C}\n`), (w += C), - (x += 1) + (x += 1)) }), (C.up = (u, _, C, j) => { const L = `${i}trace.up: ` @@ -43607,25 +43672,25 @@ let $, U, V switch (_) { case s.EMPTY: - ;(V = '|E|'), (U = "''") + ;((V = '|E|'), (U = "''")) break case s.MATCH: - ;(V = '|M|'), + ;((V = '|M|'), ($ = Math.min(100, j)), (U = $ < j ? `'${o.charsToString(a, C, $)}...'` - : `'${o.charsToString(a, C, $)}'`) + : `'${o.charsToString(a, C, $)}'`)) break case s.NOMATCH: - ;(V = '|N|'), (U = '') + ;((V = '|N|'), (U = '')) break default: throw new Error(`${L} unrecognized state`) } - ;(U = `${B}${V}[${opName(u)}]${U}\n`), (w += U) + ;((U = `${B}${V}[${opName(u)}]${U}\n`), (w += U)) }), - (C.displayTrace = () => w) + (C.displayTrace = () => w)) }, Cp = function fnstats() { const s = Pp @@ -43633,20 +43698,20 @@ const u = [], _ = [], w = [] - ;(this.init = (s, a) => { - ;(o = s), (i = a), clear() + ;((this.init = (s, a) => { + ;((o = s), (i = a), clear()) }), (this.collect = (o, i) => { - incStat(a, i.state, i.phraseLength), + ;(incStat(a, i.state, i.phraseLength), incStat(u[o.type], i.state, i.phraseLength), o.type === s.RNM && incStat(_[o.index], i.state, i.phraseLength), - o.type === s.UDT && incStat(w[o.index], i.state, i.phraseLength) + o.type === s.UDT && incStat(w[o.index], i.state, i.phraseLength)) }), (this.displayStats = () => { let o = '' const i = { match: 0, empty: 0, nomatch: 0, total: 0 }, displayRow = (s, o, a, u, _) => { - ;(i.match += o), (i.empty += a), (i.nomatch += u), (i.total += _) + ;((i.match += o), (i.empty += a), (i.nomatch += u), (i.total += _)) return `${s} | ${normalize(o)} | ${normalize(a)} | ${normalize(u)} | ${normalize(_)} |\n` } return ( @@ -43729,15 +43794,15 @@ (this.displayHits = (s) => { let o = '' const displayRow = (s, o, i, u, _) => { - ;(a.match += s), (a.empty += o), (a.nomatch += i), (a.total += u) + ;((a.match += s), (a.empty += o), (a.nomatch += i), (a.total += u)) return `| ${normalize(s)} | ${normalize(o)} | ${normalize(i)} | ${normalize(u)} | ${_}\n` } - 'string' == typeof s && 'a' === s.toLowerCase()[0] + ;('string' == typeof s && 'a' === s.toLowerCase()[0] ? (_.sort(sortAlpha), w.sort(sortAlpha), (o += ' RULES/UDTS ALPHABETICALLY\n')) : 'string' == typeof s && 'i' === s.toLowerCase()[0] ? (_.sort(sortIndex), w.sort(sortIndex), (o += ' RULES/UDTS BY INDEX\n')) : (_.sort(sortHits), w.sort(sortHits), (o += ' RULES/UDTS BY HIT COUNT\n')), - (o += '| MATCH | EMPTY | NOMATCH | TOTAL | NAME\n') + (o += '| MATCH | EMPTY | NOMATCH | TOTAL | NAME\n')) for (let s = 0; s < _.length; s += 1) { let i = _[s] i.total && (o += displayRow(i.match, i.empty, i.nomatch, i.total, i.name)) @@ -43747,7 +43812,7 @@ i.total && (o += displayRow(i.match, i.empty, i.nomatch, i.total, i.name)) } return o - }) + })) const normalize = (s) => s < 10 ? ` ${s}` @@ -43767,10 +43832,10 @@ s.total < o.total ? 1 : s.total > o.total ? -1 : sortAlpha(s, o), sortIndex = (s, o) => (s.index < o.index ? -1 : s.index > o.index ? 1 : 0), x = function fnempty() { - ;(this.empty = 0), (this.match = 0), (this.nomatch = 0), (this.total = 0) + ;((this.empty = 0), (this.match = 0), (this.nomatch = 0), (this.total = 0)) }, clear = () => { - ;(u.length = 0), + ;((u.length = 0), (a = new x()), (u[s.ALT] = new x()), (u[s.CAT] = new x()), @@ -43782,7 +43847,7 @@ (u[s.UDT] = new x()), (u[s.AND] = new x()), (u[s.NOT] = new x()), - (_.length = 0) + (_.length = 0)) for (let s = 0; s < o.length; s += 1) _.push({ empty: 0, @@ -43901,7 +43966,7 @@ }, } function grammar() { - ;(this.grammarObject = 'grammarObject'), + ;((this.grammarObject = 'grammarObject'), (this.rules = []), (this.rules[0] = { name: 'json-pointer', lower: 'json-pointer', index: 0, isBkr: !1 }), (this.rules[1] = { @@ -43982,7 +44047,7 @@ (s += 'slash = "/"\n'), '; JavaScript Object Notation (JSON) Pointer ABNF syntax\n; https://datatracker.ietf.org/doc/html/rfc6901\njson-pointer = *( slash reference-token ) ; MODIFICATION: surrogate text rule used\nreference-token = *( unescaped / escaped )\nunescaped = %x00-2E / %x30-7D / %x7F-10FFFF\n ; %x2F (\'/\') and %x7E (\'~\') are excluded from \'unescaped\'\nescaped = "~" ( "0" / "1" )\n ; representing \'~\' and \'/\', respectively\n\n; https://datatracker.ietf.org/doc/html/rfc6901#section-4\narray-location = array-index / array-dash\narray-index = %x30 / ( %x31-39 *(%x30-39) )\n ; "0", or digits without a leading "0"\narray-dash = "-"\n\n; Surrogate named rules\nslash = "/"\n' ) - }) + })) } class JSONPointerError extends Error { constructor(s, o = void 0) { @@ -43999,10 +44064,10 @@ !('cause' in this)) ) { const { cause: s } = o - ;(this.cause = s), + ;((this.cause = s), s instanceof Error && 'stack' in s && - (this.stack = `${this.stack}\nCAUSE: ${s.stack}`) + (this.stack = `${this.stack}\nCAUSE: ${s.stack}`)) } if (null != o && 'object' == typeof o) { const { cause: s, ...i } = o @@ -44032,14 +44097,14 @@ } const Np = class CSTTranslator_CSTTranslator extends Op { constructor() { - super(), + ;(super(), (this.callbacks['json-pointer'] = callbacks_cst('json-pointer')), (this.callbacks['reference-token'] = callbacks_cst('reference-token')), - (this.callbacks.slash = callbacks_cst('text')) + (this.callbacks.slash = callbacks_cst('text'))) } getTree() { const s = { stack: [], root: null } - return this.translate(s), delete s.stack, s + return (this.translate(s), delete s.stack, s) } }, es_unescape = (s) => { @@ -44083,7 +44148,7 @@ if ('string' != typeof s) throw new TypeError('JSON Pointer must be a string') try { const u = new kp() - o && (u.ast = o), i && (u.stats = new Cp()), a && (u.trace = new Dp()) + ;(o && (u.ast = o), i && (u.stats = new Cp()), a && (u.trace = new Dp())) const _ = u.parse(Lp, 'json-pointer', s) return { result: _, @@ -44098,7 +44163,7 @@ }) } } - new grammar(), new kp(), new grammar(), new kp() + ;(new grammar(), new kp(), new grammar(), new kp()) const Fp = new grammar(), Bp = new kp(), array_index = (s) => { @@ -44150,14 +44215,14 @@ #t #r constructor(s, o = {}) { - ;(this.#e = s), + ;((this.#e = s), (this.#e.steps = []), (this.#e.failed = !1), (this.#e.failedAt = -1), (this.#e.message = `JSON Pointer "${o.jsonPointer}" was successfully evaluated against the provided value`), (this.#e.context = { ...o, realm: o.realm.name }), (this.#t = []), - (this.#r = o.realm) + (this.#r = o.realm)) } step({ referenceToken: s, input: o, output: i, success: a = !0, reason: u }) { const _ = this.#t.length @@ -44174,9 +44239,9 @@ output: i, success: a, } - u && (w.reason = u), + ;(u && (w.reason = u), this.#e.steps.push(w), - a || ((this.#e.failed = !0), (this.#e.failedAt = _), (this.#e.message = u)) + a || ((this.#e.failed = !0), (this.#e.failedAt = _), (this.#e.message = u))) } } const zp = class EvaluationRealm { @@ -44251,8 +44316,8 @@ if (!w.success) { let i = `Invalid JSON Pointer: "${o}". Syntax error at position ${w.maxMatched}` throw ( - ((i += C ? `, expected ${C.inferExpectations()}` : ''), - new Wp(i, { jsonPointer: o, currentValue: s, realm: u.name })) + (i += C ? `, expected ${C.inferExpectations()}` : ''), + new Wp(i, { jsonPointer: o, currentValue: s, realm: u.name }) ) } return x.reduce((s, w, C) => { @@ -44410,13 +44475,13 @@ apidom_evaluate = (s, o, i = {}) => es_evaluate(s, o, { ...i, realm: new Yp() }) class Callback extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'callback') + ;(super(s, o, i), (this.element = 'callback')) } } const Xp = Callback class Components extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'components') + ;(super(s, o, i), (this.element = 'components')) } get schemas() { return this.get('schemas') @@ -44476,7 +44541,7 @@ const Qp = Components class Contact extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'contact') + ;(super(s, o, i), (this.element = 'contact')) } get name() { return this.get('name') @@ -44500,7 +44565,7 @@ const Zp = Contact class Discriminator extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'discriminator') + ;(super(s, o, i), (this.element = 'discriminator')) } get propertyName() { return this.get('propertyName') @@ -44518,7 +44583,7 @@ const th = Discriminator class Encoding extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'encoding') + ;(super(s, o, i), (this.element = 'encoding')) } get contentType() { return this.get('contentType') @@ -44554,7 +44619,7 @@ const rh = Encoding class Example extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'example') + ;(super(s, o, i), (this.element = 'example')) } get summary() { return this.get('summary') @@ -44584,7 +44649,7 @@ const uh = Example class ExternalDocumentation extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'externalDocumentation') + ;(super(s, o, i), (this.element = 'externalDocumentation')) } get description() { return this.get('description') @@ -44602,7 +44667,7 @@ const dh = ExternalDocumentation class Header extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'header') + ;(super(s, o, i), (this.element = 'header')) } get required() { return this.hasKey('required') ? this.get('required') : new Su.bd(!1) @@ -44677,7 +44742,7 @@ const fh = Header class Info extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'info'), this.classes.push('info') + ;(super(s, o, i), (this.element = 'info'), this.classes.push('info')) } get title() { return this.get('title') @@ -44719,7 +44784,7 @@ const vh = Info class License extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'license') + ;(super(s, o, i), (this.element = 'license')) } get name() { return this.get('name') @@ -44737,7 +44802,7 @@ const _h = License class Link extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'link') + ;(super(s, o, i), (this.element = 'link')) } get operationRef() { return this.get('operationRef') @@ -44794,7 +44859,7 @@ const wh = Link class MediaType extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'mediaType') + ;(super(s, o, i), (this.element = 'mediaType')) } get schema() { return this.get('schema') @@ -44824,7 +44889,7 @@ const Oh = MediaType class OAuthFlow extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'oAuthFlow') + ;(super(s, o, i), (this.element = 'oAuthFlow')) } get authorizationUrl() { return this.get('authorizationUrl') @@ -44854,7 +44919,7 @@ const jh = OAuthFlow class OAuthFlows extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'oAuthFlows') + ;(super(s, o, i), (this.element = 'oAuthFlows')) } get implicit() { return this.get('implicit') @@ -44884,16 +44949,16 @@ const Ph = OAuthFlows class Openapi extends Su.Om { constructor(s, o, i) { - super(s, o, i), + ;(super(s, o, i), (this.element = 'openapi'), this.classes.push('spec-version'), - this.classes.push('version') + this.classes.push('version')) } } const Ih = Openapi class OpenApi3_0 extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'openApi3_0'), this.classes.push('api') + ;(super(s, o, i), (this.element = 'openApi3_0'), this.classes.push('api')) } get openapi() { return this.get('openapi') @@ -44947,7 +45012,7 @@ const Rh = OpenApi3_0 class Operation extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'operation') + ;(super(s, o, i), (this.element = 'operation')) } get tags() { return this.get('tags') @@ -45025,7 +45090,7 @@ const Dh = Operation class Parameter extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'parameter') + ;(super(s, o, i), (this.element = 'parameter')) } get name() { return this.get('name') @@ -45112,7 +45177,7 @@ const Lh = Parameter class PathItem extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'pathItem') + ;(super(s, o, i), (this.element = 'pathItem')) } get $ref() { return this.get('$ref') @@ -45196,13 +45261,13 @@ const Fh = PathItem class Paths extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'paths') + ;(super(s, o, i), (this.element = 'paths')) } } const Jh = Paths class Reference extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'reference'), this.classes.push('openapi-reference') + ;(super(s, o, i), (this.element = 'reference'), this.classes.push('openapi-reference')) } get $ref() { return this.get('$ref') @@ -45214,7 +45279,7 @@ const Hh = Reference class RequestBody extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'requestBody') + ;(super(s, o, i), (this.element = 'requestBody')) } get description() { return this.get('description') @@ -45238,7 +45303,7 @@ const Kh = RequestBody class Response_Response extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'response') + ;(super(s, o, i), (this.element = 'response')) } get description() { return this.get('description') @@ -45268,7 +45333,7 @@ const Gh = Response_Response class Responses extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'responses') + ;(super(s, o, i), (this.element = 'responses')) } get default() { return this.get('default') @@ -45281,7 +45346,7 @@ const td = class UnsupportedOperationError extends Ko {} class JSONSchema extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'JSONSchemaDraft4') + ;(super(s, o, i), (this.element = 'JSONSchemaDraft4')) } get idProp() { return this.get('id') @@ -45509,7 +45574,7 @@ const sd = JSONSchema class JSONReference extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'JSONReference'), this.classes.push('json-reference') + ;(super(s, o, i), (this.element = 'JSONReference'), this.classes.push('json-reference')) } get $ref() { return this.get('$ref') @@ -45521,7 +45586,7 @@ const id = JSONReference class Media extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'media') + ;(super(s, o, i), (this.element = 'media')) } get binaryEncoding() { return this.get('binaryEncoding') @@ -45539,7 +45604,7 @@ const cd = Media class LinkDescription extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'linkDescription') + ;(super(s, o, i), (this.element = 'linkDescription')) } get href() { return this.get('href') @@ -45609,21 +45674,21 @@ Nu(s) && s.forEach((s, o, u) => { const _ = cloneShallow(u) - ;(_.value = cloneUnlessOtherwiseSpecified(s, i)), a.content.push(_) + ;((_.value = cloneUnlessOtherwiseSpecified(s, i)), a.content.push(_)) }), o.forEach((o, u, _) => { const w = serializers_value(u) let x if (Nu(s) && s.hasKey(w) && i.isMergeableElement(o)) { const a = s.get(w) - ;(x = cloneShallow(_)), + ;((x = cloneShallow(_)), (x.value = ((s, o) => { if ('function' != typeof o.customMerge) return deepmerge const i = o.customMerge(s, o) return 'function' == typeof i ? i : deepmerge - })(u, i)(a, o, i)) - } else (x = cloneShallow(_)), (x.value = cloneUnlessOtherwiseSpecified(o, i)) - a.remove(w), a.content.push(x) + })(u, i)(a, o, i))) + } else ((x = cloneShallow(_)), (x.value = cloneUnlessOtherwiseSpecified(o, i))) + ;(a.remove(w), a.content.push(x)) }), a ) @@ -45635,12 +45700,12 @@ deepmerge = (s, o, i) => { var a, u, _ const w = { ...ud, ...i } - ;(w.isMergeableElement = + ;((w.isMergeableElement = null !== (a = w.isMergeableElement) && void 0 !== a ? a : ud.isMergeableElement), (w.arrayElementMerge = null !== (u = w.arrayElementMerge) && void 0 !== u ? u : ud.arrayElementMerge), (w.objectElementMerge = - null !== (_ = w.objectElementMerge) && void 0 !== _ ? _ : ud.objectElementMerge) + null !== (_ = w.objectElementMerge) && void 0 !== _ ? _ : ud.objectElementMerge)) const x = Mu(o) if (!(x === Mu(s))) return cloneUnlessOtherwiseSpecified(o, w) const C = @@ -45673,15 +45738,15 @@ Object.assign(this, s) } copyMetaAndAttributes(s, o) { - ;(s.meta.length > 0 || o.meta.length > 0) && (o.meta = dd(o.meta, s.meta)), + ;((s.meta.length > 0 || o.meta.length > 0) && (o.meta = dd(o.meta, s.meta)), hasElementSourceMap(s) && assignSourceMap(o, s), (s.attributes.length > 0 || s.meta.length > 0) && - (o.attributes = dd(o.attributes, s.attributes)) + (o.attributes = dd(o.attributes, s.attributes))) } } const yd = class FallbackVisitor extends md { enter(s) { - return (this.element = cloneDeep(s)), qu + return ((this.element = cloneDeep(s)), qu) } }, copyProps = (s, o, i = []) => { @@ -45720,7 +45785,7 @@ ;-1 === w.indexOf(a) && (copyProps(_, a, ['constructor', ...i]), w.push(a)) } } - return (_.constructor = o), _ + return ((_.constructor = o), _) }, unique = (s) => s.filter((o, i) => s.indexOf(o) == i), getIngredientWithProp = (s, o) => { @@ -45756,7 +45821,7 @@ const u = getIngredientWithProp(i, s) if (void 0 === u) throw new Error('Cannot set new properties on Proxies created by ts-mixer') - return (u[i] = a), !0 + return ((u[i] = a), !0) }, deleteProperty() { throw new Error('Cannot delete properties on Proxies created by ts-mixer') @@ -45828,7 +45893,7 @@ ...(null !== (o = getMixinsForClass(s)) && void 0 !== o ? o : []), ].filter((s) => !i.has(s)) for (let s of _) a.add(s) - i.add(s), a.delete(s) + ;(i.add(s), a.delete(s)) } return [...i] })(...s) @@ -45842,7 +45907,7 @@ }, getDecoratorsForClass = (s) => { let o = xd.get(s) - return o || ((o = {}), xd.set(s, o)), o + return (o || ((o = {}), xd.set(s, o)), o) } function Mixin(...s) { var o, i, a @@ -45861,7 +45926,7 @@ null !== _ && 'function' == typeof this[_] && this[_].apply(this, o) } var w, x - ;(MixedClass.prototype = + ;((MixedClass.prototype = 'copy' === Sd ? hardMixProtos(u, MixedClass) : ((w = u), (x = MixedClass), proxyMix([...w, { constructor: x }]))), @@ -45870,7 +45935,7 @@ 'copy' === _d ? hardMixProtos(s, null, ['prototype']) : proxyMix(s, Function.prototype) - ) + )) let C = MixedClass if ('none' !== Ed) { const u = @@ -45888,17 +45953,17 @@ const o = s(C) o && (C = o) } - applyPropAndMethodDecorators( + ;(applyPropAndMethodDecorators( null !== (i = null == u ? void 0 : u.static) && void 0 !== i ? i : {}, C ), applyPropAndMethodDecorators( null !== (a = null == u ? void 0 : u.instance) && void 0 !== a ? a : {}, C.prototype - ) + )) } var j, L - return (j = C), (L = s), wd.set(j, L), C + return ((j = C), (L = s), wd.set(j, L), C) } const applyPropAndMethodDecorators = (s, o) => { const i = s.property, @@ -45938,14 +46003,14 @@ ) const Id = kd([Jc, Cd, Od]) const Td = _curry2(function pick(s, o) { - for (var i = {}, a = 0; a < s.length; ) s[a] in o && (i[s[a]] = o[s[a]]), (a += 1) + for (var i = {}, a = 0; a < s.length; ) (s[a] in o && (i[s[a]] = o[s[a]]), (a += 1)) return i }) const Nd = class SpecificationVisitor extends md { specObj passingOptionsNames = ['specObj', 'parent'] constructor({ specObj: s, ...o }) { - super({ ...o }), (this.specObj = s) + ;(super({ ...o }), (this.specObj = s)) } retrievePassingOptions() { return Td(this.passingOptionsNames, this) @@ -45974,7 +46039,7 @@ specPath ignoredFields constructor({ specPath: s, ignoredFields: o, ...i }) { - super({ ...i }), (this.specPath = s), (this.ignoredFields = o || []) + ;(super({ ...i }), (this.specPath = s), (this.ignoredFields = o || [])) } ObjectElement(s) { const o = this.specPath(s), @@ -45988,9 +46053,9 @@ ) { const i = this.toRefractedElement([...o, 'fixedFields', serializers_value(a)], s), _ = new Su.Pr(cloneDeep(a), i) - this.copyMetaAndAttributes(u, _), + ;(this.copyMetaAndAttributes(u, _), _.classes.push('fixed-field'), - this.element.content.push(_) + this.element.content.push(_)) } else this.ignoredFields.includes(serializers_value(a)) || this.element.content.push(cloneDeep(u)) @@ -46028,9 +46093,9 @@ ) class JSONSchemaVisitor extends Mixin(Md, Rd, yd) { constructor(s) { - super(s), + ;(super(s), (this.element = new sd()), - (this.specPath = fc(['document', 'objects', 'JSONSchema'])) + (this.specPath = fc(['document', 'objects', 'JSONSchema']))) } get defaultDialectIdentifier() { return 'http://json-schema.org/draft-04/schema#' @@ -46063,7 +46128,7 @@ ? cloneDeep(this.parent.getMetaProperty('ancestorsSchemaIdentifiers', [])) : new Su.wE(), a = serializers_value(s.get(o)) - Id(a) && i.push(a), this.element.setMetaProperty('ancestorsSchemaIdentifiers', i) + ;(Id(a) && i.push(a), this.element.setMetaProperty('ancestorsSchemaIdentifiers', i)) } } const $d = JSONSchemaVisitor, @@ -46073,7 +46138,7 @@ const o = isJSONReferenceLikeElement(s) ? ['document', 'objects', 'JSONReference'] : ['document', 'objects', 'JSONSchema'] - return (this.element = this.toRefractedElement(o, s)), qu + return ((this.element = this.toRefractedElement(o, s)), qu) } ArrayElement(s) { return ( @@ -46095,7 +46160,7 @@ const Vd = class RequiredVisitor extends yd { ArrayElement(s) { const o = this.enter(s) - return this.element.classes.push('json-schema-required'), o + return (this.element.classes.push('json-schema-required'), o) } } const Wd = class PatternedFieldsVisitor extends Nd { @@ -46103,10 +46168,10 @@ ignoredFields fieldPatternPredicate = es_F constructor({ specPath: s, ignoredFields: o, fieldPatternPredicate: i, ...a }) { - super({ ...a }), + ;(super({ ...a }), (this.specPath = s), (this.ignoredFields = o || []), - 'function' == typeof i && (this.fieldPatternPredicate = i) + 'function' == typeof i && (this.fieldPatternPredicate = i)) } ObjectElement(s) { return ( @@ -46118,9 +46183,9 @@ const a = this.specPath(s), u = this.toRefractedElement(a, s), _ = new Su.Pr(cloneDeep(o), u) - this.copyMetaAndAttributes(i, _), + ;(this.copyMetaAndAttributes(i, _), _.classes.push('patterned-field'), - this.element.content.push(_) + this.element.content.push(_)) } else this.ignoredFields.includes(serializers_value(o)) || this.element.content.push(cloneDeep(i)) @@ -46132,64 +46197,66 @@ } const Jd = class MapVisitor extends Wd { constructor(s) { - super(s), (this.fieldPatternPredicate = Id) + ;(super(s), (this.fieldPatternPredicate = Id)) } } class PropertiesVisitor extends Mixin(Jd, Rd, yd) { constructor(s) { - super(s), + ;(super(s), (this.element = new Su.Sh()), this.element.classes.push('json-schema-properties'), (this.specPath = (s) => isJSONReferenceLikeElement(s) ? ['document', 'objects', 'JSONReference'] - : ['document', 'objects', 'JSONSchema']) + : ['document', 'objects', 'JSONSchema'])) } } const Hd = PropertiesVisitor class PatternPropertiesVisitor extends Mixin(Jd, Rd, yd) { constructor(s) { - super(s), + ;(super(s), (this.element = new Su.Sh()), this.element.classes.push('json-schema-patternProperties'), (this.specPath = (s) => isJSONReferenceLikeElement(s) ? ['document', 'objects', 'JSONReference'] - : ['document', 'objects', 'JSONSchema']) + : ['document', 'objects', 'JSONSchema'])) } } const Kd = PatternPropertiesVisitor class DependenciesVisitor extends Mixin(Jd, Rd, yd) { constructor(s) { - super(s), + ;(super(s), (this.element = new Su.Sh()), this.element.classes.push('json-schema-dependencies'), (this.specPath = (s) => isJSONReferenceLikeElement(s) ? ['document', 'objects', 'JSONReference'] - : ['document', 'objects', 'JSONSchema']) + : ['document', 'objects', 'JSONSchema'])) } } const Gd = DependenciesVisitor const Yd = class EnumVisitor extends yd { ArrayElement(s) { const o = this.enter(s) - return this.element.classes.push('json-schema-enum'), o + return (this.element.classes.push('json-schema-enum'), o) } } const Xd = class TypeVisitor extends yd { StringElement(s) { const o = this.enter(s) - return this.element.classes.push('json-schema-type'), o + return (this.element.classes.push('json-schema-type'), o) } ArrayElement(s) { const o = this.enter(s) - return this.element.classes.push('json-schema-type'), o + return (this.element.classes.push('json-schema-type'), o) } } class AllOfVisitor extends Mixin(Nd, Rd, yd) { constructor(s) { - super(s), (this.element = new Su.wE()), this.element.classes.push('json-schema-allOf') + ;(super(s), + (this.element = new Su.wE()), + this.element.classes.push('json-schema-allOf')) } ArrayElement(s) { return ( @@ -46208,7 +46275,9 @@ const Qd = AllOfVisitor class AnyOfVisitor extends Mixin(Nd, Rd, yd) { constructor(s) { - super(s), (this.element = new Su.wE()), this.element.classes.push('json-schema-anyOf') + ;(super(s), + (this.element = new Su.wE()), + this.element.classes.push('json-schema-anyOf')) } ArrayElement(s) { return ( @@ -46227,7 +46296,9 @@ const Zd = AnyOfVisitor class OneOfVisitor extends Mixin(Nd, Rd, yd) { constructor(s) { - super(s), (this.element = new Su.wE()), this.element.classes.push('json-schema-oneOf') + ;(super(s), + (this.element = new Su.wE()), + this.element.classes.push('json-schema-oneOf')) } ArrayElement(s) { return ( @@ -46246,19 +46317,21 @@ const ef = OneOfVisitor class DefinitionsVisitor extends Mixin(Jd, Rd, yd) { constructor(s) { - super(s), + ;(super(s), (this.element = new Su.Sh()), this.element.classes.push('json-schema-definitions'), (this.specPath = (s) => isJSONReferenceLikeElement(s) ? ['document', 'objects', 'JSONReference'] - : ['document', 'objects', 'JSONSchema']) + : ['document', 'objects', 'JSONSchema'])) } } const rf = DefinitionsVisitor class LinksVisitor extends Mixin(Nd, Rd, yd) { constructor(s) { - super(s), (this.element = new Su.wE()), this.element.classes.push('json-schema-links') + ;(super(s), + (this.element = new Su.wE()), + this.element.classes.push('json-schema-links')) } ArrayElement(s) { return ( @@ -46274,20 +46347,20 @@ const of = LinksVisitor class JSONReferenceVisitor extends Mixin(Md, yd) { constructor(s) { - super(s), + ;(super(s), (this.element = new id()), - (this.specPath = fc(['document', 'objects', 'JSONReference'])) + (this.specPath = fc(['document', 'objects', 'JSONReference']))) } ObjectElement(s) { const o = Md.prototype.ObjectElement.call(this, s) - return ju(this.element.$ref) && this.element.classes.push('reference-element'), o + return (ju(this.element.$ref) && this.element.classes.push('reference-element'), o) } } const af = JSONReferenceVisitor const cf = class $RefVisitor extends yd { StringElement(s) { const o = this.enter(s) - return this.element.classes.push('reference-value'), o + return (this.element.classes.push('reference-value'), o) } } const lf = _curry3(function ifElse(s, o, i) { @@ -46377,39 +46450,39 @@ const Of = class AlternatingVisitor extends Nd { alternator constructor({ alternator: s, ...o }) { - super({ ...o }), (this.alternator = s) + ;(super({ ...o }), (this.alternator = s)) } enter(s) { const o = this.alternator.map(({ predicate: s, specPath: o }) => lf(s, fc(o), gc)), i = kf(o)(s) - return (this.element = this.toRefractedElement(i, s)), qu + return ((this.element = this.toRefractedElement(i, s)), qu) } } const Cf = class SchemaOrReferenceVisitor extends Of { constructor(s) { - super(s), + ;(super(s), (this.alternator = [ { predicate: isJSONReferenceLikeElement, specPath: ['document', 'objects', 'JSONReference'], }, { predicate: es_T, specPath: ['document', 'objects', 'JSONSchema'] }, - ]) + ])) } } class MediaVisitor extends Mixin(Md, yd) { constructor(s) { - super(s), + ;(super(s), (this.element = new cd()), - (this.specPath = fc(['document', 'objects', 'Media'])) + (this.specPath = fc(['document', 'objects', 'Media']))) } } const jf = MediaVisitor class LinkDescriptionVisitor extends Mixin(Md, yd) { constructor(s) { - super(s), + ;(super(s), (this.element = new ld()), - (this.specPath = fc(['document', 'objects', 'LinkDescription'])) + (this.specPath = fc(['document', 'objects', 'LinkDescription']))) } } const Pf = LinkDescriptionVisitor, @@ -46536,7 +46609,7 @@ (s) => (o, i = {}) => refractor_refract(o, { specPath: s, ...i }) - ;(sd.refract = refractor_createRefractor([ + ;((sd.refract = refractor_createRefractor([ 'visitors', 'document', 'objects', @@ -46563,10 +46636,10 @@ 'objects', 'LinkDescription', '$visitor', - ])) + ]))) const Ff = class Schema_Schema extends sd { constructor(s, o, i) { - super(s, o, i), (this.element = 'schema'), this.classes.push('json-schema-draft-4') + ;(super(s, o, i), (this.element = 'schema'), this.classes.push('json-schema-draft-4')) } get idProp() { throw new td('idProp getter in Schema class is not not supported.') @@ -46691,13 +46764,13 @@ } class SecurityRequirement extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'securityRequirement') + ;(super(s, o, i), (this.element = 'securityRequirement')) } } const Vf = SecurityRequirement class SecurityScheme extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'securityScheme') + ;(super(s, o, i), (this.element = 'securityScheme')) } get type() { return this.get('type') @@ -46751,7 +46824,7 @@ const Wf = SecurityScheme class Server extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'server') + ;(super(s, o, i), (this.element = 'server')) } get url() { return this.get('url') @@ -46775,7 +46848,7 @@ const Jf = Server class ServerVariable extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'serverVariable') + ;(super(s, o, i), (this.element = 'serverVariable')) } get enum() { return this.get('enum') @@ -46799,7 +46872,7 @@ const Hf = ServerVariable class Tag extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'tag') + ;(super(s, o, i), (this.element = 'tag')) } get name() { return this.get('name') @@ -46823,7 +46896,7 @@ const Gf = Tag class Xml extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'xml') + ;(super(s, o, i), (this.element = 'xml')) } get name() { return this.get('name') @@ -46863,15 +46936,15 @@ Object.assign(this, s) } copyMetaAndAttributes(s, o) { - ;(s.meta.length > 0 || o.meta.length > 0) && (o.meta = dd(o.meta, s.meta)), + ;((s.meta.length > 0 || o.meta.length > 0) && (o.meta = dd(o.meta, s.meta)), hasElementSourceMap(s) && assignSourceMap(o, s), (s.attributes.length > 0 || s.meta.length > 0) && - (o.attributes = dd(o.attributes, s.attributes)) + (o.attributes = dd(o.attributes, s.attributes))) } } const em = class FallbackVisitor_FallbackVisitor extends Qf { enter(s) { - return (this.element = cloneDeep(s)), qu + return ((this.element = cloneDeep(s)), qu) } } const tm = class SpecificationVisitor_SpecificationVisitor extends Qf { @@ -46886,11 +46959,11 @@ openApiSemanticElement: a, ...u }) { - super({ ...u }), + ;(super({ ...u }), (this.specObj = s), (this.openApiGenericElement = i), (this.openApiSemanticElement = a), - Array.isArray(o) && (this.passingOptionsNames = o) + Array.isArray(o) && (this.passingOptionsNames = o)) } retrievePassingOptions() { return Td(this.passingOptionsNames, this) @@ -46917,7 +46990,7 @@ } var rm = (function () { function XTake(s, o) { - ;(this.xf = o), (this.n = s), (this.i = 0) + ;((this.xf = o), (this.n = s), (this.i = 0)) } return ( (XTake.prototype['@@transducer/init'] = _xfBase_init), @@ -46960,11 +47033,11 @@ specificationExtensionPredicate: a, ...u }) { - super({ ...u }), + ;(super({ ...u }), (this.specPath = s), (this.ignoredFields = o || []), 'boolean' == typeof i && (this.canSupportSpecificationExtensions = i), - 'function' == typeof a && (this.specificationExtensionPredicate = a) + 'function' == typeof a && (this.specificationExtensionPredicate = a)) } ObjectElement(s) { const o = this.specPath(s), @@ -46978,9 +47051,9 @@ ) { const i = this.toRefractedElement([...o, 'fixedFields', serializers_value(a)], s), _ = new Su.Pr(cloneDeep(a), i) - this.copyMetaAndAttributes(u, _), + ;(this.copyMetaAndAttributes(u, _), _.classes.push('fixed-field'), - this.element.content.push(_) + this.element.content.push(_)) } else if ( this.canSupportSpecificationExtensions && this.specificationExtensionPredicate(u) @@ -46998,10 +47071,10 @@ } class OpenApi3_0Visitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Rh()), (this.specPath = fc(['document', 'objects', 'OpenApi'])), - (this.canSupportSpecificationExtensions = !0) + (this.canSupportSpecificationExtensions = !0)) } ObjectElement(s) { return cm.prototype.ObjectElement.call(this, s) @@ -47011,7 +47084,7 @@ class OpenapiVisitor extends Mixin(tm, em) { StringElement(s) { const o = new Ih(serializers_value(s)) - return this.copyMetaAndAttributes(s, o), (this.element = o), qu + return (this.copyMetaAndAttributes(s, o), (this.element = o), qu) } } const um = OpenapiVisitor @@ -47026,43 +47099,47 @@ } class InfoVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new vh()), (this.specPath = fc(['document', 'objects', 'Info'])), - (this.canSupportSpecificationExtensions = !0) + (this.canSupportSpecificationExtensions = !0)) } } const hm = InfoVisitor const dm = class VersionVisitor extends em { StringElement(s) { const o = super.enter(s) - return this.element.classes.push('api-version'), this.element.classes.push('version'), o + return ( + this.element.classes.push('api-version'), + this.element.classes.push('version'), + o + ) } } class ContactVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Zp()), (this.specPath = fc(['document', 'objects', 'Contact'])), - (this.canSupportSpecificationExtensions = !0) + (this.canSupportSpecificationExtensions = !0)) } } const fm = ContactVisitor class LicenseVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new _h()), (this.specPath = fc(['document', 'objects', 'License'])), - (this.canSupportSpecificationExtensions = !0) + (this.canSupportSpecificationExtensions = !0)) } } const mm = LicenseVisitor class LinkVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new wh()), (this.specPath = fc(['document', 'objects', 'Link'])), - (this.canSupportSpecificationExtensions = !0) + (this.canSupportSpecificationExtensions = !0)) } ObjectElement(s) { const o = cm.prototype.ObjectElement.call(this, s) @@ -47077,13 +47154,13 @@ const ym = class OperationRefVisitor extends em { StringElement(s) { const o = super.enter(s) - return this.element.classes.push('reference-value'), o + return (this.element.classes.push('reference-value'), o) } } const vm = class OperationIdVisitor extends em { StringElement(s) { const o = super.enter(s) - return this.element.classes.push('reference-value'), o + return (this.element.classes.push('reference-value'), o) } } const bm = class PatternedFieldsVisitor_PatternedFieldsVisitor extends tm { @@ -47100,12 +47177,12 @@ specificationExtensionPredicate: u, ..._ }) { - super({ ..._ }), + ;(super({ ..._ }), (this.specPath = s), (this.ignoredFields = o || []), 'function' == typeof i && (this.fieldPatternPredicate = i), 'boolean' == typeof a && (this.canSupportSpecificationExtensions = a), - 'function' == typeof u && (this.specificationExtensionPredicate = u) + 'function' == typeof u && (this.specificationExtensionPredicate = u)) } ObjectElement(s) { return ( @@ -47123,9 +47200,9 @@ const a = this.specPath(s), u = this.toRefractedElement(a, s), _ = new Su.Pr(cloneDeep(o), u) - this.copyMetaAndAttributes(i, _), + ;(this.copyMetaAndAttributes(i, _), _.classes.push('patterned-field'), - this.element.content.push(_) + this.element.content.push(_)) } else this.ignoredFields.includes(serializers_value(o)) || this.element.content.push(cloneDeep(i)) @@ -47137,47 +47214,47 @@ } const _m = class MapVisitor_MapVisitor extends bm { constructor(s) { - super(s), (this.fieldPatternPredicate = Id) + ;(super(s), (this.fieldPatternPredicate = Id)) } } class LinkParameters extends Su.Sh { static primaryClass = 'link-parameters' constructor(s, o, i) { - super(s, o, i), this.classes.push(LinkParameters.primaryClass) + ;(super(s, o, i), this.classes.push(LinkParameters.primaryClass)) } } const Sm = LinkParameters class ParametersVisitor extends Mixin(_m, em) { constructor(s) { - super(s), (this.element = new Sm()), (this.specPath = fc(['value'])) + ;(super(s), (this.element = new Sm()), (this.specPath = fc(['value']))) } } const Em = ParametersVisitor class ServerVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Jf()), (this.specPath = fc(['document', 'objects', 'Server'])), - (this.canSupportSpecificationExtensions = !0) + (this.canSupportSpecificationExtensions = !0)) } } const wm = ServerVisitor const xm = class UrlVisitor extends em { StringElement(s) { const o = super.enter(s) - return this.element.classes.push('server-url'), o + return (this.element.classes.push('server-url'), o) } } class Servers extends Su.wE { static primaryClass = 'servers' constructor(s, o, i) { - super(s, o, i), this.classes.push(Servers.primaryClass) + ;(super(s, o, i), this.classes.push(Servers.primaryClass)) } } const km = Servers class ServersVisitor extends Mixin(tm, em) { constructor(s) { - super(s), (this.element = new km()) + ;(super(s), (this.element = new km())) } ArrayElement(s) { return ( @@ -47194,46 +47271,46 @@ const Om = ServersVisitor class ServerVariableVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Hf()), (this.specPath = fc(['document', 'objects', 'ServerVariable'])), - (this.canSupportSpecificationExtensions = !0) + (this.canSupportSpecificationExtensions = !0)) } } const Am = ServerVariableVisitor class ServerVariables extends Su.Sh { static primaryClass = 'server-variables' constructor(s, o, i) { - super(s, o, i), this.classes.push(ServerVariables.primaryClass) + ;(super(s, o, i), this.classes.push(ServerVariables.primaryClass)) } } const Cm = ServerVariables class VariablesVisitor extends Mixin(_m, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Cm()), - (this.specPath = fc(['document', 'objects', 'ServerVariable'])) + (this.specPath = fc(['document', 'objects', 'ServerVariable']))) } } const jm = VariablesVisitor class MediaTypeVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Oh()), (this.specPath = fc(['document', 'objects', 'MediaType'])), - (this.canSupportSpecificationExtensions = !0) + (this.canSupportSpecificationExtensions = !0)) } } const Pm = MediaTypeVisitor const Im = class AlternatingVisitor_AlternatingVisitor extends tm { alternator constructor({ alternator: s, ...o }) { - super({ ...o }), (this.alternator = s || []) + ;(super({ ...o }), (this.alternator = s || [])) } enter(s) { const o = this.alternator.map(({ predicate: s, specPath: o }) => lf(s, fc(o), gc)), i = kf(o)(s) - return (this.element = this.toRefractedElement(i, s)), qu + return ((this.element = this.toRefractedElement(i, s)), qu) } }, Tm = helpers( @@ -47374,33 +47451,34 @@ ) class SchemaVisitor extends Mixin(Im, em) { constructor(s) { - super(s), + ;(super(s), (this.alternator = [ { predicate: isReferenceLikeElement, specPath: ['document', 'objects', 'Reference'], }, { predicate: es_T, specPath: ['document', 'objects', 'Schema'] }, - ]) + ])) } ObjectElement(s) { const o = Im.prototype.enter.call(this, s) return ( - Hm(this.element) && this.element.setMetaProperty('referenced-element', 'schema'), o + Hm(this.element) && this.element.setMetaProperty('referenced-element', 'schema'), + o ) } } const lg = SchemaVisitor class ExamplesVisitor extends Mixin(_m, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Su.Sh()), this.element.classes.push('examples'), (this.specPath = (s) => isReferenceLikeElement(s) ? ['document', 'objects', 'Reference'] : ['document', 'objects', 'Example']), - (this.canSupportSpecificationExtensions = !0) + (this.canSupportSpecificationExtensions = !0)) } ObjectElement(s) { const o = _m.prototype.ObjectElement.call(this, s) @@ -47416,48 +47494,48 @@ class MediaTypeExamples extends Su.Sh { static primaryClass = 'media-type-examples' constructor(s, o, i) { - super(s, o, i), + ;(super(s, o, i), this.classes.push(MediaTypeExamples.primaryClass), - this.classes.push('examples') + this.classes.push('examples')) } } const fg = MediaTypeExamples const mg = class ExamplesVisitor_ExamplesVisitor extends pg { constructor(s) { - super(s), (this.element = new fg()) + ;(super(s), (this.element = new fg())) } } class MediaTypeEncoding extends Su.Sh { static primaryClass = 'media-type-encoding' constructor(s, o, i) { - super(s, o, i), this.classes.push(MediaTypeEncoding.primaryClass) + ;(super(s, o, i), this.classes.push(MediaTypeEncoding.primaryClass)) } } const gg = MediaTypeEncoding class EncodingVisitor extends Mixin(_m, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new gg()), - (this.specPath = fc(['document', 'objects', 'Encoding'])) + (this.specPath = fc(['document', 'objects', 'Encoding']))) } } const yg = EncodingVisitor class SecurityRequirementVisitor extends Mixin(_m, em) { constructor(s) { - super(s), (this.element = new Vf()), (this.specPath = fc(['value'])) + ;(super(s), (this.element = new Vf()), (this.specPath = fc(['value']))) } } const _g = SecurityRequirementVisitor class Security extends Su.wE { static primaryClass = 'security' constructor(s, o, i) { - super(s, o, i), this.classes.push(Security.primaryClass) + ;(super(s, o, i), this.classes.push(Security.primaryClass)) } } const xg = Security class SecurityVisitor extends Mixin(tm, em) { constructor(s) { - super(s), (this.element = new xg()) + ;(super(s), (this.element = new xg())) } ArrayElement(s) { return ( @@ -47478,47 +47556,47 @@ const kg = SecurityVisitor class ComponentsVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Qp()), (this.specPath = fc(['document', 'objects', 'Components'])), - (this.canSupportSpecificationExtensions = !0) + (this.canSupportSpecificationExtensions = !0)) } } const qg = ComponentsVisitor class TagVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Gf()), (this.specPath = fc(['document', 'objects', 'Tag'])), - (this.canSupportSpecificationExtensions = !0) + (this.canSupportSpecificationExtensions = !0)) } } const Ug = TagVisitor class ReferenceVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Hh()), (this.specPath = fc(['document', 'objects', 'Reference'])), - (this.canSupportSpecificationExtensions = !1) + (this.canSupportSpecificationExtensions = !1)) } ObjectElement(s) { const o = cm.prototype.ObjectElement.call(this, s) - return ju(this.element.$ref) && this.element.classes.push('reference-element'), o + return (ju(this.element.$ref) && this.element.classes.push('reference-element'), o) } } const Vg = ReferenceVisitor const zg = class $RefVisitor_$RefVisitor extends em { StringElement(s) { const o = super.enter(s) - return this.element.classes.push('reference-value'), o + return (this.element.classes.push('reference-value'), o) } } class ParameterVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Lh()), (this.specPath = fc(['document', 'objects', 'Parameter'])), - (this.canSupportSpecificationExtensions = !0) + (this.canSupportSpecificationExtensions = !0)) } ObjectElement(s) { const o = cm.prototype.ObjectElement.call(this, s) @@ -47534,47 +47612,49 @@ const Wg = ParameterVisitor class SchemaVisitor_SchemaVisitor extends Mixin(Im, em) { constructor(s) { - super(s), + ;(super(s), (this.alternator = [ { predicate: isReferenceLikeElement, specPath: ['document', 'objects', 'Reference'], }, { predicate: es_T, specPath: ['document', 'objects', 'Schema'] }, - ]) + ])) } ObjectElement(s) { const o = Im.prototype.enter.call(this, s) return ( - Hm(this.element) && this.element.setMetaProperty('referenced-element', 'schema'), o + Hm(this.element) && this.element.setMetaProperty('referenced-element', 'schema'), + o ) } } const Kg = SchemaVisitor_SchemaVisitor class HeaderVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new fh()), (this.specPath = fc(['document', 'objects', 'Header'])), - (this.canSupportSpecificationExtensions = !0) + (this.canSupportSpecificationExtensions = !0)) } } const Yg = HeaderVisitor class header_SchemaVisitor_SchemaVisitor extends Mixin(Im, em) { constructor(s) { - super(s), + ;(super(s), (this.alternator = [ { predicate: isReferenceLikeElement, specPath: ['document', 'objects', 'Reference'], }, { predicate: es_T, specPath: ['document', 'objects', 'Schema'] }, - ]) + ])) } ObjectElement(s) { const o = Im.prototype.enter.call(this, s) return ( - Hm(this.element) && this.element.setMetaProperty('referenced-element', 'schema'), o + Hm(this.element) && this.element.setMetaProperty('referenced-element', 'schema'), + o ) } } @@ -47582,46 +47662,46 @@ class HeaderExamples extends Su.Sh { static primaryClass = 'header-examples' constructor(s, o, i) { - super(s, o, i), + ;(super(s, o, i), this.classes.push(HeaderExamples.primaryClass), - this.classes.push('examples') + this.classes.push('examples')) } } const Zg = HeaderExamples const ey = class header_ExamplesVisitor_ExamplesVisitor extends pg { constructor(s) { - super(s), (this.element = new Zg()) + ;(super(s), (this.element = new Zg())) } } class ContentVisitor extends Mixin(_m, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Su.Sh()), this.element.classes.push('content'), - (this.specPath = fc(['document', 'objects', 'MediaType'])) + (this.specPath = fc(['document', 'objects', 'MediaType']))) } } const ty = ContentVisitor class HeaderContent extends Su.Sh { static primaryClass = 'header-content' constructor(s, o, i) { - super(s, o, i), + ;(super(s, o, i), this.classes.push(HeaderContent.primaryClass), - this.classes.push('content') + this.classes.push('content')) } } const ry = HeaderContent const ny = class ContentVisitor_ContentVisitor extends ty { constructor(s) { - super(s), (this.element = new ry()) + ;(super(s), (this.element = new ry())) } } class schema_SchemaVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Ff()), (this.specPath = fc(['document', 'objects', 'Schema'])), - (this.canSupportSpecificationExtensions = !0) + (this.canSupportSpecificationExtensions = !0)) } } const sy = schema_SchemaVisitor, @@ -47666,7 +47746,8 @@ ObjectElement(s) { const o = py.prototype.ObjectElement.call(this, s) return ( - Hm(this.element) && this.element.setMetaProperty('referenced-element', 'schema'), o + Hm(this.element) && this.element.setMetaProperty('referenced-element', 'schema'), + o ) } ArrayElement(s) { @@ -47696,84 +47777,85 @@ ObjectElement(s) { const o = yy.prototype.enter.call(this, s) return ( - Hm(this.element) && this.element.setMetaProperty('referenced-element', 'schema'), o + Hm(this.element) && this.element.setMetaProperty('referenced-element', 'schema'), + o ) } } class DiscriminatorVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new th()), (this.specPath = fc(['document', 'objects', 'Discriminator'])), - (this.canSupportSpecificationExtensions = !1) + (this.canSupportSpecificationExtensions = !1)) } } const by = DiscriminatorVisitor class DiscriminatorMapping extends Su.Sh { static primaryClass = 'discriminator-mapping' constructor(s, o, i) { - super(s, o, i), this.classes.push(DiscriminatorMapping.primaryClass) + ;(super(s, o, i), this.classes.push(DiscriminatorMapping.primaryClass)) } } const _y = DiscriminatorMapping class MappingVisitor extends Mixin(_m, em) { constructor(s) { - super(s), (this.element = new _y()), (this.specPath = fc(['value'])) + ;(super(s), (this.element = new _y()), (this.specPath = fc(['value']))) } } const Sy = MappingVisitor class XmlVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Xf()), (this.specPath = fc(['document', 'objects', 'XML'])), - (this.canSupportSpecificationExtensions = !0) + (this.canSupportSpecificationExtensions = !0)) } } const Ey = XmlVisitor class ParameterExamples extends Su.Sh { static primaryClass = 'parameter-examples' constructor(s, o, i) { - super(s, o, i), + ;(super(s, o, i), this.classes.push(ParameterExamples.primaryClass), - this.classes.push('examples') + this.classes.push('examples')) } } const wy = ParameterExamples const xy = class parameter_ExamplesVisitor_ExamplesVisitor extends pg { constructor(s) { - super(s), (this.element = new wy()) + ;(super(s), (this.element = new wy())) } } class ParameterContent extends Su.Sh { static primaryClass = 'parameter-content' constructor(s, o, i) { - super(s, o, i), + ;(super(s, o, i), this.classes.push(ParameterContent.primaryClass), - this.classes.push('content') + this.classes.push('content')) } } const ky = ParameterContent const Oy = class parameter_ContentVisitor_ContentVisitor extends ty { constructor(s) { - super(s), (this.element = new ky()) + ;(super(s), (this.element = new ky())) } } class ComponentsSchemas extends Su.Sh { static primaryClass = 'components-schemas' constructor(s, o, i) { - super(s, o, i), this.classes.push(ComponentsSchemas.primaryClass) + ;(super(s, o, i), this.classes.push(ComponentsSchemas.primaryClass)) } } const Ay = ComponentsSchemas class SchemasVisitor extends Mixin(_m, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Ay()), (this.specPath = (s) => isReferenceLikeElement(s) ? ['document', 'objects', 'Reference'] - : ['document', 'objects', 'Schema']) + : ['document', 'objects', 'Schema'])) } ObjectElement(s) { const o = _m.prototype.ObjectElement.call(this, s) @@ -47789,18 +47871,18 @@ class ComponentsResponses extends Su.Sh { static primaryClass = 'components-responses' constructor(s, o, i) { - super(s, o, i), this.classes.push(ComponentsResponses.primaryClass) + ;(super(s, o, i), this.classes.push(ComponentsResponses.primaryClass)) } } const jy = ComponentsResponses class ResponsesVisitor extends Mixin(_m, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new jy()), (this.specPath = (s) => isReferenceLikeElement(s) ? ['document', 'objects', 'Reference'] - : ['document', 'objects', 'Response']) + : ['document', 'objects', 'Response'])) } ObjectElement(s) { const o = _m.prototype.ObjectElement.call(this, s) @@ -47819,20 +47901,20 @@ class ComponentsParameters extends Su.Sh { static primaryClass = 'components-parameters' constructor(s, o, i) { - super(s, o, i), + ;(super(s, o, i), this.classes.push(ComponentsParameters.primaryClass), - this.classes.push('parameters') + this.classes.push('parameters')) } } const Iy = ComponentsParameters class ParametersVisitor_ParametersVisitor extends Mixin(_m, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Iy()), (this.specPath = (s) => isReferenceLikeElement(s) ? ['document', 'objects', 'Reference'] - : ['document', 'objects', 'Parameter']) + : ['document', 'objects', 'Parameter'])) } ObjectElement(s) { const o = _m.prototype.ObjectElement.call(this, s) @@ -47848,20 +47930,20 @@ class ComponentsExamples extends Su.Sh { static primaryClass = 'components-examples' constructor(s, o, i) { - super(s, o, i), + ;(super(s, o, i), this.classes.push(ComponentsExamples.primaryClass), - this.classes.push('examples') + this.classes.push('examples')) } } const Ny = ComponentsExamples class components_ExamplesVisitor_ExamplesVisitor extends Mixin(_m, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Ny()), (this.specPath = (s) => isReferenceLikeElement(s) ? ['document', 'objects', 'Reference'] - : ['document', 'objects', 'Example']) + : ['document', 'objects', 'Example'])) } ObjectElement(s) { const o = _m.prototype.ObjectElement.call(this, s) @@ -47877,18 +47959,18 @@ class ComponentsRequestBodies extends Su.Sh { static primaryClass = 'components-request-bodies' constructor(s, o, i) { - super(s, o, i), this.classes.push(ComponentsRequestBodies.primaryClass) + ;(super(s, o, i), this.classes.push(ComponentsRequestBodies.primaryClass)) } } const Ry = ComponentsRequestBodies class RequestBodiesVisitor extends Mixin(_m, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Ry()), (this.specPath = (s) => isReferenceLikeElement(s) ? ['document', 'objects', 'Reference'] - : ['document', 'objects', 'RequestBody']) + : ['document', 'objects', 'RequestBody'])) } ObjectElement(s) { const o = _m.prototype.ObjectElement.call(this, s) @@ -47904,18 +47986,18 @@ class ComponentsHeaders extends Su.Sh { static primaryClass = 'components-headers' constructor(s, o, i) { - super(s, o, i), this.classes.push(ComponentsHeaders.primaryClass) + ;(super(s, o, i), this.classes.push(ComponentsHeaders.primaryClass)) } } const Ly = ComponentsHeaders class HeadersVisitor extends Mixin(_m, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Ly()), (this.specPath = (s) => isReferenceLikeElement(s) ? ['document', 'objects', 'Reference'] - : ['document', 'objects', 'Header']) + : ['document', 'objects', 'Header'])) } ObjectElement(s) { const o = _m.prototype.ObjectElement.call(this, s) @@ -47934,18 +48016,18 @@ class ComponentsSecuritySchemes extends Su.Sh { static primaryClass = 'components-security-schemes' constructor(s, o, i) { - super(s, o, i), this.classes.push(ComponentsSecuritySchemes.primaryClass) + ;(super(s, o, i), this.classes.push(ComponentsSecuritySchemes.primaryClass)) } } const By = ComponentsSecuritySchemes class SecuritySchemesVisitor extends Mixin(_m, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new By()), (this.specPath = (s) => isReferenceLikeElement(s) ? ['document', 'objects', 'Reference'] - : ['document', 'objects', 'SecurityScheme']) + : ['document', 'objects', 'SecurityScheme'])) } ObjectElement(s) { const o = _m.prototype.ObjectElement.call(this, s) @@ -47961,18 +48043,18 @@ class ComponentsLinks extends Su.Sh { static primaryClass = 'components-links' constructor(s, o, i) { - super(s, o, i), this.classes.push(ComponentsLinks.primaryClass) + ;(super(s, o, i), this.classes.push(ComponentsLinks.primaryClass)) } } const qy = ComponentsLinks class LinksVisitor_LinksVisitor extends Mixin(_m, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new qy()), (this.specPath = (s) => isReferenceLikeElement(s) ? ['document', 'objects', 'Reference'] - : ['document', 'objects', 'Link']) + : ['document', 'objects', 'Link'])) } ObjectElement(s) { const o = _m.prototype.ObjectElement.call(this, s) @@ -47988,18 +48070,18 @@ class ComponentsCallbacks extends Su.Sh { static primaryClass = 'components-callbacks' constructor(s, o, i) { - super(s, o, i), this.classes.push(ComponentsCallbacks.primaryClass) + ;(super(s, o, i), this.classes.push(ComponentsCallbacks.primaryClass)) } } const Vy = ComponentsCallbacks class CallbacksVisitor extends Mixin(_m, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Vy()), (this.specPath = (s) => isReferenceLikeElement(s) ? ['document', 'objects', 'Reference'] - : ['document', 'objects', 'Callback']) + : ['document', 'objects', 'Callback'])) } ObjectElement(s) { const o = _m.prototype.ObjectElement.call(this, s) @@ -48014,15 +48096,16 @@ const zy = CallbacksVisitor class ExampleVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new uh()), (this.specPath = fc(['document', 'objects', 'Example'])), - (this.canSupportSpecificationExtensions = !0) + (this.canSupportSpecificationExtensions = !0)) } ObjectElement(s) { const o = cm.prototype.ObjectElement.call(this, s) return ( - ju(this.element.externalValue) && this.element.classes.push('reference-element'), o + ju(this.element.externalValue) && this.element.classes.push('reference-element'), + o ) } } @@ -48030,24 +48113,24 @@ const Jy = class ExternalValueVisitor extends em { StringElement(s) { const o = super.enter(s) - return this.element.classes.push('reference-value'), o + return (this.element.classes.push('reference-value'), o) } } class ExternalDocumentationVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new dh()), (this.specPath = fc(['document', 'objects', 'ExternalDocumentation'])), - (this.canSupportSpecificationExtensions = !0) + (this.canSupportSpecificationExtensions = !0)) } } const Hy = ExternalDocumentationVisitor class encoding_EncodingVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new rh()), (this.specPath = fc(['document', 'objects', 'Encoding'])), - (this.canSupportSpecificationExtensions = !0) + (this.canSupportSpecificationExtensions = !0)) } ObjectElement(s) { const o = cm.prototype.ObjectElement.call(this, s) @@ -48064,18 +48147,18 @@ class EncodingHeaders extends Su.Sh { static primaryClass = 'encoding-headers' constructor(s, o, i) { - super(s, o, i), this.classes.push(EncodingHeaders.primaryClass) + ;(super(s, o, i), this.classes.push(EncodingHeaders.primaryClass)) } } const Gy = EncodingHeaders class HeadersVisitor_HeadersVisitor extends Mixin(_m, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Gy()), (this.specPath = (s) => isReferenceLikeElement(s) ? ['document', 'objects', 'Reference'] - : ['document', 'objects', 'Header']) + : ['document', 'objects', 'Header'])) } ObjectElement(s) { const o = _m.prototype.ObjectElement.call(this, s) @@ -48095,19 +48178,19 @@ const Yy = HeadersVisitor_HeadersVisitor class PathsVisitor extends Mixin(bm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Jh()), (this.specPath = fc(['document', 'objects', 'PathItem'])), (this.canSupportSpecificationExtensions = !0), - (this.fieldPatternPredicate = es_T) + (this.fieldPatternPredicate = es_T)) } ObjectElement(s) { const o = bm.prototype.ObjectElement.call(this, s) return ( this.element.filter(Wm).forEach((s, o) => { - o.classes.push('openapi-path-template'), + ;(o.classes.push('openapi-path-template'), o.classes.push('path-template'), - s.setMetaProperty('path', cloneDeep(o)) + s.setMetaProperty('path', cloneDeep(o))) }), o ) @@ -48116,9 +48199,9 @@ const Xy = PathsVisitor class RequestBodyVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Kh()), - (this.specPath = fc(['document', 'objects', 'RequestBody'])) + (this.specPath = fc(['document', 'objects', 'RequestBody']))) } ObjectElement(s) { const o = cm.prototype.ObjectElement.call(this, s) @@ -48135,24 +48218,24 @@ class RequestBodyContent extends Su.Sh { static primaryClass = 'request-body-content' constructor(s, o, i) { - super(s, o, i), + ;(super(s, o, i), this.classes.push(RequestBodyContent.primaryClass), - this.classes.push('content') + this.classes.push('content')) } } const Zy = RequestBodyContent const ev = class request_body_ContentVisitor_ContentVisitor extends ty { constructor(s) { - super(s), (this.element = new Zy()) + ;(super(s), (this.element = new Zy())) } } class CallbackVisitor extends Mixin(bm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Xp()), (this.specPath = fc(['document', 'objects', 'PathItem'])), (this.canSupportSpecificationExtensions = !0), - (this.fieldPatternPredicate = (s) => /{(?[^}]{1,2083})}/.test(String(s))) + (this.fieldPatternPredicate = (s) => /{(?[^}]{1,2083})}/.test(String(s)))) } ObjectElement(s) { const o = _m.prototype.ObjectElement.call(this, s) @@ -48167,9 +48250,9 @@ const tv = CallbackVisitor class ResponseVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Gh()), - (this.specPath = fc(['document', 'objects', 'Response'])) + (this.specPath = fc(['document', 'objects', 'Response']))) } ObjectElement(s) { const o = cm.prototype.ObjectElement.call(this, s) @@ -48190,18 +48273,18 @@ class ResponseHeaders extends Su.Sh { static primaryClass = 'response-headers' constructor(s, o, i) { - super(s, o, i), this.classes.push(ResponseHeaders.primaryClass) + ;(super(s, o, i), this.classes.push(ResponseHeaders.primaryClass)) } } const nv = ResponseHeaders class response_HeadersVisitor_HeadersVisitor extends Mixin(_m, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new nv()), (this.specPath = (s) => isReferenceLikeElement(s) ? ['document', 'objects', 'Reference'] - : ['document', 'objects', 'Header']) + : ['document', 'objects', 'Header'])) } ObjectElement(s) { const o = _m.prototype.ObjectElement.call(this, s) @@ -48222,32 +48305,32 @@ class ResponseContent extends Su.Sh { static primaryClass = 'response-content' constructor(s, o, i) { - super(s, o, i), + ;(super(s, o, i), this.classes.push(ResponseContent.primaryClass), - this.classes.push('content') + this.classes.push('content')) } } const ov = ResponseContent const iv = class response_ContentVisitor_ContentVisitor extends ty { constructor(s) { - super(s), (this.element = new ov()) + ;(super(s), (this.element = new ov())) } } class ResponseLinks extends Su.Sh { static primaryClass = 'response-links' constructor(s, o, i) { - super(s, o, i), this.classes.push(ResponseLinks.primaryClass) + ;(super(s, o, i), this.classes.push(ResponseLinks.primaryClass)) } } const av = ResponseLinks class response_LinksVisitor_LinksVisitor extends Mixin(_m, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new av()), (this.specPath = (s) => isReferenceLikeElement(s) ? ['document', 'objects', 'Reference'] - : ['document', 'objects', 'Link']) + : ['document', 'objects', 'Link'])) } ObjectElement(s) { const o = _m.prototype.ObjectElement.call(this, s) @@ -48269,9 +48352,8 @@ for ( var i = Array(s < o ? o - s : 0), a = s < 0 ? o + Math.abs(s) : o - s, u = 0; u < a; - ) - (i[u] = u + s), (u += 1) + ((i[u] = u + s), (u += 1)) return i }) const uv = lv @@ -48295,7 +48377,7 @@ var _ = s ? 1 : 0 return !!i._items[u][_] || (o && (i._items[u][_] = !0), !1) } - return o && (i._items[u] = s ? [!1, !0] : [!0, !1]), !1 + return (o && (i._items[u] = s ? [!1, !0] : [!0, !1]), !1) case 'function': return null !== i._nativeSet ? o @@ -48316,7 +48398,7 @@ } const pv = (function () { function _Set() { - ;(this._nativeSet = 'function' == typeof Set ? new Set() : null), (this._items = {}) + ;((this._nativeSet = 'function' == typeof Set ? new Set() : null), (this._items = {})) } return ( (_Set.prototype.add = function (s) { @@ -48331,7 +48413,7 @@ var hv = _curry2(function difference(s, o) { for (var i = [], a = 0, u = s.length, _ = o.length, w = new pv(), x = 0; x < _; x += 1) w.add(o[x]) - for (; a < u; ) w.add(s[a]) && (i[i.length] = s[a]), (a += 1) + for (; a < u; ) (w.add(s[a]) && (i[i.length] = s[a]), (a += 1)) return i }) const dv = hv @@ -48339,18 +48421,18 @@ specPathFixedFields specPathPatternedFields constructor({ specPathFixedFields: s, specPathPatternedFields: o, ...i }) { - super({ ...i }), (this.specPathFixedFields = s), (this.specPathPatternedFields = o) + ;(super({ ...i }), (this.specPathFixedFields = s), (this.specPathPatternedFields = o)) } ObjectElement(s) { const { specPath: o, ignoredFields: i } = this try { this.specPath = this.specPathFixedFields const o = this.retrieveFixedFields(this.specPath(s)) - ;(this.ignoredFields = [...i, ...dv(s.keys(), o)]), + ;((this.ignoredFields = [...i, ...dv(s.keys(), o)]), cm.prototype.ObjectElement.call(this, s), (this.specPath = this.specPathPatternedFields), (this.ignoredFields = o), - bm.prototype.ObjectElement.call(this, s) + bm.prototype.ObjectElement.call(this, s)) } catch (s) { throw ((this.specPath = o), s) } @@ -48360,7 +48442,7 @@ const fv = MixedFieldsVisitor class responses_ResponsesVisitor extends Mixin(fv, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Qh()), (this.specPathFixedFields = fc(['document', 'objects', 'Responses'])), (this.canSupportSpecificationExtensions = !0), @@ -48369,7 +48451,7 @@ ? ['document', 'objects', 'Reference'] : ['document', 'objects', 'Response']), (this.fieldPatternPredicate = (s) => - new RegExp(`^(1XX|2XX|3XX|4XX|5XX|${uv(100, 600).join('|')})$`).test(String(s))) + new RegExp(`^(1XX|2XX|3XX|4XX|5XX|${uv(100, 600).join('|')})$`).test(String(s)))) } ObjectElement(s) { const o = fv.prototype.ObjectElement.call(this, s) @@ -48389,14 +48471,14 @@ const mv = responses_ResponsesVisitor class DefaultVisitor extends Mixin(Im, em) { constructor(s) { - super(s), + ;(super(s), (this.alternator = [ { predicate: isReferenceLikeElement, specPath: ['document', 'objects', 'Reference'], }, { predicate: es_T, specPath: ['document', 'objects', 'Response'] }, - ]) + ])) } ObjectElement(s) { const o = Im.prototype.enter.call(this, s) @@ -48411,39 +48493,39 @@ const gv = DefaultVisitor class OperationVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Dh()), - (this.specPath = fc(['document', 'objects', 'Operation'])) + (this.specPath = fc(['document', 'objects', 'Operation']))) } } const yv = OperationVisitor class OperationTags extends Su.wE { static primaryClass = 'operation-tags' constructor(s, o, i) { - super(s, o, i), this.classes.push(OperationTags.primaryClass) + ;(super(s, o, i), this.classes.push(OperationTags.primaryClass)) } } const vv = OperationTags const bv = class TagsVisitor extends em { constructor(s) { - super(s), (this.element = new vv()) + ;(super(s), (this.element = new vv())) } ArrayElement(s) { - return (this.element = this.element.concat(cloneDeep(s))), qu + return ((this.element = this.element.concat(cloneDeep(s))), qu) } } class OperationParameters extends Su.wE { static primaryClass = 'operation-parameters' constructor(s, o, i) { - super(s, o, i), + ;(super(s, o, i), this.classes.push(OperationParameters.primaryClass), - this.classes.push('parameters') + this.classes.push('parameters')) } } const _v = OperationParameters class open_api_3_0_ParametersVisitor_ParametersVisitor extends Mixin(tm, em) { constructor(s) { - super(s), (this.element = new Su.wE()), this.element.classes.push('parameters') + ;(super(s), (this.element = new Su.wE()), this.element.classes.push('parameters')) } ArrayElement(s) { return ( @@ -48452,7 +48534,8 @@ ? ['document', 'objects', 'Reference'] : ['document', 'objects', 'Parameter'], i = this.toRefractedElement(o, s) - Hm(i) && i.setMetaProperty('referenced-element', 'parameter'), this.element.push(i) + ;(Hm(i) && i.setMetaProperty('referenced-element', 'parameter'), + this.element.push(i)) }), this.copyMetaAndAttributes(s, this.element), qu @@ -48462,19 +48545,19 @@ const Sv = open_api_3_0_ParametersVisitor_ParametersVisitor const Ev = class operation_ParametersVisitor_ParametersVisitor extends Sv { constructor(s) { - super(s), (this.element = new _v()) + ;(super(s), (this.element = new _v())) } } const wv = class RequestBodyVisitor_RequestBodyVisitor extends Im { constructor(s) { - super(s), + ;(super(s), (this.alternator = [ { predicate: isReferenceLikeElement, specPath: ['document', 'objects', 'Reference'], }, { predicate: es_T, specPath: ['document', 'objects', 'RequestBody'] }, - ]) + ])) } ObjectElement(s) { const o = Im.prototype.enter.call(this, s) @@ -48487,19 +48570,19 @@ class OperationCallbacks extends Su.Sh { static primaryClass = 'operation-callbacks' constructor(s, o, i) { - super(s, o, i), this.classes.push(OperationCallbacks.primaryClass) + ;(super(s, o, i), this.classes.push(OperationCallbacks.primaryClass)) } } const xv = OperationCallbacks class CallbacksVisitor_CallbacksVisitor extends Mixin(_m, em) { specPath constructor(s) { - super(s), + ;(super(s), (this.element = new xv()), (this.specPath = (s) => isReferenceLikeElement(s) ? ['document', 'objects', 'Reference'] - : ['document', 'objects', 'Callback']) + : ['document', 'objects', 'Callback'])) } ObjectElement(s) { const o = _m.prototype.ObjectElement.call(this, s) @@ -48515,15 +48598,15 @@ class OperationSecurity extends Su.wE { static primaryClass = 'operation-security' constructor(s, o, i) { - super(s, o, i), + ;(super(s, o, i), this.classes.push(OperationSecurity.primaryClass), - this.classes.push('security') + this.classes.push('security')) } } const Ov = OperationSecurity class SecurityVisitor_SecurityVisitor extends Mixin(tm, em) { constructor(s) { - super(s), (this.element = new Ov()) + ;(super(s), (this.element = new Ov())) } ArrayElement(s) { return ( @@ -48541,30 +48624,30 @@ class OperationServers extends Su.wE { static primaryClass = 'operation-servers' constructor(s, o, i) { - super(s, o, i), + ;(super(s, o, i), this.classes.push(OperationServers.primaryClass), - this.classes.push('servers') + this.classes.push('servers')) } } const Cv = OperationServers const jv = class ServersVisitor_ServersVisitor extends Om { constructor(s) { - super(s), (this.element = new Cv()) + ;(super(s), (this.element = new Cv())) } } class PathItemVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Fh()), - (this.specPath = fc(['document', 'objects', 'PathItem'])) + (this.specPath = fc(['document', 'objects', 'PathItem']))) } ObjectElement(s) { const o = cm.prototype.ObjectElement.call(this, s) return ( this.element.filter(Vm).forEach((s, o) => { const i = cloneDeep(o) - ;(i.content = serializers_value(i).toUpperCase()), - s.setMetaProperty('http-method', i) + ;((i.content = serializers_value(i).toUpperCase()), + s.setMetaProperty('http-method', i)) }), ju(this.element.$ref) && this.element.classes.push('reference-element'), o @@ -48575,87 +48658,87 @@ const Iv = class path_item_$RefVisitor_$RefVisitor extends em { StringElement(s) { const o = super.enter(s) - return this.element.classes.push('reference-value'), o + return (this.element.classes.push('reference-value'), o) } } class PathItemServers extends Su.wE { static primaryClass = 'path-item-servers' constructor(s, o, i) { - super(s, o, i), + ;(super(s, o, i), this.classes.push(PathItemServers.primaryClass), - this.classes.push('servers') + this.classes.push('servers')) } } const Tv = PathItemServers const Nv = class path_item_ServersVisitor_ServersVisitor extends Om { constructor(s) { - super(s), (this.element = new Tv()) + ;(super(s), (this.element = new Tv())) } } class PathItemParameters extends Su.wE { static primaryClass = 'path-item-parameters' constructor(s, o, i) { - super(s, o, i), + ;(super(s, o, i), this.classes.push(PathItemParameters.primaryClass), - this.classes.push('parameters') + this.classes.push('parameters')) } } const Mv = PathItemParameters const Rv = class path_item_ParametersVisitor_ParametersVisitor extends Sv { constructor(s) { - super(s), (this.element = new Mv()) + ;(super(s), (this.element = new Mv())) } } class SecuritySchemeVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Wf()), (this.specPath = fc(['document', 'objects', 'SecurityScheme'])), - (this.canSupportSpecificationExtensions = !0) + (this.canSupportSpecificationExtensions = !0)) } } const Dv = SecuritySchemeVisitor class OAuthFlowsVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Ph()), (this.specPath = fc(['document', 'objects', 'OAuthFlows'])), - (this.canSupportSpecificationExtensions = !0) + (this.canSupportSpecificationExtensions = !0)) } } const Lv = OAuthFlowsVisitor class OAuthFlowVisitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new jh()), (this.specPath = fc(['document', 'objects', 'OAuthFlow'])), - (this.canSupportSpecificationExtensions = !0) + (this.canSupportSpecificationExtensions = !0)) } } const Fv = OAuthFlowVisitor class OAuthFlowScopes extends Su.Sh { static primaryClass = 'oauth-flow-scopes' constructor(s, o, i) { - super(s, o, i), this.classes.push(OAuthFlowScopes.primaryClass) + ;(super(s, o, i), this.classes.push(OAuthFlowScopes.primaryClass)) } } const Bv = OAuthFlowScopes class ScopesVisitor extends Mixin(_m, em) { constructor(s) { - super(s), (this.element = new Bv()), (this.specPath = fc(['value'])) + ;(super(s), (this.element = new Bv()), (this.specPath = fc(['value']))) } } const $v = ScopesVisitor class Tags extends Su.wE { static primaryClass = 'tags' constructor(s, o, i) { - super(s, o, i), this.classes.push(Tags.primaryClass) + ;(super(s, o, i), this.classes.push(Tags.primaryClass)) } } const qv = Tags class TagsVisitor_TagsVisitor extends Mixin(tm, em) { constructor(s) { - super(s), (this.element = new qv()) + ;(super(s), (this.element = new qv())) } ArrayElement(s) { return ( @@ -49093,7 +49176,7 @@ (s) => (o, i = {}) => src_refractor_refract(o, { specPath: s, ...i }) - ;(Xp.refract = src_refractor_createRefractor([ + ;((Xp.refract = src_refractor_createRefractor([ 'visitors', 'document', 'objects', @@ -49310,7 +49393,7 @@ 'objects', 'XML', '$visitor', - ])) + ]))) const Kv = class Callback_Callback extends Xp {} const Gv = class Components_Components extends Qp { get pathItems() { @@ -49350,7 +49433,7 @@ class JsonSchemaDialect extends Su.Om { static default = new JsonSchemaDialect('https://spec.openapis.org/oas/3.1/dialect/base') constructor(s, o, i) { - super(s, o, i), (this.element = 'jsonSchemaDialect') + ;(super(s, o, i), (this.element = 'jsonSchemaDialect')) } } const pb = JsonSchemaDialect @@ -49376,7 +49459,7 @@ const Ob = class Openapi_Openapi extends Ih {} class OpenApi3_1 extends Su.Sh { constructor(s, o, i) { - super(s, o, i), (this.element = 'openApi3_1'), this.classes.push('api') + ;(super(s, o, i), (this.element = 'openApi3_1'), this.classes.push('api')) } get openapi() { return this.get('openapi') @@ -49508,7 +49591,7 @@ } const Rb = class Paths_Paths extends Jh {} class Reference_Reference extends Hh {} - Object.defineProperty(Reference_Reference.prototype, 'description', { + ;(Object.defineProperty(Reference_Reference.prototype, 'description', { get() { return this.get('description') }, @@ -49525,14 +49608,14 @@ this.set('summary', s) }, enumerable: !0, - }) + })) const Lb = Reference_Reference const qb = class RequestBody_RequestBody extends Kh {} const zb = class elements_Response_Response extends Gh {} const Qb = class Responses_Responses extends Qh {} const e_ = class JSONSchema_JSONSchema extends sd { constructor(s, o, i) { - super(s, o, i), (this.element = 'JSONSchemaDraft6') + ;(super(s, o, i), (this.element = 'JSONSchemaDraft6')) } get idProp() { throw new td('id keyword from Core vocabulary has been renamed to $id.') @@ -49657,17 +49740,17 @@ return (function _assoc(s, o, i) { if (Xo(s) && ca(i)) { var a = [].concat(i) - return (a[s] = o), a + return ((a[s] = o), a) } var u = {} for (var _ in i) u[_] = i[_] - return (u[s] = o), u + return ((u[s] = o), u) })(a, o, i) }) const n_ = r_ var s_ = _curry3(function remove(s, o, i) { var a = Array.prototype.slice.call(i, 0) - return a.splice(s, o), a + return (a.splice(s, o), a) }) const o_ = s_ var i_ = _curry3(function assoc(s, o, i) { @@ -49685,7 +49768,7 @@ if (Xo(s) && ca(o)) return o_(s, 1, o) var i = {} for (var a in o) i[a] = o[a] - return delete i[s], i + return (delete i[s], i) })(s[0], o) default: var i = s[0], @@ -49703,14 +49786,14 @@ const l_ = c_ const u_ = class json_schema_JSONSchemaVisitor extends $d { constructor(s) { - super(s), (this.element = new e_()) + ;(super(s), (this.element = new e_())) } get defaultDialectIdentifier() { return 'http://json-schema.org/draft-06/schema#' } BooleanElement(s) { const o = this.enter(s) - return this.element.classes.push('boolean-json-schema'), o + return (this.element.classes.push('boolean-json-schema'), o) } handleSchemaIdentifier(s, o = '$id') { return super.handleSchemaIdentifier(s, o) @@ -49719,19 +49802,20 @@ const p_ = class json_schema_ItemsVisitor_ItemsVisitor extends Ud { BooleanElement(s) { return ( - (this.element = this.toRefractedElement(['document', 'objects', 'JSONSchema'], s)), qu + (this.element = this.toRefractedElement(['document', 'objects', 'JSONSchema'], s)), + qu ) } } const h_ = class json_schema_ExamplesVisitor_ExamplesVisitor extends yd { ArrayElement(s) { const o = this.enter(s) - return this.element.classes.push('json-schema-examples'), o + return (this.element.classes.push('json-schema-examples'), o) } } const d_ = class link_description_LinkDescriptionVisitor extends Pf { constructor(s) { - super(s), (this.element = new t_()) + ;(super(s), (this.element = new t_())) } }, f_ = pipe( @@ -49843,7 +49927,7 @@ (s) => (o, i = {}) => apidom_ns_json_schema_draft_6_src_refractor_refract(o, { specPath: s, ...i }) - ;(e_.refract = apidom_ns_json_schema_draft_6_src_refractor_createRefractor([ + ;((e_.refract = apidom_ns_json_schema_draft_6_src_refractor_createRefractor([ 'visitors', 'document', 'objects', @@ -49856,10 +49940,10 @@ 'objects', 'LinkDescription', '$visitor', - ])) + ]))) const S_ = class elements_JSONSchema_JSONSchema extends e_ { constructor(s, o, i) { - super(s, o, i), (this.element = 'JSONSchemaDraft7') + ;(super(s, o, i), (this.element = 'JSONSchemaDraft7')) } get $comment() { return this.get('$comment') @@ -50028,7 +50112,7 @@ } const w_ = class visitors_json_schema_JSONSchemaVisitor extends u_ { constructor(s) { - super(s), (this.element = new S_()) + ;(super(s), (this.element = new S_())) } get defaultDialectIdentifier() { return 'http://json-schema.org/draft-07/schema#' @@ -50036,7 +50120,7 @@ } const x_ = class json_schema_link_description_LinkDescriptionVisitor extends d_ { constructor(s) { - super(s), (this.element = new E_()) + ;(super(s), (this.element = new E_())) } }, k_ = pipe( @@ -50189,7 +50273,7 @@ (s) => (o, i = {}) => apidom_ns_json_schema_draft_7_src_refractor_refract(o, { specPath: s, ...i }) - ;(S_.refract = apidom_ns_json_schema_draft_7_src_refractor_createRefractor([ + ;((S_.refract = apidom_ns_json_schema_draft_7_src_refractor_createRefractor([ 'visitors', 'document', 'objects', @@ -50202,10 +50286,10 @@ 'objects', 'LinkDescription', '$visitor', - ])) + ]))) const I_ = class src_elements_JSONSchema_JSONSchema extends S_ { constructor(s, o, i) { - super(s, o, i), (this.element = 'JSONSchema201909') + ;(super(s, o, i), (this.element = 'JSONSchema201909')) } get $vocabulary() { return this.get('$vocabulary') @@ -50394,15 +50478,15 @@ } const N_ = class refractor_visitors_json_schema_JSONSchemaVisitor extends w_ { constructor(s) { - super(s), (this.element = new I_()) + ;(super(s), (this.element = new I_())) } get defaultDialectIdentifier() { return 'https://json-schema.org/draft/2019-09/schema' } ObjectElement(s) { - this.handleDialectIdentifier(s), + ;(this.handleDialectIdentifier(s), this.handleSchemaIdentifier(s), - (this.parent = this.element) + (this.parent = this.element)) const o = Md.prototype.ObjectElement.call(this, s) return ( ju(this.element.$ref) && @@ -50415,27 +50499,29 @@ const M_ = class $vocabularyVisitor extends yd { ObjectElement(s) { const o = super.enter(s) - return this.element.classes.push('json-schema-$vocabulary'), o + return (this.element.classes.push('json-schema-$vocabulary'), o) } } const R_ = class $refVisitor extends yd { StringElement(s) { const o = super.enter(s) - return this.element.classes.push('reference-value'), o + return (this.element.classes.push('reference-value'), o) } } class $defsVisitor extends Mixin(Jd, Rd, yd) { constructor(s) { - super(s), + ;(super(s), (this.element = new Su.Sh()), this.element.classes.push('json-schema-$defs'), - (this.specPath = fc(['document', 'objects', 'JSONSchema'])) + (this.specPath = fc(['document', 'objects', 'JSONSchema']))) } } const D_ = $defsVisitor class json_schema_AllOfVisitor_AllOfVisitor extends Mixin(Nd, Rd, yd) { constructor(s) { - super(s), (this.element = new Su.wE()), this.element.classes.push('json-schema-allOf') + ;(super(s), + (this.element = new Su.wE()), + this.element.classes.push('json-schema-allOf')) } ArrayElement(s) { return ( @@ -50451,7 +50537,9 @@ const L_ = json_schema_AllOfVisitor_AllOfVisitor class json_schema_AnyOfVisitor_AnyOfVisitor extends Mixin(Nd, Rd, yd) { constructor(s) { - super(s), (this.element = new Su.wE()), this.element.classes.push('json-schema-anyOf') + ;(super(s), + (this.element = new Su.wE()), + this.element.classes.push('json-schema-anyOf')) } ArrayElement(s) { return ( @@ -50467,7 +50555,9 @@ const F_ = json_schema_AnyOfVisitor_AnyOfVisitor class json_schema_OneOfVisitor_OneOfVisitor extends Mixin(Nd, Rd, yd) { constructor(s) { - super(s), (this.element = new Su.wE()), this.element.classes.push('json-schema-oneOf') + ;(super(s), + (this.element = new Su.wE()), + this.element.classes.push('json-schema-oneOf')) } ArrayElement(s) { return ( @@ -50483,17 +50573,18 @@ const B_ = json_schema_OneOfVisitor_OneOfVisitor class DependentSchemasVisitor extends Mixin(Jd, Rd, yd) { constructor(s) { - super(s), + ;(super(s), (this.element = new Su.Sh()), this.element.classes.push('json-schema-dependentSchemas'), - (this.specPath = fc(['document', 'objects', 'JSONSchema'])) + (this.specPath = fc(['document', 'objects', 'JSONSchema']))) } } const $_ = DependentSchemasVisitor class visitors_json_schema_ItemsVisitor_ItemsVisitor extends Mixin(Nd, Rd, yd) { ObjectElement(s) { return ( - (this.element = this.toRefractedElement(['document', 'objects', 'JSONSchema'], s)), qu + (this.element = this.toRefractedElement(['document', 'objects', 'JSONSchema'], s)), + qu ) } ArrayElement(s) { @@ -50510,38 +50601,39 @@ } BooleanElement(s) { return ( - (this.element = this.toRefractedElement(['document', 'objects', 'JSONSchema'], s)), qu + (this.element = this.toRefractedElement(['document', 'objects', 'JSONSchema'], s)), + qu ) } } const q_ = visitors_json_schema_ItemsVisitor_ItemsVisitor class json_schema_PropertiesVisitor_PropertiesVisitor extends Mixin(Jd, Rd, yd) { constructor(s) { - super(s), + ;(super(s), (this.element = new Su.Sh()), this.element.classes.push('json-schema-properties'), - (this.specPath = fc(['document', 'objects', 'JSONSchema'])) + (this.specPath = fc(['document', 'objects', 'JSONSchema']))) } } const U_ = json_schema_PropertiesVisitor_PropertiesVisitor class PatternPropertiesVisitor_PatternPropertiesVisitor extends Mixin(Jd, Rd, yd) { constructor(s) { - super(s), + ;(super(s), (this.element = new Su.Sh()), this.element.classes.push('json-schema-patternProperties'), - (this.specPath = fc(['document', 'objects', 'JSONSchema'])) + (this.specPath = fc(['document', 'objects', 'JSONSchema']))) } } const V_ = PatternPropertiesVisitor_PatternPropertiesVisitor const z_ = class DependentRequiredVisitor extends yd { ObjectElement(s) { const o = super.enter(s) - return this.element.classes.push('json-schema-dependentRequired'), o + return (this.element.classes.push('json-schema-dependentRequired'), o) } } const W_ = class visitors_json_schema_link_description_LinkDescriptionVisitor extends x_ { constructor(s) { - super(s), (this.element = new T_()) + ;(super(s), (this.element = new T_())) } }, J_ = pipe( @@ -50675,7 +50767,7 @@ Y_ = { namespace: (s) => { const { base: o } = s - return o.register('jSONSchema201909', I_), o.register('linkDescription', T_), o + return (o.register('jSONSchema201909', I_), o.register('linkDescription', T_), o) }, }, X_ = Y_, @@ -50706,7 +50798,7 @@ (s) => (o, i = {}) => apidom_ns_json_schema_2019_09_src_refractor_refract(o, { specPath: s, ...i }) - ;(I_.refract = apidom_ns_json_schema_2019_09_src_refractor_createRefractor([ + ;((I_.refract = apidom_ns_json_schema_2019_09_src_refractor_createRefractor([ 'visitors', 'document', 'objects', @@ -50719,10 +50811,10 @@ 'objects', 'LinkDescription', '$visitor', - ])) + ]))) const Q_ = class apidom_ns_json_schema_2020_12_src_elements_JSONSchema_JSONSchema extends I_ { constructor(s, o, i) { - super(s, o, i), (this.element = 'JSONSchema202012') + ;(super(s, o, i), (this.element = 'JSONSchema202012')) } get $dynamicAnchor() { return this.get('$dynamicAnchor') @@ -50791,7 +50883,7 @@ } const eS = class src_refractor_visitors_json_schema_JSONSchemaVisitor extends N_ { constructor(s) { - super(s), (this.element = new Q_()) + ;(super(s), (this.element = new Q_())) } get defaultDialectIdentifier() { return 'https://json-schema.org/draft/2020-12/schema' @@ -50799,9 +50891,9 @@ } class PrefixItemsVisitor extends Mixin(Nd, Rd, yd) { constructor(s) { - super(s), + ;(super(s), (this.element = new Su.wE()), - this.element.classes.push('json-schema-prefixItems') + this.element.classes.push('json-schema-prefixItems')) } ArrayElement(s) { return ( @@ -50817,7 +50909,7 @@ const tS = PrefixItemsVisitor const rS = class refractor_visitors_json_schema_link_description_LinkDescriptionVisitor extends W_ { constructor(s) { - super(s), (this.element = new Z_()) + ;(super(s), (this.element = new Z_())) } }, nS = pipe( @@ -50920,7 +51012,7 @@ aS = { namespace: (s) => { const { base: o } = s - return o.register('jSONSchema202012', Q_), o.register('linkDescription', Z_), o + return (o.register('jSONSchema202012', Q_), o.register('linkDescription', Z_), o) }, }, cS = aS, @@ -50951,7 +51043,7 @@ (s) => (o, i = {}) => apidom_ns_json_schema_2020_12_src_refractor_refract(o, { specPath: s, ...i }) - ;(Q_.refract = apidom_ns_json_schema_2020_12_src_refractor_createRefractor([ + ;((Q_.refract = apidom_ns_json_schema_2020_12_src_refractor_createRefractor([ 'visitors', 'document', 'objects', @@ -50964,10 +51056,10 @@ 'objects', 'LinkDescription', '$visitor', - ])) + ]))) const lS = class elements_Schema_Schema extends Q_ { constructor(s, o, i) { - super(s, o, i), (this.element = 'schema') + ;(super(s, o, i), (this.element = 'schema')) } get discriminator() { return this.get('discriminator') @@ -51002,100 +51094,100 @@ const mS = class Xml_Xml extends Xf {} class OpenApi3_1Visitor extends Mixin(cm, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Ab()), (this.specPath = fc(['document', 'objects', 'OpenApi'])), (this.canSupportSpecificationExtensions = !0), - (this.openApiSemanticElement = this.element) + (this.openApiSemanticElement = this.element)) } ObjectElement(s) { - return (this.openApiGenericElement = s), cm.prototype.ObjectElement.call(this, s) + return ((this.openApiGenericElement = s), cm.prototype.ObjectElement.call(this, s)) } } const gS = OpenApi3_1Visitor, yS = zv.visitors.document.objects.Info.$visitor const vS = class info_InfoVisitor extends yS { constructor(s) { - super(s), (this.element = new nb()) + ;(super(s), (this.element = new nb())) } }, bS = zv.visitors.document.objects.Contact.$visitor const _S = class contact_ContactVisitor extends bS { constructor(s) { - super(s), (this.element = new Yv()) + ;(super(s), (this.element = new Yv())) } }, SS = zv.visitors.document.objects.License.$visitor const ES = class license_LicenseVisitor extends SS { constructor(s) { - super(s), (this.element = new mb()) + ;(super(s), (this.element = new mb())) } }, wS = zv.visitors.document.objects.Link.$visitor const xS = class link_LinkVisitor extends wS { constructor(s) { - super(s), (this.element = new yb()) + ;(super(s), (this.element = new yb())) } } class JsonSchemaDialectVisitor extends Mixin(tm, em) { StringElement(s) { const o = new pb(serializers_value(s)) - return this.copyMetaAndAttributes(s, o), (this.element = o), qu + return (this.copyMetaAndAttributes(s, o), (this.element = o), qu) } } const kS = JsonSchemaDialectVisitor, OS = zv.visitors.document.objects.Server.$visitor const AS = class server_ServerVisitor extends OS { constructor(s) { - super(s), (this.element = new hS()) + ;(super(s), (this.element = new hS())) } }, CS = zv.visitors.document.objects.ServerVariable.$visitor const jS = class server_variable_ServerVariableVisitor extends CS { constructor(s) { - super(s), (this.element = new dS()) + ;(super(s), (this.element = new dS())) } }, PS = zv.visitors.document.objects.MediaType.$visitor const IS = class media_type_MediaTypeVisitor extends PS { constructor(s) { - super(s), (this.element = new _b()) + ;(super(s), (this.element = new _b())) } }, TS = zv.visitors.document.objects.SecurityRequirement.$visitor const NS = class security_requirement_SecurityRequirementVisitor extends TS { constructor(s) { - super(s), (this.element = new uS()) + ;(super(s), (this.element = new uS())) } }, MS = zv.visitors.document.objects.Components.$visitor const RS = class components_ComponentsVisitor extends MS { constructor(s) { - super(s), (this.element = new Gv()) + ;(super(s), (this.element = new Gv())) } }, DS = zv.visitors.document.objects.Tag.$visitor const LS = class tag_TagVisitor extends DS { constructor(s) { - super(s), (this.element = new fS()) + ;(super(s), (this.element = new fS())) } }, FS = zv.visitors.document.objects.Reference.$visitor const BS = class reference_ReferenceVisitor extends FS { constructor(s) { - super(s), (this.element = new Lb()) + ;(super(s), (this.element = new Lb())) } }, $S = zv.visitors.document.objects.Parameter.$visitor const qS = class parameter_ParameterVisitor extends $S { constructor(s) { - super(s), (this.element = new Ib()) + ;(super(s), (this.element = new Ib())) } }, US = zv.visitors.document.objects.Header.$visitor const VS = class header_HeaderVisitor extends US { constructor(s) { - super(s), (this.element = new tb()) + ;(super(s), (this.element = new tb())) } }, zS = helpers( @@ -51244,17 +51336,17 @@ ) class open_api_3_1_schema_SchemaVisitor extends Mixin(cm, Rd, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new lS()), (this.specPath = fc(['document', 'objects', 'Schema'])), (this.canSupportSpecificationExtensions = !0), (this.jsonSchemaDefaultDialect = pb.default), - this.passingOptionsNames.push('parent') + this.passingOptionsNames.push('parent')) } ObjectElement(s) { - this.handleDialectIdentifier(s), + ;(this.handleDialectIdentifier(s), this.handleSchemaIdentifier(s), - (this.parent = this.element) + (this.parent = this.element)) const o = cm.prototype.ObjectElement.call(this, s) return ( ju(this.element.$ref) && @@ -51290,61 +51382,61 @@ const gE = open_api_3_1_schema_SchemaVisitor const yE = class $defsVisitor_$defsVisitor extends D_ { constructor(s) { - super(s), this.passingOptionsNames.push('parent') + ;(super(s), this.passingOptionsNames.push('parent')) } } const vE = class schema_AllOfVisitor_AllOfVisitor extends L_ { constructor(s) { - super(s), this.passingOptionsNames.push('parent') + ;(super(s), this.passingOptionsNames.push('parent')) } } const bE = class schema_AnyOfVisitor_AnyOfVisitor extends F_ { constructor(s) { - super(s), this.passingOptionsNames.push('parent') + ;(super(s), this.passingOptionsNames.push('parent')) } } const _E = class schema_OneOfVisitor_OneOfVisitor extends B_ { constructor(s) { - super(s), this.passingOptionsNames.push('parent') + ;(super(s), this.passingOptionsNames.push('parent')) } } const SE = class DependentSchemasVisitor_DependentSchemasVisitor extends $_ { constructor(s) { - super(s), this.passingOptionsNames.push('parent') + ;(super(s), this.passingOptionsNames.push('parent')) } } const EE = class PrefixItemsVisitor_PrefixItemsVisitor extends tS { constructor(s) { - super(s), this.passingOptionsNames.push('parent') + ;(super(s), this.passingOptionsNames.push('parent')) } } const wE = class schema_PropertiesVisitor_PropertiesVisitor extends U_ { constructor(s) { - super(s), this.passingOptionsNames.push('parent') + ;(super(s), this.passingOptionsNames.push('parent')) } } const xE = class schema_PatternPropertiesVisitor_PatternPropertiesVisitor extends V_ { constructor(s) { - super(s), this.passingOptionsNames.push('parent') + ;(super(s), this.passingOptionsNames.push('parent')) } }, kE = zv.visitors.document.objects.Discriminator.$visitor const OE = class distriminator_DiscriminatorVisitor extends kE { constructor(s) { - super(s), (this.element = new Xv()), (this.canSupportSpecificationExtensions = !0) + ;(super(s), (this.element = new Xv()), (this.canSupportSpecificationExtensions = !0)) } }, AE = zv.visitors.document.objects.XML.$visitor const CE = class xml_XmlVisitor extends AE { constructor(s) { - super(s), (this.element = new mS()) + ;(super(s), (this.element = new mS())) } } class SchemasVisitor_SchemasVisitor extends Mixin(_m, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new Ay()), - (this.specPath = fc(['document', 'objects', 'Schema'])) + (this.specPath = fc(['document', 'objects', 'Schema']))) } ObjectElement(s) { const o = _m.prototype.ObjectElement.call(this, s) @@ -51360,18 +51452,18 @@ class ComponentsPathItems extends Su.Sh { static primaryClass = 'components-path-items' constructor(s, o, i) { - super(s, o, i), this.classes.push(ComponentsPathItems.primaryClass) + ;(super(s, o, i), this.classes.push(ComponentsPathItems.primaryClass)) } } const PE = ComponentsPathItems class PathItemsVisitor extends Mixin(_m, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new PE()), (this.specPath = (s) => isReferenceLikeElement(s) ? ['document', 'objects', 'Reference'] - : ['document', 'objects', 'PathItem']) + : ['document', 'objects', 'PathItem'])) } ObjectElement(s) { const o = _m.prototype.ObjectElement.call(this, s) @@ -51387,42 +51479,42 @@ TE = zv.visitors.document.objects.Example.$visitor const NE = class example_ExampleVisitor extends TE { constructor(s) { - super(s), (this.element = new Zv()) + ;(super(s), (this.element = new Zv())) } }, ME = zv.visitors.document.objects.ExternalDocumentation.$visitor const RE = class external_documentation_ExternalDocumentationVisitor extends ME { constructor(s) { - super(s), (this.element = new eb()) + ;(super(s), (this.element = new eb())) } }, DE = zv.visitors.document.objects.Encoding.$visitor const LE = class open_api_3_1_encoding_EncodingVisitor extends DE { constructor(s) { - super(s), (this.element = new Qv()) + ;(super(s), (this.element = new Qv())) } }, FE = zv.visitors.document.objects.Paths.$visitor const BE = class paths_PathsVisitor extends FE { constructor(s) { - super(s), (this.element = new Rb()) + ;(super(s), (this.element = new Rb())) } }, $E = zv.visitors.document.objects.RequestBody.$visitor const qE = class request_body_RequestBodyVisitor extends $E { constructor(s) { - super(s), (this.element = new qb()) + ;(super(s), (this.element = new qb())) } }, UE = zv.visitors.document.objects.Callback.$visitor const VE = class callback_CallbackVisitor extends UE { constructor(s) { - super(s), + ;(super(s), (this.element = new Kv()), (this.specPath = (s) => isReferenceLikeElement(s) ? ['document', 'objects', 'Reference'] - : ['document', 'objects', 'PathItem']) + : ['document', 'objects', 'PathItem'])) } ObjectElement(s) { const o = UE.prototype.ObjectElement.call(this, s) @@ -51437,60 +51529,60 @@ zE = zv.visitors.document.objects.Response.$visitor const WE = class response_ResponseVisitor extends zE { constructor(s) { - super(s), (this.element = new zb()) + ;(super(s), (this.element = new zb())) } }, JE = zv.visitors.document.objects.Responses.$visitor const HE = class open_api_3_1_responses_ResponsesVisitor extends JE { constructor(s) { - super(s), (this.element = new Qb()) + ;(super(s), (this.element = new Qb())) } }, KE = zv.visitors.document.objects.Operation.$visitor const GE = class operation_OperationVisitor extends KE { constructor(s) { - super(s), (this.element = new Pb()) + ;(super(s), (this.element = new Pb())) } }, YE = zv.visitors.document.objects.PathItem.$visitor const XE = class path_item_PathItemVisitor extends YE { constructor(s) { - super(s), (this.element = new Mb()) + ;(super(s), (this.element = new Mb())) } }, QE = zv.visitors.document.objects.SecurityScheme.$visitor const ZE = class security_scheme_SecuritySchemeVisitor extends QE { constructor(s) { - super(s), (this.element = new pS()) + ;(super(s), (this.element = new pS())) } }, ew = zv.visitors.document.objects.OAuthFlows.$visitor const tw = class oauth_flows_OAuthFlowsVisitor extends ew { constructor(s) { - super(s), (this.element = new wb()) + ;(super(s), (this.element = new wb())) } }, rw = zv.visitors.document.objects.OAuthFlow.$visitor const nw = class oauth_flow_OAuthFlowVisitor extends rw { constructor(s) { - super(s), (this.element = new Sb()) + ;(super(s), (this.element = new Sb())) } } class Webhooks extends Su.Sh { static primaryClass = 'webhooks' constructor(s, o, i) { - super(s, o, i), this.classes.push(Webhooks.primaryClass) + ;(super(s, o, i), this.classes.push(Webhooks.primaryClass)) } } const sw = Webhooks class WebhooksVisitor extends Mixin(_m, em) { constructor(s) { - super(s), + ;(super(s), (this.element = new sw()), (this.specPath = (s) => isReferenceLikeElement(s) ? ['document', 'objects', 'Reference'] - : ['document', 'objects', 'PathItem']) + : ['document', 'objects', 'PathItem'])) } ObjectElement(s) { const o = _m.prototype.ObjectElement.call(this, s) @@ -51971,7 +52063,7 @@ (s) => (o, i = {}) => apidom_ns_openapi_3_1_src_refractor_refract(o, { specPath: s, ...i }) - ;(Kv.refract = apidom_ns_openapi_3_1_src_refractor_createRefractor([ + ;((Kv.refract = apidom_ns_openapi_3_1_src_refractor_createRefractor([ 'visitors', 'document', 'objects', @@ -52196,7 +52288,7 @@ 'objects', 'XML', '$visitor', - ])) + ]))) const hw = class NotImplementedError extends td {} const dw = class MediaTypes extends Array { unknownMediaType = 'application/octet-stream' @@ -52236,11 +52328,11 @@ refSet errors constructor({ uri: s, depth: o = 0, refSet: i, value: a }) { - ;(this.uri = s), + ;((this.uri = s), (this.value = a), (this.depth = o), (this.refSet = i), - (this.errors = []) + (this.errors = [])) } } const gw = class ReferenceSet { @@ -52248,7 +52340,7 @@ refs circular constructor({ refs: s = [], circular: o = !1 } = {}) { - ;(this.refs = []), (this.circular = o), s.forEach(this.add.bind(this)) + ;((this.refs = []), (this.circular = o), s.forEach(this.add.bind(this))) } get size() { return this.refs.length @@ -52277,11 +52369,11 @@ yield* this.refs } clean() { - this.refs.forEach((s) => { + ;(this.refs.forEach((s) => { s.refSet = void 0 }), (this.rootRef = void 0), - (this.refs.length = 0) + (this.refs.length = 0)) } } function _identity(s) { @@ -52350,7 +52442,7 @@ data parseResult constructor({ uri: s, mediaType: o = 'text/plain', data: i, parseResult: a }) { - ;(this.uri = s), (this.mediaType = o), (this.data = i), (this.parseResult = a) + ;((this.uri = s), (this.mediaType = o), (this.data = i), (this.parseResult = a)) } get extension() { return Jc(this.uri) @@ -52375,7 +52467,7 @@ const kw = class PluginError extends Ko { plugin constructor(s, o) { - super(s, { cause: o.cause }), (this.plugin = o.plugin) + ;(super(s, { cause: o.cause }), (this.plugin = o.plugin)) } }, plugins_filter = async (s, o, i) => { @@ -52400,7 +52492,7 @@ a = !1 if (!$u(s)) { const o = cloneShallow(s) - o.classes.push('result'), (i = new Au([o])), (a = !0) + ;(o.classes.push('result'), (i = new Au([o])), (a = !0)) } const u = new xw({ uri: o.resolve.baseURI, @@ -52431,11 +52523,11 @@ fileExtensions: a = [], mediaTypes: u = [], }) { - ;(this.name = s), + ;((this.name = s), (this.allowEmpty = o), (this.sourceMap = i), (this.fileExtensions = a), - (this.mediaTypes = u) + (this.mediaTypes = u)) } } const Iw = class BinaryParser extends Pw { @@ -52452,7 +52544,7 @@ a = new Au() if (0 !== i.length) { const s = new Su.Om(i) - s.classes.push('result'), a.push(s) + ;(s.classes.push('result'), a.push(s)) } return a } catch (o) { @@ -52479,7 +52571,7 @@ if (void 0 === i) throw new Aw('"openapi-3-1" dereference strategy is not available.') const a = new gw(), u = util_merge(o, { resolve: { internal: !1 }, dereference: { refSet: a } }) - return await i.dereference(s, u), a + return (await i.dereference(s, u), a) } } const Mw = class Resolver { @@ -52499,7 +52591,10 @@ redirects: a = 5, withCredentials: u = !1, } = null != s ? s : {} - super({ name: o }), (this.timeout = i), (this.redirects = a), (this.withCredentials = u) + ;(super({ name: o }), + (this.timeout = i), + (this.redirects = a), + (this.withCredentials = u)) } canRead(s) { return isHttpUrl(s.uri) @@ -52508,8 +52603,8 @@ const Dw = class ResolveError extends Ko {} const Lw = class ResolverError extends Dw {}, { AbortController: Fw, AbortSignal: Bw } = globalThis - void 0 === globalThis.AbortController && (globalThis.AbortController = Fw), - void 0 === globalThis.AbortSignal && (globalThis.AbortSignal = Bw) + ;(void 0 === globalThis.AbortController && (globalThis.AbortController = Fw), + void 0 === globalThis.AbortSignal && (globalThis.AbortSignal = Bw)) const $w = class HTTPResolverSwaggerClient extends Rw { swaggerHTTPClient = http_http swaggerHTTPClientConfig @@ -52518,9 +52613,9 @@ swaggerHTTPClientConfig: o = {}, ...i } = {}) { - super({ ...i, name: 'http-swagger-client' }), + ;(super({ ...i, name: 'http-swagger-client' }), (this.swaggerHTTPClient = s), - (this.swaggerHTTPClientConfig = o) + (this.swaggerHTTPClientConfig = o)) } getHttpClient() { return this.swaggerHTTPClient @@ -52548,8 +52643,8 @@ try { i.headers.delete('Content-Type') } catch { - ;(i = new Response(i.body, { ...i, headers: new Headers(i.headers) })), - i.headers.delete('Content-Type') + ;((i = new Response(i.body, { ...i, headers: new Headers(i.headers) })), + i.headers.delete('Content-Type')) } return i }, @@ -52584,7 +52679,7 @@ if (i) return !0 if (!i) try { - return JSON.parse(s.toString()), !0 + return (JSON.parse(s.toString()), !0) } catch (s) { return !1 } @@ -52598,7 +52693,7 @@ if (this.allowEmpty && '' === i.trim()) return o try { const s = transformers_from(JSON.parse(i)) - return s.classes.push('result'), o.push(s), o + return (s.classes.push('result'), o.push(s), o) } catch (o) { throw new jw(`Error parsing "${s.uri}"`, { cause: o }) } @@ -52619,7 +52714,7 @@ if (i) return !0 if (!i) try { - return fn.load(s.toString(), { schema: rn }), !0 + return (fn.load(s.toString(), { schema: rn }), !0) } catch (s) { return !1 } @@ -52636,7 +52731,7 @@ const s = fn.load(i, { schema: rn }) if (this.allowEmpty && void 0 === s) return o const a = transformers_from(s) - return a.classes.push('result'), o.push(a), o + return (a.classes.push('result'), o.push(a), o) } catch (o) { throw new jw(`Error parsing "${s.uri}"`, { cause: o }) } @@ -52662,7 +52757,7 @@ if (!i) try { const o = s.toString() - return JSON.parse(o), this.detectionRegExp.test(o) + return (JSON.parse(o), this.detectionRegExp.test(o)) } catch (s) { return !1 } @@ -52679,7 +52774,7 @@ try { const s = JSON.parse(i), a = Ab.refract(s, this.refractorOpts) - return a.classes.push('result'), o.push(a), o + return (a.classes.push('result'), o.push(a), o) } catch (o) { throw new jw(`Error parsing "${s.uri}"`, { cause: o }) } @@ -52706,7 +52801,7 @@ if (!i) try { const o = s.toString() - return fn.load(o), this.detectionRegExp.test(o) + return (fn.load(o), this.detectionRegExp.test(o)) } catch (s) { return !1 } @@ -52723,7 +52818,7 @@ const s = fn.load(i, { schema: rn }) if (this.allowEmpty && void 0 === s) return o const a = Ab.refract(s, this.refractorOpts) - return a.classes.push('result'), o.push(a), o + return (a.classes.push('result'), o.push(a), o) } catch (o) { throw new jw(`Error parsing "${s.uri}"`, { cause: o }) } @@ -52745,14 +52840,14 @@ const Gw = class ElementIdentityError extends Go { value constructor(s, o) { - super(s, o), void 0 !== o && (this.value = o.value) + ;(super(s, o), void 0 !== o && (this.value = o.value)) } } class IdentityManager { uuid identityMap constructor({ length: s = 6 } = {}) { - ;(this.uuid = new Kw({ length: s })), (this.identityMap = new WeakMap()) + ;((this.uuid = new Kw({ length: s })), (this.identityMap = new WeakMap())) } identify(s) { if (!Cu(s)) @@ -52764,7 +52859,7 @@ return s.id if (this.identityMap.has(s)) return this.identityMap.get(s) const o = new Su.Om(this.generateId()) - return this.identityMap.set(s, o), o + return (this.identityMap.set(s, o), o) } forget(s) { return !!this.identityMap.has(s) && (this.identityMap.delete(s), !0) @@ -52779,7 +52874,7 @@ }), traversal_find = (s, o) => { const i = new PredicateVisitor({ predicate: s, returnOnTrue: qu }) - return visitor_visit(o, i), Yw(void 0, [0], i.result) + return (visitor_visit(o, i), Yw(void 0, [0], i.result)) } const Xw = class JsonSchema$anchorError extends Ko {} const Qw = class EvaluationJsonSchema$anchorError extends Xw {} @@ -52804,7 +52899,7 @@ }, traversal_filter = (s, o) => { const i = new PredicateVisitor({ predicate: s }) - return visitor_visit(o, i), new Su.G6(i.result) + return (visitor_visit(o, i), new Su.G6(i.result)) } const ex = class JsonSchemaUriError extends Ko {} const tx = class EvaluationJsonSchemaUriError extends ex {}, @@ -52821,7 +52916,7 @@ refractToSchemaElement = (s) => { if (refractToSchemaElement.cache.has(s)) return refractToSchemaElement.cache.get(s) const o = lS.refract(s) - return refractToSchemaElement.cache.set(s, o), o + return (refractToSchemaElement.cache.set(s, o), o) } refractToSchemaElement.cache = new WeakMap() const maybeRefractToSchemaElement = (s) => @@ -52917,13 +53012,13 @@ refractCache: _ = new Map(), allOfDiscriminatorMapping: w = new Map(), }) { - ;(this.indirections = a), + ;((this.indirections = a), (this.namespace = o), (this.reference = s), (this.options = i), (this.ancestors = new AncestorLineage(...u)), (this.refractCache = _), - (this.allOfDiscriminatorMapping = w) + (this.allOfDiscriminatorMapping = w)) } toBaseURI(s) { return resolve(this.reference.uri, sanitize(stripHash(s))) @@ -52993,11 +53088,11 @@ i = `${o}-${serializers_value(ix.identify(V))}` if (this.refractCache.has(i)) V = this.refractCache.get(i) else if (isReferenceLikeElement(V)) - (V = Lb.refract(V)), + ((V = Lb.refract(V)), V.setMetaProperty('referenced-element', o), - this.refractCache.set(i, V) + this.refractCache.set(i, V)) else { - ;(V = this.namespace.getElementClass(o).refract(V)), this.refractCache.set(i, V) + ;((V = this.namespace.getElementClass(o).refract(V)), this.refractCache.set(i, V)) } } if (s === V) throw new Ko('Recursive Reference Object detected') @@ -53025,7 +53120,7 @@ ? z : this.options.dereference.circularReplacer )(o) - return _.replaceWith(a, mutationReplacer), !i && a + return (_.replaceWith(a, mutationReplacer), !i && a) } } const Z = stripHash(B.refSet.rootRef.uri) !== B.uri, @@ -53041,11 +53136,11 @@ ancestors: w, allOfDiscriminatorMapping: this.allOfDiscriminatorMapping, }) - ;(V = await ox(V, o, { + ;((V = await ox(V, o, { keyMap: lw, nodeTypeGetter: apidom_ns_openapi_3_1_src_traversal_visitor_getNodeType, })), - x.delete(s) + x.delete(s)) } this.indirections.pop() const ie = cloneShallow(V) @@ -53115,7 +53210,7 @@ ? z : this.options.dereference.circularReplacer )(o) - return _.replaceWith(a, mutationReplacer), !i && a + return (_.replaceWith(a, mutationReplacer), !i && a) } } const Z = stripHash(B.refSet.rootRef.uri) !== B.uri, @@ -53131,25 +53226,25 @@ ancestors: w, allOfDiscriminatorMapping: this.allOfDiscriminatorMapping, }) - ;(V = await ox(V, o, { + ;((V = await ox(V, o, { keyMap: lw, nodeTypeGetter: apidom_ns_openapi_3_1_src_traversal_visitor_getNodeType, })), - x.delete(s) + x.delete(s)) } if ((this.indirections.pop(), sE(V))) { const o = new Mb([...V.content], cloneDeep(V.meta), cloneDeep(V.attributes)) - o.setMetaProperty('id', ix.generateId()), + ;(o.setMetaProperty('id', ix.generateId()), s.forEach((s, i, a) => { - o.remove(serializers_value(i)), o.content.push(a) + ;(o.remove(serializers_value(i)), o.content.push(a)) }), o.remove('$ref'), o.setMetaProperty('ref-fields', { $ref: serializers_value(s.$ref) }), o.setMetaProperty('ref-origin', B.uri), o.setMetaProperty('ref-referencing-element-id', cloneDeep(ix.identify(s))), - (V = o) + (V = o)) } - return _.replaceWith(V, mutationReplacer), i ? void 0 : V + return (_.replaceWith(V, mutationReplacer), i ? void 0 : V) } async LinkElement(s, o, i, a, u, _) { if (!ju(s.operationRef) && !ju(s.operationId)) return @@ -53173,7 +53268,7 @@ ? (w = this.refractCache.get(s)) : ((w = Pb.refract(w)), this.refractCache.set(s, w)) } - ;(w = cloneShallow(w)), w.setMetaProperty('ref-origin', j.uri) + ;((w = cloneShallow(w)), w.setMetaProperty('ref-origin', j.uri)) const L = cloneShallow(s) return ( null === (x = L.operationRef) || void 0 === x || x.meta.set('operation', w), @@ -53214,7 +53309,7 @@ L = cloneShallow(j.value.result) L.setMetaProperty('ref-origin', j.uri) const B = cloneShallow(s) - return (B.value = L), _.replaceWith(B, mutationReplacer), i ? void 0 : B + return ((B.value = L), _.replaceWith(B, mutationReplacer), i ? void 0 : B) } async MemberElement(s, o, i, a, u, _) { var w @@ -53235,7 +53330,7 @@ $ = serializers_value(s.value), U = /^[a-zA-Z0-9\\.\\-_]+$/.test($) ? `#/components/schemas/${$}` : $, V = new lS({ $ref: U }) - V.setMetaProperty('ancestorsSchemaIdentifiers', B), j.add(V) + ;(V.setMetaProperty('ancestorsSchemaIdentifiers', B), j.add(V)) const z = new OpenAPI3_1DereferenceVisitor({ reference: this.reference, namespace: this.namespace, @@ -53249,7 +53344,7 @@ keyMap: lw, nodeTypeGetter: apidom_ns_openapi_3_1_src_traversal_visitor_getNodeType, }) - j.delete(V), this.indirections.pop() + ;(j.delete(V), this.indirections.pop()) const Z = cloneShallow(s) return ( Z.value.setMetaProperty('ref-schema', Y), @@ -53297,9 +53392,9 @@ C = await this.toReference(unsanitize(L)) const s = fromURIReference(L), o = maybeRefractToSchemaElement(C.value.result) - ;(z = apidom_evaluate(o, s)), + ;((z = apidom_evaluate(o, s)), (z = maybeRefractToSchemaElement(z)), - (z.id = ix.identify(z)) + (z.id = ix.identify(z))) } } catch (s) { if (!(V && s instanceof tx)) throw s @@ -53314,9 +53409,9 @@ C = await this.toReference(unsanitize(L)) const s = uriToAnchor(L), o = maybeRefractToSchemaElement(C.value.result) - ;(z = $anchor_evaluate(s, o)), + ;((z = $anchor_evaluate(s, o)), (z = maybeRefractToSchemaElement(z)), - (z.id = ix.identify(z)) + (z.id = ix.identify(z))) } else { if ( ((j = this.toBaseURI(L)), @@ -53329,9 +53424,9 @@ C = await this.toReference(unsanitize(L)) const s = fromURIReference(L), o = maybeRefractToSchemaElement(C.value.result) - ;(z = apidom_evaluate(o, s)), + ;((z = apidom_evaluate(o, s)), (z = maybeRefractToSchemaElement(z)), - (z.id = ix.identify(z)) + (z.id = ix.identify(z))) } } if (s === z) throw new Ko('Recursive Schema Object reference detected') @@ -53359,7 +53454,7 @@ ? ee : this.options.dereference.circularReplacer )(o) - return _.replaceWith(a, mutationReplacer), !i && a + return (_.replaceWith(a, mutationReplacer), !i && a) } } const ae = stripHash(C.refSet.rootRef.uri) !== C.uri, @@ -53375,11 +53470,11 @@ ancestors: w, allOfDiscriminatorMapping: this.allOfDiscriminatorMapping, }) - ;(z = await ox(z, o, { + ;((z = await ox(z, o, { keyMap: lw, nodeTypeGetter: apidom_ns_openapi_3_1_src_traversal_visitor_getNodeType, })), - x.delete(s) + x.delete(s)) } if ((this.indirections.pop(), predicates_isBooleanJsonSchemaElement(z))) { const o = cloneDeep(z) @@ -53401,7 +53496,7 @@ if ( (o.setMetaProperty('id', ix.generateId()), s.forEach((s, i, a) => { - o.remove(serializers_value(i)), o.content.push(a) + ;(o.remove(serializers_value(i)), o.content.push(a)) }), o.remove('$ref'), o.setMetaProperty('ref-fields', { @@ -53430,12 +53525,12 @@ var de const s = null !== (de = this.allOfDiscriminatorMapping.get(_)) && void 0 !== de ? de : [] - s.push(i), this.allOfDiscriminatorMapping.set(_, s) + ;(s.push(i), this.allOfDiscriminatorMapping.set(_, s)) } } z = o } - return _.replaceWith(z, mutationReplacer), i ? void 0 : z + return (_.replaceWith(z, mutationReplacer), i ? void 0 : z) } } const ax = OpenAPI3_1DereferenceVisitor, @@ -53457,7 +53552,7 @@ _ = new gw() let w, x = u - u.has(s.uri) + ;(u.has(s.uri) ? (w = u.find(Ww(s.uri, 'uri'))) : ((w = new mw({ uri: s.uri, value: s.parseResult })), u.add(w)), o.dereference.immutable && @@ -53465,7 +53560,7 @@ .map((s) => new mw({ ...s, value: cloneDeep(s.value) })) .forEach((s) => _.add(s)), (w = _.find((o) => o.uri === s.uri)), - (x = _)) + (x = _))) const C = new ax({ reference: w, namespace: a, options: o }), j = await cx(x.rootRef.value, C, { keyMap: lw, @@ -53511,25 +53606,25 @@ } catch (o) { var a, _ const w = new Error(o, { cause: o }) - ;(w.fullPath = [...to_path([...u, i, s]), 'properties']), + ;((w.fullPath = [...to_path([...u, i, s]), 'properties']), null === (a = this.options.dereference.dereferenceOpts) || void 0 === a || null === (a = a.errors) || void 0 === a || null === (_ = a.push) || void 0 === _ || - _.call(a, w) + _.call(a, w)) } }) }, } constructor({ modelPropertyMacro: s, options: o }) { - ;(this.modelPropertyMacro = s), (this.options = o) + ;((this.modelPropertyMacro = s), (this.options = o)) } } var px = (function () { function XUniqWith(s, o) { - ;(this.xf = o), (this.pred = s), (this.items = []) + ;((this.xf = o), (this.pred = s), (this.items = [])) } return ( (XUniqWith.prototype['@@transducer/init'] = _xfBase_init), @@ -53550,7 +53645,7 @@ var hx = _curry2( _dispatchable([], _xuniqWith, function (s, o) { for (var i, a = 0, u = o.length, _ = []; a < u; ) - _includesWith(s, (i = o[a]), _) || (_[_.length] = i), (a += 1) + (_includesWith(s, (i = o[a]), _) || (_[_.length] = i), (a += 1)) return _ }) ) @@ -53609,7 +53704,8 @@ s.equals(serializers_value(o)), i = cloneShallow(s) return ( - (i.content = dx(areElementsEqual)([...s.content, ...o.content])), i + (i.content = dx(areElementsEqual)([...s.content, ...o.content])), + i ) } return dd(s, o) @@ -53654,19 +53750,19 @@ } catch (s) { var x, C const o = new Error(s, { cause: s }) - ;(o.fullPath = to_path([...u, i])), + ;((o.fullPath = to_path([...u, i])), null === (x = this.options.dereference.dereferenceOpts) || void 0 === x || null === (x = x.errors) || void 0 === x || null === (C = x.push) || void 0 === C || - C.call(x, o) + C.call(x, o)) } }, } constructor({ parameterMacro: s, options: o }) { - ;(this.parameterMacro = s), (this.options = o) + ;((this.parameterMacro = s), (this.options = o)) } }, get_root_cause = (s) => { @@ -53692,10 +53788,10 @@ basePath: i = null, ...a }) { - super(a), + ;(super(a), (this.allowMetaPatches = s), (this.useCircularStructures = o), - (this.basePath = i) + (this.basePath = i)) } async ReferenceElement(s, o, i, a, u, _) { try { @@ -53716,11 +53812,11 @@ i = `${o}-${serializers_value(bx.identify(z))}` if (this.refractCache.has(i)) z = this.refractCache.get(i) else if (isReferenceLikeElement(z)) - (z = Lb.refract(z)), + ((z = Lb.refract(z)), z.setMetaProperty('referenced-element', o), - this.refractCache.set(i, z) + this.refractCache.set(i, z)) else { - ;(z = this.namespace.getElementClass(o).refract(z)), this.refractCache.set(i, z) + ;((z = this.namespace.getElementClass(o).refract(z)), this.refractCache.set(i, z)) } } if (s === z) throw new Ko('Recursive Reference Object detected') @@ -53750,7 +53846,7 @@ ? w : this.options.dereference.circularReplacer )(o) - return _.replaceWith(o, dereference_mutationReplacer), !i && a + return (_.replaceWith(o, dereference_mutationReplacer), !i && a) } } const Y = stripHash($.refSet.rootRef.uri) !== $.uri, @@ -53772,11 +53868,11 @@ ? C : [...to_path([...u, i, s]), '$ref'], }) - ;(z = await vx(z, _, { + ;((z = await vx(z, _, { keyMap: lw, nodeTypeGetter: apidom_ns_openapi_3_1_src_traversal_visitor_getNodeType, })), - a.delete(s) + a.delete(s)) } this.indirections.pop() const ee = cloneShallow(z) @@ -53800,7 +53896,7 @@ const s = resolve(j, U) ee.set('$$ref', s) } - return _.replaceWith(ee, dereference_mutationReplacer), !i && ee + return (_.replaceWith(ee, dereference_mutationReplacer), !i && ee) } catch (o) { var j, L, B const a = get_root_cause(o), @@ -53873,7 +53969,7 @@ ? w : this.options.dereference.circularReplacer )(o) - return _.replaceWith(o, dereference_mutationReplacer), !i && a + return (_.replaceWith(o, dereference_mutationReplacer), !i && a) } } const Y = stripHash($.refSet.rootRef.uri) !== $.uri, @@ -53894,17 +53990,17 @@ ? C : [...to_path([...u, i, s]), '$ref'], }) - ;(z = await vx(z, _, { + ;((z = await vx(z, _, { keyMap: lw, nodeTypeGetter: apidom_ns_openapi_3_1_src_traversal_visitor_getNodeType, })), - a.delete(s) + a.delete(s)) } if ((this.indirections.pop(), sE(z))) { const o = new Mb([...z.content], cloneDeep(z.meta), cloneDeep(z.attributes)) if ( (s.forEach((s, i, a) => { - o.remove(serializers_value(i)), o.content.push(a) + ;(o.remove(serializers_value(i)), o.content.push(a)) }), o.remove('$ref'), o.setMetaProperty('ref-fields', { $ref: serializers_value(s.$ref) }), @@ -53917,7 +54013,7 @@ } z = o } - return _.replaceWith(z, dereference_mutationReplacer), i ? void 0 : z + return (_.replaceWith(z, dereference_mutationReplacer), i ? void 0 : z) } catch (o) { var j, L, B const a = get_root_cause(o), @@ -53982,9 +54078,9 @@ j = await this.toReference(unsanitize(B)) const s = fromURIReference(B), o = maybeRefractToSchemaElement(j.value.result) - ;(Y = apidom_evaluate(o, s)), + ;((Y = apidom_evaluate(o, s)), (Y = maybeRefractToSchemaElement(Y)), - (Y.id = bx.identify(Y)) + (Y.id = bx.identify(Y))) } } catch (s) { if (!(z && s instanceof tx)) throw s @@ -53999,9 +54095,9 @@ j = await this.toReference(unsanitize(B)) const s = uriToAnchor(B), o = maybeRefractToSchemaElement(j.value.result) - ;(Y = $anchor_evaluate(s, o)), + ;((Y = $anchor_evaluate(s, o)), (Y = maybeRefractToSchemaElement(Y)), - (Y.id = bx.identify(Y)) + (Y.id = bx.identify(Y))) } else { if ( ((L = this.toBaseURI(serializers_value(B))), @@ -54014,9 +54110,9 @@ j = await this.toReference(unsanitize(B)) const s = fromURIReference(B), o = maybeRefractToSchemaElement(j.value.result) - ;(Y = apidom_evaluate(o, s)), + ;((Y = apidom_evaluate(o, s)), (Y = maybeRefractToSchemaElement(Y)), - (Y.id = bx.identify(Y)) + (Y.id = bx.identify(Y))) } } if (s === Y) throw new Ko('Recursive Schema Object reference detected') @@ -54046,7 +54142,7 @@ ? w : this.options.dereference.circularReplacer )(o) - return _.replaceWith(a, dereference_mutationReplacer), !i && a + return (_.replaceWith(a, dereference_mutationReplacer), !i && a) } } const ie = stripHash(j.refSet.rootRef.uri) !== j.uri, @@ -54067,11 +54163,11 @@ ? C : [...to_path([...u, i, s]), '$ref'], }) - ;(Y = await vx(Y, _, { + ;((Y = await vx(Y, _, { keyMap: lw, nodeTypeGetter: apidom_ns_openapi_3_1_src_traversal_visitor_getNodeType, })), - a.delete(s) + a.delete(s)) } if ((this.indirections.pop(), predicates_isBooleanJsonSchemaElement(Y))) { const o = cloneDeep(Y) @@ -54087,7 +54183,7 @@ const o = new lS([...Y.content], cloneDeep(Y.meta), cloneDeep(Y.attributes)) if ( (s.forEach((s, i, a) => { - o.remove(serializers_value(i)), o.content.push(a) + ;(o.remove(serializers_value(i)), o.content.push(a)) }), o.remove('$ref'), o.setMetaProperty('ref-fields', { $ref: serializers_value(s.$ref) }), @@ -54100,7 +54196,7 @@ } Y = o } - return _.replaceWith(Y, dereference_mutationReplacer), i ? void 0 : Y + return (_.replaceWith(Y, dereference_mutationReplacer), i ? void 0 : Y) } catch (o) { var j, L, B const a = get_root_cause(o), @@ -54156,10 +54252,10 @@ const Ex = class RootVisitor { constructor({ parameterMacro: s, modelPropertyMacro: o, mode: i, options: a, ...u }) { const _ = [] - _.push(new _x({ ...u, options: a })), + ;(_.push(new _x({ ...u, options: a })), 'function' == typeof o && _.push(new ux({ modelPropertyMacro: o, options: a })), 'strict' !== i && _.push(new fx({ options: a })), - 'function' == typeof s && _.push(new mx({ parameterMacro: s, options: a })) + 'function' == typeof s && _.push(new mx({ parameterMacro: s, options: a }))) const w = Sx(_, { nodeTypeGetter: apidom_ns_openapi_3_1_src_traversal_visitor_getNodeType, }) @@ -54181,13 +54277,13 @@ ancestors: u = [], ..._ } = {}) { - super({ ..._ }), + ;(super({ ..._ }), (this.name = 'openapi-3-1-swagger-client'), (this.allowMetaPatches = s), (this.parameterMacro = o), (this.modelPropertyMacro = i), (this.mode = a), - (this.ancestors = [...u]) + (this.ancestors = [...u])) } async dereference(s, o) { var i @@ -54196,7 +54292,7 @@ _ = new gw() let w, x = u - u.has(s.uri) + ;(u.has(s.uri) ? (w = u.find((o) => o.uri === s.uri)) : ((w = new mw({ uri: s.uri, value: s.parseResult })), u.add(w)), o.dereference.immutable && @@ -54204,7 +54300,7 @@ .map((s) => new mw({ ...s, value: cloneDeep(s.value) })) .forEach((s) => _.add(s)), (w = _.find((o) => o.uri === s.uri)), - (x = _)) + (x = _))) const C = new Ex({ reference: w, namespace: a, @@ -54365,13 +54461,13 @@ } var Ox = (function () { function _ObjectMap() { - ;(this.map = {}), (this.length = 0) + ;((this.map = {}), (this.length = 0)) } return ( (_ObjectMap.prototype.set = function (s, o) { var i = this.hash(s), a = this.map[i] - a || (this.map[i] = a = []), a.push([s, o]), (this.length += 1) + ;(a || (this.map[i] = a = []), a.push([s, o]), (this.length += 1)) }), (_ObjectMap.prototype.hash = function (s) { var o = [] @@ -54398,11 +54494,11 @@ })(), Ax = (function () { function XReduceBy(s, o, i, a) { - ;(this.valueFn = s), + ;((this.valueFn = s), (this.valueAcc = o), (this.keyFn = i), (this.xf = a), - (this.inputs = {}) + (this.inputs = {})) } return ( (XReduceBy.prototype['@@transducer/init'] = _xfBase_init), @@ -54416,7 +54512,7 @@ s = s['@@transducer/value'] break } - return (this.inputs = null), this.xf['@@transducer/result'](s) + return ((this.inputs = null), this.xf['@@transducer/result'](s)) }), (XReduceBy.prototype['@@transducer/step'] = function (s, o) { var i = this.keyFn(o) @@ -54450,22 +54546,22 @@ _checkForMethod( 'groupBy', Cx(function (s, o) { - return s.push(o), s + return (s.push(o), s) }, []) ) ) const Px = class NormalizeStorage { internalStore constructor(s, o, i) { - ;(this.storageElement = s), (this.storageField = o), (this.storageSubField = i) + ;((this.storageElement = s), (this.storageField = o), (this.storageSubField = i)) } get store() { if (!this.internalStore) { let s = this.storageElement.get(this.storageField) Nu(s) || ((s = new Su.Sh()), this.storageElement.set(this.storageField, s)) let o = s.get(this.storageSubField) - Mu(o) || ((o = new Su.wE()), s.set(this.storageSubField, o)), - (this.internalStore = o) + ;(Mu(o) || ((o = new Su.wE()), s.set(this.storageSubField, o)), + (this.internalStore = o)) } return this.internalStore } @@ -54507,7 +54603,7 @@ }, leave() { const s = jx((s) => serializers_value(s.operationId), x) - Object.entries(s).forEach(([s, o]) => { + ;(Object.entries(s).forEach(([s, o]) => { Array.isArray(o) && (o.length <= 1 || o.forEach((o, i) => { @@ -54528,7 +54624,7 @@ }), (x.length = 0), (C.length = 0), - (j = void 0) + (j = void 0)) }, }, PathItemElement: { @@ -54608,7 +54704,7 @@ if (_.includes(j)) return const L = Yw([], ['parameters', 'content'], s), B = dx(parameterEquals, [...L, ...C]) - ;(s.parameters = new _v(B)), _.append(j) + ;((s.parameters = new _v(B)), _.append(j)) }, }, }, @@ -54623,11 +54719,11 @@ visitor: { OpenApi3_1Element: { enter(o) { - ;(_ = new Px(o, s, 'security-requirements')), - i.isArrayElement(o.security) && (u = o.security) + ;((_ = new Px(o, s, 'security-requirements')), + i.isArrayElement(o.security) && (u = o.security)) }, leave() { - ;(_ = void 0), (u = void 0) + ;((_ = void 0), (u = void 0)) }, }, OperationElement: { @@ -54776,9 +54872,9 @@ i.classes.push('result') const a = o(i), u = serializers_value(a) - return kx.cache.set(u, a), serializers_value(a) + return (kx.cache.set(u, a), serializers_value(a)) })(s) - return (i.$$normalized = !0), i + return ((i.$$normalized = !0), i) } var o return Cu(s) ? openapi_3_1_apidom_normalize(s) : s @@ -54827,7 +54923,7 @@ return Pp.SEM_OK }, Mx = new (function server_url_templating_grammar() { - ;(this.grammarObject = 'grammarObject'), + ;((this.grammarObject = 'grammarObject'), (this.rules = []), (this.rules[0] = { name: 'server-url-template', @@ -54968,15 +55064,15 @@ (s += 'iprivate = %xE000-F8FF / %xF0000-FFFFD / %x100000-10FFFD\n'), '; OpenAPI Server URL templating ABNF syntax\nserver-url-template = 1*( literals / server-variable ) ; variant of https://www.rfc-editor.org/rfc/rfc6570#section-2\nserver-variable = "{" server-variable-name "}"\nserver-variable-name = 1*( %x00-7A / %x7C / %x7E-10FFFF ) ; every UTF8 character except { and } (from OpenAPI)\n\n; https://www.rfc-editor.org/rfc/rfc6570#section-2.1\n; https://www.rfc-editor.org/errata/eid6937\nliterals = 1*( %x21 / %x23-24 / %x26-3B / %x3D / %x3F-5B\n / %x5D / %x5F / %x61-7A / %x7E / ucschar / iprivate\n / pct-encoded)\n ; any Unicode character except: CTL, SP,\n ; DQUOTE, "%" (aside from pct-encoded),\n ; "<", ">", "\\", "^", "`", "{", "|", "}"\n\n; https://www.rfc-editor.org/rfc/rfc6570#section-1.5\nDIGIT = %x30-39 ; 0-9\nHEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F" ; case-insensitive\n\npct-encoded = "%" HEXDIG HEXDIG\n\nucschar = %xA0-D7FF / %xF900-FDCF / %xFDF0-FFEF\n / %x10000-1FFFD / %x20000-2FFFD / %x30000-3FFFD\n / %x40000-4FFFD / %x50000-5FFFD / %x60000-6FFFD\n / %x70000-7FFFD / %x80000-8FFFD / %x90000-9FFFD\n / %xA0000-AFFFD / %xB0000-BFFFD / %xC0000-CFFFD\n / %xD0000-DFFFD / %xE1000-EFFFD\n\niprivate = %xE000-F8FF / %xF0000-FFFFD / %x100000-10FFFD\n' ) - }) + })) })(), openapi_server_url_templating_es_parse = (s) => { const o = new kp() - ;(o.ast = new Op()), + ;((o.ast = new Op()), (o.ast.callbacks['server-url-template'] = server_url_template), (o.ast.callbacks['server-variable'] = callbacks_server_variable), (o.ast.callbacks['server-variable-name'] = server_variable_name), - (o.ast.callbacks.literals = callbacks_literals) + (o.ast.callbacks.literals = callbacks_literals)) return { result: o.parse(Mx, 'server-url-template', s), ast: o.ast } }, openapi_server_url_templating_es_test = (s, { strict: o = !1 } = {}) => { @@ -54988,7 +55084,7 @@ const u = a.some(([s]) => 'server-variable' === s) if (!o && !u) try { - return new URL(s, 'https://vladimirgorej.com'), !0 + return (new URL(s, 'https://vladimirgorej.com'), !0) } catch { return !1 } @@ -55024,7 +55120,7 @@ return w.join('') } function path_templating_grammar() { - ;(this.grammarObject = 'grammarObject'), + ;((this.grammarObject = 'grammarObject'), (this.rules = []), (this.rules[0] = { name: 'path-template', @@ -55167,10 +55263,11 @@ (s += 'HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"\n'), '; OpenAPI Path Templating ABNF syntax\n; variant of https://datatracker.ietf.org/doc/html/rfc3986#section-3.3\npath-template = slash *( path-segment slash ) [ path-segment ]\npath-segment = 1*( path-literal / template-expression )\nslash = "/"\npath-literal = 1*pchar\ntemplate-expression = "{" template-expression-param-name "}"\ntemplate-expression-param-name = 1*( %x00-7A / %x7C / %x7E-10FFFF ) ; every UTF8 character except { and } (from OpenAPI)\n\n; https://datatracker.ietf.org/doc/html/rfc3986#section-3.3\npchar = unreserved / pct-encoded / sub-delims / ":" / "@"\nunreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"\n ; https://datatracker.ietf.org/doc/html/rfc3986#section-2.3\npct-encoded = "%" HEXDIG HEXDIG\n ; https://datatracker.ietf.org/doc/html/rfc3986#section-2.1\nsub-delims = "!" / "$" / "&" / "\'" / "(" / ")"\n / "*" / "+" / "," / ";" / "="\n ; https://datatracker.ietf.org/doc/html/rfc3986#section-2.2\n\n; https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1\nALPHA = %x41-5A / %x61-7A ; A-Z / a-z\nDIGIT = %x30-39 ; 0-9\nHEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"\n' ) - }) + })) } const callbacks_slash = (s, o, i, a, u) => ( - s === Pp.SEM_PRE ? u.push(['slash', jp.charsToString(o, i, a)]) : Pp.SEM_POST, Pp.SEM_OK + s === Pp.SEM_PRE ? u.push(['slash', jp.charsToString(o, i, a)]) : Pp.SEM_POST, + Pp.SEM_OK ), path_template = (s, o, i, a, u) => { if (s === Pp.SEM_PRE) { @@ -55198,12 +55295,12 @@ Dx = new path_templating_grammar(), openapi_path_templating_es_parse = (s) => { const o = new kp() - ;(o.ast = new Op()), + ;((o.ast = new Op()), (o.ast.callbacks['path-template'] = path_template), (o.ast.callbacks.slash = callbacks_slash), (o.ast.callbacks['path-literal'] = path_literal), (o.ast.callbacks['template-expression'] = template_expression), - (o.ast.callbacks['template-expression-param-name'] = template_expression_param_name) + (o.ast.callbacks['template-expression-param-name'] = template_expression_param_name)) return { result: o.parse(Dx, 'path-template', s), ast: o.ast } }, encodePathComponent = (s) => @@ -55240,15 +55337,15 @@ void 0 !== o && (s.body = o) }, header: function headerBuilder({ req: s, parameter: o, value: i }) { - ;(s.headers = s.headers || {}), void 0 !== i && (s.headers[o.name] = i) + ;((s.headers = s.headers || {}), void 0 !== i && (s.headers[o.name] = i)) }, query: function queryBuilder({ req: s, value: o, parameter: i }) { - ;(s.query = s.query || {}), !1 === o && 'boolean' === i.type && (o = 'false') + ;((s.query = s.query || {}), !1 === o && 'boolean' === i.type && (o = 'false')) 0 === o && ['number', 'integer'].indexOf(i.type) > -1 && (o = '0') if (o) s.query[i.name] = { collectionFormat: i.collectionFormat, value: o } else if (i.allowEmptyValue && void 0 !== o) { const o = i.name - ;(s.query[o] = s.query[o] || {}), (s.query[o].allowEmptyValue = !0) + ;((s.query[o] = s.query[o] || {}), (s.query[o].allowEmptyValue = !0)) } }, path: function pathBuilder({ req: s, value: o, parameter: i, baseURL: a }) { @@ -55262,12 +55359,12 @@ !1 === o && 'boolean' === i.type && (o = 'false') 0 === o && ['number', 'integer'].indexOf(i.type) > -1 && (o = '0') if (o) - (s.form = s.form || {}), - (s.form[i.name] = { collectionFormat: i.collectionFormat, value: o }) + ((s.form = s.form || {}), + (s.form[i.name] = { collectionFormat: i.collectionFormat, value: o })) else if (i.allowEmptyValue && void 0 !== o) { s.form = s.form || {} const o = i.name - ;(s.form[o] = s.form[o] || {}), (s.form[o].allowEmptyValue = !0) + ;((s.form[o] = s.form[o] || {}), (s.form[o].allowEmptyValue = !0)) } }, }) @@ -55287,7 +55384,7 @@ : String(s) } function grammar_grammar() { - ;(this.grammarObject = 'grammarObject'), + ;((this.grammarObject = 'grammarObject'), (this.rules = []), (this.rules[0] = { name: 'lenient-cookie-string', @@ -55622,7 +55719,7 @@ (s += 'LF = %x0A ; linefeed\n'), '; Lenient version of https://datatracker.ietf.org/doc/html/rfc6265#section-4.2.1\nlenient-cookie-string = lenient-cookie-entry *( ";" OWS lenient-cookie-entry )\nlenient-cookie-entry = lenient-cookie-pair / lenient-cookie-pair-invalid\nlenient-cookie-pair = OWS lenient-cookie-name OWS "=" OWS lenient-cookie-value OWS\nlenient-cookie-pair-invalid = OWS 1*tchar OWS ; Allow for standalone entries like "fizz" to be ignored\nlenient-cookie-name = 1*( %x21-3A / %x3C / %x3E-7E ) ; Allow all printable US-ASCII except "="\nlenient-cookie-value = lenient-quoted-value [ *lenient-cookie-octet ] / *lenient-cookie-octet\nlenient-quoted-value = DQUOTE *( lenient-quoted-char ) DQUOTE\nlenient-quoted-char = %x20-21 / %x23-7E ; Allow all printable US-ASCII except DQUOTE\nlenient-cookie-octet = %x21-2B / %x2D-3A / %x3C-7E\n ; Allow all printable characters except CTLs, semicolon and SP\n\n; https://datatracker.ietf.org/doc/html/rfc6265#section-4.2.1\ncookie-string = cookie-pair *( ";" SP cookie-pair )\n\n; https://datatracker.ietf.org/doc/html/rfc6265#section-4.1.1\n; https://www.rfc-editor.org/errata/eid5518\ncookie-pair = cookie-name "=" cookie-value\ncookie-name = token\ncookie-value = ( DQUOTE *cookie-octet DQUOTE ) / *cookie-octet\n ; https://www.rfc-editor.org/errata/eid8242\ncookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E\n ; US-ASCII characters excluding CTLs,\n ; whitespace, DQUOTE, comma, semicolon,\n ; and backslash\n\n; https://datatracker.ietf.org/doc/html/rfc6265#section-2.2\nOWS = *( [ CRLF ] WSP ) ; "optional" whitespace\n\n; https://datatracker.ietf.org/doc/html/rfc9110#section-5.6.2\ntoken = 1*(tchar)\ntchar = "!" / "#" / "$" / "%" / "&" / "\'" / "*"\n / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"\n / DIGIT / ALPHA\n ; any VCHAR, except delimiters\n\n; https://datatracker.ietf.org/doc/html/rfc2616#section-2.2\nCHAR = %x01-7F ; any US-ASCII character (octets 0 - 127)\nCTL = %x00-1F / %x7F ; any US-ASCII control character\nseparators = "(" / ")" / "<" / ">" / "@" / "," / ";" / ":" / "\\" / %x22 / "/" / "[" / "]" / "?" / "=" / "{" / "}" / SP / HT\nSP = %x20 ; US-ASCII SP, space (32)\nHT = %x09 ; US-ASCII HT, horizontal-tab (9)\n\n; https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1\nALPHA = %x41-5A / %x61-7A ; A-Z / a-z\nDIGIT = %x30-39 ; 0-9\nDQUOTE = %x22 ; " (Double Quote)\nWSP = SP / HTAB ; white space\nHTAB = %x09 ; horizontal tab\nCRLF = CR LF ; Internet standard newline\nCR = %x0D ; carriage return\nLF = %x0A ; linefeed\n' ) - }) + })) } new grammar_grammar() const utils_percentEncodeChar = (s) => { @@ -55693,7 +55790,7 @@ }, u = a.encoders.name(s), _ = a.encoders.value(o) - return a.validators.name(u), a.validators.value(_), `${u}=${_}` + return (a.validators.name(u), a.validators.value(_), `${u}=${_}`) }, cookie_serialize = (s, o = {}) => (Array.isArray(s) ? s : 'object' == typeof s && null !== s ? Object.entries(s) : []) @@ -55762,7 +55859,7 @@ if (a) s.query[i.name] = a else if (i.allowEmptyValue) { const o = i.name - ;(s.query[o] = s.query[o] || {}), (s.query[o].allowEmptyValue = !0) + ;((s.query[o] = s.query[o] || {}), (s.query[o].allowEmptyValue = !0)) } } else if ((!1 === o && (o = 'false'), 0 === o && (o = '0'), o)) { const { style: a, explode: u, allowReserved: _ } = i @@ -55772,7 +55869,7 @@ } } else if (i.allowEmptyValue && void 0 !== o) { const o = i.name - ;(s.query[o] = s.query[o] || {}), (s.query[o].allowEmptyValue = !0) + ;((s.query[o] = s.query[o] || {}), (s.query[o].allowEmptyValue = !0)) } } const Hx = ['accept', 'authorization', 'content-type'] @@ -55861,9 +55958,9 @@ { type: u } = i if (o) if ('apiKey' === u) - 'query' === i.in && (_.query[i.name] = a), + ('query' === i.in && (_.query[i.name] = a), 'header' === i.in && (_.headers[i.name] = a), - 'cookie' === i.in && (_.cookies[i.name] = a) + 'cookie' === i.in && (_.cookies[i.name] = a)) else if ('http' === u) { if (/^basic$/i.test(i.scheme)) { const s = a.username || '', @@ -55876,8 +55973,8 @@ const s = o.token || {}, a = s[i['x-tokenName'] || 'access_token'] let u = s.token_type - ;(u && 'bearer' !== u.toLowerCase()) || (u = 'Bearer'), - (_.headers.Authorization = `${u} ${a}`) + ;((u && 'bearer' !== u.toLowerCase()) || (u = 'Bearer'), + (_.headers.Authorization = `${u} ${a}`)) } }) }), @@ -55915,7 +56012,7 @@ void 0 !== B ? B : {} - ;(o.form = {}), + ;((o.form = {}), Object.keys(a).forEach((i) => { let u try { @@ -55924,7 +56021,7 @@ u = a[i] } o.form[i] = { value: u, encoding: s[i] || {} } - }) + })) } else if ('string' == typeof a) { var U, V const s = @@ -55992,14 +56089,14 @@ if (o) if ('apiKey' === x) { const s = 'query' === w.in ? 'query' : 'headers' - ;(u[s] = u[s] || {}), (u[s][w.name] = a) + ;((u[s] = u[s] || {}), (u[s][w.name] = a)) } else if ('basic' === x) if (a.header) u.headers.authorization = a.header else { const s = a.username || '', o = a.password || '' - ;(a.base64 = Yx(`${s}:${o}`)), - (u.headers.authorization = `Basic ${a.base64}`) + ;((a.base64 = Yx(`${s}:${o}`)), + (u.headers.authorization = `Basic ${a.base64}`)) } else 'oauth2' === x && @@ -56148,10 +56245,10 @@ headers: {}, cookies: {}, } - $ && (ee.signal = $), + ;($ && (ee.signal = $), _ && (ee.requestInterceptor = _), w && (ee.responseInterceptor = w), - C && (ee.userFetch = C) + C && (ee.userFetch = C)) const ie = (function getOperationRaw(s, o) { return s && s.paths ? (function findOperation(s, o) { @@ -56219,14 +56316,14 @@ ? void 0 : C.servers, V = null == s ? void 0 : s.servers - ;(L = isNonEmptyServerList($) + ;((L = isNonEmptyServerList($) ? $ : isNonEmptyServerList(U) ? U : isNonEmptyServerList(V) ? V : [Fl]), - a && ((j = L.find((s) => s.url === a)), j && (B = a)) + a && ((j = L.find((s) => s.url === a)), j && (B = a))) B || (([j] = L), (B = j.url)) if (openapi_server_url_templating_es_test(B, { strict: !0 })) { const s = Object.entries({ ...j.variables }).reduce( @@ -56273,14 +56370,14 @@ (ee.url += Y), !i) ) - return delete ee.cookies, ee - ;(ee.url += le), (ee.method = `${ce}`.toUpperCase()), (V = V || {}) + return (delete ee.cookies, ee) + ;((ee.url += le), (ee.method = `${ce}`.toUpperCase()), (V = V || {})) const pe = o.paths[le] || {} a && (ee.headers.accept = a) const de = ((s) => { const o = {} s.forEach((s) => { - o[s.in] || (o[s.in] = {}), (o[s.in][s.name] = s) + ;(o[s.in] || (o[s.in] = {}), (o[s.in][s.name] = s)) }) const i = [] return ( @@ -56311,7 +56408,7 @@ void 0 === a && s.required && !s.allowEmptyValue) ) throw new Error(`Required parameter ${s.name} is not provided`) - Z && + ;(Z && 'string' == typeof a && (Yu('type', s.schema) && 'string' == typeof s.schema.type && @@ -56323,7 +56420,7 @@ (!Yu('type', s.schema) && findObjectOrArraySchema(s.schema, { recurse: !0 }))) && (a = parseJsonObjectOrArray({ value: a, silentFail: !0 }))), - i && i({ req: ee, parameter: s, value: a, operation: ae, spec: o, baseURL: Y }) + i && i({ req: ee, parameter: s, value: a, operation: ae, spec: o, baseURL: Y })) } }) const fe = { ...s, operation: ae } @@ -56334,7 +56431,7 @@ const s = helpers_cookie_serialize(ee.cookies) Id(ee.headers.Cookie) ? (ee.headers.Cookie += `; ${s}`) : (ee.headers.Cookie = s) } - return ee.cookies && delete ee.cookies, serializeRequest(ee) + return (ee.cookies && delete ee.cookies, serializeRequest(ee)) } const stripNonAlpha = (s) => (s ? s.replace(/\W/g, '') : null) const isNonEmptyServerList = (s) => Array.isArray(s) && s.length > 0 @@ -56386,6 +56483,32 @@ const a = o.getConfigs().withCredentials o.fn.fetch.withCredentials = a }) + function getTokenKey() { + var pathname = window.location.pathname.replace('docs', '') + var match = pathname.match(/^\/([^\/]+)/) + var prefix = match ? `${match[1]}_` : 'sqlbot_v1_' + return `${prefix}user.token` + } + function get_token() { + var token_key = getTokenKey() + var tokenCache = localStorage.getItem(token_key) + if (!tokenCache) { + return null + } + var result = null + try { + var tokenObj = JSON.parse(tokenCache) + if (tokenObj?.v) { + result = tokenObj.v + if (result?.startsWith('"')) { + result = JSON.parse(result) + } + } + } catch (error) { + return result + } + return result + } function swagger_client({ configs: s, getConfigs: o }) { return { fn: { @@ -56398,6 +56521,7 @@ (s) => ( 'string' == typeof s && (s = { url: s }), (s = serializeRequest(s)), + get_token() && (s.headers['x-sqlbot-token'] = `Bearer ${get_token()}`), (s = a(s)), u(i(s)) )), @@ -56491,7 +56615,12 @@ (C = U), V && z ? (function handleNewPropsAndNewState() { - return (j = s(x, C)), o.dependsOnOwnProps && (L = o(a, C)), (B = i(j, L, C)), B + return ( + (j = s(x, C)), + o.dependsOnOwnProps && (L = o(a, C)), + (B = i(j, L, C)), + B + ) })() : V ? (function handleNewProps() { @@ -56506,7 +56635,7 @@ ? (function handleNewState() { const o = s(x, C), a = !w(o, j) - return (j = o), a && (B = i(j, L, C)), B + return ((j = o), a && (B = i(j, L, C)), B) })() : B ) @@ -56516,7 +56645,13 @@ ? handleSubsequentCalls(u, _) : (function handleFirstCall(u, _) { return ( - (x = u), (C = _), (j = s(x, C)), (L = o(a, C)), (B = i(j, L, C)), ($ = !0), B + (x = u), + (C = _), + (j = s(x, C)), + (L = o(a, C)), + (B = i(j, L, C)), + ($ = !0), + B ) })(u, _) } @@ -56527,7 +56662,7 @@ function constantSelector() { return i } - return (constantSelector.dependsOnOwnProps = !1), constantSelector + return ((constantSelector.dependsOnOwnProps = !1), constantSelector) } } function getDependsOnOwnProps(s) { @@ -56541,7 +56676,7 @@ return ( (a.dependsOnOwnProps = !0), (a.mapToProps = function detectFactoryAndVerify(o, i) { - ;(a.mapToProps = s), (a.dependsOnOwnProps = getDependsOnOwnProps(s)) + ;((a.mapToProps = s), (a.dependsOnOwnProps = getDependsOnOwnProps(s))) let u = a(o, i) return ( 'function' == typeof u && @@ -56578,7 +56713,7 @@ w.onStateChange && w.onStateChange() } function trySubscribe() { - u++, + ;(u++, i || ((i = o ? o.addNestedSub(handleChangeWrapper) : s.subscribe(handleChangeWrapper)), (a = (function createListenerCollection() { @@ -56586,18 +56721,18 @@ o = null return { clear() { - ;(s = null), (o = null) + ;((s = null), (o = null)) }, notify() { defaultNoopBatch(() => { let o = s - for (; o; ) o.callback(), (o = o.next) + for (; o; ) (o.callback(), (o = o.next)) }) }, get() { const o = [] let i = s - for (; i; ) o.push(i), (i = i.next) + for (; i; ) (o.push(i), (i = i.next)) return o }, subscribe(i) { @@ -56615,10 +56750,10 @@ ) }, } - })())) + })()))) } function tryUnsubscribe() { - u--, i && 0 === u && (i(), (i = void 0), a.clear(), (a = Ak)) + ;(u--, i && 0 === u && (i(), (i = void 0), a.clear(), (a = Ak))) } const w = { addNestedSub: function addNestedSub(s) { @@ -56742,12 +56877,12 @@ if (!Re.createContext) return {} const s = (uO[lO] ??= new Map()) let o = s.get(Re.createContext) - return o || ((o = Re.createContext(null)), s.set(Re.createContext, o)), o + return (o || ((o = Re.createContext(null)), s.set(Re.createContext, o)), o) } var pO = getContext(), hO = [null, null] function captureWrapperProps(s, o, i, a, u, _) { - ;(s.current = a), (i.current = !1), u.current && ((u.current = null), _()) + ;((s.current = a), (i.current = !1), u.current && ((u.current = null), _())) } function strictEqual(s, o) { return s === o @@ -56804,7 +56939,7 @@ _ = !1 return function mergePropsProxy(o, i, w) { const x = s(o, i, w) - return _ ? a(x, u) || (u = x) : ((_ = !0), (u = x)), u + return (_ ? a(x, u) || (u = x) : ((_ = !0), (u = x)), u) } } })(s) @@ -56889,12 +57024,12 @@ try { i = a(s, u.current) } catch (s) { - ;(U = s), ($ = s) + ;((U = s), ($ = s)) } - U || ($ = null), + ;(U || ($ = null), i === _.current ? w.current || j() - : ((_.current = i), (C.current = i), (w.current = !0), L()) + : ((_.current = i), (C.current = i), (w.current = !0), L())) } return ( (i.onStateChange = checkForUpdates), @@ -56917,13 +57052,13 @@ ye = Re.useSyncExternalStore(fe, de, $ ? () => U($(), _) : de) } catch (s) { throw ( - (pe.current && + pe.current && (s.message += `\nThe error may be correlated with this previous error:\n${pe.current.stack}\n\n`), - s) + s ) } Vk(() => { - ;(pe.current = void 0), (ae.current = void 0), (ee.current = ye) + ;((pe.current = void 0), (ae.current = void 0), (ee.current = ye)) }) const be = Re.useMemo(() => Re.createElement(s, { ...ye, ref: u }), [u, s, ye]) return Re.useMemo( @@ -56936,7 +57071,7 @@ const o = Re.forwardRef(function forwardConnectRef(s, o) { return Re.createElement(j, { ...s, reactReduxForwardedRef: o }) }) - return (o.displayName = i), (o.WrappedComponent = s), hoistNonReactStatics(o, s) + return ((o.displayName = i), (o.WrappedComponent = s), hoistNonReactStatics(o, s)) } return hoistNonReactStatics(j, s) } @@ -56955,7 +57090,7 @@ s.trySubscribe(), w !== u.getState() && s.notifyNestedSubs(), () => { - s.tryUnsubscribe(), (s.onStateChange = void 0) + ;(s.tryUnsubscribe(), (s.onStateChange = void 0)) } ) }, [_, w]) @@ -56971,7 +57106,7 @@ return Re.createElement(o, Mn()({}, s(), this.props, this.context)) } } - return (WithSystem.displayName = `WithSystem(${i.getDisplayName(o)})`), WithSystem + return ((WithSystem.displayName = `WithSystem(${i.getDisplayName(o)})`), WithSystem) }, withRoot = (s, o) => (i) => { const { fn: a } = s() @@ -56984,7 +57119,7 @@ ) } } - return (WithRoot.displayName = `WithRoot(${a.getDisplayName(i)})`), WithRoot + return ((WithRoot.displayName = `WithRoot(${a.getDisplayName(i)})`), WithRoot) }, withConnect = (s, o, i) => compose( @@ -57007,7 +57142,7 @@ _ = i(o, 'root') class WithMappedContainer extends Re.Component { constructor(o, i) { - super(o, i), handleProps(s, a, o, {}) + ;(super(o, i), handleProps(s, a, o, {})) } UNSAFE_componentWillReceiveProps(o) { handleProps(s, a, o, this.props) @@ -57120,11 +57255,11 @@ })() ) ) - u.updateLoadingStatus('success'), + ;(u.updateLoadingStatus('success'), u.updateSpec(o.text), - a.url() !== s && u.updateUrl(s) + a.url() !== s && u.updateUrl(s)) } - ;(s = s || a.url()), + ;((s = s || a.url()), u.updateLoadingStatus('loading'), i.clear({ source: 'fetch' }), w({ @@ -57134,7 +57269,7 @@ responseInterceptor: x.responseInterceptor || ((s) => s), credentials: 'same-origin', headers: { Accept: 'application/json,*/*' }, - }).then(next, next) + }).then(next, next)) }, updateLoadingStatus: (s) => { let o = [null, 'loading', 'failed', 'success', 'failedConfig'] @@ -57264,11 +57399,11 @@ var i = Object.keys(s) if (Object.getOwnPropertySymbols) { var a = Object.getOwnPropertySymbols(s) - o && + ;(o && (a = a.filter(function (o) { return Object.getOwnPropertyDescriptor(s, o).enumerable })), - i.push.apply(i, a) + i.push.apply(i, a)) } return i } @@ -57497,11 +57632,11 @@ var i = Object.keys(s) if (Object.getOwnPropertySymbols) { var a = Object.getOwnPropertySymbols(s) - o && + ;(o && (a = a.filter(function (o) { return Object.getOwnPropertyDescriptor(s, o).enumerable })), - i.push.apply(i, a) + i.push.apply(i, a)) } return i } @@ -57672,7 +57807,7 @@ })(o) if (i) { var u = o.split('\n') - u.forEach(function (o, i) { + ;(u.forEach(function (o, i) { var w = a && B.length + _, x = { type: 'text', value: ''.concat(o, '\n') } if (0 === i) { @@ -57701,12 +57836,11 @@ B.push(Z) } }), - ($ = U) + ($ = U)) } U++ }; U < L.length; - ) V() if ($ !== L.length - 1) { @@ -57797,8 +57931,8 @@ if (Object.getOwnPropertySymbols) { var _ = Object.getOwnPropertySymbols(s) for (a = 0; a < _.length; a++) - (i = _[a]), - -1 === o.indexOf(i) && {}.propertyIsEnumerable.call(s, i) && (u[i] = s[i]) + ((i = _[a]), + -1 === o.indexOf(i) && {}.propertyIsEnumerable.call(s, i) && (u[i] = s[i])) } return u })(i, vO) @@ -57828,7 +57962,7 @@ !ze) ) return Re.createElement(xe, Qe, He, Re.createElement(Te, $, qe)) - ;((void 0 === de && Se) || ye) && (de = !0), (Se = Se || defaultRenderer) + ;(((void 0 === de && Se) || ye) && (de = !0), (Se = Se || defaultRenderer)) var et = [{ type: 'text', value: qe }], tt = (function getCodeTree(s) { var o = s.astGenerator, @@ -57897,14 +58031,14 @@ var RO = __webpack_require__(26571) const DO = __webpack_require__.n(RO)(), after_load = () => { - EO.registerLanguage('json', OO), + ;(EO.registerLanguage('json', OO), EO.registerLanguage('js', xO), EO.registerLanguage('xml', CO), EO.registerLanguage('yaml', TO), EO.registerLanguage('http', MO), EO.registerLanguage('bash', PO), EO.registerLanguage('powershell', DO), - EO.registerLanguage('javascript', xO) + EO.registerLanguage('javascript', xO)) }, LO = { hljs: { @@ -58356,13 +58490,13 @@ GIT_DIRTY: !0, BUILD_TIME: 'Thu, 11 Dec 2025 15:56:57 GMT', } - ;(lt.versions = lt.versions || {}), + ;((lt.versions = lt.versions || {}), (lt.versions.swaggerUI = { version: i, gitRevision: o, gitDirty: s, buildTimestamp: a, - }) + })) }, versions = () => ({ afterLoad: versions_after_load }) var UO = __webpack_require__(47248), @@ -58414,7 +58548,7 @@ return { hasError: !0, error: s } } constructor(...s) { - super(...s), (this.state = { hasError: !1, error: null }) + ;(super(...s), (this.state = { hasError: !1, error: null })) } componentDidCatch(s, o) { this.props.fn.componentDidCatch(s, o) @@ -58518,20 +58652,18 @@ Re.createElement( 'div', { className: 'modal-ux-content' }, - w - .valueSeq() - .map((w, C) => - Re.createElement(x, { - key: C, - AST: _, - definitions: w, - getComponent: i, - errSelectors: a, - authSelectors: s, - authActions: o, - specSelectors: u, - }) - ) + w.valueSeq().map((w, C) => + Re.createElement(x, { + key: C, + AST: _, + definitions: w, + getComponent: i, + errSelectors: a, + authSelectors: s, + authActions: o, + specSelectors: u, + }) + ) ) ) ) @@ -58604,7 +58736,7 @@ } class Auths extends Re.Component { constructor(s, o) { - super(s, o), (this.state = {}) + ;(super(s, o), (this.state = {})) } onAuthChange = (s) => { let { name: o } = s @@ -58619,7 +58751,7 @@ s.preventDefault() let { authActions: o, definitions: i } = this.props, a = i.map((s, o) => o).toArray() - this.setState(a.reduce((s, o) => ((s[o] = ''), s), {})), o.logoutWithPersistOption(a) + ;(this.setState(a.reduce((s, o) => ((s[o] = ''), s), {})), o.logoutWithPersistOption(a)) } close = (s) => { s.preventDefault() @@ -58793,7 +58925,7 @@ let { onChange: o } = this.props, i = s.target.value, a = Object.assign({}, this.state, { value: i }) - this.setState(a), o(a) + ;(this.setState(a), o(a)) } render() { let { @@ -58870,7 +59002,7 @@ let { onChange: o } = this.props, { value: i, name: a } = s.target, u = this.state.value - ;(u[a] = i), this.setState({ value: u }), o(this.state) + ;((u[a] = i), this.setState({ value: u }), o(this.state)) } render() { let { @@ -59125,12 +59257,12 @@ u(stringifyUnlessList(x)), this._setStateForCurrentNamespace({ isModifiedValueSelected: !0 }) ) - 'function' == typeof a && a(s, { isSyntheticChange: o }, ...i), + ;('function' == typeof a && a(s, { isSyntheticChange: o }, ...i), this._setStateForCurrentNamespace({ lastDownstreamValue: C, isModifiedValueSelected: (o && w) || (!!_ && _ !== C), }), - o || ('function' == typeof u && u(stringifyUnlessList(C))) + o || ('function' == typeof u && u(stringifyUnlessList(C)))) } UNSAFE_componentWillReceiveProps(s) { const { currentUserInputValue: o, examples: i, onSelect: a, userHasEditedBody: u } = s, @@ -59142,8 +59274,8 @@ ) if (C.size) { let o - ;(o = C.has(s.currentKey) ? s.currentKey : C.keySeq().first()), - a(o, { isSyntheticChange: !0 }) + ;((o = C.has(s.currentKey) ? s.currentKey : C.keySeq().first()), + a(o, { isSyntheticChange: !0 })) } else o !== this.props.currentUserInputValue && o !== _ && @@ -59234,9 +59366,9 @@ i = (function createCodeChallenge(s) { return b64toB64UrlEncoded(Ot()('sha256').update(s).digest('base64')) })(o) - B.push('code_challenge=' + i), + ;(B.push('code_challenge=' + i), B.push('code_challenge_method=S256'), - (s.codeVerifier = o) + (s.codeVerifier = o)) } let { additionalQueryStringParams: z } = u for (let s in z) void 0 !== z[s] && B.push([s, z[s]].map(encodeURIComponent).join('=')) @@ -59245,7 +59377,7 @@ Z = _ ? Nt()(sanitizeUrl(Y), _, !0).toString() : sanitizeUrl(Y) let ee, ie = [Z, B.join('&')].join('string' != typeof Y || Y.includes('?') ? '&' : '?') - ;(ee = + ;((ee = 'implicit' === L ? o.preAuthorizeImplicit : u.useBasicAuthenticationWithAccessCodeGrant @@ -59257,7 +59389,7 @@ redirectUrl: $, callback: ee, errCb: i.newAuthErr, - }) + })) } class Oauth2 extends Re.Component { constructor(s, o) { @@ -59270,7 +59402,7 @@ L = (w && w.get('clientSecret')) || x.clientSecret || '', B = (w && w.get('passwordType')) || 'basic', $ = (w && w.get('scopes')) || x.scopes || [] - 'string' == typeof $ && ($ = $.split(x.scopeSeparator || ' ')), + ;('string' == typeof $ && ($ = $.split(x.scopeSeparator || ' ')), (this.state = { appName: x.appName, name: i, @@ -59281,7 +59413,7 @@ username: C, password: '', passwordType: B, - }) + })) } close = (s) => { s.preventDefault() @@ -59298,7 +59430,7 @@ } = this.props, _ = i(), w = a.getConfigs() - o.clear({ authId: name, type: 'auth', source: 'auth' }), + ;(o.clear({ authId: name, type: 'auth', source: 'auth' }), oauth2_authorize_authorize({ auth: this.state, currentServer: u.serverEffectiveValue(u.selectedServer()), @@ -59306,7 +59438,7 @@ errActions: o, configs: _, authConfigs: w, - }) + })) } onScopeChange = (s) => { let { target: o } = s, @@ -59344,7 +59476,7 @@ logout = (s) => { s.preventDefault() let { authActions: o, errActions: i, name: a } = this.props - i.clear({ authId: a, type: 'auth', source: 'auth' }), o.logoutWithPersistOption([a]) + ;(i.clear({ authId: a, type: 'auth', source: 'auth' }), o.logoutWithPersistOption([a])) } render() { let { @@ -59616,7 +59748,7 @@ class Clear extends Re.Component { onClick = () => { let { specActions: s, path: o, method: i } = this.props - s.clearResponse(o, i), s.clearRequest(o, i) + ;(s.clearResponse(o, i), s.clearRequest(o, i)) } render() { return Re.createElement( @@ -59817,28 +59949,28 @@ } class ValidatorImage extends Re.Component { constructor(s) { - super(s), (this.state = { loaded: !1, error: !1 }) + ;(super(s), (this.state = { loaded: !1, error: !1 })) } componentDidMount() { const s = new Image() - ;(s.onload = () => { + ;((s.onload = () => { this.setState({ loaded: !0 }) }), (s.onerror = () => { this.setState({ error: !0 }) }), - (s.src = this.props.src) + (s.src = this.props.src)) } UNSAFE_componentWillReceiveProps(s) { if (s.src !== this.props.src) { const o = new Image() - ;(o.onload = () => { + ;((o.onload = () => { this.setState({ loaded: !0 }) }), (o.onerror = () => { this.setState({ error: !0 }) }), - (o.src = s.src) + (o.src = s.src)) } } render() { @@ -60323,13 +60455,13 @@ componentDidUpdate(s) { const { response: o, isShown: i } = this.props, a = this.getResolvedSubtree() - o !== s.response && this.setState({ executeInProgress: !1 }), - i && void 0 === a && !s.isShown && this.requestResolvedSubtree() + ;(o !== s.response && this.setState({ executeInProgress: !1 }), + i && void 0 === a && !s.isShown && this.requestResolvedSubtree()) } toggleShown = () => { let { layoutActions: s, tag: o, operationId: i, isShown: a } = this.props const u = this.getResolvedSubtree() - a || void 0 !== u || this.requestResolvedSubtree(), s.show(['operations', o, i], !a) + ;(a || void 0 !== u || this.requestResolvedSubtree(), s.show(['operations', o, i], !a)) } onCancelClick = () => { this.setState({ tryItOutEnabled: !this.state.tryItOutEnabled }) @@ -60342,7 +60474,7 @@ i = this.props.oas3Selectors.requestContentType(...s) if ('application/x-www-form-urlencoded' === i || 'multipart/form-data' === i) { const i = JSON.parse(o) - Object.entries(i).forEach(([s, o]) => { + ;(Object.entries(i).forEach(([s, o]) => { Array.isArray(o) ? (i[s] = i[s].map((s) => 'object' == typeof s ? JSON.stringify(s, null, 2) : s @@ -60352,7 +60484,7 @@ this.props.oas3Actions.setRequestBodyValue({ value: (0, ze.fromJS)(i), pathMethod: s, - }) + })) } else this.props.oas3Actions.setRequestBodyValue({ value: o, pathMethod: s }) } onExecute = () => { @@ -60809,12 +60941,12 @@ } class response_Response extends Re.Component { constructor(s, o) { - super(s, o), (this.state = { responseContentType: '' }) + ;(super(s, o), (this.state = { responseContentType: '' })) } static defaultProps = { response: (0, ze.fromJS)({}), onContentTypeChange: () => {} } _onContentTypeChange = (s) => { const { onContentTypeChange: o, controlsAcceptHeader: i } = this.props - this.setState({ responseContentType: s }), o({ value: s, controlsAcceptHeader: i }) + ;(this.setState({ responseContentType: s }), o({ value: s, controlsAcceptHeader: i })) } getTargetExamplesKey = () => { const { response: s, contentType: o, activeExamplesKey: i } = this.props, @@ -60863,9 +60995,9 @@ Te = Pe.get('examples', null) if (z) { const s = Pe.get('schema') - ;(Se = s ? U(s.toJS()) : null), - (we = s ? _.push('content', this.state.responseContentType, 'schema') : _) - } else (Se = a.get('schema')), (we = a.has('schema') ? _.push('schema') : _) + ;((Se = s ? U(s.toJS()) : null), + (we = s ? _.push('content', this.state.responseContentType, 'schema') : _)) + } else ((Se = a.get('schema')), (we = a.has('schema') ? _.push('schema') : _)) let $e, qe, We = !1, @@ -60874,12 +61006,12 @@ if (((qe = Pe.get('schema')?.toJS()), ze.Map.isMap(Te) && !Te.isEmpty())) { const s = this.getTargetExamplesKey(), getMediaTypeExample = (s) => (ze.Map.isMap(s) ? s.get('value') : void 0) - ;($e = getMediaTypeExample(Te.get(s, (0, ze.Map)({})))), + ;(($e = getMediaTypeExample(Te.get(s, (0, ze.Map)({})))), void 0 === $e && ($e = getMediaTypeExample(Te.values().next().value)), - (We = !0) + (We = !0)) } else void 0 !== Pe.get('example') && (($e = Pe.get('example')), (We = !0)) else { - ;(qe = Se), (He = { ...He, includeWriteOnly: !0 }) + ;((qe = Se), (He = { ...He, includeWriteOnly: !0 })) const s = a.getIn(['examples', xe]) s && (($e = s), (We = !0)) } @@ -61019,10 +61151,10 @@ if (s !== o) if (o && o instanceof Blob) { var i = new FileReader() - ;(i.onload = () => { + ;((i.onload = () => { this.setState({ parsedContent: i.result }) }), - i.readAsText(o) + i.readAsText(o)) } else this.setState({ parsedContent: o.toString() }) } componentDidMount() { @@ -61184,7 +61316,7 @@ } class Parameters extends Re.Component { constructor(s) { - super(s), (this.state = { callbackVisible: !1, parametersVisible: !0 }) + ;(super(s), (this.state = { callbackVisible: !1, parametersVisible: !0 })) } static defaultProps = { onTryoutClick: Function.prototype, @@ -61218,13 +61350,13 @@ let { specActions: i, oas3Selectors: a, oas3Actions: u } = this.props const _ = a.hasUserEditedBody(...o), w = a.shouldRetainRequestBodyValue(...o) - u.setRequestContentType({ value: s, pathMethod: o }), + ;(u.setRequestContentType({ value: s, pathMethod: o }), u.initRequestBodyValidateError({ pathMethod: o }), _ || (w || u.setRequestBodyValue({ value: void 0, pathMethod: o }), i.clearResponse(...o), i.clearRequest(...o), - i.clearValidateParams(o)) + i.clearValidateParams(o))) } render() { let { @@ -61257,7 +61389,7 @@ i.reduce((s, o) => { if (ze.Map.isMap(o)) { const i = o.get('in') - ;(s[i] ??= []), s[i].push(o) + ;((s[i] ??= []), s[i].push(o)) } return s }, {}) @@ -61497,7 +61629,7 @@ } class ParameterRow extends Re.Component { constructor(s, o) { - super(s, o), this.setDefaultValue() + ;(super(s, o), this.setDefaultValue()) } UNSAFE_componentWillReceiveProps(s) { let o, @@ -61510,7 +61642,7 @@ } else o = w ? w.get('enum') : void 0 let x, C = w ? w.get('value') : void 0 - void 0 !== C ? (x = C) : u.get('required') && o && o.size && (x = o.first()), + ;(void 0 !== C ? (x = C) : u.get('required') && o && o.size && (x = o.first()), void 0 !== x && x !== C && this.onChangeWrapper( @@ -61518,12 +61650,12 @@ return 'number' == typeof s ? s.toString() : s })(x) ), - this.setDefaultValue() + this.setDefaultValue()) } onChangeWrapper = (s, o = !1) => { let i, { onChange: a, rawParam: u } = this.props - return (i = '' === s || (s && 0 === s.size) ? null : s), a(u, i, o) + return ((i = '' === s || (s && 0 === s.size) ? null : s), a(u, i, o)) } _onExampleSelect = (s) => { this.props.oas3Actions.setActiveExamplesMember({ @@ -61668,7 +61800,7 @@ et = U ? getCommonExtensions(de) : null, tt = $ ? getExtensions(s) : null, rt = !1 - void 0 !== s && de && (We = de.get('items')), + ;(void 0 !== s && de && (We = de.get('items')), void 0 !== We ? ((He = We.get('enum')), (Ye = We.get('default'))) : de && (He = de.get('enum')), @@ -61677,7 +61809,7 @@ (de && (Ye = de.get('default')), void 0 === Ye && (Ye = s.get('default')), (Xe = s.get('example')), - void 0 === Xe && (Xe = s.get('x-example'))) + void 0 === Xe && (Xe = s.get('x-example')))) const nt = Z ? null : Re.createElement(V, { @@ -61819,7 +61951,7 @@ class Execute extends Re.Component { handleValidateParameters = () => { let { specSelectors: s, specActions: o, path: i, method: a } = this.props - return o.validateParams([i, a]), s.validateBeforeExecute([i, a]) + return (o.validateParams([i, a]), s.validateBeforeExecute([i, a])) } handleValidateRequestBody = () => { let { @@ -61859,15 +61991,15 @@ } handleValidationResultPass = () => { let { specActions: s, operation: o, path: i, method: a } = this.props - this.props.onExecute && this.props.onExecute(), - s.execute({ operation: o, path: i, method: a }) + ;(this.props.onExecute && this.props.onExecute(), + s.execute({ operation: o, path: i, method: a })) } handleValidationResultFail = () => { let { specActions: s, path: o, method: i } = this.props - s.clearValidateParams([o, i]), + ;(s.clearValidateParams([o, i]), setTimeout(() => { s.validateParams([o, i]) - }, 40) + }, 40)) } handleValidationResult = (s) => { s ? this.handleValidationResultPass() : this.handleValidationResultFail() @@ -62169,7 +62301,7 @@ x.push('none' + o) continue } - x.push('block' + o), x.push('col-' + i + o) + ;(x.push('block' + o), x.push('col-' + i + o)) } } s && x.push('hidden') @@ -62200,15 +62332,15 @@ static defaultProps = { multiple: !1, allowEmptyValue: !0 } constructor(s, o) { let i - super(s, o), + ;(super(s, o), (i = s.value ? s.value : s.multiple ? [''] : ''), - (this.state = { value: i }) + (this.state = { value: i })) } onChange = (s) => { let o, { onChange: i, multiple: a } = this.props, u = [].slice.call(s.target.options) - ;(o = a + ;((o = a ? u .filter(function (s) { return s.selected @@ -62218,7 +62350,7 @@ }) : s.target.value), this.setState({ value: o }), - i && i(o) + i && i(o)) } UNSAFE_componentWillReceiveProps(s) { s.value !== this.props.value && this.setState({ value: s.value }) @@ -62271,7 +62403,7 @@ } class Overview extends Re.Component { constructor(...s) { - super(...s), (this.setTagShown = this._setTagShown.bind(this)) + ;(super(...s), (this.setTagShown = this._setTagShown.bind(this))) } _setTagShown(s, o) { this.props.layoutActions.show(s, o) @@ -62340,7 +62472,7 @@ } class OperationLink extends Re.Component { constructor(s) { - super(s), (this.onClick = this._onClick.bind(this)) + ;(super(s), (this.onClick = this._onClick.bind(this))) } _onClick() { let { showOpId: s, showOpIdPrefix: o, onClick: i, shown: a } = this.props @@ -62617,7 +62749,7 @@ onChangeConsumes: sA, } constructor(s, o) { - super(s, o), (this.state = { isEditBox: !1, value: '' }) + ;(super(s, o), (this.state = { isEditBox: !1, value: '' })) } componentDidMount() { this.updateValues.call(this, this.props) @@ -62632,7 +62764,7 @@ w = u ? o.get('value_xml') : o.get('value') if (void 0 !== w) { let s = !w && _ ? '{}' : w - this.setState({ value: s }), this.onChange(s, { isXml: u, isEditBox: i }) + ;(this.setState({ value: s }), this.onChange(s, { isXml: u, isEditBox: i })) } else u ? this.onChange(this.sample('xml'), { isXml: u, isEditBox: i }) @@ -62644,7 +62776,7 @@ return i.getSampleSchema(a, s, { includeWriteOnly: !0 }) } onChange = (s, { isEditBox: o, isXml: i }) => { - this.setState({ value: s, isEditBox: o }), this._onChange(s, i) + ;(this.setState({ value: s, isEditBox: o }), this._onChange(s, i)) } _onChange = (s, o) => { ;(this.props.onChange || sA)(s, o) @@ -62996,7 +63128,8 @@ var oA function decodeEntity(s) { return ( - ((oA = oA || document.createElement('textarea')).innerHTML = '&' + s + ';'), oA.value + ((oA = oA || document.createElement('textarea')).innerHTML = '&' + s + ';'), + oA.value ) } var iA = Object.prototype.hasOwnProperty @@ -63083,7 +63216,7 @@ ? nextToken(s, o + 2) : o } - ;(dA.blockquote_open = function () { + ;((dA.blockquote_open = function () { return '
\n' }), (dA.blockquote_close = function (s, o) { @@ -63324,18 +63457,18 @@ }), (dA.dd_close = function () { return '\n' - }) + })) var fA = (dA.getBreak = function getBreak(s, o) { return (o = nextToken(s, o)) < s.length && 'list_item_close' === s[o].type ? '' : '\n' }) function Renderer() { - ;(this.rules = index_browser_assign({}, dA)), (this.getBreak = dA.getBreak) + ;((this.rules = index_browser_assign({}, dA)), (this.getBreak = dA.getBreak)) } function Ruler() { - ;(this.__rules__ = []), (this.__cache__ = null) + ;((this.__rules__ = []), (this.__cache__ = null)) } function StateInline(s, o, i, a, u) { - ;(this.src = s), + ;((this.src = s), (this.env = a), (this.options = i), (this.parser = o), @@ -63349,7 +63482,7 @@ (this.isInLabel = !1), (this.linkLevel = 0), (this.linkContent = ''), - (this.labelUnmatchedScopes = 0) + (this.labelUnmatchedScopes = 0)) } function parseLinkLabel(s, o) { var i, @@ -63360,7 +63493,7 @@ x = s.pos, C = s.isInLabel if (s.isInLabel) return -1 - if (s.labelUnmatchedScopes) return s.labelUnmatchedScopes--, -1 + if (s.labelUnmatchedScopes) return (s.labelUnmatchedScopes--, -1) for (s.pos = o + 1, s.isInLabel = !0, i = 1; s.pos < w; ) { if (91 === (u = s.src.charCodeAt(s.pos))) i++ else if (93 === u && 0 === --i) { @@ -63442,7 +63575,7 @@ if (34 !== _ && 39 !== _ && 40 !== _) return !1 for (o++, 40 === _ && (_ = 41); o < u; ) { if ((i = s.src.charCodeAt(o)) === _) - return (s.pos = o + 1), (s.linkContent = unescapeMd(s.src.slice(a + 1, o))), !0 + return ((s.pos = o + 1), (s.linkContent = unescapeMd(s.src.slice(a + 1, o))), !0) 92 === i && o + 1 < u ? (o += 2) : o++ } return !1 @@ -63475,7 +63608,6 @@ ? ((B = u.linkContent), (w = u.pos)) : ((B = ''), (w = j)); w < x && 32 === u.src.charCodeAt(w); - ) w++ return w < x && 10 !== u.src.charCodeAt(w) @@ -63484,7 +63616,7 @@ void 0 === a.references[$] && (a.references[$] = { title: B, href: L }), w) } - ;(Renderer.prototype.renderInline = function (s, o, i) { + ;((Renderer.prototype.renderInline = function (s, o, i) { for (var a = this.rules, u = s.length, _ = 0, w = ''; u--; ) w += a[s[_].type](s, _++, o, i, this) return w @@ -63504,7 +63636,7 @@ (Ruler.prototype.__compile__ = function () { var s = this, o = [''] - s.__rules__.forEach(function (s) { + ;(s.__rules__.forEach(function (s) { s.enabled && s.alt.forEach(function (s) { o.indexOf(s) < 0 && o.push(s) @@ -63512,41 +63644,41 @@ }), (s.__cache__ = {}), o.forEach(function (o) { - ;(s.__cache__[o] = []), + ;((s.__cache__[o] = []), s.__rules__.forEach(function (i) { i.enabled && ((o && i.alt.indexOf(o) < 0) || s.__cache__[o].push(i.fn)) - }) - }) + })) + })) }), (Ruler.prototype.at = function (s, o, i) { var a = this.__find__(s), u = i || {} if (-1 === a) throw new Error('Parser rule not found: ' + s) - ;(this.__rules__[a].fn = o), + ;((this.__rules__[a].fn = o), (this.__rules__[a].alt = u.alt || []), - (this.__cache__ = null) + (this.__cache__ = null)) }), (Ruler.prototype.before = function (s, o, i, a) { var u = this.__find__(s), _ = a || {} if (-1 === u) throw new Error('Parser rule not found: ' + s) - this.__rules__.splice(u, 0, { name: o, enabled: !0, fn: i, alt: _.alt || [] }), - (this.__cache__ = null) + ;(this.__rules__.splice(u, 0, { name: o, enabled: !0, fn: i, alt: _.alt || [] }), + (this.__cache__ = null)) }), (Ruler.prototype.after = function (s, o, i, a) { var u = this.__find__(s), _ = a || {} if (-1 === u) throw new Error('Parser rule not found: ' + s) - this.__rules__.splice(u + 1, 0, { name: o, enabled: !0, fn: i, alt: _.alt || [] }), - (this.__cache__ = null) + ;(this.__rules__.splice(u + 1, 0, { name: o, enabled: !0, fn: i, alt: _.alt || [] }), + (this.__cache__ = null)) }), (Ruler.prototype.push = function (s, o, i) { var a = i || {} - this.__rules__.push({ name: s, enabled: !0, fn: o, alt: a.alt || [] }), - (this.__cache__ = null) + ;(this.__rules__.push({ name: s, enabled: !0, fn: o, alt: a.alt || [] }), + (this.__cache__ = null)) }), (Ruler.prototype.enable = function (s, o) { - ;(s = Array.isArray(s) ? s : [s]), + ;((s = Array.isArray(s) ? s : [s]), o && this.__rules__.forEach(function (s) { s.enabled = !1 @@ -63556,27 +63688,27 @@ if (o < 0) throw new Error('Rules manager: invalid rule name ' + s) this.__rules__[o].enabled = !0 }, this), - (this.__cache__ = null) + (this.__cache__ = null)) }), (Ruler.prototype.disable = function (s) { - ;(s = Array.isArray(s) ? s : [s]).forEach(function (s) { + ;((s = Array.isArray(s) ? s : [s]).forEach(function (s) { var o = this.__find__(s) if (o < 0) throw new Error('Rules manager: invalid rule name ' + s) this.__rules__[o].enabled = !1 }, this), - (this.__cache__ = null) + (this.__cache__ = null)) }), (Ruler.prototype.getRules = function (s) { - return null === this.__cache__ && this.__compile__(), this.__cache__[s] || [] + return (null === this.__cache__ && this.__compile__(), this.__cache__[s] || []) }), (StateInline.prototype.pushPending = function () { - this.tokens.push({ type: 'text', content: this.pending, level: this.pendingLevel }), - (this.pending = '') + ;(this.tokens.push({ type: 'text', content: this.pending, level: this.pendingLevel }), + (this.pending = '')) }), (StateInline.prototype.push = function (s) { - this.pending && this.pushPending(), + ;(this.pending && this.pushPending(), this.tokens.push(s), - (this.pendingLevel = this.level) + (this.pendingLevel = this.level)) }), (StateInline.prototype.cacheSet = function (s, o) { for (var i = this.cache.length; i <= s; i++) this.cache.push(0) @@ -63584,7 +63716,7 @@ }), (StateInline.prototype.cacheGet = function (s) { return s < this.cache.length ? this.cache[s] : 0 - }) + })) var mA = ' \n()[]\'".,!?-' function regEscape(s) { return s.replace(/([-()\[\]{}+?*.$\^|,:# C && + (L.lastIndex > C && x.push({ type: 'text', content: w.slice(C, B.index + B[1].length), @@ -63806,7 +63937,7 @@ }), x.push({ type: 'text', content: B[2], level: j }), x.push({ type: 'abbr_close', level: --j }), - (C = L.lastIndex - B[3].length) + (C = L.lastIndex - B[3].length)) x.length && (C < w.length && x.push({ type: 'text', content: w.slice(C), level: j }), (U[i].children = u = [].concat(u.slice(0, o), x, u.slice(o + 1)))) @@ -63846,7 +63977,7 @@ for (Y = s.tokens[z].children, Z.length = 0, o = 0; o < Y.length; o++) if ('text' === (i = Y[o]).type && !bA.test(i.text)) { for (x = Y[o].level, U = Z.length - 1; U >= 0 && !(Z[U].level <= x); U--); - ;(Z.length = U + 1), (_ = 0), (w = (a = i.content).length) + ;((Z.length = U + 1), (_ = 0), (w = (a = i.content).length)) e: for (; _ < w && ((_A.lastIndex = _), (u = _A.exec(a))); ) if ( ((C = !isLetter(a, u.index - 1)), @@ -63857,7 +63988,7 @@ if (((B = !j), ($ = !C))) for (U = Z.length - 1; U >= 0 && ((L = Z[U]), !(Z[U].level < x)); U--) if (L.single === V && Z[U].level === x) { - ;(L = Z[U]), + ;((L = Z[U]), V ? ((Y[L.token].content = replaceAt( Y[L.token].content, @@ -63879,7 +64010,7 @@ u.index, s.options.quotes[1] ))), - (Z.length = U) + (Z.length = U)) continue e } B @@ -63891,7 +64022,7 @@ ], ] function Core() { - ;(this.options = {}), (this.ruler = new Ruler()) + ;((this.options = {}), (this.ruler = new Ruler())) for (var s = 0; s < EA.length; s++) this.ruler.push(EA[s][0], EA[s][1]) } function StateBlock(s, o, i, a, u) { @@ -63936,10 +64067,10 @@ (L = 0), (x = C + 1)) } - this.bMarks.push(w.length), + ;(this.bMarks.push(w.length), this.eMarks.push(w.length), this.tShift.push(0), - (this.lineMax = this.bMarks.length - 1) + (this.lineMax = this.bMarks.length - 1)) } function skipBulletListMarker(s, o) { var i, a, u @@ -63964,7 +64095,7 @@ } return a < u && 32 !== s.src.charCodeAt(a) ? -1 : a } - ;(Core.prototype.process = function (s) { + ;((Core.prototype.process = function (s) { var o, i, a for (o = 0, i = (a = this.ruler.getRules('')).length; o < i; o++) a[o](s) }), @@ -64007,13 +64138,13 @@ this.src.slice(_, w) ) for (x = new Array(o - s), u = 0; j < o; j++, u++) - (C = this.tShift[j]) > i && (C = i), + ((C = this.tShift[j]) > i && (C = i), C < 0 && (C = 0), (_ = this.bMarks[j] + C), (w = j + 1 < o || a ? this.eMarks[j] + 1 : this.eMarks[j]), - (x[u] = this.src.slice(_, w)) + (x[u] = this.src.slice(_, w))) return x.join('') - }) + })) var wA = {} ;[ 'article', @@ -64136,7 +64267,6 @@ (L = C = s.bMarks[x] + s.tShift[x]) < (B = s.eMarks[x]) && s.tShift[x] < s.blkIndent ); - ) if ( s.src.charCodeAt(L) === u && @@ -64206,14 +64336,14 @@ break } if (V) break - x.push(s.bMarks[u]), w.push(s.tShift[u]), (s.tShift[u] = -1337) + ;(x.push(s.bMarks[u]), w.push(s.tShift[u]), (s.tShift[u] = -1337)) } else - 32 === s.src.charCodeAt(z) && z++, + (32 === s.src.charCodeAt(z) && z++, x.push(s.bMarks[u]), (s.bMarks[u] = z), (_ = (z = z < Y ? s.skipSpaces(z) : z) >= Y), w.push(s.tShift[u]), - (s.tShift[u] = z - s.bMarks[u]) + (s.tShift[u] = z - s.bMarks[u])) for ( j = s.parentType, s.parentType = 'blockquote', @@ -64226,8 +64356,8 @@ $ < w.length; $++ ) - (s.bMarks[$ + o] = x[$]), (s.tShift[$ + o] = w[$]) - return (s.blkIndent = C), !0 + ((s.bMarks[$ + o] = x[$]), (s.tShift[$ + o] = w[$])) + return ((s.blkIndent = C), !0) }, ['paragraph', 'blockquote', 'list'], ], @@ -64335,7 +64465,6 @@ s.isEmpty(u) || s.tShift[u] < s.blkIndent ); - ) { for (de = !1, le = 0, pe = ce.length; le < pe; le++) if (ce[le](s, u, i, !0)) { @@ -64429,7 +64558,7 @@ if (x >= C) return !1 if (35 !== (u = s.src.charCodeAt(x)) || x >= C) return !1 for (_ = 1, u = s.src.charCodeAt(++x); 35 === u && x < C && _ <= 6; ) - _++, (u = s.src.charCodeAt(++x)) + (_++, (u = s.src.charCodeAt(++x))) return ( !(_ > 6 || (x < C && 32 !== u)) && (a || @@ -64571,7 +64700,7 @@ x < j.length; x++ ) - s.tokens.push({ + (s.tokens.push({ type: 'th_open', align: B[x], lines: [o, o + 1], @@ -64584,7 +64713,7 @@ level: s.level, children: [], }), - s.tokens.push({ type: 'th_close', level: --s.level }) + s.tokens.push({ type: 'th_close', level: --s.level })) for ( s.tokens.push({ type: 'tr_close', level: --s.level }), s.tokens.push({ type: 'thead_close', level: --s.level }), @@ -64602,7 +64731,7 @@ x < j.length; x++ ) - s.tokens.push({ type: 'td_open', align: B[x], level: s.level++ }), + (s.tokens.push({ type: 'td_open', align: B[x], level: s.level++ }), (L = j[x] .substring( 124 === j[x].charCodeAt(0) ? 1 : 0, @@ -64610,7 +64739,7 @@ ) .trim()), s.tokens.push({ type: 'inline', content: L, level: s.level, children: [] }), - s.tokens.push({ type: 'td_close', level: --s.level }) + s.tokens.push({ type: 'td_close', level: --s.level })) s.tokens.push({ type: 'tr_close', level: --s.level }) } return ( @@ -64632,10 +64761,10 @@ if (s.tShift[L] < s.blkIndent) return !1 if ((u = skipMarker(s, L)) < 0) return !1 if (s.level >= s.options.maxNesting) return !1 - ;(j = s.tokens.length), + ;((j = s.tokens.length), s.tokens.push({ type: 'dl_open', lines: (C = [o, 0]), level: s.level++ }), (w = o), - (_ = L) + (_ = L)) e: for (;;) { for ( Z = !0, @@ -64650,7 +64779,6 @@ }), s.tokens.push({ type: 'dt_close', level: --s.level }); ; - ) { if ( (s.tokens.push({ type: 'dd_open', lines: (x = [L, 0]), level: s.level++ }), @@ -64761,7 +64889,6 @@ w < i && ((s.line = w = s.skipEmptyLines(w)), !(w >= i)) && !(s.tShift[w] < s.blkIndent); - ) { for (a = 0; a < _ && !u[a](s, w, i, !1); a++); if ( @@ -64808,7 +64935,7 @@ _ = 0, w = 0 if (!s) return [] - ;(s = (s = s.replace(jA, ' ')).replace(CA, '\n')).indexOf('\t') >= 0 && + ;((s = (s = s.replace(jA, ' ')).replace(CA, '\n')).indexOf('\t') >= 0 && (s = s.replace(AA, function (o, i) { var a return 10 === s.charCodeAt(i) @@ -64816,7 +64943,7 @@ : ((a = ' '.slice((i - _ - w) % 4)), (w = i - _ + 1), a) })), (u = new StateBlock(s, this, o, i, a)), - this.tokenize(u, u.line, u.lineMax) + this.tokenize(u, u.line, u.lineMax)) } for (var PA = [], IA = 0; IA < 256; IA++) PA.push(0) function isAlphaNum(s) { @@ -65071,11 +65198,11 @@ } s.push({ type: 'hardbreak', level: s.level }) } else - (s.pending = s.pending.slice(0, -1)), - s.push({ type: 'softbreak', level: s.level }) + ((s.pending = s.pending.slice(0, -1)), + s.push({ type: 'softbreak', level: s.level })) else s.push({ type: 'softbreak', level: s.level }) for (u++; u < a && 32 === s.src.charCodeAt(u); ) u++ - return (s.pos = u), !0 + return ((s.pos = u), !0) }, ], [ @@ -65087,18 +65214,17 @@ if (92 !== s.src.charCodeAt(a)) return !1 if (++a < u) { if ((i = s.src.charCodeAt(a)) < 256 && 0 !== PA[i]) - return o || (s.pending += s.src[a]), (s.pos += 2), !0 + return (o || (s.pending += s.src[a]), (s.pos += 2), !0) if (10 === i) { for ( o || s.push({ type: 'hardbreak', level: s.level }), a++; a < u && 32 === s.src.charCodeAt(a); - ) a++ - return (s.pos = a), !0 + return ((s.pos = a), !0) } } - return o || (s.pending += '\\'), s.pos++, !0 + return (o || (s.pending += '\\'), s.pos++, !0) }, ], [ @@ -65130,7 +65256,7 @@ !0 ) } - return o || (s.pending += u), (s.pos += u.length), !0 + return (o || (s.pending += u), (s.pos += u.length), !0) }, ], [ @@ -65157,7 +65283,7 @@ if (126 === w) return !1 if (32 === w || 10 === w) return !1 for (a = C + 2; a < x && 126 === s.src.charCodeAt(a); ) a++ - if (a > C + 3) return (s.pos += a - C), o || (s.pending += s.src.slice(C, a)), !0 + if (a > C + 3) return ((s.pos += a - C), o || (s.pending += s.src.slice(C, a)), !0) for (s.pos = C + 2, u = 1; s.pos + 1 < x; ) { if ( 126 === s.src.charCodeAt(s.pos) && @@ -65209,7 +65335,7 @@ if (43 === w) return !1 if (32 === w || 10 === w) return !1 for (a = C + 2; a < x && 43 === s.src.charCodeAt(a); ) a++ - if (a !== C + 2) return (s.pos += a - C), o || (s.pending += s.src.slice(C, a)), !0 + if (a !== C + 2) return ((s.pos += a - C), o || (s.pending += s.src.slice(C, a)), !0) for (s.pos = C + 2, u = 1; s.pos + 1 < x; ) { if ( 43 === s.src.charCodeAt(s.pos) && @@ -65261,7 +65387,7 @@ if (61 === w) return !1 if (32 === w || 10 === w) return !1 for (a = C + 2; a < x && 61 === s.src.charCodeAt(a); ) a++ - if (a !== C + 2) return (s.pos += a - C), o || (s.pending += s.src.slice(C, a)), !0 + if (a !== C + 2) return ((s.pos += a - C), o || (s.pending += s.src.slice(C, a)), !0) for (s.pos = C + 2, u = 1; s.pos + 1 < x; ) { if ( 61 === s.src.charCodeAt(s.pos) && @@ -65305,7 +65431,7 @@ if (95 !== B && 42 !== B) return !1 if (o) return !1 if (((i = (C = scanDelims(s, L)).delims), !C.can_open)) - return (s.pos += i), o || (s.pending += s.src.slice(L, s.pos)), !0 + return ((s.pos += i), o || (s.pending += s.src.slice(L, s.pos)), !0) if (s.level >= s.options.maxNesting) return !1 for (s.pos = L + i, x = [i]; s.pos < j; ) if (s.src.charCodeAt(s.pos) !== B) s.parser.skipToken(s) @@ -65317,16 +65443,16 @@ break } if (((w -= _), 0 === x.length)) break - ;(s.pos += _), (_ = x.pop()) + ;((s.pos += _), (_ = x.pop())) } if (0 === x.length) { - ;(i = _), (u = !0) + ;((i = _), (u = !0)) break } s.pos += a continue } - C.can_open && x.push(a), (s.pos += a) + ;(C.can_open && x.push(a), (s.pos += a)) } return u ? ((s.posMax = s.pos), @@ -65439,7 +65565,7 @@ x++ ); else w = '' - if (x >= $ || 41 !== s.src.charCodeAt(x)) return (s.pos = B), !1 + if (x >= $ || 41 !== s.src.charCodeAt(x)) return ((s.pos = B), !1) x++ } else { if (s.linkLevel > 0) return !1 @@ -65452,8 +65578,8 @@ u || (void 0 === u && (x = a + 1), (u = s.src.slice(i, a))), !(C = s.env.references[normalizeReference(u)])) ) - return (s.pos = B), !1 - ;(_ = C.href), (w = C.title) + return ((s.pos = B), !1) + ;((_ = C.href), (w = C.title)) } return ( o || @@ -65644,9 +65770,9 @@ ) } else if ((a = s.src.slice(u).match(UA))) { var w = decodeEntity(a[1]) - if (a[1] !== w) return o || (s.pending += w), (s.pos += a[0].length), !0 + if (a[1] !== w) return (o || (s.pending += w), (s.pos += a[0].length), !0) } - return o || (s.pending += '&'), s.pos++, !0 + return (o || (s.pending += '&'), s.pos++, !0) }, ], ] @@ -65662,7 +65788,7 @@ -1 === ['vbscript', 'javascript', 'file', 'data'].indexOf(o.split(':')[0]) ) } - ;(ParserInline.prototype.skipToken = function (s) { + ;((ParserInline.prototype.skipToken = function (s) { var o, i, a = this.ruler.getRules(''), @@ -65671,7 +65797,7 @@ if ((i = s.cacheGet(_)) > 0) s.pos = i else { for (o = 0; o < u; o++) if (a[o](s, !0)) return void s.cacheSet(_, s.pos) - s.pos++, s.cacheSet(_, s.pos) + ;(s.pos++, s.cacheSet(_, s.pos)) } }), (ParserInline.prototype.tokenize = function (s) { @@ -65686,7 +65812,7 @@ (ParserInline.prototype.parse = function (s, o, i, a) { var u = new StateInline(s, this, o, i, a) this.tokenize(u) - }) + })) var zA = { default: { options: { @@ -65803,7 +65929,7 @@ }, } function StateCore(s, o, i) { - ;(this.src = o), + ;((this.src = o), (this.env = i), (this.options = s.options), (this.tokens = []), @@ -65811,10 +65937,10 @@ (this.inline = s.inline), (this.block = s.block), (this.renderer = s.renderer), - (this.typographer = s.typographer) + (this.typographer = s.typographer)) } function Remarkable(s, o) { - 'string' != typeof s && ((o = s), (s = 'default')), + ;('string' != typeof s && ((o = s), (s = 'default')), o && null != o.linkify && console.warn( @@ -65827,37 +65953,37 @@ (this.ruler = new Ruler()), (this.options = {}), this.configure(zA[s]), - this.set(o || {}) + this.set(o || {})) } - ;(Remarkable.prototype.set = function (s) { + ;((Remarkable.prototype.set = function (s) { index_browser_assign(this.options, s) }), (Remarkable.prototype.configure = function (s) { var o = this if (!s) throw new Error('Wrong `remarkable` preset, check name/content') - s.options && o.set(s.options), + ;(s.options && o.set(s.options), s.components && Object.keys(s.components).forEach(function (i) { s.components[i].rules && o[i].ruler.enable(s.components[i].rules, !0) - }) + })) }), (Remarkable.prototype.use = function (s, o) { - return s(this, o), this + return (s(this, o), this) }), (Remarkable.prototype.parse = function (s, o) { var i = new StateCore(this, s, o) - return this.core.process(i), i.tokens + return (this.core.process(i), i.tokens) }), (Remarkable.prototype.render = function (s, o) { - return (o = o || {}), this.renderer.render(this.parse(s, o), this.options, o) + return ((o = o || {}), this.renderer.render(this.parse(s, o), this.options, o)) }), (Remarkable.prototype.parseInline = function (s, o) { var i = new StateCore(this, s, o) - return (i.inlineMode = !0), this.core.process(i), i.tokens + return ((i.inlineMode = !0), this.core.process(i), i.tokens) }), (Remarkable.prototype.renderInline = function (s, o) { - return (o = o || {}), this.renderer.render(this.parseInline(s, o), this.options, o) - }) + return ((o = o || {}), this.renderer.render(this.parseInline(s, o), this.options, o)) + })) function indexOf(s, o) { if (Array.prototype.indexOf) return s.indexOf(o) for (var i = 0, a = s.length; i < a; i++) if (s[i] === o) return i @@ -65871,30 +65997,30 @@ } var WA = (function () { function HtmlTag(s) { - void 0 === s && (s = {}), + ;(void 0 === s && (s = {}), (this.tagName = ''), (this.attrs = {}), (this.innerHTML = ''), (this.whitespaceRegex = /\s+/), (this.tagName = s.tagName || ''), (this.attrs = s.attrs || {}), - (this.innerHTML = s.innerHtml || s.innerHTML || '') + (this.innerHTML = s.innerHtml || s.innerHTML || '')) } return ( (HtmlTag.prototype.setTagName = function (s) { - return (this.tagName = s), this + return ((this.tagName = s), this) }), (HtmlTag.prototype.getTagName = function () { return this.tagName || '' }), (HtmlTag.prototype.setAttr = function (s, o) { - return (this.getAttrs()[s] = o), this + return ((this.getAttrs()[s] = o), this) }), (HtmlTag.prototype.getAttr = function (s) { return this.getAttrs()[s] }), (HtmlTag.prototype.setAttrs = function (s) { - return Object.assign(this.getAttrs(), s), this + return (Object.assign(this.getAttrs(), s), this) }), (HtmlTag.prototype.getAttrs = function () { return this.attrs || (this.attrs = {}) @@ -65910,10 +66036,9 @@ u = i ? i.split(a) : [], _ = s.split(a); (o = _.shift()); - ) -1 === indexOf(u, o) && u.push(o) - return (this.getAttrs().class = u.join(' ')), this + return ((this.getAttrs().class = u.join(' ')), this) }), (HtmlTag.prototype.removeClass = function (s) { for ( @@ -65923,12 +66048,11 @@ u = i ? i.split(a) : [], _ = s.split(a); u.length && (o = _.shift()); - ) { var w = indexOf(u, o) ;-1 !== w && u.splice(w, 1) } - return (this.getAttrs().class = u.join(' ')), this + return ((this.getAttrs().class = u.join(' ')), this) }), (HtmlTag.prototype.getClass = function () { return this.getAttrs().class || '' @@ -65937,7 +66061,7 @@ return -1 !== (' ' + this.getClass() + ' ').indexOf(' ' + s + ' ') }), (HtmlTag.prototype.setInnerHTML = function (s) { - return (this.innerHTML = s), this + return ((this.innerHTML = s), this) }), (HtmlTag.prototype.setInnerHtml = function (s) { return this.setInnerHTML(s) @@ -65967,13 +66091,13 @@ })() var JA = (function () { function AnchorTagBuilder(s) { - void 0 === s && (s = {}), + ;(void 0 === s && (s = {}), (this.newWindow = !1), (this.truncate = {}), (this.className = ''), (this.newWindow = s.newWindow || !1), (this.truncate = s.truncate || {}), - (this.className = s.className || '') + (this.className = s.className || '')) } return ( (AnchorTagBuilder.prototype.build = function (s) { @@ -66035,7 +66159,7 @@ u = Math.ceil(a), _ = -1 * Math.floor(a), w = '' - return _ < 0 && (w = s.substr(_)), s.substr(0, u) + i + w + return (_ < 0 && (w = s.substr(_)), s.substr(0, u) + i + w) } if (s.length <= o) return s var _ = o - u, @@ -66128,12 +66252,12 @@ })(), HA = (function () { function Match(s) { - ;(this.__jsduckDummyDocProp = null), + ;((this.__jsduckDummyDocProp = null), (this.matchedText = ''), (this.offset = 0), (this.tagBuilder = s.tagBuilder), (this.matchedText = s.matchedText), - (this.offset = s.offset) + (this.offset = s.offset)) } return ( (Match.prototype.getMatchedText = function () { @@ -66176,8 +66300,9 @@ function __() { this.constructor = s } - extendStatics(s, o), - (s.prototype = null === o ? Object.create(o) : ((__.prototype = o.prototype), new __())) + ;(extendStatics(s, o), + (s.prototype = + null === o ? Object.create(o) : ((__.prototype = o.prototype), new __()))) } var __assign = function () { return ( @@ -66199,7 +66324,7 @@ GA = (function (s) { function EmailMatch(o) { var i = s.call(this, o) || this - return (i.email = ''), (i.email = o.email), i + return ((i.email = ''), (i.email = o.email), i) } return ( tslib_es6_extends(EmailMatch, s), @@ -66304,7 +66429,7 @@ (MentionMatch.prototype.getCssClassSuffixes = function () { var o = s.prototype.getCssClassSuffixes.call(this), i = this.getServiceName() - return i && o.push(i), o + return (i && o.push(i), o) }), MentionMatch ) @@ -66407,7 +66532,7 @@ return s.replace(this.protocolRelativeRegex, '') }), (UrlMatch.prototype.removeTrailingSlash = function (s) { - return '/' === s.charAt(s.length - 1) && (s = s.slice(0, -1)), s + return ('/' === s.charAt(s.length - 1) && (s = s.slice(0, -1)), s) }), (UrlMatch.prototype.removePercentEncoding = function (s) { var o = s @@ -66426,7 +66551,7 @@ ) })(HA), eC = function eC(s) { - ;(this.__jsduckDummyDocProp = null), (this.tagBuilder = s.tagBuilder) + ;((this.__jsduckDummyDocProp = null), (this.tagBuilder = s.tagBuilder)) }, tC = /[A-Za-z]/, rC = /[\d]/, @@ -66473,7 +66598,7 @@ bC = (function (s) { function EmailMatcher() { var o = (null !== s && s.apply(this, arguments)) || this - return (o.localPartCharRegex = yC), (o.strictTldRegex = vC), o + return ((o.localPartCharRegex = yC), (o.strictTldRegex = vC), o) } return ( tslib_es6_extends(EmailMatcher, s), @@ -66490,7 +66615,6 @@ j = 0, L = w; C < _; - ) { var B = s.charAt(C) switch (j) { @@ -66523,7 +66647,7 @@ } C++ } - return captureMatchIfValidAndReset(), u + return (captureMatchIfValidAndReset(), u) function stateNonEmailAddress(s) { 'm' === s ? beginEmailMatch(1) : i.test(s) && beginEmailMatch() } @@ -66580,10 +66704,10 @@ : captureMatchIfValidAndReset() } function beginEmailMatch(s) { - void 0 === s && (s = 2), (j = s), (L = new _C({ idx: C })) + ;(void 0 === s && (s = 2), (j = s), (L = new _C({ idx: C }))) } function resetToNonEmailMatchState() { - ;(j = 0), (L = w) + ;((j = 0), (L = w)) } function captureMatchIfValidAndReset() { if (L.hasDomainDot) { @@ -66604,10 +66728,10 @@ ) })(eC), _C = function _C(s) { - void 0 === s && (s = {}), + ;(void 0 === s && (s = {}), (this.idx = void 0 !== s.idx ? s.idx : -1), (this.hasMailtoPrefix = !!s.hasMailtoPrefix), - (this.hasDomainDot = !!s.hasDomainDot) + (this.hasDomainDot = !!s.hasDomainDot)) }, SC = (function () { function UrlMatchValidator() {} @@ -66744,7 +66868,7 @@ }) if (Z) { var ee = i.indexOf(Z) - ;(i = i.substr(ee)), (j = j.substr(ee)), (U += ee) + ;((i = i.substr(ee)), (j = j.substr(ee)), (U += ee)) } var ie = j ? 'scheme' : L ? 'www' : 'tld', ae = !!j @@ -66765,7 +66889,6 @@ }, C = this; null !== (o = i.exec(s)); - ) _loop_1() return x @@ -66805,7 +66928,7 @@ OC = (function (s) { function HashtagMatcher(o) { var i = s.call(this, o) || this - return (i.serviceName = 'twitter'), (i.serviceName = o.serviceName), i + return ((i.serviceName = 'twitter'), (i.serviceName = o.serviceName), i) } return ( tslib_es6_extends(HashtagMatcher, s), @@ -66819,7 +66942,6 @@ w = -1, x = 0; _ < u; - ) { var C = s.charAt(_) switch (x) { @@ -66840,7 +66962,7 @@ } _++ } - return captureMatchIfValid(), a + return (captureMatchIfValid(), a) function stateNone(s) { '#' === s ? ((x = 2), (w = _)) : hC.test(s) && (x = 1) } @@ -66887,7 +67009,7 @@ jC = (function (s) { function PhoneMatcher() { var o = (null !== s && s.apply(this, arguments)) || this - return (o.matcherRegex = CC), o + return ((o.matcherRegex = CC), o) } return ( tslib_es6_extends(PhoneMatcher, s), @@ -66895,7 +67017,6 @@ for ( var o, i = this.matcherRegex, a = this.tagBuilder, u = []; null !== (o = i.exec(s)); - ) { var _ = o[0], w = _.replace(/[^0-9,;#]/g, ''), @@ -66989,7 +67110,6 @@ B = 0, $ = x; C < j; - ) { var U = s.charAt(C) switch (L) { @@ -67203,21 +67323,21 @@ '>' === s ? emitTagAndPreviousTextNode() : '<' === s && startNewTag() } function resetToDataState() { - ;(L = 0), ($ = x) + ;((L = 0), ($ = x)) } function startNewTag() { - ;(L = 1), ($ = new DC({ idx: C })) + ;((L = 1), ($ = new DC({ idx: C }))) } function emitTagAndPreviousTextNode() { var o = s.slice(B, $.idx) - o && u(o, B), + ;(o && u(o, B), 'comment' === $.type ? _($.idx) : 'doctype' === $.type ? w($.idx) : ($.isOpening && i($.name, $.idx), $.isClosing && a($.name, $.idx)), resetToDataState(), - (B = C + 1) + (B = C + 1)) } function captureTagName() { var o = $.idx + ($.isClosing ? 2 : 1) @@ -67226,20 +67346,20 @@ B < C && (function emitText() { var o = s.slice(B, C) - u(o, B), (B = C + 1) + ;(u(o, B), (B = C + 1)) })() } var DC = function DC(s) { - void 0 === s && (s = {}), + ;(void 0 === s && (s = {}), (this.idx = void 0 !== s.idx ? s.idx : -1), (this.type = s.type || 'tag'), (this.name = s.name || ''), (this.isOpening = !!s.isOpening), - (this.isClosing = !!s.isClosing) + (this.isClosing = !!s.isClosing)) }, LC = (function () { function Autolinker(s) { - void 0 === s && (s = {}), + ;(void 0 === s && (s = {}), (this.version = Autolinker.version), (this.urls = {}), (this.email = !0), @@ -67272,17 +67392,17 @@ 'boolean' == typeof s.decodePercentEncoding ? s.decodePercentEncoding : this.decodePercentEncoding), - (this.sanitizeHtml = s.sanitizeHtml || !1) + (this.sanitizeHtml = s.sanitizeHtml || !1)) var o = this.mention if (!1 !== o && -1 === ['twitter', 'instagram', 'soundcloud', 'tiktok'].indexOf(o)) throw new Error("invalid `mention` cfg '".concat(o, "' - see docs")) var i = this.hashtag if (!1 !== i && -1 === AC.indexOf(i)) throw new Error("invalid `hashtag` cfg '".concat(i, "' - see docs")) - ;(this.truncate = this.normalizeTruncateCfg(s.truncate)), + ;((this.truncate = this.normalizeTruncateCfg(s.truncate)), (this.className = s.className || this.className), (this.replaceFn = s.replaceFn || this.replaceFn), - (this.context = s.context || this) + (this.context = s.context || this)) } return ( (Autolinker.link = function (s, o) { @@ -67338,10 +67458,10 @@ if (!o.global) throw new Error("`splitRegex` must have the 'g' flag set") for (var i, a = [], u = 0; (i = o.exec(s)); ) - a.push(s.substring(u, i.index)), + (a.push(s.substring(u, i.index)), a.push(i[0]), - (u = i.index + i[0].length) - return a.push(s.substring(u)), a + (u = i.index + i[0].length)) + return (a.push(s.substring(u)), a) })(s, /( | |<|<|>|>|"|"|')/gi), w = i _.forEach(function (s, i) { @@ -67421,7 +67541,7 @@ ) }), (Autolinker.prototype.parseText = function (s, o) { - void 0 === o && (o = 0), (o = o || 0) + ;(void 0 === o && (o = 0), (o = o || 0)) for (var i = this.getMatchers(), a = [], u = 0, _ = i.length; u < _; u++) { for (var w = i[u].parseMatches(s), x = 0, C = w.length; x < C; x++) w[x].setOffset(o + w[x].getOffset()) @@ -67434,11 +67554,11 @@ this.sanitizeHtml && (s = s.replace(//g, '>')) for (var o = this.parse(s), i = [], a = 0, u = 0, _ = o.length; u < _; u++) { var w = o[u] - i.push(s.substring(a, w.getOffset())), + ;(i.push(s.substring(a, w.getOffset())), i.push(this.createMatchReturnVal(w)), - (a = w.getOffset() + w.getMatchedText().length) + (a = w.getOffset() + w.getMatchedText().length)) } - return i.push(s.substring(a)), i.join('') + return (i.push(s.substring(a)), i.join('')) }), (Autolinker.prototype.createMatchReturnVal = function (s) { var o @@ -67576,8 +67696,8 @@ x.push({ type: 'text', content: $[C].text, level: L }), x.push({ type: 'link_close', level: --L }), (w = w.slice(j + $[C].text.length))) - w.length && x.push({ type: 'text', content: w, level: L }), - (V[i].children = u = [].concat(u.slice(0, o), x, u.slice(o + 1))) + ;(w.length && x.push({ type: 'text', content: w, level: L }), + (V[i].children = u = [].concat(u.slice(0, o), x, u.slice(o + 1)))) } } else for (o--; u[o].level !== _.level && 'link_open' !== u[o].type; ) o-- } @@ -67593,7 +67713,7 @@ } = Object let { freeze: WC, seal: JC, create: HC } = Object, { apply: KC, construct: GC } = 'undefined' != typeof Reflect && Reflect - WC || + ;(WC || (WC = function freeze(s) { return s }), @@ -67608,7 +67728,7 @@ GC || (GC = function construct(s, o) { return new s(...o) - }) + })) const YC = unapply(Array.prototype.forEach), XC = unapply(Array.prototype.lastIndexOf), QC = unapply(Array.prototype.pop), @@ -68348,7 +68468,7 @@ (DOMPurify.removed = []), !s || !s.document || s.document.nodeType !== EP || !s.Element) ) - return (DOMPurify.isSupported = !1), DOMPurify + return ((DOMPurify.isSupported = !1), DOMPurify) let { document: o } = s const i = o, a = i.currentScript, @@ -68587,9 +68707,9 @@ throw zj( 'TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.' ) - ;(ie = s.TRUSTED_TYPES_POLICY), (ae = ie.createHTML('')) + ;((ie = s.TRUSTED_TYPES_POLICY), (ae = ie.createHTML(''))) } else - void 0 === ie && + (void 0 === ie && (ie = (function _createTrustedTypesPolicy(s, o) { if ('object' != typeof s || 'function' != typeof s.createPolicy) return null let i = null @@ -68603,12 +68723,13 @@ }) } catch (s) { return ( - console.warn('TrustedTypes policy ' + u + ' could not be created.'), null + console.warn('TrustedTypes policy ' + u + ' could not be created.'), + null ) } })($, a)), - null !== ie && 'string' == typeof ae && (ae = ie.createHTML('')) - WC && WC(s), (Lt = s) + null !== ie && 'string' == typeof ae && (ae = ie.createHTML(''))) + ;(WC && WC(s), (Lt = s)) } }, qt = addToSet({}, [...Kj, ...Gj, ...Xj]), @@ -68704,7 +68825,7 @@ } const Gt = function _sanitizeElements(s) { let o = null - if ((_executeHooks(ye.beforeSanitizeElements, s, null), Ht(s))) return Vt(s), !0 + if ((_executeHooks(ye.beforeSanitizeElements, s, null), Ht(s))) return (Vt(s), !0) const i = Dt(s.nodeName) if ( (_executeHooks(ye.uponSanitizeElement, s, { tagName: i, allowedTags: qe }), @@ -68714,9 +68835,9 @@ $j(/<[/\w!]/g, s.innerHTML) && $j(/<[/\w!]/g, s.textContent)) ) - return Vt(s), !0 - if (s.nodeType === _P) return Vt(s), !0 - if (ot && s.nodeType === SP && $j(/<[/\w]/g, s.data)) return Vt(s), !0 + return (Vt(s), !0) + if (s.nodeType === _P) return (Vt(s), !0) + if (ot && s.nodeType === SP && $j(/<[/\w]/g, s.data)) return (Vt(s), !0) if (!qe[i] || Xe[i]) { if (!Xe[i] && Xt(i)) { if (Ye.tagNameCheck instanceof RegExp && $j(Ye.tagNameCheck, i)) return !1 @@ -68728,11 +68849,11 @@ if (i && o) { for (let a = i.length - 1; a >= 0; --a) { const u = V(i[a], !0) - ;(u.__removalCount = (s.__removalCount || 0) + 1), o.insertBefore(u, Y(s)) + ;((u.__removalCount = (s.__removalCount || 0) + 1), o.insertBefore(u, Y(s))) } } } - return Vt(s), !0 + return (Vt(s), !0) } return s instanceof x && !(function _checkValidNamespace(s) { @@ -68870,8 +68991,8 @@ } if (L !== j) try { - w ? s.setAttributeNS(w, _, L) : s.setAttribute(_, L), - Ht(s) ? Vt(s) : QC(DOMPurify.removed) + ;(w ? s.setAttributeNS(w, _, L) : s.setAttribute(_, L), + Ht(s) ? Vt(s) : QC(DOMPurify.removed)) } catch (o) { zt(_, s) } @@ -68883,10 +69004,10 @@ let o = null const i = Jt(s) for (_executeHooks(ye.beforeSanitizeShadowDOM, s, null); (o = i.nextNode()); ) - _executeHooks(ye.uponSanitizeShadowNode, o, null), + (_executeHooks(ye.uponSanitizeShadowNode, o, null), Gt(o), Qt(o), - o.content instanceof u && _sanitizeShadowDOM(o.content) + o.content instanceof u && _sanitizeShadowDOM(o.content)) _executeHooks(ye.afterSanitizeShadowDOM, s, null) } return ( @@ -68909,11 +69030,11 @@ throw zj('root node is forbidden and cannot be sanitized in-place') } } else if (s instanceof w) - (a = Wt('\x3c!----\x3e')), + ((a = Wt('\x3c!----\x3e')), (_ = a.ownerDocument.importNode(s, !0)), (_.nodeType === vP && 'BODY' === _.nodeName) || 'HTML' === _.nodeName ? (a = _) - : a.appendChild(_) + : a.appendChild(_)) else { if (!lt && !st && !it && -1 === s.indexOf('<')) return ie && pt ? ie.createHTML(s) : s @@ -68921,13 +69042,13 @@ } a && ct && Vt(a.firstChild) const j = Jt(gt ? s : a) - for (; (x = j.nextNode()); ) Gt(x), Qt(x), x.content instanceof u && Zt(x.content) + for (; (x = j.nextNode()); ) (Gt(x), Qt(x), x.content instanceof u && Zt(x.content)) if (gt) return s if (lt) { if (ut) for (C = pe.call(a.ownerDocument); a.firstChild; ) C.appendChild(a.firstChild) else C = a - return (We.shadowroot || We.shadowrootmode) && (C = fe.call(i, C, !0)), C + return ((We.shadowroot || We.shadowrootmode) && (C = fe.call(i, C, !0)), C) } let L = it ? a.outerHTML : a.innerHTML return ( @@ -68946,10 +69067,10 @@ ) }), (DOMPurify.setConfig = function () { - $t(arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}), (at = !0) + ;($t(arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}), (at = !0)) }), (DOMPurify.clearConfig = function () { - ;(Lt = null), (at = !1) + ;((Lt = null), (at = !1)) }), (DOMPurify.isValidAttribute = function (s, o, i) { Lt || $t({}) @@ -68988,7 +69109,7 @@ })() xP.addHook && xP.addHook('beforeSanitizeElements', function (s) { - return s.href && s.setAttribute('rel', 'noopener noreferrer'), s + return (s.href && s.setAttribute('rel', 'noopener noreferrer'), s) }) const kP = function Markdown({ source: s, @@ -69477,7 +69598,7 @@ }, setIsIncludedOptions = (s) => { let o = { key: s, shouldDispatchInit: !1, defaultValue: !0 } - return 'no value' === a.get(s, 'no value') && (o.shouldDispatchInit = !0), o + return ('no value' === a.get(s, 'no value') && (o.shouldDispatchInit = !0), o) }, Z = _('Markdown', !0), ee = _('modelExample'), @@ -69495,7 +69616,7 @@ Se = be.get('examples', null), we = Se?.map((s, i) => { const a = s?.get('value', null) - return a && (s = s.set('value', getDefaultRequestBodyValue(o, j, i, C), a)), s + return (a && (s = s.set('value', getDefaultRequestBodyValue(o, j, i, C), a)), s) }) u = ze.List.isList(u) ? u : (0, ze.List)() if (C.isFileUploadIntended(be?.get('schema'), j)) { @@ -69548,10 +69669,10 @@ we = i.getIn([j, 'errors']) || u, xe = a.get(j) || !1 let Pe = C.getSampleSchema(V, !1, { includeWriteOnly: !0 }) - !1 === Pe && (Pe = 'false'), + ;(!1 === Pe && (Pe = 'false'), 0 === Pe && (Pe = '0'), 'string' != typeof Pe && 'object' === ce && (Pe = stringify(Pe)), - 'string' == typeof Pe && 'array' === ce && (Pe = JSON.parse(Pe)) + 'string' == typeof Pe && 'array' === ce && (Pe = JSON.parse(Pe))) const Te = C.isFileUploadIntended(V), $e = Re.createElement(s, { fn: C, @@ -69744,7 +69865,7 @@ (s.find((s) => s.get('url') === o) || (0, ze.OrderedMap)()).get('variables') || (0, ze.OrderedMap)(), x = 0 !== w.size - ;(0, Re.useEffect)(() => { + ;((0, Re.useEffect)(() => { o || i(s.first()?.get('url')) }, []), (0, Re.useEffect)(() => { @@ -69753,7 +69874,7 @@ ;(u.get('variables') || (0, ze.OrderedMap)()).map((s, i) => { a({ server: o, key: i, val: s.get('default') || '' }) }) - }, [o, s]) + }, [o, s])) const C = (0, Re.useCallback)( (s) => { i(s.target.value) @@ -69874,13 +69995,13 @@ class RequestBodyEditor extends Re.PureComponent { static defaultProps = { onChange: UP, userHasEditedBody: !1 } constructor(s, o) { - super(s, o), + ;(super(s, o), (this.state = { value: stringify(s.value) || s.defaultValue }), - s.onChange(s.value) + s.onChange(s.value)) } applyDefaultValue = (s) => { const { onChange: o, defaultValue: i } = s || this.props - return this.setState({ value: i }), o(i) + return (this.setState({ value: i }), o(i)) } onChange = (s) => { this.props.onChange(stringify(s)) @@ -69890,10 +70011,10 @@ this.setState({ value: o }, () => this.onChange(o)) } UNSAFE_componentWillReceiveProps(s) { - this.props.value !== s.value && + ;(this.props.value !== s.value && s.value !== this.state.value && this.setState({ value: stringify(s.value) }), - !s.value && s.defaultValue && this.state.value && this.applyDefaultValue(s) + !s.value && s.defaultValue && this.state.value && this.applyDefaultValue(s)) } render() { let { getComponent: s, errors: o } = this.props, @@ -69927,7 +70048,7 @@ let { onChange: o } = this.props, { value: i, name: a } = s.target, u = Object.assign({}, this.state.value) - a ? (u[a] = i) : (u = i), this.setState({ value: u }, () => o(this.state)) + ;(a ? (u[a] = i) : (u = i), this.setState({ value: u }, () => o(this.state))) } render() { let { @@ -70052,7 +70173,7 @@ class operation_servers_OperationServers extends Re.Component { setSelectedServer = (s) => { const { path: o, method: i } = this.props - return this.forceUpdate(), this.props.setSelectedServer(s, `${o}:${i}`) + return (this.forceUpdate(), this.props.setSelectedServer(s, `${o}:${i}`)) } setServerVariableValue = (s) => { const { path: o, method: i } = this.props @@ -70124,7 +70245,7 @@ operationLink: qP, }, zP = new Remarkable('commonmark') - zP.block.ruler.enable(['table']), zP.set({ linkTarget: '_blank' }) + ;(zP.block.ruler.enable(['table']), zP.set({ linkTarget: '_blank' })) const WP = OAS3ComponentWrapFactory( ({ source: s, @@ -70390,11 +70511,11 @@ var i, a if ('string' != typeof o) { const { server: u, namespace: _ } = o - ;(a = u), + ;((a = u), (i = _ ? s.getIn([_, 'serverVariableValues', a]) - : s.getIn(['serverVariableValues', a])) - } else (a = o), (i = s.getIn(['serverVariableValues', a])) + : s.getIn(['serverVariableValues', a]))) + } else ((a = o), (i = s.getIn(['serverVariableValues', a]))) i = i || (0, ze.OrderedMap)() let u = a return ( @@ -70492,7 +70613,7 @@ _.reduce((s, o) => s.setIn([o, 'errors'], (0, ze.fromJS)(u)), s) ) } - return console.warn('unexpected result: SET_REQUEST_BODY_VALIDATE_ERROR'), s + return (console.warn('unexpected result: SET_REQUEST_BODY_VALIDATE_ERROR'), s) }, [iI]: (s, { payload: { path: o, method: i } }) => { const a = s.getIn(['requestData', o, i, 'bodyValue']) @@ -70869,8 +70990,8 @@ handleJSONSchema202012Expand = (i) => (u, _) => { const w = [...j, i] if (_) { - null != o.specResolvedSubtree(w) || s.requestResolvedSubtree([...j, i]), - a.show(w, !0) + ;(null != o.specResolvedSubtree(w) || s.requestResolvedSubtree([...j, i]), + a.show(w, !0)) } else a.show(w, !1) } return !C || B < 0 @@ -70921,7 +71042,7 @@ } class auths_Auths extends Re.Component { constructor(s, o) { - super(s, o), (this.state = {}) + ;(super(s, o), (this.state = {})) } onAuthChange = (s) => { let { name: o } = s @@ -70936,7 +71057,7 @@ s.preventDefault() let { authActions: o, definitions: i } = this.props, a = i.map((s, o) => o).toArray() - this.setState(a.reduce((s, o) => ((s[o] = ''), s), {})), o.logoutWithPersistOption(a) + ;(this.setState(a.reduce((s, o) => ((s[o] = ''), s), {})), o.logoutWithPersistOption(a)) } close = (s) => { s.preventDefault() @@ -71299,7 +71420,7 @@ ? ze.Map.isMap(o) ? Object.entries(s.toJS()).reduce((s, [i, a]) => { const u = o.get(i) - return (s[i] = u?.toJS() || a), s + return ((s[i] = u?.toJS() || a), s) }, {}) : s.toJS() : {} @@ -72069,7 +72190,7 @@ return { state: o, setState: (i) => { - i(o), s({}) + ;(i(o), s({})) }, } }, @@ -72086,13 +72207,13 @@ pathMutator: (s, o = { deep: !1 }) => { const u = a.toString(), updateFn = (o) => { - ;(o.paths[u] = s), + ;((o.paths[u] = s), s === JSONSchemaIsExpandedState.Collapsed && Object.keys(o.paths).forEach((s) => { s.startsWith(u) && o.paths[s] === JSONSchemaIsExpandedState.DeeplyExpanded && (o.paths[s] = JSONSchemaIsExpandedState.Expanded) - }) + })) }, updateDeepFn = (o) => { Object.keys(o.paths).forEach((i) => { @@ -72211,13 +72332,13 @@ bt = useComponent('ExpandDeepButton'), _t = (0, Re.useCallback)( (s, o) => { - o ? L() : B(), a(s, o, !1) + ;(o ? L() : B(), a(s, o, !1)) }, [a, L, B] ), St = (0, Re.useCallback)( (s, o) => { - o ? L({ deep: !0 }) : B({ deep: !0 }), a(s, o, !0) + ;(o ? L({ deep: !0 }) : B({ deep: !0 }), a(s, o, !0)) }, [a, L, B] ) @@ -73445,7 +73566,7 @@ ] .filter(Boolean) .join(' | ') - return i.delete(o), x || 'any' + return (i.delete(o), x || 'any') } return getType }, @@ -73537,26 +73658,26 @@ if (w || C) return `${L ? '<' : '≤'} ${L ? u : i}` return null })(s) - null !== a && o.push({ scope: 'number', value: a }), - s?.format && o.push({ scope: 'string', value: s.format }) + ;(null !== a && o.push({ scope: 'number', value: a }), + s?.format && o.push({ scope: 'string', value: s.format })) const u = stringifyConstraintRange('characters', s?.minLength, s?.maxLength) - null !== u && o.push({ scope: 'string', value: u }), + ;(null !== u && o.push({ scope: 'string', value: u }), s?.pattern && o.push({ scope: 'string', value: `matches ${s?.pattern}` }), s?.contentMediaType && o.push({ scope: 'string', value: `media type: ${s.contentMediaType}` }), s?.contentEncoding && - o.push({ scope: 'string', value: `encoding: ${s.contentEncoding}` }) + o.push({ scope: 'string', value: `encoding: ${s.contentEncoding}` })) const _ = stringifyConstraintRange( s?.uniqueItems ? 'unique items' : 'items', s?.minItems, s?.maxItems ) - null !== _ && o.push({ scope: 'array', value: _ }), - s?.uniqueItems && !_ && o.push({ scope: 'array', value: 'unique' }) + ;(null !== _ && o.push({ scope: 'array', value: _ }), + s?.uniqueItems && !_ && o.push({ scope: 'array', value: 'unique' })) const w = stringifyConstraintRange('contained items', s?.minContains, s?.maxContains) null !== w && o.push({ scope: 'array', value: w }) const x = stringifyConstraintRange('properties', s?.minProperties, s?.maxProperties) - return null !== x && o.push({ scope: 'object', value: x }), o + return (null !== x && o.push({ scope: 'object', value: x }), o) }, getDependentRequired = (s, o) => o?.dependentRequired @@ -74131,7 +74252,9 @@ }, HOC = (o) => Re.createElement(rT.Provider, { value: i }, Re.createElement(s, o)) return ( - (HOC.contexts = { JSONSchemaContext: rT }), (HOC.displayName = s.displayName), HOC + (HOC.contexts = { JSONSchemaContext: rT }), + (HOC.displayName = s.displayName), + HOC ) }, makeWithJSONSchemaSystemContext = @@ -74328,7 +74451,7 @@ (Number.isInteger(a) && a > 0 && (C = s.slice(0, a)), Number.isInteger(i) && i > 0) ) for (let s = 0; C.length < i; s += 1) C.push(C[s % C.length]) - return !0 === u && (C = Array.from(new Set(C))), C + return (!0 === u && (C = Array.from(new Set(C))), C) })(o, s), object = () => { throw new Error('Not implemented') @@ -74444,7 +74567,7 @@ w = 0 for (let s = 0; s < o.length; s++) for (_ = (_ << 8) | o.charCodeAt(s), w += 8; w >= 5; ) - (u += i.charAt((_ >>> (w - 5)) & 31)), (w -= 5) + ((u += i.charAt((_ >>> (w - 5)) & 31)), (w -= 5)) w > 0 && ((u += i.charAt((_ << (5 - w)) & 31)), (a = (8 - ((8 * o.length) % 5)) % 5)) for (let s = 0; s < a; s++) u += '=' return u @@ -74537,7 +74660,7 @@ /(?<=(? inferType(s), typeCast = (s) => @@ -74806,14 +74929,14 @@ NT = merge_merge, main_sampleFromSchemaGeneric = (s, o = {}, i = void 0, a = !1) => { if (null == s && void 0 === i) return - 'function' == typeof s?.toJS && (s = s.toJS()), (s = typeCast(s)) + ;('function' == typeof s?.toJS && (s = s.toJS()), (s = typeCast(s))) let u = void 0 !== i || hasExample(s) const _ = !u && Array.isArray(s.oneOf) && s.oneOf.length > 0, w = !u && Array.isArray(s.anyOf) && s.anyOf.length > 0 if (!u && (_ || w)) { const i = typeCast(random_pick(_ ? s.oneOf : s.anyOf)) - !(s = NT(s, i, o)).xml && i.xml && (s.xml = i.xml), - hasExample(s) && hasExample(i) && (u = !0) + ;(!(s = NT(s, i, o)).xml && i.xml && (s.xml = i.xml), + hasExample(s) && hasExample(i) && (u = !0)) } const x = {} let { xml: C, properties: j, additionalProperties: L, items: B, contains: $ } = s || {}, @@ -74945,9 +75068,9 @@ ((ce[s]?.readOnly && !V) || (ce[s]?.writeOnly && !z) || (ce[s]?.xml?.attribute ? (x[ce[s].xml.name || s] = u[s]) : le(s, u[s]))) - return ds()(x) || ae[Y].push({ _attr: x }), ae + return (ds()(x) || ae[Y].push({ _attr: x }), ae) } - return (ae[Y] = ds()(x) ? u : [{ _attr: x }, u]), ae + return ((ae[Y] = ds()(x) ? u : [{ _attr: x }, u]), ae) } if ('array' === U) { let i = [] @@ -75003,10 +75126,10 @@ le(s)) if ((a && x && ae[Y].push({ _attr: x }), hasExceededMaxProperties())) return ae if (predicates_isBooleanJSONSchema(L) && L) - a + (a ? ae[Y].push({ additionalProp: 'Anything can be here' }) : (ae.additionalProp1 = {}), - pe++ + pe++) else if (isJSONSchemaObject(L)) { const i = L, u = main_sampleFromSchemaGeneric(i, o, void 0, a) @@ -75024,7 +75147,7 @@ if (hasExceededMaxProperties()) return ae if (a) { const i = {} - ;(i[o + s] = u.notagname), ae[Y].push(i) + ;((i[o + s] = u.notagname), ae[Y].push(i)) } else ae[o + s] = u pe++ } @@ -75073,10 +75196,10 @@ w = _.jsonSchema202012.getJsonSampleSchema(o, i, a, u) let x try { - ;(x = fn.dump(fn.load(w), { lineWidth: -1 }, { schema: rn })), - '\n' === x[x.length - 1] && (x = x.slice(0, x.length - 1)) + ;((x = fn.dump(fn.load(w), { lineWidth: -1 }, { schema: rn })), + '\n' === x[x.length - 1] && (x = x.slice(0, x.length - 1))) } catch (s) { - return console.error(s), 'error: could not generate yaml example' + return (console.error(s), 'error: could not generate yaml example') } return x.replace(/\t/g, ' ') }, @@ -75178,7 +75301,7 @@ const s = {} return ( (s.promise = new Promise((o, i) => { - ;(s.resolve = o), (s.reject = i) + ;((s.resolve = o), (s.reject = i)) })), s ) @@ -75406,13 +75529,13 @@ const u = [] for (const s of o) { const o = { ...s } - Object.hasOwn(o, 'domNode') && ((i = o.domNode), delete o.domNode), + ;(Object.hasOwn(o, 'domNode') && ((i = o.domNode), delete o.domNode), Object.hasOwn(o, 'urls.primaryName') ? ((a = o['urls.primaryName']), delete o['urls.primaryName']) : Array.isArray(o.urls) && Object.hasOwn(o.urls, 'primaryName') && ((a = o.urls.primaryName), delete o.urls.primaryName), - u.push(o) + u.push(o)) } const _ = Ye()(s, ...u) return ( @@ -75431,7 +75554,7 @@ w.register([a.plugins, _]) const x = w.getSystem(), persistConfigs = (s) => { - w.setConfigs(s), x.configsActions.loaded() + ;(w.setConfigs(s), x.configsActions.loaded()) }, updateSpec = (s) => { !o.url && 'object' == typeof s.spec && Object.keys(s.spec).length > 0 @@ -75458,12 +75581,12 @@ const { configUrl: s } = a, i = await sources_url({ url: s, system: x })(a), u = SwaggerUI.config.merge({}, a, i, o) - persistConfigs(u), null !== i && updateSpec(u), render(u) + ;(persistConfigs(u), null !== i && updateSpec(u), render(u)) })(), x) : (persistConfigs(a), updateSpec(a), render(a), x) } - ;(SwaggerUI.System = Store), + ;((SwaggerUI.System = Store), (SwaggerUI.config = { defaults: BT, merge: config_merge, @@ -75497,7 +75620,7 @@ SyntaxHighlighting: syntax_highlighting, Versions: versions, SafeRender: safe_render, - }) + })) const WT = SwaggerUI })(), (i = i.default) diff --git a/frontend/src/api/assistant.ts b/frontend/src/api/assistant.ts index bb955e09f..b883976f0 100644 --- a/frontend/src/api/assistant.ts +++ b/frontend/src/api/assistant.ts @@ -6,6 +6,6 @@ export const assistantApi = { add: (data: any) => request.post('/system/assistant', data), edit: (data: any) => request.put('/system/assistant', data), delete: (id: number) => request.delete(`/system/assistant/${id}`), - query: (id: number) => request.get(`/system/assistant/${id}`), + // query: (id: number) => request.get(`/system/assistant/${id}`), validate: (data: any) => request.get('/system/assistant/validator', { params: data }), } diff --git a/frontend/src/api/chat.ts b/frontend/src/api/chat.ts index 6c471f8c4..4a52187ee 100644 --- a/frontend/src/api/chat.ts +++ b/frontend/src/api/chat.ts @@ -1,5 +1,8 @@ import { request } from '@/utils/request' import { getDate } from '@/utils/utils.ts' +import { i18n } from '@/i18n' + +const { t } = i18n.global export const questionApi = { pager: (pageNumber: number, pageSize: number) => @@ -36,6 +39,7 @@ export class ChatRecord { question?: string sql_answer?: string sql?: string + datasource?: number data?: string | any chart_answer?: string chart?: string @@ -52,6 +56,8 @@ export class ChatRecord { analysis_record_id?: number predict_record_id?: number regenerate_record_id?: number + duration?: number + total_tokens?: number constructor() constructor( @@ -62,6 +68,7 @@ export class ChatRecord { question: string, sql_answer: string | undefined, sql: string | undefined, + datasource: number | undefined, data: string | any | undefined, chart_answer: string | undefined, chart: string | undefined, @@ -77,7 +84,9 @@ export class ChatRecord { recommended_question: string | undefined, analysis_record_id: number | undefined, predict_record_id: number | undefined, - regenerate_record_id: number | undefined + regenerate_record_id: number | undefined, + duration: number | undefined, + total_tokens: number | undefined ) constructor( id?: number, @@ -87,6 +96,7 @@ export class ChatRecord { question?: string, sql_answer?: string, sql?: string, + datasource?: number | undefined, data?: string | any, chart_answer?: string, chart?: string, @@ -102,7 +112,9 @@ export class ChatRecord { recommended_question?: string, analysis_record_id?: number, predict_record_id?: number, - regenerate_record_id?: number + regenerate_record_id?: number, + duration?: number, + total_tokens?: number ) { this.id = id this.chat_id = chat_id @@ -111,6 +123,7 @@ export class ChatRecord { this.question = question this.sql_answer = sql_answer this.sql = sql + this.datasource = datasource this.data = data this.chart_answer = chart_answer this.chart = chart @@ -127,6 +140,8 @@ export class ChatRecord { this.analysis_record_id = analysis_record_id this.predict_record_id = predict_record_id this.regenerate_record_id = regenerate_record_id + this.duration = duration + this.total_tokens = total_tokens } } @@ -252,6 +267,7 @@ const toChatRecord = (data?: any): ChatRecord | undefined => { data.question, data.sql_answer, data.sql, + data.datasource, data.data, data.chart_answer, data.chart, @@ -267,7 +283,9 @@ const toChatRecord = (data?: any): ChatRecord | undefined => { data.recommended_question, data.analysis_record_id, data.predict_record_id, - data.regenerate_record_id + data.regenerate_record_id, + data.duration, + data.total_tokens ) } const toChatRecordList = (list: any = []): ChatRecord[] => { @@ -281,6 +299,107 @@ const toChatRecordList = (list: any = []): ChatRecord[] => { return records } +export class ChatLogHistoryItem { + start_time?: Date | string + finish_time?: Date | string + duration?: number | undefined + total_tokens?: number | undefined + operate?: string | undefined + operate_key?: string | undefined + local_operation?: boolean | undefined + error?: boolean | undefined + message?: any + + constructor() + constructor( + start_time: Date | string, + finish_time: Date | string, + duration: number | undefined, + total_tokens: number | undefined, + operate: string | undefined, + local_operation: boolean | undefined, + error: boolean | undefined, + message: any | undefined + ) + constructor( + start_time?: Date | string, + finish_time?: Date | string, + duration?: number | undefined, + total_tokens?: number | undefined, + operate?: string | undefined, + local_operation?: boolean | undefined, + error?: boolean | undefined, + message?: any | undefined + ) { + this.start_time = getDate(start_time) + this.finish_time = getDate(finish_time) + this.duration = duration + this.total_tokens = total_tokens + this.operate_key = operate + this.operate = t('chat.log.' + operate) + this.local_operation = !!local_operation + this.error = !!error + this.message = message + } +} + +export class ChatLogHistory { + start_time?: Date | string + finish_time?: Date | string + duration?: number | undefined + total_tokens?: number | undefined + steps?: Array | undefined + + constructor() + constructor( + start_time: Date | string, + finish_time: Date | string, + duration: number | undefined, + total_tokens: number | undefined, + steps: Array | undefined + ) + constructor( + start_time?: Date | string, + finish_time?: Date | string, + duration?: number | undefined, + total_tokens?: number | undefined, + steps?: Array | undefined + ) { + this.start_time = getDate(start_time) + this.finish_time = getDate(finish_time) + this.duration = duration + this.total_tokens = total_tokens + this.steps = steps ? steps : [] + } +} + +const toChatLogHistoryItem = (data?: any): any | undefined => { + if (!data) { + return undefined + } + return new ChatLogHistoryItem( + data.start_time, + data.finish_time, + data.duration, + data.total_tokens, + data.operate, + data.local_operation, + data.error, + data.message + ) +} + +const toChatLogHistoryItemList = (list: any = []): ChatLogHistoryItem[] => { + const records: Array = [] + for (let i = 0; i < list.length; i++) { + const record = toChatLogHistoryItem(list[i]) + if (record) { + records.push(record) + } + } + return records +} + export const chatApi = { toChatInfo: (data?: any): ChatInfo | undefined => { if (!data) { @@ -312,6 +431,18 @@ export const chatApi = { } return infos }, + toChatLogHistory: (data?: any): ChatLogHistory | undefined => { + if (!data) { + return undefined + } + return new ChatLogHistory( + data.start_time, + data.finish_time, + data.duration, + data.total_tokens, + toChatLogHistoryItemList(data.steps) + ) + }, list: (): Promise> => { return request.get('/chat/list') }, @@ -327,17 +458,23 @@ export const chatApi = { get_chart_predict_data: (record_id?: number): Promise => { return request.get(`/chat/record/${record_id}/predict_data`) }, + get_chart_log_history: (record_id?: number): Promise => { + return request.get(`/chat/record/${record_id}/log`) + }, + get_chart_usage: (record_id?: number): Promise => { + return request.get(`/chat/record/${record_id}/usage`) + }, startChat: (data: any): Promise => { return request.post('/chat/start', data) }, - startAssistantChat: (): Promise => { - return request.post('/chat/assistant/start') + startAssistantChat: (data?: any): Promise => { + return request.post('/chat/assistant/start', Object.assign({ origin: 2 }, data)) }, renameChat: (chat_id: number | undefined, brief: string): Promise => { return request.post('/chat/rename', { id: chat_id, brief: brief }) }, deleteChat: (id: number | undefined, brief: any): Promise => { - return request.delete(`/chat/${id}/${brief}`) + return request.delete(`/chat/${id}`, { data: { id: id, brief: brief } }) }, analysis: (record_id: number | undefined, controller?: AbortController) => { return request.fetchStream(`/chat/record/${record_id}/analysis`, {}, controller) diff --git a/frontend/src/api/datasource.ts b/frontend/src/api/datasource.ts index 7f2fb782b..fe5bf9a78 100644 --- a/frontend/src/api/datasource.ts +++ b/frontend/src/api/datasource.ts @@ -6,6 +6,7 @@ export const datasourceApi = { relationGet: (id: any) => request.post(`/table_relation/get/${id}`), relationSave: (dsId: any, data: any) => request.post(`/table_relation/save/${dsId}`, data), add: (data: any) => request.post('/datasource/add', data), + importToDb: (data: any) => request.post('/datasource/importToDb', data), list: () => request.get('/datasource/list'), update: (data: any) => request.post('/datasource/update', data), delete: (id: number, name: string) => request.post(`/datasource/delete/${id}/${name}`), diff --git a/frontend/src/api/embedded.ts b/frontend/src/api/embedded.ts index 0733088ae..2e51008ae 100644 --- a/frontend/src/api/embedded.ts +++ b/frontend/src/api/embedded.ts @@ -5,7 +5,7 @@ export const getAdvancedApplicationList = () => request.get('/system/assistant/advanced_application') export const updateAssistant = (data: any) => request.put('/system/assistant', data) export const saveAssistant = (data: any) => request.post('/system/assistant', data) -export const getOne = (id: any) => request.get(`/system/assistant/${id}`) +// export const getOne = (id: any) => request.get(`/system/assistant/${id}`) export const delOne = (id: any) => request.delete(`/system/assistant/${id}`) export const dsApi = (id: any) => request.get(`/datasource/ws/${id}`) diff --git a/frontend/src/api/system.ts b/frontend/src/api/system.ts index aa7db56d9..4d56fecb1 100644 --- a/frontend/src/api/system.ts +++ b/frontend/src/api/system.ts @@ -27,4 +27,8 @@ export const modelApi = { query: (id: number) => request.get(`/system/aimodel/${id}`), setDefault: (id: number) => request.put(`/system/aimodel/default/${id}`), check: (data: any) => request.fetchStream('/system/aimodel/status', data), + platform: (id: number, lazy?: number, pid?: string) => + request.post(`/system/platform/org/${id}`, { lazy, pid }), + userSync: (data: any) => request.post(`/system/platform/user/sync`, data), + list_by_ws: () => request.get(`/system/aimodel/list/by_ws`), } diff --git a/frontend/src/api/user.ts b/frontend/src/api/user.ts index 3a16e25c7..013bae32d 100644 --- a/frontend/src/api/user.ts +++ b/frontend/src/api/user.ts @@ -21,6 +21,7 @@ export const userApi = { add: (data: any) => request.post('/user', data), edit: (data: any) => request.put('/user', data), clearErrorApi: (key: string) => request.get(`/user/clearErrorRecord/${key}`), + errorRecord: (key: string) => request.get(`/user/errorRecord/${key}`, { responseType: 'blob' }), delete: (key: string) => request.delete(`/user/${key}`), deleteBatch: (data: any) => request.delete(`/user`, { data }), get: (key: string) => request.get(`/user/${key}`), diff --git a/frontend/src/api/variables.ts b/frontend/src/api/variables.ts new file mode 100644 index 000000000..61ac0df1e --- /dev/null +++ b/frontend/src/api/variables.ts @@ -0,0 +1,9 @@ +import { request } from '@/utils/request' + +export const variablesApi = { + save: (data: any) => request.post('/sys_variable/save', data), + listAll: () => request.post('/sys_variable/listAll', {}), + listPage: (pageNum: any, pageSize: any, data: any) => + request.post(`/sys_variable/listPage/${pageNum}/${pageSize}`, data), + delete: (data: any) => request.post(`/sys_variable/delete`, data), +} diff --git a/frontend/src/api/workspace.ts b/frontend/src/api/workspace.ts index 5298045b5..46637678c 100644 --- a/frontend/src/api/workspace.ts +++ b/frontend/src/api/workspace.ts @@ -15,3 +15,12 @@ export const workspaceDelete = (id: any) => request.delete(`/system/workspace/${ export const workspaceList = () => request.get('/system/workspace') export const workspaceDetail = (id: any) => request.get(`/system/workspace/${id}`) export const uwsOption = (params: any) => request.get('system/workspace/uws/option', { params }) + +export const workspaceModelMapping = (aiModelId: any) => + request.get(`/system/aimodel/${aiModelId}/ws_mapping`) +export const workspaceModelMappingUpdate = (aiModelId: any, data: any) => + request.put(`/system/aimodel/${aiModelId}/ws_mapping`, data) +export const workspaceModelMappingAdd = (aiModelId: any, data: any) => + request.post(`/system/aimodel/${aiModelId}/ws_mapping`, data) +export const workspaceModelMappingDelete = (aiModelId: any, data: any) => + request.delete(`/system/aimodel/${aiModelId}/ws_mapping`, { data }) diff --git a/frontend/src/assets/datasource/icon_hive.png b/frontend/src/assets/datasource/icon_hive.png new file mode 100644 index 000000000..51b996f5e Binary files /dev/null and b/frontend/src/assets/datasource/icon_hive.png differ diff --git a/frontend/src/assets/datasource/icon_sqlite.png b/frontend/src/assets/datasource/icon_sqlite.png new file mode 100644 index 000000000..1a198d0b4 Binary files /dev/null and b/frontend/src/assets/datasource/icon_sqlite.png differ diff --git a/frontend/src/assets/img/dingtalk.png b/frontend/src/assets/img/dingtalk.png new file mode 100644 index 000000000..44b6cf077 Binary files /dev/null and b/frontend/src/assets/img/dingtalk.png differ diff --git a/frontend/src/assets/img/lark.png b/frontend/src/assets/img/lark.png new file mode 100644 index 000000000..82edd33c1 Binary files /dev/null and b/frontend/src/assets/img/lark.png differ diff --git a/frontend/src/assets/img/wechat.png b/frontend/src/assets/img/wechat.png new file mode 100644 index 000000000..f41ca1c96 Binary files /dev/null and b/frontend/src/assets/img/wechat.png differ diff --git a/frontend/src/assets/model/icon_minimax_colorful.png b/frontend/src/assets/model/icon_minimax_colorful.png new file mode 100644 index 000000000..f9dd9aaeb Binary files /dev/null and b/frontend/src/assets/model/icon_minimax_colorful.png differ diff --git a/frontend/src/assets/svg/avatar_organize.svg b/frontend/src/assets/svg/avatar_organize.svg new file mode 100644 index 000000000..2fe6321ff --- /dev/null +++ b/frontend/src/assets/svg/avatar_organize.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/frontend/src/assets/svg/chart/icon-thousand-separator.svg b/frontend/src/assets/svg/chart/icon-thousand-separator.svg new file mode 100644 index 000000000..670e86901 --- /dev/null +++ b/frontend/src/assets/svg/chart/icon-thousand-separator.svg @@ -0,0 +1,6 @@ + + + diff --git a/frontend/src/assets/svg/field_text.svg b/frontend/src/assets/svg/field_text.svg new file mode 100644 index 000000000..16fa77815 --- /dev/null +++ b/frontend/src/assets/svg/field_text.svg @@ -0,0 +1 @@ + diff --git a/frontend/src/assets/svg/field_time.svg b/frontend/src/assets/svg/field_time.svg new file mode 100644 index 000000000..b5c0c4e47 --- /dev/null +++ b/frontend/src/assets/svg/field_time.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/svg/field_value.svg b/frontend/src/assets/svg/field_value.svg new file mode 100644 index 000000000..b907e4f6d --- /dev/null +++ b/frontend/src/assets/svg/field_value.svg @@ -0,0 +1 @@ + diff --git a/frontend/src/assets/svg/icon_alarm-clock_colorful.svg b/frontend/src/assets/svg/icon_alarm-clock_colorful.svg new file mode 100644 index 000000000..5eb6f52e4 --- /dev/null +++ b/frontend/src/assets/svg/icon_alarm-clock_colorful.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/frontend/src/assets/svg/icon_block_outlined.svg b/frontend/src/assets/svg/icon_block_outlined.svg new file mode 100644 index 000000000..ffefda2c0 --- /dev/null +++ b/frontend/src/assets/svg/icon_block_outlined.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/frontend/src/assets/svg/icon_database_colorful.svg b/frontend/src/assets/svg/icon_database_colorful.svg new file mode 100644 index 000000000..66a4a0d66 --- /dev/null +++ b/frontend/src/assets/svg/icon_database_colorful.svg @@ -0,0 +1,4 @@ + + + + diff --git a/frontend/src/assets/svg/icon_describe_outlined.svg b/frontend/src/assets/svg/icon_describe_outlined.svg new file mode 100644 index 000000000..7dc0951b4 --- /dev/null +++ b/frontend/src/assets/svg/icon_describe_outlined.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/assets/svg/icon_expand-left_filled.svg b/frontend/src/assets/svg/icon_expand-left_filled.svg new file mode 100644 index 000000000..63b0ea82d --- /dev/null +++ b/frontend/src/assets/svg/icon_expand-left_filled.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/assets/svg/icon_expand-right_filled.svg b/frontend/src/assets/svg/icon_expand-right_filled.svg new file mode 100644 index 000000000..58b34d86a --- /dev/null +++ b/frontend/src/assets/svg/icon_expand-right_filled.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/assets/svg/icon_logs_outlined.svg b/frontend/src/assets/svg/icon_logs_outlined.svg new file mode 100644 index 000000000..0857b0a08 --- /dev/null +++ b/frontend/src/assets/svg/icon_logs_outlined.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/assets/svg/logo_lark.svg b/frontend/src/assets/svg/logo_lark.svg index 0eaf8df87..fc82390a3 100644 --- a/frontend/src/assets/svg/logo_lark.svg +++ b/frontend/src/assets/svg/logo_lark.svg @@ -1,20 +1,12 @@ - - - - - - - + + + - - - - - - - - - - + + + + + + diff --git a/frontend/src/assets/svg/workspace-white.svg b/frontend/src/assets/svg/workspace-white.svg new file mode 100644 index 000000000..7e9cac0a5 --- /dev/null +++ b/frontend/src/assets/svg/workspace-white.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/src/components/Language-selector/index.vue b/frontend/src/components/Language-selector/index.vue index 7d9ee8d16..7ba9b37cf 100644 --- a/frontend/src/components/Language-selector/index.vue +++ b/frontend/src/components/Language-selector/index.vue @@ -34,6 +34,7 @@ const userStore = useUserStore() const languageOptions = computed(() => [ { value: 'en', label: t('common.english') }, { value: 'zh-CN', label: t('common.simplified_chinese') }, + { value: 'zh-TW', label: t('common.traditional_chinese') }, { value: 'ko-KR', label: t('common.korean') }, ]) @@ -73,4 +74,4 @@ const changeLanguage = (lang: string) => { .selected-lang { color: var(--el-color-primary); } - \ No newline at end of file + diff --git a/frontend/src/components/drawer-filter/src/DrawerEnumFilter.vue b/frontend/src/components/drawer-filter/src/DrawerEnumFilter.vue index a7cae5c5d..262b5c710 100644 --- a/frontend/src/components/drawer-filter/src/DrawerEnumFilter.vue +++ b/frontend/src/components/drawer-filter/src/DrawerEnumFilter.vue @@ -84,7 +84,7 @@ useEmitt({ padding: 1px 6px; background: var(--deTextPrimary5, #f5f6f7); color: var(--deTextPrimary, #1f2329); - border-radius: 4px; + border-radius: 6px; cursor: pointer; display: inline-block; margin-bottom: 12px; diff --git a/frontend/src/components/filter-text/src/FilterText.vue b/frontend/src/components/filter-text/src/FilterText.vue index 4eedaa269..d423543d4 100644 --- a/frontend/src/components/filter-text/src/FilterText.vue +++ b/frontend/src/components/filter-text/src/FilterText.vue @@ -181,7 +181,7 @@ watch( .arrow-filter:hover { background: rgba(31, 35, 41, 0.1); - border-radius: 4px; + border-radius: 6px; } .ed-icon-arrow-right.arrow-filter { diff --git a/frontend/src/components/layout/Apikey.vue b/frontend/src/components/layout/Apikey.vue index d55e37a16..ee17bd56c 100644 --- a/frontend/src/components/layout/Apikey.vue +++ b/frontend/src/components/layout/Apikey.vue @@ -38,7 +38,7 @@ const handleAdd = () => { const pwd = ref('**********') const toApiDoc = () => { console.log('Add API Key') - const url = '/docs' + const url = './docs' window.open(url, '_blank') } diff --git a/frontend/src/components/layout/Menu.vue b/frontend/src/components/layout/Menu.vue index f8b22432e..731d1027a 100644 --- a/frontend/src/components/layout/Menu.vue +++ b/frontend/src/components/layout/Menu.vue @@ -56,6 +56,7 @@ const routerList = computed(() => { !route.path.includes('training') && !route.path.includes('prompt') && !route.path.includes('permission') && + !route.path.includes('embeddedCommon') && !route.path.includes('preview') && !route.path.includes('audit') && route.path !== '/login' && diff --git a/frontend/src/components/layout/Person.vue b/frontend/src/components/layout/Person.vue index a0ada36c4..a58a02afb 100644 --- a/frontend/src/components/layout/Person.vue +++ b/frontend/src/components/layout/Person.vue @@ -19,7 +19,9 @@ import { useRouter } from 'vue-router' import { useUserStore } from '@/stores/user' import { userApi } from '@/api/auth' import { toLoginPage } from '@/utils/utils' +import { useCache } from '@/utils/useCache' +const { wsCache } = useCache() const router = useRouter() const appearanceStore = useAppearanceStoreWithOut() const userStore = useUserStore() @@ -36,6 +38,10 @@ const currentLanguage = computed(() => userStore.getLanguage) const isAdmin = computed(() => userStore.isAdmin) const isLocalUser = computed(() => !userStore.getOrigin) +const isClient = computed(() => { + return !!wsCache.get('sqlbot-platform-client') +}) + const platFlag = computed(() => { const platformInfo = userStore.getPlatformInfo return platformInfo?.origin || 0 @@ -52,6 +58,10 @@ const languageList = computed(() => [ name: '简体中文', value: 'zh-CN', }, + { + name: '繁體中文', + value: 'zh-TW', + }, { name: '한국인', value: 'ko-KR', @@ -184,7 +194,7 @@ const logout = async () => {
{{ $t('common.help') }}
-
+
@@ -335,7 +345,7 @@ const logout = async () => { position: relative; cursor: pointer; margin: 0 4px; - border-radius: 4px; + border-radius: 6px; &:hover { background-color: #1f23291a; } @@ -372,7 +382,7 @@ const logout = async () => { padding-right: 8px; margin-bottom: 2px; position: relative; - border-radius: 4px; + border-radius: 6px; cursor: pointer; &:not(.empty):hover { background: #1f23291a; diff --git a/frontend/src/components/layout/Workspace.vue b/frontend/src/components/layout/Workspace.vue index 1f76e92ad..456c083cd 100644 --- a/frontend/src/components/layout/Workspace.vue +++ b/frontend/src/components/layout/Workspace.vue @@ -198,7 +198,7 @@ onMounted(async () => { padding-right: 8px; margin-bottom: 2px; position: relative; - border-radius: 4px; + border-radius: 6px; cursor: pointer; &:not(.empty):hover { background: #1f23291a; diff --git a/frontend/src/components/layout/index.vue b/frontend/src/components/layout/index.vue index f83ef983a..4a0097e41 100644 --- a/frontend/src/components/layout/index.vue +++ b/frontend/src/components/layout/index.vue @@ -362,7 +362,7 @@ onMounted(() => { column-gap: 12px; align-items: center; padding: 8px 16px; - border-radius: 4px; + border-radius: 6px; cursor: pointer; border: none; font-weight: 500; @@ -493,7 +493,7 @@ onMounted(() => { column-gap: 12px; align-items: center; padding: 8px 16px; - border-radius: 4px; + border-radius: 6px; cursor: pointer; border: none; font-weight: 500; diff --git a/frontend/src/entity/supplier.ts b/frontend/src/entity/supplier.ts index 733cde9f4..bd4ddc971 100644 --- a/frontend/src/entity/supplier.ts +++ b/frontend/src/entity/supplier.ts @@ -10,6 +10,7 @@ import icon_txhy_colorful from '@/assets/model/icon_txhy_colorful.png' import icon_hsyq_colorful from '@/assets/model/icon_hsyq_colorful.png' // import icon_vllm_colorful from '@/assets/model/icon_vllm_colorful.png' import icon_common_openai from '@/assets/model/icon_common_openai.png' +import icon_minimax_colorful from '@/assets/model/icon_minimax_colorful.png' // import icon_azure_openAI_colorful from '@/assets/model/icon_Azure_OpenAI_colorful.png' type ModelArg = { key: string; val?: string | number; type: string; range?: string } @@ -45,6 +46,10 @@ export const supplierList: Array<{ { key: 'extra_body', val: '{"enable_thinking": false}', type: 'json' }, ], model_options: [ + { name: 'qwen3.6-plus' }, + { name: 'qwen3.5-plus' }, + { name: 'qwen3.5-flash' }, + { name: 'qwen3-coder-next' }, { name: 'qwen3-coder-plus' }, { name: 'qwen3-coder-flash' }, { name: 'qwen-plus' }, @@ -271,11 +276,24 @@ export const supplierList: Array<{ { name: 'doubao-1-5-pro-32k-character-250715' }, { name: 'kimi-k2-250711' }, { name: 'deepseek-v3-250324' }, - { name: 'deepseek-r1' }, + { name: 'deepseek-v4-pro-260425' }, ], }, }, }, + { + id: 13, + name: 'MiniMax', + i18nKey: 'supplier.minimax', + icon: icon_minimax_colorful, + model_config: { + 0: { + api_domain: 'https://api.minimax.io/v1', + common_args: [{ key: 'temperature', val: 0.7, type: 'number', range: '[0, 1]' }], + model_options: [{ name: 'MiniMax-M3' }, { name: 'MiniMax-M2.7' }], + }, + }, + }, /* { id: 11, name: 'vLLM', diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index f972a98f9..4cdef7da8 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -7,19 +7,85 @@ "AI Model Configuration": "AI Model Config", "Details": "Details" }, + "variables": { + "please_select_date": "Please select a date", + "number_variable_error": "Please enter the correct numerical range.", + "built_in": "Built-in", + "normal_value": "Normal value", + "​​cannot_be_empty": "Variable values ​​cannot be empty.", + "1_to_100": "{name}, the numerical range is {min} to {max}.", + "1_to_100_de": "{name}, the date range is {min} to {max}.", + "system_variables": "System Variables", + "variables": "Variables", + "system": "System", + "search_variables": "Search Variables", + "add_variable": "Add Variable", + "variable_name": "Variable Name", + "variable_type": "Variable Type", + "variable_value": "Variable Value", + "edit_variable": "Edit Variable", + "no_variables_yet": "No Variables Yet", + "please_enter_value": "Please Enter Value", + "date": "Date", + "start_date": "Start Date", + "end_date": "End Date", + "enter_variable_name": "Please Enter Variable Name", + "enter_variable_value": "Please Enter Variable Value" + }, + "authorized_space": { + "authorized_space": "Authorized Space", + "authorized_space_list": "Authorized Space List", + "select_space": "Select Space", + "modify_authorized_space": "Modify Authorized Space", + "workspaces_authorized": "Authorized {num} Workspaces", + "number_of_members": "Number of Members", + "delete_selected_workspaces": "Are you sure you want to delete the selected {msg} workspaces?", + "delete_workspace": "Are you sure you want to delete the workspace: {msg}?", + "no_workspace": "No Workspaces" + }, + "sync": { + "records": "Displaying {num} records out of {total}", + "confirm_upload": "Confirm Upload", + "field_details": "Field Details", + "integration": "Platform integration needs to be enabled.", + "the_existing_user": "If the user already exists, overwrite the existing user.", + "lazy_load": "Lazy Load", + "sync_users": "Sync Users", + "sync_wechat_users": "Sync WeChat Users", + "sync_dingtalk_users": "Sync DingTalk Users", + "sync_lark_users": "Sync Lark Users", + "sync_complete": "Sync Complete", + "synced_10_users": "Successfully synced {num} users", + "failed_3_users": "Successfully synced {success} users, sync failed {failed} users", + "download_failure_list": "Download Failure List", + "sync_failed": "Sync Failed", + "failed_10_users": "Sync failed {num} users", + "continue_syncing": "Continue Syncing", + "return_to_view": "Return to View" + }, "parameter": { + "execution_details": "Execution Details", + "overview": "Overview", + "tokens_required": "Tokens Required", + "time_execution": "Time Execution", "export_notes": "Export notes", "import_notes": "Import notes", "memo": "Memo update rules: Match table name and field name. If a match is found, update the table memo and field memo; otherwise, leave the memo unchanged.", "parameter_configuration": "Parameter Config", "question_count_settings": "Question Count Settings", + "context_record_count": "Context Record Count", + "context_record_count_hint": "Number of user question rounds", "model_thinking_process": "Expand Model Thinking Process", + "hide_model_thinking_process": "Hide Model Thinking Process", "rows_of_data": "Limit 1000 Rows of Data", - "third_party_platform_settings": "Third-Party Platform Settings", - "by_third_party_platform": "Automatic User Creation by Third-Party Platform", - "platform_user_organization": "Third-Party Platform Workspace", + "third_party_platform_settings": "Authentication Settings", + "by_third_party_platform": "Automatic User Creation", + "platform_user_organization": "Default Workspace", "platform_user_roles": "Third-Party Platform User Roles", "excessive_data_volume": "Disabling the 1000-row data limit may cause system lag due to excessive data volume.", + "sqlbot_name": "Data Query Assistant Name", + "show_sql": "Allow Viewing SQL Statements", + "show_log": "Show Execution Log", "prompt": "Prompt", "disabling_successfully": "Disabling Successfully", "closed_by_default": "In the Question Count window, control whether the model thinking process is expanded or closed by default.", @@ -125,6 +191,7 @@ "system_manage": "System Management", "update_success": "Update", "save_success": "Save Successful", + "operation_success": "Operation successful", "next": "Next", "save": "Save", "logout": "Logout", @@ -151,7 +218,8 @@ "password_reset_successful": "Password reset successful", "or": "Or", "refresh": "Refresh", - "input_limit": "Length cannot exceed {0} characters" + "input_limit": "Length cannot exceed {0} characters", + "file_size_limit_error": "File size exceeds the limit (maximum {limit})" }, "dashboard": { "open_dashboard": "Open Dashboard", @@ -341,12 +409,19 @@ "success": "Connect success", "failed": "Connect failed" }, - "timeout": "Timeout(second)", - "address": "Address" + "timeout": "Connection Timeout(second)", + "address": "Address", + "low_version": "Compatible with lower versions", + "ssl": "Enable SSL", + "file_path": "File Path", + "pool_size": "Connection Pool Size" }, - "sync_fields": "Sync Fields" + "sync_fields": "Sync Fields", + "sync_fields_success": "Sync fields successfully", + "sync_fields_failed": "Sync fields failed" }, "datasource": { + "recommended_question": "Recommended Question", "recommended_repetitive_tips": "Duplicate questions exist", "recommended_problem_tips": "Custom configuration requires at least one problem, each problem should be 2-200 characters", "recommended_problem_configuration": "Recommended Problem Configuration", @@ -391,6 +466,9 @@ "get_schema": "Get Schema" }, "model": { + "int": "Integer", + "float": "Float", + "string": "String", "default_model": "Default model", "model_type": "Model type", "basic_model": "Basic model", @@ -450,7 +528,7 @@ "lark": "Lark", "larksuite": "Larksuite", "dingtalk": "DingTalk", - "wechat_for_business": "WeChat for business", + "wecom": "WeCom", "1240_results": "{msg} results", "clear_conditions": "Clear conditions", "disabled": "Disabled", @@ -508,6 +586,7 @@ "member_feng_yibudao": "Do you want to remove the member: {msg}?", "select_member": "Select member", "selected_2_people": "Selected: {msg} people", + "selected_number": "Selected: {msg} items", "clear": "Clear", "historical_dialogue": "No historical dialogue", "rename_a_workspace": "Rename a workspace", @@ -525,6 +604,7 @@ "operate_with_caution": "After deletion, the users under the workspace will be removed and all resources will be deleted. Please operate with caution." }, "permission": { + "search_field": "Search field", "search_rule_group": "Search rule group", "add_rule_group": "Add rule group", "permission_rule": "Permission rules", @@ -607,6 +687,10 @@ "application_name": "Application name", "application_description": "Application description", "cross_domain_settings": "Cross-domain settings", + "enableCustomModel": "Use specified model", + "useModel": "Use model", + "defaultModel": "Default model", + "customModel": "Specified model", "third_party_address": "Please enter the embedded third party address,multiple items separated by semicolons", "set_to_private": "Set as private", "set_to_public": "Set as public", @@ -617,7 +701,7 @@ "interface_url": "Interface URL", "format_is_incorrect": "format is incorrect{msg}", "domain_format_incorrect": ", start with http:// or https://, no trailing slash (/), multiple domains separated by semicolons", - "interface_url_incorrect": ",enter a relative path starting with /", + "interface_url_incorrect": ", enter a relative path starting with /, or an absolute path starting with http:// or https://", "aes_enable": "Enable AES encryption", "aes_enable_tips": "The fields (host, user, password, dataBase, schema) are all encrypted using the AES-CBC-PKCS5Padding encryption method", "bit": "bit", @@ -657,7 +741,7 @@ "display_settings": "Display Settings", "header_text_color": "Header Text Color", "app_logo": "App Logo", - "maximum_size_10mb": "Recommended size: 32 x 32, supports JPG, PNG, and SVG, maximum size: 10MB", + "maximum_size_10mb": "Recommended size: 32 x 32, supports JPG, PNG, maximum size: 10MB", "replace": "Replace", "default_icon_position": "Default Icon Position", "draggable_position": "Draggable Position", @@ -669,7 +753,8 @@ "data_analysis_now": "I can query data, generate charts, detect data anomalies, predict data, and more! Enable Smart Data Analysis now!", "window_entrance_icon": "Floating window entrance icon", "preview_error": "The current page prohibits embedding using Iframe!", - "assistant_app": "Assistant App" + "assistant_app": "Assistant App", + "auto_select_ds": "Automatically select data source" }, "chat": { "type": "Chart Type", @@ -680,6 +765,11 @@ "line": "Line", "pie": "Pie" }, + "hide_label": "Hide Label", + "show_label": "Show Label", + "sort_asc": "Ascending", + "sort_desc": "Descending", + "sort_none": "No Sort", "show_sql": "View SQL", "export_to": "Export As", "excel": "Excel", @@ -699,7 +789,33 @@ "exec-sql-err": "Execute SQL failed", "no_data": "No Data", "loading_data": "Loading ...", - "show_error_detail": "Show error info" + "show_error_detail": "Show error info", + "thousands_separator_setting": "Thousands Separator Setting", + "thousands_separator_display": "Apply Thousands Separator Display", + "log": { + "GENERATE_SQL": "Generate SQL", + "GENERATE_CHART": "Generate Chart Structure", + "ANALYSIS": "Analyze", + "PREDICT_DATA": "Predict", + "GENERATE_SQL_WITH_PERMISSIONS": "Apply Row Permissions to SQL", + "CHOOSE_DATASOURCE": "Match Datasource", + "GENERATE_DYNAMIC_SQL": "Generate Dynamic SQL", + "CHOOSE_TABLE": "Match Data Table (Schema)", + "FILTER_TERMS": "Match Terms", + "FILTER_SQL_EXAMPLE": "Match SQL Examples", + "FILTER_CUSTOM_PROMPT": "Match Custom Prompts", + "EXECUTE_SQL": "Execute SQL", + "GENERATE_PICTURE": "Generate Picture" + }, + "log_system": "Conversation Template", + "log_question": "Current Question", + "log_answer": "AI Response", + "log_history": "History", + "find_term_title": "Matched {0} terms", + "find_sql_sample_title": "Matched {0} SQL examples", + "find_custom_prompt_title": "Matched {0} custom prompts", + "query_count_title": "Found {0} data entries", + "generate_picture_success": "Image generated" }, "about": { "title": "About", @@ -740,11 +856,11 @@ "website_logo": "Website Logo", "tab": "Tab", "replace_image": "Replace Image", - "larger_than_200kb": "Logo displayed at the top of the website: Recommended size: 48 x 48 pixels, supports JPG, PNG, and SVG, and no larger than 200KB", + "larger_than_200kb": "Logo displayed at the top of the website: Recommended size: 48 x 48 pixels, supports JPG, PNG, and no larger than 200KB", "login_logo": "System Logo", - "larger_than_200kb_de": "Logo on the right side of the login page: Recommended size: 204 x 52 pixels, supports JPG, PNG, and SVG, and no larger than 200KB", + "larger_than_200kb_de": "Logo on the right side of the login page: Recommended size: 204 x 52 pixels, supports JPG, PNG, and no larger than 200KB", "login_background_image": "Login Background Image", - "larger_than_5mb": "Background image on the left: Recommended size: 576 x 900 for vector images, 1152 x 1800 for bitmap images, supports JPG, PNG, and SVG, and no larger than 5MB", + "larger_than_5mb": "Background image on the left: Recommended size: 576 x 900 for vector images, 1152 x 1800 for bitmap images, supports JPG, PNG, and no larger than 5MB", "website_name": "Website Name", "on_webpage_tabs": "Platform name displayed on webpage tabs", "welcome_message": "Display a welcome message", @@ -818,7 +934,10 @@ "platform_disable": "{0} settings are not enabled!", "input_account": "Please enter account", "redirect_2_auth": "Redirecting to {0} authentication, {1} seconds...", - "redirect_immediately": "Redirecting immediately" + "redirect_immediately": "Redirecting immediately", + "permission_invalid": "Authentication invalid [Current account has insufficient permissions]", + "scan_qr_login": " Scan QR Code", + "no_auth_error": "Not authenticated. Redirecting to login page in {0} seconds..." }, "supplier": { "alibaba_cloud_bailian": "Alibaba Cloud Bailian", @@ -831,6 +950,7 @@ "kimi": "Kimi", "tencent_cloud": "Tencent Cloud", "volcano_engine": "Volcano Engine", + "minimax": "MiniMax", "generic_openai": "Generic OpenAI" }, "modelType": { diff --git a/frontend/src/i18n/index.ts b/frontend/src/i18n/index.ts index df718e652..c06dfcd98 100644 --- a/frontend/src/i18n/index.ts +++ b/frontend/src/i18n/index.ts @@ -1,16 +1,42 @@ import { createI18n } from 'vue-i18n' import en from './en.json' import zhCN from './zh-CN.json' +import zhTw from './zh-TW.json' import koKR from './ko-KR.json' import elementEnLocale from 'element-plus-secondary/es/locale/lang/en' import elementZhLocale from 'element-plus-secondary/es/locale/lang/zh-cn' +import elementTwLocale from 'element-plus-secondary/es/locale/lang/zh-tw' import { useCache } from '@/utils/useCache' import { getBrowserLocale } from '@/utils/utils' const elementKoLocale = elementEnLocale const { wsCache } = useCache() +const isEmbeddedRoute = () => { + const hash = window.location.hash + if (!hash) return false + const hashPath = hash.substring(1).split('?')[0] + return ['/assistant', '/embeddedPage', '/embeddedCommon'].includes(hashPath) +} + +const getUrlLang = () => { + try { + const hash = window.location.hash + if (!hash) return null + const hashQuery = hash.substring(1).split('?')[1] + if (!hashQuery) return null + return new URLSearchParams(hashQuery).get('lang') + } catch { + return null + } +} + const getDefaultLocale = () => { + // 嵌入式页面的 URL lang 参数(第三种国际化渠道),优先级最高 + const urlLang = getUrlLang() + if (urlLang && isEmbeddedRoute()) { + return urlLang + } return wsCache.get('user.language') || getBrowserLocale() || 'zh-CN' } @@ -23,6 +49,10 @@ const messages = { ...zhCN, el: elementZhLocale, }, + 'zh-TW': { + ...zhTw, + el: elementTwLocale, + }, 'ko-KR': { ...koKR, el: elementKoLocale, @@ -40,6 +70,7 @@ export const i18n = createI18n({ const elementLocales = { en: elementEnLocale, 'zh-CN': elementZhLocale, + 'zh-TW': elementTwLocale, 'ko-KR': elementKoLocale, } as const diff --git a/frontend/src/i18n/ko-KR.json b/frontend/src/i18n/ko-KR.json index 709ca9b9c..100efe262 100644 --- a/frontend/src/i18n/ko-KR.json +++ b/frontend/src/i18n/ko-KR.json @@ -7,19 +7,85 @@ "AI Model Configuration": "모델 구성", "Details": "세부" }, + "variables": { + "please_select_date": "날짜를 선택하십시오", + "number_variable_error": "올바른 숫자 범위를 입력하십시오.", + "built_in": "내장형", + "normal_value": "정상값", + "​​cannot_be_empty": "변수 값은 비어 있을 수 없습니다.", + "1_to_100": "{name}, 숫자 범위는 {min}부터 {max}까지입니다.", + "1_to_100_de": "{name}, 날짜 범위는 {min}부터 {max}까지입니다.", + "system_variables": "시스템 변수", + "variables": "변수", + "system": "체계", + "search_variables": "변수 검색", + "add_variable": "변수 추가", + "variable_name": "변수 이름", + "variable_type": "변수 유형", + "variable_value": "변수 값", + "edit_variable": "변수 편집", + "no_variables_yet": "아직 변수가 없습니다", + "please_enter_value": "값을 입력하세요", + "date": "날짜", + "start_date": "시작일", + "end_date": "종료일", + "enter_variable_name": "변수 이름을 입력하세요", + "enter_variable_value": "변수 값을 입력하세요" + }, + "authorized_space": { + "authorized_space": "권한 있는 공간", + "authorized_space_list": "권한 있는 공간 목록", + "select_space": "공간 선택", + "modify_authorized_space": "권한 있는 공간 수정", + "workspaces_authorized": "{num}개의 권한 있는 작업 공간", + "number_of_members": "회원 수", + "delete_selected_workspaces": "선택한 {msg}개의 작업 공간을 삭제하시겠습니까?", + "delete_workspace": "작업 공간을 삭제하시겠습니까: {msg}?", + "no_workspace": "작업 공간 없음" + }, + "sync": { + "records": "{total}개 중 {num}개의 레코드 표시", + "confirm_upload": "업로드 확인", + "field_details": "필드 세부 정보", + "integration": "플랫폼 통합을 활성화해야 합니다.", + "the_existing_user": "해당 사용자가 이미 존재하는 경우 기존 사용자를 덮어씁니다.", + "lazy_load": "지연 로딩", + "sync_users": "사용자 동기화", + "sync_wechat_users": "위챗 사용자 동기화", + "sync_dingtalk_users": "딩톡 사용자 동기화", + "sync_lark_users": "라크 사용자 동기화", + "sync_complete": "동기화 완료", + "synced_10_users": "{num}명 동기화 성공", + "failed_3_users": "{failed}명 동기화 성공, {success}명 동기화 실패", + "download_failure_list": "실패 목록 다운로드", + "sync_failed": "동기화 실패", + "failed_10_users": "{failed}명 동기화 실패", + "continue_syncing": "동기화 계속", + "return_to_view": "화면으로 돌아가기" + }, "parameter": { + "execution_details": "실행 세부 정보", + "overview": "개요", + "tokens_required": "필요한 토큰 수", + "time_execution": "실행 시간", "export_notes": "수출 참고사항", "import_notes": "수입 참고사항", "memo": "메모 업데이트 규칙: 테이블 이름과 필드 이름이 일치하는지 확인합니다. 일치하는 항목이 있으면 테이블 메모와 필드 메모를 업데이트하고, 그렇지 않으면 메모를 변경하지 않고 그대로 둡니다.", "parameter_configuration": "매개변수 구성", "question_count_settings": "질문 수 설정", + "context_record_count": "컨텍스트 기록 수", + "context_record_count_hint": "사용자 질문 라운드 수", "model_thinking_process": "모델 사고 프로세스 확장", + "hide_model_thinking_process": "모델 사고 과정 숨기기", "rows_of_data": "데이터 1,000행 제한", - "third_party_platform_settings": "타사 플랫폼 설정", - "by_third_party_platform": "타사 플랫폼에 의한 자동 사용자 생성", - "platform_user_organization": "제3자 플랫폼 작업 공간", + "third_party_platform_settings": "로그인 인증 설정", + "by_third_party_platform": "자동 사용자 생성", + "platform_user_organization": "기본 작업 공간", "platform_user_roles": "타사 플랫폼 사용자 역할", "excessive_data_volume": "1,000행 데이터 제한을 비활성화하면 과도한 데이터 양으로 인해 시스템 지연이 발생할 수 있습니다.", + "sqlbot_name": "데이터 질의 도우미 이름", + "show_sql": "SQL 문 보기 허용", + "show_log": "실행 로그 표시", "prompt": "프롬프트", "disabling_successfully": "비활성화 완료", "closed_by_default": "질문 수 창에서 모델 사고 프로세스를 기본적으로 확장할지 또는 닫을지 여부를 제어합니다.", @@ -125,6 +191,7 @@ "system_manage": "시스템 관리", "update_success": "업데이트 성공", "save_success": "저장 성공", + "operation_success": "작업 성공", "next": "다음 단계", "save": "저장", "logout": "로그아웃", @@ -151,7 +218,8 @@ "password_reset_successful": "비밀번호 재설정 성공", "or": "또는", "refresh": "새로고침", - "input_limit": "길이는 {0}자에서 {1}자 사이여야 합니다" + "input_limit": "길이는 {0}자에서 {1}자 사이여야 합니다", + "file_size_limit_error": "파일 크기가 제한을 초과했습니다 (최대 {limit})" }, "dashboard": { "open_dashboard": "대시보드 열기", @@ -341,12 +409,19 @@ "success": "연결 성공", "failed": "연결 실패" }, - "timeout": "쿼리 시간 초과(초)", - "address": "주소" + "timeout": "연결 시간 초과(초)", + "address": "주소", + "low_version": "낮은 버전 호환", + "ssl": "SSL 활성화", + "file_path": "파일 경로", + "pool_size": "연결 풀 크기" }, - "sync_fields": "동기화된 테이블 구조" + "sync_fields": "동기화된 테이블 구조", + "sync_fields_success": "테이블 구조 동기화 성공", + "sync_fields_failed": "테이블 구조 동기화 실패" }, "datasource": { + "recommended_question": "추천 질문", "recommended_repetitive_tips": "중복된 문제가 존재합니다", "recommended_problem_tips": "사용자 정의 구성으로 최소 한 개의 문제를 생성하세요, 각 문제는 2~200자로 작성", "recommended_problem_configuration": "추천 문제 구성", @@ -391,6 +466,9 @@ "get_schema": "스키마 가져오기" }, "model": { + "int": "정수", + "float": "소수", + "string": "문자열", "default_model": "기본 모델", "model_type": "모델 유형", "basic_model": "기본 모델", @@ -450,7 +528,7 @@ "lark": "페이슈", "larksuite": "페이수 (Pei-su)", "dingtalk": "딩톡", - "wechat_for_business": "기업용 위챗", + "wecom": "기업용 위챗", "1240_results": "{msg}개 결과 ", "clear_conditions": "조건 지우기", "disabled": "비활성화됨", @@ -508,6 +586,7 @@ "member_feng_yibudao": "멤버를 제거하시겠습니까: {msg}?", "select_member": "멤버 선택", "selected_2_people": "선택됨: {msg}명", + "selected_number": "선택됨: {msg}개", "clear": "지우기", "historical_dialogue": "과거 대화가 없습니다", "rename_a_workspace": "작업 공간 이름 바꾸기", @@ -525,6 +604,7 @@ "operate_with_caution": "삭제 후 해당 작업 공간의 사용자가 제거되고 모든 리소스도 삭제됩니다. 신중하게 작업하십시오." }, "permission": { + "search_field": "검색 필드", "search_rule_group": "규칙 그룹 검색", "add_rule_group": "규칙 그룹 추가", "permission_rule": "권한 규칙", @@ -607,6 +687,10 @@ "application_name": "애플리케이션 이름", "application_description": "애플리케이션 설명", "cross_domain_settings": "교차 도메인 설정", + "enableCustomModel": "지정된 모델 사용", + "useModel": "사용 모델", + "defaultModel": "기본 모델", + "customModel": "지정 모델", "third_party_address": "임베디드할 제3자 주소를 입력하십시오, 여러 항목을 세미콜론으로 구분", "set_to_private": "비공개로 설정", "set_to_public": "공개로 설정", @@ -616,7 +700,7 @@ "interface_url": "인터페이스 URL", "format_is_incorrect": "형식이 올바르지 않습니다{msg}", "domain_format_incorrect": ", http:// 또는 https://로 시작해야 하며, 슬래시(/)로 끝날 수 없습니다. 여러 도메인은 세미콜론으로 구분합니다", - "interface_url_incorrect": ", 상대 경로를 입력해주세요. /로 시작합니다", + "interface_url_incorrect": ", 상대 경로는 /로 시작하거나, 절대 경로는 http:// 또는 https://로 시작하는 경로를 입력해 주세요.", "aes_enable": "AES 암호화 활성화", "aes_enable_tips": "암호화 필드 (host, user, password, dataBase, schema)는 모두 AES-CBC-PKCS5Padding 암호화 방식을 사용합니다", "bit": "비트", @@ -657,7 +741,7 @@ "display_settings": "표시 설정", "header_text_color": "헤더 텍스트 색상", "app_logo": "애플리케이션 로고", - "maximum_size_10mb": "권장 크기 32 x 32, JPG, PNG, SVG 지원, 크기 10MB 이하", + "maximum_size_10mb": "권장 크기 32 x 32, JPG, PNG 지원, 크기 10MB 이하", "replace": "교체", "default_icon_position": "아이콘 기본 위치", "draggable_position": "드래그 가능한 위치", @@ -669,7 +753,8 @@ "data_analysis_now": "저는 데이터 조회, 차트 생성, 데이터 이상 감지, 데이터 예측 등을 할 수 있습니다. 빨리 스마트 데이터 조회를 시작하세요~", "window_entrance_icon": "플로팅 윈도우 입구 아이콘", "preview_error": "현재 페이지는 Iframe 임베딩을 허용하지 않습니다!", - "assistant_app": "어시스턴트 앱" + "assistant_app": "어시스턴트 앱", + "auto_select_ds": "자동 데이터 소스 선택" }, "chat": { "type": "차트 유형", @@ -680,6 +765,11 @@ "line": "선 차트", "pie": "원형 차트" }, + "hide_label": "라벨 숨기기", + "show_label": "라벨 표시", + "sort_asc": "오름차순", + "sort_desc": "내림차순", + "sort_none": "정렬 안 함", "show_sql": "SQL 보기", "export_to": "다음으로 내보내기", "excel": "Excel", @@ -699,7 +789,33 @@ "exec-sql-err": "SQL 실행 실패", "no_data": "데이터가 없습니다", "loading_data": "로딩 중 ...", - "show_error_detail": "구체적인 정보 보기" + "show_error_detail": "구체적인 정보 보기", + "thousands_separator_setting": "천 단위 구분 기호 설정", + "thousands_separator_display": "천 단위 구분 기호 표시 적용", + "log": { + "GENERATE_SQL": "SQL 생성", + "GENERATE_CHART": "차트 구조 생성", + "ANALYSIS": "분석", + "PREDICT_DATA": "예측", + "GENERATE_SQL_WITH_PERMISSIONS": "SQL에 행 권한 적용", + "CHOOSE_DATASOURCE": "데이터 소스 매칭", + "GENERATE_DYNAMIC_SQL": "동적 SQL 생성", + "CHOOSE_TABLE": "데이터 테이블 매칭 (스키마)", + "FILTER_TERMS": "용어 매칭", + "FILTER_SQL_EXAMPLE": "SQL 예시 매칭", + "FILTER_CUSTOM_PROMPT": "사용자 정의 프롬프트 매칭", + "EXECUTE_SQL": "SQL 실행", + "GENERATE_PICTURE": "이미지 생성" + }, + "log_system": "대화 템플릿", + "log_question": "현재 질문", + "log_answer": "AI 응답", + "log_history": "기록", + "find_term_title": "{0}개의 용어 매칭됨", + "find_sql_sample_title": "{0}개의 SQL 예시 매칭됨", + "find_custom_prompt_title": "{0}개의 사용자 정의 프롬프트 매칭됨", + "query_count_title": "{0}개의 데이터 항목 발견됨", + "generate_picture_success": "이미지가 생성되었습니다" }, "about": { "title": "정보", @@ -740,11 +856,11 @@ "website_logo": "웹사이트 로고", "tab": "페이지 탭", "replace_image": "이미지 교체", - "larger_than_200kb": "상단 웹사이트에 표시되는 로고, 권장 크기 48 x 48, JPG, PNG, SVG 지원, 크기 200KB 이하", + "larger_than_200kb": "상단 웹사이트에 표시되는 로고, 권장 크기 48 x 48, JPG, PNG 지원, 크기 200KB 이하", "login_logo": "시스템 로고", - "larger_than_200kb_de": "로그인 페이지 오른쪽 로고, 권장 크기 204*52, JPG, PNG, SVG 지원, 크기 200KB 이하", + "larger_than_200kb_de": "로그인 페이지 오른쪽 로고, 권장 크기 204*52, JPG, PNG 지원, 크기 200KB 이하", "login_background_image": "로그인 배경 이미지", - "larger_than_5mb": "왼쪽 배경 이미지, 벡터 이미지 권장 크기 576*900, 비트맵 권장 크기 1152*1800; JPG, PNG, SVG 지원, 크기 5MB 이하", + "larger_than_5mb": "왼쪽 배경 이미지, 벡터 이미지 권장 크기 576*900, 비트맵 권장 크기 1152*1800; JPG, PNG 지원, 크기 5MB 이하", "website_name": "웹사이트 이름", "on_webpage_tabs": "웹페이지 탭에 표시되는 플랫폼 이름", "welcome_message": "환영 메시지 표시", @@ -818,7 +934,10 @@ "platform_disable": "{0} 설정이 활성화되지 않았습니다!", "input_account": "계정을 입력해 주세요", "redirect_2_auth": "{0} 인증으로 리디렉션 중입니다, {1}초...", - "redirect_immediately": "지금 이동" + "redirect_immediately": "지금 이동", + "permission_invalid": "인증 무효 [현재 계정의 권한이 부족합니다]", + "scan_qr_login": " QR 코드 스캔", + "no_auth_error": "인증되지 않았습니다. {0}초 후 로그인 페이지로 이동합니다..." }, "supplier": { "alibaba_cloud_bailian": "알리바바 클라우드 바이리엔", @@ -831,6 +950,7 @@ "kimi": "Kimi", "tencent_cloud": "텐센트 클라우드", "volcano_engine": "볼케이노 엔진", + "minimax": "MiniMax", "generic_openai": "범용 OpenAI" }, "modelType": { diff --git a/frontend/src/i18n/zh-CN.json b/frontend/src/i18n/zh-CN.json index 963481af6..9f5cc9b24 100644 --- a/frontend/src/i18n/zh-CN.json +++ b/frontend/src/i18n/zh-CN.json @@ -7,19 +7,85 @@ "AI Model Configuration": "模型配置", "Details": "详情" }, + "variables": { + "please_select_date": "请选择日期", + "number_variable_error": "请输入正确的数值范围", + "built_in": "已内置", + "normal_value": "常规值", + "​​cannot_be_empty": "变量值不能为空", + "1_to_100": "{name}数值范围 {min}~{max}", + "1_to_100_de": "{name}日期范围 {min}~{max}", + "system_variables": "系统变量", + "variables": "变量", + "system": "系统", + "search_variables": "搜索变量", + "add_variable": "添加变量", + "variable_name": "变量名称", + "variable_type": "变量类型", + "variable_value": "变量值", + "edit_variable": "编辑变量", + "no_variables_yet": "暂无变量", + "please_enter_value": "请输入数值", + "date": "日期", + "start_date": "开始日期", + "end_date": "结束日期", + "enter_variable_name": "请输入变量名称", + "enter_variable_value": "请输入变量值" + }, + "authorized_space": { + "authorized_space": "授权空间", + "authorized_space_list": "授权空间列表", + "select_space": "选择空间", + "modify_authorized_space": "修改授权空间", + "workspaces_authorized": "已授权 {num} 个工作空间", + "number_of_members": "成员数量", + "delete_selected_workspaces": "是否移除选中的 {msg} 个工作空间?", + "delete_workspace": "是否移除工作空间:{msg}?", + "no_workspace": "暂无工作空间" + }, + "sync": { + "records": "显示 {num} 条数据,共 {total} 条", + "confirm_upload": "确定上传", + "field_details": "字段详情", + "integration": "需开启平台对接", + "the_existing_user": "若用户已存在,覆盖旧用户", + "lazy_load": "懒加载", + "sync_users": "同步用户", + "sync_wechat_users": "同步企业微信用户", + "sync_dingtalk_users": "同步钉钉用户", + "sync_lark_users": "同步飞书用户", + "sync_complete": "同步完成", + "synced_10_users": "成功同步 {num} 个用户", + "failed_3_users": "成功同步 {success} 个用户,同步失败 {failed} 个用户,", + "download_failure_list": "下载失败列表", + "sync_failed": "同步失败", + "failed_10_users": "同步失败 {num} 个用户,", + "continue_syncing": "继续同步", + "return_to_view": "返回查看" + }, "parameter": { + "execution_details": "执行详情", + "overview": "概览", + "tokens_required": "消耗 Tokens", + "time_execution": "耗时", "export_notes": "导出备注", "import_notes": "导入备注", "memo": "备注更新规则:根据表名和字段名匹配,如果匹配则更新表备注和字段备注;如果匹配不上,备注保持不变。", "parameter_configuration": "参数配置", "question_count_settings": "问数设置", + "context_record_count": "上下文记录数", + "context_record_count_hint": "用户提问轮数", "model_thinking_process": "展开模型思考过程", + "hide_model_thinking_process": "隐藏模型思考过程", "rows_of_data": "限制 1000 行数据", - "third_party_platform_settings": "第三方平台设置", - "by_third_party_platform": "第三方自动创建用户", - "platform_user_organization": "第三方平台工作空间", + "third_party_platform_settings": "登录认证设置", + "by_third_party_platform": "自动创建用户", + "platform_user_organization": "默认工作空间", "platform_user_roles": "第三方平台用户角色", "excessive_data_volume": "关闭1000行的数据限制后,数据量过大,可能会造成系统卡顿", + "sqlbot_name": "问数小助手名称", + "show_sql": "允许查看SQL语句", + "show_log": "显示执行日志", "prompt": "提示", "disabling_successfully": "关闭成功", "closed_by_default": "在问数窗口中,控制模型思考过程默认展开或者关闭", @@ -125,6 +191,7 @@ "system_manage": "系统管理", "update_success": "更新成功", "save_success": "保存成功", + "operation_success": "操作成功", "next": "下一步", "save": "保存", "logout": "退出登录", @@ -151,7 +218,8 @@ "password_reset_successful": "重置密码成功", "or": "或者", "refresh": "刷新", - "input_limit": "长度在 {0} 到 {1} 个字符" + "input_limit": "长度在 {0} 到 {1} 个字符", + "file_size_limit_error": "文件大小超出限制(最大{limit})" }, "dashboard": { "open_dashboard": "打开仪表板", @@ -341,12 +409,19 @@ "success": "连接成功", "failed": "连接失败" }, - "timeout": "查询超时(秒)", - "address": "地址" + "timeout": "连接超时(秒)", + "address": "地址", + "low_version": "兼容低版本", + "ssl": "启用 SSL", + "file_path": "文件路径", + "pool_size": "连接池大小" }, - "sync_fields": "同步表结构" + "sync_fields": "同步表结构", + "sync_fields_success": "同步表结构成功", + "sync_fields_failed": "同步表结构失败" }, "datasource": { + "recommended_question": "推荐问题", "recommended_repetitive_tips": "存在重复问题", "recommended_problem_tips": "自定义配置至少一个问题,每个问题2-200个字符", "recommended_problem_configuration": "推荐问题配置", @@ -391,6 +466,9 @@ "get_schema": "获取Schema" }, "model": { + "int": "整数", + "float": "小数", + "string": "字符串", "default_model": "默认模型", "model_type": "模型类型", "basic_model": "基础模型", @@ -450,7 +528,7 @@ "lark": "飞书", "larksuite": "国际飞书", "dingtalk": "钉钉", - "wechat_for_business": "企业微信", + "wecom": "企业微信", "1240_results": "{msg} 个结果 ", "clear_conditions": "清空条件", "disabled": "已禁用", @@ -508,6 +586,7 @@ "member_feng_yibudao": "是否移除成员:{msg}?", "select_member": "选择成员", "selected_2_people": "已选:{msg} 人", + "selected_number": "已选:{msg} 个", "clear": "清空", "historical_dialogue": "暂无历史对话", "rename_a_workspace": "重命名工作空间", @@ -525,6 +604,7 @@ "operate_with_caution": "删除后,该工作空间下的用户将被移除,所有资源也将被删除,请谨慎操作。" }, "permission": { + "search_field": "搜索字段", "search_rule_group": "搜索规则组", "add_rule_group": "添加规则组", "permission_rule": "权限规则", @@ -607,6 +687,10 @@ "application_name": "应用名称", "application_description": "应用描述", "cross_domain_settings": "跨域设置", + "enableCustomModel": "使用指定大模型", + "useModel": "使用模型", + "defaultModel": "默认模型", + "customModel": "指定模型", "third_party_address": "请输入嵌入的第三方地址,多个以分号分割", "set_to_private": "设为私有", "set_to_public": "设为公共", @@ -616,7 +700,7 @@ "interface_url": "接口 URL", "format_is_incorrect": "格式不对{msg}", "domain_format_incorrect": ",http或https开头,不能以 / 结尾,多个域名以分号(半角)分隔", - "interface_url_incorrect": ",请填写相对路径,以/开头", + "interface_url_incorrect": ",请填写相对路径,以/开头,或者绝对路径以http或https开头", "aes_enable": "开启 AES 加密", "aes_enable_tips": "加密字段 (host, user, password, dataBase, schema) 均采用 AES-CBC-PKCS5Padding 加密方式", "bit": "位", @@ -657,7 +741,7 @@ "display_settings": "显示设置", "header_text_color": "头部文本颜色", "app_logo": "应用 Logo", - "maximum_size_10mb": "建议尺寸 32 x 32,支持 JPG、PNG、SVG,大小不超过 10MB", + "maximum_size_10mb": "建议尺寸 32 x 32,支持 JPG、PNG,大小不超过 10MB", "replace": "替换", "default_icon_position": "图标默认位置", "draggable_position": "可拖拽位置", @@ -669,7 +753,8 @@ "data_analysis_now": "我可以查询数据、生成图表、检测数据异常、预测数据等赶快开启智能问数吧~", "window_entrance_icon": "浮窗入口图标", "preview_error": "当前页面禁止使用 Iframe 嵌入!", - "assistant_app": "小助手应用" + "assistant_app": "小助手应用", + "auto_select_ds": "自动选择数据源" }, "chat": { "type": "图表类型", @@ -680,6 +765,11 @@ "line": "折线图", "pie": "饼图" }, + "hide_label": "隐藏标签", + "show_label": "显示标签", + "sort_asc": "升序", + "sort_desc": "降序", + "sort_none": "不排序", "show_sql": "查看SQL", "export_to": "导出为", "excel": "Excel", @@ -699,7 +789,33 @@ "exec-sql-err": "执行SQL失败", "no_data": "暂无数据", "loading_data": "加载中...", - "show_error_detail": "查看具体信息" + "show_error_detail": "查看具体信息", + "thousands_separator_setting": "千分位符设置", + "thousands_separator_display": "应用千分位符展示", + "log": { + "GENERATE_SQL": "生成 SQL", + "GENERATE_CHART": "生成图表结构", + "ANALYSIS": "分析", + "PREDICT_DATA": "预测", + "GENERATE_SQL_WITH_PERMISSIONS": "拼接 SQL 行权限", + "CHOOSE_DATASOURCE": "匹配数据源", + "GENERATE_DYNAMIC_SQL": "生成动态 SQL", + "CHOOSE_TABLE": "匹配数据表 (Schema)", + "FILTER_TERMS": "匹配术语", + "FILTER_SQL_EXAMPLE": "匹配 SQL 示例", + "FILTER_CUSTOM_PROMPT": "匹配自定义提示词", + "EXECUTE_SQL": "执行 SQL", + "GENERATE_PICTURE": "生成图片" + }, + "log_system": "对话模板", + "log_question": "本次提问", + "log_answer": "AI 回答", + "log_history": "历史记录", + "find_term_title": "匹配到 {0} 个术语", + "find_sql_sample_title": "匹配到 {0} 个SQL示例", + "find_custom_prompt_title": "匹配到 {0} 个自定义提示词", + "query_count_title": "查询到 {0} 条数据", + "generate_picture_success": "已生成图片" }, "about": { "title": "关于", @@ -740,11 +856,11 @@ "website_logo": "网站 Logo", "tab": "页签", "replace_image": "替换图片", - "larger_than_200kb": "顶部网站显示的 Logo,建议尺寸 48 x 48,支持 JPG、PNG、SVG,大小不超过 200KB", + "larger_than_200kb": "顶部网站显示的 Logo,建议尺寸 48 x 48,支持 JPG、PNG,大小不超过 200KB", "login_logo": "系统 Logo", - "larger_than_200kb_de": "登录页面右侧 Logo,建议尺寸 204*52,支持 JPG、PNG、SVG,大小不超过 200KB", + "larger_than_200kb_de": "登录页面右侧 Logo,建议尺寸 204*52,支持 JPG、PNG,大小不超过 200KB", "login_background_image": "登录背景图", - "larger_than_5mb": "左侧背景图,矢量图建议尺寸 576*900,位图建议尺寸 1152*1800;支持 JPG、PNG、SVG,大小不超过 5M", + "larger_than_5mb": "左侧背景图,矢量图建议尺寸 576*900,位图建议尺寸 1152*1800;支持 JPG、PNG,大小不超过 5M", "website_name": "网站名称", "on_webpage_tabs": "显示在网页 Tab 的平台名称", "welcome_message": "显示欢迎语", @@ -818,7 +934,10 @@ "platform_disable": "{0}设置未开启!", "input_account": "请输入账号", "redirect_2_auth": "正在跳转至 {0} 认证,{1} 秒...", - "redirect_immediately": "立即跳转" + "redirect_immediately": "立即跳转", + "permission_invalid": "认证无效【当前账号权限不够】", + "scan_qr_login": "扫码登录", + "no_auth_error": "未认证,即将跳转登录页面,{0} 秒..." }, "supplier": { "alibaba_cloud_bailian": "阿里云百炼", @@ -831,6 +950,7 @@ "kimi": "Kimi", "tencent_cloud": "腾讯云", "volcano_engine": "火山引擎", + "minimax": "MiniMax", "generic_openai": "通用OpenAI" }, "modelType": { diff --git a/frontend/src/i18n/zh-TW.json b/frontend/src/i18n/zh-TW.json new file mode 100644 index 000000000..b64649f9a --- /dev/null +++ b/frontend/src/i18n/zh-TW.json @@ -0,0 +1,985 @@ +{ + "menu": { + "add_interface_credentials": "請新增介面憑證", + "Data Q&A": "智慧問數", + "Data Connections": "資料來源", + "Dashboard": "儀表板", + "AI Model Configuration": "模型配置", + "Details": "詳情" + }, + "variables": { + "please_select_date": "請選擇日期", + "number_variable_error": "請輸入正確的數值範圍", + "built_in": "已內建", + "normal_value": "一般值", + "​​cannot_be_empty": "變數值不能為空", + "1_to_100": "{name}數值範圍 {min}~{max}", + "1_to_100_de": "{name}日期範圍 {min}~{max}", + "system_variables": "系統變數", + "variables": "變數", + "system": "系統", + "search_variables": "搜尋變數", + "add_variable": "新增變數", + "variable_name": "變數名稱", + "variable_type": "變數類型", + "variable_value": "變數值", + "edit_variable": "編輯變數", + "no_variables_yet": "暫無變數", + "please_enter_value": "請輸入數值", + "date": "日期", + "start_date": "開始日期", + "end_date": "結束日期", + "enter_variable_name": "請輸入變數名稱", + "enter_variable_value": "請輸入變數值" + }, + "authorized_space": { + "authorized_space": "授權空間", + "authorized_space_list": "授權空間列表", + "select_space": "選擇空間", + "modify_authorized_space": "修改授權空間", + "workspaces_authorized": "已授權 {num} 個工作空間", + "number_of_members": "成員數量", + "delete_selected_workspaces": "是否移除選中的 {msg} 個工作空間?", + "delete_workspace": "是否移除工作空間:{msg}?", + "no_workspace": "暫無工作空間" + }, + "sync": { + "records": "顯示 {num} 筆資料,共 {total} 筆", + "confirm_upload": "確定上傳", + "field_details": "欄位詳情", + "integration": "需開啟平台對接", + "the_existing_user": "若使用者已存在,覆蓋舊使用者", + "lazy_load": "懶加載", + "sync_users": "同步使用者", + "sync_wechat_users": "同步企業微信使用者", + "sync_dingtalk_users": "同步釘釘使用者", + "sync_lark_users": "同步飛書使用者", + "sync_complete": "同步完成", + "synced_10_users": "成功同步 {num} 個使用者", + "failed_3_users": "成功同步 {success} 個使用者,同步失敗 {failed} 個使用者,", + "download_failure_list": "下載失敗列表", + "sync_failed": "同步失敗", + "failed_10_users": "同步失敗 {num} 個使用者,", + "continue_syncing": "繼續同步", + "return_to_view": "返回查看" + }, + "parameter": { + "execution_details": "執行詳情", + "overview": "概覽", + "tokens_required": "消耗 Tokens", + "time_execution": "耗時", + "export_notes": "匯出備註", + "import_notes": "匯入備註", + "memo": "備註更新規則:根據表名和欄位名稱匹配,如果匹配則更新表備註和欄位備註;如果匹配不上,備註保持不變。", + "parameter_configuration": "參數配置", + "question_count_settings": "問數設定", + "context_record_count": "上下文記錄數", + "context_record_count_hint": "使用者提問輪數", + "model_thinking_process": "展開模型思考過程", + "hide_model_thinking_process": "隱藏模型思考過程", + "rows_of_data": "限制 1000 列資料", + "third_party_platform_settings": "登入認證設定", + "by_third_party_platform": "自動建立使用者", + "platform_user_organization": "預設工作區", + "platform_user_roles": "第三方平台使用者角色", + "excessive_data_volume": "關閉1000列的資料限制後,資料量過大,可能會造成系統卡頓", + "sqlbot_name": "問數小助手名稱", + "show_sql": "允許查看SQL語句", + "show_log": "顯示執行日誌", + "prompt": "提示", + "disabling_successfully": "關閉成功", + "closed_by_default": "在問數視窗中,控制模型思考過程預設展開或者關閉", + "and_platform_integration": "登入認證相關", + "login_settings": "登入設定", + "default_login": "預設登入方式" + }, + "prompt": { + "default_password": "預設密碼:{msg}", + "no_sql_sample": "暫無 SQL 範例", + "add_sql_sample": "新增 SQL 範例", + "no_prompt_words": "暫無提示詞", + "customize_prompt_words": "自訂提示詞", + "ask_sql": "問數 SQL", + "data_analysis": "資料分析", + "data_prediction": "資料預測", + "add_prompt_word": "新增提示詞", + "prompt_word_name": "提示詞名稱", + "prompt_word_content": "提示詞內容", + "training_data_details": "訓練資料詳情", + "selected_prompt_words": "是否刪除選中的 {msg} 筆提示詞?", + "replaced_with": "請輸入提示詞,範例:回傳姓名時,只顯示姓氏,名字用*代替", + "loss_exercise_caution": "若輸入刪除資料庫、資料表或修改表結構等高風險的操作指令,可能導致資料永久遺失,請務必謹慎!", + "edit_prompt_word": "編輯提示詞", + "all_236_terms": "是否匯出全部 {msg} 筆{type}提示詞?", + "export_hint": "是否匯出全部{type}提示詞?", + "prompt_word_name_de": "是否刪除提示詞:{msg}?", + "disable_field": "停用欄位", + "to_disable_it": "該欄位已配置表關聯關係,若停用後,關聯關係將失效,確定停用?" + }, + "training": { + "effective_data_sources": "生效資料來源", + "all_data_sources": "所有資料來源", + "partial_data_sources": "部分資料來源", + "add_it_here": "拖曳左側表名,新增到這裡", + "table_relationship_management": "表關係管理", + "system_management": "系統管理", + "data_training": "SQL 範例庫", + "problem_description": "問題描述", + "sample_sql": "範例 SQL", + "search_problem": "搜尋問題", + "add_training_data": "新增範例 SQL", + "training_data_details": "範例 SQL 詳情", + "training_data_items": "是否刪除選中的 {msg} 筆範例 SQL?", + "sql_statement": "SQL 語句", + "edit_training_data": "編輯範例 SQL", + "all_236_terms": "是否匯出全部 {msg} 筆範例 SQL?", + "export_hint": "是否匯出全部範例 SQL?", + "sales_this_year": "是否刪除範例 SQL:{msg}?", + "upload_success": "匯入成功", + "upload_failed": "匯入成功 {success} 筆,失敗 {fail} 筆,失敗資訊詳見:{fail_info}" + }, + "professional": { + "cannot_be_repeated": "術語名稱,同義詞不能重複", + "code_for_debugging": "複製以下程式碼進行除錯", + "full_screen_mode": "全螢幕模式", + "editing_terminology": "編輯術語", + "professional_terminology": "術語配置", + "term_name": "術語名稱", + "term_description": "術語描述", + "search_term": "搜尋術語", + "no_term": "暫無術語", + "create_new_term": "新建術語", + "export_all": "全部匯出", + "professional_term_details": "專業術語詳情", + "business_term": "業務術語", + "synonyms": "同義詞", + "all_236_terms": "是否匯出全部 {msg} 筆術語?", + "export_hint": "是否匯出全部術語?", + "export": "匯出", + "selected_2_terms": "是否刪除選中的 {msg} 筆術語?", + "selected_2_terms_de": "是否匯出選中的 {msg} 筆術語?", + "the_term_gmv": "是否刪除術語:{msg}?" + }, + "common": { + "start_time": "開始時間", + "end_time": "結束時間", + "require": "必填", + "zoom_in": "放大", + "zoom_out": "縮小", + "the_default_model": "已是預設模型", + "as_default_model": "設為預設模型", + "no_model_yet": "暫無模型", + "intelligent_questioning_platform": "歡迎使用 SQLBot 智慧問數平台", + "login": "帳號登入", + "login_": "登入", + "confirm2": "確定", + "excessive_tables_selected": "選擇資料表過量", + "to_continue_saving": "選擇的資料表數量為:{msg},已超出30,可能會導致操作逾時或者無回應,是否繼續儲存?", + "proceed_with_caution": "刪除後無法復原,請謹慎操作。", + "sales_in_2024": "是否刪除對話:{msg}?", + "limited_to_30": "資料表數量限制30", + "enter_your_password": "請輸入密碼", + "your_account_email_address": "請輸入帳號/郵箱", + "the_correct_password": "請輸入正確的密碼", + "input_content": "請輸入內容", + "may_not_exist": "暫無結果,使用者可能不存在", + "empty": "", + "back": "返回", + "confirm": "確認", + "cancel": "取消", + "search": "查詢", + "system_manage": "系統管理", + "update_success": "更新成功", + "save_success": "儲存成功", + "operation_success": "操作成功", + "next": "下一步", + "save": "儲存", + "logout": "登出", + "please_input": "請輸入{msg}", + "switch_success": "切換成功", + "result_count": "個結果", + "clear_filter": "清空條件", + "reset": "重設", + "simplified_chinese": "簡體中文", + "korean": "한국어", + "traditional_chinese": "繁體中文", + "help": "說明", + "language": "語言", + "english": "English", + "re_upload": "重新上傳", + "not_exceed_50mb": "支援 XLS、XLSX、CSV 格式,檔案大小不超過 50MB", + "excel_file_type_limit": "僅支援 XLS、XLSX 格式", + "click_to_select_file": "點擊選擇檔案", + "upload_hint_first": "先", + "upload_hint_download_template": "下載範本", + "upload_hint_end": ",按要求填寫後上傳。", + "continue_to_upload": "繼續匯入", + "reset_password": "重設密碼", + "password_reset_successful": "重設密碼成功", + "or": "或者", + "refresh": "重新整理", + "input_limit": "長度在 {0} 到 {1} 個字元", + "file_size_limit_error": "檔案大小超出限制(最大{limit})" + }, + "dashboard": { + "open_dashboard": "開啟儀表板", + "add_dashboard_name_tips": "請輸入儀表板名稱", + "existing_dashboard": "存量儀表板", + "add_success": "新增成功", + "no_data": "沒有找到相關內容", + "new_tab": "新建Tab", + "length_limit64": "欄位長度需要在1-64之間", + "sort_column": "排序欄位", + "sort_type": "排序方式", + "time": "時間", + "sort_asc": "升序", + "sort_desc": "降序", + "name_repeat": "儀表板名稱已被使用", + "rich_text_tips": "雙擊輸入文字內容", + "exit_preview": "退出預覽", + "no_chat": "暫無對話", + "today": "今日", + "this_week": "本週", + "earlier": "更早", + "add_component_tips": "從頂部工具列中選擇元件,新增到這裡建立儀表板", + "add_view": "新增圖表", + "delete_dashboard_warn": "是否刪除儀表板:{0}", + "rename_dashboard": "重新命名儀表板", + "dashboard_name": "儀表板名稱", + "select_dashboard_tips": "請在左側選擇儀表板", + "no_dashboard": "暫無儀表板", + "no_dashboard_info": "暫無內容,點擊下列按鈕進行新增", + "search": "搜尋", + "time_asc": "按時間升序", + "time_desc": "按時間降序", + "name_asc": "按名稱升序", + "name_desc": "按名稱降序", + "select_dashboard": "請選擇儀表板", + "name": "名稱", + "view": "圖表", + "text": "富文字", + "preview": "預覽", + "creator": "建立人", + "dashboard_id": "儀表板ID", + "create_time": "建立時間", + "updater": "更新人", + "update_time": "更新時間", + "edit": "編輯", + "edit_title": "編輯標題", + "length_1_64_characters": "名稱欄位長度1-64個字元", + "rename": "重新命名", + "delete": "刪除", + "delete_tips": "刪除後,此目錄的所有資源都會被刪除,請謹慎操作。", + "undo": "復原", + "reduction": "復原", + "folder": "目錄", + "dashboard": "儀表板", + "delete_warning": "確定要刪除嗎?", + "delete_resource_warn": "確定刪除該{0}嗎?", + "delete_success": "刪除成功", + "new_folder": "新建目錄", + "new_dashboard": "新建儀表板", + "add_chart": "新增圖表", + "chart_selected": "已選{0}" + }, + "qa": { + "retrieve_error": "暫無內容", + "retrieve_again": "重新取得", + "recently": "最近", + "recommend": "推薦", + "quick_question": "快捷提問", + "new_chat": "新建對話", + "start_sqlbot": "開啟問數", + "title": "智慧問數", + "placeholder": "請輸入您的問題", + "ask": "提問", + "loading": "載入中...", + "no_data": "暫無資料", + "error": "發生錯誤,請稍後再試", + "question_placeholder": "按下 Enter 提交問題, 或使用 Ctrl + Enter 換行", + "greeting": "你好,我是SQLBot,很高興為你服務", + "hint_description": "我可以查詢資料、產生圖表、分析資料、預測資料等,請選擇一個資料來源,開啟智慧問數吧~", + "select_datasource": "選擇資料來源", + "view_more": "查看更多", + "selected_datasource": "已選擇資料來源", + "empty_datasource": "資料來源為空,請新建後再開啟智慧問數!", + "datasource_not_exist": "資料來源不存在", + "guess_u_ask": "猜你想問:", + "continue_to_ask": "繼續提問:", + "data_analysis": "資料分析", + "data_predict": "資料預測", + "data_regenerated": "重新產生", + "chat_search": "搜尋", + "thinking": "思考中", + "thinking_step": "思考過程", + "ask_again": "重新產生", + "today": "今天", + "week": "7天內", + "earlier": "更早以前", + "no_time": "沒有時間", + "rename_conversation_title": "重新命名對話標題", + "conversation_title": "對話標題", + "copied": "已複製", + "ask_failed": "問數失敗" + }, + "ds": { + "title": "資料來源", + "local_excelcsv": "本機 Excel/CSV", + "add": "新增資料來源", + "delete": "刪除資料來源", + "name": "資料來源名稱", + "type": "資料來源類型", + "status": "狀態", + "pieces_in_total": "顯示 {ms} 筆資料", + "actions": "操作", + "test_connection": "測試連線", + "check": "驗證", + "connection_success": "連線成功", + "connection_failed": "連線失敗,請檢查配置", + "Search Datasource": "搜尋資料來源", + "tables": "資料表", + "no_data_tip": "暫無資料,請從左側選擇資料表", + "comment": "註解", + "table_schema": "表結構", + "previous": "上一步", + "preview": "資料預覽", + "preview_tip": "預覽100筆資料", + "field": { + "name": "欄位名", + "type": "類型", + "comment": "註解", + "custom_comment": "自訂註解", + "status": "狀態" + }, + "edit": { + "table_comment": "編輯表註解", + "field_comment": "編輯欄位註解", + "table_comment_label": "表註解", + "field_comment_label": "欄位註解" + }, + "form": { + "title": { + "add": "新增資料來源", + "edit": "編輯資料來源", + "choose_tables": "選擇資料表" + }, + "base_info": "基本資訊", + "choose_tables": "選擇資料表", + "name": "名稱", + "description": "描述", + "host": "主機名/IP位址", + "port": "連接埠", + "username": "使用者名稱", + "password": "密碼", + "database": "資料庫", + "connect_mode": "連線方式", + "service_name": "服務名", + "extra_jdbc": "額外的資料庫連線配置", + "schema": "模式", + "get_schema": "取得模式", + "file": "檔案", + "upload_tip": "僅支援 .xls, .xlsx, .csv 格式,大小不超過50MB", + "version_tip": { + "sqlServer": "支援版本: 2012+", + "oracle": "支援版本: 12+", + "mysql": "支援版本: 5.6+", + "pg": "支援版本: 9.6+" + }, + "selected": "已選擇: {0}/{1}", + "validate": { + "name_required": "請輸入名稱", + "name_length": "長度應在1到50個字元之間", + "type_required": "請選擇資料庫類型", + "host_required": "請輸入主機位址", + "port_required": "請輸入連接埠號", + "database_required": "請輸入資料庫名", + "mode_required": "請選擇連線方式", + "schema_required": "請輸入模式名" + }, + "mode": { + "sid": "SID", + "service_name": "服務名" + }, + "support_version": "支援版本", + "upload": { + "button": "上傳", + "tip": "僅支援 .xls, .xlsx, .csv 格式,檔案小於 50MB." + }, + "connect": { + "success": "連線成功", + "failed": "連線失敗" + }, + "timeout": "連線逾時(秒)", + "address": "位址", + "low_version": "相容低版本", + "ssl": "啟用 SSL", + "file_path": "文件路徑", + "pool_size": "連線池大小" + }, + "sync_fields": "同步表結構", + "sync_fields_success": "同步表結構成功", + "sync_fields_failed": "同步表結構失敗" + }, + "datasource": { + "recommended_question": "推薦問題", + "recommended_repetitive_tips": "存在重複問題", + "recommended_problem_tips": "自訂配置至少一個問題,每個問題2-200個字元", + "recommended_problem_configuration": "推薦問題配置", + "problem_generation_method": "問題產生方式", + "ai_automatic_generation": "AI 自動產生", + "user_defined": "使用者自訂", + "question_tips": "請輸入推薦問題", + "add_question": "新增問題", + "data_source_yet": "暫無資料來源", + "search_by_name": "透過名稱搜尋", + "search": "搜尋", + "all_types": "全部類型", + "new_data_source": "新建資料來源", + "open_query": "開啟問數", + "edit": "編輯", + "source_connection_failed": "資料來源連線失敗", + "confirm": "確定", + "copy": "複製", + "the_original_one": "確認恢復為初始密碼嗎?", + "incorrect_email_format": "郵箱格式不對", + "enabled_status": "啟用狀態", + "custom_notes": "自訂備註", + "field_type": "欄位類型", + "field_name": "欄位名稱", + "relevant_content_found": "沒有找到相關內容", + "please_enter": "請輸入", + "Please_select": "請選擇", + "table_notes": "表備註", + "field_notes": "欄位備註", + "select_all": "全選", + "mysql_data_source": "修改 {msg} 資料來源", + "configuration_information": "配置資訊", + "data_source": "是否刪除資料來源:{msg}?", + "operate_with_caution": "被刪除後,將無法對該資料來源進行智慧問數,請謹慎操作。", + "data_source_de": "無法刪除資料來源:{msg}", + "cannot_be_deleted": "儀表板的圖表使用了該資料來源,不可刪除。", + "got_it": "知道了", + "field_original_notes": "欄位原始備註", + "field_notes_1": "欄位備註", + "no_table": "暫無資料表", + "go_add": "去新增", + "get_schema": "取得Schema" + }, + "model": { + "int": "整數", + "float": "小數", + "string": "字串", + "default_model": "預設模型", + "model_type": "模型類型", + "basic_model": "基礎模型", + "set_successfully": "設定成功", + "operate_with_caution": "系統預設模型被取代後,智慧問數的結果將會受到影響,請謹慎操作。", + "system_default_model": "是否設定 {msg} 為系統預設模型?", + "ai_model_configuration": "AI 模型配置", + "system_default_model_de": "系統預設模型", + "relevant_results_found": "沒有找到相關結果", + "add_model": "新增模型", + "select_supplier": "選擇供應商", + "the_basic_model": "請給基礎模型設定一個名稱", + "the_basic_model_de": "請選擇基礎模型", + "length_max_error": "{msg}長度不能超過{max}個字元", + "model_name": "模型名稱", + "custom_model_name": "自訂的模型名稱", + "enter_to_add": "清單中未列出的模型,直接輸入模型名稱,Enter 即可新增", + "api_domain_name": "API 網域", + "advanced_settings": "進階設定", + "model_parameters": "模型參數", + "add": "新增", + "parameters": "參數", + "display_name": "顯示名稱", + "parameter_value": "參數值", + "text": "文字", + "number": "數值", + "parameter_type": "參數類型", + "verification_successful": "驗證成功", + "del_default_tip": "無法刪除模型: {msg}", + "del_default_warn": "該模型為系統預設模型,請先設定其他模型為系統預設模型,再刪除此模型。", + "del_warn_tip": "是否刪除模型: {msg}?", + "check_failed": "模型無效【{msg}】", + "default_miss": "尚未設定預設大語言模型,因此無法開啟問數,請聯繫管理員設定。", + "default_miss_admin": "尚未設定預設大語言模型,因此無法開啟問數。", + "to_config": "去設定" + }, + "user": { + "workspace": "工作區", + "creation_time": "建立時間", + "user_source": "使用者來源", + "phone_number": "手機號", + "email": "郵箱", + "user_status": "使用者狀態", + "account": "帳號", + "name": "姓名", + "selected_2_items": "已選 {msg} 筆", + "name_account_email": "搜尋姓名、帳號、郵箱", + "user_management": "使用者管理", + "filter": "篩選", + "batch_import": "批次匯入", + "add_users": "新增使用者", + "selected_2_users": "是否刪除選中的 {msg} 個使用者?", + "filter_conditions": "篩選條件", + "enable": "啟用", + "disable": "停用", + "local_creation": "本機建立", + "lark": "飛書", + "larksuite": "國際飛書", + "dingtalk": "釘釘", + "wecom": "企業微信", + "1240_results": "{msg} 個結果 ", + "clear_conditions": "清空條件", + "disabled": "已停用", + "enabled": "已啟用", + "edit_user": "編輯使用者", + "del_user": "是否刪除使用者: {msg}?", + "del_key": "是否刪除key: {msg}?", + "please_first": "請先", + "download_the_template": "下載範本", + "required_and_upload": ",按要求填寫後上傳", + "file": "檔案", + "upload_file": "上傳檔案", + "xls_format_files": "僅支援xlsx、xls格式的檔案", + "import": "匯入", + "change_file": "更換檔案", + "data_import_completed": "資料匯入完成", + "notes_import_completed": "備註匯入完成", + "imported_100_data": "成功匯入資料 {msg} 筆", + "return_to_view": "返回查看", + "continue_importing": "繼續匯入", + "import_20_can": "成功匯入資料 {msg} 筆,匯入失敗 {loss} 筆,可 ", + "download_error_report": "下載錯誤報告", + "modify_and_re_import": ",修改後重新匯入", + "data_import_failed": "資料匯入失敗", + "failed_100_can": "匯入失敗 {msg} 筆,可", + "change_password": "修改密碼", + "new_password": "新密碼", + "confirm_password": "確認密碼", + "old_password": "舊密碼", + "title": "使用者管理", + "upgrade_pwd": { + "title": "修改密碼", + "old_pwd": "舊密碼", + "new_pwd": "新密碼", + "confirm_pwd": "確認密碼", + "two_pwd_not_match": "兩次輸入的密碼不一致", + "pwd_format_error": "8-20位且至少一位大寫字母、小寫字母、數字、特殊字元" + } + }, + "workspace": { + "relevant_content_found": "找不到相關內容", + "add_workspace": "新增工作區", + "administrator": "管理員", + "ordinary_member": "一般成員", + "people": "人", + "name_username_email": "搜尋姓名、使用者名稱、郵箱", + "add_member": "新增成員", + "member_type": "成員類型", + "workspace_name": "工作區名稱", + "no_user": "暫無使用者", + "remove": "移除", + "selected_2_members": "是否移除選中的 {msg} 個成員?", + "removed_successfully": "移除成功", + "workspace_de_workspace": "是否刪除工作區:{msg}?", + "member_feng_yibudao": "是否移除成員:{msg}?", + "select_member": "選擇成員", + "selected_2_people": "已選:{msg} 人", + "selected_number": "已選:{msg} 個", + "clear": "清空", + "historical_dialogue": "暫無歷史對話", + "rename_a_workspace": "重新命名工作區", + "return_to_workspace": "返回工作區", + "there_are": "有 ", + "2_dashboards": "{msg} 個儀表板", + "smart_data_centers": "{msg} 個智慧問數", + "confirm_to_delete": "資料來源刪除後,相關的問數不可繼續提問,儀表板中的圖表無法正常顯示,請謹慎操作!", + "id_account_to_add": "搜尋使用者名稱/帳號新增", + "find_user": "尋找使用者", + "add_successfully": "新增成功", + "member_management": "成員管理", + "permission_configuration": "權限配置", + "set": "設定", + "operate_with_caution": "刪除後,該工作區下的使用者將被移除,所有資源也將被刪除,請謹慎操作。" + }, + "permission": { + "search_field": "搜尋欄位", + "search_rule_group": "搜尋規則組", + "add_rule_group": "新增規則組", + "permission_rule": "權限規則", + "restricted_user": "受限使用者", + "set_rule": "設定規則", + "set_user": "設定使用者", + "2": "{msg} 個", + "238_people": "{msg} 人", + "no_permission_rule": "暫無權限規則", + "set_permission_rule": "設定權限規則", + "basic_information": "基本資訊", + "rule_group_name": "規則組名稱", + "rule_name": "規則名稱", + "type": "類型", + "data_source": "資料來源", + "data_table": "資料表", + "select_restricted_user": "選擇受限使用者", + "rule_group_1": "是否刪除規則組:{msg}?", + "no_rule": "暫無規則", + "row_permission": "列權限", + "column_permission": "欄位權限", + "rule_rule_1": "是否刪除規則:{msg}?", + "no_content": "暫無內容", + "edit_column_permission": "編輯欄位權限", + "edit_row_permission": "編輯列權限", + "add_column_permission": "新增欄位權限", + "add_row_permission": "新增列權限", + "no_fields_yet": "暫無欄位", + "filter_eq": "等於", + "filter_not_eq": "不等於", + "filter_lt": "小於", + "filter_le": "小於等於", + "filter_gt": "大於", + "filter_ge": "大於等於", + "filter_null": "為空", + "filter_not_null": "不為空", + "filter_empty": "空字串", + "filter_not_empty": "非空字串", + "filter_include": "包含", + "filter_not_include": "不包含", + "conditional_filtering": "條件篩選", + "add_conditions": "新增條件", + "add_relationships": "新增關係", + "cannot_be_empty_": "過濾欄位不能為空", + "cannot_be_empty_de_ruler": "規則條件不能為空", + "filter_value_can_null": "過濾值不能為空", + "filter_like": "包含", + "filter_not_like": "不包含", + "filter_in": "屬於", + "filter_not_in": "不屬於", + "enter_a_question": "請輸入問題", + "new_conversation": "新對話", + "send": "傳送", + "stop_replying": "停止回覆", + "i_am_sqlbot": "你好,我是SQLBot", + "predict_data_etc": "我可以查詢資料、產生圖表、分析資料、預測資料等。", + "intelligent_data_query": "趕快開啟智慧問數吧~" + }, + "embedded": { + "delete_10_apps": "是否刪除 {msg} 個應用?", + "click_to_show": "點擊顯示", + "click_to_hide": "點擊隱藏", + "your_app_secret": "確定更新 APP Secret 嗎?", + "proceed_with_caution": "重設後現有的 App Secret 將會失效,請謹慎操作。", + "password_length": "密碼長度", + "edit_app": "編輯應用", + "embedded_management": "嵌入式管理", + "embedded_assistant": "小助手嵌入", + "embedded_page": "頁面嵌入", + "no_application": "暫無應用", + "create_application": "建立應用", + "basic_application": "基礎應用", + "advanced_application": "進階應用", + "embed_third_party": "嵌入第三方", + "support_is_required": "適用於無需資料驗證的場景,只需將嵌入式程式碼內嵌到第三方的程式碼中,無需做額外的支援", + "data_permissions_etc": "適用於需要資料驗證的場景,需要第三方系統提供資料來源介面、使用者介面資料權限等", + "create_basic_application": "建立基礎應用", + "set_data_source": "設定資料來源", + "basic_information": "基本資訊", + "application_name": "應用名稱", + "application_description": "應用描述", + "cross_domain_settings": "跨網域設定", + "enableCustomModel": "使用指定模型", + "useModel": "使用模型", + "defaultModel": "預設模型", + "customModel": "指定模型", + "third_party_address": "請輸入嵌入的第三方位址,多個以分號分割", + "set_to_private": "設為私有", + "set_to_public": "設為公共", + "public": "公共", + "private": "私有", + "configure_interface": "配置介面", + "interface_url": "介面 URL", + "format_is_incorrect": "格式不對{msg}", + "domain_format_incorrect": ",http或https開頭,不能以 / 結尾,多個網域名稱以分號(半形)分隔", + "interface_url_incorrect": ",請填寫相對路徑,以/開頭,或者絕對路徑以http或https開頭", + "aes_enable": "開啟 AES 加密", + "aes_enable_tips": "加密欄位 (host, user, password, dataBase, schema) 均採用 AES-CBC-PKCS5Padding 加密方式", + "bit": "位", + "creating_advanced_applications": "建立進階應用", + "credential_acquisition_method": "憑證取得方式", + "table_notes": "表備註", + "system_credential_type": "來源系統憑證類型", + "credential_name": "憑證名稱", + "target_credential_location": "目標憑證位置", + "target_credential_name": "目標憑證名稱", + "target_credential": "目標憑證", + "edit_advanced_applications": "編輯進階應用", + "edit_basic_applications": "編輯基礎應用", + "delete": "是否刪除: {msg}?", + "code_to_embed": "複製以下程式碼進行嵌入", + "floating_window_mode": "浮窗模式", + "copy_successful": "複製成功", + "copy_failed": "複製失敗", + "open_the_query": "公共的資料來源,允許所有使用者開啟問數;私有資料來源,登入狀態的使用者可以開啟問數", + "add_interface_credentials": "新增介面憑證", + "edit_interface_credentials": "編輯介面憑證", + "duplicate_name": "重複名稱", + "duplicate_name_": "重複姓名", + "duplicate_account": "重複帳號", + "duplicate_email": "重複郵箱", + "repeating_parameters": "重複參數", + "interface_credentials": "介面憑證", + "no_credentials_yet": "暫無憑證", + "intelligent_customer_service": "SQLBot 智慧客服", + "enter_a_question": "請輸入問題", + "new_conversation": "新建對話", + "send": "傳送", + "stop_replying": "停止回答", + "i_am_sqlbot": "你好,我是 SQLBot", + "predict_data_etc": "我可以查詢資料、產生圖表、檢測資料異常、預測資料等", + "intelligent_data_query": "趕快開啟智慧問數吧~", + "origin_format_error": "格式錯誤,http或https開頭,不能以 / 結尾", + "display_settings": "顯示設定", + "header_text_color": "頭部文字顏色", + "app_logo": "應用 Logo", + "maximum_size_10mb": "建議尺寸 32 x 32,支援 JPG、PNG,大小不超過 10MB", + "replace": "取代", + "default_icon_position": "圖示預設位置", + "draggable_position": "可拖曳位置", + "up": "上", + "down": "下", + "left": "左", + "right": "右", + "welcome_description": "歡迎語描述", + "data_analysis_now": "我可以查詢資料、產生圖表、檢測資料異常、預測資料等趕快開啟智慧問數吧~", + "window_entrance_icon": "浮窗入口圖示", + "preview_error": "目前頁面禁止使用 Iframe 嵌入!", + "assistant_app": "小助手應用", + "auto_select_ds": "自動選擇資料來源" + }, + "chat": { + "type": "圖表類型", + "chart_type": { + "table": "明細表", + "bar": "橫條圖", + "column": "柱狀圖", + "line": "折線圖", + "pie": "圓餅圖" + }, + "hide_label": "隱藏標籤", + "show_label": "顯示標籤", + "sort_asc": "升序", + "sort_desc": "降序", + "sort_none": "不排序", + "show_sql": "檢視SQL", + "export_to": "匯出為", + "excel": "Excel", + "picture": "圖片", + "add_to_dashboard": "新增到儀表板", + "full_screen": "全螢幕", + "exit_full_screen": "退出全螢幕", + "sql_generation": "產生SQL", + "chart_generation": "產生圖表", + "inference_process": "思考過程", + "thinking": "思考中", + "data_analysis": "資料分析", + "data_predict": "資料預測", + "data_over_limit": "資料量過大,僅展示前{0}筆資料", + "ds_is_invalid": "資料來源無效", + "error": "錯誤", + "exec-sql-err": "執行SQL失敗", + "no_data": "暫無資料", + "loading_data": "載入中...", + "show_error_detail": "檢視具體資訊", + "thousands_separator_setting": "千分位符設定", + "thousands_separator_display": "套用千分位符顯示", + "log": { + "GENERATE_SQL": "產生 SQL", + "GENERATE_CHART": "產生圖表結構", + "ANALYSIS": "分析", + "PREDICT_DATA": "預測", + "GENERATE_SQL_WITH_PERMISSIONS": "拼接 SQL 列權限", + "CHOOSE_DATASOURCE": "匹配資料來源", + "GENERATE_DYNAMIC_SQL": "產生動態 SQL", + "CHOOSE_TABLE": "匹配資料表 (Schema)", + "FILTER_TERMS": "匹配術語", + "FILTER_SQL_EXAMPLE": "匹配 SQL 範例", + "FILTER_CUSTOM_PROMPT": "匹配自訂提示詞", + "EXECUTE_SQL": "執行 SQL", + "GENERATE_PICTURE": "產生圖片" + }, + "log_system": "對話範本", + "log_question": "本次提問", + "log_answer": "AI 回答", + "log_history": "歷史記錄", + "find_term_title": "匹配到 {0} 個術語", + "find_sql_sample_title": "匹配到 {0} 個SQL範例", + "find_custom_prompt_title": "匹配到 {0} 個自訂提示詞", + "query_count_title": "查詢到 {0} 筆資料", + "generate_picture_success": "已產生圖片" + }, + "about": { + "title": "關於", + "auth_to": "授權給", + "invalid_license": "License 無效", + "update_license": "更新 License", + "expiration_time": "過期時間", + "expirationed": "(已過期)", + "auth_num": "授權數量", + "version": "版本", + "version_num": "版本號", + "standard": "社區版", + "enterprise": "企業版", + "professional": "專業版", + "embedded": "嵌入式版", + "support": "取得技術支援", + "update_success": "更新成功,請重新登入", + "serial_no": "序號", + "remark": "備註", + "back_community": "還原至社區版", + "confirm_tips": "確定還原至社區版?" + }, + "license": { + "error_tips": "是否重新整理頁面?", + "offline_tips": "服務已下線,請聯繫管理員重啟服務!" + }, + "system": { + "system_settings": "系統設定", + "appearance_settings": "外觀設定", + "authentication_settings": "登入認證", + "platform_display_theme": "平台顯示主題", + "default_turquoise": "預設 (松石綠)", + "tech_blue": "科技藍", + "custom": "自訂", + "platform_login_settings": "平台登入設定", + "page_preview": "頁面預覽", + "restore_default": "恢復預設", + "website_logo": "網站 Logo", + "tab": "頁籤", + "replace_image": "取代圖片", + "larger_than_200kb": "頂部網站顯示的 Logo,建議尺寸 48 x 48,支援 JPG、PNG,大小不超過 200KB", + "login_logo": "系統 Logo", + "larger_than_200kb_de": "登入頁面右側 Logo,建議尺寸 204*52,支援 JPG、PNG,大小不超過 200KB", + "login_background_image": "登入背景圖", + "larger_than_5mb": "左側背景圖,向量圖建議尺寸 576*900,點陣圖建議尺寸 1152*1800;支援 JPG、PNG,大小不超過 5M", + "website_name": "網站名稱", + "on_webpage_tabs": "顯示在網頁 Tab 的平台名稱", + "welcome_message": "顯示歡迎語", + "the_product_logo": "產品 Logo 下的 歡迎語", + "screen_customization_supported": "預設為 SQLBot 登入介面,支援自訂設定", + "screen_customization_settings": "預設為 SQLBot 平台介面,支援自訂設定", + "platform_settings": "平台設定", + "help_documentation": "說明文件", + "show_about": "顯示關於", + "abort_update": "放棄更新", + "save_and_apply": "儲存並套用", + "setting_successfully": "設定成功", + "customize_theme_color": "自訂主題色" + }, + "platform": { + "title": "平台對接", + "status_open": "已開啟", + "status_close": "已關閉", + "access_in": "接入", + "can_enable_it": "測試連線有效後,可開啟" + }, + "authentication": { + "invalid": "無效", + "valid": "有效", + "cas_settings": "CAS 設定", + "callback_domain_name": "回調位址", + "callback_domain_name_error": "回調位址必須是目前的存取網域名稱", + "field_mapping": "使用者屬性對應", + "field_mapping_placeholder": "例如:{'{'}\"account\": \"saml2Account\", \"name\": \"saml2Name\", \"email\": \"email\"{'}'}", + "incorrect_please_re_enter": "格式錯誤,請重新填寫", + "in_json_format": "請輸入json格式", + "authorize_url": "授權位址", + "client_id": "用戶端 ID", + "client_secret": "用戶端密鑰", + "redirect_url": "回調位址", + "logout_redirect_url": "登出回調位址", + "logout_redirect_url_placeholder": "登出後預設跳轉至 SQLBot 登入頁面,可自訂設定登出後跳轉位址", + "oauth2_settings": "OAuth2 設定", + "scope": "授權範圍", + "userinfo_url": "使用者資訊位址", + "token_url": "權杖位址", + "revoke_url": "撤銷位址", + "oauth2_field_mapping_placeholder": "例如:{'{'}\"account\": \"oauth2Account\", \"name\": \"oauth2Name\", \"email\": \"email\"{'}'}", + "token_auth_method": "Token 認證方式", + "userinfo_auth_method": "使用者資訊認證方式", + "oidc_settings": "OIDC 設定", + "metadata_url": "中繼資料位址", + "realm": "領域", + "oidc_field_mapping_placeholder": "例如:{'{'}\"account\": \"oidcAccount\", \"name\": \"oidcName\", \"email\": \"email\"{'}'}", + "ldap_settings": "LDAP 設定", + "server_address": "伺服器位址", + "server_address_placeholder": "例如:ldap://ldap.example.com:389", + "bind_dn": "繫結 DN", + "bind_dn_placeholder": "例如:cn=admin,dc=example,dc=com", + "bind_pwd": "繫結密碼", + "ou": "使用者 OU", + "ou_placeholder": "例如:ou=users,dc=example,dc=com", + "user_filter": "使用者過濾器", + "user_filter_placeholder": "例如:uid 或 uid {0} email, 多屬性以 {1} 分割", + "ldap_field_mapping_placeholder": "例如:{'{'}\"account\": \"ldapAccount\", \"name\": \"ldapName\", \"email\": \"mail\"{'}'}", + "be_turned_on": "測試連線有效後,可開啟" + }, + "login": { + "default_login": "預設", + "ldap_login": "LDAP 登入", + "account_login": "帳號登入", + "other_login": "其他登入方式", + "pwd_invalid_error": "密碼已過期請聯繫管理員修改或重設", + "pwd_exp_tips": "密碼在 {0} 天後過期,請盡快修改密碼", + "qr_code": "QR Code", + "platform_disable": "{0}設定未開啟!", + "input_account": "請輸入帳號", + "redirect_2_auth": "正在跳轉至 {0} 認證,{1} 秒...", + "redirect_immediately": "立即跳轉", + "permission_invalid": "認證無效【目前帳號權限不夠】", + "scan_qr_login": "掃碼登入", + "no_auth_error": "未認證,即將跳轉登入頁面,{0} 秒..." + }, + "supplier": { + "alibaba_cloud_bailian": "阿里雲百煉", + "qianfan_model": "千帆大模型", + "deepseek": "DeepSeek", + "tencent_hunyuan": "騰訊混元", + "iflytek_spark": "訊飛星火", + "gemini": "Gemini", + "openai": "OpenAI", + "kimi": "Kimi", + "tencent_cloud": "騰訊雲", + "volcano_engine": "火山引擎", + "minimax": "MiniMax", + "generic_openai": "通用OpenAI" + }, + "modelType": { + "llm": "大語言模型" + }, + "audit": { + "system_log": "操作日誌", + "search_log": "搜尋日誌", + "operation_type": "操作類型", + "operation_details": "操作詳情", + "operation_user_name": "操作使用者", + "operation_status": "操作狀態", + "user_name": "操作日誌", + "oid_name": "工作區", + "ip_address": "IP 位址", + "create_time": "建立時間", + "no_log": "暫無日誌", + "all_236_terms": "是否匯出全部 {msg} 筆日誌?", + "export_hint": "是否匯出全部日誌?", + "export": "匯出", + "success": "成功", + "failed": "失敗", + "failed_info": "操作失敗詳情", + "opt_time": "操作時間" + }, + "api_key": { + "info_tips": "API Key 是您存取 SQLBot API 的密鑰,具有帳戶的完全權限,請您務必妥善保管!不要以任何方式公開 API Key 到外部渠道,避免被他人利用造成安全威脅。", + "create": "建立", + "to_doc": "檢視 API", + "trigger_limit": "最多支援建立 {0} 個 API Key" + } +} diff --git a/frontend/src/main.ts b/frontend/src/main.ts index f81e9fcbe..08c414c1a 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -1,3 +1,7 @@ +import 'core-js/features/object/has-own' +// @ts-ignore: css-has-pseudo/browser lacks official type definitions +import cssHasPseudo from 'css-has-pseudo/browser' + import { createApp } from 'vue' import { createPinia } from 'pinia' import './style.less' @@ -7,6 +11,26 @@ import { i18n } from './i18n' import VueDOMPurifyHTML from 'vue-dompurify-html' // import 'element-plus/dist/index.css' +cssHasPseudo(document) + +function supportsFlexGap() { + const flex = document.createElement('div') + flex.style.display = 'flex' + flex.style.flexDirection = 'column' + flex.style.rowGap = '1px' + + flex.appendChild(document.createElement('div')) + flex.appendChild(document.createElement('div')) + + document.body.appendChild(flex) + const isSupported = flex.scrollHeight === 1 + document.body.removeChild(flex) + + return isSupported +} + +document.documentElement.setAttribute('data-no-flex-gap', String(!supportsFlexGap())) + const app = createApp(App) const pinia = createPinia() diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index 6392920d0..b1c266752 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -12,10 +12,12 @@ import Model from '@/views/system/model/Model.vue' // import Embedded from '@/views/system/embedded/index.vue' // import SetAssistant from '@/views/system/embedded/iframe.vue' import SystemEmbedded from '@/views/system/embedded/Page.vue' +import Variables from '@/views/system/variables/index.vue' import assistantTest from '@/views/system/embedded/Test.vue' import assistant from '@/views/embedded/index.vue' import EmbeddedPage from '@/views/embedded/page.vue' +import EmbeddedCommon from '@/views/embedded/common.vue' import Member from '@/views/system/member/index.vue' import Professional from '@/views/system/professional/index.vue' import Training from '@/views/system/training/index.vue' @@ -218,6 +220,12 @@ export const routes = [ component: Parameter, meta: { title: t('parameter.parameter_configuration') }, }, + { + path: 'variables', + name: 'variables', + component: Variables, + meta: { title: t('variables.system_variables') }, + }, { path: 'authentication', name: 'authentication', @@ -251,6 +259,11 @@ export const routes = [ name: 'embeddedPage', component: EmbeddedPage, }, + { + path: '/embeddedCommon', + name: 'embeddedCommon', + component: EmbeddedCommon, + }, { path: '/assistantTest', name: 'assistantTest', diff --git a/frontend/src/router/watch.ts b/frontend/src/router/watch.ts index aa8f06e4a..e862d286f 100644 --- a/frontend/src/router/watch.ts +++ b/frontend/src/router/watch.ts @@ -11,7 +11,9 @@ const appearanceStore = useAppearanceStoreWithOut() const userStore = useUserStore() const { wsCache } = useCache() const whiteList = ['/login', '/admin-login'] -const assistantWhiteList = ['/assistant', '/embeddedPage', '/401'] +const assistantWhiteList = ['/assistant', '/embeddedPage', '/embeddedCommon', '/401'] + +const wsAdminRouterList = ['/ds/index', '/as/index'] export const watchRouter = (router: Router) => { router.beforeEach(async (to: any, from: any, next: any) => { await loadXpackStatic() @@ -35,16 +37,21 @@ export const watchRouter = (router: Router) => { next(toLoginPage(to.fullPath)) return } - let isFirstDynamicPath = false if (!userStore.getUid) { await userStore.info() generateDynamicRouters(router) - isFirstDynamicPath = to?.path && ['/ds/index', '/as/index'].includes(to.path) + const isFirstDynamicPath = to?.path && ['/ds/index', '/as/index'].includes(to.path) if (isFirstDynamicPath) { - next({ ...to, replace: true }) - return + if (userStore.isSpaceAdmin) { + next({ ...to, replace: true }) + return + } } } + if (to.path === '/docs') { + location.href = to.fullPath + return + } if (to.path === '/' || accessCrossPermission(to)) { next('/chat') return @@ -62,9 +69,14 @@ const accessCrossPermission = (to: any) => { if (!to?.path) return false return ( (to.path.startsWith('/system') && !userStore.isAdmin) || - (to.path.startsWith('/set') && !userStore.isSpaceAdmin) + (to.path.startsWith('/set') && !userStore.isSpaceAdmin) || + (isWsAdminRouter(to) && !userStore.isSpaceAdmin) ) } + +const isWsAdminRouter = (to?: any) => { + return wsAdminRouterList.some((item: string) => to?.path?.startsWith(item)) +} const loadXpackStatic = () => { if (document.getElementById('sqlbot_xpack_static')) { return Promise.resolve() diff --git a/frontend/src/stores/appearance.ts b/frontend/src/stores/appearance.ts index 2093f300a..ed368a7dc 100644 --- a/frontend/src/stores/appearance.ts +++ b/frontend/src/stores/appearance.ts @@ -315,7 +315,7 @@ const setLinkIcon = (linkWeb?: string) => { if (linkWeb) { link['href'] = baseUrl + linkWeb } else { - link['href'] = '/LOGO-fold.svg' + link['href'] = `${location.pathname}LOGO-fold.svg` } } } diff --git a/frontend/src/stores/assistant.ts b/frontend/src/stores/assistant.ts index 46b7a7893..45474fcbd 100644 --- a/frontend/src/stores/assistant.ts +++ b/frontend/src/stores/assistant.ts @@ -1,13 +1,10 @@ import { defineStore } from 'pinia' import { store } from './index' import { chatApi, ChatInfo } from '@/api/chat' -import { useCache } from '@/utils/useCache' - -const { wsCache } = useCache() -const flagKey = 'sqlbit-assistant-flag' type Resolver = (value: T | PromiseLike) => void type Rejecter = (reason?: any) => void interface PendingRequest { + requestId: string resolve: Resolver reject: Rejecter } @@ -15,14 +12,16 @@ interface AssistantState { id: string token: string assistant: boolean - flag: number type: number certificate: string online: boolean pageEmbedded?: boolean history: boolean hostOrigin: string - requestPromiseMap: Map + autoDs?: boolean + requestPromiseMap: Map + peddingStatus: number //0: ready,1: pedding,2:finish + certificateTime: number } export const AssistantStore = defineStore('assistant', { @@ -31,14 +30,16 @@ export const AssistantStore = defineStore('assistant', { id: '', token: '', assistant: false, - flag: 0, type: 0, certificate: '', online: false, pageEmbedded: false, history: true, hostOrigin: '', - requestPromiseMap: new Map(), + autoDs: false, + requestPromiseMap: new Map(), + peddingStatus: 0, + certificateTime: 0, } }, getters: { @@ -54,9 +55,6 @@ export const AssistantStore = defineStore('assistant', { getAssistant(): boolean { return this.assistant }, - getFlag(): number { - return this.flag - }, getType(): number { return this.type }, @@ -75,47 +73,90 @@ export const AssistantStore = defineStore('assistant', { getHostOrigin(): string { return this.hostOrigin }, + getAutoDs(): boolean { + return !!this.autoDs + }, }, actions: { - refreshCertificate() { + refreshCertificate(requestUrl?: string) { + /* if (+new Date() < this.certificateTime + 5000) { + return + } */ + const timeout = 30000 + let peddingList = this.requestPromiseMap.get(this.id) as PendingRequest[] + if (!peddingList) { + this.requestPromiseMap.set(this.id, []) + peddingList = this.requestPromiseMap.get(this.id) as PendingRequest[] + } + + if (this.peddingStatus === 2) { + if (peddingList?.length) { + return + } else { + this.peddingStatus = 0 + } + } + return new Promise((resolve, reject) => { + const currentRequestId = `${this.id}|${requestUrl}|${+new Date()}` const timeoutId = setTimeout(() => { - this.requestPromiseMap.delete(this.id) - reject(new Error(`Request ${this.id} timed out after ${timeout}ms`)) + console.error(`Request ${currentRequestId}[${requestUrl}] timed out after ${timeout}ms`) + resolve(null) + removeRequest(currentRequestId, peddingList) + if (timeoutId) { + clearTimeout(timeoutId) + } + // reject(new Error(`Request ${this.id} timed out after ${timeout}ms`)) }, timeout) - this.requestPromiseMap.set(this.id, { - resolve: (value: T) => { + + const cleanupAndResolve = (value: any) => { + if (timeoutId) { clearTimeout(timeoutId) - this.requestPromiseMap.delete(this.id) - resolve(value) - }, - reject: (reason) => { + } + resolve(value) + removeRequest(currentRequestId, peddingList) + } + + const cleanupAndReject = (reason: any) => { + if (timeoutId) { clearTimeout(timeoutId) - this.requestPromiseMap.delete(this.id) - reject(reason) - }, - }) - const readyData = { - eventName: this.pageEmbedded ? 'sqlbot_embedded_event' : 'sqlbot_assistant_event', - busi: 'ready', - ready: true, - messageId: this.id, + } + removeRequest(currentRequestId, peddingList) + reject(reason) + } + + addRequest(currentRequestId, cleanupAndResolve, cleanupAndReject, peddingList) + if (this.peddingStatus !== 1) { + this.peddingStatus = 1 + const readyData = { + eventName: this.pageEmbedded ? 'sqlbot_embedded_event' : 'sqlbot_assistant_event', + busi: 'ready', + ready: true, + messageId: this.id, + } + window.parent.postMessage(readyData, '*') } - window.parent.postMessage(readyData, '*') }) }, resolveCertificate(data?: any) { - const peddingRequest = this.requestPromiseMap.get(this.id) - if (peddingRequest) { - peddingRequest.resolve(data) + const peddingRequestList = this.requestPromiseMap.get(this.id) + + if (peddingRequestList?.length) { + let len = peddingRequestList?.length + while (len--) { + const peddingRequest: PendingRequest = peddingRequestList[len] + peddingRequest.resolve(data) + } } + this.peddingStatus = 2 }, setId(id: string) { this.id = id }, setCertificate(certificate: string) { this.certificate = certificate + this.certificateTime = +new Date() }, setType(type: number) { this.type = type @@ -126,14 +167,6 @@ export const AssistantStore = defineStore('assistant', { setAssistant(assistant: boolean) { this.assistant = assistant }, - setFlag(flag: number) { - if (wsCache.get(flagKey)) { - this.flag = wsCache.get(flagKey) - } else { - this.flag = flag - wsCache.set(flagKey, flag) - } - }, setPageEmbedded(embedded?: boolean) { this.pageEmbedded = !!embedded }, @@ -146,6 +179,9 @@ export const AssistantStore = defineStore('assistant', { setHostOrigin(origin: string) { this.hostOrigin = origin }, + setAutoDs(autoDs?: boolean) { + this.autoDs = !!autoDs + }, async setChat() { if (!this.assistant) { return null @@ -155,12 +191,40 @@ export const AssistantStore = defineStore('assistant', { return chat }, clear() { - wsCache.delete(flagKey) this.$reset() }, }, }) +const removeRequest = (requestId: string, peddingList: PendingRequest[]) => { + if (!peddingList) return + let len = peddingList.length + while (len--) { + const peddingRequest = peddingList[len] + if (peddingRequest?.requestId === requestId) { + peddingList.splice(len, 1) + } + } +} + +const addRequest = ( + requestId: string, + resolve: any, + reject: any, + peddingList: PendingRequest[] +) => { + const currentPeddingRequest = { + requestId, + resolve: (value: any) => { + resolve(value) + }, + reject: (reason: any) => { + reject(reason) + }, + } as PendingRequest + peddingList?.push(currentPeddingRequest) +} + export const useAssistantStore = () => { return AssistantStore(store) } diff --git a/frontend/src/stores/chatConfig.ts b/frontend/src/stores/chatConfig.ts index a4ad4def9..478547826 100644 --- a/frontend/src/stores/chatConfig.ts +++ b/frontend/src/stores/chatConfig.ts @@ -4,21 +4,41 @@ import { request } from '@/utils/request.ts' import { formatArg } from '@/utils/utils.ts' interface ChatConfig { + sqlbot_name: string expand_thinking_block: boolean + hide_thinking_block: boolean limit_rows: boolean + show_sql: boolean + show_log: boolean } export const chatConfigStore = defineStore('chatConfigStore', { state: (): ChatConfig => { return { + sqlbot_name: 'SQLBot', expand_thinking_block: false, + hide_thinking_block: false, limit_rows: true, + show_sql: true, + show_log: true, } }, getters: { + getSQLBotName(): string { + return this.sqlbot_name + }, getExpandThinkingBlock(): boolean { return this.expand_thinking_block }, + getHideThinkingBlock(): boolean { + return this.hide_thinking_block + }, + getShowSQL(): boolean { + return this.show_sql + }, + getShowLog(): boolean { + return this.show_log + }, getLimitRows(): boolean { return this.limit_rows }, @@ -28,12 +48,26 @@ export const chatConfigStore = defineStore('chatConfigStore', { request.get('/system/parameter/chat').then((res: any) => { if (res) { res.forEach((item: any) => { + if (item.pkey === 'chat.hide_thinking_block') { + this.hide_thinking_block = formatArg(item.pval) + } if (item.pkey === 'chat.expand_thinking_block') { this.expand_thinking_block = formatArg(item.pval) } + if (item.pkey === 'chat.show_sql') { + this.show_sql = formatArg(item.pval) + } + if (item.pkey === 'chat.show_log') { + this.show_log = formatArg(item.pval) + } if (item.pkey === 'chat.limit_rows') { this.limit_rows = formatArg(item.pval) } + if (item.pkey === 'chat.sqlbot_name') { + if (item.pval && item.pval.trim().length > 0) { + this.sqlbot_name = item.pval + } + } }) } }) diff --git a/frontend/src/stores/user.ts b/frontend/src/stores/user.ts index cc8c13b54..b72e061d7 100644 --- a/frontend/src/stores/user.ts +++ b/frontend/src/stores/user.ts @@ -4,7 +4,7 @@ import { AuthApi } from '@/api/login' import { useCache } from '@/utils/useCache' import { i18n } from '@/i18n' import { store } from './index' -import { getCurrentRouter, getQueryString } from '@/utils/utils' +import { getCurrentRouter, getQueryString, getSQLBotAddr, isPlatform } from '@/utils/utils' const { wsCache } = useCache() @@ -98,9 +98,12 @@ export const UserStore = defineStore('user', { window.open(res, '_self') return res } - if (getQueryString('code') && getQueryString('state')?.includes('oauth2_state')) { + if ( + (getQueryString('code') && getQueryString('state')?.includes('oauth2_state')) || + isPlatform() + ) { const currentPath = getCurrentRouter() - let logout_url = location.origin + location.pathname + '#/login' + let logout_url = getSQLBotAddr() + '#/login' if (currentPath) { logout_url += `?redirect=${currentPath}` } @@ -174,6 +177,8 @@ export const UserStore = defineStore('user', { language = 'zh-CN' } else if (language === 'zh_CN') { language = 'zh-CN' + } else if (language === 'zh_TW') { + language = 'zh-TW' } else if (language === 'ko_KR') { language = 'ko-KR' } diff --git a/frontend/src/style.less b/frontend/src/style.less index 05e5b8b8c..0d1d9263b 100644 --- a/frontend/src/style.less +++ b/frontend/src/style.less @@ -1,3 +1,23 @@ +/* ========================================== + 老旧浏览器 Flex Gap 完美物理隔离补丁 + ========================================== */ + +/* 1. 当浏览器【不支持 flex gap】时,激活此特定命名空间 */ +:root[data-no-flex-gap='true'] .flex-gap-fallback { + display: flex; +} + +/* 2. 仅对标记了该 class 的容器下的【相邻子元素】水平方向加间距 */ +:root[data-no-flex-gap='true'] .flex-gap-fallback > * + * { + margin-left: var(--gap-size, 16px); /* 默认 16px,可通过变量动态修改 */ +} + +/* 3. 如果需要处理垂直排列(flex-direction: column) */ +:root[data-no-flex-gap='true'] .flex-gap-fallback.flex-col > * + * { + margin-left: 0; + margin-top: var(--gap-size, 16px); +} + :root { font-family: system-ui, Avenir, Helvetica, Arial, sans-serif; line-height: 1.5; @@ -25,12 +45,15 @@ --shadow: 0 1px 3px rgba(0, 0, 0, 0.1); --ed-border-radius-base: 6px !important; --ed-border-color: #d9dcdf !important; +} + +:root:root { --ed-color-primary-light-7: #d2f1e9 !important; --ed-border-color: #d9dcdf !important; - --ed-border-radius-base: 6px !important; --ed-disabled-border-color: #d9dcdf !important; --ed-border-color-light: #dee0e3 !important; --ed-border-color-lighter: #dee0e3 !important; + --ed-border-radius-base: 6px !important; } a { @@ -85,7 +108,7 @@ body { .list-item_primary { height: 40px; - border-radius: 4px; + border-radius: 6px; padding: 8px 12px; cursor: pointer; display: flex; @@ -227,7 +250,11 @@ strong { .ed-select__popper { padding: 0 4px !important; .ed-select-dropdown__item { - border-radius: 4px; + border-radius: 6px; + } + + .ed-select-dropdown__list { + padding: 4px 0 !important; } } @@ -380,16 +407,6 @@ strong { line-height: 22px; } -.ed-pager li.number.number.number { - &:hover { - background-color: var(--ed-color-primary-60); - } - - &:active { - background-color: var(--ed-color-primary-80); - } -} - .ed-table.ed-table.ed-table { --ed-table-border-color: #1f232926; } @@ -419,3 +436,45 @@ strong { margin-top: -7px; } } + +.text-variables.text-variables, +.string-variables.string-variables { + color: #3370ff; +} +.number-variables.number-variables, +.int-variables.int-variables, +.float-variables.float-variables { + color: #04b49c; +} +.datetime-variables.datetime-variables { + color: #3370ff; +} + +.ed-tree-node__content { + border-radius: 6px; +} + +.login-content { + /* 针对 Webkit 浏览器的自动填充样式重置 */ + input:-webkit-autofill, + input:-webkit-autofill:hover, + input:-webkit-autofill:focus, + input:-webkit-autofill:active { + /* 1. 使用足够大的内阴影来覆盖背景色,把 #ffffff 替换成你输入框原本的背景色 */ + -webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important; + + /* 2. 由于常规的 color 属性也会失效,需要用这个属性修改文字颜色 */ + -webkit-text-fill-color: #333333 !important; + + /* 3. 保留光标的正常颜色 */ + caret-color: #333333; + } +} + +.ed-popper.is-pure:has(.ed-select-dropdown) { + padding: 0 !important; + + .ed-select-dropdown { + padding: 0 4px !important; + } +} diff --git a/frontend/src/utils/request.ts b/frontend/src/utils/request.ts index 84db2335a..b0700fd00 100644 --- a/frontend/src/utils/request.ts +++ b/frontend/src/utils/request.ts @@ -107,8 +107,12 @@ class HttpService { !!(assistantStore.getType % 2) && assistantStore.getCertificate ) { - if (config.method?.toLowerCase() === 'get' && /\/chat\/\d+$/.test(config.url || '')) { - await assistantStore.refreshCertificate() + if ( + /* (config.method?.toLowerCase() === 'get' && /\/chat\/\d+$/.test(config.url || '')) || */ + /^\/chat/.test(config.url || '') || + config.url?.includes('/system/assistant/ds') + ) { + await assistantStore.refreshCertificate(config.url || '') } config.headers['X-SQLBOT-ASSISTANT-CERTIFICATE'] = btoa( encodeURIComponent(assistantStore.getCertificate) @@ -317,7 +321,7 @@ class HttpService { !!(assistantStore.getType % 2) && assistantStore.getCertificate ) { - await assistantStore.refreshCertificate() + await assistantStore.refreshCertificate(url) heads['X-SQLBOT-ASSISTANT-CERTIFICATE'] = btoa( encodeURIComponent(assistantStore.getCertificate) ) diff --git a/frontend/src/utils/useCache.ts b/frontend/src/utils/useCache.ts index c7cda2afa..256da2142 100644 --- a/frontend/src/utils/useCache.ts +++ b/frontend/src/utils/useCache.ts @@ -1,13 +1,50 @@ import WebStorageCache from 'web-storage-cache' -type CacheType = 'sessionStorage' | 'localStorage' +type CacheType = 'localStorage' | 'sessionStorage' + +const getPathPrefix = () => { + const pathname = window.location.pathname + // eslint-disable-next-line no-useless-escape + const match = pathname.match(/^\/([^\/]+)/) + return match ? `${match[1]}_` : 'sqlbot_v1_' +} export const useCache = (type: CacheType = 'localStorage') => { - const wsCache: WebStorageCache = new WebStorageCache({ - storage: type, + const originalCache = new WebStorageCache({ storage: type }) + const prefix = getPathPrefix() + + const methodsNeedKeyPrefix = new Set(['get', 'delete', 'touch', 'add', 'replace']) + + const wrappedCache = new Proxy(originalCache, { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + get(target, prop, _receiver) { + const originalMethod = target[prop as keyof typeof target] + + if (typeof originalMethod !== 'function') { + return originalMethod + } + + if (methodsNeedKeyPrefix.has(prop as string)) { + return function (this: any, key: string, ...args: any[]) { + // 自动加上前缀 + const scopedKey = `${prefix}${key}` + return (originalMethod as (...args: any[]) => any).apply(target, [scopedKey, ...args]) + } + } + + if (prop === 'set') { + return function (this: any, key: string, value: any, ...args: any[]) { + const scopedKey = `${prefix}${key}` + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type + return (originalMethod as Function).apply(target, [scopedKey, value, ...args]) + } + } + + return originalMethod.bind(target) + }, }) return { - wsCache, + wsCache: wrappedCache, } } diff --git a/frontend/src/utils/utils.ts b/frontend/src/utils/utils.ts index 267e587e9..01eb57390 100644 --- a/frontend/src/utils/utils.ts +++ b/frontend/src/utils/utils.ts @@ -50,7 +50,7 @@ export const getBrowserLocale = () => { } if (language.toLowerCase().startsWith('zh')) { const temp = language.toLowerCase().replace('_', '-') - return temp === 'zh' ? 'zh-CN' : temp === 'zh-cn' ? 'zh-CN' : 'tw' + return temp === 'zh' ? 'zh-CN' : temp === 'zh-cn' ? 'zh-CN' : 'zh-TW' } return language } @@ -245,11 +245,21 @@ export const isLarkPlatform = () => { return !!getQueryString('state') && !!getQueryString('code') } +export const isPlatform = () => { + const state = getQueryString('state') + const platformArray = ['wecom', 'dingtalk', 'lark'] + return ( + !!state && + !!getQueryString('code') && + platformArray.some((item: string) => state.includes(item)) + ) +} + export const isPlatformClient = () => { return !!getQueryString('client') || getQueryString('state')?.includes('client') } -export const checkPlatform = () => { +/* export const checkPlatform = () => { const flagArray = ['/casbi', 'oidcbi'] const pathname = window.location.pathname if ( @@ -265,7 +275,7 @@ export const cleanPlatformFlag = () => { const platformKey = 'out_auth_platform' wsCache.delete(platformKey) return false -} +} */ export function isTablet() { const userAgent = navigator.userAgent const tabletRegex = /iPad|Silk|Galaxy Tab|PlayBook|BlackBerry|(tablet|ipad|playbook)/i diff --git a/frontend/src/utils/xss.ts b/frontend/src/utils/xss.ts index c0307d716..a2504373f 100644 --- a/frontend/src/utils/xss.ts +++ b/frontend/src/utils/xss.ts @@ -27,16 +27,13 @@ export function highlightKeyword( highlightClass: string = 'highlight' ): string { if (!keyword) return escapeHtml(text) - + const escapedText = escapeHtml(text) const escapedKeyword = escapeHtml(keyword) - + // Use case-insensitive replace const regex = new RegExp(escapedKeyword, 'gi') - return escapedText.replace( - regex, - (match) => `${match}` - ) + return escapedText.replace(regex, (match) => `${match}`) } /** @@ -48,18 +45,18 @@ export function sanitizeHtml(html: string): string { // Create a temporary div to parse HTML const temp = document.createElement('div') temp.innerHTML = html - + // List of allowed tags const allowedTags = ['b', 'i', 'u', 'strong', 'em', 'span', 'p', 'br', 'a'] - + // List of allowed attributes const allowedAttrs = ['class', 'href', 'title'] - + // Remove disallowed tags and attributes const sanitize = (node: Node): void => { if (node.nodeType === Node.ELEMENT_NODE) { const element = node as Element - + // Check if tag is allowed if (!allowedTags.includes(element.tagName.toLowerCase())) { // Replace with text content @@ -67,14 +64,14 @@ export function sanitizeHtml(html: string): string { element.parentNode?.replaceChild(textNode, element) return } - + // Remove disallowed attributes Array.from(element.attributes).forEach((attr) => { if (!allowedAttrs.includes(attr.name.toLowerCase())) { element.removeAttribute(attr.name) } }) - + // For links, ensure they don't use javascript: protocol if (element.tagName.toLowerCase() === 'a') { const href = element.getAttribute('href') || '' @@ -83,11 +80,11 @@ export function sanitizeHtml(html: string): string { } } } - + // Recursively sanitize child nodes Array.from(node.childNodes).forEach(sanitize) } - + sanitize(temp) return temp.innerHTML } diff --git a/frontend/src/views/chat/ChatCreator.vue b/frontend/src/views/chat/ChatCreator.vue index 90d21ab6e..aab5ae298 100644 --- a/frontend/src/views/chat/ChatCreator.vue +++ b/frontend/src/views/chat/ChatCreator.vue @@ -1,5 +1,5 @@